likec4 1.37.0 → 1.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -1
- package/__app__/src/main.js +161 -197
- package/__app__/src/style.css +1 -1
- package/dist/cli/index.mjs +709 -690
- package/dist/index.d.mts +26 -10
- package/dist/index.mjs +2 -2
- package/dist/shared/{likec4.cqC6tNHO.d.mts → likec4.CRYZWScz.d.mts} +674 -530
- package/dist/shared/likec4.D6zjV21i.mjs +257 -0
- package/dist/shared/likec4.enfOs0BB.mjs +4204 -0
- package/dist/vite-plugin/index.d.mts +2 -2
- package/dist/vite-plugin/index.mjs +2 -2
- package/package.json +17 -17
- package/react/index.d.mts +2 -1
- package/react/index.mjs +39 -35
- package/dist/shared/likec4.B6V1NOky.mjs +0 -258
- package/dist/shared/likec4.BKp9_9LQ.mjs +0 -2268
package/dist/cli/index.mjs
CHANGED
|
@@ -1,110 +1,109 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{k as He,o as kh,p as
|
|
3
|
-
import{strictEqual as
|
|
4
|
-
mkdir as ct,stat as
|
|
5
|
-
import{chromium as
|
|
6
|
-
import"@likec4/core/utils";import"boxen";import"node:child_process";import"node:events";import"node:stream/promises";import"node:readline/promises";import"
|
|
7
|
-
|
|
8
|
-
return e
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
this.renderInline(i,r[r.length-1]))}),r.push({text:i.replace(/ +$/,""),span:e.span})}),r}renderInline(e,r){const n=e.match(/^ */),s=n?n[0].length:0,i=r.text,o=De.stringWidth(i.trimRight());return r.span?this.wrap?s<o?e:(r.hidden=!0,i.trimRight()+" ".repeat(s-o)+e.trimLeft()):(r.hidden=!0,i+e):e}rasterize(e){const r=[],n=this.columnWidths(e);let s;return e.forEach((i,o)=>{i.width=n[o],this.wrap?s=De.wrap(i.text,this.negatePadding(i),{hard:!0}).split(`
|
|
2
|
+
import{k as He,o as kh,p as Ot,q as Cs,t as lr,r as ca,C as ua,e as Dh,d as Wt,u as B,w as la,s as xh,v as Mh,x as at,y as fa,z as Ur,A as gt,B as qh,h as da,D as ha,c as Uh,L as Fe,P as Hh,j as pa,E as Fh,F as ma,G as nt,H as Vh,I as zh,n as Gh,J as Ct,K as fr,M as Ps,O as ga,Q as Bh,R as Wh}from"../shared/likec4.enfOs0BB.mjs";import he,{existsSync as Pt,copyFileSync as ya,readdirSync as Kh,rmSync as Is}from"node:fs";import Se,{hrtime as Yh,cwd as Ns,exit as $a,stdout as Xh,argv as Jh}from"node:process";
|
|
3
|
+
import{strictEqual as Qh,notStrictEqual as Zh}from"assert";import Ts,{resolve as Ve,dirname as js,normalize as ep,relative as tp,extname as rp,basename as np}from"path";import{statSync as _a,readdirSync as sp,readFileSync as Ls,writeFile as ip}from"fs";import va,{format as ba,inspect as op}from"util";import{fileURLToPath as ap}from"url";import me,{resolve as ge,dirname as It,join as dr,relative as yt,extname as hr,isAbsolute as ks,basename as Hr}from"node:path";import wa,{mkdtemp as Fr,writeFile as Nt,
|
|
4
|
+
mkdir as ct,stat as Ds,copyFile as cp,rm as up}from"node:fs/promises";import pr,{tmpdir as Vr}from"node:os";import{fileURLToPath as Ea}from"node:url";import xs from"@vitejs/plugin-react";import{j as Sa,e as Ra,C as lp,t as Aa,N as Kt,L as Ms,g as fp,a as dp,b as hp}from"../shared/likec4.D6zjV21i.mjs";import{build as mr,createServer as pp,preview as mp}from"vite";import gp from"node:module";import{compareNatural as yp,sortNaturalByFqn as $p,invariant as zr,hasAtLeast as qs,nonexhaustive as Oa,delay as Ca}from"@likec4/core";
|
|
5
|
+
import{chromium as Pa}from"playwright";import _p from"node:net";import{setTimeout as vp}from"node:timers/promises";import{promisify as Ie,isDeepStrictEqual as bp}from"node:util";import gr from"node:crypto";import wp from"node:assert";import{u as Ep}from"../shared/likec4.BeWJWU7_.mjs";import"tty";import"os";import"crypto";import"net";import"child_process";import"fs/promises";import"events";import"node:stream";import"http";import"http2";import"stream";import"buffer";import"string_decoder";import"node:buffer";
|
|
6
|
+
import"node:http";import"@likec4/core/types";import"@hpcc-js/wasm-graphviz";import"@likec4/core/model";import"@likec4/core/utils";import"@likec4/core/compute-view";import"boxen";import"node:child_process";import"node:events";import"node:stream/promises";import"node:readline/promises";import"../shared/likec4.B7noVoso.mjs";function Sp(...r){return Ep(Rp,r)}var Rp=r=>`${r[0]?.toUpperCase()??""}${r.slice(1)}`;let Us;function Ap(){try{return he.statSync("/.dockerenv"),!0}catch{return!1}}function Op(){
|
|
7
|
+
try{return he.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function Cp(){return Us===void 0&&(Us=Ap()||Op()),Us}let Hs;const Pp=()=>{try{return he.statSync("/run/.containerenv"),!0}catch{return!1}};function ut(){return Hs===void 0&&(Hs=Pp()||Cp()),Hs}const Gr=Object.create(null),yr=r=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(r?Gr:globalThis),$t=new Proxy(Gr,{get(r,e){return yr()[e]??Gr[e]},has(r,e){const t=yr();
|
|
8
|
+
return e in t||e in Gr},set(r,e,t){const n=yr(!0);return n[e]=t,!0},deleteProperty(r,e){if(!e)return!1;const t=yr(!0);return delete t[e],!0},ownKeys(){const r=yr(!0);return Object.keys(r)}}),Br=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",Ip=[["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\
|
|
9
|
+
_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CLOUDFLARE_WORKERS","WORKERS_CI",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["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"],
|
|
10
|
+
["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","VERCEL_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",{
|
|
11
|
+
ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function Np(){if(globalThis.process?.env)for(const r of Ip){const e=r[1]||r[0];if(globalThis.process?.env[e])return{name:r[0].toLowerCase(),...r[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}const Ia=Np();Ia.name;function Tt(r){return r?
|
|
12
|
+
r!=="false":!1}const Tp=globalThis.process?.platform||"",Na=Tt($t.CI)||Ia.ci!==!1,Ta=Tt(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY);Tt($t.DEBUG);const jp=Br==="test"||Tt($t.TEST),Lp=Br==="dev"||Br==="development",kp=Tt($t.MINIMAL)||Na||jp||!Ta,Dp=/^win/i.test(Tp);!Tt($t.NO_COLOR)&&(Tt($t.FORCE_COLOR)||(Ta||Dp)&&$t.TERM);const xp=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(xp?.split(".")[0]);const Mp=globalThis.process||Object.create(null),ja={versions:{}};
|
|
13
|
+
new Proxy(Mp,{get(r,e){if(e==="env")return $t;if(e in r)return r[e];if(e in ja)return ja[e]}});const qp=globalThis.process?.release?.name==="node",Up=!!globalThis.Bun||!!globalThis.process?.versions?.bun,Hp=!!globalThis.Deno,Fp=!!globalThis.fastly,Vp=!!globalThis.Netlify,zp=!!globalThis.EdgeRuntime,Gp=globalThis.navigator?.userAgent==="Cloudflare-Workers",Bp=[[Vp,"netlify"],[zp,"edge-light"],[Gp,"workerd"],[Fp,"fastly"],[Hp,"deno"],[Up,"bun"],[qp,"node"]];function Wp(){const r=Bp.find(e=>e[0]);if(r)
|
|
14
|
+
return{name:r[1]}}const Kp=Wp();Kp?.name;const Yp={right:tm,center:rm},Xp=0,Wr=1,Jp=2,Kr=3;class Qp{constructor(e){var t;this.width=e.width,this.wrap=(t=e.wrap)!==null&&t!==void 0?t:!0,this.rows=[]}span(...e){const t=this.div(...e);t.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 t=e.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(t),t}shouldApplyLayoutDSL(...e){
|
|
15
|
+
return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){const t=e.split(`
|
|
16
|
+
`).map(s=>s.split(" "));let n=0;return t.forEach(s=>{s.length>1&&ke.stringWidth(s[0])>n&&(n=Math.min(Math.floor(this.width*.5),ke.stringWidth(s[0])))}),t.forEach(s=>{this.div(...s.map((i,o)=>({text:i.trim(),padding:this.measurePadding(i),width:o===0&&s.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){const t=ke.stripAnsi(e);return[0,t.match(/\s*$/)[0].length,0,t.match(/^\s*/)[0].length]}toString(){const e=[];return this.
|
|
17
|
+
rows.forEach(t=>{this.rowToString(t,e)}),e.filter(t=>!t.hidden).map(t=>t.text).join(`
|
|
18
|
+
`)}rowToString(e,t){return this.rasterize(e).forEach((n,s)=>{let i="";n.forEach((o,a)=>{const{width:c}=e[a],l=this.negatePadding(e[a]);let u=o;if(l>ke.stringWidth(o)&&(u+=" ".repeat(l-ke.stringWidth(o))),e[a].align&&e[a].align!=="left"&&this.wrap){const h=Yp[e[a].align];u=h(u,l),ke.stringWidth(u)<l&&(u+=" ".repeat((c||0)-ke.stringWidth(u)-1))}const f=e[a].padding||[0,0,0,0];f[Kr]&&(i+=" ".repeat(f[Kr])),i+=La(e[a],u,"| "),i+=u,i+=La(e[a],u," |"),f[Wr]&&(i+=" ".repeat(f[Wr])),s===0&&t.length>0&&(i=
|
|
19
|
+
this.renderInline(i,t[t.length-1]))}),t.push({text:i.replace(/ +$/,""),span:e.span})}),t}renderInline(e,t){const n=e.match(/^ */),s=n?n[0].length:0,i=t.text,o=ke.stringWidth(i.trimRight());return t.span?this.wrap?s<o?e:(t.hidden=!0,i.trimRight()+" ".repeat(s-o)+e.trimLeft()):(t.hidden=!0,i+e):e}rasterize(e){const t=[],n=this.columnWidths(e);let s;return e.forEach((i,o)=>{i.width=n[o],this.wrap?s=ke.wrap(i.text,this.negatePadding(i),{hard:!0}).split(`
|
|
21
20
|
`):s=i.text.split(`
|
|
22
|
-
`),i.border&&(s.unshift("."+"-".repeat(this.negatePadding(i)+2)+"."),s.push("'"+"-".repeat(this.negatePadding(i)+2)+"'")),i.padding&&(s.unshift(...new Array(i.padding[
|
|
23
|
-
o=>o.width||
|
|
24
|
-
|
|
21
|
+
`),i.border&&(s.unshift("."+"-".repeat(this.negatePadding(i)+2)+"."),s.push("'"+"-".repeat(this.negatePadding(i)+2)+"'")),i.padding&&(s.unshift(...new Array(i.padding[Xp]||0).fill("")),s.push(...new Array(i.padding[Jp]||0).fill(""))),s.forEach((a,c)=>{t[c]||t.push([]);const l=t[c];for(let u=0;u<o;u++)l[u]===void 0&&l.push("");l.push(a)})}),t}negatePadding(e){let t=e.width||0;return e.padding&&(t-=(e.padding[Kr]||0)+(e.padding[Wr]||0)),e.border&&(t-=4),t}columnWidths(e){if(!this.wrap)return e.map(
|
|
22
|
+
o=>o.width||ke.stringWidth(o.text));let t=e.length,n=this.width;const s=e.map(o=>{if(o.width)return t--,n-=o.width,o.width}),i=t?Math.floor(n/t):0;return s.map((o,a)=>o===void 0?Math.max(i,Zp(e[a])):o)}}function La(r,e,t){return r.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?t:" ":""}function Zp(r){const e=r.padding||[],t=1+(e[Kr]||0)+(e[Wr]||0);return r.border?t+4:t}function em(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function tm(r,e){
|
|
23
|
+
r=r.trim();const t=ke.stringWidth(r);return t<e?" ".repeat(e-t)+r:r}function rm(r,e){r=r.trim();const t=ke.stringWidth(r);return t>=e?r:" ".repeat(e-t>>1)+r}let ke;function nm(r,e){return ke=e,new Qp({width:r?.width||em(),wrap:r?.wrap})}const ka=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function Da(r){return r.replace(ka,"")}function sm(r,e){const[t,n]=r.match(ka)||["",""];r=Da(r);let s="";for(let i=0;i<r.length;i++)i!==0&&i%e===0&&(s+=
|
|
25
24
|
`
|
|
26
|
-
`),s+=
|
|
27
|
-
o=o.toUpperCase()),i!==0&&(o==="-"||o==="_")?n=!0:o!=="-"&&o!=="_"&&(
|
|
28
|
-
|
|
29
|
-
envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},
|
|
25
|
+
`),s+=r.charAt(i);return t&&n&&(s=`${t}${s}${n}`),s}function im(r){return nm(r,{stringWidth:e=>[...e].length,stripAnsi:Da,wrap:sm})}function om(r,e){let t=Ve(".",r),n;for(_a(t).isDirectory()||(t=js(t));;){if(n=e(t,sp(t)),n)return Ve(t,n);if(t=js(n=t),n===t)break}}function $r(r){if(r!==r.toLowerCase()&&r!==r.toUpperCase()||(r=r.toLowerCase()),r.indexOf("-")===-1&&r.indexOf("_")===-1)return r;{let t="",n=!1;const s=r.match(/^-+/);for(let i=s?s[0].length:0;i<r.length;i++){let o=r.charAt(i);n&&(n=!1,
|
|
26
|
+
o=o.toUpperCase()),i!==0&&(o==="-"||o==="_")?n=!0:o!=="-"&&o!=="_"&&(t+=o)}return t}}function xa(r,e){const t=r.toLowerCase();e=e||"-";let n="";for(let s=0;s<r.length;s++){const i=t.charAt(s),o=r.charAt(s);i!==o&&s>0?n+=`${e}${t.charAt(s)}`:n+=o}return n}function Ma(r){return r==null?!1:typeof r=="number"||/^0x[0-9a-f]+$/i.test(r)?!0:/^0[^.]/.test(r)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(r)}function am(r){if(Array.isArray(r))return r.map(o=>typeof o!="string"?o+"":o);r=r.trim();let e=0,
|
|
27
|
+
t=null,n=null,s=null;const i=[];for(let o=0;o<r.length;o++){if(t=n,n=r.charAt(o),n===" "&&!s){t!==" "&&e++;continue}n===s?s=null:(n==="'"||n==='"')&&!s&&(s=n),i[e]||(i[e]=""),i[e]+=n}return i}var Ye;(function(r){r.BOOLEAN="boolean",r.STRING="string",r.NUMBER="number",r.ARRAY="array"})(Ye||(Ye={}));let lt;class cm{constructor(e){lt=e}parse(e,t){const n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,
|
|
28
|
+
envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},t),s=am(e),i=typeof e=="string",o=um(Object.assign(Object.create(null),n.alias)),a=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"se\
|
|
30
29
|
t-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),c=Object.assign(Object.create(null),n.default),l=n.configObjects||[],u=n.envPrefix,f=a["populate--"],h=f?"--":"_",$=Object.create(null),b=Object.create(null),y=n.__||lt.format,d={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),
|
|
31
|
-
configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},g=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,p=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(P){const T=typeof P=="object"?P.key:P,ee=Object.keys(P).map(function(
|
|
30
|
+
configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},g=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,p=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(P){const T=typeof P=="object"?P.key:P,ee=Object.keys(P).map(function(K){return{boolean:"bools",string:"strings",number:"numbers"}[K]}).filter(Boolean).pop();ee&&(d[ee][T]=!0),d.arrays[T]=!0,d.keys.push(T)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(P){
|
|
32
31
|
d.bools[P]=!0,d.keys.push(P)}),[].concat(n.string||[]).filter(Boolean).forEach(function(P){d.strings[P]=!0,d.keys.push(P)}),[].concat(n.number||[]).filter(Boolean).forEach(function(P){d.numbers[P]=!0,d.keys.push(P)}),[].concat(n.count||[]).filter(Boolean).forEach(function(P){d.counts[P]=!0,d.keys.push(P)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(P){d.normalize[P]=!0,d.keys.push(P)}),typeof n.narg=="object"&&Object.entries(n.narg).forEach(([P,T])=>{typeof T=="number"&&(d.nargs[P]=
|
|
33
32
|
T,d.keys.push(P))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([P,T])=>{typeof T=="function"&&(d.coercions[P]=T,d.keys.push(P))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(P){d.configs[P]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([P,T])=>{(typeof T=="boolean"||typeof T=="function")&&(d.configs[P]=T)})),x(n.key,o,n.default,d.arrays),Object.keys(c).forEach(function(P){(d.aliases[P]||
|
|
34
|
-
[]).forEach(function(T){c[T]=c[P]})});let m=null;ne();let _=[];const v=Object.assign(Object.create(null),{_:[]}),w={};for(let P=0;P<s.length;P++){const T=s[P],ee=T.replace(/^-{3,}/,"---");let
|
|
35
|
-
P,z[1],s,z[2]):
|
|
36
|
-
match(/^-.\..+=/))z=T.match(/^-([^=]+)=([\s\S]*)$/),z!==null&&Array.isArray(z)&&z.length>=3&&
|
|
37
|
-
P=F(P,N,s,le):E(N,d.nargs)!==!1?P=I(P,N,s,le):
|
|
38
|
-
(
|
|
39
|
-
"--"&&P.includes("-")).forEach(P=>{delete v[P]}),a["strip-aliased"]&&[].concat(...Object.keys(o).map(P=>o[P])).forEach(P=>{a["camel-case-expansion"]&&P.includes("-")&&delete v[P.split(".").map(T
|
|
40
|
-
rgs-eats-options"])ee.length-(P+1)+z<te&&(m=Error(y("Not enough arguments following: %s",T))),z=te;else{for(N=P+1;N<ee.length&&(!ee[N].match(/^-[^0-9]/)||ee[N].match(g)||Z(ee[N]));N++)z++;z<te&&(m=Error(y("Not enough arguments following: %s",T)))}let re=Math.min(z,te);for(!Q(
|
|
41
|
-
test(te)&&!Z(te)){if(c[T]!==void 0){const re=c[T];N=Array.isArray(re)?re:[re]}}else{Q(
|
|
42
|
-
map(function(z){return
|
|
43
|
-
set(re){T=typeof re=="string"?lt.normalize(re):re}})})}function
|
|
44
|
-
return!a["parse-positional-numbers"]&&P==="_"||!E(P,d.strings)&&!E(P,d.bools)&&!Array.isArray(T)&&(
|
|
45
|
-
N=lt.require(te);U(N)}catch(N){N.name==="PermissionDenied"?m=N:P[ee]&&(m=Error(y("Invalid JSON config file: %s",
|
|
46
|
-
function(N){if(ee===""||N.lastIndexOf(ee,0)===0){const te=N.split("__").map(function(z,re){return re===0&&(z=z.substring(ee.length))
|
|
47
|
-
typeof P[T]>"u"&&(P[T]=void 0)}),P}function H(P,T,ee,
|
|
48
|
-
le=
|
|
49
|
-
rays"]?
|
|
50
|
-
push(N),$[N]=!0)}}),d.aliases[ee].concat(ee).forEach(function(
|
|
51
|
-
T.map(
|
|
52
|
-
unknown-options-as-args"]&&ie(P)}function ie(P){return P=P.replace(/^-{3,}/,"--"),P.match(g)||X(P)?!1:!C(P,/^-+([^=]+?)=[\s\S]*$/,p,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function oe(P){return!E(P,d.bools)&&!E(P,d.counts)&&`${P}`in c?c[P]:L(q(P))}function L(P){return{[
|
|
53
|
-
(T=
|
|
54
|
-
keys(
|
|
55
|
-
"string"&&(
|
|
56
|
-
on of ${
|
|
57
|
-
|
|
58
|
-
let
|
|
59
|
-
function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][
|
|
60
|
-
cache[this.locale][
|
|
61
|
-
e,
|
|
62
|
-
shift(),e.writeQueue.length>0&&e._processWriteQueue(),i(c)})}_readLocaleFile(){let e={};const
|
|
63
|
-
e,"./",
|
|
64
|
-
0,
|
|
65
|
-
"u"?process.stdout.columns:null},readFileSync:Ls,require:()=>{throw new Oe(
|
|
66
|
-
s=
|
|
67
|
-
|
|
68
|
-
cmd,s),s+=1}),i.optional.forEach(f=>{if(c.length===0)return;const h=c.shift(),$=
|
|
69
|
-
ion> [boolean] [boolean] [boolean]",[e,
|
|
70
|
-
this.globalMiddleware.filter(s=>{const i=[...n[
|
|
71
|
-
if(i.applyBeforeValidation!==n)return s;if(i.mutates){if(i.applied)return s;i.applied=!0}if(Ae(s))return s.then(o=>Promise.all([o,i(o,e)])).then(([o,a])=>Object.assign(o,a));{const o=i(s,e);return Ae(o)?o.then(a=>Object.assign(s,a)):Object.assign(s,o)}},
|
|
72
|
-
n;e<
|
|
73
|
-
has(a))return l;this.requireCache.add(a),this.addHandler(l)}return l},this.shim.requireDirectory({require:
|
|
74
|
-
return}else if(
|
|
75
|
-
demanded,optional:l.optional},u&&(this.defaultCommand=this.handlers[l.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,
|
|
76
|
-
u,a,
|
|
77
|
-
u=n.getInternalMethods().reset(s),Object.keys(
|
|
78
|
-
{aliases:n.parsed.aliases,innerArgv:a}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,
|
|
79
|
-
i,c,o.parsed.error,e);n=
|
|
80
|
-
return e||(s.commands.pop(),s.fullCommands.pop()),n}applyMiddlewareAndGetResult(e,
|
|
81
|
-
0),o=e.optional.slice(0),a={};for(this.validation.positionalCount(i.length,
|
|
82
|
-
alias:{},demand:{}},n=
|
|
83
|
-
{};const o=[];if(Object.keys(
|
|
84
|
-
(
|
|
85
|
-
prototype.hasOwnProperty.call(s,
|
|
86
|
-
n=>{e.option(n,
|
|
87
|
-
const e=this.frozens.pop();
|
|
88
|
-
object"}function
|
|
89
|
-
const[
|
|
90
|
-
1);if(
|
|
91
|
-
"object"?Object.keys(M).forEach(
|
|
92
|
-
keys($)),J=J.concat(Object.keys(j)),J=J.concat(Object.keys(
|
|
93
|
-
`:C=`${M} [${
|
|
94
|
-
`,H.div(`${C}`)}}if(h.length>1||h.length===1&&!h[0][2]){H.div(
|
|
95
|
-
ie[3].length&&L.push(`[${
|
|
33
|
+
[]).forEach(function(T){c[T]=c[P]})});let m=null;ne();let _=[];const v=Object.assign(Object.create(null),{_:[]}),w={};for(let P=0;P<s.length;P++){const T=s[P],ee=T.replace(/^-{3,}/,"---");let K,N,te,z,re,le;if(T!=="--"&&/^-/.test(T)&&Z(T))S(T);else if(ee.match(/^---+(=|$)/)){S(T);continue}else if(T.match(/^--.+=/)||!a["short-option-groups"]&&T.match(/^-.+=/))z=T.match(/^--?([^=]+)=([\s\S]*)$/),z!==null&&Array.isArray(z)&&z.length>=3&&(E(z[1],d.arrays)?P=F(P,z[1],s,z[2]):E(z[1],d.nargs)!==!1?P=I(
|
|
34
|
+
P,z[1],s,z[2]):W(z[1],z[2],!0));else if(T.match(p)&&a["boolean-negation"])z=T.match(p),z!==null&&Array.isArray(z)&&z.length>=2&&(N=z[1],W(N,E(N,d.arrays)?[!1]:!1));else if(T.match(/^--.+/)||!a["short-option-groups"]&&T.match(/^-[^-]+/))z=T.match(/^--?(.+)/),z!==null&&Array.isArray(z)&&z.length>=2&&(N=z[1],E(N,d.arrays)?P=F(P,N,s):E(N,d.nargs)!==!1?P=I(P,N,s):(re=s[P+1],re!==void 0&&(!re.match(/^-/)||re.match(g))&&!E(N,d.bools)&&!E(N,d.counts)||/^(true|false)$/.test(re)?(W(N,re),P++):W(N,oe(N))));else if(T.
|
|
35
|
+
match(/^-.\..+=/))z=T.match(/^-([^=]+)=([\s\S]*)$/),z!==null&&Array.isArray(z)&&z.length>=3&&W(z[1],z[2]);else if(T.match(/^-.\..+/)&&!T.match(g))re=s[P+1],z=T.match(/^-(.\..+)/),z!==null&&Array.isArray(z)&&z.length>=2&&(N=z[1],re!==void 0&&!re.match(/^-/)&&!E(N,d.bools)&&!E(N,d.counts)?(W(N,re),P++):W(N,oe(N)));else if(T.match(/^-[^-]+/)&&!T.match(g)){te=T.slice(1,-1).split(""),K=!1;for(let _e=0;_e<te.length;_e++){if(re=T.slice(_e+2),te[_e+1]&&te[_e+1]==="="){le=T.slice(_e+3),N=te[_e],E(N,d.arrays)?
|
|
36
|
+
P=F(P,N,s,le):E(N,d.nargs)!==!1?P=I(P,N,s,le):W(N,le),K=!0;break}if(re==="-"){W(te[_e],re);continue}if(/[A-Za-z]/.test(te[_e])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(re)&&E(re,d.bools)===!1){W(te[_e],re),K=!0;break}if(te[_e+1]&&te[_e+1].match(/\W/)){W(te[_e],re),K=!0;break}else W(te[_e],oe(te[_e]))}N=T.slice(-1)[0],!K&&N!=="-"&&(E(N,d.arrays)?P=F(P,N,s):E(N,d.nargs)!==!1?P=I(P,N,s):(re=s[P+1],re!==void 0&&(!/^(-|--)[^-]/.test(re)||re.match(g))&&!E(N,d.bools)&&!E(N,d.counts)||/^(true|false)$/.test(re)?
|
|
37
|
+
(W(N,re),P++):W(N,oe(N))))}else if(T.match(/^-[0-9]$/)&&T.match(g)&&E(T.slice(1),d.bools))N=T.slice(1),W(N,oe(N));else if(T==="--"){_=s.slice(P+1);break}else if(a["halt-at-non-option"]){_=s.slice(P);break}else S(T)}G(v,!0),G(v,!1),D(v),Y(),H(v,d.aliases,c,!0),J(v),a["set-placeholder-key"]&&se(v),Object.keys(d.counts).forEach(function(P){A(v,P.split("."))||W(P,0)}),f&&_.length&&(v[h]=[]),_.forEach(function(P){v[h].push(P)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(v).filter(P=>P!==
|
|
38
|
+
"--"&&P.includes("-")).forEach(P=>{delete v[P]}),a["strip-aliased"]&&[].concat(...Object.keys(o).map(P=>o[P])).forEach(P=>{a["camel-case-expansion"]&&P.includes("-")&&delete v[P.split(".").map(T=>$r(T)).join(".")],delete v[P]});function S(P){const T=j("_",P);(typeof T=="string"||typeof T=="number")&&v._.push(T)}function I(P,T,ee,K){let N,te=E(T,d.nargs);if(te=typeof te!="number"||isNaN(te)?1:te,te===0)return Q(K)||(m=Error(y("Argument unexpected for: %s",T))),W(T,oe(T)),P;let z=Q(K)?0:1;if(a["na\
|
|
39
|
+
rgs-eats-options"])ee.length-(P+1)+z<te&&(m=Error(y("Not enough arguments following: %s",T))),z=te;else{for(N=P+1;N<ee.length&&(!ee[N].match(/^-[^0-9]/)||ee[N].match(g)||Z(ee[N]));N++)z++;z<te&&(m=Error(y("Not enough arguments following: %s",T)))}let re=Math.min(z,te);for(!Q(K)&&re>0&&(W(T,K),re--),N=P+1;N<re+P+1;N++)W(T,ee[N]);return P+re}function F(P,T,ee,K){let N=[],te=K||ee[P+1];const z=E(T,d.nargs);if(E(T,d.bools)&&!/^(true|false)$/.test(te))N.push(!0);else if(Q(te)||Q(K)&&/^-/.test(te)&&!g.
|
|
40
|
+
test(te)&&!Z(te)){if(c[T]!==void 0){const re=c[T];N=Array.isArray(re)?re:[re]}}else{Q(K)||N.push(M(T,K,!0));for(let re=P+1;re<ee.length&&!(!a["greedy-arrays"]&&N.length>0||z&&typeof z=="number"&&N.length>=z||(te=ee[re],/^-/.test(te)&&!g.test(te)&&!Z(te)));re++)P=re,N.push(M(T,te,i))}return typeof z=="number"&&(z&&N.length<z||isNaN(z)&&N.length===0)&&(m=Error(y("Not enough arguments following: %s",T))),W(T,N),P}function W(P,T,ee=i){if(/-/.test(P)&&a["camel-case-expansion"]){const te=P.split(".").
|
|
41
|
+
map(function(z){return $r(z)}).join(".");k(P,te)}const K=M(P,T,ee),N=P.split(".");V(v,N,K),d.aliases[P]&&d.aliases[P].forEach(function(te){const z=te.split(".");V(v,z,K)}),N.length>1&&a["dot-notation"]&&(d.aliases[N[0]]||[]).forEach(function(te){let z=te.split(".");const re=[].concat(N);re.shift(),z=z.concat(re),(d.aliases[P]||[]).includes(z.join("."))||V(v,z,K)}),E(P,d.normalize)&&!E(P,d.arrays)&&[P].concat(d.aliases[P]||[]).forEach(function(z){Object.defineProperty(w,z,{enumerable:!0,get(){return T},
|
|
42
|
+
set(re){T=typeof re=="string"?lt.normalize(re):re}})})}function k(P,T){d.aliases[P]&&d.aliases[P].length||(d.aliases[P]=[T],$[T]=!0),d.aliases[T]&&d.aliases[T].length||k(T,P)}function M(P,T,ee){ee&&(T=lm(T)),(E(P,d.bools)||E(P,d.counts))&&typeof T=="string"&&(T=T==="true");let K=Array.isArray(T)?T.map(function(N){return j(P,N)}):j(P,T);return E(P,d.counts)&&(Q(K)||typeof K=="boolean")&&(K=Fs()),E(P,d.normalize)&&E(P,d.arrays)&&(Array.isArray(T)?K=T.map(N=>lt.normalize(N)):K=lt.normalize(T)),K}function j(P,T){
|
|
43
|
+
return!a["parse-positional-numbers"]&&P==="_"||!E(P,d.strings)&&!E(P,d.bools)&&!Array.isArray(T)&&(Ma(T)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${T}`)))||!Q(T)&&E(P,d.numbers))&&(T=Number(T)),T}function D(P){const T=Object.create(null);H(T,d.aliases,c),Object.keys(d.configs).forEach(function(ee){const K=P[ee]||T[ee];if(K)try{let N=null;const te=lt.resolve(lt.cwd(),K),z=d.configs[ee];if(typeof z=="function"){try{N=z(te)}catch(re){N=re}if(N instanceof Error){m=N;return}}else
|
|
44
|
+
N=lt.require(te);U(N)}catch(N){N.name==="PermissionDenied"?m=N:P[ee]&&(m=Error(y("Invalid JSON config file: %s",K)))}})}function U(P,T){Object.keys(P).forEach(function(ee){const K=P[ee],N=T?T+"."+ee:ee;typeof K=="object"&&K!==null&&!Array.isArray(K)&&a["dot-notation"]?U(K,N):(!A(v,N.split("."))||E(N,d.arrays)&&a["combine-arrays"])&&W(N,K)})}function Y(){typeof l<"u"&&l.forEach(function(P){U(P)})}function G(P,T){if(typeof u>"u")return;const ee=typeof u=="string"?u:"",K=lt.env();Object.keys(K).forEach(
|
|
45
|
+
function(N){if(ee===""||N.lastIndexOf(ee,0)===0){const te=N.split("__").map(function(z,re){return re===0&&(z=z.substring(ee.length)),$r(z)});(T&&d.configs[te.join(".")]||!T)&&!A(P,te)&&W(te.join("."),K[N])}})}function J(P){let T;const ee=new Set;Object.keys(P).forEach(function(K){if(!ee.has(K)&&(T=E(K,d.coercions),typeof T=="function"))try{const N=j(K,T(P[K]));[].concat(d.aliases[K]||[],K).forEach(te=>{ee.add(te),P[te]=N})}catch(N){m=N}})}function se(P){return d.keys.forEach(T=>{~T.indexOf(".")||
|
|
46
|
+
typeof P[T]>"u"&&(P[T]=void 0)}),P}function H(P,T,ee,K=!1){Object.keys(ee).forEach(function(N){A(P,N.split("."))||(V(P,N.split("."),ee[N]),K&&(b[N]=!0),(T[N]||[]).forEach(function(te){A(P,te.split("."))||V(P,te.split("."),ee[N])}))})}function A(P,T){let ee=P;a["dot-notation"]||(T=[T.join(".")]),T.slice(0,-1).forEach(function(N){ee=ee[N]||{}});const K=T[T.length-1];return typeof ee!="object"?!1:K in ee}function V(P,T,ee){let K=P;a["dot-notation"]||(T=[T.join(".")]),T.slice(0,-1).forEach(function(le){
|
|
47
|
+
le=qa(le),typeof K=="object"&&K[le]===void 0&&(K[le]={}),typeof K[le]!="object"||Array.isArray(K[le])?(Array.isArray(K[le])?K[le].push({}):K[le]=[K[le],{}],K=K[le][K[le].length-1]):K=K[le]});const N=qa(T[T.length-1]),te=E(T.join("."),d.arrays),z=Array.isArray(ee);let re=a["duplicate-arguments-array"];!re&&E(N,d.nargs)&&(re=!0,(!Q(K[N])&&d.nargs[N]===1||Array.isArray(K[N])&&K[N].length===d.nargs[N])&&(K[N]=void 0)),ee===Fs()?K[N]=Fs(K[N]):Array.isArray(K[N])?re&&te&&z?K[N]=a["flatten-duplicate-ar\
|
|
48
|
+
rays"]?K[N].concat(ee):(Array.isArray(K[N][0])?K[N]:[K[N]]).concat([ee]):!re&&!!te==!!z?K[N]=ee:K[N]=K[N].concat([ee]):K[N]===void 0&&te?K[N]=z?ee:[ee]:re&&!(K[N]===void 0||E(N,d.counts)||E(N,d.bools))?K[N]=[K[N],ee]:K[N]=ee}function x(...P){P.forEach(function(T){Object.keys(T||{}).forEach(function(ee){d.aliases[ee]||(d.aliases[ee]=[].concat(o[ee]||[]),d.aliases[ee].concat(ee).forEach(function(K){if(/-/.test(K)&&a["camel-case-expansion"]){const N=$r(K);N!==ee&&d.aliases[ee].indexOf(N)===-1&&(d.aliases[ee].
|
|
49
|
+
push(N),$[N]=!0)}}),d.aliases[ee].concat(ee).forEach(function(K){if(K.length>1&&/[A-Z]/.test(K)&&a["camel-case-expansion"]){const N=xa(K,"-");N!==ee&&d.aliases[ee].indexOf(N)===-1&&(d.aliases[ee].push(N),$[N]=!0)}}),d.aliases[ee].forEach(function(K){d.aliases[K]=[ee].concat(d.aliases[ee].filter(function(N){return K!==N}))}))})})}function E(P,T){const ee=[].concat(d.aliases[P]||[],P),K=Object.keys(T),N=ee.find(te=>K.includes(te));return N?T[N]:!1}function R(P){const T=Object.keys(d);return[].concat(
|
|
50
|
+
T.map(K=>d[K])).some(function(K){return Array.isArray(K)?K.includes(P):K[P]})}function C(P,...T){return[].concat(...T).some(function(K){const N=P.match(K);return N&&R(N[1])})}function X(P){if(P.match(g)||!P.match(/^-[^-]+/))return!1;let T=!0,ee;const K=P.slice(1).split("");for(let N=0;N<K.length;N++){if(ee=P.slice(N+2),!R(K[N])){T=!1;break}if(K[N+1]&&K[N+1]==="="||ee==="-"||/[A-Za-z]/.test(K[N])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(ee)||K[N+1]&&K[N+1].match(/\W/))break}return T}function Z(P){return a["\
|
|
51
|
+
unknown-options-as-args"]&&ie(P)}function ie(P){return P=P.replace(/^-{3,}/,"--"),P.match(g)||X(P)?!1:!C(P,/^-+([^=]+?)=[\s\S]*$/,p,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function oe(P){return!E(P,d.bools)&&!E(P,d.counts)&&`${P}`in c?c[P]:L(q(P))}function L(P){return{[Ye.BOOLEAN]:!0,[Ye.STRING]:"",[Ye.NUMBER]:void 0,[Ye.ARRAY]:[]}[P]}function q(P){let T=Ye.BOOLEAN;return E(P,d.strings)?T=Ye.STRING:E(P,d.numbers)?T=Ye.NUMBER:E(P,d.bools)?T=Ye.BOOLEAN:E(P,d.arrays)&&
|
|
52
|
+
(T=Ye.ARRAY),T}function Q(P){return P===void 0}function ne(){Object.keys(d.counts).find(P=>E(P,d.arrays)?(m=Error(y("Invalid configuration: %s, opts.count excludes opts.array.",P)),!0):E(P,d.nargs)?(m=Error(y("Invalid configuration: %s, opts.count excludes opts.narg.",P)),!0):!1)}return{aliases:Object.assign({},d.aliases),argv:Object.assign(w,v),configuration:a,defaulted:Object.assign({},b),error:m,newAliases:Object.assign({},$)}}}function um(r){const e=[],t=Object.create(null);let n=!0;for(Object.
|
|
53
|
+
keys(r).forEach(function(s){e.push([].concat(r[s],s))});n;){n=!1;for(let s=0;s<e.length;s++)for(let i=s+1;i<e.length;i++)if(e[s].filter(function(a){return e[i].indexOf(a)!==-1}).length){e[s]=e[s].concat(e[i]),e.splice(i,1),n=!0;break}}return e.forEach(function(s){s=s.filter(function(o,a,c){return c.indexOf(o)===a});const i=s.pop();i!==void 0&&typeof i=="string"&&(t[i]=s)}),t}function Fs(r){return r!==void 0?r+1:1}function qa(r){return r==="__proto__"?"___proto___":r}function lm(r){return typeof r==
|
|
54
|
+
"string"&&(r[0]==="'"||r[0]==='"')&&r[r.length-1]===r[0]?r.substring(1,r.length-1):r}var Vs,zs,Gs;const Ua=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,Ha=(zs=(Vs=process==null?void 0:process.versions)===null||Vs===void 0?void 0:Vs.node)!==null&&zs!==void 0?zs:(Gs=process==null?void 0:process.version)===null||Gs===void 0?void 0:Gs.slice(1);if(Ha&&Number(Ha.match(/^([^.]+)/)[1])<Ua)throw Error(`yargs parser supports a minimum Node.js versi\
|
|
55
|
+
on of ${Ua}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);const fm=process?process.env:{},Fa=new cm({cwd:process.cwd,env:()=>fm,format:ba,normalize:ep,resolve:Ve,require:r=>{if(typeof require<"u")return require(r);if(r.match(/\.json$/))return JSON.parse(Ls(r,"utf8"));throw Error("only .json config files are supported in ESM")}}),_r=function(e,t){return Fa.parse(e.slice(),t).argv};_r.detailed=function(r,e){return Fa.parse(r.slice(),e)},_r.camelCase=
|
|
56
|
+
$r,_r.decamelize=xa,_r.looksLikeNumber=Ma;function Va(){return dm()?0:1}function dm(){return hm()&&!process.defaultApp}function hm(){return!!process.versions.electron}function pm(r){return r.slice(Va()+1)}function mm(){return process.argv[Va()]}class Oe extends Error{constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,Oe)}}const gm={fs:{readFileSync:Ls,writeFile:ip},format:ba,resolve:Ve,exists:r=>{try{return _a(r).isFile()}catch{return!1}}};
|
|
57
|
+
let Xe;class ym{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 t=e.shift();let n=function(){};return typeof e[e.length-1]=="function"&&(n=e.pop()),n=n||
|
|
58
|
+
function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]=t,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),Xe.format.apply(Xe.format,[this.cache[this.locale][t]||t].concat(e))}__n(){const e=Array.prototype.slice.call(arguments),t=e.shift(),n=e.shift(),s=e.shift();let i=function(){};typeof e[e.length-1]=="function"&&(i=e.pop()),this.cache[this.locale]||this._readLocaleFile();let o=s===1?t:n;this.
|
|
59
|
+
cache[this.locale][t]&&(o=this.cache[this.locale][t][s===1?"one":"other"]),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]={one:t,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:i})):i();const a=[o];return~o.indexOf("%d")&&a.push(s),Xe.format.apply(Xe.format,a.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(const t in e)Object.prototype.hasOwnProperty.call(
|
|
60
|
+
e,t)&&(this.cache[this.locale][t]=e[t])}_taggedLiteral(e,...t){let n="";return e.forEach(function(s,i){const o=t[i+1];n+=s,typeof o<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(t,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){const e=this,t=this.writeQueue[0],n=t.directory,s=t.locale,i=t.cb,o=this._resolveLocaleFile(n,s),a=JSON.stringify(this.cache[s],null,2);Xe.fs.writeFile(o,a,"utf-8",function(c){e.writeQueue.
|
|
61
|
+
shift(),e.writeQueue.length>0&&e._processWriteQueue(),i(c)})}_readLocaleFile(){let e={};const t=this._resolveLocaleFile(this.directory,this.locale);try{Xe.fs.readFileSync&&(e=JSON.parse(Xe.fs.readFileSync(t,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+t),n.code==="ENOENT")e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,t){let n=Xe.resolve(e,"./",t+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~t.lastIndexOf("_")){const s=Xe.resolve(
|
|
62
|
+
e,"./",t.split("_")[0]+".json");this._fileExistsSync(s)&&(n=s)}return n}_fileExistsSync(e){return Xe.exists(e)}}function $m(r,e){Xe=e;const t=new ym(r);return{__:t.__.bind(t),__n:t.__n.bind(t),setLocale:t.setLocale.bind(t),getLocale:t.getLocale.bind(t),updateLocale:t.updateLocale.bind(t),locale:t.locale}}const _m=r=>$m(r,gm),vm="require is not supported by ESM",za="loading a directory of commands is not supported yet for ESM";let vr;try{vr=ap(import.meta.url)}catch{vr=process.cwd()}const bm=vr.substring(
|
|
63
|
+
0,vr.lastIndexOf("node_modules")),wm={assert:{notStrictEqual:Zh,strictEqual:Qh},cliui:im,findUp:om,getEnv:r=>process.env[r],inspect:op,getCallerFile:()=>{throw new Oe(za)},getProcessArgvBin:mm,mainFilename:bm||process.cwd(),Parser:_r,path:{basename:np,dirname:js,extname:rp,relative:tp,resolve:Ve},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(r,e)=>process.emitWarning(r,e),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<
|
|
64
|
+
"u"?process.stdout.columns:null},readFileSync:Ls,require:()=>{throw new Oe(vm)},requireDirectory:()=>{throw new Oe(za)},stringWidth:r=>[...r].length,y18n:_m({directory:Ve(vr,"../../../locales"),updateFiles:!1})};function Je(r,e,t,n){t.assert.notStrictEqual(r,e,n)}function Ga(r,e){e.assert.strictEqual(typeof r,"string")}function Yr(r){return Object.keys(r)}function Ae(r){return!!r&&!!r.then&&typeof r.then=="function"}function br(r){const t=r.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,
|
|
65
|
+
s=t.shift();if(!s)throw new Error(`No command found in: ${r}`);const i={cmd:s.replace(n,""),demanded:[],optional:[]};return t.forEach((o,a)=>{let c=!1;o=o.replace(/\s/g,""),/\.+[\]>]/.test(o)&&a===t.length-1&&(c=!0),/^\[/.test(o)?i.optional.push({cmd:o.replace(n,"").split("|"),variadic:c}):i.demanded.push({cmd:o.replace(n,"").split("|"),variadic:c})}),i}const Em=["first","second","third","fourth","fifth","sixth"];function ce(r,e,t){function n(){return typeof r=="object"?[{demanded:[],optional:[]},
|
|
66
|
+
r,e]:[br(`cmd ${r}`),e,t]}try{let s=0;const[i,o,a]=n(),c=[].slice.call(o);for(;c.length&&c[c.length-1]===void 0;)c.pop();const l=a||c.length;if(l<i.demanded.length)throw new Oe(`Not enough arguments provided. Expected ${i.demanded.length} but received ${c.length}.`);const u=i.demanded.length+i.optional.length;if(l>u)throw new Oe(`Too many arguments provided. Expected max ${u} but received ${l}.`);i.demanded.forEach(f=>{const h=c.shift(),$=Ba(h);f.cmd.filter(y=>y===$||y==="*").length===0&&Wa($,f.
|
|
67
|
+
cmd,s),s+=1}),i.optional.forEach(f=>{if(c.length===0)return;const h=c.shift(),$=Ba(h);f.cmd.filter(y=>y===$||y==="*").length===0&&Wa($,f.cmd,s),s+=1})}catch(s){console.warn(s.stack)}}function Ba(r){return Array.isArray(r)?"array":r===null?"null":typeof r}function Wa(r,e,t){throw new Oe(`Invalid ${Em[t]||"manyith"} argument. Expected ${e.join(" or ")} but received ${r}.`)}class Sm{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,t,n=!0,s=!1){if(ce("<array|funct\
|
|
68
|
+
ion> [boolean] [boolean] [boolean]",[e,t,n],arguments.length),Array.isArray(e)){for(let i=0;i<e.length;i++){if(typeof e[i]!="function")throw Error("middleware must be a function");const o=e[i];o.applyBeforeValidation=t,o.global=n}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e=="function"){const i=e;i.applyBeforeValidation=t,i.global=n,i.mutates=s,this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,t){const n=this.yargs.getAliases();return this.globalMiddleware=
|
|
69
|
+
this.globalMiddleware.filter(s=>{const i=[...n[t]||[],t];return s.option?!i.includes(s.option):!0}),e.option=t,this.addMiddleware(e,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}}function Rm(r){return r?r.map(e=>(e.applyBeforeValidation=!1,e)):[]}function wr(r,e,t,n){return t.reduce((s,i)=>{
|
|
70
|
+
if(i.applyBeforeValidation!==n)return s;if(i.mutates){if(i.applied)return s;i.applied=!0}if(Ae(s))return s.then(o=>Promise.all([o,i(o,e)])).then(([o,a])=>Object.assign(o,a));{const o=i(s,e);return Ae(o)?o.then(a=>Object.assign(s,a)):Object.assign(s,o)}},r)}function Er(r,e,t=n=>{throw n}){try{const n=Am(r)?r():r;return Ae(n)?n.then(s=>e(s)):e(n)}catch(n){return t(n)}}function Am(r){return typeof r=="function"}function Om(r){if(typeof require>"u")return null;for(let e=0,t=Object.keys(require.cache),
|
|
71
|
+
n;e<t.length;e++)if(n=require.cache[t[e]],n.exports===r)return n;return null}const Yt=/(^\*)|(^\$0)/;class Cm{constructor(e,t,n,s){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=s,this.usage=e,this.globalMiddleware=n,this.validation=t}addDirectory(e,t,n,s){s=s||{},typeof s.recurse!="boolean"&&(s.recurse=!1),Array.isArray(s.extensions)||(s.extensions=["js"]);const i=typeof s.visit=="function"?s.visit:o=>o;s.visit=(o,a,c)=>{const l=i(o,a,c);if(l){if(this.requireCache.
|
|
72
|
+
has(a))return l;this.requireCache.add(a),this.addHandler(l)}return l},this.shim.requireDirectory({require:t,filename:n},e,s)}addHandler(e,t,n,s,i,o){let a=[];const c=Rm(i);if(s=s||(()=>{}),Array.isArray(e))if(Im(e))[e,...a]=e;else for(const l of e)this.addHandler(l);else if(Tm(e)){let l=Array.isArray(e.command)||typeof e.command=="string"?e.command:this.moduleName(e);e.aliases&&(l=[].concat(l).concat(e.aliases)),this.addHandler(l,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);
|
|
73
|
+
return}else if(Ka(n)){this.addHandler([e].concat(a),t,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){const l=br(e);a=a.map(h=>br(h).cmd);let u=!1;const f=[l.cmd].concat(a).filter(h=>Yt.test(h)?(u=!0,!1):!0);f.length===0&&u&&f.push("$0"),u&&(l.cmd=f[0],a=f.slice(1),e=e.replace(Yt,l.cmd)),a.forEach(h=>{this.aliasMap[h]=l.cmd}),t!==!1&&this.usage.command(e,t,u,a,o),this.handlers[l.cmd]={original:e,description:t,handler:s,builder:n||{},middlewares:c,deprecated:o,demanded:l.
|
|
74
|
+
demanded,optional:l.optional},u&&(this.defaultCommand=this.handlers[l.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,t,n,s,i,o){const a=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,c=t.getInternalMethods().getContext(),l=c.commands.slice(),u=!e;e&&(c.commands.push(e),c.fullCommands.push(a.original));const f=this.applyBuilderUpdateUsageAndParse(
|
|
75
|
+
u,a,t,n.aliases,l,s,i,o);return Ae(f)?f.then(h=>this.applyMiddlewareAndGetResult(u,a,h.innerArgv,c,i,h.aliases,t)):this.applyMiddlewareAndGetResult(u,a,f.innerArgv,c,i,f.aliases,t)}applyBuilderUpdateUsageAndParse(e,t,n,s,i,o,a,c){const l=t.builder;let u=n;if(Bs(l)){n.getInternalMethods().getUsageInstance().freeze();const f=l(n.getInternalMethods().reset(s),c);if(Ae(f))return f.then(h=>(u=Km(h)?h:n,this.parseAndUpdateUsage(e,t,u,i,o,a)))}else Nm(l)&&(n.getInternalMethods().getUsageInstance().freeze(),
|
|
76
|
+
u=n.getInternalMethods().reset(s),Object.keys(t.builder).forEach(f=>{u.option(f,l[f])}));return this.parseAndUpdateUsage(e,t,u,i,o,a)}parseAndUpdateUsage(e,t,n,s,i,o){e&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(s,t),t.description);const a=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,i,o);return Ae(a)?a.then(c=>({aliases:n.parsed.aliases,innerArgv:c})):
|
|
77
|
+
{aliases:n.parsed.aliases,innerArgv:a}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,t){const n=Yt.test(t.original)?t.original.replace(Yt,"").trim():t.original,s=e.filter(i=>!Yt.test(i));return s.push(n),`$0 ${s.join(" ")}`}handleValidationAndGetResult(e,t,n,s,i,o,a,c){if(!o.getInternalMethods().getHasOutput()){const l=o.getInternalMethods().runValidation(
|
|
78
|
+
i,c,o.parsed.error,e);n=Er(n,u=>(l(u),u))}if(t.handler&&!o.getInternalMethods().getHasOutput()){o.getInternalMethods().setHasOutput();const l=!!o.getOptions().configuration["populate--"];o.getInternalMethods().postProcess(n,l,!1,!1),n=wr(n,o,a,!1),n=Er(n,u=>{const f=t.handler(u);return Ae(f)?f.then(()=>u):u}),e||o.getInternalMethods().getUsageInstance().cacheHelpMessage(),Ae(n)&&!o.getInternalMethods().hasParseCallback()&&n.catch(u=>{try{o.getInternalMethods().getUsageInstance().fail(null,u)}catch{}})}
|
|
79
|
+
return e||(s.commands.pop(),s.fullCommands.pop()),n}applyMiddlewareAndGetResult(e,t,n,s,i,o,a){let c={};if(i)return n;a.getInternalMethods().getHasOutput()||(c=this.populatePositionals(t,n,s,a));const l=this.globalMiddleware.getMiddleware().slice(0).concat(t.middlewares),u=wr(n,a,l,!0);return Ae(u)?u.then(f=>this.handleValidationAndGetResult(e,t,f,s,o,a,l,c)):this.handleValidationAndGetResult(e,t,u,s,o,a,l,c)}populatePositionals(e,t,n,s){t._=t._.slice(n.commands.length);const i=e.demanded.slice(
|
|
80
|
+
0),o=e.optional.slice(0),a={};for(this.validation.positionalCount(i.length,t._.length);i.length;){const c=i.shift();this.populatePositional(c,t,a)}for(;o.length;){const c=o.shift();this.populatePositional(c,t,a)}return t._=n.commands.concat(t._.map(c=>""+c)),this.postProcessPositionals(t,a,this.cmdToParseOptions(e.original),s),a}populatePositional(e,t,n){const s=e.cmd[0];e.variadic?n[s]=t._.splice(0).map(String):t._.length&&(n[s]=[String(t._.shift())])}cmdToParseOptions(e){const t={array:[],default:{},
|
|
81
|
+
alias:{},demand:{}},n=br(e);return n.demanded.forEach(s=>{const[i,...o]=s.cmd;s.variadic&&(t.array.push(i),t.default[i]=[]),t.alias[i]=o,t.demand[i]=!0}),n.optional.forEach(s=>{const[i,...o]=s.cmd;s.variadic&&(t.array.push(i),t.default[i]=[]),t.alias[i]=o}),t}postProcessPositionals(e,t,n,s){const i=Object.assign({},s.getOptions());i.default=Object.assign(n.default,i.default);for(const l of Object.keys(n.alias))i.alias[l]=(i.alias[l]||[]).concat(n.alias[l]);i.array=i.array.concat(n.array),i.config=
|
|
82
|
+
{};const o=[];if(Object.keys(t).forEach(l=>{t[l].map(u=>{i.configuration["unknown-options-as-args"]&&(i.key[l]=!0),o.push(`--${l}`),o.push(u)})}),!o.length)return;const a=Object.assign({},i.configuration,{"populate--":!1}),c=this.shim.Parser.detailed(o,Object.assign({},i,{configuration:a}));if(c.error)s.getInternalMethods().getUsageInstance().fail(c.error.message,c.error);else{const l=Object.keys(t);Object.keys(t).forEach(u=>{l.push(...c.aliases[u])}),Object.keys(c.argv).forEach(u=>{l.includes(u)&&
|
|
83
|
+
(t[u]||(t[u]=c.argv[u]),!this.isInConfigs(s,u)&&!this.isDefaulted(s,u)&&Object.prototype.hasOwnProperty.call(e,u)&&Object.prototype.hasOwnProperty.call(c.argv,u)&&(Array.isArray(e[u])||Array.isArray(c.argv[u]))?e[u]=[].concat(e[u],c.argv[u]):e[u]=c.argv[u])})}}isDefaulted(e,t){const{default:n}=e.getOptions();return Object.prototype.hasOwnProperty.call(n,t)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(t))}isInConfigs(e,t){const{configObjects:n}=e.getOptions();return n.some(s=>Object.
|
|
84
|
+
prototype.hasOwnProperty.call(s,t))||n.some(s=>Object.prototype.hasOwnProperty.call(s,this.shim.Parser.camelCase(t)))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){const n=Yt.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}const t=this.defaultCommand.builder;if(Bs(t))return t(e,!0);Ka(t)||Object.keys(t).forEach(
|
|
85
|
+
n=>{e.option(n,t[n])})}moduleName(e){const t=Om(e);if(!t)throw new Error(`No command name given for module: ${this.shim.inspect(e)}`);return this.commandFromFilename(t.filename)}commandFromFilename(e){return this.shim.path.basename(e,this.shim.path.extname(e))}extractDesc({describe:e,description:t,desc:n}){for(const s of[e,t,n]){if(typeof s=="string"||s===!1)return s;Je(s,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){
|
|
86
|
+
const e=this.frozens.pop();Je(e,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}}function Pm(r,e,t,n){return new Cm(r,e,t,n)}function Ka(r){return typeof r=="object"&&!!r.builder&&typeof r.handler=="function"}function Im(r){return r.every(e=>typeof e=="string")}function Bs(r){return typeof r=="function"}function Nm(r){return typeof r=="\
|
|
87
|
+
object"}function Tm(r){return typeof r=="object"&&!Array.isArray(r)}function Sr(r={},e=()=>!0){const t={};return Yr(r).forEach(n=>{e(n,r[n])&&(t[n]=r[n])}),t}function Rr(r){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{const t=e;t._handle&&t.isTTY&&typeof t._handle.setBlocking=="function"&&t._handle.setBlocking(r)})}function jm(r){return typeof r=="boolean"}function Lm(r,e){const t=e.y18n.__,n={},s=[];n.failFn=function(M){s.push(M)};let i=null,o=null,a=!0;n.showHelpOnFail=function(M=!0,j){
|
|
88
|
+
const[D,U]=typeof M=="string"?[!0,M]:[M,j];return r.getInternalMethods().isGlobalContext()&&(o=U),i=U,a=D,n};let c=!1;n.fail=function(M,j){const D=r.getInternalMethods().getLoggerInstance();if(s.length)for(let U=s.length-1;U>=0;--U){const Y=s[U];if(jm(Y)){if(j)throw j;if(M)throw Error(M)}else Y(M,j,n)}else{if(r.getExitProcess()&&Rr(!0),!c){c=!0,a&&(r.showHelp("error"),D.error()),(M||j)&&D.error(M||j);const U=i||o;U&&((M||j)&&D.error(""),D.error(U))}if(j=j||new Oe(M),r.getExitProcess())return r.exit(
|
|
89
|
+
1);if(r.getInternalMethods().hasParseCallback())return r.exit(1,j);throw j}};let l=[],u=!1;n.usage=(k,M)=>k===null?(u=!0,l=[],n):(u=!1,l.push([k,M||""]),n),n.getUsage=()=>l,n.getUsageDisabled=()=>u,n.getPositionalGroupName=()=>t("Positionals:");let f=[];n.example=(k,M)=>{f.push([k,M||""])};let h=[];n.command=function(M,j,D,U,Y=!1){D&&(h=h.map(G=>(G[2]=!1,G))),h.push([M,j||"",D,U,Y])},n.getCommands=()=>h;let $={};n.describe=function(M,j){Array.isArray(M)?M.forEach(D=>{n.describe(D,j)}):typeof M==
|
|
90
|
+
"object"?Object.keys(M).forEach(D=>{n.describe(D,M[D])}):$[M]=j},n.getDescriptions=()=>$;let b=[];n.epilog=k=>{b.push(k)};let y=!1,d;n.wrap=k=>{y=!0,d=k},n.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(y||(d=I(),y=!0),d);const g="__yargsString__:";n.deferY18nLookup=k=>g+k,n.help=function(){if(_)return _;m();const M=r.customScriptName?r.$0:e.path.basename(r.$0),j=r.getDemandedOptions(),D=r.getDemandedCommands(),U=r.getDeprecatedOptions(),Y=r.getGroups(),G=r.getOptions();let J=[];J=J.concat(Object.
|
|
91
|
+
keys($)),J=J.concat(Object.keys(j)),J=J.concat(Object.keys(D)),J=J.concat(Object.keys(G.default)),J=J.filter(w),J=Object.keys(J.reduce((C,X)=>(X!=="_"&&(C[X]=!0),C),{}));const se=n.getWrap(),H=e.cliui({width:se,wrap:!!se});if(!u){if(l.length)l.forEach(C=>{H.div({text:`${C[0].replace(/\$0/g,M)}`}),C[1]&&H.div({text:`${C[1]}`,padding:[1,0,0,0]})}),H.div();else if(h.length){let C=null;D._?C=`${M} <${t("command")}>
|
|
92
|
+
`:C=`${M} [${t("command")}]
|
|
93
|
+
`,H.div(`${C}`)}}if(h.length>1||h.length===1&&!h[0][2]){H.div(t("Commands:"));const C=r.getInternalMethods().getContext(),X=C.commands.length?`${C.commands.join(" ")} `:"";r.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(h=h.sort((ie,oe)=>ie[0].localeCompare(oe[0])));const Z=M?`${M} `:"";h.forEach(ie=>{const oe=`${Z}${X}${ie[0].replace(/^\$0 ?/,"")}`;H.span({text:oe,padding:[0,2,0,2],width:p(h,se,`${M}${X}`)+4},{text:ie[1]});const L=[];ie[2]&&L.push(`[${t("default")}]`),ie[3]&&
|
|
94
|
+
ie[3].length&&L.push(`[${t("aliases:")} ${ie[3].join(", ")}]`),ie[4]&&(typeof ie[4]=="string"?L.push(`[${t("deprecated: %s",ie[4])}]`):L.push(`[${t("deprecated")}]`)),L.length?H.div({text:L.join(" "),padding:[0,0,0,2],align:"right"}):H.div()}),H.div()}const A=(Object.keys(G.alias)||[]).concat(Object.keys(r.parsed.newAliases)||[]);J=J.filter(C=>!r.parsed.newAliases[C]&&A.every(X=>(G.alias[X]||[]).indexOf(C)===-1));const V=t("Options:");Y[V]||(Y[V]=[]),v(J,G.alias,Y,V);const x=C=>/^--/.test(Xr(C)),
|
|
96
95
|
E=Object.keys(Y).filter(C=>Y[C].length>0).map(C=>{const X=Y[C].filter(w).map(Z=>{if(A.includes(Z))return Z;for(let ie=0,oe;(oe=A[ie])!==void 0;ie++)if((G.alias[oe]||[]).includes(Z))return oe;return Z});return{groupName:C,normalizedKeys:X}}).filter(({normalizedKeys:C})=>C.length>0).map(({groupName:C,normalizedKeys:X})=>{const Z=X.reduce((ie,oe)=>(ie[oe]=[oe].concat(G.alias[oe]||[]).map(L=>C===n.getPositionalGroupName()?L:(/^[0-9]$/.test(L)?G.boolean.includes(oe)?"-":"--":L.length>1?"--":"-")+L).sort(
|
|
97
|
-
(L,q)=>x(L)===x(q)?0:x(L)?1:-1).join(", "),ie),{});return{groupName:C,normalizedKeys:X,switches:Z}});if(E.filter(({groupName:C})=>C!==n.getPositionalGroupName()).some(({normalizedKeys:C,switches:X})=>!C.every(Z=>x(X[Z])))&&E.filter(({groupName:C})=>C!==n.getPositionalGroupName()).forEach(({normalizedKeys:C,switches:X})=>{C.forEach(Z=>{x(X[Z])&&(X[Z]=
|
|
98
|
-
(L=
|
|
99
|
-
G.choices[ie])}]`:null,S(G.default[ie],G.defaultDescription[ie])].filter(Boolean).join(" ");H.span({text:Xr(oe),padding:[0,2,0,2+
|
|
96
|
+
(L,q)=>x(L)===x(q)?0:x(L)?1:-1).join(", "),ie),{});return{groupName:C,normalizedKeys:X,switches:Z}});if(E.filter(({groupName:C})=>C!==n.getPositionalGroupName()).some(({normalizedKeys:C,switches:X})=>!C.every(Z=>x(X[Z])))&&E.filter(({groupName:C})=>C!==n.getPositionalGroupName()).forEach(({normalizedKeys:C,switches:X})=>{C.forEach(Z=>{x(X[Z])&&(X[Z]=km(X[Z],4))})}),E.forEach(({groupName:C,normalizedKeys:X,switches:Z})=>{H.div(C),X.forEach(ie=>{const oe=Z[ie];let L=$[ie]||"",q=null;L.includes(g)&&
|
|
97
|
+
(L=t(L.substring(g.length))),G.boolean.includes(ie)&&(q=`[${t("boolean")}]`),G.count.includes(ie)&&(q=`[${t("count")}]`),G.string.includes(ie)&&(q=`[${t("string")}]`),G.normalize.includes(ie)&&(q=`[${t("string")}]`),G.array.includes(ie)&&(q=`[${t("array")}]`),G.number.includes(ie)&&(q=`[${t("number")}]`);const Q=T=>typeof T=="string"?`[${t("deprecated: %s",T)}]`:`[${t("deprecated")}]`,ne=[ie in U?Q(U[ie]):null,q,ie in j?`[${t("required")}]`:null,G.choices&&G.choices[ie]?`[${t("choices:")} ${n.stringifiedValues(
|
|
98
|
+
G.choices[ie])}]`:null,S(G.default[ie],G.defaultDescription[ie])].filter(Boolean).join(" ");H.span({text:Xr(oe),padding:[0,2,0,2+Ya(oe)],width:p(Z,se)+4},L);const P=r.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;ne&&!P?H.div({text:ne,padding:[0,0,0,2],align:"right"}):H.div()}),H.div()}),f.length&&(H.div(t("Examples:")),f.forEach(C=>{C[0]=C[0].replace(/\$0/g,M)}),f.forEach(C=>{C[1]===""?H.div({text:C[0],padding:[0,2,0,2]}):H.div({text:C[0],padding:[0,2,0,2],width:p(f,se)+4},{text:C[1]})}),
|
|
100
99
|
H.div()),b.length>0){const C=b.map(X=>X.replace(/\$0/g,M)).join(`
|
|
101
100
|
`);H.div(`${C}
|
|
102
|
-
`)}return H.toString().replace(/\s*$/,"")};function p(
|
|
103
|
-
count(j),M.string.includes(
|
|
104
|
-
hiddenOptions.indexOf(
|
|
105
|
-
void 0&&!M)return null;if(M)j+=M;else switch(typeof
|
|
106
|
-
|
|
107
|
-
{text:
|
|
101
|
+
`)}return H.toString().replace(/\s*$/,"")};function p(k,M,j){let D=0;return Array.isArray(k)||(k=Object.values(k).map(U=>[U])),k.forEach(U=>{D=Math.max(e.stringWidth(j?`${j} ${Xr(U[0])}`:Xr(U[0]))+Ya(U[0]),D)}),M&&(D=Math.min(D,parseInt((M*.5).toString(),10))),D}function m(){const k=r.getDemandedOptions(),M=r.getOptions();(Object.keys(M.alias)||[]).forEach(j=>{M.alias[j].forEach(D=>{$[D]&&n.describe(j,$[D]),D in k&&r.demandOption(j,k[D]),M.boolean.includes(D)&&r.boolean(j),M.count.includes(D)&&r.
|
|
102
|
+
count(j),M.string.includes(D)&&r.string(j),M.normalize.includes(D)&&r.normalize(j),M.array.includes(D)&&r.array(j),M.number.includes(D)&&r.number(j)})})}let _;n.cacheHelpMessage=function(){_=this.help()},n.clearCachedHelpMessage=function(){_=void 0},n.hasCachedHelpMessage=function(){return!!_};function v(k,M,j,D){let U=[],Y=null;return Object.keys(j).forEach(G=>{U=U.concat(j[G])}),k.forEach(G=>{Y=[G].concat(M[G]),Y.some(J=>U.indexOf(J)!==-1)||j[D].push(G)}),U}function w(k){return r.getOptions().
|
|
103
|
+
hiddenOptions.indexOf(k)<0||r.parsed.argv[r.getOptions().showHiddenOpt]}n.showHelp=k=>{const M=r.getInternalMethods().getLoggerInstance();k||(k="error"),(typeof k=="function"?k:M[k])(n.help())},n.functionDescription=k=>["(",k.name?e.Parser.decamelize(k.name,"-"):t("generated-value"),")"].join(""),n.stringifiedValues=function(M,j){let D="";const U=j||", ",Y=[].concat(M);return!M||!Y.length||Y.forEach(G=>{D.length&&(D+=U),D+=JSON.stringify(G)}),D};function S(k,M){let j=`[${t("default:")} `;if(k===
|
|
104
|
+
void 0&&!M)return null;if(M)j+=M;else switch(typeof k){case"string":j+=`"${k}"`;break;case"object":j+=JSON.stringify(k);break;default:j+=k}return`${j}]`}function I(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}let F=null;n.version=k=>{F=k},n.showVersion=k=>{const M=r.getInternalMethods().getLoggerInstance();k||(k="error"),(typeof k=="function"?k:M[k])(F)},n.reset=function(M){return i=null,c=!1,l=[],u=!1,b=[],f=[],h=[],$=Sr($,j=>!M[j]),n};const W=[];return n.freeze=function(){
|
|
105
|
+
W.push({failMessage:i,failureOutput:c,usages:l,usageDisabled:u,epilogs:b,examples:f,commands:h,descriptions:$})},n.unfreeze=function(M=!1){const j=W.pop();j&&(M?($={...j.descriptions,...$},h=[...j.commands,...h],l=[...j.usages,...l],f=[...j.examples,...f],b=[...j.epilogs,...b]):{failMessage:i,failureOutput:c,usages:l,usageDisabled:u,epilogs:b,examples:f,commands:h,descriptions:$}=j)},n}function Ws(r){return typeof r=="object"}function km(r,e){return Ws(r)?{text:r.text,indentation:r.indentation+e}:
|
|
106
|
+
{text:r,indentation:e}}function Ya(r){return Ws(r)?r.indentation:0}function Xr(r){return Ws(r)?r.text:r}const Dm=`###-begin-{{app_name}}-completions-###
|
|
108
107
|
#
|
|
109
108
|
# yargs command completion script
|
|
110
109
|
#
|
|
@@ -132,7 +131,7 @@ _{{app_name}}_yargs_completions()
|
|
|
132
131
|
}
|
|
133
132
|
complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}
|
|
134
133
|
###-end-{{app_name}}-completions-###
|
|
135
|
-
`,
|
|
134
|
+
`,xm=`#compdef {{app_name}}
|
|
136
135
|
###-begin-{{app_name}}-completions-###
|
|
137
136
|
#
|
|
138
137
|
# yargs command completion script
|
|
@@ -151,92 +150,92 @@ _{{app_name}}_yargs_completions()
|
|
|
151
150
|
}
|
|
152
151
|
compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
153
152
|
###-end-{{app_name}}-completions-###
|
|
154
|
-
`;class
|
|
155
|
-
length;a<c;++a)if(i[e[a]]&&i[e[a]].builder){const l=i[e[a]].builder;if(
|
|
156
|
-
|
|
157
|
-
includes(a)&&!this.argsContainKey(
|
|
158
|
-
getContext().commands.length+1),a=i[n._.length-o-1];if(!a)return;const c=this.yargs.getOptions().choices[a]||[];for(const l of c)l.startsWith(s)&&e.push(l.replace(/:/g,"\\:"))}getPreviousArgChoices(e){if(e.length<1)return;let
|
|
159
|
-
isArray(i.choices[c])){a=i.choices[c];break}if(a)return a.filter(c=>!n||c.startsWith(n))}previousArgHasChoices(e){const
|
|
160
|
-
void 0?void 0:this.aliases)===null||i===void 0?void 0:i[e])===null||o===void 0?void 0:o.find(g=>{const p=$[g];return typeof p=="string"&&p.length>0}),y=b?$[b]:void 0,d=(c=(a=$[e])!==null&&a!==void 0?a:y)!==null&&c!==void 0?c:"";l=`${e.replace(/:/g,"\\:")}:${d.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}const u=$=>/^--/.test($),f=$=>/^[^0-9]$/.test($),h=!u(n)&&f(e)?"-":"--";
|
|
161
|
-
shim),
|
|
162
|
-
o=>this.customCompletion(e,o,n,
|
|
163
|
-
return
|
|
164
|
-
function
|
|
153
|
+
`;class Mm{constructor(e,t,n,s){var i,o,a;this.yargs=e,this.usage=t,this.command=n,this.shim=s,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(a=((i=this.shim.getEnv("SHELL"))===null||i===void 0?void 0:i.includes("zsh"))||((o=this.shim.getEnv("ZSH_NAME"))===null||o===void 0?void 0:o.includes("zsh")))!==null&&a!==void 0?a:!1}defaultCompletion(e,t,n,s){const i=this.command.getCommandHandlers();for(let a=0,c=e.
|
|
154
|
+
length;a<c;++a)if(i[e[a]]&&i[e[a]].builder){const l=i[e[a]].builder;if(Bs(l)){this.indexAfterLastReset=a+1;const u=this.yargs.getInternalMethods().reset();return l(u,!0),u.argv}}const o=[];this.commandCompletions(o,e,n),this.optionCompletions(o,e,t,n),this.choicesFromOptionsCompletions(o,e,t,n),this.choicesFromPositionalsCompletions(o,e,t,n),s(null,o)}commandCompletions(e,t,n){const s=this.yargs.getInternalMethods().getContext().commands;!n.match(/^-/)&&s[s.length-1]!==n&&!this.previousArgHasChoices(
|
|
155
|
+
t)&&this.usage.getCommands().forEach(i=>{const o=br(i[0]).cmd;if(t.indexOf(o)===-1)if(!this.zshShell)e.push(o);else{const a=i[1]||"";e.push(o.replace(/:/g,"\\:")+":"+a)}})}optionCompletions(e,t,n,s){if((s.match(/^-/)||s===""&&e.length===0)&&!this.previousArgHasChoices(t)){const i=this.yargs.getOptions(),o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(i.key).forEach(a=>{const c=!!i.configuration["boolean-negation"]&&i.boolean.includes(a);!o.includes(a)&&!i.hiddenOptions.
|
|
156
|
+
includes(a)&&!this.argsContainKey(t,a,c)&&this.completeOptionKey(a,e,s,c&&!!i.default[a])})}}choicesFromOptionsCompletions(e,t,n,s){if(this.previousArgHasChoices(t)){const i=this.getPreviousArgChoices(t);i&&i.length>0&&e.push(...i.map(o=>o.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(e,t,n,s){if(s===""&&e.length>0&&this.previousArgHasChoices(t))return;const i=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],o=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().
|
|
157
|
+
getContext().commands.length+1),a=i[n._.length-o-1];if(!a)return;const c=this.yargs.getOptions().choices[a]||[];for(const l of c)l.startsWith(s)&&e.push(l.replace(/:/g,"\\:"))}getPreviousArgChoices(e){if(e.length<1)return;let t=e[e.length-1],n="";if(!t.startsWith("-")&&e.length>1&&(n=t,t=e[e.length-2]),!t.startsWith("-"))return;const s=t.replace(/^-+/,""),i=this.yargs.getOptions(),o=[s,...this.yargs.getAliases()[s]||[]];let a;for(const c of o)if(Object.prototype.hasOwnProperty.call(i.key,c)&&Array.
|
|
158
|
+
isArray(i.choices[c])){a=i.choices[c];break}if(a)return a.filter(c=>!n||c.startsWith(n))}previousArgHasChoices(e){const t=this.getPreviousArgChoices(e);return t!==void 0&&t.length>0}argsContainKey(e,t,n){const s=i=>e.indexOf((/^[^0-9]$/.test(i)?"-":"--")+i)!==-1;if(s(t)||n&&s(`no-${t}`))return!0;if(this.aliases){for(const i of this.aliases[t])if(s(i))return!0}return!1}completeOptionKey(e,t,n,s){var i,o,a,c;let l=e;if(this.zshShell){const $=this.usage.getDescriptions(),b=(o=(i=this===null||this===
|
|
159
|
+
void 0?void 0:this.aliases)===null||i===void 0?void 0:i[e])===null||o===void 0?void 0:o.find(g=>{const p=$[g];return typeof p=="string"&&p.length>0}),y=b?$[b]:void 0,d=(c=(a=$[e])!==null&&a!==void 0?a:y)!==null&&c!==void 0?c:"";l=`${e.replace(/:/g,"\\:")}:${d.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}const u=$=>/^--/.test($),f=$=>/^[^0-9]$/.test($),h=!u(n)&&f(e)?"-":"--";t.push(h+l),s&&t.push(h+"no-"+l)}customCompletion(e,t,n,s){if(Je(this.customCompletionFunction,null,this.
|
|
160
|
+
shim),Um(this.customCompletionFunction)){const i=this.customCompletionFunction(n,t);return Ae(i)?i.then(o=>{this.shim.process.nextTick(()=>{s(null,o)})}).catch(o=>{this.shim.process.nextTick(()=>{s(o,void 0)})}):s(null,i)}else return Hm(this.customCompletionFunction)?this.customCompletionFunction(n,t,(i=s)=>this.defaultCompletion(e,t,n,i),i=>{s(null,i)}):this.customCompletionFunction(n,t,i=>{s(null,i)})}getCompletion(e,t){const n=e.length?e[e.length-1]:"",s=this.yargs.parse(e,!0),i=this.customCompletionFunction?
|
|
161
|
+
o=>this.customCompletion(e,o,n,t):o=>this.defaultCompletion(e,o,n,t);return Ae(s)?s.then(i):i(s)}generateCompletionScript(e,t){let n=this.zshShell?xm:Dm;const s=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),n=n.replace(/{{app_name}}/g,s),n=n.replace(/{{completion_command}}/g,t),n.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}}function qm(r,e,t,n){return new Mm(r,e,t,n)}function Um(r){return r.length<3}function Hm(r){
|
|
162
|
+
return r.length>3}function Fm(r,e){if(r.length===0)return e.length;if(e.length===0)return r.length;const t=[];let n;for(n=0;n<=e.length;n++)t[n]=[n];let s;for(s=0;s<=r.length;s++)t[0][s]=s;for(n=1;n<=e.length;n++)for(s=1;s<=r.length;s++)e.charAt(n-1)===r.charAt(s-1)?t[n][s]=t[n-1][s-1]:n>1&&s>1&&e.charAt(n-2)===r.charAt(s-1)&&e.charAt(n-1)===r.charAt(s-2)?t[n][s]=t[n-2][s-2]+1:t[n][s]=Math.min(t[n-1][s-1]+1,Math.min(t[n][s-1]+1,t[n-1][s]+1));return t[e.length][r.length]}const Xa=["$0","--","_"];
|
|
163
|
+
function Vm(r,e,t){const n=t.y18n.__,s=t.y18n.__n,i={};i.nonOptionCount=function(f){const h=r.getDemandedCommands(),b=f._.length+(f["--"]?f["--"].length:0)-r.getInternalMethods().getContext().commands.length;h._&&(b<h._.min||b>h._.max)&&(b<h._.min?h._.minMsg!==void 0?e.fail(h._.minMsg?h._.minMsg.replace(/\$0/g,b.toString()).replace(/\$1/,h._.min.toString()):null):e.fail(s("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",b,b.toString(),
|
|
165
164
|
h._.min.toString())):b>h._.max&&(h._.maxMsg!==void 0?e.fail(h._.maxMsg?h._.maxMsg.replace(/\$0/g,b.toString()).replace(/\$1/,h._.max.toString()):null):e.fail(s("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",b,b.toString(),h._.max.toString()))))},i.positionalCount=function(f,h){h<f&&e.fail(s("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",h,h+"",f+""))},i.requiredArguments=
|
|
166
165
|
function(f,h){let $=null;for(const b of Object.keys(h))(!Object.prototype.hasOwnProperty.call(f,b)||typeof f[b]>"u")&&($=$||{},$[b]=h[b]);if($){const b=[];for(const d of Object.keys($)){const g=$[d];g&&b.indexOf(g)<0&&b.push(g)}const y=b.length?`
|
|
167
166
|
${b.join(`
|
|
168
|
-
`)}`:"";e.fail(s("Missing required argument: %s","Missing required arguments: %s",Object.keys($).length,Object.keys($).join(", ")+y))}},i.unknownArguments=function(f,h,$,b,y=!0){var d;const g=
|
|
169
|
-
h)&&p.push(_)}),y&&(m.commands.length>0||g.length>0||b)&&f._.slice(m.commands.length).forEach(_=>{g.includes(""+_)||p.push(""+_)}),y){const v=((d=
|
|
170
|
-
getCommandInstance().getCommands(),$=[],b=
|
|
171
|
-
function(f){const h=
|
|
172
|
-
${n("Argument: %s, Given: %s, Choices: %s",d,e.stringifiedValues($[d]),e.stringifiedValues(h.choices[d]))}`}),e.fail(y)};let o={};i.implies=function(f,h){ce("<string|object> [array|number|string]",[f,h],arguments.length),typeof f=="object"?Object.keys(f).forEach($=>{i.implies($,f[$])}):(
|
|
167
|
+
`)}`:"";e.fail(s("Missing required argument: %s","Missing required arguments: %s",Object.keys($).length,Object.keys($).join(", ")+y))}},i.unknownArguments=function(f,h,$,b,y=!0){var d;const g=r.getInternalMethods().getCommandInstance().getCommands(),p=[],m=r.getInternalMethods().getContext();if(Object.keys(f).forEach(_=>{!Xa.includes(_)&&!Object.prototype.hasOwnProperty.call($,_)&&!Object.prototype.hasOwnProperty.call(r.getInternalMethods().getParseContext(),_)&&!i.isValidAndSomeAliasIsNotNew(_,
|
|
168
|
+
h)&&p.push(_)}),y&&(m.commands.length>0||g.length>0||b)&&f._.slice(m.commands.length).forEach(_=>{g.includes(""+_)||p.push(""+_)}),y){const v=((d=r.getDemandedCommands()._)===null||d===void 0?void 0:d.max)||0,w=m.commands.length+v;w<f._.length&&f._.slice(w).forEach(S=>{S=String(S),!m.commands.includes(S)&&!p.includes(S)&&p.push(S)})}p.length&&e.fail(s("Unknown argument: %s","Unknown arguments: %s",p.length,p.map(_=>_.trim()?_:`"${_}"`).join(", ")))},i.unknownCommands=function(f){const h=r.getInternalMethods().
|
|
169
|
+
getCommandInstance().getCommands(),$=[],b=r.getInternalMethods().getContext();return(b.commands.length>0||h.length>0)&&f._.slice(b.commands.length).forEach(y=>{h.includes(""+y)||$.push(""+y)}),$.length>0?(e.fail(s("Unknown command: %s","Unknown commands: %s",$.length,$.join(", "))),!0):!1},i.isValidAndSomeAliasIsNotNew=function(f,h){if(!Object.prototype.hasOwnProperty.call(h,f))return!1;const $=r.parsed.newAliases;return[f,...h[f]].some(b=>!Object.prototype.hasOwnProperty.call($,b)||!$[f])},i.limitedChoices=
|
|
170
|
+
function(f){const h=r.getOptions(),$={};if(!Object.keys(h.choices).length)return;Object.keys(f).forEach(d=>{Xa.indexOf(d)===-1&&Object.prototype.hasOwnProperty.call(h.choices,d)&&[].concat(f[d]).forEach(g=>{h.choices[d].indexOf(g)===-1&&g!==void 0&&($[d]=($[d]||[]).concat(g))})});const b=Object.keys($);if(!b.length)return;let y=n("Invalid values:");b.forEach(d=>{y+=`
|
|
171
|
+
${n("Argument: %s, Given: %s, Choices: %s",d,e.stringifiedValues($[d]),e.stringifiedValues(h.choices[d]))}`}),e.fail(y)};let o={};i.implies=function(f,h){ce("<string|object> [array|number|string]",[f,h],arguments.length),typeof f=="object"?Object.keys(f).forEach($=>{i.implies($,f[$])}):(r.global(f),o[f]||(o[f]=[]),Array.isArray(h)?h.forEach($=>i.implies(f,$)):(Je(h,void 0,t),o[f].push(h)))},i.getImplied=function(){return o};function a(u,f){const h=Number(f);return f=isNaN(h)?f:h,typeof f=="num\
|
|
173
172
|
ber"?f=u._.length>=f:f.match(/^--no-.+/)?(f=f.match(/^--no-(.+)/)[1],f=!Object.prototype.hasOwnProperty.call(u,f)):f=Object.prototype.hasOwnProperty.call(u,f),f}i.implications=function(f){const h=[];if(Object.keys(o).forEach($=>{const b=$;(o[$]||[]).forEach(y=>{let d=b;const g=y;d=a(f,d),y=a(f,y),d&&!y&&h.push(` ${b} -> ${g}`)})}),h.length){let $=`${n("Implications failed:")}
|
|
174
|
-
`;h.forEach(b=>{$+=b}),e.fail($)}};let c={};i.conflicts=function(f,h){ce("<string|object> [array|string]",[f,h],arguments.length),typeof f=="object"?Object.keys(f).forEach($=>{i.conflicts($,f[$])}):(
|
|
175
|
-
getParserConfiguration()["strip-dashed"]&&Object.keys(c).forEach(h=>{c[h].forEach($=>{$&&f[
|
|
176
|
-
freeze=function(){l.push({implied:o,conflicting:c})},i.unfreeze=function(){const f=l.pop();
|
|
177
|
-
s=
|
|
178
|
-
if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?
|
|
179
|
-
id not declare it");return
|
|
180
|
-
"getDollarZero"),
|
|
181
|
-
"getContext"),
|
|
182
|
-
this,void 0),
|
|
183
|
-
fe.set(this,void 0),
|
|
184
|
-
"[string|boolean] [string]",[e,
|
|
185
|
-
n),this.describe(n,
|
|
186
|
-
return ce("<function> [boolean]",[e,
|
|
187
|
-
if(ce("<object|string|array> [function]",[e,
|
|
188
|
-
a;const c=s.getInternalMethods().getParserConfiguration()["strip-aliased"];if(i[e]&&c!==!0)for(const l of i[e])n[l]=a;return n},a=>{throw new Oe(a.message)}):n},e),this}conflicts(e,
|
|
189
|
-
f")),O(this,ue,"f").configObjects=(O(this,ue,"f").configObjects||[]).concat(e),this):(typeof
|
|
190
|
-
script"),this.command(O(this,
|
|
191
|
-
"f").getCallerFile(),
|
|
192
|
-
return this.default(e,
|
|
193
|
-
Array.isArray(e)?e.forEach(s=>{
|
|
194
|
-
ing]",[e,
|
|
195
|
-
e)?e.forEach(n=>this.example(...n)):O(this,de,"f").example(e,
|
|
196
|
-
return ce("<array> [function]",[e,
|
|
197
|
-
"f"),O(this,Dt,"f"))}getHelp(){if(ae(this,xe,!0,"f"),!O(this,de,"f").hasCachedHelpMessage()){if(!this.parsed){const
|
|
198
|
-
|
|
199
|
-
return ce("<string>",[e],arguments.length),O(this,ue,"f").hiddenOptions.push(e),this}implies(e,
|
|
200
|
-
length),this[Qt](this.nargs.bind(this),"narg",e,
|
|
173
|
+
`;h.forEach(b=>{$+=b}),e.fail($)}};let c={};i.conflicts=function(f,h){ce("<string|object> [array|string]",[f,h],arguments.length),typeof f=="object"?Object.keys(f).forEach($=>{i.conflicts($,f[$])}):(r.global(f),c[f]||(c[f]=[]),Array.isArray(h)?h.forEach($=>i.conflicts(f,$)):c[f].push(h))},i.getConflicting=()=>c,i.conflicting=function(f){Object.keys(f).forEach(h=>{c[h]&&c[h].forEach($=>{$&&f[h]!==void 0&&f[$]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",h,$))})}),r.getInternalMethods().
|
|
174
|
+
getParserConfiguration()["strip-dashed"]&&Object.keys(c).forEach(h=>{c[h].forEach($=>{$&&f[t.Parser.camelCase(h)]!==void 0&&f[t.Parser.camelCase($)]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",h,$))})})},i.recommendCommands=function(f,h){h=h.sort((d,g)=>g.length-d.length);let b=null,y=1/0;for(let d=0,g;(g=h[d])!==void 0;d++){const p=Fm(f,g);p<=3&&p<y&&(y=p,b=g)}b&&e.fail(n("Did you mean %s?",b))},i.reset=function(f){return o=Sr(o,h=>!f[h]),c=Sr(c,h=>!f[h]),i};const l=[];return i.
|
|
175
|
+
freeze=function(){l.push({implied:o,conflicting:c})},i.unfreeze=function(){const f=l.pop();Je(f,void 0,t),{implied:o,conflicting:c}=f},i}let Ks=[],Ar;function Ys(r,e,t,n){Ar=n;let s={};if(Object.prototype.hasOwnProperty.call(r,"extends")){if(typeof r.extends!="string")return s;const i=/\.json|\..*rc$/.test(r.extends);let o=null;if(i)o=Gm(e,r.extends);else try{o=require.resolve(r.extends)}catch{return r}zm(o),Ks.push(o),s=i?JSON.parse(Ar.readFileSync(o,"utf8")):require(r.extends),delete r.extends,
|
|
176
|
+
s=Ys(s,Ar.path.dirname(o),t,Ar)}return Ks=[],t?Ja(s,r):Object.assign({},s,r)}function zm(r){if(Ks.indexOf(r)>-1)throw new Oe(`Circular extended configurations: '${r}'.`)}function Gm(r,e){return Ar.path.resolve(r,e)}function Ja(r,e){const t={};function n(s){return s&&typeof s=="object"&&!Array.isArray(s)}Object.assign(t,r);for(const s of Object.keys(e))n(e[s])&&n(t[s])?t[s]=Ja(r[s],e[s]):t[s]=e[s];return t}var ae=function(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");
|
|
177
|
+
if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},O=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class d\
|
|
178
|
+
id not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Re,jt,Or,ze,De,Jr,_t,Lt,Qr,Ge,Zr,Be,st,xe,We,en,Xt,Ce,ue,tn,rn,Me,kt,Jt,Dt,vt,nn,fe,xt,Mt,qt,de,sn,it,Ee;function Bm(r){return(e=[],t=r.process.cwd(),n)=>{const s=new Wm(e,t,n,r);return Object.defineProperty(s,"argv",{get:()=>s.parse(),enumerable:!0}),s.help(),s.version(),s}}const Qa=Symbol("copyDoubleDash"),Za=Symbol("copyDoubleDash"),Xs=Symbol("deleteFromParserHintObject"),ec=Symbol("emitWarning"),tc=Symbol("freeze"),rc=Symbol(
|
|
179
|
+
"getDollarZero"),Ut=Symbol("getParserConfiguration"),nc=Symbol("getUsageConfiguration"),Js=Symbol("guessLocale"),sc=Symbol("guessVersion"),ic=Symbol("parsePositionalNumbers"),Qs=Symbol("pkgUp"),bt=Symbol("populateParserHintArray"),Qt=Symbol("populateParserHintSingleValueDictionary"),Zs=Symbol("populateParserHintArrayDictionary"),ei=Symbol("populateParserHintDictionary"),ti=Symbol("sanitizeKey"),ri=Symbol("setKey"),ni=Symbol("unfreeze"),oc=Symbol("validateAsync"),ac=Symbol("getCommandInstance"),cc=Symbol(
|
|
180
|
+
"getContext"),uc=Symbol("getHasOutput"),lc=Symbol("getLoggerInstance"),fc=Symbol("getParseContext"),dc=Symbol("getUsageInstance"),hc=Symbol("getValidationInstance"),on=Symbol("hasParseCallback"),pc=Symbol("isGlobalContext"),Ht=Symbol("postProcess"),mc=Symbol("rebase"),si=Symbol("reset"),Cr=Symbol("runYargsParserAndExecuteCommands"),ii=Symbol("runValidation"),gc=Symbol("setHasOutput"),Ft=Symbol("kTrackManuallySetKeys");class Wm{constructor(e=[],t,n,s){this.customScriptName=!1,this.parsed=!1,Re.set(
|
|
181
|
+
this,void 0),jt.set(this,void 0),Or.set(this,{commands:[],fullCommands:[]}),ze.set(this,null),De.set(this,null),Jr.set(this,"show-hidden"),_t.set(this,null),Lt.set(this,!0),Qr.set(this,{}),Ge.set(this,!0),Zr.set(this,[]),Be.set(this,void 0),st.set(this,{}),xe.set(this,!1),We.set(this,null),en.set(this,!0),Xt.set(this,void 0),Ce.set(this,""),ue.set(this,void 0),tn.set(this,void 0),rn.set(this,{}),Me.set(this,null),kt.set(this,null),Jt.set(this,{}),Dt.set(this,{}),vt.set(this,void 0),nn.set(this,!1),
|
|
182
|
+
fe.set(this,void 0),xt.set(this,!1),Mt.set(this,!1),qt.set(this,!1),de.set(this,void 0),sn.set(this,{}),it.set(this,null),Ee.set(this,void 0),ae(this,fe,s,"f"),ae(this,vt,e,"f"),ae(this,jt,t,"f"),ae(this,tn,n,"f"),ae(this,Be,new Sm(this),"f"),this.$0=this[rc](),this[si](),ae(this,Re,O(this,Re,"f"),"f"),ae(this,de,O(this,de,"f"),"f"),ae(this,Ee,O(this,Ee,"f"),"f"),ae(this,ue,O(this,ue,"f"),"f"),O(this,ue,"f").showHiddenOpt=O(this,Jr,"f"),ae(this,Xt,this[Za](),"f")}addHelpOpt(e,t){const n="help";return ce(
|
|
183
|
+
"[string|boolean] [string]",[e,t],arguments.length),O(this,We,"f")&&(this[Xs](O(this,We,"f")),ae(this,We,null,"f")),e===!1&&t===void 0?this:(ae(this,We,typeof e=="string"?e:n,"f"),this.boolean(O(this,We,"f")),this.describe(O(this,We,"f"),t||O(this,de,"f").deferY18nLookup("Show help")),this)}help(e,t){return this.addHelpOpt(e,t)}addShowHiddenOpt(e,t){if(ce("[string|boolean] [string]",[e,t],arguments.length),e===!1&&t===void 0)return this;const n=typeof e=="string"?e:O(this,Jr,"f");return this.boolean(
|
|
184
|
+
n),this.describe(n,t||O(this,de,"f").deferY18nLookup("Show hidden options")),O(this,ue,"f").showHiddenOpt=n,this}showHidden(e,t){return this.addShowHiddenOpt(e,t)}alias(e,t){return ce("<object|string|array> [string|array]",[e,t],arguments.length),this[Zs](this.alias.bind(this),"alias",e,t),this}array(e){return ce("<array|string>",[e],arguments.length),this[bt]("array",e),this[Ft](e),this}boolean(e){return ce("<array|string>",[e],arguments.length),this[bt]("boolean",e),this[Ft](e),this}check(e,t){
|
|
185
|
+
return ce("<function> [boolean]",[e,t],arguments.length),this.middleware((n,s)=>Er(()=>e(n,s.getOptions()),i=>(i?(typeof i=="string"||i instanceof Error)&&O(this,de,"f").fail(i.toString(),i):O(this,de,"f").fail(O(this,fe,"f").y18n.__("Argument check failed: %s",e.toString())),n),i=>(O(this,de,"f").fail(i.message?i.message:i.toString(),i),n)),!1,t),this}choices(e,t){return ce("<object|string|array> [string|array]",[e,t],arguments.length),this[Zs](this.choices.bind(this),"choices",e,t),this}coerce(e,t){
|
|
186
|
+
if(ce("<object|string|array> [function]",[e,t],arguments.length),Array.isArray(e)){if(!t)throw new Oe("coerce callback must be provided");for(const n of e)this.coerce(n,t);return this}else if(typeof e=="object"){for(const n of Object.keys(e))this.coerce(n,e[n]);return this}if(!t)throw new Oe("coerce callback must be provided");return O(this,ue,"f").key[e]=!0,O(this,Be,"f").addCoerceMiddleware((n,s)=>{let i;return Object.prototype.hasOwnProperty.call(n,e)?Er(()=>(i=s.getAliases(),t(n[e])),a=>{n[e]=
|
|
187
|
+
a;const c=s.getInternalMethods().getParserConfiguration()["strip-aliased"];if(i[e]&&c!==!0)for(const l of i[e])n[l]=a;return n},a=>{throw new Oe(a.message)}):n},e),this}conflicts(e,t){return ce("<string|object> [string|array]",[e,t],arguments.length),O(this,Ee,"f").conflicts(e,t),this}config(e="config",t,n){return ce("[object|string] [string|function] [function]",[e,t,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=Ys(e,O(this,jt,"f"),this[Ut]()["deep-merge-config"]||!1,O(this,fe,"\
|
|
188
|
+
f")),O(this,ue,"f").configObjects=(O(this,ue,"f").configObjects||[]).concat(e),this):(typeof t=="function"&&(n=t,t=void 0),this.describe(e,t||O(this,de,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(s=>{O(this,ue,"f").config[s]=n||!0}),this)}completion(e,t,n){return ce("[string] [string|boolean|function] [function]",[e,t,n],arguments.length),typeof t=="function"&&(n=t,t=void 0),ae(this,De,e||O(this,De,"f")||"completion","f"),!t&&t!==!1&&(t="generate completion\
|
|
189
|
+
script"),this.command(O(this,De,"f"),t),n&&O(this,ze,"f").registerFunction(n),this}command(e,t,n,s,i,o){return ce("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,t,n,s,i,o],arguments.length),O(this,Re,"f").addHandler(e,t,n,s,i,o),this}commands(e,t,n,s,i,o){return this.command(e,t,n,s,i,o)}commandDir(e,t){ce("<string> [object]",[e,t],arguments.length);const n=O(this,tn,"f")||O(this,fe,"f").require;return O(this,Re,"f").addDirectory(e,n,O(this,fe,
|
|
190
|
+
"f").getCallerFile(),t),this}count(e){return ce("<array|string>",[e],arguments.length),this[bt]("count",e),this[Ft](e),this}default(e,t,n){return ce("<object|string|array> [*] [string]",[e,t,n],arguments.length),n&&(Ga(e,O(this,fe,"f")),O(this,ue,"f").defaultDescription[e]=n),typeof t=="function"&&(Ga(e,O(this,fe,"f")),O(this,ue,"f").defaultDescription[e]||(O(this,ue,"f").defaultDescription[e]=O(this,de,"f").functionDescription(t)),t=t.call()),this[Qt](this.default.bind(this),"default",e,t),this}defaults(e,t,n){
|
|
191
|
+
return this.default(e,t,n)}demandCommand(e=1,t,n,s){return ce("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,t,n,s],arguments.length),typeof t!="number"&&(n=t,t=1/0),this.global("_",!1),O(this,ue,"f").demandedCommands._={min:e,max:t,minMsg:n,maxMsg:s},this}demand(e,t,n){return Array.isArray(t)?(t.forEach(s=>{Je(n,!0,O(this,fe,"f")),this.demandOption(s,n)}),t=1/0):typeof t!="number"&&(n=t,t=1/0),typeof e=="number"?(Je(n,!0,O(this,fe,"f")),this.demandCommand(e,t,n,n)):
|
|
192
|
+
Array.isArray(e)?e.forEach(s=>{Je(n,!0,O(this,fe,"f")),this.demandOption(s,n)}):typeof n=="string"?this.demandOption(e,n):(n===!0||typeof n>"u")&&this.demandOption(e),this}demandOption(e,t){return ce("<object|string|array> [string]",[e,t],arguments.length),this[Qt](this.demandOption.bind(this),"demandedOptions",e,t),this}deprecateOption(e,t){return ce("<string> [string|boolean]",[e,t],arguments.length),O(this,ue,"f").deprecatedOptions[e]=t,this}describe(e,t){return ce("<object|string|array> [str\
|
|
193
|
+
ing]",[e,t],arguments.length),this[ri](e,!0),O(this,de,"f").describe(e,t),this}detectLocale(e){return ce("<boolean>",[e],arguments.length),ae(this,Lt,e,"f"),this}env(e){return ce("[string|boolean]",[e],arguments.length),e===!1?delete O(this,ue,"f").envPrefix:O(this,ue,"f").envPrefix=e||"",this}epilogue(e){return ce("<string>",[e],arguments.length),O(this,de,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,t){return ce("<string|array> [string]",[e,t],arguments.length),Array.isArray(
|
|
194
|
+
e)?e.forEach(n=>this.example(...n)):O(this,de,"f").example(e,t),this}exit(e,t){ae(this,xe,!0,"f"),ae(this,_t,t,"f"),O(this,Ge,"f")&&O(this,fe,"f").process.exit(e)}exitProcess(e=!0){return ce("[boolean]",[e],arguments.length),ae(this,Ge,e,"f"),this}fail(e){if(ce("<function|boolean>",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new Oe("Invalid first argument. Expected function or boolean 'false'");return O(this,de,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,t){
|
|
195
|
+
return ce("<array> [function]",[e,t],arguments.length),t?O(this,ze,"f").getCompletion(e,t):new Promise((n,s)=>{O(this,ze,"f").getCompletion(e,(i,o)=>{i?s(i):n(o)})})}getDemandedOptions(){return ce([],0),O(this,ue,"f").demandedOptions}getDemandedCommands(){return ce([],0),O(this,ue,"f").demandedCommands}getDeprecatedOptions(){return ce([],0),O(this,ue,"f").deprecatedOptions}getDetectLocale(){return O(this,Lt,"f")}getExitProcess(){return O(this,Ge,"f")}getGroups(){return Object.assign({},O(this,st,
|
|
196
|
+
"f"),O(this,Dt,"f"))}getHelp(){if(ae(this,xe,!0,"f"),!O(this,de,"f").hasCachedHelpMessage()){if(!this.parsed){const t=this[Cr](O(this,vt,"f"),void 0,void 0,0,!0);if(Ae(t))return t.then(()=>O(this,de,"f").help())}const e=O(this,Re,"f").runDefaultBuilderOn(this);if(Ae(e))return e.then(()=>O(this,de,"f").help())}return Promise.resolve(O(this,de,"f").help())}getOptions(){return O(this,ue,"f")}getStrict(){return O(this,xt,"f")}getStrictCommands(){return O(this,Mt,"f")}getStrictOptions(){return O(this,
|
|
197
|
+
qt,"f")}global(e,t){return ce("<string|array> [boolean]",[e,t],arguments.length),e=[].concat(e),t!==!1?O(this,ue,"f").local=O(this,ue,"f").local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{O(this,ue,"f").local.includes(n)||O(this,ue,"f").local.push(n)}),this}group(e,t){ce("<string|array> <string>",[e,t],arguments.length);const n=O(this,Dt,"f")[t]||O(this,st,"f")[t];O(this,Dt,"f")[t]&&delete O(this,Dt,"f")[t];const s={};return O(this,st,"f")[t]=(n||[]).concat(e).filter(i=>s[i]?!1:s[i]=!0),this}hide(e){
|
|
198
|
+
return ce("<string>",[e],arguments.length),O(this,ue,"f").hiddenOptions.push(e),this}implies(e,t){return ce("<string|object> [number|string|array]",[e,t],arguments.length),O(this,Ee,"f").implies(e,t),this}locale(e){return ce("[string]",[e],arguments.length),e===void 0?(this[Js](),O(this,fe,"f").y18n.getLocale()):(ae(this,Lt,!1,"f"),O(this,fe,"f").y18n.setLocale(e),this)}middleware(e,t,n){return O(this,Be,"f").addMiddleware(e,!!t,n)}nargs(e,t){return ce("<string|object|array> [number]",[e,t],arguments.
|
|
199
|
+
length),this[Qt](this.nargs.bind(this),"narg",e,t),this}normalize(e){return ce("<array|string>",[e],arguments.length),this[bt]("normalize",e),this}number(e){return ce("<array|string>",[e],arguments.length),this[bt]("number",e),this[Ft](e),this}option(e,t){if(ce("<string|object> [object]",[e,t],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof t!="object"&&(t={}),this[Ft](e),O(this,it,"f")&&(e==="version"||t?.alias==="version")&&this[ec](['"version\
|
|
201
200
|
" 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(`
|
|
202
|
-
`),void 0,"versionWarning"),O(this,ue,"f").key[e]=!0,
|
|
203
|
-
|
|
204
|
-
"boolean"&&this.global(e,
|
|
205
|
-
|
|
206
|
-
this.parsed=i}):(O(this,Me,"f")&&O(this,Me,"f").call(this,O(this
|
|
207
|
-
let n=null;const s=this[
|
|
208
|
-
an"].includes(a)?!1:n.includes(o));const s=O(this,
|
|
209
|
-
e,
|
|
210
|
-
"f"),!O(this,de,"f").hasCachedHelpMessage()){if(!this.parsed){const n=this[
|
|
211
|
-
|
|
212
|
-
string>",[e],arguments.length),this[
|
|
213
|
-
command(e,
|
|
214
|
-
1){if(e===!1)return this;n=e,e=s}else arguments.length===2&&(n=
|
|
215
|
-
|
|
201
|
+
`),void 0,"versionWarning"),O(this,ue,"f").key[e]=!0,t.alias&&this.alias(e,t.alias);const n=t.deprecate||t.deprecated;n&&this.deprecateOption(e,n);const s=t.demand||t.required||t.require;s&&this.demand(e,s),t.demandOption&&this.demandOption(e,typeof t.demandOption=="string"?t.demandOption:void 0),t.conflicts&&this.conflicts(e,t.conflicts),"default"in t&&this.default(e,t.default),t.implies!==void 0&&this.implies(e,t.implies),t.nargs!==void 0&&this.nargs(e,t.nargs),t.config&&this.config(e,t.configParser),
|
|
202
|
+
t.normalize&&this.normalize(e),t.choices&&this.choices(e,t.choices),t.coerce&&this.coerce(e,t.coerce),t.group&&this.group(e,t.group),(t.boolean||t.type==="boolean")&&(this.boolean(e),t.alias&&this.boolean(t.alias)),(t.array||t.type==="array")&&(this.array(e),t.alias&&this.array(t.alias)),(t.number||t.type==="number")&&(this.number(e),t.alias&&this.number(t.alias)),(t.string||t.type==="string")&&(this.string(e),t.alias&&this.string(t.alias)),(t.count||t.type==="count")&&this.count(e),typeof t.global==
|
|
203
|
+
"boolean"&&this.global(e,t.global),t.defaultDescription&&(O(this,ue,"f").defaultDescription[e]=t.defaultDescription),t.skipValidation&&this.skipValidation(e);const i=t.describe||t.description||t.desc,o=O(this,de,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(o,e)||typeof i=="string")&&this.describe(e,i),t.hidden&&this.hide(e),t.requiresArg&&this.requiresArg(e)}return this}options(e,t){return this.option(e,t)}parse(e,t,n){ce("[string|array] [function|boolean|object] [function]",[e,
|
|
204
|
+
t,n],arguments.length),this[tc](),typeof e>"u"&&(e=O(this,vt,"f")),typeof t=="object"&&(ae(this,kt,t,"f"),t=n),typeof t=="function"&&(ae(this,Me,t,"f"),t=!1),t||ae(this,vt,e,"f"),O(this,Me,"f")&&ae(this,Ge,!1,"f");const s=this[Cr](e,!!t),i=this.parsed;return O(this,ze,"f").setParsed(this.parsed),Ae(s)?s.then(o=>(O(this,Me,"f")&&O(this,Me,"f").call(this,O(this,_t,"f"),o,O(this,Ce,"f")),o)).catch(o=>{throw O(this,Me,"f")&&O(this,Me,"f")(o,this.parsed.argv,O(this,Ce,"f")),o}).finally(()=>{this[ni](),
|
|
205
|
+
this.parsed=i}):(O(this,Me,"f")&&O(this,Me,"f").call(this,O(this,_t,"f"),s,O(this,Ce,"f")),this[ni](),this.parsed=i,s)}parseAsync(e,t,n){const s=this.parse(e,t,n);return Ae(s)?s:Promise.resolve(s)}parseSync(e,t,n){const s=this.parse(e,t,n);if(Ae(s))throw new Oe(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return s}parserConfiguration(e){return ce("<object>",[e],arguments.length),ae(this,rn,e,"f"),this}pkgConf(e,t){ce("<string> [string]",[e,t],arguments.length);
|
|
206
|
+
let n=null;const s=this[Qs](t||O(this,jt,"f"));return s[e]&&typeof s[e]=="object"&&(n=Ys(s[e],t||O(this,jt,"f"),this[Ut]()["deep-merge-config"]||!1,O(this,fe,"f")),O(this,ue,"f").configObjects=(O(this,ue,"f").configObjects||[]).concat(n)),this}positional(e,t){ce("<string> <object>",[e,t],arguments.length);const n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];t=Sr(t,(o,a)=>o==="type"&&!["string","number","boole\
|
|
207
|
+
an"].includes(a)?!1:n.includes(o));const s=O(this,Or,"f").fullCommands[O(this,Or,"f").fullCommands.length-1],i=s?O(this,Re,"f").cmdToParseOptions(s):{array:[],alias:{},default:{},demand:{}};return Yr(i).forEach(o=>{const a=i[o];Array.isArray(a)?a.indexOf(e)!==-1&&(t[o]=!0):a[e]&&!(o in t)&&(t[o]=a[e])}),this.group(e,O(this,de,"f").getPositionalGroupName()),this.option(e,t)}recommendCommands(e=!0){return ce("[boolean]",[e],arguments.length),ae(this,nn,e,"f"),this}required(e,t,n){return this.demand(
|
|
208
|
+
e,t,n)}require(e,t,n){return this.demand(e,t,n)}requiresArg(e){return ce("<array|string|object> [number]",[e],arguments.length),typeof e=="string"&&O(this,ue,"f").narg[e]?this:(this[Qt](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,t){return ce("[string] [string]",[e,t],arguments.length),e=e||this.$0,O(this,Xt,"f").log(O(this,ze,"f").generateCompletionScript(e,t||O(this,De,"f")||"completion")),this}showHelp(e){if(ce("[string|function]",[e],arguments.length),ae(this,xe,!0,
|
|
209
|
+
"f"),!O(this,de,"f").hasCachedHelpMessage()){if(!this.parsed){const n=this[Cr](O(this,vt,"f"),void 0,void 0,0,!0);if(Ae(n))return n.then(()=>{O(this,de,"f").showHelp(e)}),this}const t=O(this,Re,"f").runDefaultBuilderOn(this);if(Ae(t))return t.then(()=>{O(this,de,"f").showHelp(e)}),this}return O(this,de,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,t){return ce("[boolean|string] [string]",[e,t],arguments.length),O(this,de,"f").showHelpOnFail(e,
|
|
210
|
+
t),this}showVersion(e){return ce("[string|function]",[e],arguments.length),O(this,de,"f").showVersion(e),this}skipValidation(e){return ce("<array|string>",[e],arguments.length),this[bt]("skipValidation",e),this}strict(e){return ce("[boolean]",[e],arguments.length),ae(this,xt,e!==!1,"f"),this}strictCommands(e){return ce("[boolean]",[e],arguments.length),ae(this,Mt,e!==!1,"f"),this}strictOptions(e){return ce("[boolean]",[e],arguments.length),ae(this,qt,e!==!1,"f"),this}string(e){return ce("<array|\
|
|
211
|
+
string>",[e],arguments.length),this[bt]("string",e),this[Ft](e),this}terminalWidth(){return ce([],0),O(this,fe,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return ce("<object>",[e],arguments.length),ae(this,Lt,!1,"f"),O(this,fe,"f").y18n.updateLocale(e),this}usage(e,t,n,s){if(ce("<string|null|undefined> [string|boolean] [function|object] [function]",[e,t,n,s],arguments.length),t!==void 0){if(Je(e,null,O(this,fe,"f")),(e||"").match(/^\$0( |$)/))return this.
|
|
212
|
+
command(e,t,n,s);throw new Oe(".usage() description must start with $0 if being used as alias for .command()")}else return O(this,de,"f").usage(e),this}usageConfiguration(e){return ce("<object>",[e],arguments.length),ae(this,sn,e,"f"),this}version(e,t,n){const s="version";if(ce("[boolean|string] [string] [string]",[e,t,n],arguments.length),O(this,it,"f")&&(this[Xs](O(this,it,"f")),O(this,de,"f").version(void 0),ae(this,it,null,"f")),arguments.length===0)n=this[sc](),e=s;else if(arguments.length===
|
|
213
|
+
1){if(e===!1)return this;n=e,e=s}else arguments.length===2&&(n=t,t=void 0);return ae(this,it,typeof e=="string"?e:s,"f"),t=t||O(this,de,"f").deferY18nLookup("Show version number"),O(this,de,"f").version(n||void 0),this.boolean(O(this,it,"f")),this.describe(O(this,it,"f"),t),this}wrap(e){return ce("<number|null|undefined>",[e],arguments.length),O(this,de,"f").wrap(e),this}[(Re=new WeakMap,jt=new WeakMap,Or=new WeakMap,ze=new WeakMap,De=new WeakMap,Jr=new WeakMap,_t=new WeakMap,Lt=new WeakMap,Qr=new WeakMap,
|
|
214
|
+
Ge=new WeakMap,Zr=new WeakMap,Be=new WeakMap,st=new WeakMap,xe=new WeakMap,We=new WeakMap,en=new WeakMap,Xt=new WeakMap,Ce=new WeakMap,ue=new WeakMap,tn=new WeakMap,rn=new WeakMap,Me=new WeakMap,kt=new WeakMap,Jt=new WeakMap,Dt=new WeakMap,vt=new WeakMap,nn=new WeakMap,fe=new WeakMap,xt=new WeakMap,Mt=new WeakMap,qt=new WeakMap,de=new WeakMap,sn=new WeakMap,it=new WeakMap,Ee=new WeakMap,Qa)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[Za](){return{
|
|
216
215
|
log:(...e)=>{this[on]()||console.log(...e),ae(this,xe,!0,"f"),O(this,Ce,"f").length&&ae(this,Ce,O(this,Ce,"f")+`
|
|
217
216
|
`,"f"),ae(this,Ce,O(this,Ce,"f")+e.join(" "),"f")},error:(...e)=>{this[on]()||console.error(...e),ae(this,xe,!0,"f"),O(this,Ce,"f").length&&ae(this,Ce,O(this,Ce,"f")+`
|
|
218
|
-
`,"f"),ae(this,Ce,O(this,Ce,"f")+e.join(" "),"f")}}}[
|
|
219
|
-
this,
|
|
220
|
-
process.argv().slice(1,2):
|
|
221
|
-
this,fe,"f").getEnv("LC_ALL")||O(this,fe,"f").getEnv("LC_MESSAGES")||O(this,fe,"f").getEnv("LANG")||O(this,fe,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[
|
|
222
|
-
O(this,fe,"f").mainFilename;!e&&O(this,fe,"f").path.extname(s)&&(s=O(this,fe,"f").path.dirname(s));const i=O(this,fe,"f").findUp(s,(o,a)=>{if(a.includes("package.json"))return"package.json"});
|
|
223
|
-
|
|
224
|
-
f=this,h=this,{options:{set value(y){ae(e,ue,y,"f")}}.value,configObjects:b,exitProcess:{set value(y){ae(
|
|
225
|
-
ae(u,
|
|
226
|
-
bind(this),getUsageConfiguration:this[
|
|
227
|
-
return O(this,
|
|
228
|
-
|
|
229
|
-
ue,"f")[o]||[]).filter(a=>!n[a])}),i.forEach(o=>{
|
|
230
|
-
this,fe,"f")),"f"),O(this,
|
|
231
|
-
O(this,ue,"f"),{configuration:{"parse-positional-numbers":!1,...c}})),u=Object.assign(l.argv,O(this,
|
|
232
|
-
en,!1,"f");const y=O(this,Re,"f").getCommands(),d=O(this,
|
|
233
|
-
|
|
234
|
-
o=!0,this.showHelp("log"),this.exit(0)):b&&(O(this,
|
|
235
|
-
Oe)O(this,de,"f").fail(y.message,y);else throw y}return this[
|
|
236
|
-
Ee,"f").conflicting(o)}}[
|
|
237
|
-
uld be on PATH)',default:ut()}
|
|
238
|
-
s being served from, e.g. "/" or "/pages/"'},
|
|
239
|
-
s!==n&&s!==i;){const o=me.isAbsolute(
|
|
217
|
+
`,"f"),ae(this,Ce,O(this,Ce,"f")+e.join(" "),"f")}}}[Xs](e){Yr(O(this,ue,"f")).forEach(t=>{if((s=>s==="configObjects")(t))return;const n=O(this,ue,"f")[t];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete O(this,de,"f").getDescriptions()[e]}[ec](e,t,n){O(this,Qr,"f")[n]||(O(this,fe,"f").process.emitWarning(e,t),O(this,Qr,"f")[n]=!0)}[tc](){O(this,Zr,"f").push({options:O(this,ue,"f"),configObjects:O(this,ue,"f").configObjects.slice(0),exitProcess:O(
|
|
218
|
+
this,Ge,"f"),groups:O(this,st,"f"),strict:O(this,xt,"f"),strictCommands:O(this,Mt,"f"),strictOptions:O(this,qt,"f"),completionCommand:O(this,De,"f"),output:O(this,Ce,"f"),exitError:O(this,_t,"f"),hasOutput:O(this,xe,"f"),parsed:this.parsed,parseFn:O(this,Me,"f"),parseContext:O(this,kt,"f")}),O(this,de,"f").freeze(),O(this,Ee,"f").freeze(),O(this,Re,"f").freeze(),O(this,Be,"f").freeze()}[rc](){let e="",t;return/\b(node|iojs|electron)(\.exe)?$/.test(O(this,fe,"f").process.argv()[0])?t=O(this,fe,"f").
|
|
219
|
+
process.argv().slice(1,2):t=O(this,fe,"f").process.argv().slice(0,1),e=t.map(n=>{const s=this[mc](O(this,jt,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&s.length<n.length?s:n}).join(" ").trim(),O(this,fe,"f").getEnv("_")&&O(this,fe,"f").getProcessArgvBin()===O(this,fe,"f").getEnv("_")&&(e=O(this,fe,"f").getEnv("_").replace(`${O(this,fe,"f").path.dirname(O(this,fe,"f").process.execPath())}/`,"")),e}[Ut](){return O(this,rn,"f")}[nc](){return O(this,sn,"f")}[Js](){if(!O(this,Lt,"f"))return;const e=O(
|
|
220
|
+
this,fe,"f").getEnv("LC_ALL")||O(this,fe,"f").getEnv("LC_MESSAGES")||O(this,fe,"f").getEnv("LANG")||O(this,fe,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[sc](){return this[Qs]().version||"unknown"}[ic](e){const t=e["--"]?e["--"]:e._;for(let n=0,s;(s=t[n])!==void 0;n++)O(this,fe,"f").Parser.looksLikeNumber(s)&&Number.isSafeInteger(Math.floor(parseFloat(`${s}`)))&&(t[n]=Number(s));return e}[Qs](e){const t=e||"*";if(O(this,Jt,"f")[t])return O(this,Jt,"f")[t];let n={};try{let s=e||
|
|
221
|
+
O(this,fe,"f").mainFilename;!e&&O(this,fe,"f").path.extname(s)&&(s=O(this,fe,"f").path.dirname(s));const i=O(this,fe,"f").findUp(s,(o,a)=>{if(a.includes("package.json"))return"package.json"});Je(i,void 0,O(this,fe,"f")),n=JSON.parse(O(this,fe,"f").readFileSync(i,"utf8"))}catch{}return O(this,Jt,"f")[t]=n||{},O(this,Jt,"f")[t]}[bt](e,t){t=[].concat(t),t.forEach(n=>{n=this[ti](n),O(this,ue,"f")[e].push(n)})}[Qt](e,t,n,s){this[ei](e,t,n,s,(i,o,a)=>{O(this,ue,"f")[i][o]=a})}[Zs](e,t,n,s){this[ei](e,
|
|
222
|
+
t,n,s,(i,o,a)=>{O(this,ue,"f")[i][o]=(O(this,ue,"f")[i][o]||[]).concat(a)})}[ei](e,t,n,s,i){if(Array.isArray(n))n.forEach(o=>{e(o,s)});else if((o=>typeof o=="object")(n))for(const o of Yr(n))e(o,n[o]);else i(t,this[ti](n),s)}[ti](e){return e==="__proto__"?"___proto___":e}[ri](e,t){return this[Qt](this[ri].bind(this),"key",e,t),this}[ni](){var e,t,n,s,i,o,a,c,l,u,f,h;const $=O(this,Zr,"f").pop();Je($,void 0,O(this,fe,"f"));let b;e=this,t=this,n=this,s=this,i=this,o=this,a=this,c=this,l=this,u=this,
|
|
223
|
+
f=this,h=this,{options:{set value(y){ae(e,ue,y,"f")}}.value,configObjects:b,exitProcess:{set value(y){ae(t,Ge,y,"f")}}.value,groups:{set value(y){ae(n,st,y,"f")}}.value,output:{set value(y){ae(s,Ce,y,"f")}}.value,exitError:{set value(y){ae(i,_t,y,"f")}}.value,hasOutput:{set value(y){ae(o,xe,y,"f")}}.value,parsed:this.parsed,strict:{set value(y){ae(a,xt,y,"f")}}.value,strictCommands:{set value(y){ae(c,Mt,y,"f")}}.value,strictOptions:{set value(y){ae(l,qt,y,"f")}}.value,completionCommand:{set value(y){
|
|
224
|
+
ae(u,De,y,"f")}}.value,parseFn:{set value(y){ae(f,Me,y,"f")}}.value,parseContext:{set value(y){ae(h,kt,y,"f")}}.value}=$,O(this,ue,"f").configObjects=b,O(this,de,"f").unfreeze(),O(this,Ee,"f").unfreeze(),O(this,Re,"f").unfreeze(),O(this,Be,"f").unfreeze()}[oc](e,t){return Er(t,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[ac].bind(this),getContext:this[cc].bind(this),getHasOutput:this[uc].bind(this),getLoggerInstance:this[lc].bind(this),getParseContext:this[fc].bind(this),getParserConfiguration:this[Ut].
|
|
225
|
+
bind(this),getUsageConfiguration:this[nc].bind(this),getUsageInstance:this[dc].bind(this),getValidationInstance:this[hc].bind(this),hasParseCallback:this[on].bind(this),isGlobalContext:this[pc].bind(this),postProcess:this[Ht].bind(this),reset:this[si].bind(this),runValidation:this[ii].bind(this),runYargsParserAndExecuteCommands:this[Cr].bind(this),setHasOutput:this[gc].bind(this)}}[ac](){return O(this,Re,"f")}[cc](){return O(this,Or,"f")}[uc](){return O(this,xe,"f")}[lc](){return O(this,Xt,"f")}[fc](){
|
|
226
|
+
return O(this,kt,"f")||{}}[dc](){return O(this,de,"f")}[hc](){return O(this,Ee,"f")}[on](){return!!O(this,Me,"f")}[pc](){return O(this,en,"f")}[Ht](e,t,n,s){return n||Ae(e)||(t||(e=this[Qa](e)),(this[Ut]()["parse-positional-numbers"]||this[Ut]()["parse-positional-numbers"]===void 0)&&(e=this[ic](e)),s&&(e=wr(e,this,O(this,Be,"f").getMiddleware(),!1))),e}[si](e={}){ae(this,ue,O(this,ue,"f")||{},"f");const t={};t.local=O(this,ue,"f").local||[],t.configObjects=O(this,ue,"f").configObjects||[];const n={};
|
|
227
|
+
t.local.forEach(o=>{n[o]=!0,(e[o]||[]).forEach(a=>{n[a]=!0})}),Object.assign(O(this,Dt,"f"),Object.keys(O(this,st,"f")).reduce((o,a)=>{const c=O(this,st,"f")[a].filter(l=>!(l in n));return c.length>0&&(o[a]=c),o},{})),ae(this,st,{},"f");const s=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],i=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return s.forEach(o=>{t[o]=(O(this,
|
|
228
|
+
ue,"f")[o]||[]).filter(a=>!n[a])}),i.forEach(o=>{t[o]=Sr(O(this,ue,"f")[o],a=>!n[a])}),t.envPrefix=O(this,ue,"f").envPrefix,ae(this,ue,t,"f"),ae(this,de,O(this,de,"f")?O(this,de,"f").reset(n):Lm(this,O(this,fe,"f")),"f"),ae(this,Ee,O(this,Ee,"f")?O(this,Ee,"f").reset(n):Vm(this,O(this,de,"f"),O(this,fe,"f")),"f"),ae(this,Re,O(this,Re,"f")?O(this,Re,"f").reset():Pm(O(this,de,"f"),O(this,Ee,"f"),O(this,Be,"f"),O(this,fe,"f")),"f"),O(this,ze,"f")||ae(this,ze,qm(this,O(this,de,"f"),O(this,Re,"f"),O(
|
|
229
|
+
this,fe,"f")),"f"),O(this,Be,"f").reset(),ae(this,De,null,"f"),ae(this,Ce,"","f"),ae(this,_t,null,"f"),ae(this,xe,!1,"f"),this.parsed=!1,this}[mc](e,t){return O(this,fe,"f").path.relative(e,t)}[Cr](e,t,n,s=0,i=!1){let o=!!n||i;e=e||O(this,vt,"f"),O(this,ue,"f").__=O(this,fe,"f").y18n.__,O(this,ue,"f").configuration=this[Ut]();const a=!!O(this,ue,"f").configuration["populate--"],c=Object.assign({},O(this,ue,"f").configuration,{"populate--":!0}),l=O(this,fe,"f").Parser.detailed(e,Object.assign({},
|
|
230
|
+
O(this,ue,"f"),{configuration:{"parse-positional-numbers":!1,...c}})),u=Object.assign(l.argv,O(this,kt,"f"));let f;const h=l.aliases;let $=!1,b=!1;Object.keys(u).forEach(y=>{y===O(this,We,"f")&&u[y]?$=!0:y===O(this,it,"f")&&u[y]&&(b=!0)}),u.$0=this.$0,this.parsed=l,s===0&&O(this,de,"f").clearCachedHelpMessage();try{if(this[Js](),t)return this[Ht](u,a,!!n,!1);O(this,We,"f")&&[O(this,We,"f")].concat(h[O(this,We,"f")]||[]).filter(m=>m.length>1).includes(""+u._[u._.length-1])&&(u._.pop(),$=!0),ae(this,
|
|
231
|
+
en,!1,"f");const y=O(this,Re,"f").getCommands(),d=O(this,ze,"f").completionKey in u,g=$||d||i;if(u._.length){if(y.length){let p;for(let m=s||0,_;u._[m]!==void 0;m++)if(_=String(u._[m]),y.includes(_)&&_!==O(this,De,"f")){const v=O(this,Re,"f").runCommand(_,this,l,m+1,i,$||b||i);return this[Ht](v,a,!!n,!1)}else if(!p&&_!==O(this,De,"f")){p=_;break}!O(this,Re,"f").hasDefaultCommand()&&O(this,nn,"f")&&p&&!g&&O(this,Ee,"f").recommendCommands(p,y)}O(this,De,"f")&&u._.includes(O(this,De,"f"))&&!d&&(O(this,
|
|
232
|
+
Ge,"f")&&Rr(!0),this.showCompletionScript(),this.exit(0))}if(O(this,Re,"f").hasDefaultCommand()&&!g){const p=O(this,Re,"f").runCommand(null,this,l,0,i,$||b||i);return this[Ht](p,a,!!n,!1)}if(d){O(this,Ge,"f")&&Rr(!0),e=[].concat(e);const p=e.slice(e.indexOf(`--${O(this,ze,"f").completionKey}`)+1);return O(this,ze,"f").getCompletion(p,(m,_)=>{if(m)throw new Oe(m.message);(_||[]).forEach(v=>{O(this,Xt,"f").log(v)}),this.exit(0)}),this[Ht](u,!a,!!n,!1)}if(O(this,xe,"f")||($?(O(this,Ge,"f")&&Rr(!0),
|
|
233
|
+
o=!0,this.showHelp("log"),this.exit(0)):b&&(O(this,Ge,"f")&&Rr(!0),o=!0,O(this,de,"f").showVersion("log"),this.exit(0))),!o&&O(this,ue,"f").skipValidation.length>0&&(o=Object.keys(u).some(p=>O(this,ue,"f").skipValidation.indexOf(p)>=0&&u[p]===!0)),!o){if(l.error)throw new Oe(l.error.message);if(!d){const p=this[ii](h,{},l.error);n||(f=wr(u,this,O(this,Be,"f").getMiddleware(),!0)),f=this[oc](p,f??u),Ae(f)&&!n&&(f=f.then(()=>wr(u,this,O(this,Be,"f").getMiddleware(),!1)))}}}catch(y){if(y instanceof
|
|
234
|
+
Oe)O(this,de,"f").fail(y.message,y);else throw y}return this[Ht](f??u,a,!!n,!0)}[ii](e,t,n,s){const i={...this.getDemandedOptions()};return o=>{if(n)throw new Oe(n.message);O(this,Ee,"f").nonOptionCount(o),O(this,Ee,"f").requiredArguments(o,i);let a=!1;O(this,Mt,"f")&&(a=O(this,Ee,"f").unknownCommands(o)),O(this,xt,"f")&&!a?O(this,Ee,"f").unknownArguments(o,e,t,!!s):O(this,qt,"f")&&O(this,Ee,"f").unknownArguments(o,e,{},!1,!1),O(this,Ee,"f").limitedChoices(o),O(this,Ee,"f").implications(o),O(this,
|
|
235
|
+
Ee,"f").conflicting(o)}}[gc](){ae(this,xe,!0,"f")}[Ft](e){if(typeof e=="string")O(this,ue,"f").key[e]=!0;else for(const t of e)O(this,ue,"f").key[t]=!0}}function Km(r){return!!r&&typeof r.getInternalMethods=="function"}const Ym=Bm(wm),Zt={type:"string",desc:"<directory> with LikeC4 sources (default is current directory)",normalize:!0,default:".",coerce:ge},Ke={alias:"use-dot-bin",boolean:!0,type:"boolean",desc:ut()?"enabled in container, disable by --no-use-dot":'use graphviz binaries ("dot" sho\
|
|
236
|
+
uld be on PATH)',default:ut()},yc={boolean:!0,type:"boolean",desc:'use hash history for navigation, e.g. "/#/view" instead of "/view"'},Pr={alias:"o",type:"string",desc:"<directory> output directory",normalize:!0,coerce:ge},oi={alias:"w",type:"string",desc:'prefix for Webcomponents, e.g "c4" generates <c4-view ../>',default:"likec4"},$c={alias:"t",type:"string",desc:'base title of the app pages (default is "LikeC4")',default:"LikeC4"},_c={alias:["base-url"],type:"string",desc:'base url the app i\
|
|
237
|
+
s being served from, e.g. "/" or "/pages/"'},Xm={boolean:!0,type:"boolean",desc:"outputs a single self-contained HTML file with all required resources inlined"},Jm={alias:"l",type:"string",desc:ut()?"listen 0.0.0.0 by default in container":"ip address of the network interface to listen on",default:ut()?"0.0.0.0":"localhost"},vc=r=>r instanceof URL?Ea(r):r;function Qm(r,{cwd:e=Se.cwd(),type:t="file",stopAt:n}={}){let s=me.resolve(vc(e)??"");const{root:i}=me.parse(s);for(n=me.resolve(s,vc(n)??i);s&&
|
|
238
|
+
s!==n&&s!==i;){const o=me.isAbsolute(r)?r:me.join(s,r);try{const a=he.statSync(o,{throwIfNoEntry:!1});if(t==="file"&&a?.isFile()||t==="directory"&&a?.isDirectory())return o}catch{}s=me.dirname(s)}}function Zm({cwd:r=Se.cwd()}={}){return Qm("package.json",{cwd:r})}const eg=He("vite"),an=It(Ea(import.meta.url)),tg=`
|
|
240
239
|
/* prettier-ignore-start */
|
|
241
240
|
/* eslint-disable */
|
|
242
241
|
|
|
@@ -245,120 +244,120 @@ s!==n&&s!==i;){const o=me.isAbsolute(t)?t:me.join(s,t);try{const a=he.statSync(o
|
|
|
245
244
|
* DO NOT EDIT MANUALLY!
|
|
246
245
|
******************************************************************************/
|
|
247
246
|
|
|
248
|
-
`.trimStart(),
|
|
247
|
+
`.trimStart(),rg=`
|
|
249
248
|
|
|
250
249
|
/* prettier-ignore-end */
|
|
251
|
-
`,
|
|
250
|
+
`,ai={banner:tg,footer:rg};function bc(){const r=Zm({cwd:an});if(!r)throw new Error("likec4 package folder not found");return It(r)}function ci(){const r=bc(),e=[ge(r,"__app__"),ge(an,"../__app__"),ge(an,"../../__app__"),ge(an,"../../dist/__app__")],t=kh(e,Pt);if(!t)throw Ot.error(`likec4 app root does not exist, tried:
|
|
252
251
|
${e.join(`
|
|
253
|
-
`)}`),new Error("likec4 app root does not exist");return
|
|
254
|
-
`),
|
|
255
|
-
nodes[
|
|
256
|
-
"range"&&(n.type="text"),
|
|
257
|
-
nodes)c+=n(l);return c};return n(e)},
|
|
258
|
-
o be a number.");let m={relaxZeros:!0,...p};typeof m.strictZeros=="boolean"&&(m.relaxZeros=m.strictZeros===!1);let _=String(m.relaxZeros),v=String(m.shorthand),w=String(m.capture),S=String(m.wrap),I=d+":"+g+"="+_+v+w+S;if(e.cache.hasOwnProperty(I))return e.cache[I].result;let F=Math.min(d,g),
|
|
259
|
-
0){let U=
|
|
260
|
-
_),m+=1,_=f(g+1,m)-1;return v=[...v],v.sort(c),v}function s(d,g,p){if(d===g)return{pattern:d,count:[],digits:0};let m=a(d,g),_=m.length,v="",w=0;for(let S=0;S<_;S++){let[I,F]=m[S];I===F?v+=I:I!=="0"||F!=="9"?v+=$(I,F):w++}return w&&(v+=p.shorthand===!0?"\\d":"[0-9]"),{pattern:v,count:[w],digits:_}}function i(d,g,p,m){let _=n(d,g),v=[],w=d,S;for(let I=0;I<_.length;I++){let F=_[I],
|
|
261
|
-
|
|
262
|
-
repeat(g))}function f(d,g){return d-d%Math.pow(10,g)}function h(d){let[g=0,p=""]=d;return p||g>1?`{${g+(p?","+p:"")}}`:""}function $(d,g,p){return`[${d}${g-d===1?"":"-"}${g}]`}function b(d){return/^-?(0+)\d/.test(d)}function y(d,g,p){if(!g.isPadded)return d;let m=Math.abs(g.maxLen-String(d).length),_=p.relaxZeros!==!1;switch(m){case 0:return"";case 1:return _?"0?":"0";case 2:return _?"0{0,2}":"00";default:return _?`0{0,${m}}`:`0{${m}}`}}return e.cache={},e.clearCache=()=>e.cache={}
|
|
263
|
-
|
|
264
|
-
m):m},l=(m,_)=>{let v=m[0]==="-"?"-":"";for(v&&(m=m.slice(1),_--);m.length<_;)m="0"+m;return v?"-"+m:m},u=(m,_,v)=>{m.negatives.sort((
|
|
265
|
-
m);if(m===_)return S;let I=String.fromCharCode(_);return`[${S}-${I}]`},h=(m,_,v)=>{if(Array.isArray(m)){let w=v.wrap===!0,S=v.capture?"":"?:";return w?`(${S}${m.join("|")})`:m.join("|")}return e(m,_,v)},$=(...m)=>new RangeError("Invalid range arguments: "+
|
|
266
|
-
S)||!Number.isInteger(I)){if(w.strictRanges===!0)throw $([m,_]);return[]}S===0&&(S=0),I===0&&(I=0);let F=S>I,
|
|
267
|
-
v:S+v,H++;return w.toRegex===!0?v>1?u(G,w,
|
|
268
|
-
m,_,w);if(typeof v=="function")return p(m,_,1,{transform:v});if(
|
|
269
|
-
!0)return f+o.value;if(o.isClose===!0)return console.log("node.isClose",f,o.value),f+o.value;if(o.type==="open")return u?f+o.value:"(";if(o.type==="close")return u?f+o.value:")";if(o.type==="comma")return o.prev.type==="comma"?"":u?o.value:"|";if(o.value)return o.value;if(o.nodes&&o.ranges>0){const $=e.reduce(o.nodes),b=
|
|
270
|
-
|
|
271
|
-
for(;f.type!=="brace"&&f.type!=="root"&&f.parent;)f=f.parent,h=f.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 d=
|
|
272
|
-
const $=
|
|
252
|
+
`)}`),new Error("likec4 app root does not exist");return t}async function ui(){const r=await Fr(dr(Vr(),".likec4-public-"));return await Nt(dr(r,"likec4-views.js"),`// generated by likec4
|
|
253
|
+
`),r}const li=1e4;function fi(){const r=bc();return{"likec4/icons":ge(r,"icons"),"likec4/react":ge(r,"react"),"likec4/model":ge(r,"dist/model")}}var di={},wc;function hi(){return wc||(wc=1,function(r){r.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1,r.find=(e,t)=>e.nodes.find(n=>n.type===t),r.exceedsLimit=(e,t,n=1,s)=>s===!1||!r.isInteger(e)||!r.isInteger(t)?!1:(Number(t)-Number(e))/Number(n)>=s,r.escapeNode=(e,t=0,n)=>{const s=e.
|
|
254
|
+
nodes[t];s&&(n&&s.type===n||s.type==="open"||s.type==="close")&&s.escaped!==!0&&(s.value="\\"+s.value,s.escaped=!0)},r.encloseBrace=e=>e.type!=="brace"?!1:e.commas>>0+e.ranges>>0===0?(e.invalid=!0,!0):!1,r.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,r.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0,r.reduce=e=>e.reduce((t,n)=>(n.type==="text"&&t.push(n.value),n.type===
|
|
255
|
+
"range"&&(n.type="text"),t),[]),r.flatten=(...e)=>{const t=[],n=s=>{for(let i=0;i<s.length;i++){const o=s[i];if(Array.isArray(o)){n(o);continue}o!==void 0&&t.push(o)}return t};return n(e),t}}(di)),di}var pi,Ec;function mi(){if(Ec)return pi;Ec=1;const r=hi();return pi=(e,t={})=>{const n=(s,i={})=>{const o=t.escapeInvalid&&r.isInvalidBrace(i),a=s.invalid===!0&&t.escapeInvalid===!0;let c="";if(s.value)return(o||a)&&r.isOpenOrClose(s)?"\\"+s.value:s.value;if(s.value)return s.value;if(s.nodes)for(const l of s.
|
|
256
|
+
nodes)c+=n(l);return c};return n(e)},pi}var gi,Sc;function ng(){return Sc||(Sc=1,gi=function(r){return typeof r=="number"?r-r===0:typeof r=="string"&&r.trim()!==""?Number.isFinite?Number.isFinite(+r):isFinite(+r):!1}),gi}var yi,Rc;function sg(){if(Rc)return yi;Rc=1;const r=ng(),e=(d,g,p)=>{if(r(d)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(g===void 0||d===g)return String(d);if(r(g)===!1)throw new TypeError("toRegexRange: expected the second argument t\
|
|
257
|
+
o be a number.");let m={relaxZeros:!0,...p};typeof m.strictZeros=="boolean"&&(m.relaxZeros=m.strictZeros===!1);let _=String(m.relaxZeros),v=String(m.shorthand),w=String(m.capture),S=String(m.wrap),I=d+":"+g+"="+_+v+w+S;if(e.cache.hasOwnProperty(I))return e.cache[I].result;let F=Math.min(d,g),W=Math.max(d,g);if(Math.abs(F-W)===1){let U=d+"|"+g;return m.capture?`(${U})`:m.wrap===!1?U:`(?:${U})`}let k=b(d)||b(g),M={min:d,max:g,a:F,b:W},j=[],D=[];if(k&&(M.isPadded=k,M.maxLen=String(M.max).length),F<
|
|
258
|
+
0){let U=W<0?Math.abs(W):1;D=i(U,Math.abs(F),M,m),F=M.a=0}return W>=0&&(j=i(F,W,M,m)),M.negatives=D,M.positives=j,M.result=t(D,j),m.capture===!0?M.result=`(${M.result})`:m.wrap!==!1&&j.length+D.length>1&&(M.result=`(?:${M.result})`),e.cache[I]=M,M.result};function t(d,g,p){let m=o(d,g,"-",!1)||[],_=o(g,d,"",!1)||[],v=o(d,g,"-?",!0)||[];return m.concat(v).concat(_).join("|")}function n(d,g){let p=1,m=1,_=u(d,p),v=new Set([g]);for(;d<=_&&_<=g;)v.add(_),p+=1,_=u(d,p);for(_=f(g+1,m)-1;d<_&&_<=g;)v.add(
|
|
259
|
+
_),m+=1,_=f(g+1,m)-1;return v=[...v],v.sort(c),v}function s(d,g,p){if(d===g)return{pattern:d,count:[],digits:0};let m=a(d,g),_=m.length,v="",w=0;for(let S=0;S<_;S++){let[I,F]=m[S];I===F?v+=I:I!=="0"||F!=="9"?v+=$(I,F):w++}return w&&(v+=p.shorthand===!0?"\\d":"[0-9]"),{pattern:v,count:[w],digits:_}}function i(d,g,p,m){let _=n(d,g),v=[],w=d,S;for(let I=0;I<_.length;I++){let F=_[I],W=s(String(w),String(F),m),k="";if(!p.isPadded&&S&&S.pattern===W.pattern){S.count.length>1&&S.count.pop(),S.count.push(
|
|
260
|
+
W.count[0]),S.string=S.pattern+h(S.count),w=F+1;continue}p.isPadded&&(k=y(F,p,m)),W.string=k+W.pattern+h(W.count),v.push(W),w=F+1,S=W}return v}function o(d,g,p,m,_){let v=[];for(let w of d){let{string:S}=w;!m&&!l(g,"string",S)&&v.push(p+S),m&&l(g,"string",S)&&v.push(p+S)}return v}function a(d,g){let p=[];for(let m=0;m<d.length;m++)p.push([d[m],g[m]]);return p}function c(d,g){return d>g?1:g>d?-1:0}function l(d,g,p){return d.some(m=>m[g]===p)}function u(d,g){return Number(String(d).slice(0,-g)+"9".
|
|
261
|
+
repeat(g))}function f(d,g){return d-d%Math.pow(10,g)}function h(d){let[g=0,p=""]=d;return p||g>1?`{${g+(p?","+p:"")}}`:""}function $(d,g,p){return`[${d}${g-d===1?"":"-"}${g}]`}function b(d){return/^-?(0+)\d/.test(d)}function y(d,g,p){if(!g.isPadded)return d;let m=Math.abs(g.maxLen-String(d).length),_=p.relaxZeros!==!1;switch(m){case 0:return"";case 1:return _?"0?":"0";case 2:return _?"0{0,2}":"00";default:return _?`0{0,${m}}`:`0{${m}}`}}return e.cache={},e.clearCache=()=>e.cache={},yi=e,yi}var $i,
|
|
262
|
+
Ac;function Oc(){if(Ac)return $i;Ac=1;const r=va,e=sg(),t=m=>m!==null&&typeof m=="object"&&!Array.isArray(m),n=m=>_=>m===!0?Number(_):String(_),s=m=>typeof m=="number"||typeof m=="string"&&m!=="",i=m=>Number.isInteger(+m),o=m=>{let _=`${m}`,v=-1;if(_[0]==="-"&&(_=_.slice(1)),_==="0")return!1;for(;_[++v]==="0";);return v>0},a=(m,_,v)=>typeof m=="string"||typeof _=="string"?!0:v.stringify===!0,c=(m,_,v)=>{if(_>0){let w=m[0]==="-"?"-":"";w&&(m=m.slice(1)),m=w+m.padStart(w?_-1:_,"0")}return v===!1?String(
|
|
263
|
+
m):m},l=(m,_)=>{let v=m[0]==="-"?"-":"";for(v&&(m=m.slice(1),_--);m.length<_;)m="0"+m;return v?"-"+m:m},u=(m,_,v)=>{m.negatives.sort((W,k)=>W<k?-1:W>k?1:0),m.positives.sort((W,k)=>W<k?-1:W>k?1:0);let w=_.capture?"":"?:",S="",I="",F;return m.positives.length&&(S=m.positives.map(W=>l(String(W),v)).join("|")),m.negatives.length&&(I=`-(${w}${m.negatives.map(W=>l(String(W),v)).join("|")})`),S&&I?F=`${S}|${I}`:F=S||I,_.wrap?`(${w}${F})`:F},f=(m,_,v,w)=>{if(v)return e(m,_,{wrap:!1,...w});let S=String.fromCharCode(
|
|
264
|
+
m);if(m===_)return S;let I=String.fromCharCode(_);return`[${S}-${I}]`},h=(m,_,v)=>{if(Array.isArray(m)){let w=v.wrap===!0,S=v.capture?"":"?:";return w?`(${S}${m.join("|")})`:m.join("|")}return e(m,_,v)},$=(...m)=>new RangeError("Invalid range arguments: "+r.inspect(...m)),b=(m,_,v)=>{if(v.strictRanges===!0)throw $([m,_]);return[]},y=(m,_)=>{if(_.strictRanges===!0)throw new TypeError(`Expected step "${m}" to be a number`);return[]},d=(m,_,v=1,w={})=>{let S=Number(m),I=Number(_);if(!Number.isInteger(
|
|
265
|
+
S)||!Number.isInteger(I)){if(w.strictRanges===!0)throw $([m,_]);return[]}S===0&&(S=0),I===0&&(I=0);let F=S>I,W=String(m),k=String(_),M=String(v);v=Math.max(Math.abs(v),1);let j=o(W)||o(k)||o(M),D=j?Math.max(W.length,k.length,M.length):0,U=j===!1&&a(m,_,w)===!1,Y=w.transform||n(U);if(w.toRegex&&v===1)return f(l(m,D),l(_,D),!0,w);let G={negatives:[],positives:[]},J=A=>G[A<0?"negatives":"positives"].push(Math.abs(A)),se=[],H=0;for(;F?S>=I:S<=I;)w.toRegex===!0&&v>1?J(S):se.push(c(Y(S,H),D,U)),S=F?S-
|
|
266
|
+
v:S+v,H++;return w.toRegex===!0?v>1?u(G,w,D):h(se,null,{wrap:!1,...w}):se},g=(m,_,v=1,w={})=>{if(!i(m)&&m.length>1||!i(_)&&_.length>1)return b(m,_,w);let S=w.transform||(U=>String.fromCharCode(U)),I=`${m}`.charCodeAt(0),F=`${_}`.charCodeAt(0),W=I>F,k=Math.min(I,F),M=Math.max(I,F);if(w.toRegex&&v===1)return f(k,M,!1,w);let j=[],D=0;for(;W?I>=F:I<=F;)j.push(S(I,D)),I=W?I-v:I+v,D++;return w.toRegex===!0?h(j,null,{wrap:!1,options:w}):j},p=(m,_,v,w={})=>{if(_==null&&s(m))return[m];if(!s(m)||!s(_))return b(
|
|
267
|
+
m,_,w);if(typeof v=="function")return p(m,_,1,{transform:v});if(t(v))return p(m,_,0,v);let S={...w};return S.capture===!0&&(S.wrap=!0),v=v||S.step||1,i(v)?i(m)&&i(_)?d(m,_,v,S):g(m,_,Math.max(Math.abs(v),1),S):v!=null&&!t(v)?y(v,S):p(m,_,1,v)};return $i=p,$i}var _i,Cc;function ig(){if(Cc)return _i;Cc=1;const r=Oc(),e=hi();return _i=(n,s={})=>{const i=(o,a={})=>{const c=e.isInvalidBrace(a),l=o.invalid===!0&&s.escapeInvalid===!0,u=c===!0||l===!0,f=s.escapeInvalid===!0?"\\":"";let h="";if(o.isOpen===
|
|
268
|
+
!0)return f+o.value;if(o.isClose===!0)return console.log("node.isClose",f,o.value),f+o.value;if(o.type==="open")return u?f+o.value:"(";if(o.type==="close")return u?f+o.value:")";if(o.type==="comma")return o.prev.type==="comma"?"":u?o.value:"|";if(o.value)return o.value;if(o.nodes&&o.ranges>0){const $=e.reduce(o.nodes),b=r(...$,{...s,wrap:!1,toRegex:!0,strictZeros:!0});if(b.length!==0)return $.length>1&&b.length>1?`(${b})`:b}if(o.nodes)for(const $ of o.nodes)h+=i($,o);return h};return i(n)},_i}var vi,
|
|
269
|
+
Pc;function og(){if(Pc)return vi;Pc=1;const r=Oc(),e=mi(),t=hi(),n=(i="",o="",a=!1)=>{const c=[];if(i=[].concat(i),o=[].concat(o),!o.length)return i;if(!i.length)return a?t.flatten(o).map(l=>`{${l}}`):o;for(const l of i)if(Array.isArray(l))for(const u of l)c.push(n(u,o,a));else for(let u of o)a===!0&&typeof u=="string"&&(u=`{${u}}`),c.push(Array.isArray(u)?n(l,u,a):l+u);return t.flatten(c)};return vi=(i,o={})=>{const a=o.rangeLimit===void 0?1e3:o.rangeLimit,c=(l,u={})=>{l.queue=[];let f=u,h=u.queue;
|
|
270
|
+
for(;f.type!=="brace"&&f.type!=="root"&&f.parent;)f=f.parent,h=f.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 d=t.reduce(l.nodes);if(t.exceedsLimit(...d,o.step,a))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let g=r(...d,o);g.length===0&&(g=e(l,o)),h.push(n(h.pop(),g)),l.nodes=[];return}
|
|
271
|
+
const $=t.encloseBrace(l);let b=l.queue,y=l;for(;y.type!=="brace"&&y.type!=="root"&&y.parent;)y=y.parent,b=y.queue;for(let d=0;d<l.nodes.length;d++){const g=l.nodes[d];if(g.type==="comma"&&l.type==="brace"){d===1&&b.push(""),b.push("");continue}if(g.type==="close"){h.push(n(h.pop(),b,$));continue}if(g.value&&g.type!=="open"){b.push(n(b.pop(),g.value));continue}g.nodes&&c(g,l)}return b};return t.flatten(c(i))},vi}var bi,Ic;function ag(){return Ic||(Ic=1,bi={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"\
|
|
273
272
|
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:"\
|
|
274
273
|
{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
275
|
-
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}),
|
|
276
|
-
CHAR_LEFT_CURLY_BRACE:c,CHAR_RIGHT_CURLY_BRACE:l,CHAR_LEFT_SQUARE_BRACKET:u,CHAR_RIGHT_SQUARE_BRACKET:f,CHAR_DOUBLE_QUOTE:h,CHAR_SINGLE_QUOTE:$,CHAR_NO_BREAK_SPACE:b,CHAR_ZERO_WIDTH_NOBREAK_SPACE:y}=
|
|
277
|
-
let S=v,I=v,F=0;const
|
|
278
|
-
|
|
279
|
-
type:"brace",open:!0,close:!1,dollar:I.value&&I.value.slice(-1)==="$"||S.dollar===!0,depth:M,commas:0,ranges:0,nodes:[]};S=U(G),w.push(S),U({type:"open",value:j});continue}if(j===l){if(S.type!=="brace"){U({type:"text",value:j});continue}const Y="close";S=w.pop(),S.close=!0,U({type:Y,value:j}),M--,S=w[w.length-1];continue}if(j===s&&M>0){if(S.ranges>0){S.ranges=0;const Y=S.nodes.shift();S.nodes=[Y,{type:"text",value:
|
|
274
|
+
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}),bi}var wi,Nc;function cg(){if(Nc)return wi;Nc=1;const r=mi(),{MAX_LENGTH:e,CHAR_BACKSLASH:t,CHAR_BACKTICK:n,CHAR_COMMA:s,CHAR_DOT:i,CHAR_LEFT_PARENTHESES:o,CHAR_RIGHT_PARENTHESES:a,
|
|
275
|
+
CHAR_LEFT_CURLY_BRACE:c,CHAR_RIGHT_CURLY_BRACE:l,CHAR_LEFT_SQUARE_BRACKET:u,CHAR_RIGHT_SQUARE_BRACKET:f,CHAR_DOUBLE_QUOTE:h,CHAR_SINGLE_QUOTE:$,CHAR_NO_BREAK_SPACE:b,CHAR_ZERO_WIDTH_NOBREAK_SPACE:y}=ag();return wi=(g,p={})=>{if(typeof g!="string")throw new TypeError("Expected a string");const m=p||{},_=typeof m.maxLength=="number"?Math.min(e,m.maxLength):e;if(g.length>_)throw new SyntaxError(`Input length (${g.length}), exceeds max characters (${_})`);const v={type:"root",input:g,nodes:[]},w=[v];
|
|
276
|
+
let S=v,I=v,F=0;const W=g.length;let k=0,M=0,j;const D=()=>g[k++],U=Y=>{if(Y.type==="text"&&I.type==="dot"&&(I.type="text"),I&&I.type==="text"&&Y.type==="text"){I.value+=Y.value;return}return S.nodes.push(Y),Y.parent=S,Y.prev=I,I=Y,Y};for(U({type:"bos"});k<W;)if(S=w[w.length-1],j=D(),!(j===y||j===b)){if(j===t){U({type:"text",value:(p.keepEscaping?j:"")+D()});continue}if(j===f){U({type:"text",value:"\\"+j});continue}if(j===u){F++;let Y;for(;k<W&&(Y=D());){if(j+=Y,Y===u){F++;continue}if(Y===t){j+=
|
|
277
|
+
D();continue}if(Y===f&&(F--,F===0))break}U({type:"text",value:j});continue}if(j===o){S=U({type:"paren",nodes:[]}),w.push(S),U({type:"text",value:j});continue}if(j===a){if(S.type!=="paren"){U({type:"text",value:j});continue}S=w.pop(),U({type:"text",value:j}),S=w[w.length-1];continue}if(j===h||j===$||j===n){const Y=j;let G;for(p.keepQuotes!==!0&&(j="");k<W&&(G=D());){if(G===t){j+=G+D();continue}if(G===Y){p.keepQuotes===!0&&(j+=G);break}j+=G}U({type:"text",value:j});continue}if(j===c){M++;const G={
|
|
278
|
+
type:"brace",open:!0,close:!1,dollar:I.value&&I.value.slice(-1)==="$"||S.dollar===!0,depth:M,commas:0,ranges:0,nodes:[]};S=U(G),w.push(S),U({type:"open",value:j});continue}if(j===l){if(S.type!=="brace"){U({type:"text",value:j});continue}const Y="close";S=w.pop(),S.close=!0,U({type:Y,value:j}),M--,S=w[w.length-1];continue}if(j===s&&M>0){if(S.ranges>0){S.ranges=0;const Y=S.nodes.shift();S.nodes=[Y,{type:"text",value:r(S)}]}U({type:"comma",value:j}),S.commas++;continue}if(j===i&&M>0&&S.commas===0){
|
|
280
279
|
const Y=S.nodes;if(M===0||Y.length===0){U({type:"text",value:j});continue}if(I.type==="dot"){if(S.range=[],I.value+=j,I.type="range",S.nodes.length!==3&&S.nodes.length!==5){S.invalid=!0,S.ranges=0,I.type="text";continue}S.ranges++,S.args=[];continue}if(I.type==="range"){Y.pop();const G=Y[Y.length-1];G.value+=I.value+j,I=G,S.ranges--;continue}U({type:"dot",value:j});continue}U({type:"text",value:j})}do if(S=w.pop(),S.type!=="root"){S.nodes.forEach(J=>{J.nodes||(J.type==="open"&&(J.isOpen=!0),J.type===
|
|
281
|
-
"close"&&(J.isClose=!0),J.nodes||(J.type="text"),J.invalid=!0)});const Y=w[w.length-1],G=Y.nodes.indexOf(S);Y.nodes.splice(G,1,...S.nodes)}while(w.length>0);return U({type:"eos"}),v},
|
|
282
|
-
i,o),s.stringify=(i,o={})=>
|
|
283
|
-
=.)",c="[^/]",l=`(?:${o}|$)`,u=`(?:^|${o})`,f=`${n}{1,2}${l}`,h=`(?!${n})`,$=`(?!${u}${f})`,b=`(?!${n}{0,1}${l})`,y=`(?!${f})`,d=`[^.${o}]`,g=`${c}*?`,p={DOT_LITERAL:n,PLUS_LITERAL:s,QMARK_LITERAL:i,SLASH_LITERAL:o,ONE_CHAR:a,QMARK:c,END_ANCHOR:l,DOTS_SLASH:f,NO_DOT:h,NO_DOTS:$,NO_DOT_SLASH:b,NO_DOTS_SLASH:y,QMARK_NO_DOT:d,STAR:g,START_ANCHOR:u},m={...p,SLASH_LITERAL:`[${e}]`,QMARK:
|
|
284
|
-
NO_DOT_SLASH:`(?!${n}{0,1}(?:[${e}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${e}]|$))`,QMARK_NO_DOT:`[^.${e}]`,START_ANCHOR:`(?:^|[${e}])`,END_ANCHOR:`(?:[${e}]|$)`},_={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
|
|
280
|
+
"close"&&(J.isClose=!0),J.nodes||(J.type="text"),J.invalid=!0)});const Y=w[w.length-1],G=Y.nodes.indexOf(S);Y.nodes.splice(G,1,...S.nodes)}while(w.length>0);return U({type:"eos"}),v},wi}var Ei,Tc;function ug(){if(Tc)return Ei;Tc=1;const r=mi(),e=ig(),t=og(),n=cg(),s=(i,o={})=>{let a=[];if(Array.isArray(i))for(const c of i){const l=s.create(c,o);Array.isArray(l)?a.push(...l):a.push(l)}else a=[].concat(s.create(i,o));return o&&o.expand===!0&&o.nodupes===!0&&(a=[...new Set(a)]),a};return s.parse=(i,o={})=>n(
|
|
281
|
+
i,o),s.stringify=(i,o={})=>r(typeof i=="string"?s.parse(i,o):i,o),s.compile=(i,o={})=>(typeof i=="string"&&(i=s.parse(i,o)),e(i,o)),s.expand=(i,o={})=>{typeof i=="string"&&(i=s.parse(i,o));let a=t(i,o);return o.noempty===!0&&(a=a.filter(Boolean)),o.nodupes===!0&&(a=[...new Set(a)]),a},s.create=(i,o={})=>i===""||i.length<3?[i]:o.expand!==!0?s.compile(i,o):s.expand(i,o),Ei=s,Ei}var Si={},Ri,jc;function cn(){if(jc)return Ri;jc=1;const r=Ts,e="\\\\/",t=`[^${e}]`,n="\\.",s="\\+",i="\\?",o="\\/",a="(?\
|
|
282
|
+
=.)",c="[^/]",l=`(?:${o}|$)`,u=`(?:^|${o})`,f=`${n}{1,2}${l}`,h=`(?!${n})`,$=`(?!${u}${f})`,b=`(?!${n}{0,1}${l})`,y=`(?!${f})`,d=`[^.${o}]`,g=`${c}*?`,p={DOT_LITERAL:n,PLUS_LITERAL:s,QMARK_LITERAL:i,SLASH_LITERAL:o,ONE_CHAR:a,QMARK:c,END_ANCHOR:l,DOTS_SLASH:f,NO_DOT:h,NO_DOTS:$,NO_DOT_SLASH:b,NO_DOTS_SLASH:y,QMARK_NO_DOT:d,STAR:g,START_ANCHOR:u},m={...p,SLASH_LITERAL:`[${e}]`,QMARK:t,STAR:`${t}*?`,DOTS_SLASH:`${n}{1,2}(?:[${e}]|$)`,NO_DOT:`(?!${n})`,NO_DOTS:`(?!(?:^|[${e}])${n}{1,2}(?:[${e}]|$))`,
|
|
283
|
+
NO_DOT_SLASH:`(?!${n}{0,1}(?:[${e}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${e}]|$))`,QMARK_NO_DOT:`[^.${e}]`,START_ANCHOR:`(?:^|[${e}])`,END_ANCHOR:`(?:[${e}]|$)`},_={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 Ri={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:_,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,
|
|
285
284
|
REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,
|
|
286
285
|
CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,
|
|
287
|
-
CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:
|
|
288
|
-
platform==="win32",{REGEX_BACKSLASH:n,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:o}=cn();
|
|
289
|
-
a[0]===8&&a[1]>=10},
|
|
290
|
-
if(kc)return
|
|
291
|
-
|
|
292
|
-
!0,G=Z.isGlob=!0,E=!0,S===!0)continue;break}if(X===$&&(R--,R===0)){H=!1,U=Z.isBrace=!0,E=!0;break}}if(S===!0)continue;break}if(X===a){if(I.push(M),F.push(Z),Z={value:"",depth:0,isGlob:!1},E===!0)continue;if(C===i&&M===j+1){j+=2;continue}
|
|
286
|
+
CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:r.sep,extglobChars(v){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${v.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(v){return v===!0?m:p}},Ri}var Lc;function un(){return Lc||(Lc=1,function(r){const e=Ts,t=process.
|
|
287
|
+
platform==="win32",{REGEX_BACKSLASH:n,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:o}=cn();r.isObject=a=>a!==null&&typeof a=="object"&&!Array.isArray(a),r.hasRegexChars=a=>i.test(a),r.isRegexChar=a=>a.length===1&&r.hasRegexChars(a),r.escapeRegex=a=>a.replace(o,"\\$1"),r.toPosixSlashes=a=>a.replace(n,"/"),r.removeBackslashes=a=>a.replace(s,c=>c==="\\"?"":c),r.supportsLookbehinds=()=>{const a=process.version.slice(1).split(".").map(Number);return a.length===3&&a[0]>=9||
|
|
288
|
+
a[0]===8&&a[1]>=10},r.isWindows=a=>a&&typeof a.windows=="boolean"?a.windows:t===!0||e.sep==="\\",r.escapeLast=(a,c,l)=>{const u=a.lastIndexOf(c,l);return u===-1?a:a[u-1]==="\\"?r.escapeLast(a,c,u-1):`${a.slice(0,u)}\\${a.slice(u)}`},r.removePrefix=(a,c={})=>{let l=a;return l.startsWith("./")&&(l=l.slice(2),c.prefix="./"),l},r.wrapOutput=(a,c={},l={})=>{const u=l.contains?"":"^",f=l.contains?"":"$";let h=`${u}(?:${a})${f}`;return c.negated===!0&&(h=`(?:^(?!${h}).*$)`),h}}(Si)),Si}var Ai,kc;function lg(){
|
|
289
|
+
if(kc)return Ai;kc=1;const r=un(),{CHAR_ASTERISK:e,CHAR_AT:t,CHAR_BACKWARD_SLASH:n,CHAR_COMMA:s,CHAR_DOT:i,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:c,CHAR_LEFT_PARENTHESES:l,CHAR_LEFT_SQUARE_BRACKET:u,CHAR_PLUS:f,CHAR_QUESTION_MARK:h,CHAR_RIGHT_CURLY_BRACE:$,CHAR_RIGHT_PARENTHESES:b,CHAR_RIGHT_SQUARE_BRACKET:y}=cn(),d=m=>m===a||m===n,g=m=>{m.isPrefix!==!0&&(m.depth=m.isGlobstar?1/0:1)};return Ai=(m,_)=>{const v=_||{},w=m.length-1,S=v.parts===!0||v.scanToEnd===!0,I=[],F=[],
|
|
290
|
+
W=[];let k=m,M=-1,j=0,D=0,U=!1,Y=!1,G=!1,J=!1,se=!1,H=!1,A=!1,V=!1,x=!1,E=!1,R=0,C,X,Z={value:"",depth:0,isGlob:!1};const ie=()=>M>=w,oe=()=>k.charCodeAt(M+1),L=()=>(C=X,k.charCodeAt(++M));for(;M<w;){X=L();let T;if(X===n){A=Z.backslashes=!0,X=L(),X===c&&(H=!0);continue}if(H===!0||X===c){for(R++;ie()!==!0&&(X=L());){if(X===n){A=Z.backslashes=!0,L();continue}if(X===c){R++;continue}if(H!==!0&&X===i&&(X=L())===i){if(U=Z.isBrace=!0,G=Z.isGlob=!0,E=!0,S===!0)continue;break}if(H!==!0&&X===s){if(U=Z.isBrace=
|
|
291
|
+
!0,G=Z.isGlob=!0,E=!0,S===!0)continue;break}if(X===$&&(R--,R===0)){H=!1,U=Z.isBrace=!0,E=!0;break}}if(S===!0)continue;break}if(X===a){if(I.push(M),F.push(Z),Z={value:"",depth:0,isGlob:!1},E===!0)continue;if(C===i&&M===j+1){j+=2;continue}D=M+1;continue}if(v.noext!==!0&&(X===f||X===t||X===e||X===h||X===o)===!0&&oe()===l){if(G=Z.isGlob=!0,J=Z.isExtglob=!0,E=!0,X===o&&M===j&&(x=!0),S===!0){for(;ie()!==!0&&(X=L());){if(X===n){A=Z.backslashes=!0,X=L();continue}if(X===b){G=Z.isGlob=!0,E=!0;break}}continue}
|
|
293
292
|
break}if(X===e){if(C===e&&(se=Z.isGlobstar=!0),G=Z.isGlob=!0,E=!0,S===!0)continue;break}if(X===h){if(G=Z.isGlob=!0,E=!0,S===!0)continue;break}if(X===u){for(;ie()!==!0&&(T=L());){if(T===n){A=Z.backslashes=!0,L();continue}if(T===y){Y=Z.isBracket=!0,G=Z.isGlob=!0,E=!0;break}}if(S===!0)continue;break}if(v.nonegate!==!0&&X===o&&M===j){V=Z.negated=!0,j++;continue}if(v.noparen!==!0&&X===l){if(G=Z.isGlob=!0,S===!0){for(;ie()!==!0&&(X=L());){if(X===l){A=Z.backslashes=!0,X=L();continue}if(X===b){E=!0;break}}
|
|
294
|
-
continue}break}if(G===!0){if(E=!0,S===!0)continue;break}}v.noext===!0&&(J=!1,G=!1);let q=
|
|
295
|
-
if(v.tokens===!0&&(P.maxDepth=0,d(X)||F.push(Z),P.tokens=F),v.parts===!0||v.tokens===!0){let T;for(let ee=0;ee<I.length;ee++){const
|
|
296
|
-
if(
|
|
297
|
-
const h={...f},$=typeof h.maxLength=="number"?Math.min(
|
|
298
|
-
)*?)`,J=h.dot?"":
|
|
293
|
+
continue}break}if(G===!0){if(E=!0,S===!0)continue;break}}v.noext===!0&&(J=!1,G=!1);let q=k,Q="",ne="";j>0&&(Q=k.slice(0,j),k=k.slice(j),D-=j),q&&G===!0&&D>0?(q=k.slice(0,D),ne=k.slice(D)):G===!0?(q="",ne=k):q=k,q&&q!==""&&q!=="/"&&q!==k&&d(q.charCodeAt(q.length-1))&&(q=q.slice(0,-1)),v.unescape===!0&&(ne&&(ne=r.removeBackslashes(ne)),q&&A===!0&&(q=r.removeBackslashes(q)));const P={prefix:Q,input:m,start:j,base:q,glob:ne,isBrace:U,isBracket:Y,isGlob:G,isExtglob:J,isGlobstar:se,negated:V,negatedExtglob:x};
|
|
294
|
+
if(v.tokens===!0&&(P.maxDepth=0,d(X)||F.push(Z),P.tokens=F),v.parts===!0||v.tokens===!0){let T;for(let ee=0;ee<I.length;ee++){const K=T?T+1:j,N=I[ee],te=m.slice(K,N);v.tokens&&(ee===0&&j!==0?(F[ee].isPrefix=!0,F[ee].value=Q):F[ee].value=te,g(F[ee]),P.maxDepth+=F[ee].depth),(ee!==0||te!=="")&&W.push(te),T=N}if(T&&T+1<m.length){const ee=m.slice(T+1);W.push(ee),v.tokens&&(F[F.length-1].value=ee,g(F[F.length-1]),P.maxDepth+=F[F.length-1].depth)}P.slashes=I,P.parts=W}return P},Ai}var Oi,Dc;function fg(){
|
|
295
|
+
if(Dc)return Oi;Dc=1;const r=cn(),e=un(),{MAX_LENGTH:t,POSIX_REGEX_SOURCE:n,REGEX_NON_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_BACKREF:i,REPLACEMENTS:o}=r,a=(u,f)=>{if(typeof f.expandRange=="function")return f.expandRange(...u,f);u.sort();const h=`[${u.join("-")}]`;try{new RegExp(h)}catch{return u.map(b=>e.escapeRegex(b)).join("..")}return h},c=(u,f)=>`Missing ${u}: "${f}" - use "\\\\${f}" to match literal characters`,l=(u,f)=>{if(typeof u!="string")throw new TypeError("Expected a string");u=o[u]||u;
|
|
296
|
+
const h={...f},$=typeof h.maxLength=="number"?Math.min(t,h.maxLength):t;let b=u.length;if(b>$)throw new SyntaxError(`Input length: ${b}, exceeds maximum allowed length: ${$}`);const y={type:"bos",value:"",output:h.prepend||""},d=[y],g=h.capture?"":"?:",p=e.isWindows(f),m=r.globChars(p),_=r.extglobChars(m),{DOT_LITERAL:v,PLUS_LITERAL:w,SLASH_LITERAL:S,ONE_CHAR:I,DOTS_SLASH:F,NO_DOT:W,NO_DOT_SLASH:k,NO_DOTS_SLASH:M,QMARK:j,QMARK_NO_DOT:D,STAR:U,START_ANCHOR:Y}=m,G=N=>`(${g}(?:(?!${Y}${N.dot?F:v}).\
|
|
297
|
+
)*?)`,J=h.dot?"":W,se=h.dot?j:D;let H=h.bash===!0?G(h):U;h.capture&&(H=`(${H})`),typeof h.noext=="boolean"&&(h.noextglob=h.noext);const A={input:u,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:d};u=e.removePrefix(u,A),b=u.length;const V=[],x=[],E=[];let R=y,C;const X=()=>A.index===b-1,Z=A.peek=(N=1)=>u[A.index+N],ie=A.advance=()=>u[++A.index]||"",oe=()=>u.slice(A.index+1),L=(N="",te=0)=>{A.consumed+=
|
|
299
298
|
N,A.index+=te},q=N=>{A.output+=N.output!=null?N.output:N.value,L(N.value)},Q=()=>{let N=1;for(;Z()==="!"&&(Z(2)!=="("||Z(3)==="?");)ie(),A.start++,N++;return N%2===0?!1:(A.negated=!0,A.start++,!0)},ne=N=>{A[N]++,E.push(N)},P=N=>{A[N]--,E.pop()},T=N=>{if(R.type==="globstar"){const te=A.braces>0&&(N.type==="comma"||N.type==="brace"),z=N.extglob===!0||V.length&&(N.type==="pipe"||N.type==="paren");N.type!=="slash"&&N.type!=="paren"&&!te&&!z&&(A.output=A.output.slice(0,-R.output.length),R.type="star",
|
|
300
|
-
R.value="*",R.output=H,A.output+=R.output)}if(V.length&&N.type!=="paren"&&(V[V.length-1].inner+=N.value),(N.value||N.output)&&q(N),R&&R.type==="text"&&N.type==="text"){R.value+=N.value,R.output=(R.output||"")+N.value;return}N.prev=R,d.push(N),R=N},ee=(N,te)=>{const z={..._[te],conditions:1,inner:""};z.prev=R,z.parens=A.parens,z.output=A.output;const re=(h.capture?"(":"")+z.open;ne("parens"),T({type:N,value:te,output:A.output?"":I}),T({type:"paren",extglob:!0,value:ie(),output:re}),V.push(z)},
|
|
299
|
+
R.value="*",R.output=H,A.output+=R.output)}if(V.length&&N.type!=="paren"&&(V[V.length-1].inner+=N.value),(N.value||N.output)&&q(N),R&&R.type==="text"&&N.type==="text"){R.value+=N.value,R.output=(R.output||"")+N.value;return}N.prev=R,d.push(N),R=N},ee=(N,te)=>{const z={..._[te],conditions:1,inner:""};z.prev=R,z.parens=A.parens,z.output=A.output;const re=(h.capture?"(":"")+z.open;ne("parens"),T({type:N,value:te,output:A.output?"":I}),T({type:"paren",extglob:!0,value:ie(),output:re}),V.push(z)},K=N=>{
|
|
301
300
|
let te=N.close+(h.capture?")":""),z;if(N.type==="negate"){let re=H;if(N.inner&&N.inner.length>1&&N.inner.includes("/")&&(re=G(h)),(re!==H||X()||/^\)+$/.test(oe()))&&(te=N.close=`)$))${re}`),N.inner.includes("*")&&(z=oe())&&/^\.[^\\/.]+$/.test(z)){const le=l(z,{...f,fastpaths:!1}).output;te=N.close=`)${le})${re})`}N.prev.type==="bos"&&(A.negatedExtglob=!0)}T({type:"paren",extglob:!0,value:C,output:te}),P("parens")};if(h.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(u)){let N=!1,te=u.replace(i,(z,re,le,_e,we,ot)=>_e===
|
|
302
301
|
"\\"?(N=!0,z):_e==="?"?re?re+_e+(we?j.repeat(we.length):""):ot===0?se+(we?j.repeat(we.length):""):j.repeat(le.length):_e==="."?v.repeat(le.length):_e==="*"?re?re+_e+(we?H:""):H:re?z:`\\${z}`);return N===!0&&(h.unescape===!0?te=te.replace(/\\/g,""):te=te.replace(/\\+/g,z=>z.length%2===0?"\\\\":z?"\\":"")),te===u&&h.contains===!0?(A.output=u,A):(A.output=e.wrapOutput(te,A,f),A)}for(;!X();){if(C=ie(),C==="\0")continue;if(C==="\\"){const z=Z();if(z==="/"&&h.bash!==!0||z==="."||z===";")continue;if(!z){
|
|
303
302
|
C+="\\",T({type:"text",value:C});continue}const re=/^\\+/.exec(oe());let le=0;if(re&&re[0].length>2&&(le=re[0].length,A.index+=le,le%2!==0&&(C+="\\")),h.unescape===!0?C=ie():C+=ie(),A.brackets===0){T({type:"text",value:C});continue}}if(A.brackets>0&&(C!=="]"||R.value==="["||R.value==="[^")){if(h.posix!==!1&&C===":"){const z=R.value.slice(1);if(z.includes("[")&&(R.posix=!0,z.includes(":"))){const re=R.value.lastIndexOf("["),le=R.value.slice(0,re),_e=R.value.slice(re+2),we=n[_e];if(we){R.value=le+
|
|
304
303
|
we,A.backtrack=!0,ie(),!y.output&&d.indexOf(R)===1&&(y.output=I);continue}}}(C==="["&&Z()!==":"||C==="-"&&Z()==="]")&&(C=`\\${C}`),C==="]"&&(R.value==="["||R.value==="[^")&&(C=`\\${C}`),h.posix===!0&&C==="!"&&R.value==="["&&(C="^"),R.value+=C,q({value:C});continue}if(A.quotes===1&&C!=='"'){C=e.escapeRegex(C),R.value+=C,q({value:C});continue}if(C==='"'){A.quotes=A.quotes===1?0:1,h.keepQuotes===!0&&T({type:"text",value:C});continue}if(C==="("){ne("parens"),T({type:"paren",value:C});continue}if(C===
|
|
305
|
-
")"){if(A.parens===0&&h.strictBrackets===!0)throw new SyntaxError(c("opening","("));const z=V[V.length-1];if(z&&A.parens===z.parens+1){
|
|
304
|
+
")"){if(A.parens===0&&h.strictBrackets===!0)throw new SyntaxError(c("opening","("));const z=V[V.length-1];if(z&&A.parens===z.parens+1){K(V.pop());continue}T({type:"paren",value:C,output:A.parens?")":"\\)"}),P("parens");continue}if(C==="["){if(h.nobracket===!0||!oe().includes("]")){if(h.nobracket!==!0&&h.strictBrackets===!0)throw new SyntaxError(c("closing","]"));C=`\\${C}`}else ne("brackets");T({type:"bracket",value:C});continue}if(C==="]"){if(h.nobracket===!0||R&&R.type==="bracket"&&R.value.length===
|
|
306
305
|
1){T({type:"text",value:C,output:`\\${C}`});continue}if(A.brackets===0){if(h.strictBrackets===!0)throw new SyntaxError(c("opening","["));T({type:"text",value:C,output:`\\${C}`});continue}P("brackets");const z=R.value.slice(1);if(R.posix!==!0&&z[0]==="^"&&!z.includes("/")&&(C=`/${C}`),R.value+=C,q({value:C}),h.literalBrackets===!1||e.hasRegexChars(z))continue;const re=e.escapeRegex(R.value);if(A.output=A.output.slice(0,-R.value.length),h.literalBrackets===!0){A.output+=re,R.value=re;continue}R.value=
|
|
307
306
|
`(${g}${re}|${R.value})`,A.output+=R.value;continue}if(C==="{"&&h.nobrace!==!0){ne("braces");const z={type:"brace",value:C,output:"(",outputIndex:A.output.length,tokensIndex:A.tokens.length};x.push(z),T(z);continue}if(C==="}"){const z=x[x.length-1];if(h.nobrace===!0||!z){T({type:"text",value:C,output:C});continue}let re=")";if(z.dots===!0){const le=d.slice(),_e=[];for(let we=le.length-1;we>=0&&(d.pop(),le[we].type!=="brace");we--)le[we].type!=="dots"&&_e.unshift(le[we].value);re=a(_e,h),A.backtrack=
|
|
308
307
|
!0}if(z.comma!==!0&&z.dots!==!0){const le=A.output.slice(0,z.outputIndex),_e=A.tokens.slice(z.tokensIndex);z.value=z.output="\\{",C=re="\\}",A.output=le;for(const we of _e)A.output+=we.output||we.value}T({type:"brace",value:C,output:re}),P("braces"),x.pop();continue}if(C==="|"){V.length>0&&V[V.length-1].conditions++,T({type:"text",value:C});continue}if(C===","){let z=C;const re=x[x.length-1];re&&E[E.length-1]==="braces"&&(re.comma=!0,z="|"),T({type:"comma",value:C,output:z});continue}if(C==="/"){
|
|
309
308
|
if(R.type==="dot"&&A.index===A.start+1){A.start=A.index+1,A.consumed="",A.output="",d.pop(),R=y;continue}T({type:"slash",value:C,output:S});continue}if(C==="."){if(A.braces>0&&R.type==="dot"){R.value==="."&&(R.output=v);const z=x[x.length-1];R.type="dots",R.output+=C,R.value+=C,z.dots=!0;continue}if(A.braces+A.parens===0&&R.type!=="bos"&&R.type!=="slash"){T({type:"text",value:C,output:v});continue}T({type:"dot",value:C,output:v});continue}if(C==="?"){if(!(R&&R.value==="(")&&h.noextglob!==!0&&Z()===
|
|
310
|
-
"("&&Z(2)!=="?"){ee("qmark",C);continue}if(R&&R.type==="paren"){const re=Z();let le=C;if(re==="<"&&!e.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(R.value==="("&&!/[!=<:]/.test(re)||re==="<"&&!/<([!=]|\w+>)/.test(oe()))&&(le=`\\${C}`),T({type:"text",value:C,output:le});continue}if(h.dot!==!0&&(R.type==="slash"||R.type==="bos")){T({type:"qmark",value:C,output:
|
|
309
|
+
"("&&Z(2)!=="?"){ee("qmark",C);continue}if(R&&R.type==="paren"){const re=Z();let le=C;if(re==="<"&&!e.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(R.value==="("&&!/[!=<:]/.test(re)||re==="<"&&!/<([!=]|\w+>)/.test(oe()))&&(le=`\\${C}`),T({type:"text",value:C,output:le});continue}if(h.dot!==!0&&(R.type==="slash"||R.type==="bos")){T({type:"qmark",value:C,output:D});continue}T({type:"qmark",value:C,output:j});continue}if(C==="!"){if(h.noextglob!==
|
|
311
310
|
!0&&Z()==="("&&(Z(2)!=="?"||!/[!=<:]/.test(Z(3)))){ee("negate",C);continue}if(h.nonegate!==!0&&A.index===0){Q();continue}}if(C==="+"){if(h.noextglob!==!0&&Z()==="("&&Z(2)!=="?"){ee("plus",C);continue}if(R&&R.value==="("||h.regex===!1){T({type:"plus",value:C,output:w});continue}if(R&&(R.type==="bracket"||R.type==="paren"||R.type==="brace")||A.parens>0){T({type:"plus",value:C});continue}T({type:"plus",value:w});continue}if(C==="@"){if(h.noextglob!==!0&&Z()==="("&&Z(2)!=="?"){T({type:"at",extglob:!0,
|
|
312
311
|
value:C,output:""});continue}T({type:"text",value:C});continue}if(C!=="*"){(C==="$"||C==="^")&&(C=`\\${C}`);const z=s.exec(oe());z&&(C+=z[0],A.index+=z[0].length),T({type:"text",value:C});continue}if(R&&(R.type==="globstar"||R.star===!0)){R.type="star",R.star=!0,R.value+=C,R.output=H,A.backtrack=!0,A.globstar=!0,L(C);continue}let N=oe();if(h.noextglob!==!0&&/^\([^?]/.test(N)){ee("star",C);continue}if(R.type==="star"){if(h.noglobstar===!0){L(C);continue}const z=R.prev,re=z.prev,le=z.type==="slash"||
|
|
313
312
|
z.type==="bos",_e=re&&(re.type==="star"||re.type==="globstar");if(h.bash===!0&&(!le||N[0]&&N[0]!=="/")){T({type:"star",value:C,output:""});continue}const we=A.braces>0&&(z.type==="comma"||z.type==="brace"),ot=V.length&&(z.type==="pipe"||z.type==="paren");if(!le&&z.type!=="paren"&&!we&&!ot){T({type:"star",value:C,output:""});continue}for(;N.slice(0,3)==="/**";){const mt=u[A.index+4];if(mt&&mt!=="/")break;N=N.slice(3),L("/**",3)}if(z.type==="bos"&&X()){R.type="globstar",R.value+=C,R.output=G(h),A.
|
|
314
313
|
output=R.output,A.globstar=!0,L(C);continue}if(z.type==="slash"&&z.prev.type!=="bos"&&!_e&&X()){A.output=A.output.slice(0,-(z.output+R.output).length),z.output=`(?:${z.output}`,R.type="globstar",R.output=G(h)+(h.strictSlashes?")":"|$)"),R.value+=C,A.globstar=!0,A.output+=z.output+R.output,L(C);continue}if(z.type==="slash"&&z.prev.type!=="bos"&&N[0]==="/"){const mt=N[1]!==void 0?"|$":"";A.output=A.output.slice(0,-(z.output+R.output).length),z.output=`(?:${z.output}`,R.type="globstar",R.output=`${G(
|
|
315
314
|
h)}${S}|${S}${mt})`,R.value+=C,A.output+=z.output+R.output,A.globstar=!0,L(C+ie()),T({type:"slash",value:"/",output:""});continue}if(z.type==="bos"&&N[0]==="/"){R.type="globstar",R.value+=C,R.output=`(?:^|${S}|${G(h)}${S})`,A.output=R.output,A.globstar=!0,L(C+ie()),T({type:"slash",value:"/",output:""});continue}A.output=A.output.slice(0,-R.output.length),R.type="globstar",R.output=G(h),R.value+=C,A.output+=R.output,A.globstar=!0,L(C);continue}const te={type:"star",value:C,output:H};if(h.bash===!0){
|
|
316
|
-
te.output=".*?",(R.type==="bos"||R.type==="slash")&&(te.output=J+te.output),T(te);continue}if(R&&(R.type==="bracket"||R.type==="paren")&&h.regex===!0){te.output=C,T(te);continue}(A.index===A.start||R.type==="slash"||R.type==="dot")&&(R.type==="dot"?(A.output+=
|
|
315
|
+
te.output=".*?",(R.type==="bos"||R.type==="slash")&&(te.output=J+te.output),T(te);continue}if(R&&(R.type==="bracket"||R.type==="paren")&&h.regex===!0){te.output=C,T(te);continue}(A.index===A.start||R.type==="slash"||R.type==="dot")&&(R.type==="dot"?(A.output+=k,R.output+=k):h.dot===!0?(A.output+=M,R.output+=M):(A.output+=J,R.output+=J),Z()!=="*"&&(A.output+=I,R.output+=I)),T(te)}for(;A.brackets>0;){if(h.strictBrackets===!0)throw new SyntaxError(c("closing","]"));A.output=e.escapeLast(A.output,"["),
|
|
317
316
|
P("brackets")}for(;A.parens>0;){if(h.strictBrackets===!0)throw new SyntaxError(c("closing",")"));A.output=e.escapeLast(A.output,"("),P("parens")}for(;A.braces>0;){if(h.strictBrackets===!0)throw new SyntaxError(c("closing","}"));A.output=e.escapeLast(A.output,"{"),P("braces")}if(h.strictSlashes!==!0&&(R.type==="star"||R.type==="bracket")&&T({type:"maybe_slash",value:"",output:`${S}?`}),A.backtrack===!0){A.output="";for(const N of A.tokens)A.output+=N.output!=null?N.output:N.value,N.suffix&&(A.output+=
|
|
318
|
-
N.suffix)}return A};return l.fastpaths=(u,f)=>{const h={...f},$=typeof h.maxLength=="number"?Math.min(
|
|
319
|
-
noglobstar===!0?j:`(${
|
|
320
|
-
Y=e.removePrefix(u,M);let G=U(Y);return G&&h.strictSlashes!==!0&&(G+=`${g}?`),G},
|
|
317
|
+
N.suffix)}return A};return l.fastpaths=(u,f)=>{const h={...f},$=typeof h.maxLength=="number"?Math.min(t,h.maxLength):t,b=u.length;if(b>$)throw new SyntaxError(`Input length: ${b}, exceeds maximum allowed length: ${$}`);u=o[u]||u;const y=e.isWindows(f),{DOT_LITERAL:d,SLASH_LITERAL:g,ONE_CHAR:p,DOTS_SLASH:m,NO_DOT:_,NO_DOTS:v,NO_DOTS_SLASH:w,STAR:S,START_ANCHOR:I}=r.globChars(y),F=h.dot?v:_,W=h.dot?w:_,k=h.capture?"":"?:",M={negated:!1,prefix:""};let j=h.bash===!0?".*?":S;h.capture&&(j=`(${j})`);const D=J=>J.
|
|
318
|
+
noglobstar===!0?j:`(${k}(?:(?!${I}${J.dot?m:d}).)*?)`,U=J=>{switch(J){case"*":return`${F}${p}${j}`;case".*":return`${d}${p}${j}`;case"*.*":return`${F}${j}${d}${p}${j}`;case"*/*":return`${F}${j}${g}${p}${W}${j}`;case"**":return F+D(h);case"**/*":return`(?:${F}${D(h)}${g})?${W}${p}${j}`;case"**/*.*":return`(?:${F}${D(h)}${g})?${W}${j}${d}${p}${j}`;case"**/.*":return`(?:${F}${D(h)}${g})?${d}${p}${j}`;default:{const se=/^(.*?)\.(\w+)$/.exec(J);if(!se)return;const H=U(se[1]);return H?H+d+se[2]:void 0}}},
|
|
319
|
+
Y=e.removePrefix(u,M);let G=U(Y);return G&&h.strictSlashes!==!0&&(G+=`${g}?`),G},Oi=l,Oi}var Ci,xc;function dg(){if(xc)return Ci;xc=1;const r=Ts,e=lg(),t=fg(),n=un(),s=cn(),i=a=>a&&typeof a=="object"&&!Array.isArray(a),o=(a,c,l=!1)=>{if(Array.isArray(a)){const g=a.map(m=>o(m,c,l));return m=>{for(const _ of g){const v=_(m);if(v)return v}return!1}}const u=i(a)&&a.tokens&&a.input;if(a===""||typeof a!="string"&&!u)throw new TypeError("Expected pattern to be a non-empty string");const f=c||{},h=n.isWindows(
|
|
321
320
|
c),$=u?o.compileRe(a,c):o.makeRe(a,c,!1,!0),b=$.state;delete $.state;let y=()=>!1;if(f.ignore){const g={...c,ignore:null,onMatch:null,onResult:null};y=o(f.ignore,g,l)}const d=(g,p=!1)=>{const{isMatch:m,match:_,output:v}=o.test(g,$,c,{glob:a,posix:h}),w={glob:a,state:b,regex:$,posix:h,input:g,output:v,match:_,isMatch:m};return typeof f.onResult=="function"&&f.onResult(w),m===!1?(w.isMatch=!1,p?w:!1):y(g)?(typeof f.onIgnore=="function"&&f.onIgnore(w),w.isMatch=!1,p?w:!1):(typeof f.onMatch=="functi\
|
|
322
321
|
on"&&f.onMatch(w),p?w:!0)};return l&&(d.state=b),d};return o.test=(a,c,l,{glob:u,posix:f}={})=>{if(typeof a!="string")throw new TypeError("Expected input to be a string");if(a==="")return{isMatch:!1,output:""};const h=l||{},$=h.format||(f?n.toPosixSlashes:null);let b=a===u,y=b&&$?$(a):a;return b===!1&&(y=$?$(a):a,b=y===u),(b===!1||h.capture===!0)&&(h.matchBase===!0||h.basename===!0?b=o.matchBase(a,c,l,f):b=c.exec(y)),{isMatch:!!b,match:b,output:y}},o.matchBase=(a,c,l,u=n.isWindows(l))=>(c instanceof
|
|
323
|
-
RegExp?c:o.makeRe(c,l)).test(
|
|
324
|
-
mpty string");let f={negated:!1,fastpaths:!0};return c.fastpaths!==!1&&(a[0]==="."||a[0]==="*")&&(f.output=
|
|
325
|
-
{");return c>-1&&a.indexOf("}",c)>-1},o=(a,c,l)=>{c=[].concat(c),a=[].concat(a);let u=new Set,f=new Set,h=new Set,$=0,b=g=>{h.add(g.output),l&&l.onResult&&l.onResult(g)};for(let g=0;g<c.length;g++){let p=
|
|
326
|
-
`No matches found for "${c.join(", ")}"`);if(l.nonull===!0||l.nullglob===!0)return l.unescape?c.map(g=>g.replace(/\\/g,"")):c}return d};return o.match=o,o.matcher=(a,c)=>
|
|
327
|
-
ng: "${
|
|
328
|
-
some($=>h($)))return!0}return!1},o.every=(a,c,l)=>{let u=[].concat(a);for(let f of[].concat(c)){let h=
|
|
329
|
-
scan(...a),o.parse=(a,c)=>{let l=[];for(let u of[].concat(a||[]))for(let f of e(String(u),c))l.push(
|
|
330
|
-
function
|
|
331
|
-
</style>`)}const
|
|
332
|
-
`);const a={html:[],css:[],js:[],other:[]};for(const l of Object.keys(i))
|
|
333
|
-
h),f
|
|
334
|
-
output={});const e=
|
|
335
|
-
`).trimStart()}function
|
|
336
|
-
`).trimStart()}function
|
|
322
|
+
RegExp?c:o.makeRe(c,l)).test(r.basename(a)),o.isMatch=(a,c,l)=>o(c,l)(a),o.parse=(a,c)=>Array.isArray(a)?a.map(l=>o.parse(l,c)):t(a,{...c,fastpaths:!1}),o.scan=(a,c)=>e(a,c),o.compileRe=(a,c,l=!1,u=!1)=>{if(l===!0)return a.output;const f=c||{},h=f.contains?"":"^",$=f.contains?"":"$";let b=`${h}(?:${a.output})${$}`;a&&a.negated===!0&&(b=`^(?!${b}).*$`);const y=o.toRegex(b,c);return u===!0&&(y.state=a),y},o.makeRe=(a,c={},l=!1,u=!1)=>{if(!a||typeof a!="string")throw new TypeError("Expected a non-e\
|
|
323
|
+
mpty string");let f={negated:!1,fastpaths:!0};return c.fastpaths!==!1&&(a[0]==="."||a[0]==="*")&&(f.output=t.fastpaths(a,c)),f.output||(f=t(a,c)),o.compileRe(f,c,l,u)},o.toRegex=(a,c)=>{try{const l=c||{};return new RegExp(a,l.flags||(l.nocase?"i":""))}catch(l){if(c&&c.debug===!0)throw l;return/$^/}},o.constants=s,Ci=o,Ci}var Pi,Mc;function hg(){return Mc||(Mc=1,Pi=dg()),Pi}var Ii,qc;function pg(){if(qc)return Ii;qc=1;const r=va,e=ug(),t=hg(),n=un(),s=a=>a===""||a==="./",i=a=>{const c=a.indexOf("\
|
|
324
|
+
{");return c>-1&&a.indexOf("}",c)>-1},o=(a,c,l)=>{c=[].concat(c),a=[].concat(a);let u=new Set,f=new Set,h=new Set,$=0,b=g=>{h.add(g.output),l&&l.onResult&&l.onResult(g)};for(let g=0;g<c.length;g++){let p=t(String(c[g]),{...l,onResult:b},!0),m=p.state.negated||p.state.negatedExtglob;m&&$++;for(let _ of a){let v=p(_,!0);(m?!v.isMatch:v.isMatch)&&(m?u.add(v.output):(u.delete(v.output),f.add(v.output)))}}let d=($===c.length?[...h]:[...f]).filter(g=>!u.has(g));if(l&&d.length===0){if(l.failglob===!0)throw new Error(
|
|
325
|
+
`No matches found for "${c.join(", ")}"`);if(l.nonull===!0||l.nullglob===!0)return l.unescape?c.map(g=>g.replace(/\\/g,"")):c}return d};return o.match=o,o.matcher=(a,c)=>t(a,c),o.isMatch=(a,c,l)=>t(c,l)(a),o.any=o.isMatch,o.not=(a,c,l={})=>{c=[].concat(c).map(String);let u=new Set,f=[],h=b=>{l.onResult&&l.onResult(b),f.push(b.output)},$=new Set(o(a,c,{...l,onResult:h}));for(let b of f)$.has(b)||u.add(b);return[...u]},o.contains=(a,c,l)=>{if(typeof a!="string")throw new TypeError(`Expected a stri\
|
|
326
|
+
ng: "${r.inspect(a)}"`);if(Array.isArray(c))return c.some(u=>o.contains(a,u,l));if(typeof c=="string"){if(s(a)||s(c))return!1;if(a.includes(c)||a.startsWith("./")&&a.slice(2).includes(c))return!0}return o.isMatch(a,c,{...l,contains:!0})},o.matchKeys=(a,c,l)=>{if(!n.isObject(a))throw new TypeError("Expected the first argument to be an object");let u=o(Object.keys(a),c,l),f={};for(let h of u)f[h]=a[h];return f},o.some=(a,c,l)=>{let u=[].concat(a);for(let f of[].concat(c)){let h=t(String(f),l);if(u.
|
|
327
|
+
some($=>h($)))return!0}return!1},o.every=(a,c,l)=>{let u=[].concat(a);for(let f of[].concat(c)){let h=t(String(f),l);if(!u.every($=>h($)))return!1}return!0},o.all=(a,c,l)=>{if(typeof a!="string")throw new TypeError(`Expected a string: "${r.inspect(a)}"`);return[].concat(c).every(u=>t(u,l)(a))},o.capture=(a,c,l)=>{let u=n.isWindows(l),h=t.makeRe(String(a),{...l,capture:!0}).exec(u?n.toPosixSlashes(c):c);if(h)return h.slice(1).map($=>$===void 0?"":$)},o.makeRe=(...a)=>t.makeRe(...a),o.scan=(...a)=>t.
|
|
328
|
+
scan(...a),o.parse=(a,c)=>{let l=[];for(let u of[].concat(a||[]))for(let f of e(String(u),c))l.push(t.parse(f,c));return l},o.braces=(a,c)=>{if(typeof a!="string")throw new TypeError("Expected a string");return c&&c.nobrace===!0||!i(a)?[a]:e(a,c)},o.braceExpand=(a,c)=>{if(typeof a!="string")throw new TypeError("Expected a string");return o.braces(a,{...c,expand:!0})},o.hasBraces=i,Ii=o,Ii}var mg=pg();const Uc=Cs(mg),gg={useRecommendedBuildConfig:!0,removeViteModuleLoader:!1,deleteInlinedFiles:!0};
|
|
329
|
+
function yg(r,e,t,n=!1){const s=e.replaceAll(".","\\."),i=new RegExp(`<script([^>]*?) src="(?:[^"]*?/)?${s}"([^>]*)></script>`),o=/"?__VITE_PRELOAD__"?/g,a=t.replace(o,"void 0").replace(/<(\/script>|!--)/g,"\\x3C$1"),c=r.replace(i,(l,u,f)=>`<script${u}${f}>${a.trim()}</script>`);return n?Eg(c):c}function $g(r,e,t){const n=e.replaceAll(".","\\."),s=new RegExp(`<link([^>]*?) href="(?:[^"]*?/)?${n}"([^>]*)>`),i=t.replace('@charset "UTF-8";',"");return r.replace(s,(a,c,l)=>`<style${c}${l}>${i.trim()}\
|
|
330
|
+
</style>`)}const _g=/\.[mc]?js$/,vg=/\.css$/,bg=/\.html?$/;function wg({useRecommendedBuildConfig:r=!0,removeViteModuleLoader:e=!1,inlinePattern:t=[],deleteInlinedFiles:n=!0}=gg){return{name:"vite:singlefile",config:r?Sg:void 0,enforce:"post",generateBundle(s,i){const o=l=>this.info(`NOTE: asset not inlined: ${l}`);this.info(`
|
|
331
|
+
`);const a={html:[],css:[],js:[],other:[]};for(const l of Object.keys(i))bg.test(l)?a.html.push(l):vg.test(l)?a.css.push(l):_g.test(l)?a.js.push(l):a.other.push(l);const c=[];for(const l of a.html){const u=i[l];let f=u.source;for(const h of a.js){if(t.length&&!Uc.isMatch(h,t)){o(h);continue}const $=i[h];$.code!=null&&(this.info(`Inlining: ${h}`),c.push(h),f=yg(f,$.fileName,$.code,e))}for(const h of a.css){if(t.length&&!Uc.isMatch(h,t)){o(h);continue}const $=i[h];this.info(`Inlining: ${h}`),c.push(
|
|
332
|
+
h),f=$g(f,$.fileName,$.source)}u.source=f}if(n)for(const l of c)delete i[l];for(const l of a.other)o(l)}}}const Eg=r=>r.replace(/(<script type="module" crossorigin>\s*)\(function(?: polyfill)?\(\)\s*\{[\s\S]*?\}\)\(\);/,'<script type="module">'),Sg=r=>{r.build||(r.build={}),r.build.assetsInlineLimit=()=>!0,r.build.chunkSizeWarningLimit=1e8,r.build.cssCodeSplit=!1,r.base="./",r.build.assetsDir="",r.build.rollupOptions||(r.build.rollupOptions={}),r.build.rollupOptions.output||(r.build.rollupOptions.
|
|
333
|
+
output={});const e=t=>{t.inlineDynamicImports=!0};if(Array.isArray(r.build.rollupOptions.output))for(const t of r.build.rollupOptions.output)e(t);else e(r.build.rollupOptions.output)};function er(r){return r.length===0?"never":r.sort(yp).map(e=>` | ${JSON.stringify(e)}`).join(`
|
|
334
|
+
`).trimStart()}function Hc(r){const e=ca(r);return e.length===0?"never":ua(e,$p,Dh(t=>` | ${JSON.stringify(t.id)}`)).join(`
|
|
335
|
+
`).trimStart()}function Fc(r){return`
|
|
337
336
|
import type { Aux, SpecAux } from '@likec4/core/types';
|
|
338
337
|
|
|
339
338
|
export type $Specs = SpecAux<
|
|
340
339
|
// Element kinds
|
|
341
|
-
${
|
|
340
|
+
${er(lr(r.specification.elements))},
|
|
342
341
|
// Deployment kinds
|
|
343
|
-
${
|
|
342
|
+
${er(lr(r.specification.deployments??{}))},
|
|
344
343
|
// Relationship kinds
|
|
345
|
-
${
|
|
344
|
+
${er(lr(r.specification.relationships??{}))},
|
|
346
345
|
// Tags
|
|
347
|
-
${
|
|
346
|
+
${er(lr(r.specification.tags??{}))},
|
|
348
347
|
// Metadata keys
|
|
349
|
-
${
|
|
348
|
+
${er(r.specification.metadataKeys??[])}
|
|
350
349
|
>
|
|
351
350
|
|
|
352
351
|
export type $Aux = Aux<
|
|
353
|
-
${JSON.stringify(
|
|
352
|
+
${JSON.stringify(r.stage)},
|
|
354
353
|
// Elements
|
|
355
|
-
${
|
|
354
|
+
${Hc(r.$data.elements)},
|
|
356
355
|
// Deployments
|
|
357
|
-
${
|
|
356
|
+
${Hc(r.$data.deployments.elements)},
|
|
358
357
|
// Views
|
|
359
|
-
${
|
|
358
|
+
${er(lr(r.$data.views))},
|
|
360
359
|
// Project ID
|
|
361
|
-
${JSON.stringify(
|
|
360
|
+
${JSON.stringify(r.projectId)},
|
|
362
361
|
$Specs
|
|
363
362
|
>
|
|
364
363
|
|
|
@@ -372,7 +371,7 @@ export type $DeploymentKind = $Aux['DeploymentKind']
|
|
|
372
371
|
export type $Tag = $Aux['Tag']
|
|
373
372
|
export type $Tags = readonly $Aux['Tag'][]
|
|
374
373
|
export type $MetadataKey = $Aux['MetadataKey']
|
|
375
|
-
`.trimStart()}function
|
|
374
|
+
`.trimStart()}function Rg(r){const e=Fc(r),t=Sp(r.stage)+"LikeC4ModelData";return`
|
|
376
375
|
/* prettier-ignore-start */
|
|
377
376
|
/* eslint-disable */
|
|
378
377
|
|
|
@@ -382,13 +381,13 @@ export type $MetadataKey = $Aux['MetadataKey']
|
|
|
382
381
|
******************************************************************************/
|
|
383
382
|
|
|
384
383
|
import { LikeC4Model } from '@likec4/core/model'
|
|
385
|
-
import type { ${
|
|
384
|
+
import type { ${t} } from '@likec4/core/types'
|
|
386
385
|
${e}
|
|
387
386
|
|
|
388
|
-
export const likec4model: LikeC4Model<$Aux> = new LikeC4Model(<${
|
|
387
|
+
export const likec4model: LikeC4Model<$Aux> = new LikeC4Model(<${t}<$Aux>>(${Wt.stringify(r.$data,{space:2,quote:"'"})} as unknown))
|
|
389
388
|
|
|
390
389
|
/* prettier-ignore-end */
|
|
391
|
-
`.trimStart()}function
|
|
390
|
+
`.trimStart()}function Ag(r){return Sa(r,e=>Ra`${Wt.stringify(e.id)}`,{separator:" | "})}function Og(r){const e=Array.from(r),t=new lp;return t.appendTemplate`
|
|
392
391
|
/******************************************************************************
|
|
393
392
|
* This file was generated
|
|
394
393
|
* DO NOT EDIT MANUALLY!
|
|
@@ -399,10 +398,10 @@ export const likec4model: LikeC4Model<$Aux> = new LikeC4Model(<${r}<$Aux>>(${Bt.
|
|
|
399
398
|
// @ts-nocheck
|
|
400
399
|
|
|
401
400
|
import type { DiagramView } from 'likec4'
|
|
402
|
-
`.append(Kt,Kt),e.length===0?(
|
|
403
|
-
export type LikeC4ViewId = ${
|
|
401
|
+
`.append(Kt,Kt),e.length===0?(t.append("export {}",Kt),Aa(t)):(t.appendTemplate`
|
|
402
|
+
export type LikeC4ViewId = ${Ag(e)};
|
|
404
403
|
export const LikeC4Views = {
|
|
405
|
-
`.indent({indentation:2,indentedChildren(n){n.appendNewLineIf(e.length>1).append(
|
|
404
|
+
`.indent({indentation:2,indentedChildren(n){n.appendNewLineIf(e.length>1).append(Sa(e,s=>Ra`${Wt.stringify(s.id)}: (${Wt.stringify(s)} as unknown) as DiagramView`,{separator:",",appendNewLineIfNotEmpty:!0}))}}).append("} as const satisfies Record<LikeC4ViewId, DiagramView>",Kt,Kt).appendTemplate`
|
|
406
405
|
export type LikeC4Views = typeof LikeC4Views
|
|
407
406
|
|
|
408
407
|
export function isLikeC4ViewId(value: unknown): value is LikeC4ViewId {
|
|
@@ -414,7 +413,7 @@ export const likec4model: LikeC4Model<$Aux> = new LikeC4Model(<${r}<$Aux>>(${Bt.
|
|
|
414
413
|
}
|
|
415
414
|
|
|
416
415
|
/* prettier-ignore-end */
|
|
417
|
-
`.append(Kt),
|
|
416
|
+
`.append(Kt),Aa(t))}function Cg(r){return zr(!r.isParsed(),"can not generate react types for parsed model"),`
|
|
418
417
|
/* prettier-ignore-start */
|
|
419
418
|
/* eslint-disable */
|
|
420
419
|
|
|
@@ -432,7 +431,7 @@ import type {
|
|
|
432
431
|
ReactLikeC4Props as GenericReactLikeC4Props
|
|
433
432
|
} from 'likec4/react'
|
|
434
433
|
|
|
435
|
-
${
|
|
434
|
+
${Fc(r)}
|
|
436
435
|
|
|
437
436
|
declare function isLikeC4ViewId(value: unknown): value is $ViewId;
|
|
438
437
|
|
|
@@ -470,212 +469,212 @@ export {
|
|
|
470
469
|
ReactLikeC4
|
|
471
470
|
}
|
|
472
471
|
/* prettier-ignore-end */
|
|
473
|
-
`.trimStart()}const
|
|
474
|
-
webcomponentPrefix:c,title:l,root:s,languageServices:
|
|
475
|
-
likec4/vite-plugin/internal"],noDiscovery:!0},esbuild:{tsconfigRaw:{compilerOptions:{target:"ESNext",jsx:"react-jsx"}}},define:{WEBCOMPONENT_PREFIX:JSON.stringify(c),PAGE_TITLE:JSON.stringify(l),__USE_OVERVIEW_GRAPH__:i?"true":"false",__USE_HASH_HISTORY__:
|
|
476
|
-
nded"},...!u&&{input:[ge(s,"index.html"),ge(s,"src","main.js"),ge(s,"src","fonts.css"),ge(s,"src","style.css")],output:{compact:!0,manualChunks:f=>{if(f.includes("/likec4/node_modules/"))return"vendors"}}}}},customLogger:n,plugins:[xs(),Ms({languageServices:
|
|
477
|
-
|
|
478
|
-
lib:{entry:"src/webcomponent.tsx",fileName(a,c){return s},formats:["iife"],name:"LikeC4Views"},rollupOptions:{treeshake:{preset:"recommended"},output:{format:"iife",hoistTransitiveImports:!1,compact:!0}}},customLogger:i,plugins:[xs(),Ms({languageServices:
|
|
479
|
-
4-assets-"));const{isDev:a,...c}=await
|
|
480
|
-
c.customLogger.warn(`${
|
|
481
|
-
s`)}`)}if(
|
|
482
|
-
agent:["npm",0],run:
|
|
483
|
-
"upgrade-interactive":["yarn","upgrade-interactive",0],execute:["npx",0],"execute-local":
|
|
484
|
-
"pnpm","i","--frozen-lockfile",0],global:["pnpm","add","-g",0],add:["pnpm","add",0],upgrade:["pnpm","update",0],"upgrade-interactive":["pnpm","update","-i",0],execute:["pnpm","dlx",0],"execute-local":["pnpm","exec",0],uninstall:["pnpm","remove",0],global_uninstall:["pnpm","remove","--global",0]},
|
|
485
|
-
ractive":["bun","update",0],execute:["bun","x",0],"execute-local":["bun","x",0],uninstall:["bun","remove",0],global_uninstall:["bun","remove","-g",0]},
|
|
486
|
-
"deno","uninstall","-g",0]},
|
|
487
|
-
m","yarn.lock":"yarn","package-lock.json":"npm","npm-shrinkwrap.json":"npm"},
|
|
488
|
-
parse(e);for(;e&&e!==
|
|
489
|
-
e.json"),n);return l||{name:c,agent:c}}break}case"packageManager-field":case"devEngines-field":{const a=await
|
|
490
|
-
|
|
491
|
-
agent:n,version:a}):
|
|
492
|
-
react"} ${"react-dom"}`,process.exit(1));const e=
|
|
493
|
-
rver is not ready, no resolvedUrls");
|
|
494
|
-
`+"".padEnd(9," ")),
|
|
495
|
-
`+"".padEnd(9," ")):void 0].filter(e=>
|
|
496
|
-
`))}class
|
|
497
|
-
try{await
|
|
498
|
-
responding to the port you want excluded.");if(!Number.isSafeInteger(i))throw new TypeError(`Number ${i} in the exclude option is not a safe integer and can't be used`)}
|
|
499
|
-
if(!["EADDRINUSE","EACCES"].includes(i.code)&&!(i instanceof
|
|
500
|
-
s;i++)yield i}(
|
|
501
|
-
ng HMR: localhost:${$}`),ut()&&f.info(
|
|
502
|
-
warn(Ur(g)),f.warn("webcomponent build failed, ignoring error and continue")}})(),d}async function
|
|
503
|
-
tempt ${$} of ${i} after ${p}ms`)),await
|
|
504
|
-
|
|
505
|
-
`+y)),$<i&&(l.push({view:h,attempt:$+1}),n.info(
|
|
506
|
-
`${
|
|
507
|
-
`);const l=
|
|
508
|
-
`);const f=await u.newContext({deviceScaleFactor:2,colorScheme:
|
|
509
|
-
chromiumSandbox:u=!1}){const f=He("export"),h=
|
|
510
|
-
|
|
511
|
-
theme:
|
|
512
|
-
`),_.length!==g.length&&(o&&_.length>0?f.info(
|
|
513
|
-
output:o,outputSingleFile:a,base:c}){await Ir();const l=He("c4:build"),u=await
|
|
514
|
-
`),await
|
|
515
|
-
[path]",aliases:["bundle"],describe:"Build a static website",builder:
|
|
516
|
-
await
|
|
517
|
-
|
|
518
|
-
index";break}case"]":{if(n==="index"){e.push(Number.parseInt(
|
|
519
|
-
start":{e.push("");break}}return e}function
|
|
520
|
-
r
|
|
521
|
-
if(!
|
|
522
|
-
r,
|
|
523
|
-
|
|
524
|
-
AIN"||e==="EBUSY"||e==="EACCESS"||e==="EACCES"||e==="EACCS"||e==="EPERM"},onChangeError:
|
|
525
|
-
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
|
|
526
|
-
return
|
|
527
|
-
Ie(he.close),qe),fsync:
|
|
528
|
-
fsync:
|
|
529
|
-
renameSync:
|
|
530
|
-
SIGTERM"];
|
|
531
|
-
this.register=e=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}const
|
|
532
|
-
store[
|
|
533
|
-
|
|
534
|
-
retry.fsyncSync(n)(o):Ne.attempt.fsync(o)),Ne.retry.closeSync(n)(o),o=null,
|
|
535
|
-
Object.defineProperty(
|
|
536
|
-
|
|
537
|
-
const m=[g[0]];let _=0;for(;_<p.length;)a(m,p[_]),m.push(g[++_]);return new n(m)}
|
|
538
|
-
'""')return g;if(g==='""')return p;if(typeof g=="string")return p instanceof
|
|
539
|
-
h;function $(g){return JSON.stringify(g).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}
|
|
540
|
-
(
|
|
541
|
-
{},this._prefixes=l,this._parent=u}toName(l){return l instanceof e.Name?l:this.name(l)}name(l){return new e.Name(this._newName(l))}_newName(l){const u=this._names[l]||this._nameGroup(l);return`${l}${u.index++}`}_nameGroup(l){var u,f;if(!((f=(u=this._parent)===null||u===void 0?void 0:u._prefixes)===null||f===void 0)&&f.has(l)||this._prefixes&&!this._prefixes.has(l))throw new Error(`CodeGen: prefix "${l}" is not allowed in this scope`);return this._names[l]={prefix:l,index:0}}}
|
|
542
|
-
Name{constructor(l,u){super(u),this.prefix=l}setValue(l,{property:u,itemIndex:f}){this.value=l,this.scopePath=(0,e._)`.${new e.Name(u)}[${f}]`}}
|
|
472
|
+
`.trimStart()}const Ni=async({languageServices:r,likec4AssetsDir:e,...t})=>{const n=t.customLogger??eg,s=ci(),i=t?.useOverviewGraph===!0;n.info(`${B.cyan("likec4 app root")} ${B.dim(s)}`);const o=t.outputDir??ge(r.workspace,"dist");n.info(B.cyan("outDir")+" "+B.dim(o));let a="/";t.base&&(a=la(t.base),!xh(a)&&a!=="./"&&(a=Mh(a))),a!=="/"&&n.info(`${B.green("app base url")} ${B.dim(a)}`);const c=t.webcomponentPrefix??"likec4",l=t.title??"LikeC4",u=t.outputSingleFile??!1;return{isDev:!1,likec4AssetsDir:e,
|
|
473
|
+
webcomponentPrefix:c,title:l,root:s,languageServices:r,clearScreen:!1,base:a,resolve:{conditions:["production"],dedupe:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client"],alias:{...fi(),"likec4/previews":e}},configFile:!1,mode:"production",optimizeDeps:{include:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client","@likec4/core/types","@likec4/core/model","@likec4/core/compute-view/relationships","@likec4/core/utils","@likec4/core","\
|
|
474
|
+
likec4/vite-plugin/internal"],noDiscovery:!0},esbuild:{tsconfigRaw:{compilerOptions:{target:"ESNext",jsx:"react-jsx"}}},define:{WEBCOMPONENT_PREFIX:JSON.stringify(c),PAGE_TITLE:JSON.stringify(l),__USE_OVERVIEW_GRAPH__:i?"true":"false",__USE_HASH_HISTORY__:t?.useHashHistory===!0?"true":"false","process.env.NODE_ENV":'"production"'},build:{outDir:o,modulePreload:!1,emptyOutDir:!1,sourcemap:!1,cssMinify:!0,minify:!0,copyPublicDir:!0,chunkSizeWarningLimit:li,rollupOptions:{treeshake:{preset:"recomme\
|
|
475
|
+
nded"},...!u&&{input:[ge(s,"index.html"),ge(s,"src","main.js"),ge(s,"src","fonts.css"),ge(s,"src","style.css")],output:{compact:!0,manualChunks:f=>{if(f.includes("/likec4/node_modules/"))return"vendors"}}}}},customLogger:n,plugins:[xs(),Ms({languageServices:r.languageServices,useOverviewGraph:i}),u?wg():void 0].filter(Boolean)}};async function Ti({languageServices:r,outDir:e,base:t,webcomponentPrefix:n="likec4",filename:s="likec4-views.js"}){const i=He(["vite","webcomponent"]),o=ci();return i.info(
|
|
476
|
+
B.cyan("outDir")+" "+B.dim(e)),{root:o,clearScreen:!1,base:t,configFile:!1,publicDir:!1,mode:"production",resolve:{conditions:["production"],alias:fi(),dedupe:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client"]},define:{WEBCOMPONENT_PREFIX:JSON.stringify(n),"process.env.NODE_ENV":'"production"'},esbuild:{...ai,tsconfigRaw:{compilerOptions:{target:"ESNext",jsx:"react-jsx"}}},build:{outDir:e,emptyOutDir:!1,sourcemap:!1,minify:!0,assetsInlineLimit:100*1024,chunkSizeWarningLimit:li,
|
|
477
|
+
lib:{entry:"src/webcomponent.tsx",fileName(a,c){return s},formats:["iife"],name:"LikeC4Views"},rollupOptions:{treeshake:{preset:"recommended"},output:{format:"iife",hoistTransitiveImports:!1,compact:!0}}},customLogger:i,plugins:[xs(),Ms({languageServices:r.languageServices,useOverviewGraph:!1})]}}const Pg=["favicon.ico","robots.txt"],Ig=async({buildWebcomponent:r=!0,webcomponentPrefix:e="likec4",title:t,languageServices:n,likec4AssetsDir:s,outputSingleFile:i,...o})=>{s??=await Fr(dr(Vr(),".likec\
|
|
478
|
+
4-assets-"));const{isDev:a,...c}=await Ni({...o,languageServices:n,likec4AssetsDir:s,webcomponentPrefix:e,title:t,outputSingleFile:i}),l=await ui();for(const f of Pg){const h=ge(c.root,f);Pt(h)&&ya(h,ge(l,f))}const u=n.languageServices.projects();if(u.length===1){const f=await n.viewsService.computedViews(),h=await n.diagrams();if(h.length===0)throw process.exitCode=1,new Error("no views found");h.length===f.length?c.customLogger.info(`${B.dim("workspace:")} ${B.green("\u2713 all views layouted")}`):
|
|
479
|
+
c.customLogger.warn(`${B.dim("workspace:")} ${B.yellow(`\u2717 layouted ${h.length} of ${f.length} views`)}`),h.forEach($=>{$.hasLayoutDrift&&c.customLogger.warn(B.yellow("drift detected, manual layout can not be applied, view:")+" "+B.red($.id))})}else for(const f of u){const h=await n.viewsService.computedViews(f.id);h.length===0?c.customLogger.warn(`${B.dim("project:")} ${f.id} ${B.yellow("\u2717 no views found")}`):c.customLogger.info(`${B.dim("project:")} ${f.id} ${B.green(`${h.length} view\
|
|
480
|
+
s`)}`)}if(r){const f=await Ti({webcomponentPrefix:e,languageServices:n,outDir:l,base:c.base});await mr(f)}if(await mr({...c,publicDir:l,mode:"production"}),i)for(let f of Kh(ge(c.build.outDir)).filter(h=>h!=="index.html"))Is(ge(c.build.outDir,f),{recursive:!0});else{const f=ge(c.build.outDir,"index.html");Pt(f)&&ya(f,ge(c.build.outDir,"404.html"))}};function ji(r,e){return t=>t.length>1?[r,e,t[0],"--",...t.slice(1)]:[r,e,t[0]]}function Ng(){return r=>["deno","run",`npm:${r[0]}`,...r.slice(1)]}const Tg={
|
|
481
|
+
agent:["npm",0],run:ji("npm","run"),install:["npm","i",0],frozen:["npm","ci",0],global:["npm","i","-g",0],add:["npm","i",0],upgrade:["npm","update",0],"upgrade-interactive":null,execute:["npx",0],"execute-local":["npx",0],uninstall:["npm","uninstall",0],global_uninstall:["npm","uninstall","-g",0]},Vc={agent:["yarn",0],run:["yarn","run",0],install:["yarn","install",0],frozen:["yarn","install","--frozen-lockfile",0],global:["yarn","global","add",0],add:["yarn","add",0],upgrade:["yarn","upgrade",0],
|
|
482
|
+
"upgrade-interactive":["yarn","upgrade-interactive",0],execute:["npx",0],"execute-local":ji("yarn","exec"),uninstall:["yarn","remove",0],global_uninstall:["yarn","global","remove",0]},jg={...Vc,frozen:["yarn","install","--immutable",0],upgrade:["yarn","up",0],"upgrade-interactive":["yarn","up","-i",0],execute:["yarn","dlx",0],"execute-local":["yarn","exec",0],global:["npm","i","-g",0],global_uninstall:["npm","uninstall","-g",0]},zc={agent:["pnpm",0],run:["pnpm","run",0],install:["pnpm","i",0],frozen:[
|
|
483
|
+
"pnpm","i","--frozen-lockfile",0],global:["pnpm","add","-g",0],add:["pnpm","add",0],upgrade:["pnpm","update",0],"upgrade-interactive":["pnpm","update","-i",0],execute:["pnpm","dlx",0],"execute-local":["pnpm","exec",0],uninstall:["pnpm","remove",0],global_uninstall:["pnpm","remove","--global",0]},Lg={agent:["bun",0],run:["bun","run",0],install:["bun","install",0],frozen:["bun","install","--frozen-lockfile",0],global:["bun","add","-g",0],add:["bun","add",0],upgrade:["bun","update",0],"upgrade-inte\
|
|
484
|
+
ractive":["bun","update",0],execute:["bun","x",0],"execute-local":["bun","x",0],uninstall:["bun","remove",0],global_uninstall:["bun","remove","-g",0]},kg={agent:["deno",0],run:["deno","task",0],install:["deno","install",0],frozen:["deno","install","--frozen",0],global:["deno","install","-g",0],add:["deno","add",0],upgrade:["deno","outdated","--update",0],"upgrade-interactive":["deno","outdated","--update",0],execute:Ng(),"execute-local":["deno","task","--eval",0],uninstall:["deno","remove",0],global_uninstall:[
|
|
485
|
+
"deno","uninstall","-g",0]},Dg={npm:Tg,yarn:Vc,"yarn@berry":jg,pnpm:zc,"pnpm@6":{...zc,run:ji("pnpm","run")},bun:Lg,deno:kg};function xg(r,e,t){const n=Dg[r][e];return Mg(n,t)}function Mg(r,e){if(r==null)return null;const t=typeof r=="function"?r(e):r.flatMap(n=>typeof n=="number"?e:[n]);return{command:t[0],args:t.slice(1)}}const qg=["npm","yarn","yarn@berry","pnpm","pnpm@6","bun","deno"],Gc={"bun.lock":"bun","bun.lockb":"bun","deno.lock":"deno","pnpm-lock.yaml":"pnpm","pnpm-workspace.yaml":"pnp\
|
|
486
|
+
m","yarn.lock":"yarn","package-lock.json":"npm","npm-shrinkwrap.json":"npm"},Bc={"node_modules/.deno/":"deno","node_modules/.pnpm/":"pnpm","node_modules/.yarn-state.yml":"yarn","node_modules/.yarn_integrity":"yarn","node_modules/.package-lock.json":"npm",".pnp.cjs":"yarn",".pnp.js":"yarn","bun.lock":"bun","bun.lockb":"bun"};async function Li(r,e){try{const t=await wa.stat(r);return e==="file"?t.isFile():t.isDirectory()}catch{return!1}}function*Ug(r=Se.cwd()){let e=me.resolve(r);const{root:t}=me.
|
|
487
|
+
parse(e);for(;e&&e!==t;)yield e,e=me.dirname(e)}async function Wc(r,e){return!r||!Li(r,"file")?null:await Vg(r,e)}async function Hg(r={}){const{cwd:e,strategies:t=["lockfile","packageManager-field","devEngines-field"],onUnknown:n}=r;let s;if(typeof r.stopDir=="string"){const i=me.resolve(r.stopDir);s=o=>o===i}else s=r.stopDir;for(const i of Ug(e)){for(const o of t)switch(o){case"lockfile":{for(const a of Object.keys(Gc))if(await Li(me.join(i,a),"file")){const c=Gc[a],l=await Wc(me.join(i,"packag\
|
|
488
|
+
e.json"),n);return l||{name:c,agent:c}}break}case"packageManager-field":case"devEngines-field":{const a=await Wc(me.join(i,"package.json"),n);if(a)return a;break}case"install-metadata":{for(const a of Object.keys(Bc)){const c=a.endsWith("/")?"dir":"file";if(await Li(me.join(i,a),c)){const l=Bc[a],u=l==="yarn"?zg(a)?"yarn":"yarn@berry":l;return{name:l,agent:u}}}break}}if(s?.(i))break}return null}function Fg(r){const e=t=>t?.match(/\d+(\.\d+){0,2}/)?.[0]??t;if(typeof r.packageManager=="string"){const[
|
|
489
|
+
t,n]=r.packageManager.replace(/^\^/,"").split("@");return{name:t,ver:e(n)}}if(typeof r.devEngines?.packageManager?.name=="string")return{name:r.devEngines.packageManager.name,ver:e(r.devEngines.packageManager.version)}}async function Vg(r,e){try{const t=JSON.parse(await wa.readFile(r,"utf8"));let n;const s=Fg(t);if(s){const i=s.name,o=s.ver;let a=o;return i==="yarn"&&o&&Number.parseInt(o)>1?(n="yarn@berry",a="berry",{name:i,agent:n,version:a}):i==="pnpm"&&o&&Number.parseInt(o)<7?(n="pnpm@6",{name:i,
|
|
490
|
+
agent:n,version:a}):qg.includes(i)?(n=i,{name:i,agent:n,version:a}):e?.(t.packageManager)??null}}catch{}return null}function zg(r){return r.endsWith(".yarn_integrity")}function Kc(r){try{return!!gp.createRequire(import.meta.url).resolve(r)}catch(e){return at.debug(Ur(e)),!1}}async function Ir(){if(Kc("react")&&Kc("react-dom")){at.debug("react already installed");return}at.debug("react not installed");const r=await Hg();r||(at.error`Package manager not detected, please install dependencies manually: ${"\
|
|
491
|
+
react"} ${"react-dom"}`,process.exit(1));const e=xg(r.agent,"add",["react","react-dom"]);e||(at.error`Please install dependencies manually: ${"react"} ${"react-dom"}`,process.exit(1));try{await fa(e.command,e.args,{stdio:"inherit"})}catch(t){at.debug(Ur(t)),at.error`Please install dependencies manually: ${"react"} ${"react-dom"}`,process.exit(1)}}function Yc(r){if(r.resolvedUrls)return da(r.resolvedUrls.network)??da(r.resolvedUrls.local)}function Xc(r){if(!r.resolvedUrls)throw new Error("Vite se\
|
|
492
|
+
rver is not ready, no resolvedUrls");gt([B.green("LikeC4 served at:"),"",B.dim("Local: ")+r.resolvedUrls.local.join(`
|
|
493
|
+
`+"".padEnd(9," ")),r.resolvedUrls.network.length?B.dim("Network: ")+r.resolvedUrls.network.join(`
|
|
494
|
+
`+"".padEnd(9," ")):void 0].filter(e=>qh(e)).join(`
|
|
495
|
+
`))}class Jc extends Error{constructor(e){super(`${e} is locked`)}}const tr={old:new Set,young:new Set},Gg=1e3*15,ln=1024,fn=65535;let Nr;const Bg=()=>{const r=pr.networkInterfaces(),e=new Set([void 0,"0.0.0.0"]);for(const t of Object.values(r))for(const n of t)e.add(n.address);return e},Qc=r=>new Promise((e,t)=>{const n=_p.createServer();n.unref(),n.on("error",t),n.listen(r,()=>{const{port:s}=n.address();n.close(()=>{e(s)})})}),Zc=async(r,e)=>{if(r.host||r.port===0)return Qc(r);for(const t of e)
|
|
496
|
+
try{await Qc({port:r.port,host:t})}catch(n){if(!["EADDRNOTAVAIL","EINVAL"].includes(n.code))throw n}return r.port},Wg=function*(r){r&&(yield*r),yield 0};async function ki(r){let e,t=new Set;if(r&&(r.port&&(e=typeof r.port=="number"?[r.port]:r.port),r.exclude)){const s=r.exclude;if(typeof s[Symbol.iterator]!="function")throw new TypeError("The `exclude` option must be an iterable.");for(const i of s){if(typeof i!="number")throw new TypeError("Each item in the `exclude` option must be a number cor\
|
|
497
|
+
responding to the port you want excluded.");if(!Number.isSafeInteger(i))throw new TypeError(`Number ${i} in the exclude option is not a safe integer and can't be used`)}t=new Set(s)}Nr===void 0&&(Nr=setTimeout(()=>{Nr=void 0,tr.old=tr.young,tr.young=new Set},Gg),Nr.unref&&Nr.unref());const n=Bg();for(const s of Wg(e))try{if(t.has(s))continue;let i=await Zc({...r,port:s},n);for(;tr.old.has(i)||tr.young.has(i);){if(s!==0)throw new Jc(s);i=await Zc({...r,port:s},n)}return tr.young.add(i),i}catch(i){
|
|
498
|
+
if(!["EADDRINUSE","EACCES"].includes(i.code)&&!(i instanceof Jc))throw i}throw new Error("No available ports found")}function dn(r,e){if(!Number.isInteger(r)||!Number.isInteger(e))throw new TypeError("`from` and `to` must be integer numbers");if(r<ln||r>fn)throw new RangeError(`'from' must be between ${ln} and ${fn}`);if(e<ln||e>fn)throw new RangeError(`'to' must be between ${ln} and ${fn}`);if(r>e)throw new RangeError("`to` must be greater than or equal to `from`");return function*(n,s){for(let i=n;i<=
|
|
499
|
+
s;i++)yield i}(r,e)}async function eu({buildWebcomponent:r=!0,hmr:e=!0,webcomponentPrefix:t="likec4",title:n,languageServices:s,likec4AssetsDir:i,openBrowser:o,listen:a,...c}){i??=await Fr(dr(Vr(),".likec4-assets-"));const{isDev:l,...u}=await Ni({...c,languageServices:s,likec4AssetsDir:i,webcomponentPrefix:t,title:n}),f=u.customLogger,h=await ki({port:[5173,...dn(61e3,61010),...dn(62002,62010)]}),$=await ki({port:dn(24678,24690)}),b=await ui(),y=a??(ut()?"0.0.0.0":"localhost");e&&(f.info(`Enabli\
|
|
500
|
+
ng HMR: localhost:${$}`),ut()&&f.info(B.yellow(`ensure port ${$} is published from container`)));const d=await pp({...u,define:e?{...u.define,"process.env.NODE_ENV":'"development"'}:u.define,mode:e?"development":u.mode,publicDir:b,server:{host:y,allowedHosts:!0,port:h,hmr:e&&{overlay:!0,port:$},fs:{strict:!1},open:o??(!l&&!ut())}});return await d.listen(),r&&(async()=>{try{const g=await Ti({webcomponentPrefix:t,languageServices:s,outDir:b,base:u.base});await mr({...g,logLevel:"warn"})}catch(g){f.
|
|
501
|
+
warn(Ur(g)),f.warn("webcomponent build failed, ignoring error and continue")}})(),d}async function Kg({browserContext:r,views:e,output:t,logger:n,timeout:s,maxAttempts:i,outputType:o,theme:a}){let c;const l=e.map(h=>({view:h,attempt:1})),u=[];let f;for(;f=l.shift();){const{view:h,attempt:$}=f,b=`export/${encodeURIComponent(h.id)}`;try{if($>1){c&&(c.close({runBeforeUnload:!0}).catch(m=>n.error(`failed to close page: ${m}`)),c=void 0);const p=ha($*200,{min:200,max:1e3});n.info(B.cyan(b)+B.dim(` at\
|
|
502
|
+
tempt ${$} of ${i} after ${p}ms`)),await vp(p)}else h.hasLayoutDrift&&n.warn(B.yellow("Drift detected, manual layout can not be applied, view may be invalid: ")+B.red(h.id));let y=".";o==="relative"&&(y=h.relativePath??".",y.includes("/")?y=y.slice(0,y.lastIndexOf("/")):y=".");const d=ge(t,y,`${h.id}.png`);c??=await r.newPage();const g=16;await c.setViewportSize({width:h.bounds.width+20*2+g,height:h.bounds.height+20*2+g}),await c.goto(b+`?padding=20&theme=${a}`),n.info(B.cyan(b)+B.dim(` -> ${yt(
|
|
503
|
+
t,d)}`)),await c.waitForSelector(".react-flow.initialized"),h.nodes.some(p=>Uh(p.icon)&&p.icon.toLowerCase().startsWith("http"))&&await Yg(c,s),await c.getByTestId("export-page").screenshot({animations:"disabled",path:d,omitBackground:!0}),u.push({view:h,path:d})}catch(y){c?.close({runBeforeUnload:!0}).catch(d=>n.error(`failed to close page: ${d}`)),n.error(B.red("failed "+b+`
|
|
504
|
+
`+y)),$<i&&(l.push({view:h,attempt:$+1}),n.info(B.dim(`retry ${b}`))),c=void 0}}return u}async function Yg(r,e){let t=await r.locator("//img").all();if(!t.length)return;const n=t.map(s=>s.evaluate(i=>i.complete||new Promise(o=>{i.onload=o,i.onerror=o}),{timeout:Math.max(15e3,e)}));await Promise.allSettled(n)}async function tu({logger:r,serverUrl:e,theme:t="light",timeoutMs:n=15e3,views:s,output:i,outputType:o="relative",maxAttempts:a=3,chromiumSandbox:c=!1}){r.info(`${B.dim("output")} ${i}`),r.info(
|
|
505
|
+
`${B.dim("base url")} ${e}
|
|
506
|
+
`);const l=Pa.executablePath();r.info(B.cyan("Start chromium")+" "+B.dim(l));const u=await Pa.launch({chromiumSandbox:c,headless:!0});r.info(B.cyan("Color scheme: ")+t+`
|
|
507
|
+
`);const f=await u.newContext({deviceScaleFactor:2,colorScheme:t,baseURL:e,bypassCSP:!0,ignoreHTTPSErrors:!0,isMobile:!1});f.setDefaultNavigationTimeout(n),f.setDefaultTimeout(n);try{return await Kg({browserContext:f,views:s,output:i,outputType:o,logger:r,maxAttempts:a,timeout:n,theme:t})}finally{r.info(B.cyan("close chromium")),await f.close(),await u.close()}}async function ru({path:r,useDotBin:e,theme:t="light",output:n,outputType:s,serverUrl:i,ignore:o=!1,timeoutMs:a=1e4,maxAttempts:c=3,filter:l,
|
|
508
|
+
chromiumSandbox:u=!1}){const f=He("export"),h=Yh(),$=await Fe.fromWorkspace(r,{logger:"vite",graphviz:e?"binary":"wasm",watch:!1});n??=$.workspace;let b;const y=$.languageServices.projects();if(!i&&(f.info(B.cyan("start preview server")),b=await eu({languageServices:$,buildWebcomponent:!1,openBrowser:!1,useOverviewGraph:!1,hmr:!1}),i=Yc(b),!i))throw f.error("Vite server is not ready, no resolvedUrls"),new Error("Vite server is not ready, no resolvedUrls");for(const d of y){y.length>1&&(f.info(B.
|
|
509
|
+
dim("---------")),f.info(`${B.dim("project:")} ${d.id}`),f.info(`${B.dim("folder:")} ${d.folder.fsPath}`));let g=await $.diagrams(d.id);if(l&&qs(l,1)&&qs(g,1)){const w=Hh(l);f.info(`${B.cyan("filter")} ${B.dim(JSON.stringify(l))}`),g=g.filter(S=>w(S.id)?(f.info(`${B.green("include")} ${S.id} \u2705`),!0):(f.info(`${B.gray("skip")} ${B.dim(S.id)}`),!1))}if(!qs(g,1)){f.warn("no views found");continue}let p=y.length>1?la(pa(i,"project",d.id)):i,m=y.length>1?pa(n,d.id):n;const _=await tu({logger:f,serverUrl:p,
|
|
510
|
+
theme:t,timeoutMs:a,views:g,output:m,outputType:s,maxAttempts:c,chromiumSandbox:u}),{pretty:v}=Fh(h);if(_.length>0&&f.info(B.green(`exported ${_.length} views in ${v}`)+`
|
|
511
|
+
`),_.length!==g.length&&(o&&_.length>0?f.info(B.dim("ignore")+" "+B.red(`failed ${g.length-_.length} out of ${g.length} views`)):f.error(B.red(`failed ${g.length-_.length} out of ${g.length} views`))),_.length!==g.length&&(_.length===0||!o))throw new Error(`Failed ${g.length-_.length} out of ${g.length} views`)}b&&(f.info(B.cyan("stop server")),await b.close().catch(d=>{f.error(d)}))}const{cyan:nu,dim:su}=B;async function Xg({path:r,useDotBin:e,useHashHistory:t,webcomponentPrefix:n,title:s,useOverview:i=!1,
|
|
512
|
+
output:o,outputSingleFile:a,base:c}){await Ir();const l=He("c4:build"),u=await Fe.fromWorkspace(r,{graphviz:e?"binary":"wasm",logger:"vite",watch:!1}),f=o??ge(u.workspace,"dist");let h=ge(f,"assets");if(i)try{h=ge(f,"assets","previews"),await ct(h,{recursive:!0}),l.info(`${nu("Generate previews")} ${su(h)}
|
|
513
|
+
`),await ru({path:r,useDotBin:e,output:h,outputType:"flat",ignore:!0})}catch($){l.error(B.red("Failed to generate previews")),l.error($),l.warn(B.yellow("Ignore previews and continue build")),Is(h,{recursive:!0,force:!0}),i=!1}await Ig({base:c,useHashHistory:a||t,customLogger:l,useOverviewGraph:i,webcomponentPrefix:n,title:s,languageServices:u,likec4AssetsDir:h,outputDir:o,outputSingleFile:a}),i&&(l.info(`${nu("clean previews")} ${su(h)}`),Is(h,{recursive:!0,force:!0}))}const Jg=r=>r.command({command:"\
|
|
514
|
+
build [path]",aliases:["bundle"],describe:"Build a static website",builder:e=>e.positional("path",Zt).option("output",{alias:"o",type:"string",desc:"output directory for production build",normalize:!0,coerce:ge}).option("base",_c).option("use-hash-history",yc).option("use-dot",Ke).option("webcomponent-prefix",oi).option("title",$c).option("output-single-file",Xm).example(`${B.green("$0 build -o ./build ./src")}`,B.gray("Search for likec4 files in 'src' and output static site to 'build'")),handler:async e=>{
|
|
515
|
+
await Xg({path:e.path,output:e.output,base:e.base,useHashHistory:e["use-hash-history"],useDotBin:e["use-dot"],webcomponentPrefix:e["webcomponent-prefix"],title:e.title,outputSingleFile:e["output-single-file"]??!1})}}),Vt=r=>{const e=typeof r;return r!==null&&(e==="object"||e==="function")},Di=new Set(["__proto__","prototype","constructor"]),Qg=new Set("0123456789");function hn(r){const e=[];let t="",n="start",s=!1;for(const i of r)switch(i){case"\\":{if(n==="index")throw new Error("Invalid chara\
|
|
516
|
+
cter in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");s&&(t+=i),n="property",s=!s;break}case".":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(s){s=!1,t+=i;break}if(Di.has(t))return[];e.push(t),t="",n="property";break}case"[":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(s){s=!1,t+=i;break}if(n==="property"){if(Di.has(t))return[];e.push(t),t=""}n=
|
|
517
|
+
"index";break}case"]":{if(n==="index"){e.push(Number.parseInt(t,10)),t="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!Qg.has(i))throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");n==="start"&&(n="property"),s&&(s=!1,t+="\\"),t+=i}}switch(s&&(t+="\\"),n){case"property":{if(Di.has(t))return[];e.push(t);break}case"index":throw new Error("Index was not closed");case"\
|
|
518
|
+
start":{e.push("");break}}return e}function xi(r,e){if(typeof e!="number"&&Array.isArray(r)){const t=Number.parseInt(e,10);return Number.isInteger(t)&&r[t]===r[e]}return!1}function iu(r,e){if(xi(r,e))throw new Error("Cannot use string index")}function Zg(r,e,t){if(!Vt(r)||typeof e!="string")return t===void 0?r:t;const n=hn(e);if(n.length===0)return t;for(let s=0;s<n.length;s++){const i=n[s];if(xi(r,i)?r=s===n.length-1?void 0:null:r=r[i],r==null){if(s!==n.length-1)return t;break}}return r===void 0?
|
|
519
|
+
t:r}function ou(r,e,t){if(!Vt(r)||typeof e!="string")return r;const n=r,s=hn(e);for(let i=0;i<s.length;i++){const o=s[i];iu(r,o),i===s.length-1?r[o]=t:Vt(r[o])||(r[o]=typeof s[i+1]=="number"?[]:{}),r=r[o]}return n}function ey(r,e){if(!Vt(r)||typeof e!="string")return!1;const t=hn(e);for(let n=0;n<t.length;n++){const s=t[n];if(iu(r,s),n===t.length-1)return delete r[s],!0;if(r=r[s],!Vt(r))return!1}}function ty(r,e){if(!Vt(r)||typeof e!="string")return!1;const t=hn(e);if(t.length===0)return!1;for(const n of t){
|
|
520
|
+
if(!Vt(r)||!(n in r)||xi(r,n))return!1;r=r[n]}return!0}const wt=pr.homedir(),Mi=pr.tmpdir(),{env:rr}=Se,ry=r=>{const e=me.join(wt,"Library");return{data:me.join(e,"Application Support",r),config:me.join(e,"Preferences",r),cache:me.join(e,"Caches",r),log:me.join(e,"Logs",r),temp:me.join(Mi,r)}},ny=r=>{const e=rr.APPDATA||me.join(wt,"AppData","Roaming"),t=rr.LOCALAPPDATA||me.join(wt,"AppData","Local");return{data:me.join(t,r,"Data"),config:me.join(e,r,"Config"),cache:me.join(t,r,"Cache"),log:me.join(
|
|
521
|
+
t,r,"Log"),temp:me.join(Mi,r)}},sy=r=>{const e=me.basename(wt);return{data:me.join(rr.XDG_DATA_HOME||me.join(wt,".local","share"),r),config:me.join(rr.XDG_CONFIG_HOME||me.join(wt,".config"),r),cache:me.join(rr.XDG_CACHE_HOME||me.join(wt,".cache"),r),log:me.join(rr.XDG_STATE_HOME||me.join(wt,".local","state"),r),temp:me.join(Mi,e,r)}};function iy(r,{suffix:e="nodejs"}={}){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);return e&&(r+=`-${e}`),Se.platform==="darwin"?
|
|
522
|
+
ry(r):Se.platform==="win32"?ny(r):sy(r)}const Et=(r,e)=>function(...n){return r.apply(void 0,n).catch(e)},ft=(r,e)=>function(...n){try{return r.apply(void 0,n)}catch(s){return e(s)}},oy=Se.getuid?!Se.getuid():!1,ay=1e4,qe=()=>{},be={isChangeErrorOk:r=>{if(!be.isNodeError(r))return!1;const{code:e}=r;return e==="ENOSYS"||!oy&&(e==="EINVAL"||e==="EPERM")},isNodeError:r=>r instanceof Error,isRetriableError:r=>{if(!be.isNodeError(r))return!1;const{code:e}=r;return e==="EMFILE"||e==="ENFILE"||e==="EAG\
|
|
523
|
+
AIN"||e==="EBUSY"||e==="EACCESS"||e==="EACCES"||e==="EACCS"||e==="EPERM"},onChangeError:r=>{if(!be.isNodeError(r))throw r;if(!be.isChangeErrorOk(r))throw r}};class cy{constructor(){this.interval=25,this.intervalId=void 0,this.limit=ay,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.queueWaiting.add(e),
|
|
524
|
+
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 t=()=>this.remove(n),n=()=>e(t);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 uy=new cy,St=(r,e)=>function(n){return function s(...i){
|
|
525
|
+
return uy.schedule().then(o=>{const a=l=>(o(),l),c=l=>{if(o(),Date.now()>=n)throw l;if(e(l)){const u=Math.round(100*Math.random());return new Promise(h=>setTimeout(h,u)).then(()=>s.apply(void 0,i))}throw l};return r.apply(void 0,i).then(a,c)})}},Rt=(r,e)=>function(n){return function s(...i){try{return r.apply(void 0,i)}catch(o){if(Date.now()>n)throw o;if(e(o))return s.apply(void 0,i);throw o}}},Ne={attempt:{chmod:Et(Ie(he.chmod),be.onChangeError),chown:Et(Ie(he.chown),be.onChangeError),close:Et(
|
|
526
|
+
Ie(he.close),qe),fsync:Et(Ie(he.fsync),qe),mkdir:Et(Ie(he.mkdir),qe),realpath:Et(Ie(he.realpath),qe),stat:Et(Ie(he.stat),qe),unlink:Et(Ie(he.unlink),qe),chmodSync:ft(he.chmodSync,be.onChangeError),chownSync:ft(he.chownSync,be.onChangeError),closeSync:ft(he.closeSync,qe),existsSync:ft(he.existsSync,qe),fsyncSync:ft(he.fsync,qe),mkdirSync:ft(he.mkdirSync,qe),realpathSync:ft(he.realpathSync,qe),statSync:ft(he.statSync,qe),unlinkSync:ft(he.unlinkSync,qe)},retry:{close:St(Ie(he.close),be.isRetriableError),
|
|
527
|
+
fsync:St(Ie(he.fsync),be.isRetriableError),open:St(Ie(he.open),be.isRetriableError),readFile:St(Ie(he.readFile),be.isRetriableError),rename:St(Ie(he.rename),be.isRetriableError),stat:St(Ie(he.stat),be.isRetriableError),write:St(Ie(he.write),be.isRetriableError),writeFile:St(Ie(he.writeFile),be.isRetriableError),closeSync:Rt(he.closeSync,be.isRetriableError),fsyncSync:Rt(he.fsyncSync,be.isRetriableError),openSync:Rt(he.openSync,be.isRetriableError),readFileSync:Rt(he.readFileSync,be.isRetriableError),
|
|
528
|
+
renameSync:Rt(he.renameSync,be.isRetriableError),statSync:Rt(he.statSync,be.isRetriableError),writeSync:Rt(he.writeSync,be.isRetriableError),writeFileSync:Rt(he.writeFileSync,be.isRetriableError)}},ly="utf8",au=438,fy=511,dy={},hy=pr.userInfo().uid,py=pr.userInfo().gid,my=1e3,gy=!!Se.getuid;Se.getuid&&Se.getuid();const cu=128,yy=r=>r instanceof Error&&"code"in r,uu=r=>typeof r=="string",qi=r=>r===void 0,$y=Se.platform==="linux",lu=Se.platform==="win32",Ui=["SIGABRT","SIGALRM","SIGHUP","SIGINT","\
|
|
529
|
+
SIGTERM"];lu||Ui.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),$y&&Ui.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED");class _y{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=e=>{if(!this.exited){this.exited=!0;for(const t of this.callbacks)t();e&&(lu&&e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"?Se.kill(Se.pid,"SIGTERM"):Se.kill(Se.pid,e))}},this.hook=()=>{Se.once("exit",()=>this.exit());for(const e of Ui)try{Se.once(e,()=>this.exit(e))}catch{}},
|
|
530
|
+
this.register=e=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}const vy=new _y,by=vy.register,Te={store:{},create:r=>{const e=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),s=`.tmp-${Date.now().toString().slice(-10)}${e}`;return`${r}${s}`},get:(r,e,t=!0)=>{const n=Te.truncate(e(r));return n in Te.store?Te.get(r,e,t):(Te.store[n]=t,[n,()=>delete Te.store[n]])},purge:r=>{Te.store[r]&&(delete Te.store[r],Ne.attempt.unlink(r))},purgeSync:r=>{Te.store[r]&&(delete Te.
|
|
531
|
+
store[r],Ne.attempt.unlinkSync(r))},purgeSyncAll:()=>{for(const r in Te.store)Te.purgeSync(r)},truncate:r=>{const e=me.basename(r);if(e.length<=cu)return r;const t=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(e);if(!t)return r;const n=e.length-cu;return`${r.slice(0,-e.length)}${t[1]}${t[2].slice(0,-n)}${t[3]}`}};by(Te.purgeSyncAll);function fu(r,e,t=dy){if(uu(t))return fu(r,e,{encoding:t});const n=Date.now()+((t.timeout??my)||-1);let s=null,i=null,o=null;try{const a=Ne.attempt.realpathSync(
|
|
532
|
+
r),c=!!a;r=a||r,[i,s]=Te.get(r,t.tmpCreate||Te.create,t.tmpPurge!==!1);const l=gy&&qi(t.chown),u=qi(t.mode);if(c&&(l||u)){const f=Ne.attempt.statSync(r);f&&(t={...t},l&&(t.chown={uid:f.uid,gid:f.gid}),u&&(t.mode=f.mode))}if(!c){const f=me.dirname(r);Ne.attempt.mkdirSync(f,{mode:fy,recursive:!0})}o=Ne.retry.openSync(n)(i,"w",t.mode||au),t.tmpCreated&&t.tmpCreated(i),uu(e)?Ne.retry.writeSync(n)(o,e,0,t.encoding||ly):qi(e)||Ne.retry.writeSync(n)(o,e,0,e.length,0),t.fsync!==!1&&(t.fsyncWait!==!1?Ne.
|
|
533
|
+
retry.fsyncSync(n)(o):Ne.attempt.fsync(o)),Ne.retry.closeSync(n)(o),o=null,t.chown&&(t.chown.uid!==hy||t.chown.gid!==py)&&Ne.attempt.chownSync(i,t.chown.uid,t.chown.gid),t.mode&&t.mode!==au&&Ne.attempt.chmodSync(i,t.mode);try{Ne.retry.renameSync(n)(i,r)}catch(f){if(!yy(f)||f.code!=="ENAMETOOLONG")throw f;Ne.retry.renameSync(n)(i,Te.truncate(r))}s(),i=null}finally{o&&Ne.attempt.closeSync(o),i&&Te.purge(i)}}var pn={exports:{}},Hi={},dt={},zt={},Fi={},Vi={},zi={},du;function mn(){return du||(du=1,function(r){
|
|
534
|
+
Object.defineProperty(r,"__esModule",{value:!0}),r.regexpCode=r.getEsmExportName=r.getProperty=r.safeStringify=r.stringify=r.strConcat=r.addCodeArg=r.str=r._=r.nil=r._Code=r.Name=r.IDENTIFIER=r._CodeOrName=void 0;class e{}r._CodeOrName=e,r.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class t extends e{constructor(p){if(super(),!r.IDENTIFIER.test(p))throw new Error("CodeGen: name must be a valid identifier");this.str=p}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}r.Name=
|
|
535
|
+
t;class n extends e{constructor(p){super(),this._items=typeof p=="string"?[p]:p}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const p=this._items[0];return p===""||p==='""'}get str(){var p;return(p=this._str)!==null&&p!==void 0?p:this._str=this._items.reduce((m,_)=>`${m}${_}`,"")}get names(){var p;return(p=this._names)!==null&&p!==void 0?p:this._names=this._items.reduce((m,_)=>(_ instanceof t&&(m[_.str]=(m[_.str]||0)+1),m),{})}}r._Code=n,r.nil=new n("");function s(g,...p){
|
|
536
|
+
const m=[g[0]];let _=0;for(;_<p.length;)a(m,p[_]),m.push(g[++_]);return new n(m)}r._=s;const i=new n("+");function o(g,...p){const m=[$(g[0])];let _=0;for(;_<p.length;)m.push(i),a(m,p[_]),m.push(i,$(g[++_]));return c(m),new n(m)}r.str=o;function a(g,p){p instanceof n?g.push(...p._items):p instanceof t?g.push(p):g.push(f(p))}r.addCodeArg=a;function c(g){let p=1;for(;p<g.length-1;){if(g[p]===i){const m=l(g[p-1],g[p+1]);if(m!==void 0){g.splice(p-1,3,m);continue}g[p++]="+"}p++}}function l(g,p){if(p===
|
|
537
|
+
'""')return g;if(g==='""')return p;if(typeof g=="string")return p instanceof t||g[g.length-1]!=='"'?void 0:typeof p!="string"?`${g.slice(0,-1)}${p}"`:p[0]==='"'?g.slice(0,-1)+p.slice(1):void 0;if(typeof p=="string"&&p[0]==='"'&&!(g instanceof t))return`"${g}${p.slice(1)}`}function u(g,p){return p.emptyStr()?g:g.emptyStr()?p:o`${g}${p}`}r.strConcat=u;function f(g){return typeof g=="number"||typeof g=="boolean"||g===null?g:$(Array.isArray(g)?g.join(","):g)}function h(g){return new n($(g))}r.stringify=
|
|
538
|
+
h;function $(g){return JSON.stringify(g).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}r.safeStringify=$;function b(g){return typeof g=="string"&&r.IDENTIFIER.test(g)?new n(`.${g}`):s`[${g}]`}r.getProperty=b;function y(g){if(typeof g=="string"&&r.IDENTIFIER.test(g))return new n(`${g}`);throw new Error(`CodeGen: invalid export name: ${g}, use explicit $id name mapping`)}r.getEsmExportName=y;function d(g){return new n(g.toString())}r.regexpCode=d}(zi)),zi}var Gi={},hu;function pu(){return hu||
|
|
539
|
+
(hu=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.ValueScope=r.ValueScopeName=r.Scope=r.varKinds=r.UsedValueState=void 0;const e=mn();class t extends Error{constructor(l){super(`CodeGen: "code" for ${l} not defined`),this.value=l.value}}var n;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(n||(r.UsedValueState=n={})),r.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};class s{constructor({prefixes:l,parent:u}={}){this._names=
|
|
540
|
+
{},this._prefixes=l,this._parent=u}toName(l){return l instanceof e.Name?l:this.name(l)}name(l){return new e.Name(this._newName(l))}_newName(l){const u=this._names[l]||this._nameGroup(l);return`${l}${u.index++}`}_nameGroup(l){var u,f;if(!((f=(u=this._parent)===null||u===void 0?void 0:u._prefixes)===null||f===void 0)&&f.has(l)||this._prefixes&&!this._prefixes.has(l))throw new Error(`CodeGen: prefix "${l}" is not allowed in this scope`);return this._names[l]={prefix:l,index:0}}}r.Scope=s;class i extends e.
|
|
541
|
+
Name{constructor(l,u){super(u),this.prefix=l}setValue(l,{property:u,itemIndex:f}){this.value=l,this.scopePath=(0,e._)`.${new e.Name(u)}[${f}]`}}r.ValueScopeName=i;const o=(0,e._)`\n`;class a extends s{constructor(l){super(l),this._values={},this._scope=l.scope,this.opts={...l,_n:l.lines?o:e.nil}}get(){return this._scope}name(l){return new i(l,this._newName(l))}value(l,u){var f;if(u.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const h=this.toName(l),{prefix:$}=h,b=(f=u.key)!==
|
|
543
542
|
null&&f!==void 0?f:u.ref;let y=this._values[$];if(y){const p=y.get(b);if(p)return p}else y=this._values[$]=new Map;y.set(b,h);const d=this._scope[$]||(this._scope[$]=[]),g=d.length;return d[g]=u.ref,h.setValue(u,{property:$,itemIndex:g}),h}getValue(l,u){const f=this._values[l];if(f)return f.get(u)}scopeRefs(l,u=this._values){return this._reduceValues(u,f=>{if(f.scopePath===void 0)throw new Error(`CodeGen: name "${f}" has no value`);return(0,e._)`${l}${f.scopePath}`})}scopeCode(l=this._values,u,f){
|
|
544
|
-
return this._reduceValues(l,h=>{if(h.value===void 0)throw new Error(`CodeGen: name "${h}" has no value`);return h.value.code},u,f)}_reduceValues(l,u,f={},h){let $=e.nil;for(const b in l){const y=l[b];if(!y)continue;const d=f[b]=f[b]||new Map;y.forEach(g=>{if(d.has(g))return;d.set(g,n.Started);let p=u(g);if(p){const m=this.opts.es5?
|
|
545
|
-
return $}}
|
|
546
|
-
|
|
547
|
-
Object.defineProperty(
|
|
548
|
-
_Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class i{optimizeNodes(){return this}optimizeNames(E,R){return this}}class o extends i{constructor(E,R,C){super(),this.varKind=E,this.name=R,this.rhs=C}render({es5:E,_n:R}){const C=E?
|
|
549
|
-
this.rhs.names:{}}}class a extends i{constructor(E,R,C){super(),this.lhs=E,this.rhs=R,this.sideEffects=C}render({_n:E}){return`${this.lhs} = ${this.rhs};`+E}optimizeNames(E,R){if(!(this.lhs instanceof e.Name&&!E[this.lhs.str]&&!this.sideEffects))return this.rhs=
|
|
543
|
+
return this._reduceValues(l,h=>{if(h.value===void 0)throw new Error(`CodeGen: name "${h}" has no value`);return h.value.code},u,f)}_reduceValues(l,u,f={},h){let $=e.nil;for(const b in l){const y=l[b];if(!y)continue;const d=f[b]=f[b]||new Map;y.forEach(g=>{if(d.has(g))return;d.set(g,n.Started);let p=u(g);if(p){const m=this.opts.es5?r.varKinds.var:r.varKinds.const;$=(0,e._)`${$}${m} ${g} = ${p};${this.opts._n}`}else if(p=h?.(g))$=(0,e._)`${$}${p}${this.opts._n}`;else throw new t(g);d.set(g,n.Completed)})}
|
|
544
|
+
return $}}r.ValueScope=a}(Gi)),Gi}var mu;function pe(){return mu||(mu=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.or=r.and=r.not=r.CodeGen=r.operators=r.varKinds=r.ValueScopeName=r.ValueScope=r.Scope=r.Name=r.regexpCode=r.stringify=r.getProperty=r.nil=r.strConcat=r.str=r._=void 0;const e=mn(),t=pu();var n=mn();Object.defineProperty(r,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(r,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(
|
|
545
|
+
r,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(r,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(r,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(r,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(r,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(r,"Name",{enumerable:!0,get:function(){return n.Name}});var s=pu();
|
|
546
|
+
Object.defineProperty(r,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(r,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(r,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(r,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),r.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e.
|
|
547
|
+
_Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class i{optimizeNodes(){return this}optimizeNames(E,R){return this}}class o extends i{constructor(E,R,C){super(),this.varKind=E,this.name=R,this.rhs=C}render({es5:E,_n:R}){const C=E?t.varKinds.var:this.varKind,X=this.rhs===void 0?"":` = ${this.rhs}`;return`${C} ${this.name}${X};`+R}optimizeNames(E,R){if(E[this.name.str])return this.rhs&&(this.rhs=D(this.rhs,E,R)),this}get names(){return this.rhs instanceof e._CodeOrName?
|
|
548
|
+
this.rhs.names:{}}}class a extends i{constructor(E,R,C){super(),this.lhs=E,this.rhs=R,this.sideEffects=C}render({_n:E}){return`${this.lhs} = ${this.rhs};`+E}optimizeNames(E,R){if(!(this.lhs instanceof e.Name&&!E[this.lhs.str]&&!this.sideEffects))return this.rhs=D(this.rhs,E,R),this}get names(){const E=this.lhs instanceof e.Name?{}:{...this.lhs.names};return j(E,this.rhs)}}class c extends a{constructor(E,R,C,X){super(E,C,X),this.op=R}render({_n:E}){return`${this.lhs} ${this.op}= ${this.rhs};`+E}}
|
|
550
549
|
class l extends i{constructor(E){super(),this.label=E,this.names={}}render({_n:E}){return`${this.label}:`+E}}class u extends i{constructor(E){super(),this.label=E,this.names={}}render({_n:E}){return`break${this.label?` ${this.label}`:""};`+E}}class f extends i{constructor(E){super(),this.error=E}render({_n:E}){return`throw ${this.error};`+E}get names(){return this.error.names}}class h extends i{constructor(E){super(),this.code=E}render({_n:E}){return`${this.code};`+E}optimizeNodes(){return`${this.
|
|
551
|
-
code}`?this:void 0}optimizeNames(E,R){return this.code=
|
|
550
|
+
code}`?this:void 0}optimizeNames(E,R){return this.code=D(this.code,E,R),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class $ extends i{constructor(E=[]){super(),this.nodes=E}render(E){return this.nodes.reduce((R,C)=>R+C.render(E),"")}optimizeNodes(){const{nodes:E}=this;let R=E.length;for(;R--;){const C=E[R].optimizeNodes();Array.isArray(C)?E.splice(R,1,...C):C?E[R]=C:E.splice(R,1)}return E.length>0?this:void 0}optimizeNames(E,R){const{nodes:C}=this;let X=C.length;
|
|
552
551
|
for(;X--;){const Z=C[X];Z.optimizeNames(E,R)||(U(E,Z.names),C.splice(X,1))}return C.length>0?this:void 0}get names(){return this.nodes.reduce((E,R)=>M(E,R.names),{})}}class b extends ${render(E){return"{"+E._n+super.render(E)+"}"+E._n}}class y extends ${}class d extends b{}d.kind="else";class g extends b{constructor(E,R){super(R),this.condition=E}render(E){let R=`if(${this.condition})`+super.render(E);return this.else&&(R+="else "+this.else.render(E)),R}optimizeNodes(){super.optimizeNodes();const E=this.
|
|
553
|
-
condition;if(E===!0)return this.nodes;let R=this.else;if(R){const C=R.optimizeNodes();R=this.else=Array.isArray(C)?new d(C):C}if(R)return E===!1?R instanceof g?R:R.nodes:this.nodes.length?this:new g(Y(E),R instanceof g?[R]:R.nodes);if(!(E===!1||!this.nodes.length))return this}optimizeNames(E,R){var C;if(this.else=(C=this.else)===null||C===void 0?void 0:C.optimizeNames(E,R),!!(super.optimizeNames(E,R)||this.else))return this.condition=
|
|
554
|
-
E,this.condition),this.else&&M(E,this.else.names),E}}g.kind="if";class p extends b{}p.kind="for";class m extends p{constructor(E){super(),this.iteration=E}render(E){return`for(${this.iteration})`+super.render(E)}optimizeNames(E,R){if(super.optimizeNames(E,R))return this.iteration=
|
|
555
|
-
varKind,{name:C,from:X,to:Z}=this;return`for(${R} ${C}=${X}; ${C}<${Z}; ${C}++)`+super.render(E)}get names(){const E=j(super.names,this.from);return j(E,this.to)}}class v extends p{constructor(E,R,C,X){super(),this.loop=E,this.varKind=R,this.name=C,this.iterable=X}render(E){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(E)}optimizeNames(E,R){if(super.optimizeNames(E,R))return this.iterable=
|
|
552
|
+
condition;if(E===!0)return this.nodes;let R=this.else;if(R){const C=R.optimizeNodes();R=this.else=Array.isArray(C)?new d(C):C}if(R)return E===!1?R instanceof g?R:R.nodes:this.nodes.length?this:new g(Y(E),R instanceof g?[R]:R.nodes);if(!(E===!1||!this.nodes.length))return this}optimizeNames(E,R){var C;if(this.else=(C=this.else)===null||C===void 0?void 0:C.optimizeNames(E,R),!!(super.optimizeNames(E,R)||this.else))return this.condition=D(this.condition,E,R),this}get names(){const E=super.names;return j(
|
|
553
|
+
E,this.condition),this.else&&M(E,this.else.names),E}}g.kind="if";class p extends b{}p.kind="for";class m extends p{constructor(E){super(),this.iteration=E}render(E){return`for(${this.iteration})`+super.render(E)}optimizeNames(E,R){if(super.optimizeNames(E,R))return this.iteration=D(this.iteration,E,R),this}get names(){return M(super.names,this.iteration.names)}}class _ extends p{constructor(E,R,C,X){super(),this.varKind=E,this.name=R,this.from=C,this.to=X}render(E){const R=E.es5?t.varKinds.var:this.
|
|
554
|
+
varKind,{name:C,from:X,to:Z}=this;return`for(${R} ${C}=${X}; ${C}<${Z}; ${C}++)`+super.render(E)}get names(){const E=j(super.names,this.from);return j(E,this.to)}}class v extends p{constructor(E,R,C,X){super(),this.loop=E,this.varKind=R,this.name=C,this.iterable=X}render(E){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(E)}optimizeNames(E,R){if(super.optimizeNames(E,R))return this.iterable=D(this.iterable,E,R),this}get names(){return M(super.names,this.iterable.
|
|
556
555
|
names)}}class w extends b{constructor(E,R,C){super(),this.name=E,this.args=R,this.async=C}render(E){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(E)}}w.kind="func";class S extends ${render(E){return"return "+super.render(E)}}S.kind="return";class I extends b{render(E){let R="try"+super.render(E);return this.catch&&(R+=this.catch.render(E)),this.finally&&(R+=this.finally.render(E)),R}optimizeNodes(){var E,R;return super.optimizeNodes(),(E=this.catch)===null||E===
|
|
557
556
|
void 0||E.optimizeNodes(),(R=this.finally)===null||R===void 0||R.optimizeNodes(),this}optimizeNames(E,R){var C,X;return super.optimizeNames(E,R),(C=this.catch)===null||C===void 0||C.optimizeNames(E,R),(X=this.finally)===null||X===void 0||X.optimizeNames(E,R),this}get names(){const E=super.names;return this.catch&&M(E,this.catch.names),this.finally&&M(E,this.finally.names),E}}class F extends b{constructor(E){super(),this.error=E}render(E){return`catch(${this.error})`+super.render(E)}}F.kind="catc\
|
|
558
|
-
h";class
|
|
559
|
-
`:""},this._extScope=E,this._scope=new
|
|
560
|
-
const Z=this._scope.toName(R);return C!==void 0&&X&&(this._constants[Z.str]=C),this._leafNode(new o(E,Z,C)),Z}const(E,R,C){return this._def(
|
|
557
|
+
h";class W extends b{render(E){return"finally"+super.render(E)}}W.kind="finally";class k{constructor(E,R={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...R,_n:R.lines?`
|
|
558
|
+
`:""},this._extScope=E,this._scope=new t.Scope({parent:E}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(E){return this._scope.name(E)}scopeName(E){return this._extScope.name(E)}scopeValue(E,R){const C=this._extScope.value(E,R);return(this._values[C.prefix]||(this._values[C.prefix]=new Set)).add(C),C}getScopeValue(E,R){return this._extScope.getValue(E,R)}scopeRefs(E){return this._extScope.scopeRefs(E,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(E,R,C,X){
|
|
559
|
+
const Z=this._scope.toName(R);return C!==void 0&&X&&(this._constants[Z.str]=C),this._leafNode(new o(E,Z,C)),Z}const(E,R,C){return this._def(t.varKinds.const,E,R,C)}let(E,R,C){return this._def(t.varKinds.let,E,R,C)}var(E,R,C){return this._def(t.varKinds.var,E,R,C)}assign(E,R,C){return this._leafNode(new a(E,R,C))}add(E,R){return this._leafNode(new c(E,r.operators.ADD,R))}code(E){return typeof E=="function"?E():E!==e.nil&&this._leafNode(new h(E)),this}object(...E){const R=["{"];for(const[C,X]of E)
|
|
561
560
|
R.length>1&&R.push(","),R.push(C),(C!==X||this.opts.es5)&&(R.push(":"),(0,e.addCodeArg)(R,X));return R.push("}"),new e._Code(R)}if(E,R,C){if(this._blockNode(new g(E)),R&&C)this.code(R).else().code(C).endIf();else if(R)this.code(R).endIf();else if(C)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(E){return this._elseNode(new g(E))}else(){return this._elseNode(new d)}endIf(){return this._endBlockNode(g,d)}_for(E,R){return this._blockNode(E),R&&this.code(R).endFor(),this}for(E,R){
|
|
562
|
-
return this._for(new m(E),R)}forRange(E,R,C,X,Z=this.opts.es5?
|
|
561
|
+
return this._for(new m(E),R)}forRange(E,R,C,X,Z=this.opts.es5?t.varKinds.var:t.varKinds.let){const ie=this._scope.toName(E);return this._for(new _(Z,ie,R,C),()=>X(ie))}forOf(E,R,C,X=t.varKinds.const){const Z=this._scope.toName(E);if(this.opts.es5){const ie=R instanceof e.Name?R:this.var("_arr",R);return this.forRange("_i",0,(0,e._)`${ie}.length`,oe=>{this.var(Z,(0,e._)`${ie}[${oe}]`),C(Z)})}return this._for(new v("of",X,Z,R),()=>C(Z))}forIn(E,R,C,X=this.opts.es5?t.varKinds.var:t.varKinds.const){
|
|
563
562
|
if(this.opts.ownProperties)return this.forOf(E,(0,e._)`Object.keys(${R})`,C);const Z=this._scope.toName(E);return this._for(new v("in",X,Z,R),()=>C(Z))}endFor(){return this._endBlockNode(p)}label(E){return this._leafNode(new l(E))}break(E){return this._leafNode(new u(E))}return(E){const R=new S;if(this._blockNode(R),this.code(E),R.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try(E,R,C){if(!R&&!C)throw new Error('CodeGen: "try" without "c\
|
|
564
|
-
atch" and "finally"');const X=new I;if(this._blockNode(X),this.code(E),R){const Z=this.name("e");this._currNode=X.catch=new F(Z),R(Z)}return C&&(this._currNode=X.finally=new
|
|
563
|
+
atch" and "finally"');const X=new I;if(this._blockNode(X),this.code(E),R){const Z=this.name("e");this._currNode=X.catch=new F(Z),R(Z)}return C&&(this._currNode=X.finally=new W,this.code(C)),this._endBlockNode(F,W)}throw(E){return this._leafNode(new f(E))}block(E,R){return this._blockStarts.push(this._nodes.length),E&&this.code(E).endBlock(R),this}endBlock(E){const R=this._blockStarts.pop();if(R===void 0)throw new Error("CodeGen: not in self-balancing block");const C=this._nodes.length-R;if(C<0||
|
|
565
564
|
E!==void 0&&C!==E)throw new Error(`CodeGen: wrong number of nodes: ${C} vs ${E} expected`);return this._nodes.length=R,this}func(E,R=e.nil,C,X){return this._blockNode(new w(E,R,C)),X&&this.code(X).endFunc(),this}endFunc(){return this._endBlockNode(w)}optimize(E=1){for(;E-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(E){return this._currNode.nodes.push(E),this}_blockNode(E){this._currNode.nodes.push(E),this._nodes.push(E)}_endBlockNode(E,R){
|
|
566
|
-
const C=this._currNode;if(C instanceof E||R&&C instanceof R)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${R?`${E.kind}/${R.kind}`:E.kind}"`)}_elseNode(E){const R=this._currNode;if(!(R instanceof g))throw new Error('CodeGen: "else" without "if"');return this._currNode=R.else=E,this}get _root(){return this._nodes[0]}get _currNode(){const E=this._nodes;return E[E.length-1]}set _currNode(E){const R=this._nodes;R[R.length-1]=E}}
|
|
567
|
-
(x[R]||0)+(E[R]||0);return x}function j(x,E){return E instanceof e._CodeOrName?M(x,E.names):x}function
|
|
568
|
-
void 0)}}function U(x,E){for(const R in E)x[R]=(x[R]||0)-(E[R]||0)}function Y(x){return typeof x=="boolean"||typeof x=="number"||x===null?!x:(0,e._)`!${V(x)}`}
|
|
569
|
-
|
|
570
|
-
"boolean"?w:Object.keys(w).length===0?!0:(s(v,w),!i(w,v.self.RULES.all))}ye.alwaysValidSchema=n;function s(v,w=v.schema){const{opts:S,self:I}=v;if(!S.strictSchema||typeof w=="boolean")return;const F=I.RULES.keywords;for(const
|
|
571
|
-
return!1}ye.schemaHasRulesButRef=o;function a({topSchemaRef:v,schemaPath:w},S,I,F){if(!F){if(typeof S=="number"||typeof S=="boolean")return S;if(typeof S=="string")return(0,
|
|
572
|
-
return v.replace(/~1/g,"/").replace(/~0/g,"~")}ye.unescapeJsonPointer=f;function h(v,w){if(Array.isArray(v))for(const S of v)w(S);else w(v)}ye.eachItem=h;function $({mergeNames:v,mergeToName:w,mergeValues:S,resultToName:I}){return(F,
|
|
573
|
-
()=>{v.if((0,
|
|
574
|
-
()=>v.assign(S,w===!0?!0:(0,
|
|
575
|
-
w.code))})}ye.useFunc=g;var p;(function(v){v[v.Num=0]="Num",v[v.Str=1]="Str"})(p||(ye.Type=p={}));function m(v,w,S){if(v instanceof
|
|
576
|
-
checkStrictMode=_,ye}var gn={}
|
|
577
|
-
Name("scope"),json:new
|
|
578
|
-
keyword:d,schemaType:g})=>g?(0,e.str)`"${d}" keyword must be ${g} ($data)`:(0,e.str)`"${d}" keyword is invalid ($data)`};function s(d,g=
|
|
579
|
-
()=>d.if(g,()=>d.assign((0,e._)`${n.default.vErrors}.length`,g),()=>d.assign(n.default.vErrors,null)))}
|
|
580
|
-
(0,e._)`${w}.schemaPath`,(0,e.str)`${v.errSchemaPath}/${g}`),v.opts.verbose&&(d.assign((0,e._)`${w}.schema`,p),d.assign((0,e._)`${w}.data`,m))})}
|
|
565
|
+
const C=this._currNode;if(C instanceof E||R&&C instanceof R)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${R?`${E.kind}/${R.kind}`:E.kind}"`)}_elseNode(E){const R=this._currNode;if(!(R instanceof g))throw new Error('CodeGen: "else" without "if"');return this._currNode=R.else=E,this}get _root(){return this._nodes[0]}get _currNode(){const E=this._nodes;return E[E.length-1]}set _currNode(E){const R=this._nodes;R[R.length-1]=E}}r.CodeGen=k;function M(x,E){for(const R in E)x[R]=
|
|
566
|
+
(x[R]||0)+(E[R]||0);return x}function j(x,E){return E instanceof e._CodeOrName?M(x,E.names):x}function D(x,E,R){if(x instanceof e.Name)return C(x);if(!X(x))return x;return new e._Code(x._items.reduce((Z,ie)=>(ie instanceof e.Name&&(ie=C(ie)),ie instanceof e._Code?Z.push(...ie._items):Z.push(ie),Z),[]));function C(Z){const ie=R[Z.str];return ie===void 0||E[Z.str]!==1?Z:(delete E[Z.str],ie)}function X(Z){return Z instanceof e._Code&&Z._items.some(ie=>ie instanceof e.Name&&E[ie.str]===1&&R[ie.str]!==
|
|
567
|
+
void 0)}}function U(x,E){for(const R in E)x[R]=(x[R]||0)-(E[R]||0)}function Y(x){return typeof x=="boolean"||typeof x=="number"||x===null?!x:(0,e._)`!${V(x)}`}r.not=Y;const G=A(r.operators.AND);function J(...x){return x.reduce(G)}r.and=J;const se=A(r.operators.OR);function H(...x){return x.reduce(se)}r.or=H;function A(x){return(E,R)=>E===e.nil?R:R===e.nil?E:(0,e._)`${V(E)} ${x} ${V(R)}`}function V(x){return x instanceof e.Name?x:(0,e._)`(${x})`}}(Vi)),Vi}var ye={},gu;function $e(){if(gu)return ye;
|
|
568
|
+
gu=1,Object.defineProperty(ye,"__esModule",{value:!0}),ye.checkStrictMode=ye.getErrorPath=ye.Type=ye.useFunc=ye.setEvaluated=ye.evaluatedPropsToName=ye.mergeEvaluated=ye.eachItem=ye.unescapeJsonPointer=ye.escapeJsonPointer=ye.escapeFragment=ye.unescapeFragment=ye.schemaRefOrVal=ye.schemaHasRulesButRef=ye.schemaHasRules=ye.checkUnknownRules=ye.alwaysValidSchema=ye.toHash=void 0;const r=pe(),e=mn();function t(v){const w={};for(const S of v)w[S]=!0;return w}ye.toHash=t;function n(v,w){return typeof w==
|
|
569
|
+
"boolean"?w:Object.keys(w).length===0?!0:(s(v,w),!i(w,v.self.RULES.all))}ye.alwaysValidSchema=n;function s(v,w=v.schema){const{opts:S,self:I}=v;if(!S.strictSchema||typeof w=="boolean")return;const F=I.RULES.keywords;for(const W in w)F[W]||_(v,`unknown keyword: "${W}"`)}ye.checkUnknownRules=s;function i(v,w){if(typeof v=="boolean")return!v;for(const S in v)if(w[S])return!0;return!1}ye.schemaHasRules=i;function o(v,w){if(typeof v=="boolean")return!v;for(const S in v)if(S!=="$ref"&&w.all[S])return!0;
|
|
570
|
+
return!1}ye.schemaHasRulesButRef=o;function a({topSchemaRef:v,schemaPath:w},S,I,F){if(!F){if(typeof S=="number"||typeof S=="boolean")return S;if(typeof S=="string")return(0,r._)`${S}`}return(0,r._)`${v}${w}${(0,r.getProperty)(I)}`}ye.schemaRefOrVal=a;function c(v){return f(decodeURIComponent(v))}ye.unescapeFragment=c;function l(v){return encodeURIComponent(u(v))}ye.escapeFragment=l;function u(v){return typeof v=="number"?`${v}`:v.replace(/~/g,"~0").replace(/\//g,"~1")}ye.escapeJsonPointer=u;function f(v){
|
|
571
|
+
return v.replace(/~1/g,"/").replace(/~0/g,"~")}ye.unescapeJsonPointer=f;function h(v,w){if(Array.isArray(v))for(const S of v)w(S);else w(v)}ye.eachItem=h;function $({mergeNames:v,mergeToName:w,mergeValues:S,resultToName:I}){return(F,W,k,M)=>{const j=k===void 0?W:k instanceof r.Name?(W instanceof r.Name?v(F,W,k):w(F,W,k),k):W instanceof r.Name?(w(F,k,W),W):S(W,k);return M===r.Name&&!(j instanceof r.Name)?I(F,j):j}}ye.mergeEvaluated={props:$({mergeNames:(v,w,S)=>v.if((0,r._)`${S} !== true && ${w} !== undefined`,
|
|
572
|
+
()=>{v.if((0,r._)`${w} === true`,()=>v.assign(S,!0),()=>v.assign(S,(0,r._)`${S} || {}`).code((0,r._)`Object.assign(${S}, ${w})`))}),mergeToName:(v,w,S)=>v.if((0,r._)`${S} !== true`,()=>{w===!0?v.assign(S,!0):(v.assign(S,(0,r._)`${S} || {}`),y(v,S,w))}),mergeValues:(v,w)=>v===!0?!0:{...v,...w},resultToName:b}),items:$({mergeNames:(v,w,S)=>v.if((0,r._)`${S} !== true && ${w} !== undefined`,()=>v.assign(S,(0,r._)`${w} === true ? true : ${S} > ${w} ? ${S} : ${w}`)),mergeToName:(v,w,S)=>v.if((0,r._)`${S} !== true`,
|
|
573
|
+
()=>v.assign(S,w===!0?!0:(0,r._)`${S} > ${w} ? ${S} : ${w}`)),mergeValues:(v,w)=>v===!0?!0:Math.max(v,w),resultToName:(v,w)=>v.var("items",w)})};function b(v,w){if(w===!0)return v.var("props",!0);const S=v.var("props",(0,r._)`{}`);return w!==void 0&&y(v,S,w),S}ye.evaluatedPropsToName=b;function y(v,w,S){Object.keys(S).forEach(I=>v.assign((0,r._)`${w}${(0,r.getProperty)(I)}`,!0))}ye.setEvaluated=y;const d={};function g(v,w){return v.scopeValue("func",{ref:w,code:d[w.code]||(d[w.code]=new e._Code(
|
|
574
|
+
w.code))})}ye.useFunc=g;var p;(function(v){v[v.Num=0]="Num",v[v.Str=1]="Str"})(p||(ye.Type=p={}));function m(v,w,S){if(v instanceof r.Name){const I=w===p.Num;return S?I?(0,r._)`"[" + ${v} + "]"`:(0,r._)`"['" + ${v} + "']"`:I?(0,r._)`"/" + ${v}`:(0,r._)`"/" + ${v}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return S?(0,r.getProperty)(v).toString():"/"+u(v)}ye.getErrorPath=m;function _(v,w,S=v.opts.strictSchema){if(S){if(w=`strict mode: ${w}`,S===!0)throw new Error(w);v.self.logger.warn(w)}}return ye.
|
|
575
|
+
checkStrictMode=_,ye}var gn={},yu;function Qe(){if(yu)return gn;yu=1,Object.defineProperty(gn,"__esModule",{value:!0});const r=pe(),e={data:new r.Name("data"),valCxt:new r.Name("valCxt"),instancePath:new r.Name("instancePath"),parentData:new r.Name("parentData"),parentDataProperty:new r.Name("parentDataProperty"),rootData:new r.Name("rootData"),dynamicAnchors:new r.Name("dynamicAnchors"),vErrors:new r.Name("vErrors"),errors:new r.Name("errors"),this:new r.Name("this"),self:new r.Name("self"),scope:new r.
|
|
576
|
+
Name("scope"),json:new r.Name("json"),jsonPos:new r.Name("jsonPos"),jsonLen:new r.Name("jsonLen"),jsonPart:new r.Name("jsonPart")};return gn.default=e,gn}var $u;function yn(){return $u||($u=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.extendErrors=r.resetErrorsCount=r.reportExtraError=r.reportError=r.keyword$DataError=r.keywordError=void 0;const e=pe(),t=$e(),n=Qe();r.keywordError={message:({keyword:d})=>(0,e.str)`must pass "${d}" keyword validation`},r.keyword$DataError={message:({
|
|
577
|
+
keyword:d,schemaType:g})=>g?(0,e.str)`"${d}" keyword must be ${g} ($data)`:(0,e.str)`"${d}" keyword is invalid ($data)`};function s(d,g=r.keywordError,p,m){const{it:_}=d,{gen:v,compositeRule:w,allErrors:S}=_,I=f(d,g,p);m??(w||S)?c(v,I):l(_,(0,e._)`[${I}]`)}r.reportError=s;function i(d,g=r.keywordError,p){const{it:m}=d,{gen:_,compositeRule:v,allErrors:w}=m,S=f(d,g,p);c(_,S),v||w||l(m,n.default.vErrors)}r.reportExtraError=i;function o(d,g){d.assign(n.default.errors,g),d.if((0,e._)`${n.default.vErrors} !== null`,
|
|
578
|
+
()=>d.if(g,()=>d.assign((0,e._)`${n.default.vErrors}.length`,g),()=>d.assign(n.default.vErrors,null)))}r.resetErrorsCount=o;function a({gen:d,keyword:g,schemaValue:p,data:m,errsCount:_,it:v}){if(_===void 0)throw new Error("ajv implementation error");const w=d.name("err");d.forRange("i",_,n.default.errors,S=>{d.const(w,(0,e._)`${n.default.vErrors}[${S}]`),d.if((0,e._)`${w}.instancePath === undefined`,()=>d.assign((0,e._)`${w}.instancePath`,(0,e.strConcat)(n.default.instancePath,v.errorPath))),d.assign(
|
|
579
|
+
(0,e._)`${w}.schemaPath`,(0,e.str)`${v.errSchemaPath}/${g}`),v.opts.verbose&&(d.assign((0,e._)`${w}.schema`,p),d.assign((0,e._)`${w}.data`,m))})}r.extendErrors=a;function c(d,g){const p=d.const("err",g);d.if((0,e._)`${n.default.vErrors} === null`,()=>d.assign(n.default.vErrors,(0,e._)`[${p}]`),(0,e._)`${n.default.vErrors}.push(${p})`),d.code((0,e._)`${n.default.errors}++`)}function l(d,g){const{gen:p,validateName:m,schemaEnv:_}=d;_.$async?p.throw((0,e._)`new ${d.ValidationError}(${g})`):(p.assign(
|
|
581
580
|
(0,e._)`${m}.errors`,g),p.return(!1))}const u={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 f(d,g,p){const{createErrors:m}=d.it;return m===!1?(0,e._)`{}`:h(d,g,p)}function h(d,g,p={}){const{gen:m,it:_}=d,v=[$(_,p),b(d,p)];return y(d,g,v),m.object(...v)}function $({errorPath:d},{instancePath:g}){const p=g?
|
|
582
|
-
(0,e.str)`${d}${(0,
|
|
583
|
-
g(d):g||(0,e._)`{}`]),I.messages&&m.push([u.message,typeof p=="function"?p(d):p]),I.verbose&&m.push([u.schema,w],[u.parentSchema,(0,e._)`${
|
|
584
|
-
ct"&&l.$async===!0?c.return(
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
function $n(){if(
|
|
588
|
-
p.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');p.nullable===!0&&m.push("null")}return m}Pe.getSchemaTypes=o;function a(p){const m=Array.isArray(p)?p:p?[p]:[];if(m.every(
|
|
581
|
+
(0,e.str)`${d}${(0,t.getErrorPath)(g,t.Type.Str)}`:d;return[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,p)]}function b({keyword:d,it:{errSchemaPath:g}},{schemaPath:p,parentSchema:m}){let _=m?g:(0,e.str)`${g}/${d}`;return p&&(_=(0,e.str)`${_}${(0,t.getErrorPath)(p,t.Type.Str)}`),[u.schemaPath,_]}function y(d,{params:g,message:p},m){const{keyword:_,data:v,schemaValue:w,it:S}=d,{opts:I,propertyName:F,topSchemaRef:W,schemaPath:k}=S;m.push([u.keyword,_],[u.params,typeof g=="function"?
|
|
582
|
+
g(d):g||(0,e._)`{}`]),I.messages&&m.push([u.message,typeof p=="function"?p(d):p]),I.verbose&&m.push([u.schema,w],[u.parentSchema,(0,e._)`${W}${k}`],[n.default.data,v]),F&&m.push([u.propertyName,F])}}(Fi)),Fi}var _u;function wy(){if(_u)return zt;_u=1,Object.defineProperty(zt,"__esModule",{value:!0}),zt.boolOrEmptySchema=zt.topBoolOrEmptySchema=void 0;const r=yn(),e=pe(),t=Qe(),n={message:"boolean schema is false"};function s(a){const{gen:c,schema:l,validateName:u}=a;l===!1?o(a,!1):typeof l=="obje\
|
|
583
|
+
ct"&&l.$async===!0?c.return(t.default.data):(c.assign((0,e._)`${u}.errors`,null),c.return(!0))}zt.topBoolOrEmptySchema=s;function i(a,c){const{gen:l,schema:u}=a;u===!1?(l.var(c,!1),o(a)):l.var(c,!0)}zt.boolOrEmptySchema=i;function o(a,c){const{gen:l,data:u}=a,f={gen:l,keyword:"false schema",data:u,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:a};(0,r.reportError)(f,n,void 0,c)}return zt}var Pe={},Gt={},vu;function bu(){if(vu)return Gt;vu=1,Object.defineProperty(Gt,"__esModule",{value:!0}),
|
|
584
|
+
Gt.getRules=Gt.isJSONType=void 0;const r=["string","number","integer","boolean","null","object","array"],e=new Set(r);function t(s){return typeof s=="string"&&e.has(s)}Gt.isJSONType=t;function n(){const s={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...s,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},s.number,s.string,s.array,s.object],post:{rules:[]},all:{},keywords:{}}}return Gt.getRules=n,Gt}var ht={},
|
|
585
|
+
wu;function Eu(){if(wu)return ht;wu=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.shouldUseRule=ht.shouldUseGroup=ht.schemaHasRulesForType=void 0;function r({schema:n,self:s},i){const o=s.RULES.types[i];return o&&o!==!0&&e(n,o)}ht.schemaHasRulesForType=r;function e(n,s){return s.rules.some(i=>t(n,i))}ht.shouldUseGroup=e;function t(n,s){var i;return n[s.keyword]!==void 0||((i=s.definition.implements)===null||i===void 0?void 0:i.some(o=>n[o]!==void 0))}return ht.shouldUseRule=t,ht}var Su;
|
|
586
|
+
function $n(){if(Su)return Pe;Su=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.reportTypeError=Pe.checkDataTypes=Pe.checkDataType=Pe.coerceAndCheckDataType=Pe.getJSONTypes=Pe.getSchemaTypes=Pe.DataType=void 0;const r=bu(),e=Eu(),t=yn(),n=pe(),s=$e();var i;(function(p){p[p.Correct=0]="Correct",p[p.Wrong=1]="Wrong"})(i||(Pe.DataType=i={}));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&&
|
|
587
|
+
p.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');p.nullable===!0&&m.push("null")}return m}Pe.getSchemaTypes=o;function a(p){const m=Array.isArray(p)?p:p?[p]:[];if(m.every(r.isJSONType))return m;throw new Error("type must be JSONType or JSONType[]: "+m.join(","))}Pe.getJSONTypes=a;function c(p,m){const{gen:_,data:v,opts:w}=p,S=u(m,w.coerceTypes),I=m.length>0&&!(S.length===0&&m.length===1&&(0,e.schemaHasRulesForType)(p,m[0]));if(I){const F=b(m,v,w.strictNumbers,i.Wrong);
|
|
589
588
|
_.if(F,()=>{S.length?f(p,m,S):d(p)})}return I}Pe.coerceAndCheckDataType=c;const l=new Set(["string","number","integer","boolean","null"]);function u(p,m){return m?p.filter(_=>l.has(_)||m==="array"&&_==="array"):[]}function f(p,m,_){const{gen:v,data:w,opts:S}=p,I=v.let("dataType",(0,n._)`typeof ${w}`),F=v.let("coerced",(0,n._)`undefined`);S.coerceTypes==="array"&&v.if((0,n._)`${I} == 'object' && Array.isArray(${w}) && ${w}.length == 1`,()=>v.assign(w,(0,n._)`${w}[0]`).assign(I,(0,n._)`typeof ${w}`).
|
|
590
|
-
if(b(m,w,S.strictNumbers),()=>v.assign(F,w))),v.if((0,n._)`${F} !== undefined`);for(const
|
|
589
|
+
if(b(m,w,S.strictNumbers),()=>v.assign(F,w))),v.if((0,n._)`${F} !== undefined`);for(const k of _)(l.has(k)||k==="array"&&S.coerceTypes==="array")&&W(k);v.else(),d(p),v.endIf(),v.if((0,n._)`${F} !== undefined`,()=>{v.assign(w,F),h(p,F)});function W(k){switch(k){case"string":v.elseIf((0,n._)`${I} == "number" || ${I} == "boolean"`).assign(F,(0,n._)`"" + ${w}`).elseIf((0,n._)`${w} === null`).assign(F,(0,n._)`""`);return;case"number":v.elseIf((0,n._)`${I} == "boolean" || ${w} === null
|
|
591
590
|
|| (${I} == "string" && ${w} && ${w} == +${w})`).assign(F,(0,n._)`+${w}`);return;case"integer":v.elseIf((0,n._)`${I} === "boolean" || ${w} === null
|
|
592
591
|
|| (${I} === "string" && ${w} && ${w} == +${w} && !(${w} % 1))`).assign(F,(0,n._)`+${w}`);return;case"boolean":v.elseIf((0,n._)`${w} === "false" || ${w} === 0 || ${w} === null`).assign(F,!1).elseIf((0,n._)`${w} === "true" || ${w} === 1`).assign(F,!0);return;case"null":v.elseIf((0,n._)`${w} === "" || ${w} === 0 || ${w} === false`),v.assign(F,null);return;case"array":v.elseIf((0,n._)`${I} === "string" || ${I} === "number"
|
|
593
592
|
|| ${I} === "boolean" || ${w} === null`).assign(F,(0,n._)`[${w}]`)}}}function h({gen:p,parentData:m,parentDataProperty:_},v){p.if((0,n._)`${m} !== undefined`,()=>p.assign((0,n._)`${m}[${_}]`,v))}function $(p,m,_,v=i.Correct){const w=v===i.Correct?n.operators.EQ:n.operators.NEQ;let S;switch(p){case"null":return(0,n._)`${m} ${w} null`;case"array":S=(0,n._)`Array.isArray(${m})`;break;case"object":S=(0,n._)`${m} && typeof ${m} == "object" && !Array.isArray(${m})`;break;case"integer":S=
|
|
594
593
|
I((0,n._)`!(${m} % 1) && !isNaN(${m})`);break;case"number":S=I();break;default:return(0,n._)`typeof ${m} ${w} ${p}`}return v===i.Correct?S:(0,n.not)(S);function I(F=n.nil){return(0,n.and)((0,n._)`typeof ${m} == "number"`,F,_?(0,n._)`isFinite(${m})`:n.nil)}}Pe.checkDataType=$;function b(p,m,_,v){if(p.length===1)return $(p[0],m,_,v);let w;const S=(0,s.toHash)(p);if(S.array&&S.object){const I=(0,n._)`typeof ${m} != "object"`;w=S.null?I:(0,n._)`!${m} || ${I}`,delete S.null,delete S.array,delete S.object}else
|
|
595
|
-
w=n.nil;S.number&&delete S.integer;for(const I in S)w=(0,n.and)(w,$(I,m,_,v));return w}Pe.checkDataTypes=b;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 d(p){const m=g(p);(0,
|
|
596
|
-
it:p}}return Pe}var Tr={},
|
|
597
|
-
s,`default is ignored for: ${f}`);return}let h=(0,
|
|
598
|
-
ve.checkMissingProp=ve.checkReportMissingProp=void 0;const
|
|
599
|
-
return p.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,
|
|
600
|
-
return p?Object.keys(p).filter(m=>m!=="__proto__"):[]}ve.allSchemaProperties=f;function h(p,m){return f(m).filter(_=>!(0,e.alwaysValidSchema)(p,m[_]))}ve.schemaProperties=h;function $({schemaCode:p,data:m,it:{gen:_,topSchemaRef:v,schemaPath:w,errorPath:S},it:I},F,
|
|
601
|
-
I.opts.dynamicRef&&j.push([
|
|
602
|
-
data:_,keyword:v,it:w}=p,S=m.name("valid");if(w.allErrors){const F=m.let("valid",!0);return I(()=>m.assign(F,!1)),F}return m.var(S,!0),I(()=>m.break()),S;function I(F){const
|
|
603
|
-
!w.opts.unevaluated)return;const I=m.let("valid",!1),F=m.name("_valid");m.block(()=>_.forEach((
|
|
604
|
-
const
|
|
605
|
-
$.compile.call(_.self,g,p,_):$.validate,w=l(y,d,v),S=y.let("valid");h.block$data(S,I),h.ok((b=$.valid)!==null&&b!==void 0?b:S);function I(){if($.errors===!1)
|
|
606
|
-
return y.assign(j,null),
|
|
607
|
-
if((0,
|
|
608
|
-
stringify)(b)})}function u(h,$,b=!1){return!$.length||$.some(y=>y==="array"?Array.isArray(h):y==="object"?h&&typeof h=="object"&&!Array.isArray(h):typeof h==y||b&&typeof h>"u")}
|
|
609
|
-
f ${g}: ${p.join(",")}`);if(d.validateSchema&&!d.validateSchema(h[g])){const _=`keyword "${g}" value is invalid at path "${y}": `+b.errorsText(d.validateSchema.errors);if($.validateSchema==="log")b.logger.error(_);else throw new Error(_)}}return
|
|
610
|
-
schemaPath:l,errSchemaPath:u,topSchemaRef:f}){if(o!==void 0&&c!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(o!==void 0){const h=i.schema[o];return a===void 0?{schema:h,schemaPath:(0,
|
|
611
|
-
u===void 0||f===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:c,schemaPath:l,topSchemaRef:f,errSchemaPath:u}}throw new Error('either "keyword" or "schema" must be passed')}pt.getSubschema=
|
|
612
|
-
g=h.let("data",(0,
|
|
613
|
-
n;function s(i,{jtdDiscriminator:o,jtdMetadata:a,compositeRule:c,createErrors:l,allErrors:u}){c!==void 0&&(i.compositeRule=c),l!==void 0&&(i.createErrors=l),u!==void 0&&(i.allErrors=u),i.jtdDiscriminator=o,i.jtdMetadata=a}return pt.extendSubschemaMode=s,pt}var je={},
|
|
614
|
-
{additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},
|
|
615
|
-
function e(n,s,i,o,a,c,l,u,f,h){if(o&&typeof o=="object"&&!Array.isArray(o)){s(o,a,c,l,u,f,h);for(var $ in o){var b=o[$];if(Array.isArray(b)){if($ in
|
|
616
|
-
"~1")}return
|
|
617
|
-
d:!1}je.inlineRef=s;const i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function o(y){for(const d in y){if(i.has(d))return!0;const g=y[d];if(Array.isArray(g)&&g.some(o)||typeof g=="object"&&o(g))return!0}return!1}function a(y){let d=0;for(const g in y){if(g==="$ref")return 1/0;if(d++,!n.has(g)&&(typeof y[g]=="object"&&(0,
|
|
618
|
-
c;function l(y,d){return y.serialize(d).split("#")[0]+"#"}je._getFullPath=l;const u=/#\/?$/;function f(y){return y?y.replace(u,""):""}je.normalizeId=f;function h(y,d,g){return g=f(g),y.resolve(d,g)}je.resolveUrl=h;const $=/^[a-z_][-a-z0-9._]*$/i;function b(y,d){if(typeof y=="boolean")return{};const{schemaId:g,uriResolver:p}=this.opts,m=f(y[g]||d),_={"":m},v=c(p,m,!1),w={},S=new Set;return
|
|
619
|
-
|
|
620
|
-
return new Error(`reference "${
|
|
594
|
+
w=n.nil;S.number&&delete S.integer;for(const I in S)w=(0,n.and)(w,$(I,m,_,v));return w}Pe.checkDataTypes=b;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 d(p){const m=g(p);(0,t.reportError)(m,y)}Pe.reportTypeError=d;function g(p){const{gen:m,data:_,schema:v}=p,w=(0,s.schemaRefOrVal)(p,v,"type");return{gen:m,keyword:"type",data:_,schema:v.type,schemaCode:w,schemaValue:w,parentSchema:v,params:{},
|
|
595
|
+
it:p}}return Pe}var Tr={},Ru;function Ey(){if(Ru)return Tr;Ru=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.assignDefaults=void 0;const r=pe(),e=$e();function t(s,i){const{properties:o,items:a}=s.schema;if(i==="object"&&o)for(const c in o)n(s,c,o[c].default);else i==="array"&&Array.isArray(a)&&a.forEach((c,l)=>n(s,l,c.default))}Tr.assignDefaults=t;function n(s,i,o){const{gen:a,compositeRule:c,data:l,opts:u}=s;if(o===void 0)return;const f=(0,r._)`${l}${(0,r.getProperty)(i)}`;if(c){(0,e.checkStrictMode)(
|
|
596
|
+
s,`default is ignored for: ${f}`);return}let h=(0,r._)`${f} === undefined`;u.useDefaults==="empty"&&(h=(0,r._)`${h} || ${f} === null || ${f} === ""`),a.if(h,(0,r._)`${f} = ${(0,r.stringify)(o)}`)}return Tr}var Ze={},ve={},Au;function et(){if(Au)return ve;Au=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.validateUnion=ve.validateArray=ve.usePattern=ve.callValidateCode=ve.schemaProperties=ve.allSchemaProperties=ve.noPropertyInData=ve.propertyInData=ve.isOwnProperty=ve.hasPropFunc=ve.reportMissingProp=
|
|
597
|
+
ve.checkMissingProp=ve.checkReportMissingProp=void 0;const r=pe(),e=$e(),t=Qe(),n=$e();function s(p,m){const{gen:_,data:v,it:w}=p;_.if(u(_,v,m,w.opts.ownProperties),()=>{p.setParams({missingProperty:(0,r._)`${m}`},!0),p.error()})}ve.checkReportMissingProp=s;function i({gen:p,data:m,it:{opts:_}},v,w){return(0,r.or)(...v.map(S=>(0,r.and)(u(p,m,S,_.ownProperties),(0,r._)`${w} = ${S}`)))}ve.checkMissingProp=i;function o(p,m){p.setParams({missingProperty:m},!0),p.error()}ve.reportMissingProp=o;function a(p){
|
|
598
|
+
return p.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,r._)`Object.prototype.hasOwnProperty`})}ve.hasPropFunc=a;function c(p,m,_){return(0,r._)`${a(p)}.call(${m}, ${_})`}ve.isOwnProperty=c;function l(p,m,_,v){const w=(0,r._)`${m}${(0,r.getProperty)(_)} !== undefined`;return v?(0,r._)`${w} && ${c(p,m,_)}`:w}ve.propertyInData=l;function u(p,m,_,v){const w=(0,r._)`${m}${(0,r.getProperty)(_)} === undefined`;return v?(0,r.or)(w,(0,r.not)(c(p,m,_))):w}ve.noPropertyInData=u;function f(p){
|
|
599
|
+
return p?Object.keys(p).filter(m=>m!=="__proto__"):[]}ve.allSchemaProperties=f;function h(p,m){return f(m).filter(_=>!(0,e.alwaysValidSchema)(p,m[_]))}ve.schemaProperties=h;function $({schemaCode:p,data:m,it:{gen:_,topSchemaRef:v,schemaPath:w,errorPath:S},it:I},F,W,k){const M=k?(0,r._)`${p}, ${m}, ${v}${w}`:m,j=[[t.default.instancePath,(0,r.strConcat)(t.default.instancePath,S)],[t.default.parentData,I.parentData],[t.default.parentDataProperty,I.parentDataProperty],[t.default.rootData,t.default.rootData]];
|
|
600
|
+
I.opts.dynamicRef&&j.push([t.default.dynamicAnchors,t.default.dynamicAnchors]);const D=(0,r._)`${M}, ${_.object(...j)}`;return W!==r.nil?(0,r._)`${F}.call(${W}, ${D})`:(0,r._)`${F}(${D})`}ve.callValidateCode=$;const b=(0,r._)`new RegExp`;function y({gen:p,it:{opts:m}},_){const v=m.unicodeRegExp?"u":"",{regExp:w}=m.code,S=w(_,v);return p.scopeValue("pattern",{key:S.toString(),ref:S,code:(0,r._)`${w.code==="new RegExp"?b:(0,n.useFunc)(p,w)}(${_}, ${v})`})}ve.usePattern=y;function d(p){const{gen:m,
|
|
601
|
+
data:_,keyword:v,it:w}=p,S=m.name("valid");if(w.allErrors){const F=m.let("valid",!0);return I(()=>m.assign(F,!1)),F}return m.var(S,!0),I(()=>m.break()),S;function I(F){const W=m.const("len",(0,r._)`${_}.length`);m.forRange("i",0,W,k=>{p.subschema({keyword:v,dataProp:k,dataPropType:e.Type.Num},S),m.if((0,r.not)(S),F)})}}ve.validateArray=d;function g(p){const{gen:m,schema:_,keyword:v,it:w}=p;if(!Array.isArray(_))throw new Error("ajv implementation error");if(_.some(W=>(0,e.alwaysValidSchema)(w,W))&&
|
|
602
|
+
!w.opts.unevaluated)return;const I=m.let("valid",!1),F=m.name("_valid");m.block(()=>_.forEach((W,k)=>{const M=p.subschema({keyword:v,schemaProp:k,compositeRule:!0},F);m.assign(I,(0,r._)`${I} || ${F}`),p.mergeValidEvaluated(M,F)||m.if((0,r.not)(I))})),p.result(I,()=>p.reset(),()=>p.error(!0))}return ve.validateUnion=g,ve}var Ou;function Sy(){if(Ou)return Ze;Ou=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.validateKeywordUsage=Ze.validSchemaType=Ze.funcKeywordCode=Ze.macroKeywordCode=void 0;
|
|
603
|
+
const r=pe(),e=Qe(),t=et(),n=yn();function s(h,$){const{gen:b,keyword:y,schema:d,parentSchema:g,it:p}=h,m=$.macro.call(p.self,d,g,p),_=l(b,y,m);p.opts.validateSchema!==!1&&p.self.validateSchema(m,!0);const v=b.name("valid");h.subschema({schema:m,schemaPath:r.nil,errSchemaPath:`${p.errSchemaPath}/${y}`,topSchemaRef:_,compositeRule:!0},v),h.pass(v,()=>h.error(!0))}Ze.macroKeywordCode=s;function i(h,$){var b;const{gen:y,keyword:d,schema:g,parentSchema:p,$data:m,it:_}=h;c(_,$);const v=!m&&$.compile?
|
|
604
|
+
$.compile.call(_.self,g,p,_):$.validate,w=l(y,d,v),S=y.let("valid");h.block$data(S,I),h.ok((b=$.valid)!==null&&b!==void 0?b:S);function I(){if($.errors===!1)k(),$.modifying&&o(h),M(()=>h.error());else{const j=$.async?F():W();$.modifying&&o(h),M(()=>a(h,j))}}function F(){const j=y.let("ruleErrs",null);return y.try(()=>k((0,r._)`await `),D=>y.assign(S,!1).if((0,r._)`${D} instanceof ${_.ValidationError}`,()=>y.assign(j,(0,r._)`${D}.errors`),()=>y.throw(D))),j}function W(){const j=(0,r._)`${w}.errors`;
|
|
605
|
+
return y.assign(j,null),k(r.nil),j}function k(j=$.async?(0,r._)`await `:r.nil){const D=_.opts.passContext?e.default.this:e.default.self,U=!("compile"in $&&!m||$.schema===!1);y.assign(S,(0,r._)`${j}${(0,t.callValidateCode)(h,w,D,U)}`,$.modifying)}function M(j){var D;y.if((0,r.not)((D=$.valid)!==null&&D!==void 0?D:S),j)}}Ze.funcKeywordCode=i;function o(h){const{gen:$,data:b,it:y}=h;$.if(y.parentData,()=>$.assign(b,(0,r._)`${y.parentData}[${y.parentDataProperty}]`))}function a(h,$){const{gen:b}=h;b.
|
|
606
|
+
if((0,r._)`Array.isArray(${$})`,()=>{b.assign(e.default.vErrors,(0,r._)`${e.default.vErrors} === null ? ${$} : ${e.default.vErrors}.concat(${$})`).assign(e.default.errors,(0,r._)`${e.default.vErrors}.length`),(0,n.extendErrors)(h)},()=>h.error())}function c({schemaEnv:h},$){if($.async&&!h.$async)throw new Error("async keyword in sync schema")}function l(h,$,b){if(b===void 0)throw new Error(`keyword "${$}" failed to compile`);return h.scopeValue("keyword",typeof b=="function"?{ref:b}:{ref:b,code:(0,r.
|
|
607
|
+
stringify)(b)})}function u(h,$,b=!1){return!$.length||$.some(y=>y==="array"?Array.isArray(h):y==="object"?h&&typeof h=="object"&&!Array.isArray(h):typeof h==y||b&&typeof h>"u")}Ze.validSchemaType=u;function f({schema:h,opts:$,self:b,errSchemaPath:y},d,g){if(Array.isArray(d.keyword)?!d.keyword.includes(g):d.keyword!==g)throw new Error("ajv implementation error");const p=d.dependencies;if(p?.some(m=>!Object.prototype.hasOwnProperty.call(h,m)))throw new Error(`parent schema must have dependencies o\
|
|
608
|
+
f ${g}: ${p.join(",")}`);if(d.validateSchema&&!d.validateSchema(h[g])){const _=`keyword "${g}" value is invalid at path "${y}": `+b.errorsText(d.validateSchema.errors);if($.validateSchema==="log")b.logger.error(_);else throw new Error(_)}}return Ze.validateKeywordUsage=f,Ze}var pt={},Cu;function Ry(){if(Cu)return pt;Cu=1,Object.defineProperty(pt,"__esModule",{value:!0}),pt.extendSubschemaMode=pt.extendSubschemaData=pt.getSubschema=void 0;const r=pe(),e=$e();function t(i,{keyword:o,schemaProp:a,schema:c,
|
|
609
|
+
schemaPath:l,errSchemaPath:u,topSchemaRef:f}){if(o!==void 0&&c!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(o!==void 0){const h=i.schema[o];return a===void 0?{schema:h,schemaPath:(0,r._)`${i.schemaPath}${(0,r.getProperty)(o)}`,errSchemaPath:`${i.errSchemaPath}/${o}`}:{schema:h[a],schemaPath:(0,r._)`${i.schemaPath}${(0,r.getProperty)(o)}${(0,r.getProperty)(a)}`,errSchemaPath:`${i.errSchemaPath}/${o}/${(0,e.escapeFragment)(a)}`}}if(c!==void 0){if(l===void 0||
|
|
610
|
+
u===void 0||f===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:c,schemaPath:l,topSchemaRef:f,errSchemaPath:u}}throw new Error('either "keyword" or "schema" must be passed')}pt.getSubschema=t;function n(i,o,{dataProp:a,dataPropType:c,data:l,dataTypes:u,propertyName:f}){if(l!==void 0&&a!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:h}=o;if(a!==void 0){const{errorPath:b,dataPathArr:y,opts:d}=o,
|
|
611
|
+
g=h.let("data",(0,r._)`${o.data}${(0,r.getProperty)(a)}`,!0);$(g),i.errorPath=(0,r.str)`${b}${(0,e.getErrorPath)(a,c,d.jsPropertySyntax)}`,i.parentDataProperty=(0,r._)`${a}`,i.dataPathArr=[...y,i.parentDataProperty]}if(l!==void 0){const b=l instanceof r.Name?l:h.let("data",l,!0);$(b),f!==void 0&&(i.propertyName=f)}u&&(i.dataTypes=u);function $(b){i.data=b,i.dataLevel=o.dataLevel+1,i.dataTypes=[],o.definedProperties=new Set,i.parentData=o.data,i.dataNames=[...o.dataNames,b]}}pt.extendSubschemaData=
|
|
612
|
+
n;function s(i,{jtdDiscriminator:o,jtdMetadata:a,compositeRule:c,createErrors:l,allErrors:u}){c!==void 0&&(i.compositeRule=c),l!==void 0&&(i.createErrors=l),u!==void 0&&(i.allErrors=u),i.jtdDiscriminator=o,i.jtdMetadata=a}return pt.extendSubschemaMode=s,pt}var je={},Bi={exports:{}},Pu;function Ay(){if(Pu)return Bi.exports;Pu=1;var r=Bi.exports=function(n,s,i){typeof s=="function"&&(i=s,s={}),i=s.cb||i;var o=typeof i=="function"?i:i.pre||function(){},a=i.post||function(){};e(s,o,a,n,"",n)};r.keywords=
|
|
613
|
+
{additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};
|
|
614
|
+
function e(n,s,i,o,a,c,l,u,f,h){if(o&&typeof o=="object"&&!Array.isArray(o)){s(o,a,c,l,u,f,h);for(var $ in o){var b=o[$];if(Array.isArray(b)){if($ in r.arrayKeywords)for(var y=0;y<b.length;y++)e(n,s,i,b[y],a+"/"+$+"/"+y,c,a,$,o,y)}else if($ in r.propsKeywords){if(b&&typeof b=="object")for(var d in b)e(n,s,i,b[d],a+"/"+$+"/"+t(d),c,a,$,o,d)}else($ in r.keywords||n.allKeys&&!($ in r.skipKeywords))&&e(n,s,i,b,a+"/"+$,c,a,$,o)}i(o,a,c,l,u,f,h)}}function t(n){return n.replace(/~/g,"~0").replace(/\//g,
|
|
615
|
+
"~1")}return Bi.exports}var Iu;function _n(){if(Iu)return je;Iu=1,Object.defineProperty(je,"__esModule",{value:!0}),je.getSchemaRefs=je.resolveUrl=je.normalizeId=je._getFullPath=je.getFullPath=je.inlineRef=void 0;const r=$e(),e=ma(),t=Ay(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(y,d=!0){return typeof y=="boolean"?!0:d===!0?!o(y):d?a(y)<=
|
|
616
|
+
d:!1}je.inlineRef=s;const i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function o(y){for(const d in y){if(i.has(d))return!0;const g=y[d];if(Array.isArray(g)&&g.some(o)||typeof g=="object"&&o(g))return!0}return!1}function a(y){let d=0;for(const g in y){if(g==="$ref")return 1/0;if(d++,!n.has(g)&&(typeof y[g]=="object"&&(0,r.eachItem)(y[g],p=>d+=a(p)),d===1/0))return 1/0}return d}function c(y,d="",g){g!==!1&&(d=f(d));const p=y.parse(d);return l(y,p)}je.getFullPath=
|
|
617
|
+
c;function l(y,d){return y.serialize(d).split("#")[0]+"#"}je._getFullPath=l;const u=/#\/?$/;function f(y){return y?y.replace(u,""):""}je.normalizeId=f;function h(y,d,g){return g=f(g),y.resolve(d,g)}je.resolveUrl=h;const $=/^[a-z_][-a-z0-9._]*$/i;function b(y,d){if(typeof y=="boolean")return{};const{schemaId:g,uriResolver:p}=this.opts,m=f(y[g]||d),_={"":m},v=c(p,m,!1),w={},S=new Set;return t(y,{allKeys:!0},(W,k,M,j)=>{if(j===void 0)return;const D=v+k;let U=_[j];typeof W[g]=="string"&&(U=Y.call(this,
|
|
618
|
+
W[g])),G.call(this,W.$anchor),G.call(this,W.$dynamicAnchor),_[k]=U;function Y(J){const se=this.opts.uriResolver.resolve;if(J=f(U?se(U,J):J),S.has(J))throw F(J);S.add(J);let H=this.refs[J];return typeof H=="string"&&(H=this.refs[H]),typeof H=="object"?I(W,H.schema,J):J!==f(D)&&(J[0]==="#"?(I(W,w[J],J),w[J]=W):this.refs[J]=D),J}function G(J){if(typeof J=="string"){if(!$.test(J))throw new Error(`invalid anchor "${J}"`);Y.call(this,`#${J}`)}}}),w;function I(W,k,M){if(k!==void 0&&!e(W,k))throw F(M)}function F(W){
|
|
619
|
+
return new Error(`reference "${W}" resolves to more than one schema`)}}return je.getSchemaRefs=b,je}var Nu;function jr(){if(Nu)return dt;Nu=1,Object.defineProperty(dt,"__esModule",{value:!0}),dt.getData=dt.KeywordCxt=dt.validateFunctionCode=void 0;const r=wy(),e=$n(),t=Eu(),n=$n(),s=Ey(),i=Sy(),o=Ry(),a=pe(),c=Qe(),l=_n(),u=$e(),f=yn();function h(L){if(v(L)&&(S(L),_(L))){d(L);return}$(L,()=>(0,r.topBoolOrEmptySchema)(L))}dt.validateFunctionCode=h;function $({gen:L,validateName:q,schema:Q,schemaEnv:ne,
|
|
621
620
|
opts:P},T){P.code.es5?L.func(q,(0,a._)`${c.default.data}, ${c.default.valCxt}`,ne.$async,()=>{L.code((0,a._)`"use strict"; ${p(Q,P)}`),y(L,P),L.code(T)}):L.func(q,(0,a._)`${c.default.data}, ${b(P)}`,ne.$async,()=>L.code(p(Q,P)).code(T))}function b(L){return(0,a._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${L.dynamicRef?(0,a._)`, ${c.default.dynamicAnchors}={}`:a.nil}}={}`}function y(L,q){L.if(c.default.valCxt,
|
|
622
621
|
()=>{L.var(c.default.instancePath,(0,a._)`${c.default.valCxt}.${c.default.instancePath}`),L.var(c.default.parentData,(0,a._)`${c.default.valCxt}.${c.default.parentData}`),L.var(c.default.parentDataProperty,(0,a._)`${c.default.valCxt}.${c.default.parentDataProperty}`),L.var(c.default.rootData,(0,a._)`${c.default.valCxt}.${c.default.rootData}`),q.dynamicRef&&L.var(c.default.dynamicAnchors,(0,a._)`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{L.var(c.default.instancePath,(0,a._)`""`),L.var(
|
|
623
|
-
c.default.parentData,(0,a._)`undefined`),L.var(c.default.parentDataProperty,(0,a._)`undefined`),L.var(c.default.rootData,c.default.data),q.dynamicRef&&L.var(c.default.dynamicAnchors,(0,a._)`{}`)})}function d(L){const{schema:q,opts:Q,gen:ne}=L;$(L,()=>{Q.$comment&&q.$comment&&j(L),
|
|
624
|
-
()=>q.assign((0,a._)`${L.evaluated}.props`,(0,a._)`undefined`)),q.if((0,a._)`${L.evaluated}.dynamicItems`,()=>q.assign((0,a._)`${L.evaluated}.items`,(0,a._)`undefined`))}function p(L,q){const Q=typeof L=="object"&&L[q.schemaId];return Q&&(q.code.source||q.code.process)?(0,a._)`/*# sourceURL=${Q} */`:a.nil}function m(L,q){if(v(L)&&(S(L),_(L))){w(L,q);return}(0,
|
|
625
|
-
function v(L){return typeof L.schema!="boolean"}function w(L,q){const{schema:Q,gen:ne,opts:P}=L;P.$comment&&Q.$comment&&j(L),
|
|
626
|
-
(0,u.schemaHasRulesButRef)(q,P.RULES)&&P.logger.warn(`$ref: keywords ignored in schema at path "${Q}"`)}function
|
|
627
|
-
schema:Q,errSchemaPath:ne,opts:P}){const T=Q.$comment;if(P.$comment===!0)L.code((0,a._)`${c.default.self}.logger.log(${T})`);else if(typeof P.$comment=="function"){const ee=(0,a.str)`${ne}/$comment`,
|
|
628
|
-
default.vErrors})`)):(q.assign((0,a._)`${ne}.errors`,c.default.vErrors),T.unevaluated&&U(L),q.return((0,a._)`${c.default.errors} === 0`))}function U({gen:L,evaluated:q,props:Q,items:ne}){Q instanceof a.Name&&L.assign((0,a._)`${q}.props`,Q),ne instanceof a.Name&&L.assign((0,a._)`${q}.items`,ne)}function Y(L,q,Q,ne){const{gen:P,schema:T,data:ee,allErrors:
|
|
629
|
-
return}N.jtd||J(L,q),P.block(()=>{for(const le of z.rules)re(le);re(z.post)});function re(le){(0,
|
|
622
|
+
c.default.parentData,(0,a._)`undefined`),L.var(c.default.parentDataProperty,(0,a._)`undefined`),L.var(c.default.rootData,c.default.data),q.dynamicRef&&L.var(c.default.dynamicAnchors,(0,a._)`{}`)})}function d(L){const{schema:q,opts:Q,gen:ne}=L;$(L,()=>{Q.$comment&&q.$comment&&j(L),W(L),ne.let(c.default.vErrors,null),ne.let(c.default.errors,0),Q.unevaluated&&g(L),I(L),D(L)})}function g(L){const{gen:q,validateName:Q}=L;L.evaluated=q.const("evaluated",(0,a._)`${Q}.evaluated`),q.if((0,a._)`${L.evaluated}.dynamicProps`,
|
|
623
|
+
()=>q.assign((0,a._)`${L.evaluated}.props`,(0,a._)`undefined`)),q.if((0,a._)`${L.evaluated}.dynamicItems`,()=>q.assign((0,a._)`${L.evaluated}.items`,(0,a._)`undefined`))}function p(L,q){const Q=typeof L=="object"&&L[q.schemaId];return Q&&(q.code.source||q.code.process)?(0,a._)`/*# sourceURL=${Q} */`:a.nil}function m(L,q){if(v(L)&&(S(L),_(L))){w(L,q);return}(0,r.boolOrEmptySchema)(L,q)}function _({schema:L,self:q}){if(typeof L=="boolean")return!L;for(const Q in L)if(q.RULES.all[Q])return!0;return!1}
|
|
624
|
+
function v(L){return typeof L.schema!="boolean"}function w(L,q){const{schema:Q,gen:ne,opts:P}=L;P.$comment&&Q.$comment&&j(L),k(L),M(L);const T=ne.const("_errs",c.default.errors);I(L,T),ne.var(q,(0,a._)`${T} === ${c.default.errors}`)}function S(L){(0,u.checkUnknownRules)(L),F(L)}function I(L,q){if(L.opts.jtd)return Y(L,[],!1,q);const Q=(0,e.getSchemaTypes)(L.schema),ne=(0,e.coerceAndCheckDataType)(L,Q);Y(L,Q,!ne,q)}function F(L){const{schema:q,errSchemaPath:Q,opts:ne,self:P}=L;q.$ref&&ne.ignoreKeywordsWithRef&&
|
|
625
|
+
(0,u.schemaHasRulesButRef)(q,P.RULES)&&P.logger.warn(`$ref: keywords ignored in schema at path "${Q}"`)}function W(L){const{schema:q,opts:Q}=L;q.default!==void 0&&Q.useDefaults&&Q.strictSchema&&(0,u.checkStrictMode)(L,"default is ignored in the schema root")}function k(L){const q=L.schema[L.opts.schemaId];q&&(L.baseId=(0,l.resolveUrl)(L.opts.uriResolver,L.baseId,q))}function M(L){if(L.schema.$async&&!L.schemaEnv.$async)throw new Error("async schema in sync schema")}function j({gen:L,schemaEnv:q,
|
|
626
|
+
schema:Q,errSchemaPath:ne,opts:P}){const T=Q.$comment;if(P.$comment===!0)L.code((0,a._)`${c.default.self}.logger.log(${T})`);else if(typeof P.$comment=="function"){const ee=(0,a.str)`${ne}/$comment`,K=L.scopeValue("root",{ref:q.root});L.code((0,a._)`${c.default.self}.opts.$comment(${T}, ${ee}, ${K}.schema)`)}}function D(L){const{gen:q,schemaEnv:Q,validateName:ne,ValidationError:P,opts:T}=L;Q.$async?q.if((0,a._)`${c.default.errors} === 0`,()=>q.return(c.default.data),()=>q.throw((0,a._)`new ${P}(${c.
|
|
627
|
+
default.vErrors})`)):(q.assign((0,a._)`${ne}.errors`,c.default.vErrors),T.unevaluated&&U(L),q.return((0,a._)`${c.default.errors} === 0`))}function U({gen:L,evaluated:q,props:Q,items:ne}){Q instanceof a.Name&&L.assign((0,a._)`${q}.props`,Q),ne instanceof a.Name&&L.assign((0,a._)`${q}.items`,ne)}function Y(L,q,Q,ne){const{gen:P,schema:T,data:ee,allErrors:K,opts:N,self:te}=L,{RULES:z}=te;if(T.$ref&&(N.ignoreKeywordsWithRef||!(0,u.schemaHasRulesButRef)(T,z))){P.block(()=>X(L,"$ref",z.all.$ref.definition));
|
|
628
|
+
return}N.jtd||J(L,q),P.block(()=>{for(const le of z.rules)re(le);re(z.post)});function re(le){(0,t.shouldUseGroup)(T,le)&&(le.type?(P.if((0,n.checkDataType)(le.type,ee,N.strictNumbers)),G(L,le),q.length===1&&q[0]===le.type&&Q&&(P.else(),(0,n.reportTypeError)(L)),P.endIf()):G(L,le),K||P.if((0,a._)`${c.default.errors} === ${ne||0}`))}}function G(L,q){const{gen:Q,schema:ne,opts:{useDefaults:P}}=L;P&&(0,s.assignDefaults)(L,q.type),Q.block(()=>{for(const T of q.rules)(0,t.shouldUseRule)(ne,T)&&X(L,T.
|
|
630
629
|
keyword,T.definition,q.type)})}function J(L,q){L.schemaEnv.meta||!L.opts.strictTypes||(se(L,q),L.opts.allowUnionTypes||H(L,q),A(L,L.dataTypes))}function se(L,q){if(q.length){if(!L.dataTypes.length){L.dataTypes=q;return}q.forEach(Q=>{x(L.dataTypes,Q)||R(L,`type "${Q}" not allowed by context "${L.dataTypes.join(",")}"`)}),E(L,q)}}function H(L,q){q.length>1&&!(q.length===2&&q.includes("null"))&&R(L,"use allowUnionTypes to allow union type keyword")}function A(L,q){const Q=L.self.RULES.all;for(const ne in Q){
|
|
631
|
-
const P=Q[ne];if(typeof P=="object"&&(0,
|
|
630
|
+
const P=Q[ne];if(typeof P=="object"&&(0,t.shouldUseRule)(L.schema,P)){const{type:T}=P.definition;T.length&&!T.some(ee=>V(q,ee))&&R(L,`missing type "${T.join(",")}" for keyword "${ne}"`)}}}function V(L,q){return L.includes(q)||q==="number"&&L.includes("integer")}function x(L,q){return L.includes(q)||q==="integer"&&L.includes("number")}function E(L,q){const Q=[];for(const ne of L.dataTypes)x(q,ne)?Q.push(ne):q.includes("integer")&&ne==="number"&&Q.push("integer");L.dataTypes=Q}function R(L,q){const Q=L.
|
|
632
631
|
schemaEnv.baseId+L.errSchemaPath;q+=` at "${Q}" (strictTypes)`,(0,u.checkStrictMode)(L,q,L.opts.strictTypes)}class C{constructor(q,Q,ne){if((0,i.validateKeywordUsage)(q,Q,ne),this.gen=q.gen,this.allErrors=q.allErrors,this.keyword=ne,this.data=q.data,this.schema=q.schema[ne],this.$data=Q.$data&&q.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,u.schemaRefOrVal)(q,this.schema,ne,this.$data),this.schemaType=Q.schemaType,this.parentSchema=q.schema,this.params={},this.it=q,this.def=Q,this.
|
|
633
632
|
$data)this.schemaCode=q.gen.const("vSchema",oe(this.$data,q));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,Q.schemaType,Q.allowUndefined))throw new Error(`${ne} value must be ${JSON.stringify(Q.schemaType)}`);("code"in Q?Q.trackErrors:Q.errors!==!1)&&(this.errsCount=q.gen.const("_errs",c.default.errors))}result(q,Q,ne){this.failResult((0,a.not)(q),Q,ne)}failResult(q,Q,ne){this.gen.if(q),ne?ne():this.error(),Q?(this.gen.else(),Q(),this.allErrors&&this.gen.endIf()):this.
|
|
634
633
|
allErrors?this.gen.endIf():this.gen.else()}pass(q,Q){this.failResult((0,a.not)(q),void 0,Q)}fail(q){if(q===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(q),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(q){if(!this.$data)return this.fail(q);const{schemaCode:Q}=this;this.fail((0,a._)`${Q} !== undefined && (${(0,a.or)(this.invalid$data(),q)})`)}error(q,Q,ne){if(Q){this.setParams(Q),this._error(q,ne),this.setParams({});return}this._error(q,ne)}_error(q,Q){
|
|
635
634
|
(q?f.reportExtraError:f.reportError)(this,this.def.error,Q)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(q){this.allErrors||this.gen.if(q)}setParams(q,Q){Q?Object.assign(this.params,q):this.params=q}block$data(q,Q,ne=a.nil){this.gen.block(()=>{this.check$data(q,ne),Q()})}check$data(q=a.nil,Q=a.nil){if(!this.$data)return;
|
|
636
|
-
const{gen:ne,schemaCode:P,schemaType:T,def:ee}=this;ne.if((0,a.or)((0,a._)`${P} === undefined`,Q)),q!==a.nil&&ne.assign(q,!0),(T.length||ee.validateSchema)&&(ne.elseIf(this.invalid$data()),this.$dataError(),q!==a.nil&&ne.assign(q,!1)),ne.else()}invalid$data(){const{gen:q,schemaCode:Q,schemaType:ne,def:P,it:T}=this;return(0,a.or)(ee(),
|
|
637
|
-
N,Q,T.opts.strictNumbers,n.DataType.Wrong)}`}return a.nil}function
|
|
635
|
+
const{gen:ne,schemaCode:P,schemaType:T,def:ee}=this;ne.if((0,a.or)((0,a._)`${P} === undefined`,Q)),q!==a.nil&&ne.assign(q,!0),(T.length||ee.validateSchema)&&(ne.elseIf(this.invalid$data()),this.$dataError(),q!==a.nil&&ne.assign(q,!1)),ne.else()}invalid$data(){const{gen:q,schemaCode:Q,schemaType:ne,def:P,it:T}=this;return(0,a.or)(ee(),K());function ee(){if(ne.length){if(!(Q instanceof a.Name))throw new Error("ajv implementation error");const N=Array.isArray(ne)?ne:[ne];return(0,a._)`${(0,n.checkDataTypes)(
|
|
636
|
+
N,Q,T.opts.strictNumbers,n.DataType.Wrong)}`}return a.nil}function K(){if(P.validateSchema){const N=q.scopeValue("validate$data",{ref:P.validateSchema});return(0,a._)`!${N}(${Q})`}return a.nil}}subschema(q,Q){const ne=(0,o.getSubschema)(this.it,q);(0,o.extendSubschemaData)(ne,this.it,q),(0,o.extendSubschemaMode)(ne,q);const P={...this.it,...ne,items:void 0,props:void 0};return m(P,Q),P}mergeEvaluated(q,Q){const{it:ne,gen:P}=this;ne.opts.unevaluated&&(ne.props!==!0&&q.props!==void 0&&(ne.props=u.
|
|
638
637
|
mergeEvaluated.props(P,q.props,ne.props,Q)),ne.items!==!0&&q.items!==void 0&&(ne.items=u.mergeEvaluated.items(P,q.items,ne.items,Q)))}mergeValidEvaluated(q,Q){const{it:ne,gen:P}=this;if(ne.opts.unevaluated&&(ne.props!==!0||ne.items!==!0))return P.if(Q,()=>this.mergeEvaluated(q,a.Name)),!0}}dt.KeywordCxt=C;function X(L,q,Q,ne){const P=new C(L,Q,q);"code"in Q?Q.code(P,ne):P.$data&&Q.validate?(0,i.funcKeywordCode)(P,Q):"macro"in Q?(0,i.macroKeywordCode)(P,Q):(Q.compile||Q.validate)&&(0,i.funcKeywordCode)(
|
|
639
638
|
P,Q)}const Z=/^\/(?:[^~]|~0|~1)*$/,ie=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function oe(L,{dataLevel:q,dataNames:Q,dataPathArr:ne}){let P,T;if(L==="")return c.default.rootData;if(L[0]==="/"){if(!Z.test(L))throw new Error(`Invalid JSON-pointer: ${L}`);P=L,T=c.default.rootData}else{const te=ie.exec(L);if(!te)throw new Error(`Invalid JSON-pointer: ${L}`);const z=+te[1];if(P=te[2],P==="#"){if(z>=q)throw new Error(N("property/index",z));return ne[q-z]}if(z>q)throw new Error(N("data",z));if(T=Q[q-z],!P)return T}
|
|
640
|
-
let ee=T;const
|
|
641
|
-
|
|
642
|
-
Ue.SchemaEnv=void 0;const
|
|
643
|
-
return g;const p=(0,n.getFullPath)(this.opts.uriResolver,d.root.baseId),{es5:m,lines:_}=this.opts.code,{ownProperties:v}=this.opts,w=new
|
|
644
|
-
dataNames:[
|
|
645
|
-
this.opts.code.optimize);const
|
|
646
|
-
|
|
639
|
+
let ee=T;const K=P.split("/");for(const te of K)te&&(T=(0,a._)`${T}${(0,a.getProperty)((0,u.unescapeJsonPointer)(te))}`,ee=(0,a._)`${ee} && ${T}`);return ee;function N(te,z){return`Cannot access ${te} ${z} levels up, current level is ${q}`}}return dt.getData=oe,dt}var vn={},Tu;function bn(){if(Tu)return vn;Tu=1,Object.defineProperty(vn,"__esModule",{value:!0});class r extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}return vn.default=r,vn}var wn={},
|
|
640
|
+
ju;function Lr(){if(ju)return wn;ju=1,Object.defineProperty(wn,"__esModule",{value:!0});const r=_n();class e extends Error{constructor(n,s,i,o){super(o||`can't resolve reference ${i} from id ${s}`),this.missingRef=(0,r.resolveUrl)(n,s,i),this.missingSchema=(0,r.normalizeId)((0,r.getFullPath)(n,this.missingRef))}}return wn.default=e,wn}var Ue={},Lu;function En(){if(Lu)return Ue;Lu=1,Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.resolveSchema=Ue.getCompilingSchema=Ue.resolveRef=Ue.compileSchema=
|
|
641
|
+
Ue.SchemaEnv=void 0;const r=pe(),e=bn(),t=Qe(),n=_n(),s=$e(),i=jr();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=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={}}}Ue.SchemaEnv=o;function a(d){const g=u.call(this,d);if(g)
|
|
642
|
+
return g;const p=(0,n.getFullPath)(this.opts.uriResolver,d.root.baseId),{es5:m,lines:_}=this.opts.code,{ownProperties:v}=this.opts,w=new r.CodeGen(this.scope,{es5:m,lines:_,ownProperties:v});let S;d.$async&&(S=w.scopeValue("Error",{ref:e.default,code:(0,r._)`require("ajv/dist/runtime/validation_error").default`}));const I=w.scopeName("validate");d.validateName=I;const F={gen:w,allErrors:this.opts.allErrors,data:t.default.data,parentData:t.default.parentData,parentDataProperty:t.default.parentDataProperty,
|
|
643
|
+
dataNames:[t.default.data],dataPathArr:[r.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:w.scopeValue("schema",this.opts.code.source===!0?{ref:d.schema,code:(0,r.stringify)(d.schema)}:{ref:d.schema}),validateName:I,ValidationError:S,schema:d.schema,schemaEnv:d,rootId:p,baseId:d.baseId||p,schemaPath:r.nil,errSchemaPath:d.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,r._)`""`,opts:this.opts,self:this};let W;try{this._compilations.add(d),(0,i.validateFunctionCode)(F),w.optimize(
|
|
644
|
+
this.opts.code.optimize);const k=w.toString();W=`${w.scopeRefs(t.default.scope)}return ${k}`,this.opts.code.process&&(W=this.opts.code.process(W,d));const j=new Function(`${t.default.self}`,`${t.default.scope}`,W)(this,this.scope.get());if(this.scope.value(I,{ref:j}),j.errors=null,j.schema=d.schema,j.schemaEnv=d,d.$async&&(j.$async=!0),this.opts.code.source===!0&&(j.source={validateName:I,validateCode:k,scopeValues:w._values}),this.opts.unevaluated){const{props:D,items:U}=F;j.evaluated={props:D instanceof
|
|
645
|
+
r.Name?void 0:D,items:U instanceof r.Name?void 0:U,dynamicProps:D instanceof r.Name,dynamicItems:U instanceof r.Name},j.source&&(j.source.evaluated=(0,r.stringify)(j.evaluated))}return d.validate=j,d}catch(k){throw delete d.validate,delete d.validateName,W&&this.logger.error("Error compiling schema, function code:",W),k}finally{this._compilations.delete(d)}}Ue.compileSchema=a;function c(d,g,p){var m;p=(0,n.resolveUrl)(this.opts.uriResolver,g,p);const _=d.refs[p];if(_)return _;let v=h.call(this,d,
|
|
647
646
|
p);if(v===void 0){const w=(m=d.localRefs)===null||m===void 0?void 0:m[p],{schemaId:S}=this.opts;w&&(v=new o({schema:w,schemaId:S,root:d,baseId:g}))}if(v!==void 0)return d.refs[p]=l.call(this,v)}Ue.resolveRef=c;function l(d){return(0,n.inlineRef)(d.schema,this.opts.inlineRefs)?d.schema:d.validate?d:a.call(this,d)}function u(d){for(const g of this._compilations)if(f(g,d))return g}Ue.getCompilingSchema=u;function f(d,g){return d.schema===g.schema&&d.root===g.root&&d.baseId===g.baseId}function h(d,g){
|
|
648
647
|
let p;for(;typeof(p=this.refs[g])=="string";)g=p;return p||this.schemas[g]||$.call(this,d,g)}function $(d,g){const p=this.opts.uriResolver.parse(g),m=(0,n._getFullPath)(this.opts.uriResolver,p);let _=(0,n.getFullPath)(this.opts.uriResolver,d.baseId,void 0);if(Object.keys(d.schema).length>0&&m===_)return y.call(this,p,d);const v=(0,n.normalizeId)(m),w=this.refs[v]||this.schemas[v];if(typeof w=="string"){const S=$.call(this,d,w);return typeof S?.schema!="object"?void 0:y.call(this,p,S)}if(typeof w?.
|
|
649
648
|
schema=="object"){if(w.validate||a.call(this,w),v===(0,n.normalizeId)(g)){const{schema:S}=w,{schemaId:I}=this.opts,F=S[I];return F&&(_=(0,n.resolveUrl)(this.opts.uriResolver,_,F)),new o({schema:S,schemaId:I,root:d,baseId:_})}return y.call(this,p,w)}}Ue.resolveSchema=$;const b=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(d,{baseId:g,schema:p,root:m}){var _;if(((_=d.fragment)===null||_===void 0?void 0:_[0])!=="/")return;for(const S of d.fragment.slice(
|
|
650
649
|
1).split("/")){if(typeof p=="boolean")return;const I=p[(0,s.unescapeFragment)(S)];if(I===void 0)return;p=I;const F=typeof p=="object"&&p[this.opts.schemaId];!b.has(S)&&F&&(g=(0,n.resolveUrl)(this.opts.uriResolver,g,F))}let v;if(typeof p!="boolean"&&p.$ref&&!(0,s.schemaHasRulesButRef)(p,this.RULES)){const S=(0,n.resolveUrl)(this.opts.uriResolver,g,p.$ref);v=$.call(this,m,S)}const{schemaId:w}=this.opts;if(v=v||new o({schema:p,schemaId:w,root:m,baseId:g}),v.schema!==v.root.schema)return v}return Ue}
|
|
651
|
-
const ku="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
|
|
652
|
-
|
|
653
|
-
if(
|
|
650
|
+
const ku="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Du="Meta-schema for $data reference (JSON AnySchema extension proposal)",xu="object",Mu=["$data"],qu={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Uu=!1,Oy={$id:ku,description:Du,type:xu,required:Mu,properties:qu,additionalProperties:Uu},Cy={__proto__:null,$id:ku,additionalProperties:Uu,default:Oy,description:Du,properties:qu,required:Mu,type:xu},Py=nt(Cy);var Sn={},
|
|
651
|
+
kr={exports:{}},Wi,Hu;function Iy(){return Hu||(Hu=1,Wi={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}}),Wi}var Ki,Fu;function Ny(){if(Fu)return Ki;Fu=1;const{HEX:r}=Iy(),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 t(y){if(a(y,".")<3)return{host:y,isIPV4:!1};const d=y.match(e)||[],[g]=d;return g?{host:o(g,"."),isIPV4:!0}:{host:y,isIPV4:!1}}function n(y,d=!1){let g="",p=!0;for(const m of y){
|
|
652
|
+
if(r[m]===void 0)return;m!=="0"&&p===!0&&(p=!1),p||(g+=m)}return d&&g.length===0&&(g="0"),g}function s(y){let d=0;const g={error:!1,address:"",zone:""},p=[],m=[];let _=!1,v=!1,w=!1;function S(){if(m.length){if(_===!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 F=y[I];if(!(F==="["||F==="]"))if(F===":"){if(v===!0&&(w=!0),!S())break;if(d++,p.push(":"),d>7){g.error=!0;break}I-1>=0&&y[I-1]===":"&&(v=!0);continue}else if(F==="%"){
|
|
654
653
|
if(!S())break;_=!0}else{m.push(F);continue}}return m.length&&(_?g.zone=m.join(""):w?p.push(m.join("")):p.push(n(m))),g.address=p.join(""),g}function i(y){if(a(y,":")<2)return{host:y,isIPV6:!1};const d=s(y);if(d.error)return{host:y,isIPV6:!1};{let g=d.address,p=d.address;return d.zone&&(g+="%"+d.zone,p+="%25"+d.zone),{host:g,escapedHost:p,isIPV6:!0}}}function o(y,d){let g="",p=!0;const m=y.length;for(let _=0;_<m;_++){const v=y[_];v==="0"&&p?(_+1<=m&&y[_+1]===d||_+1===m)&&(g+=v,p=!1):(v===d?p=!0:p=
|
|
655
654
|
!1,g+=v)}return g}function a(y,d){let g=0;for(let p=0;p<y.length;p++)y[p]===d&&g++;return g}const c=/^\.\.?\//u,l=/^\/\.(?:\/|$)/u,u=/^\/\.\.(?:\/|$)/u,f=/^\/?(?:.|\n)*?(?=\/|$)/u;function h(y){const d=[];for(;y.length;)if(y.match(c))y=y.replace(c,"");else if(y.match(l))y=y.replace(l,"/");else if(y.match(u))y=y.replace(u,"/"),d.pop();else if(y==="."||y==="..")y="";else{const g=y.match(f);if(g){const p=g[0];y=y.slice(p.length),d.push(p)}else throw new Error("Unexpected dot segment condition")}return d.
|
|
656
|
-
join("")}function $(y,d){const g=d!==!0?escape:unescape;return y.scheme!==void 0&&(y.scheme=g(y.scheme)),y.userinfo!==void 0&&(y.userinfo=g(y.userinfo)),y.host!==void 0&&(y.host=g(y.host)),y.path!==void 0&&(y.path=g(y.path)),y.query!==void 0&&(y.query=g(y.query)),y.fragment!==void 0&&(y.fragment=g(y.fragment)),y}function b(y){const d=[];if(y.userinfo!==void 0&&(d.push(y.userinfo),d.push("@")),y.host!==void 0){let g=unescape(y.host);const p=
|
|
657
|
-
!0?g=`[${m.escapedHost}]`:g=y.host}d.push(g)}return(typeof y.port=="number"||typeof y.port=="string")&&(d.push(":"),d.push(String(y.port))),d.length?d.join(""):void 0}return
|
|
658
|
-
return typeof p.secure=="boolean"?p.secure:String(p.scheme).toLowerCase()==="wss"}function n(p){return p.host||(p.error=p.error||"HTTP URIs must have a host."),p}function s(p){const m=String(p.scheme).toLowerCase()==="https";return(p.port===(m?443:80)||p.port==="")&&(p.port=void 0),p.path||(p.path="/"),p}function i(p){return p.secure=
|
|
655
|
+
join("")}function $(y,d){const g=d!==!0?escape:unescape;return y.scheme!==void 0&&(y.scheme=g(y.scheme)),y.userinfo!==void 0&&(y.userinfo=g(y.userinfo)),y.host!==void 0&&(y.host=g(y.host)),y.path!==void 0&&(y.path=g(y.path)),y.query!==void 0&&(y.query=g(y.query)),y.fragment!==void 0&&(y.fragment=g(y.fragment)),y}function b(y){const d=[];if(y.userinfo!==void 0&&(d.push(y.userinfo),d.push("@")),y.host!==void 0){let g=unescape(y.host);const p=t(g);if(p.isIPV4)g=p.host;else{const m=i(p.host);m.isIPV6===
|
|
656
|
+
!0?g=`[${m.escapedHost}]`:g=y.host}d.push(g)}return(typeof y.port=="number"||typeof y.port=="string")&&(d.push(":"),d.push(String(y.port))),d.length?d.join(""):void 0}return Ki={recomposeAuthority:b,normalizeComponentEncoding:$,removeDotSegments:h,normalizeIPv4:t,normalizeIPv6:i,stringArrayToHexStripped:n},Ki}var Yi,Vu;function Ty(){if(Vu)return Yi;Vu=1;const r=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,e=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function t(p){
|
|
657
|
+
return typeof p.secure=="boolean"?p.secure:String(p.scheme).toLowerCase()==="wss"}function n(p){return p.host||(p.error=p.error||"HTTP URIs must have a host."),p}function s(p){const m=String(p.scheme).toLowerCase()==="https";return(p.port===(m?443:80)||p.port==="")&&(p.port=void 0),p.path||(p.path="/"),p}function i(p){return p.secure=t(p),p.resourceName=(p.path||"/")+(p.query?"?"+p.query:""),p.path=void 0,p.query=void 0,p}function o(p){if((p.port===(t(p)?443:80)||p.port==="")&&(p.port=void 0),typeof p.
|
|
659
658
|
secure=="boolean"&&(p.scheme=p.secure?"wss":"ws",p.secure=void 0),p.resourceName){const[m,_]=p.resourceName.split("?");p.path=m&&m!=="/"?m:void 0,p.query=_,p.resourceName=void 0}return p.fragment=void 0,p}function a(p,m){if(!p.path)return p.error="URN can not be parsed",p;const _=p.path.match(e);if(_){const v=m.scheme||p.scheme||"urn";p.nid=_[1].toLowerCase(),p.nss=_[2];const w=`${v}:${m.nid||p.nid}`,S=g[w];p.path=void 0,S&&(p=S.parse(p,m))}else p.error=p.error||"URN can not be parsed.";return p}
|
|
660
|
-
function c(p,m){const _=m.scheme||p.scheme||"urn",v=p.nid.toLowerCase(),w=`${_}:${m.nid||v}`,S=g[w];S&&(p=S.serialize(p,m));const I=p,F=p.nss;return I.path=`${v||m.nid}:${F}`,m.skipEscape=!0,I}function l(p,m){const _=p;return _.uuid=_.nss,_.nss=void 0,!m.tolerant&&(!_.uuid||!
|
|
661
|
-
parse:n,serialize:s},$={scheme:"ws",domainHost:!0,parse:i,serialize:o},b={scheme:"wss",domainHost:$.domainHost,parse:$.parse,serialize:$.serialize},g={http:f,https:h,ws:$,wss:b,urn:{scheme:"urn",parse:a,serialize:c,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:l,serialize:u,skipNormalize:!0}};return
|
|
662
|
-
return typeof d=="string"?d=u(b(d,g),g):typeof d=="object"&&(d=b(u(d,g),g)),d}function a(d,g,p){const m=Object.assign({scheme:"null"},p),_=c(b(d,m),b(g,m),m,!0);return u(_,{...m,skipEscape:!0})}function c(d,g,p,m){const _={};return m||(d=b(u(d,p),p),g=b(u(g,p),p)),p=p||{},!p.tolerant&&g.scheme?(_.scheme=g.scheme,_.userinfo=g.userinfo,_.host=g.host,_.port=g.port,_.path=
|
|
663
|
-
g.port,_.path=
|
|
659
|
+
function c(p,m){const _=m.scheme||p.scheme||"urn",v=p.nid.toLowerCase(),w=`${_}:${m.nid||v}`,S=g[w];S&&(p=S.serialize(p,m));const I=p,F=p.nss;return I.path=`${v||m.nid}:${F}`,m.skipEscape=!0,I}function l(p,m){const _=p;return _.uuid=_.nss,_.nss=void 0,!m.tolerant&&(!_.uuid||!r.test(_.uuid))&&(_.error=_.error||"UUID is not valid."),_}function u(p){const m=p;return m.nss=(p.uuid||"").toLowerCase(),m}const f={scheme:"http",domainHost:!0,parse:n,serialize:s},h={scheme:"https",domainHost:f.domainHost,
|
|
660
|
+
parse:n,serialize:s},$={scheme:"ws",domainHost:!0,parse:i,serialize:o},b={scheme:"wss",domainHost:$.domainHost,parse:$.parse,serialize:$.serialize},g={http:f,https:h,ws:$,wss:b,urn:{scheme:"urn",parse:a,serialize:c,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:l,serialize:u,skipNormalize:!0}};return Yi=g,Yi}var zu;function jy(){if(zu)return kr.exports;zu=1;const{normalizeIPv6:r,normalizeIPv4:e,removeDotSegments:t,recomposeAuthority:n,normalizeComponentEncoding:s}=Ny(),i=Ty();function o(d,g){
|
|
661
|
+
return typeof d=="string"?d=u(b(d,g),g):typeof d=="object"&&(d=b(u(d,g),g)),d}function a(d,g,p){const m=Object.assign({scheme:"null"},p),_=c(b(d,m),b(g,m),m,!0);return u(_,{...m,skipEscape:!0})}function c(d,g,p,m){const _={};return m||(d=b(u(d,p),p),g=b(u(g,p),p)),p=p||{},!p.tolerant&&g.scheme?(_.scheme=g.scheme,_.userinfo=g.userinfo,_.host=g.host,_.port=g.port,_.path=t(g.path||""),_.query=g.query):(g.userinfo!==void 0||g.host!==void 0||g.port!==void 0?(_.userinfo=g.userinfo,_.host=g.host,_.port=
|
|
662
|
+
g.port,_.path=t(g.path||""),_.query=g.query):(g.path?(g.path.charAt(0)==="/"?_.path=t(g.path):((d.userinfo!==void 0||d.host!==void 0||d.port!==void 0)&&!d.path?_.path="/"+g.path:d.path?_.path=d.path.slice(0,d.path.lastIndexOf("/")+1)+g.path:_.path=g.path,_.path=t(_.path)),_.query=g.query):(_.path=d.path,g.query!==void 0?_.query=g.query:_.query=d.query),_.userinfo=d.userinfo,_.host=d.host,_.port=d.port),_.scheme=d.scheme),_.fragment=g.fragment,_}function l(d,g,p){return typeof d=="string"?(d=unescape(
|
|
664
663
|
d),d=u(s(b(d,p),!0),{...p,skipEscape:!0})):typeof d=="object"&&(d=u(s(d,!0),{...p,skipEscape:!0})),typeof g=="string"?(g=unescape(g),g=u(s(b(g,p),!0),{...p,skipEscape:!0})):typeof g=="object"&&(g=u(s(g,!0),{...p,skipEscape:!0})),d.toLowerCase()===g.toLowerCase()}function u(d,g){const p={host:d.host,scheme:d.scheme,userinfo:d.userinfo,port:d.port,path:d.path,query:d.query,nid:d.nid,nss:d.nss,uuid:d.uuid,fragment:d.fragment,reference:d.reference,resourceName:d.resourceName,secure:d.secure,error:""},
|
|
665
|
-
m=Object.assign({},g),_=[],v=i[(m.scheme||p.scheme||"").toLowerCase()];v&&v.serialize&&v.serialize(p,m),p.path!==void 0&&(m.skipEscape?p.path=unescape(p.path):(p.path=escape(p.path),p.scheme!==void 0&&(p.path=p.path.split("%3A").join(":")))),m.reference!=="suffix"&&p.scheme&&_.push(p.scheme,":");const w=n(p);if(w!==void 0&&(m.reference!=="suffix"&&_.push("//"),_.push(w),p.path&&p.path.charAt(0)!=="/"&&_.push("/")),p.path!==void 0){let S=p.path;!m.absolutePath&&(!v||!v.absolutePath)&&(S=
|
|
664
|
+
m=Object.assign({},g),_=[],v=i[(m.scheme||p.scheme||"").toLowerCase()];v&&v.serialize&&v.serialize(p,m),p.path!==void 0&&(m.skipEscape?p.path=unescape(p.path):(p.path=escape(p.path),p.scheme!==void 0&&(p.path=p.path.split("%3A").join(":")))),m.reference!=="suffix"&&p.scheme&&_.push(p.scheme,":");const w=n(p);if(w!==void 0&&(m.reference!=="suffix"&&_.push("//"),_.push(w),p.path&&p.path.charAt(0)!=="/"&&_.push("/")),p.path!==void 0){let S=p.path;!m.absolutePath&&(!v||!v.absolutePath)&&(S=t(S)),w===
|
|
666
665
|
void 0&&(S=S.replace(/^\/\//u,"/%2F")),_.push(S)}return p.query!==void 0&&_.push("?",p.query),p.fragment!==void 0&&_.push("#",p.fragment),_.join("")}const f=Array.from({length:127},(d,g)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(g)));function h(d){let g=0;for(let p=0,m=d.length;p<m;++p)if(g=d.charCodeAt(p),g>126||f[g])return!0;return!1}const $=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function b(d,g){
|
|
667
|
-
const p=Object.assign({},g),m={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},_=d.indexOf("%")!==-1;let v=!1;p.reference==="suffix"&&(d=(p.scheme?p.scheme+":":"")+"//"+d);const w=d.match($);if(w){if(m.scheme=w[1],m.userinfo=w[3],m.host=w[4],m.port=parseInt(w[5],10),m.path=w[6]||"",m.query=w[7],m.fragment=w[8],isNaN(m.port)&&(m.port=w[5]),m.host){const I=e(m.host);if(I.isIPV4===!1){const F=
|
|
666
|
+
const p=Object.assign({},g),m={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},_=d.indexOf("%")!==-1;let v=!1;p.reference==="suffix"&&(d=(p.scheme?p.scheme+":":"")+"//"+d);const w=d.match($);if(w){if(m.scheme=w[1],m.userinfo=w[3],m.host=w[4],m.port=parseInt(w[5],10),m.path=w[6]||"",m.query=w[7],m.fragment=w[8],isNaN(m.port)&&(m.port=w[5]),m.host){const I=e(m.host);if(I.isIPV4===!1){const F=r(I.host);m.host=F.host.toLowerCase(),v=F.isIPV6}else m.host=I.host,
|
|
668
667
|
v=!0}m.scheme===void 0&&m.userinfo===void 0&&m.host===void 0&&m.port===void 0&&m.query===void 0&&!m.path?m.reference="same-document":m.scheme===void 0?m.reference="relative":m.fragment===void 0?m.reference="absolute":m.reference="uri",p.reference&&p.reference!=="suffix"&&p.reference!==m.reference&&(m.error=m.error||"URI is not a "+p.reference+" reference.");const S=i[(p.scheme||m.scheme||"").toLowerCase()];if(!p.unicodeSupport&&(!S||!S.unicodeSupport)&&m.host&&(p.domainHost||S&&S.domainHost)&&v===
|
|
669
668
|
!1&&h(m.host))try{m.host=URL.domainToASCII(m.host.toLowerCase())}catch(I){m.error=m.error||"Host's domain name can not be converted to ASCII: "+I}(!S||S&&!S.skipNormalize)&&(_&&m.scheme!==void 0&&(m.scheme=unescape(m.scheme)),_&&m.host!==void 0&&(m.host=unescape(m.host)),m.path&&(m.path=escape(unescape(m.path))),m.fragment&&(m.fragment=encodeURI(decodeURIComponent(m.fragment)))),S&&S.parse&&S.parse(m,p)}else m.error=m.error||"URI can not be parsed.";return m}const y={SCHEMES:i,normalize:o,resolve:a,
|
|
670
|
-
resolveComponents:c,equal:l,serialize:u,parse:b};return
|
|
671
|
-
eywordCxt",{enumerable:!0,get:function(){return e.KeywordCxt}});var
|
|
672
|
-
enumerable:!0,get:function(){return
|
|
669
|
+
resolveComponents:c,equal:l,serialize:u,parse:b};return kr.exports=y,kr.exports.default=y,kr.exports.fastUri=y,kr.exports}var Gu;function Ly(){if(Gu)return Sn;Gu=1,Object.defineProperty(Sn,"__esModule",{value:!0});const r=jy();return r.code='require("ajv/dist/runtime/uri").default',Sn.default=r,Sn}var Bu;function Wu(){return Bu||(Bu=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.CodeGen=r.Name=r.nil=r.stringify=r.str=r._=r.KeywordCxt=void 0;var e=jr();Object.defineProperty(r,"K\
|
|
670
|
+
eywordCxt",{enumerable:!0,get:function(){return e.KeywordCxt}});var t=pe();Object.defineProperty(r,"_",{enumerable:!0,get:function(){return t._}}),Object.defineProperty(r,"str",{enumerable:!0,get:function(){return t.str}}),Object.defineProperty(r,"stringify",{enumerable:!0,get:function(){return t.stringify}}),Object.defineProperty(r,"nil",{enumerable:!0,get:function(){return t.nil}}),Object.defineProperty(r,"Name",{enumerable:!0,get:function(){return t.Name}}),Object.defineProperty(r,"CodeGen",{
|
|
671
|
+
enumerable:!0,get:function(){return t.CodeGen}});const n=bn(),s=Lr(),i=bu(),o=En(),a=pe(),c=_n(),l=$n(),u=$e(),f=Py,h=Ly(),$=(H,A)=>new RegExp(H,A);$.code="new RegExp";const b=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),d={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"\
|
|
673
672
|
Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"\
|
|
674
|
-
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."},g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},p=200;function m(H){var A,V,x,E,R,C,X,Z,ie,oe,L,q,Q,ne,P,T,ee,
|
|
675
|
-
!0||mt===void 0?1:mt||0,
|
|
676
|
-
"log",strictRequired:(ne=(Q=H.strictRequired)!==null&&Q!==void 0?Q:ot)!==null&&ne!==void 0?ne:!1,code:H.code?{...H.code,optimize:
|
|
677
|
-
null&&z!==void 0?z:!0,validateSchema:(re=H.validateSchema)!==null&&re!==void 0?re:!0,validateFormats:(le=H.validateFormats)!==null&&le!==void 0?le:!0,unicodeRegExp:(_e=H.unicodeRegExp)!==null&&_e!==void 0?_e:!0,int32range:(we=H.int32range)!==null&&we!==void 0?we:!0,uriResolver:
|
|
678
|
-
{scope:{},prefixes:y,es5:V,lines:x}),this.logger=M(A.logger);const E=A.validateFormats;A.validateFormats=!1,this.RULES=(0,i.getRules)(),v.call(this,d,A,"NOT SUPPORTED"),v.call(this,g,A,"DEPRECATED","warn"),this._metaOpts=
|
|
673
|
+
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."},g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},p=200;function m(H){var A,V,x,E,R,C,X,Z,ie,oe,L,q,Q,ne,P,T,ee,K,N,te,z,re,le,_e,we;const ot=H.strict,mt=(A=H.code)===null||A===void 0?void 0:A.optimize,oa=mt===
|
|
674
|
+
!0||mt===void 0?1:mt||0,aa=(x=(V=H.code)===null||V===void 0?void 0:V.regExp)!==null&&x!==void 0?x:$,Lh=(E=H.uriResolver)!==null&&E!==void 0?E:h.default;return{strictSchema:(C=(R=H.strictSchema)!==null&&R!==void 0?R:ot)!==null&&C!==void 0?C:!0,strictNumbers:(Z=(X=H.strictNumbers)!==null&&X!==void 0?X:ot)!==null&&Z!==void 0?Z:!0,strictTypes:(oe=(ie=H.strictTypes)!==null&&ie!==void 0?ie:ot)!==null&&oe!==void 0?oe:"log",strictTuples:(q=(L=H.strictTuples)!==null&&L!==void 0?L:ot)!==null&&q!==void 0?q:
|
|
675
|
+
"log",strictRequired:(ne=(Q=H.strictRequired)!==null&&Q!==void 0?Q:ot)!==null&&ne!==void 0?ne:!1,code:H.code?{...H.code,optimize:oa,regExp:aa}:{optimize:oa,regExp:aa},loopRequired:(P=H.loopRequired)!==null&&P!==void 0?P:p,loopEnum:(T=H.loopEnum)!==null&&T!==void 0?T:p,meta:(ee=H.meta)!==null&&ee!==void 0?ee:!0,messages:(K=H.messages)!==null&&K!==void 0?K:!0,inlineRefs:(N=H.inlineRefs)!==null&&N!==void 0?N:!0,schemaId:(te=H.schemaId)!==null&&te!==void 0?te:"$id",addUsedSchema:(z=H.addUsedSchema)!==
|
|
676
|
+
null&&z!==void 0?z:!0,validateSchema:(re=H.validateSchema)!==null&&re!==void 0?re:!0,validateFormats:(le=H.validateFormats)!==null&&le!==void 0?le:!0,unicodeRegExp:(_e=H.unicodeRegExp)!==null&&_e!==void 0?_e:!0,int32range:(we=H.int32range)!==null&&we!==void 0?we:!0,uriResolver:Lh}}class _{constructor(A={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,A=this.opts={...A,...m(A)};const{es5:V,lines:x}=this.opts.code;this.scope=new a.ValueScope(
|
|
677
|
+
{scope:{},prefixes:y,es5:V,lines:x}),this.logger=M(A.logger);const E=A.validateFormats;A.validateFormats=!1,this.RULES=(0,i.getRules)(),v.call(this,d,A,"NOT SUPPORTED"),v.call(this,g,A,"DEPRECATED","warn"),this._metaOpts=W.call(this),A.formats&&I.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),A.keywords&&F.call(this,A.keywords),typeof A.meta=="object"&&this.addMetaSchema(A.meta),S.call(this),A.validateFormats=E}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){
|
|
679
678
|
const{$data:A,meta:V,schemaId:x}=this.opts;let E=f;x==="id"&&(E={...f},E.id=E.$id,delete E.$id),V&&A&&this.addMetaSchema(E,E[x],!1)}defaultMeta(){const{meta:A,schemaId:V}=this.opts;return this.opts.defaultMeta=typeof A=="object"?A[V]||A:void 0}validate(A,V){let x;if(typeof A=="string"){if(x=this.getSchema(A),!x)throw new Error(`no schema with key or ref "${A}"`)}else x=this.compile(A);const E=x(V);return"$async"in x||(this.errors=x.errors),E}compile(A,V){const x=this._addSchema(A,V);return x.validate||
|
|
680
679
|
this._compileSchemaEnv(x)}compileAsync(A,V){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:x}=this.opts;return E.call(this,A,V);async function E(oe,L){await R.call(this,oe.$schema);const q=this._addSchema(oe,L);return q.validate||C.call(this,q)}async function R(oe){oe&&!this.getSchema(oe)&&await E.call(this,{$ref:oe},!0)}async function C(oe){try{return this._compileSchemaEnv(oe)}catch(L){if(!(L instanceof s.default))throw L;
|
|
681
680
|
return X.call(this,L),await Z.call(this,L.missingSchema),C.call(this,oe)}}function X({missingSchema:oe,missingRef:L}){if(this.refs[oe])throw new Error(`AnySchema ${oe} is loaded but ${L} cannot be resolved`)}async function Z(oe){const L=await ie.call(this,oe);this.refs[oe]||await R.call(this,L.$schema),this.refs[oe]||this.addSchema(L,oe,V)}async function ie(oe){const L=this._loading[oe];if(L)return L;try{return await(this._loading[oe]=x(oe))}finally{delete this._loading[oe]}}}addSchema(A,V,x,E=this.
|
|
@@ -683,264 +682,264 @@ opts.validateSchema){if(Array.isArray(A)){for(const C of A)this.addSchema(C,void
|
|
|
683
682
|
x!==void 0&&typeof x!="string")throw new Error("$schema must be a string");if(x=x||this.opts.defaultMeta||this.defaultMeta(),!x)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const E=this.validate(x,A);if(!E&&V){const R="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(R);else throw new Error(R)}return E}getSchema(A){let V;for(;typeof(V=w.call(this,A))=="string";)A=V;if(V===void 0){const{schemaId:x}=this.opts,E=new o.SchemaEnv(
|
|
684
683
|
{schema:{},schemaId:x});if(V=o.resolveSchema.call(this,E,A),!V)return;this.refs[A]=V}return V.validate||this._compileSchemaEnv(V)}removeSchema(A){if(A instanceof RegExp)return this._removeAllSchemas(this.schemas,A),this._removeAllSchemas(this.refs,A),this;switch(typeof A){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const V=w.call(this,A);return typeof V=="object"&&this._cache.delete(V.schema),delete this.schemas[A],
|
|
685
684
|
delete this.refs[A],this}case"object":{const V=A;this._cache.delete(V);let x=A[this.opts.schemaId];return x&&(x=(0,c.normalizeId)(x),delete this.schemas[x],delete this.refs[x]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(A){for(const V of A)this.addKeyword(V);return this}addKeyword(A,V){let x;if(typeof A=="string")x=A,typeof V=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),V.keyword=x);else if(typeof A=="object"&&V===
|
|
686
|
-
void 0){if(V=A,x=V.keyword,Array.isArray(x)&&!x.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(
|
|
685
|
+
void 0){if(V=A,x=V.keyword,Array.isArray(x)&&!x.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(D.call(this,x,V),!V)return(0,u.eachItem)(x,R=>U.call(this,R)),this;G.call(this,V);const E={...V,type:(0,l.getJSONTypes)(V.type),schemaType:(0,l.getJSONTypes)(V.schemaType)};return(0,u.eachItem)(x,E.type.length===0?R=>U.call(this,R,E):R=>E.type.forEach(C=>U.call(this,R,E,C))),this}getKeyword(A){const V=this.RULES.
|
|
687
686
|
all[A];return typeof V=="object"?V.definition:!!V}removeKeyword(A){const{RULES:V}=this;delete V.keywords[A],delete V.all[A];for(const x of V.rules){const E=x.rules.findIndex(R=>R.keyword===A);E>=0&&x.rules.splice(E,1)}return this}addFormat(A,V){return typeof V=="string"&&(V=new RegExp(V)),this.formats[A]=V,this}errorsText(A=this.errors,{separator:V=", ",dataVar:x="data"}={}){return!A||A.length===0?"No errors":A.map(E=>`${x}${E.instancePath} ${E.message}`).reduce((E,R)=>E+V+R)}$dataMetaSchema(A,V){
|
|
688
687
|
const x=this.RULES.all;A=JSON.parse(JSON.stringify(A));for(const E of V){const R=E.split("/").slice(1);let C=A;for(const X of R)C=C[X];for(const X in x){const Z=x[X];if(typeof Z!="object")continue;const{$data:ie}=Z.definition,oe=C[X];ie&&oe&&(C[X]=se(oe))}}return A}_removeAllSchemas(A,V){for(const x in A){const E=A[x];(!V||V.test(x))&&(typeof E=="string"?delete A[x]:E&&!E.meta&&(this._cache.delete(E.schema),delete A[x]))}}_addSchema(A,V,x,E=this.opts.validateSchema,R=this.opts.addUsedSchema){let C;
|
|
689
688
|
const{schemaId:X}=this.opts;if(typeof A=="object")C=A[X];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof A!="boolean")throw new Error("schema must be object or boolean")}let Z=this._cache.get(A);if(Z!==void 0)return Z;x=(0,c.normalizeId)(C||x);const ie=c.getSchemaRefs.call(this,A,x);return Z=new o.SchemaEnv({schema:A,schemaId:X,meta:V,baseId:x,localRefs:ie}),this._cache.set(Z.schema,Z),R&&!x.startsWith("#")&&(x&&this._checkUnique(x),this.refs[x]=Z),E&&this.validateSchema(
|
|
690
|
-
A,!0),Z}_checkUnique(A){if(this.schemas[A]||this.refs[A])throw new Error(`schema with key or id "${A}" already exists`)}_compileSchemaEnv(A){if(A.meta?this._compileMetaSchema(A):o.compileSchema.call(this,A),!A.validate)throw new Error("ajv implementation error");return A.validate}_compileMetaSchema(A){const V=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,A)}finally{this.opts=V}}}_.ValidationError=n.default,_.MissingRefError=s.default,
|
|
689
|
+
A,!0),Z}_checkUnique(A){if(this.schemas[A]||this.refs[A])throw new Error(`schema with key or id "${A}" already exists`)}_compileSchemaEnv(A){if(A.meta?this._compileMetaSchema(A):o.compileSchema.call(this,A),!A.validate)throw new Error("ajv implementation error");return A.validate}_compileMetaSchema(A){const V=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,A)}finally{this.opts=V}}}_.ValidationError=n.default,_.MissingRefError=s.default,r.default=_;function v(H,A,V,x="error"){for(const E in H){
|
|
691
690
|
const R=E;R in A&&this.logger[x](`${V}: option ${E}. ${H[R]}`)}}function w(H){return H=(0,c.normalizeId)(H),this.schemas[H]||this.refs[H]}function S(){const H=this.opts.schemas;if(H)if(Array.isArray(H))this.addSchema(H);else for(const A in H)this.addSchema(H[A],A)}function I(){for(const H in this.opts.formats){const A=this.opts.formats[H];A&&this.addFormat(H,A)}}function F(H){if(Array.isArray(H)){this.addVocabulary(H);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const A in H){
|
|
692
|
-
const V=H[A];V.keyword||(V.keyword=A),this.addKeyword(V)}}function
|
|
691
|
+
const V=H[A];V.keyword||(V.keyword=A),this.addKeyword(V)}}function W(){const H={...this.opts};for(const A of b)delete H[A];return H}const k={log(){},warn(){},error(){}};function M(H){if(H===!1)return k;if(H===void 0)return console;if(H.log&&H.warn&&H.error)return H;throw new Error("logger must implement log, warn and error methods")}const j=/^[a-z_$][a-z0-9_$:-]*$/i;function D(H,A){const{RULES:V}=this;if((0,u.eachItem)(H,x=>{if(V.keywords[x])throw new Error(`Keyword ${x} is already defined`);if(!j.
|
|
693
692
|
test(x))throw new Error(`Keyword ${x} has invalid name`)}),!!A&&A.$data&&!("code"in A||"validate"in A))throw new Error('$data keyword must have "code" or "validate" function')}function U(H,A,V){var x;const E=A?.post;if(V&&E)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:R}=this;let C=E?R.post:R.rules.find(({type:Z})=>Z===V);if(C||(C={type:V,rules:[]},R.rules.push(C)),R.keywords[H]=!0,!A)return;const X={keyword:H,definition:{...A,type:(0,l.getJSONTypes)(A.type),schemaType:(0,l.
|
|
694
693
|
getJSONTypes)(A.schemaType)}};A.before?Y.call(this,C,X,A.before):C.rules.push(X),R.all[H]=X,(x=A.implements)===null||x===void 0||x.forEach(Z=>this.addKeyword(Z))}function Y(H,A,V){const x=H.rules.findIndex(E=>E.keyword===V);x>=0?H.rules.splice(x,0,A):(H.rules.push(A),this.logger.warn(`rule ${V} is not defined`))}function G(H){let{metaSchema:A}=H;A!==void 0&&(H.$data&&this.opts.$data&&(A=se(A)),H.validateSchema=this.compile(A,!0))}const J={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv\
|
|
695
|
-
/master/lib/refs/data.json#"};function se(H){return{anyOf:[H,J]}}}(
|
|
696
|
-
$ref",schemaType:"string",code(l){const{gen:u,schema:f,it:h}=l,{baseId:$,schemaEnv:b,validateName:y,opts:d,self:g}=h,{root:p}=b;if((f==="#"||f==="#/")&&$===p.baseId)return _();const m=s.resolveRef.call(g,p,$,f);if(m===void 0)throw new
|
|
697
|
-
const I=u.scopeValue("schema",d.code.source===!0?{ref:S,code:(0,
|
|
698
|
-
h?m():_();function m(){if(!d.$async)throw new Error("async schema referenced by sync schema");const S=$.let("valid");$.try(()=>{$.code((0,
|
|
699
|
-
default.vErrors}.concat(${I})`),$.assign(n.default.errors,(0,
|
|
700
|
-
items($,F.items,b.items));else{const
|
|
701
|
-
const
|
|
702
|
-
(0,
|
|
703
|
-
(0,
|
|
704
|
-
1,Object.defineProperty(Nn,"__esModule",{value:!0});const
|
|
705
|
-
useFunc)(i.gen,
|
|
706
|
-
(0,
|
|
707
|
-
data:i,schemaCode:o}=n,a=s==="maxProperties"?
|
|
708
|
-
code(i){const{gen:o,schema:a,schemaCode:c,data:l,$data:u,it:f}=i,{opts:h}=f;if(!u&&a.length===0)return;const $=a.length>=h.loopRequired;if(f.allErrors?b():y(),h.strictRequired){const p=i.parentSchema.properties,{definedProperties:m}=i.it;for(const _ of a)if(p?.[_]===void 0&&!m.has(_)){const v=f.schemaEnv.baseId+f.errSchemaPath,w=`required property "${_}" is not defined at "${v}" (strictRequired)`;(0,
|
|
709
|
-
(0,
|
|
710
|
-
i.error(),o.break()})},e.nil)}}};return
|
|
711
|
-
GT:
|
|
712
|
-
j:a}})=>(0,e.str)`must NOT have duplicate items (items ## ${a} and ${o} are identical)`,params:({params:{i:o,j:a}})=>(0,e._)`{i: ${o}, j: ${a}}`},code(o){const{gen:a,data:c,$data:l,schema:u,parentSchema:f,schemaCode:h,it:$}=o;if(!l&&!u)return;const b=a.let("valid"),y=f.items?(0,
|
|
713
|
-
_,v))}function g(){return y.length>0&&!y.some(_=>_==="object"||_==="array")}function p(_,v){const w=a.name("item"),S=(0,
|
|
714
|
-
function m(_,v){const w=(0,
|
|
715
|
-
code(i){const{gen:o,data:a,$data:c,schemaCode:l,schema:u}=i;c||u&&typeof u=="object"?i.fail$data((0,
|
|
716
|
-
const{gen:o,data:a,$data:c,schema:l,schemaCode:u,it:f}=i;if(!c&&l.length===0)throw new Error("enum must have non-empty array");const h=l.length>=f.opts.loopEnum;let $;const b=()=>$??($=(0,e.useFunc)(o,
|
|
717
|
-
!0).break()))}function g(p,m){const _=l[m];return typeof _=="object"&&_!==null?(0,
|
|
718
|
-
c.default,l.default];return Cn.default=u,Cn}var Hn={},
|
|
719
|
-
(0,e.checkStrictMode)(a,'"additionalItems" is ignored when "items" is not an array of schemas');return}s(i,c)}};function s(i,o){const{gen:a,schema:c,data:l,keyword:u,it:f}=i;f.items=!0;const h=a.const("len",(0,
|
|
720
|
-
{keyword:u,dataProp:y,dataPropType:e.Type.Num},b),f.allErrors||a.if((0,
|
|
721
|
-
a,o)&&i.ok((0,
|
|
722
|
-
d.maxItems||d[o]===!1);if(g.strictTuples&&!_){const v=`"${f}" is ${m}-tuple, but minItems or maxItems/${o} are not specified or different at path "${p}"`;(0,e.checkStrictMode)(h,v,g.strictTuples)}}}return
|
|
723
|
-
function
|
|
724
|
-
o)))}};return Vn.default=i,Vn}var zn={}
|
|
725
|
-
(0,
|
|
726
|
-
alwaysValidSchema)(l,o)){let m=(0,
|
|
727
|
-
m),_()})}function p(m){i.code((0,
|
|
694
|
+
/master/lib/refs/data.json#"};function se(H){return{anyOf:[H,J]}}}(Hi)),Hi}var Rn={},An={},On={},Ku;function ky(){if(Ku)return On;Ku=1,Object.defineProperty(On,"__esModule",{value:!0});const r={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return On.default=r,On}var At={},Yu;function Xi(){if(Yu)return At;Yu=1,Object.defineProperty(At,"__esModule",{value:!0}),At.callRef=At.getValidate=void 0;const r=Lr(),e=et(),t=pe(),n=Qe(),s=En(),i=$e(),o={keyword:"\
|
|
695
|
+
$ref",schemaType:"string",code(l){const{gen:u,schema:f,it:h}=l,{baseId:$,schemaEnv:b,validateName:y,opts:d,self:g}=h,{root:p}=b;if((f==="#"||f==="#/")&&$===p.baseId)return _();const m=s.resolveRef.call(g,p,$,f);if(m===void 0)throw new r.default(h.opts.uriResolver,$,f);if(m instanceof s.SchemaEnv)return v(m);return w(m);function _(){if(b===p)return c(l,y,b,b.$async);const S=u.scopeValue("root",{ref:p});return c(l,(0,t._)`${S}.validate`,p,p.$async)}function v(S){const I=a(l,S);c(l,I,S,S.$async)}function w(S){
|
|
696
|
+
const I=u.scopeValue("schema",d.code.source===!0?{ref:S,code:(0,t.stringify)(S)}:{ref:S}),F=u.name("valid"),W=l.subschema({schema:S,dataTypes:[],schemaPath:t.nil,topSchemaRef:I,errSchemaPath:f},F);l.mergeEvaluated(W),l.ok(F)}}};function a(l,u){const{gen:f}=l;return u.validate?f.scopeValue("validate",{ref:u.validate}):(0,t._)`${f.scopeValue("wrapper",{ref:u})}.validate`}At.getValidate=a;function c(l,u,f,h){const{gen:$,it:b}=l,{allErrors:y,schemaEnv:d,opts:g}=b,p=g.passContext?n.default.this:t.nil;
|
|
697
|
+
h?m():_();function m(){if(!d.$async)throw new Error("async schema referenced by sync schema");const S=$.let("valid");$.try(()=>{$.code((0,t._)`await ${(0,e.callValidateCode)(l,u,p)}`),w(u),y||$.assign(S,!0)},I=>{$.if((0,t._)`!(${I} instanceof ${b.ValidationError})`,()=>$.throw(I)),v(I),y||$.assign(S,!1)}),l.ok(S)}function _(){l.result((0,e.callValidateCode)(l,u,p),()=>w(u),()=>v(u))}function v(S){const I=(0,t._)`${S}.errors`;$.assign(n.default.vErrors,(0,t._)`${n.default.vErrors} === null ? ${I} : ${n.
|
|
698
|
+
default.vErrors}.concat(${I})`),$.assign(n.default.errors,(0,t._)`${n.default.vErrors}.length`)}function w(S){var I;if(!b.opts.unevaluated)return;const F=(I=f?.validate)===null||I===void 0?void 0:I.evaluated;if(b.props!==!0)if(F&&!F.dynamicProps)F.props!==void 0&&(b.props=i.mergeEvaluated.props($,F.props,b.props));else{const W=$.var("props",(0,t._)`${S}.evaluated.props`);b.props=i.mergeEvaluated.props($,W,b.props,t.Name)}if(b.items!==!0)if(F&&!F.dynamicItems)F.items!==void 0&&(b.items=i.mergeEvaluated.
|
|
699
|
+
items($,F.items,b.items));else{const W=$.var("items",(0,t._)`${S}.evaluated.items`);b.items=i.mergeEvaluated.items($,W,b.items,t.Name)}}}return At.callRef=c,At.default=o,At}var Xu;function Ju(){if(Xu)return An;Xu=1,Object.defineProperty(An,"__esModule",{value:!0});const r=ky(),e=Xi(),t=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",r.default,e.default];return An.default=t,An}var Cn={},Pn={},Qu;function Dy(){if(Qu)return Pn;Qu=1,Object.defineProperty(Pn,"__esModule",{value:!0});
|
|
700
|
+
const r=pe(),e=r.operators,t={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:i,schemaCode:o})=>(0,r.str)`must be ${t[i].okStr} ${o}`,params:({keyword:i,schemaCode:o})=>(0,r._)`{comparison: ${t[i].okStr}, limit: ${o}}`},s={keyword:Object.keys(t),type:"number",schemaType:"number",$data:!0,error:n,code(i){const{keyword:o,data:a,schemaCode:c}=i;i.fail$data(
|
|
701
|
+
(0,r._)`${a} ${t[o].fail} ${c} || isNaN(${a})`)}};return Pn.default=s,Pn}var In={},Zu;function xy(){if(Zu)return In;Zu=1,Object.defineProperty(In,"__esModule",{value:!0});const r=pe(),t={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:n})=>(0,r.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,r._)`{multipleOf: ${n}}`},code(n){const{gen:s,data:i,schemaCode:o,it:a}=n,c=a.opts.multipleOfPrecision,l=s.let("res"),u=c?(0,r._)`Math.abs(Math.round(${l}) - ${l}) > 1e-${c}`:
|
|
702
|
+
(0,r._)`${l} !== parseInt(${l})`;n.fail$data((0,r._)`(${o} === 0 || (${l} = ${i}/${o}, ${u}))`)}};return In.default=t,In}var Nn={},Tn={},el;function My(){if(el)return Tn;el=1,Object.defineProperty(Tn,"__esModule",{value:!0});function r(e){const t=e.length;let n=0,s=0,i;for(;s<t;)n++,i=e.charCodeAt(s++),i>=55296&&i<=56319&&s<t&&(i=e.charCodeAt(s),(i&64512)===56320&&s++);return n}return Tn.default=r,r.code='require("ajv/dist/runtime/ucs2length").default',Tn}var tl;function qy(){if(tl)return Nn;tl=
|
|
703
|
+
1,Object.defineProperty(Nn,"__esModule",{value:!0});const r=pe(),e=$e(),t=My(),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:i,schemaCode:o}){const a=i==="maxLength"?"more":"fewer";return(0,r.str)`must NOT have ${a} than ${o} characters`},params:({schemaCode:i})=>(0,r._)`{limit: ${i}}`},code(i){const{keyword:o,data:a,schemaCode:c,it:l}=i,u=o==="maxLength"?r.operators.GT:r.operators.LT,f=l.opts.unicode===!1?(0,r._)`${a}.length`:(0,r._)`${(0,e.
|
|
704
|
+
useFunc)(i.gen,t.default)}(${a})`;i.fail$data((0,r._)`${f} ${u} ${c}`)}};return Nn.default=s,Nn}var jn={},rl;function Uy(){if(rl)return jn;rl=1,Object.defineProperty(jn,"__esModule",{value:!0});const r=et(),e=pe(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:s})=>(0,e.str)`must match pattern "${s}"`,params:({schemaCode:s})=>(0,e._)`{pattern: ${s}}`},code(s){const{data:i,$data:o,schema:a,schemaCode:c,it:l}=s,u=l.opts.unicodeRegExp?"u":"",f=o?(0,e._)`(new RegExp(${c}, ${u}))`:
|
|
705
|
+
(0,r.usePattern)(s,a);s.fail$data((0,e._)`!${f}.test(${i})`)}};return jn.default=n,jn}var Ln={},nl;function Hy(){if(nl)return Ln;nl=1,Object.defineProperty(Ln,"__esModule",{value:!0});const r=pe(),t={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:s}){const i=n==="maxProperties"?"more":"fewer";return(0,r.str)`must NOT have ${i} than ${s} properties`},params:({schemaCode:n})=>(0,r._)`{limit: ${n}}`},code(n){const{keyword:s,
|
|
706
|
+
data:i,schemaCode:o}=n,a=s==="maxProperties"?r.operators.GT:r.operators.LT;n.fail$data((0,r._)`Object.keys(${i}).length ${a} ${o}`)}};return Ln.default=t,Ln}var kn={},sl;function Fy(){if(sl)return kn;sl=1,Object.defineProperty(kn,"__esModule",{value:!0});const r=et(),e=pe(),t=$e(),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:i}})=>(0,e.str)`must have required property '${i}'`,params:({params:{missingProperty:i}})=>(0,e._)`{missingProperty: ${i}}`},
|
|
707
|
+
code(i){const{gen:o,schema:a,schemaCode:c,data:l,$data:u,it:f}=i,{opts:h}=f;if(!u&&a.length===0)return;const $=a.length>=h.loopRequired;if(f.allErrors?b():y(),h.strictRequired){const p=i.parentSchema.properties,{definedProperties:m}=i.it;for(const _ of a)if(p?.[_]===void 0&&!m.has(_)){const v=f.schemaEnv.baseId+f.errSchemaPath,w=`required property "${_}" is not defined at "${v}" (strictRequired)`;(0,t.checkStrictMode)(f,w,f.opts.strictRequired)}}function b(){if($||u)i.block$data(e.nil,d);else for(const p of a)
|
|
708
|
+
(0,r.checkReportMissingProp)(i,p)}function y(){const p=o.let("missing");if($||u){const m=o.let("valid",!0);i.block$data(m,()=>g(p,m)),i.ok(m)}else o.if((0,r.checkMissingProp)(i,a,p)),(0,r.reportMissingProp)(i,p),o.else()}function d(){o.forOf("prop",c,p=>{i.setParams({missingProperty:p}),o.if((0,r.noPropertyInData)(o,l,p,h.ownProperties),()=>i.error())})}function g(p,m){i.setParams({missingProperty:p}),o.forOf(p,c,()=>{o.assign(m,(0,r.propertyInData)(o,l,p,h.ownProperties)),o.if((0,e.not)(m),()=>{
|
|
709
|
+
i.error(),o.break()})},e.nil)}}};return kn.default=s,kn}var Dn={},il;function Vy(){if(il)return Dn;il=1,Object.defineProperty(Dn,"__esModule",{value:!0});const r=pe(),t={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:s}){const i=n==="maxItems"?"more":"fewer";return(0,r.str)`must NOT have ${i} than ${s} items`},params:({schemaCode:n})=>(0,r._)`{limit: ${n}}`},code(n){const{keyword:s,data:i,schemaCode:o}=n,a=s==="maxItems"?r.operators.
|
|
710
|
+
GT:r.operators.LT;n.fail$data((0,r._)`${i}.length ${a} ${o}`)}};return Dn.default=t,Dn}var xn={},Mn={},ol;function Ji(){if(ol)return Mn;ol=1,Object.defineProperty(Mn,"__esModule",{value:!0});const r=ma();return r.code='require("ajv/dist/runtime/equal").default',Mn.default=r,Mn}var al;function zy(){if(al)return xn;al=1,Object.defineProperty(xn,"__esModule",{value:!0});const r=$n(),e=pe(),t=$e(),n=Ji(),i={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:o,
|
|
711
|
+
j:a}})=>(0,e.str)`must NOT have duplicate items (items ## ${a} and ${o} are identical)`,params:({params:{i:o,j:a}})=>(0,e._)`{i: ${o}, j: ${a}}`},code(o){const{gen:a,data:c,$data:l,schema:u,parentSchema:f,schemaCode:h,it:$}=o;if(!l&&!u)return;const b=a.let("valid"),y=f.items?(0,r.getSchemaTypes)(f.items):[];o.block$data(b,d,(0,e._)`${h} === false`),o.ok(b);function d(){const _=a.let("i",(0,e._)`${c}.length`),v=a.let("j");o.setParams({i:_,j:v}),a.assign(b,!0),a.if((0,e._)`${_} > 1`,()=>(g()?p:m)(
|
|
712
|
+
_,v))}function g(){return y.length>0&&!y.some(_=>_==="object"||_==="array")}function p(_,v){const w=a.name("item"),S=(0,r.checkDataTypes)(y,w,$.opts.strictNumbers,r.DataType.Wrong),I=a.const("indices",(0,e._)`{}`);a.for((0,e._)`;${_}--;`,()=>{a.let(w,(0,e._)`${c}[${_}]`),a.if(S,(0,e._)`continue`),y.length>1&&a.if((0,e._)`typeof ${w} == "string"`,(0,e._)`${w} += "_"`),a.if((0,e._)`typeof ${I}[${w}] == "number"`,()=>{a.assign(v,(0,e._)`${I}[${w}]`),o.error(),a.assign(b,!1).break()}).code((0,e._)`${I}[${w}] = ${_}`)})}
|
|
713
|
+
function m(_,v){const w=(0,t.useFunc)(a,n.default),S=a.name("outer");a.label(S).for((0,e._)`;${_}--;`,()=>a.for((0,e._)`${v} = ${_}; ${v}--;`,()=>a.if((0,e._)`${w}(${c}[${_}], ${c}[${v}])`,()=>{o.error(),a.assign(b,!1).break(S)})))}}};return xn.default=i,xn}var qn={},cl;function Gy(){if(cl)return qn;cl=1,Object.defineProperty(qn,"__esModule",{value:!0});const r=pe(),e=$e(),t=Ji(),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:i})=>(0,r._)`{allowedValue: ${i}}`},
|
|
714
|
+
code(i){const{gen:o,data:a,$data:c,schemaCode:l,schema:u}=i;c||u&&typeof u=="object"?i.fail$data((0,r._)`!${(0,e.useFunc)(o,t.default)}(${a}, ${l})`):i.fail((0,r._)`${u} !== ${a}`)}};return qn.default=s,qn}var Un={},ul;function By(){if(ul)return Un;ul=1,Object.defineProperty(Un,"__esModule",{value:!0});const r=pe(),e=$e(),t=Ji(),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:i})=>(0,r._)`{allowedValues: ${i}}`},code(i){
|
|
715
|
+
const{gen:o,data:a,$data:c,schema:l,schemaCode:u,it:f}=i;if(!c&&l.length===0)throw new Error("enum must have non-empty array");const h=l.length>=f.opts.loopEnum;let $;const b=()=>$??($=(0,e.useFunc)(o,t.default));let y;if(h||c)y=o.let("valid"),i.block$data(y,d);else{if(!Array.isArray(l))throw new Error("ajv implementation error");const p=o.const("vSchema",u);y=(0,r.or)(...l.map((m,_)=>g(p,_)))}i.pass(y);function d(){o.assign(y,!1),o.forOf("v",u,p=>o.if((0,r._)`${b()}(${a}, ${p})`,()=>o.assign(y,
|
|
716
|
+
!0).break()))}function g(p,m){const _=l[m];return typeof _=="object"&&_!==null?(0,r._)`${b()}(${a}, ${p}[${m}])`:(0,r._)`${a} === ${_}`}}};return Un.default=s,Un}var ll;function fl(){if(ll)return Cn;ll=1,Object.defineProperty(Cn,"__esModule",{value:!0});const r=Dy(),e=xy(),t=qy(),n=Uy(),s=Hy(),i=Fy(),o=Vy(),a=zy(),c=Gy(),l=By(),u=[r.default,e.default,t.default,n.default,s.default,i.default,o.default,a.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},
|
|
717
|
+
c.default,l.default];return Cn.default=u,Cn}var Hn={},nr={},dl;function hl(){if(dl)return nr;dl=1,Object.defineProperty(nr,"__esModule",{value:!0}),nr.validateAdditionalItems=void 0;const r=pe(),e=$e(),n={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:i}})=>(0,r.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,r._)`{limit: ${i}}`},code(i){const{parentSchema:o,it:a}=i,{items:c}=o;if(!Array.isArray(c)){
|
|
718
|
+
(0,e.checkStrictMode)(a,'"additionalItems" is ignored when "items" is not an array of schemas');return}s(i,c)}};function s(i,o){const{gen:a,schema:c,data:l,keyword:u,it:f}=i;f.items=!0;const h=a.const("len",(0,r._)`${l}.length`);if(c===!1)i.setParams({len:o.length}),i.pass((0,r._)`${h} <= ${o.length}`);else if(typeof c=="object"&&!(0,e.alwaysValidSchema)(f,c)){const b=a.var("valid",(0,r._)`${h} <= ${o.length}`);a.if((0,r.not)(b),()=>$(b)),i.ok(b)}function $(b){a.forRange("i",o.length,h,y=>{i.subschema(
|
|
719
|
+
{keyword:u,dataProp:y,dataPropType:e.Type.Num},b),f.allErrors||a.if((0,r.not)(b),()=>a.break())})}}return nr.validateAdditionalItems=s,nr.default=n,nr}var Fn={},sr={},pl;function ml(){if(pl)return sr;pl=1,Object.defineProperty(sr,"__esModule",{value:!0}),sr.validateTuple=void 0;const r=pe(),e=$e(),t=et(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(i){const{schema:o,it:a}=i;if(Array.isArray(o))return s(i,"additionalItems",o);a.items=!0,!(0,e.alwaysValidSchema)(
|
|
720
|
+
a,o)&&i.ok((0,t.validateArray)(i))}};function s(i,o,a=i.schema){const{gen:c,parentSchema:l,data:u,keyword:f,it:h}=i;y(l),h.opts.unevaluated&&a.length&&h.items!==!0&&(h.items=e.mergeEvaluated.items(c,a.length,h.items));const $=c.name("valid"),b=c.const("len",(0,r._)`${u}.length`);a.forEach((d,g)=>{(0,e.alwaysValidSchema)(h,d)||(c.if((0,r._)`${b} > ${g}`,()=>i.subschema({keyword:f,schemaProp:g,dataProp:g},$)),i.ok($))});function y(d){const{opts:g,errSchemaPath:p}=h,m=a.length,_=m===d.minItems&&(m===
|
|
721
|
+
d.maxItems||d[o]===!1);if(g.strictTuples&&!_){const v=`"${f}" is ${m}-tuple, but minItems or maxItems/${o} are not specified or different at path "${p}"`;(0,e.checkStrictMode)(h,v,g.strictTuples)}}}return sr.validateTuple=s,sr.default=n,sr}var gl;function Wy(){if(gl)return Fn;gl=1,Object.defineProperty(Fn,"__esModule",{value:!0});const r=ml(),e={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,r.validateTuple)(t,"items")};return Fn.default=e,Fn}var Vn={},yl;
|
|
722
|
+
function Ky(){if(yl)return Vn;yl=1,Object.defineProperty(Vn,"__esModule",{value:!0});const r=pe(),e=$e(),t=et(),n=hl(),i={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,r.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,r._)`{limit: ${o}}`},code(o){const{schema:a,parentSchema:c,it:l}=o,{prefixItems:u}=c;l.items=!0,!(0,e.alwaysValidSchema)(l,a)&&(u?(0,n.validateAdditionalItems)(o,u):o.ok((0,t.validateArray)(
|
|
723
|
+
o)))}};return Vn.default=i,Vn}var zn={},$l;function Yy(){if($l)return zn;$l=1,Object.defineProperty(zn,"__esModule",{value:!0});const r=pe(),e=$e(),n={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:s,max:i}})=>i===void 0?(0,r.str)`must contain at least ${s} valid item(s)`:(0,r.str)`must contain at least ${s} and no more than ${i} valid item(s)`,params:({params:{min:s,max:i}})=>i===void 0?(0,r._)`{minContains: ${s}}`:
|
|
724
|
+
(0,r._)`{minContains: ${s}, maxContains: ${i}}`},code(s){const{gen:i,schema:o,parentSchema:a,data:c,it:l}=s;let u,f;const{minContains:h,maxContains:$}=a;l.opts.next?(u=h===void 0?1:h,f=$):u=1;const b=i.const("len",(0,r._)`${c}.length`);if(s.setParams({min:u,max:f}),f===void 0&&u===0){(0,e.checkStrictMode)(l,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(f!==void 0&&u>f){(0,e.checkStrictMode)(l,'"minContains" > "maxContains" is always invalid'),s.fail();return}if((0,e.
|
|
725
|
+
alwaysValidSchema)(l,o)){let m=(0,r._)`${b} >= ${u}`;f!==void 0&&(m=(0,r._)`${m} && ${b} <= ${f}`),s.pass(m);return}l.items=!0;const y=i.name("valid");f===void 0&&u===1?g(y,()=>i.if(y,()=>i.break())):u===0?(i.let(y,!0),f!==void 0&&i.if((0,r._)`${c}.length > 0`,d)):(i.let(y,!1),d()),s.result(y,()=>s.reset());function d(){const m=i.name("_valid"),_=i.let("count",0);g(m,()=>i.if(m,()=>p(_)))}function g(m,_){i.forRange("i",0,b,v=>{s.subschema({keyword:"contains",dataProp:v,dataPropType:e.Type.Num,compositeRule:!0},
|
|
726
|
+
m),_()})}function p(m){i.code((0,r._)`${m}++`),f===void 0?i.if((0,r._)`${m} >= ${u}`,()=>i.assign(y,!0).break()):(i.if((0,r._)`${m} > ${f}`,()=>i.assign(y,!1).break()),u===1?i.assign(y,!0):i.if((0,r._)`${m} >= ${u}`,()=>i.assign(y,!0)))}}};return zn.default=n,zn}var Qi={},_l;function Zi(){return _l||(_l=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.validateSchemaDeps=r.validatePropertyDeps=r.error=void 0;const e=pe(),t=$e(),n=et();r.error={message:({params:{property:c,depsCount:l,
|
|
728
727
|
deps:u}})=>{const f=l===1?"property":"properties";return(0,e.str)`must have ${f} ${u} when property ${c} is present`},params:({params:{property:c,depsCount:l,deps:u,missingProperty:f}})=>(0,e._)`{property: ${c},
|
|
729
728
|
missingProperty: ${f},
|
|
730
729
|
depsCount: ${l},
|
|
731
|
-
deps: ${u}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:
|
|
732
|
-
c.setParams({property:b,depsCount:y.length,deps:y.join(", ")}),h.allErrors?u.if(d,()=>{for(const g of y)(0,n.checkReportMissingProp)(c,g)}):(u.if((0,e._)`${d} && (${(0,n.checkMissingProp)(c,y,$)})`),(0,n.reportMissingProp)(c,$),u.else())}}
|
|
733
|
-
c.mergeValidEvaluated(d,b)},()=>u.var(b,!0)),c.ok(b))}
|
|
734
|
-
lid");i.forIn("key",a,u=>{s.setParams({propertyName:u}),s.subschema({keyword:"propertyNames",data:u,dataTypes:["string"],propertyName:u,compositeRule:!0},l),i.if((0,
|
|
735
|
-
message:"must NOT have additional properties",params:({params:o})=>(0,e._)`{additionalProperty: ${o.additionalProperty}}`},code(o){const{gen:a,schema:c,parentSchema:l,data:u,errsCount:f,it:h}=o;if(!f)throw new Error("ajv implementation error");const{allErrors:$,opts:b}=h;if(h.props=!0,b.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(h,c))return;const y=(0,
|
|
736
|
-
a.forIn("key",u,w=>{!y.length&&!d.length?_(w):a.if(p(w),()=>_(w))})}function p(w){let S;if(y.length>8){const I=(0,n.schemaRefOrVal)(h,l.properties,"properties");S=(0,
|
|
737
|
-
!1){o.setParams({additionalProperty:w}),o.error(),$||a.break();return}if(typeof c=="object"&&!(0,n.alwaysValidSchema)(h,c)){const S=a.name("valid");b.removeAdditional==="failing"?(v(w,S,!1),a.if((0,e.not)(S),()=>{o.reset(),m(w)})):(v(w,S),$||a.if((0,e.not)(S),()=>a.break()))}}function v(w,S,I){const F={keyword:"additionalProperties",dataProp:w,dataPropType:n.Type.Str};I===!1&&Object.assign(F,{compositeRule:!0,createErrors:!1,allErrors:!1}),o.subschema(F,S)}}};return Bn.default=i,Bn}var Wn={},
|
|
738
|
-
function
|
|
739
|
-
|
|
740
|
-
Wn}var Kn={},
|
|
741
|
-
"valid");u.props!==!0&&!(u.props instanceof e.Name)&&(u.props=(0,n.evaluatedPropsToName)(o,u.props));const{props:d}=u;g();function g(){for(const _ of h)b&&p(_),u.allErrors?m(_):(o.var(y,!0),m(_),o.if(y))}function p(_){for(const v in b)new RegExp(_).test(v)&&(0,
|
|
742
|
-
ies",schemaProp:_,dataProp:v,dataPropType:n.Type.Str},y),u.opts.unevaluated&&d!==!0?o.assign((0,e._)`${d}[${v}]`,!0):!w&&!u.allErrors&&o.if((0,e.not)(y),()=>o.break())})})}}};return Kn.default=s,Kn}var Yn={},
|
|
743
|
-
not",compositeRule:!0,createErrors:!1,allErrors:!1},o),
|
|
744
|
-
const
|
|
745
|
-
!0));function $(){l.forEach((b,y)=>{let d;(0,e.alwaysValidSchema)(c,b)?i.var(h,!0):d=s.subschema({keyword:"oneOf",schemaProp:y,compositeRule:!0},h),y>0&&i.if((0,
|
|
746
|
-
schema:s,it:i}=
|
|
747
|
-
ifClause}" schema`,params:({params:i})=>(0,
|
|
748
|
-
error(!0));function $(){const y=i.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},h);i.mergeEvaluated(y)}function b(y,d){return()=>{const g=i.subschema({keyword:y},h);o.assign(f,h),i.mergeValidEvaluated(g,f),d?o.assign(d,(0,
|
|
749
|
-
e={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:
|
|
750
|
-
a.default,i.default,c.default,l.default];return g?p.push(e.default,n.default):p.push(
|
|
751
|
-
getProperty)(c)}`,h=u.errSchemaPath==="#"?u.validateName:o(a);l.if((0,
|
|
752
|
-
void 0;const
|
|
753
|
-
function h($,b){return b?()=>a.block(()=>{(0,
|
|
754
|
-
ns,"__esModule",{value:!0});const
|
|
755
|
-
ct",schemaType:"object",error:
|
|
756
|
-
schemaType:"number",code({keyword:
|
|
757
|
-
operties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:i})=>(0,
|
|
758
|
-
u.props=!0,i.ok((0,
|
|
759
|
-
s,us}var ls={},
|
|
760
|
-
"object"&&!(0,e.alwaysValidSchema)(c,o)){const h=i.var("valid",(0,
|
|
761
|
-
|
|
762
|
-
code:f.code.formats}),p=i.const("fDef",(0,
|
|
763
|
-
_)`(typeof ${_} == "function" ? ${S} : ${_}.test(${o}))`;return(0,
|
|
764
|
-
c)}`:void 0,
|
|
765
|
-
fs,"__esModule",{value:!0});const e=[
|
|
766
|
-
e=
|
|
767
|
-
e=
|
|
768
|
-
propertyName;if(typeof b!="string")throw new Error("discriminator: requires propertyName");if(u.mapping)throw new Error("discriminator: mapping is not supported");if(!$)throw new Error("discriminator: requires oneOf keyword");const y=c.let("valid",!1),d=c.const("tag",(0,
|
|
769
|
-
c.assign(y,p(_[v]));c.else(),a.error(!1,{discrError:e.DiscrError.Mapping,tag:d,tagName:b}),c.endIf()}function p(_){const v=c.name("valid"),w=a.subschema({keyword:"oneOf",schemaProp:_},v);return a.mergeEvaluated(w,
|
|
770
|
-
default(h.opts.uriResolver,h.baseId,
|
|
771
|
-
"properties/${b}" must have "const" or "enum"`)}function
|
|
772
|
-
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},
|
|
773
|
-
|
|
774
|
-
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}}
|
|
775
|
-
$comment:
|
|
730
|
+
deps: ${u}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:r.error,code(c){const[l,u]=i(c);o(c,l),a(c,u)}};function i({schema:c}){const l={},u={};for(const f in c){if(f==="__proto__")continue;const h=Array.isArray(c[f])?l:u;h[f]=c[f]}return[l,u]}function o(c,l=c.schema){const{gen:u,data:f,it:h}=c;if(Object.keys(l).length===0)return;const $=u.let("missing");for(const b in l){const y=l[b];if(y.length===0)continue;const d=(0,n.propertyInData)(u,f,b,h.opts.ownProperties);
|
|
731
|
+
c.setParams({property:b,depsCount:y.length,deps:y.join(", ")}),h.allErrors?u.if(d,()=>{for(const g of y)(0,n.checkReportMissingProp)(c,g)}):(u.if((0,e._)`${d} && (${(0,n.checkMissingProp)(c,y,$)})`),(0,n.reportMissingProp)(c,$),u.else())}}r.validatePropertyDeps=o;function a(c,l=c.schema){const{gen:u,data:f,keyword:h,it:$}=c,b=u.name("valid");for(const y in l)(0,t.alwaysValidSchema)($,l[y])||(u.if((0,n.propertyInData)(u,f,y,$.opts.ownProperties),()=>{const d=c.subschema({keyword:h,schemaProp:y},b);
|
|
732
|
+
c.mergeValidEvaluated(d,b)},()=>u.var(b,!0)),c.ok(b))}r.validateSchemaDeps=a,r.default=s}(Qi)),Qi}var Gn={},vl;function Xy(){if(vl)return Gn;vl=1,Object.defineProperty(Gn,"__esModule",{value:!0});const r=pe(),e=$e(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:s})=>(0,r._)`{propertyName: ${s.propertyName}}`},code(s){const{gen:i,schema:o,data:a,it:c}=s;if((0,e.alwaysValidSchema)(c,o))return;const l=i.name("va\
|
|
733
|
+
lid");i.forIn("key",a,u=>{s.setParams({propertyName:u}),s.subschema({keyword:"propertyNames",data:u,dataTypes:["string"],propertyName:u,compositeRule:!0},l),i.if((0,r.not)(l),()=>{s.error(!0),c.allErrors||i.break()})}),s.ok(l)}};return Gn.default=n,Gn}var Bn={},bl;function wl(){if(bl)return Bn;bl=1,Object.defineProperty(Bn,"__esModule",{value:!0});const r=et(),e=pe(),t=Qe(),n=$e(),i={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{
|
|
734
|
+
message:"must NOT have additional properties",params:({params:o})=>(0,e._)`{additionalProperty: ${o.additionalProperty}}`},code(o){const{gen:a,schema:c,parentSchema:l,data:u,errsCount:f,it:h}=o;if(!f)throw new Error("ajv implementation error");const{allErrors:$,opts:b}=h;if(h.props=!0,b.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(h,c))return;const y=(0,r.allSchemaProperties)(l.properties),d=(0,r.allSchemaProperties)(l.patternProperties);g(),o.ok((0,e._)`${f} === ${t.default.errors}`);function g(){
|
|
735
|
+
a.forIn("key",u,w=>{!y.length&&!d.length?_(w):a.if(p(w),()=>_(w))})}function p(w){let S;if(y.length>8){const I=(0,n.schemaRefOrVal)(h,l.properties,"properties");S=(0,r.isOwnProperty)(a,I,w)}else y.length?S=(0,e.or)(...y.map(I=>(0,e._)`${w} === ${I}`)):S=e.nil;return d.length&&(S=(0,e.or)(S,...d.map(I=>(0,e._)`${(0,r.usePattern)(o,I)}.test(${w})`))),(0,e.not)(S)}function m(w){a.code((0,e._)`delete ${u}[${w}]`)}function _(w){if(b.removeAdditional==="all"||b.removeAdditional&&c===!1){m(w);return}if(c===
|
|
736
|
+
!1){o.setParams({additionalProperty:w}),o.error(),$||a.break();return}if(typeof c=="object"&&!(0,n.alwaysValidSchema)(h,c)){const S=a.name("valid");b.removeAdditional==="failing"?(v(w,S,!1),a.if((0,e.not)(S),()=>{o.reset(),m(w)})):(v(w,S),$||a.if((0,e.not)(S),()=>a.break()))}}function v(w,S,I){const F={keyword:"additionalProperties",dataProp:w,dataPropType:n.Type.Str};I===!1&&Object.assign(F,{compositeRule:!0,createErrors:!1,allErrors:!1}),o.subschema(F,S)}}};return Bn.default=i,Bn}var Wn={},El;
|
|
737
|
+
function Jy(){if(El)return Wn;El=1,Object.defineProperty(Wn,"__esModule",{value:!0});const r=jr(),e=et(),t=$e(),n=wl(),s={keyword:"properties",type:"object",schemaType:"object",code(i){const{gen:o,schema:a,parentSchema:c,data:l,it:u}=i;u.opts.removeAdditional==="all"&&c.additionalProperties===void 0&&n.default.code(new r.KeywordCxt(u,n.default,"additionalProperties"));const f=(0,e.allSchemaProperties)(a);for(const d of f)u.definedProperties.add(d);u.opts.unevaluated&&f.length&&u.props!==!0&&(u.props=
|
|
738
|
+
t.mergeEvaluated.props(o,(0,t.toHash)(f),u.props));const h=f.filter(d=>!(0,t.alwaysValidSchema)(u,a[d]));if(h.length===0)return;const $=o.name("valid");for(const d of h)b(d)?y(d):(o.if((0,e.propertyInData)(o,l,d,u.opts.ownProperties)),y(d),u.allErrors||o.else().var($,!0),o.endIf()),i.it.definedProperties.add(d),i.ok($);function b(d){return u.opts.useDefaults&&!u.compositeRule&&a[d].default!==void 0}function y(d){i.subschema({keyword:"properties",schemaProp:d,dataProp:d},$)}}};return Wn.default=s,
|
|
739
|
+
Wn}var Kn={},Sl;function Qy(){if(Sl)return Kn;Sl=1,Object.defineProperty(Kn,"__esModule",{value:!0});const r=et(),e=pe(),t=$e(),n=$e(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(i){const{gen:o,schema:a,data:c,parentSchema:l,it:u}=i,{opts:f}=u,h=(0,r.allSchemaProperties)(a),$=h.filter(_=>(0,t.alwaysValidSchema)(u,a[_]));if(h.length===0||$.length===h.length&&(!u.opts.unevaluated||u.props===!0))return;const b=f.strictSchema&&!f.allowMatchingProperties&&l.properties,y=o.name(
|
|
740
|
+
"valid");u.props!==!0&&!(u.props instanceof e.Name)&&(u.props=(0,n.evaluatedPropsToName)(o,u.props));const{props:d}=u;g();function g(){for(const _ of h)b&&p(_),u.allErrors?m(_):(o.var(y,!0),m(_),o.if(y))}function p(_){for(const v in b)new RegExp(_).test(v)&&(0,t.checkStrictMode)(u,`property ${v} matches pattern ${_} (use allowMatchingProperties)`)}function m(_){o.forIn("key",c,v=>{o.if((0,e._)`${(0,r.usePattern)(i,_)}.test(${v})`,()=>{const w=$.includes(_);w||i.subschema({keyword:"patternPropert\
|
|
741
|
+
ies",schemaProp:_,dataProp:v,dataPropType:n.Type.Str},y),u.opts.unevaluated&&d!==!0?o.assign((0,e._)`${d}[${v}]`,!0):!w&&!u.allErrors&&o.if((0,e.not)(y),()=>o.break())})})}}};return Kn.default=s,Kn}var Yn={},Rl;function Zy(){if(Rl)return Yn;Rl=1,Object.defineProperty(Yn,"__esModule",{value:!0});const r=$e(),e={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){const{gen:n,schema:s,it:i}=t;if((0,r.alwaysValidSchema)(i,s)){t.fail();return}const o=n.name("valid");t.subschema({keyword:"\
|
|
742
|
+
not",compositeRule:!0,createErrors:!1,allErrors:!1},o),t.failResult(o,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};return Yn.default=e,Yn}var Xn={},Al;function e$(){if(Al)return Xn;Al=1,Object.defineProperty(Xn,"__esModule",{value:!0});const e={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:et().validateUnion,error:{message:"must match a schema in anyOf"}};return Xn.default=e,Xn}var Jn={},Ol;function t$(){if(Ol)return Jn;Ol=1,Object.defineProperty(Jn,"__esModule",{value:!0});
|
|
743
|
+
const r=pe(),e=$e(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:s})=>(0,r._)`{passingSchemas: ${s.passing}}`},code(s){const{gen:i,schema:o,parentSchema:a,it:c}=s;if(!Array.isArray(o))throw new Error("ajv implementation error");if(c.opts.discriminator&&a.discriminator)return;const l=o,u=i.let("valid",!1),f=i.let("passing",null),h=i.name("_valid");s.setParams({passing:f}),i.block($),s.result(u,()=>s.reset(),()=>s.error(
|
|
744
|
+
!0));function $(){l.forEach((b,y)=>{let d;(0,e.alwaysValidSchema)(c,b)?i.var(h,!0):d=s.subschema({keyword:"oneOf",schemaProp:y,compositeRule:!0},h),y>0&&i.if((0,r._)`${h} && ${u}`).assign(u,!1).assign(f,(0,r._)`[${f}, ${y}]`).else(),i.if(h,()=>{i.assign(u,!0),i.assign(f,y),d&&s.mergeEvaluated(d,r.Name)})})}}};return Jn.default=n,Jn}var Qn={},Cl;function r$(){if(Cl)return Qn;Cl=1,Object.defineProperty(Qn,"__esModule",{value:!0});const r=$e(),e={keyword:"allOf",schemaType:"array",code(t){const{gen:n,
|
|
745
|
+
schema:s,it:i}=t;if(!Array.isArray(s))throw new Error("ajv implementation error");const o=n.name("valid");s.forEach((a,c)=>{if((0,r.alwaysValidSchema)(i,a))return;const l=t.subschema({keyword:"allOf",schemaProp:c},o);t.ok(o),t.mergeEvaluated(l)})}};return Qn.default=e,Qn}var Zn={},Pl;function n$(){if(Pl)return Zn;Pl=1,Object.defineProperty(Zn,"__esModule",{value:!0});const r=pe(),e=$e(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:i})=>(0,r.str)`must match "${i.
|
|
746
|
+
ifClause}" schema`,params:({params:i})=>(0,r._)`{failingKeyword: ${i.ifClause}}`},code(i){const{gen:o,parentSchema:a,it:c}=i;a.then===void 0&&a.else===void 0&&(0,e.checkStrictMode)(c,'"if" without "then" and "else" is ignored');const l=s(c,"then"),u=s(c,"else");if(!l&&!u)return;const f=o.let("valid",!0),h=o.name("_valid");if($(),i.reset(),l&&u){const y=o.let("ifClause");i.setParams({ifClause:y}),o.if(h,b("then",y),b("else",y))}else l?o.if(h,b("then")):o.if((0,r.not)(h),b("else"));i.pass(f,()=>i.
|
|
747
|
+
error(!0));function $(){const y=i.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},h);i.mergeEvaluated(y)}function b(y,d){return()=>{const g=i.subschema({keyword:y},h);o.assign(f,h),i.mergeValidEvaluated(g,f),d?o.assign(d,(0,r._)`${y}`):i.setParams({ifClause:y})}}}};function s(i,o){const a=i.schema[o];return a!==void 0&&!(0,e.alwaysValidSchema)(i,a)}return Zn.default=n,Zn}var es={},Il;function s$(){if(Il)return es;Il=1,Object.defineProperty(es,"__esModule",{value:!0});const r=$e(),
|
|
748
|
+
e={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:n,it:s}){n.if===void 0&&(0,r.checkStrictMode)(s,`"${t}" without "if" is ignored`)}};return es.default=e,es}var Nl;function Tl(){if(Nl)return Hn;Nl=1,Object.defineProperty(Hn,"__esModule",{value:!0});const r=hl(),e=Wy(),t=ml(),n=Ky(),s=Yy(),i=Zi(),o=Xy(),a=wl(),c=Jy(),l=Qy(),u=Zy(),f=e$(),h=t$(),$=r$(),b=n$(),y=s$();function d(g=!1){const p=[u.default,f.default,h.default,$.default,b.default,y.default,o.default,
|
|
749
|
+
a.default,i.default,c.default,l.default];return g?p.push(e.default,n.default):p.push(r.default,t.default),p.push(s.default),p}return Hn.default=d,Hn}var ts={},ir={},jl;function Ll(){if(jl)return ir;jl=1,Object.defineProperty(ir,"__esModule",{value:!0}),ir.dynamicAnchor=void 0;const r=pe(),e=Qe(),t=En(),n=Xi(),s={keyword:"$dynamicAnchor",schemaType:"string",code:a=>i(a,a.schema)};function i(a,c){const{gen:l,it:u}=a;u.schemaEnv.root.dynamicAnchors[c]=!0;const f=(0,r._)`${e.default.dynamicAnchors}${(0,r.
|
|
750
|
+
getProperty)(c)}`,h=u.errSchemaPath==="#"?u.validateName:o(a);l.if((0,r._)`!${f}`,()=>l.assign(f,h))}ir.dynamicAnchor=i;function o(a){const{schemaEnv:c,schema:l,self:u}=a.it,{root:f,baseId:h,localRefs:$,meta:b}=c.root,{schemaId:y}=u.opts,d=new t.SchemaEnv({schema:l,schemaId:y,root:f,baseId:h,localRefs:$,meta:b});return t.compileSchema.call(u,d),(0,n.getValidate)(a,d)}return ir.default=s,ir}var or={},kl;function Dl(){if(kl)return or;kl=1,Object.defineProperty(or,"__esModule",{value:!0}),or.dynamicRef=
|
|
751
|
+
void 0;const r=pe(),e=Qe(),t=Xi(),n={keyword:"$dynamicRef",schemaType:"string",code:i=>s(i,i.schema)};function s(i,o){const{gen:a,keyword:c,it:l}=i;if(o[0]!=="#")throw new Error(`"${c}" only supports hash fragment reference`);const u=o.slice(1);if(l.allErrors)f();else{const $=a.let("valid",!1);f($),i.ok($)}function f($){if(l.schemaEnv.root.dynamicAnchors[u]){const b=a.let("_v",(0,r._)`${e.default.dynamicAnchors}${(0,r.getProperty)(u)}`);a.if(b,h(b,$),h(l.validateName,$))}else h(l.validateName,$)()}
|
|
752
|
+
function h($,b){return b?()=>a.block(()=>{(0,t.callRef)(i,$),a.let(b,!0)}):()=>(0,t.callRef)(i,$)}}return or.dynamicRef=s,or.default=n,or}var rs={},xl;function i$(){if(xl)return rs;xl=1,Object.defineProperty(rs,"__esModule",{value:!0});const r=Ll(),e=$e(),t={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0,r.dynamicAnchor)(n,""):(0,e.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};return rs.default=t,rs}var ns={},Ml;function o$(){if(Ml)return ns;Ml=1,Object.defineProperty(
|
|
753
|
+
ns,"__esModule",{value:!0});const r=Dl(),e={keyword:"$recursiveRef",schemaType:"string",code:t=>(0,r.dynamicRef)(t,t.schema)};return ns.default=e,ns}var ql;function a$(){if(ql)return ts;ql=1,Object.defineProperty(ts,"__esModule",{value:!0});const r=Ll(),e=Dl(),t=i$(),n=o$(),s=[r.default,e.default,t.default,n.default];return ts.default=s,ts}var ss={},is={},Ul;function c$(){if(Ul)return is;Ul=1,Object.defineProperty(is,"__esModule",{value:!0});const r=Zi(),e={keyword:"dependentRequired",type:"obje\
|
|
754
|
+
ct",schemaType:"object",error:r.error,code:t=>(0,r.validatePropertyDeps)(t)};return is.default=e,is}var os={},Hl;function u$(){if(Hl)return os;Hl=1,Object.defineProperty(os,"__esModule",{value:!0});const r=Zi(),e={keyword:"dependentSchemas",type:"object",schemaType:"object",code:t=>(0,r.validateSchemaDeps)(t)};return os.default=e,os}var as={},Fl;function l$(){if(Fl)return as;Fl=1,Object.defineProperty(as,"__esModule",{value:!0});const r=$e(),e={keyword:["maxContains","minContains"],type:"array",
|
|
755
|
+
schemaType:"number",code({keyword:t,parentSchema:n,it:s}){n.contains===void 0&&(0,r.checkStrictMode)(s,`"${t}" without "contains" is ignored`)}};return as.default=e,as}var Vl;function f$(){if(Vl)return ss;Vl=1,Object.defineProperty(ss,"__esModule",{value:!0});const r=c$(),e=u$(),t=l$(),n=[r.default,e.default,t.default];return ss.default=n,ss}var cs={},us={},zl;function d$(){if(zl)return us;zl=1,Object.defineProperty(us,"__esModule",{value:!0});const r=pe(),e=$e(),t=Qe(),s={keyword:"unevaluatedPr\
|
|
756
|
+
operties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:i})=>(0,r._)`{unevaluatedProperty: ${i.unevaluatedProperty}}`},code(i){const{gen:o,schema:a,data:c,errsCount:l,it:u}=i;if(!l)throw new Error("ajv implementation error");const{allErrors:f,props:h}=u;h instanceof r.Name?o.if((0,r._)`${h} !== true`,()=>o.forIn("key",c,d=>o.if(b(h,d),()=>$(d)))):h!==!0&&o.forIn("key",c,d=>h===void 0?$(d):o.if(y(h,d),()=>$(d))),
|
|
757
|
+
u.props=!0,i.ok((0,r._)`${l} === ${t.default.errors}`);function $(d){if(a===!1){i.setParams({unevaluatedProperty:d}),i.error(),f||o.break();return}if(!(0,e.alwaysValidSchema)(u,a)){const g=o.name("valid");i.subschema({keyword:"unevaluatedProperties",dataProp:d,dataPropType:e.Type.Str},g),f||o.if((0,r.not)(g),()=>o.break())}}function b(d,g){return(0,r._)`!${d} || !${d}[${g}]`}function y(d,g){const p=[];for(const m in d)d[m]===!0&&p.push((0,r._)`${g} !== ${m}`);return(0,r.and)(...p)}}};return us.default=
|
|
758
|
+
s,us}var ls={},Gl;function h$(){if(Gl)return ls;Gl=1,Object.defineProperty(ls,"__esModule",{value:!0});const r=pe(),e=$e(),n={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:s}})=>(0,r.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,r._)`{limit: ${s}}`},code(s){const{gen:i,schema:o,data:a,it:c}=s,l=c.items||0;if(l===!0)return;const u=i.const("len",(0,r._)`${a}.length`);if(o===!1)s.setParams({len:l}),s.fail((0,r._)`${u} > ${l}`);else if(typeof o==
|
|
759
|
+
"object"&&!(0,e.alwaysValidSchema)(c,o)){const h=i.var("valid",(0,r._)`${u} <= ${l}`);i.if((0,r.not)(h),()=>f(h,l)),s.ok(h)}c.items=!0;function f(h,$){i.forRange("i",$,u,b=>{s.subschema({keyword:"unevaluatedItems",dataProp:b,dataPropType:e.Type.Num},h),c.allErrors||i.if((0,r.not)(h),()=>i.break())})}}};return ls.default=n,ls}var Bl;function p$(){if(Bl)return cs;Bl=1,Object.defineProperty(cs,"__esModule",{value:!0});const r=d$(),e=h$(),t=[r.default,e.default];return cs.default=t,cs}var fs={},ds={},
|
|
760
|
+
Wl;function m$(){if(Wl)return ds;Wl=1,Object.defineProperty(ds,"__esModule",{value:!0});const r=pe(),t={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:n})=>(0,r.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,r._)`{format: ${n}}`},code(n,s){const{gen:i,data:o,$data:a,schema:c,schemaCode:l,it:u}=n,{opts:f,errSchemaPath:h,schemaEnv:$,self:b}=u;if(!f.validateFormats)return;a?y():d();function y(){const g=i.scopeValue("formats",{ref:b.formats,
|
|
761
|
+
code:f.code.formats}),p=i.const("fDef",(0,r._)`${g}[${l}]`),m=i.let("fType"),_=i.let("format");i.if((0,r._)`typeof ${p} == "object" && !(${p} instanceof RegExp)`,()=>i.assign(m,(0,r._)`${p}.type || "string"`).assign(_,(0,r._)`${p}.validate`),()=>i.assign(m,(0,r._)`"string"`).assign(_,p)),n.fail$data((0,r.or)(v(),w()));function v(){return f.strictSchema===!1?r.nil:(0,r._)`${l} && !${_}`}function w(){const S=$.$async?(0,r._)`(${p}.async ? await ${_}(${o}) : ${_}(${o}))`:(0,r._)`${_}(${o})`,I=(0,r.
|
|
762
|
+
_)`(typeof ${_} == "function" ? ${S} : ${_}.test(${o}))`;return(0,r._)`${_} && ${_} !== true && ${m} === ${s} && !${I}`}}function d(){const g=b.formats[c];if(!g){v();return}if(g===!0)return;const[p,m,_]=w(g);p===s&&n.pass(S());function v(){if(f.strictSchema===!1){b.logger.warn(I());return}throw new Error(I());function I(){return`unknown format "${c}" ignored in schema at path "${h}"`}}function w(I){const F=I instanceof RegExp?(0,r.regexpCode)(I):f.code.formats?(0,r._)`${f.code.formats}${(0,r.getProperty)(
|
|
763
|
+
c)}`:void 0,W=i.scopeValue("formats",{key:c,ref:I,code:F});return typeof I=="object"&&!(I instanceof RegExp)?[I.type||"string",I.validate,(0,r._)`${W}.validate`]:["string",I,W]}function S(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!$.$async)throw new Error("async format in sync schema");return(0,r._)`await ${_}(${o})`}return typeof m=="function"?(0,r._)`${_}(${o})`:(0,r._)`${_}.test(${o})`}}}};return ds.default=t,ds}var Kl;function Yl(){if(Kl)return fs;Kl=1,Object.defineProperty(
|
|
764
|
+
fs,"__esModule",{value:!0});const e=[m$().default];return fs.default=e,fs}var Bt={},Xl;function Jl(){return Xl||(Xl=1,Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.contentVocabulary=Bt.metadataVocabulary=void 0,Bt.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Bt.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Bt}var Ql;function g$(){if(Ql)return Rn;Ql=1,Object.defineProperty(Rn,"__esModule",{value:!0});const r=Ju(),
|
|
765
|
+
e=fl(),t=Tl(),n=a$(),s=f$(),i=p$(),o=Yl(),a=Jl(),c=[n.default,r.default,e.default,(0,t.default)(!0),o.default,a.metadataVocabulary,a.contentVocabulary,s.default,i.default];return Rn.default=c,Rn}var hs={},Dr={},Zl;function y$(){if(Zl)return Dr;Zl=1,Object.defineProperty(Dr,"__esModule",{value:!0}),Dr.DiscrError=void 0;var r;return function(e){e.Tag="tag",e.Mapping="mapping"}(r||(Dr.DiscrError=r={})),Dr}var ef;function tf(){if(ef)return hs;ef=1,Object.defineProperty(hs,"__esModule",{value:!0});const r=pe(),
|
|
766
|
+
e=y$(),t=En(),n=Lr(),s=$e(),o={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:a,tagName:c}})=>a===e.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:a,tag:c,tagName:l}})=>(0,r._)`{error: ${a}, tag: ${l}, tagValue: ${c}}`},code(a){const{gen:c,data:l,schema:u,parentSchema:f,it:h}=a,{oneOf:$}=f;if(!h.opts.discriminator)throw new Error("discriminator: requires discriminator option");const b=u.
|
|
767
|
+
propertyName;if(typeof b!="string")throw new Error("discriminator: requires propertyName");if(u.mapping)throw new Error("discriminator: mapping is not supported");if(!$)throw new Error("discriminator: requires oneOf keyword");const y=c.let("valid",!1),d=c.const("tag",(0,r._)`${l}${(0,r.getProperty)(b)}`);c.if((0,r._)`typeof ${d} == "string"`,()=>g(),()=>a.error(!1,{discrError:e.DiscrError.Tag,tag:d,tagName:b})),a.ok(y);function g(){const _=m();c.if(!1);for(const v in _)c.elseIf((0,r._)`${d} === ${v}`),
|
|
768
|
+
c.assign(y,p(_[v]));c.else(),a.error(!1,{discrError:e.DiscrError.Mapping,tag:d,tagName:b}),c.endIf()}function p(_){const v=c.name("valid"),w=a.subschema({keyword:"oneOf",schemaProp:_},v);return a.mergeEvaluated(w,r.Name),v}function m(){var _;const v={},w=I(f);let S=!0;for(let k=0;k<$.length;k++){let M=$[k];if(M?.$ref&&!(0,s.schemaHasRulesButRef)(M,h.self.RULES)){const D=M.$ref;if(M=t.resolveRef.call(h.self,h.schemaEnv.root,h.baseId,D),M instanceof t.SchemaEnv&&(M=M.schema),M===void 0)throw new n.
|
|
769
|
+
default(h.opts.uriResolver,h.baseId,D)}const j=(_=M?.properties)===null||_===void 0?void 0:_[b];if(typeof j!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${b}"`);S=S&&(w||I(M)),F(j,k)}if(!S)throw new Error(`discriminator: "${b}" must be required`);return v;function I({required:k}){return Array.isArray(k)&&k.includes(b)}function F(k,M){if(k.const)W(k.const,M);else if(k.enum)for(const j of k.enum)W(j,M);else throw new Error(`discriminator:\
|
|
770
|
+
"properties/${b}" must have "const" or "enum"`)}function W(k,M){if(typeof k!="string"||k in v)throw new Error(`discriminator: "${b}" values must be unique strings`);v[k]=M}}}};return hs.default=o,hs}var ps={};const rf="https://json-schema.org/draft/2020-12/schema",nf="https://json-schema.org/draft/2020-12/schema",sf={"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"http\
|
|
771
|
+
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},of="meta",af="Core and Validation specifications meta-schema",cf=[{$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"],
|
|
772
|
+
lf="This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",ff={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:{
|
|
773
|
+
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}},$$={$schema:rf,$id:nf,$vocabulary:sf,$dynamicAnchor:of,title:af,allOf:cf,type:uf,$comment:lf,properties:ff},_$={__proto__:null,
|
|
774
|
+
$comment:lf,$dynamicAnchor:of,$id:nf,$schema:rf,$vocabulary:sf,allOf:cf,default:$$,properties:ff,title:af,type:uf},v$=nt(_$),df="https://json-schema.org/draft/2020-12/schema",hf="https://json-schema.org/draft/2020-12/meta/applicator",pf={"https://json-schema.org/draft/2020-12/vocab/applicator":!0},mf="meta",gf="Applicator vocabulary meta-schema",yf=["object","boolean"],$f={prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"\
|
|
776
775
|
#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\
|
|
777
|
-
/schemaArray"},not:{$dynamicRef:"#meta"}},
|
|
778
|
-
unevaluated":!0},
|
|
779
|
-
tent",
|
|
780
|
-
ma",kf="https://json-schema.org/draft/2020-12/meta/core",
|
|
781
|
-
type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},
|
|
782
|
-
$schema:
|
|
783
|
-
$id:
|
|
784
|
-
examples:{type:"array",items:!0}},
|
|
776
|
+
/schemaArray"},not:{$dynamicRef:"#meta"}},_f={schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}},b$={$schema:df,$id:hf,$vocabulary:pf,$dynamicAnchor:mf,title:gf,type:yf,properties:$f,$defs:_f},w$={__proto__:null,$defs:_f,$dynamicAnchor:mf,$id:hf,$schema:df,$vocabulary:pf,default:b$,properties:$f,title:gf,type:yf},E$=nt(w$),vf="https://json-schema.org/draft/2020-12/schema",bf="https://json-schema.org/draft/2020-12/meta/unevaluated",wf={"https://json-schema.org/draft/2020-12/vocab/\
|
|
777
|
+
unevaluated":!0},Ef="meta",Sf="Unevaluated applicator vocabulary meta-schema",Rf=["object","boolean"],Af={unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}},S$={$schema:vf,$id:bf,$vocabulary:wf,$dynamicAnchor:Ef,title:Sf,type:Rf,properties:Af},R$={__proto__:null,$dynamicAnchor:Ef,$id:bf,$schema:vf,$vocabulary:wf,default:S$,properties:Af,title:Sf,type:Rf},A$=nt(R$),Of="https://json-schema.org/draft/2020-12/schema",Cf="https://json-schema.org/draft/2020-12/meta/con\
|
|
778
|
+
tent",Pf={"https://json-schema.org/draft/2020-12/vocab/content":!0},If="meta",Nf="Content vocabulary meta-schema",Tf=["object","boolean"],jf={contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}},O$={$schema:Of,$id:Cf,$vocabulary:Pf,$dynamicAnchor:If,title:Nf,type:Tf,properties:jf},C$={__proto__:null,$dynamicAnchor:If,$id:Cf,$schema:Of,$vocabulary:Pf,default:O$,properties:jf,title:Nf,type:Tf},P$=nt(C$),Lf="https://json-schema.org/draft/2020-12/sche\
|
|
779
|
+
ma",kf="https://json-schema.org/draft/2020-12/meta/core",Df={"https://json-schema.org/draft/2020-12/vocab/core":!0},xf="meta",Mf="Core vocabulary meta-schema",qf=["object","boolean"],Uf={$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:{
|
|
780
|
+
type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},Hf={anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}},I$={$schema:Lf,$id:kf,$vocabulary:Df,$dynamicAnchor:xf,title:Mf,type:qf,properties:Uf,$defs:Hf},N$={__proto__:null,$defs:Hf,$dynamicAnchor:xf,$id:kf,
|
|
781
|
+
$schema:Lf,$vocabulary:Df,default:I$,properties:Uf,title:Mf,type:qf},T$=nt(N$),Ff="https://json-schema.org/draft/2020-12/schema",Vf="https://json-schema.org/draft/2020-12/meta/format-annotation",zf={"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},Gf="meta",Bf="Format vocabulary meta-schema for annotation results",Wf=["object","boolean"],Kf={format:{type:"string"}},j$={$schema:Ff,$id:Vf,$vocabulary:zf,$dynamicAnchor:Gf,title:Bf,type:Wf,properties:Kf},L$={__proto__:null,$dynamicAnchor:Gf,
|
|
782
|
+
$id:Vf,$schema:Ff,$vocabulary:zf,default:j$,properties:Kf,title:Bf,type:Wf},k$=nt(L$),Yf="https://json-schema.org/draft/2020-12/schema",Xf="https://json-schema.org/draft/2020-12/meta/meta-data",Jf={"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},Qf="meta",Zf="Meta-data vocabulary meta-schema",ed=["object","boolean"],td={title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},
|
|
783
|
+
examples:{type:"array",items:!0}},D$={$schema:Yf,$id:Xf,$vocabulary:Jf,$dynamicAnchor:Qf,title:Zf,type:ed,properties:td},x$={__proto__:null,$dynamicAnchor:Qf,$id:Xf,$schema:Yf,$vocabulary:Jf,default:D$,properties:td,title:Zf,type:ed},M$=nt(x$),rd="https://json-schema.org/draft/2020-12/schema",nd="https://json-schema.org/draft/2020-12/meta/validation",sd={"https://json-schema.org/draft/2020-12/vocab/validation":!0},id="meta",od="Validation vocabulary meta-schema",ad=["object","boolean"],cd={type:{
|
|
785
784
|
anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{
|
|
786
|
-
$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},
|
|
787
|
-
#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},
|
|
788
|
-
dule",{value:!0});const
|
|
789
|
-
o="https://json-schema.org/draft/2020-12/schema";class a extends
|
|
790
|
-
(this.getSchema(o)?o:void 0)}}e.Ajv2020=a,
|
|
791
|
-
e,"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}});var u=bn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return u.default}});var f=Lr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return f.default}})}(pn,pn.exports)),pn.exports}var
|
|
792
|
-
return
|
|
785
|
+
$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},ud={nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"\
|
|
786
|
+
#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},q$={$schema:rd,$id:nd,$vocabulary:sd,$dynamicAnchor:id,title:od,type:ad,properties:cd,$defs:ud},U$={__proto__:null,$defs:ud,$dynamicAnchor:id,$id:nd,$schema:rd,$vocabulary:sd,default:q$,properties:cd,title:od,type:ad},H$=nt(U$);var ld;function F$(){if(ld)return ps;ld=1,Object.defineProperty(ps,"__esMo\
|
|
787
|
+
dule",{value:!0});const r=v$,e=E$,t=A$,n=P$,s=T$,i=k$,o=M$,a=H$,c=["/properties"];function l(u){return[r,e,t,n,s,f(this,i),o,f(this,a)].forEach(h=>this.addMetaSchema(h,void 0,!1)),this;function f(h,$){return u?h.$dataMetaSchema($,c):$}}return ps.default=l,ps}var fd;function V$(){return fd||(fd=1,function(r,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.Ajv2020=void 0;const t=Wu(),n=g$(),s=tf(),i=F$(),
|
|
788
|
+
o="https://json-schema.org/draft/2020-12/schema";class a extends t.default{constructor($={}){super({...$,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),n.default.forEach($=>this.addVocabulary($)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:$,meta:b}=this.opts;b&&(i.default.call(this,$),this.refs["http://json-schema.org/schema"]=o)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||
|
|
789
|
+
(this.getSchema(o)?o:void 0)}}e.Ajv2020=a,r.exports=e=a,r.exports.Ajv2020=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var c=jr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var l=pe();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return l._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(
|
|
790
|
+
e,"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}});var u=bn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return u.default}});var f=Lr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return f.default}})}(pn,pn.exports)),pn.exports}var z$=V$(),ms={exports:{}},eo={},dd;function G$(){
|
|
791
|
+
return dd||(dd=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.formatNames=r.fastFormats=r.fullFormats=void 0;function e(k,M){return{validate:k,compare:M}}r.fullFormats={date:e(i,o),time:e(c(!0),l),"date-time":e(h(!0),$),"iso-time":e(c(),u),"iso-date-time":e(h(),b),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:g,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,
|
|
793
792
|
"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,
|
|
794
793
|
email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,
|
|
795
|
-
regex:
|
|
794
|
+
regex:W,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:w},int64:{type:"number",validate:S},float:{type:"number",validate:I},double:{type:"number",validate:I},password:!0,binary:!0},r.fastFormats={...r.fullFormats,date:e(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,
|
|
796
795
|
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,$),"iso-time":e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"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,b),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
|
|
797
|
-
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},
|
|
798
|
-
function c(
|
|
799
|
-
j[1]+j[2]+j[3],M=
|
|
800
|
-
function g(
|
|
801
|
-
ys,"__esModule",{value:!0});const
|
|
802
|
-
simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}
|
|
796
|
+
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},r.formatNames=Object.keys(r.fullFormats);function t(k){return k%4===0&&(k%100!==0||k%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,s=[0,31,28,31,30,31,30,31,31,30,31,30,31];function i(k){const M=n.exec(k);if(!M)return!1;const j=+M[1],D=+M[2],U=+M[3];return D>=1&&D<=12&&U>=1&&U<=(D===2&&t(j)?29:s[D])}function o(k,M){if(k&&M)return k>M?1:k<M?-1:0}const a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;
|
|
797
|
+
function c(k){return function(j){const D=a.exec(j);if(!D)return!1;const U=+D[1],Y=+D[2],G=+D[3],J=D[4],se=D[5]==="-"?-1:1,H=+(D[6]||0),A=+(D[7]||0);if(H>23||A>59||k&&!J)return!1;if(U<=23&&Y<=59&&G<60)return!0;const V=Y-A*se,x=U-H*se-(V<0?1:0);return(x===23||x===-1)&&(V===59||V===-1)&&G<61}}function l(k,M){if(!(k&&M))return;const j=new Date("2020-01-01T"+k).valueOf(),D=new Date("2020-01-01T"+M).valueOf();if(j&&D)return j-D}function u(k,M){if(!(k&&M))return;const j=a.exec(k),D=a.exec(M);if(j&&D)return k=
|
|
798
|
+
j[1]+j[2]+j[3],M=D[1]+D[2]+D[3],k>M?1:k<M?-1:0}const f=/t|\s/i;function h(k){const M=c(k);return function(D){const U=D.split(f);return U.length===2&&i(U[0])&&M(U[1])}}function $(k,M){if(!(k&&M))return;const j=new Date(k).valueOf(),D=new Date(M).valueOf();if(j&&D)return j-D}function b(k,M){if(!(k&&M))return;const[j,D]=k.split(f),[U,Y]=M.split(f),G=o(j,U);if(G!==void 0)return G||l(D,Y)}const y=/\/|:/,d=/^(?:[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;
|
|
799
|
+
function g(k){return y.test(k)&&d.test(k)}const p=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function m(k){return p.lastIndex=0,p.test(k)}const _=-2147483648,v=2**31-1;function w(k){return Number.isInteger(k)&&k<=v&&k>=_}function S(k){return Number.isInteger(k)}function I(){return!0}const F=/[^\\]\\Z/;function W(k){if(F.test(k))return!1;try{return new RegExp(k),!0}catch{return!1}}}(eo)),eo}var to={},gs={exports:{}},ys={},hd;function B$(){if(hd)return ys;hd=1,Object.defineProperty(
|
|
800
|
+
ys,"__esModule",{value:!0});const r=Ju(),e=fl(),t=Tl(),n=Yl(),s=Jl(),i=[r.default,e.default,(0,t.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];return ys.default=i,ys}const pd="http://json-schema.org/draft-07/schema#",md="http://json-schema.org/draft-07/schema#",gd="Core schema meta-schema",yd={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},
|
|
801
|
+
simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},$d=["object","boolean"],_d={$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},
|
|
803
802
|
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\
|
|
804
803
|
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:"\
|
|
805
804
|
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\
|
|
806
|
-
initions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},
|
|
807
|
-
i=
|
|
808
|
-
(this.getSchema(a)?a:void 0)}}e.Ajv=c,
|
|
809
|
-
"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var f=bn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return f.default}});var h=Lr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return h.default}})}(gs,gs.exports)),gs.exports}var
|
|
810
|
-
defineProperty(
|
|
811
|
-
{keyword:Object.keys(s),type:"string",schemaType:"string",$data:!0,error:i,code(a){const{gen:c,data:l,schemaCode:u,keyword:f,it:h}=a,{opts:$,self:b}=h;if(!$.validateFormats)return;const y=new e.KeywordCxt(h,b.RULES.all.format.definition,"format");y.$data?d():g();function d(){const m=c.scopeValue("formats",{ref:b.formats,code:$.code.formats}),_=c.const("fmt",(0,
|
|
812
|
-
p(_)))}function g(){const m=y.schema,_=b.formats[m];if(!_||_===!0)return;if(typeof _!="object"||_ instanceof RegExp||typeof _.compare!="function")throw new Error(`"${f}": format "${m}" does not define "compare" function`);const v=c.scopeValue("formats",{key:m,ref:_,code:$.code.formats?(0,
|
|
813
|
-
a);
|
|
814
|
-
throw new Error(`Unknown format "${l}"`);return h};function c(l,u,f,h){var $,b;($=(b=l.opts.code).formats)!==null&&$!==void 0||(b.formats=(0,s._)`require("ajv-formats/dist/formats").${h}`);for(const y of u)l.addFormat(y,f[y])}
|
|
815
|
-
e,
|
|
816
|
-
${e}`,
|
|
817
|
-
e,s,
|
|
818
|
-
void 0),i&&(c=
|
|
819
|
-
MAX_SAFE_BUILD_LENGTH:s,MAX_SAFE_INTEGER:
|
|
820
|
-
MAX_LENGTH:s}=_s(),i=vs();e=
|
|
805
|
+
initions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},W$={$schema:pd,$id:md,title:gd,definitions:yd,type:$d,properties:_d,default:!0},K$={__proto__:null,$id:md,$schema:pd,default:W$,definitions:yd,properties:_d,title:gd,type:$d},Y$=nt(K$);var vd;function X$(){return vd||(vd=1,function(r,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 t=Wu(),n=B$(),s=tf(),
|
|
806
|
+
i=Y$,o=["/properties"],a="http://json-schema.org/draft-07/schema";class c extends t.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(b=>this.addVocabulary(b)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const b=this.opts.$data?this.$dataMetaSchema(i,o):i;this.addMetaSchema(b,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||
|
|
807
|
+
(this.getSchema(a)?a:void 0)}}e.Ajv=c,r.exports=e=c,r.exports.Ajv=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var l=jr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var u=pe();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,
|
|
808
|
+
"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var f=bn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return f.default}});var h=Lr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return h.default}})}(gs,gs.exports)),gs.exports}var bd;function J$(){return bd||(bd=1,function(r){Object.
|
|
809
|
+
defineProperty(r,"__esModule",{value:!0}),r.formatLimitDefinition=void 0;const e=X$(),t=pe(),n=t.operators,s={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},i={message:({keyword:a,schemaCode:c})=>(0,t.str)`should be ${s[a].okStr} ${c}`,params:({keyword:a,schemaCode:c})=>(0,t._)`{comparison: ${s[a].okStr}, limit: ${c}}`};r.formatLimitDefinition=
|
|
810
|
+
{keyword:Object.keys(s),type:"string",schemaType:"string",$data:!0,error:i,code(a){const{gen:c,data:l,schemaCode:u,keyword:f,it:h}=a,{opts:$,self:b}=h;if(!$.validateFormats)return;const y=new e.KeywordCxt(h,b.RULES.all.format.definition,"format");y.$data?d():g();function d(){const m=c.scopeValue("formats",{ref:b.formats,code:$.code.formats}),_=c.const("fmt",(0,t._)`${m}[${y.schemaCode}]`);a.fail$data((0,t.or)((0,t._)`typeof ${_} != "object"`,(0,t._)`${_} instanceof RegExp`,(0,t._)`typeof ${_}.compare != "function"`,
|
|
811
|
+
p(_)))}function g(){const m=y.schema,_=b.formats[m];if(!_||_===!0)return;if(typeof _!="object"||_ instanceof RegExp||typeof _.compare!="function")throw new Error(`"${f}": format "${m}" does not define "compare" function`);const v=c.scopeValue("formats",{key:m,ref:_,code:$.code.formats?(0,t._)`${$.code.formats}${(0,t.getProperty)(m)}`:void 0});a.fail$data(p(v))}function p(m){return(0,t._)`${m}.compare(${l}, ${u}) ${s[f].fail} 0`}},dependencies:["format"]};const o=a=>(a.addKeyword(r.formatLimitDefinition),
|
|
812
|
+
a);r.default=o}(to)),to}var wd;function Q$(){return wd||(wd=1,function(r,e){Object.defineProperty(e,"__esModule",{value:!0});const t=G$(),n=J$(),s=pe(),i=new s.Name("fullFormats"),o=new s.Name("fastFormats"),a=(l,u={keywords:!0})=>{if(Array.isArray(u))return c(l,u,t.fullFormats,i),l;const[f,h]=u.mode==="fast"?[t.fastFormats,o]:[t.fullFormats,i],$=u.formats||t.formatNames;return c(l,$,f,h),u.keywords&&(0,n.default)(l),l};a.get=(l,u="full")=>{const h=(u==="fast"?t.fastFormats:t.fullFormats)[l];if(!h)
|
|
813
|
+
throw new Error(`Unknown format "${l}"`);return h};function c(l,u,f,h){var $,b;($=(b=l.opts.code).formats)!==null&&$!==void 0||(b.formats=(0,s._)`require("ajv-formats/dist/formats").${h}`);for(const y of u)l.addFormat(y,f[y])}r.exports=e=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a}(ms,ms.exports)),ms.exports}var Z$=Q$();const e0=Cs(Z$),t0=(r,e,t,n)=>{if(t==="length"||t==="prototype"||t==="arguments"||t==="caller")return;const s=Object.getOwnPropertyDescriptor(r,t),i=Object.getOwnPropertyDescriptor(
|
|
814
|
+
e,t);!r0(s,i)&&n||Object.defineProperty(r,t,i)},r0=function(r,e){return r===void 0||r.configurable||r.writable===e.writable&&r.enumerable===e.enumerable&&r.configurable===e.configurable&&(r.writable||r.value===e.value)},n0=(r,e)=>{const t=Object.getPrototypeOf(e);t!==Object.getPrototypeOf(r)&&Object.setPrototypeOf(r,t)},s0=(r,e)=>`/* Wrapped ${r}*/
|
|
815
|
+
${e}`,i0=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),o0=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),a0=(r,e,t)=>{const n=t===""?"":`with ${t.trim()}() `,s=s0.bind(null,n,e.toString());Object.defineProperty(s,"name",o0);const{writable:i,enumerable:o,configurable:a}=i0;Object.defineProperty(r,"toString",{value:s,writable:i,enumerable:o,configurable:a})};function c0(r,e,{ignoreNonConfigurable:t=!1}={}){const{name:n}=r;for(const s of Reflect.ownKeys(e))t0(r,
|
|
816
|
+
e,s,t);return n0(r,e),a0(r,e,n),r}const Ed=(r,e={})=>{if(typeof r!="function")throw new TypeError(`Expected the first argument to be a function, got \`${typeof r}\``);const{wait:t=0,maxWait:n=Number.POSITIVE_INFINITY,before:s=!1,after:i=!0}=e;if(t<0||n<0)throw new RangeError("`wait` and `maxWait` must not be negative.");if(!s&&!i)throw new Error("Both `before` and `after` are false, function wouldn't be called.");let o,a,c;const l=function(...u){const f=this,h=()=>{o=void 0,a&&(clearTimeout(a),a=
|
|
817
|
+
void 0),i&&(c=r.apply(f,u))},$=()=>{a=void 0,o&&(clearTimeout(o),o=void 0),i&&(c=r.apply(f,u))},b=s&&!o;return clearTimeout(o),o=setTimeout(h,t),n>0&&n!==Number.POSITIVE_INFINITY&&!a&&(a=setTimeout($,n)),b&&(c=r.apply(f,u)),c};return c0(l,r),l.cancel=()=>{o&&(clearTimeout(o),o=void 0),a&&(clearTimeout(a),a=void 0)},l};var $s={exports:{}},ro,Sd;function _s(){if(Sd)return ro;Sd=1;const r="2.0.0",e=256,t=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,s=e-6;return ro={MAX_LENGTH:e,MAX_SAFE_COMPONENT_LENGTH:n,
|
|
818
|
+
MAX_SAFE_BUILD_LENGTH:s,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:r,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},ro}var no,Rd;function vs(){return Rd||(Rd=1,no=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}),no}var Ad;function xr(){return Ad||(Ad=1,function(r,e){const{MAX_SAFE_COMPONENT_LENGTH:t,MAX_SAFE_BUILD_LENGTH:n,
|
|
819
|
+
MAX_LENGTH:s}=_s(),i=vs();e=r.exports={};const o=e.re=[],a=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={};let f=0;const h="[a-zA-Z0-9-]",$=[["\\s",1],["\\d",s],[h,n]],b=d=>{for(const[g,p]of $)d=d.split(`${g}*`).join(`${g}{0,${p}}`).split(`${g}+`).join(`${g}{1,${p}}`);return d},y=(d,g,p)=>{const m=b(g),_=f++;i(d,_,g),u[d]=_,c[_]=g,l[_]=m,o[_]=new RegExp(g,p?"g":void 0),a[_]=new RegExp(m,p?"g":void 0)};y("NUMERICIDENTIFIER","0|[1-9]\\d*"),y("NUMERICIDENTIFIERLOOSE","\\d+"),y("NONNUMERICIDENTIFIER",
|
|
821
820
|
`\\d*[a-zA-Z-]${h}*`),y("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),y("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),y("PRERELEASEIDENTIFIER",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),y("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),y("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.
|
|
822
821
|
PRERELEASEIDENTIFIER]})*))`),y("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),y("BUILDIDENTIFIER",`${h}+`),y("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),y("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),y("FULL",`^${c[u.FULLPLAIN]}$`),y("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),y("LOOSE",`^${c[u.LOOSEPLAIN]}$`),y("GTLT","((?:<|>)?=?)"),y("XRAN\
|
|
823
822
|
GEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),y("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),y("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),y("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),y("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}\
|
|
824
|
-
$`),y("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),y("COERCEPLAIN",`(^|[^\\d])(\\d{1,${
|
|
823
|
+
$`),y("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),y("COERCEPLAIN",`(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`),y("COERCE",`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),y("COERCEFULL",c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),y("COERCERTL",c[u.COERCE],!0),y("COERCERTLFULL",c[u.COERCEFULL],!0),y("LONETILDE","(?:~>?)"),y("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",y("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}\
|
|
825
824
|
$`),y("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),y("LONECARET","(?:\\^)"),y("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",y("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),y("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),y("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),y("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),y("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=
|
|
826
|
-
"$1$2$3",y("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),y("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),y("STAR","(<|>)?=?\\s*\\*"),y("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),y("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}($s,$s.exports)),$s.exports}var
|
|
827
|
-
|
|
828
|
-
"string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>e)throw new TypeError(`version is longer than ${e} characters`);
|
|
829
|
-
on");if(this.minor>
|
|
830
|
-
return this.version}compare(l){if(
|
|
831
|
-
prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;let u=0;do{const f=this.prerelease[u],h=l.prerelease[u];if(
|
|
825
|
+
"$1$2$3",y("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),y("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),y("STAR","(<|>)?=?\\s*\\*"),y("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),y("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}($s,$s.exports)),$s.exports}var so,Od;function io(){if(Od)return so;Od=1;const r=Object.freeze({loose:!0}),e=Object.freeze({});return so=n=>n?typeof n!="object"?r:n:e,so}var oo,Cd;function Pd(){if(Cd)return oo;
|
|
826
|
+
Cd=1;const r=/^[0-9]+$/,e=(n,s)=>{const i=r.test(n),o=r.test(s);return i&&o&&(n=+n,s=+s),n===s?0:i&&!o?-1:o&&!i?1:n<s?-1:1};return oo={compareIdentifiers:e,rcompareIdentifiers:(n,s)=>e(s,n)},oo}var ao,Id;function Le(){if(Id)return ao;Id=1;const r=vs(),{MAX_LENGTH:e,MAX_SAFE_INTEGER:t}=_s(),{safeRe:n,t:s}=xr(),i=io(),{compareIdentifiers:o}=Pd();class a{constructor(l,u){if(u=i(u),l instanceof a){if(l.loose===!!u.loose&&l.includePrerelease===!!u.includePrerelease)return l;l=l.version}else if(typeof l!=
|
|
827
|
+
"string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>e)throw new TypeError(`version is longer than ${e} characters`);r("SemVer",l,u),this.options=u,this.loose=!!u.loose,this.includePrerelease=!!u.includePrerelease;const f=l.trim().match(u.loose?n[s.LOOSE]:n[s.FULL]);if(!f)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>t||this.major<0)throw new TypeError("Invalid major versi\
|
|
828
|
+
on");if(this.minor>t||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>t||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(h=>{if(/^[0-9]+$/.test(h)){const $=+h;if($>=0&&$<t)return $}return h}):this.prerelease=[],this.build=f[5]?f[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){
|
|
829
|
+
return this.version}compare(l){if(r("SemVer.compare",this.version,this.options,l),!(l instanceof a)){if(typeof l=="string"&&l===this.version)return 0;l=new a(l,this.options)}return l.version===this.version?0:this.compareMain(l)||this.comparePre(l)}compareMain(l){return l instanceof a||(l=new a(l,this.options)),o(this.major,l.major)||o(this.minor,l.minor)||o(this.patch,l.patch)}comparePre(l){if(l instanceof a||(l=new a(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.
|
|
830
|
+
prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;let u=0;do{const f=this.prerelease[u],h=l.prerelease[u];if(r("prerelease compare",u,f,h),f===void 0&&h===void 0)return 0;if(h===void 0)return 1;if(f===void 0)return-1;if(f===h)continue;return o(f,h)}while(++u)}compareBuild(l){l instanceof a||(l=new a(l,this.options));let u=0;do{const f=this.build[u],h=l.build[u];if(r("build compare",u,f,h),f===void 0&&h===void 0)return 0;if(h===void 0)return 1;
|
|
832
831
|
if(f===void 0)return-1;if(f===h)continue;return o(f,h)}while(++u)}inc(l,u,f){if(l.startsWith("pre")){if(!u&&f===!1)throw new Error("invalid increment argument: identifier is empty");if(u){const h=`-${u}`.match(this.options.loose?n[s.PRERELEASELOOSE]:n[s.PRERELEASE]);if(!h||h[1]!==u)throw new Error(`invalid identifier: ${u}`)}}switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",u,f);break;case"preminor":this.prerelease.length=0,this.patch=0,this.
|
|
833
832
|
minor++,this.inc("pre",u,f);break;case"prepatch":this.prerelease.length=0,this.inc("patch",u,f),this.inc("pre",u,f);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",u,f),this.inc("pre",u,f);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.
|
|
834
833
|
patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const h=Number(f)?1:0;if(this.prerelease.length===0)this.prerelease=[h];else{let $=this.prerelease.length;for(;--$>=0;)typeof this.prerelease[$]=="number"&&(this.prerelease[$]++,$=-2);if($===-1){if(u===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.
|
|
835
|
-
push(h)}}if(u){let $=[u,h];f===!1&&($=[u]),o(this.prerelease[0],u)===0?isNaN(this.prerelease[1])&&(this.prerelease=$):this.prerelease=$}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return
|
|
836
|
-
if(
|
|
837
|
-
return
|
|
838
|
-
|
|
839
|
-
(
|
|
840
|
-
|
|
841
|
-
n,s)<=0,
|
|
842
|
-
`Invalid operator: ${c}`)}},
|
|
843
|
-
b),$.lastIndex=b.index+b[1].length+b[2].length;$.lastIndex=-1}if(a===null)return null;const c=a[2],l=a[3]||"0",u=a[4]||"0",f=o.includePrerelease&&a[5]?`-${a[5]}`:"",h=o.includePrerelease&&a[6]?`+${a[6]}`:"";return e(`${c}.${l}.${u}${f}${h}`,o)},ko}var
|
|
844
|
-
n!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(
|
|
845
|
-
this.raw=U.trim().replace(
|
|
834
|
+
push(h)}}if(u){let $=[u,h];f===!1&&($=[u]),o(this.prerelease[0],u)===0?isNaN(this.prerelease[1])&&(this.prerelease=$):this.prerelease=$}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return ao=a,ao}var co,Nd;function ar(){if(Nd)return co;Nd=1;const r=Le();return co=(t,n,s=!1)=>{if(t instanceof r)return t;try{return new r(t,n)}catch(i){if(!s)return null;throw i}},co}var uo,Td;function u0(){
|
|
835
|
+
if(Td)return uo;Td=1;const r=ar();return uo=(t,n)=>{const s=r(t,n);return s?s.version:null},uo}var lo,jd;function l0(){if(jd)return lo;jd=1;const r=ar();return lo=(t,n)=>{const s=r(t.trim().replace(/^[=v]+/,""),n);return s?s.version:null},lo}var fo,Ld;function f0(){if(Ld)return fo;Ld=1;const r=Le();return fo=(t,n,s,i,o)=>{typeof s=="string"&&(o=i,i=s,s=void 0);try{return new r(t instanceof r?t.version:t,s).inc(n,i,o).version}catch{return null}},fo}var ho,kd;function d0(){if(kd)return ho;kd=1;const r=ar();
|
|
836
|
+
return ho=(t,n)=>{const s=r(t,null,!0),i=r(n,null,!0),o=s.compare(i);if(o===0)return null;const a=o>0,c=a?s:i,l=a?i:s,u=!!c.prerelease.length;if(!!l.prerelease.length&&!u){if(!l.patch&&!l.minor)return"major";if(l.compareMain(c)===0)return l.minor&&!l.patch?"minor":"patch"}const h=u?"pre":"";return s.major!==i.major?h+"major":s.minor!==i.minor?h+"minor":s.patch!==i.patch?h+"patch":"prerelease"},ho}var po,Dd;function h0(){if(Dd)return po;Dd=1;const r=Le();return po=(t,n)=>new r(t,n).major,po}var mo,
|
|
837
|
+
xd;function p0(){if(xd)return mo;xd=1;const r=Le();return mo=(t,n)=>new r(t,n).minor,mo}var go,Md;function m0(){if(Md)return go;Md=1;const r=Le();return go=(t,n)=>new r(t,n).patch,go}var yo,qd;function g0(){if(qd)return yo;qd=1;const r=ar();return yo=(t,n)=>{const s=r(t,n);return s&&s.prerelease.length?s.prerelease:null},yo}var $o,Ud;function tt(){if(Ud)return $o;Ud=1;const r=Le();return $o=(t,n,s)=>new r(t,s).compare(new r(n,s)),$o}var _o,Hd;function y0(){if(Hd)return _o;Hd=1;const r=tt();return _o=
|
|
838
|
+
(t,n,s)=>r(n,t,s),_o}var vo,Fd;function $0(){if(Fd)return vo;Fd=1;const r=tt();return vo=(t,n)=>r(t,n,!0),vo}var bo,Vd;function wo(){if(Vd)return bo;Vd=1;const r=Le();return bo=(t,n,s)=>{const i=new r(t,s),o=new r(n,s);return i.compare(o)||i.compareBuild(o)},bo}var Eo,zd;function _0(){if(zd)return Eo;zd=1;const r=wo();return Eo=(t,n)=>t.sort((s,i)=>r(s,i,n)),Eo}var So,Gd;function v0(){if(Gd)return So;Gd=1;const r=wo();return So=(t,n)=>t.sort((s,i)=>r(i,s,n)),So}var Ro,Bd;function bs(){if(Bd)return Ro;
|
|
839
|
+
Bd=1;const r=tt();return Ro=(t,n,s)=>r(t,n,s)>0,Ro}var Ao,Wd;function Oo(){if(Wd)return Ao;Wd=1;const r=tt();return Ao=(t,n,s)=>r(t,n,s)<0,Ao}var Co,Kd;function Yd(){if(Kd)return Co;Kd=1;const r=tt();return Co=(t,n,s)=>r(t,n,s)===0,Co}var Po,Xd;function Jd(){if(Xd)return Po;Xd=1;const r=tt();return Po=(t,n,s)=>r(t,n,s)!==0,Po}var Io,Qd;function No(){if(Qd)return Io;Qd=1;const r=tt();return Io=(t,n,s)=>r(t,n,s)>=0,Io}var To,Zd;function jo(){if(Zd)return To;Zd=1;const r=tt();return To=(t,n,s)=>r(t,
|
|
840
|
+
n,s)<=0,To}var Lo,eh;function th(){if(eh)return Lo;eh=1;const r=Yd(),e=Jd(),t=bs(),n=No(),s=Oo(),i=jo();return Lo=(a,c,l,u)=>{switch(c){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 r(a,l,u);case"!=":return e(a,l,u);case">":return t(a,l,u);case">=":return n(a,l,u);case"<":return s(a,l,u);case"<=":return i(a,l,u);default:throw new TypeError(
|
|
841
|
+
`Invalid operator: ${c}`)}},Lo}var ko,rh;function b0(){if(rh)return ko;rh=1;const r=Le(),e=ar(),{safeRe:t,t:n}=xr();return ko=(i,o)=>{if(i instanceof r)return i;if(typeof i=="number"&&(i=String(i)),typeof i!="string")return null;o=o||{};let a=null;if(!o.rtl)a=i.match(o.includePrerelease?t[n.COERCEFULL]:t[n.COERCE]);else{const $=o.includePrerelease?t[n.COERCERTLFULL]:t[n.COERCERTL];let b;for(;(b=$.exec(i))&&(!a||a.index+a[0].length!==i.length);)(!a||b.index+b[0].length!==a.index+a[0].length)&&(a=
|
|
842
|
+
b),$.lastIndex=b.index+b[1].length+b[2].length;$.lastIndex=-1}if(a===null)return null;const c=a[2],l=a[3]||"0",u=a[4]||"0",f=o.includePrerelease&&a[5]?`-${a[5]}`:"",h=o.includePrerelease&&a[6]?`+${a[6]}`:"";return e(`${c}.${l}.${u}${f}${h}`,o)},ko}var Do,nh;function w0(){if(nh)return Do;nh=1;class r{constructor(){this.max=1e3,this.map=new Map}get(t){const n=this.map.get(t);if(n!==void 0)return this.map.delete(t),this.map.set(t,n),n}delete(t){return this.map.delete(t)}set(t,n){if(!this.delete(t)&&
|
|
843
|
+
n!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(t,n)}return this}}return Do=r,Do}var xo,sh;function rt(){if(sh)return xo;sh=1;const r=/\s+/g;class e{constructor(U,Y){if(Y=s(Y),U instanceof e)return U.loose===!!Y.loose&&U.includePrerelease===!!Y.includePrerelease?U:new e(U.raw,Y);if(U instanceof i)return this.raw=U.value,this.set=[[U]],this.formatted=void 0,this;if(this.options=Y,this.loose=!!Y.loose,this.includePrerelease=!!Y.includePrerelease,
|
|
844
|
+
this.raw=U.trim().replace(r," "),this.set=this.raw.split("||").map(G=>this.parseRange(G.trim())).filter(G=>G.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const G=this.set[0];if(this.set=this.set.filter(J=>!y(J[0])),this.set.length===0)this.set=[G];else if(this.set.length>1){for(const J of this.set)if(J.length===1&&d(J[0])){this.set=[J];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let U=0;U<this.
|
|
846
845
|
set.length;U++){U>0&&(this.formatted+="||");const Y=this.set[U];for(let G=0;G<Y.length;G++)G>0&&(this.formatted+=" "),this.formatted+=Y[G].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(U){const G=((this.options.includePrerelease&&$)|(this.options.loose&&b))+":"+U,J=n.get(G);if(J)return J;const se=this.options.loose,H=se?c[l.HYPHENRANGELOOSE]:c[l.HYPHENRANGE];U=U.replace(H,M(this.options.includePrerelease)),o("hyphen replace",U),U=U.replace(
|
|
847
|
-
c[l.COMPARATORTRIM],u),o("comparator trim",U),U=U.replace(c[l.TILDETRIM],f),o("tilde trim",U),U=U.replace(c[l.CARETTRIM],h),o("caret trim",U);let A=U.split(" ").map(R=>p(R,this.options)).join(" ").split(/\s+/).map(R=>
|
|
848
|
-
values()];return n.set(G,E),E}intersects(U,Y){if(!(U instanceof e))throw new TypeError("a Range is required");return this.set.some(G=>g(G,Y)&&U.set.some(J=>g(J,Y)&&G.every(se=>J.every(H=>se.intersects(H,Y)))))}test(U){if(!U)return!1;if(typeof U=="string")try{U=new a(U,this.options)}catch{return!1}for(let Y=0;Y<this.set.length;Y++)if(j(this.set[Y],U,this.options))return!0;return!1}}
|
|
849
|
-
{FLAG_INCLUDE_PRERELEASE:$,FLAG_LOOSE:b}=_s(),y=
|
|
850
|
-
o("tilde",
|
|
846
|
+
c[l.COMPARATORTRIM],u),o("comparator trim",U),U=U.replace(c[l.TILDETRIM],f),o("tilde trim",U),U=U.replace(c[l.CARETTRIM],h),o("caret trim",U);let A=U.split(" ").map(R=>p(R,this.options)).join(" ").split(/\s+/).map(R=>k(R,this.options));se&&(A=A.filter(R=>(o("loose invalid filter",R,this.options),!!R.match(c[l.COMPARATORLOOSE])))),o("range list",A);const V=new Map,x=A.map(R=>new i(R,this.options));for(const R of x){if(y(R))return[R];V.set(R.value,R)}V.size>1&&V.has("")&&V.delete("");const E=[...V.
|
|
847
|
+
values()];return n.set(G,E),E}intersects(U,Y){if(!(U instanceof e))throw new TypeError("a Range is required");return this.set.some(G=>g(G,Y)&&U.set.some(J=>g(J,Y)&&G.every(se=>J.every(H=>se.intersects(H,Y)))))}test(U){if(!U)return!1;if(typeof U=="string")try{U=new a(U,this.options)}catch{return!1}for(let Y=0;Y<this.set.length;Y++)if(j(this.set[Y],U,this.options))return!0;return!1}}xo=e;const t=w0(),n=new t,s=io(),i=ws(),o=vs(),a=Le(),{safeRe:c,t:l,comparatorTrimReplace:u,tildeTrimReplace:f,caretTrimReplace:h}=xr(),
|
|
848
|
+
{FLAG_INCLUDE_PRERELEASE:$,FLAG_LOOSE:b}=_s(),y=D=>D.value==="<0.0.0-0",d=D=>D.value==="",g=(D,U)=>{let Y=!0;const G=D.slice();let J=G.pop();for(;Y&&G.length;)Y=G.every(se=>J.intersects(se,U)),J=G.pop();return Y},p=(D,U)=>(o("comp",D,U),D=w(D,U),o("caret",D),D=_(D,U),o("tildes",D),D=I(D,U),o("xrange",D),D=W(D,U),o("stars",D),D),m=D=>!D||D.toLowerCase()==="x"||D==="*",_=(D,U)=>D.trim().split(/\s+/).map(Y=>v(Y,U)).join(" "),v=(D,U)=>{const Y=U.loose?c[l.TILDELOOSE]:c[l.TILDE];return D.replace(Y,(G,J,se,H,A)=>{
|
|
849
|
+
o("tilde",D,G,J,se,H,A);let V;return m(J)?V="":m(se)?V=`>=${J}.0.0 <${+J+1}.0.0-0`:m(H)?V=`>=${J}.${se}.0 <${J}.${+se+1}.0-0`:A?(o("replaceTilde pr",A),V=`>=${J}.${se}.${H}-${A} <${J}.${+se+1}.0-0`):V=`>=${J}.${se}.${H} <${J}.${+se+1}.0-0`,o("tilde return",V),V})},w=(D,U)=>D.trim().split(/\s+/).map(Y=>S(Y,U)).join(" "),S=(D,U)=>{o("caret",D,U);const Y=U.loose?c[l.CARETLOOSE]:c[l.CARET],G=U.includePrerelease?"-0":"";return D.replace(Y,(J,se,H,A,V)=>{o("caret",D,J,se,H,A,V);let x;return m(se)?x="":
|
|
851
850
|
m(H)?x=`>=${se}.0.0${G} <${+se+1}.0.0-0`:m(A)?se==="0"?x=`>=${se}.${H}.0${G} <${se}.${+H+1}.0-0`:x=`>=${se}.${H}.0${G} <${+se+1}.0.0-0`:V?(o("replaceCaret pr",V),se==="0"?H==="0"?x=`>=${se}.${H}.${A}-${V} <${se}.${H}.${+A+1}-0`:x=`>=${se}.${H}.${A}-${V} <${se}.${+H+1}.0-0`:x=`>=${se}.${H}.${A}-${V} <${+se+1}.0.0-0`):(o("no pr"),se==="0"?H==="0"?x=`>=${se}.${H}.${A}${G} <${se}.${H}.${+A+1}-0`:x=`>=${se}.${H}.${A}${G} <${se}.${+H+1}.0-0`:x=`>=${se}.${H}.${A} <${+se+1}.0.0-0`),o("caret return",x),x})},
|
|
852
|
-
I=(
|
|
853
|
-
0.0${V} <${+se+1}.0.0-0`:R&&(G=`>=${se}.${H}.0${V} <${se}.${+H+1}.0-0`),o("xRange return",G),G})},
|
|
854
|
-
.${E}.${+R+1}-0`:V=`<=${V}`,`${Y} ${V}`.trim()),j=(
|
|
855
|
-
if(f=
|
|
856
|
-
h[2],this.options.loose):this.semver=
|
|
857
|
-
(f=
|
|
858
|
-
f)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}
|
|
859
|
-
let o=null,a=null,c=null;try{c=new e(s,i)}catch{return null}return n.forEach(l=>{c.test(l)&&(!o||a.compare(l)===-1)&&(o=l,a=new
|
|
860
|
-
test(o)||(o=new
|
|
861
|
-
return
|
|
862
|
-
forEach(S=>{S.semver===
|
|
863
|
-
return
|
|
864
|
-
String(n);return u.length<f.length?u:n},
|
|
865
|
-
length===1&&h[0].semver===
|
|
851
|
+
I=(D,U)=>(o("replaceXRanges",D,U),D.split(/\s+/).map(Y=>F(Y,U)).join(" ")),F=(D,U)=>{D=D.trim();const Y=U.loose?c[l.XRANGELOOSE]:c[l.XRANGE];return D.replace(Y,(G,J,se,H,A,V)=>{o("xRange",D,G,J,se,H,A,V);const x=m(se),E=x||m(H),R=E||m(A),C=R;return J==="="&&C&&(J=""),V=U.includePrerelease?"-0":"",x?J===">"||J==="<"?G="<0.0.0-0":G="*":J&&C?(E&&(H=0),A=0,J===">"?(J=">=",E?(se=+se+1,H=0,A=0):(H=+H+1,A=0)):J==="<="&&(J="<",E?se=+se+1:H=+H+1),J==="<"&&(V="-0"),G=`${J+se}.${H}.${A}${V}`):E?G=`>=${se}.\
|
|
852
|
+
0.0${V} <${+se+1}.0.0-0`:R&&(G=`>=${se}.${H}.0${V} <${se}.${+H+1}.0-0`),o("xRange return",G),G})},W=(D,U)=>(o("replaceStars",D,U),D.trim().replace(c[l.STAR],"")),k=(D,U)=>(o("replaceGTE0",D,U),D.trim().replace(c[U.includePrerelease?l.GTE0PRE:l.GTE0],"")),M=D=>(U,Y,G,J,se,H,A,V,x,E,R,C)=>(m(G)?Y="":m(J)?Y=`>=${G}.0.0${D?"-0":""}`:m(se)?Y=`>=${G}.${J}.0${D?"-0":""}`:H?Y=`>=${Y}`:Y=`>=${Y}${D?"-0":""}`,m(x)?V="":m(E)?V=`<${+x+1}.0.0-0`:m(R)?V=`<${x}.${+E+1}.0-0`:C?V=`<=${x}.${E}.${R}-${C}`:D?V=`<${x}\
|
|
853
|
+
.${E}.${+R+1}-0`:V=`<=${V}`,`${Y} ${V}`.trim()),j=(D,U,Y)=>{for(let G=0;G<D.length;G++)if(!D[G].test(U))return!1;if(U.prerelease.length&&!Y.includePrerelease){for(let G=0;G<D.length;G++)if(o(D[G].semver),D[G].semver!==i.ANY&&D[G].semver.prerelease.length>0){const J=D[G].semver;if(J.major===U.major&&J.minor===U.minor&&J.patch===U.patch)return!0}return!1}return!0};return xo}var Mo,ih;function ws(){if(ih)return Mo;ih=1;const r=Symbol("SemVer ANY");class e{static get ANY(){return r}constructor(u,f){
|
|
854
|
+
if(f=t(f),u instanceof e){if(u.loose===!!f.loose)return u;u=u.value}u=u.trim().split(/\s+/).join(" "),o("comparator",u,f),this.options=f,this.loose=!!f.loose,this.parse(u),this.semver===r?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(u){const f=this.options.loose?n[s.COMPARATORLOOSE]:n[s.COMPARATOR],h=u.match(f);if(!h)throw new TypeError(`Invalid comparator: ${u}`);this.operator=h[1]!==void 0?h[1]:"",this.operator==="="&&(this.operator=""),h[2]?this.semver=new a(
|
|
855
|
+
h[2],this.options.loose):this.semver=r}toString(){return this.value}test(u){if(o("Comparator.test",u,this.options.loose),this.semver===r||u===r)return!0;if(typeof u=="string")try{u=new a(u,this.options)}catch{return!1}return i(u,this.operator,this.semver,this.options)}intersects(u,f){if(!(u instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(u.value,f).test(this.value):u.operator===""?u.value===""?!0:new c(this.value,f).test(u.semver):
|
|
856
|
+
(f=t(f),f.includePrerelease&&(this.value==="<0.0.0-0"||u.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||u.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&u.operator.startsWith(">")||this.operator.startsWith("<")&&u.operator.startsWith("<")||this.semver.version===u.semver.version&&this.operator.includes("=")&&u.operator.includes("=")||i(this.semver,"<",u.semver,f)&&this.operator.startsWith(">")&&u.operator.startsWith("<")||i(this.semver,">",u.semver,
|
|
857
|
+
f)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}Mo=e;const t=io(),{safeRe:n,t:s}=xr(),i=th(),o=vs(),a=Le(),c=rt();return Mo}var qo,oh;function Es(){if(oh)return qo;oh=1;const r=rt();return qo=(t,n,s)=>{try{n=new r(n,s)}catch{return!1}return n.test(t)},qo}var Uo,ah;function E0(){if(ah)return Uo;ah=1;const r=rt();return Uo=(t,n)=>new r(t,n).set.map(s=>s.map(i=>i.value).join(" ").trim().split(" ")),Uo}var Ho,ch;function S0(){if(ch)return Ho;ch=1;const r=Le(),e=rt();return Ho=(n,s,i)=>{
|
|
858
|
+
let o=null,a=null,c=null;try{c=new e(s,i)}catch{return null}return n.forEach(l=>{c.test(l)&&(!o||a.compare(l)===-1)&&(o=l,a=new r(o,i))}),o},Ho}var Fo,uh;function R0(){if(uh)return Fo;uh=1;const r=Le(),e=rt();return Fo=(n,s,i)=>{let o=null,a=null,c=null;try{c=new e(s,i)}catch{return null}return n.forEach(l=>{c.test(l)&&(!o||a.compare(l)===1)&&(o=l,a=new r(o,i))}),o},Fo}var Vo,lh;function A0(){if(lh)return Vo;lh=1;const r=Le(),e=rt(),t=bs();return Vo=(s,i)=>{s=new e(s,i);let o=new r("0.0.0");if(s.
|
|
859
|
+
test(o)||(o=new r("0.0.0-0"),s.test(o)))return o;o=null;for(let a=0;a<s.set.length;++a){const c=s.set[a];let l=null;c.forEach(u=>{const f=new r(u.semver.version);switch(u.operator){case">":f.prerelease.length===0?f.patch++:f.prerelease.push(0),f.raw=f.format();case"":case">=":(!l||t(f,l))&&(l=f);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${u.operator}`)}}),l&&(!o||t(o,l))&&(o=l)}return o&&s.test(o)?o:null},Vo}var zo,fh;function O0(){if(fh)return zo;fh=1;const r=rt();
|
|
860
|
+
return zo=(t,n)=>{try{return new r(t,n).range||"*"}catch{return null}},zo}var Go,dh;function Bo(){if(dh)return Go;dh=1;const r=Le(),e=ws(),{ANY:t}=e,n=rt(),s=Es(),i=bs(),o=Oo(),a=jo(),c=No();return Go=(u,f,h,$)=>{u=new r(u,$),f=new n(f,$);let b,y,d,g,p;switch(h){case">":b=i,y=a,d=o,g=">",p=">=";break;case"<":b=o,y=c,d=i,g="<",p="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(u,f,$))return!1;for(let m=0;m<f.set.length;++m){const _=f.set[m];let v=null,w=null;if(_.
|
|
861
|
+
forEach(S=>{S.semver===t&&(S=new e(">=0.0.0")),v=v||S,w=w||S,b(S.semver,v.semver,$)?v=S:d(S.semver,w.semver,$)&&(w=S)}),v.operator===g||v.operator===p||(!w.operator||w.operator===g)&&y(u,w.semver))return!1;if(w.operator===p&&d(u,w.semver))return!1}return!0},Go}var Wo,hh;function C0(){if(hh)return Wo;hh=1;const r=Bo();return Wo=(t,n,s)=>r(t,n,">",s),Wo}var Ko,ph;function P0(){if(ph)return Ko;ph=1;const r=Bo();return Ko=(t,n,s)=>r(t,n,"<",s),Ko}var Yo,mh;function I0(){if(mh)return Yo;mh=1;const r=rt();
|
|
862
|
+
return Yo=(t,n,s)=>(t=new r(t,s),n=new r(n,s),t.intersects(n,s)),Yo}var Xo,gh;function N0(){if(gh)return Xo;gh=1;const r=Es(),e=tt();return Xo=(t,n,s)=>{const i=[];let o=null,a=null;const c=t.sort((h,$)=>e(h,$,s));for(const h of c)r(h,n,s)?(a=h,o||(o=h)):(a&&i.push([o,a]),a=null,o=null);o&&i.push([o,null]);const l=[];for(const[h,$]of i)h===$?l.push(h):!$&&h===c[0]?l.push("*"):$?h===c[0]?l.push(`<=${$}`):l.push(`${h} - ${$}`):l.push(`>=${h}`);const u=l.join(" || "),f=typeof n.raw=="string"?n.raw:
|
|
863
|
+
String(n);return u.length<f.length?u:n},Xo}var Jo,yh;function T0(){if(yh)return Jo;yh=1;const r=rt(),e=ws(),{ANY:t}=e,n=Es(),s=tt(),i=(f,h,$={})=>{if(f===h)return!0;f=new r(f,$),h=new r(h,$);let b=!1;e:for(const y of f.set){for(const d of h.set){const g=c(y,d,$);if(b=b||g!==null,g)continue e}if(b)return!1}return!0},o=[new e(">=0.0.0-0")],a=[new e(">=0.0.0")],c=(f,h,$)=>{if(f===h)return!0;if(f.length===1&&f[0].semver===t){if(h.length===1&&h[0].semver===t)return!0;$.includePrerelease?f=o:f=a}if(h.
|
|
864
|
+
length===1&&h[0].semver===t){if($.includePrerelease)return!0;h=a}const b=new Set;let y,d;for(const I of f)I.operator===">"||I.operator===">="?y=l(y,I,$):I.operator==="<"||I.operator==="<="?d=u(d,I,$):b.add(I.semver);if(b.size>1)return null;let g;if(y&&d){if(g=s(y.semver,d.semver,$),g>0)return null;if(g===0&&(y.operator!==">="||d.operator!=="<="))return null}for(const I of b){if(y&&!n(I,String(y),$)||d&&!n(I,String(d),$))return null;for(const F of h)if(!n(I,String(F),$))return!1;return!0}let p,m,
|
|
866
865
|
_,v,w=d&&!$.includePrerelease&&d.semver.prerelease.length?d.semver:!1,S=y&&!$.includePrerelease&&y.semver.prerelease.length?y.semver:!1;w&&w.prerelease.length===1&&d.operator==="<"&&w.prerelease[0]===0&&(w=!1);for(const I of h){if(v=v||I.operator===">"||I.operator===">=",_=_||I.operator==="<"||I.operator==="<=",y){if(S&&I.semver.prerelease&&I.semver.prerelease.length&&I.semver.major===S.major&&I.semver.minor===S.minor&&I.semver.patch===S.patch&&(S=!1),I.operator===">"||I.operator===">="){if(p=l(
|
|
867
866
|
y,I,$),p===I&&p!==y)return!1}else if(y.operator===">="&&!n(y.semver,String(I),$))return!1}if(d){if(w&&I.semver.prerelease&&I.semver.prerelease.length&&I.semver.major===w.major&&I.semver.minor===w.minor&&I.semver.patch===w.patch&&(w=!1),I.operator==="<"||I.operator==="<="){if(m=u(d,I,$),m===I&&m!==d)return!1}else if(d.operator==="<="&&!n(d.semver,String(I),$))return!1}if(!I.operator&&(d||y)&&g!==0)return!1}return!(y&&_&&!d&&g!==0||d&&v&&!y&&g!==0||S||w)},l=(f,h,$)=>{if(!f)return h;const b=s(f.semver,
|
|
868
|
-
h.semver,$);return b>0?f:b<0||h.operator===">"&&f.operator===">="?h:f},u=(f,h,$)=>{if(!f)return h;const b=s(f.semver,h.semver,$);return b<0?f:b>0||h.operator==="<"&&f.operator==="<="?h:f};return
|
|
869
|
-
H=
|
|
870
|
-
compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},
|
|
871
|
-
`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof
|
|
872
|
-
TextEncoder;function
|
|
873
|
-
const
|
|
874
|
-
...
|
|
875
|
-
store,i=Object.assign(
|
|
876
|
-
type \`string\` or \`object\`, got ${typeof e}`);if(typeof e!="object"&&
|
|
877
|
-
|
|
878
|
-
return this._handleChange(()=>this.get(e),
|
|
879
|
-
if(this.#e.clearInvalidConfig&&e.name==="SyntaxError")return
|
|
880
|
-
o),s.final()]))}catch{}return e.toString()}_handleChange(e,
|
|
881
|
-
"; "))}_ensureDirectory(){he.mkdirSync(me.dirname(this.path),{recursive:!0})}_write(e){let
|
|
882
|
-
throw n}}_watch(){this._ensureDirectory(),he.existsSync(this.path)||this._write(
|
|
883
|
-
toVersion:a,finalVersion:
|
|
884
|
-
return
|
|
885
|
-
${
|
|
886
|
-
ntent-Type")}catch(s){if(s instanceof Error&&s.message==="unsupported BodyInit type")return!1;throw s}return
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
return 0},
|
|
890
|
-
0?0:n/
|
|
891
|
-
s.close();return}n+=c.byteLength;let l=
|
|
892
|
-
entries())n&&o==="undefined"||o===void 0?
|
|
893
|
-
|
|
894
|
-
isArray(
|
|
895
|
-
clearTimeout(i),n(e.reason)}const i=setTimeout(()=>{e?.removeEventListener("abort",s),
|
|
896
|
-
n.request,n._options,n._decorateResponse(a.clone()));l instanceof globalThis.Response&&(a=l)}if(n._decorateResponse(a),!a.ok&&n._options.throwHttpErrors){let c=new
|
|
897
|
-
|
|
898
|
-
text())}return l[a]()};return o}request;abortController;_retryCount=0;_input;_options;constructor(e,
|
|
899
|
-
"string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this.
|
|
900
|
-
new globalThis.AbortController,this._options.signal=n?AbortSignal.any([n,this.abortController.signal]):this.abortController.signal}if(
|
|
901
|
-
?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),i=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,s);(
|
|
902
|
-
_options)}if(this._options.onUploadProgress){if(typeof this._options.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!
|
|
903
|
-
if(e instanceof Ah){if(!this._options.retry.statusCodes.includes(e.response.status))throw e;const n=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(n&&this._options.retry.afterStatusCodes.includes(e.response.status)){let s=Number(n)*1e3;Number.isNaN(s)?s=Date.parse(n)-Date.now():s>=
|
|
904
|
-
i?s:i}if(e.response.status===413)throw e}const
|
|
905
|
-
options:this._options,error:
|
|
906
|
-
r,
|
|
907
|
-
detached:!0,env:{NODE_ENV:
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
dim("total")} ${o} files`)}async function v_(
|
|
911
|
-
{recursive:!0}),o.add(f));const h=ge(
|
|
912
|
-
exitCode=1,new Error("no views found");switch(
|
|
913
|
-
for(const f of o.views())f.$view.hasLayoutDrift&&n.warn(
|
|
914
|
-
t be a .ts, .mts or .cts file`);const u=
|
|
915
|
-
${
|
|
916
|
-
${
|
|
917
|
-
|
|
918
|
-
${
|
|
919
|
-
${
|
|
920
|
-
`).trim(),{padding:2,borderColor:"green",borderStyle:"round"}),s.stopAndLog()}async function w_({languageServices:
|
|
921
|
-
`+
|
|
922
|
-
ct","likec4/model","react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client",/likec4\/icons\/.*/],onwarn(i,o){i.code!=="SOURCEMAP_ERROR"&&o(i)}}},plugins:[xs({}),Ms({languageServices:
|
|
923
|
-
diagrams();if(o.length===0)throw process.exitCode=1,new Error("no views found");o.forEach($=>{$.hasLayoutDrift&&n.warn(
|
|
924
|
-
".mjs",".jsx"].includes(u))throw n.error(`output file ${
|
|
925
|
-
${
|
|
926
|
-
${
|
|
927
|
-
|
|
928
|
-
${
|
|
929
|
-
${
|
|
930
|
-
`),{padding:2,borderColor:"green",borderStyle:"round"}),s.stopAndLog()}async function S_({path:
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
${
|
|
934
|
-
${
|
|
935
|
-
|
|
936
|
-
${
|
|
937
|
-
${
|
|
938
|
-
`)),i.stopAndLog()}const R_={command:"codegen <command> [path]",aliases:["generate","gen"],describe:"Generate various artifacts from LikeC4 sources",builder:
|
|
939
|
-
|
|
940
|
-
outfile",{alias:"o",type:"string",desc:"<file> path to output file (.ts)",normalize:!0,coerce:
|
|
941
|
-
views",path:
|
|
942
|
-
{command:"mermaid [path]",aliases:["mmd"],describe:"generate Mermaid files (.mmd)",builder:
|
|
943
|
-
"Examples:")}
|
|
867
|
+
h.semver,$);return b>0?f:b<0||h.operator===">"&&f.operator===">="?h:f},u=(f,h,$)=>{if(!f)return h;const b=s(f.semver,h.semver,$);return b<0?f:b>0||h.operator==="<"&&f.operator==="<="?h:f};return Jo=i,Jo}var Qo,$h;function j0(){if($h)return Qo;$h=1;const r=xr(),e=_s(),t=Le(),n=Pd(),s=ar(),i=u0(),o=l0(),a=f0(),c=d0(),l=h0(),u=p0(),f=m0(),h=g0(),$=tt(),b=y0(),y=$0(),d=wo(),g=_0(),p=v0(),m=bs(),_=Oo(),v=Yd(),w=Jd(),S=No(),I=jo(),F=th(),W=b0(),k=ws(),M=rt(),j=Es(),D=E0(),U=S0(),Y=R0(),G=A0(),J=O0(),se=Bo(),
|
|
868
|
+
H=C0(),A=P0(),V=I0(),x=N0(),E=T0();return Qo={parse:s,valid:i,clean:o,inc:a,diff:c,major:l,minor:u,patch:f,prerelease:h,compare:$,rcompare:b,compareLoose:y,compareBuild:d,sort:g,rsort:p,gt:m,lt:_,eq:v,neq:w,gte:S,lte:I,cmp:F,coerce:W,Comparator:k,Range:M,satisfies:j,toComparators:D,maxSatisfying:U,minSatisfying:Y,minVersion:G,validRange:J,outside:se,gtr:H,ltr:A,intersects:V,simplifyRange:x,subset:E,SemVer:t,re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:e.SEMVER_SPEC_VERSION,RELEASE_TYPES:e.RELEASE_TYPES,
|
|
869
|
+
compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},Qo}var Zo=j0();const cr=Cs(Zo),L0=Object.prototype.toString,k0="[object Uint8Array]",D0="[object ArrayBuffer]";function _h(r,e,t){return r?r.constructor===e?!0:L0.call(r)===t:!1}function vh(r){return _h(r,Uint8Array,k0)}function x0(r){return _h(r,ArrayBuffer,D0)}function M0(r){return vh(r)||x0(r)}function q0(r){if(!vh(r))throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof r}\``)}function U0(r){if(!M0(r))throw new TypeError(
|
|
870
|
+
`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof r}\``)}function bh(r,e){if(r.length===0)return new Uint8Array(0);e??=r.reduce((s,i)=>s+i.length,0);const t=new Uint8Array(e);let n=0;for(const s of r)q0(s),t.set(s,n),n+=s.length;return t}const wh={utf8:new globalThis.TextDecoder("utf8")};function Eh(r,e="utf8"){return U0(r),wh[e]??=new globalThis.TextDecoder(e),wh[e].decode(r)}function H0(r){if(typeof r!="string")throw new TypeError(`Expected \`string\`, got \`${typeof r}\``)}const F0=new globalThis.
|
|
871
|
+
TextEncoder;function ea(r){return H0(r),F0.encode(r)}Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));const V0=e0.default,Sh="aes-256-cbc",ur=()=>Object.create(null),z0=r=>r!=null,G0=(r,e)=>{const t=new Set(["undefined","symbol","function"]),n=typeof e;if(t.has(n))throw new TypeError(`Setting a value of type \`${n}\` for key \`${r}\` is not allowed as it's not supported by JSON`)},Ss="__internal__",ta=`${Ss}.migrations.version`;class B0{path;events;#n;#t;#e;#r={};constructor(e={}){
|
|
872
|
+
const t={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...e};if(!t.cwd){if(!t.projectName)throw new Error("Please specify the `projectName` option.");t.cwd=iy(t.projectName,{suffix:t.projectSuffix}).config}if(this.#e=t,t.schema??t.ajvOptions??t.rootSchema){if(t.schema&&typeof t.schema!="object")throw new TypeError("The `schema` option must be an object.");const o=new z$.Ajv2020({allErrors:!0,useDefaults:!0,
|
|
873
|
+
...t.ajvOptions});V0(o);const a={...t.rootSchema,type:"object",properties:t.schema};this.#n=o.compile(a);for(const[c,l]of Object.entries(t.schema??{}))l?.default&&(this.#r[c]=l.default)}t.defaults&&(this.#r={...this.#r,...t.defaults}),t.serialize&&(this._serialize=t.serialize),t.deserialize&&(this._deserialize=t.deserialize),this.events=new EventTarget,this.#t=t.encryptionKey;const n=t.fileExtension?`.${t.fileExtension}`:"";this.path=me.resolve(t.cwd,`${t.configName??"config"}${n}`);const s=this.
|
|
874
|
+
store,i=Object.assign(ur(),t.defaults,s);if(t.migrations){if(!t.projectVersion)throw new Error("Please specify the `projectVersion` option.");this._migrate(t.migrations,t.projectVersion,t.beforeEachMigration)}this._validate(i);try{wp.deepEqual(s,i)}catch{this.store=i}t.watch&&this._watch()}get(e,t){if(this.#e.accessPropertiesByDotNotation)return this._get(e,t);const{store:n}=this;return e in n?n[e]:t}set(e,t){if(typeof e!="string"&&typeof e!="object")throw new TypeError(`Expected \`key\` to be of \
|
|
875
|
+
type \`string\` or \`object\`, got ${typeof e}`);if(typeof e!="object"&&t===void 0)throw new TypeError("Use `delete()` to clear values");if(this._containsReservedKey(e))throw new TypeError(`Please don't use the ${Ss} key, as it's used to manage this module internal operations.`);const{store:n}=this,s=(i,o)=>{G0(i,o),this.#e.accessPropertiesByDotNotation?ou(n,i,o):n[i]=o};if(typeof e=="object"){const i=e;for(const[o,a]of Object.entries(i))s(o,a)}else s(e,t);this.store=n}has(e){return this.#e.accessPropertiesByDotNotation?
|
|
876
|
+
ty(this.store,e):e in this.store}reset(...e){for(const t of e)z0(this.#r[t])&&this.set(t,this.#r[t])}delete(e){const{store:t}=this;this.#e.accessPropertiesByDotNotation?ey(t,e):delete t[e],this.store=t}clear(){this.store=ur();for(const e of Object.keys(this.#r))this.reset(e)}onDidChange(e,t){if(typeof e!="string")throw new TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof e}`);if(typeof t!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof t}`);
|
|
877
|
+
return this._handleChange(()=>this.get(e),t)}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=he.readFileSync(this.path,this.#t?null:"utf8"),t=this._encryptData(e),n=this._deserialize(t);return this._validate(n),Object.assign(ur(),n)}catch(e){if(e?.code==="ENOENT")return this._ensureDirectory(),ur();
|
|
878
|
+
if(this.#e.clearInvalidConfig&&e.name==="SyntaxError")return ur();throw e}}set store(e){this._ensureDirectory(),this._validate(e),this._write(e),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(const[e,t]of Object.entries(this.store))yield[e,t]}_encryptData(e){if(!this.#t)return typeof e=="string"?e:Eh(e);try{const t=e.slice(0,16),n=gr.pbkdf2Sync(this.#t,t.toString(),1e4,32,"sha512"),s=gr.createDecipheriv(Sh,n,t),i=e.slice(17),o=typeof i=="string"?ea(i):i;return Eh(bh([s.update(
|
|
879
|
+
o),s.final()]))}catch{}return e.toString()}_handleChange(e,t){let n=e();const s=()=>{const i=n,o=e();bp(o,i)||(n=o,t.call(this,o,i))};return this.events.addEventListener("change",s),()=>{this.events.removeEventListener("change",s)}}_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:s,message:i=""})=>`\`${s.slice(1)}\` ${i}`);throw new Error("Config schema violation: "+n.join(
|
|
880
|
+
"; "))}_ensureDirectory(){he.mkdirSync(me.dirname(this.path),{recursive:!0})}_write(e){let t=this._serialize(e);if(this.#t){const n=gr.randomBytes(16),s=gr.pbkdf2Sync(this.#t,n.toString(),1e4,32,"sha512"),i=gr.createCipheriv(Sh,s,n);t=bh([n,ea(":"),i.update(ea(t)),i.final()])}if(Se.env.SNAP)he.writeFileSync(this.path,t,{mode:this.#e.configFileMode});else try{fu(this.path,t,{mode:this.#e.configFileMode})}catch(n){if(n?.code==="EXDEV"){he.writeFileSync(this.path,t,{mode:this.#e.configFileMode});return}
|
|
881
|
+
throw n}}_watch(){this._ensureDirectory(),he.existsSync(this.path)||this._write(ur()),Se.platform==="win32"?he.watch(this.path,{persistent:!1},Ed(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100})):he.watchFile(this.path,{persistent:!1},Ed(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5e3}))}_migrate(e,t,n){let s=this._get(ta,"0.0.0");const i=Object.keys(e).filter(a=>this._shouldPerformMigration(a,s,t));let o={...this.store};for(const a of i)try{n&&n(this,{fromVersion:s,
|
|
882
|
+
toVersion:a,finalVersion:t,versions:i});const c=e[a];c?.(this),this._set(ta,a),s=a,o={...this.store}}catch(c){throw this.store=o,new Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${c}`)}(this._isVersionInRangeFormat(s)||!cr.eq(s,t))&&this._set(ta,t)}_containsReservedKey(e){return typeof e=="object"&&Object.keys(e)[0]===Ss?!0:typeof e!="string"?!1:this.#e.accessPropertiesByDotNotation?!!e.startsWith(`${Ss}.`):!1}_isVersionInRangeFormat(e){
|
|
883
|
+
return cr.clean(e)===null}_shouldPerformMigration(e,t,n){return this._isVersionInRangeFormat(e)?t!=="0.0.0"&&cr.satisfies(t,e)?!1:cr.satisfies(n,e):!(cr.lte(e,t)||cr.gt(e,n))}_get(e,t){return Zg(this.store,e,t)}_set(e,t){const{store:n}=this;ou(n,e,t),this.store=n}}class Rh extends Error{response;request;options;constructor(e,t,n){const s=e.status||e.status===0?e.status:"",i=e.statusText||"",o=`${s} ${i}`.trim(),a=o?`status code ${o}`:"an unknown error";super(`Request failed with ${a}: ${t.method}\
|
|
884
|
+
${t.url}`),this.name="HTTPError",this.response=e,this.request=t,this.options=n}}class Ah extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}}const Oh=(()=>{let r=!1,e=!1;const t=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";if(t&&n)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return r=!0,"half"}}).headers.has("Co\
|
|
885
|
+
ntent-Type")}catch(s){if(s instanceof Error&&s.message==="unsupported BodyInit type")return!1;throw s}return r&&!e})(),W0=typeof globalThis.AbortController=="function",K0=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",Y0=typeof globalThis.ReadableStream=="function",X0=typeof globalThis.FormData=="function",Ch=["get","post","put","patch","head","delete"],J0={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},
|
|
886
|
+
ra=2147483647,Q0=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,Ph=Symbol("stop"),Z0={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0},e_={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},t_=r=>{if(!r)return 0;if(r instanceof
|
|
887
|
+
FormData){let e=0;for(const[t,n]of r)e+=Q0,e+=new TextEncoder().encode(`Content-Disposition: form-data; name="${t}"`).length,e+=typeof n=="string"?new TextEncoder().encode(n).length:n.size;return e}if(r instanceof Blob)return r.size;if(r instanceof ArrayBuffer)return r.byteLength;if(typeof r=="string")return new TextEncoder().encode(r).length;if(r instanceof URLSearchParams)return new TextEncoder().encode(r.toString()).length;if("byteLength"in r)return r.byteLength;if(typeof r=="object"&&r!==null)
|
|
888
|
+
try{const e=JSON.stringify(r);return new TextEncoder().encode(e).length}catch{return 0}return 0},r_=(r,e)=>{const t=Number(r.headers.get("content-length"))||0;let n=0;return r.status===204?(e&&e({percent:1,totalBytes:t,transferredBytes:n},new Uint8Array),new Response(null,{status:r.status,statusText:r.statusText,headers:r.headers})):new Response(new ReadableStream({async start(s){const i=r.body.getReader();e&&e({percent:0,transferredBytes:0,totalBytes:t},new Uint8Array);async function o(){const{
|
|
889
|
+
done:a,value:c}=await i.read();if(a){s.close();return}if(e){n+=c.byteLength;const l=t===0?0:n/t;e({percent:l,transferredBytes:n,totalBytes:t},c)}s.enqueue(c),await o()}await o()}}),{status:r.status,statusText:r.statusText,headers:r.headers})},n_=(r,e)=>{const t=t_(r.body);let n=0;return new Request(r,{duplex:"half",body:new ReadableStream({async start(s){const i=r.body instanceof ReadableStream?r.body.getReader():new Response("").body.getReader();async function o(){const{done:a,value:c}=await i.
|
|
890
|
+
read();if(a){e&&e({percent:1,transferredBytes:n,totalBytes:Math.max(t,n)},new Uint8Array),s.close();return}n+=c.byteLength;let l=t===0?0:n/t;(t<n||l===1)&&(l=.99),e&&e({percent:Number(l.toFixed(2)),transferredBytes:n,totalBytes:t},c),s.enqueue(c),await o()}await o()}})})},Mr=r=>r!==null&&typeof r=="object",Rs=(...r)=>{for(const e of r)if((!Mr(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return na({},...r)},Ih=(r={},e={})=>{const t=new globalThis.
|
|
891
|
+
Headers(r),n=e instanceof globalThis.Headers,s=new globalThis.Headers(e);for(const[i,o]of s.entries())n&&o==="undefined"||o===void 0?t.delete(i):t.set(i,o);return t};function As(r,e,t){return Object.hasOwn(e,t)&&e[t]===void 0?[]:na(r[t]??[],e[t]??[])}const Nh=(r={},e={})=>({beforeRequest:As(r,e,"beforeRequest"),beforeRetry:As(r,e,"beforeRetry"),afterResponse:As(r,e,"afterResponse"),beforeError:As(r,e,"beforeError")}),na=(...r)=>{let e={},t={},n={};for(const s of r)if(Array.isArray(s))Array.isArray(
|
|
892
|
+
e)||(e=[]),e=[...e,...s];else if(Mr(s)){for(let[i,o]of Object.entries(s))Mr(o)&&i in e&&(o=na(e[i],o)),e={...e,[i]:o};Mr(s.hooks)&&(n=Nh(n,s.hooks),e.hooks=n),Mr(s.headers)&&(t=Ih(t,s.headers),e.headers=t)}return e},s_=r=>Ch.includes(r)?r.toUpperCase():r,i_=["get","put","head","delete","options","trace"],o_=[408,413,429,500,502,503,504],a_=[413,429,503],Th={limit:2,methods:i_,statusCodes:o_,afterStatusCodes:a_,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:r=>.3*
|
|
893
|
+
2**(r-1)*1e3},c_=(r={})=>{if(typeof r=="number")return{...Th,limit:r};if(r.methods&&!Array.isArray(r.methods))throw new Error("retry.methods must be an array");if(r.statusCodes&&!Array.isArray(r.statusCodes))throw new Error("retry.statusCodes must be an array");return{...Th,...r}};async function u_(r,e,t,n){return new Promise((s,i)=>{const o=setTimeout(()=>{t&&t.abort(),i(new Ah(r))},n.timeout);n.fetch(r,e).then(s).catch(i).then(()=>{clearTimeout(o)})})}async function l_(r,{signal:e}){return new Promise(
|
|
894
|
+
(t,n)=>{e&&(e.throwIfAborted(),e.addEventListener("abort",s,{once:!0}));function s(){clearTimeout(i),n(e.reason)}const i=setTimeout(()=>{e?.removeEventListener("abort",s),t()},r)})}const f_=(r,e)=>{const t={};for(const n in e)!(n in e_)&&!(n in Z0)&&!(n in r)&&(t[n]=e[n]);return t};class Os{static create(e,t){const n=new Os(e,t),s=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>ra)throw new RangeError(`The \`timeout\` option cannot be greater than ${ra}`);await Promise.resolve();
|
|
895
|
+
let a=await n._fetch();for(const c of n._options.hooks.afterResponse){const l=await c(n.request,n._options,n._decorateResponse(a.clone()));l instanceof globalThis.Response&&(a=l)}if(n._decorateResponse(a),!a.ok&&n._options.throwHttpErrors){let c=new Rh(a,n.request,n._options);for(const l of n._options.hooks.beforeError)c=await l(c);throw c}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");
|
|
896
|
+
if(!Y0)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return r_(a.clone(),n._options.onDownloadProgress)}return a},o=(n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(s):s()).finally(async()=>{n.request.bodyUsed||await n.request.body?.cancel()});for(const[a,c]of Object.entries(J0))o[a]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||c);const l=await o;if(a==="json"){if(l.status===204||(await l.clone().
|
|
897
|
+
arrayBuffer()).byteLength===0)return"";if(t.parseJson)return t.parseJson(await l.text())}return l[a]()};return o}request;abortController;_retryCount=0;_input;_options;constructor(e,t={}){if(this._input=e,this._options={...t,headers:Ih(this._input.headers,t.headers),hooks:Nh({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},t.hooks),method:s_(t.method??this._input.method??"GET"),prefixUrl:String(t.prefixUrl||""),retry:c_(t.retry),throwHttpErrors:t.throwHttpErrors!==!1,timeout:t.timeout??
|
|
898
|
+
1e4,fetch:t.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this.
|
|
899
|
+
_input}if(W0&&K0){const n=this._options.signal??this._input.signal;this.abortController=new globalThis.AbortController,this._options.signal=n?AbortSignal.any([n,this.abortController.signal]):this.abortController.signal}if(Oh&&(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.
|
|
900
|
+
request=new globalThis.Request(this._input,this._options),this._options.searchParams){const s="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),i=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,s);(X0&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("cont\
|
|
901
|
+
ent-type"),this.request=new globalThis.Request(new globalThis.Request(i,{...this.request}),this._options)}if(this._options.onUploadProgress){if(typeof this._options.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!Oh)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request.body&&(this.request=n_(this.request,this._options.onUploadProgress))}}_calculateRetryDelay(e){
|
|
902
|
+
if(this._retryCount++,this._retryCount>this._options.retry.limit||e instanceof Ah)throw e;if(e instanceof Rh){if(!this._options.retry.statusCodes.includes(e.response.status))throw e;const n=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(n&&this._options.retry.afterStatusCodes.includes(e.response.status)){let s=Number(n)*1e3;Number.isNaN(s)?s=Date.parse(n)-Date.now():s>=
|
|
903
|
+
Date.parse("2024-01-01")&&(s-=Date.now());const i=this._options.retry.maxRetryAfter??s;return s<i?s:i}if(e.response.status===413)throw e}const t=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,t)}_decorateResponse(e){return this._options.parseJson&&(e.json=async()=>this._options.parseJson(await e.text())),e}async _retry(e){try{return await e()}catch(t){const n=Math.min(this._calculateRetryDelay(t),ra);if(this._retryCount<1)throw t;await l_(n,{signal:this.
|
|
904
|
+
_options.signal});for(const s of this._options.hooks.beforeRetry)if(await s({request:this.request,options:this._options,error:t,retryCount:this._retryCount})===Ph)return;return this._retry(e)}}async _fetch(){for(const n of this._options.hooks.beforeRequest){const s=await n(this.request,this._options);if(s instanceof Request){this.request=s;break}if(s instanceof Response)return s}const e=f_(this.request,this._options),t=this.request;return this.request=t.clone(),this._options.timeout===!1?this._options.
|
|
905
|
+
fetch(t,e):u_(t,e,this.abortController,this._options)}}const sa=r=>{const e=(t,n)=>Os.create(t,Rs(r,n));for(const t of Ch)e[t]=(n,s)=>Os.create(n,Rs(r,s,{method:t}));return e.create=t=>sa(Rs(t)),e.extend=t=>(typeof t=="function"&&(t=t(r??{})),sa(Rs(r,t))),e.stop=Ph,e},d_=sa(),ia=new B0({projectName:Vh,serialize:r=>Wt.stringify(r,null,2),deserialize:r=>Wt.parse(r)}),h_=1e3*60*60*24,jh="check-update";function p_(){if(kp||Br===jh)return;const r=ia.get("lastUpdateCheck"),e=ia.get("latestVersion");if(zh(
|
|
906
|
+
e)||Gh(r)||r+h_<Date.now())try{fa("likec4",["check-update"],{stdio:"ignore",preferLocal:!0,detached:!0,env:{NODE_ENV:jh}}).catch(()=>{})}catch{}e&&Zo.gt(e,Ct)&>(["Update available: ",B.dim(Ct),B.reset(" \u2192 "),B.green(e)].join(""))}async function m_(){try{const r=await g_();zr(r,"No version found in latest npm"),ia.set({lastUpdateCheck:Date.now(),latestVersion:r}),Zo.gt(r,Ct)?gt(["Update available: ",B.dim(Ct),B.reset(" \u2192 "),B.green(r)].join("")):gt(B.dim("Up to date: ")+" "+B.green(Ct))}catch(r){
|
|
907
|
+
at.error(Ur(r))}}async function g_(){return(await d_("https://registry.npmjs.org/likec4/latest",{headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"},keepalive:!0}).json()).version}const y_=r=>r.command({command:"check-update",describe:"Check for updates",handler:async()=>{await m_()}});async function $_(r,e,t){const n=".ts";e=e??ge(r.workspace,"likec4.generated"+n),hr(e)!==n&&(e=e+n),await ct(It(e),{recursive:!0});const s=await r.diagrams(),i=Og([...s]);await Nt(
|
|
908
|
+
e,i),t.info(`${B.dim("generated")} ${yt(process.cwd(),e)}`)}async function __(r,e,t){await ct(e,{recursive:!0}),t.info(`${B.dim("format")} ${B.green("dot")}`),t.info(`${B.dim("outdir")} ${e}`);const n=new Set,s=r.computedModel(),i=ca(s.$data.views);let o=0;for(const a of i)try{const c=await r.viewsService.layouter.dot({view:a,specification:s.specification});let l=a.relativePath??".";l.includes("/")?l=l.slice(0,l.lastIndexOf("/")):l=".",l!==""&&!n.has(l)&&(await ct(ge(e,l),{recursive:!0}),n.add(l));
|
|
909
|
+
const u=ge(e,l,a.id+".dot");await Nt(u,c),t.info(`${B.dim("generated")} ${yt(process.cwd(),u)}`),o++}catch(c){at.error(`error while generating ${a.id}`,{error:c})}o>0&&t.info(`${B.dim("total")} ${o} files`)}async function v_(r,e,t,n){await ct(t,{recursive:!0}),n.info(`${B.dim("format")} ${B.green(e)}`),n.info(`${B.dim("outdir")} ${t}`);let s,i;switch(e){case"d2":s=".d2",i=hp;break;case"mermaid":s=".mmd",i=dp;break;case"plantuml":s=".puml",i=fp;break;default:Oa(e)}const o=new Set,a=await r.layoutedModel();
|
|
910
|
+
let c=0;for(const l of a.views()){const u=l.$view;try{let f=u.relativePath??".";f.includes("/")?f=f.slice(0,f.lastIndexOf("/")):f=".",f!==""&&!o.has(f)&&(await ct(ge(t,f),{recursive:!0}),o.add(f));const h=ge(t,f,u.id+s),$=i(l);await Nt(h,$),n.info(`${B.dim("generated")} ${yt(process.cwd(),h)}`),c++}catch(f){n.error(`error while generating ${u.id}`,{error:f})}}c>0&&n.info(`${B.dim("total")} ${c} files`)}async function qr({path:r,useDotBin:e,...t}){const n=He("c4:codegen"),s=fr(n),i=await Fe.fromWorkspace(
|
|
911
|
+
r,{logger:"vite",graphviz:e?"binary":"wasm"});if(i.ensureSingleProject(),(await i.viewsService.computedViews()).length===0)throw n.warn("no views found"),process.exitCode=1,new Error("no views found");switch(t.format){case"views":{await $_(i,t.outfile,n);break}case"dot":{await __(i,t.outdir??r,n);break}case"d2":case"mermaid":case"plantuml":{await v_(i,t.format,t.outdir??r,n);break}default:Oa(t)}s.stopAndLog()}async function b_({path:r,useDotBin:e,outfile:t}){const n=He("c4:codegen"),s=fr(n),i=await Fe.
|
|
912
|
+
fromWorkspace(r,{logger:"vite",graphviz:e?"binary":"wasm",watch:!1});i.ensureSingleProject(),n.info(`${B.dim("format")} ${B.green("model")}`);const o=await i.layoutedModel();for(const f of o.views())f.$view.hasLayoutDrift&&n.warn(B.yellow("drift detected, manual layout can not be applied, view:")+" "+B.red(f.id));let a=ge(i.workspace,"likec4-model.ts");if(t&&(a=ks(t)?t:ge(t),Pt(t)&&(await Ds(t)).isDirectory()))throw new Error(`output file is a directory: ${t}`);const c=Hr(a);n.info(`${B.dim("fil\
|
|
913
|
+
ename")} ${c}`);const l=hr(c).toLocaleLowerCase();if(![".ts",".mts",".cts"].includes(l))throw n.error(`output file ${t} has extension "${l}"`),new Error(`output file ${t} must be a .ts, .mts or .cts file`);const u=It(a);n.info(`${B.dim("outdir")} ${u}`),await ct(u,{recursive:!0}),await Nt(a,Rg(o),{encoding:"utf-8"}),gt(Ps(`
|
|
914
|
+
${B.dim("Source with LikeC4Model generated:")}
|
|
915
|
+
${yt(Ns(),a)}
|
|
916
|
+
|
|
917
|
+
${B.dim("How to use:")}
|
|
918
|
+
${B.underline("https://likec4.dev/tooling/code-generation/model/")}
|
|
919
|
+
`).trim(),{padding:2,borderColor:"green",borderStyle:"round"}),s.stopAndLog()}async function w_({languageServices:r,outDir:e,filename:t="likec4-react.mjs"}){const n=He(["vite","react"]),s=ci();return n.info(`${B.cyan("likec4 app root")} ${B.dim(s)}`),n.info(B.cyan("outDir")+" "+B.dim(e)),{customLogger:n,root:s,configFile:!1,clearScreen:!1,publicDir:!1,mode:"production",resolve:{conditions:["production"],alias:fi()},esbuild:{banner:`'use client'
|
|
920
|
+
`+ai.banner,footer:ai.footer,jsx:"transform",jsxDev:!1,jsxSideEffects:!1,minifyIdentifiers:!1,minifySyntax:!1,minifyWhitespace:!1,tsconfigRaw:{compilerOptions:{target:"ES2022",useDefineForClassFields:!0,verbatimModuleSyntax:!0,jsx:"react-jsx"}}},build:{outDir:e,emptyOutDir:!1,sourcemap:!1,minify:!1,target:"es2022",copyPublicDir:!1,chunkSizeWarningLimit:li,lib:{entry:"react/likec4.tsx",fileName(i,o){return t},formats:["es"]},rollupOptions:{output:{compact:!1,exports:"named"},external:["likec4/rea\
|
|
921
|
+
ct","likec4/model","react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client",/likec4\/icons\/.*/],onwarn(i,o){i.code!=="SOURCEMAP_ERROR"&&o(i)}}},plugins:[xs({}),Ms({languageServices:r.languageServices,useOverviewGraph:!1})]}}async function E_({path:r,useDotBin:e,outfile:t}){await Ir();const n=He("c4:codegen"),s=fr(n),i=await Fe.fromWorkspace(r,{logger:"vite",graphviz:e?"binary":"wasm",watch:!1});i.ensureSingleProject(),n.info(`${B.dim("format")} ${B.green("react")}`);const o=await i.
|
|
922
|
+
diagrams();if(o.length===0)throw process.exitCode=1,new Error("no views found");o.forEach($=>{$.hasLayoutDrift&&n.warn(B.yellow("drift detected, manual layout can not be applied, view:")+" "+B.red($.id))});let a=ge(i.workspace,"likec4-views.js");if(t&&(a=ks(t)?t:ge(t),Pt(t)&&(await Ds(t)).isDirectory()))throw new Error(`output file is a directory: ${t}`);const c=It(a);n.info(`${B.dim("outdir")} ${c}`);const l=Hr(a);n.info(`${B.dim("filename")} ${l}`);const u=hr(l).toLocaleLowerCase();if(![".js",
|
|
923
|
+
".mjs",".jsx"].includes(u))throw n.error(`output file ${t} has extension "${u}"`),new Error(`output file ${t} must be a .js, .jsx or .mjs`);const f=await w_({languageServices:i,outDir:c,filename:l});await mr({...f,logLevel:"warn"});const h=await i.layoutedModel();await Nt(ge(c,Hr(a,u)+(u===".mjs"?".d.mts":".d.ts")),Cg(h)),gt(Ps(`
|
|
924
|
+
${B.dim("Source generated:")}
|
|
925
|
+
${yt(Ns(),a)}
|
|
926
|
+
|
|
927
|
+
${B.dim("How to use:")}
|
|
928
|
+
${B.underline("https://likec4.dev/tooling/code-generation/react/")}
|
|
929
|
+
`),{padding:2,borderColor:"green",borderStyle:"round"}),s.stopAndLog()}async function S_({path:r,useDotBin:e,webcomponentPrefix:t="likec4",outfile:n}){await Ir();const s=He("c4:codegen"),i=fr(s),o=await Fe.fromWorkspace(r,{logger:"vite",graphviz:e?"binary":"wasm",watch:!1});o.ensureSingleProject(),s.info(`${B.dim("format")} ${B.green("webcomponent")}`);const a=await o.diagrams();if(!ga(a,1))throw s.warn("no views found"),process.exitCode=1,new Error("no views found");a.forEach(b=>{b.hasLayoutDrift&&
|
|
930
|
+
s.warn(B.yellow("drift detected, manual layout can not be applied, view:")+" "+B.red(b.id))});let c=ge(o.workspace,"likec4-views.js");if(n&&(c=ks(n)?n:ge(n),Pt(n)&&(await Ds(n)).isDirectory()))throw new Error(`output file is a directory: ${n}`);Ot.debug(`${B.dim("outfilepath")} ${c}`);const l=Hr(c);Ot.debug(`${B.dim("filename")} ${l}`);const u=hr(l).toLocaleLowerCase();if(u!==".js"&&u!==".mjs")throw Ot.warn(`output file ${n} has extension "${u}"`),new Error(`output file ${n} must be a .js or .mj\
|
|
931
|
+
s`);const f=await ui();Ot.debug(`${B.dim("created temp public")} ${f}`);const h=await Ti({languageServices:o,outDir:f,filename:l,webcomponentPrefix:t,base:"/"});Ot.debug(`${B.dim("vite build webcomponent")}`),await mr({...h,logLevel:"warn"});const $=ge(f,l);if(!Pt($))throw new Error(`output file not found: ${$}`);await ct(It(c),{recursive:!0}),await cp($,c),s.info(`${B.dim("generated")} ${c}`),Ot.debug(`${B.dim("remove temp public")}`),await up(f,{recursive:!0,force:!0}),gt(Ps(`
|
|
932
|
+
${B.dim("Webcomponents generated to:")}
|
|
933
|
+
${yt(Ns(),c)}
|
|
934
|
+
|
|
935
|
+
${B.dim("Setup and usage instructions:")}
|
|
936
|
+
${B.blue("https://likec4.dev/tooling/code-generation/webcomponent/")}
|
|
937
|
+
`)),i.stopAndLog()}const R_=r=>r.command({command:"codegen <command> [path]",aliases:["generate","gen"],describe:"Generate various artifacts from LikeC4 sources",builder:e=>e.positional("path",Zt).command("react [path]","generate react component to render likec4 view",t=>t.option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.jsx, .mjs or .js)",normalize:!0,coerce:Ve}).option("use-dot",Ke),async t=>{await E_({useDotBin:t.useDotBin,path:t.path,outfile:t.outfile})}).command(
|
|
938
|
+
{command:"webcomponent [path]",aliases:["wc","webcomp"],describe:"generate js with webcomponents",builder:t=>t.option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.mjs or .js)",normalize:!0,coerce:Ve}).option("webcomponent-prefix",oi).option("use-dot",Ke),handler:async t=>{await S_({useDotBin:t.useDotBin,path:t.path,outfile:t.outfile,webcomponentPrefix:t.webcomponentPrefix})}}).command({command:"model [path]",aliases:["ts"],describe:"generate LikeC4Model (.ts)",builder:t=>t.
|
|
939
|
+
option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.ts)",normalize:!0,coerce:Ve}).option("use-dot",Ke),handler:async t=>{await b_({path:t.path,useDotBin:t.useDotBin,outfile:t.outfile})}}).command({command:"views-data [path]",aliases:["views"],describe:"generate likec4 views data (.ts)",deprecated:"use codegen model",builder:t=>t.option("outfile",{alias:"o",type:"string",desc:"<file> output .ts file",normalize:!0,coerce:Ve}).option("use-dot",Ke),handler:async t=>{await qr(
|
|
940
|
+
{format:"views",path:t.path,useDotBin:t.useDotBin,outfile:t.outfile})}}).command({command:"dot [path]",describe:"generate graphviz files (.dot)",builder:t=>t.option("outdir",Pr).option("use-dot",Ke),handler:async t=>{await qr({format:"dot",path:t.path,useDotBin:t.useDotBin,outdir:t.outdir})}}).command({command:"d2 [path]",describe:"generate D2 files (.d2)",builder:t=>t.option("outdir",Pr).option("use-dot",Ke),handler:async t=>{await qr({format:"d2",path:t.path,useDotBin:t.useDotBin,outdir:t.outdir})}}).
|
|
941
|
+
command({command:"mermaid [path]",aliases:["mmd"],describe:"generate Mermaid files (.mmd)",builder:t=>t.option("outdir",Pr).option("use-dot",Ke),handler:async t=>{await qr({format:"mermaid",useDotBin:t.useDotBin,path:t.path,outdir:t.outdir})}}).command({command:"plantuml [path]",aliases:["puml"],describe:"generate PlantUML files (.puml)",builder:t=>t.option("outdir",Pr).option("use-dot",Ke),handler:async t=>{await qr({format:"plantuml",useDotBin:t.useDotBin,path:t.path,outdir:t.outdir})}}).epilog(
|
|
942
|
+
`${B.bold("Examples:")}
|
|
944
943
|
likec4 gen react -o dist/likec4-views.mjs ./src/likec4
|
|
945
944
|
likec4 gen model -o likec4-model.ts
|
|
946
945
|
likec4 gen ts --outfile likec4-model.ts
|
|
@@ -948,33 +947,53 @@ views",path:e.path,useDotBin:e.useDotBin,outfile:e.outfile})}}).command({command
|
|
|
948
947
|
likec4 gen mmd --outdir assets/
|
|
949
948
|
likec4 gen plantuml --outdir assets/
|
|
950
949
|
likec4 gen dot -o out .
|
|
951
|
-
`),handler:()=>{}};async function A_({path:
|
|
952
|
-
|
|
953
|
-
|
|
950
|
+
`),handler:()=>{}});async function A_({path:r,useDotBin:e,outfile:t}){const n=He("c4:export"),s=fr(n),i=await Fe.fromWorkspace(r,{logger:"vite",graphviz:e?"binary":"wasm",watch:!1});i.ensureSingleProject();const o=await i.layoutedModel();hr(t)!==".json"&&(t=t+".json"),await ct(It(t),{recursive:!0});const a=JSON.stringify(o.$model,null,2);await Nt(t,a),n.info(`${B.dim("generated")} ${yt(process.cwd(),t)}`),s.stopAndLog("\u2713 export in ")}const O_=r=>r.command({command:"export <format> [path]",describe:"\
|
|
951
|
+
Export to images or JSON",builder:e=>e.usage(`${B.bold("Usage:")} $0 export <format> [path]`).positional("path",Zt).command({command:"png [path]",describe:"export views to PNG",builder:t=>t.option("output",Pr).option("theme",{choices:["light","dark"],desc:"color-scheme to use, default is light"}).option("flat",{boolean:!0,type:"boolean",desc:"flatten all images in output directory ignoring sources structure"}).option("use-dot",Ke).options({filter:{alias:"f",array:!0,string:!0,desc:`include views\
|
|
952
|
+
with ids matching given patterns
|
|
954
953
|
multiple patterns are combined with OR`},ignore:{boolean:!0,alias:"i",desc:"continue if export fails for some views"},timeout:{type:"number",alias:"t",desc:"timeout for playwright",default:10},"max-attempts":{type:"number",desc:"max attempts to export failing view, 1 means no retry",default:3},"server-url":{type:"string",desc:"use this url instead of starting new likec4 server"},"chromium-sandbox":{boolean:!0,desc:`enable/disable chromium sandbox
|
|
955
|
-
see Playwright docs`,default:!1}}).epilog(`${
|
|
956
|
-
${
|
|
957
|
-
${
|
|
958
|
-
|
|
959
|
-
${
|
|
960
|
-
${
|
|
961
|
-
|
|
962
|
-
${
|
|
963
|
-
${
|
|
964
|
-
`),handler:async
|
|
965
|
-
type:"string",desc:"<file> output .json file",default:"likec4.json",normalize:!0,coerce:ge}).option("use-dot",
|
|
966
|
-
${
|
|
967
|
-
${
|
|
968
|
-
|
|
969
|
-
${
|
|
970
|
-
${
|
|
971
|
-
`),handler:async
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
"
|
|
979
|
-
|
|
980
|
-
|
|
954
|
+
see Playwright docs`,default:!1}}).epilog(`${B.bold("Examples:")}
|
|
955
|
+
${B.green("$0 export png")}
|
|
956
|
+
${B.gray("Search for likec4 files in current directory and output PNG next to sources")}
|
|
957
|
+
|
|
958
|
+
${B.green("$0 export png --theme dark -o ./png src/likec4")}
|
|
959
|
+
${B.gray("Search for likec4 files in src/likec4 and output PNG with dark theme to png folder")}
|
|
960
|
+
|
|
961
|
+
${B.green('$0 export png -f "team1*" -f "team2*" --flat -o ./png src/likec4')}
|
|
962
|
+
${B.gray("Export views matching team1* or team2* only")}
|
|
963
|
+
`),handler:async t=>{zr(t.timeout>=1,"timeout must be >= 1"),zr(t["max-attempts"]>=1,"max-attempts must be >= 1"),await Ir(),await ru({path:t.path,useDotBin:t.useDotBin,output:t.output,timeoutMs:t.timeout*1e3,maxAttempts:t.maxAttempts,ignore:t.ignore===!0,outputType:t.flat?"flat":"relative",serverUrl:t.serverUrl,theme:t.theme??"light",filter:t.filter,chromiumSandbox:t["chromium-sandbox"]})}}).command({command:"json [path]",describe:"export model to JSON",builder:t=>t.option("outfile",{alias:"o",
|
|
964
|
+
type:"string",desc:"<file> output .json file",default:"likec4.json",normalize:!0,coerce:ge}).option("use-dot",Ke).epilog(`${B.bold("Examples:")}
|
|
965
|
+
${B.green("$0 export json")}
|
|
966
|
+
${B.gray("Search for likec4 files in current directory and output JSON to likec4.json")}
|
|
967
|
+
|
|
968
|
+
${B.green("$0 export json -o ./generated/likec4.json src/likec4 ")}
|
|
969
|
+
${B.gray("Search for likec4 files in src/likec4 and output JSON to generated/likec4.json")}
|
|
970
|
+
`),handler:async t=>{await A_({path:t.path,useDotBin:t.useDotBin,outfile:t.outfile})}}).updateStrings({"Commands:":B.bold("Formats:")}),handler:()=>{}}),C_=r=>r.command({command:"mcp [path]",aliases:[],describe:"Start MCP server",builder:e=>e.usage(`${B.bold("Usage:")} $0 mcp [path]`).positional("path",Zt).option("stdio",{boolean:!0,description:"use stdio transport",conflicts:["http","port"]}).option("http",{boolean:!0,description:"use streamable http transport (use 33335 port by default)",conflicts:"\
|
|
971
|
+
stdio"}).option("port",{alias:"p",number:!0,description:"enables http transport and sets the port",conflicts:"stdio"}).epilog(`${B.bold("Examples:")}
|
|
972
|
+
${B.green("$0 mcp")}
|
|
973
|
+
${B.gray("Start MCP with default stdio transport")}
|
|
974
|
+
${B.green("$0 mcp --http ./src")}
|
|
975
|
+
${B.gray("Start MCP with streamable http transport on port 33335 at ./src folder")}
|
|
976
|
+
${B.green("$0 mcp -p 1234")}
|
|
977
|
+
${B.gray("Start MCP with streamable http transport on port 1234")}
|
|
978
|
+
`),handler:async e=>{e.http||e.port?await P_(e.path,e.port):await I_(e.path)}});async function P_(r,e=33335){await Fe.fromWorkspace(r,{mcp:{port:e},watch:!0}),gt([B.green("LikeC4 MCP served at:"),`
|
|
979
|
+
{
|
|
980
|
+
"mcpServers": {
|
|
981
|
+
"likec4": {
|
|
982
|
+
"url": "http://localhost:${e}/mcp"
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
${B.dim("Documentation:")}
|
|
988
|
+
${B.underline("https://likec4.dev/tooling/mcp/#using-extension")}
|
|
989
|
+
`].join(`
|
|
990
|
+
`))}async function I_(r){await Fe.fromWorkspace(r,{mcp:"stdio"})}async function N_(r){const{isDev:e,...t}=await Ni({...r,likec4AssetsDir:"",webcomponentPrefix:void 0}),n=await ki({port:dn(62001,62010)}),s=r?.open??!1;return await mp({...t,mode:"production",preview:{host:r.listen??"127.0.0.1",allowedHosts:!0,port:n,open:s}})}async function T_({path:r,output:e,base:t,listen:n}){const s=await Fe.fromWorkspace(r,{logger:"vite",watch:!1}),i=await N_({base:t,languageServices:s,outputDir:e,open:!ut(),listen:n});
|
|
991
|
+
Xc(i)}const j_=r=>r.command({command:"preview [path]",describe:"Start local server to preview production build",builder:e=>e.positional("path",{type:"string",desc:`Directory with LikeC4 source files
|
|
992
|
+
if not specified search in current directory`,normalize:!0}).options({output:{alias:"o",type:"string",desc:"output directory from production build",normalize:!0},base:{type:"string",desc:"base url the app is being served from"},listen:{alias:"l",type:"string",desc:"ip address of the network interface to listen on"}}).coerce(["path","output"],Ve).default("path",Ve("."),".").default("listen","127.0.0.1","localhost"),handler:async e=>{await T_(e)}});async function L_({path:r,useDotBin:e,webcomponentPrefix:t,
|
|
993
|
+
title:n,useHashHistory:s,useOverview:i=!1,base:o,listen:a}){process.env.NODE_ENV="development";const c=await Fe.fromWorkspace(r,{graphviz:e?"binary":"wasm",watch:!0}),l=await Fr(dr(Vr(),".likec4-assets-")),u=await eu({buildWebcomponent:!0,hmr:!0,base:o,webcomponentPrefix:t,title:n,languageServices:c,useHashHistory:s,useOverviewGraph:i,likec4AssetsDir:l,listen:a});if(u.config.logger.clearScreen("info"),Xc(u),!i)return;const f=await c.diagrams();if(ga(f,1)){const h=He("c4:export"),$=Yc(u);if(!$){h.
|
|
994
|
+
error("no preview server url");return}h.info(B.cyan("wait 5sec before generating previews")),await Ca(5e3);try{await tu({serverUrl:$,logger:h,views:f,theme:"light",output:l,outputType:"flat"}),await Ca(1e3),h.info(B.yellow("Note: changes in sources do not trigger preview updates, restart is required"))}catch(b){h.error(B.red("Failed to generate previews")),h.error(b)}}else u.config.logger.warn("no views found, no previews generated")}const k_=r=>r.command({command:"start [path]",aliases:["serve",
|
|
995
|
+
"dev"],describe:"Start local dev server to preview LikeC4 views",builder:e=>e.positional("path",Zt).option("base",_c).option("webcomponent-prefix",oi).option("title",$c).option("use-hash-history",yc).option("use-dot",Ke).option("listen",Jm),handler:async e=>{await Ir(),await L_({path:e.path,useDotBin:e["use-dot"],base:e.base,webcomponentPrefix:e["webcomponent-prefix"],title:e.title,useHashHistory:e["use-hash-history"],listen:e.listen})}});async function D_({path:r,ignoreLayout:e}){const t=await Fe.
|
|
996
|
+
fromWorkspace(r,{logger:"vite",watch:!1}),n=He("c4:views");let s=!0;return s=await i(t)&&s,s=(e||await o(t,n))&&s,s?0:$a(1);function i(a){return a.getErrors().length===0}async function o(a,c){const l=await a.diagrams();let u=!1;for(const f of l)f.hasLayoutDrift===!0&&(u=!0,c.error(B.red(`Layout drift detected on view '${f.id}' at ${ge(r,f.relativePath??".")}`)));return!u}}const x_=r=>r.command({command:"validate [path]",aliases:[],describe:"Validate model syntax and manual layout",builder:e=>e.positional(
|
|
997
|
+
"path",Zt).option("ignore-layout",{alias:["skip-layout"],boolean:!0,default:!1,description:"do not validate layout of views"}),handler:async e=>{await D_({path:e.path,ignoreLayout:e["ignore-layout"]})}});Bh({sinks:{console:Wh()},loggers:[{category:"likec4",sinks:["console"],lowestLevel:Lp?"debug":"info"}]});async function M_(){!ut()&&p_(),await ua(Ym(pm(Jh)),k_,Jg,R_,O_,j_,x_,C_,y_).scriptName("likec4").usage("Usage: $0 <command>").version(Ct).alias("v","version").alias("h","help").demandCommand(
|
|
998
|
+
1,"Please run with valid command").strict().recommendCommands().help("help").version(Ct).alias("v","version").alias("h","help").demandCommand(1,"Please run with valid command").strict().recommendCommands().showHelpOnFail(!0,"Something is wrong, run with --help").updateStrings({"Options:":B.bold("Options:"),"Positionals:":B.bold("Arguments:"),"Commands:":B.bold("Commands:"),"Examples:":B.bold("Examples:")}).wrap(ha(Xh.columns-20,{min:80,max:120})).parseAsync()}M_().catch(()=>{$a(1)}),process.on("\
|
|
999
|
+
unhandledRejection",r=>{console.error("Unhandled rejection",r)});
|