@equinor/fusion-framework-cli 11.1.2 → 11.1.4

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/README.md +3 -2
  3. package/bin/build/bin.mjs +1 -1
  4. package/bin/build/cli.mjs +6 -6
  5. package/dist/esm/lib/utils/resolve-package.js +12 -3
  6. package/dist/esm/lib/utils/resolve-package.js.map +1 -1
  7. package/dist/esm/version.js +1 -1
  8. package/dist/types/cli/commands/app/build.d.ts +1 -1
  9. package/dist/types/cli/commands/app/check.d.ts +3 -3
  10. package/dist/types/cli/commands/app/config.d.ts +4 -4
  11. package/dist/types/cli/commands/app/dev.d.ts +4 -4
  12. package/dist/types/cli/commands/app/manifest.d.ts +4 -4
  13. package/dist/types/cli/commands/app/pack.d.ts +3 -3
  14. package/dist/types/cli/commands/app/publish.d.ts +4 -4
  15. package/dist/types/cli/commands/app/tag.d.ts +10 -11
  16. package/dist/types/cli/commands/app/upload.d.ts +4 -4
  17. package/dist/types/cli/commands/auth/login.d.ts +14 -0
  18. package/dist/types/cli/commands/auth/logout.d.ts +13 -3
  19. package/dist/types/cli/commands/auth/token.d.ts +15 -1
  20. package/dist/types/cli/commands/portal/build.d.ts +25 -0
  21. package/dist/types/cli/commands/portal/config.d.ts +4 -4
  22. package/dist/types/cli/commands/portal/dev.d.ts +25 -0
  23. package/dist/types/cli/commands/portal/manifest.d.ts +28 -0
  24. package/dist/types/cli/commands/portal/pack.d.ts +24 -0
  25. package/dist/types/cli/commands/portal/publish.d.ts +29 -0
  26. package/dist/types/cli/commands/portal/schema.d.ts +27 -0
  27. package/dist/types/cli/commands/portal/tag.d.ts +29 -0
  28. package/dist/types/cli/commands/portal/upload.d.ts +25 -0
  29. package/dist/types/cli/options/auth.d.ts +16 -0
  30. package/dist/types/version.d.ts +1 -1
  31. package/docs/application.md +5 -6
  32. package/docs/auth.md +7 -0
  33. package/docs/portal.md +4 -4
  34. package/package.json +8 -6
  35. package/docs/libsecret.md +0 -66
package/bin/build/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import{createCommand as e,createOption as t,InvalidOptionArgumentError as r,Command as o}from"commander";import{fileURLToPath as n}from"node:url";import{resolve as a,dirname as s}from"node:path";import{readPackageUpSync as i}from"read-package-up";import{ConsoleLogger as c,buildApplication as d,bundleApp as l,FusionEnv as u,resolveDefaultEnv as p,checkApp as f,initializeFramework as m,uploadApplication as h,publishAppConfig as g,generateApplicationConfig as v,AllowedAppTags as y,loadAppManifest as b,tagApplication as $,startAppDevServer as w,startPortalDevServer as _,loadPortalManifest as k,buildPortal as P,bundlePortal as S,uploadPortalBundle as E,tagPortal as j,AllowedPortalTags as O,publishPortalConfig as N,generatePortalConfig as I}from"@equinor/fusion-framework-cli/bin";import{stdout as x}from"node:process";import{mkdir as T,writeFile as C}from"node:fs/promises";import{accessSync as R,constants as A,existsSync as F,mkdirSync as M,writeFileSync as D}from"node:fs";import"node:assert";import{importConfig as V,importJSON as z}from"@equinor/fusion-imports";import{z as U}from"zod";import"deepmerge";import"node:child_process";const q=(e=0)=>t=>`[${t+e}m`,K=(e=0)=>t=>`[${38+e};5;${t}m`,L=(e=0)=>(t,r,o)=>`[${38+e};2;${t};${r};${o}m`,B={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(B.modifier);Object.keys(B.color),Object.keys(B.bgColor);const H=function(){const e=new Map;for(const[t,r]of Object.entries(B)){for(const[t,o]of Object.entries(r))B[t]={open:`[${o[0]}m`,close:`[${o[1]}m`},r[t]=B[t],e.set(o[0],o[1]);Object.defineProperty(B,t,{value:r,enumerable:!1})}return Object.defineProperty(B,"codes",{value:e,enumerable:!1}),B.color.close="",B.bgColor.close="",B.color.ansi=q(),B.color.ansi256=K(),B.color.ansi16m=L(),B.bgColor.ansi=q(10),B.bgColor.ansi256=K(10),B.bgColor.ansi16m=L(10),Object.defineProperties(B,{rgbToAnsi256:{value:(e,t,r)=>e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value(e){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;3===r.length&&(r=[...r].map(e=>e+e).join(""));const o=Number.parseInt(r,16);return[o>>16&255,o>>8&255,255&o]},enumerable:!1},hexToAnsi256:{value:e=>B.rgbToAnsi256(...B.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return e-8+90;let t,r,o;if(e>=232)t=(10*(e-232)+8)/255,r=t,o=t;else{const n=(e-=16)%36;t=Math.floor(e/36)/5,r=Math.floor(n/6)/5,o=n%6/5}const n=2*Math.max(t,r,o);if(0===n)return 30;let a=30+(Math.round(o)<<2|Math.round(r)<<1|Math.round(t));return 2===n&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,r)=>B.ansi256ToAnsi(B.rgbToAnsi256(e,t,r)),enumerable:!1},hexToAnsi:{value:e=>B.ansi256ToAnsi(B.hexToAnsi256(e)),enumerable:!1}}),B}(),G=(()=>{if(!("navigator"in globalThis))return 0;if(globalThis.navigator.userAgentData){const e=navigator.userAgentData.brands.find(({brand:e})=>"Chromium"===e);if(e&&e.version>93)return 3}return/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)?1:0})(),J=0!==G&&{level:G},W={stdout:J,stderr:J};function Y(e,t,r){let o=e.indexOf(t);if(-1===o)return e;const n=t.length;let a=0,s="";do{s+=e.slice(a,o)+t+r,a=o+n,o=e.indexOf(t,a)}while(-1!==o);return s+=e.slice(a),s}const{stdout:Q,stderr:X}=W,Z=Symbol("GENERATOR"),ee=Symbol("STYLER"),te=Symbol("IS_EMPTY"),re=["ansi","ansi","ansi256","ansi16m"],oe=Object.create(null),ne=e=>{const t=(...e)=>e.join(" ");return((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const r=Q?Q.level:0;e.level=void 0===t.level?r:t.level})(t,e),Object.setPrototypeOf(t,ae.prototype),t};function ae(e){return ne(e)}Object.setPrototypeOf(ae.prototype,Function.prototype);for(const[e,t]of Object.entries(H))oe[e]={get(){const r=le(this,de(t.open,t.close,this[ee]),this[te]);return Object.defineProperty(this,e,{value:r}),r}};oe.visible={get(){const e=le(this,this[ee],!0);return Object.defineProperty(this,"visible",{value:e}),e}};const se=(e,t,r,...o)=>"rgb"===e?"ansi16m"===t?H[r].ansi16m(...o):"ansi256"===t?H[r].ansi256(H.rgbToAnsi256(...o)):H[r].ansi(H.rgbToAnsi(...o)):"hex"===e?se("rgb",t,r,...H.hexToRgb(...o)):H[r][e](...o),ie=["rgb","hex","ansi256"];for(const e of ie){oe[e]={get(){const{level:t}=this;return function(...r){const o=de(se(e,re[t],"color",...r),H.color.close,this[ee]);return le(this,o,this[te])}}};oe["bg"+e[0].toUpperCase()+e.slice(1)]={get(){const{level:t}=this;return function(...r){const o=de(se(e,re[t],"bgColor",...r),H.bgColor.close,this[ee]);return le(this,o,this[te])}}}}const ce=Object.defineProperties(()=>{},{...oe,level:{enumerable:!0,get(){return this[Z].level},set(e){this[Z].level=e}}}),de=(e,t,r)=>{let o,n;return void 0===r?(o=e,n=t):(o=r.openAll+e,n=t+r.closeAll),{open:e,close:t,openAll:o,closeAll:n,parent:r}},le=(e,t,r)=>{const o=(...e)=>ue(o,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(o,ce),o[Z]=e,o[ee]=t,o[te]=r,o},ue=(e,t)=>{if(e.level<=0||!t)return e[te]?"":t;let r=e[ee];if(void 0===r)return t;const{openAll:o,closeAll:n}=r;if(t.includes(""))for(;void 0!==r;)t=Y(t,r.close,r.open),r=r.parent;const a=t.indexOf("\n");return-1!==a&&(t=function(e,t,r,o){let n=0,a="";do{const s="\r"===e[o-1];a+=e.slice(n,s?o-1:o)+t+(s?"\r\n":"\n")+r,n=o+1,o=e.indexOf("\n",n)}while(-1!==o);return a+=e.slice(n),a}(t,n,o,a)),o+t+n};Object.defineProperties(ae.prototype,oe);const pe=ae();ae({level:X?X.level:0});const fe=e("build").description("Build the application using a manifest file and environment-specific configuration.").addHelpText("after",["Builds the application using a manifest file and environment-specific configuration.","If no manifest is provided, searches for a default app.manifest.[ts|js|json] in the current directory.","You can use environment variables to customize the build process.","","Arguments:"," [manifest] Manifest file to use for building (e.g., app.manifest.ts)","","Options:"," -d, --debug Enable debug mode for verbose logging (default: false)","","Examples:"," $ fusion build"," $ fusion build app.manifest.dev.ts --debug"].join("\n")).option("-d, --debug","Enable debug mode for verbose logging",!1).argument("[manifest]","Manifest file to use for building (e.g., app.manifest.ts)").action(async(e,t)=>{const r=new c("app:build",{debug:t.debug});await d({log:r,manifest:e})}),me="app-bundle.zip",he=e("pack").description("Create a distributable app bundle of the application.").addHelpText("after",["Creates a distributable app bundle of the application.","Bundles all necessary files for deployment.","You can specify the output filename and directory, and optionally provide a manifest file.","If no manifest is provided, defaults to app.manifest.[ts|js|json] in the current directory.","","Arguments:"," [manifest] Manifest file to use for bundling (e.g., app.manifest.ts)","","Options:"," -a, --archive Name of the output archive file (default: app-bundle.zip)"," -o, --output Directory where the archive will be saved (default: current working directory)"," -d, --debug Enable debug mode for verbose logging","","Examples:"," $ fusion pack"," $ fusion pack app.manifest.dev.ts --archive my-app.zip --output ./dist"].join("\n")).option("-a, --archive [string]","Name of the output archive file (default: app-bundle.zip)",me).option("-o, --output [string]","Directory where the archive will be saved (default: current working directory)",process.cwd()).option("-d, --debug","Enable debug mode for verbose logging",!1).argument("[manifest]","Manifest file to use for bundling (e.g., app.manifest.ts)").action(async(e,t)=>{const r=new c("app:pack",{debug:t.debug});await l({log:r,manifest:e,archive:t.archive}).catch(e=>{r.error("Failed to create package:",e),process.exit(1)})}),ge=e=>{const r=Object.values(u).filter(t=>t!==u.Development||e.allowDev);return t("-e, --env <string>",["Specify the environment to use for the Fusion Framework command.",`Allowed values: [${r.join(", ")}, custom]`,"You can also set the environment using the FUSION_ENV environment variable.",`Defaults to ${e.default??p(e.allowDev)}.`,e.allowDev?"Development environment is allowed.":"Development environment is not allowed for this command."].join(" ")).env("FUSION_ENV").default(e.default??p(e.allowDev))};ge({allowDev:!0});const ve=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,ye=t("--tenantId <string>","The Azure Active Directory tenant ID").env("FUSION_TENANT_ID").default("3aa4a235-b6e2-48d5-9195-7fcf05b459b0"),be=t("--clientId <string>","The client ID of the application registered in Azure AD").env("FUSION_CLIENT_ID").default("a318b8e1-0295-4e17-98d5-35f67dfeba14"),$e=t("--token <string>","The Azure AD access token. If provided, the --tenant and --client options are ignored").env("FUSION_TOKEN").default(void 0),we=t("--scope <scopes...>","Azure audience scope, normally the application ID URI of the API you want to access and `.default`").env("FUSION_AUTH_SCOPE").default(["5a842df8-3238-415d-b168-9f16a6a6031b/.default"]),_e=(e,t)=>(e.addOption(ye),e.addOption(be),t?.excludeToken||e.addOption($e),t?.includeScope&&e.addOption(we),e.hook("preAction",e=>{const o=e.opts();if(o.token){if("string"!=typeof o.token||""===o.token.trim())throw new r("Token must be a non-empty string.");return e.setOptionValue("tenantId",void 0),e.setOptionValue("clientId",void 0),void(t?.includeScope&&e.setOptionValue("scope",void 0))}if(!o.tenantId||"string"!=typeof o.tenantId)throw new r("Tenant ID must be a non-empty string.");if(!ve.test(o.tenantId))throw new r("Tenant ID must be a valid UUID.");if(!o.clientId||"string"!=typeof o.clientId)throw new r("Client ID must be a non-empty string.");if(!ve.test(o.clientId))throw new r("Client ID must be a valid UUID.");if(t?.includeScope){if(!Array.isArray(o.scope)||0===o.scope.length)throw new r("Scope must be a non-empty array of strings.");for(const e of o.scope)if("string"!=typeof e||""===e.trim())throw new r("Each scope must be a non-empty string.")}}),e),ke=_e(e("check").description("Check if application is registered in Fusion app store.").addHelpText("after",["Checks if the application is registered in the Fusion app store.","Verifies the registration status of your application in the Fusion app store.","Helps identify issues with app registration or configuration.","Supports authentication and environment options. Provides a debug mode for verbose logging.","","Options:"," -d, --debug Enable debug mode for verbose logging (default: false)"," --environment <env> Specify the environment (see available environments)"," --token <token> Provide an authentication token (if required)","","Examples:"," $ fusion check --environment prod --debug"].join("\n")).option("-d, --debug","debug mode",!1).addOption(ge({allowDev:!1})).action(e=>{const t=new c("app:check",{debug:!!e.debug});return f({log:t,environment:e.environment,auth:"token"in e?{token:e.token}:e})})),Pe=_e(e("upload").description("Upload a Fusion application bundle to the Fusion App Store.").addHelpText("after",["","Uploads a Fusion application bundle to the Fusion App Store.","Uploads a distributable application bundle (e.g., app-bundle.zip) to the Fusion app registry.","Supports specifying application key, environment, and debug mode.","","Arguments:"," [bundle] Application bundle to upload (default: app-bundle.zip)","","Options:"," -k, --appKey <string> Application key (if not provided, resolved from manifest)"," -e, --env <env> Target environment"," -d, --debug Enable debug mode for verbose logging","","Examples:"," $ fusion upload"," $ fusion upload my-app-bundle.zip --appKey my-app"," $ fusion upload --debug"].join("\n")).option("-d, --debug [boolean]","Enable debug mode for verbose logging",!1).option("-k, --appKey <string>","Application key (if not provided, resolved from manifest)").addOption(ge({allowDev:!1})).argument("[bundle]","Application bundle to upload (default: app-bundle.zip)",me).action(async(e,t)=>{const r=new c("portal:upload",{debug:t.debug});r?.start("💾 Initializing Fusion Framework...");const o=await m({env:t.env,auth:{token:t.token,tenantId:t.tenantId,clientId:t.clientId}});r?.succeed("💾 Initialized Fusion Framework"),await h({log:r,appKey:t.appKey,framework:o,fileOrBundle:e}).catch(e=>{r.error("😢 Failed to upload bundle:",e),process.exit(1)})})),Se=_e(e("config").description("Generate or publish the Fusion application configuration file.").addHelpText("after",["Generate and/or publish the application configuration for Fusion apps.","","By default, outputs the generated config to stdout or a file. Use --publish to upload the config to the Fusion app registry.","Options [token, tenant, client, manifest] are only relevant when --publish is used.","Option [-e, --env] cannot be set to dev when --publish is used.","","Arguments:"," [config] Config build file to use (e.g., app.config[.env]?.[ts,js,json])","","Options:"," --debug Enable debug mode for verbose logging"," --silent Silent mode, suppresses output except errors"," --publish Publish config to Fusion app registry"," --manifest <path> Path to the app manifest file (required with --publish)"," -e, --env <env> Target environment"," -o, --output <stdout|path> Output to stdout or a file (default: stdout)","","Examples:"," $ fusion-framework-cli config app.config.ts"," $ fusion-framework-cli config app.config.prod.ts --output ./dist/app.config.json"," $ fusion-framework-cli config --publish --manifest app.manifest.ts --env prod"," $ fusion-framework-cli config --env prod my-custom.config.ts"].join("\n")).option("--debug","Enable debug mode for verbose logging").option("--silent","Silent mode, suppresses output except errors").option("--publish","Publish config to Fusion app registry").option("--manifest <path>","Path to the app manifest file (required with --publish)").addOption(ge({allowDev:!0})).option("-o, --output <stdout|path>","Output the result to stdout or a file (ignored with --publish, default: stdout)","stdout").argument("[config]","Config build file to use (e.g., app.config[.env]?.[ts,js,json])").action(async(e,t)=>{const r=t.silent?null:new c("app:config",{debug:!!t.debug});if(t.publish)return"dev"===t.env&&(r?.fail("🤪",pe.blue("--env"),'cannot be "dev" when',pe.blue("--publish")," is used"),process.exit(1)),g({config:t.config,manifest:t.manifest,environment:t.env,auth:"token"in t?{token:t.token}:t,debug:t.debug});const{config:o}=await v({log:r,config:e,env:{environment:t.env},output:"stdout"===t.output?void 0:t.output});"stdout"===t.output&&x.write(JSON.stringify(o,null,2))})),Ee=_e(e("tag").description("Tag your Fusion application with a specific version or preview.").addHelpText("after",["","Tags a Fusion application with a specific version or preview in the Fusion app registry.","Applies a tag to the specified application version for release management.","App key and version can be provided or resolved from the manifest file.","Supports environment selection, debug, and silent modes.","","Arguments:"," <tag> Tag to apply (latest | preview | stable)","","Options:"," --appKey <string> Application key (if not provided, resolved from manifest)"," -v, --version <string> Version to tag (if not provided, resolved from manifest)"," -m, --manifest <string> Manifest file to use for resolving app key and version"," --debug Enable debug mode for verbose logging"," --silent Silent mode, suppresses output except errors"," -e, --env <env> Target environment","","Examples:"," $ fusion tag latest"," $ fusion tag preview --env prod --manifest app.manifest.prod.ts"," $ fusion tag stable --appKey my-app --version 1.2.3"].join("\n")).addOption(ge({allowDev:!1})).option("--appKey <string>","Application key (if not provided, resolved from manifest)").option("-v, --version <string>","Version to tag (if not provided, resolved from manifest)").option("-m, --manifest <string>","Manifest file to use for resolving app key and version").option("--debug","Enable debug mode for verbose logging").option("--silent","Silent mode, suppresses output except errors").argument("<tag>",`Tag to apply (${Object.values(y).join(" | ")})`).action(async(e,t)=>{const r=t.silent?null:new c("app:tag",{debug:t.debug}),o={command:"build",environment:t.env,mode:process.env.NODE_ENV??"production",root:process.cwd()};let n=t.appKey,a=t.version;if(!n||!a){const{manifest:e}=await b({log:r,manifest:t.manifest,env:o});n=n??e.appKey,a=a??e.build?.version}r?.start("Initializing Fusion Framework...");const s=await m({env:t.env,auth:{token:t.token,tenantId:t.tenantId,clientId:t.clientId}});r?.succeed("Initialized Fusion Framework"),r?.start("Tagging application..."),await $({appKey:n,version:a,framework:s,log:r,tag:e}).catch(e=>{r?.error("Failed to tag application:",e),process.exit(1)})})),je=e("dev").description("Start the application in development mode.").addHelpText("after",["","Starts the application in development mode with a local dev server.","","Options:"," --debug Enable debug mode"," --manifest <path> Path to the app manifest file (app.manifest[.env]?.[ts,js,json])"," --config <path> Path to the app config file (app.config[.env]?.[ts,js,json])"," --env <environment> Runtime environment for the dev server (default: local)"," --port <port> Port for the development server (default: 3000)","","Examples:"," $ fusion app dev"," $ fusion app dev --port 4000"," $ fusion app dev --manifest ./app.manifest.local.ts --config ./app.config.ts"].join("\n")).option("--debug","Enable debug mode").option("--manifest <path>","Path to the app manifest file (app.manifest[.env]?.[ts,js,json])").option("--config <path>","Path to the app config file (app.config[.env]?.[ts,js,json])").option("--env <environment>","Runtime environment for the dev server","local").option("--port <port>","Port for the development server","3000").action(async e=>{const t=new c("app:dev",{debug:e.debug});t.start("Starting application in development mode..."),w({log:t,manifest:e.manifest,config:e.config,env:e.env,port:e.port}),t.succeed("Development server started successfully.")}),Oe=(e,t)=>{try{return R(e,A.F_OK),!0}catch(e){return!1}},Ne=e("manifest").description("Build and output the application manifest for Fusion apps.").addHelpText("after",["","Builds and outputs the application manifest for Fusion apps.","By default, prints the manifest to stdout. Use --output to write to a file.","You can specify a custom manifest build file or use the default (app.manifest[.env]?.[ts,js,json]).","Supports debug and silent modes for flexible output.","","Arguments:"," [manifest] Manifest build file to use (e.g., app.manifest[.env]?.[ts,js,json])","","Options:"," -d, --debug Enable debug mode for verbose logging"," -o, --output Write manifest to the specified file (default: stdout)"," -s, --silent Silent mode, suppresses output except errors","","Examples:"," $ fusion manifest"," $ fusion manifest app.manifest.prod.ts --output ./dist/app.manifest.json"," $ fusion manifest --debug"].join("\n")).option("-d, --debug","Enable debug mode for verbose logging",!1).option("-o, --output <string>","Write manifest to the specified file","stdout").option("-s, --silent","Silent mode, suppresses output except errors").argument("[manifest]","Manifest build file to use (e.g., app.manifest[.env]?.[ts,js,json])").action(async(e,t)=>{const r=t.silent?null:new c("app:manifest",{debug:t.debug}),o=await b({log:r,manifest:e});if(t.output){const e=a(process.cwd(),t.output);r?.start("Writing manifest to file",t.output),Oe(s(e))||await T(s(e),{recursive:!0}),await C(e,JSON.stringify(o.manifest,null,2)),r?.succeed("Manifest written to file",e)}else x.write(JSON.stringify(o.manifest,null,2))}),Ie=_e(e("publish").description("Build, upload, and tag your Fusion application for deployment.").addHelpText("after",["","Builds, uploads, and tags a Fusion application for deployment to the Fusion portal.","Bundles the app, uploads it to the Fusion app store, and applies a tag for versioning.","Supports specifying environment, manifest file, and tag.","Debug mode and authentication options are supported.","","Arguments:"," [bundle] Path to the app bundle to upload","","Options:"," -d, --debug Enable debug mode for verbose logging (default: false)"," -e, --env <env> Target environment"," -m, --manifest Manifest file to use for bundling (e.g., app.manifest.ts)"," -t, --tag Tag to apply to the published app (latest | preview)","","Examples:"," $ fusion publish"," $ fusion publish --env prod --manifest app.manifest.prod.ts"," $ fusion publish --tag latest app.bundle.zip"].join("\n")).option("-d, --debug","Enable debug mode for verbose logging",!1).addOption(ge({allowDev:!1})).option("-m, --manifest [string]","Manifest file to use for bundling (e.g., app.manifest.ts)").option("-t, --tag [string]",`Tag to apply to the published app (${Object.values(y).join(" | ")})`,y.Latest).argument("[bundle]","Path to the app bundle to upload").action(async(e,t)=>{const r=new c("app:publish",{debug:t.debug});let o;if(e)r.info(`📦 Using provided bundle: ${e}`),o=e;else try{r.start("📦 Bundle application...");o=(await l({log:r,manifest:t.manifest})).archive,r.succeed("📦 Bundle completed")}catch(e){r.error("😢 Failed to bundle application:",e),process.exit(1)}o||(r.error("😢 No bundle provided or created. Please specify a bundle file."),process.exit(1)),r?.start("💾 Initializing Fusion Framework...");const n=await m({env:t.env,auth:{token:t.token,tenantId:t.tenantId,clientId:t.clientId}});r?.succeed("💾 Initialized Fusion Framework"),r.start("🚀 Uploading application...");const a=await h({log:r,framework:n,fileOrBundle:o}).catch(e=>{r.error("😢 Failed to upload bundle:",e),process.exit(1)});r.succeed("🚀 Upload completed"),r.debug("Upload result:",a),r.start("🏷️ Tagging application...");const s=await $({tag:t.tag,appKey:a.name,version:a.version,log:r,framework:n}).catch(e=>{r.error("😢 Failed to tag application:",e),process.exit(1)});r.succeed("Tagging completed"),r.debug("Tagging result:",s)}));he.alias("build-pack").hook("preAction",e=>{"build-pack"===process.argv[3]&&(console.warn(pe.bgRedBright.bold('The command "build-pack" is deprecated. Please use "pack" instead.')),e.getOptionValue("archive")||e.setOptionValue("archive",me))}),Pe.alias("build-upload").hook("preAction",e=>{if("build-upload"===process.argv[3]){if(console.warn(pe.bgRedBright.bold('The command "build-upload" is deprecated. Please use "upload" instead.')),e.getOptionValue("service"))throw new Error("The --service option is deprecated. Please use --env instead.");const t=e.getOptionValue("bundle")??me;process.argv[4]=t}}),Ne.alias("build-manifest").hook("preAction",()=>{"build-manifest"===process.argv[3]&&console.warn(pe.bgRedBright.bold('The command "build-manifest" is deprecated. Please use "manifest" instead.'))}),Ie.alias("build-publish").hook("preAction",e=>{if("build-publish"===process.argv[3]&&console.warn(pe.bgRedBright.bold('The command "build-publish" is deprecated. Please use "publish" instead.')),e.getOptionValue("service"))throw new Error("The --service option is deprecated. Please use --env instead.")});const xe=e("app").description("Develop, build, configure, and deploy Fusion applications from your workspace root.").addHelpText("after",["",'The "app" command is your main entry point for managing Fusion applications in this workspace.',"","It provides access to subcommands for every stage of the application lifecycle, including development, building, packaging, configuration, deployment, and release management.","","All available subcommands are listed below automatically. For details and options for a specific subcommand, run:"," fusion app <subcommand> --help","","Typical usage:"," - Run and test your app locally with the dev subcommand"," - Build, bundle, and configure your app for deployment"," - Upload, publish, and tag releases to the Fusion App Store"," - Check registration and generate manifests as needed","","This command should be run from your app root directory."].join("\n")).addCommand(fe).addCommand(he).addCommand(ke).addCommand(Pe).addCommand(Se).addCommand(Ee).addCommand(je).addCommand(Ne).addCommand(Ie),Te=e("login").description("Authenticate and log in to Fusion Framework using interactive browser-based authentication.").addHelpText("after",["","Authenticate and log in to Fusion Framework using interactive browser-based authentication.","","This command initializes the Fusion Framework and opens a browser window for secure login.","Supports custom tenant, client, and scope options for advanced authentication scenarios.","","Options:"," --tenant <tenantId> Specify the tenant ID"," --client <clientId> Specify the client ID"," --scope <scope> Specify the scope(s) for authentication"," --debug Enable debug mode for verbose logging","","Examples:"," $ fusion-framework-cli login"," $ fusion-framework-cli login --tenant my-tenant --client my-client-id --scope api://my-app/.default"].join("\n")).action(async e=>{const t=new c("auth:login",{debug:e.debug}),r="string"==typeof e.scope?[e.scope]:e.scope;t.start("Initializing Fusion Framework...");const o=await m({auth:{tenantId:e.tenantId,clientId:e.clientId,interactive:!0,server:{port:49741}}});t.succeed("Initialized Fusion Framework");try{t.start("Logging in...");const e=await o.auth.login({scopes:r});t.info("username:",pe.green(e.account?.username)),t.info("tenant: ",pe.yellow(e.tenantId)),t.info("audience:",pe.yellow(e.account?.idTokenClaims?.aud));for(const r of e.scopes)t.info("scope: ",pe.dim(r));t.succeed("Successfully logged in",pe.greenBright(e.account?.name))}catch(r){throw t.fail("Failed to log in 🥺",JSON.stringify({tenant:e.tenant,client:e.clientId},void 0,2)),r}});_e(Te,{includeScope:!0,excludeToken:!0});const Ce=e("logout").description("Log out from Fusion Framework and clear your authentication session.").addHelpText("after",["","Log out from Fusion Framework and clear your authentication session.","","This command removes your current authentication state from the Fusion Framework CLI.","Supports custom tenant and client options for advanced scenarios.","","Options:"," --tenant <tenantId> Specify the tenant ID"," --client <clientId> Specify the client ID"," --debug Enable debug mode for verbose logging","","Examples:"," $ fusion-framework-cli logout"," $ fusion-framework-cli logout --tenant my-tenant --client my-client-id"].join("\n")).action(async e=>{const t=new c("auth:logout",{debug:e.debug});t.start("Initializing Fusion Framework...");const r=await m({auth:{tenantId:e.tenantId,clientId:e.clientId}});t.succeed("Initialized Fusion Framework");try{t.start("Logging in..."),await r.auth.logout(),t.succeed("Successfully logged out")}catch(r){throw t.fail("Failed to log out 🥺",JSON.stringify({tenant:e.tenant,client:e.clientId},void 0,2)),r}});_e(Ce,{excludeToken:!0,includeScope:!1});class Re extends Error{static Name="NoAccountsError";constructor(e,t){super(e,t),this.name=Re.Name}}const Ae=e("token").description("Acquire and print an access token for Fusion APIs using your current authentication context.").addHelpText("after",["","Acquire and print an access token for Fusion APIs using your current authentication context.","","This command retrieves an access token for the specified scopes, tenant, and client.","Supports debug and silent modes for flexible output.","","Options:"," --tenant <tenantId> Specify the tenant ID"," --client <clientId> Specify the client ID"," --scope <scope> Specify the scope(s) for authentication"," --debug Enable debug mode for verbose logging"," --silent Only output the token (no extra logging)","","Examples:"," $ fusion-framework-cli token"," $ fusion-framework-cli token --scope api://my-app/.default"," $ fusion-framework-cli token --tenant my-tenant --client my-client-id --silent"].join("\n")).option("-d, --debug","Enable debug mode for verbose logging",!1).option("--silent","Only output the token (no extra logging)").action(async e=>{const t=e.silent?null:new c("auth:token",{debug:e.debug}),r="string"==typeof e.scope?[e.scope]:e.scope;console.log("options"),t?.info("Using tenant",e.tenantId),t?.info("Using client",e.clientId),t?.info("Using scope",JSON.stringify(r)),t?.start("Initializing Fusion Framework...");const o=await m({auth:{tenantId:e.tenantId,clientId:e.clientId}});t?.succeed("Initialized Fusion Framework");try{t?.start("Getting access token...");const n=await o.auth.acquireAccessToken({scopes:r});t?.succeed("Successfully acquired access token"),e.silent?console.log(n):t?.info("Access token:",n)}catch(r){if(e.silent||!(r instanceof Re))throw r;t?.fail("No accounts found, please login first")}});_e(Ae,{includeScope:!0});const Fe=new o("auth").description("Authenticate with Fusion Framework CLI").addHelpText("after",["","Authentication commands for Fusion Framework CLI.","","Use these commands to log in, log out, or acquire tokens for Fusion APIs.","","Examples:"," $ fusion-framework-cli auth login"," $ fusion-framework-cli auth logout"," $ fusion-framework-cli auth token --scope api://my-app/.default"].join("\n"));Fe.addCommand(Te,{isDefault:!0}),Fe.addCommand(Ce),Fe.addCommand(Ae);const Me=_e(e("resolve").description("Resolve and display information about a service registered in Fusion service discovery.").addHelpText("after",["","Resolve and display information about a service registered in Fusion service discovery.","","This command looks up a service by name and prints its discovery details using the current authentication and environment.","","Examples:"," $ fusion-framework-cli resolve my-service"," $ fusion-framework-cli resolve my-service --env prod"," $ fusion-framework-cli resolve my-service --env test --tenantId my-tenant --clientId my-client-id","","The command will print the resolved service details to the console."].join("\n")).addOption(ge({allowDev:!1})).argument("<service>","Name of the service to resolve in Fusion service discovery").action(async(e,t)=>{const r=new c("disco:resolve");r.start("Initializing Fusion Framework..."),console.log("Options:",t);const o=await m({env:t.environment,auth:{token:t.token,tenantId:t.tenantId,clientId:t.clientId}});r.succeed("Initialized Fusion Framework"),r.start(`Resolving service ${e}...`);const n=await o.serviceDiscovery.resolveService(e);r.succeed(`Resolved service ${e}`),console.debug(n)})),De=e("disco").description("Service discovery operations");De.addCommand(Me);const Ve=e("dev").description("Start a local development server for the Fusion portal.").addHelpText("after",["","Starts a local development server for your Fusion portal.","","Options:"," -p, --port Port to run the development server on (default: 3000)"," -d, --debug Enable debug mode for verbose logging","","Examples:"," $ fusion-framework-cli portal dev"," $ fusion-framework-cli portal dev --port 4000 --debug"].join("\n")).option("-p, --port <number>","Port to run the development server on","3000").option("-d, --debug","Enable debug mode for verbose logging").action(async e=>{const t=new c("portal:dev",{debug:e.debug});t.start("Starting application in development mode..."),_({server:{port:Number(e.port)},log:t}),t.succeed("Development server started successfully.")}),ze=e("manifest").description("Generate or validate a Fusion portal manifest file.").addHelpText("after",["Generates or validates a Fusion portal manifest file.","","If no manifest is provided, a default portal.manifest.[ts|js|json] is used from the current directory.","","Options:"," -o, --output Write manifest to the specified file (default: stdout)"," -d, --debug Enable debug mode for verbose logging"," -s, --silent Silent mode, suppresses output except errors","","Examples:"," $ fusion-framework-cli portal manifest"," $ fusion-framework-cli portal manifest portal.manifest.prod.ts --output ./dist/portal.manifest.json"].join("\n")).option("-d, --debug","Enable debug mode for verbose logging",!1).option("-o, --output <string>","Write manifest to the specified file","stdout").option("-s, --silent","Silent mode, suppresses output except errors").argument("[manifest]","Manifest build file to use (e.g., app.manifest[.env]?.[ts,js,json])").action(async(e,t)=>{const r=t.silent?null:new c("app:manifest",{debug:t.debug}),o=await k({log:r,manifest:e});if(t.output){const e=a(process.cwd(),t.output);r?.start("Writing manifest to file",t.output),Oe(s(e))||await T(s(e),{recursive:!0}),await C(e,JSON.stringify(o.manifest,null,2)),r?.succeed("Manifest written to file",e)}else x.write(JSON.stringify(o.manifest,null,2))});function Ue(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qe,Ke={exports:{}},Le={},Be={},He={},Ge={},Je={},We={};function Ye(){return qe||(qe=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class o extends t{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e),{})}}function n(e,...t){const r=[e[0]];let n=0;for(;n<t.length;)i(r,t[n]),r.push(e[++n]);return new o(r)}e._Code=o,e.nil=new o(""),e._=n;const a=new o("+");function s(e,...t){const r=[d(e[0])];let n=0;for(;n<t.length;)r.push(a),i(r,t[n]),r.push(a,d(e[++n]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===a){const r=c(e[t-1],e[t+1]);if(void 0!==r){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}(r),new o(r)}function i(e,t){var n;t instanceof o?e.push(...t._items):t instanceof r?e.push(t):e.push("number"==typeof(n=t)||"boolean"==typeof n||null===n?n:d(Array.isArray(n)?n.join(","):n))}function c(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof r||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof r?void 0:`"${e}${t.slice(1)}`}function d(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.str=s,e.addCodeArg=i,e.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:s`${e}${t}`},e.stringify=function(e){return new o(d(e))},e.safeStringify=d,e.getProperty=function(t){return"string"==typeof t&&e.IDENTIFIER.test(t)?new o(`.${t}`):n`[${t}]`},e.getEsmExportName=function(t){if("string"==typeof t&&e.IDENTIFIER.test(t))return new o(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)},e.regexpCode=function(e){return new o(e.toString())}}(We)),We}var Qe,Xe,Ze={};function et(){return Qe||(Qe=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=Ye();class r extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var o;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(o||(e.UsedValueState=o={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class n{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,r;if((null===(r=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===r?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}e.Scope=n;class a extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:r,itemIndex:o}){this.value=e,this.scopePath=t._`.${new t.Name(r)}[${o}]`}}e.ValueScopeName=a;const s=t._`\n`;e.ValueScope=class extends n{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?s:t.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const o=this.toName(e),{prefix:n}=o,a=null!==(r=t.key)&&void 0!==r?r:t.ref;let s=this._values[n];if(s){const e=s.get(a);if(e)return e}else s=this._values[n]=new Map;s.set(a,o);const i=this._scope[n]||(this._scope[n]=[]),c=i.length;return i[c]=t.ref,o.setValue(t,{property:n,itemIndex:c}),o}getValue(e,t){const r=this._values[e];if(r)return r.get(t)}scopeRefs(e,r=this._values){return this._reduceValues(r,r=>{if(void 0===r.scopePath)throw new Error(`CodeGen: name "${r}" has no value`);return t._`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,r)}_reduceValues(n,a,s={},i){let c=t.nil;for(const d in n){const l=n[d];if(!l)continue;const u=s[d]=s[d]||new Map;l.forEach(n=>{if(u.has(n))return;u.set(n,o.Started);let s=a(n);if(s){const r=this.opts.es5?e.varKinds.var:e.varKinds.const;c=t._`${c}${r} ${n} = ${s};${this.opts._n}`}else{if(!(s=null==i?void 0:i(n)))throw new r(n);c=t._`${c}${s}${this.opts._n}`}u.set(n,o.Completed)})}return c}}}(Ze)),Ze}function tt(){return Xe||(Xe=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=Ye(),r=et();var o=Ye();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return o.Name}});var n=et();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return n.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return n.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return n.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return n.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class s extends a{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const o=e?r.varKinds.var:this.varKind,n=void 0===this.rhs?"":` = ${this.rhs}`;return`${o} ${this.name}${n};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=N(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class i extends a{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof t.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=N(this.rhs,e,r),this}get names(){return O(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}}class c extends i{constructor(e,t,r,o){super(e,r,o),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class d extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class l extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class u extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class p extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=N(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class f extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let o=r.length;for(;o--;){const n=r[o];n.optimizeNames(e,t)||(I(e,n.names),r.splice(o,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>j(e,t.names),{})}}class m extends f{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class h extends f{}class g extends m{}g.kind="else";class v extends m{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new g(e):e}return t?!1===e?t instanceof v?t:t.nodes:this.nodes.length?this:new v(x(e),t instanceof v?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=N(this.condition,e,t),this}get names(){const e=super.names;return O(e,this.condition),this.else&&j(e,this.else.names),e}}v.kind="if";class y extends m{}y.kind="for";class b extends y{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=N(this.iteration,e,t),this}get names(){return j(super.names,this.iteration.names)}}class $ extends y{constructor(e,t,r,o){super(),this.varKind=e,this.name=t,this.from=r,this.to=o}render(e){const t=e.es5?r.varKinds.var:this.varKind,{name:o,from:n,to:a}=this;return`for(${t} ${o}=${n}; ${o}<${a}; ${o}++)`+super.render(e)}get names(){const e=O(super.names,this.from);return O(e,this.to)}}class w extends y{constructor(e,t,r,o){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=o}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=N(this.iterable,e,t),this}get names(){return j(super.names,this.iterable.names)}}class _ extends m{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}_.kind="func";class k extends f{render(e){return"return "+super.render(e)}}k.kind="return";class P extends m{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,o;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(o=this.finally)||void 0===o||o.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&j(e,this.catch.names),this.finally&&j(e,this.finally.names),e}}class S extends m{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}S.kind="catch";class E extends m{render(e){return"finally"+super.render(e)}}E.kind="finally";function j(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function O(e,r){return r instanceof t._CodeOrName?j(e,r.names):e}function N(e,r,o){return e instanceof t.Name?a(e):(n=e)instanceof t._Code&&n._items.some(e=>e instanceof t.Name&&1===r[e.str]&&void 0!==o[e.str])?new t._Code(e._items.reduce((e,r)=>(r instanceof t.Name&&(r=a(r)),r instanceof t._Code?e.push(...r._items):e.push(r),e),[])):e;var n;function a(e){const t=o[e.str];return void 0===t||1!==r[e.str]?e:(delete r[e.str],t)}}function I(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function x(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:t._`!${A(e)}`}e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new r.Scope({parent:e}),this._nodes=[new h]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,o){const n=this._scope.toName(t);return void 0!==r&&o&&(this._constants[n.str]=r),this._leafNode(new s(e,n,r)),n}const(e,t,o){return this._def(r.varKinds.const,e,t,o)}let(e,t,o){return this._def(r.varKinds.let,e,t,o)}var(e,t,o){return this._def(r.varKinds.var,e,t,o)}assign(e,t,r){return this._leafNode(new i(e,t,r))}add(t,r){return this._leafNode(new c(t,e.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==t.nil&&this._leafNode(new p(e)),this}object(...e){const r=["{"];for(const[o,n]of e)r.length>1&&r.push(","),r.push(o),(o!==n||this.opts.es5)&&(r.push(":"),(0,t.addCodeArg)(r,n));return r.push("}"),new t._Code(r)}if(e,t,r){if(this._blockNode(new v(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new v(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(v,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new b(e),t)}forRange(e,t,o,n,a=(this.opts.es5?r.varKinds.var:r.varKinds.let)){const s=this._scope.toName(e);return this._for(new $(a,s,t,o),()=>n(s))}forOf(e,o,n,a=r.varKinds.const){const s=this._scope.toName(e);if(this.opts.es5){const e=o instanceof t.Name?o:this.var("_arr",o);return this.forRange("_i",0,t._`${e}.length`,r=>{this.var(s,t._`${e}[${r}]`),n(s)})}return this._for(new w("of",a,s,o),()=>n(s))}forIn(e,o,n,a=(this.opts.es5?r.varKinds.var:r.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,t._`Object.keys(${o})`,n);const s=this._scope.toName(e);return this._for(new w("in",a,s,o),()=>n(s))}endFor(){return this._endBlockNode(y)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new l(e))}return(e){const t=new k;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(k)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const o=new P;if(this._blockNode(o),this.code(e),t){const e=this.name("e");this._currNode=o.catch=new S(e),t(e)}return r&&(this._currNode=o.finally=new E,this.code(r)),this._endBlockNode(S,E)}throw(e){return this._leafNode(new u(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,r=t.nil,o,n){return this._blockNode(new _(e,r,o)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(_)}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,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof v))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},e.not=x;const T=R(e.operators.AND);e.and=function(...e){return e.reduce(T)};const C=R(e.operators.OR);function R(e){return(r,o)=>r===t.nil?o:o===t.nil?r:t._`${A(r)} ${e} ${A(o)}`}function A(e){return e instanceof t.Name?e:t._`(${e})`}e.or=function(...e){return e.reduce(C)}}(Je)),Je}var rt,ot={};function nt(){if(rt)return ot;rt=1,Object.defineProperty(ot,"__esModule",{value:!0}),ot.checkStrictMode=ot.getErrorPath=ot.Type=ot.useFunc=ot.setEvaluated=ot.evaluatedPropsToName=ot.mergeEvaluated=ot.eachItem=ot.unescapeJsonPointer=ot.escapeJsonPointer=ot.escapeFragment=ot.unescapeFragment=ot.schemaRefOrVal=ot.schemaHasRulesButRef=ot.schemaHasRules=ot.checkUnknownRules=ot.alwaysValidSchema=ot.toHash=void 0;const e=tt(),t=Ye();function r(e,t=e.schema){const{opts:r,self:o}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const n=o.RULES.keywords;for(const r in t)n[r]||u(e,`unknown keyword: "${r}"`)}function o(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function n(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function a(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function s({mergeNames:t,mergeToName:r,mergeValues:o,resultToName:n}){return(a,s,i,c)=>{const d=void 0===i?s:i instanceof e.Name?(s instanceof e.Name?t(a,s,i):r(a,s,i),i):s instanceof e.Name?(r(a,i,s),s):o(s,i);return c!==e.Name||d instanceof e.Name?d:n(a,d)}}function i(t,r){if(!0===r)return t.var("props",!0);const o=t.var("props",e._`{}`);return void 0!==r&&c(t,o,r),o}function c(t,r,o){Object.keys(o).forEach(o=>t.assign(e._`${r}${(0,e.getProperty)(o)}`,!0))}ot.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},ot.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(r(e,t),!o(t,e.self.RULES.all))},ot.checkUnknownRules=r,ot.schemaHasRules=o,ot.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},ot.schemaRefOrVal=function({topSchemaRef:t,schemaPath:r},o,n,a){if(!a){if("number"==typeof o||"boolean"==typeof o)return o;if("string"==typeof o)return e._`${o}`}return e._`${t}${r}${(0,e.getProperty)(n)}`},ot.unescapeFragment=function(e){return a(decodeURIComponent(e))},ot.escapeFragment=function(e){return encodeURIComponent(n(e))},ot.escapeJsonPointer=n,ot.unescapeJsonPointer=a,ot.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},ot.mergeEvaluated={props:s({mergeNames:(t,r,o)=>t.if(e._`${o} !== true && ${r} !== undefined`,()=>{t.if(e._`${r} === true`,()=>t.assign(o,!0),()=>t.assign(o,e._`${o} || {}`).code(e._`Object.assign(${o}, ${r})`))}),mergeToName:(t,r,o)=>t.if(e._`${o} !== true`,()=>{!0===r?t.assign(o,!0):(t.assign(o,e._`${o} || {}`),c(t,o,r))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:i}),items:s({mergeNames:(t,r,o)=>t.if(e._`${o} !== true && ${r} !== undefined`,()=>t.assign(o,e._`${r} === true ? true : ${o} > ${r} ? ${o} : ${r}`)),mergeToName:(t,r,o)=>t.if(e._`${o} !== true`,()=>t.assign(o,!0===r||e._`${o} > ${r} ? ${o} : ${r}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},ot.evaluatedPropsToName=i,ot.setEvaluated=c;const d={};var l;function u(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}return ot.useFunc=function(e,r){return e.scopeValue("func",{ref:r,code:d[r.code]||(d[r.code]=new t._Code(r.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(l||(ot.Type=l={})),ot.getErrorPath=function(t,r,o){if(t instanceof e.Name){const n=r===l.Num;return o?n?e._`"[" + ${t} + "]"`:e._`"['" + ${t} + "']"`:n?e._`"/" + ${t}`:e._`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return o?(0,e.getProperty)(t).toString():"/"+n(t)},ot.checkStrictMode=u,ot}var at,st,it,ct={};function dt(){if(at)return ct;at=1,Object.defineProperty(ct,"__esModule",{value:!0});const e=tt(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return ct.default=t,ct}function lt(){return st||(st=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=tt(),r=nt(),o=dt();function n(e,r){const n=e.const("err",r);e.if(t._`${o.default.vErrors} === null`,()=>e.assign(o.default.vErrors,t._`[${n}]`),t._`${o.default.vErrors}.push(${n})`),e.code(t._`${o.default.errors}++`)}function a(e,r){const{gen:o,validateName:n,schemaEnv:a}=e;a.$async?o.throw(t._`new ${e.ValidationError}(${r})`):(o.assign(t._`${n}.errors`,r),o.return(!1))}e.keywordError={message:({keyword:e})=>t.str`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:r})=>r?t.str`"${e}" keyword must be ${r} ($data)`:t.str`"${e}" keyword is invalid ($data)`},e.reportError=function(r,o=e.keywordError,s,c){const{it:d}=r,{gen:l,compositeRule:u,allErrors:p}=d,f=i(r,o,s);(null!=c?c:u||p)?n(l,f):a(d,t._`[${f}]`)},e.reportExtraError=function(t,r=e.keywordError,s){const{it:c}=t,{gen:d,compositeRule:l,allErrors:u}=c;n(d,i(t,r,s)),l||u||a(c,o.default.vErrors)},e.resetErrorsCount=function(e,r){e.assign(o.default.errors,r),e.if(t._`${o.default.vErrors} !== null`,()=>e.if(r,()=>e.assign(t._`${o.default.vErrors}.length`,r),()=>e.assign(o.default.vErrors,null)))},e.extendErrors=function({gen:e,keyword:r,schemaValue:n,data:a,errsCount:s,it:i}){if(void 0===s)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",s,o.default.errors,s=>{e.const(c,t._`${o.default.vErrors}[${s}]`),e.if(t._`${c}.instancePath === undefined`,()=>e.assign(t._`${c}.instancePath`,(0,t.strConcat)(o.default.instancePath,i.errorPath))),e.assign(t._`${c}.schemaPath`,t.str`${i.errSchemaPath}/${r}`),i.opts.verbose&&(e.assign(t._`${c}.schema`,n),e.assign(t._`${c}.data`,a))})};const s={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function i(e,r,n){const{createErrors:a}=e.it;return!1===a?t._`{}`:function(e,r,n={}){const{gen:a,it:i}=e,l=[c(i,n),d(e,n)];return function(e,{params:r,message:n},a){const{keyword:i,data:c,schemaValue:d,it:l}=e,{opts:u,propertyName:p,topSchemaRef:f,schemaPath:m}=l;a.push([s.keyword,i],[s.params,"function"==typeof r?r(e):r||t._`{}`]),u.messages&&a.push([s.message,"function"==typeof n?n(e):n]);u.verbose&&a.push([s.schema,d],[s.parentSchema,t._`${f}${m}`],[o.default.data,c]);p&&a.push([s.propertyName,p])}(e,r,l),a.object(...l)}(e,r,n)}function c({errorPath:e},{instancePath:n}){const a=n?t.str`${e}${(0,r.getErrorPath)(n,r.Type.Str)}`:e;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,a)]}function d({keyword:e,it:{errSchemaPath:o}},{schemaPath:n,parentSchema:a}){let i=a?o:t.str`${o}/${e}`;return n&&(i=t.str`${i}${(0,r.getErrorPath)(n,r.Type.Str)}`),[s.schemaPath,i]}}(Ge)),Ge}var ut,pt={},ft={};function mt(){if(ut)return ft;ut=1,Object.defineProperty(ft,"__esModule",{value:!0}),ft.getRules=ft.isJSONType=void 0;const e=new Set(["string","number","integer","boolean","null","object","array"]);return ft.isJSONType=function(t){return"string"==typeof t&&e.has(t)},ft.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}},ft}var ht,gt,vt={};function yt(){if(ht)return vt;function e(e,r){return r.rules.some(r=>t(e,r))}function t(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some(t=>void 0!==e[t]))}return ht=1,Object.defineProperty(vt,"__esModule",{value:!0}),vt.shouldUseRule=vt.shouldUseGroup=vt.schemaHasRulesForType=void 0,vt.schemaHasRulesForType=function({schema:t,self:r},o){const n=r.RULES.types[o];return n&&!0!==n&&e(t,n)},vt.shouldUseGroup=e,vt.shouldUseRule=t,vt}function bt(){if(gt)return pt;gt=1,Object.defineProperty(pt,"__esModule",{value:!0}),pt.reportTypeError=pt.checkDataTypes=pt.checkDataType=pt.coerceAndCheckDataType=pt.getJSONTypes=pt.getSchemaTypes=pt.DataType=void 0;const e=mt(),t=yt(),r=lt(),o=tt(),n=nt();var a;function s(t){const r=Array.isArray(t)?t:t?[t]:[];if(r.every(e.isJSONType))return r;throw new Error("type must be JSONType or JSONType[]: "+r.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(a||(pt.DataType=a={})),pt.getSchemaTypes=function(e){const t=s(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},pt.getJSONTypes=s,pt.coerceAndCheckDataType=function(e,r){const{gen:n,data:s,opts:c}=e,l=function(e,t){return t?e.filter(e=>i.has(e)||"array"===t&&"array"===e):[]}(r,c.coerceTypes),p=r.length>0&&!(0===l.length&&1===r.length&&(0,t.schemaHasRulesForType)(e,r[0]));if(p){const t=d(r,s,c.strictNumbers,a.Wrong);n.if(t,()=>{l.length?function(e,t,r){const{gen:n,data:a,opts:s}=e,c=n.let("dataType",o._`typeof ${a}`),l=n.let("coerced",o._`undefined`);"array"===s.coerceTypes&&n.if(o._`${c} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>n.assign(a,o._`${a}[0]`).assign(c,o._`typeof ${a}`).if(d(t,a,s.strictNumbers),()=>n.assign(l,a)));n.if(o._`${l} !== undefined`);for(const e of r)(i.has(e)||"array"===e&&"array"===s.coerceTypes)&&p(e);function p(e){switch(e){case"string":return void n.elseIf(o._`${c} == "number" || ${c} == "boolean"`).assign(l,o._`"" + ${a}`).elseIf(o._`${a} === null`).assign(l,o._`""`);case"number":return void n.elseIf(o._`${c} == "boolean" || ${a} === null
2
- || (${c} == "string" && ${a} && ${a} == +${a})`).assign(l,o._`+${a}`);case"integer":return void n.elseIf(o._`${c} === "boolean" || ${a} === null
3
- || (${c} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(l,o._`+${a}`);case"boolean":return void n.elseIf(o._`${a} === "false" || ${a} === 0 || ${a} === null`).assign(l,!1).elseIf(o._`${a} === "true" || ${a} === 1`).assign(l,!0);case"null":return n.elseIf(o._`${a} === "" || ${a} === 0 || ${a} === false`),void n.assign(l,null);case"array":n.elseIf(o._`${c} === "string" || ${c} === "number"
4
- || ${c} === "boolean" || ${a} === null`).assign(l,o._`[${a}]`)}}n.else(),u(e),n.endIf(),n.if(o._`${l} !== undefined`,()=>{n.assign(a,l),function({gen:e,parentData:t,parentDataProperty:r},n){e.if(o._`${t} !== undefined`,()=>e.assign(o._`${t}[${r}]`,n))}(e,l)})}(e,r,l):u(e)})}return p};const i=new Set(["string","number","integer","boolean","null"]);function c(e,t,r,n=a.Correct){const s=n===a.Correct?o.operators.EQ:o.operators.NEQ;let i;switch(e){case"null":return o._`${t} ${s} null`;case"array":i=o._`Array.isArray(${t})`;break;case"object":i=o._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=c(o._`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=c();break;default:return o._`typeof ${t} ${s} ${e}`}return n===a.Correct?i:(0,o.not)(i);function c(e=o.nil){return(0,o.and)(o._`typeof ${t} == "number"`,e,r?o._`isFinite(${t})`:o.nil)}}function d(e,t,r,a){if(1===e.length)return c(e[0],t,r,a);let s;const i=(0,n.toHash)(e);if(i.array&&i.object){const e=o._`typeof ${t} != "object"`;s=i.null?e:o._`!${t} || ${e}`,delete i.null,delete i.array,delete i.object}else s=o.nil;i.number&&delete i.integer;for(const e in i)s=(0,o.and)(s,c(e,t,r,a));return s}pt.checkDataType=c,pt.checkDataTypes=d;const l={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?o._`{type: ${e}}`:o._`{type: ${t}}`};function u(e){const t=function(e){const{gen:t,data:r,schema:o}=e,a=(0,n.schemaRefOrVal)(e,o,"type");return{gen:t,keyword:"type",data:r,schema:o.type,schemaCode:a,schemaValue:a,parentSchema:o,params:{},it:e}}(e);(0,r.reportError)(t,l)}return pt.reportTypeError=u,pt}var $t,wt={};var _t,kt,Pt={},St={};function Et(){if(_t)return St;_t=1,Object.defineProperty(St,"__esModule",{value:!0}),St.validateUnion=St.validateArray=St.usePattern=St.callValidateCode=St.schemaProperties=St.allSchemaProperties=St.noPropertyInData=St.propertyInData=St.isOwnProperty=St.hasPropFunc=St.reportMissingProp=St.checkMissingProp=St.checkReportMissingProp=void 0;const e=tt(),t=nt(),r=dt(),o=nt();function n(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:e._`Object.prototype.hasOwnProperty`})}function a(t,r,o){return e._`${n(t)}.call(${r}, ${o})`}function s(t,r,o,n){const s=e._`${r}${(0,e.getProperty)(o)} === undefined`;return n?(0,e.or)(s,(0,e.not)(a(t,r,o))):s}function i(e){return e?Object.keys(e).filter(e=>"__proto__"!==e):[]}St.checkReportMissingProp=function(t,r){const{gen:o,data:n,it:a}=t;o.if(s(o,n,r,a.opts.ownProperties),()=>{t.setParams({missingProperty:e._`${r}`},!0),t.error()})},St.checkMissingProp=function({gen:t,data:r,it:{opts:o}},n,a){return(0,e.or)(...n.map(n=>(0,e.and)(s(t,r,n,o.ownProperties),e._`${a} = ${n}`)))},St.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},St.hasPropFunc=n,St.isOwnProperty=a,St.propertyInData=function(t,r,o,n){const s=e._`${r}${(0,e.getProperty)(o)} !== undefined`;return n?e._`${s} && ${a(t,r,o)}`:s},St.noPropertyInData=s,St.allSchemaProperties=i,St.schemaProperties=function(e,r){return i(r).filter(o=>!(0,t.alwaysValidSchema)(e,r[o]))},St.callValidateCode=function({schemaCode:t,data:o,it:{gen:n,topSchemaRef:a,schemaPath:s,errorPath:i},it:c},d,l,u){const p=u?e._`${t}, ${o}, ${a}${s}`:o,f=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,i)],[r.default.parentData,c.parentData],[r.default.parentDataProperty,c.parentDataProperty],[r.default.rootData,r.default.rootData]];c.opts.dynamicRef&&f.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const m=e._`${p}, ${n.object(...f)}`;return l!==e.nil?e._`${d}.call(${l}, ${m})`:e._`${d}(${m})`};const c=e._`new RegExp`;return St.usePattern=function({gen:t,it:{opts:r}},n){const a=r.unicodeRegExp?"u":"",{regExp:s}=r.code,i=s(n,a);return t.scopeValue("pattern",{key:i.toString(),ref:i,code:e._`${"new RegExp"===s.code?c:(0,o.useFunc)(t,s)}(${n}, ${a})`})},St.validateArray=function(r){const{gen:o,data:n,keyword:a,it:s}=r,i=o.name("valid");if(s.allErrors){const e=o.let("valid",!0);return c(()=>o.assign(e,!1)),e}return o.var(i,!0),c(()=>o.break()),i;function c(s){const c=o.const("len",e._`${n}.length`);o.forRange("i",0,c,n=>{r.subschema({keyword:a,dataProp:n,dataPropType:t.Type.Num},i),o.if((0,e.not)(i),s)})}},St.validateUnion=function(r){const{gen:o,schema:n,keyword:a,it:s}=r;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some(e=>(0,t.alwaysValidSchema)(s,e))&&!s.opts.unevaluated)return;const i=o.let("valid",!1),c=o.name("_valid");o.block(()=>n.forEach((t,n)=>{const s=r.subschema({keyword:a,schemaProp:n,compositeRule:!0},c);o.assign(i,e._`${i} || ${c}`);r.mergeValidEvaluated(s,c)||o.if((0,e.not)(i))})),r.result(i,()=>r.reset(),()=>r.error(!0))},St}function jt(){if(kt)return Pt;kt=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.validateKeywordUsage=Pt.validSchemaType=Pt.funcKeywordCode=Pt.macroKeywordCode=void 0;const e=tt(),t=dt(),r=Et(),o=lt();function n(t){const{gen:r,data:o,it:n}=t;r.if(n.parentData,()=>r.assign(o,e._`${n.parentData}[${n.parentDataProperty}]`))}function a(t,r,o){if(void 0===o)throw new Error(`keyword "${r}" failed to compile`);return t.scopeValue("keyword","function"==typeof o?{ref:o}:{ref:o,code:(0,e.stringify)(o)})}return Pt.macroKeywordCode=function(t,r){const{gen:o,keyword:n,schema:s,parentSchema:i,it:c}=t,d=r.macro.call(c.self,s,i,c),l=a(o,n,d);!1!==c.opts.validateSchema&&c.self.validateSchema(d,!0);const u=o.name("valid");t.subschema({schema:d,schemaPath:e.nil,errSchemaPath:`${c.errSchemaPath}/${n}`,topSchemaRef:l,compositeRule:!0},u),t.pass(u,()=>t.error(!0))},Pt.funcKeywordCode=function(s,i){var c;const{gen:d,keyword:l,schema:u,parentSchema:p,$data:f,it:m}=s;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(m,i);const h=!f&&i.compile?i.compile.call(m.self,u,p,m):i.validate,g=a(d,l,h),v=d.let("valid");function y(o=(i.async?e._`await `:e.nil)){const n=m.opts.passContext?t.default.this:t.default.self,a=!("compile"in i&&!f||!1===i.schema);d.assign(v,e._`${o}${(0,r.callValidateCode)(s,g,n,a)}`,i.modifying)}function b(t){var r;d.if((0,e.not)(null!==(r=i.valid)&&void 0!==r?r:v),t)}s.block$data(v,function(){if(!1===i.errors)y(),i.modifying&&n(s),b(()=>s.error());else{const r=i.async?function(){const t=d.let("ruleErrs",null);return d.try(()=>y(e._`await `),r=>d.assign(v,!1).if(e._`${r} instanceof ${m.ValidationError}`,()=>d.assign(t,e._`${r}.errors`),()=>d.throw(r))),t}():function(){const t=e._`${g}.errors`;return d.assign(t,null),y(e.nil),t}();i.modifying&&n(s),b(()=>function(r,n){const{gen:a}=r;a.if(e._`Array.isArray(${n})`,()=>{a.assign(t.default.vErrors,e._`${t.default.vErrors} === null ? ${n} : ${t.default.vErrors}.concat(${n})`).assign(t.default.errors,e._`${t.default.vErrors}.length`),(0,o.extendErrors)(r)},()=>r.error())}(s,r))}}),s.ok(null!==(c=i.valid)&&void 0!==c?c:v)},Pt.validSchemaType=function(e,t,r=!1){return!t.length||t.some(t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e)},Pt.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:o},n,a){if(Array.isArray(n.keyword)?!n.keyword.includes(a):n.keyword!==a)throw new Error("ajv implementation error");const s=n.dependencies;if(null==s?void 0:s.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw new Error(`parent schema must have dependencies of ${a}: ${s.join(",")}`);if(n.validateSchema){if(!n.validateSchema(e[a])){const e=`keyword "${a}" value is invalid at path "${o}": `+r.errorsText(n.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}},Pt}var Ot,Nt={};var It,xt,Tt={};function Ct(){return xt||(xt=1,It=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var o,n,a;if(Array.isArray(t)){if((o=t.length)!=r.length)return!1;for(n=o;0!==n--;)if(!e(t[n],r[n]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((o=(a=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(n=o;0!==n--;)if(!Object.prototype.hasOwnProperty.call(r,a[n]))return!1;for(n=o;0!==n--;){var s=a[n];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}),It}var Rt,At,Ft,Mt={exports:{}};function Dt(){if(Rt)return Mt.exports;Rt=1;var e=Mt.exports=function(e,r,o){"function"==typeof r&&(o=r,r={}),t(r,"function"==typeof(o=r.cb||o)?o:o.pre||function(){},o.post||function(){},e,"",e)};function t(o,n,a,s,i,c,d,l,u,p){if(s&&"object"==typeof s&&!Array.isArray(s)){for(var f in n(s,i,c,d,l,u,p),s){var m=s[f];if(Array.isArray(m)){if(f in e.arrayKeywords)for(var h=0;h<m.length;h++)t(o,n,a,m[h],i+"/"+f+"/"+h,c,i,f,s,h)}else if(f in e.propsKeywords){if(m&&"object"==typeof m)for(var g in m)t(o,n,a,m[g],i+"/"+f+"/"+r(g),c,i,f,s,g)}else(f in e.keywords||o.allKeys&&!(f in e.skipKeywords))&&t(o,n,a,m,i+"/"+f,c,i,f,s)}a(s,i,c,d,l,u,p)}}function r(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}return e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0},Mt.exports}function Vt(){if(At)return Tt;At=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.getSchemaRefs=Tt.resolveUrl=Tt.normalizeId=Tt._getFullPath=Tt.getFullPath=Tt.inlineRef=void 0;const e=nt(),t=Ct(),r=Dt(),o=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);Tt.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!a(e):!!t&&s(e)<=t)};const n=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function a(e){for(const t in e){if(n.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(a))return!0;if("object"==typeof r&&a(r))return!0}return!1}function s(t){let r=0;for(const n in t){if("$ref"===n)return 1/0;if(r++,!o.has(n)&&("object"==typeof t[n]&&(0,e.eachItem)(t[n],e=>r+=s(e)),r===1/0))return 1/0}return r}function i(e,t="",r){!1!==r&&(t=l(t));const o=e.parse(t);return c(e,o)}function c(e,t){return e.serialize(t).split("#")[0]+"#"}Tt.getFullPath=i,Tt._getFullPath=c;const d=/#\/?$/;function l(e){return e?e.replace(d,""):""}Tt.normalizeId=l,Tt.resolveUrl=function(e,t,r){return r=l(r),e.resolve(t,r)};const u=/^[a-z_][-a-z0-9._]*$/i;return Tt.getSchemaRefs=function(e,o){if("boolean"==typeof e)return{};const{schemaId:n,uriResolver:a}=this.opts,s=l(e[n]||o),c={"":s},d=i(a,s,!1),p={},f=new Set;return r(e,{allKeys:!0},(e,t,r,o)=>{if(void 0===o)return;const a=d+t;let s=c[o];function i(t){const r=this.opts.uriResolver.resolve;if(t=l(s?r(s,t):t),f.has(t))throw h(t);f.add(t);let o=this.refs[t];return"string"==typeof o&&(o=this.refs[o]),"object"==typeof o?m(e,o.schema,t):t!==l(a)&&("#"===t[0]?(m(e,p[t],t),p[t]=e):this.refs[t]=a),t}function g(e){if("string"==typeof e){if(!u.test(e))throw new Error(`invalid anchor "${e}"`);i.call(this,`#${e}`)}}"string"==typeof e[n]&&(s=i.call(this,e[n])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),c[t]=s}),p;function m(e,r,o){if(void 0!==r&&!t(e,r))throw h(o)}function h(e){return new Error(`reference "${e}" resolves to more than one schema`)}},Tt}function zt(){if(Ft)return Be;Ft=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.getData=Be.KeywordCxt=Be.validateFunctionCode=void 0;const e=function(){if(it)return He;it=1,Object.defineProperty(He,"__esModule",{value:!0}),He.boolOrEmptySchema=He.topBoolOrEmptySchema=void 0;const e=lt(),t=tt(),r=dt(),o={message:"boolean schema is false"};function n(t,r){const{gen:n,data:a}=t,s={gen:n,keyword:"false schema",data:a,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,e.reportError)(s,o,void 0,r)}return He.topBoolOrEmptySchema=function(e){const{gen:o,schema:a,validateName:s}=e;!1===a?n(e,!1):"object"==typeof a&&!0===a.$async?o.return(r.default.data):(o.assign(t._`${s}.errors`,null),o.return(!0))},He.boolOrEmptySchema=function(e,t){const{gen:r,schema:o}=e;!1===o?(r.var(t,!1),n(e)):r.var(t,!0)},He}(),t=bt(),r=yt(),o=bt(),n=function(){if($t)return wt;$t=1,Object.defineProperty(wt,"__esModule",{value:!0}),wt.assignDefaults=void 0;const e=tt(),t=nt();function r(r,o,n){const{gen:a,compositeRule:s,data:i,opts:c}=r;if(void 0===n)return;const d=e._`${i}${(0,e.getProperty)(o)}`;if(s)return void(0,t.checkStrictMode)(r,`default is ignored for: ${d}`);let l=e._`${d} === undefined`;"empty"===c.useDefaults&&(l=e._`${l} || ${d} === null || ${d} === ""`),a.if(l,e._`${d} = ${(0,e.stringify)(n)}`)}return wt.assignDefaults=function(e,t){const{properties:o,items:n}=e.schema;if("object"===t&&o)for(const t in o)r(e,t,o[t].default);else"array"===t&&Array.isArray(n)&&n.forEach((t,o)=>r(e,o,t.default))},wt}(),a=jt(),s=function(){if(Ot)return Nt;Ot=1,Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.extendSubschemaMode=Nt.extendSubschemaData=Nt.getSubschema=void 0;const e=tt(),t=nt();return Nt.getSubschema=function(r,{keyword:o,schemaProp:n,schema:a,schemaPath:s,errSchemaPath:i,topSchemaRef:c}){if(void 0!==o&&void 0!==a)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==o){const a=r.schema[o];return void 0===n?{schema:a,schemaPath:e._`${r.schemaPath}${(0,e.getProperty)(o)}`,errSchemaPath:`${r.errSchemaPath}/${o}`}:{schema:a[n],schemaPath:e._`${r.schemaPath}${(0,e.getProperty)(o)}${(0,e.getProperty)(n)}`,errSchemaPath:`${r.errSchemaPath}/${o}/${(0,t.escapeFragment)(n)}`}}if(void 0!==a){if(void 0===s||void 0===i||void 0===c)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:a,schemaPath:s,topSchemaRef:c,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')},Nt.extendSubschemaData=function(r,o,{dataProp:n,dataPropType:a,data:s,dataTypes:i,propertyName:c}){if(void 0!==s&&void 0!==n)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:d}=o;if(void 0!==n){const{errorPath:s,dataPathArr:i,opts:c}=o;l(d.let("data",e._`${o.data}${(0,e.getProperty)(n)}`,!0)),r.errorPath=e.str`${s}${(0,t.getErrorPath)(n,a,c.jsPropertySyntax)}`,r.parentDataProperty=e._`${n}`,r.dataPathArr=[...i,r.parentDataProperty]}function l(e){r.data=e,r.dataLevel=o.dataLevel+1,r.dataTypes=[],o.definedProperties=new Set,r.parentData=o.data,r.dataNames=[...o.dataNames,e]}void 0!==s&&(l(s instanceof e.Name?s:d.let("data",s,!0)),void 0!==c&&(r.propertyName=c)),i&&(r.dataTypes=i)},Nt.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:o,createErrors:n,allErrors:a}){void 0!==o&&(e.compositeRule=o),void 0!==n&&(e.createErrors=n),void 0!==a&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=r},Nt}(),i=tt(),c=dt(),d=Vt(),l=nt(),u=lt();function p({gen:e,validateName:t,schema:r,schemaEnv:o,opts:n},a){n.code.es5?e.func(t,i._`${c.default.data}, ${c.default.valCxt}`,o.$async,()=>{e.code(i._`"use strict"; ${f(r,n)}`),function(e,t){e.if(c.default.valCxt,()=>{e.var(c.default.instancePath,i._`${c.default.valCxt}.${c.default.instancePath}`),e.var(c.default.parentData,i._`${c.default.valCxt}.${c.default.parentData}`),e.var(c.default.parentDataProperty,i._`${c.default.valCxt}.${c.default.parentDataProperty}`),e.var(c.default.rootData,i._`${c.default.valCxt}.${c.default.rootData}`),t.dynamicRef&&e.var(c.default.dynamicAnchors,i._`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{e.var(c.default.instancePath,i._`""`),e.var(c.default.parentData,i._`undefined`),e.var(c.default.parentDataProperty,i._`undefined`),e.var(c.default.rootData,c.default.data),t.dynamicRef&&e.var(c.default.dynamicAnchors,i._`{}`)})}(e,n),e.code(a)}):e.func(t,i._`${c.default.data}, ${function(e){return i._`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${e.dynamicRef?i._`, ${c.default.dynamicAnchors}={}`:i.nil}}={}`}(n)}`,o.$async,()=>e.code(f(r,n)).code(a))}function f(e,t){const r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?i._`/*# sourceURL=${r} */`:i.nil}function m(t,r){g(t)&&(v(t),h(t))?function(e,t){const{schema:r,gen:o,opts:n}=e;n.$comment&&r.$comment&&b(e);(function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,d.resolveUrl)(e.opts.uriResolver,e.baseId,t))})(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const a=o.const("_errs",c.default.errors);y(e,a),o.var(t,i._`${a} === ${c.default.errors}`)}(t,r):(0,e.boolOrEmptySchema)(t,r)}function h({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function g(e){return"boolean"!=typeof e.schema}function v(e){(0,l.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:r,opts:o,self:n}=e;t.$ref&&o.ignoreKeywordsWithRef&&(0,l.schemaHasRulesButRef)(t,n.RULES)&&n.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function y(e,r){if(e.opts.jtd)return $(e,[],!1,r);const o=(0,t.getSchemaTypes)(e.schema);$(e,o,!(0,t.coerceAndCheckDataType)(e,o),r)}function b({gen:e,schemaEnv:t,schema:r,errSchemaPath:o,opts:n}){const a=r.$comment;if(!0===n.$comment)e.code(i._`${c.default.self}.logger.log(${a})`);else if("function"==typeof n.$comment){const r=i.str`${o}/$comment`,n=e.scopeValue("root",{ref:t.root});e.code(i._`${c.default.self}.opts.$comment(${a}, ${r}, ${n}.schema)`)}}function $(e,t,n,a){const{gen:s,schema:d,data:u,allErrors:p,opts:f,self:m}=e,{RULES:h}=m;function g(l){(0,r.shouldUseGroup)(d,l)&&(l.type?(s.if((0,o.checkDataType)(l.type,u,f.strictNumbers)),w(e,l),1===t.length&&t[0]===l.type&&n&&(s.else(),(0,o.reportTypeError)(e)),s.endIf()):w(e,l),p||s.if(i._`${c.default.errors} === ${a||0}`))}!d.$ref||!f.ignoreKeywordsWithRef&&(0,l.schemaHasRulesButRef)(d,h)?(f.jtd||function(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;(function(e,t){if(!t.length)return;if(!e.dataTypes.length)return void(e.dataTypes=t);t.forEach(t=>{k(e.dataTypes,t)||P(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)}),function(e,t){const r=[];for(const o of e.dataTypes)k(t,o)?r.push(o):t.includes("integer")&&"number"===o&&r.push("integer");e.dataTypes=r}(e,t)})(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&P(e,"use allowUnionTypes to allow union type keyword")}(e,t);!function(e,t){const o=e.self.RULES.all;for(const n in o){const a=o[n];if("object"==typeof a&&(0,r.shouldUseRule)(e.schema,a)){const{type:r}=a.definition;r.length&&!r.some(e=>_(t,e))&&P(e,`missing type "${r.join(",")}" for keyword "${n}"`)}}}(e,e.dataTypes)}(e,t),s.block(()=>{for(const e of h.rules)g(e);g(h.post)})):s.block(()=>E(e,"$ref",h.all.$ref.definition))}function w(e,t){const{gen:o,schema:a,opts:{useDefaults:s}}=e;s&&(0,n.assignDefaults)(e,t.type),o.block(()=>{for(const o of t.rules)(0,r.shouldUseRule)(a,o)&&E(e,o.keyword,o.definition,t.type)})}function _(e,t){return e.includes(t)||"number"===t&&e.includes("integer")}function k(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function P(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,l.checkStrictMode)(e,t,e.opts.strictTypes)}Be.validateFunctionCode=function(t){g(t)&&(v(t),h(t))?function(e){const{schema:t,opts:r,gen:o}=e;p(e,()=>{r.$comment&&t.$comment&&b(e),function(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,l.checkStrictMode)(e,"default is ignored in the schema root")}(e),o.let(c.default.vErrors,null),o.let(c.default.errors,0),r.unevaluated&&function(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",i._`${r}.evaluated`),t.if(i._`${e.evaluated}.dynamicProps`,()=>t.assign(i._`${e.evaluated}.props`,i._`undefined`)),t.if(i._`${e.evaluated}.dynamicItems`,()=>t.assign(i._`${e.evaluated}.items`,i._`undefined`))}(e),y(e),function(e){const{gen:t,schemaEnv:r,validateName:o,ValidationError:n,opts:a}=e;r.$async?t.if(i._`${c.default.errors} === 0`,()=>t.return(c.default.data),()=>t.throw(i._`new ${n}(${c.default.vErrors})`)):(t.assign(i._`${o}.errors`,c.default.vErrors),a.unevaluated&&function({gen:e,evaluated:t,props:r,items:o}){r instanceof i.Name&&e.assign(i._`${t}.props`,r);o instanceof i.Name&&e.assign(i._`${t}.items`,o)}(e),t.return(i._`${c.default.errors} === 0`))}(e)})}(t):p(t,()=>(0,e.topBoolOrEmptySchema)(t))};class S{constructor(e,t,r){if((0,a.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,l.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",N(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,a.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",c.default.errors))}result(e,t,r){this.failResult((0,i.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,i.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(i._`${t} !== undefined && (${(0,i.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t)return this.setParams(t),this._error(e,r),void this.setParams({});this._error(e,r)}_error(e,t){(e?u.reportExtraError:u.reportError)(this,this.def.error,t)}$dataError(){(0,u.reportError)(this,this.def.$dataError||u.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,u.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=i.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=i.nil,t=i.nil){if(!this.$data)return;const{gen:r,schemaCode:o,schemaType:n,def:a}=this;r.if((0,i.or)(i._`${o} === undefined`,t)),e!==i.nil&&r.assign(e,!0),(n.length||a.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==i.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:n,it:a}=this;return(0,i.or)(function(){if(r.length){if(!(t instanceof i.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return i._`${(0,o.checkDataTypes)(e,t,a.opts.strictNumbers,o.DataType.Wrong)}`}return i.nil}(),function(){if(n.validateSchema){const r=e.scopeValue("validate$data",{ref:n.validateSchema});return i._`!${r}(${t})`}return i.nil}())}subschema(e,t){const r=(0,s.getSubschema)(this.it,e);(0,s.extendSubschemaData)(r,this.it,e),(0,s.extendSubschemaMode)(r,e);const o={...this.it,...r,items:void 0,props:void 0};return m(o,t),o}mergeEvaluated(e,t){const{it:r,gen:o}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=l.mergeEvaluated.props(o,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=l.mergeEvaluated.items(o,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:o}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return o.if(t,()=>this.mergeEvaluated(e,i.Name)),!0}}function E(e,t,r,o){const n=new S(e,r,t);"code"in r?r.code(n,o):n.$data&&r.validate?(0,a.funcKeywordCode)(n,r):"macro"in r?(0,a.macroKeywordCode)(n,r):(r.compile||r.validate)&&(0,a.funcKeywordCode)(n,r)}Be.KeywordCxt=S;const j=/^\/(?:[^~]|~0|~1)*$/,O=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function N(e,{dataLevel:t,dataNames:r,dataPathArr:o}){let n,a;if(""===e)return c.default.rootData;if("/"===e[0]){if(!j.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);n=e,a=c.default.rootData}else{const s=O.exec(e);if(!s)throw new Error(`Invalid JSON-pointer: ${e}`);const i=+s[1];if(n=s[2],"#"===n){if(i>=t)throw new Error(u("property/index",i));return o[t-i]}if(i>t)throw new Error(u("data",i));if(a=r[t-i],!n)return a}let s=a;const d=n.split("/");for(const e of d)e&&(a=i._`${a}${(0,i.getProperty)((0,l.unescapeJsonPointer)(e))}`,s=i._`${s} && ${a}`);return s;function u(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}return Be.getData=N,Be}var Ut,qt={};function Kt(){if(Ut)return qt;Ut=1,Object.defineProperty(qt,"__esModule",{value:!0});class e extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}return qt.default=e,qt}var Lt,Bt={};function Ht(){if(Lt)return Bt;Lt=1,Object.defineProperty(Bt,"__esModule",{value:!0});const e=Vt();class t extends Error{constructor(t,r,o,n){super(n||`can't resolve reference ${o} from id ${r}`),this.missingRef=(0,e.resolveUrl)(t,r,o),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(t,this.missingRef))}}return Bt.default=t,Bt}var Gt,Jt={};function Wt(){if(Gt)return Jt;Gt=1,Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.resolveSchema=Jt.getCompilingSchema=Jt.resolveRef=Jt.compileSchema=Jt.SchemaEnv=void 0;const e=tt(),t=Kt(),r=dt(),o=Vt(),n=nt(),a=zt();class s{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,o.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function i(n){const s=d.call(this,n);if(s)return s;const i=(0,o.getFullPath)(this.opts.uriResolver,n.root.baseId),{es5:c,lines:l}=this.opts.code,{ownProperties:u}=this.opts,p=new e.CodeGen(this.scope,{es5:c,lines:l,ownProperties:u});let f;n.$async&&(f=p.scopeValue("Error",{ref:t.default,code:e._`require("ajv/dist/runtime/validation_error").default`}));const m=p.scopeName("validate");n.validateName=m;const h={gen:p,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:p.scopeValue("schema",!0===this.opts.code.source?{ref:n.schema,code:(0,e.stringify)(n.schema)}:{ref:n.schema}),validateName:m,ValidationError:f,schema:n.schema,schemaEnv:n,rootId:i,baseId:n.baseId||i,schemaPath:e.nil,errSchemaPath:n.schemaPath||(this.opts.jtd?"":"#"),errorPath:e._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(n),(0,a.validateFunctionCode)(h),p.optimize(this.opts.code.optimize);const t=p.toString();g=`${p.scopeRefs(r.default.scope)}return ${t}`,this.opts.code.process&&(g=this.opts.code.process(g,n));const o=new Function(`${r.default.self}`,`${r.default.scope}`,g)(this,this.scope.get());if(this.scope.value(m,{ref:o}),o.errors=null,o.schema=n.schema,o.schemaEnv=n,n.$async&&(o.$async=!0),!0===this.opts.code.source&&(o.source={validateName:m,validateCode:t,scopeValues:p._values}),this.opts.unevaluated){const{props:t,items:r}=h;o.evaluated={props:t instanceof e.Name?void 0:t,items:r instanceof e.Name?void 0:r,dynamicProps:t instanceof e.Name,dynamicItems:r instanceof e.Name},o.source&&(o.source.evaluated=(0,e.stringify)(o.evaluated))}return n.validate=o,n}catch(e){throw delete n.validate,delete n.validateName,g&&this.logger.error("Error compiling schema, function code:",g),e}finally{this._compilations.delete(n)}}function c(e){return(0,o.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:i.call(this,e)}function d(e){for(const t of this._compilations)if(l(t,e))return t}function l(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function u(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||p.call(this,e,t)}function p(e,t){const r=this.opts.uriResolver.parse(t),n=(0,o._getFullPath)(this.opts.uriResolver,r);let a=(0,o.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===a)return m.call(this,r,e);const c=(0,o.normalizeId)(n),d=this.refs[c]||this.schemas[c];if("string"==typeof d){const t=p.call(this,e,d);if("object"!=typeof(null==t?void 0:t.schema))return;return m.call(this,r,t)}if("object"==typeof(null==d?void 0:d.schema)){if(d.validate||i.call(this,d),c===(0,o.normalizeId)(t)){const{schema:t}=d,{schemaId:r}=this.opts,n=t[r];return n&&(a=(0,o.resolveUrl)(this.opts.uriResolver,a,n)),new s({schema:t,schemaId:r,root:e,baseId:a})}return m.call(this,r,d)}}Jt.SchemaEnv=s,Jt.compileSchema=i,Jt.resolveRef=function(e,t,r){var n;r=(0,o.resolveUrl)(this.opts.uriResolver,t,r);const a=e.refs[r];if(a)return a;let i=u.call(this,e,r);if(void 0===i){const o=null===(n=e.localRefs)||void 0===n?void 0:n[r],{schemaId:a}=this.opts;o&&(i=new s({schema:o,schemaId:a,root:e,baseId:t}))}return void 0!==i?e.refs[r]=c.call(this,i):void 0},Jt.getCompilingSchema=d,Jt.resolveSchema=p;const f=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function m(e,{baseId:t,schema:r,root:a}){var i;if("/"!==(null===(i=e.fragment)||void 0===i?void 0:i[0]))return;for(const a of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;const e=r[(0,n.unescapeFragment)(a)];if(void 0===e)return;const s="object"==typeof(r=e)&&r[this.opts.schemaId];!f.has(a)&&s&&(t=(0,o.resolveUrl)(this.opts.uriResolver,t,s))}let c;if("boolean"!=typeof r&&r.$ref&&!(0,n.schemaHasRulesButRef)(r,this.RULES)){const e=(0,o.resolveUrl)(this.opts.uriResolver,t,r.$ref);c=p.call(this,a,e)}const{schemaId:d}=this.opts;return c=c||new s({schema:r,schemaId:d,root:a,baseId:t}),c.schema!==c.root.schema?c:void 0}return Jt}var Yt,Qt,Xt,Zt,er,tr,rr,or,nr,ar={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1},sr={},ir={exports:{}};function cr(){if(Zt)return Xt;Zt=1;const{HEX:e}=Qt?Yt:(Qt=1,Yt={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}}),t=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function r(e){if(s(e,".")<3)return{host:e,isIPV4:!1};const r=e.match(t)||[],[o]=r;return o?{host:a(o,"."),isIPV4:!0}:{host:e,isIPV4:!1}}function o(t,r=!1){let o="",n=!0;for(const r of t){if(void 0===e[r])return;"0"!==r&&!0===n&&(n=!1),n||(o+=r)}return r&&0===o.length&&(o="0"),o}function n(e){if(s(e,":")<2)return{host:e,isIPV6:!1};const t=function(e){let t=0;const r={error:!1,address:"",zone:""},n=[],a=[];let s=!1,i=!1,c=!1;function d(){if(a.length){if(!1===s){const e=o(a);if(void 0===e)return r.error=!0,!1;n.push(e)}a.length=0}return!0}for(let o=0;o<e.length;o++){const l=e[o];if("["!==l&&"]"!==l)if(":"!==l)if("%"===l){if(!d())break;s=!0}else a.push(l);else{if(!0===i&&(c=!0),!d())break;if(t++,n.push(":"),t>7){r.error=!0;break}o-1>=0&&":"===e[o-1]&&(i=!0)}}return a.length&&(s?r.zone=a.join(""):c?n.push(a.join("")):n.push(o(a))),r.address=n.join(""),r}(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,r=t.address;return t.zone&&(e+="%"+t.zone,r+="%25"+t.zone),{host:e,escapedHost:r,isIPV6:!0}}}function a(e,t){let r="",o=!0;const n=e.length;for(let a=0;a<n;a++){const s=e[a];"0"===s&&o?(a+1<=n&&e[a+1]===t||a+1===n)&&(r+=s,o=!1):(o=s===t,r+=s)}return r}function s(e,t){let r=0;for(let o=0;o<e.length;o++)e[o]===t&&r++;return r}const i=/^\.\.?\//u,c=/^\/\.(?:\/|$)/u,d=/^\/\.\.(?:\/|$)/u,l=/^\/?(?:.|\n)*?(?=\/|$)/u;return Xt={recomposeAuthority:function(e){const t=[];if(void 0!==e.userinfo&&(t.push(e.userinfo),t.push("@")),void 0!==e.host){let o=unescape(e.host);const a=r(o);if(a.isIPV4)o=a.host;else{const t=n(a.host);o=!0===t.isIPV6?`[${t.escapedHost}]`:e.host}t.push(o)}return"number"!=typeof e.port&&"string"!=typeof e.port||(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0},normalizeComponentEncoding:function(e,t){const r=!0!==t?escape:unescape;return void 0!==e.scheme&&(e.scheme=r(e.scheme)),void 0!==e.userinfo&&(e.userinfo=r(e.userinfo)),void 0!==e.host&&(e.host=r(e.host)),void 0!==e.path&&(e.path=r(e.path)),void 0!==e.query&&(e.query=r(e.query)),void 0!==e.fragment&&(e.fragment=r(e.fragment)),e},removeDotSegments:function(e){const t=[];for(;e.length;)if(e.match(i))e=e.replace(i,"");else if(e.match(c))e=e.replace(c,"/");else if(e.match(d))e=e.replace(d,"/"),t.pop();else if("."===e||".."===e)e="";else{const r=e.match(l);if(!r)throw new Error("Unexpected dot segment condition");{const o=r[0];e=e.slice(o.length),t.push(o)}}return t.join("")},normalizeIPv4:r,normalizeIPv6:n,stringArrayToHexStripped:o}}function dr(){if(rr)return ir.exports;rr=1;const{normalizeIPv6:e,normalizeIPv4:t,removeDotSegments:r,recomposeAuthority:o,normalizeComponentEncoding:n}=cr(),a=function(){if(tr)return er;tr=1;const e=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function r(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}function o(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function n(e){const t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}const a={scheme:"http",domainHost:!0,parse:o,serialize:n},s={scheme:"ws",domainHost:!0,parse:function(e){return e.secure=r(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e},serialize:function(e){if(e.port!==(r(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[t,r]=e.resourceName.split("?");e.path=t&&"/"!==t?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}},i={http:a,https:{scheme:"https",domainHost:a.domainHost,parse:o,serialize:n},ws:s,wss:{scheme:"wss",domainHost:s.domainHost,parse:s.parse,serialize:s.serialize},urn:{scheme:"urn",parse:function(e,r){if(!e.path)return e.error="URN can not be parsed",e;const o=e.path.match(t);if(o){const t=r.scheme||e.scheme||"urn";e.nid=o[1].toLowerCase(),e.nss=o[2];const n=`${t}:${r.nid||e.nid}`,a=i[n];e.path=void 0,a&&(e=a.parse(e,r))}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,t){const r=t.scheme||e.scheme||"urn",o=e.nid.toLowerCase(),n=`${r}:${t.nid||o}`,a=i[n];a&&(e=a.serialize(e,t));const s=e,c=e.nss;return s.path=`${o||t.nid}:${c}`,t.skipEscape=!0,s},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(t,r){const o=t;return o.uuid=o.nss,o.nss=void 0,r.tolerant||o.uuid&&e.test(o.uuid)||(o.error=o.error||"UUID is not valid."),o},serialize:function(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t},skipNormalize:!0}};return er=i}();function s(e,t,o,n){const a={};return n||(e=l(i(e,o),o),t=l(i(t,o),o)),!(o=o||{}).tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||""),a.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||""),a.query=t.query):(t.path?("/"===t.path.charAt(0)?a.path=r(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?a.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:a.path=t.path:a.path="/"+t.path,a.path=r(a.path)),a.query=t.query):(a.path=e.path,void 0!==t.query?a.query=t.query:a.query=e.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function i(e,t){const n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},s=Object.assign({},t),i=[],c=a[(s.scheme||n.scheme||"").toLowerCase()];c&&c.serialize&&c.serialize(n,s),void 0!==n.path&&(s.skipEscape?n.path=unescape(n.path):(n.path=escape(n.path),void 0!==n.scheme&&(n.path=n.path.split("%3A").join(":")))),"suffix"!==s.reference&&n.scheme&&i.push(n.scheme,":");const d=o(n);if(void 0!==d&&("suffix"!==s.reference&&i.push("//"),i.push(d),n.path&&"/"!==n.path.charAt(0)&&i.push("/")),void 0!==n.path){let e=n.path;s.absolutePath||c&&c.absolutePath||(e=r(e)),void 0===d&&(e=e.replace(/^\/\//u,"/%2F")),i.push(e)}return void 0!==n.query&&i.push("?",n.query),void 0!==n.fragment&&i.push("#",n.fragment),i.join("")}const c=Array.from({length:127},(e,t)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(t)));const d=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function l(r,o){const n=Object.assign({},o),s={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=-1!==r.indexOf("%");let l=!1;"suffix"===n.reference&&(r=(n.scheme?n.scheme+":":"")+"//"+r);const u=r.match(d);if(u){if(s.scheme=u[1],s.userinfo=u[3],s.host=u[4],s.port=parseInt(u[5],10),s.path=u[6]||"",s.query=u[7],s.fragment=u[8],isNaN(s.port)&&(s.port=u[5]),s.host){const r=t(s.host);if(!1===r.isIPV4){const t=e(r.host);s.host=t.host.toLowerCase(),l=t.isIPV6}else s.host=r.host,l=!0}void 0!==s.scheme||void 0!==s.userinfo||void 0!==s.host||void 0!==s.port||void 0!==s.query||s.path?void 0===s.scheme?s.reference="relative":void 0===s.fragment?s.reference="absolute":s.reference="uri":s.reference="same-document",n.reference&&"suffix"!==n.reference&&n.reference!==s.reference&&(s.error=s.error||"URI is not a "+n.reference+" reference.");const r=a[(n.scheme||s.scheme||"").toLowerCase()];if(!(n.unicodeSupport||r&&r.unicodeSupport)&&s.host&&(n.domainHost||r&&r.domainHost)&&!1===l&&function(e){let t=0;for(let r=0,o=e.length;r<o;++r)if(t=e.charCodeAt(r),t>126||c[t])return!0;return!1}(s.host))try{s.host=URL.domainToASCII(s.host.toLowerCase())}catch(e){s.error=s.error||"Host's domain name can not be converted to ASCII: "+e}(!r||r&&!r.skipNormalize)&&(i&&void 0!==s.scheme&&(s.scheme=unescape(s.scheme)),i&&void 0!==s.host&&(s.host=unescape(s.host)),s.path&&(s.path=escape(unescape(s.path))),s.fragment&&(s.fragment=encodeURI(decodeURIComponent(s.fragment)))),r&&r.parse&&r.parse(s,n)}else s.error=s.error||"URI can not be parsed.";return s}const u={SCHEMES:a,normalize:function(e,t){return"string"==typeof e?e=i(l(e,t),t):"object"==typeof e&&(e=l(i(e,t),t)),e},resolve:function(e,t,r){const o=Object.assign({scheme:"null"},r);return i(s(l(e,o),l(t,o),o,!0),{...o,skipEscape:!0})},resolveComponents:s,equal:function(e,t,r){return"string"==typeof e?(e=unescape(e),e=i(n(l(e,r),!0),{...r,skipEscape:!0})):"object"==typeof e&&(e=i(n(e,!0),{...r,skipEscape:!0})),"string"==typeof t?(t=unescape(t),t=i(n(l(t,r),!0),{...r,skipEscape:!0})):"object"==typeof t&&(t=i(n(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()},serialize:i,parse:l};return ir.exports=u,ir.exports.default=u,ir.exports.fastUri=u,ir.exports}function lr(){return nr||(nr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=zt();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=tt();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const o=Kt(),n=Ht(),a=mt(),s=Wt(),i=tt(),c=Vt(),d=bt(),l=nt(),u=ar,p=function(){if(or)return sr;or=1,Object.defineProperty(sr,"__esModule",{value:!0});const e=dr();return e.code='require("ajv/dist/runtime/uri").default',sr.default=e,sr}(),f=(e,t)=>new RegExp(e,t);f.code="new RegExp";const m=["removeAdditional","useDefaults","coerceTypes"],h=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},v={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function y(e){var t,r,o,n,a,s,i,c,d,l,u,m,h,g,v,y,b,$,w,_,k,P,S,E,j;const O=e.strict,N=null===(t=e.code)||void 0===t?void 0:t.optimize,I=!0===N||void 0===N?1:N||0,x=null!==(o=null===(r=e.code)||void 0===r?void 0:r.regExp)&&void 0!==o?o:f,T=null!==(n=e.uriResolver)&&void 0!==n?n:p.default;return{strictSchema:null===(s=null!==(a=e.strictSchema)&&void 0!==a?a:O)||void 0===s||s,strictNumbers:null===(c=null!==(i=e.strictNumbers)&&void 0!==i?i:O)||void 0===c||c,strictTypes:null!==(l=null!==(d=e.strictTypes)&&void 0!==d?d:O)&&void 0!==l?l:"log",strictTuples:null!==(m=null!==(u=e.strictTuples)&&void 0!==u?u:O)&&void 0!==m?m:"log",strictRequired:null!==(g=null!==(h=e.strictRequired)&&void 0!==h?h:O)&&void 0!==g&&g,code:e.code?{...e.code,optimize:I,regExp:x}:{optimize:I,regExp:x},loopRequired:null!==(v=e.loopRequired)&&void 0!==v?v:200,loopEnum:null!==(y=e.loopEnum)&&void 0!==y?y:200,meta:null===(b=e.meta)||void 0===b||b,messages:null===($=e.messages)||void 0===$||$,inlineRefs:null===(w=e.inlineRefs)||void 0===w||w,schemaId:null!==(_=e.schemaId)&&void 0!==_?_:"$id",addUsedSchema:null===(k=e.addUsedSchema)||void 0===k||k,validateSchema:null===(P=e.validateSchema)||void 0===P||P,validateFormats:null===(S=e.validateFormats)||void 0===S||S,unicodeRegExp:null===(E=e.unicodeRegExp)||void 0===E||E,int32range:null===(j=e.int32range)||void 0===j||j,uriResolver:T}}class b{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...y(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new i.ValueScope({scope:{},prefixes:h,es5:t,lines:r}),this.logger=function(e){if(!1===e)return E;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),$.call(this,g,e,"NOT SUPPORTED"),$.call(this,v,e,"DEPRECATED","warn"),this._metaOpts=S.call(this),e.formats&&k.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&P.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),_.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:r}=this.opts;let o=u;"id"===r&&(o={...u},o.id=o.$id,delete o.$id),t&&e&&this.addMetaSchema(o,o[r],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const o=r(t);return"$async"in r||(this.errors=r.errors),o}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return o.call(this,e,t);async function o(e,t){await a.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||s.call(this,r)}async function a(e){e&&!this.getSchema(e)&&await o.call(this,{$ref:e},!0)}async function s(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof n.default))throw t;return i.call(this,t),await c.call(this,t.missingSchema),s.call(this,e)}}function i({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const r=await d.call(this,e);this.refs[e]||await a.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function d(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,o=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,o);return this}let n;if("object"==typeof e){const{schemaId:t}=this.opts;if(n=e[t],void 0!==n&&"string"!=typeof n)throw new Error(`schema ${t} must be string`)}return t=(0,c.normalizeId)(t||n),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,o,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const o=this.validate(r,e);if(!o&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return o}getSchema(e){let t;for(;"string"==typeof(t=w.call(this,e));)e=t;if(void 0===t){const{schemaId:r}=this.opts,o=new s.SchemaEnv({schema:{},schemaId:r});if(t=s.resolveSchema.call(this,o,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=w.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,c.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(r=(t=e).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(O.call(this,r,t),!t)return(0,l.eachItem)(r,e=>N.call(this,e)),this;x.call(this,t);const o={...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)};return(0,l.eachItem)(r,0===o.type.length?e=>N.call(this,e,o):e=>o.type.forEach(t=>N.call(this,e,o,t))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex(t=>t.keyword===e);t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map(e=>`${r}${e.instancePath} ${e.message}`).reduce((e,r)=>e+t+r):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const o of t){const t=o.split("/").slice(1);let n=e;for(const e of t)n=n[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:o}=t.definition,a=n[e];o&&a&&(n[e]=C(a))}}return e}_removeAllSchemas(e,t){for(const r in e){const o=e[r];t&&!t.test(r)||("string"==typeof o?delete e[r]:o&&!o.meta&&(this._cache.delete(o.schema),delete e[r]))}}_addSchema(e,t,r,o=this.opts.validateSchema,n=this.opts.addUsedSchema){let a;const{schemaId:i}=this.opts;if("object"==typeof e)a=e[i];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let d=this._cache.get(e);if(void 0!==d)return d;r=(0,c.normalizeId)(a||r);const l=c.getSchemaRefs.call(this,e,r);return d=new s.SchemaEnv({schema:e,schemaId:i,meta:t,baseId:r,localRefs:l}),this._cache.set(d.schema,d),n&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=d),o&&this.validateSchema(e,!0),d}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):s.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,e)}finally{this.opts=t}}}function $(e,t,r,o="error"){for(const n in e){const a=n;a in t&&this.logger[o](`${r}: option ${n}. ${e[a]}`)}}function w(e){return e=(0,c.normalizeId)(e),this.schemas[e]||this.refs[e]}function _(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function k(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function P(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function S(){const e={...this.opts};for(const t of m)delete e[t];return e}b.ValidationError=o.default,b.MissingRefError=n.default,e.default=b;const E={log(){},warn(){},error(){}};const j=/^[a-z_$][a-z0-9_$:-]*$/i;function O(e,t){const{RULES:r}=this;if((0,l.eachItem)(e,e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!j.test(e))throw new Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function N(e,t,r){var o;const n=null==t?void 0:t.post;if(r&&n)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:a}=this;let s=n?a.post:a.rules.find(({type:e})=>e===r);if(s||(s={type:r,rules:[]},a.rules.push(s)),a.keywords[e]=!0,!t)return;const i={keyword:e,definition:{...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)}};t.before?I.call(this,s,i,t.before):s.rules.push(i),a.all[e]=i,null===(o=t.implements)||void 0===o||o.forEach(e=>this.addKeyword(e))}function I(e,t,r){const o=e.rules.findIndex(e=>e.keyword===r);o>=0?e.rules.splice(o,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function x(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=C(t)),e.validateSchema=this.compile(t,!0))}const T={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function C(e){return{anyOf:[e,T]}}}(Le)),Le}var ur,pr={},fr={},mr={};var hr,gr,vr={};function yr(){if(hr)return vr;hr=1,Object.defineProperty(vr,"__esModule",{value:!0}),vr.callRef=vr.getValidate=void 0;const e=Ht(),t=Et(),r=tt(),o=dt(),n=Wt(),a=nt(),s={keyword:"$ref",schemaType:"string",code(t){const{gen:o,schema:a,it:s}=t,{baseId:d,schemaEnv:l,validateName:u,opts:p,self:f}=s,{root:m}=l;if(("#"===a||"#/"===a)&&d===m.baseId)return function(){if(l===m)return c(t,u,l,l.$async);const e=o.scopeValue("root",{ref:m});return c(t,r._`${e}.validate`,m,m.$async)}();const h=n.resolveRef.call(f,m,d,a);if(void 0===h)throw new e.default(s.opts.uriResolver,d,a);return h instanceof n.SchemaEnv?function(e){const r=i(t,e);c(t,r,e,e.$async)}(h):function(e){const n=o.scopeValue("schema",!0===p.code.source?{ref:e,code:(0,r.stringify)(e)}:{ref:e}),s=o.name("valid"),i=t.subschema({schema:e,dataTypes:[],schemaPath:r.nil,topSchemaRef:n,errSchemaPath:a},s);t.mergeEvaluated(i),t.ok(s)}(h)}};function i(e,t){const{gen:o}=e;return t.validate?o.scopeValue("validate",{ref:t.validate}):r._`${o.scopeValue("wrapper",{ref:t})}.validate`}function c(e,n,s,i){const{gen:c,it:d}=e,{allErrors:l,schemaEnv:u,opts:p}=d,f=p.passContext?o.default.this:r.nil;function m(e){const t=r._`${e}.errors`;c.assign(o.default.vErrors,r._`${o.default.vErrors} === null ? ${t} : ${o.default.vErrors}.concat(${t})`),c.assign(o.default.errors,r._`${o.default.vErrors}.length`)}function h(e){var t;if(!d.opts.unevaluated)return;const o=null===(t=null==s?void 0:s.validate)||void 0===t?void 0:t.evaluated;if(!0!==d.props)if(o&&!o.dynamicProps)void 0!==o.props&&(d.props=a.mergeEvaluated.props(c,o.props,d.props));else{const t=c.var("props",r._`${e}.evaluated.props`);d.props=a.mergeEvaluated.props(c,t,d.props,r.Name)}if(!0!==d.items)if(o&&!o.dynamicItems)void 0!==o.items&&(d.items=a.mergeEvaluated.items(c,o.items,d.items));else{const t=c.var("items",r._`${e}.evaluated.items`);d.items=a.mergeEvaluated.items(c,t,d.items,r.Name)}}i?function(){if(!u.$async)throw new Error("async schema referenced by sync schema");const o=c.let("valid");c.try(()=>{c.code(r._`await ${(0,t.callValidateCode)(e,n,f)}`),h(n),l||c.assign(o,!0)},e=>{c.if(r._`!(${e} instanceof ${d.ValidationError})`,()=>c.throw(e)),m(e),l||c.assign(o,!1)}),e.ok(o)}():e.result((0,t.callValidateCode)(e,n,f),()=>h(n),()=>m(n))}return vr.getValidate=i,vr.callRef=c,vr.default=s,vr}function br(){if(gr)return fr;gr=1,Object.defineProperty(fr,"__esModule",{value:!0});const e=function(){if(ur)return mr;ur=1,Object.defineProperty(mr,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return mr.default=e,mr}(),t=yr(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return fr.default=r,fr}var $r,wr={},_r={};var kr,Pr={};var Sr,Er,jr={},Or={};function Nr(){if(Er)return jr;Er=1,Object.defineProperty(jr,"__esModule",{value:!0});const e=tt(),t=nt(),r=function(){if(Sr)return Or;function e(e){const t=e.length;let r,o=0,n=0;for(;n<t;)o++,r=e.charCodeAt(n++),r>=55296&&r<=56319&&n<t&&(r=e.charCodeAt(n),56320==(64512&r)&&n++);return o}return Sr=1,Object.defineProperty(Or,"__esModule",{value:!0}),Or.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Or}(),o={message({keyword:t,schemaCode:r}){const o="maxLength"===t?"more":"fewer";return e.str`must NOT have ${o} than ${r} characters`},params:({schemaCode:t})=>e._`{limit: ${t}}`},n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:o,code(o){const{keyword:n,data:a,schemaCode:s,it:i}=o,c="maxLength"===n?e.operators.GT:e.operators.LT,d=!1===i.opts.unicode?e._`${a}.length`:e._`${(0,t.useFunc)(o.gen,r.default)}(${a})`;o.fail$data(e._`${d} ${c} ${s}`)}};return jr.default=n,jr}var Ir,xr={};var Tr,Cr={};var Rr,Ar={};function Fr(){if(Rr)return Ar;Rr=1,Object.defineProperty(Ar,"__esModule",{value:!0});const e=Et(),t=tt(),r=nt(),o={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>t.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>t._`{missingProperty: ${e}}`},code(o){const{gen:n,schema:a,schemaCode:s,data:i,$data:c,it:d}=o,{opts:l}=d;if(!c&&0===a.length)return;const u=a.length>=l.loopRequired;if(d.allErrors?function(){if(u||c)o.block$data(t.nil,p);else for(const t of a)(0,e.checkReportMissingProp)(o,t)}():function(){const r=n.let("missing");if(u||c){const a=n.let("valid",!0);o.block$data(a,()=>function(r,a){o.setParams({missingProperty:r}),n.forOf(r,s,()=>{n.assign(a,(0,e.propertyInData)(n,i,r,l.ownProperties)),n.if((0,t.not)(a),()=>{o.error(),n.break()})},t.nil)}(r,a)),o.ok(a)}else n.if((0,e.checkMissingProp)(o,a,r)),(0,e.reportMissingProp)(o,r),n.else()}(),l.strictRequired){const e=o.parentSchema.properties,{definedProperties:t}=o.it;for(const o of a)if(void 0===(null==e?void 0:e[o])&&!t.has(o)){const e=`required property "${o}" is not defined at "${d.schemaEnv.baseId+d.errSchemaPath}" (strictRequired)`;(0,r.checkStrictMode)(d,e,d.opts.strictRequired)}}function p(){n.forOf("prop",s,t=>{o.setParams({missingProperty:t}),n.if((0,e.noPropertyInData)(n,i,t,l.ownProperties),()=>o.error())})}}};return Ar.default=o,Ar}var Mr,Dr={};var Vr,zr,Ur={},qr={};function Kr(){if(Vr)return qr;Vr=1,Object.defineProperty(qr,"__esModule",{value:!0});const e=Ct();return e.code='require("ajv/dist/runtime/equal").default',qr.default=e,qr}function Lr(){if(zr)return Ur;zr=1,Object.defineProperty(Ur,"__esModule",{value:!0});const e=bt(),t=tt(),r=nt(),o=Kr(),n={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:r}})=>t.str`must NOT have duplicate items (items ## ${r} and ${e} are identical)`,params:({params:{i:e,j:r}})=>t._`{i: ${e}, j: ${r}}`},code(n){const{gen:a,data:s,$data:i,schema:c,parentSchema:d,schemaCode:l,it:u}=n;if(!i&&!c)return;const p=a.let("valid"),f=d.items?(0,e.getSchemaTypes)(d.items):[];function m(r,o){const i=a.name("item"),c=(0,e.checkDataTypes)(f,i,u.opts.strictNumbers,e.DataType.Wrong),d=a.const("indices",t._`{}`);a.for(t._`;${r}--;`,()=>{a.let(i,t._`${s}[${r}]`),a.if(c,t._`continue`),f.length>1&&a.if(t._`typeof ${i} == "string"`,t._`${i} += "_"`),a.if(t._`typeof ${d}[${i}] == "number"`,()=>{a.assign(o,t._`${d}[${i}]`),n.error(),a.assign(p,!1).break()}).code(t._`${d}[${i}] = ${r}`)})}function h(e,i){const c=(0,r.useFunc)(a,o.default),d=a.name("outer");a.label(d).for(t._`;${e}--;`,()=>a.for(t._`${i} = ${e}; ${i}--;`,()=>a.if(t._`${c}(${s}[${e}], ${s}[${i}])`,()=>{n.error(),a.assign(p,!1).break(d)})))}n.block$data(p,function(){const e=a.let("i",t._`${s}.length`),r=a.let("j");n.setParams({i:e,j:r}),a.assign(p,!0),a.if(t._`${e} > 1`,()=>(f.length>0&&!f.some(e=>"object"===e||"array"===e)?m:h)(e,r))},t._`${l} === false`),n.ok(p)}};return Ur.default=n,Ur}var Br,Hr={};var Gr,Jr,Wr={};function Yr(){if(Gr)return Wr;Gr=1,Object.defineProperty(Wr,"__esModule",{value:!0});const e=tt(),t=nt(),r=Kr(),o={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:t})=>e._`{allowedValues: ${t}}`},code(o){const{gen:n,data:a,$data:s,schema:i,schemaCode:c,it:d}=o;if(!s&&0===i.length)throw new Error("enum must have non-empty array");const l=i.length>=d.opts.loopEnum;let u;const p=()=>null!=u?u:u=(0,t.useFunc)(n,r.default);let f;if(l||s)f=n.let("valid"),o.block$data(f,function(){n.assign(f,!1),n.forOf("v",c,t=>n.if(e._`${p()}(${a}, ${t})`,()=>n.assign(f,!0).break()))});else{if(!Array.isArray(i))throw new Error("ajv implementation error");const t=n.const("vSchema",c);f=(0,e.or)(...i.map((r,o)=>function(t,r){const o=i[r];return"object"==typeof o&&null!==o?e._`${p()}(${a}, ${t}[${r}])`:e._`${a} === ${o}`}(t,o)))}o.pass(f)}};return Wr.default=o,Wr}function Qr(){if(Jr)return wr;Jr=1,Object.defineProperty(wr,"__esModule",{value:!0});const e=function(){if($r)return _r;$r=1,Object.defineProperty(_r,"__esModule",{value:!0});const e=tt(),t=e.operators,r={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},o={message:({keyword:t,schemaCode:o})=>e.str`must be ${r[t].okStr} ${o}`,params:({keyword:t,schemaCode:o})=>e._`{comparison: ${r[t].okStr}, limit: ${o}}`},n={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:o,code(t){const{keyword:o,data:n,schemaCode:a}=t;t.fail$data(e._`${n} ${r[o].fail} ${a} || isNaN(${n})`)}};return _r.default=n,_r}(),t=function(){if(kr)return Pr;kr=1,Object.defineProperty(Pr,"__esModule",{value:!0});const e=tt(),t={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:t})=>e.str`must be multiple of ${t}`,params:({schemaCode:t})=>e._`{multipleOf: ${t}}`},code(t){const{gen:r,data:o,schemaCode:n,it:a}=t,s=a.opts.multipleOfPrecision,i=r.let("res"),c=s?e._`Math.abs(Math.round(${i}) - ${i}) > 1e-${s}`:e._`${i} !== parseInt(${i})`;t.fail$data(e._`(${n} === 0 || (${i} = ${o}/${n}, ${c}))`)}};return Pr.default=t,Pr}(),r=Nr(),o=function(){if(Ir)return xr;Ir=1,Object.defineProperty(xr,"__esModule",{value:!0});const e=Et(),t=tt(),r={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>t.str`must match pattern "${e}"`,params:({schemaCode:e})=>t._`{pattern: ${e}}`},code(r){const{data:o,$data:n,schema:a,schemaCode:s,it:i}=r,c=i.opts.unicodeRegExp?"u":"",d=n?t._`(new RegExp(${s}, ${c}))`:(0,e.usePattern)(r,a);r.fail$data(t._`!${d}.test(${o})`)}};return xr.default=r,xr}(),n=function(){if(Tr)return Cr;Tr=1,Object.defineProperty(Cr,"__esModule",{value:!0});const e=tt(),t={message({keyword:t,schemaCode:r}){const o="maxProperties"===t?"more":"fewer";return e.str`must NOT have ${o} than ${r} properties`},params:({schemaCode:t})=>e._`{limit: ${t}}`},r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:t,code(t){const{keyword:r,data:o,schemaCode:n}=t,a="maxProperties"===r?e.operators.GT:e.operators.LT;t.fail$data(e._`Object.keys(${o}).length ${a} ${n}`)}};return Cr.default=r,Cr}(),a=Fr(),s=function(){if(Mr)return Dr;Mr=1,Object.defineProperty(Dr,"__esModule",{value:!0});const e=tt(),t={message({keyword:t,schemaCode:r}){const o="maxItems"===t?"more":"fewer";return e.str`must NOT have ${o} than ${r} items`},params:({schemaCode:t})=>e._`{limit: ${t}}`},r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:t,code(t){const{keyword:r,data:o,schemaCode:n}=t,a="maxItems"===r?e.operators.GT:e.operators.LT;t.fail$data(e._`${o}.length ${a} ${n}`)}};return Dr.default=r,Dr}(),i=Lr(),c=function(){if(Br)return Hr;Br=1,Object.defineProperty(Hr,"__esModule",{value:!0});const e=tt(),t=nt(),r=Kr(),o={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:t})=>e._`{allowedValue: ${t}}`},code(o){const{gen:n,data:a,$data:s,schemaCode:i,schema:c}=o;s||c&&"object"==typeof c?o.fail$data(e._`!${(0,t.useFunc)(n,r.default)}(${a}, ${i})`):o.fail(e._`${c} !== ${a}`)}};return Hr.default=o,Hr}(),d=Yr(),l=[e.default,t.default,r.default,o.default,n.default,a.default,s.default,i.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,d.default];return wr.default=l,wr}var Xr,Zr={},eo={};function to(){if(Xr)return eo;Xr=1,Object.defineProperty(eo,"__esModule",{value:!0}),eo.validateAdditionalItems=void 0;const e=tt(),t=nt(),r={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:t}})=>e.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>e._`{limit: ${t}}`},code(e){const{parentSchema:r,it:n}=e,{items:a}=r;Array.isArray(a)?o(e,a):(0,t.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas')}};function o(r,o){const{gen:n,schema:a,data:s,keyword:i,it:c}=r;c.items=!0;const d=n.const("len",e._`${s}.length`);if(!1===a)r.setParams({len:o.length}),r.pass(e._`${d} <= ${o.length}`);else if("object"==typeof a&&!(0,t.alwaysValidSchema)(c,a)){const a=n.var("valid",e._`${d} <= ${o.length}`);n.if((0,e.not)(a),()=>function(a){n.forRange("i",o.length,d,o=>{r.subschema({keyword:i,dataProp:o,dataPropType:t.Type.Num},a),c.allErrors||n.if((0,e.not)(a),()=>n.break())})}(a)),r.ok(a)}}return eo.validateAdditionalItems=o,eo.default=r,eo}var ro,oo,no={},ao={};function so(){if(ro)return ao;ro=1,Object.defineProperty(ao,"__esModule",{value:!0}),ao.validateTuple=void 0;const e=tt(),t=nt(),r=Et(),o={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:o,it:a}=e;if(Array.isArray(o))return n(e,"additionalItems",o);a.items=!0,(0,t.alwaysValidSchema)(a,o)||e.ok((0,r.validateArray)(e))}};function n(r,o,n=r.schema){const{gen:a,parentSchema:s,data:i,keyword:c,it:d}=r;!function(e){const{opts:r,errSchemaPath:a}=d,s=n.length,i=s===e.minItems&&(s===e.maxItems||!1===e[o]);if(r.strictTuples&&!i){const e=`"${c}" is ${s}-tuple, but minItems or maxItems/${o} are not specified or different at path "${a}"`;(0,t.checkStrictMode)(d,e,r.strictTuples)}}(s),d.opts.unevaluated&&n.length&&!0!==d.items&&(d.items=t.mergeEvaluated.items(a,n.length,d.items));const l=a.name("valid"),u=a.const("len",e._`${i}.length`);n.forEach((o,n)=>{(0,t.alwaysValidSchema)(d,o)||(a.if(e._`${u} > ${n}`,()=>r.subschema({keyword:c,schemaProp:n,dataProp:n},l)),r.ok(l))})}return ao.validateTuple=n,ao.default=o,ao}var io,co={};var lo,uo={};function po(){if(lo)return uo;lo=1,Object.defineProperty(uo,"__esModule",{value:!0});const e=tt(),t=nt(),r={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:t,max:r}})=>void 0===r?e.str`must contain at least ${t} valid item(s)`:e.str`must contain at least ${t} and no more than ${r} valid item(s)`,params:({params:{min:t,max:r}})=>void 0===r?e._`{minContains: ${t}}`:e._`{minContains: ${t}, maxContains: ${r}}`},code(r){const{gen:o,schema:n,parentSchema:a,data:s,it:i}=r;let c,d;const{minContains:l,maxContains:u}=a;i.opts.next?(c=void 0===l?1:l,d=u):c=1;const p=o.const("len",e._`${s}.length`);if(r.setParams({min:c,max:d}),void 0===d&&0===c)return void(0,t.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==d&&c>d)return(0,t.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),void r.fail();if((0,t.alwaysValidSchema)(i,n)){let t=e._`${p} >= ${c}`;return void 0!==d&&(t=e._`${t} && ${p} <= ${d}`),void r.pass(t)}i.items=!0;const f=o.name("valid");function m(){const t=o.name("_valid"),r=o.let("count",0);h(t,()=>o.if(t,()=>function(t){o.code(e._`${t}++`),void 0===d?o.if(e._`${t} >= ${c}`,()=>o.assign(f,!0).break()):(o.if(e._`${t} > ${d}`,()=>o.assign(f,!1).break()),1===c?o.assign(f,!0):o.if(e._`${t} >= ${c}`,()=>o.assign(f,!0)))}(r)))}function h(e,n){o.forRange("i",0,p,o=>{r.subschema({keyword:"contains",dataProp:o,dataPropType:t.Type.Num,compositeRule:!0},e),n()})}void 0===d&&1===c?h(f,()=>o.if(f,()=>o.break())):0===c?(o.let(f,!0),void 0!==d&&o.if(e._`${s}.length > 0`,m)):(o.let(f,!1),m()),r.result(f,()=>r.reset())}};return uo.default=r,uo}var fo,mo={};function ho(){return fo||(fo=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=tt(),r=nt(),o=Et();e.error={message:({params:{property:e,depsCount:r,deps:o}})=>{const n=1===r?"property":"properties";return t.str`must have ${n} ${o} when property ${e} is present`},params:({params:{property:e,depsCount:r,deps:o,missingProperty:n}})=>t._`{property: ${e},
5
- missingProperty: ${n},
1
+ import{createCommand as e,createOption as t,InvalidOptionArgumentError as r,Command as n}from"commander";import o,{fileURLToPath as i}from"node:url";import{resolve as s,dirname as a}from"node:path";import{readPackageUpSync as c}from"read-package-up";import{ConsoleLogger as l,buildApplication as d,bundleApp as u,FusionEnv as p,resolveDefaultEnv as f,checkApp as h,initializeFramework as m,uploadApplication as g,publishAppConfig as y,generateApplicationConfig as v,AllowedAppTags as b,tagApplication as $,loadAppManifest as w,startAppDevServer as E,startPortalDevServer as S,loadPortalManifest as P,buildPortal as _,bundlePortal as L,uploadPortalBundle as C,tagPortal as N,AllowedPortalTags as I,publishPortalConfig as O,generatePortalConfig as k}from"@equinor/fusion-framework-cli/bin";import{mkdir as A,writeFile as T}from"node:fs/promises";import{accessSync as x,constants as D,existsSync as j,mkdirSync as R,writeFileSync as F}from"node:fs";import"node:assert";import M from"url";import G from"node:module";import U from"util";import{importConfig as B,importJSON as z}from"@equinor/fusion-imports";import{z as V}from"zod";import"deepmerge";import"node:child_process";const H=(e=0)=>t=>`[${t+e}m`,q=(e=0)=>t=>`[${38+e};5;${t}m`,K=(e=0)=>(t,r,n)=>`[${38+e};2;${t};${r};${n}m`,W={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(W.modifier);Object.keys(W.color),Object.keys(W.bgColor);const Y=function(){const e=new Map;for(const[t,r]of Object.entries(W)){for(const[t,n]of Object.entries(r))W[t]={open:`[${n[0]}m`,close:`[${n[1]}m`},r[t]=W[t],e.set(n[0],n[1]);Object.defineProperty(W,t,{value:r,enumerable:!1})}return Object.defineProperty(W,"codes",{value:e,enumerable:!1}),W.color.close="",W.bgColor.close="",W.color.ansi=H(),W.color.ansi256=q(),W.color.ansi16m=K(),W.bgColor.ansi=H(10),W.bgColor.ansi256=q(10),W.bgColor.ansi16m=K(10),Object.defineProperties(W,{rgbToAnsi256:{value:(e,t,r)=>e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value(e){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;3===r.length&&(r=[...r].map(e=>e+e).join(""));const n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},enumerable:!1},hexToAnsi256:{value:e=>W.rgbToAnsi256(...W.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return e-8+90;let t,r,n;if(e>=232)t=(10*(e-232)+8)/255,r=t,n=t;else{const o=(e-=16)%36;t=Math.floor(e/36)/5,r=Math.floor(o/6)/5,n=o%6/5}const o=2*Math.max(t,r,n);if(0===o)return 30;let i=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));return 2===o&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(e,t,r)=>W.ansi256ToAnsi(W.rgbToAnsi256(e,t,r)),enumerable:!1},hexToAnsi:{value:e=>W.ansi256ToAnsi(W.hexToAnsi256(e)),enumerable:!1}}),W}(),J=(()=>{if(!("navigator"in globalThis))return 0;if(globalThis.navigator.userAgentData){const e=navigator.userAgentData.brands.find(({brand:e})=>"Chromium"===e);if(e&&e.version>93)return 3}return/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)?1:0})(),X=0!==J&&{level:J},Z={stdout:X,stderr:X};function Q(e,t,r){let n=e.indexOf(t);if(-1===n)return e;const o=t.length;let i=0,s="";do{s+=e.slice(i,n)+t+r,i=n+o,n=e.indexOf(t,i)}while(-1!==n);return s+=e.slice(i),s}const{stdout:ee,stderr:te}=Z,re=Symbol("GENERATOR"),ne=Symbol("STYLER"),oe=Symbol("IS_EMPTY"),ie=["ansi","ansi","ansi256","ansi16m"],se=Object.create(null),ae=e=>{const t=(...e)=>e.join(" ");return((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const r=ee?ee.level:0;e.level=void 0===t.level?r:t.level})(t,e),Object.setPrototypeOf(t,ce.prototype),t};function ce(e){return ae(e)}Object.setPrototypeOf(ce.prototype,Function.prototype);for(const[e,t]of Object.entries(Y))se[e]={get(){const r=fe(this,pe(t.open,t.close,this[ne]),this[oe]);return Object.defineProperty(this,e,{value:r}),r}};se.visible={get(){const e=fe(this,this[ne],!0);return Object.defineProperty(this,"visible",{value:e}),e}};const le=(e,t,r,...n)=>"rgb"===e?"ansi16m"===t?Y[r].ansi16m(...n):"ansi256"===t?Y[r].ansi256(Y.rgbToAnsi256(...n)):Y[r].ansi(Y.rgbToAnsi(...n)):"hex"===e?le("rgb",t,r,...Y.hexToRgb(...n)):Y[r][e](...n),de=["rgb","hex","ansi256"];for(const e of de){se[e]={get(){const{level:t}=this;return function(...r){const n=pe(le(e,ie[t],"color",...r),Y.color.close,this[ne]);return fe(this,n,this[oe])}}};se["bg"+e[0].toUpperCase()+e.slice(1)]={get(){const{level:t}=this;return function(...r){const n=pe(le(e,ie[t],"bgColor",...r),Y.bgColor.close,this[ne]);return fe(this,n,this[oe])}}}}const ue=Object.defineProperties(()=>{},{...se,level:{enumerable:!0,get(){return this[re].level},set(e){this[re].level=e}}}),pe=(e,t,r)=>{let n,o;return void 0===r?(n=e,o=t):(n=r.openAll+e,o=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:o,parent:r}},fe=(e,t,r)=>{const n=(...e)=>he(n,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(n,ue),n[re]=e,n[ne]=t,n[oe]=r,n},he=(e,t)=>{if(e.level<=0||!t)return e[oe]?"":t;let r=e[ne];if(void 0===r)return t;const{openAll:n,closeAll:o}=r;if(t.includes(""))for(;void 0!==r;)t=Q(t,r.close,r.open),r=r.parent;const i=t.indexOf("\n");return-1!==i&&(t=function(e,t,r,n){let o=0,i="";do{const s="\r"===e[n-1];i+=e.slice(o,s?n-1:n)+t+(s?"\r\n":"\n")+r,o=n+1,n=e.indexOf("\n",o)}while(-1!==n);return i+=e.slice(o),i}(t,o,n,i)),n+t+o};Object.defineProperties(ce.prototype,se);const me=ce();ce({level:te?te.level:0});const ge=e("build").description("Build the application").addHelpText("after",["","If no manifest is provided, searches for a default app.manifest(.$ENV)?.[ts|js|json] in the current directory.","example: `ffc app build --env prod` will search for `app.manifest.prod.ts` then fallback to `app.manifest.ts`","","NOTE: app manifest is not required, a default manifest will be generated if not provided","","OUTPUT LOCATION:"," The build output location is determined by the `main` field in your package.json.",' - "main": "dist/index.js" → outputs to dist/index.js',' - "main": "build/app.js" → outputs to build/app.js'," - No main field → defaults to dist/bundle.js"," Output directory cannot be project root, src/, or current working directory.","","Examples:"," $ ffc app build"," $ ffc app build app.manifest.dev.ts --debug"].join("\n")).option("-d, --debug","Enable debug mode for verbose logging",!1).argument("[manifest]","Manifest file to use for building (e.g., app.manifest.ts)").action(async(e,t)=>{const r=new l("app:build",{debug:t.debug});await d({log:r,manifest:e})}),ye="app-bundle.zip",ve=e("pack").description("Create a distributable app bundle of the application.").addHelpText("after",["","If no manifest is provided, a default app.manifest(.$ENV)?.[ts|js|json] is used from the current directory.","example: `ffc app pack --env prod` will search for `app.manifest.prod.ts` then fallback to `app.manifest.ts`","","NOTE: app manifest is not required, a default manifest will be generated if not provided","","Examples:"," $ ffc app pack"," $ ffc app pack app.manifest.dev.ts --archive my-app.zip --output ./dist"].join("\n")).option("-a, --archive [string]","Name of the output archive file (default: app-bundle.zip)",ye).option("-o, --output [string]","Directory where the archive will be saved (default: current working directory)",process.cwd()).option("-d, --debug","Enable debug mode for verbose logging",!1).argument("[manifest]","Manifest file to use for bundling (e.g., app.manifest.ts)").action(async(e,t)=>{const r=new l("app:pack",{debug:t.debug});await u({log:r,manifest:e,archive:t.archive}).catch(e=>{r.error("Failed to create package:",e),process.exit(1)})}),be=e=>{const r=Object.values(p).filter(t=>t!==p.Development||e.allowDev);return t("-e, --env <string>",`Set environment [${r.join(", ")}, custom].`).env("FUSION_ENV").default(e.default??f(e.allowDev))};be({allowDev:!0});const $e=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,we=t("--tenantId <string>","The Azure Active Directory tenant ID").env("FUSION_TENANT_ID").default("3aa4a235-b6e2-48d5-9195-7fcf05b459b0"),Ee=t("--clientId <string>","The client ID of the application registered in Azure AD").env("FUSION_CLIENT_ID").default("a318b8e1-0295-4e17-98d5-35f67dfeba14"),Se=t("--token <string>","The Azure AD access token. If provided, the --tenant and --client options are ignored").env("FUSION_TOKEN").default(void 0),Pe=t("--scope <scopes...>","Azure audience scope, normally the application ID URI of the API you want to access and `.default`").env("FUSION_AUTH_SCOPE").default(["5a842df8-3238-415d-b168-9f16a6a6031b/.default"]),_e=(e,t)=>(e.addOption(we),e.addOption(Ee),t?.excludeToken||e.addOption(Se),t?.includeScope&&e.addOption(Pe),e.hook("preAction",e=>{const n=e.opts();if(n.token){if("string"!=typeof n.token||""===n.token.trim())throw new r("Token must be a non-empty string.");return e.setOptionValue("tenantId",void 0),e.setOptionValue("clientId",void 0),void(t?.includeScope&&e.setOptionValue("scope",void 0))}if(!n.tenantId||"string"!=typeof n.tenantId)throw new r("Tenant ID must be a non-empty string.");if(!$e.test(n.tenantId))throw new r("Tenant ID must be a valid UUID.");if(!n.clientId||"string"!=typeof n.clientId)throw new r("Client ID must be a non-empty string.");if(!$e.test(n.clientId))throw new r("Client ID must be a valid UUID.");if(t?.includeScope){if(!Array.isArray(n.scope)||0===n.scope.length)throw new r("Scope must be a non-empty array of strings.");for(const e of n.scope)if("string"!=typeof e||""===e.trim())throw new r("Each scope must be a non-empty string.")}}),e),Le=_e(e("check").description("Check if application is registered in Fusion app store.").addHelpText("after",["","Verifies the registration status of your application in the Fusion app store.","Helps identify issues with app registration or configuration.","","FIRST TIME SETUP:"," Before checking app status, ensure your app is registered in the Fusion App Admin."," The check command will tell you if your app is properly registered.","","Examples:"," $ ffc app check"," $ ffc app check --env prod --debug"].join("\n")).option("-d, --debug","debug mode",!1).addOption(be({allowDev:!1})).action(e=>{const t=new l("app:check",{debug:!!e.debug});return h({log:t,environment:e.env,auth:"token"in e?{token:e.token}:e})})),Ce=_e(e("upload").description("Upload a Fusion application bundle to the Fusion App Store.").addHelpText("after",["","Uploads a distributable application bundle (e.g., app-bundle.zip) to the Fusion app store.","","Examples:"," $ ffc app upload"," $ ffc app upload my-app-bundle.zip --appKey my-app"," $ ffc app upload --debug"].join("\n")).option("-d, --debug [boolean]","Enable debug mode for verbose logging",!1).option("-k, --appKey <string>","Application key (if not provided, resolved from the build metadata of the bundle)").addOption(be({allowDev:!1})).argument("[bundle]","Application bundle to upload",ye).action(async(e,t)=>{const r=new l("portal:upload",{debug:t.debug});r?.start("💾 Initializing Fusion Framework...");const n=await m({env:t.env,auth:{token:t.token,tenantId:t.tenantId,clientId:t.clientId}});r?.succeed("💾 Initialized Fusion Framework"),await g({log:r,appKey:t.appKey,framework:n,fileOrBundle:e}).catch(e=>{r.error("😢 Failed to upload bundle:",e),process.exit(1)})})),Ne=_e(e("config").description("Generate or publish the Fusion application configuration object.").addHelpText("after",["","By default, outputs the generated config object to stdout or a file. Use --publish to upload the config to the Fusion app registry.","- Options [--token, --tenantId, --clientId, --manifest] are only relevant when --publish is used.",'- Option [-e, --env] cannot be set to "dev" when --publish is used.',"","Note:","- If not `app.config(.$ENV)?.[ts|js|json]` is found it will fallback to generate a default config (empty object)","- If not `app.manifest(.$ENV)?.[ts|js|json]` is found it will fallback to generate a default manifest","","Examples:"," $ ffc app config app.config.ts"," $ ffc app config app.config.prod.ts --output ./dist/app.config.json"," $ ffc app config app.manifest.prod.ts --silent > ./dist/app.config.json"," $ ffc app config --publish --manifest app.manifest.ts --env prod"," $ ffc app config --env prod my-custom.config.ts"].join("\n")).option("--debug","Enable debug mode for verbose logging").option("--silent","Silent mode, suppresses output except errors").option("--publish","Publish config to Fusion app registry").option("--manifest <path>","Path to the app manifest file (required with --publish)").addOption(be({allowDev:!0})).option("-o, --output <stdout|path>","Output the result to stdout or a file (ignored with --publish, default: stdout)","stdout").argument("[config]","Config build file to use (e.g., app.config[.env]?.[ts,js,json])").action(async(e,t)=>{const r=t.silent?null:new l("app:config",{debug:!!t.debug});if(t.publish)return"dev"===t.env&&(r?.fail("🤪",me.blue("--env"),'cannot be "dev" when',me.blue("--publish")," is used"),process.exit(1)),y({config:t.config,manifest:t.manifest,environment:t.env,auth:"token"in t?{token:t.token}:t,debug:t.debug});const{config:n}=await v({log:r,config:e,env:{environment:t.env},output:"stdout"===t.output?void 0:t.output});"stdout"===t.output&&console.log(JSON.stringify(n,null,2))}));const Ie=_e(e("tag").description("Tag your uploaded Fusion Application build version with a specific tag.").addHelpText("after",["","Note: using --package is preferred over --manifest, since no infered compilation is required.","","Examples:"," $ ffc app tag latest"," $ ffc app tag preview --env prod --manifest app.manifest.prod.ts"," $ ffc app tag stable --package my-app@1.2.3"," $ ffc app tag latest --manifest app.manifest.custom.ts"].join("\n")).addOption(be({allowDev:!1})).option("-p, --package [package@version]","Package to tag in format name@version (e.g., my-app@1.0.0)").option("-m, --manifest <string>","Manifest file to use. Note: ignoring if --package is provided").option("--debug","Enable debug mode for verbose logging").option("--silent","Silent mode, suppresses output except errors").argument("<tag>",`Tag to apply (${Object.values(b).join(" | ")})`).action(async(e,t)=>{const r=t.silent?null:new l("app:tag",{debug:t.debug}),n={command:"build",environment:t.env,mode:process.env.NODE_ENV??"production",root:process.cwd()};let o,i;try{({appKey:o,version:i}=await async function(e,t){if(e.package){const[t,r]=e.package.split("@");if(!t||!r)throw new Error("Package must be in format name@version (e.g., my-app@1.0.0). Please verify the package name and version with --package");return{appKey:t,version:r}}const{manifest:r}=await w({manifest:e.manifest,env:t}),n=r.build?.version;if(!n)throw new Error(`Could not determine version from manifest. Please verify manifest ${e.manifest} or provide a package name and version with --package`);return{appKey:r.appKey,version:n}}(t,n))}catch(e){r?.error(`😢 ${e instanceof Error?e.message:"Unknown error occurred"}`),process.exit(1)}r?.info("Tagging application:",me.greenBright(`${o}@${i} - ${e}`)),r?.start("Initializing Fusion Framework...");const s=await m({env:t.env,auth:{token:t.token,tenantId:t.tenantId,clientId:t.clientId}});r?.succeed("Initialized Fusion Framework"),r?.start("Tagging application..."),await $({appKey:o,version:i,framework:s,log:r,tag:e}).catch(e=>{r?.error("Failed to tag application:",e),process.exit(1)})})),Oe=e("dev").description("Start the application in development mode.").addHelpText("after",["","Examples:"," $ ffc app dev"," $ ffc app dev --port 4000"," $ ffc app dev --manifest ./app.manifest.local.ts --config ./app.config.ts"].join("\n")).option("--debug","Enable debug mode").option("--manifest <path>","Path to the app manifest file (app.manifest[.env]?.[ts,js,json])").option("--config <path>","Path to the app config file (app.config[.env]?.[ts,js,json])").option("--env <environment>","Runtime environment for the dev server","local").option("--port <port>","Port for the development server","3000").action(async e=>{const t=new l("app:dev",{debug:e.debug});t.start("Starting application in development mode..."),E({log:t,manifest:e.manifest,config:e.config,env:e.env,port:e.port}),t.succeed("Development server started successfully.")}),ke=(e,t)=>{try{return x(e,D.F_OK),!0}catch(e){return!1}},Ae=e("manifest").description("Build and output the application manifest for Fusion apps.").addHelpText("after",["","By default, outputs the generated manifest object to stdout or a file. Use --output to write to a file.","","Note:","- If not `app.manifest(.$ENV)?.[ts|js|json]` is found it will fallback to generate a default manifest","","Examples:"," $ ffc app manifest"," $ ffc app manifest app.manifest.prod.ts --output ./dist/app.manifest.json",' $ ffc app manifest --silent | jq ".build.entryPoint"'," $ ffc app manifest --debug"].join("\n")).option("-d, --debug","Enable debug mode for verbose logging",!1).option("-o, --output <string>","Output the result to stdout or a file","stdout").option("-s, --silent","Silent mode, suppresses output except errors").argument("[manifest]","Manifest build file to use (e.g., app.manifest[.env]?.[ts,js,json])").action(async(e,t)=>{const r=t.silent?null:new l("app:manifest",{debug:t.debug}),n=await w({log:r,manifest:e});if("stdout"!==t.output){const e=s(process.cwd(),t.output);r?.start("Writing manifest to file",t.output),ke(a(e))||await A(a(e),{recursive:!0}),await T(e,JSON.stringify(n.manifest,null,2)),r?.succeed("Manifest written to file",e)}else console.log(JSON.stringify(n.manifest,null,2))}),Te=_e(e("publish").description("Deployment: Build, upload, and tag your Fusion application.").addHelpText("after",["","WHAT THIS COMMAND DOES:"," 1. Builds your application (if no bundle provided)"," 2. Uploads the bundle to Fusion app registry"," 3. Tags the uploaded version for deployment","","If no manifest is provided, a default app.manifest(.$ENV)?.[ts|js|json] is used from the current directory.","example: `ffc app publish --env prod` will search for `app.manifest.prod.ts` then fallback to `app.manifest.ts`","","NOTE: app manifest is not required, a default manifest will be generated if not provided","","FIRST TIME PUBLISHING:"," - Ensure your app is registered in Fusion App Admin"," - Use `ffc app check` first to verify registration status"," - Start with a test environment before production","","Examples:"," $ ffc app publish"," $ ffc app publish --env prod --manifest app.manifest.prod.ts"," $ ffc app publish --tag latest app.bundle.zip"].join("\n")).option("-d, --debug","Enable debug mode for verbose logging",!1).addOption(be({allowDev:!1})).option("-m, --manifest [string]","Manifest file to use for bundling (e.g., app.manifest.ts)").option("-t, --tag [string]",`Tag to apply to the published app (${Object.values(b).join(" | ")})`,b.Latest).argument("[bundle]","Path to the app bundle to upload").action(async(e,t)=>{const r=new l("app:publish",{debug:t.debug});let n;if(e)r.info(`📦 Using provided bundle: ${e}`),n=e;else try{r.start("📦 Bundle application...");n=(await u({log:r,manifest:t.manifest})).archive,r.succeed("📦 Bundle completed")}catch(e){r.error("😢 Failed to bundle application:",e),process.exit(1)}n||(r.error("😢 No bundle provided or created. Please specify a bundle file."),process.exit(1)),r?.start("💾 Initializing Fusion Framework...");const o=await m({env:t.env,auth:{token:t.token,tenantId:t.tenantId,clientId:t.clientId}});r?.succeed("💾 Initialized Fusion Framework"),r.start("🚀 Uploading application...");const i=await g({log:r,framework:o,fileOrBundle:n}).catch(e=>{r.error("😢 Failed to upload bundle:",e),process.exit(1)});r.succeed("🚀 Upload completed"),r.debug("Upload result:",i),r.start("🏷️ Tagging application...");const s=await $({tag:t.tag,appKey:i.name,version:i.version,log:r,framework:o}).catch(e=>{r.error("😢 Failed to tag application:",e),process.exit(1)});r.succeed("Tagging completed"),r.debug("Tagging result:",s)}));ve.alias("build-pack").hook("preAction",e=>{"build-pack"===process.argv[3]&&(console.warn(me.bgRedBright.bold('The command "build-pack" is deprecated. Please use "pack" instead.')),e.getOptionValue("archive")||e.setOptionValue("archive",ye))}),Ce.alias("build-upload").hook("preAction",e=>{if("build-upload"===process.argv[3]){if(console.warn(me.bgRedBright.bold('The command "build-upload" is deprecated. Please use "upload" instead.')),e.getOptionValue("service"))throw new Error("The --service option is deprecated. Please use --env instead.");const t=e.getOptionValue("bundle")??ye;process.argv[4]=t}}),Ae.alias("build-manifest").hook("preAction",()=>{"build-manifest"===process.argv[3]&&console.warn(me.bgRedBright.bold('The command "build-manifest" is deprecated. Please use "manifest" instead.'))}),Te.alias("build-publish").hook("preAction",e=>{if("build-publish"===process.argv[3]&&console.warn(me.bgRedBright.bold('The command "build-publish" is deprecated. Please use "publish" instead.')),e.getOptionValue("service"))throw new Error("The --service option is deprecated. Please use --env instead.")});const xe=e("app").description("Develop, build, configure, and deploy Fusion applications from your workspace root.").addHelpText("after",["",'The "app" command is your main entry point for managing Fusion applications in this workspace.',"","It provides access to subcommands for every stage of the application lifecycle, including development, building, packaging, configuration, deployment, and release management.","","All available subcommands are listed below automatically. For details and options for a specific subcommand, run:"," fusion app <subcommand> --help","","Typical usage:"," - Run and test your app locally with the dev subcommand"," - Build, bundle, and configure your app for deployment"," - Upload, publish, and tag releases to the Fusion App Store"," - Check registration and generate manifests as needed","","This command should be run from your app root directory."].join("\n")).addCommand(ge).addCommand(ve).addCommand(Le).addCommand(Ce).addCommand(Ne).addCommand(Ie).addCommand(Oe).addCommand(Ae).addCommand(Te),De=e("login").description("Authenticate and log in to Fusion Framework using interactive browser-based authentication.").addHelpText("after",["","WHAT HAPPENS WHEN YOU RUN THIS COMMAND:"," 1. Opens a browser window for Azure AD authentication"," 2. Prompts you to sign in with your Fusion credentials"," 3. Securely caches your tokens for future CLI commands"," 4. You only need to log in once per session","","Note: Requires interactive environment (won't work in CI/CD pipelines)","","Examples:"," $ ffc auth login"," $ ffc auth login --tenant my-tenant --client my-client-id --scope api://my-app/.default"].join("\n")).action(async e=>{const t=new l("auth:login",{debug:e.debug}),r="string"==typeof e.scope?[e.scope]:e.scope;t.start("Initializing Fusion Framework...");const n=await m({auth:{tenantId:e.tenantId,clientId:e.clientId,interactive:!0,server:{port:49741}}});t.succeed("Initialized Fusion Framework");try{t.start("Logging in...");const e=await n.auth.login({scopes:r});t.info("username:",me.green(e.account?.username)),t.info("tenant: ",me.yellow(e.tenantId)),t.info("audience:",me.yellow(e.account?.idTokenClaims?.aud));for(const r of e.scopes)t.info("scope: ",me.dim(r));t.succeed("Successfully logged in",me.greenBright(e.account?.name))}catch(r){throw t.fail("Failed to log in 🥺",JSON.stringify({tenant:e.tenant,client:e.clientId},void 0,2)),r}});_e(De,{includeScope:!0,excludeToken:!0});const je=e("logout").description("Log out from Fusion Framework and clear your authentication session.").addHelpText("after",["","WHAT THIS COMMAND DOES:"," - Removes your cached authentication tokens from local storage"," - Clears the current session (does not revoke tokens server-side)"," - You will need to run `ffc auth login` again for future commands","","WHEN TO USE THIS COMMAND:"," - When switching between different user accounts"," - When troubleshooting authentication issues"," - When your cached tokens have expired and you want a fresh login","","Examples:"," $ ffc auth logout"," $ ffc auth logout --tenant my-tenant --client my-client-id"].join("\n")).action(async e=>{const t=new l("auth:logout",{debug:e.debug});t.start("Initializing Fusion Framework...");const r=await m({auth:{tenantId:e.tenantId,clientId:e.clientId}});t.succeed("Initialized Fusion Framework");try{t.start("Logging in..."),await r.auth.logout(),t.succeed("Successfully logged out")}catch(r){throw t.fail("Failed to log out 🥺",JSON.stringify({tenant:e.tenant,client:e.clientId},void 0,2)),r}});_e(je,{excludeToken:!0,includeScope:!1});class Re extends Error{static Name="NoAccountsError";constructor(e,t){super(e,t),this.name=Re.Name}}const Fe=e("token").description("Acquire and print an access token for Fusion APIs using your current authentication context.").addHelpText("after",["","USAGE NOTES:"," - This command acquires an access token using your current interactive login session."," - It is intended for local development, manual testing, and debugging authentication issues.","","LIMITATIONS:"," - Requires an interactive user session (not suitable for CI/CD or headless environments)."," - Will only work if you have previously logged in using `ffc auth login`."," - Does NOT prompt for login; if no cached credentials are found, you must log in first."," - For automation or CI/CD, set the FUSION_TOKEN environment variable instead.","","BEST PRACTICES:"," - Use this command to quickly fetch a token for manual API calls or local scripts."," - Use the --silent flag to output only the token (useful for scripting or piping)."," - Specify --scope, --tenant, or --client for advanced scenarios.","","EXAMPLES:"," $ ffc auth token"," $ export MY_TOKEN=$(ffc auth token --silent)"," $ ffc auth token --scope api://my-app/.default"," $ ffc auth token --tenant my-tenant --client my-client-id --silent"].join("\n")).option("-d, --debug","Enable debug mode for verbose logging",!1).option("--silent","Only output the token (no extra logging)").action(async e=>{const t=e.silent?null:new l("auth:token",{debug:e.debug}),r="string"==typeof e.scope?[e.scope]:e.scope;t?.info("Using tenant",e.tenantId),t?.info("Using client",e.clientId),t?.info("Using scope",JSON.stringify(r)),t?.start("Initializing Fusion Framework...");const n=await m({auth:{tenantId:e.tenantId,clientId:e.clientId}});t?.succeed("Initialized Fusion Framework");try{t?.start("Getting access token...");const o=await n.auth.acquireAccessToken({scopes:r});t?.succeed("Successfully acquired access token"),e.silent?console.log(o):t?.info("Access token:",o)}catch(r){if(e.silent||!(r instanceof Re))throw r;t?.fail("No accounts found, please login first")}});_e(Fe,{includeScope:!0});const Me=new n("auth").description("Authenticate with Fusion Framework CLI").addHelpText("after",["","Authentication commands for Fusion Framework CLI.","","Use these commands to log in, log out, or acquire tokens for Fusion APIs.","","Examples:"," $ fusion-framework-cli auth login"," $ fusion-framework-cli auth logout"," $ fusion-framework-cli auth token --scope api://my-app/.default"].join("\n"));Me.addCommand(De,{isDefault:!0}),Me.addCommand(je),Me.addCommand(Fe);const Ge=_e(e("resolve").description("Resolve and display information about a service registered in Fusion service discovery.").addHelpText("after",["","This command looks up a service by name and prints its discovery details using the current authentication and environment.","","USEFUL FOR:"," - Finding service endpoints for API calls"," - Debugging service connectivity issues"," - Getting service metadata and configuration","","OUTPUT FORMATS:"," - Normal: Pretty-printed JSON with service details",' - Silent: Raw JSON only (useful for scripts: --silent | jq ".uri")',"","Examples:"," $ ffc disco resolve my-service",' $ ffc disco resolve my-service --silent | jq ".uri"'," $ ffc disco resolve my-service --env prod"," $ ffc disco resolve my-service --env test --tenantId my-tenant --clientId my-client-id"].join("\n")).addOption(be({allowDev:!1})).option("--silent","Silent mode, suppresses output except errors").argument("<service>","Name of the service to resolve in Fusion service discovery").action(async(e,t)=>{const r=t.silent?null:new l("disco:resolve");r?.start("Initializing Fusion Framework...");const n=await m({env:t.environment,auth:{token:t.token,tenantId:t.tenantId,clientId:t.clientId}});r?.succeed("Initialized Fusion Framework"),r?.start(`Resolving service ${e}...`);const o=await n.serviceDiscovery.resolveService(e);r?.succeed(`Resolved service ${e}`),r?.debug(o),t.silent&&console.log(JSON.stringify(o,null,2))})),Ue=e("disco").description("Service discovery operations");Ue.addCommand(Ge);const Be=e("dev").description("Start a local development server for the Fusion portal.").addHelpText("after",["","Examples:"," $ ffc portal dev"," $ ffc portal dev --port 4000"," $ ffc portal dev --debug"].join("\n")).option("--debug","Enable debug mode").option("--env <environment>","Runtime environment for the dev server","local").option("--port <port>","Port for the development server","3000").action(async e=>{const t=new l("portal:dev",{debug:e.debug});t.start("Starting portal in development mode..."),S({server:{port:Number(e.port)},log:t,env:e.env}),t.succeed("Development server started successfully.")});function ze(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ve,He,qe,Ke;function We(){if(He)return Ve;He=1;const e="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};return Ve=e}function Ye(){if(Ke)return qe;Ke=1;const e=Number.MAX_SAFE_INTEGER||9007199254740991;return qe={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:e,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}var Je,Xe,Ze,Qe,et,tt,rt,nt,ot,it,st,at,ct,lt={exports:{}};function dt(){return Je||(Je=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:o}=Ye(),i=We(),s=(t=e.exports={}).re=[],a=t.safeRe=[],c=t.src=[],l=t.safeSrc=[],d=t.t={};let u=0;const p="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",o],[p,n]],h=(e,t,r)=>{const n=(e=>{for(const[t,r]of f)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),o=u++;i(e,o,t),d[e]=o,c[o]=t,l[o]=n,s[o]=new RegExp(t,r?"g":void 0),a[o]=new RegExp(n,r?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","\\d+"),h("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${p}*`),h("MAINVERSION",`(${c[d.NUMERICIDENTIFIER]})\\.(${c[d.NUMERICIDENTIFIER]})\\.(${c[d.NUMERICIDENTIFIER]})`),h("MAINVERSIONLOOSE",`(${c[d.NUMERICIDENTIFIERLOOSE]})\\.(${c[d.NUMERICIDENTIFIERLOOSE]})\\.(${c[d.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASEIDENTIFIER",`(?:${c[d.NONNUMERICIDENTIFIER]}|${c[d.NUMERICIDENTIFIER]})`),h("PRERELEASEIDENTIFIERLOOSE",`(?:${c[d.NONNUMERICIDENTIFIER]}|${c[d.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASE",`(?:-(${c[d.PRERELEASEIDENTIFIER]}(?:\\.${c[d.PRERELEASEIDENTIFIER]})*))`),h("PRERELEASELOOSE",`(?:-?(${c[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[d.PRERELEASEIDENTIFIERLOOSE]})*))`),h("BUILDIDENTIFIER",`${p}+`),h("BUILD",`(?:\\+(${c[d.BUILDIDENTIFIER]}(?:\\.${c[d.BUILDIDENTIFIER]})*))`),h("FULLPLAIN",`v?${c[d.MAINVERSION]}${c[d.PRERELEASE]}?${c[d.BUILD]}?`),h("FULL",`^${c[d.FULLPLAIN]}$`),h("LOOSEPLAIN",`[v=\\s]*${c[d.MAINVERSIONLOOSE]}${c[d.PRERELEASELOOSE]}?${c[d.BUILD]}?`),h("LOOSE",`^${c[d.LOOSEPLAIN]}$`),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE",`${c[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h("XRANGEIDENTIFIER",`${c[d.NUMERICIDENTIFIER]}|x|X|\\*`),h("XRANGEPLAIN",`[v=\\s]*(${c[d.XRANGEIDENTIFIER]})(?:\\.(${c[d.XRANGEIDENTIFIER]})(?:\\.(${c[d.XRANGEIDENTIFIER]})(?:${c[d.PRERELEASE]})?${c[d.BUILD]}?)?)?`),h("XRANGEPLAINLOOSE",`[v=\\s]*(${c[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[d.XRANGEIDENTIFIERLOOSE]})(?:${c[d.PRERELEASELOOSE]})?${c[d.BUILD]}?)?)?`),h("XRANGE",`^${c[d.GTLT]}\\s*${c[d.XRANGEPLAIN]}$`),h("XRANGELOOSE",`^${c[d.GTLT]}\\s*${c[d.XRANGEPLAINLOOSE]}$`),h("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),h("COERCE",`${c[d.COERCEPLAIN]}(?:$|[^\\d])`),h("COERCEFULL",c[d.COERCEPLAIN]+`(?:${c[d.PRERELEASE]})?`+`(?:${c[d.BUILD]})?(?:$|[^\\d])`),h("COERCERTL",c[d.COERCE],!0),h("COERCERTLFULL",c[d.COERCEFULL],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM",`(\\s*)${c[d.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",h("TILDE",`^${c[d.LONETILDE]}${c[d.XRANGEPLAIN]}$`),h("TILDELOOSE",`^${c[d.LONETILDE]}${c[d.XRANGEPLAINLOOSE]}$`),h("LONECARET","(?:\\^)"),h("CARETTRIM",`(\\s*)${c[d.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",h("CARET",`^${c[d.LONECARET]}${c[d.XRANGEPLAIN]}$`),h("CARETLOOSE",`^${c[d.LONECARET]}${c[d.XRANGEPLAINLOOSE]}$`),h("COMPARATORLOOSE",`^${c[d.GTLT]}\\s*(${c[d.LOOSEPLAIN]})$|^$`),h("COMPARATOR",`^${c[d.GTLT]}\\s*(${c[d.FULLPLAIN]})$|^$`),h("COMPARATORTRIM",`(\\s*)${c[d.GTLT]}\\s*(${c[d.LOOSEPLAIN]}|${c[d.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE",`^\\s*(${c[d.XRANGEPLAIN]})\\s+-\\s+(${c[d.XRANGEPLAIN]})\\s*$`),h("HYPHENRANGELOOSE",`^\\s*(${c[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[d.XRANGEPLAINLOOSE]})\\s*$`),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(lt,lt.exports)),lt.exports}function ut(){if(rt)return tt;rt=1;const e=We(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=Ye(),{safeRe:n,t:o}=dt(),i=function(){if(Ze)return Xe;Ze=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Xe=r=>r?"object"!=typeof r?e:r:t}(),{compareIdentifiers:s}=function(){if(et)return Qe;et=1;const e=/^[0-9]+$/,t=(t,r)=>{const n=e.test(t),o=e.test(r);return n&&o&&(t=+t,r=+r),t===r?0:n&&!o?-1:o&&!n?1:t<r?-1:1};return Qe={compareIdentifiers:t,rcompareIdentifiers:(e,r)=>t(r,e)}}();class a{constructor(s,c){if(c=i(c),s instanceof a){if(s.loose===!!c.loose&&s.includePrerelease===!!c.includePrerelease)return s;s=s.version}else if("string"!=typeof s)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof s}".`);if(s.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",s,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const l=s.trim().match(c.loose?n[o.LOOSE]:n[o.FULL]);if(!l)throw new TypeError(`Invalid Version: ${s}`);if(this.raw=s,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");l[4]?this.prerelease=l[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<r)return t}return e}):this.prerelease=[],this.build=l[5]?l[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(){return this.version}compare(t){if(e("SemVer.compare",this.version,this.options,t),!(t instanceof a)){if("string"==typeof t&&t===this.version)return 0;t=new a(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(e){return e instanceof a||(e=new a(e,this.options)),s(this.major,e.major)||s(this.minor,e.minor)||s(this.patch,e.patch)}comparePre(t){if(t instanceof a||(t=new a(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],o=t.prerelease[r];if(e("prerelease compare",r,n,o),void 0===n&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===n)return-1;if(n!==o)return s(n,o)}while(++r)}compareBuild(t){t instanceof a||(t=new a(t,this.options));let r=0;do{const n=this.build[r],o=t.build[r];if(e("build compare",r,n,o),void 0===n&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===n)return-1;if(n!==o)return s(n,o)}while(++r)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?n[o.PRERELEASELOOSE]:n[o.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===s(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return tt=a}function pt(){if(ot)return nt;ot=1;const e=ut();return nt=(t,r,n=!1)=>{if(t instanceof e)return t;try{return new e(t,r)}catch(e){if(!n)return null;throw e}}}var ft,ht,mt,gt,yt,vt,bt,$t,wt,Et,St=["0BSD","3D-Slicer-1.0","AAL","ADSL","AFL-1.1","AFL-1.2","AFL-2.0","AFL-2.1","AFL-3.0","AGPL-1.0-only","AGPL-1.0-or-later","AGPL-3.0-only","AGPL-3.0-or-later","AMD-newlib","AMDPLPA","AML","AML-glslang","AMPAS","ANTLR-PD","ANTLR-PD-fallback","APAFML","APL-1.0","APSL-1.0","APSL-1.1","APSL-1.2","APSL-2.0","ASWF-Digital-Assets-1.0","ASWF-Digital-Assets-1.1","Abstyles","AdaCore-doc","Adobe-2006","Adobe-Display-PostScript","Adobe-Glyph","Adobe-Utopia","Afmparse","Aladdin","Apache-1.0","Apache-1.1","Apache-2.0","App-s2p","Arphic-1999","Artistic-1.0","Artistic-1.0-Perl","Artistic-1.0-cl8","Artistic-2.0","Artistic-dist","Aspell-RU","BSD-1-Clause","BSD-2-Clause","BSD-2-Clause-Darwin","BSD-2-Clause-Patent","BSD-2-Clause-Views","BSD-2-Clause-first-lines","BSD-2-Clause-pkgconf-disclaimer","BSD-3-Clause","BSD-3-Clause-Attribution","BSD-3-Clause-Clear","BSD-3-Clause-HP","BSD-3-Clause-LBNL","BSD-3-Clause-Modification","BSD-3-Clause-No-Military-License","BSD-3-Clause-No-Nuclear-License","BSD-3-Clause-No-Nuclear-License-2014","BSD-3-Clause-No-Nuclear-Warranty","BSD-3-Clause-Open-MPI","BSD-3-Clause-Sun","BSD-3-Clause-acpica","BSD-3-Clause-flex","BSD-4-Clause","BSD-4-Clause-Shortened","BSD-4-Clause-UC","BSD-4.3RENO","BSD-4.3TAHOE","BSD-Advertising-Acknowledgement","BSD-Attribution-HPND-disclaimer","BSD-Inferno-Nettverk","BSD-Protection","BSD-Source-Code","BSD-Source-beginning-file","BSD-Systemics","BSD-Systemics-W3Works","BSL-1.0","BUSL-1.1","Baekmuk","Bahyph","Barr","Beerware","BitTorrent-1.0","BitTorrent-1.1","Bitstream-Charter","Bitstream-Vera","BlueOak-1.0.0","Boehm-GC","Boehm-GC-without-fee","Borceux","Brian-Gladman-2-Clause","Brian-Gladman-3-Clause","C-UDA-1.0","CAL-1.0","CAL-1.0-Combined-Work-Exception","CATOSL-1.1","CC-BY-1.0","CC-BY-2.0","CC-BY-2.5","CC-BY-2.5-AU","CC-BY-3.0","CC-BY-3.0-AT","CC-BY-3.0-AU","CC-BY-3.0-DE","CC-BY-3.0-IGO","CC-BY-3.0-NL","CC-BY-3.0-US","CC-BY-4.0","CC-BY-NC-1.0","CC-BY-NC-2.0","CC-BY-NC-2.5","CC-BY-NC-3.0","CC-BY-NC-3.0-DE","CC-BY-NC-4.0","CC-BY-NC-ND-1.0","CC-BY-NC-ND-2.0","CC-BY-NC-ND-2.5","CC-BY-NC-ND-3.0","CC-BY-NC-ND-3.0-DE","CC-BY-NC-ND-3.0-IGO","CC-BY-NC-ND-4.0","CC-BY-NC-SA-1.0","CC-BY-NC-SA-2.0","CC-BY-NC-SA-2.0-DE","CC-BY-NC-SA-2.0-FR","CC-BY-NC-SA-2.0-UK","CC-BY-NC-SA-2.5","CC-BY-NC-SA-3.0","CC-BY-NC-SA-3.0-DE","CC-BY-NC-SA-3.0-IGO","CC-BY-NC-SA-4.0","CC-BY-ND-1.0","CC-BY-ND-2.0","CC-BY-ND-2.5","CC-BY-ND-3.0","CC-BY-ND-3.0-DE","CC-BY-ND-4.0","CC-BY-SA-1.0","CC-BY-SA-2.0","CC-BY-SA-2.0-UK","CC-BY-SA-2.1-JP","CC-BY-SA-2.5","CC-BY-SA-3.0","CC-BY-SA-3.0-AT","CC-BY-SA-3.0-DE","CC-BY-SA-3.0-IGO","CC-BY-SA-4.0","CC-PDDC","CC-PDM-1.0","CC-SA-1.0","CC0-1.0","CDDL-1.0","CDDL-1.1","CDL-1.0","CDLA-Permissive-1.0","CDLA-Permissive-2.0","CDLA-Sharing-1.0","CECILL-1.0","CECILL-1.1","CECILL-2.0","CECILL-2.1","CECILL-B","CECILL-C","CERN-OHL-1.1","CERN-OHL-1.2","CERN-OHL-P-2.0","CERN-OHL-S-2.0","CERN-OHL-W-2.0","CFITSIO","CMU-Mach","CMU-Mach-nodoc","CNRI-Jython","CNRI-Python","CNRI-Python-GPL-Compatible","COIL-1.0","CPAL-1.0","CPL-1.0","CPOL-1.02","CUA-OPL-1.0","Caldera","Caldera-no-preamble","Catharon","ClArtistic","Clips","Community-Spec-1.0","Condor-1.1","Cornell-Lossless-JPEG","Cronyx","Crossword","CryptoSwift","CrystalStacker","Cube","D-FSL-1.0","DEC-3-Clause","DL-DE-BY-2.0","DL-DE-ZERO-2.0","DOC","DRL-1.0","DRL-1.1","DSDP","DocBook-DTD","DocBook-Schema","DocBook-Stylesheet","DocBook-XML","Dotseqn","ECL-1.0","ECL-2.0","EFL-1.0","EFL-2.0","EPICS","EPL-1.0","EPL-2.0","EUDatagrid","EUPL-1.0","EUPL-1.1","EUPL-1.2","Elastic-2.0","Entessa","ErlPL-1.1","Eurosym","FBM","FDK-AAC","FSFAP","FSFAP-no-warranty-disclaimer","FSFUL","FSFULLR","FSFULLRSD","FSFULLRWD","FSL-1.1-ALv2","FSL-1.1-MIT","FTL","Fair","Ferguson-Twofish","Frameworx-1.0","FreeBSD-DOC","FreeImage","Furuseth","GCR-docs","GD","GFDL-1.1-invariants-only","GFDL-1.1-invariants-or-later","GFDL-1.1-no-invariants-only","GFDL-1.1-no-invariants-or-later","GFDL-1.1-only","GFDL-1.1-or-later","GFDL-1.2-invariants-only","GFDL-1.2-invariants-or-later","GFDL-1.2-no-invariants-only","GFDL-1.2-no-invariants-or-later","GFDL-1.2-only","GFDL-1.2-or-later","GFDL-1.3-invariants-only","GFDL-1.3-invariants-or-later","GFDL-1.3-no-invariants-only","GFDL-1.3-no-invariants-or-later","GFDL-1.3-only","GFDL-1.3-or-later","GL2PS","GLWTPL","GPL-1.0-only","GPL-1.0-or-later","GPL-2.0-only","GPL-2.0-or-later","GPL-3.0-only","GPL-3.0-or-later","Game-Programming-Gems","Giftware","Glide","Glulxe","Graphics-Gems","Gutmann","HDF5","HIDAPI","HP-1986","HP-1989","HPND","HPND-DEC","HPND-Fenneberg-Livingston","HPND-INRIA-IMAG","HPND-Intel","HPND-Kevlin-Henney","HPND-MIT-disclaimer","HPND-Markus-Kuhn","HPND-Netrek","HPND-Pbmplus","HPND-UC","HPND-UC-export-US","HPND-doc","HPND-doc-sell","HPND-export-US","HPND-export-US-acknowledgement","HPND-export-US-modify","HPND-export2-US","HPND-merchantability-variant","HPND-sell-MIT-disclaimer-xserver","HPND-sell-regexpr","HPND-sell-variant","HPND-sell-variant-MIT-disclaimer","HPND-sell-variant-MIT-disclaimer-rev","HTMLTIDY","HaskellReport","Hippocratic-2.1","IBM-pibs","ICU","IEC-Code-Components-EULA","IJG","IJG-short","IPA","IPL-1.0","ISC","ISC-Veillard","ImageMagick","Imlib2","Info-ZIP","Inner-Net-2.0","InnoSetup","Intel","Intel-ACPI","Interbase-1.0","JPL-image","JPNIC","JSON","Jam","JasPer-2.0","Kastrup","Kazlib","Knuth-CTAN","LAL-1.2","LAL-1.3","LGPL-2.0-only","LGPL-2.0-or-later","LGPL-2.1-only","LGPL-2.1-or-later","LGPL-3.0-only","LGPL-3.0-or-later","LGPLLR","LOOP","LPD-document","LPL-1.0","LPL-1.02","LPPL-1.0","LPPL-1.1","LPPL-1.2","LPPL-1.3a","LPPL-1.3c","LZMA-SDK-9.11-to-9.20","LZMA-SDK-9.22","Latex2e","Latex2e-translated-notice","Leptonica","LiLiQ-P-1.1","LiLiQ-R-1.1","LiLiQ-Rplus-1.1","Libpng","Linux-OpenIB","Linux-man-pages-1-para","Linux-man-pages-copyleft","Linux-man-pages-copyleft-2-para","Linux-man-pages-copyleft-var","Lucida-Bitmap-Fonts","MIPS","MIT","MIT-0","MIT-CMU","MIT-Click","MIT-Festival","MIT-Khronos-old","MIT-Modern-Variant","MIT-Wu","MIT-advertising","MIT-enna","MIT-feh","MIT-open-group","MIT-testregex","MITNFA","MMIXware","MPEG-SSG","MPL-1.0","MPL-1.1","MPL-2.0","MPL-2.0-no-copyleft-exception","MS-LPL","MS-PL","MS-RL","MTLL","Mackerras-3-Clause","Mackerras-3-Clause-acknowledgment","MakeIndex","Martin-Birgmeier","McPhee-slideshow","Minpack","MirOS","Motosoto","MulanPSL-1.0","MulanPSL-2.0","Multics","Mup","NAIST-2003","NASA-1.3","NBPL-1.0","NCBI-PD","NCGL-UK-2.0","NCL","NCSA","NGPL","NICTA-1.0","NIST-PD","NIST-PD-fallback","NIST-Software","NLOD-1.0","NLOD-2.0","NLPL","NOSL","NPL-1.0","NPL-1.1","NPOSL-3.0","NRL","NTIA-PD","NTP","NTP-0","Naumen","NetCDF","Newsletr","Nokia","Noweb","O-UDA-1.0","OAR","OCCT-PL","OCLC-2.0","ODC-By-1.0","ODbL-1.0","OFFIS","OFL-1.0","OFL-1.0-RFN","OFL-1.0-no-RFN","OFL-1.1","OFL-1.1-RFN","OFL-1.1-no-RFN","OGC-1.0","OGDL-Taiwan-1.0","OGL-Canada-2.0","OGL-UK-1.0","OGL-UK-2.0","OGL-UK-3.0","OGTSL","OLDAP-1.1","OLDAP-1.2","OLDAP-1.3","OLDAP-1.4","OLDAP-2.0","OLDAP-2.0.1","OLDAP-2.1","OLDAP-2.2","OLDAP-2.2.1","OLDAP-2.2.2","OLDAP-2.3","OLDAP-2.4","OLDAP-2.5","OLDAP-2.6","OLDAP-2.7","OLDAP-2.8","OLFL-1.3","OML","OPL-1.0","OPL-UK-3.0","OPUBL-1.0","OSET-PL-2.1","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","OpenPBS-2.3","OpenSSL","OpenSSL-standalone","OpenVision","PADL","PDDL-1.0","PHP-3.0","PHP-3.01","PPL","PSF-2.0","Parity-6.0.0","Parity-7.0.0","Pixar","Plexus","PolyForm-Noncommercial-1.0.0","PolyForm-Small-Business-1.0.0","PostgreSQL","Python-2.0","Python-2.0.1","QPL-1.0","QPL-1.0-INRIA-2004","Qhull","RHeCos-1.1","RPL-1.1","RPL-1.5","RPSL-1.0","RSA-MD","RSCPL","Rdisc","Ruby","Ruby-pty","SAX-PD","SAX-PD-2.0","SCEA","SGI-B-1.0","SGI-B-1.1","SGI-B-2.0","SGI-OpenGL","SGP4","SHL-0.5","SHL-0.51","SISSL","SISSL-1.2","SL","SMAIL-GPL","SMLNJ","SMPPL","SNIA","SOFA","SPL-1.0","SSH-OpenSSH","SSH-short","SSLeay-standalone","SSPL-1.0","SUL-1.0","SWL","Saxpath","SchemeReport","Sendmail","Sendmail-8.23","Sendmail-Open-Source-1.1","SimPL-2.0","Sleepycat","Soundex","Spencer-86","Spencer-94","Spencer-99","SugarCRM-1.1.3","Sun-PPP","Sun-PPP-2000","SunPro","Symlinks","TAPR-OHL-1.0","TCL","TCP-wrappers","TGPPL-1.0","TMate","TORQUE-1.1","TOSL","TPDL","TPL-1.0","TTWL","TTYP0","TU-Berlin-1.0","TU-Berlin-2.0","TermReadKey","ThirdEye","TrustedQSL","UCAR","UCL-1.0","UMich-Merit","UPL-1.0","URT-RLE","Ubuntu-font-1.0","Unicode-3.0","Unicode-DFS-2015","Unicode-DFS-2016","Unicode-TOU","UnixCrypt","Unlicense","Unlicense-libtelnet","Unlicense-libwhirlpool","VOSTROM","VSL-1.0","Vim","W3C","W3C-19980720","W3C-20150513","WTFPL","Watcom-1.0","Widget-Workshop","Wsuipa","X11","X11-distribute-modifications-variant","X11-swapped","XFree86-1.1","XSkat","Xdebug-1.03","Xerox","Xfig","Xnet","YPL-1.0","YPL-1.1","ZPL-1.1","ZPL-2.0","ZPL-2.1","Zed","Zeeff","Zend-2.0","Zimbra-1.3","Zimbra-1.4","Zlib","any-OSI","any-OSI-perl-modules","bcrypt-Solar-Designer","blessing","bzip2-1.0.6","check-cvs","checkmk","copyleft-next-0.3.0","copyleft-next-0.3.1","curl","cve-tou","diffmark","dtoa","dvipdfm","eGenix","etalab-2.0","fwlw","gSOAP-1.3b","generic-xts","gnuplot","gtkbook","hdparm","iMatix","jove","libpng-1.6.35","libpng-2.0","libselinux-1.0","libtiff","libutil-David-Nugent","lsof","magaz","mailprio","man2html","metamail","mpi-permissive","mpich2","mplus","ngrep","pkgconf","pnmstitch","psfrag","psutils","python-ldap","radvd","snprintf","softSurfer","ssh-keyscan","swrule","threeparttable","ulem","w3m","wwl","xinetd","xkeyboard-config-Zinoviev","xlock","xpp","xzoom","zlib-acknowledgement"],Pt=["AGPL-1.0","AGPL-3.0","BSD-2-Clause-FreeBSD","BSD-2-Clause-NetBSD","GFDL-1.1","GFDL-1.2","GFDL-1.3","GPL-1.0","GPL-2.0","GPL-2.0-with-GCC-exception","GPL-2.0-with-autoconf-exception","GPL-2.0-with-bison-exception","GPL-2.0-with-classpath-exception","GPL-2.0-with-font-exception","GPL-3.0","GPL-3.0-with-GCC-exception","GPL-3.0-with-autoconf-exception","LGPL-2.0","LGPL-2.1","LGPL-3.0","Net-SNMP","Nunit","StandardML-NJ","bzip2-1.0.5","eCos-2.0","wxWindows"],_t=["389-exception","Asterisk-exception","Autoconf-exception-2.0","Autoconf-exception-3.0","Autoconf-exception-generic","Autoconf-exception-generic-3.0","Autoconf-exception-macro","Bison-exception-1.24","Bison-exception-2.2","Bootloader-exception","Classpath-exception-2.0","CLISP-exception-2.0","cryptsetup-OpenSSL-exception","DigiRule-FOSS-exception","eCos-exception-2.0","Fawkes-Runtime-exception","FLTK-exception","fmt-exception","Font-exception-2.0","freertos-exception-2.0","GCC-exception-2.0","GCC-exception-2.0-note","GCC-exception-3.1","Gmsh-exception","GNAT-exception","GNOME-examples-exception","GNU-compiler-exception","gnu-javamail-exception","GPL-3.0-interface-exception","GPL-3.0-linking-exception","GPL-3.0-linking-source-exception","GPL-CC-1.0","GStreamer-exception-2005","GStreamer-exception-2008","i2p-gpl-java-exception","KiCad-libraries-exception","LGPL-3.0-linking-exception","libpri-OpenH323-exception","Libtool-exception","Linux-syscall-note","LLGPL","LLVM-exception","LZMA-exception","mif-exception","OCaml-LGPL-linking-exception","OCCT-exception-1.0","OpenJDK-assembly-exception-1.0","openvpn-openssl-exception","PS-or-PDF-font-exception-20170817","QPL-1.0-INRIA-2004-exception","Qt-GPL-exception-1.0","Qt-LGPL-exception-1.1","Qwt-exception-1.0","SANE-exception","SHL-2.0","SHL-2.1","stunnel-exception","SWI-exception","Swift-exception","Texinfo-exception","u-boot-exception-2.0","UBDL-exception","Universal-FOSS-exception-1.0","vsftpd-openssl-exception","WxWindows-exception-3.1","x11vnc-openssl-exception"];function Lt(){if(ht)return ft;ht=1;var e=[].concat(St).concat(Pt),t=_t;return ft=function(r){var n=0;function o(){return n<r.length}function i(e){if(e instanceof RegExp){var t=r.slice(n).match(e);if(t)return n+=t[0].length,t[0]}else if(r.indexOf(e,n)===n)return n+=e.length,e}function s(){i(/[ ]*/)}function a(){return i(/[A-Za-z0-9-.]+/)}function c(){var e=a();if(!e)throw new Error("Expected idstring at offset "+n);return e}function l(){return function(){for(var e,t=["WITH","AND","OR","(",")",":","+"],o=0;o<t.length&&!(e=i(t[o]));o++);if("+"===e&&n>1&&" "===r[n-2])throw new Error("Space before `+`");return e&&{type:"OPERATOR",string:e}}()||function(){if(i("DocumentRef-"))return{type:"DOCUMENTREF",string:c()}}()||function(){if(i("LicenseRef-"))return{type:"LICENSEREF",string:c()}}()||(o=n,s=a(),-1!==e.indexOf(s)?{type:"LICENSE",string:s}:-1!==t.indexOf(s)?{type:"EXCEPTION",string:s}:void(n=o));var o,s}for(var d=[];o()&&(s(),o());){var u=l();if(!u)throw new Error("Unexpected `"+r[n]+"` at offset "+n);d.push(u)}return d}}function Ct(){return gt||(gt=1,mt=function(e){var t=0;function r(){return t<e.length}function n(){return r()?e[t]:null}function o(){if(!r())throw new Error;t++}function i(e){var t=n();if(t&&"OPERATOR"===t.type&&e===t.string)return o(),t.string}function s(){var e=n();if(e&&"LICENSE"===e.type){o();var t={license:e.string};i("+")&&(t.plus=!0);var r=function(){if(i("WITH")){var e=n();if(e&&"EXCEPTION"===e.type)return o(),e.string;throw new Error("Expected exception after `WITH`")}}();return r&&(t.exception=r),t}}function a(e,t){return function r(){var n=t();if(n){if(!i(e))return n;var o=r();if(!o)throw new Error("Expected expression");return{left:n,conjunction:e.toLowerCase(),right:o}}}}var c=a("AND",function(){return function(){if(i("(")){var e=l();if(!i(")"))throw new Error("Expected `)`");return e}}()||function(){var e=t,r="",s=n();if("DOCUMENTREF"===s.type&&(o(),r+="DocumentRef-"+s.string+":",!i(":")))throw new Error("Expected `:` after `DocumentRef-...`");if("LICENSEREF"===(s=n()).type)return o(),{license:r+="LicenseRef-"+s.string};t=e}()||s()}),l=a("OR",c),d=l();if(!d||r())throw new Error("Syntax error");return d}),mt}function Nt(){if(vt)return yt;vt=1;var e=Lt(),t=Ct();return yt=function(r){return t(e(r))}}function It(){if(Et)return wt;Et=1;var e=Nt(),t=function(){if($t)return bt;$t=1;var e=Nt(),t=St;function r(t){try{return e(t),!0}catch(e){return!1}}function n(e,t){var r=t[0].length-e[0].length;return 0!==r?r:e[0].toUpperCase().localeCompare(t[0].toUpperCase())}var o=[["APGL","AGPL"],["Gpl","GPL"],["GLP","GPL"],["APL","Apache"],["ISD","ISC"],["GLP","GPL"],["IST","ISC"],["Claude","Clause"],[" or later","+"],[" International",""],["GNU","GPL"],["GUN","GPL"],["+",""],["GNU GPL","GPL"],["GNU LGPL","LGPL"],["GNU/GPL","GPL"],["GNU GLP","GPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL"],["GNU Lesser General Public License","LGPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["GNU Lesser General Public License","LGPL-2.1"],["LESSER GENERAL PUBLIC LICENSE","LGPL"],["Lesser General Public License","LGPL"],["LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["Lesser General Public License","LGPL-2.1"],["GNU General Public License","GPL"],["Gnu public license","GPL"],["GNU Public License","GPL"],["GNU GENERAL PUBLIC LICENSE","GPL"],["MTI","MIT"],["Mozilla Public License","MPL"],["Universal Permissive License","UPL"],["WTH","WTF"],["WTFGPL","WTFPL"],["-License",""]].sort(n),i=[function(e){return e.toUpperCase()},function(e){return e.trim()},function(e){return e.replace(/\./g,"")},function(e){return e.replace(/\s+/g,"")},function(e){return e.replace(/\s+/g,"-")},function(e){return e.replace("v","-")},function(e){return e.replace(/,?\s*(\d)/,"-$1")},function(e){return e.replace(/,?\s*(\d)/,"-$1.0")},function(e){return e.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2")},function(e){return e.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2.0")},function(e){return e[0].toUpperCase()+e.slice(1)},function(e){return e.replace("/","-")},function(e){return e.replace(/\s*V\s*(\d)/,"-$1").replace(/(\d)$/,"$1.0")},function(e){return-1!==e.indexOf("3.0")?e+"-or-later":e+"-only"},function(e){return e+"only"},function(e){return e.replace(/(\d)$/,"-$1.0")},function(e){return e.replace(/(-| )?(\d)$/,"-$2-Clause")},function(e){return e.replace(/(-| )clause(-| )(\d)/,"-$3-Clause")},function(e){return e.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,"BSD-3-Clause")},function(e){return e.replace(/\bSimplified(-| )?BSD((-| )License)?/i,"BSD-2-Clause")},function(e){return e.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,"BSD-2-Clause-$1BSD")},function(e){return e.replace(/\bClear(-| )?BSD((-| )License)?/i,"BSD-3-Clause-Clear")},function(e){return e.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,"BSD-4-Clause")},function(e){return"CC-"+e},function(e){return"CC-"+e+"-4.0"},function(e){return e.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")},function(e){return"CC-"+e.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")+"-4.0"}],s=t.map(function(e){var t=/^(.*)-\d+\.\d+$/.exec(e);return t?[t[0],t[1]]:[e,null]}).reduce(function(e,t){var r=t[1];return e[r]=e[r]||[],e[r].push(t[0]),e},{}),a=Object.keys(s).map(function(e){return[e,s[e]]}).filter(function(e){return 1===e[1].length&&null!==e[0]&&"APL"!==e[0]}).map(function(e){return[e[0],e[1][0]]});s=void 0;var c=[["UNLI","Unlicense"],["WTF","WTFPL"],["2 CLAUSE","BSD-2-Clause"],["2-CLAUSE","BSD-2-Clause"],["3 CLAUSE","BSD-3-Clause"],["3-CLAUSE","BSD-3-Clause"],["AFFERO","AGPL-3.0-or-later"],["AGPL","AGPL-3.0-or-later"],["APACHE","Apache-2.0"],["ARTISTIC","Artistic-2.0"],["Affero","AGPL-3.0-or-later"],["BEER","Beerware"],["BOOST","BSL-1.0"],["BSD","BSD-2-Clause"],["CDDL","CDDL-1.1"],["ECLIPSE","EPL-1.0"],["FUCK","WTFPL"],["GNU","GPL-3.0-or-later"],["LGPL","LGPL-3.0-or-later"],["GPLV1","GPL-1.0-only"],["GPL-1","GPL-1.0-only"],["GPLV2","GPL-2.0-only"],["GPL-2","GPL-2.0-only"],["GPL","GPL-3.0-or-later"],["MIT +NO-FALSE-ATTRIBS","MITNFA"],["MIT","MIT"],["MPL","MPL-2.0"],["X11","X11"],["ZLIB","Zlib"]].concat(a).sort(n),l=function(e){for(var t=0;t<i.length;t++){var n=i[t](e).trim();if(n!==e&&r(n))return n}return null},d=function(e){for(var t=e.toUpperCase(),r=0;r<c.length;r++){var n=c[r];if(t.indexOf(n[0])>-1)return n[1]}return null},u=function(e,t){for(var r=0;r<o.length;r++){var n=o[r],i=n[0];if(e.indexOf(i)>-1){var s=t(e.replace(i,n[1]));if(null!==s)return s}}return null};return bt=function(e,t){var n=void 0===(t=t||{}).upgrade||!!t.upgrade;function o(e){return n?function(e){return-1!==["GPL-1.0","LGPL-1.0","AGPL-1.0","GPL-2.0","LGPL-2.0","AGPL-2.0","LGPL-2.1"].indexOf(e)?e+"-only":-1!==["GPL-1.0+","GPL-2.0+","GPL-3.0+","LGPL-2.0+","LGPL-2.1+","LGPL-3.0+","AGPL-1.0+","AGPL-3.0+"].indexOf(e)?e.replace(/\+$/,"-or-later"):-1!==["GPL-3.0","LGPL-3.0","AGPL-3.0"].indexOf(e)?e+"-or-later":e}(e):e}if("string"!=typeof e||0===e.trim().length)throw Error("Invalid argument. Expected non-empty string.");if(r(e=e.trim()))return o(e);var i=e.replace(/\+$/,"").trim();if(r(i))return o(i);var s=l(e);return null!==s||null!==(s=u(e,function(e){return r(e)?e:l(e)}))||null!==(s=d(e))||null!==(s=u(e,d))?o(s):null}}(),r='license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"',n=/^SEE LICEN[CS]E IN (.+)$/;function o(e,t){return t.slice(0,e.length)===e}function i(e){if(e.hasOwnProperty("license")){var t=e.license;return o("LicenseRef",t)||o("DocumentRef",t)}return i(e.left)||i(e.right)}return wt=function(o){var s;try{s=e(o)}catch(e){var a;if("UNLICENSED"===o||"UNLICENCED"===o)return{validForOldPackages:!0,validForNewPackages:!0,unlicensed:!0};if(a=n.exec(o))return{validForOldPackages:!0,validForNewPackages:!0,inFile:a[1]};var c={validForOldPackages:!1,validForNewPackages:!1,warnings:[r]};if(0!==o.trim().length){var l=t(o);l&&c.warnings.push('license is similar to the valid expression "'+l+'"')}return c}return i(s)?{validForNewPackages:!1,validForOldPackages:!1,spdx:!0,warnings:[r]}:{validForNewPackages:!0,validForOldPackages:!0,spdx:!0}}}var Ot,kt,At,Tt,xt,Dt,jt,Rt,Ft,Mt,Gt,Ut={};function Bt(){if(Ot)return Ut;Ot=1,Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.LRUCache=void 0;const e="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,t=new Set,r="object"==typeof process&&process?process:{},n=(e,t,n,o)=>{"function"==typeof r.emitWarning?r.emitWarning(e,t,n,o):console.error(`[${n}] ${t}: ${e}`)};let o=globalThis.AbortController,i=globalThis.AbortSignal;if(void 0===o){i=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},o=class{constructor(){t()}signal=new i;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(const t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e="1"!==r.env?.LRU_CACHE_IGNORE_AC_WARNING;const t=()=>{e&&(e=!1,n("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}const s=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),a=e=>s(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?c:null:null;class c extends Array{constructor(e){super(e),this.fill(0)}}class l{heap;length;static#e=!1;static create(e){const t=a(e);if(!t)return[];l.#e=!0;const r=new l(e,t);return l.#e=!1,r}constructor(e,t){if(!l.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class d{#t;#r;#n;#o;#i;#s;#a;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#c;#l;#d;#u;#p;#f;#h;#m;#g;#y;#v;#b;#$;#w;#E;#S;#P;#_;static unsafeExposeInternals(e){return{starts:e.#$,ttls:e.#w,sizes:e.#b,keyMap:e.#d,keyList:e.#u,valList:e.#p,next:e.#f,prev:e.#h,get head(){return e.#m},get tail(){return e.#g},free:e.#y,isBackgroundFetch:t=>e.#L(t),backgroundFetch:(t,r,n,o)=>e.#C(t,r,n,o),moveToTail:t=>e.#N(t),indexes:t=>e.#I(t),rindexes:t=>e.#O(t),isStale:t=>e.#k(t)}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#l}get size(){return this.#c}get fetchMethod(){return this.#s}get memoMethod(){return this.#a}get dispose(){return this.#n}get onInsert(){return this.#o}get disposeAfter(){return this.#i}constructor(e){const{max:r=0,ttl:o,ttlResolution:i=1,ttlAutopurge:c,updateAgeOnGet:u,updateAgeOnHas:p,allowStale:f,dispose:h,onInsert:m,disposeAfter:g,noDisposeOnSet:y,noUpdateTTL:v,maxSize:b=0,maxEntrySize:$=0,sizeCalculation:w,fetchMethod:E,memoMethod:S,noDeleteOnFetchRejection:P,noDeleteOnStaleGet:_,allowStaleOnFetchRejection:L,allowStaleOnFetchAbort:C,ignoreFetchAbort:N}=e;if(0!==r&&!s(r))throw new TypeError("max option must be a nonnegative integer");const I=r?a(r):Array;if(!I)throw new Error("invalid max value: "+r);if(this.#t=r,this.#r=b,this.maxEntrySize=$||this.#r,this.sizeCalculation=w,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==S&&"function"!=typeof S)throw new TypeError("memoMethod must be a function if defined");if(this.#a=S,void 0!==E&&"function"!=typeof E)throw new TypeError("fetchMethod must be a function if specified");if(this.#s=E,this.#S=!!E,this.#d=new Map,this.#u=new Array(r).fill(void 0),this.#p=new Array(r).fill(void 0),this.#f=new I(r),this.#h=new I(r),this.#m=0,this.#g=0,this.#y=l.create(r),this.#c=0,this.#l=0,"function"==typeof h&&(this.#n=h),"function"==typeof m&&(this.#o=m),"function"==typeof g?(this.#i=g,this.#v=[]):(this.#i=void 0,this.#v=void 0),this.#E=!!this.#n,this.#_=!!this.#o,this.#P=!!this.#i,this.noDisposeOnSet=!!y,this.noUpdateTTL=!!v,this.noDeleteOnFetchRejection=!!P,this.allowStaleOnFetchRejection=!!L,this.allowStaleOnFetchAbort=!!C,this.ignoreFetchAbort=!!N,0!==this.maxEntrySize){if(0!==this.#r&&!s(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!s(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#A()}if(this.allowStale=!!f,this.noDeleteOnStaleGet=!!_,this.updateAgeOnGet=!!u,this.updateAgeOnHas=!!p,this.ttlResolution=s(i)||0===i?i:1,this.ttlAutopurge=!!c,this.ttl=o||0,this.ttl){if(!s(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#T()}if(0===this.#t&&0===this.ttl&&0===this.#r)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){const e="LRU_CACHE_UNBOUNDED";if((e=>!t.has(e))(e)){t.add(e);n("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,d)}}}getRemainingTTL(e){return this.#d.has(e)?1/0:0}#T(){const t=new c(this.#t),r=new c(this.#t);this.#w=t,this.#$=r,this.#x=(n,o,i=e.now())=>{if(r[n]=0!==o?i:0,t[n]=o,0!==o&&this.ttlAutopurge){const e=setTimeout(()=>{this.#k(n)&&this.#D(this.#u[n],"expire")},o+1);e.unref&&e.unref()}},this.#j=n=>{r[n]=0!==t[n]?e.now():0},this.#R=(e,i)=>{if(t[i]){const s=t[i],a=r[i];if(!s||!a)return;e.ttl=s,e.start=a,e.now=n||o();const c=e.now-a;e.remainingTTL=s-c}};let n=0;const o=()=>{const t=e.now();if(this.ttlResolution>0){n=t;const e=setTimeout(()=>n=0,this.ttlResolution);e.unref&&e.unref()}return t};this.getRemainingTTL=e=>{const i=this.#d.get(e);if(void 0===i)return 0;const s=t[i],a=r[i];if(!s||!a)return 1/0;return s-((n||o())-a)},this.#k=e=>{const i=r[e],s=t[e];return!!s&&!!i&&(n||o())-i>s}}#j=()=>{};#R=()=>{};#x=()=>{};#k=()=>!1;#A(){const e=new c(this.#t);this.#l=0,this.#b=e,this.#F=t=>{this.#l-=e[t],e[t]=0},this.#M=(e,t,r,n)=>{if(this.#L(t))return 0;if(!s(r)){if(!n)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(r=n(t,e),!s(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.#G=(t,r,n)=>{if(e[t]=r,this.#r){const r=this.#r-e[t];for(;this.#l>r;)this.#U(!0)}this.#l+=e[t],n&&(n.entrySize=r,n.totalCalculatedSize=this.#l)}}#F=e=>{};#G=(e,t,r)=>{};#M=(e,t,r,n)=>{if(r||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#I({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#g;this.#B(t)&&(!e&&this.#k(t)||(yield t),t!==this.#m);)t=this.#h[t]}*#O({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#m;this.#B(t)&&(!e&&this.#k(t)||(yield t),t!==this.#g);)t=this.#f[t]}#B(e){return void 0!==e&&this.#d.get(this.#u[e])===e}*entries(){for(const e of this.#I())void 0===this.#p[e]||void 0===this.#u[e]||this.#L(this.#p[e])||(yield[this.#u[e],this.#p[e]])}*rentries(){for(const e of this.#O())void 0===this.#p[e]||void 0===this.#u[e]||this.#L(this.#p[e])||(yield[this.#u[e],this.#p[e]])}*keys(){for(const e of this.#I()){const t=this.#u[e];void 0===t||this.#L(this.#p[e])||(yield t)}}*rkeys(){for(const e of this.#O()){const t=this.#u[e];void 0===t||this.#L(this.#p[e])||(yield t)}}*values(){for(const e of this.#I()){void 0===this.#p[e]||this.#L(this.#p[e])||(yield this.#p[e])}}*rvalues(){for(const e of this.#O()){void 0===this.#p[e]||this.#L(this.#p[e])||(yield this.#p[e])}}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(const r of this.#I()){const n=this.#p[r],o=this.#L(n)?n.__staleWhileFetching:n;if(void 0!==o&&e(o,this.#u[r],this))return this.get(this.#u[r],t)}}forEach(e,t=this){for(const r of this.#I()){const n=this.#p[r],o=this.#L(n)?n.__staleWhileFetching:n;void 0!==o&&e.call(t,o,this.#u[r],this)}}rforEach(e,t=this){for(const r of this.#O()){const n=this.#p[r],o=this.#L(n)?n.__staleWhileFetching:n;void 0!==o&&e.call(t,o,this.#u[r],this)}}purgeStale(){let e=!1;for(const t of this.#O({allowStale:!0}))this.#k(t)&&(this.#D(this.#u[t],"expire"),e=!0);return e}info(t){const r=this.#d.get(t);if(void 0===r)return;const n=this.#p[r],o=this.#L(n)?n.__staleWhileFetching:n;if(void 0===o)return;const i={value:o};if(this.#w&&this.#$){const t=this.#w[r],n=this.#$[r];if(t&&n){const r=t-(e.now()-n);i.ttl=r,i.start=Date.now()}}return this.#b&&(i.size=this.#b[r]),i}dump(){const t=[];for(const r of this.#I({allowStale:!0})){const n=this.#u[r],o=this.#p[r],i=this.#L(o)?o.__staleWhileFetching:o;if(void 0===i||void 0===n)continue;const s={value:i};if(this.#w&&this.#$){s.ttl=this.#w[r];const t=e.now()-this.#$[r];s.start=Math.floor(Date.now()-t)}this.#b&&(s.size=this.#b[r]),t.unshift([n,s])}return t}load(t){this.clear();for(const[r,n]of t){if(n.start){const t=Date.now()-n.start;n.start=e.now()-t}this.set(r,n.value,n)}}set(e,t,r={}){if(void 0===t)return this.delete(e),this;const{ttl:n=this.ttl,start:o,noDisposeOnSet:i=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:a}=r;let{noUpdateTTL:c=this.noUpdateTTL}=r;const l=this.#M(e,t,r.size||0,s);if(this.maxEntrySize&&l>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#D(e,"set"),this;let d=0===this.#c?void 0:this.#d.get(e);if(void 0===d)d=0===this.#c?this.#g:0!==this.#y.length?this.#y.pop():this.#c===this.#t?this.#U(!1):this.#c,this.#u[d]=e,this.#p[d]=t,this.#d.set(e,d),this.#f[this.#g]=d,this.#h[d]=this.#g,this.#g=d,this.#c++,this.#G(d,l,a),a&&(a.set="add"),c=!1,this.#_&&this.#o?.(t,e,"add");else{this.#N(d);const r=this.#p[d];if(t!==r){if(this.#S&&this.#L(r)){r.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:t}=r;void 0===t||i||(this.#E&&this.#n?.(t,e,"set"),this.#P&&this.#v?.push([t,e,"set"]))}else i||(this.#E&&this.#n?.(r,e,"set"),this.#P&&this.#v?.push([r,e,"set"]));if(this.#F(d),this.#G(d,l,a),this.#p[d]=t,a){a.set="replace";const e=r&&this.#L(r)?r.__staleWhileFetching:r;void 0!==e&&(a.oldValue=e)}}else a&&(a.set="update");this.#_&&this.onInsert?.(t,e,t===r?"update":"replace")}if(0===n||this.#w||this.#T(),this.#w&&(c||this.#x(d,n,o),a&&this.#R(a,d)),!i&&this.#P&&this.#v){const e=this.#v;let t;for(;t=e?.shift();)this.#i?.(...t)}return this}pop(){try{for(;this.#c;){const e=this.#p[this.#m];if(this.#U(!0),this.#L(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#P&&this.#v){const e=this.#v;let t;for(;t=e?.shift();)this.#i?.(...t)}}}#U(e){const t=this.#m,r=this.#u[t],n=this.#p[t];return this.#S&&this.#L(n)?n.__abortController.abort(new Error("evicted")):(this.#E||this.#P)&&(this.#E&&this.#n?.(n,r,"evict"),this.#P&&this.#v?.push([n,r,"evict"])),this.#F(t),e&&(this.#u[t]=void 0,this.#p[t]=void 0,this.#y.push(t)),1===this.#c?(this.#m=this.#g=0,this.#y.length=0):this.#m=this.#f[t],this.#d.delete(r),this.#c--,t}has(e,t={}){const{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=t,o=this.#d.get(e);if(void 0!==o){const e=this.#p[o];if(this.#L(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#k(o))return r&&this.#j(o),n&&(n.has="hit",this.#R(n,o)),!0;n&&(n.has="stale",this.#R(n,o))}else n&&(n.has="miss");return!1}peek(e,t={}){const{allowStale:r=this.allowStale}=t,n=this.#d.get(e);if(void 0===n||!r&&this.#k(n))return;const o=this.#p[n];return this.#L(o)?o.__staleWhileFetching:o}#C(e,t,r,n){const i=void 0===t?void 0:this.#p[t];if(this.#L(i))return i;const s=new o,{signal:a}=r;a?.addEventListener("abort",()=>s.abort(a.reason),{signal:s.signal});const c={signal:s.signal,options:r,context:n},l=(n,o=!1)=>{const{aborted:i}=s.signal,a=r.ignoreFetchAbort&&void 0!==n;if(r.status&&(i&&!o?(r.status.fetchAborted=!0,r.status.fetchError=s.signal.reason,a&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),i&&!a&&!o)return d(s.signal.reason);const l=u;return this.#p[t]===u&&(void 0===n?l.__staleWhileFetching?this.#p[t]=l.__staleWhileFetching:this.#D(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,n,c.options))),n},d=n=>{const{aborted:o}=s.signal,i=o&&r.allowStaleOnFetchAbort,a=i||r.allowStaleOnFetchRejection,c=a||r.noDeleteOnFetchRejection,l=u;if(this.#p[t]===u){!c||void 0===l.__staleWhileFetching?this.#D(e,"fetch"):i||(this.#p[t]=l.__staleWhileFetching)}if(a)return r.status&&void 0!==l.__staleWhileFetching&&(r.status.returnedStale=!0),l.__staleWhileFetching;if(l.__returned===l)throw n};r.status&&(r.status.fetchDispatched=!0);const u=new Promise((t,n)=>{const o=this.#s?.(e,i,c);o&&o instanceof Promise&&o.then(e=>t(void 0===e?void 0:e),n),s.signal.addEventListener("abort",()=>{r.ignoreFetchAbort&&!r.allowStaleOnFetchAbort||(t(void 0),r.allowStaleOnFetchAbort&&(t=e=>l(e,!0)))})}).then(l,e=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=e),d(e))),p=Object.assign(u,{__abortController:s,__staleWhileFetching:i,__returned:void 0});return void 0===t?(this.set(e,p,{...c.options,status:void 0}),t=this.#d.get(e)):this.#p[t]=p,p}#L(e){if(!this.#S)return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof o}async fetch(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:i=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:f=this.allowStaleOnFetchAbort,context:h,forceRefresh:m=!1,status:g,signal:y}=t;if(!this.#S)return g&&(g.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:o,status:g});const v={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:o,ttl:i,noDisposeOnSet:s,size:a,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:f,ignoreFetchAbort:p,status:g,signal:y};let b=this.#d.get(e);if(void 0===b){g&&(g.fetch="miss");const t=this.#C(e,b,v,h);return t.__returned=t}{const t=this.#p[b];if(this.#L(t)){const e=r&&void 0!==t.__staleWhileFetching;return g&&(g.fetch="inflight",e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}const o=this.#k(b);if(!m&&!o)return g&&(g.fetch="hit"),this.#N(b),n&&this.#j(b),g&&this.#R(g,b),t;const i=this.#C(e,b,v,h),s=void 0!==i.__staleWhileFetching&&r;return g&&(g.fetch=o?"stale":"refresh",s&&o&&(g.returnedStale=!0)),s?i.__staleWhileFetching:i.__returned=i}}async forceFetch(e,t={}){const r=await this.fetch(e,t);if(void 0===r)throw new Error("fetch() returned undefined");return r}memo(e,t={}){const r=this.#a;if(!r)throw new Error("no memoMethod provided to constructor");const{context:n,forceRefresh:o,...i}=t,s=this.get(e,i);if(!o&&void 0!==s)return s;const a=r(e,s,{options:i,context:n});return this.set(e,a,i),a}get(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:i}=t,s=this.#d.get(e);if(void 0!==s){const t=this.#p[s],a=this.#L(t);return i&&this.#R(i,s),this.#k(s)?(i&&(i.get="stale"),a?(i&&r&&void 0!==t.__staleWhileFetching&&(i.returnedStale=!0),r?t.__staleWhileFetching:void 0):(o||this.#D(e,"expire"),i&&r&&(i.returnedStale=!0),r?t:void 0)):(i&&(i.get="hit"),a?t.__staleWhileFetching:(this.#N(s),n&&this.#j(s),t))}i&&(i.get="miss")}#z(e,t){this.#h[t]=e,this.#f[e]=t}#N(e){e!==this.#g&&(e===this.#m?this.#m=this.#f[e]:this.#z(this.#h[e],this.#f[e]),this.#z(this.#g,e),this.#g=e)}delete(e){return this.#D(e,"delete")}#D(e,t){let r=!1;if(0!==this.#c){const n=this.#d.get(e);if(void 0!==n)if(r=!0,1===this.#c)this.#V(t);else{this.#F(n);const r=this.#p[n];if(this.#L(r)?r.__abortController.abort(new Error("deleted")):(this.#E||this.#P)&&(this.#E&&this.#n?.(r,e,t),this.#P&&this.#v?.push([r,e,t])),this.#d.delete(e),this.#u[n]=void 0,this.#p[n]=void 0,n===this.#g)this.#g=this.#h[n];else if(n===this.#m)this.#m=this.#f[n];else{const e=this.#h[n];this.#f[e]=this.#f[n];const t=this.#f[n];this.#h[t]=this.#h[n]}this.#c--,this.#y.push(n)}}if(this.#P&&this.#v?.length){const e=this.#v;let t;for(;t=e?.shift();)this.#i?.(...t)}return r}clear(){return this.#V("delete")}#V(e){for(const t of this.#O({allowStale:!0})){const r=this.#p[t];if(this.#L(r))r.__abortController.abort(new Error("deleted"));else{const n=this.#u[t];this.#E&&this.#n?.(r,n,e),this.#P&&this.#v?.push([r,n,e])}}if(this.#d.clear(),this.#p.fill(void 0),this.#u.fill(void 0),this.#w&&this.#$&&(this.#w.fill(0),this.#$.fill(0)),this.#b&&this.#b.fill(0),this.#m=0,this.#g=0,this.#y.length=0,this.#l=0,this.#c=0,this.#P&&this.#v){const e=this.#v;let t;for(;t=e?.shift();)this.#i?.(...t)}}}return Ut.LRUCache=d,Ut}function zt(){if(xt)return Tt;xt=1;const e=M,t=(e,t,r)=>{const n=e.indexOf(r);return e.lastIndexOf(t,n>-1?n:1/0)},r=t=>{try{return new e.URL(t)}catch{}};return Tt=(e,n)=>{const o=n?((e,t)=>{const r=e.indexOf(":"),n=e.slice(0,r+1);if(Object.prototype.hasOwnProperty.call(t,n))return e;const o=e.indexOf("@");return o>-1?o>r?`git+ssh://${e}`:e:e.indexOf("//")===r+1?e:`${e.slice(0,r+1)}//${e.slice(r+1)}`})(e,n):e;return r(o)||r((e=>{const r=t(e,"@","#"),n=t(e,":","#");return n>r&&(e=e.slice(0,n)+"/"+e.slice(n+1)),-1===t(e,":","#")&&-1===e.indexOf("//")&&(e=`git+ssh://${e}`),e})(o))},Tt}function Vt(){if(jt)return Dt;jt=1;const e=zt();return Dt=(t,r,{gitHosts:n,protocols:o})=>{if(!t)return;const i=(e=>{const t=e.indexOf("#"),r=e.indexOf("/"),n=e.indexOf("/",r+1),o=e.indexOf(":"),i=/\s/.exec(e),s=e.indexOf("@"),a=!i||t>-1&&i.index>t,c=-1===s||t>-1&&s>t,l=-1===o||t>-1&&o>t,d=-1===n||t>-1&&n>t,u=r>0,p=t>-1?"/"!==e[t-1]:!e.endsWith("/"),f=!e.startsWith(".");return a&&u&&p&&f&&c&&l&&d})(t)?`github:${t}`:t,s=e(i,o);if(!s)return;const a=n.byShortcut[s.protocol],c=n.byDomain[s.hostname.startsWith("www.")?s.hostname.slice(4):s.hostname],l=a||c;if(!l)return;const d=n[a||c];let u=null;o[s.protocol]?.auth&&(s.username||s.password)&&(u=`${s.username}${s.password?":"+s.password:""}`);let p=null,f=null,h=null,m=null;try{if(a){let e=s.pathname.startsWith("/")?s.pathname.slice(1):s.pathname;const t=e.indexOf("@");t>-1&&(e=e.slice(t+1));const r=e.lastIndexOf("/");r>-1?(f=decodeURIComponent(e.slice(0,r)),f||(f=null),h=decodeURIComponent(e.slice(r+1))):h=decodeURIComponent(e),h.endsWith(".git")&&(h=h.slice(0,-4)),s.hash&&(p=decodeURIComponent(s.hash.slice(1))),m="shortcut"}else{if(!d.protocols.includes(s.protocol))return;const e=d.extract(s);if(!e)return;f=e.user&&decodeURIComponent(e.user),h=decodeURIComponent(e.project),p=decodeURIComponent(e.committish),m=o[s.protocol]?.name||s.protocol.slice(0,-1)}}catch(e){if(e instanceof URIError)return;throw e}return[l,f,u,h,p,m,r]}}function Ht(){if(Ft)return Rt;Ft=1;const{LRUCache:e}=Bt(),t=function(){if(At)return kt;At=1;const e=(...e)=>e.every(e=>e)?e.join(""):"",t=e=>e?encodeURIComponent(e):"",r=e=>e.toLowerCase().replace(/^\W+/g,"").replace(/(?<!\W)\W+$/,"").replace(/\//g,"").replace(/\W+/g,"-"),n={sshtemplate:({domain:t,user:r,project:n,committish:o})=>`git@${t}:${r}/${n}.git${e("#",o)}`,sshurltemplate:({domain:t,user:r,project:n,committish:o})=>`git+ssh://git@${t}/${r}/${n}.git${e("#",o)}`,edittemplate:({domain:r,user:n,project:o,committish:i,editpath:s,path:a})=>`https://${r}/${n}/${o}${e("/",s,"/",t(i||"HEAD"),"/",a)}`,browsetemplate:({domain:r,user:n,project:o,committish:i,treepath:s})=>`https://${r}/${n}/${o}${e("/",s,"/",t(i))}`,browsetreetemplate:({domain:r,user:n,project:o,committish:i,treepath:s,path:a,fragment:c,hashformat:l})=>`https://${r}/${n}/${o}/${s}/${t(i||"HEAD")}/${a}${e("#",l(c||""))}`,browseblobtemplate:({domain:r,user:n,project:o,committish:i,blobpath:s,path:a,fragment:c,hashformat:l})=>`https://${r}/${n}/${o}/${s}/${t(i||"HEAD")}/${a}${e("#",l(c||""))}`,docstemplate:({domain:r,user:n,project:o,treepath:i,committish:s})=>`https://${r}/${n}/${o}${e("/",i,"/",t(s))}#readme`,httpstemplate:({auth:t,domain:r,user:n,project:o,committish:i})=>`git+https://${e(t,"@")}${r}/${n}/${o}.git${e("#",i)}`,filetemplate:({domain:e,user:r,project:n,committish:o,path:i})=>`https://${e}/${r}/${n}/raw/${t(o||"HEAD")}/${i}`,shortcuttemplate:({type:t,user:r,project:n,committish:o})=>`${t}:${r}/${n}${e("#",o)}`,pathtemplate:({user:t,project:r,committish:n})=>`${t}/${r}${e("#",n)}`,bugstemplate:({domain:e,user:t,project:r})=>`https://${e}/${t}/${r}/issues`,hashformat:r},o={};o.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:({auth:r,user:n,project:o,committish:i,path:s})=>`https://${e(r,"@")}raw.githubusercontent.com/${n}/${o}/${t(i||"HEAD")}/${s}`,gittemplate:({auth:t,domain:r,user:n,project:o,committish:i})=>`git://${e(t,"@")}${r}/${n}/${o}.git${e("#",i)}`,tarballtemplate:({domain:e,user:r,project:n,committish:o})=>`https://codeload.${e}/${r}/${n}/tar.gz/${t(o||"HEAD")}`,extract:e=>{let[,t,r,n,o]=e.pathname.split("/",5);if((!n||"tree"===n)&&(n||(o=e.hash.slice(1)),r&&r.endsWith(".git")&&(r=r.slice(0,-4)),t&&r))return{user:t,project:r,committish:o}}},o.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:({domain:r,user:n,project:o,committish:i,treepath:s,path:a,editpath:c})=>`https://${r}/${n}/${o}${e("/",s,"/",t(i||"HEAD"),"/",a,c)}`,tarballtemplate:({domain:e,user:r,project:n,committish:o})=>`https://${e}/${r}/${n}/get/${t(o||"HEAD")}.tar.gz`,extract:e=>{let[,t,r,n]=e.pathname.split("/",4);if(!["get"].includes(n)&&(r&&r.endsWith(".git")&&(r=r.slice(0,-4)),t&&r))return{user:t,project:r,committish:e.hash.slice(1)}}},o.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",httpstemplate:({auth:t,domain:r,user:n,project:o,committish:i})=>`git+https://${e(t,"@")}${r}/${n}/${o}.git${e("#",i)}`,tarballtemplate:({domain:e,user:r,project:n,committish:o})=>`https://${e}/${r}/${n}/repository/archive.tar.gz?ref=${t(o||"HEAD")}`,extract:e=>{const t=e.pathname.slice(1);if(t.includes("/-/")||t.includes("/archive.tar.gz"))return;const r=t.split("/");let n=r.pop();n.endsWith(".git")&&(n=n.slice(0,-4));const o=r.join("/");return o&&n?{user:o,project:n,committish:e.hash.slice(1)}:void 0}},o.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:({domain:t,project:r,committish:n})=>`git@${t}:${r}.git${e("#",n)}`,sshurltemplate:({domain:t,project:r,committish:n})=>`git+ssh://git@${t}/${r}.git${e("#",n)}`,edittemplate:({domain:r,user:n,project:o,committish:i,editpath:s})=>`https://${r}/${n}/${o}${e("/",t(i))}/${s}`,browsetemplate:({domain:r,project:n,committish:o})=>`https://${r}/${n}${e("/",t(o))}`,browsetreetemplate:({domain:r,project:n,committish:o,path:i,hashformat:s})=>`https://${r}/${n}${e("/",t(o))}${e("#",s(i))}`,browseblobtemplate:({domain:r,project:n,committish:o,path:i,hashformat:s})=>`https://${r}/${n}${e("/",t(o))}${e("#",s(i))}`,docstemplate:({domain:r,project:n,committish:o})=>`https://${r}/${n}${e("/",t(o))}`,httpstemplate:({domain:t,project:r,committish:n})=>`git+https://${t}/${r}.git${e("#",n)}`,filetemplate:({user:r,project:n,committish:o,path:i})=>`https://gist.githubusercontent.com/${r}/${n}/raw${e("/",t(o))}/${i}`,shortcuttemplate:({type:t,project:r,committish:n})=>`${t}:${r}${e("#",n)}`,pathtemplate:({project:t,committish:r})=>`${t}${e("#",r)}`,bugstemplate:({domain:e,project:t})=>`https://${e}/${t}`,gittemplate:({domain:t,project:r,committish:n})=>`git://${t}/${r}.git${e("#",n)}`,tarballtemplate:({project:e,committish:r})=>`https://codeload.github.com/gist/${e}/tar.gz/${t(r||"HEAD")}`,extract:e=>{let[,t,r,n]=e.pathname.split("/",4);if("raw"!==n){if(!r){if(!t)return;r=t,t=null}return r.endsWith(".git")&&(r=r.slice(0,-4)),{user:t,project:r,committish:e.hash.slice(1)}}},hashformat:function(e){return e&&"file-"+r(e)}},o.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:({domain:e,user:r,project:n,committish:o,path:i})=>`https://${e}/${r}/${n}/blob/${t(o)||"HEAD"}/${i}`,httpstemplate:({domain:t,user:r,project:n,committish:o})=>`https://${t}/${r}/${n}.git${e("#",o)}`,tarballtemplate:({domain:e,user:r,project:n,committish:o})=>`https://${e}/${r}/${n}/archive/${t(o)||"HEAD"}.tar.gz`,bugstemplate:()=>null,extract:e=>{let[,t,r,n]=e.pathname.split("/",4);if(!["archive"].includes(n)&&(r&&r.endsWith(".git")&&(r=r.slice(0,-4)),t&&r))return{user:t,project:r,committish:e.hash.slice(1)}}};for(const[e,t]of Object.entries(o))o[e]=Object.assign({},n,t);return kt=o}(),r=Vt(),n=zt(),o=new e({max:1e3});class i{constructor(e,t,r,n,o,s,a={}){Object.assign(this,i.#H[e],{type:e,user:t,auth:r,project:n,committish:o,default:s,opts:a})}static#H={byShortcut:{},byDomain:{}};static#q={"git+ssh:":{name:"sshurl"},"ssh:":{name:"sshurl"},"git+https:":{name:"https",auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(e,t){i.#H[e]=t,i.#H.byDomain[t.domain]=e,i.#H.byShortcut[`${e}:`]=e,i.#q[`${e}:`]={name:e}}static fromUrl(e,t){if("string"!=typeof e)return;const n=e+JSON.stringify(t||{});if(!o.has(n)){const s=r(e,t,{gitHosts:i.#H,protocols:i.#q});o.set(n,s?new i(...s):void 0)}return o.get(n)}static fromManifest(e,t={}){if(!e||"object"!=typeof e)return;const r=e.repository,n=r&&("string"==typeof r?r:"object"==typeof r&&"string"==typeof r.url?r.url:null);if(!n)throw new Error("no repository");const o=n&&i.fromUrl(n.replace(/^git\+/,""),t)||null;if(o)return o;const s=function(e){try{const{protocol:t,hostname:r,pathname:n}=new URL(e);if(!r)return null;return`${/(?:git\+)http:$/.test(t)?"http:":"https:"}//${r}${n.replace(/\.git$/,"")}`}catch{return null}}(n);return i.fromUrl(s,t)||s}static parseUrl(e){return n(e)}#K(e,t){if("function"!=typeof e)return null;const r={...this,...this.opts,...t};r.path||(r.path=""),r.path.startsWith("/")&&(r.path=r.path.slice(1)),r.noCommittish&&(r.committish=null);const n=e(r);return r.noGitPlus&&n.startsWith("git+")?n.slice(4):n}hash(){return this.committish?`#${this.committish}`:""}ssh(e){return this.#K(this.sshtemplate,e)}sshurl(e){return this.#K(this.sshurltemplate,e)}browse(e,...t){return"string"!=typeof e?this.#K(this.browsetemplate,e):"string"!=typeof t[0]?this.#K(this.browsetreetemplate,{...t[0],path:e}):this.#K(this.browsetreetemplate,{...t[1],fragment:t[0],path:e})}browseFile(e,...t){return"string"!=typeof t[0]?this.#K(this.browseblobtemplate,{...t[0],path:e}):this.#K(this.browseblobtemplate,{...t[1],fragment:t[0],path:e})}docs(e){return this.#K(this.docstemplate,e)}bugs(e){return this.#K(this.bugstemplate,e)}https(e){return this.#K(this.httpstemplate,e)}git(e){return this.#K(this.gittemplate,e)}shortcut(e){return this.#K(this.shortcuttemplate,e)}path(e){return this.#K(this.pathtemplate,e)}tarball(e){return this.#K(this.tarballtemplate,{...e,noCommittish:!1})}file(e,t){return this.#K(this.filetemplate,{...t,path:e})}edit(e,t){return this.#K(this.edittemplate,{...t,path:e})}getDefaultRepresentation(){return this.default}toString(e){return this.default&&"function"==typeof this[this.default]?this[this.default](e):this.sshurl(e)}}for(const[e,r]of Object.entries(t))i.addHost(e,r);return Rt=i}var qt,Kt,Wt={topLevel:{dependancies:"dependencies",dependecies:"dependencies",depdenencies:"dependencies",devEependencies:"devDependencies",depends:"dependencies","dev-dependencies":"devDependencies",devDependences:"devDependencies",devDepenencies:"devDependencies",devdependencies:"devDependencies",repostitory:"repository",repo:"repository",prefereGlobal:"preferGlobal",hompage:"homepage",hampage:"homepage",autohr:"author",autor:"author",contributers:"contributors",publicationConfig:"publishConfig",script:"scripts"},bugs:{web:"url",name:"url"},script:{server:"start",tests:"test"}};function Yt(){if(Kt)return qt;Kt=1;var{URL:e}=o,t=function(){if(st)return it;st=1;const e=pt();return it=(t,r)=>{const n=e(t,r);return n?n.version:null}}(),r=function(){if(ct)return at;ct=1;const e=pt();return at=(t,r)=>{const n=e(t.trim().replace(/^[=v]+/,""),r);return n?n.version:null}}(),n=It(),i=Ht(),{isBuiltin:s}=G,a=["dependencies","devDependencies","optionalDependencies"],c=Gt?Mt:(Gt=1,Mt=function(e){if(!e)return;if("ERROR: No README data found!"===e)return;e=e.trim().split("\n");let t=0;for(;e[t]&&e[t].trim().match(/^(#|$)/);)t++;const r=e.length;let n=t+1;for(;n<r&&e[n].trim();)n++;return e.slice(t,n).join(" ").trim()}),l=Wt,d=e=>e.includes("@")&&e.indexOf("@")<e.lastIndexOf(".");function u(e,t){return e.author&&(e.author=t(e.author)),["maintainers","contributors"].forEach(function(r){Array.isArray(e[r])&&(e[r]=e[r].map(t))}),e}function p(e){if("string"==typeof e)return e;var t=e.name||"",r=e.url||e.web,n=r?" ("+r+")":"",o=e.email||e.mail;return t+(o?" <"+o+">":"")+n}function f(e){if("string"!=typeof e)return e;var t=e.match(/^([^(<]+)/),r=e.match(/\(([^()]+)\)/),n=e.match(/<([^<>]+)>/),o={};return t&&t[0].trim()&&(o.name=t[0].trim()),n&&(o.email=n[1]),r&&(o.url=r[1]),o}return qt={warn:function(){},fixRepositoryField:function(e){if(e.repositories&&(this.warn("repositories"),e.repository=e.repositories[0]),!e.repository)return this.warn("missingRepository");"string"==typeof e.repository&&(e.repository={type:"git",url:e.repository});var t=e.repository.url||"";if(t){var r=i.fromUrl(t);r&&(t=e.repository.url="shortcut"===r.getDefaultRepresentation()?r.https():r.toString())}t.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn("brokenGitUrl",t)},fixTypos:function(e){Object.keys(l.topLevel).forEach(function(t){Object.prototype.hasOwnProperty.call(e,t)&&this.warn("typo",t,l.topLevel[t])},this)},fixScriptsField:function(e){if(e.scripts)return"object"!=typeof e.scripts?(this.warn("nonObjectScripts"),void delete e.scripts):void Object.keys(e.scripts).forEach(function(t){"string"!=typeof e.scripts[t]?(this.warn("nonStringScript"),delete e.scripts[t]):l.script[t]&&!e.scripts[l.script[t]]&&this.warn("typo",t,l.script[t],"scripts")},this)},fixFilesField:function(e){var t=e.files;t&&!Array.isArray(t)?(this.warn("nonArrayFiles"),delete e.files):e.files&&(e.files=e.files.filter(function(e){return!(!e||"string"!=typeof e)||(this.warn("invalidFilename",e),!1)},this))},fixBinField:function(e){if(e.bin&&"string"==typeof e.bin){var t,r={};(t=e.name.match(/^@[^/]+[/](.*)$/))?r[t[1]]=e.bin:r[e.name]=e.bin,e.bin=r}},fixManField:function(e){e.man&&"string"==typeof e.man&&(e.man=[e.man])},fixBundleDependenciesField:function(e){var t="bundledDependencies",r="bundleDependencies";e[t]&&!e[r]&&(e[r]=e[t],delete e[t]),e[r]&&!Array.isArray(e[r])?(this.warn("nonArrayBundleDependencies"),delete e[r]):e[r]&&(e[r]=e[r].filter(function(t){return t&&"string"==typeof t?(e.dependencies||(e.dependencies={}),Object.prototype.hasOwnProperty.call(e.dependencies,t)||(this.warn("nonDependencyBundleDependency",t),e.dependencies[t]="*"),!0):(this.warn("nonStringBundleDependency",t),!1)},this))},fixDependencies:function(e){!function(e,t){a.forEach(function(r){e[r]&&(e[r]=function(e,t,r){if(!e)return{};"string"==typeof e&&(e=e.trim().split(/[\n\r\s\t ,]+/));if(!Array.isArray(e))return e;r("deprecatedArrayDependencies",t);var n={};return e.filter(function(e){return"string"==typeof e}).forEach(function(e){var t=(e=e.trim().split(/(:?[@\s><=])/)).shift(),r=e.join("");r=(r=r.trim()).replace(/^@/,""),n[t]=r}),n}(e[r],r,t))})}(e,this.warn),function(e){var t=e.optionalDependencies;if(!t)return;var r=e.dependencies||{};Object.keys(t).forEach(function(e){r[e]=t[e]}),e.dependencies=r}(e,this.warn),this.fixBundleDependenciesField(e),["dependencies","devDependencies"].forEach(function(t){if(t in e)return e[t]&&"object"==typeof e[t]?void Object.keys(e[t]).forEach(function(r){var n=e[t][r];"string"!=typeof n&&(this.warn("nonStringDependency",r,JSON.stringify(n)),delete e[t][r]);var o=i.fromUrl(e[t][r]);o&&(e[t][r]=o.toString())},this):(this.warn("nonObjectDependencies",t),void delete e[t])},this)},fixModulesField:function(e){e.modules&&(this.warn("deprecatedModules"),delete e.modules)},fixKeywordsField:function(e){"string"==typeof e.keywords&&(e.keywords=e.keywords.split(/,\s+/)),e.keywords&&!Array.isArray(e.keywords)?(delete e.keywords,this.warn("nonArrayKeywords")):e.keywords&&(e.keywords=e.keywords.filter(function(e){return!("string"!=typeof e||!e)||(this.warn("nonStringKeyword"),!1)},this))},fixVersionField:function(e,n){var o=!n;if(!e.version)return e.version="",!0;if(!t(e.version,o))throw new Error('Invalid version: "'+e.version+'"');return e.version=r(e.version,o),!0},fixPeople:function(e){u(e,p),u(e,f)},fixNameField:function(e,t){"boolean"==typeof t?t={strict:t}:void 0===t&&(t={});var r=t.strict;if(e.name||r){if("string"!=typeof e.name)throw new Error("name field must be a string.");r||(e.name=e.name.trim()),function(e,t,r){if("."===e.charAt(0)||!function(e){if("@"!==e.charAt(0))return!1;var t=e.slice(1).split("/");if(2!==t.length)return!1;return t[0]&&t[1]&&t[0]===encodeURIComponent(t[0])&&t[1]===encodeURIComponent(t[1])}(e)&&(n=e,n.match(/[/@\s+%:]/)||n!==encodeURIComponent(n))||t&&!r&&e!==e.toLowerCase()||"node_modules"===e.toLowerCase()||"favicon.ico"===e.toLowerCase())throw new Error("Invalid name: "+JSON.stringify(e));var n}(e.name,r,t.allowLegacyCase),s(e.name)&&this.warn("conflictingName",e.name)}else e.name=""},fixDescriptionField:function(e){e.description&&"string"!=typeof e.description&&(this.warn("nonStringDescription"),delete e.description),e.readme&&!e.description&&(e.description=c(e.readme)),void 0===e.description&&delete e.description,e.description||this.warn("missingDescription")},fixReadmeField:function(e){e.readme||(this.warn("missingReadme"),e.readme="ERROR: No README data found!")},fixBugsField:function(t){if(!t.bugs&&t.repository&&t.repository.url){var r=i.fromUrl(t.repository.url);r&&r.bugs()&&(t.bugs={url:r.bugs()})}else if(t.bugs){if("string"==typeof t.bugs)d(t.bugs)?t.bugs={email:t.bugs}:e.canParse(t.bugs)?t.bugs={url:t.bugs}:this.warn("nonEmailUrlBugsString");else{!function(e,t){if(!e)return;Object.keys(e).forEach(function(r){l.bugs[r]&&(t("typo",r,l.bugs[r],"bugs"),e[l.bugs[r]]=e[r],delete e[r])})}(t.bugs,this.warn);var n=t.bugs;t.bugs={},n.url&&(e.canParse(n.url)?t.bugs.url=n.url:this.warn("nonUrlBugsUrlField")),n.email&&("string"==typeof n.email&&d(n.email)?t.bugs.email=n.email:this.warn("nonEmailBugsEmailField"))}t.bugs.email||t.bugs.url||(delete t.bugs,this.warn("emptyNormalizedBugs"))}},fixHomepageField:function(t){if(!t.homepage&&t.repository&&t.repository.url){var r=i.fromUrl(t.repository.url);r&&r.docs()&&(t.homepage=r.docs())}if(t.homepage)return"string"!=typeof t.homepage?(this.warn("nonUrlHomepage"),delete t.homepage):void(e.canParse(t.homepage)||(t.homepage="http://"+t.homepage))},fixLicenseField:function(e){const t=e.license||e.licence;return t?"string"!=typeof t||t.length<1||""===t.trim()?this.warn("invalidLicense"):n(t).validForNewPackages?void 0:this.warn("invalidLicense"):this.warn("missingLicense")}},qt}var Jt,Xt,Zt,Qt,er={repositories:"'repositories' (plural) Not supported. Please pick one as the 'repository' field",missingRepository:"No repository field.",brokenGitUrl:"Probably broken git url: %s",nonObjectScripts:"scripts must be an object",nonStringScript:"script values must be string commands",nonArrayFiles:"Invalid 'files' member",invalidFilename:"Invalid filename in 'files' list: %s",nonArrayBundleDependencies:"Invalid 'bundleDependencies' list. Must be array of package names",nonStringBundleDependency:"Invalid bundleDependencies member: %s",nonDependencyBundleDependency:"Non-dependency in bundleDependencies: %s",nonObjectDependencies:"%s field must be an object",nonStringDependency:"Invalid dependency: %s %s",deprecatedArrayDependencies:"specifying %s as array is deprecated",deprecatedModules:"modules field is deprecated",nonArrayKeywords:"keywords should be an array of strings",nonStringKeyword:"keywords should be an array of strings",conflictingName:"%s is also the name of a node core module.",nonStringDescription:"'description' field should be a string",missingDescription:"No description",missingReadme:"No README data",missingLicense:"No license field.",nonEmailUrlBugsString:"Bug string field must be url, email, or {email,url}",nonUrlBugsUrlField:"bugs.url field must be a string url. Deleted.",nonEmailBugsEmailField:"bugs.email field must be a string email. Deleted.",emptyNormalizedBugs:"Normalized value of bugs field is an empty object. Deleted.",nonUrlHomepage:"homepage field must be a string url. Deleted.",invalidLicense:"license should be a valid SPDX license expression",typo:"%s should probably be %s."};function tr(){if(Xt)return Jt;Xt=1;var e=U,t=er;function r(r,n,o){return o&&(r=o+"['"+r+"']",n=o+"['"+n+"']"),e.format(t.typo,r,n)}return Jt=function(){var n=Array.prototype.slice.call(arguments,0),o=n.shift();if("typo"===o)return r.apply(null,n);var i=t[o]?t[o]:o+": '%s'";return n.unshift(i),e.format.apply(null,n)},Jt}!function(){if(Qt)return Zt;Qt=1,Zt=n;var e=Yt();n.fixer=e;var t=tr(),r=["name","version","description","repository","modules","scripts","files","bin","man","bugs","keywords","readme","homepage","license"].map(function(e){return o(e)+"Field"});function n(n,i,s){!0===i&&(i=null,s=!0),s||(s=!1),i&&!n.private||(i=function(){}),n.scripts&&"node-gyp rebuild"===n.scripts.install&&!n.scripts.preinstall&&(n.gypfile=!0),e.warn=function(){i(t.apply(null,arguments))},r.forEach(function(t){e["fix"+o(t)](n,s)}),n._id=n.name+"@"+n.version}function o(e){return e.charAt(0).toUpperCase()+e.slice(1)}r=r.concat(["dependencies","people","typos"])}();const rr=e("manifest").description("Generate or validate a Fusion portal manifest file.").addHelpText("after",["","By default, outputs the generated manifest object to stdout or a file. Use --output to write to a file.","","Note:","- If not `portal.manifest(.$ENV)?.[ts|js|json]` is found it will fallback to generate a default manifest","","Examples:"," $ ffc portal manifest"," $ ffc portal manifest portal.manifest.prod.ts --output ./dist/portal.manifest.json",' $ ffc portal manifest --silent | jq ".build.entryPoint"'," $ ffc portal manifest --debug"].join("\n")).option("-d, --debug","Enable debug mode for verbose logging",!1).option("-o, --output <string>","Write manifest to the specified file","stdout").option("-s, --silent","Silent mode, suppresses output except errors").argument("[manifest]","Manifest build file to use (e.g., portal.manifest[.env]?.[ts,js,json])").action(async(e,t)=>{const r=t.silent?null:new l("portal:manifest",{debug:t.debug}),n=await P({log:r,manifest:e});if(t.output){const e=s(process.cwd(),t.output);r?.start("Writing manifest to file",t.output),ke(a(e))||await A(a(e),{recursive:!0}),await T(e,JSON.stringify(n.manifest,null,2)),r?.succeed("Manifest written to file",e)}else console.log(JSON.stringify(n.manifest,null,2))});var nr,or={exports:{}},ir={},sr={},ar={},cr={},lr={},dr={};function ur(){return nr||(nr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e),{})}}function o(e,...t){const r=[e[0]];let o=0;for(;o<t.length;)a(r,t[o]),r.push(e[++o]);return new n(r)}e._Code=n,e.nil=new n(""),e._=o;const i=new n("+");function s(e,...t){const r=[l(e[0])];let o=0;for(;o<t.length;)r.push(i),a(r,t[o]),r.push(i,l(e[++o]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===i){const r=c(e[t-1],e[t+1]);if(void 0!==r){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}(r),new n(r)}function a(e,t){var o;t instanceof n?e.push(...t._items):t instanceof r?e.push(t):e.push("number"==typeof(o=t)||"boolean"==typeof o||null===o?o:l(Array.isArray(o)?o.join(","):o))}function c(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof r||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof r?void 0:`"${e}${t.slice(1)}`}function l(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.str=s,e.addCodeArg=a,e.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:s`${e}${t}`},e.stringify=function(e){return new n(l(e))},e.safeStringify=l,e.getProperty=function(t){return"string"==typeof t&&e.IDENTIFIER.test(t)?new n(`.${t}`):o`[${t}]`},e.getEsmExportName=function(t){if("string"==typeof t&&e.IDENTIFIER.test(t))return new n(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)},e.regexpCode=function(e){return new n(e.toString())}}(dr)),dr}var pr,fr,hr={};function mr(){return pr||(pr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=ur();class r extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var n;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class o{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,r;if((null===(r=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===r?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}e.Scope=o;class i extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=t._`.${new t.Name(r)}[${n}]`}}e.ValueScopeName=i;const s=t._`\n`;e.ValueScope=class extends o{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?s:t.nil}}get(){return this._scope}name(e){return new i(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const n=this.toName(e),{prefix:o}=n,i=null!==(r=t.key)&&void 0!==r?r:t.ref;let s=this._values[o];if(s){const e=s.get(i);if(e)return e}else s=this._values[o]=new Map;s.set(i,n);const a=this._scope[o]||(this._scope[o]=[]),c=a.length;return a[c]=t.ref,n.setValue(t,{property:o,itemIndex:c}),n}getValue(e,t){const r=this._values[e];if(r)return r.get(t)}scopeRefs(e,r=this._values){return this._reduceValues(r,r=>{if(void 0===r.scopePath)throw new Error(`CodeGen: name "${r}" has no value`);return t._`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,r)}_reduceValues(o,i,s={},a){let c=t.nil;for(const l in o){const d=o[l];if(!d)continue;const u=s[l]=s[l]||new Map;d.forEach(o=>{if(u.has(o))return;u.set(o,n.Started);let s=i(o);if(s){const r=this.opts.es5?e.varKinds.var:e.varKinds.const;c=t._`${c}${r} ${o} = ${s};${this.opts._n}`}else{if(!(s=null==a?void 0:a(o)))throw new r(o);c=t._`${c}${s}${this.opts._n}`}u.set(o,n.Completed)})}return c}}}(hr)),hr}function gr(){return fr||(fr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=ur(),r=mr();var n=ur();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var o=mr();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class i{optimizeNodes(){return this}optimizeNames(e,t){return this}}class s extends i{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const n=e?r.varKinds.var:this.varKind,o=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=I(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class a extends i{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof t.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=I(this.rhs,e,r),this}get names(){return N(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}}class c extends a{constructor(e,t,r,n){super(e,r,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class l extends i{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class d extends i{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class u extends i{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class p extends i{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=I(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class f extends i{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let n=r.length;for(;n--;){const o=r[n];o.optimizeNames(e,t)||(O(e,o.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>C(e,t.names),{})}}class h extends f{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class m extends f{}class g extends h{}g.kind="else";class y extends h{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new g(e):e}return t?!1===e?t instanceof y?t:t.nodes:this.nodes.length?this:new y(k(e),t instanceof y?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=I(this.condition,e,t),this}get names(){const e=super.names;return N(e,this.condition),this.else&&C(e,this.else.names),e}}y.kind="if";class v extends h{}v.kind="for";class b extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=I(this.iteration,e,t),this}get names(){return C(super.names,this.iteration.names)}}class $ extends v{constructor(e,t,r,n){super(),this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){const t=e.es5?r.varKinds.var:this.varKind,{name:n,from:o,to:i}=this;return`for(${t} ${n}=${o}; ${n}<${i}; ${n}++)`+super.render(e)}get names(){const e=N(super.names,this.from);return N(e,this.to)}}class w extends v{constructor(e,t,r,n){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=I(this.iterable,e,t),this}get names(){return C(super.names,this.iterable.names)}}class E extends h{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}E.kind="func";class S extends f{render(e){return"return "+super.render(e)}}S.kind="return";class P extends h{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(n=this.finally)||void 0===n||n.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&C(e,this.catch.names),this.finally&&C(e,this.finally.names),e}}class _ extends h{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}_.kind="catch";class L extends h{render(e){return"finally"+super.render(e)}}L.kind="finally";function C(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function N(e,r){return r instanceof t._CodeOrName?C(e,r.names):e}function I(e,r,n){return e instanceof t.Name?i(e):(o=e)instanceof t._Code&&o._items.some(e=>e instanceof t.Name&&1===r[e.str]&&void 0!==n[e.str])?new t._Code(e._items.reduce((e,r)=>(r instanceof t.Name&&(r=i(r)),r instanceof t._Code?e.push(...r._items):e.push(r),e),[])):e;var o;function i(e){const t=n[e.str];return void 0===t||1!==r[e.str]?e:(delete r[e.str],t)}}function O(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function k(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:t._`!${D(e)}`}e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new r.Scope({parent:e}),this._nodes=[new m]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){const o=this._scope.toName(t);return void 0!==r&&n&&(this._constants[o.str]=r),this._leafNode(new s(e,o,r)),o}const(e,t,n){return this._def(r.varKinds.const,e,t,n)}let(e,t,n){return this._def(r.varKinds.let,e,t,n)}var(e,t,n){return this._def(r.varKinds.var,e,t,n)}assign(e,t,r){return this._leafNode(new a(e,t,r))}add(t,r){return this._leafNode(new c(t,e.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==t.nil&&this._leafNode(new p(e)),this}object(...e){const r=["{"];for(const[n,o]of e)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,t.addCodeArg)(r,o));return r.push("}"),new t._Code(r)}if(e,t,r){if(this._blockNode(new y(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new y(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(y,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new b(e),t)}forRange(e,t,n,o,i=(this.opts.es5?r.varKinds.var:r.varKinds.let)){const s=this._scope.toName(e);return this._for(new $(i,s,t,n),()=>o(s))}forOf(e,n,o,i=r.varKinds.const){const s=this._scope.toName(e);if(this.opts.es5){const e=n instanceof t.Name?n:this.var("_arr",n);return this.forRange("_i",0,t._`${e}.length`,r=>{this.var(s,t._`${e}[${r}]`),o(s)})}return this._for(new w("of",i,s,n),()=>o(s))}forIn(e,n,o,i=(this.opts.es5?r.varKinds.var:r.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,t._`Object.keys(${n})`,o);const s=this._scope.toName(e);return this._for(new w("in",i,s,n),()=>o(s))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new l(e))}break(e){return this._leafNode(new d(e))}return(e){const t=new S;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new P;if(this._blockNode(n),this.code(e),t){const e=this.name("e");this._currNode=n.catch=new _(e),t(e)}return r&&(this._currNode=n.finally=new L,this.code(r)),this._endBlockNode(_,L)}throw(e){return this._leafNode(new u(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,r=t.nil,n,o){return this._blockNode(new E(e,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(E)}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,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof y))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},e.not=k;const A=x(e.operators.AND);e.and=function(...e){return e.reduce(A)};const T=x(e.operators.OR);function x(e){return(r,n)=>r===t.nil?n:n===t.nil?r:t._`${D(r)} ${e} ${D(n)}`}function D(e){return e instanceof t.Name?e:t._`(${e})`}e.or=function(...e){return e.reduce(T)}}(lr)),lr}var yr,vr={};function br(){if(yr)return vr;yr=1,Object.defineProperty(vr,"__esModule",{value:!0}),vr.checkStrictMode=vr.getErrorPath=vr.Type=vr.useFunc=vr.setEvaluated=vr.evaluatedPropsToName=vr.mergeEvaluated=vr.eachItem=vr.unescapeJsonPointer=vr.escapeJsonPointer=vr.escapeFragment=vr.unescapeFragment=vr.schemaRefOrVal=vr.schemaHasRulesButRef=vr.schemaHasRules=vr.checkUnknownRules=vr.alwaysValidSchema=vr.toHash=void 0;const e=gr(),t=ur();function r(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const o=n.RULES.keywords;for(const r in t)o[r]||u(e,`unknown keyword: "${r}"`)}function n(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function o(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function i(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function s({mergeNames:t,mergeToName:r,mergeValues:n,resultToName:o}){return(i,s,a,c)=>{const l=void 0===a?s:a instanceof e.Name?(s instanceof e.Name?t(i,s,a):r(i,s,a),a):s instanceof e.Name?(r(i,a,s),s):n(s,a);return c!==e.Name||l instanceof e.Name?l:o(i,l)}}function a(t,r){if(!0===r)return t.var("props",!0);const n=t.var("props",e._`{}`);return void 0!==r&&c(t,n,r),n}function c(t,r,n){Object.keys(n).forEach(n=>t.assign(e._`${r}${(0,e.getProperty)(n)}`,!0))}vr.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},vr.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(r(e,t),!n(t,e.self.RULES.all))},vr.checkUnknownRules=r,vr.schemaHasRules=n,vr.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},vr.schemaRefOrVal=function({topSchemaRef:t,schemaPath:r},n,o,i){if(!i){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return e._`${n}`}return e._`${t}${r}${(0,e.getProperty)(o)}`},vr.unescapeFragment=function(e){return i(decodeURIComponent(e))},vr.escapeFragment=function(e){return encodeURIComponent(o(e))},vr.escapeJsonPointer=o,vr.unescapeJsonPointer=i,vr.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},vr.mergeEvaluated={props:s({mergeNames:(t,r,n)=>t.if(e._`${n} !== true && ${r} !== undefined`,()=>{t.if(e._`${r} === true`,()=>t.assign(n,!0),()=>t.assign(n,e._`${n} || {}`).code(e._`Object.assign(${n}, ${r})`))}),mergeToName:(t,r,n)=>t.if(e._`${n} !== true`,()=>{!0===r?t.assign(n,!0):(t.assign(n,e._`${n} || {}`),c(t,n,r))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:a}),items:s({mergeNames:(t,r,n)=>t.if(e._`${n} !== true && ${r} !== undefined`,()=>t.assign(n,e._`${r} === true ? true : ${n} > ${r} ? ${n} : ${r}`)),mergeToName:(t,r,n)=>t.if(e._`${n} !== true`,()=>t.assign(n,!0===r||e._`${n} > ${r} ? ${n} : ${r}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},vr.evaluatedPropsToName=a,vr.setEvaluated=c;const l={};var d;function u(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}return vr.useFunc=function(e,r){return e.scopeValue("func",{ref:r,code:l[r.code]||(l[r.code]=new t._Code(r.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(d||(vr.Type=d={})),vr.getErrorPath=function(t,r,n){if(t instanceof e.Name){const o=r===d.Num;return n?o?e._`"[" + ${t} + "]"`:e._`"['" + ${t} + "']"`:o?e._`"/" + ${t}`:e._`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,e.getProperty)(t).toString():"/"+o(t)},vr.checkStrictMode=u,vr}var $r,wr,Er,Sr={};function Pr(){if($r)return Sr;$r=1,Object.defineProperty(Sr,"__esModule",{value:!0});const e=gr(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return Sr.default=t,Sr}function _r(){return wr||(wr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=gr(),r=br(),n=Pr();function o(e,r){const o=e.const("err",r);e.if(t._`${n.default.vErrors} === null`,()=>e.assign(n.default.vErrors,t._`[${o}]`),t._`${n.default.vErrors}.push(${o})`),e.code(t._`${n.default.errors}++`)}function i(e,r){const{gen:n,validateName:o,schemaEnv:i}=e;i.$async?n.throw(t._`new ${e.ValidationError}(${r})`):(n.assign(t._`${o}.errors`,r),n.return(!1))}e.keywordError={message:({keyword:e})=>t.str`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:r})=>r?t.str`"${e}" keyword must be ${r} ($data)`:t.str`"${e}" keyword is invalid ($data)`},e.reportError=function(r,n=e.keywordError,s,c){const{it:l}=r,{gen:d,compositeRule:u,allErrors:p}=l,f=a(r,n,s);(null!=c?c:u||p)?o(d,f):i(l,t._`[${f}]`)},e.reportExtraError=function(t,r=e.keywordError,s){const{it:c}=t,{gen:l,compositeRule:d,allErrors:u}=c;o(l,a(t,r,s)),d||u||i(c,n.default.vErrors)},e.resetErrorsCount=function(e,r){e.assign(n.default.errors,r),e.if(t._`${n.default.vErrors} !== null`,()=>e.if(r,()=>e.assign(t._`${n.default.vErrors}.length`,r),()=>e.assign(n.default.vErrors,null)))},e.extendErrors=function({gen:e,keyword:r,schemaValue:o,data:i,errsCount:s,it:a}){if(void 0===s)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",s,n.default.errors,s=>{e.const(c,t._`${n.default.vErrors}[${s}]`),e.if(t._`${c}.instancePath === undefined`,()=>e.assign(t._`${c}.instancePath`,(0,t.strConcat)(n.default.instancePath,a.errorPath))),e.assign(t._`${c}.schemaPath`,t.str`${a.errSchemaPath}/${r}`),a.opts.verbose&&(e.assign(t._`${c}.schema`,o),e.assign(t._`${c}.data`,i))})};const s={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function a(e,r,o){const{createErrors:i}=e.it;return!1===i?t._`{}`:function(e,r,o={}){const{gen:i,it:a}=e,d=[c(a,o),l(e,o)];return function(e,{params:r,message:o},i){const{keyword:a,data:c,schemaValue:l,it:d}=e,{opts:u,propertyName:p,topSchemaRef:f,schemaPath:h}=d;i.push([s.keyword,a],[s.params,"function"==typeof r?r(e):r||t._`{}`]),u.messages&&i.push([s.message,"function"==typeof o?o(e):o]);u.verbose&&i.push([s.schema,l],[s.parentSchema,t._`${f}${h}`],[n.default.data,c]);p&&i.push([s.propertyName,p])}(e,r,d),i.object(...d)}(e,r,o)}function c({errorPath:e},{instancePath:o}){const i=o?t.str`${e}${(0,r.getErrorPath)(o,r.Type.Str)}`:e;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,i)]}function l({keyword:e,it:{errSchemaPath:n}},{schemaPath:o,parentSchema:i}){let a=i?n:t.str`${n}/${e}`;return o&&(a=t.str`${a}${(0,r.getErrorPath)(o,r.Type.Str)}`),[s.schemaPath,a]}}(cr)),cr}var Lr,Cr={},Nr={};function Ir(){if(Lr)return Nr;Lr=1,Object.defineProperty(Nr,"__esModule",{value:!0}),Nr.getRules=Nr.isJSONType=void 0;const e=new Set(["string","number","integer","boolean","null","object","array"]);return Nr.isJSONType=function(t){return"string"==typeof t&&e.has(t)},Nr.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}},Nr}var Or,kr,Ar={};function Tr(){if(Or)return Ar;function e(e,r){return r.rules.some(r=>t(e,r))}function t(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some(t=>void 0!==e[t]))}return Or=1,Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.shouldUseRule=Ar.shouldUseGroup=Ar.schemaHasRulesForType=void 0,Ar.schemaHasRulesForType=function({schema:t,self:r},n){const o=r.RULES.types[n];return o&&!0!==o&&e(t,o)},Ar.shouldUseGroup=e,Ar.shouldUseRule=t,Ar}function xr(){if(kr)return Cr;kr=1,Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.reportTypeError=Cr.checkDataTypes=Cr.checkDataType=Cr.coerceAndCheckDataType=Cr.getJSONTypes=Cr.getSchemaTypes=Cr.DataType=void 0;const e=Ir(),t=Tr(),r=_r(),n=gr(),o=br();var i;function s(t){const r=Array.isArray(t)?t:t?[t]:[];if(r.every(e.isJSONType))return r;throw new Error("type must be JSONType or JSONType[]: "+r.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(i||(Cr.DataType=i={})),Cr.getSchemaTypes=function(e){const t=s(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},Cr.getJSONTypes=s,Cr.coerceAndCheckDataType=function(e,r){const{gen:o,data:s,opts:c}=e,d=function(e,t){return t?e.filter(e=>a.has(e)||"array"===t&&"array"===e):[]}(r,c.coerceTypes),p=r.length>0&&!(0===d.length&&1===r.length&&(0,t.schemaHasRulesForType)(e,r[0]));if(p){const t=l(r,s,c.strictNumbers,i.Wrong);o.if(t,()=>{d.length?function(e,t,r){const{gen:o,data:i,opts:s}=e,c=o.let("dataType",n._`typeof ${i}`),d=o.let("coerced",n._`undefined`);"array"===s.coerceTypes&&o.if(n._`${c} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>o.assign(i,n._`${i}[0]`).assign(c,n._`typeof ${i}`).if(l(t,i,s.strictNumbers),()=>o.assign(d,i)));o.if(n._`${d} !== undefined`);for(const e of r)(a.has(e)||"array"===e&&"array"===s.coerceTypes)&&p(e);function p(e){switch(e){case"string":return void o.elseIf(n._`${c} == "number" || ${c} == "boolean"`).assign(d,n._`"" + ${i}`).elseIf(n._`${i} === null`).assign(d,n._`""`);case"number":return void o.elseIf(n._`${c} == "boolean" || ${i} === null
2
+ || (${c} == "string" && ${i} && ${i} == +${i})`).assign(d,n._`+${i}`);case"integer":return void o.elseIf(n._`${c} === "boolean" || ${i} === null
3
+ || (${c} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(d,n._`+${i}`);case"boolean":return void o.elseIf(n._`${i} === "false" || ${i} === 0 || ${i} === null`).assign(d,!1).elseIf(n._`${i} === "true" || ${i} === 1`).assign(d,!0);case"null":return o.elseIf(n._`${i} === "" || ${i} === 0 || ${i} === false`),void o.assign(d,null);case"array":o.elseIf(n._`${c} === "string" || ${c} === "number"
4
+ || ${c} === "boolean" || ${i} === null`).assign(d,n._`[${i}]`)}}o.else(),u(e),o.endIf(),o.if(n._`${d} !== undefined`,()=>{o.assign(i,d),function({gen:e,parentData:t,parentDataProperty:r},o){e.if(n._`${t} !== undefined`,()=>e.assign(n._`${t}[${r}]`,o))}(e,d)})}(e,r,d):u(e)})}return p};const a=new Set(["string","number","integer","boolean","null"]);function c(e,t,r,o=i.Correct){const s=o===i.Correct?n.operators.EQ:n.operators.NEQ;let a;switch(e){case"null":return n._`${t} ${s} null`;case"array":a=n._`Array.isArray(${t})`;break;case"object":a=n._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":a=c(n._`!(${t} % 1) && !isNaN(${t})`);break;case"number":a=c();break;default:return n._`typeof ${t} ${s} ${e}`}return o===i.Correct?a:(0,n.not)(a);function c(e=n.nil){return(0,n.and)(n._`typeof ${t} == "number"`,e,r?n._`isFinite(${t})`:n.nil)}}function l(e,t,r,i){if(1===e.length)return c(e[0],t,r,i);let s;const a=(0,o.toHash)(e);if(a.array&&a.object){const e=n._`typeof ${t} != "object"`;s=a.null?e:n._`!${t} || ${e}`,delete a.null,delete a.array,delete a.object}else s=n.nil;a.number&&delete a.integer;for(const e in a)s=(0,n.and)(s,c(e,t,r,i));return s}Cr.checkDataType=c,Cr.checkDataTypes=l;const d={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?n._`{type: ${e}}`:n._`{type: ${t}}`};function u(e){const t=function(e){const{gen:t,data:r,schema:n}=e,i=(0,o.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}(e);(0,r.reportError)(t,d)}return Cr.reportTypeError=u,Cr}var Dr,jr={};var Rr,Fr,Mr={},Gr={};function Ur(){if(Rr)return Gr;Rr=1,Object.defineProperty(Gr,"__esModule",{value:!0}),Gr.validateUnion=Gr.validateArray=Gr.usePattern=Gr.callValidateCode=Gr.schemaProperties=Gr.allSchemaProperties=Gr.noPropertyInData=Gr.propertyInData=Gr.isOwnProperty=Gr.hasPropFunc=Gr.reportMissingProp=Gr.checkMissingProp=Gr.checkReportMissingProp=void 0;const e=gr(),t=br(),r=Pr(),n=br();function o(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:e._`Object.prototype.hasOwnProperty`})}function i(t,r,n){return e._`${o(t)}.call(${r}, ${n})`}function s(t,r,n,o){const s=e._`${r}${(0,e.getProperty)(n)} === undefined`;return o?(0,e.or)(s,(0,e.not)(i(t,r,n))):s}function a(e){return e?Object.keys(e).filter(e=>"__proto__"!==e):[]}Gr.checkReportMissingProp=function(t,r){const{gen:n,data:o,it:i}=t;n.if(s(n,o,r,i.opts.ownProperties),()=>{t.setParams({missingProperty:e._`${r}`},!0),t.error()})},Gr.checkMissingProp=function({gen:t,data:r,it:{opts:n}},o,i){return(0,e.or)(...o.map(o=>(0,e.and)(s(t,r,o,n.ownProperties),e._`${i} = ${o}`)))},Gr.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},Gr.hasPropFunc=o,Gr.isOwnProperty=i,Gr.propertyInData=function(t,r,n,o){const s=e._`${r}${(0,e.getProperty)(n)} !== undefined`;return o?e._`${s} && ${i(t,r,n)}`:s},Gr.noPropertyInData=s,Gr.allSchemaProperties=a,Gr.schemaProperties=function(e,r){return a(r).filter(n=>!(0,t.alwaysValidSchema)(e,r[n]))},Gr.callValidateCode=function({schemaCode:t,data:n,it:{gen:o,topSchemaRef:i,schemaPath:s,errorPath:a},it:c},l,d,u){const p=u?e._`${t}, ${n}, ${i}${s}`:n,f=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,a)],[r.default.parentData,c.parentData],[r.default.parentDataProperty,c.parentDataProperty],[r.default.rootData,r.default.rootData]];c.opts.dynamicRef&&f.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const h=e._`${p}, ${o.object(...f)}`;return d!==e.nil?e._`${l}.call(${d}, ${h})`:e._`${l}(${h})`};const c=e._`new RegExp`;return Gr.usePattern=function({gen:t,it:{opts:r}},o){const i=r.unicodeRegExp?"u":"",{regExp:s}=r.code,a=s(o,i);return t.scopeValue("pattern",{key:a.toString(),ref:a,code:e._`${"new RegExp"===s.code?c:(0,n.useFunc)(t,s)}(${o}, ${i})`})},Gr.validateArray=function(r){const{gen:n,data:o,keyword:i,it:s}=r,a=n.name("valid");if(s.allErrors){const e=n.let("valid",!0);return c(()=>n.assign(e,!1)),e}return n.var(a,!0),c(()=>n.break()),a;function c(s){const c=n.const("len",e._`${o}.length`);n.forRange("i",0,c,o=>{r.subschema({keyword:i,dataProp:o,dataPropType:t.Type.Num},a),n.if((0,e.not)(a),s)})}},Gr.validateUnion=function(r){const{gen:n,schema:o,keyword:i,it:s}=r;if(!Array.isArray(o))throw new Error("ajv implementation error");if(o.some(e=>(0,t.alwaysValidSchema)(s,e))&&!s.opts.unevaluated)return;const a=n.let("valid",!1),c=n.name("_valid");n.block(()=>o.forEach((t,o)=>{const s=r.subschema({keyword:i,schemaProp:o,compositeRule:!0},c);n.assign(a,e._`${a} || ${c}`);r.mergeValidEvaluated(s,c)||n.if((0,e.not)(a))})),r.result(a,()=>r.reset(),()=>r.error(!0))},Gr}function Br(){if(Fr)return Mr;Fr=1,Object.defineProperty(Mr,"__esModule",{value:!0}),Mr.validateKeywordUsage=Mr.validSchemaType=Mr.funcKeywordCode=Mr.macroKeywordCode=void 0;const e=gr(),t=Pr(),r=Ur(),n=_r();function o(t){const{gen:r,data:n,it:o}=t;r.if(o.parentData,()=>r.assign(n,e._`${o.parentData}[${o.parentDataProperty}]`))}function i(t,r,n){if(void 0===n)throw new Error(`keyword "${r}" failed to compile`);return t.scopeValue("keyword","function"==typeof n?{ref:n}:{ref:n,code:(0,e.stringify)(n)})}return Mr.macroKeywordCode=function(t,r){const{gen:n,keyword:o,schema:s,parentSchema:a,it:c}=t,l=r.macro.call(c.self,s,a,c),d=i(n,o,l);!1!==c.opts.validateSchema&&c.self.validateSchema(l,!0);const u=n.name("valid");t.subschema({schema:l,schemaPath:e.nil,errSchemaPath:`${c.errSchemaPath}/${o}`,topSchemaRef:d,compositeRule:!0},u),t.pass(u,()=>t.error(!0))},Mr.funcKeywordCode=function(s,a){var c;const{gen:l,keyword:d,schema:u,parentSchema:p,$data:f,it:h}=s;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(h,a);const m=!f&&a.compile?a.compile.call(h.self,u,p,h):a.validate,g=i(l,d,m),y=l.let("valid");function v(n=(a.async?e._`await `:e.nil)){const o=h.opts.passContext?t.default.this:t.default.self,i=!("compile"in a&&!f||!1===a.schema);l.assign(y,e._`${n}${(0,r.callValidateCode)(s,g,o,i)}`,a.modifying)}function b(t){var r;l.if((0,e.not)(null!==(r=a.valid)&&void 0!==r?r:y),t)}s.block$data(y,function(){if(!1===a.errors)v(),a.modifying&&o(s),b(()=>s.error());else{const r=a.async?function(){const t=l.let("ruleErrs",null);return l.try(()=>v(e._`await `),r=>l.assign(y,!1).if(e._`${r} instanceof ${h.ValidationError}`,()=>l.assign(t,e._`${r}.errors`),()=>l.throw(r))),t}():function(){const t=e._`${g}.errors`;return l.assign(t,null),v(e.nil),t}();a.modifying&&o(s),b(()=>function(r,o){const{gen:i}=r;i.if(e._`Array.isArray(${o})`,()=>{i.assign(t.default.vErrors,e._`${t.default.vErrors} === null ? ${o} : ${t.default.vErrors}.concat(${o})`).assign(t.default.errors,e._`${t.default.vErrors}.length`),(0,n.extendErrors)(r)},()=>r.error())}(s,r))}}),s.ok(null!==(c=a.valid)&&void 0!==c?c:y)},Mr.validSchemaType=function(e,t,r=!1){return!t.length||t.some(t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e)},Mr.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:n},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");const s=o.dependencies;if(null==s?void 0:s.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw new Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(o.validateSchema){if(!o.validateSchema(e[i])){const e=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}},Mr}var zr,Vr={};var Hr,qr,Kr={};function Wr(){return qr||(qr=1,Hr=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(o=n;0!==o--;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(i=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(o=n;0!==o--;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;0!==o--;){var s=i[o];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}),Hr}var Yr,Jr,Xr,Zr={exports:{}};function Qr(){if(Yr)return Zr.exports;Yr=1;var e=Zr.exports=function(e,r,n){"function"==typeof r&&(n=r,r={}),t(r,"function"==typeof(n=r.cb||n)?n:n.pre||function(){},n.post||function(){},e,"",e)};function t(n,o,i,s,a,c,l,d,u,p){if(s&&"object"==typeof s&&!Array.isArray(s)){for(var f in o(s,a,c,l,d,u,p),s){var h=s[f];if(Array.isArray(h)){if(f in e.arrayKeywords)for(var m=0;m<h.length;m++)t(n,o,i,h[m],a+"/"+f+"/"+m,c,a,f,s,m)}else if(f in e.propsKeywords){if(h&&"object"==typeof h)for(var g in h)t(n,o,i,h[g],a+"/"+f+"/"+r(g),c,a,f,s,g)}else(f in e.keywords||n.allKeys&&!(f in e.skipKeywords))&&t(n,o,i,h,a+"/"+f,c,a,f,s)}i(s,a,c,l,d,u,p)}}function r(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}return e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0},Zr.exports}function en(){if(Jr)return Kr;Jr=1,Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.getSchemaRefs=Kr.resolveUrl=Kr.normalizeId=Kr._getFullPath=Kr.getFullPath=Kr.inlineRef=void 0;const e=br(),t=Wr(),r=Qr(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);Kr.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!i(e):!!t&&s(e)<=t)};const o=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function i(e){for(const t in e){if(o.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(i))return!0;if("object"==typeof r&&i(r))return!0}return!1}function s(t){let r=0;for(const o in t){if("$ref"===o)return 1/0;if(r++,!n.has(o)&&("object"==typeof t[o]&&(0,e.eachItem)(t[o],e=>r+=s(e)),r===1/0))return 1/0}return r}function a(e,t="",r){!1!==r&&(t=d(t));const n=e.parse(t);return c(e,n)}function c(e,t){return e.serialize(t).split("#")[0]+"#"}Kr.getFullPath=a,Kr._getFullPath=c;const l=/#\/?$/;function d(e){return e?e.replace(l,""):""}Kr.normalizeId=d,Kr.resolveUrl=function(e,t,r){return r=d(r),e.resolve(t,r)};const u=/^[a-z_][-a-z0-9._]*$/i;return Kr.getSchemaRefs=function(e,n){if("boolean"==typeof e)return{};const{schemaId:o,uriResolver:i}=this.opts,s=d(e[o]||n),c={"":s},l=a(i,s,!1),p={},f=new Set;return r(e,{allKeys:!0},(e,t,r,n)=>{if(void 0===n)return;const i=l+t;let s=c[n];function a(t){const r=this.opts.uriResolver.resolve;if(t=d(s?r(s,t):t),f.has(t))throw m(t);f.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?h(e,n.schema,t):t!==d(i)&&("#"===t[0]?(h(e,p[t],t),p[t]=e):this.refs[t]=i),t}function g(e){if("string"==typeof e){if(!u.test(e))throw new Error(`invalid anchor "${e}"`);a.call(this,`#${e}`)}}"string"==typeof e[o]&&(s=a.call(this,e[o])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),c[t]=s}),p;function h(e,r,n){if(void 0!==r&&!t(e,r))throw m(n)}function m(e){return new Error(`reference "${e}" resolves to more than one schema`)}},Kr}function tn(){if(Xr)return sr;Xr=1,Object.defineProperty(sr,"__esModule",{value:!0}),sr.getData=sr.KeywordCxt=sr.validateFunctionCode=void 0;const e=function(){if(Er)return ar;Er=1,Object.defineProperty(ar,"__esModule",{value:!0}),ar.boolOrEmptySchema=ar.topBoolOrEmptySchema=void 0;const e=_r(),t=gr(),r=Pr(),n={message:"boolean schema is false"};function o(t,r){const{gen:o,data:i}=t,s={gen:o,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,e.reportError)(s,n,void 0,r)}return ar.topBoolOrEmptySchema=function(e){const{gen:n,schema:i,validateName:s}=e;!1===i?o(e,!1):"object"==typeof i&&!0===i.$async?n.return(r.default.data):(n.assign(t._`${s}.errors`,null),n.return(!0))},ar.boolOrEmptySchema=function(e,t){const{gen:r,schema:n}=e;!1===n?(r.var(t,!1),o(e)):r.var(t,!0)},ar}(),t=xr(),r=Tr(),n=xr(),o=function(){if(Dr)return jr;Dr=1,Object.defineProperty(jr,"__esModule",{value:!0}),jr.assignDefaults=void 0;const e=gr(),t=br();function r(r,n,o){const{gen:i,compositeRule:s,data:a,opts:c}=r;if(void 0===o)return;const l=e._`${a}${(0,e.getProperty)(n)}`;if(s)return void(0,t.checkStrictMode)(r,`default is ignored for: ${l}`);let d=e._`${l} === undefined`;"empty"===c.useDefaults&&(d=e._`${d} || ${l} === null || ${l} === ""`),i.if(d,e._`${l} = ${(0,e.stringify)(o)}`)}return jr.assignDefaults=function(e,t){const{properties:n,items:o}=e.schema;if("object"===t&&n)for(const t in n)r(e,t,n[t].default);else"array"===t&&Array.isArray(o)&&o.forEach((t,n)=>r(e,n,t.default))},jr}(),i=Br(),s=function(){if(zr)return Vr;zr=1,Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.extendSubschemaMode=Vr.extendSubschemaData=Vr.getSubschema=void 0;const e=gr(),t=br();return Vr.getSubschema=function(r,{keyword:n,schemaProp:o,schema:i,schemaPath:s,errSchemaPath:a,topSchemaRef:c}){if(void 0!==n&&void 0!==i)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==n){const i=r.schema[n];return void 0===o?{schema:i,schemaPath:e._`${r.schemaPath}${(0,e.getProperty)(n)}`,errSchemaPath:`${r.errSchemaPath}/${n}`}:{schema:i[o],schemaPath:e._`${r.schemaPath}${(0,e.getProperty)(n)}${(0,e.getProperty)(o)}`,errSchemaPath:`${r.errSchemaPath}/${n}/${(0,t.escapeFragment)(o)}`}}if(void 0!==i){if(void 0===s||void 0===a||void 0===c)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:s,topSchemaRef:c,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},Vr.extendSubschemaData=function(r,n,{dataProp:o,dataPropType:i,data:s,dataTypes:a,propertyName:c}){if(void 0!==s&&void 0!==o)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:l}=n;if(void 0!==o){const{errorPath:s,dataPathArr:a,opts:c}=n;d(l.let("data",e._`${n.data}${(0,e.getProperty)(o)}`,!0)),r.errorPath=e.str`${s}${(0,t.getErrorPath)(o,i,c.jsPropertySyntax)}`,r.parentDataProperty=e._`${o}`,r.dataPathArr=[...a,r.parentDataProperty]}function d(e){r.data=e,r.dataLevel=n.dataLevel+1,r.dataTypes=[],n.definedProperties=new Set,r.parentData=n.data,r.dataNames=[...n.dataNames,e]}void 0!==s&&(d(s instanceof e.Name?s:l.let("data",s,!0)),void 0!==c&&(r.propertyName=c)),a&&(r.dataTypes=a)},Vr.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:i}){void 0!==n&&(e.compositeRule=n),void 0!==o&&(e.createErrors=o),void 0!==i&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r},Vr}(),a=gr(),c=Pr(),l=en(),d=br(),u=_r();function p({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){o.code.es5?e.func(t,a._`${c.default.data}, ${c.default.valCxt}`,n.$async,()=>{e.code(a._`"use strict"; ${f(r,o)}`),function(e,t){e.if(c.default.valCxt,()=>{e.var(c.default.instancePath,a._`${c.default.valCxt}.${c.default.instancePath}`),e.var(c.default.parentData,a._`${c.default.valCxt}.${c.default.parentData}`),e.var(c.default.parentDataProperty,a._`${c.default.valCxt}.${c.default.parentDataProperty}`),e.var(c.default.rootData,a._`${c.default.valCxt}.${c.default.rootData}`),t.dynamicRef&&e.var(c.default.dynamicAnchors,a._`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{e.var(c.default.instancePath,a._`""`),e.var(c.default.parentData,a._`undefined`),e.var(c.default.parentDataProperty,a._`undefined`),e.var(c.default.rootData,c.default.data),t.dynamicRef&&e.var(c.default.dynamicAnchors,a._`{}`)})}(e,o),e.code(i)}):e.func(t,a._`${c.default.data}, ${function(e){return a._`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${e.dynamicRef?a._`, ${c.default.dynamicAnchors}={}`:a.nil}}={}`}(o)}`,n.$async,()=>e.code(f(r,o)).code(i))}function f(e,t){const r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?a._`/*# sourceURL=${r} */`:a.nil}function h(t,r){g(t)&&(y(t),m(t))?function(e,t){const{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&b(e);(function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,l.resolveUrl)(e.opts.uriResolver,e.baseId,t))})(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const i=n.const("_errs",c.default.errors);v(e,i),n.var(t,a._`${i} === ${c.default.errors}`)}(t,r):(0,e.boolOrEmptySchema)(t,r)}function m({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function g(e){return"boolean"!=typeof e.schema}function y(e){(0,d.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function v(e,r){if(e.opts.jtd)return $(e,[],!1,r);const n=(0,t.getSchemaTypes)(e.schema);$(e,n,!(0,t.coerceAndCheckDataType)(e,n),r)}function b({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){const i=r.$comment;if(!0===o.$comment)e.code(a._`${c.default.self}.logger.log(${i})`);else if("function"==typeof o.$comment){const r=a.str`${n}/$comment`,o=e.scopeValue("root",{ref:t.root});e.code(a._`${c.default.self}.opts.$comment(${i}, ${r}, ${o}.schema)`)}}function $(e,t,o,i){const{gen:s,schema:l,data:u,allErrors:p,opts:f,self:h}=e,{RULES:m}=h;function g(d){(0,r.shouldUseGroup)(l,d)&&(d.type?(s.if((0,n.checkDataType)(d.type,u,f.strictNumbers)),w(e,d),1===t.length&&t[0]===d.type&&o&&(s.else(),(0,n.reportTypeError)(e)),s.endIf()):w(e,d),p||s.if(a._`${c.default.errors} === ${i||0}`))}!l.$ref||!f.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(l,m)?(f.jtd||function(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;(function(e,t){if(!t.length)return;if(!e.dataTypes.length)return void(e.dataTypes=t);t.forEach(t=>{S(e.dataTypes,t)||P(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)}),function(e,t){const r=[];for(const n of e.dataTypes)S(t,n)?r.push(n):t.includes("integer")&&"number"===n&&r.push("integer");e.dataTypes=r}(e,t)})(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&P(e,"use allowUnionTypes to allow union type keyword")}(e,t);!function(e,t){const n=e.self.RULES.all;for(const o in n){const i=n[o];if("object"==typeof i&&(0,r.shouldUseRule)(e.schema,i)){const{type:r}=i.definition;r.length&&!r.some(e=>E(t,e))&&P(e,`missing type "${r.join(",")}" for keyword "${o}"`)}}}(e,e.dataTypes)}(e,t),s.block(()=>{for(const e of m.rules)g(e);g(m.post)})):s.block(()=>L(e,"$ref",m.all.$ref.definition))}function w(e,t){const{gen:n,schema:i,opts:{useDefaults:s}}=e;s&&(0,o.assignDefaults)(e,t.type),n.block(()=>{for(const n of t.rules)(0,r.shouldUseRule)(i,n)&&L(e,n.keyword,n.definition,t.type)})}function E(e,t){return e.includes(t)||"number"===t&&e.includes("integer")}function S(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function P(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,d.checkStrictMode)(e,t,e.opts.strictTypes)}sr.validateFunctionCode=function(t){g(t)&&(y(t),m(t))?function(e){const{schema:t,opts:r,gen:n}=e;p(e,()=>{r.$comment&&t.$comment&&b(e),function(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,d.checkStrictMode)(e,"default is ignored in the schema root")}(e),n.let(c.default.vErrors,null),n.let(c.default.errors,0),r.unevaluated&&function(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",a._`${r}.evaluated`),t.if(a._`${e.evaluated}.dynamicProps`,()=>t.assign(a._`${e.evaluated}.props`,a._`undefined`)),t.if(a._`${e.evaluated}.dynamicItems`,()=>t.assign(a._`${e.evaluated}.items`,a._`undefined`))}(e),v(e),function(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;r.$async?t.if(a._`${c.default.errors} === 0`,()=>t.return(c.default.data),()=>t.throw(a._`new ${o}(${c.default.vErrors})`)):(t.assign(a._`${n}.errors`,c.default.vErrors),i.unevaluated&&function({gen:e,evaluated:t,props:r,items:n}){r instanceof a.Name&&e.assign(a._`${t}.props`,r);n instanceof a.Name&&e.assign(a._`${t}.items`,n)}(e),t.return(a._`${c.default.errors} === 0`))}(e)})}(t):p(t,()=>(0,e.topBoolOrEmptySchema)(t))};class _{constructor(e,t,r){if((0,i.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",I(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",c.default.errors))}result(e,t,r){this.failResult((0,a.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,a.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(a._`${t} !== undefined && (${(0,a.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t)return this.setParams(t),this._error(e,r),void this.setParams({});this._error(e,r)}_error(e,t){(e?u.reportExtraError:u.reportError)(this,this.def.error,t)}$dataError(){(0,u.reportError)(this,this.def.$dataError||u.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,u.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=a.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=a.nil,t=a.nil){if(!this.$data)return;const{gen:r,schemaCode:n,schemaType:o,def:i}=this;r.if((0,a.or)(a._`${n} === undefined`,t)),e!==a.nil&&r.assign(e,!0),(o.length||i.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==a.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:o,it:i}=this;return(0,a.or)(function(){if(r.length){if(!(t instanceof a.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return a._`${(0,n.checkDataTypes)(e,t,i.opts.strictNumbers,n.DataType.Wrong)}`}return a.nil}(),function(){if(o.validateSchema){const r=e.scopeValue("validate$data",{ref:o.validateSchema});return a._`!${r}(${t})`}return a.nil}())}subschema(e,t){const r=(0,s.getSubschema)(this.it,e);(0,s.extendSubschemaData)(r,this.it,e),(0,s.extendSubschemaMode)(r,e);const n={...this.it,...r,items:void 0,props:void 0};return h(n,t),n}mergeEvaluated(e,t){const{it:r,gen:n}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=d.mergeEvaluated.props(n,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=d.mergeEvaluated.items(n,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:n}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return n.if(t,()=>this.mergeEvaluated(e,a.Name)),!0}}function L(e,t,r,n){const o=new _(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,i.funcKeywordCode)(o,r):"macro"in r?(0,i.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,i.funcKeywordCode)(o,r)}sr.KeywordCxt=_;const C=/^\/(?:[^~]|~0|~1)*$/,N=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function I(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(""===e)return c.default.rootData;if("/"===e[0]){if(!C.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,i=c.default.rootData}else{const s=N.exec(e);if(!s)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+s[1];if(o=s[2],"#"===o){if(a>=t)throw new Error(u("property/index",a));return n[t-a]}if(a>t)throw new Error(u("data",a));if(i=r[t-a],!o)return i}let s=i;const l=o.split("/");for(const e of l)e&&(i=a._`${i}${(0,a.getProperty)((0,d.unescapeJsonPointer)(e))}`,s=a._`${s} && ${i}`);return s;function u(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}return sr.getData=I,sr}var rn,nn={};function on(){if(rn)return nn;rn=1,Object.defineProperty(nn,"__esModule",{value:!0});class e extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}return nn.default=e,nn}var sn,an={};function cn(){if(sn)return an;sn=1,Object.defineProperty(an,"__esModule",{value:!0});const e=en();class t extends Error{constructor(t,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,e.resolveUrl)(t,r,n),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(t,this.missingRef))}}return an.default=t,an}var ln,dn={};function un(){if(ln)return dn;ln=1,Object.defineProperty(dn,"__esModule",{value:!0}),dn.resolveSchema=dn.getCompilingSchema=dn.resolveRef=dn.compileSchema=dn.SchemaEnv=void 0;const e=gr(),t=on(),r=Pr(),n=en(),o=br(),i=tn();class s{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,n.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function a(o){const s=l.call(this,o);if(s)return s;const a=(0,n.getFullPath)(this.opts.uriResolver,o.root.baseId),{es5:c,lines:d}=this.opts.code,{ownProperties:u}=this.opts,p=new e.CodeGen(this.scope,{es5:c,lines:d,ownProperties:u});let f;o.$async&&(f=p.scopeValue("Error",{ref:t.default,code:e._`require("ajv/dist/runtime/validation_error").default`}));const h=p.scopeName("validate");o.validateName=h;const m={gen:p,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:p.scopeValue("schema",!0===this.opts.code.source?{ref:o.schema,code:(0,e.stringify)(o.schema)}:{ref:o.schema}),validateName:h,ValidationError:f,schema:o.schema,schemaEnv:o,rootId:a,baseId:o.baseId||a,schemaPath:e.nil,errSchemaPath:o.schemaPath||(this.opts.jtd?"":"#"),errorPath:e._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(o),(0,i.validateFunctionCode)(m),p.optimize(this.opts.code.optimize);const t=p.toString();g=`${p.scopeRefs(r.default.scope)}return ${t}`,this.opts.code.process&&(g=this.opts.code.process(g,o));const n=new Function(`${r.default.self}`,`${r.default.scope}`,g)(this,this.scope.get());if(this.scope.value(h,{ref:n}),n.errors=null,n.schema=o.schema,n.schemaEnv=o,o.$async&&(n.$async=!0),!0===this.opts.code.source&&(n.source={validateName:h,validateCode:t,scopeValues:p._values}),this.opts.unevaluated){const{props:t,items:r}=m;n.evaluated={props:t instanceof e.Name?void 0:t,items:r instanceof e.Name?void 0:r,dynamicProps:t instanceof e.Name,dynamicItems:r instanceof e.Name},n.source&&(n.source.evaluated=(0,e.stringify)(n.evaluated))}return o.validate=n,o}catch(e){throw delete o.validate,delete o.validateName,g&&this.logger.error("Error compiling schema, function code:",g),e}finally{this._compilations.delete(o)}}function c(e){return(0,n.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:a.call(this,e)}function l(e){for(const t of this._compilations)if(d(t,e))return t}function d(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function u(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||p.call(this,e,t)}function p(e,t){const r=this.opts.uriResolver.parse(t),o=(0,n._getFullPath)(this.opts.uriResolver,r);let i=(0,n.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&o===i)return h.call(this,r,e);const c=(0,n.normalizeId)(o),l=this.refs[c]||this.schemas[c];if("string"==typeof l){const t=p.call(this,e,l);if("object"!=typeof(null==t?void 0:t.schema))return;return h.call(this,r,t)}if("object"==typeof(null==l?void 0:l.schema)){if(l.validate||a.call(this,l),c===(0,n.normalizeId)(t)){const{schema:t}=l,{schemaId:r}=this.opts,o=t[r];return o&&(i=(0,n.resolveUrl)(this.opts.uriResolver,i,o)),new s({schema:t,schemaId:r,root:e,baseId:i})}return h.call(this,r,l)}}dn.SchemaEnv=s,dn.compileSchema=a,dn.resolveRef=function(e,t,r){var o;r=(0,n.resolveUrl)(this.opts.uriResolver,t,r);const i=e.refs[r];if(i)return i;let a=u.call(this,e,r);if(void 0===a){const n=null===(o=e.localRefs)||void 0===o?void 0:o[r],{schemaId:i}=this.opts;n&&(a=new s({schema:n,schemaId:i,root:e,baseId:t}))}return void 0!==a?e.refs[r]=c.call(this,a):void 0},dn.getCompilingSchema=l,dn.resolveSchema=p;const f=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function h(e,{baseId:t,schema:r,root:i}){var a;if("/"!==(null===(a=e.fragment)||void 0===a?void 0:a[0]))return;for(const i of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;const e=r[(0,o.unescapeFragment)(i)];if(void 0===e)return;const s="object"==typeof(r=e)&&r[this.opts.schemaId];!f.has(i)&&s&&(t=(0,n.resolveUrl)(this.opts.uriResolver,t,s))}let c;if("boolean"!=typeof r&&r.$ref&&!(0,o.schemaHasRulesButRef)(r,this.RULES)){const e=(0,n.resolveUrl)(this.opts.uriResolver,t,r.$ref);c=p.call(this,i,e)}const{schemaId:l}=this.opts;return c=c||new s({schema:r,schemaId:l,root:i,baseId:t}),c.schema!==c.root.schema?c:void 0}return dn}var pn,fn,hn,mn,gn,yn,vn,bn,$n,wn={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1},En={},Sn={exports:{}};function Pn(){if(mn)return hn;mn=1;const{HEX:e}=fn?pn:(fn=1,pn={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}}),t=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function r(e){if(s(e,".")<3)return{host:e,isIPV4:!1};const r=e.match(t)||[],[n]=r;return n?{host:i(n,"."),isIPV4:!0}:{host:e,isIPV4:!1}}function n(t,r=!1){let n="",o=!0;for(const r of t){if(void 0===e[r])return;"0"!==r&&!0===o&&(o=!1),o||(n+=r)}return r&&0===n.length&&(n="0"),n}function o(e){if(s(e,":")<2)return{host:e,isIPV6:!1};const t=function(e){let t=0;const r={error:!1,address:"",zone:""},o=[],i=[];let s=!1,a=!1,c=!1;function l(){if(i.length){if(!1===s){const e=n(i);if(void 0===e)return r.error=!0,!1;o.push(e)}i.length=0}return!0}for(let n=0;n<e.length;n++){const d=e[n];if("["!==d&&"]"!==d)if(":"!==d)if("%"===d){if(!l())break;s=!0}else i.push(d);else{if(!0===a&&(c=!0),!l())break;if(t++,o.push(":"),t>7){r.error=!0;break}n-1>=0&&":"===e[n-1]&&(a=!0)}}return i.length&&(s?r.zone=i.join(""):c?o.push(i.join("")):o.push(n(i))),r.address=o.join(""),r}(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,r=t.address;return t.zone&&(e+="%"+t.zone,r+="%25"+t.zone),{host:e,escapedHost:r,isIPV6:!0}}}function i(e,t){let r="",n=!0;const o=e.length;for(let i=0;i<o;i++){const s=e[i];"0"===s&&n?(i+1<=o&&e[i+1]===t||i+1===o)&&(r+=s,n=!1):(n=s===t,r+=s)}return r}function s(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}const a=/^\.\.?\//u,c=/^\/\.(?:\/|$)/u,l=/^\/\.\.(?:\/|$)/u,d=/^\/?(?:.|\n)*?(?=\/|$)/u;return hn={recomposeAuthority:function(e){const t=[];if(void 0!==e.userinfo&&(t.push(e.userinfo),t.push("@")),void 0!==e.host){let n=unescape(e.host);const i=r(n);if(i.isIPV4)n=i.host;else{const t=o(i.host);n=!0===t.isIPV6?`[${t.escapedHost}]`:e.host}t.push(n)}return"number"!=typeof e.port&&"string"!=typeof e.port||(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0},normalizeComponentEncoding:function(e,t){const r=!0!==t?escape:unescape;return void 0!==e.scheme&&(e.scheme=r(e.scheme)),void 0!==e.userinfo&&(e.userinfo=r(e.userinfo)),void 0!==e.host&&(e.host=r(e.host)),void 0!==e.path&&(e.path=r(e.path)),void 0!==e.query&&(e.query=r(e.query)),void 0!==e.fragment&&(e.fragment=r(e.fragment)),e},removeDotSegments:function(e){const t=[];for(;e.length;)if(e.match(a))e=e.replace(a,"");else if(e.match(c))e=e.replace(c,"/");else if(e.match(l))e=e.replace(l,"/"),t.pop();else if("."===e||".."===e)e="";else{const r=e.match(d);if(!r)throw new Error("Unexpected dot segment condition");{const n=r[0];e=e.slice(n.length),t.push(n)}}return t.join("")},normalizeIPv4:r,normalizeIPv6:o,stringArrayToHexStripped:n}}function _n(){if(vn)return Sn.exports;vn=1;const{normalizeIPv6:e,normalizeIPv4:t,removeDotSegments:r,recomposeAuthority:n,normalizeComponentEncoding:o}=Pn(),i=function(){if(yn)return gn;yn=1;const e=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function r(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}function n(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function o(e){const t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}const i={scheme:"http",domainHost:!0,parse:n,serialize:o},s={scheme:"ws",domainHost:!0,parse:function(e){return e.secure=r(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e},serialize:function(e){if(e.port!==(r(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[t,r]=e.resourceName.split("?");e.path=t&&"/"!==t?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}},a={http:i,https:{scheme:"https",domainHost:i.domainHost,parse:n,serialize:o},ws:s,wss:{scheme:"wss",domainHost:s.domainHost,parse:s.parse,serialize:s.serialize},urn:{scheme:"urn",parse:function(e,r){if(!e.path)return e.error="URN can not be parsed",e;const n=e.path.match(t);if(n){const t=r.scheme||e.scheme||"urn";e.nid=n[1].toLowerCase(),e.nss=n[2];const o=`${t}:${r.nid||e.nid}`,i=a[o];e.path=void 0,i&&(e=i.parse(e,r))}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,t){const r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),o=`${r}:${t.nid||n}`,i=a[o];i&&(e=i.serialize(e,t));const s=e,c=e.nss;return s.path=`${n||t.nid}:${c}`,t.skipEscape=!0,s},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(t,r){const n=t;return n.uuid=n.nss,n.nss=void 0,r.tolerant||n.uuid&&e.test(n.uuid)||(n.error=n.error||"UUID is not valid."),n},serialize:function(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t},skipNormalize:!0}};return gn=a}();function s(e,t,n,o){const i={};return o||(e=d(a(e,n),n),t=d(a(t,n),n)),!(n=n||{}).tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=r(t.path||""),i.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=r(t.path||""),i.query=t.query):(t.path?("/"===t.path.charAt(0)?i.path=r(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path:i.path="/"+t.path,i.path=r(i.path)),i.query=t.query):(i.path=e.path,void 0!==t.query?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function a(e,t){const o={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},s=Object.assign({},t),a=[],c=i[(s.scheme||o.scheme||"").toLowerCase()];c&&c.serialize&&c.serialize(o,s),void 0!==o.path&&(s.skipEscape?o.path=unescape(o.path):(o.path=escape(o.path),void 0!==o.scheme&&(o.path=o.path.split("%3A").join(":")))),"suffix"!==s.reference&&o.scheme&&a.push(o.scheme,":");const l=n(o);if(void 0!==l&&("suffix"!==s.reference&&a.push("//"),a.push(l),o.path&&"/"!==o.path.charAt(0)&&a.push("/")),void 0!==o.path){let e=o.path;s.absolutePath||c&&c.absolutePath||(e=r(e)),void 0===l&&(e=e.replace(/^\/\//u,"/%2F")),a.push(e)}return void 0!==o.query&&a.push("?",o.query),void 0!==o.fragment&&a.push("#",o.fragment),a.join("")}const c=Array.from({length:127},(e,t)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(t)));const l=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function d(r,n){const o=Object.assign({},n),s={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},a=-1!==r.indexOf("%");let d=!1;"suffix"===o.reference&&(r=(o.scheme?o.scheme+":":"")+"//"+r);const u=r.match(l);if(u){if(s.scheme=u[1],s.userinfo=u[3],s.host=u[4],s.port=parseInt(u[5],10),s.path=u[6]||"",s.query=u[7],s.fragment=u[8],isNaN(s.port)&&(s.port=u[5]),s.host){const r=t(s.host);if(!1===r.isIPV4){const t=e(r.host);s.host=t.host.toLowerCase(),d=t.isIPV6}else s.host=r.host,d=!0}void 0!==s.scheme||void 0!==s.userinfo||void 0!==s.host||void 0!==s.port||void 0!==s.query||s.path?void 0===s.scheme?s.reference="relative":void 0===s.fragment?s.reference="absolute":s.reference="uri":s.reference="same-document",o.reference&&"suffix"!==o.reference&&o.reference!==s.reference&&(s.error=s.error||"URI is not a "+o.reference+" reference.");const r=i[(o.scheme||s.scheme||"").toLowerCase()];if(!(o.unicodeSupport||r&&r.unicodeSupport)&&s.host&&(o.domainHost||r&&r.domainHost)&&!1===d&&function(e){let t=0;for(let r=0,n=e.length;r<n;++r)if(t=e.charCodeAt(r),t>126||c[t])return!0;return!1}(s.host))try{s.host=URL.domainToASCII(s.host.toLowerCase())}catch(e){s.error=s.error||"Host's domain name can not be converted to ASCII: "+e}(!r||r&&!r.skipNormalize)&&(a&&void 0!==s.scheme&&(s.scheme=unescape(s.scheme)),a&&void 0!==s.host&&(s.host=unescape(s.host)),s.path&&(s.path=escape(unescape(s.path))),s.fragment&&(s.fragment=encodeURI(decodeURIComponent(s.fragment)))),r&&r.parse&&r.parse(s,o)}else s.error=s.error||"URI can not be parsed.";return s}const u={SCHEMES:i,normalize:function(e,t){return"string"==typeof e?e=a(d(e,t),t):"object"==typeof e&&(e=d(a(e,t),t)),e},resolve:function(e,t,r){const n=Object.assign({scheme:"null"},r);return a(s(d(e,n),d(t,n),n,!0),{...n,skipEscape:!0})},resolveComponents:s,equal:function(e,t,r){return"string"==typeof e?(e=unescape(e),e=a(o(d(e,r),!0),{...r,skipEscape:!0})):"object"==typeof e&&(e=a(o(e,!0),{...r,skipEscape:!0})),"string"==typeof t?(t=unescape(t),t=a(o(d(t,r),!0),{...r,skipEscape:!0})):"object"==typeof t&&(t=a(o(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()},serialize:a,parse:d};return Sn.exports=u,Sn.exports.default=u,Sn.exports.fastUri=u,Sn.exports}function Ln(){return $n||($n=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=tn();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=gr();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=on(),o=cn(),i=Ir(),s=un(),a=gr(),c=en(),l=xr(),d=br(),u=wn,p=function(){if(bn)return En;bn=1,Object.defineProperty(En,"__esModule",{value:!0});const e=_n();return e.code='require("ajv/dist/runtime/uri").default',En.default=e,En}(),f=(e,t)=>new RegExp(e,t);f.code="new RegExp";const h=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},y={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function v(e){var t,r,n,o,i,s,a,c,l,d,u,h,m,g,y,v,b,$,w,E,S,P,_,L,C;const N=e.strict,I=null===(t=e.code)||void 0===t?void 0:t.optimize,O=!0===I||void 0===I?1:I||0,k=null!==(n=null===(r=e.code)||void 0===r?void 0:r.regExp)&&void 0!==n?n:f,A=null!==(o=e.uriResolver)&&void 0!==o?o:p.default;return{strictSchema:null===(s=null!==(i=e.strictSchema)&&void 0!==i?i:N)||void 0===s||s,strictNumbers:null===(c=null!==(a=e.strictNumbers)&&void 0!==a?a:N)||void 0===c||c,strictTypes:null!==(d=null!==(l=e.strictTypes)&&void 0!==l?l:N)&&void 0!==d?d:"log",strictTuples:null!==(h=null!==(u=e.strictTuples)&&void 0!==u?u:N)&&void 0!==h?h:"log",strictRequired:null!==(g=null!==(m=e.strictRequired)&&void 0!==m?m:N)&&void 0!==g&&g,code:e.code?{...e.code,optimize:O,regExp:k}:{optimize:O,regExp:k},loopRequired:null!==(y=e.loopRequired)&&void 0!==y?y:200,loopEnum:null!==(v=e.loopEnum)&&void 0!==v?v:200,meta:null===(b=e.meta)||void 0===b||b,messages:null===($=e.messages)||void 0===$||$,inlineRefs:null===(w=e.inlineRefs)||void 0===w||w,schemaId:null!==(E=e.schemaId)&&void 0!==E?E:"$id",addUsedSchema:null===(S=e.addUsedSchema)||void 0===S||S,validateSchema:null===(P=e.validateSchema)||void 0===P||P,validateFormats:null===(_=e.validateFormats)||void 0===_||_,unicodeRegExp:null===(L=e.unicodeRegExp)||void 0===L||L,int32range:null===(C=e.int32range)||void 0===C||C,uriResolver:A}}class b{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...v(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:m,es5:t,lines:r}),this.logger=function(e){if(!1===e)return L;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,i.getRules)(),$.call(this,g,e,"NOT SUPPORTED"),$.call(this,y,e,"DEPRECATED","warn"),this._metaOpts=_.call(this),e.formats&&S.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&P.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),E.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:r}=this.opts;let n=u;"id"===r&&(n={...u},n.id=n.$id,delete n.$id),t&&e&&this.addMetaSchema(n,n[r],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const n=r(t);return"$async"in r||(this.errors=r.errors),n}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(e,t){await i.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||s.call(this,r)}async function i(e){e&&!this.getSchema(e)&&await n.call(this,{$ref:e},!0)}async function s(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof o.default))throw t;return a.call(this,t),await c.call(this,t.missingSchema),s.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const r=await l.call(this,e);this.refs[e]||await i.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function l(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,n);return this}let o;if("object"==typeof e){const{schemaId:t}=this.opts;if(o=e[t],void 0!==o&&"string"!=typeof o)throw new Error(`schema ${t} must be string`)}return t=(0,c.normalizeId)(t||o),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const n=this.validate(r,e);if(!n&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return n}getSchema(e){let t;for(;"string"==typeof(t=w.call(this,e));)e=t;if(void 0===t){const{schemaId:r}=this.opts,n=new s.SchemaEnv({schema:{},schemaId:r});if(t=s.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=w.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,c.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(r=(t=e).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(N.call(this,r,t),!t)return(0,d.eachItem)(r,e=>I.call(this,e)),this;k.call(this,t);const n={...t,type:(0,l.getJSONTypes)(t.type),schemaType:(0,l.getJSONTypes)(t.schemaType)};return(0,d.eachItem)(r,0===n.type.length?e=>I.call(this,e,n):e=>n.type.forEach(t=>I.call(this,e,n,t))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex(t=>t.keyword===e);t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map(e=>`${r}${e.instancePath} ${e.message}`).reduce((e,r)=>e+t+r):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const n of t){const t=n.split("/").slice(1);let o=e;for(const e of t)o=o[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:n}=t.definition,i=o[e];n&&i&&(o[e]=T(i))}}return e}_removeAllSchemas(e,t){for(const r in e){const n=e[r];t&&!t.test(r)||("string"==typeof n?delete e[r]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[r]))}}_addSchema(e,t,r,n=this.opts.validateSchema,o=this.opts.addUsedSchema){let i;const{schemaId:a}=this.opts;if("object"==typeof e)i=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let l=this._cache.get(e);if(void 0!==l)return l;r=(0,c.normalizeId)(i||r);const d=c.getSchemaRefs.call(this,e,r);return l=new s.SchemaEnv({schema:e,schemaId:a,meta:t,baseId:r,localRefs:d}),this._cache.set(l.schema,l),o&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=l),n&&this.validateSchema(e,!0),l}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):s.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,e)}finally{this.opts=t}}}function $(e,t,r,n="error"){for(const o in e){const i=o;i in t&&this.logger[n](`${r}: option ${o}. ${e[i]}`)}}function w(e){return e=(0,c.normalizeId)(e),this.schemas[e]||this.refs[e]}function E(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function S(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function P(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function _(){const e={...this.opts};for(const t of h)delete e[t];return e}b.ValidationError=n.default,b.MissingRefError=o.default,e.default=b;const L={log(){},warn(){},error(){}};const C=/^[a-z_$][a-z0-9_$:-]*$/i;function N(e,t){const{RULES:r}=this;if((0,d.eachItem)(e,e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!C.test(e))throw new Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function I(e,t,r){var n;const o=null==t?void 0:t.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:i}=this;let s=o?i.post:i.rules.find(({type:e})=>e===r);if(s||(s={type:r,rules:[]},i.rules.push(s)),i.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,l.getJSONTypes)(t.type),schemaType:(0,l.getJSONTypes)(t.schemaType)}};t.before?O.call(this,s,a,t.before):s.rules.push(a),i.all[e]=a,null===(n=t.implements)||void 0===n||n.forEach(e=>this.addKeyword(e))}function O(e,t,r){const n=e.rules.findIndex(e=>e.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function k(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=T(t)),e.validateSchema=this.compile(t,!0))}const A={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function T(e){return{anyOf:[e,A]}}}(ir)),ir}var Cn,Nn={},In={},On={};var kn,An,Tn={};function xn(){if(kn)return Tn;kn=1,Object.defineProperty(Tn,"__esModule",{value:!0}),Tn.callRef=Tn.getValidate=void 0;const e=cn(),t=Ur(),r=gr(),n=Pr(),o=un(),i=br(),s={keyword:"$ref",schemaType:"string",code(t){const{gen:n,schema:i,it:s}=t,{baseId:l,schemaEnv:d,validateName:u,opts:p,self:f}=s,{root:h}=d;if(("#"===i||"#/"===i)&&l===h.baseId)return function(){if(d===h)return c(t,u,d,d.$async);const e=n.scopeValue("root",{ref:h});return c(t,r._`${e}.validate`,h,h.$async)}();const m=o.resolveRef.call(f,h,l,i);if(void 0===m)throw new e.default(s.opts.uriResolver,l,i);return m instanceof o.SchemaEnv?function(e){const r=a(t,e);c(t,r,e,e.$async)}(m):function(e){const o=n.scopeValue("schema",!0===p.code.source?{ref:e,code:(0,r.stringify)(e)}:{ref:e}),s=n.name("valid"),a=t.subschema({schema:e,dataTypes:[],schemaPath:r.nil,topSchemaRef:o,errSchemaPath:i},s);t.mergeEvaluated(a),t.ok(s)}(m)}};function a(e,t){const{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):r._`${n.scopeValue("wrapper",{ref:t})}.validate`}function c(e,o,s,a){const{gen:c,it:l}=e,{allErrors:d,schemaEnv:u,opts:p}=l,f=p.passContext?n.default.this:r.nil;function h(e){const t=r._`${e}.errors`;c.assign(n.default.vErrors,r._`${n.default.vErrors} === null ? ${t} : ${n.default.vErrors}.concat(${t})`),c.assign(n.default.errors,r._`${n.default.vErrors}.length`)}function m(e){var t;if(!l.opts.unevaluated)return;const n=null===(t=null==s?void 0:s.validate)||void 0===t?void 0:t.evaluated;if(!0!==l.props)if(n&&!n.dynamicProps)void 0!==n.props&&(l.props=i.mergeEvaluated.props(c,n.props,l.props));else{const t=c.var("props",r._`${e}.evaluated.props`);l.props=i.mergeEvaluated.props(c,t,l.props,r.Name)}if(!0!==l.items)if(n&&!n.dynamicItems)void 0!==n.items&&(l.items=i.mergeEvaluated.items(c,n.items,l.items));else{const t=c.var("items",r._`${e}.evaluated.items`);l.items=i.mergeEvaluated.items(c,t,l.items,r.Name)}}a?function(){if(!u.$async)throw new Error("async schema referenced by sync schema");const n=c.let("valid");c.try(()=>{c.code(r._`await ${(0,t.callValidateCode)(e,o,f)}`),m(o),d||c.assign(n,!0)},e=>{c.if(r._`!(${e} instanceof ${l.ValidationError})`,()=>c.throw(e)),h(e),d||c.assign(n,!1)}),e.ok(n)}():e.result((0,t.callValidateCode)(e,o,f),()=>m(o),()=>h(o))}return Tn.getValidate=a,Tn.callRef=c,Tn.default=s,Tn}function Dn(){if(An)return In;An=1,Object.defineProperty(In,"__esModule",{value:!0});const e=function(){if(Cn)return On;Cn=1,Object.defineProperty(On,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return On.default=e,On}(),t=xn(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return In.default=r,In}var jn,Rn={},Fn={};var Mn,Gn={};var Un,Bn,zn={},Vn={};function Hn(){if(Bn)return zn;Bn=1,Object.defineProperty(zn,"__esModule",{value:!0});const e=gr(),t=br(),r=function(){if(Un)return Vn;function e(e){const t=e.length;let r,n=0,o=0;for(;o<t;)n++,r=e.charCodeAt(o++),r>=55296&&r<=56319&&o<t&&(r=e.charCodeAt(o),56320==(64512&r)&&o++);return n}return Un=1,Object.defineProperty(Vn,"__esModule",{value:!0}),Vn.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Vn}(),n={message({keyword:t,schemaCode:r}){const n="maxLength"===t?"more":"fewer";return e.str`must NOT have ${n} than ${r} characters`},params:({schemaCode:t})=>e._`{limit: ${t}}`},o={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:n,code(n){const{keyword:o,data:i,schemaCode:s,it:a}=n,c="maxLength"===o?e.operators.GT:e.operators.LT,l=!1===a.opts.unicode?e._`${i}.length`:e._`${(0,t.useFunc)(n.gen,r.default)}(${i})`;n.fail$data(e._`${l} ${c} ${s}`)}};return zn.default=o,zn}var qn,Kn={};var Wn,Yn={};var Jn,Xn={};function Zn(){if(Jn)return Xn;Jn=1,Object.defineProperty(Xn,"__esModule",{value:!0});const e=Ur(),t=gr(),r=br(),n={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>t.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>t._`{missingProperty: ${e}}`},code(n){const{gen:o,schema:i,schemaCode:s,data:a,$data:c,it:l}=n,{opts:d}=l;if(!c&&0===i.length)return;const u=i.length>=d.loopRequired;if(l.allErrors?function(){if(u||c)n.block$data(t.nil,p);else for(const t of i)(0,e.checkReportMissingProp)(n,t)}():function(){const r=o.let("missing");if(u||c){const i=o.let("valid",!0);n.block$data(i,()=>function(r,i){n.setParams({missingProperty:r}),o.forOf(r,s,()=>{o.assign(i,(0,e.propertyInData)(o,a,r,d.ownProperties)),o.if((0,t.not)(i),()=>{n.error(),o.break()})},t.nil)}(r,i)),n.ok(i)}else o.if((0,e.checkMissingProp)(n,i,r)),(0,e.reportMissingProp)(n,r),o.else()}(),d.strictRequired){const e=n.parentSchema.properties,{definedProperties:t}=n.it;for(const n of i)if(void 0===(null==e?void 0:e[n])&&!t.has(n)){const e=`required property "${n}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,r.checkStrictMode)(l,e,l.opts.strictRequired)}}function p(){o.forOf("prop",s,t=>{n.setParams({missingProperty:t}),o.if((0,e.noPropertyInData)(o,a,t,d.ownProperties),()=>n.error())})}}};return Xn.default=n,Xn}var Qn,eo={};var to,ro,no={},oo={};function io(){if(to)return oo;to=1,Object.defineProperty(oo,"__esModule",{value:!0});const e=Wr();return e.code='require("ajv/dist/runtime/equal").default',oo.default=e,oo}function so(){if(ro)return no;ro=1,Object.defineProperty(no,"__esModule",{value:!0});const e=xr(),t=gr(),r=br(),n=io(),o={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:r}})=>t.str`must NOT have duplicate items (items ## ${r} and ${e} are identical)`,params:({params:{i:e,j:r}})=>t._`{i: ${e}, j: ${r}}`},code(o){const{gen:i,data:s,$data:a,schema:c,parentSchema:l,schemaCode:d,it:u}=o;if(!a&&!c)return;const p=i.let("valid"),f=l.items?(0,e.getSchemaTypes)(l.items):[];function h(r,n){const a=i.name("item"),c=(0,e.checkDataTypes)(f,a,u.opts.strictNumbers,e.DataType.Wrong),l=i.const("indices",t._`{}`);i.for(t._`;${r}--;`,()=>{i.let(a,t._`${s}[${r}]`),i.if(c,t._`continue`),f.length>1&&i.if(t._`typeof ${a} == "string"`,t._`${a} += "_"`),i.if(t._`typeof ${l}[${a}] == "number"`,()=>{i.assign(n,t._`${l}[${a}]`),o.error(),i.assign(p,!1).break()}).code(t._`${l}[${a}] = ${r}`)})}function m(e,a){const c=(0,r.useFunc)(i,n.default),l=i.name("outer");i.label(l).for(t._`;${e}--;`,()=>i.for(t._`${a} = ${e}; ${a}--;`,()=>i.if(t._`${c}(${s}[${e}], ${s}[${a}])`,()=>{o.error(),i.assign(p,!1).break(l)})))}o.block$data(p,function(){const e=i.let("i",t._`${s}.length`),r=i.let("j");o.setParams({i:e,j:r}),i.assign(p,!0),i.if(t._`${e} > 1`,()=>(f.length>0&&!f.some(e=>"object"===e||"array"===e)?h:m)(e,r))},t._`${d} === false`),o.ok(p)}};return no.default=o,no}var ao,co={};var lo,uo,po={};function fo(){if(lo)return po;lo=1,Object.defineProperty(po,"__esModule",{value:!0});const e=gr(),t=br(),r=io(),n={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:t})=>e._`{allowedValues: ${t}}`},code(n){const{gen:o,data:i,$data:s,schema:a,schemaCode:c,it:l}=n;if(!s&&0===a.length)throw new Error("enum must have non-empty array");const d=a.length>=l.opts.loopEnum;let u;const p=()=>null!=u?u:u=(0,t.useFunc)(o,r.default);let f;if(d||s)f=o.let("valid"),n.block$data(f,function(){o.assign(f,!1),o.forOf("v",c,t=>o.if(e._`${p()}(${i}, ${t})`,()=>o.assign(f,!0).break()))});else{if(!Array.isArray(a))throw new Error("ajv implementation error");const t=o.const("vSchema",c);f=(0,e.or)(...a.map((r,n)=>function(t,r){const n=a[r];return"object"==typeof n&&null!==n?e._`${p()}(${i}, ${t}[${r}])`:e._`${i} === ${n}`}(t,n)))}n.pass(f)}};return po.default=n,po}function ho(){if(uo)return Rn;uo=1,Object.defineProperty(Rn,"__esModule",{value:!0});const e=function(){if(jn)return Fn;jn=1,Object.defineProperty(Fn,"__esModule",{value:!0});const e=gr(),t=e.operators,r={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},n={message:({keyword:t,schemaCode:n})=>e.str`must be ${r[t].okStr} ${n}`,params:({keyword:t,schemaCode:n})=>e._`{comparison: ${r[t].okStr}, limit: ${n}}`},o={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(t){const{keyword:n,data:o,schemaCode:i}=t;t.fail$data(e._`${o} ${r[n].fail} ${i} || isNaN(${o})`)}};return Fn.default=o,Fn}(),t=function(){if(Mn)return Gn;Mn=1,Object.defineProperty(Gn,"__esModule",{value:!0});const e=gr(),t={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:t})=>e.str`must be multiple of ${t}`,params:({schemaCode:t})=>e._`{multipleOf: ${t}}`},code(t){const{gen:r,data:n,schemaCode:o,it:i}=t,s=i.opts.multipleOfPrecision,a=r.let("res"),c=s?e._`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:e._`${a} !== parseInt(${a})`;t.fail$data(e._`(${o} === 0 || (${a} = ${n}/${o}, ${c}))`)}};return Gn.default=t,Gn}(),r=Hn(),n=function(){if(qn)return Kn;qn=1,Object.defineProperty(Kn,"__esModule",{value:!0});const e=Ur(),t=gr(),r={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>t.str`must match pattern "${e}"`,params:({schemaCode:e})=>t._`{pattern: ${e}}`},code(r){const{data:n,$data:o,schema:i,schemaCode:s,it:a}=r,c=a.opts.unicodeRegExp?"u":"",l=o?t._`(new RegExp(${s}, ${c}))`:(0,e.usePattern)(r,i);r.fail$data(t._`!${l}.test(${n})`)}};return Kn.default=r,Kn}(),o=function(){if(Wn)return Yn;Wn=1,Object.defineProperty(Yn,"__esModule",{value:!0});const e=gr(),t={message({keyword:t,schemaCode:r}){const n="maxProperties"===t?"more":"fewer";return e.str`must NOT have ${n} than ${r} properties`},params:({schemaCode:t})=>e._`{limit: ${t}}`},r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:t,code(t){const{keyword:r,data:n,schemaCode:o}=t,i="maxProperties"===r?e.operators.GT:e.operators.LT;t.fail$data(e._`Object.keys(${n}).length ${i} ${o}`)}};return Yn.default=r,Yn}(),i=Zn(),s=function(){if(Qn)return eo;Qn=1,Object.defineProperty(eo,"__esModule",{value:!0});const e=gr(),t={message({keyword:t,schemaCode:r}){const n="maxItems"===t?"more":"fewer";return e.str`must NOT have ${n} than ${r} items`},params:({schemaCode:t})=>e._`{limit: ${t}}`},r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:t,code(t){const{keyword:r,data:n,schemaCode:o}=t,i="maxItems"===r?e.operators.GT:e.operators.LT;t.fail$data(e._`${n}.length ${i} ${o}`)}};return eo.default=r,eo}(),a=so(),c=function(){if(ao)return co;ao=1,Object.defineProperty(co,"__esModule",{value:!0});const e=gr(),t=br(),r=io(),n={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:t})=>e._`{allowedValue: ${t}}`},code(n){const{gen:o,data:i,$data:s,schemaCode:a,schema:c}=n;s||c&&"object"==typeof c?n.fail$data(e._`!${(0,t.useFunc)(o,r.default)}(${i}, ${a})`):n.fail(e._`${c} !== ${i}`)}};return co.default=n,co}(),l=fo(),d=[e.default,t.default,r.default,n.default,o.default,i.default,s.default,a.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,l.default];return Rn.default=d,Rn}var mo,go={},yo={};function vo(){if(mo)return yo;mo=1,Object.defineProperty(yo,"__esModule",{value:!0}),yo.validateAdditionalItems=void 0;const e=gr(),t=br(),r={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:t}})=>e.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>e._`{limit: ${t}}`},code(e){const{parentSchema:r,it:o}=e,{items:i}=r;Array.isArray(i)?n(e,i):(0,t.checkStrictMode)(o,'"additionalItems" is ignored when "items" is not an array of schemas')}};function n(r,n){const{gen:o,schema:i,data:s,keyword:a,it:c}=r;c.items=!0;const l=o.const("len",e._`${s}.length`);if(!1===i)r.setParams({len:n.length}),r.pass(e._`${l} <= ${n.length}`);else if("object"==typeof i&&!(0,t.alwaysValidSchema)(c,i)){const i=o.var("valid",e._`${l} <= ${n.length}`);o.if((0,e.not)(i),()=>function(i){o.forRange("i",n.length,l,n=>{r.subschema({keyword:a,dataProp:n,dataPropType:t.Type.Num},i),c.allErrors||o.if((0,e.not)(i),()=>o.break())})}(i)),r.ok(i)}}return yo.validateAdditionalItems=n,yo.default=r,yo}var bo,$o,wo={},Eo={};function So(){if(bo)return Eo;bo=1,Object.defineProperty(Eo,"__esModule",{value:!0}),Eo.validateTuple=void 0;const e=gr(),t=br(),r=Ur(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:n,it:i}=e;if(Array.isArray(n))return o(e,"additionalItems",n);i.items=!0,(0,t.alwaysValidSchema)(i,n)||e.ok((0,r.validateArray)(e))}};function o(r,n,o=r.schema){const{gen:i,parentSchema:s,data:a,keyword:c,it:l}=r;!function(e){const{opts:r,errSchemaPath:i}=l,s=o.length,a=s===e.minItems&&(s===e.maxItems||!1===e[n]);if(r.strictTuples&&!a){const e=`"${c}" is ${s}-tuple, but minItems or maxItems/${n} are not specified or different at path "${i}"`;(0,t.checkStrictMode)(l,e,r.strictTuples)}}(s),l.opts.unevaluated&&o.length&&!0!==l.items&&(l.items=t.mergeEvaluated.items(i,o.length,l.items));const d=i.name("valid"),u=i.const("len",e._`${a}.length`);o.forEach((n,o)=>{(0,t.alwaysValidSchema)(l,n)||(i.if(e._`${u} > ${o}`,()=>r.subschema({keyword:c,schemaProp:o,dataProp:o},d)),r.ok(d))})}return Eo.validateTuple=o,Eo.default=n,Eo}var Po,_o={};var Lo,Co={};function No(){if(Lo)return Co;Lo=1,Object.defineProperty(Co,"__esModule",{value:!0});const e=gr(),t=br(),r={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:t,max:r}})=>void 0===r?e.str`must contain at least ${t} valid item(s)`:e.str`must contain at least ${t} and no more than ${r} valid item(s)`,params:({params:{min:t,max:r}})=>void 0===r?e._`{minContains: ${t}}`:e._`{minContains: ${t}, maxContains: ${r}}`},code(r){const{gen:n,schema:o,parentSchema:i,data:s,it:a}=r;let c,l;const{minContains:d,maxContains:u}=i;a.opts.next?(c=void 0===d?1:d,l=u):c=1;const p=n.const("len",e._`${s}.length`);if(r.setParams({min:c,max:l}),void 0===l&&0===c)return void(0,t.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==l&&c>l)return(0,t.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void r.fail();if((0,t.alwaysValidSchema)(a,o)){let t=e._`${p} >= ${c}`;return void 0!==l&&(t=e._`${t} && ${p} <= ${l}`),void r.pass(t)}a.items=!0;const f=n.name("valid");function h(){const t=n.name("_valid"),r=n.let("count",0);m(t,()=>n.if(t,()=>function(t){n.code(e._`${t}++`),void 0===l?n.if(e._`${t} >= ${c}`,()=>n.assign(f,!0).break()):(n.if(e._`${t} > ${l}`,()=>n.assign(f,!1).break()),1===c?n.assign(f,!0):n.if(e._`${t} >= ${c}`,()=>n.assign(f,!0)))}(r)))}function m(e,o){n.forRange("i",0,p,n=>{r.subschema({keyword:"contains",dataProp:n,dataPropType:t.Type.Num,compositeRule:!0},e),o()})}void 0===l&&1===c?m(f,()=>n.if(f,()=>n.break())):0===c?(n.let(f,!0),void 0!==l&&n.if(e._`${s}.length > 0`,h)):(n.let(f,!1),h()),r.result(f,()=>r.reset())}};return Co.default=r,Co}var Io,Oo={};function ko(){return Io||(Io=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=gr(),r=br(),n=Ur();e.error={message:({params:{property:e,depsCount:r,deps:n}})=>{const o=1===r?"property":"properties";return t.str`must have ${o} ${n} when property ${e} is present`},params:({params:{property:e,depsCount:r,deps:n,missingProperty:o}})=>t._`{property: ${e},
5
+ missingProperty: ${o},
6
6
  depsCount: ${r},
7
- deps: ${o}}`};const n={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(e){const[t,r]=function({schema:e}){const t={},r={};for(const o in e){if("__proto__"===o)continue;(Array.isArray(e[o])?t:r)[o]=e[o]}return[t,r]}(e);a(e,t),s(e,r)}};function a(e,r=e.schema){const{gen:n,data:a,it:s}=e;if(0===Object.keys(r).length)return;const i=n.let("missing");for(const c in r){const d=r[c];if(0===d.length)continue;const l=(0,o.propertyInData)(n,a,c,s.opts.ownProperties);e.setParams({property:c,depsCount:d.length,deps:d.join(", ")}),s.allErrors?n.if(l,()=>{for(const t of d)(0,o.checkReportMissingProp)(e,t)}):(n.if(t._`${l} && (${(0,o.checkMissingProp)(e,d,i)})`),(0,o.reportMissingProp)(e,i),n.else())}}function s(e,t=e.schema){const{gen:n,data:a,keyword:s,it:i}=e,c=n.name("valid");for(const d in t)(0,r.alwaysValidSchema)(i,t[d])||(n.if((0,o.propertyInData)(n,a,d,i.opts.ownProperties),()=>{const t=e.subschema({keyword:s,schemaProp:d},c);e.mergeValidEvaluated(t,c)},()=>n.var(c,!0)),e.ok(c))}e.validatePropertyDeps=a,e.validateSchemaDeps=s,e.default=n}(mo)),mo}var go,vo={};var yo,bo={};function $o(){if(yo)return bo;yo=1,Object.defineProperty(bo,"__esModule",{value:!0});const e=Et(),t=tt(),r=dt(),o=nt(),n={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>t._`{additionalProperty: ${e.additionalProperty}}`},code(n){const{gen:a,schema:s,parentSchema:i,data:c,errsCount:d,it:l}=n;if(!d)throw new Error("ajv implementation error");const{allErrors:u,opts:p}=l;if(l.props=!0,"all"!==p.removeAdditional&&(0,o.alwaysValidSchema)(l,s))return;const f=(0,e.allSchemaProperties)(i.properties),m=(0,e.allSchemaProperties)(i.patternProperties);function h(e){a.code(t._`delete ${c}[${e}]`)}function g(e){if("all"===p.removeAdditional||p.removeAdditional&&!1===s)h(e);else{if(!1===s)return n.setParams({additionalProperty:e}),n.error(),void(u||a.break());if("object"==typeof s&&!(0,o.alwaysValidSchema)(l,s)){const r=a.name("valid");"failing"===p.removeAdditional?(v(e,r,!1),a.if((0,t.not)(r),()=>{n.reset(),h(e)})):(v(e,r),u||a.if((0,t.not)(r),()=>a.break()))}}}function v(e,t,r){const a={keyword:"additionalProperties",dataProp:e,dataPropType:o.Type.Str};!1===r&&Object.assign(a,{compositeRule:!0,createErrors:!1,allErrors:!1}),n.subschema(a,t)}a.forIn("key",c,r=>{f.length||m.length?a.if(function(r){let s;if(f.length>8){const t=(0,o.schemaRefOrVal)(l,i.properties,"properties");s=(0,e.isOwnProperty)(a,t,r)}else s=f.length?(0,t.or)(...f.map(e=>t._`${r} === ${e}`)):t.nil;return m.length&&(s=(0,t.or)(s,...m.map(o=>t._`${(0,e.usePattern)(n,o)}.test(${r})`))),(0,t.not)(s)}(r),()=>g(r)):g(r)}),n.ok(t._`${d} === ${r.default.errors}`)}};return bo.default=n,bo}var wo,_o={};var ko,Po={};var So,Eo={};var jo,Oo={};var No,Io={};var xo,To={};var Co,Ro={};var Ao,Fo,Mo={};function Do(){if(Fo)return Zr;Fo=1,Object.defineProperty(Zr,"__esModule",{value:!0});const e=to(),t=function(){if(oo)return no;oo=1,Object.defineProperty(no,"__esModule",{value:!0});const e=so(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,e.validateTuple)(t,"items")};return no.default=t,no}(),r=so(),o=function(){if(io)return co;io=1,Object.defineProperty(co,"__esModule",{value:!0});const e=tt(),t=nt(),r=Et(),o=to(),n={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:t}})=>e.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>e._`{limit: ${t}}`},code(e){const{schema:n,parentSchema:a,it:s}=e,{prefixItems:i}=a;s.items=!0,(0,t.alwaysValidSchema)(s,n)||(i?(0,o.validateAdditionalItems)(e,i):e.ok((0,r.validateArray)(e)))}};return co.default=n,co}(),n=po(),a=ho(),s=function(){if(go)return vo;go=1,Object.defineProperty(vo,"__esModule",{value:!0});const e=tt(),t=nt(),r={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:t})=>e._`{propertyName: ${t.propertyName}}`},code(r){const{gen:o,schema:n,data:a,it:s}=r;if((0,t.alwaysValidSchema)(s,n))return;const i=o.name("valid");o.forIn("key",a,t=>{r.setParams({propertyName:t}),r.subschema({keyword:"propertyNames",data:t,dataTypes:["string"],propertyName:t,compositeRule:!0},i),o.if((0,e.not)(i),()=>{r.error(!0),s.allErrors||o.break()})}),r.ok(i)}};return vo.default=r,vo}(),i=$o(),c=function(){if(wo)return _o;wo=1,Object.defineProperty(_o,"__esModule",{value:!0});const e=zt(),t=Et(),r=nt(),o=$o(),n={keyword:"properties",type:"object",schemaType:"object",code(n){const{gen:a,schema:s,parentSchema:i,data:c,it:d}=n;"all"===d.opts.removeAdditional&&void 0===i.additionalProperties&&o.default.code(new e.KeywordCxt(d,o.default,"additionalProperties"));const l=(0,t.allSchemaProperties)(s);for(const e of l)d.definedProperties.add(e);d.opts.unevaluated&&l.length&&!0!==d.props&&(d.props=r.mergeEvaluated.props(a,(0,r.toHash)(l),d.props));const u=l.filter(e=>!(0,r.alwaysValidSchema)(d,s[e]));if(0===u.length)return;const p=a.name("valid");for(const e of u)f(e)?m(e):(a.if((0,t.propertyInData)(a,c,e,d.opts.ownProperties)),m(e),d.allErrors||a.else().var(p,!0),a.endIf()),n.it.definedProperties.add(e),n.ok(p);function f(e){return d.opts.useDefaults&&!d.compositeRule&&void 0!==s[e].default}function m(e){n.subschema({keyword:"properties",schemaProp:e,dataProp:e},p)}}};return _o.default=n,_o}(),d=function(){if(ko)return Po;ko=1,Object.defineProperty(Po,"__esModule",{value:!0});const e=Et(),t=tt(),r=nt(),o=nt(),n={keyword:"patternProperties",type:"object",schemaType:"object",code(n){const{gen:a,schema:s,data:i,parentSchema:c,it:d}=n,{opts:l}=d,u=(0,e.allSchemaProperties)(s),p=u.filter(e=>(0,r.alwaysValidSchema)(d,s[e]));if(0===u.length||p.length===u.length&&(!d.opts.unevaluated||!0===d.props))return;const f=l.strictSchema&&!l.allowMatchingProperties&&c.properties,m=a.name("valid");!0===d.props||d.props instanceof t.Name||(d.props=(0,o.evaluatedPropsToName)(a,d.props));const{props:h}=d;function g(e){for(const t in f)new RegExp(e).test(t)&&(0,r.checkStrictMode)(d,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function v(r){a.forIn("key",i,s=>{a.if(t._`${(0,e.usePattern)(n,r)}.test(${s})`,()=>{const e=p.includes(r);e||n.subschema({keyword:"patternProperties",schemaProp:r,dataProp:s,dataPropType:o.Type.Str},m),d.opts.unevaluated&&!0!==h?a.assign(t._`${h}[${s}]`,!0):e||d.allErrors||a.if((0,t.not)(m),()=>a.break())})})}!function(){for(const e of u)f&&g(e),d.allErrors?v(e):(a.var(m,!0),v(e),a.if(m))}()}};return Po.default=n,Po}(),l=function(){if(So)return Eo;So=1,Object.defineProperty(Eo,"__esModule",{value:!0});const e=nt(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){const{gen:r,schema:o,it:n}=t;if((0,e.alwaysValidSchema)(n,o))return void t.fail();const a=r.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},a),t.failResult(a,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};return Eo.default=t,Eo}(),u=function(){if(jo)return Oo;jo=1,Object.defineProperty(Oo,"__esModule",{value:!0});const e={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Et().validateUnion,error:{message:"must match a schema in anyOf"}};return Oo.default=e,Oo}(),p=function(){if(No)return Io;No=1,Object.defineProperty(Io,"__esModule",{value:!0});const e=tt(),t=nt(),r={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:t})=>e._`{passingSchemas: ${t.passing}}`},code(r){const{gen:o,schema:n,parentSchema:a,it:s}=r;if(!Array.isArray(n))throw new Error("ajv implementation error");if(s.opts.discriminator&&a.discriminator)return;const i=n,c=o.let("valid",!1),d=o.let("passing",null),l=o.name("_valid");r.setParams({passing:d}),o.block(function(){i.forEach((n,a)=>{let i;(0,t.alwaysValidSchema)(s,n)?o.var(l,!0):i=r.subschema({keyword:"oneOf",schemaProp:a,compositeRule:!0},l),a>0&&o.if(e._`${l} && ${c}`).assign(c,!1).assign(d,e._`[${d}, ${a}]`).else(),o.if(l,()=>{o.assign(c,!0),o.assign(d,a),i&&r.mergeEvaluated(i,e.Name)})})}),r.result(c,()=>r.reset(),()=>r.error(!0))}};return Io.default=r,Io}(),f=function(){if(xo)return To;xo=1,Object.defineProperty(To,"__esModule",{value:!0});const e=nt(),t={keyword:"allOf",schemaType:"array",code(t){const{gen:r,schema:o,it:n}=t;if(!Array.isArray(o))throw new Error("ajv implementation error");const a=r.name("valid");o.forEach((r,o)=>{if((0,e.alwaysValidSchema)(n,r))return;const s=t.subschema({keyword:"allOf",schemaProp:o},a);t.ok(a),t.mergeEvaluated(s)})}};return To.default=t,To}(),m=function(){if(Co)return Ro;Co=1,Object.defineProperty(Ro,"__esModule",{value:!0});const e=tt(),t=nt(),r={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:t})=>e.str`must match "${t.ifClause}" schema`,params:({params:t})=>e._`{failingKeyword: ${t.ifClause}}`},code(r){const{gen:n,parentSchema:a,it:s}=r;void 0===a.then&&void 0===a.else&&(0,t.checkStrictMode)(s,'"if" without "then" and "else" is ignored');const i=o(s,"then"),c=o(s,"else");if(!i&&!c)return;const d=n.let("valid",!0),l=n.name("_valid");if(function(){const e=r.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);r.mergeEvaluated(e)}(),r.reset(),i&&c){const e=n.let("ifClause");r.setParams({ifClause:e}),n.if(l,u("then",e),u("else",e))}else i?n.if(l,u("then")):n.if((0,e.not)(l),u("else"));function u(t,o){return()=>{const a=r.subschema({keyword:t},l);n.assign(d,l),r.mergeValidEvaluated(a,d),o?n.assign(o,e._`${t}`):r.setParams({ifClause:t})}}r.pass(d,()=>r.error(!0))}};function o(e,r){const o=e.schema[r];return void 0!==o&&!(0,t.alwaysValidSchema)(e,o)}return Ro.default=r,Ro}(),h=function(){if(Ao)return Mo;Ao=1,Object.defineProperty(Mo,"__esModule",{value:!0});const e=nt(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:r,it:o}){void 0===r.if&&(0,e.checkStrictMode)(o,`"${t}" without "if" is ignored`)}};return Mo.default=t,Mo}();return Zr.default=function(g=!1){const v=[l.default,u.default,p.default,f.default,m.default,h.default,s.default,i.default,a.default,c.default,d.default];return g?v.push(t.default,o.default):v.push(e.default,r.default),v.push(n.default),v},Zr}var Vo,zo={},Uo={};function qo(){if(Vo)return Uo;Vo=1,Object.defineProperty(Uo,"__esModule",{value:!0}),Uo.dynamicAnchor=void 0;const e=tt(),t=dt(),r=Wt(),o=yr(),n={keyword:"$dynamicAnchor",schemaType:"string",code:e=>a(e,e.schema)};function a(n,a){const{gen:s,it:i}=n;i.schemaEnv.root.dynamicAnchors[a]=!0;const c=e._`${t.default.dynamicAnchors}${(0,e.getProperty)(a)}`,d="#"===i.errSchemaPath?i.validateName:function(e){const{schemaEnv:t,schema:n,self:a}=e.it,{root:s,baseId:i,localRefs:c,meta:d}=t.root,{schemaId:l}=a.opts,u=new r.SchemaEnv({schema:n,schemaId:l,root:s,baseId:i,localRefs:c,meta:d});return r.compileSchema.call(a,u),(0,o.getValidate)(e,u)}(n);s.if(e._`!${c}`,()=>s.assign(c,d))}return Uo.dynamicAnchor=a,Uo.default=n,Uo}var Ko,Lo={};function Bo(){if(Ko)return Lo;Ko=1,Object.defineProperty(Lo,"__esModule",{value:!0}),Lo.dynamicRef=void 0;const e=tt(),t=dt(),r=yr(),o={keyword:"$dynamicRef",schemaType:"string",code:e=>n(e,e.schema)};function n(o,n){const{gen:a,keyword:s,it:i}=o;if("#"!==n[0])throw new Error(`"${s}" only supports hash fragment reference`);const c=n.slice(1);if(i.allErrors)d();else{const e=a.let("valid",!1);d(e),o.ok(e)}function d(r){if(i.schemaEnv.root.dynamicAnchors[c]){const o=a.let("_v",e._`${t.default.dynamicAnchors}${(0,e.getProperty)(c)}`);a.if(o,l(o,r),l(i.validateName,r))}else l(i.validateName,r)()}function l(e,t){return t?()=>a.block(()=>{(0,r.callRef)(o,e),a.let(t,!0)}):()=>(0,r.callRef)(o,e)}}return Lo.dynamicRef=n,Lo.default=o,Lo}var Ho,Go={};var Jo,Wo,Yo={};function Qo(){if(Wo)return zo;Wo=1,Object.defineProperty(zo,"__esModule",{value:!0});const e=qo(),t=Bo(),r=function(){if(Ho)return Go;Ho=1,Object.defineProperty(Go,"__esModule",{value:!0});const e=qo(),t=nt(),r={keyword:"$recursiveAnchor",schemaType:"boolean",code(r){r.schema?(0,e.dynamicAnchor)(r,""):(0,t.checkStrictMode)(r.it,"$recursiveAnchor: false is ignored")}};return Go.default=r,Go}(),o=function(){if(Jo)return Yo;Jo=1,Object.defineProperty(Yo,"__esModule",{value:!0});const e=Bo(),t={keyword:"$recursiveRef",schemaType:"string",code:t=>(0,e.dynamicRef)(t,t.schema)};return Yo.default=t,Yo}(),n=[e.default,t.default,r.default,o.default];return zo.default=n,zo}var Xo,Zo={},en={};var tn,rn={};var on,nn,an={};function sn(){if(nn)return Zo;nn=1,Object.defineProperty(Zo,"__esModule",{value:!0});const e=function(){if(Xo)return en;Xo=1,Object.defineProperty(en,"__esModule",{value:!0});const e=ho(),t={keyword:"dependentRequired",type:"object",schemaType:"object",error:e.error,code:t=>(0,e.validatePropertyDeps)(t)};return en.default=t,en}(),t=function(){if(tn)return rn;tn=1,Object.defineProperty(rn,"__esModule",{value:!0});const e=ho(),t={keyword:"dependentSchemas",type:"object",schemaType:"object",code:t=>(0,e.validateSchemaDeps)(t)};return rn.default=t,rn}(),r=function(){if(on)return an;on=1,Object.defineProperty(an,"__esModule",{value:!0});const e=nt(),t={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:t,parentSchema:r,it:o}){void 0===r.contains&&(0,e.checkStrictMode)(o,`"${t}" without "contains" is ignored`)}};return an.default=t,an}(),o=[e.default,t.default,r.default];return Zo.default=o,Zo}var cn,dn={},ln={};function un(){if(cn)return ln;cn=1,Object.defineProperty(ln,"__esModule",{value:!0});const e=tt(),t=nt(),r=dt(),o={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:t})=>e._`{unevaluatedProperty: ${t.unevaluatedProperty}}`},code(o){const{gen:n,schema:a,data:s,errsCount:i,it:c}=o;if(!i)throw new Error("ajv implementation error");const{allErrors:d,props:l}=c;function u(r){if(!1===a)return o.setParams({unevaluatedProperty:r}),o.error(),void(d||n.break());if(!(0,t.alwaysValidSchema)(c,a)){const a=n.name("valid");o.subschema({keyword:"unevaluatedProperties",dataProp:r,dataPropType:t.Type.Str},a),d||n.if((0,e.not)(a),()=>n.break())}}l instanceof e.Name?n.if(e._`${l} !== true`,()=>n.forIn("key",s,t=>n.if(function(t,r){return e._`!${t} || !${t}[${r}]`}(l,t),()=>u(t)))):!0!==l&&n.forIn("key",s,t=>void 0===l?u(t):n.if(function(t,r){const o=[];for(const n in t)!0===t[n]&&o.push(e._`${r} !== ${n}`);return(0,e.and)(...o)}(l,t),()=>u(t))),c.props=!0,o.ok(e._`${i} === ${r.default.errors}`)}};return ln.default=o,ln}var pn,fn,mn={};function hn(){if(pn)return mn;pn=1,Object.defineProperty(mn,"__esModule",{value:!0});const e=tt(),t=nt(),r={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:t}})=>e.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>e._`{limit: ${t}}`},code(r){const{gen:o,schema:n,data:a,it:s}=r,i=s.items||0;if(!0===i)return;const c=o.const("len",e._`${a}.length`);if(!1===n)r.setParams({len:i}),r.fail(e._`${c} > ${i}`);else if("object"==typeof n&&!(0,t.alwaysValidSchema)(s,n)){const n=o.var("valid",e._`${c} <= ${i}`);o.if((0,e.not)(n),()=>function(n,a){o.forRange("i",a,c,a=>{r.subschema({keyword:"unevaluatedItems",dataProp:a,dataPropType:t.Type.Num},n),s.allErrors||o.if((0,e.not)(n),()=>o.break())})}(n,i)),r.ok(n)}s.items=!0}};return mn.default=r,mn}var gn,vn,yn={},bn={};function $n(){if(gn)return bn;gn=1,Object.defineProperty(bn,"__esModule",{value:!0});const e=tt(),t={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:t})=>e.str`must match format "${t}"`,params:({schemaCode:t})=>e._`{format: ${t}}`},code(t,r){const{gen:o,data:n,$data:a,schema:s,schemaCode:i,it:c}=t,{opts:d,errSchemaPath:l,schemaEnv:u,self:p}=c;d.validateFormats&&(a?function(){const a=o.scopeValue("formats",{ref:p.formats,code:d.code.formats}),s=o.const("fDef",e._`${a}[${i}]`),c=o.let("fType"),l=o.let("format");o.if(e._`typeof ${s} == "object" && !(${s} instanceof RegExp)`,()=>o.assign(c,e._`${s}.type || "string"`).assign(l,e._`${s}.validate`),()=>o.assign(c,e._`"string"`).assign(l,s)),t.fail$data((0,e.or)(!1===d.strictSchema?e.nil:e._`${i} && !${l}`,function(){const t=u.$async?e._`(${s}.async ? await ${l}(${n}) : ${l}(${n}))`:e._`${l}(${n})`,o=e._`(typeof ${l} == "function" ? ${t} : ${l}.test(${n}))`;return e._`${l} && ${l} !== true && ${c} === ${r} && !${o}`}()))}():function(){const a=p.formats[s];if(!a)return void function(){if(!1===d.strictSchema)return void p.logger.warn(e());throw new Error(e());function e(){return`unknown format "${s}" ignored in schema at path "${l}"`}}();if(!0===a)return;const[i,c,f]=function(t){const r=t instanceof RegExp?(0,e.regexpCode)(t):d.code.formats?e._`${d.code.formats}${(0,e.getProperty)(s)}`:void 0,n=o.scopeValue("formats",{key:s,ref:t,code:r});if("object"==typeof t&&!(t instanceof RegExp))return[t.type||"string",t.validate,e._`${n}.validate`];return["string",t,n]}(a);i===r&&t.pass(function(){if("object"==typeof a&&!(a instanceof RegExp)&&a.async){if(!u.$async)throw new Error("async format in sync schema");return e._`await ${f}(${n})`}return"function"==typeof c?e._`${f}(${n})`:e._`${f}.test(${n})`}())}())}};return bn.default=t,bn}var wn,_n,kn={};function Pn(){if(_n)return pr;_n=1,Object.defineProperty(pr,"__esModule",{value:!0});const e=br(),t=Qr(),r=Do(),o=Qo(),n=sn(),a=function(){if(fn)return dn;fn=1,Object.defineProperty(dn,"__esModule",{value:!0});const e=un(),t=hn(),r=[e.default,t.default];return dn.default=r,dn}(),s=function(){if(vn)return yn;vn=1,Object.defineProperty(yn,"__esModule",{value:!0});const e=[$n().default];return yn.default=e,yn}(),i=(wn||(wn=1,Object.defineProperty(kn,"__esModule",{value:!0}),kn.contentVocabulary=kn.metadataVocabulary=void 0,kn.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],kn.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),kn),c=[o.default,e.default,t.default,(0,r.default)(!0),s.default,i.metadataVocabulary,i.contentVocabulary,n.default,a.default];return pr.default=c,pr}var Sn,En,jn={},On={};function Nn(){if(En)return jn;En=1,Object.defineProperty(jn,"__esModule",{value:!0});const e=tt(),t=(Sn||(Sn=1,Object.defineProperty(On,"__esModule",{value:!0}),On.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(r||(On.DiscrError=r={}))),On);var r;const o=Wt(),n=Ht(),a=nt(),s={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:r}})=>e===t.DiscrError.Tag?`tag "${r}" must be string`:`value of tag "${r}" must be in oneOf`,params:({params:{discrError:t,tag:r,tagName:o}})=>e._`{error: ${t}, tag: ${o}, tagValue: ${r}}`},code(r){const{gen:s,data:i,schema:c,parentSchema:d,it:l}=r,{oneOf:u}=d;if(!l.opts.discriminator)throw new Error("discriminator: requires discriminator option");const p=c.propertyName;if("string"!=typeof p)throw new Error("discriminator: requires propertyName");if(c.mapping)throw new Error("discriminator: mapping is not supported");if(!u)throw new Error("discriminator: requires oneOf keyword");const f=s.let("valid",!1),m=s.const("tag",e._`${i}${(0,e.getProperty)(p)}`);function h(t){const o=s.name("valid"),n=r.subschema({keyword:"oneOf",schemaProp:t},o);return r.mergeEvaluated(n,e.Name),o}s.if(e._`typeof ${m} == "string"`,()=>function(){const i=function(){var e;const t={},r=i(d);let s=!0;for(let t=0;t<u.length;t++){let d=u[t];if((null==d?void 0:d.$ref)&&!(0,a.schemaHasRulesButRef)(d,l.self.RULES)){const e=d.$ref;if(d=o.resolveRef.call(l.self,l.schemaEnv.root,l.baseId,e),d instanceof o.SchemaEnv&&(d=d.schema),void 0===d)throw new n.default(l.opts.uriResolver,l.baseId,e)}const f=null===(e=null==d?void 0:d.properties)||void 0===e?void 0:e[p];if("object"!=typeof f)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${p}"`);s=s&&(r||i(d)),c(f,t)}if(!s)throw new Error(`discriminator: "${p}" must be required`);return t;function i({required:e}){return Array.isArray(e)&&e.includes(p)}function c(e,t){if(e.const)f(e.const,t);else{if(!e.enum)throw new Error(`discriminator: "properties/${p}" must have "const" or "enum"`);for(const r of e.enum)f(r,t)}}function f(e,r){if("string"!=typeof e||e in t)throw new Error(`discriminator: "${p}" values must be unique strings`);t[e]=r}}();s.if(!1);for(const t in i)s.elseIf(e._`${m} === ${t}`),s.assign(f,h(i[t]));s.else(),r.error(!1,{discrError:t.DiscrError.Mapping,tag:m,tagName:p}),s.endIf()}(),()=>r.error(!1,{discrError:t.DiscrError.Tag,tag:m,tagName:p})),r.ok(f)}};return jn.default=s,jn}var In,xn,Tn={},Cn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"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,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{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:{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}}},Rn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#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/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}},An={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}},Fn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}},Mn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$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:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}},Dn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}},Vn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}},zn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}};var Un=(xn||(xn=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2020=void 0;const r=lr(),o=Pn(),n=Nn(),a=function(){if(In)return Tn;In=1,Object.defineProperty(Tn,"__esModule",{value:!0});const e=Cn,t=Rn,r=An,o=Fn,n=Mn,a=Dn,s=Vn,i=zn,c=["/properties"];return Tn.default=function(d){return[e,t,r,o,n,l(this,a),s,l(this,i)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function l(e,t){return d?e.$dataMetaSchema(t,c):t}},Tn}(),s="https://json-schema.org/draft/2020-12/schema";class i extends r.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),o.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:e,meta:t}=this.opts;t&&(a.default.call(this,e),this.refs["http://json-schema.org/schema"]=s)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}t.Ajv2020=i,e.exports=t=i,e.exports.Ajv2020=i,Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var c=zt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var d=tt();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var l=Kt();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return l.default}});var u=Ht();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return u.default}})}(Ke,Ke.exports)),Ke.exports),qn=Ue(Un);const Kn=U.object({templateEntry:U.string({required_error:"templateEntry is required in build section",invalid_type_error:"templateEntry must be a string"}).describe("Main entry point for the portal"),schemaEntry:U.string({required_error:"schemaEntry is required in build section",invalid_type_error:"schemaEntry must be a string"}).describe("Schema file for portal validation"),assetPath:U.string({invalid_type_error:"assetPath must be a string"}).optional().describe("Asset path for dev/preview builds"),githubRepo:U.string({invalid_type_error:"githubRepo must be a string"}).optional().describe("GitHub repo URL or local git remote"),version:U.string({required_error:"version is required in build section",invalid_type_error:"version must be a string"}).describe("Version from package.json"),timestamp:U.string({required_error:"timestamp is required in build section",invalid_type_error:"timestamp must be a string"}).describe("Current build timestamp (ISO8601)"),commitSha:U.string({required_error:"commitSha is required in build section",invalid_type_error:"commitSha must be a string"}).describe("Current git commit SHA"),annotations:U.record(U.string(),{invalid_type_error:"annotations must be a record of string values"}).optional().describe("Optional build annotations"),projectPage:U.string({invalid_type_error:"projectPage must be a string"}).optional().describe("Optional project homepage"),allowedExtensions:U.array(U.string({invalid_type_error:"Each allowed extension must be a string"}),{required_error:"allowedExtensions is required in build section",invalid_type_error:"allowedExtensions must be an array of strings"}).describe("List of allowed asset extensions (with leading dot)"),schema:U.record(U.unknown(),{invalid_type_error:"schema must be a record of unknown values"}).optional().describe("Optional schema for the portal"),config:U.record(U.unknown(),{invalid_type_error:"config must be a record of unknown values"}).optional().describe("Optional configuration for the portal")});U.object({name:U.string({required_error:"name is required in portal manifest",invalid_type_error:"name must be a string"}).describe("Short app key (unscoped, derived from package name)"),displayName:U.string({invalid_type_error:"displayName must be a string"}).optional().describe("Full package name, may include scope"),description:U.string({invalid_type_error:"description must be a string"}).optional().describe("Description of the portal"),build:Kn});const Ln=e("schema").description("Generate or validate a Fusion portal schema file.").addHelpText("after",["Generates or validates a Fusion portal schema file.","","Options:"," -o, --output Output file name (default: stdout)"," -v, --validate Validate the generated schema against a JSON file"," -d, --debug Enable debug mode for verbose logging","","Examples:"," $ fusion-framework-cli portal schema"," $ fusion-framework-cli portal schema --output portal.schema.json"," $ fusion-framework-cli portal schema --validate my-config.json"].join("\n")).addOption(ge({allowDev:!0})).option("-o, --output <string>","Output file name (default: stdout)","stdout").option("-d, --debug","Enable debug mode for verbose logging",!1).option("-v, --validate <file>","Validate the generated schema against a JSON file").argument("[schema]","Schema build file to use (e.g., portal.schema[.env]?.[ts,js,json])").action(async(e,t)=>{const r=new c("portal:schema",{debug:t.debug});r.debug("Manifest file:",e),r.debug("Current working directory:",process.cwd()),r.start("Generating schema for the application...");const o=await(async(e,t)=>{const r=[`portal.schema.${e.environment}`,"portal.schema"],o=await V(r,{baseDir:e.root,extensions:t?.extensions,script:{resolve:async t=>{const r="function"==typeof t.default?await Promise.resolve(t.default(e)):t.default;if(!r)throw new Error("Schema function did not return a valid schema");return r}}});return{schema:o.config,path:o.path,extension:o.extension}})({command:"build",environment:t.environment,mode:"build",root:process.cwd()});if(r.debug("Schema:",JSON.stringify(o,null,2)),r.succeed("Schema generated successfully!"),t.output&&("stdout"===t.output?r.info("Schema:",JSON.stringify(o.schema,null,2)):(r.start(`Writing schema to ${t.output}`),((e,t,r)=>{const o=s(String(e));F(o)||M(o,{recursive:!0}),D(e,t,r)})(t.output,JSON.stringify(o.schema,null,2)),r.succeed(`Schema written to ${t.output}`)),process.exit(0)),t.validate){r.start("Validating schema against JSON file...");const e=new qn({strict:!0}).compile(o.schema),n=await z(t.validate);r.debug("JSON value:",JSON.stringify(n,null,2));e(n)?r.succeed("Schema validation passed!"):(r.fail("Schema validation failed:",JSON.stringify(e.errors??"Unknown error")),process.exit(1))}}),Bn=e("build").description("Build the Fusion portal from a manifest file with environment-specific settings.").addHelpText("after",["Builds the Fusion portal using a manifest file and environment-specific configuration.","","If no manifest is provided, the command will search for a default portal.manifest.[ts|js|json] in the current directory.","You can use environment variables to customize the build process (e.g., NODE_ENV, FUSION_PORTAL_*).","","Options:"," -d, --debug Enable debug mode for verbose logging","","Examples:"," $ fusion-framework-cli portal build"," $ fusion-framework-cli portal build portal.manifest.prod.ts --debug",""].join("\n")).option("-d, --debug","Enable debug mode for verbose logging",!1).argument("[manifest]","Manifest build file to use for building (e.g., portal.manifest[.env]?.[ts,js,json])").action(async(e,t)=>{const r=new c("portal:build",{debug:t.debug});await P({log:r,manifest:e})}),Hn=e("pack").description("Bundle the Fusion portal into a deployable archive.").addHelpText("after",["Bundles the Fusion portal using the provided manifest and schema into a zip archive for deployment.","","If no manifest is provided, a default portal.manifest.[ts|js|json] is used from the current directory.","","Options:"," -a, --archive Name of the output archive file (default: out/bundle.zip)"," --schema Schema file to use for validation"," -d, --debug Enable debug mode for verbose logging","","Examples:"," $ fusion-framework-cli portal pack"," $ fusion-framework-cli portal pack --archive my-portal.zip --schema portal.schema.json"," $ fusion-framework-cli portal pack portal.manifest.prod.ts --debug"].join("\n")).option("-a, --archive [string]","Name of the output archive file (default: out/bundle.zip)","out/bundle.zip").option("-d, --debug [boolean]","Enable debug mode for verbose logging",!1).option("--schema [string]","Schema file to use for validation").argument("[manifest]","Manifest file to use for bundling (e.g., portal.manifest[.env]?.[ts,js,json])").action(async(e,t)=>{const r=new c("portal:pack",{debug:t.debug});await S({log:r,manifest:e,archive:t.archive,schema:t.schema}).catch(e=>{r.error("Failed to create package:",e),process.exit(1)})}),Gn=_e(e("upload").description("Upload a Fusion portal bundle to the portal registry.").addHelpText("after",["Uploads a distributable Fusion portal bundle to the portal registry for deployment.","","Options:"," --env Target environment"," -d, --debug Enable debug mode for verbose logging","","Examples:"," $ fusion-framework-cli portal upload my-portal-bundle.zip"," $ fusion-framework-cli portal upload my-portal-bundle.zip --env prod"].join("\n")).option("-d, --debug [boolean]","Enable debug mode for verbose logging",!1).addOption(ge({allowDev:!1})).argument("<bundle>","Portal bundle to upload (e.g., out/bundle.zip)").action(async(e,t)=>{const r=new c("portal:upload",{debug:t.debug});r?.start("Initializing Fusion Framework...");const o=await m({env:t.env,auth:{token:t.token,tenantId:t.tenantId,clientId:t.clientId}});r?.succeed("Initialized Fusion Framework"),await E({log:r,framework:o,fileOrBundle:e}).catch(e=>{r.error("Failed to upload bundle:",e),process.exit(1)})})),Jn=_e(e("tag").description("Tag your Fusion portal with a specific version or label.").addHelpText("after",["Tags your Fusion portal with a specific version or label in the portal registry.","","Options:"," -n, --name Portal name (if not provided, resolved from manifest)"," -m, --manifest Manifest file to use for resolving portal name and version"," -v, --version Version to tag (if not provided, resolved from manifest)"," --env Target environment"," -d, --debug Enable debug mode for verbose logging"," --silent Silent mode, suppresses output except errors","","Examples:"," $ fusion-framework-cli portal tag latest"," $ fusion-framework-cli portal tag preview --env prod --manifest portal.manifest.prod.ts"].join("\n")).addOption(ge({allowDev:!1})).option("-m, --manifest <string>","Manifest file to use for resolving portal name and version (only used when --package is not provided)").option("-p, --package [package@version]","Package to tag (e.g., my-portal@1.0.0)").option("-v, --version <string>","Version to tag (if not provided, resolved from manifest)").option("-d, --debug","Enable debug mode for verbose logging").option("--silent","Silent mode, suppresses output except errors").argument("<tag>","Tag to apply (latest | preview)").action(async(e,t)=>{const r=t.silent?null:new c("app:tag",{debug:t.debug}),o={command:"build",environment:t.env,mode:process.env.NODE_ENV??"production",root:process.cwd()};let[n,a]=(t.package??"").split("@");if(!n||!a){const{manifest:e}=await k({log:r,manifest:t.manifest,env:o});e||(r?.error("😢 No portal manifest found. Please provide a valid manifest file or package name"),process.exit(1)),n=e.name,a=e.build.version}r?.start("Initializing Fusion Framework...");const s=await m({env:t.env,auth:{token:t.token,tenantId:t.tenantId,clientId:t.clientId}});r?.succeed("Initialized Fusion Framework"),j({tag:e,name:n,version:a,framework:s,log:r}).catch(e=>{r?.error("😢 Failed to tag application:",e),process.exit(1)})})),Wn=_e(e("publish").description("Build, upload, and tag your Fusion portal bundle for deployment.").addHelpText("after",["Builds, uploads, and tags your Fusion portal bundle for deployment to the portal registry.","","Options:"," --env Target environment"," -m, --manifest Manifest file to use for bundling"," --schema Schema file to use for validation"," -t, --tag Tag to apply to the published portal"," -d, --debug Enable debug mode for verbose logging","","Examples:"," $ fusion-framework-cli portal publish"," $ fusion-framework-cli portal publish --env prod --manifest portal.manifest.prod.ts"].join("\n")).option("-d, --debug","Enable debug mode for verbose logging",!1).addOption(ge({allowDev:!1})).option("-m, --manifest [string]","Manifest file to use for bundling (e.g., portal.manifest.ts)").option("--schema [string]","Schema file to use for validation").option("-t, --tag [string]",`Tag to apply to the published portal (${Object.values(O).join(" | ")})`,O.Latest).action(async e=>{const t=new c("portal:publish",{debug:e.debug});t?.info("Using environment:",pe.redBright(e.env)),t.start("📦 Bundling Portal Template...");const r=await S({log:t,manifest:e.manifest,schema:e.schema}).catch(e=>{t.error("😢 Failed to create bundle:",e),process.exit(1)});t.succeed("📦 Bundling completed"),t?.start("💾 Initializing Fusion Framework...");const o=await m({env:e.env,auth:{token:e.token,tenantId:e.tenantId,clientId:e.clientId}});t?.succeed("💾 Initialized Fusion Framework"),t.start("🚀 Uploading Portal Template..."),await E({log:t,framework:o,fileOrBundle:r.archive}).catch(e=>{t.error("😢 Failed to upload bundle:",e),process.exit(1)}),t.succeed("🚀 Upload completed"),t.start("🏷️ Tagging Portal Template..."),await j({tag:e.tag,name:r.manifest.name,version:r.manifest.build.version,framework:o,log:t}).catch(e=>{t.error("😢 Failed to tag Portal Template:",e),process.exit(1)}),t.succeed("🏷️ Tagging completed")})),Yn=_e(e("config").description("Generate or publish the Fusion portal configuration file.").addHelpText("after",["Generates and/or publishes the Fusion portal configuration.","","By default, outputs the config to stdout or a file. Use --publish to upload to the portal registry.","","Options:"," --publish Publish config to Fusion portal registry"," --identifier Portal identifier (required with --publish)"," -o, --output Output to stdout or a file (default: stdout)"," --env Target environment"," --debug Enable debug mode for verbose logging","","Examples:"," $ fusion-framework-cli portal config --identifier my-portal@1.2.3 -o stdout portal.config.ts"," $ fusion-framework-cli portal config --publish --env prod --identifier my-portal@1.2.3 portal.config.ts"].join("\n")).option("--debug","Enable debug mode for verbose logging").option("--silent","Silent mode, suppresses output except errors").option("--publish <name@version>","Publish config to Fusion portal registry, Identifier of the portal, example my-portal@1.2.3").addOption(ge({allowDev:!0})).option("-o, --output <stdout|path>","Output the result to stdout or a file (ignored with --publish, default: stdout)","stdout").argument("[config]","Path to the portal config file (e.g., portal.config[.env]?.[ts,js,json])").action(async(e,t)=>{const r=t.silent?null:new c("portal:config",{debug:!!t.debug});if(t.publish){const[e,o]=t.publish.split("@")||[];return e&&o||(r?.fail("🤪","Portal identifier is required when using",pe.blue("--publish")),r?.info("Example: fusion-framework-cli portal config --publish my-portal@1.2.3"),process.exit(1)),"dev"===t.env&&(r?.fail("🤪",pe.blue("--env"),'cannot be "dev" when',pe.blue("--publish")," is used"),process.exit(1)),N({config:t.config,portal:{name:e,version:o},environment:t.env,auth:"token"in t?{token:t.token}:t,debug:t.debug})}const{config:o}=await I({log:r,config:e,env:{environment:t.env},output:"stdout"===t.output?void 0:t.output});"stdout"===t.output&&x.write(JSON.stringify(o,null,2))})),Qn=e("portal").description("Develop and deploy portal templates").addCommand(Ve).addCommand(ze).addCommand(Ln).addCommand(Bn).addCommand(Hn).addCommand(Gn).addCommand(Jn).addCommand(Wn).addCommand(Yn);const[Xn]=process.versions.node.split(".").map(Number);Xn<Number(20)&&(console.error(pe.red("[ERROR]"),"Fusion Framework CLI requires Node.js 20 or higher."),process.exit(1));Xn!==Number(22)&&console.warn(pe.yellow("[WARNING]"),"Node.js 22.x (LTS) is recommended for best compatibility. You are using Node.js",process.versions.node);const Zn=i({cwd:n(import.meta.url)});if(!Zn)throw Error("failed to find program root");process.env.CLI_BIN=a(s(Zn.path),String(Zn.packageJson.bin?.["fusion-framework-cli"]));const ea=new o;ea.name(Zn.packageJson.name),ea.description([`${Zn.packageJson.name}@${Zn.packageJson.version}`,"","Fusion Framework CLI","","A toolkit for building, packaging, deploying, and managing Fusion applications and portals.","","• Run fusion <command> --help for details on any command.","• For documentation, issues, and source code, visit:",` ${Zn.packageJson.homepage}`].join("\n")),ea.version(Zn.packageJson.version,"-V, --version","CLI version"),(e=>{e.addCommand(xe),e.addCommand(Fe),e.addCommand(De),e.addCommand(Qn)})(ea),ea.parse();
7
+ deps: ${n}}`};const o={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(e){const[t,r]=function({schema:e}){const t={},r={};for(const n in e){if("__proto__"===n)continue;(Array.isArray(e[n])?t:r)[n]=e[n]}return[t,r]}(e);i(e,t),s(e,r)}};function i(e,r=e.schema){const{gen:o,data:i,it:s}=e;if(0===Object.keys(r).length)return;const a=o.let("missing");for(const c in r){const l=r[c];if(0===l.length)continue;const d=(0,n.propertyInData)(o,i,c,s.opts.ownProperties);e.setParams({property:c,depsCount:l.length,deps:l.join(", ")}),s.allErrors?o.if(d,()=>{for(const t of l)(0,n.checkReportMissingProp)(e,t)}):(o.if(t._`${d} && (${(0,n.checkMissingProp)(e,l,a)})`),(0,n.reportMissingProp)(e,a),o.else())}}function s(e,t=e.schema){const{gen:o,data:i,keyword:s,it:a}=e,c=o.name("valid");for(const l in t)(0,r.alwaysValidSchema)(a,t[l])||(o.if((0,n.propertyInData)(o,i,l,a.opts.ownProperties),()=>{const t=e.subschema({keyword:s,schemaProp:l},c);e.mergeValidEvaluated(t,c)},()=>o.var(c,!0)),e.ok(c))}e.validatePropertyDeps=i,e.validateSchemaDeps=s,e.default=o}(Oo)),Oo}var Ao,To={};var xo,Do={};function jo(){if(xo)return Do;xo=1,Object.defineProperty(Do,"__esModule",{value:!0});const e=Ur(),t=gr(),r=Pr(),n=br(),o={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>t._`{additionalProperty: ${e.additionalProperty}}`},code(o){const{gen:i,schema:s,parentSchema:a,data:c,errsCount:l,it:d}=o;if(!l)throw new Error("ajv implementation error");const{allErrors:u,opts:p}=d;if(d.props=!0,"all"!==p.removeAdditional&&(0,n.alwaysValidSchema)(d,s))return;const f=(0,e.allSchemaProperties)(a.properties),h=(0,e.allSchemaProperties)(a.patternProperties);function m(e){i.code(t._`delete ${c}[${e}]`)}function g(e){if("all"===p.removeAdditional||p.removeAdditional&&!1===s)m(e);else{if(!1===s)return o.setParams({additionalProperty:e}),o.error(),void(u||i.break());if("object"==typeof s&&!(0,n.alwaysValidSchema)(d,s)){const r=i.name("valid");"failing"===p.removeAdditional?(y(e,r,!1),i.if((0,t.not)(r),()=>{o.reset(),m(e)})):(y(e,r),u||i.if((0,t.not)(r),()=>i.break()))}}}function y(e,t,r){const i={keyword:"additionalProperties",dataProp:e,dataPropType:n.Type.Str};!1===r&&Object.assign(i,{compositeRule:!0,createErrors:!1,allErrors:!1}),o.subschema(i,t)}i.forIn("key",c,r=>{f.length||h.length?i.if(function(r){let s;if(f.length>8){const t=(0,n.schemaRefOrVal)(d,a.properties,"properties");s=(0,e.isOwnProperty)(i,t,r)}else s=f.length?(0,t.or)(...f.map(e=>t._`${r} === ${e}`)):t.nil;return h.length&&(s=(0,t.or)(s,...h.map(n=>t._`${(0,e.usePattern)(o,n)}.test(${r})`))),(0,t.not)(s)}(r),()=>g(r)):g(r)}),o.ok(t._`${l} === ${r.default.errors}`)}};return Do.default=o,Do}var Ro,Fo={};var Mo,Go={};var Uo,Bo={};var zo,Vo={};var Ho,qo={};var Ko,Wo={};var Yo,Jo={};var Xo,Zo,Qo={};function ei(){if(Zo)return go;Zo=1,Object.defineProperty(go,"__esModule",{value:!0});const e=vo(),t=function(){if($o)return wo;$o=1,Object.defineProperty(wo,"__esModule",{value:!0});const e=So(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,e.validateTuple)(t,"items")};return wo.default=t,wo}(),r=So(),n=function(){if(Po)return _o;Po=1,Object.defineProperty(_o,"__esModule",{value:!0});const e=gr(),t=br(),r=Ur(),n=vo(),o={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:t}})=>e.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>e._`{limit: ${t}}`},code(e){const{schema:o,parentSchema:i,it:s}=e,{prefixItems:a}=i;s.items=!0,(0,t.alwaysValidSchema)(s,o)||(a?(0,n.validateAdditionalItems)(e,a):e.ok((0,r.validateArray)(e)))}};return _o.default=o,_o}(),o=No(),i=ko(),s=function(){if(Ao)return To;Ao=1,Object.defineProperty(To,"__esModule",{value:!0});const e=gr(),t=br(),r={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:t})=>e._`{propertyName: ${t.propertyName}}`},code(r){const{gen:n,schema:o,data:i,it:s}=r;if((0,t.alwaysValidSchema)(s,o))return;const a=n.name("valid");n.forIn("key",i,t=>{r.setParams({propertyName:t}),r.subschema({keyword:"propertyNames",data:t,dataTypes:["string"],propertyName:t,compositeRule:!0},a),n.if((0,e.not)(a),()=>{r.error(!0),s.allErrors||n.break()})}),r.ok(a)}};return To.default=r,To}(),a=jo(),c=function(){if(Ro)return Fo;Ro=1,Object.defineProperty(Fo,"__esModule",{value:!0});const e=tn(),t=Ur(),r=br(),n=jo(),o={keyword:"properties",type:"object",schemaType:"object",code(o){const{gen:i,schema:s,parentSchema:a,data:c,it:l}=o;"all"===l.opts.removeAdditional&&void 0===a.additionalProperties&&n.default.code(new e.KeywordCxt(l,n.default,"additionalProperties"));const d=(0,t.allSchemaProperties)(s);for(const e of d)l.definedProperties.add(e);l.opts.unevaluated&&d.length&&!0!==l.props&&(l.props=r.mergeEvaluated.props(i,(0,r.toHash)(d),l.props));const u=d.filter(e=>!(0,r.alwaysValidSchema)(l,s[e]));if(0===u.length)return;const p=i.name("valid");for(const e of u)f(e)?h(e):(i.if((0,t.propertyInData)(i,c,e,l.opts.ownProperties)),h(e),l.allErrors||i.else().var(p,!0),i.endIf()),o.it.definedProperties.add(e),o.ok(p);function f(e){return l.opts.useDefaults&&!l.compositeRule&&void 0!==s[e].default}function h(e){o.subschema({keyword:"properties",schemaProp:e,dataProp:e},p)}}};return Fo.default=o,Fo}(),l=function(){if(Mo)return Go;Mo=1,Object.defineProperty(Go,"__esModule",{value:!0});const e=Ur(),t=gr(),r=br(),n=br(),o={keyword:"patternProperties",type:"object",schemaType:"object",code(o){const{gen:i,schema:s,data:a,parentSchema:c,it:l}=o,{opts:d}=l,u=(0,e.allSchemaProperties)(s),p=u.filter(e=>(0,r.alwaysValidSchema)(l,s[e]));if(0===u.length||p.length===u.length&&(!l.opts.unevaluated||!0===l.props))return;const f=d.strictSchema&&!d.allowMatchingProperties&&c.properties,h=i.name("valid");!0===l.props||l.props instanceof t.Name||(l.props=(0,n.evaluatedPropsToName)(i,l.props));const{props:m}=l;function g(e){for(const t in f)new RegExp(e).test(t)&&(0,r.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function y(r){i.forIn("key",a,s=>{i.if(t._`${(0,e.usePattern)(o,r)}.test(${s})`,()=>{const e=p.includes(r);e||o.subschema({keyword:"patternProperties",schemaProp:r,dataProp:s,dataPropType:n.Type.Str},h),l.opts.unevaluated&&!0!==m?i.assign(t._`${m}[${s}]`,!0):e||l.allErrors||i.if((0,t.not)(h),()=>i.break())})})}!function(){for(const e of u)f&&g(e),l.allErrors?y(e):(i.var(h,!0),y(e),i.if(h))}()}};return Go.default=o,Go}(),d=function(){if(Uo)return Bo;Uo=1,Object.defineProperty(Bo,"__esModule",{value:!0});const e=br(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){const{gen:r,schema:n,it:o}=t;if((0,e.alwaysValidSchema)(o,n))return void t.fail();const i=r.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};return Bo.default=t,Bo}(),u=function(){if(zo)return Vo;zo=1,Object.defineProperty(Vo,"__esModule",{value:!0});const e={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Ur().validateUnion,error:{message:"must match a schema in anyOf"}};return Vo.default=e,Vo}(),p=function(){if(Ho)return qo;Ho=1,Object.defineProperty(qo,"__esModule",{value:!0});const e=gr(),t=br(),r={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:t})=>e._`{passingSchemas: ${t.passing}}`},code(r){const{gen:n,schema:o,parentSchema:i,it:s}=r;if(!Array.isArray(o))throw new Error("ajv implementation error");if(s.opts.discriminator&&i.discriminator)return;const a=o,c=n.let("valid",!1),l=n.let("passing",null),d=n.name("_valid");r.setParams({passing:l}),n.block(function(){a.forEach((o,i)=>{let a;(0,t.alwaysValidSchema)(s,o)?n.var(d,!0):a=r.subschema({keyword:"oneOf",schemaProp:i,compositeRule:!0},d),i>0&&n.if(e._`${d} && ${c}`).assign(c,!1).assign(l,e._`[${l}, ${i}]`).else(),n.if(d,()=>{n.assign(c,!0),n.assign(l,i),a&&r.mergeEvaluated(a,e.Name)})})}),r.result(c,()=>r.reset(),()=>r.error(!0))}};return qo.default=r,qo}(),f=function(){if(Ko)return Wo;Ko=1,Object.defineProperty(Wo,"__esModule",{value:!0});const e=br(),t={keyword:"allOf",schemaType:"array",code(t){const{gen:r,schema:n,it:o}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");const i=r.name("valid");n.forEach((r,n)=>{if((0,e.alwaysValidSchema)(o,r))return;const s=t.subschema({keyword:"allOf",schemaProp:n},i);t.ok(i),t.mergeEvaluated(s)})}};return Wo.default=t,Wo}(),h=function(){if(Yo)return Jo;Yo=1,Object.defineProperty(Jo,"__esModule",{value:!0});const e=gr(),t=br(),r={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:t})=>e.str`must match "${t.ifClause}" schema`,params:({params:t})=>e._`{failingKeyword: ${t.ifClause}}`},code(r){const{gen:o,parentSchema:i,it:s}=r;void 0===i.then&&void 0===i.else&&(0,t.checkStrictMode)(s,'"if" without "then" and "else" is ignored');const a=n(s,"then"),c=n(s,"else");if(!a&&!c)return;const l=o.let("valid",!0),d=o.name("_valid");if(function(){const e=r.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},d);r.mergeEvaluated(e)}(),r.reset(),a&&c){const e=o.let("ifClause");r.setParams({ifClause:e}),o.if(d,u("then",e),u("else",e))}else a?o.if(d,u("then")):o.if((0,e.not)(d),u("else"));function u(t,n){return()=>{const i=r.subschema({keyword:t},d);o.assign(l,d),r.mergeValidEvaluated(i,l),n?o.assign(n,e._`${t}`):r.setParams({ifClause:t})}}r.pass(l,()=>r.error(!0))}};function n(e,r){const n=e.schema[r];return void 0!==n&&!(0,t.alwaysValidSchema)(e,n)}return Jo.default=r,Jo}(),m=function(){if(Xo)return Qo;Xo=1,Object.defineProperty(Qo,"__esModule",{value:!0});const e=br(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:r,it:n}){void 0===r.if&&(0,e.checkStrictMode)(n,`"${t}" without "if" is ignored`)}};return Qo.default=t,Qo}();return go.default=function(g=!1){const y=[d.default,u.default,p.default,f.default,h.default,m.default,s.default,a.default,i.default,c.default,l.default];return g?y.push(t.default,n.default):y.push(e.default,r.default),y.push(o.default),y},go}var ti,ri={},ni={};function oi(){if(ti)return ni;ti=1,Object.defineProperty(ni,"__esModule",{value:!0}),ni.dynamicAnchor=void 0;const e=gr(),t=Pr(),r=un(),n=xn(),o={keyword:"$dynamicAnchor",schemaType:"string",code:e=>i(e,e.schema)};function i(o,i){const{gen:s,it:a}=o;a.schemaEnv.root.dynamicAnchors[i]=!0;const c=e._`${t.default.dynamicAnchors}${(0,e.getProperty)(i)}`,l="#"===a.errSchemaPath?a.validateName:function(e){const{schemaEnv:t,schema:o,self:i}=e.it,{root:s,baseId:a,localRefs:c,meta:l}=t.root,{schemaId:d}=i.opts,u=new r.SchemaEnv({schema:o,schemaId:d,root:s,baseId:a,localRefs:c,meta:l});return r.compileSchema.call(i,u),(0,n.getValidate)(e,u)}(o);s.if(e._`!${c}`,()=>s.assign(c,l))}return ni.dynamicAnchor=i,ni.default=o,ni}var ii,si={};function ai(){if(ii)return si;ii=1,Object.defineProperty(si,"__esModule",{value:!0}),si.dynamicRef=void 0;const e=gr(),t=Pr(),r=xn(),n={keyword:"$dynamicRef",schemaType:"string",code:e=>o(e,e.schema)};function o(n,o){const{gen:i,keyword:s,it:a}=n;if("#"!==o[0])throw new Error(`"${s}" only supports hash fragment reference`);const c=o.slice(1);if(a.allErrors)l();else{const e=i.let("valid",!1);l(e),n.ok(e)}function l(r){if(a.schemaEnv.root.dynamicAnchors[c]){const n=i.let("_v",e._`${t.default.dynamicAnchors}${(0,e.getProperty)(c)}`);i.if(n,d(n,r),d(a.validateName,r))}else d(a.validateName,r)()}function d(e,t){return t?()=>i.block(()=>{(0,r.callRef)(n,e),i.let(t,!0)}):()=>(0,r.callRef)(n,e)}}return si.dynamicRef=o,si.default=n,si}var ci,li={};var di,ui,pi={};function fi(){if(ui)return ri;ui=1,Object.defineProperty(ri,"__esModule",{value:!0});const e=oi(),t=ai(),r=function(){if(ci)return li;ci=1,Object.defineProperty(li,"__esModule",{value:!0});const e=oi(),t=br(),r={keyword:"$recursiveAnchor",schemaType:"boolean",code(r){r.schema?(0,e.dynamicAnchor)(r,""):(0,t.checkStrictMode)(r.it,"$recursiveAnchor: false is ignored")}};return li.default=r,li}(),n=function(){if(di)return pi;di=1,Object.defineProperty(pi,"__esModule",{value:!0});const e=ai(),t={keyword:"$recursiveRef",schemaType:"string",code:t=>(0,e.dynamicRef)(t,t.schema)};return pi.default=t,pi}(),o=[e.default,t.default,r.default,n.default];return ri.default=o,ri}var hi,mi={},gi={};var yi,vi={};var bi,$i,wi={};function Ei(){if($i)return mi;$i=1,Object.defineProperty(mi,"__esModule",{value:!0});const e=function(){if(hi)return gi;hi=1,Object.defineProperty(gi,"__esModule",{value:!0});const e=ko(),t={keyword:"dependentRequired",type:"object",schemaType:"object",error:e.error,code:t=>(0,e.validatePropertyDeps)(t)};return gi.default=t,gi}(),t=function(){if(yi)return vi;yi=1,Object.defineProperty(vi,"__esModule",{value:!0});const e=ko(),t={keyword:"dependentSchemas",type:"object",schemaType:"object",code:t=>(0,e.validateSchemaDeps)(t)};return vi.default=t,vi}(),r=function(){if(bi)return wi;bi=1,Object.defineProperty(wi,"__esModule",{value:!0});const e=br(),t={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:t,parentSchema:r,it:n}){void 0===r.contains&&(0,e.checkStrictMode)(n,`"${t}" without "contains" is ignored`)}};return wi.default=t,wi}(),n=[e.default,t.default,r.default];return mi.default=n,mi}var Si,Pi={},_i={};function Li(){if(Si)return _i;Si=1,Object.defineProperty(_i,"__esModule",{value:!0});const e=gr(),t=br(),r=Pr(),n={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:t})=>e._`{unevaluatedProperty: ${t.unevaluatedProperty}}`},code(n){const{gen:o,schema:i,data:s,errsCount:a,it:c}=n;if(!a)throw new Error("ajv implementation error");const{allErrors:l,props:d}=c;function u(r){if(!1===i)return n.setParams({unevaluatedProperty:r}),n.error(),void(l||o.break());if(!(0,t.alwaysValidSchema)(c,i)){const i=o.name("valid");n.subschema({keyword:"unevaluatedProperties",dataProp:r,dataPropType:t.Type.Str},i),l||o.if((0,e.not)(i),()=>o.break())}}d instanceof e.Name?o.if(e._`${d} !== true`,()=>o.forIn("key",s,t=>o.if(function(t,r){return e._`!${t} || !${t}[${r}]`}(d,t),()=>u(t)))):!0!==d&&o.forIn("key",s,t=>void 0===d?u(t):o.if(function(t,r){const n=[];for(const o in t)!0===t[o]&&n.push(e._`${r} !== ${o}`);return(0,e.and)(...n)}(d,t),()=>u(t))),c.props=!0,n.ok(e._`${a} === ${r.default.errors}`)}};return _i.default=n,_i}var Ci,Ni,Ii={};function Oi(){if(Ci)return Ii;Ci=1,Object.defineProperty(Ii,"__esModule",{value:!0});const e=gr(),t=br(),r={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:t}})=>e.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>e._`{limit: ${t}}`},code(r){const{gen:n,schema:o,data:i,it:s}=r,a=s.items||0;if(!0===a)return;const c=n.const("len",e._`${i}.length`);if(!1===o)r.setParams({len:a}),r.fail(e._`${c} > ${a}`);else if("object"==typeof o&&!(0,t.alwaysValidSchema)(s,o)){const o=n.var("valid",e._`${c} <= ${a}`);n.if((0,e.not)(o),()=>function(o,i){n.forRange("i",i,c,i=>{r.subschema({keyword:"unevaluatedItems",dataProp:i,dataPropType:t.Type.Num},o),s.allErrors||n.if((0,e.not)(o),()=>n.break())})}(o,a)),r.ok(o)}s.items=!0}};return Ii.default=r,Ii}var ki,Ai,Ti={},xi={};function Di(){if(ki)return xi;ki=1,Object.defineProperty(xi,"__esModule",{value:!0});const e=gr(),t={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:t})=>e.str`must match format "${t}"`,params:({schemaCode:t})=>e._`{format: ${t}}`},code(t,r){const{gen:n,data:o,$data:i,schema:s,schemaCode:a,it:c}=t,{opts:l,errSchemaPath:d,schemaEnv:u,self:p}=c;l.validateFormats&&(i?function(){const i=n.scopeValue("formats",{ref:p.formats,code:l.code.formats}),s=n.const("fDef",e._`${i}[${a}]`),c=n.let("fType"),d=n.let("format");n.if(e._`typeof ${s} == "object" && !(${s} instanceof RegExp)`,()=>n.assign(c,e._`${s}.type || "string"`).assign(d,e._`${s}.validate`),()=>n.assign(c,e._`"string"`).assign(d,s)),t.fail$data((0,e.or)(!1===l.strictSchema?e.nil:e._`${a} && !${d}`,function(){const t=u.$async?e._`(${s}.async ? await ${d}(${o}) : ${d}(${o}))`:e._`${d}(${o})`,n=e._`(typeof ${d} == "function" ? ${t} : ${d}.test(${o}))`;return e._`${d} && ${d} !== true && ${c} === ${r} && !${n}`}()))}():function(){const i=p.formats[s];if(!i)return void function(){if(!1===l.strictSchema)return void p.logger.warn(e());throw new Error(e());function e(){return`unknown format "${s}" ignored in schema at path "${d}"`}}();if(!0===i)return;const[a,c,f]=function(t){const r=t instanceof RegExp?(0,e.regexpCode)(t):l.code.formats?e._`${l.code.formats}${(0,e.getProperty)(s)}`:void 0,o=n.scopeValue("formats",{key:s,ref:t,code:r});if("object"==typeof t&&!(t instanceof RegExp))return[t.type||"string",t.validate,e._`${o}.validate`];return["string",t,o]}(i);a===r&&t.pass(function(){if("object"==typeof i&&!(i instanceof RegExp)&&i.async){if(!u.$async)throw new Error("async format in sync schema");return e._`await ${f}(${o})`}return"function"==typeof c?e._`${f}(${o})`:e._`${f}.test(${o})`}())}())}};return xi.default=t,xi}var ji,Ri,Fi={};function Mi(){if(Ri)return Nn;Ri=1,Object.defineProperty(Nn,"__esModule",{value:!0});const e=Dn(),t=ho(),r=ei(),n=fi(),o=Ei(),i=function(){if(Ni)return Pi;Ni=1,Object.defineProperty(Pi,"__esModule",{value:!0});const e=Li(),t=Oi(),r=[e.default,t.default];return Pi.default=r,Pi}(),s=function(){if(Ai)return Ti;Ai=1,Object.defineProperty(Ti,"__esModule",{value:!0});const e=[Di().default];return Ti.default=e,Ti}(),a=(ji||(ji=1,Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.contentVocabulary=Fi.metadataVocabulary=void 0,Fi.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Fi.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Fi),c=[n.default,e.default,t.default,(0,r.default)(!0),s.default,a.metadataVocabulary,a.contentVocabulary,o.default,i.default];return Nn.default=c,Nn}var Gi,Ui,Bi={},zi={};function Vi(){if(Ui)return Bi;Ui=1,Object.defineProperty(Bi,"__esModule",{value:!0});const e=gr(),t=(Gi||(Gi=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(r||(zi.DiscrError=r={}))),zi);var r;const n=un(),o=cn(),i=br(),s={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:r}})=>e===t.DiscrError.Tag?`tag "${r}" must be string`:`value of tag "${r}" must be in oneOf`,params:({params:{discrError:t,tag:r,tagName:n}})=>e._`{error: ${t}, tag: ${n}, tagValue: ${r}}`},code(r){const{gen:s,data:a,schema:c,parentSchema:l,it:d}=r,{oneOf:u}=l;if(!d.opts.discriminator)throw new Error("discriminator: requires discriminator option");const p=c.propertyName;if("string"!=typeof p)throw new Error("discriminator: requires propertyName");if(c.mapping)throw new Error("discriminator: mapping is not supported");if(!u)throw new Error("discriminator: requires oneOf keyword");const f=s.let("valid",!1),h=s.const("tag",e._`${a}${(0,e.getProperty)(p)}`);function m(t){const n=s.name("valid"),o=r.subschema({keyword:"oneOf",schemaProp:t},n);return r.mergeEvaluated(o,e.Name),n}s.if(e._`typeof ${h} == "string"`,()=>function(){const a=function(){var e;const t={},r=a(l);let s=!0;for(let t=0;t<u.length;t++){let l=u[t];if((null==l?void 0:l.$ref)&&!(0,i.schemaHasRulesButRef)(l,d.self.RULES)){const e=l.$ref;if(l=n.resolveRef.call(d.self,d.schemaEnv.root,d.baseId,e),l instanceof n.SchemaEnv&&(l=l.schema),void 0===l)throw new o.default(d.opts.uriResolver,d.baseId,e)}const f=null===(e=null==l?void 0:l.properties)||void 0===e?void 0:e[p];if("object"!=typeof f)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${p}"`);s=s&&(r||a(l)),c(f,t)}if(!s)throw new Error(`discriminator: "${p}" must be required`);return t;function a({required:e}){return Array.isArray(e)&&e.includes(p)}function c(e,t){if(e.const)f(e.const,t);else{if(!e.enum)throw new Error(`discriminator: "properties/${p}" must have "const" or "enum"`);for(const r of e.enum)f(r,t)}}function f(e,r){if("string"!=typeof e||e in t)throw new Error(`discriminator: "${p}" values must be unique strings`);t[e]=r}}();s.if(!1);for(const t in a)s.elseIf(e._`${h} === ${t}`),s.assign(f,m(a[t]));s.else(),r.error(!1,{discrError:t.DiscrError.Mapping,tag:h,tagName:p}),s.endIf()}(),()=>r.error(!1,{discrError:t.DiscrError.Tag,tag:h,tagName:p})),r.ok(f)}};return Bi.default=s,Bi}var Hi,qi,Ki={},Wi={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"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,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{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:{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}}},Yi={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#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/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}},Ji={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}},Xi={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}},Zi={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$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:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}},Qi={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}},es={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}},ts={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}};var rs=(qi||(qi=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2020=void 0;const r=Ln(),n=Mi(),o=Vi(),i=function(){if(Hi)return Ki;Hi=1,Object.defineProperty(Ki,"__esModule",{value:!0});const e=Wi,t=Yi,r=Ji,n=Xi,o=Zi,i=Qi,s=es,a=ts,c=["/properties"];return Ki.default=function(l){return[e,t,r,n,o,d(this,i),s,d(this,a)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function d(e,t){return l?e.$dataMetaSchema(t,c):t}},Ki}(),s="https://json-schema.org/draft/2020-12/schema";class a extends r.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),n.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:e,meta:t}=this.opts;t&&(i.default.call(this,e),this.refs["http://json-schema.org/schema"]=s)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}t.Ajv2020=a,e.exports=t=a,e.exports.Ajv2020=a,Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var c=tn();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var l=gr();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return l._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}});var d=on();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var u=cn();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return u.default}})}(or,or.exports)),or.exports),ns=ze(rs);const os=V.object({templateEntry:V.string({required_error:"templateEntry is required in build section",invalid_type_error:"templateEntry must be a string"}).describe("Main entry point for the portal"),schemaEntry:V.string({required_error:"schemaEntry is required in build section",invalid_type_error:"schemaEntry must be a string"}).describe("Schema file for portal validation"),assetPath:V.string({invalid_type_error:"assetPath must be a string"}).optional().describe("Asset path for dev/preview builds"),githubRepo:V.string({invalid_type_error:"githubRepo must be a string"}).optional().describe("GitHub repo URL or local git remote"),version:V.string({required_error:"version is required in build section",invalid_type_error:"version must be a string"}).describe("Version from package.json"),timestamp:V.string({required_error:"timestamp is required in build section",invalid_type_error:"timestamp must be a string"}).describe("Current build timestamp (ISO8601)"),commitSha:V.string({required_error:"commitSha is required in build section",invalid_type_error:"commitSha must be a string"}).describe("Current git commit SHA"),annotations:V.record(V.string(),{invalid_type_error:"annotations must be a record of string values"}).optional().describe("Optional build annotations"),projectPage:V.string({invalid_type_error:"projectPage must be a string"}).optional().describe("Optional project homepage"),allowedExtensions:V.array(V.string({invalid_type_error:"Each allowed extension must be a string"}),{required_error:"allowedExtensions is required in build section",invalid_type_error:"allowedExtensions must be an array of strings"}).describe("List of allowed asset extensions (with leading dot)"),schema:V.record(V.unknown(),{invalid_type_error:"schema must be a record of unknown values"}).optional().describe("Optional schema for the portal"),config:V.record(V.unknown(),{invalid_type_error:"config must be a record of unknown values"}).optional().describe("Optional configuration for the portal")});V.object({name:V.string({required_error:"name is required in portal manifest",invalid_type_error:"name must be a string"}).describe("Short app key (unscoped, derived from package name)"),displayName:V.string({invalid_type_error:"displayName must be a string"}).optional().describe("Full package name, may include scope"),description:V.string({invalid_type_error:"description must be a string"}).optional().describe("Description of the portal"),build:os});const is=e("schema").description("Generate or validate a Fusion portal schema file.").addHelpText("after",["","Examples:"," $ ffc portal schema"," $ ffc portal schema --output portal.schema.json"," $ ffc portal schema --validate my-config.json"].join("\n")).addOption(be({allowDev:!0})).option("-o, --output <string>","Output file name (default: stdout)","stdout").option("-d, --debug","Enable debug mode for verbose logging",!1).option("-v, --validate <file>","Validate the generated schema against a JSON file").argument("[schema]","Schema build file to use (e.g., portal.schema[.env]?.[ts,js,json])").action(async(e,t)=>{const r=new l("portal:schema",{debug:t.debug});r.debug("Manifest file:",e),r.debug("Current working directory:",process.cwd()),r.start("Generating schema for the application...");const n=await(async(e,t)=>{const r=[`portal.schema.${e.environment}`,"portal.schema"],n=await B(r,{baseDir:e.root,extensions:t?.extensions,script:{resolve:async t=>{const r="function"==typeof t.default?await Promise.resolve(t.default(e)):t.default;if(!r)throw new Error("Schema function did not return a valid schema");return r}}});return{schema:n.config,path:n.path,extension:n.extension}})({command:"build",environment:t.environment,mode:"build",root:process.cwd()});if(r.debug("Schema:",JSON.stringify(n,null,2)),r.succeed("Schema generated successfully!"),t.output&&("stdout"===t.output?r.info("Schema:",JSON.stringify(n.schema,null,2)):(r.start(`Writing schema to ${t.output}`),((e,t,r)=>{const n=a(String(e));j(n)||R(n,{recursive:!0}),F(e,t,r)})(t.output,JSON.stringify(n.schema,null,2)),r.succeed(`Schema written to ${t.output}`)),process.exit(0)),t.validate){r.start("Validating schema against JSON file...");const e=new ns({strict:!0}).compile(n.schema),o=await z(t.validate);r.debug("JSON value:",JSON.stringify(o,null,2));e(o)?r.succeed("Schema validation passed!"):(r.fail("Schema validation failed:",JSON.stringify(e.errors??"Unknown error")),process.exit(1))}}),ss=e("build").description("Build the Fusion portal from a manifest file with environment-specific settings.").addHelpText("after",["","If no manifest is provided, the command will search for a default portal.manifest.[ts|js|json] in the current directory.","example: `ffc portal build --env prod` will search for `portal.manifest.prod.ts` then fallback to `portal.manifest.ts`","","NOTE: portal manifest is not required, a default manifest will be generated if not provided","","Examples:"," $ ffc portal build"," $ ffc portal build portal.manifest.prod.ts --debug",""].join("\n")).option("-d, --debug","Enable debug mode for verbose logging",!1).argument("[manifest]","Manifest build file to use for building (e.g., portal.manifest[.env]?.[ts|js|json])").action(async(e,t)=>{const r=new l("portal:build",{debug:t.debug});await _({log:r,manifest:e})}),as=e("pack").description("Bundle the Fusion portal into a deployable archive.").addHelpText("after",["","If no manifest is provided, a default portal.manifest(.$ENV)?.[ts|js|json] is used from the current directory.","example: `ffc portal pack --env prod` will search for `portal.manifest.prod.ts` then fallback to `portal.manifest.ts`","","NOTE: portal manifest is not required, a default manifest will be generated if not provided","","Examples:"," $ ffc portal pack"," $ ffc portal pack portal.manifest.dev.ts --archive my-portal.zip --output ./dist"].join("\n")).option("-a, --archive [string]","Name of the output archive file (default: out/bundle.zip)","out/bundle.zip").option("-d, --debug [boolean]","Enable debug mode for verbose logging",!1).option("--schema [string]","Schema file to use for validation").argument("[manifest]","Manifest file to use for bundling (e.g., my-portal.manifest.ts)").action(async(e,t)=>{const r=new l("portal:pack",{debug:t.debug});await L({log:r,manifest:e,archive:t.archive,schema:t.schema}).catch(e=>{r.error("Failed to create package:",e),process.exit(1)})}),cs=_e(e("upload").description("Upload a Fusion portal bundle to the portal registry.").addHelpText("after",["","Uploads a distributable portal bundle (e.g., portal-bundle.zip) to the Fusion portal registry.","","Examples:"," $ ffc portal upload"," $ ffc portal upload my-portal-bundle.zip --name my-portal"," $ ffc portal upload --debug"].join("\n")).option("-d, --debug [boolean]","Enable debug mode for verbose logging",!1).addOption(be({allowDev:!1})).argument("<bundle>","Portal bundle to upload (e.g., out/bundle.zip)").action(async(e,t)=>{const r=new l("portal:upload",{debug:t.debug});r?.start("Initializing Fusion Framework...");const n=await m({env:t.env,auth:{token:t.token,tenantId:t.tenantId,clientId:t.clientId}});r?.succeed("Initialized Fusion Framework"),await C({log:r,framework:n,fileOrBundle:e}).catch(e=>{r.error("Failed to upload bundle:",e),process.exit(1)})}));const ls=_e(e("tag").description("Tag your uploaded Fusion Portal build version with a specific tag.").addHelpText("after",["","Note: using --package is preferred over --manifest, since no infered compilation is required.","","Examples:"," $ ffc portal tag latest"," $ ffc portal tag latest --package my-portal@1.2.3 --env prod"," $ ffc portal tag preview --manifest ./portal.manifest.ts"].join("\n")).addOption(be({allowDev:!1})).option("-m, --manifest <string>","Manifest file to use. Note: ignoring if --package is provided").option("-p, --package [package@version]","Package to tag in format name@version (e.g., my-portal@1.0.0). If not provided, loaded from manifest").option("-d, --debug","Enable debug mode for verbose logging").option("--silent","Silent mode, suppresses output except errors").argument("<tag>","Tag to apply (latest | preview)").action(async(e,t)=>{const r=t.silent?null:new l("app:tag",{debug:t.debug}),n={command:"build",environment:t.env,mode:process.env.NODE_ENV??"production",root:process.cwd()},o=await async function(e,t){if(e.package){const[t,r]=e.package.split("@");if(!t||!r)throw new Error("Package must be in format name@version (e.g., my-portal@1.0.0). Please verify the package name and version with --package");return{name:t,version:r}}const{manifest:r}=await P({manifest:e.manifest,env:t}),n=r.build?.version;if(!n)throw new Error(`Could not determine version from manifest. Please verify manifest ${e.manifest} or provide a package name and version with --package`);return{name:r.name,version:n}}(t,n).catch(e=>{r?.error(`😢 ${e instanceof Error?e.message:"Unknown error occurred"}`),r?.debug(e),process.exit(1)});r?.info("Tagging portal:",me.greenBright(`${o.name}@${o.version} - ${e}`)),r?.start("Initializing Fusion Framework...");const i=await m({env:t.env,auth:{token:t.token,tenantId:t.tenantId,clientId:t.clientId}});r?.succeed("Initialized Fusion Framework"),N({tag:e,name:o.name,version:o.version,framework:i,log:r}).catch(e=>{r?.error("😢 Failed to tag application:",e),process.exit(1)})})),ds=_e(e("publish").description("Build, upload, and tag your Fusion portal bundle for deployment.").addHelpText("after",["","If no manifest is provided, a default portal.manifest(.$ENV)?.[ts|js|json] is used from the current directory.","example: `ffc portal publish --env prod` will search for `portal.manifest.prod.ts` then fallback to `portal.manifest.ts`","","NOTE: portal manifest is not required, a default manifest will be generated if not provided","","Examples:"," $ ffc portal publish"," $ ffc portal publish --env prod --manifest portal.manifest.prod.ts"," $ ffc portal publish --tag latest portal.bundle.zip"].join("\n")).option("-d, --debug","Enable debug mode for verbose logging",!1).addOption(be({allowDev:!1})).option("-m, --manifest [string]","Manifest file to use for bundling (e.g., my-portal.manifest.ts)").option("--schema [string]","Schema file to use for validation").option("-t, --tag [string]",`Tag to apply to the published portal (${Object.values(I).join(" | ")})`,I.Latest).action(async e=>{const t=new l("portal:publish",{debug:e.debug});t?.info("Using environment:",me.redBright(e.env)),t.start("📦 Bundling Portal Template...");const r=await L({log:t,manifest:e.manifest,schema:e.schema}).catch(e=>{t.error("😢 Failed to create bundle:",e),process.exit(1)});t.succeed("📦 Bundling completed"),t?.start("💾 Initializing Fusion Framework...");const n=await m({env:e.env,auth:{token:e.token,tenantId:e.tenantId,clientId:e.clientId}});t?.succeed("💾 Initialized Fusion Framework"),t.start("🚀 Uploading Portal Template..."),await C({log:t,framework:n,fileOrBundle:r.archive}).catch(e=>{t.error("😢 Failed to upload bundle:",e),process.exit(1)}),t.succeed("🚀 Upload completed"),t.start("🏷️ Tagging Portal Template..."),await N({tag:e.tag,name:r.manifest.name,version:r.manifest.build.version,framework:n,log:t}).catch(e=>{t.error("😢 Failed to tag Portal Template:",e),process.exit(1)}),t.succeed("🏷️ Tagging completed")})),us=_e(e("config").description("Generate or publish the Fusion portal configuration file.").addHelpText("after",["","By default, outputs the generated config object to stdout or a file. Use --publish to upload the config to the Fusion portal registry.","- Options [--token, --tenantId, --clientId, --manifest] are only relevant when --publish is used.",'- Option [-e, --env] cannot be set to "dev" when --publish is used.',"","Note:","- If not `portal.config(.$ENV)?.[ts|js|json]` is found it will fallback to generate a default config (empty object)","- If not `portal.manifest(.$ENV)?.[ts|js|json]` is found it will fallback to generate a default manifest","","Examples:"," $ ffc portal config app.config.ts"," $ ffc portal config portal.config.prod.ts --output ./dist/portal.config.json"," $ ffc portal config portal.manifest.prod.ts --silent > ./dist/portal.config.json"," $ ffc portal config --publish --manifest portal.manifest.ts --env prod"," $ ffc portal config --env prod my-custom.config.ts"].join("\n")).option("--debug","Enable debug mode for verbose logging").option("--silent","Silent mode, suppresses output except errors").option("--publish <name@version>","Publish config to Fusion portal registry, Identifier of the portal, example my-portal@1.2.3").addOption(be({allowDev:!0})).option("-o, --output <stdout|path>","Output the result to stdout or a file (ignored with --publish, default: stdout)","stdout").argument("[config]","Path to the portal config file (e.g., portal.config[.env]?.[ts,js,json])").action(async(e,t)=>{const r=t.silent?null:new l("portal:config",{debug:!!t.debug});if(t.publish){const[e,n]=t.publish.split("@")||[];return e&&n||(r?.fail("🤪","Portal identifier is required when using",me.blue("--publish")),r?.info("Example: fusion-framework-cli portal config --publish my-portal@1.2.3"),process.exit(1)),"dev"===t.env&&(r?.fail("🤪",me.blue("--env"),'cannot be "dev" when',me.blue("--publish")," is used"),process.exit(1)),O({config:t.config,portal:{name:e,version:n},environment:t.env,auth:"token"in t?{token:t.token}:t,debug:t.debug})}const{config:n}=await k({log:r,config:e,env:{environment:t.env},output:"stdout"===t.output?void 0:t.output});"stdout"===t.output&&console.log(JSON.stringify(n,null,2))})),ps=e("portal").description("Develop and deploy portal templates").addCommand(Be).addCommand(rr).addCommand(is).addCommand(ss).addCommand(as).addCommand(cs).addCommand(ls).addCommand(ds).addCommand(us);const[fs]=process.versions.node.split(".").map(Number);fs<Number(20)&&(console.error(me.red("[ERROR]"),"Fusion Framework CLI requires Node.js 20 or higher."),process.exit(1));fs!==Number(22)&&console.warn(me.yellow("[WARNING]"),"Node.js 22.x (LTS) is recommended for best compatibility. You are using Node.js",process.versions.node);const hs=c({cwd:i(import.meta.url)});if(!hs)throw Error("failed to find program root");process.env.CLI_BIN=s(a(hs.path),String(hs.packageJson.bin?.["fusion-framework-cli"]));const ms=new n;ms.name(hs.packageJson.name),ms.description([`${hs.packageJson.name}@${hs.packageJson.version}`,"","Fusion Framework CLI","","A toolkit for building, packaging, deploying, and managing Fusion applications and portals.","","• Run fusion <command> --help for details on any command.","• For documentation, issues, and source code, visit:",` ${hs.packageJson.homepage}`].join("\n")),ms.version(hs.packageJson.version,"-V, --version","CLI version"),(e=>{e.addCommand(xe),e.addCommand(Me),e.addCommand(Ue),e.addCommand(ps)})(ms),ms.parse();