@wp-playground/blueprints 0.5.4 → 0.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var hn=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var z=(t,e,r)=>(hn(t,e,"read from private field"),r?r.call(t):e.get(t)),ee=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},pe=(t,e,r,n)=>(hn(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r);var _e=(t,e,r)=>(hn(t,e,"access private method"),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});if(typeof File>"u"){class t extends Blob{constructor(r,n,s){super(r);let i;s!=null&&s.lastModified&&(i=new Date),(!i||isNaN(i.getFullYear()))&&(i=new Date),this.lastModifiedDate=i,this.lastModified=i.getMilliseconds(),this.name=n||""}}global.File=t}function pi(t){return new Promise(function(e,r){t.onload=t.onerror=function(n){t.onload=t.onerror=null,n.type==="load"?e(t.result):r(new Error("Failed to read the blob/file"))}})}typeof Blob.prototype.arrayBuffer>"u"&&(Blob.prototype.arrayBuffer=function(){const e=new FileReader;return e.readAsArrayBuffer(this),pi(e)});typeof Blob.prototype.text>"u"&&(Blob.prototype.text=function(){const e=new FileReader;return e.readAsText(this),pi(e)});function Xo(){const t=new Uint8Array([1,2,3,4]),r=new File([t],"test").stream();try{return r.getReader({mode:"byob"}),r.getReader({mode:"byob"}),!0}catch{return!1}}(typeof Blob.prototype.stream>"u"||!Xo())&&(Blob.prototype.stream=function(){let t=0;const e=this;return new ReadableStream({type:"bytes",autoAllocateChunkSize:512*1024,async pull(r){const n=r.byobRequest.view,i=await e.slice(t,t+n.byteLength).arrayBuffer(),a=new Uint8Array(i);new Uint8Array(n.buffer).set(a);const l=a.byteLength;r.byobRequest.respond(l),t+=l,t>=e.size&&r.close()}})});if(typeof CustomEvent>"u"){class t extends Event{constructor(r,n={}){super(r,n),this.detail=n.detail}initCustomEvent(){}}globalThis.CustomEvent=t}const On=["db.php","plugins/akismet","plugins/hello.php","plugins/wordpress-importer","plugins/sqlite-database-integration","mu-plugins/playground-includes","mu-plugins/export-wxz.php","mu-plugins/0-playground.php","themes/twentytwenty","themes/twentytwentyone","themes/twentytwentytwo","themes/twentytwentythree","themes/twentytwentyfour","themes/twentytwentyfive","themes/twentytwentysix"],Cn=async(t,{pluginPath:e,pluginName:r},n)=>{n==null||n.tracker.setCaption(`Activating ${r||e}`);const s=[`${await t.documentRoot}/wp-load.php`,`${await t.documentRoot}/wp-admin/includes/plugin.php`];if(!s.every(l=>t.fileExists(l)))throw new Error(`Required WordPress files do not exist: ${s.join(", ")}`);if((await t.run({code:`<?php
1
+ "use strict";var fn=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var z=(t,e,r)=>(fn(t,e,"read from private field"),r?r.call(t):e.get(t)),ee=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},pe=(t,e,r,n)=>(fn(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r);var _e=(t,e,r)=>(fn(t,e,"access private method"),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});if(typeof File>"u"){class t extends Blob{constructor(r,n,s){super(r);let i;s!=null&&s.lastModified&&(i=new Date),(!i||isNaN(i.getFullYear()))&&(i=new Date),this.lastModifiedDate=i,this.lastModified=i.getMilliseconds(),this.name=n||""}}global.File=t}function pi(t){return new Promise(function(e,r){t.onload=t.onerror=function(n){t.onload=t.onerror=null,n.type==="load"?e(t.result):r(new Error("Failed to read the blob/file"))}})}typeof Blob.prototype.arrayBuffer>"u"&&(Blob.prototype.arrayBuffer=function(){const e=new FileReader;return e.readAsArrayBuffer(this),pi(e)});typeof Blob.prototype.text>"u"&&(Blob.prototype.text=function(){const e=new FileReader;return e.readAsText(this),pi(e)});function Zo(){const t=new Uint8Array([1,2,3,4]),r=new File([t],"test").stream();try{return r.getReader({mode:"byob"}),!0}catch{return!1}}(typeof Blob.prototype.stream>"u"||!Zo())&&(Blob.prototype.stream=function(){let t=0;const e=this;return new ReadableStream({type:"bytes",autoAllocateChunkSize:512*1024,async pull(r){const n=r.byobRequest.view,i=await e.slice(t,t+n.byteLength).arrayBuffer(),a=new Uint8Array(i);new Uint8Array(n.buffer).set(a);const l=a.byteLength;r.byobRequest.respond(l),t+=l,t>=e.size&&r.close()}})});if(typeof CustomEvent>"u"){class t extends Event{constructor(r,n={}){super(r,n),this.detail=n.detail}initCustomEvent(){}}globalThis.CustomEvent=t}const On=["db.php","plugins/akismet","plugins/hello.php","plugins/wordpress-importer","plugins/sqlite-database-integration","mu-plugins/playground-includes","mu-plugins/export-wxz.php","mu-plugins/0-playground.php","themes/twentytwenty","themes/twentytwentyone","themes/twentytwentytwo","themes/twentytwentythree","themes/twentytwentyfour","themes/twentytwentyfive","themes/twentytwentysix"],Nn=async(t,{pluginPath:e,pluginName:r},n)=>{n==null||n.tracker.setCaption(`Activating ${r||e}`);const s=[`${await t.documentRoot}/wp-load.php`,`${await t.documentRoot}/wp-admin/includes/plugin.php`];if(!s.every(l=>t.fileExists(l)))throw new Error(`Required WordPress files do not exist: ${s.join(", ")}`);if((await t.run({code:`<?php
2
2
  define( 'WP_ADMIN', true );
3
3
  ${s.map(l=>`require_once( '${l}' );`).join(`
4
4
  `)}
@@ -16,11 +16,11 @@ foreach ( ( glob( $plugin_path . '/*.php' ) ?: array() ) as $file ) {
16
16
  }
17
17
  }
18
18
  echo 'NO_ENTRY_FILE';
19
- `})).text.endsWith("NO_ENTRY_FILE"))throw new Error("Could not find plugin entry file.")},Nn=async(t,{themeFolderName:e},r)=>{r==null||r.tracker.setCaption(`Activating ${e}`);const n=`${await t.documentRoot}/wp-load.php`;if(!t.fileExists(n))throw new Error(`Required WordPress file does not exist: ${n}`);await t.run({code:`<?php
19
+ `})).text.endsWith("NO_ENTRY_FILE"))throw new Error("Could not find plugin entry file.")},Cn=async(t,{themeFolderName:e},r)=>{r==null||r.tracker.setCaption(`Activating ${e}`);const n=`${await t.documentRoot}/wp-load.php`;if(!t.fileExists(n))throw new Error(`Required WordPress file does not exist: ${n}`);await t.run({code:`<?php
20
20
  define( 'WP_ADMIN', true );
21
21
  require_once( '${n}' );
22
22
  switch_theme( '${e}' );
23
- `})};class jn{constructor({concurrency:e}){this._running=0,this.concurrency=e,this.queue=[]}get running(){return this._running}async acquire(){for(;;)if(this._running>=this.concurrency)await new Promise(e=>this.queue.push(e));else{this._running++;let e=!1;return()=>{e||(e=!0,this._running--,this.queue.length>0&&this.queue.shift()())}}}async run(e){const r=await this.acquire();try{return await e()}finally{r()}}}function ye(...t){let e=t.join("/");const r=e[0]==="/",n=e.substring(e.length-1)==="/";return e=fi(e),!e&&!r&&(e="."),e&&n&&(e+="/"),e}function ea(t){if(t==="/")return"/";t=fi(t);const e=t.lastIndexOf("/");return e===-1?"":e===0?"/":t.substr(0,e)}function fi(t){const e=t[0]==="/";return t=ta(t.split("/").filter(r=>!!r),!e).join("/"),(e?"/":"")+t.replace(/\/$/,"")}function ta(t,e){let r=0;for(let n=t.length-1;n>=0;n--){const s=t[n];s==="."?t.splice(n,1):s===".."?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r;r--)t.unshift("..");return t}function hr(t){return`json_decode(base64_decode('${ra(JSON.stringify(t))}'), true)`}function on(t){const e={};for(const r in t)e[r]=hr(t[r]);return e}function ra(t){return na(new TextEncoder().encode(t))}function na(t){const e=String.fromCodePoint(...t);return btoa(e)}const sa=`<?php
23
+ `})};class jn{constructor({concurrency:e}){this._running=0,this.concurrency=e,this.queue=[]}get running(){return this._running}async acquire(){for(;;)if(this._running>=this.concurrency)await new Promise(e=>this.queue.push(e));else{this._running++;let e=!1;return()=>{e||(e=!0,this._running--,this.queue.length>0&&this.queue.shift()())}}}async run(e){const r=await this.acquire();try{return await e()}finally{r()}}}function ye(...t){let e=t.join("/");const r=e[0]==="/",n=e.substring(e.length-1)==="/";return e=fi(e),!e&&!r&&(e="."),e&&n&&(e+="/"),e}function Xo(t){if(t==="/")return"/";t=fi(t);const e=t.lastIndexOf("/");return e===-1?"":e===0?"/":t.substr(0,e)}function fi(t){const e=t[0]==="/";return t=ea(t.split("/").filter(r=>!!r),!e).join("/"),(e?"/":"")+t.replace(/\/$/,"")}function ea(t,e){let r=0;for(let n=t.length-1;n>=0;n--){const s=t[n];s==="."?t.splice(n,1):s===".."?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r;r--)t.unshift("..");return t}function hr(t){return`json_decode(base64_decode('${ta(JSON.stringify(t))}'), true)`}function sn(t){const e={};for(const r in t)e[r]=hr(t[r]);return e}function ta(t){return ra(new TextEncoder().encode(t))}function ra(t){const e=String.fromCodePoint(...t);return btoa(e)}const na=`<?php
24
24
 
25
25
  /**
26
26
  * Rewrites the wp-config.php file to ensure specific constants are defined
@@ -351,12 +351,12 @@ function skip_whitespace($tokens) {
351
351
  }
352
352
  return $output;
353
353
  }
354
- `,qt=async(t,{consts:e,method:r="rewrite-wp-config"})=>{switch(r){case"define-before-run":await ia(t,e);break;case"rewrite-wp-config":{const n=await t.documentRoot,s=ye(n,"/wp-config.php"),i=await t.readFileAsText(s),a=await oa(t,i,e);await t.writeFile(s,a);break}default:throw new Error(`Invalid method: ${r}`)}};async function ia(t,e){for(const r in e)await t.defineConstant(r,e[r])}async function oa(t,e,r){await t.writeFile("/tmp/code.php",e);const n=on({consts:r});return await t.run({code:`${sa}
354
+ `,qt=async(t,{consts:e,method:r="rewrite-wp-config"})=>{switch(r){case"define-before-run":await sa(t,e);break;case"rewrite-wp-config":{const n=await t.documentRoot,s=ye(n,"/wp-config.php"),i=await t.readFileAsText(s),a=await ia(t,i,e);await t.writeFile(s,a);break}default:throw new Error(`Invalid method: ${r}`)}};async function sa(t,e){for(const r in e)await t.defineConstant(r,e[r])}async function ia(t,e,r){await t.writeFile("/tmp/code.php",e);const n=sn({consts:r});return await t.run({code:`${na}
355
355
  $wp_config_path = '/tmp/code.php';
356
356
  $wp_config = file_get_contents($wp_config_path);
357
357
  $new_wp_config = rewrite_wp_config_to_define_constants($wp_config, ${n.consts});
358
358
  file_put_contents($wp_config_path, $new_wp_config);
359
- `}),await t.readFileAsText("/tmp/code.php")}const aa=`<?php
359
+ `}),await t.readFileAsText("/tmp/code.php")}const oa=`<?php
360
360
 
361
361
  /**
362
362
  * This transport delegates PHP HTTP requests to JavaScript synchronous XHR.
@@ -501,7 +501,7 @@ if (class_exists('\\WpOrg\\Requests\\Requests')) {
501
501
 
502
502
  }
503
503
  }
504
- `,ca=`<?php
504
+ `,aa=`<?php
505
505
 
506
506
  /**
507
507
  * This transport does not perform any HTTP requests and only exists
@@ -556,7 +556,7 @@ if (class_exists('\\WpOrg\\Requests\\Requests')) {
556
556
 
557
557
  }
558
558
  }
559
- `,la=`<?php
559
+ `,ca=`<?php
560
560
  /**
561
561
  * Add a notice to wp-login.php offering the username and password.
562
562
  */
@@ -583,7 +583,7 @@ add_filter('plugins_api_result', function ($res) {
583
583
  if ($res instanceof WP_Error) {
584
584
  $res = new WP_Error(
585
585
  'plugins_api_failed',
586
- 'Enable networking support in Playground settings to access the Plugins directory. Network access is an <a href="https://github.com/WordPress/wordpress-playground/issues/85">experimental, opt-in feature</a>. If you don\\'t want to use it, you can still upload plugins or install them using the <a href="https://wordpress.github.io/wordpress-playground/query-api">Query API</a> (e.g. ?plugin=coblocks).'
586
+ 'Enable networking support in Playground settings to access the Plugins directory. Network access is an <a href="https://github.com/WordPress/wordpress-playground/issues/85" target="_blank">experimental, opt-in feature</a>. If you don\\'t want to use it, you can still upload plugins or install them using the <a href="https://wordpress.github.io/wordpress-playground/query-api">Query API</a> (e.g. ?plugin=coblocks).'
587
587
  );
588
588
  }
589
589
  return $res;
@@ -600,7 +600,7 @@ add_filter('gettext', function ($translation) {
600
600
  }
601
601
 
602
602
  if ($translation === 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.') {
603
- return 'Enable networking support in Playground settings to access the Themes directory. Network access is an <a href="https://github.com/WordPress/wordpress-playground/issues/85">experimental, opt-in feature</a>. If you don\\'t want to use it, you can still upload themes or install them using the <a href="https://wordpress.github.io/wordpress-playground/query-api">Query API</a> (e.g. ?theme=pendant).';
603
+ return 'Enable networking support in Playground settings to access the Themes directory. Network access is an <a href="https://github.com/WordPress/wordpress-playground/issues/85" target="_blank">experimental, opt-in feature</a>. If you don\\'t want to use it, you can still upload themes or install them using the <a href="https://wordpress.github.io/wordpress-playground/query-api">Query API</a> (e.g. ?theme=pendant).';
604
604
  }
605
605
  return $translation;
606
606
  });
@@ -678,51 +678,7 @@ if (defined('USE_FETCH_FOR_REQUESTS') && USE_FETCH_FOR_REQUESTS) {
678
678
  require(__DIR__ . '/playground-includes/requests_transport_dummy.php');
679
679
  $__requests_class::add_transport('Requests_Transport_Dummy');
680
680
  }
681
- `;async function Ir(t,e,r){let n="";await t.fileExists(e)&&(n=await t.readFileAsText(e)),await t.writeFile(e,r(n))}const hi=async(t,e)=>{const r=new ua(t,e.wordpressPath||"/wordpress",e.siteUrl);e.addPhpInfo===!0&&await r.addPhpInfo(),e.siteUrl&&await r.patchSiteUrl(),e.patchSecrets===!0&&await r.patchSecrets(),e.disableSiteHealth===!0&&await r.disableSiteHealth(),e.disableWpNewBlogNotification===!0&&await r.disableWpNewBlogNotification(),e.makeEditorFrameControlled===!0&&await mi(t,r.wordpressPath,[`${r.wordpressPath}/wp-includes/js/dist/block-editor.js`,`${r.wordpressPath}/wp-includes/js/dist/block-editor.min.js`]),e.prepareForRunningInsideWebBrowser===!0&&await r.prepareForRunningInsideWebBrowser(),e.addFetchNetworkTransport===!0&&await r.addFetchNetworkTransport()};class ua{constructor(e,r,n){this.php=e,this.scopedSiteUrl=n,this.wordpressPath=r}async addPhpInfo(){await this.php.writeFile(`${this.wordpressPath}/phpinfo.php`,"<?php phpinfo(); ")}async patchSiteUrl(){await qt(this.php,{consts:{WP_HOME:this.scopedSiteUrl,WP_SITEURL:this.scopedSiteUrl}})}async patchSecrets(){await qt(this.php,{consts:{AUTH_KEY:et(40),SECURE_AUTH_KEY:et(40),LOGGED_IN_KEY:et(40),NONCE_KEY:et(40),AUTH_SALT:et(40),SECURE_AUTH_SALT:et(40),LOGGED_IN_SALT:et(40),NONCE_SALT:et(40)}})}async disableSiteHealth(){await Ir(this.php,`${this.wordpressPath}/wp-includes/default-filters.php`,e=>e.replace(/add_filter[^;]+wp_maybe_grant_site_health_caps[^;]+;/i,""))}async disableWpNewBlogNotification(){await Ir(this.php,`${this.wordpressPath}/wp-config.php`,e=>`${e} function wp_new_blog_notification(...$args){} `)}async prepareForRunningInsideWebBrowser(){await this.php.mkdir(`${this.wordpressPath}/wp-content/mu-plugins`),await this.php.writeFile(`${this.wordpressPath}/wp-content/mu-plugins/0-playground.php`,la),await this.php.mkdir(`${this.wordpressPath}/wp-content/mu-plugins/playground-includes`),await this.php.writeFile(`${this.wordpressPath}/wp-content/mu-plugins/playground-includes/requests_transport_dummy.php`,ca)}async addFetchNetworkTransport(){await qt(this.php,{consts:{USE_FETCH_FOR_REQUESTS:!0}});const e=[`${this.wordpressPath}/wp-includes/Requests/Transport/fsockopen.php`,`${this.wordpressPath}/wp-includes/Requests/Transport/cURL.php`,`${this.wordpressPath}/wp-includes/Requests/src/Transport/Fsockopen.php`,`${this.wordpressPath}/wp-includes/Requests/src/Transport/Curl.php`];for(const r of e)await this.php.fileExists(r)&&await Ir(this.php,r,n=>n.includes("public static function test2")?n:n.replace("public static function test","public static function test( $capabilities = array() ) { return false; } public static function test2"));await this.php.writeFile(`${this.wordpressPath}/wp-content/mu-plugins/playground-includes/wp_http_fetch.php`,aa),await this.php.mkdir(`${this.wordpressPath}/wp-content/fonts`)}}function et(t){const e="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()_+=-[]/.,<>?";let r="";for(let n=t;n>0;--n)r+=e[Math.floor(Math.random()*e.length)];return r}async function mi(t,e,r){const n=`
682
- /**
683
- * A synchronous function to read a blob URL as text.
684
- *
685
- * @param {string} url
686
- * @returns {string}
687
- */
688
- const __playground_readBlobAsText = function (url) {
689
- try {
690
- let xhr = new XMLHttpRequest();
691
- xhr.open('GET', url, false);
692
- xhr.overrideMimeType('text/plain;charset=utf-8');
693
- xhr.send();
694
- return xhr.responseText;
695
- } catch(e) {
696
- return '';
697
- } finally {
698
- URL.revokeObjectURL(url);
699
- }
700
- }
701
-
702
- window.__playground_ControlledIframe = window.wp.element.forwardRef(function (props, ref) {
703
- const source = window.wp.element.useMemo(function () {
704
- if (props.srcDoc) {
705
- // WordPress <= 6.2 uses a srcDoc that only contains a doctype.
706
- return '/wp-includes/empty.html';
707
- } else if (props.src && props.src.startsWith('blob:')) {
708
- // WordPress 6.3 uses a blob URL with doctype and a list of static assets.
709
- // Let's pass the document content to empty.html and render it there.
710
- return '/wp-includes/empty.html#' + encodeURIComponent(__playground_readBlobAsText(props.src));
711
- } else {
712
- // WordPress >= 6.4 uses a plain HTTPS URL that needs no correction.
713
- return props.src;
714
- }
715
- }, [props.src]);
716
- return (
717
- window.wp.element.createElement('iframe', {
718
- ...props,
719
- ref: ref,
720
- src: source,
721
- // Make sure there's no srcDoc, as it would interfere with the src.
722
- srcDoc: undefined
723
- })
724
- )
725
- });`;for(const s of r)await t.fileExists(s)&&await Ir(t,s,i=>`${n} ${i.replace(/\(\s*"iframe",/,"(__playground_ControlledIframe,")}`);await t.writeFile(`${e}/wp-includes/empty.html`,"<!doctype html><script>const hash = window.location.hash.substring(1); if ( hash ) document.write(decodeURIComponent(hash))<\/script>")}const yi=async(t,{code:e})=>await t.run({code:e}),gi=async(t,{options:e})=>await t.run(e),In=async(t,{path:e})=>{await t.unlink(e)},$i=async(t,{sql:e},r)=>{r==null||r.tracker.setCaption("Executing SQL Queries");const n=`/tmp/${crypto.randomUUID()}.sql`;await t.writeFile(n,new Uint8Array(await e.arrayBuffer()));const s=await t.documentRoot,i=on({docroot:s,sqlFilename:n}),a=await t.run({code:`<?php
681
+ `;async function hn(t,e,r){let n="";await t.fileExists(e)&&(n=await t.readFileAsText(e)),await t.writeFile(e,r(n))}const hi=async(t,e)=>{const r=new la(t,e.wordpressPath||"/wordpress",e.siteUrl);e.addPhpInfo===!0&&await r.addPhpInfo(),e.siteUrl&&await r.patchSiteUrl(),e.patchSecrets===!0&&await r.patchSecrets(),e.disableSiteHealth===!0&&await r.disableSiteHealth(),e.disableWpNewBlogNotification===!0&&await r.disableWpNewBlogNotification(),e.prepareForRunningInsideWebBrowser===!0&&await r.prepareForRunningInsideWebBrowser(),e.addFetchNetworkTransport===!0&&await r.addFetchNetworkTransport()};class la{constructor(e,r,n){this.php=e,this.scopedSiteUrl=n,this.wordpressPath=r}async addPhpInfo(){await this.php.writeFile(`${this.wordpressPath}/phpinfo.php`,"<?php phpinfo(); ")}async patchSiteUrl(){await qt(this.php,{consts:{WP_HOME:this.scopedSiteUrl,WP_SITEURL:this.scopedSiteUrl}})}async patchSecrets(){await qt(this.php,{consts:{AUTH_KEY:et(40),SECURE_AUTH_KEY:et(40),LOGGED_IN_KEY:et(40),NONCE_KEY:et(40),AUTH_SALT:et(40),SECURE_AUTH_SALT:et(40),LOGGED_IN_SALT:et(40),NONCE_SALT:et(40)}})}async disableSiteHealth(){await hn(this.php,`${this.wordpressPath}/wp-includes/default-filters.php`,e=>e.replace(/add_filter[^;]+wp_maybe_grant_site_health_caps[^;]+;/i,""))}async disableWpNewBlogNotification(){await hn(this.php,`${this.wordpressPath}/wp-config.php`,e=>`${e} function wp_new_blog_notification(...$args){} `)}async prepareForRunningInsideWebBrowser(){await this.php.mkdir(`${this.wordpressPath}/wp-content/mu-plugins`),await this.php.writeFile(`${this.wordpressPath}/wp-content/mu-plugins/0-playground.php`,ca),await this.php.mkdir(`${this.wordpressPath}/wp-content/mu-plugins/playground-includes`),await this.php.writeFile(`${this.wordpressPath}/wp-content/mu-plugins/playground-includes/requests_transport_dummy.php`,aa)}async addFetchNetworkTransport(){await qt(this.php,{consts:{USE_FETCH_FOR_REQUESTS:!0}});const e=[`${this.wordpressPath}/wp-includes/Requests/Transport/fsockopen.php`,`${this.wordpressPath}/wp-includes/Requests/Transport/cURL.php`,`${this.wordpressPath}/wp-includes/Requests/src/Transport/Fsockopen.php`,`${this.wordpressPath}/wp-includes/Requests/src/Transport/Curl.php`];for(const r of e)await this.php.fileExists(r)&&await hn(this.php,r,n=>n.includes("public static function test2")?n:n.replace("public static function test","public static function test( $capabilities = array() ) { return false; } public static function test2"));await this.php.writeFile(`${this.wordpressPath}/wp-content/mu-plugins/playground-includes/wp_http_fetch.php`,oa),await this.php.mkdir(`${this.wordpressPath}/wp-content/fonts`)}}function et(t){const e="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()_+=-[]/.,<>?";let r="";for(let n=t;n>0;--n)r+=e[Math.floor(Math.random()*e.length)];return r}const mi=async(t,{code:e})=>await t.run({code:e}),yi=async(t,{options:e})=>await t.run(e),In=async(t,{path:e})=>{await t.unlink(e)},gi=async(t,{sql:e},r)=>{r==null||r.tracker.setCaption("Executing SQL Queries");const n=`/tmp/${crypto.randomUUID()}.sql`;await t.writeFile(n,new Uint8Array(await e.arrayBuffer()));const s=await t.documentRoot,i=sn({docroot:s,sqlFilename:n}),a=await t.run({code:`<?php
726
682
  require_once ${i.docroot} . '/wp-load.php';
727
683
 
728
684
  $handle = fopen(${i.sqlFilename}, 'r');
@@ -741,7 +697,7 @@ if (defined('USE_FETCH_FOR_REQUESTS') && USE_FETCH_FOR_REQUESTS) {
741
697
  $wpdb->query($buffer);
742
698
  $buffer = '';
743
699
  }
744
- `});return await In(t,{path:n}),a},_i=async(t,{key:e,value:r})=>{await t.setPhpIniEntry(e,r)},wi=async(t,{request:e})=>await t.request(e),vi=async(t,{fromPath:e,toPath:r})=>{await t.writeFile(r,await t.readFileAsBuffer(e))},bi=async(t,{fromPath:e,toPath:r})=>{await t.mv(e,r)},Pi=async(t,{path:e})=>{await t.mkdir(e)},Ei=async(t,{path:e})=>{await t.rmdir(e)},Dn=async(t,{path:e,data:r})=>{r instanceof File&&(r=new Uint8Array(await r.arrayBuffer())),await t.writeFile(e,r)},Si=async(t,{siteUrl:e})=>{await qt(t,{consts:{WP_HOME:e,WP_SITEURL:e}})},Ti=async(t,{file:e})=>{var l;const r=await t.request({url:"/wp-admin/admin.php?import=wordpress"}),n=(l=Ds(r).getElementById("import-upload-form"))==null?void 0:l.getAttribute("action"),s=await t.request({url:`/wp-admin/${n}`,method:"POST",files:{import:e}}),i=Ds(s).querySelector("#wpbody-content form");if(!i)throw console.log(s.text),new Error("Could not find an importer form in response. See the response text above for details.");const a=da(i);a.fetch_attachments="1";for(const p in a)if(p.startsWith("user_map[")){const u="user_new["+p.slice(9,-1)+"]";a[u]="1"}await t.request({url:i.action,method:"POST",formData:a})};function Ds(t){return new DOMParser().parseFromString(t.text,"text/html")}function da(t){return Object.fromEntries(new FormData(t).entries())}const As=`<?php
700
+ `});return await In(t,{path:n}),a},$i=async(t,{key:e,value:r})=>{await t.setPhpIniEntry(e,r)},_i=async(t,{request:e})=>await t.request(e),vi=async(t,{fromPath:e,toPath:r})=>{await t.writeFile(r,await t.readFileAsBuffer(e))},wi=async(t,{fromPath:e,toPath:r})=>{await t.mv(e,r)},bi=async(t,{path:e})=>{await t.mkdir(e)},Pi=async(t,{path:e})=>{await t.rmdir(e)},Dn=async(t,{path:e,data:r})=>{r instanceof File&&(r=new Uint8Array(await r.arrayBuffer())),await t.writeFile(e,r)},Ei=async(t,{siteUrl:e})=>{await qt(t,{consts:{WP_HOME:e,WP_SITEURL:e}})},Si=async(t,{file:e})=>{var l;const r=await t.request({url:"/wp-admin/admin.php?import=wordpress"}),n=(l=Ds(r).getElementById("import-upload-form"))==null?void 0:l.getAttribute("action"),s=await t.request({url:`/wp-admin/${n}`,method:"POST",files:{import:e}}),i=Ds(s).querySelector("#wpbody-content form");if(!i)throw console.log(s.text),new Error("Could not find an importer form in response. See the response text above for details.");const a=ua(i);a.fetch_attachments="1";for(const p in a)if(p.startsWith("user_map[")){const u="user_new["+p.slice(9,-1)+"]";a[u]="1"}await t.request({url:i.action,method:"POST",formData:a})};function Ds(t){return new DOMParser().parseFromString(t.text,"text/html")}function ua(t){return Object.fromEntries(new FormData(t).entries())}const As=`<?php
745
701
 
746
702
  function zipDir($root, $output, $options = array())
747
703
  {
@@ -824,34 +780,34 @@ function delTree($dir)
824
780
  }
825
781
  return rmdir($dir);
826
782
  }
827
- `;async function ki(t,e){const r=await t.run({code:As+e});if(r.exitCode!==0)throw console.log(As+e),console.log(e+""),console.log(r.errors),r.errors;return r}const an=async(t,{zipPath:e,extractToPath:r})=>{const n=on({zipPath:e,extractToPath:r});await ki(t,`unzip(${n.zipPath}, ${n.extractToPath});`)},Ri=async(t,{wordPressFilesZip:e,pathInZip:r=""})=>{const n="/import.zip";await t.writeFile(n,new Uint8Array(await e.arrayBuffer()));const s=await t.documentRoot;let i=ye("/tmp","import");await t.mkdir(i),await an(t,{zipPath:n,extractToPath:i}),await t.unlink(n),i=ye(i,r);const a=ye(i,"wp-content"),l=ye(s,"wp-content");for(const y of On){const k=ye(a,y);await Fs(t,k);const R=ye(l,y);await t.fileExists(R)&&(await t.mkdir(ea(k)),await t.mv(R,k))}const p=ye(i,"wp-content","database");await t.fileExists(p)||await t.mv(ye(s,"wp-content","database"),p);const u=await t.listFiles(i);for(const y of u)await Fs(t,ye(s,y)),await t.mv(ye(i,y),ye(s,y));await t.rmdir(i);const f=hr(ye(s,"wp-admin","upgrade.php"));await t.run({code:`<?php
783
+ `;async function Ti(t,e){const r=await t.run({code:As+e});if(r.exitCode!==0)throw console.log(As+e),console.log(e+""),console.log(r.errors),r.errors;return r}const on=async(t,{zipPath:e,extractToPath:r})=>{const n=sn({zipPath:e,extractToPath:r});await Ti(t,`unzip(${n.zipPath}, ${n.extractToPath});`)},ki=async(t,{wordPressFilesZip:e,pathInZip:r=""})=>{const n="/import.zip";await t.writeFile(n,new Uint8Array(await e.arrayBuffer()));const s=await t.documentRoot;let i=ye("/tmp","import");await t.mkdir(i),await on(t,{zipPath:n,extractToPath:i}),await t.unlink(n),i=ye(i,r);const a=ye(i,"wp-content"),l=ye(s,"wp-content");for(const y of On){const k=ye(a,y);await Fs(t,k);const R=ye(l,y);await t.fileExists(R)&&(await t.mkdir(Xo(k)),await t.mv(R,k))}const p=ye(i,"wp-content","database");await t.fileExists(p)||await t.mv(ye(s,"wp-content","database"),p);const u=await t.listFiles(i);for(const y of u)await Fs(t,ye(s,y)),await t.mv(ye(i,y),ye(s,y));await t.rmdir(i);const f=hr(ye(s,"wp-admin","upgrade.php"));await t.run({code:`<?php
828
784
  $_GET['step'] = 'upgrade_db';
829
785
  require ${f};
830
- `})};async function Fs(t,e){await t.fileExists(e)&&(await t.isDir(e)?await t.rmdir(e):await t.unlink(e))}async function Oi(t){const e=await t.request({url:"/wp-admin/export.php?download=true&content=all"});return new File([e.bytes],"export.xml")}async function Ci(t){const e=await t.request({url:"/wp-admin/export.php?download=true&content=all&export_wxz=1"});return new File([e.bytes],"export.wxz")}async function Ni(t,{targetPath:e,zipFile:r}){const n=r.name,s=n.replace(/\.zip$/,""),i=ye(await t.documentRoot,"wp-content"),a=ye(i,crypto.randomUUID()),l=ye(a,n),p=ye(a,"assets",s);await t.fileExists(p)&&await t.rmdir(a,{recursive:!0}),await t.mkdir(a),await Dn(t,{path:l,data:r});try{await an(t,{zipPath:l,extractToPath:p});let u=await t.listFiles(p,{prependPath:!0});u=u.filter(w=>!w.endsWith("/__MACOSX"));const f=u.length===1&&await t.isDir(u[0]);let y,k="";f?(k=u[0],y=u[0].split("/").pop()):(k=p,y=s);const R=`${e}/${y}`;return await t.mv(k,R),{assetFolderPath:R,assetFolderName:y}}finally{await t.rmdir(a,{recursive:!0})}}function cn(t){const e=t.split(".").shift().replace(/-/g," ");return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}const ji=async(t,{pluginZipFile:e,options:r={}},n)=>{const s=e.name.split("/").pop()||"plugin.zip",i=cn(s);n==null||n.tracker.setCaption(`Installing the ${i} plugin`);try{const{assetFolderPath:a}=await Ni(t,{zipFile:e,targetPath:`${await t.documentRoot}/wp-content/plugins`});("activate"in r?r.activate:!0)&&await Cn(t,{pluginPath:a,pluginName:i},n),await pa(t)}catch(a){console.error(`Proceeding without the ${i} plugin. Could not install it in wp-admin. The original error was: ${a}`),console.error(a)}};async function pa(t){await t.isDir("/wordpress/wp-content/plugins/gutenberg")&&!await t.fileExists("/wordpress/.gutenberg-patched")&&(await t.writeFile("/wordpress/.gutenberg-patched","1"),await mi(t,"/wordpress",["/wordpress/wp-content/plugins/gutenberg/build/block-editor/index.js","/wordpress/wp-content/plugins/gutenberg/build/block-editor/index.min.js"]))}const Ii=async(t,{themeZipFile:e,options:r={}},n)=>{const s=cn(e.name);n==null||n.tracker.setCaption(`Installing the ${s} theme`);try{const{assetFolderName:i}=await Ni(t,{zipFile:e,targetPath:`${await t.documentRoot}/wp-content/themes`});("activate"in r?r.activate:!0)&&await Nn(t,{themeFolderName:i},n)}catch(i){console.error(`Proceeding without the ${s} theme. Could not install it in wp-admin. The original error was: ${i}`),console.error(i)}},Di=async(t,{username:e="admin",password:r="password"}={},n)=>{n==null||n.tracker.setCaption((n==null?void 0:n.initialCaption)||"Logging in"),await t.request({url:"/wp-login.php"}),await t.request({url:"/wp-login.php",method:"POST",formData:{log:e,pwd:r,rememberme:"forever"}})},Ai=async(t,{options:e})=>{await t.request({url:"/wp-admin/install.php?step=2",method:"POST",formData:{language:"en",prefix:"wp_",weblog_title:"My WordPress Website",user_name:e.adminPassword||"admin",admin_password:e.adminPassword||"password",admin_password2:e.adminPassword||"password",Submit:"Install WordPress",pw_weak:"1",admin_email:"admin@localhost.com"}})},Fi=async(t,{options:e})=>{const r=`<?php
786
+ `})};async function Fs(t,e){await t.fileExists(e)&&(await t.isDir(e)?await t.rmdir(e):await t.unlink(e))}async function Ri(t){const e=await t.request({url:"/wp-admin/export.php?download=true&content=all"});return new File([e.bytes],"export.xml")}async function Oi(t){const e=await t.request({url:"/wp-admin/export.php?download=true&content=all&export_wxz=1"});return new File([e.bytes],"export.wxz")}async function Ni(t,{targetPath:e,zipFile:r}){const n=r.name,s=n.replace(/\.zip$/,""),i=ye(await t.documentRoot,"wp-content"),a=ye(i,crypto.randomUUID()),l=ye(a,n),p=ye(a,"assets",s);await t.fileExists(p)&&await t.rmdir(a,{recursive:!0}),await t.mkdir(a),await Dn(t,{path:l,data:r});try{await on(t,{zipPath:l,extractToPath:p});let u=await t.listFiles(p,{prependPath:!0});u=u.filter(v=>!v.endsWith("/__MACOSX"));const f=u.length===1&&await t.isDir(u[0]);let y,k="";f?(k=u[0],y=u[0].split("/").pop()):(k=p,y=s);const R=`${e}/${y}`;return await t.mv(k,R),{assetFolderPath:R,assetFolderName:y}}finally{await t.rmdir(a,{recursive:!0})}}function an(t){const e=t.split(".").shift().replace(/-/g," ");return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}const Ci=async(t,{pluginZipFile:e,options:r={}},n)=>{const s=e.name.split("/").pop()||"plugin.zip",i=an(s);n==null||n.tracker.setCaption(`Installing the ${i} plugin`);try{const{assetFolderPath:a}=await Ni(t,{zipFile:e,targetPath:`${await t.documentRoot}/wp-content/plugins`});("activate"in r?r.activate:!0)&&await Nn(t,{pluginPath:a,pluginName:i},n)}catch(a){console.error(`Proceeding without the ${i} plugin. Could not install it in wp-admin. The original error was: ${a}`),console.error(a)}},ji=async(t,{themeZipFile:e,options:r={}},n)=>{const s=an(e.name);n==null||n.tracker.setCaption(`Installing the ${s} theme`);try{const{assetFolderName:i}=await Ni(t,{zipFile:e,targetPath:`${await t.documentRoot}/wp-content/themes`});("activate"in r?r.activate:!0)&&await Cn(t,{themeFolderName:i},n)}catch(i){console.error(`Proceeding without the ${s} theme. Could not install it in wp-admin. The original error was: ${i}`),console.error(i)}},Ii=async(t,{username:e="admin",password:r="password"}={},n)=>{n==null||n.tracker.setCaption((n==null?void 0:n.initialCaption)||"Logging in"),await t.request({url:"/wp-login.php"}),await t.request({url:"/wp-login.php",method:"POST",formData:{log:e,pwd:r,rememberme:"forever"}})},Di=async(t,{options:e})=>{await t.request({url:"/wp-admin/install.php?step=2",method:"POST",formData:{language:"en",prefix:"wp_",weblog_title:"My WordPress Website",user_name:e.adminPassword||"admin",admin_password:e.adminPassword||"password",admin_password2:e.adminPassword||"password",Submit:"Install WordPress",pw_weak:"1",admin_email:"admin@localhost.com"}})},Ai=async(t,{options:e})=>{const r=`<?php
831
787
  include 'wordpress/wp-load.php';
832
788
  $site_options = ${hr(e)};
833
789
  foreach($site_options as $name => $value) {
834
790
  update_option($name, $value);
835
791
  }
836
792
  echo "Success";
837
- `,n=await t.run({code:r});return Mi(n),{code:r,result:n}},qi=async(t,{meta:e,userId:r})=>{const n=`<?php
793
+ `,n=await t.run({code:r});return qi(n),{code:r,result:n}},Fi=async(t,{meta:e,userId:r})=>{const n=`<?php
838
794
  include 'wordpress/wp-load.php';
839
795
  $meta = ${hr(e)};
840
796
  foreach($meta as $name => $value) {
841
797
  update_user_meta(${hr(r)}, $name, $value);
842
798
  }
843
799
  echo "Success";
844
- `,s=await t.run({code:n});return Mi(s),{code:n,result:s}};async function Mi(t){if(t.text!=="Success")throw console.log(t),new Error(`Failed to run code: ${t.text} ${t.errors}`)}const Ui=async(t,{selfContained:e=!1}={})=>{const r="/tmp/wordpress-playground.zip",n=await t.documentRoot,s=ye(n,"wp-content");let i=On;e&&(i=i.filter(p=>!p.startsWith("themes/twenty")).filter(p=>p!=="plugins/sqlite-database-integration"));const a=on({zipPath:r,wpContentPath:s,documentRoot:n,exceptPaths:i.map(p=>ye(n,"wp-content",p)),additionalPaths:e?{[ye(n,"wp-config.php")]:"wp-config.php"}:{}});await ki(t,`zipDir(${a.wpContentPath}, ${a.zipPath}, array(
800
+ `,s=await t.run({code:n});return qi(s),{code:n,result:s}};async function qi(t){if(t.text!=="Success")throw console.log(t),new Error(`Failed to run code: ${t.text} ${t.errors}`)}const Mi=async(t,{selfContained:e=!1}={})=>{const r="/tmp/wordpress-playground.zip",n=await t.documentRoot,s=ye(n,"wp-content");let i=On;e&&(i=i.filter(p=>!p.startsWith("themes/twenty")).filter(p=>p!=="plugins/sqlite-database-integration"));const a=sn({zipPath:r,wpContentPath:s,documentRoot:n,exceptPaths:i.map(p=>ye(n,"wp-content",p)),additionalPaths:e?{[ye(n,"wp-config.php")]:"wp-config.php"}:{}});await Ti(t,`zipDir(${a.wpContentPath}, ${a.zipPath}, array(
845
801
  'exclude_paths' => ${a.exceptPaths},
846
802
  'zip_root' => ${a.documentRoot},
847
803
  'additional_paths' => ${a.additionalPaths}
848
- ));`);const l=await t.readFileAsBuffer(r);return t.unlink(r),l},fa=Object.freeze(Object.defineProperty({__proto__:null,activatePlugin:Cn,activateTheme:Nn,applyWordPressPatches:hi,cp:vi,defineSiteUrl:Si,defineWpConfigConsts:qt,exportWXR:Oi,exportWXZ:Ci,importFile:Ti,importWordPressFiles:Ri,installPlugin:ji,installTheme:Ii,login:Di,mkdir:Pi,mv:bi,request:wi,rm:In,rmdir:Ei,runPHP:yi,runPHPWithOptions:gi,runSql:$i,runWpInstallationWizard:Ai,setPhpIniEntry:_i,setSiteOptions:Fi,unzip:an,updateUserMeta:qi,writeFile:Dn,zipWpContent:Ui},Symbol.toStringTag,{value:"Module"})),ha=5*1024*1024;function ma(t,e){const r=t.headers.get("content-length")||"",n=parseInt(r,10)||ha;function s(i,a){e(new CustomEvent("progress",{detail:{loaded:i,total:a}}))}return new Response(new ReadableStream({async start(i){if(!t.body){i.close();return}const a=t.body.getReader();let l=0;for(;;)try{const{done:p,value:u}=await a.read();if(u&&(l+=u.byteLength),p){s(l,l),i.close();break}else s(l,n),i.enqueue(u)}catch(p){console.error({e:p}),i.error(p);break}}}),{status:t.status,statusText:t.statusText,headers:t.headers})}const mn=1e-5;class An extends EventTarget{constructor({weight:e=1,caption:r="",fillTime:n=4}={}){super(),this._selfWeight=1,this._selfDone=!1,this._selfProgress=0,this._selfCaption="",this._isFilling=!1,this._subTrackers=[],this._weight=e,this._selfCaption=r,this._fillTime=n}stage(e,r=""){if(e||(e=this._selfWeight),this._selfWeight-e<-mn)throw new Error(`Cannot add a stage with weight ${e} as the total weight of registered stages would exceed 1.`);this._selfWeight-=e;const n=new An({caption:r,weight:e,fillTime:this._fillTime});return this._subTrackers.push(n),n.addEventListener("progress",()=>this.notifyProgress()),n.addEventListener("done",()=>{this.done&&this.notifyDone()}),n}fillSlowly({stopBeforeFinishing:e=!0}={}){if(this._isFilling)return;this._isFilling=!0;const r=100,n=this._fillTime/r;this._fillInterval=setInterval(()=>{this.set(this._selfProgress+1),e&&this._selfProgress>=99&&clearInterval(this._fillInterval)},n)}set(e){this._selfProgress=Math.min(e,100),this.notifyProgress(),this._selfProgress+mn>=100&&this.finish()}finish(){this._fillInterval&&clearInterval(this._fillInterval),this._selfDone=!0,this._selfProgress=100,this._isFilling=!1,this._fillInterval=void 0,this.notifyProgress(),this.notifyDone()}get caption(){for(let e=this._subTrackers.length-1;e>=0;e--)if(!this._subTrackers[e].done){const r=this._subTrackers[e].caption;if(r)return r}return this._selfCaption}setCaption(e){this._selfCaption=e,this.notifyProgress()}get done(){return this.progress+mn>=100}get progress(){if(this._selfDone)return 100;const e=this._subTrackers.reduce((r,n)=>r+n.progress*n.weight,this._selfProgress*this._selfWeight);return Math.round(e*1e4)/1e4}get weight(){return this._weight}get observer(){return this._progressObserver||(this._progressObserver=e=>{this.set(e)}),this._progressObserver}get loadingListener(){return this._loadingListener||(this._loadingListener=e=>{this.set(e.detail.loaded/e.detail.total*100)}),this._loadingListener}pipe(e){e.setProgress({progress:this.progress,caption:this.caption}),this.addEventListener("progress",r=>{e.setProgress({progress:r.detail.progress,caption:r.detail.caption})}),this.addEventListener("done",()=>{e.setLoaded()})}addEventListener(e,r){super.addEventListener(e,r)}removeEventListener(e,r){super.removeEventListener(e,r)}notifyProgress(){const e=this;this.dispatchEvent(new CustomEvent("progress",{detail:{get progress(){return e.progress},get caption(){return e.caption}}}))}notifyDone(){this.dispatchEvent(new CustomEvent("done"))}}const qs=Symbol("error"),Ms=Symbol("message");class Fn extends Event{constructor(e,r={}){super(e),this[qs]=r.error===void 0?null:r.error,this[Ms]=r.message===void 0?"":r.message}get error(){return this[qs]}get message(){return this[Ms]}}Object.defineProperty(Fn.prototype,"error",{enumerable:!0});Object.defineProperty(Fn.prototype,"message",{enumerable:!0});const ya=typeof globalThis.ErrorEvent=="function"?globalThis.ErrorEvent:Fn;function ga(t){return t instanceof Error?"exitCode"in t&&(t==null?void 0:t.exitCode)===0||(t==null?void 0:t.name)==="ExitStatus"&&"status"in t&&t.status===0:!1}class $a extends EventTarget{constructor(){super(...arguments),this.listenersCount=0}addEventListener(e,r){++this.listenersCount,super.addEventListener(e,r)}removeEventListener(e,r){--this.listenersCount,super.removeEventListener(e,r)}hasListeners(){return this.listenersCount>0}}function _a(t){t.asm={...t.asm};const e=new $a;for(const r in t.asm)if(typeof t.asm[r]=="function"){const n=t.asm[r];t.asm[r]=function(...s){var i;try{return n(...s)}catch(a){if(!(a instanceof Error))throw a;const l=va(a,(i=t.lastAsyncifyStackSource)==null?void 0:i.stack);if(t.lastAsyncifyStackSource&&(a.cause=t.lastAsyncifyStackSource),e.hasListeners()){e.dispatchEvent(new ya("error",{error:a,message:l}));return}throw ga(a)||Ea(l),a}}}return e}let vn=[];function wa(){return vn}function va(t,e){if(t.message==="unreachable"){let r=ba;e||(r+=`
804
+ ));`);const l=await t.readFileAsBuffer(r);return t.unlink(r),l},da=Object.freeze(Object.defineProperty({__proto__:null,activatePlugin:Nn,activateTheme:Cn,applyWordPressPatches:hi,cp:vi,defineSiteUrl:Ei,defineWpConfigConsts:qt,exportWXR:Ri,exportWXZ:Oi,importFile:Si,importWordPressFiles:ki,installPlugin:Ci,installTheme:ji,login:Ii,mkdir:bi,mv:wi,request:_i,rm:In,rmdir:Pi,runPHP:mi,runPHPWithOptions:yi,runSql:gi,runWpInstallationWizard:Di,setPhpIniEntry:$i,setSiteOptions:Ai,unzip:on,updateUserMeta:Fi,writeFile:Dn,zipWpContent:Mi},Symbol.toStringTag,{value:"Module"})),pa=5*1024*1024;function fa(t,e){const r=t.headers.get("content-length")||"",n=parseInt(r,10)||pa;function s(i,a){e(new CustomEvent("progress",{detail:{loaded:i,total:a}}))}return new Response(new ReadableStream({async start(i){if(!t.body){i.close();return}const a=t.body.getReader();let l=0;for(;;)try{const{done:p,value:u}=await a.read();if(u&&(l+=u.byteLength),p){s(l,l),i.close();break}else s(l,n),i.enqueue(u)}catch(p){console.error({e:p}),i.error(p);break}}}),{status:t.status,statusText:t.statusText,headers:t.headers})}const mn=1e-5;class An extends EventTarget{constructor({weight:e=1,caption:r="",fillTime:n=4}={}){super(),this._selfWeight=1,this._selfDone=!1,this._selfProgress=0,this._selfCaption="",this._isFilling=!1,this._subTrackers=[],this._weight=e,this._selfCaption=r,this._fillTime=n}stage(e,r=""){if(e||(e=this._selfWeight),this._selfWeight-e<-mn)throw new Error(`Cannot add a stage with weight ${e} as the total weight of registered stages would exceed 1.`);this._selfWeight-=e;const n=new An({caption:r,weight:e,fillTime:this._fillTime});return this._subTrackers.push(n),n.addEventListener("progress",()=>this.notifyProgress()),n.addEventListener("done",()=>{this.done&&this.notifyDone()}),n}fillSlowly({stopBeforeFinishing:e=!0}={}){if(this._isFilling)return;this._isFilling=!0;const r=100,n=this._fillTime/r;this._fillInterval=setInterval(()=>{this.set(this._selfProgress+1),e&&this._selfProgress>=99&&clearInterval(this._fillInterval)},n)}set(e){this._selfProgress=Math.min(e,100),this.notifyProgress(),this._selfProgress+mn>=100&&this.finish()}finish(){this._fillInterval&&clearInterval(this._fillInterval),this._selfDone=!0,this._selfProgress=100,this._isFilling=!1,this._fillInterval=void 0,this.notifyProgress(),this.notifyDone()}get caption(){for(let e=this._subTrackers.length-1;e>=0;e--)if(!this._subTrackers[e].done){const r=this._subTrackers[e].caption;if(r)return r}return this._selfCaption}setCaption(e){this._selfCaption=e,this.notifyProgress()}get done(){return this.progress+mn>=100}get progress(){if(this._selfDone)return 100;const e=this._subTrackers.reduce((r,n)=>r+n.progress*n.weight,this._selfProgress*this._selfWeight);return Math.round(e*1e4)/1e4}get weight(){return this._weight}get observer(){return this._progressObserver||(this._progressObserver=e=>{this.set(e)}),this._progressObserver}get loadingListener(){return this._loadingListener||(this._loadingListener=e=>{this.set(e.detail.loaded/e.detail.total*100)}),this._loadingListener}pipe(e){e.setProgress({progress:this.progress,caption:this.caption}),this.addEventListener("progress",r=>{e.setProgress({progress:r.detail.progress,caption:r.detail.caption})}),this.addEventListener("done",()=>{e.setLoaded()})}addEventListener(e,r){super.addEventListener(e,r)}removeEventListener(e,r){super.removeEventListener(e,r)}notifyProgress(){const e=this;this.dispatchEvent(new CustomEvent("progress",{detail:{get progress(){return e.progress},get caption(){return e.caption}}}))}notifyDone(){this.dispatchEvent(new CustomEvent("done"))}}const qs=Symbol("error"),Ms=Symbol("message");class Fn extends Event{constructor(e,r={}){super(e),this[qs]=r.error===void 0?null:r.error,this[Ms]=r.message===void 0?"":r.message}get error(){return this[qs]}get message(){return this[Ms]}}Object.defineProperty(Fn.prototype,"error",{enumerable:!0});Object.defineProperty(Fn.prototype,"message",{enumerable:!0});const ha=typeof globalThis.ErrorEvent=="function"?globalThis.ErrorEvent:Fn;function ma(t){return t instanceof Error?"exitCode"in t&&(t==null?void 0:t.exitCode)===0||(t==null?void 0:t.name)==="ExitStatus"&&"status"in t&&t.status===0:!1}class ya extends EventTarget{constructor(){super(...arguments),this.listenersCount=0}addEventListener(e,r){++this.listenersCount,super.addEventListener(e,r)}removeEventListener(e,r){--this.listenersCount,super.removeEventListener(e,r)}hasListeners(){return this.listenersCount>0}}function ga(t){t.asm={...t.asm};const e=new ya;for(const r in t.asm)if(typeof t.asm[r]=="function"){const n=t.asm[r];t.asm[r]=function(...s){var i;try{return n(...s)}catch(a){if(!(a instanceof Error))throw a;const l=_a(a,(i=t.lastAsyncifyStackSource)==null?void 0:i.stack);if(t.lastAsyncifyStackSource&&(a.cause=t.lastAsyncifyStackSource),e.hasListeners()){e.dispatchEvent(new ha("error",{error:a,message:l}));return}throw ma(a)||ba(l),a}}}return e}let wn=[];function $a(){return wn}function _a(t,e){if(t.message==="unreachable"){let r=va;e||(r+=`
849
805
 
850
806
  This stack trace is lacking. For a better one initialize
851
807
  the PHP runtime with { debug: true }, e.g. PHPNode.load('8.1', { debug: true }).
852
808
 
853
- `),vn=Sa(e||t.stack||"");for(const n of vn)r+=` * ${n}
854
- `;return r}return t.message}const ba=`
809
+ `),wn=Pa(e||t.stack||"");for(const n of wn)r+=` * ${n}
810
+ `;return r}return t.message}const va=`
855
811
  "unreachable" WASM instruction executed.
856
812
 
857
813
  The typical reason is a PHP function missing from the ASYNCIFY_ONLY
@@ -875,13 +831,13 @@ the Dockerfile, you'll need to trigger this error again with long stack
875
831
  traces enabled. In node.js, you can do it using the --stack-trace-limit=100
876
832
  CLI option:
877
833
 
878
- `,Us="\x1B[41m",Pa="\x1B[1m",Ls="\x1B[0m",Hs="\x1B[K";let zs=!1;function Ea(t){if(!zs){zs=!0,console.log(`${Us}
834
+ `,Us="\x1B[41m",wa="\x1B[1m",Ls="\x1B[0m",Hs="\x1B[K";let zs=!1;function ba(t){if(!zs&&(zs=!0,!(t!=null&&t.trim().startsWith("Program terminated with exit")))){console.log(`${Us}
879
835
  ${Hs}
880
- ${Pa} WASM ERROR${Ls}${Us}`);for(const e of t.split(`
881
- `))console.log(`${Hs} ${e} `);console.log(`${Ls}`)}}function Sa(t){try{const e=t.split(`
882
- `).slice(1).map(r=>{const n=r.trim().substring(3).split(" ");return{fn:n.length>=2?n[0]:"<unknown>",isWasm:r.includes("wasm://")}}).filter(({fn:r,isWasm:n})=>n&&!r.startsWith("dynCall_")&&!r.startsWith("invoke_")).map(({fn:r})=>r);return Array.from(new Set(e))}catch{return[]}}ReadableStream.prototype[Symbol.asyncIterator]||(ReadableStream.prototype[Symbol.asyncIterator]=async function*(){const t=this.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)return;yield r}}finally{t.releaseLock()}},ReadableStream.prototype.iterate=ReadableStream.prototype[Symbol.asyncIterator]);class Mt{constructor(e,r,n,s="",i=0){this.httpStatusCode=e,this.headers=r,this.bytes=n,this.exitCode=i,this.errors=s}static fromRawData(e){return new Mt(e.httpStatusCode,e.headers,e.bytes,e.errors,e.exitCode)}toRawData(){return{headers:this.headers,bytes:this.bytes,errors:this.errors,exitCode:this.exitCode,httpStatusCode:this.httpStatusCode}}get json(){return JSON.parse(this.text)}get text(){return new TextDecoder().decode(this.bytes)}}const Li=["8.3","8.2","8.1","8.0","7.4","7.3","7.2","7.1","7.0"],Ta=Li[0],Hi=["iconv","mbstring","xml-bundle","gd"],Vs={"kitchen-sink":Hi};var gt,Lt;class ka{constructor(e,r={}){ee(this,gt,void 0);ee(this,Lt,void 0);this.requestHandler=e,pe(this,gt,{}),pe(this,Lt,{handleRedirects:!1,maxRedirects:4,...r})}async request(e,r=0){const n=await this.requestHandler.request({...e,headers:{...e.headers,cookie:this.serializeCookies()}});if(n.headers["set-cookie"]&&this.setCookies(n.headers["set-cookie"]),z(this,Lt).handleRedirects&&n.headers.location&&r<z(this,Lt).maxRedirects){const s=new URL(n.headers.location[0],this.requestHandler.absoluteUrl);return this.request({url:s.toString(),method:"GET",headers:{}},r+1)}return n}pathToInternalUrl(e){return this.requestHandler.pathToInternalUrl(e)}internalUrlToPath(e){return this.requestHandler.internalUrlToPath(e)}get absoluteUrl(){return this.requestHandler.absoluteUrl}get documentRoot(){return this.requestHandler.documentRoot}setCookies(e){for(const r of e)try{if(!r.includes("="))continue;const n=r.indexOf("="),s=r.substring(0,n),i=r.substring(n+1).split(";")[0];z(this,gt)[s]=i}catch(n){console.error(n)}}serializeCookies(){const e=[];for(const r in z(this,gt))e.push(`${r}=${z(this,gt)[r]}`);return e.join("; ")}}gt=new WeakMap,Lt=new WeakMap;const Ra="http://example.com";function Ws(t){return t.toString().substring(t.origin.length)}function xs(t,e){return!e||!t.startsWith(e)?t:t.substring(e.length)}function Oa(t,e){return!e||t.startsWith(e)?t:e+t}var He,Ht,yr,$t,zt,ze,Vt,Wt,Wr,zi,xr,Vi,Br,Wi;class Ca{constructor(e,r={}){ee(this,Wr);ee(this,xr);ee(this,Br);ee(this,He,void 0);ee(this,Ht,void 0);ee(this,yr,void 0);ee(this,$t,void 0);ee(this,zt,void 0);ee(this,ze,void 0);ee(this,Vt,void 0);ee(this,Wt,void 0);pe(this,Wt,new jn({concurrency:1}));const{documentRoot:n="/www/",absoluteUrl:s=typeof location=="object"?location==null?void 0:location.href:""}=r;this.php=e,pe(this,He,n);const i=new URL(s);pe(this,yr,i.hostname),pe(this,$t,i.port?Number(i.port):i.protocol==="https:"?443:80),pe(this,Ht,(i.protocol||"").replace(":",""));const a=z(this,$t)!==443&&z(this,$t)!==80;pe(this,zt,[z(this,yr),a?`:${z(this,$t)}`:""].join("")),pe(this,ze,i.pathname.replace(/\/+$/,"")),pe(this,Vt,[`${z(this,Ht)}://`,z(this,zt),z(this,ze)].join(""))}pathToInternalUrl(e){return`${this.absoluteUrl}${e}`}internalUrlToPath(e){const r=new URL(e);return r.pathname.startsWith(z(this,ze))&&(r.pathname=r.pathname.slice(z(this,ze).length)),Ws(r)}get isRequestRunning(){return z(this,Wt).running>0}get absoluteUrl(){return z(this,Vt)}get documentRoot(){return z(this,He)}async request(e){const r=e.url.startsWith("http://")||e.url.startsWith("https://"),n=new URL(e.url,r?void 0:Ra),s=xs(n.pathname,z(this,ze)),i=`${z(this,He)}${s}`;return Ia(i)?await _e(this,xr,Vi).call(this,e,n):_e(this,Wr,zi).call(this,i)}}He=new WeakMap,Ht=new WeakMap,yr=new WeakMap,$t=new WeakMap,zt=new WeakMap,ze=new WeakMap,Vt=new WeakMap,Wt=new WeakMap,Wr=new WeakSet,zi=function(e){if(!this.php.fileExists(e))return new Mt(404,{"x-file-type":["static"]},new TextEncoder().encode("404 File not found"));const r=this.php.readFileAsBuffer(e);return new Mt(200,{"content-length":[`${r.byteLength}`],"content-type":[ja(e)],"accept-ranges":["bytes"],"cache-control":["public, max-age=0"]},r)},xr=new WeakSet,Vi=async function(e,r){var s;const n=await z(this,Wt).acquire();try{this.php.addServerGlobalEntry("DOCUMENT_ROOT",z(this,He)),this.php.addServerGlobalEntry("HTTPS",z(this,Vt).startsWith("https://")?"on":"");let i="GET";const a={host:z(this,zt),...no(e.headers||{})},l=[];if(e.files&&Object.keys(e.files).length){i="POST";for(const f in e.files){const y=e.files[f];l.push({key:f,name:y.name,type:y.type,data:new Uint8Array(await y.arrayBuffer())})}(s=a["content-type"])!=null&&s.startsWith("multipart/form-data")&&(e.formData=Na(e.body||""),a["content-type"]="application/x-www-form-urlencoded",delete e.body)}let p;e.formData!==void 0?(i="POST",a["content-type"]=a["content-type"]||"application/x-www-form-urlencoded",p=new URLSearchParams(e.formData).toString()):p=e.body;let u;try{u=_e(this,Br,Wi).call(this,r.pathname)}catch{return new Mt(404,{},new TextEncoder().encode("404 File not found"))}return await this.php.run({relativeUri:Oa(Ws(r),z(this,ze)),protocol:z(this,Ht),method:e.method||i,body:p,fileInfos:l,scriptPath:u,headers:a})}finally{n()}},Br=new WeakSet,Wi=function(e){let r=xs(e,z(this,ze));r.includes(".php")?r=r.split(".php")[0]+".php":(r.endsWith("/")||(r+="/"),r.endsWith("index.php")||(r+="index.php"));const n=`${z(this,He)}${r}`;if(this.php.fileExists(n))return n;if(!this.php.fileExists(`${z(this,He)}/index.php`))throw new Error(`File not found: ${n}`);return`${z(this,He)}/index.php`};function Na(t){const e={},r=t.match(/--(.*)\r\n/);if(!r)return e;const n=r[1],s=t.split(`--${n}`);return s.shift(),s.pop(),s.forEach(i=>{const a=i.indexOf(`\r
836
+ ${wa} WASM ERROR${Ls}${Us}`);for(const e of t.split(`
837
+ `))console.log(`${Hs} ${e} `);console.log(`${Ls}`)}}function Pa(t){try{const e=t.split(`
838
+ `).slice(1).map(r=>{const n=r.trim().substring(3).split(" ");return{fn:n.length>=2?n[0]:"<unknown>",isWasm:r.includes("wasm://")}}).filter(({fn:r,isWasm:n})=>n&&!r.startsWith("dynCall_")&&!r.startsWith("invoke_")).map(({fn:r})=>r);return Array.from(new Set(e))}catch{return[]}}ReadableStream.prototype[Symbol.asyncIterator]||(ReadableStream.prototype[Symbol.asyncIterator]=async function*(){const t=this.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)return;yield r}}finally{t.releaseLock()}},ReadableStream.prototype.iterate=ReadableStream.prototype[Symbol.asyncIterator]);class Mt{constructor(e,r,n,s="",i=0){this.httpStatusCode=e,this.headers=r,this.bytes=n,this.exitCode=i,this.errors=s}static fromRawData(e){return new Mt(e.httpStatusCode,e.headers,e.bytes,e.errors,e.exitCode)}toRawData(){return{headers:this.headers,bytes:this.bytes,errors:this.errors,exitCode:this.exitCode,httpStatusCode:this.httpStatusCode}}get json(){return JSON.parse(this.text)}get text(){return new TextDecoder().decode(this.bytes)}}const Ui=["8.3","8.2","8.1","8.0","7.4","7.3","7.2","7.1","7.0"],Ea=Ui[0],Li=["iconv","mbstring","xml-bundle","gd"],Vs={"kitchen-sink":Li};var gt,Lt;class Sa{constructor(e,r={}){ee(this,gt,void 0);ee(this,Lt,void 0);this.requestHandler=e,pe(this,gt,{}),pe(this,Lt,{handleRedirects:!1,maxRedirects:4,...r})}async request(e,r=0){const n=await this.requestHandler.request({...e,headers:{...e.headers,cookie:this.serializeCookies()}});if(n.headers["set-cookie"]&&this.setCookies(n.headers["set-cookie"]),z(this,Lt).handleRedirects&&n.headers.location&&r<z(this,Lt).maxRedirects){const s=new URL(n.headers.location[0],this.requestHandler.absoluteUrl);return this.request({url:s.toString(),method:"GET",headers:{}},r+1)}return n}pathToInternalUrl(e){return this.requestHandler.pathToInternalUrl(e)}internalUrlToPath(e){return this.requestHandler.internalUrlToPath(e)}get absoluteUrl(){return this.requestHandler.absoluteUrl}get documentRoot(){return this.requestHandler.documentRoot}setCookies(e){for(const r of e)try{if(!r.includes("="))continue;const n=r.indexOf("="),s=r.substring(0,n),i=r.substring(n+1).split(";")[0];z(this,gt)[s]=i}catch(n){console.error(n)}}serializeCookies(){const e=[];for(const r in z(this,gt))e.push(`${r}=${z(this,gt)[r]}`);return e.join("; ")}}gt=new WeakMap,Lt=new WeakMap;const Ta="http://example.com";function Ws(t){return t.toString().substring(t.origin.length)}function xs(t,e){return!e||!t.startsWith(e)?t:t.substring(e.length)}function ka(t,e){return!e||t.startsWith(e)?t:e+t}var He,Ht,yr,$t,zt,ze,Vt,Wt,Vr,Hi,Wr,zi,xr,Vi;class Ra{constructor(e,r={}){ee(this,Vr);ee(this,Wr);ee(this,xr);ee(this,He,void 0);ee(this,Ht,void 0);ee(this,yr,void 0);ee(this,$t,void 0);ee(this,zt,void 0);ee(this,ze,void 0);ee(this,Vt,void 0);ee(this,Wt,void 0);pe(this,Wt,new jn({concurrency:1}));const{documentRoot:n="/www/",absoluteUrl:s=typeof location=="object"?location==null?void 0:location.href:""}=r;this.php=e,pe(this,He,n);const i=new URL(s);pe(this,yr,i.hostname),pe(this,$t,i.port?Number(i.port):i.protocol==="https:"?443:80),pe(this,Ht,(i.protocol||"").replace(":",""));const a=z(this,$t)!==443&&z(this,$t)!==80;pe(this,zt,[z(this,yr),a?`:${z(this,$t)}`:""].join("")),pe(this,ze,i.pathname.replace(/\/+$/,"")),pe(this,Vt,[`${z(this,Ht)}://`,z(this,zt),z(this,ze)].join(""))}pathToInternalUrl(e){return`${this.absoluteUrl}${e}`}internalUrlToPath(e){const r=new URL(e);return r.pathname.startsWith(z(this,ze))&&(r.pathname=r.pathname.slice(z(this,ze).length)),Ws(r)}get isRequestRunning(){return z(this,Wt).running>0}get absoluteUrl(){return z(this,Vt)}get documentRoot(){return z(this,He)}async request(e){const r=e.url.startsWith("http://")||e.url.startsWith("https://"),n=new URL(e.url,r?void 0:Ta),s=xs(n.pathname,z(this,ze)),i=`${z(this,He)}${s}`;return Ca(i)?await _e(this,Wr,zi).call(this,e,n):_e(this,Vr,Hi).call(this,i)}}He=new WeakMap,Ht=new WeakMap,yr=new WeakMap,$t=new WeakMap,zt=new WeakMap,ze=new WeakMap,Vt=new WeakMap,Wt=new WeakMap,Vr=new WeakSet,Hi=function(e){if(!this.php.fileExists(e))return new Mt(404,{"x-file-type":["static"]},new TextEncoder().encode("404 File not found"));const r=this.php.readFileAsBuffer(e);return new Mt(200,{"content-length":[`${r.byteLength}`],"content-type":[Na(e)],"accept-ranges":["bytes"],"cache-control":["public, max-age=0"]},r)},Wr=new WeakSet,zi=async function(e,r){var s;const n=await z(this,Wt).acquire();try{this.php.addServerGlobalEntry("DOCUMENT_ROOT",z(this,He)),this.php.addServerGlobalEntry("HTTPS",z(this,Vt).startsWith("https://")?"on":"");let i="GET";const a={host:z(this,zt),...ro(e.headers||{})},l=[];if(e.files&&Object.keys(e.files).length){i="POST";for(const f in e.files){const y=e.files[f];l.push({key:f,name:y.name,type:y.type,data:new Uint8Array(await y.arrayBuffer())})}(s=a["content-type"])!=null&&s.startsWith("multipart/form-data")&&(e.formData=Oa(e.body||""),a["content-type"]="application/x-www-form-urlencoded",delete e.body)}let p;e.formData!==void 0?(i="POST",a["content-type"]=a["content-type"]||"application/x-www-form-urlencoded",p=new URLSearchParams(e.formData).toString()):p=e.body;let u;try{u=_e(this,xr,Vi).call(this,r.pathname)}catch{return new Mt(404,{},new TextEncoder().encode("404 File not found"))}return await this.php.run({relativeUri:ka(Ws(r),z(this,ze)),protocol:z(this,Ht),method:e.method||i,body:p,fileInfos:l,scriptPath:u,headers:a})}finally{n()}},xr=new WeakSet,Vi=function(e){let r=xs(e,z(this,ze));r.includes(".php")?r=r.split(".php")[0]+".php":(r.endsWith("/")||(r+="/"),r.endsWith("index.php")||(r+="index.php"));const n=`${z(this,He)}${r}`;if(this.php.fileExists(n))return n;if(!this.php.fileExists(`${z(this,He)}/index.php`))throw new Error(`File not found: ${n}`);return`${z(this,He)}/index.php`};function Oa(t){const e={},r=t.match(/--(.*)\r\n/);if(!r)return e;const n=r[1],s=t.split(`--${n}`);return s.shift(),s.pop(),s.forEach(i=>{const a=i.indexOf(`\r
883
839
  \r
884
- `),l=i.substring(0,a).trim(),p=i.substring(a+4).trim(),u=l.match(/name="([^"]+)"/);if(u){const f=u[1];e[f]=p}}),e}function ja(t){switch(t.split(".").pop()){case"css":return"text/css";case"js":return"application/javascript";case"png":return"image/png";case"jpg":case"jpeg":return"image/jpeg";case"gif":return"image/gif";case"svg":return"image/svg+xml";case"woff":return"font/woff";case"woff2":return"font/woff2";case"ttf":return"font/ttf";case"otf":return"font/otf";case"eot":return"font/eot";case"ico":return"image/x-icon";case"html":return"text/html";case"json":return"application/json";case"xml":return"application/xml";case"txt":case"md":return"text/plain";default:return"application-octet-stream"}}function Ia(t){return Da(t)||Aa(t)}function Da(t){return t.endsWith(".php")||t.includes(".php/")}function Aa(t){return!t.split("/").pop().includes(".")}const Mr={0:"No error occurred. System call completed successfully.",1:"Argument list too long.",2:"Permission denied.",3:"Address in use.",4:"Address not available.",5:"Address family not supported.",6:"Resource unavailable, or operation would block.",7:"Connection already in progress.",8:"Bad file descriptor.",9:"Bad message.",10:"Device or resource busy.",11:"Operation canceled.",12:"No child processes.",13:"Connection aborted.",14:"Connection refused.",15:"Connection reset.",16:"Resource deadlock would occur.",17:"Destination address required.",18:"Mathematics argument out of domain of function.",19:"Reserved.",20:"File exists.",21:"Bad address.",22:"File too large.",23:"Host is unreachable.",24:"Identifier removed.",25:"Illegal byte sequence.",26:"Operation in progress.",27:"Interrupted function.",28:"Invalid argument.",29:"I/O error.",30:"Socket is connected.",31:"There is a directory under that path.",32:"Too many levels of symbolic links.",33:"File descriptor value too large.",34:"Too many links.",35:"Message too large.",36:"Reserved.",37:"Filename too long.",38:"Network is down.",39:"Connection aborted by network.",40:"Network unreachable.",41:"Too many files open in system.",42:"No buffer space available.",43:"No such device.",44:"There is no such file or directory OR the parent directory does not exist.",45:"Executable file format error.",46:"No locks available.",47:"Reserved.",48:"Not enough space.",49:"No message of the desired type.",50:"Protocol not available.",51:"No space left on device.",52:"Function not supported.",53:"The socket is not connected.",54:"Not a directory or a symbolic link to a directory.",55:"Directory not empty.",56:"State not recoverable.",57:"Not a socket.",58:"Not supported, or operation not supported on socket.",59:"Inappropriate I/O control operation.",60:"No such device or address.",61:"Value too large to be stored in data type.",62:"Previous owner died.",63:"Operation not permitted.",64:"Broken pipe.",65:"Protocol error.",66:"Protocol not supported.",67:"Protocol wrong type for socket.",68:"Result too large.",69:"Read-only file system.",70:"Invalid seek.",71:"No such process.",72:"Reserved.",73:"Connection timed out.",74:"Text file busy.",75:"Cross-device link.",76:"Extension: Capabilities insufficient."};function Fa(t){const e=typeof t=="object"?t==null?void 0:t.errno:null;if(e in Mr)return Mr[e]}function xe(t=""){return function(r,n,s){const i=s.value;s.value=function(...a){try{return i.apply(this,a)}catch(l){const p=typeof l=="object"?l==null?void 0:l.errno:null;if(p in Mr){const u=Mr[p],f=typeof a[0]=="string"?a[0]:null,y=f!==null?t.replaceAll("{path}",f):t;throw new Error(`${y}: ${u}`,{cause:l})}throw l}}}}const qa=new Map;function Ma(t){return qa.get(t)}(function(){var t;return typeof process<"u"&&((t=process.release)==null?void 0:t.name)==="node"?"NODE":typeof window<"u"?"WEB":typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?"WORKER":"NODE"})();var Ua=Object.defineProperty,La=Object.getOwnPropertyDescriptor,Be=(t,e,r,n)=>{for(var s=n>1?void 0:n?La(e,r):e,i=t.length-1,a;i>=0;i--)(a=t[i])&&(s=(n?a(e,r,s):a(s))||s);return n&&s&&Ua(e,r,s),s};const we="string",It="number",te=Symbol("__private__dont__use");var _t,nt,wt,st,Ye,xt,gr,Gr,xi,Kr,Bi,Jr,Gi,Yr,Ki,Qr,Ji,Zr,Yi,Xr,Qi,en,Zi,tn,Xi,rn,eo,nn,to,sn,ro;class Ge{constructor(e,r){ee(this,Gr);ee(this,Kr);ee(this,Jr);ee(this,Yr);ee(this,Qr);ee(this,Zr);ee(this,Xr);ee(this,en);ee(this,tn);ee(this,rn);ee(this,nn);ee(this,sn);ee(this,_t,void 0);ee(this,nt,void 0);ee(this,wt,void 0);ee(this,st,void 0);ee(this,Ye,void 0);ee(this,xt,void 0);ee(this,gr,void 0);pe(this,_t,[]),pe(this,nt,!1),pe(this,wt,null),pe(this,st,{}),pe(this,Ye,new Map),pe(this,xt,[]),pe(this,gr,new jn({concurrency:1})),e!==void 0&&this.initializeRuntime(e),r&&(this.requestHandler=new ka(new Ca(this,r)))}addEventListener(e,r){z(this,Ye).has(e)||z(this,Ye).set(e,new Set),z(this,Ye).get(e).add(r)}removeEventListener(e,r){var n;(n=z(this,Ye).get(e))==null||n.delete(r)}dispatchEvent(e){const r=z(this,Ye).get(e.type);if(r)for(const n of r)n(e)}async onMessage(e){z(this,xt).push(e)}async setSpawnHandler(e){this[te].spawnProcess=e}get absoluteUrl(){return this.requestHandler.requestHandler.absoluteUrl}get documentRoot(){return this.requestHandler.requestHandler.documentRoot}pathToInternalUrl(e){return this.requestHandler.requestHandler.pathToInternalUrl(e)}internalUrlToPath(e){return this.requestHandler.requestHandler.internalUrlToPath(e)}initializeRuntime(e){if(this[te])throw new Error("PHP runtime already initialized.");const r=Ma(e);if(!r)throw new Error("Invalid PHP runtime id.");this[te]=r,r.onMessage=async n=>{for(const s of z(this,xt)){const i=await s(n);if(i)return i}return""},pe(this,wt,_a(r))}setPhpIniPath(e){if(z(this,nt))throw new Error("Cannot set PHP ini path after calling run().");this[te].ccall("wasm_set_phpini_path",null,["string"],[e])}setPhpIniEntry(e,r){if(z(this,nt))throw new Error("Cannot set PHP ini entries after calling run().");z(this,_t).push([e,r])}chdir(e){this[te].FS.chdir(e)}async request(e,r){if(!this.requestHandler)throw new Error("No request handler available.");return this.requestHandler.request(e,r)}async run(e){const r=await z(this,gr).acquire();try{z(this,nt)||(_e(this,Gr,xi).call(this),pe(this,nt,!0)),_e(this,en,Zi).call(this,e.scriptPath||""),_e(this,Jr,Gi).call(this,e.relativeUri||""),_e(this,Qr,Ji).call(this,e.method||"GET");const n=no(e.headers||{}),s=n.host||"example.com:443";if(_e(this,Yr,Ki).call(this,s,e.protocol||"http"),_e(this,Zr,Yi).call(this,n),e.body&&_e(this,Xr,Qi).call(this,e.body),e.fileInfos)for(const i of e.fileInfos)_e(this,rn,eo).call(this,i);return e.code&&_e(this,nn,to).call(this," ?>"+e.code),_e(this,tn,Xi).call(this),await _e(this,sn,ro).call(this)}finally{r(),this.dispatchEvent({type:"request.end"})}}addServerGlobalEntry(e,r){z(this,st)[e]=r}defineConstant(e,r){let n={};try{n=JSON.parse(this.fileExists("/tmp/consts.json")&&this.readFileAsText("/tmp/consts.json")||"{}")}catch{}this.writeFile("/tmp/consts.json",JSON.stringify({...n,[e]:r}))}mkdir(e){this[te].FS.mkdirTree(e)}mkdirTree(e){this.mkdir(e)}readFileAsText(e){return new TextDecoder().decode(this.readFileAsBuffer(e))}readFileAsBuffer(e){return this[te].FS.readFile(e)}writeFile(e,r){this[te].FS.writeFile(e,r)}unlink(e){this[te].FS.unlink(e)}mv(e,r){try{this[te].FS.rename(e,r)}catch(n){const s=Fa(n);throw s?new Error(`Could not move ${e} to ${r}: ${s}`,{cause:n}):n}}rmdir(e,r={recursive:!0}){r!=null&&r.recursive&&this.listFiles(e).forEach(n=>{const s=`${e}/${n}`;this.isDir(s)?this.rmdir(s,r):this.unlink(s)}),this[te].FS.rmdir(e)}listFiles(e,r={prependPath:!1}){if(!this.fileExists(e))return[];try{const n=this[te].FS.readdir(e).filter(s=>s!=="."&&s!=="..");if(r.prependPath){const s=e.replace(/\/$/,"");return n.map(i=>`${s}/${i}`)}return n}catch(n){return console.error(n,{path:e}),[]}}isDir(e){return this.fileExists(e)?this[te].FS.isDir(this[te].FS.lookupPath(e).node.mode):!1}fileExists(e){try{return this[te].FS.lookupPath(e),!0}catch{return!1}}exit(e=0){return this[te]._exit(e)}}_t=new WeakMap,nt=new WeakMap,wt=new WeakMap,st=new WeakMap,Ye=new WeakMap,xt=new WeakMap,gr=new WeakMap,Gr=new WeakSet,xi=function(){if(this.setPhpIniEntry("auto_prepend_file","/tmp/consts.php"),this.fileExists("/tmp/consts.php")||this.writeFile("/tmp/consts.php",`<?php
840
+ `),l=i.substring(0,a).trim(),p=i.substring(a+4).trim(),u=l.match(/name="([^"]+)"/);if(u){const f=u[1];e[f]=p}}),e}function Na(t){switch(t.split(".").pop()){case"css":return"text/css";case"js":return"application/javascript";case"png":return"image/png";case"jpg":case"jpeg":return"image/jpeg";case"gif":return"image/gif";case"svg":return"image/svg+xml";case"woff":return"font/woff";case"woff2":return"font/woff2";case"ttf":return"font/ttf";case"otf":return"font/otf";case"eot":return"font/eot";case"ico":return"image/x-icon";case"html":return"text/html";case"json":return"application/json";case"xml":return"application/xml";case"txt":case"md":return"text/plain";default:return"application-octet-stream"}}function Ca(t){return ja(t)||Ia(t)}function ja(t){return t.endsWith(".php")||t.includes(".php/")}function Ia(t){return!t.split("/").pop().includes(".")}const qr={0:"No error occurred. System call completed successfully.",1:"Argument list too long.",2:"Permission denied.",3:"Address in use.",4:"Address not available.",5:"Address family not supported.",6:"Resource unavailable, or operation would block.",7:"Connection already in progress.",8:"Bad file descriptor.",9:"Bad message.",10:"Device or resource busy.",11:"Operation canceled.",12:"No child processes.",13:"Connection aborted.",14:"Connection refused.",15:"Connection reset.",16:"Resource deadlock would occur.",17:"Destination address required.",18:"Mathematics argument out of domain of function.",19:"Reserved.",20:"File exists.",21:"Bad address.",22:"File too large.",23:"Host is unreachable.",24:"Identifier removed.",25:"Illegal byte sequence.",26:"Operation in progress.",27:"Interrupted function.",28:"Invalid argument.",29:"I/O error.",30:"Socket is connected.",31:"There is a directory under that path.",32:"Too many levels of symbolic links.",33:"File descriptor value too large.",34:"Too many links.",35:"Message too large.",36:"Reserved.",37:"Filename too long.",38:"Network is down.",39:"Connection aborted by network.",40:"Network unreachable.",41:"Too many files open in system.",42:"No buffer space available.",43:"No such device.",44:"There is no such file or directory OR the parent directory does not exist.",45:"Executable file format error.",46:"No locks available.",47:"Reserved.",48:"Not enough space.",49:"No message of the desired type.",50:"Protocol not available.",51:"No space left on device.",52:"Function not supported.",53:"The socket is not connected.",54:"Not a directory or a symbolic link to a directory.",55:"Directory not empty.",56:"State not recoverable.",57:"Not a socket.",58:"Not supported, or operation not supported on socket.",59:"Inappropriate I/O control operation.",60:"No such device or address.",61:"Value too large to be stored in data type.",62:"Previous owner died.",63:"Operation not permitted.",64:"Broken pipe.",65:"Protocol error.",66:"Protocol not supported.",67:"Protocol wrong type for socket.",68:"Result too large.",69:"Read-only file system.",70:"Invalid seek.",71:"No such process.",72:"Reserved.",73:"Connection timed out.",74:"Text file busy.",75:"Cross-device link.",76:"Extension: Capabilities insufficient."};function Da(t){const e=typeof t=="object"?t==null?void 0:t.errno:null;if(e in qr)return qr[e]}function xe(t=""){return function(r,n,s){const i=s.value;s.value=function(...a){try{return i.apply(this,a)}catch(l){const p=typeof l=="object"?l==null?void 0:l.errno:null;if(p in qr){const u=qr[p],f=typeof a[0]=="string"?a[0]:null,y=f!==null?t.replaceAll("{path}",f):t;throw new Error(`${y}: ${u}`,{cause:l})}throw l}}}}const Aa=new Map;function Fa(t){return Aa.get(t)}(function(){var t;return typeof process<"u"&&((t=process.release)==null?void 0:t.name)==="node"?"NODE":typeof window<"u"?"WEB":typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?"WORKER":"NODE"})();var qa=Object.defineProperty,Ma=Object.getOwnPropertyDescriptor,Be=(t,e,r,n)=>{for(var s=n>1?void 0:n?Ma(e,r):e,i=t.length-1,a;i>=0;i--)(a=t[i])&&(s=(n?a(e,r,s):a(s))||s);return n&&s&&qa(e,r,s),s};const ve="string",It="number",te=Symbol("__private__dont__use");var _t,nt,vt,st,Ye,xt,gr,Br,Wi,Gr,xi,Kr,Bi,Jr,Gi,Yr,Ki,Qr,Ji,Zr,Yi,Xr,Qi,en,Zi,tn,Xi,rn,eo,nn,to;class Ge{constructor(e,r){ee(this,Br);ee(this,Gr);ee(this,Kr);ee(this,Jr);ee(this,Yr);ee(this,Qr);ee(this,Zr);ee(this,Xr);ee(this,en);ee(this,tn);ee(this,rn);ee(this,nn);ee(this,_t,void 0);ee(this,nt,void 0);ee(this,vt,void 0);ee(this,st,void 0);ee(this,Ye,void 0);ee(this,xt,void 0);ee(this,gr,void 0);pe(this,_t,[]),pe(this,nt,!1),pe(this,vt,null),pe(this,st,{}),pe(this,Ye,new Map),pe(this,xt,[]),pe(this,gr,new jn({concurrency:1})),e!==void 0&&this.initializeRuntime(e),r&&(this.requestHandler=new Sa(new Ra(this,r)))}addEventListener(e,r){z(this,Ye).has(e)||z(this,Ye).set(e,new Set),z(this,Ye).get(e).add(r)}removeEventListener(e,r){var n;(n=z(this,Ye).get(e))==null||n.delete(r)}dispatchEvent(e){const r=z(this,Ye).get(e.type);if(r)for(const n of r)n(e)}async onMessage(e){z(this,xt).push(e)}async setSpawnHandler(e){this[te].spawnProcess=e}get absoluteUrl(){return this.requestHandler.requestHandler.absoluteUrl}get documentRoot(){return this.requestHandler.requestHandler.documentRoot}pathToInternalUrl(e){return this.requestHandler.requestHandler.pathToInternalUrl(e)}internalUrlToPath(e){return this.requestHandler.requestHandler.internalUrlToPath(e)}initializeRuntime(e){if(this[te])throw new Error("PHP runtime already initialized.");const r=Fa(e);if(!r)throw new Error("Invalid PHP runtime id.");this[te]=r,r.onMessage=async n=>{for(const s of z(this,xt)){const i=await s(n);if(i)return i}return""},pe(this,vt,ga(r))}setPhpIniPath(e){if(z(this,nt))throw new Error("Cannot set PHP ini path after calling run().");this[te].ccall("wasm_set_phpini_path",null,["string"],[e])}setPhpIniEntry(e,r){if(z(this,nt))throw new Error("Cannot set PHP ini entries after calling run().");z(this,_t).push([e,r])}chdir(e){this[te].FS.chdir(e)}async request(e,r){if(!this.requestHandler)throw new Error("No request handler available.");return this.requestHandler.request(e,r)}async run(e){const r=await z(this,gr).acquire();try{z(this,nt)||(_e(this,Br,Wi).call(this),pe(this,nt,!0)),_e(this,Xr,Qi).call(this,e.scriptPath||""),_e(this,Kr,Bi).call(this,e.relativeUri||""),_e(this,Yr,Ki).call(this,e.method||"GET");const n=ro(e.headers||{}),s=n.host||"example.com:443";if(_e(this,Jr,Gi).call(this,s,e.protocol||"http"),_e(this,Qr,Ji).call(this,n),e.body&&_e(this,Zr,Yi).call(this,e.body),e.fileInfos)for(const i of e.fileInfos)_e(this,tn,Xi).call(this,i);return e.code&&_e(this,rn,eo).call(this," ?>"+e.code),_e(this,en,Zi).call(this),await _e(this,nn,to).call(this)}finally{r(),this.dispatchEvent({type:"request.end"})}}addServerGlobalEntry(e,r){z(this,st)[e]=r}defineConstant(e,r){let n={};try{n=JSON.parse(this.fileExists("/tmp/consts.json")&&this.readFileAsText("/tmp/consts.json")||"{}")}catch{}this.writeFile("/tmp/consts.json",JSON.stringify({...n,[e]:r}))}mkdir(e){this[te].FS.mkdirTree(e)}mkdirTree(e){this.mkdir(e)}readFileAsText(e){return new TextDecoder().decode(this.readFileAsBuffer(e))}readFileAsBuffer(e){return this[te].FS.readFile(e)}writeFile(e,r){this[te].FS.writeFile(e,r)}unlink(e){this[te].FS.unlink(e)}mv(e,r){try{this[te].FS.rename(e,r)}catch(n){const s=Da(n);throw s?new Error(`Could not move ${e} to ${r}: ${s}`,{cause:n}):n}}rmdir(e,r={recursive:!0}){r!=null&&r.recursive&&this.listFiles(e).forEach(n=>{const s=`${e}/${n}`;this.isDir(s)?this.rmdir(s,r):this.unlink(s)}),this[te].FS.rmdir(e)}listFiles(e,r={prependPath:!1}){if(!this.fileExists(e))return[];try{const n=this[te].FS.readdir(e).filter(s=>s!=="."&&s!=="..");if(r.prependPath){const s=e.replace(/\/$/,"");return n.map(i=>`${s}/${i}`)}return n}catch(n){return console.error(n,{path:e}),[]}}isDir(e){return this.fileExists(e)?this[te].FS.isDir(this[te].FS.lookupPath(e).node.mode):!1}fileExists(e){try{return this[te].FS.lookupPath(e),!0}catch{return!1}}exit(e=0){return this[te]._exit(e)}}_t=new WeakMap,nt=new WeakMap,vt=new WeakMap,st=new WeakMap,Ye=new WeakMap,xt=new WeakMap,gr=new WeakMap,Br=new WeakSet,Wi=function(){if(this.setPhpIniEntry("auto_prepend_file","/tmp/consts.php"),this.fileExists("/tmp/consts.php")||this.writeFile("/tmp/consts.php",`<?php
885
841
  if(file_exists('/tmp/consts.json')) {
886
842
  $consts = json_decode(file_get_contents('/tmp/consts.json'), true);
887
843
  foreach ($consts as $const => $value) {
@@ -892,16 +848,16 @@ ${Pa} WASM ERROR${Ls}${Us}`);for(const e of t.split(`
892
848
  }`),z(this,_t).length>0){const e=z(this,_t).map(([r,n])=>`${r}=${n}`).join(`
893
849
  `)+`
894
850
 
895
- `;this[te].ccall("wasm_set_phpini_entries",null,[we],[e])}this[te].ccall("php_wasm_init",null,[],[])},Kr=new WeakSet,Bi=function(){const e="/tmp/headers.json";if(!this.fileExists(e))throw new Error("SAPI Error: Could not find response headers file.");const r=JSON.parse(this.readFileAsText(e)),n={};for(const s of r.headers){if(!s.includes(": "))continue;const i=s.indexOf(": "),a=s.substring(0,i).toLowerCase(),l=s.substring(i+2);a in n||(n[a]=[]),n[a].push(l)}return{headers:n,httpStatusCode:r.status}},Jr=new WeakSet,Gi=function(e){if(this[te].ccall("wasm_set_request_uri",null,[we],[e]),e.includes("?")){const r=e.substring(e.indexOf("?")+1);this[te].ccall("wasm_set_query_string",null,[we],[r])}},Yr=new WeakSet,Ki=function(e,r){this[te].ccall("wasm_set_request_host",null,[we],[e]);let n;try{n=parseInt(new URL(e).port,10)}catch{}(!n||isNaN(n)||n===80)&&(n=r==="https"?443:80),this[te].ccall("wasm_set_request_port",null,[It],[n]),(r==="https"||!r&&n===443)&&this.addServerGlobalEntry("HTTPS","on")},Qr=new WeakSet,Ji=function(e){this[te].ccall("wasm_set_request_method",null,[we],[e])},Zr=new WeakSet,Yi=function(e){e.cookie&&this[te].ccall("wasm_set_cookies",null,[we],[e.cookie]),e["content-type"]&&this[te].ccall("wasm_set_content_type",null,[we],[e["content-type"]]),e["content-length"]&&this[te].ccall("wasm_set_content_length",null,[It],[parseInt(e["content-length"],10)]);for(const r in e){let n="HTTP_";["content-type","content-length"].includes(r.toLowerCase())&&(n=""),this.addServerGlobalEntry(`${n}${r.toUpperCase().replace(/-/g,"_")}`,e[r])}},Xr=new WeakSet,Qi=function(e){this[te].ccall("wasm_set_request_body",null,[we],[e]),this[te].ccall("wasm_set_content_length",null,[It],[new TextEncoder().encode(e).length])},en=new WeakSet,Zi=function(e){this[te].ccall("wasm_set_path_translated",null,[we],[e])},tn=new WeakSet,Xi=function(){for(const e in z(this,st))this[te].ccall("wasm_add_SERVER_entry",null,[we,we],[e,z(this,st)[e]])},rn=new WeakSet,eo=function(e){const{key:r,name:n,type:s,data:i}=e,a=`/tmp/${Math.random().toFixed(20)}`;this.writeFile(a,i);const l=0;this[te].ccall("wasm_add_uploaded_file",null,[we,we,we,we,It,It],[r,n,s,a,l,i.byteLength])},nn=new WeakSet,to=function(e){this[te].ccall("wasm_set_php_code",null,[we],[e])},sn=new WeakSet,ro=async function(){var i;let e,r;try{e=await new Promise((a,l)=>{var u;r=f=>{const y=new Error("Rethrown");y.cause=f.error,y.betterMessage=f.message,l(y)},(u=z(this,wt))==null||u.addEventListener("error",r);const p=this[te].ccall("wasm_sapi_handle_request",It,[],[],{async:!0});return p instanceof Promise?p.then(a,l):a(p)})}catch(a){for(const f in this)typeof this[f]=="function"&&(this[f]=()=>{throw new Error("PHP runtime has crashed – see the earlier error for details.")});this.functionsMaybeMissingFromAsyncify=wa();const l=a,p="betterMessage"in l?l.betterMessage:l.message,u=new Error(p);throw u.cause=l,u}finally{(i=z(this,wt))==null||i.removeEventListener("error",r),pe(this,st,{})}const{headers:n,httpStatusCode:s}=_e(this,Kr,Bi).call(this);return new Mt(s,n,this.readFileAsBuffer("/tmp/stdout"),this.readFileAsText("/tmp/stderr"),e)};Be([xe('Could not create directory "{path}"')],Ge.prototype,"mkdir",1);Be([xe('Could not create directory "{path}"')],Ge.prototype,"mkdirTree",1);Be([xe('Could not read "{path}"')],Ge.prototype,"readFileAsText",1);Be([xe('Could not read "{path}"')],Ge.prototype,"readFileAsBuffer",1);Be([xe('Could not write to "{path}"')],Ge.prototype,"writeFile",1);Be([xe('Could not unlink "{path}"')],Ge.prototype,"unlink",1);Be([xe('Could not remove directory "{path}"')],Ge.prototype,"rmdir",1);Be([xe('Could not list files in "{path}"')],Ge.prototype,"listFiles",1);Be([xe('Could not stat "{path}"')],Ge.prototype,"isDir",1);Be([xe('Could not stat "{path}"')],Ge.prototype,"fileExists",1);function no(t){const e={};for(const r in t)e[r.toLowerCase()]=t[r];return e}const Ha=["vfs","literal","wordpress.org/themes","wordpress.org/plugins","url"];function za(t){return t&&typeof t=="object"&&typeof t.resource=="string"&&Ha.includes(t.resource)}class Pt{static create(e,{semaphore:r,progress:n}){let s;switch(e.resource){case"vfs":s=new Va(e,n);break;case"literal":s=new Wa(e,n);break;case"wordpress.org/themes":s=new Ga(e,n);break;case"wordpress.org/plugins":s=new Ka(e,n);break;case"url":s=new Ba(e,n);break;default:throw new Error(`Invalid resource: ${e}`)}return s=new Ja(s),r&&(s=new Ya(s,r)),s}setPlayground(e){this.playground=e}get isAsync(){return!1}}class Va extends Pt{constructor(e,r){super(),this.resource=e,this.progress=r}async resolve(){var r;const e=await this.playground.readFileAsBuffer(this.resource.path);return(r=this.progress)==null||r.set(100),new File([e],this.name)}get name(){return this.resource.path.split("/").pop()||""}}class Wa extends Pt{constructor(e,r){super(),this.resource=e,this.progress=r}async resolve(){var e;return(e=this.progress)==null||e.set(100),new File([this.resource.contents],this.resource.name)}get name(){return this.resource.name}}class qn extends Pt{constructor(e){super(),this.progress=e}async resolve(){var n,s;(n=this.progress)==null||n.setCaption(this.caption);const e=this.getURL();let r=await fetch(e);if(r=await ma(r,((s=this.progress)==null?void 0:s.loadingListener)??xa),r.status!==200)throw new Error(`Could not download "${e}"`);return new File([await r.blob()],this.name)}get caption(){return`Downloading ${this.name}`}get name(){try{return new URL(this.getURL(),"http://example.com").pathname.split("/").pop()}catch{return this.getURL()}}get isAsync(){return!0}}const xa=()=>{};class Ba extends qn{constructor(e,r){super(r),this.resource=e}getURL(){return this.resource.url}get caption(){return this.resource.caption??super.caption}}class Ga extends qn{constructor(e,r){super(r),this.resource=e}get name(){return cn(this.resource.slug)}getURL(){return`https://downloads.wordpress.org/theme/${so(this.resource.slug)}`}}class Ka extends qn{constructor(e,r){super(r),this.resource=e}get name(){return cn(this.resource.slug)}getURL(){return`https://downloads.wordpress.org/plugin/${so(this.resource.slug)}`}}function so(t){return!t||t.endsWith(".zip")?t:t+".latest-stable.zip"}class io extends Pt{constructor(e){super(),this.resource=e}async resolve(){return this.resource.resolve()}async setPlayground(e){return this.resource.setPlayground(e)}get progress(){return this.resource.progress}set progress(e){this.resource.progress=e}get name(){return this.resource.name}get isAsync(){return this.resource.isAsync}}class Ja extends io{async resolve(){return this.promise||(this.promise=super.resolve()),this.promise}}class Ya extends io{constructor(e,r){super(e),this.semaphore=r}async resolve(){return this.isAsync?this.semaphore.run(()=>super.resolve()):super.resolve()}}var Qa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Za(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var bn={exports:{}},oo={},De={},Bt={},$r={},G={},mr={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class e{}t._CodeOrName=e,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends e{constructor(T){if(super(),!t.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}}}t.Name=r;class n extends e{constructor(T){super(),this._items=typeof T=="string"?[T]:T}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const T=this._items[0];return T===""||T==='""'}get str(){var T;return(T=this._str)!==null&&T!==void 0?T:this._str=this._items.reduce((O,j)=>`${O}${j}`,"")}get names(){var T;return(T=this._names)!==null&&T!==void 0?T:this._names=this._items.reduce((O,j)=>(j instanceof r&&(O[j.str]=(O[j.str]||0)+1),O),{})}}t._Code=n,t.nil=new n("");function s(g,...T){const O=[g[0]];let j=0;for(;j<T.length;)l(O,T[j]),O.push(g[++j]);return new n(O)}t._=s;const i=new n("+");function a(g,...T){const O=[R(g[0])];let j=0;for(;j<T.length;)O.push(i),l(O,T[j]),O.push(i,R(g[++j]));return p(O),new n(O)}t.str=a;function l(g,T){T instanceof n?g.push(...T._items):T instanceof r?g.push(T):g.push(y(T))}t.addCodeArg=l;function p(g){let T=1;for(;T<g.length-1;){if(g[T]===i){const O=u(g[T-1],g[T+1]);if(O!==void 0){g.splice(T-1,3,O);continue}g[T++]="+"}T++}}function u(g,T){if(T==='""')return g;if(g==='""')return T;if(typeof g=="string")return T instanceof r||g[g.length-1]!=='"'?void 0:typeof T!="string"?`${g.slice(0,-1)}${T}"`:T[0]==='"'?g.slice(0,-1)+T.slice(1):void 0;if(typeof T=="string"&&T[0]==='"'&&!(g instanceof r))return`"${g}${T.slice(1)}`}function f(g,T){return T.emptyStr()?g:g.emptyStr()?T:a`${g}${T}`}t.strConcat=f;function y(g){return typeof g=="number"||typeof g=="boolean"||g===null?g:R(Array.isArray(g)?g.join(","):g)}function k(g){return new n(R(g))}t.stringify=k;function R(g){return JSON.stringify(g).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.safeStringify=R;function w(g){return typeof g=="string"&&t.IDENTIFIER.test(g)?new n(`.${g}`):s`[${g}]`}t.getProperty=w;function S(g){if(typeof g=="string"&&t.IDENTIFIER.test(g))return new n(`${g}`);throw new Error(`CodeGen: invalid export name: ${g}, use explicit $id name mapping`)}t.getEsmExportName=S;function _(g){return new n(g.toString())}t.regexpCode=_})(mr);var Pn={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const e=mr;class r extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}}var n;(function(p){p[p.Started=0]="Started",p[p.Completed=1]="Completed"})(n=t.UsedValueState||(t.UsedValueState={})),t.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};class s{constructor({prefixes:u,parent:f}={}){this._names={},this._prefixes=u,this._parent=f}toName(u){return u instanceof e.Name?u:this.name(u)}name(u){return new e.Name(this._newName(u))}_newName(u){const f=this._names[u]||this._nameGroup(u);return`${u}${f.index++}`}_nameGroup(u){var f,y;if(!((y=(f=this._parent)===null||f===void 0?void 0:f._prefixes)===null||y===void 0)&&y.has(u)||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}}t.Scope=s;class i extends e.Name{constructor(u,f){super(f),this.prefix=u}setValue(u,{property:f,itemIndex:y}){this.value=u,this.scopePath=(0,e._)`.${new e.Name(f)}[${y}]`}}t.ValueScopeName=i;const a=(0,e._)`\n`;class l extends s{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts={...u,_n:u.lines?a:e.nil}}get(){return this._scope}name(u){return new i(u,this._newName(u))}value(u,f){var y;if(f.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const k=this.toName(u),{prefix:R}=k,w=(y=f.key)!==null&&y!==void 0?y:f.ref;let S=this._values[R];if(S){const T=S.get(w);if(T)return T}else S=this._values[R]=new Map;S.set(w,k);const _=this._scope[R]||(this._scope[R]=[]),g=_.length;return _[g]=f.ref,k.setValue(f,{property:R,itemIndex:g}),k}getValue(u,f){const y=this._values[u];if(y)return y.get(f)}scopeRefs(u,f=this._values){return this._reduceValues(f,y=>{if(y.scopePath===void 0)throw new Error(`CodeGen: name "${y}" has no value`);return(0,e._)`${u}${y.scopePath}`})}scopeCode(u=this._values,f,y){return this._reduceValues(u,k=>{if(k.value===void 0)throw new Error(`CodeGen: name "${k}" has no value`);return k.value.code},f,y)}_reduceValues(u,f,y={},k){let R=e.nil;for(const w in u){const S=u[w];if(!S)continue;const _=y[w]=y[w]||new Map;S.forEach(g=>{if(_.has(g))return;_.set(g,n.Started);let T=f(g);if(T){const O=this.opts.es5?t.varKinds.var:t.varKinds.const;R=(0,e._)`${R}${O} ${g} = ${T};${this.opts._n}`}else if(T=k==null?void 0:k(g))R=(0,e._)`${R}${T}${this.opts._n}`;else throw new r(g);_.set(g,n.Completed)})}return R}}t.ValueScope=l})(Pn);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const e=mr,r=Pn;var n=mr;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return n.Name}});var s=Pn;Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),t.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class i{optimizeNodes(){return this}optimizeNames(o,h){return this}}class a extends i{constructor(o,h,N){super(),this.varKind=o,this.name=h,this.rhs=N}render({es5:o,_n:h}){const N=o?r.varKinds.var:this.varKind,q=this.rhs===void 0?"":` = ${this.rhs}`;return`${N} ${this.name}${q};`+h}optimizeNames(o,h){if(o[this.name.str])return this.rhs&&(this.rhs=he(this.rhs,o,h)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class l extends i{constructor(o,h,N){super(),this.lhs=o,this.rhs=h,this.sideEffects=N}render({_n:o}){return`${this.lhs} = ${this.rhs};`+o}optimizeNames(o,h){if(!(this.lhs instanceof e.Name&&!o[this.lhs.str]&&!this.sideEffects))return this.rhs=he(this.rhs,o,h),this}get names(){const o=this.lhs instanceof e.Name?{}:{...this.lhs.names};return ke(o,this.rhs)}}class p extends l{constructor(o,h,N,q){super(o,N,q),this.op=h}render({_n:o}){return`${this.lhs} ${this.op}= ${this.rhs};`+o}}class u extends i{constructor(o){super(),this.label=o,this.names={}}render({_n:o}){return`${this.label}:`+o}}class f extends i{constructor(o){super(),this.label=o,this.names={}}render({_n:o}){return`break${this.label?` ${this.label}`:""};`+o}}class y extends i{constructor(o){super(),this.error=o}render({_n:o}){return`throw ${this.error};`+o}get names(){return this.error.names}}class k extends i{constructor(o){super(),this.code=o}render({_n:o}){return`${this.code};`+o}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(o,h){return this.code=he(this.code,o,h),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class R extends i{constructor(o=[]){super(),this.nodes=o}render(o){return this.nodes.reduce((h,N)=>h+N.render(o),"")}optimizeNodes(){const{nodes:o}=this;let h=o.length;for(;h--;){const N=o[h].optimizeNodes();Array.isArray(N)?o.splice(h,1,...N):N?o[h]=N:o.splice(h,1)}return o.length>0?this:void 0}optimizeNames(o,h){const{nodes:N}=this;let q=N.length;for(;q--;){const M=N[q];M.optimizeNames(o,h)||(at(o,M.names),N.splice(q,1))}return N.length>0?this:void 0}get names(){return this.nodes.reduce((o,h)=>Z(o,h.names),{})}}class w extends R{render(o){return"{"+o._n+super.render(o)+"}"+o._n}}class S extends R{}class _ extends w{}_.kind="else";class g extends w{constructor(o,h){super(h),this.condition=o}render(o){let h=`if(${this.condition})`+super.render(o);return this.else&&(h+="else "+this.else.render(o)),h}optimizeNodes(){super.optimizeNodes();const o=this.condition;if(o===!0)return this.nodes;let h=this.else;if(h){const N=h.optimizeNodes();h=this.else=Array.isArray(N)?new _(N):N}if(h)return o===!1?h instanceof g?h:h.nodes:this.nodes.length?this:new g(ct(o),h instanceof g?[h]:h.nodes);if(!(o===!1||!this.nodes.length))return this}optimizeNames(o,h){var N;if(this.else=(N=this.else)===null||N===void 0?void 0:N.optimizeNames(o,h),!!(super.optimizeNames(o,h)||this.else))return this.condition=he(this.condition,o,h),this}get names(){const o=super.names;return ke(o,this.condition),this.else&&Z(o,this.else.names),o}}g.kind="if";class T extends w{}T.kind="for";class O extends T{constructor(o){super(),this.iteration=o}render(o){return`for(${this.iteration})`+super.render(o)}optimizeNames(o,h){if(super.optimizeNames(o,h))return this.iteration=he(this.iteration,o,h),this}get names(){return Z(super.names,this.iteration.names)}}class j extends T{constructor(o,h,N,q){super(),this.varKind=o,this.name=h,this.from=N,this.to=q}render(o){const h=o.es5?r.varKinds.var:this.varKind,{name:N,from:q,to:M}=this;return`for(${h} ${N}=${q}; ${N}<${M}; ${N}++)`+super.render(o)}get names(){const o=ke(super.names,this.from);return ke(o,this.to)}}class A extends T{constructor(o,h,N,q){super(),this.loop=o,this.varKind=h,this.name=N,this.iterable=q}render(o){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(o)}optimizeNames(o,h){if(super.optimizeNames(o,h))return this.iterable=he(this.iterable,o,h),this}get names(){return Z(super.names,this.iterable.names)}}class v extends w{constructor(o,h,N){super(),this.name=o,this.args=h,this.async=N}render(o){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(o)}}v.kind="func";class C extends R{render(o){return"return "+super.render(o)}}C.kind="return";class D extends w{render(o){let h="try"+super.render(o);return this.catch&&(h+=this.catch.render(o)),this.finally&&(h+=this.finally.render(o)),h}optimizeNodes(){var o,h;return super.optimizeNodes(),(o=this.catch)===null||o===void 0||o.optimizeNodes(),(h=this.finally)===null||h===void 0||h.optimizeNodes(),this}optimizeNames(o,h){var N,q;return super.optimizeNames(o,h),(N=this.catch)===null||N===void 0||N.optimizeNames(o,h),(q=this.finally)===null||q===void 0||q.optimizeNames(o,h),this}get names(){const o=super.names;return this.catch&&Z(o,this.catch.names),this.finally&&Z(o,this.finally.names),o}}class W extends w{constructor(o){super(),this.error=o}render(o){return`catch(${this.error})`+super.render(o)}}W.kind="catch";class K extends w{render(o){return"finally"+super.render(o)}}K.kind="finally";class ce{constructor(o,h={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...h,_n:h.lines?`
896
- `:""},this._extScope=o,this._scope=new r.Scope({parent:o}),this._nodes=[new S]}toString(){return this._root.render(this.opts)}name(o){return this._scope.name(o)}scopeName(o){return this._extScope.name(o)}scopeValue(o,h){const N=this._extScope.value(o,h);return(this._values[N.prefix]||(this._values[N.prefix]=new Set)).add(N),N}getScopeValue(o,h){return this._extScope.getValue(o,h)}scopeRefs(o){return this._extScope.scopeRefs(o,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(o,h,N,q){const M=this._scope.toName(h);return N!==void 0&&q&&(this._constants[M.str]=N),this._leafNode(new a(o,M,N)),M}const(o,h,N){return this._def(r.varKinds.const,o,h,N)}let(o,h,N){return this._def(r.varKinds.let,o,h,N)}var(o,h,N){return this._def(r.varKinds.var,o,h,N)}assign(o,h,N){return this._leafNode(new l(o,h,N))}add(o,h){return this._leafNode(new p(o,t.operators.ADD,h))}code(o){return typeof o=="function"?o():o!==e.nil&&this._leafNode(new k(o)),this}object(...o){const h=["{"];for(const[N,q]of o)h.length>1&&h.push(","),h.push(N),(N!==q||this.opts.es5)&&(h.push(":"),(0,e.addCodeArg)(h,q));return h.push("}"),new e._Code(h)}if(o,h,N){if(this._blockNode(new g(o)),h&&N)this.code(h).else().code(N).endIf();else if(h)this.code(h).endIf();else if(N)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(o){return this._elseNode(new g(o))}else(){return this._elseNode(new _)}endIf(){return this._endBlockNode(g,_)}_for(o,h){return this._blockNode(o),h&&this.code(h).endFor(),this}for(o,h){return this._for(new O(o),h)}forRange(o,h,N,q,M=this.opts.es5?r.varKinds.var:r.varKinds.let){const J=this._scope.toName(o);return this._for(new j(M,J,h,N),()=>q(J))}forOf(o,h,N,q=r.varKinds.const){const M=this._scope.toName(o);if(this.opts.es5){const J=h instanceof e.Name?h:this.var("_arr",h);return this.forRange("_i",0,(0,e._)`${J}.length`,Q=>{this.var(M,(0,e._)`${J}[${Q}]`),N(M)})}return this._for(new A("of",q,M,h),()=>N(M))}forIn(o,h,N,q=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(o,(0,e._)`Object.keys(${h})`,N);const M=this._scope.toName(o);return this._for(new A("in",q,M,h),()=>N(M))}endFor(){return this._endBlockNode(T)}label(o){return this._leafNode(new u(o))}break(o){return this._leafNode(new f(o))}return(o){const h=new C;if(this._blockNode(h),this.code(o),h.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(C)}try(o,h,N){if(!h&&!N)throw new Error('CodeGen: "try" without "catch" and "finally"');const q=new D;if(this._blockNode(q),this.code(o),h){const M=this.name("e");this._currNode=q.catch=new W(M),h(M)}return N&&(this._currNode=q.finally=new K,this.code(N)),this._endBlockNode(W,K)}throw(o){return this._leafNode(new y(o))}block(o,h){return this._blockStarts.push(this._nodes.length),o&&this.code(o).endBlock(h),this}endBlock(o){const h=this._blockStarts.pop();if(h===void 0)throw new Error("CodeGen: not in self-balancing block");const N=this._nodes.length-h;if(N<0||o!==void 0&&N!==o)throw new Error(`CodeGen: wrong number of nodes: ${N} vs ${o} expected`);return this._nodes.length=h,this}func(o,h=e.nil,N,q){return this._blockNode(new v(o,h,N)),q&&this.code(q).endFunc(),this}endFunc(){return this._endBlockNode(v)}optimize(o=1){for(;o-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(o){return this._currNode.nodes.push(o),this}_blockNode(o){this._currNode.nodes.push(o),this._nodes.push(o)}_endBlockNode(o,h){const N=this._currNode;if(N instanceof o||h&&N instanceof h)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${h?`${o.kind}/${h.kind}`:o.kind}"`)}_elseNode(o){const h=this._currNode;if(!(h instanceof g))throw new Error('CodeGen: "else" without "if"');return this._currNode=h.else=o,this}get _root(){return this._nodes[0]}get _currNode(){const o=this._nodes;return o[o.length-1]}set _currNode(o){const h=this._nodes;h[h.length-1]=o}}t.CodeGen=ce;function Z(b,o){for(const h in o)b[h]=(b[h]||0)+(o[h]||0);return b}function ke(b,o){return o instanceof e._CodeOrName?Z(b,o.names):b}function he(b,o,h){if(b instanceof e.Name)return N(b);if(!q(b))return b;return new e._Code(b._items.reduce((M,J)=>(J instanceof e.Name&&(J=N(J)),J instanceof e._Code?M.push(...J._items):M.push(J),M),[]));function N(M){const J=h[M.str];return J===void 0||o[M.str]!==1?M:(delete o[M.str],J)}function q(M){return M instanceof e._Code&&M._items.some(J=>J instanceof e.Name&&o[J.str]===1&&h[J.str]!==void 0)}}function at(b,o){for(const h in o)b[h]=(b[h]||0)-(o[h]||0)}function ct(b){return typeof b=="boolean"||typeof b=="number"||b===null?!b:(0,e._)`!${I(b)}`}t.not=ct;const Et=$(t.operators.AND);function Yt(...b){return b.reduce(Et)}t.and=Yt;const St=$(t.operators.OR);function F(...b){return b.reduce(St)}t.or=F;function $(b){return(o,h)=>o===e.nil?h:h===e.nil?o:(0,e._)`${I(o)} ${b} ${I(h)}`}function I(b){return b instanceof e.Name?b:(0,e._)`(${b})`}})(G);var re={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const e=G,r=mr;function n(v){const C={};for(const D of v)C[D]=!0;return C}t.toHash=n;function s(v,C){return typeof C=="boolean"?C:Object.keys(C).length===0?!0:(i(v,C),!a(C,v.self.RULES.all))}t.alwaysValidSchema=s;function i(v,C=v.schema){const{opts:D,self:W}=v;if(!D.strictSchema||typeof C=="boolean")return;const K=W.RULES.keywords;for(const ce in C)K[ce]||A(v,`unknown keyword: "${ce}"`)}t.checkUnknownRules=i;function a(v,C){if(typeof v=="boolean")return!v;for(const D in v)if(C[D])return!0;return!1}t.schemaHasRules=a;function l(v,C){if(typeof v=="boolean")return!v;for(const D in v)if(D!=="$ref"&&C.all[D])return!0;return!1}t.schemaHasRulesButRef=l;function p({topSchemaRef:v,schemaPath:C},D,W,K){if(!K){if(typeof D=="number"||typeof D=="boolean")return D;if(typeof D=="string")return(0,e._)`${D}`}return(0,e._)`${v}${C}${(0,e.getProperty)(W)}`}t.schemaRefOrVal=p;function u(v){return k(decodeURIComponent(v))}t.unescapeFragment=u;function f(v){return encodeURIComponent(y(v))}t.escapeFragment=f;function y(v){return typeof v=="number"?`${v}`:v.replace(/~/g,"~0").replace(/\//g,"~1")}t.escapeJsonPointer=y;function k(v){return v.replace(/~1/g,"/").replace(/~0/g,"~")}t.unescapeJsonPointer=k;function R(v,C){if(Array.isArray(v))for(const D of v)C(D);else C(v)}t.eachItem=R;function w({mergeNames:v,mergeToName:C,mergeValues:D,resultToName:W}){return(K,ce,Z,ke)=>{const he=Z===void 0?ce:Z instanceof e.Name?(ce instanceof e.Name?v(K,ce,Z):C(K,ce,Z),Z):ce instanceof e.Name?(C(K,Z,ce),ce):D(ce,Z);return ke===e.Name&&!(he instanceof e.Name)?W(K,he):he}}t.mergeEvaluated={props:w({mergeNames:(v,C,D)=>v.if((0,e._)`${D} !== true && ${C} !== undefined`,()=>{v.if((0,e._)`${C} === true`,()=>v.assign(D,!0),()=>v.assign(D,(0,e._)`${D} || {}`).code((0,e._)`Object.assign(${D}, ${C})`))}),mergeToName:(v,C,D)=>v.if((0,e._)`${D} !== true`,()=>{C===!0?v.assign(D,!0):(v.assign(D,(0,e._)`${D} || {}`),_(v,D,C))}),mergeValues:(v,C)=>v===!0?!0:{...v,...C},resultToName:S}),items:w({mergeNames:(v,C,D)=>v.if((0,e._)`${D} !== true && ${C} !== undefined`,()=>v.assign(D,(0,e._)`${C} === true ? true : ${D} > ${C} ? ${D} : ${C}`)),mergeToName:(v,C,D)=>v.if((0,e._)`${D} !== true`,()=>v.assign(D,C===!0?!0:(0,e._)`${D} > ${C} ? ${D} : ${C}`)),mergeValues:(v,C)=>v===!0?!0:Math.max(v,C),resultToName:(v,C)=>v.var("items",C)})};function S(v,C){if(C===!0)return v.var("props",!0);const D=v.var("props",(0,e._)`{}`);return C!==void 0&&_(v,D,C),D}t.evaluatedPropsToName=S;function _(v,C,D){Object.keys(D).forEach(W=>v.assign((0,e._)`${C}${(0,e.getProperty)(W)}`,!0))}t.setEvaluated=_;const g={};function T(v,C){return v.scopeValue("func",{ref:C,code:g[C.code]||(g[C.code]=new r._Code(C.code))})}t.useFunc=T;var O;(function(v){v[v.Num=0]="Num",v[v.Str=1]="Str"})(O=t.Type||(t.Type={}));function j(v,C,D){if(v instanceof e.Name){const W=C===O.Num;return D?W?(0,e._)`"[" + ${v} + "]"`:(0,e._)`"['" + ${v} + "']"`:W?(0,e._)`"/" + ${v}`:(0,e._)`"/" + ${v}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return D?(0,e.getProperty)(v).toString():"/"+y(v)}t.getErrorPath=j;function A(v,C,D=v.opts.strictSchema){if(D){if(C=`strict mode: ${C}`,D===!0)throw new Error(C);v.self.logger.warn(C)}}t.checkStrictMode=A})(re);var Ke={};Object.defineProperty(Ke,"__esModule",{value:!0});const ve=G,Xa={data:new ve.Name("data"),valCxt:new ve.Name("valCxt"),instancePath:new ve.Name("instancePath"),parentData:new ve.Name("parentData"),parentDataProperty:new ve.Name("parentDataProperty"),rootData:new ve.Name("rootData"),dynamicAnchors:new ve.Name("dynamicAnchors"),vErrors:new ve.Name("vErrors"),errors:new ve.Name("errors"),this:new ve.Name("this"),self:new ve.Name("self"),scope:new ve.Name("scope"),json:new ve.Name("json"),jsonPos:new ve.Name("jsonPos"),jsonLen:new ve.Name("jsonLen"),jsonPart:new ve.Name("jsonPart")};Ke.default=Xa;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const e=G,r=re,n=Ke;t.keywordError={message:({keyword:_})=>(0,e.str)`must pass "${_}" keyword validation`},t.keyword$DataError={message:({keyword:_,schemaType:g})=>g?(0,e.str)`"${_}" keyword must be ${g} ($data)`:(0,e.str)`"${_}" keyword is invalid ($data)`};function s(_,g=t.keywordError,T,O){const{it:j}=_,{gen:A,compositeRule:v,allErrors:C}=j,D=y(_,g,T);O??(v||C)?p(A,D):u(j,(0,e._)`[${D}]`)}t.reportError=s;function i(_,g=t.keywordError,T){const{it:O}=_,{gen:j,compositeRule:A,allErrors:v}=O,C=y(_,g,T);p(j,C),A||v||u(O,n.default.vErrors)}t.reportExtraError=i;function a(_,g){_.assign(n.default.errors,g),_.if((0,e._)`${n.default.vErrors} !== null`,()=>_.if(g,()=>_.assign((0,e._)`${n.default.vErrors}.length`,g),()=>_.assign(n.default.vErrors,null)))}t.resetErrorsCount=a;function l({gen:_,keyword:g,schemaValue:T,data:O,errsCount:j,it:A}){if(j===void 0)throw new Error("ajv implementation error");const v=_.name("err");_.forRange("i",j,n.default.errors,C=>{_.const(v,(0,e._)`${n.default.vErrors}[${C}]`),_.if((0,e._)`${v}.instancePath === undefined`,()=>_.assign((0,e._)`${v}.instancePath`,(0,e.strConcat)(n.default.instancePath,A.errorPath))),_.assign((0,e._)`${v}.schemaPath`,(0,e.str)`${A.errSchemaPath}/${g}`),A.opts.verbose&&(_.assign((0,e._)`${v}.schema`,T),_.assign((0,e._)`${v}.data`,O))})}t.extendErrors=l;function p(_,g){const T=_.const("err",g);_.if((0,e._)`${n.default.vErrors} === null`,()=>_.assign(n.default.vErrors,(0,e._)`[${T}]`),(0,e._)`${n.default.vErrors}.push(${T})`),_.code((0,e._)`${n.default.errors}++`)}function u(_,g){const{gen:T,validateName:O,schemaEnv:j}=_;j.$async?T.throw((0,e._)`new ${_.ValidationError}(${g})`):(T.assign((0,e._)`${O}.errors`,g),T.return(!1))}const f={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function y(_,g,T){const{createErrors:O}=_.it;return O===!1?(0,e._)`{}`:k(_,g,T)}function k(_,g,T={}){const{gen:O,it:j}=_,A=[R(j,T),w(_,T)];return S(_,g,A),O.object(...A)}function R({errorPath:_},{instancePath:g}){const T=g?(0,e.str)`${_}${(0,r.getErrorPath)(g,r.Type.Str)}`:_;return[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,T)]}function w({keyword:_,it:{errSchemaPath:g}},{schemaPath:T,parentSchema:O}){let j=O?g:(0,e.str)`${g}/${_}`;return T&&(j=(0,e.str)`${j}${(0,r.getErrorPath)(T,r.Type.Str)}`),[f.schemaPath,j]}function S(_,{params:g,message:T},O){const{keyword:j,data:A,schemaValue:v,it:C}=_,{opts:D,propertyName:W,topSchemaRef:K,schemaPath:ce}=C;O.push([f.keyword,j],[f.params,typeof g=="function"?g(_):g||(0,e._)`{}`]),D.messages&&O.push([f.message,typeof T=="function"?T(_):T]),D.verbose&&O.push([f.schema,v],[f.parentSchema,(0,e._)`${K}${ce}`],[n.default.data,A]),W&&O.push([f.propertyName,W])}})($r);Object.defineProperty(Bt,"__esModule",{value:!0});Bt.boolOrEmptySchema=Bt.topBoolOrEmptySchema=void 0;const ec=$r,tc=G,rc=Ke,nc={message:"boolean schema is false"};function sc(t){const{gen:e,schema:r,validateName:n}=t;r===!1?ao(t,!1):typeof r=="object"&&r.$async===!0?e.return(rc.default.data):(e.assign((0,tc._)`${n}.errors`,null),e.return(!0))}Bt.topBoolOrEmptySchema=sc;function ic(t,e){const{gen:r,schema:n}=t;n===!1?(r.var(e,!1),ao(t)):r.var(e,!0)}Bt.boolOrEmptySchema=ic;function ao(t,e){const{gen:r,data:n}=t,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,ec.reportError)(s,nc,void 0,e)}var _r={},vt={};Object.defineProperty(vt,"__esModule",{value:!0});vt.getRules=vt.isJSONType=void 0;const oc=["string","number","integer","boolean","null","object","array"],ac=new Set(oc);function cc(t){return typeof t=="string"&&ac.has(t)}vt.isJSONType=cc;function lc(){const t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}vt.getRules=lc;var Qe={};Object.defineProperty(Qe,"__esModule",{value:!0});Qe.shouldUseRule=Qe.shouldUseGroup=Qe.schemaHasRulesForType=void 0;function uc({schema:t,self:e},r){const n=e.RULES.types[r];return n&&n!==!0&&co(t,n)}Qe.schemaHasRulesForType=uc;function co(t,e){return e.rules.some(r=>lo(t,r))}Qe.shouldUseGroup=co;function lo(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Qe.shouldUseRule=lo;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const e=vt,r=Qe,n=$r,s=G,i=re;var a;(function(O){O[O.Correct=0]="Correct",O[O.Wrong=1]="Wrong"})(a=t.DataType||(t.DataType={}));function l(O){const j=p(O.type);if(j.includes("null")){if(O.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!j.length&&O.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');O.nullable===!0&&j.push("null")}return j}t.getSchemaTypes=l;function p(O){const j=Array.isArray(O)?O:O?[O]:[];if(j.every(e.isJSONType))return j;throw new Error("type must be JSONType or JSONType[]: "+j.join(","))}t.getJSONTypes=p;function u(O,j){const{gen:A,data:v,opts:C}=O,D=y(j,C.coerceTypes),W=j.length>0&&!(D.length===0&&j.length===1&&(0,r.schemaHasRulesForType)(O,j[0]));if(W){const K=S(j,v,C.strictNumbers,a.Wrong);A.if(K,()=>{D.length?k(O,j,D):g(O)})}return W}t.coerceAndCheckDataType=u;const f=new Set(["string","number","integer","boolean","null"]);function y(O,j){return j?O.filter(A=>f.has(A)||j==="array"&&A==="array"):[]}function k(O,j,A){const{gen:v,data:C,opts:D}=O,W=v.let("dataType",(0,s._)`typeof ${C}`),K=v.let("coerced",(0,s._)`undefined`);D.coerceTypes==="array"&&v.if((0,s._)`${W} == 'object' && Array.isArray(${C}) && ${C}.length == 1`,()=>v.assign(C,(0,s._)`${C}[0]`).assign(W,(0,s._)`typeof ${C}`).if(S(j,C,D.strictNumbers),()=>v.assign(K,C))),v.if((0,s._)`${K} !== undefined`);for(const Z of A)(f.has(Z)||Z==="array"&&D.coerceTypes==="array")&&ce(Z);v.else(),g(O),v.endIf(),v.if((0,s._)`${K} !== undefined`,()=>{v.assign(C,K),R(O,K)});function ce(Z){switch(Z){case"string":v.elseIf((0,s._)`${W} == "number" || ${W} == "boolean"`).assign(K,(0,s._)`"" + ${C}`).elseIf((0,s._)`${C} === null`).assign(K,(0,s._)`""`);return;case"number":v.elseIf((0,s._)`${W} == "boolean" || ${C} === null
897
- || (${W} == "string" && ${C} && ${C} == +${C})`).assign(K,(0,s._)`+${C}`);return;case"integer":v.elseIf((0,s._)`${W} === "boolean" || ${C} === null
898
- || (${W} === "string" && ${C} && ${C} == +${C} && !(${C} % 1))`).assign(K,(0,s._)`+${C}`);return;case"boolean":v.elseIf((0,s._)`${C} === "false" || ${C} === 0 || ${C} === null`).assign(K,!1).elseIf((0,s._)`${C} === "true" || ${C} === 1`).assign(K,!0);return;case"null":v.elseIf((0,s._)`${C} === "" || ${C} === 0 || ${C} === false`),v.assign(K,null);return;case"array":v.elseIf((0,s._)`${W} === "string" || ${W} === "number"
899
- || ${W} === "boolean" || ${C} === null`).assign(K,(0,s._)`[${C}]`)}}}function R({gen:O,parentData:j,parentDataProperty:A},v){O.if((0,s._)`${j} !== undefined`,()=>O.assign((0,s._)`${j}[${A}]`,v))}function w(O,j,A,v=a.Correct){const C=v===a.Correct?s.operators.EQ:s.operators.NEQ;let D;switch(O){case"null":return(0,s._)`${j} ${C} null`;case"array":D=(0,s._)`Array.isArray(${j})`;break;case"object":D=(0,s._)`${j} && typeof ${j} == "object" && !Array.isArray(${j})`;break;case"integer":D=W((0,s._)`!(${j} % 1) && !isNaN(${j})`);break;case"number":D=W();break;default:return(0,s._)`typeof ${j} ${C} ${O}`}return v===a.Correct?D:(0,s.not)(D);function W(K=s.nil){return(0,s.and)((0,s._)`typeof ${j} == "number"`,K,A?(0,s._)`isFinite(${j})`:s.nil)}}t.checkDataType=w;function S(O,j,A,v){if(O.length===1)return w(O[0],j,A,v);let C;const D=(0,i.toHash)(O);if(D.array&&D.object){const W=(0,s._)`typeof ${j} != "object"`;C=D.null?W:(0,s._)`!${j} || ${W}`,delete D.null,delete D.array,delete D.object}else C=s.nil;D.number&&delete D.integer;for(const W in D)C=(0,s.and)(C,w(W,j,A,v));return C}t.checkDataTypes=S;const _={message:({schema:O})=>`must be ${O}`,params:({schema:O,schemaValue:j})=>typeof O=="string"?(0,s._)`{type: ${O}}`:(0,s._)`{type: ${j}}`};function g(O){const j=T(O);(0,n.reportError)(j,_)}t.reportTypeError=g;function T(O){const{gen:j,data:A,schema:v}=O,C=(0,i.schemaRefOrVal)(O,v,"type");return{gen:j,keyword:"type",data:A,schema:v.type,schemaCode:C,schemaValue:C,parentSchema:v,params:{},it:O}}})(_r);var ln={};Object.defineProperty(ln,"__esModule",{value:!0});ln.assignDefaults=void 0;const Dt=G,dc=re;function pc(t,e){const{properties:r,items:n}=t.schema;if(e==="object"&&r)for(const s in r)Bs(t,s,r[s].default);else e==="array"&&Array.isArray(n)&&n.forEach((s,i)=>Bs(t,i,s.default))}ln.assignDefaults=pc;function Bs(t,e,r){const{gen:n,compositeRule:s,data:i,opts:a}=t;if(r===void 0)return;const l=(0,Dt._)`${i}${(0,Dt.getProperty)(e)}`;if(s){(0,dc.checkStrictMode)(t,`default is ignored for: ${l}`);return}let p=(0,Dt._)`${l} === undefined`;a.useDefaults==="empty"&&(p=(0,Dt._)`${p} || ${l} === null || ${l} === ""`),n.if(p,(0,Dt._)`${l} = ${(0,Dt.stringify)(r)}`)}var We={},B={};Object.defineProperty(B,"__esModule",{value:!0});B.validateUnion=B.validateArray=B.usePattern=B.callValidateCode=B.schemaProperties=B.allSchemaProperties=B.noPropertyInData=B.propertyInData=B.isOwnProperty=B.hasPropFunc=B.reportMissingProp=B.checkMissingProp=B.checkReportMissingProp=void 0;const ie=G,Mn=re,tt=Ke,fc=re;function hc(t,e){const{gen:r,data:n,it:s}=t;r.if(Ln(r,n,e,s.opts.ownProperties),()=>{t.setParams({missingProperty:(0,ie._)`${e}`},!0),t.error()})}B.checkReportMissingProp=hc;function mc({gen:t,data:e,it:{opts:r}},n,s){return(0,ie.or)(...n.map(i=>(0,ie.and)(Ln(t,e,i,r.ownProperties),(0,ie._)`${s} = ${i}`)))}B.checkMissingProp=mc;function yc(t,e){t.setParams({missingProperty:e},!0),t.error()}B.reportMissingProp=yc;function uo(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ie._)`Object.prototype.hasOwnProperty`})}B.hasPropFunc=uo;function Un(t,e,r){return(0,ie._)`${uo(t)}.call(${e}, ${r})`}B.isOwnProperty=Un;function gc(t,e,r,n){const s=(0,ie._)`${e}${(0,ie.getProperty)(r)} !== undefined`;return n?(0,ie._)`${s} && ${Un(t,e,r)}`:s}B.propertyInData=gc;function Ln(t,e,r,n){const s=(0,ie._)`${e}${(0,ie.getProperty)(r)} === undefined`;return n?(0,ie.or)(s,(0,ie.not)(Un(t,e,r))):s}B.noPropertyInData=Ln;function po(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}B.allSchemaProperties=po;function $c(t,e){return po(e).filter(r=>!(0,Mn.alwaysValidSchema)(t,e[r]))}B.schemaProperties=$c;function _c({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:i},it:a},l,p,u){const f=u?(0,ie._)`${t}, ${e}, ${n}${s}`:e,y=[[tt.default.instancePath,(0,ie.strConcat)(tt.default.instancePath,i)],[tt.default.parentData,a.parentData],[tt.default.parentDataProperty,a.parentDataProperty],[tt.default.rootData,tt.default.rootData]];a.opts.dynamicRef&&y.push([tt.default.dynamicAnchors,tt.default.dynamicAnchors]);const k=(0,ie._)`${f}, ${r.object(...y)}`;return p!==ie.nil?(0,ie._)`${l}.call(${p}, ${k})`:(0,ie._)`${l}(${k})`}B.callValidateCode=_c;const wc=(0,ie._)`new RegExp`;function vc({gen:t,it:{opts:e}},r){const n=e.unicodeRegExp?"u":"",{regExp:s}=e.code,i=s(r,n);return t.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,ie._)`${s.code==="new RegExp"?wc:(0,fc.useFunc)(t,s)}(${r}, ${n})`})}B.usePattern=vc;function bc(t){const{gen:e,data:r,keyword:n,it:s}=t,i=e.name("valid");if(s.allErrors){const l=e.let("valid",!0);return a(()=>e.assign(l,!1)),l}return e.var(i,!0),a(()=>e.break()),i;function a(l){const p=e.const("len",(0,ie._)`${r}.length`);e.forRange("i",0,p,u=>{t.subschema({keyword:n,dataProp:u,dataPropType:Mn.Type.Num},i),e.if((0,ie.not)(i),l)})}}B.validateArray=bc;function Pc(t){const{gen:e,schema:r,keyword:n,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(p=>(0,Mn.alwaysValidSchema)(s,p))&&!s.opts.unevaluated)return;const a=e.let("valid",!1),l=e.name("_valid");e.block(()=>r.forEach((p,u)=>{const f=t.subschema({keyword:n,schemaProp:u,compositeRule:!0},l);e.assign(a,(0,ie._)`${a} || ${l}`),t.mergeValidEvaluated(f,l)||e.if((0,ie.not)(a))})),t.result(a,()=>t.reset(),()=>t.error(!0))}B.validateUnion=Pc;Object.defineProperty(We,"__esModule",{value:!0});We.validateKeywordUsage=We.validSchemaType=We.funcKeywordCode=We.macroKeywordCode=void 0;const be=G,ht=Ke,Ec=B,Sc=$r;function Tc(t,e){const{gen:r,keyword:n,schema:s,parentSchema:i,it:a}=t,l=e.macro.call(a.self,s,i,a),p=fo(r,n,l);a.opts.validateSchema!==!1&&a.self.validateSchema(l,!0);const u=r.name("valid");t.subschema({schema:l,schemaPath:be.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:p,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}We.macroKeywordCode=Tc;function kc(t,e){var r;const{gen:n,keyword:s,schema:i,parentSchema:a,$data:l,it:p}=t;Oc(p,e);const u=!l&&e.compile?e.compile.call(p.self,i,a,p):e.validate,f=fo(n,s,u),y=n.let("valid");t.block$data(y,k),t.ok((r=e.valid)!==null&&r!==void 0?r:y);function k(){if(e.errors===!1)S(),e.modifying&&Gs(t),_(()=>t.error());else{const g=e.async?R():w();e.modifying&&Gs(t),_(()=>Rc(t,g))}}function R(){const g=n.let("ruleErrs",null);return n.try(()=>S((0,be._)`await `),T=>n.assign(y,!1).if((0,be._)`${T} instanceof ${p.ValidationError}`,()=>n.assign(g,(0,be._)`${T}.errors`),()=>n.throw(T))),g}function w(){const g=(0,be._)`${f}.errors`;return n.assign(g,null),S(be.nil),g}function S(g=e.async?(0,be._)`await `:be.nil){const T=p.opts.passContext?ht.default.this:ht.default.self,O=!("compile"in e&&!l||e.schema===!1);n.assign(y,(0,be._)`${g}${(0,Ec.callValidateCode)(t,f,T,O)}`,e.modifying)}function _(g){var T;n.if((0,be.not)((T=e.valid)!==null&&T!==void 0?T:y),g)}}We.funcKeywordCode=kc;function Gs(t){const{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,be._)`${n.parentData}[${n.parentDataProperty}]`))}function Rc(t,e){const{gen:r}=t;r.if((0,be._)`Array.isArray(${e})`,()=>{r.assign(ht.default.vErrors,(0,be._)`${ht.default.vErrors} === null ? ${e} : ${ht.default.vErrors}.concat(${e})`).assign(ht.default.errors,(0,be._)`${ht.default.vErrors}.length`),(0,Sc.extendErrors)(t)},()=>t.error())}function Oc({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function fo(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,be.stringify)(r)})}function Cc(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}We.validSchemaType=Cc;function Nc({schema:t,opts:e,self:r,errSchemaPath:n},s,i){if(Array.isArray(s.keyword)?!s.keyword.includes(i):s.keyword!==i)throw new Error("ajv implementation error");const a=s.dependencies;if(a!=null&&a.some(l=>!Object.prototype.hasOwnProperty.call(t,l)))throw new Error(`parent schema must have dependencies of ${i}: ${a.join(",")}`);if(s.validateSchema&&!s.validateSchema(t[i])){const p=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(p);else throw new Error(p)}}We.validateKeywordUsage=Nc;var ot={};Object.defineProperty(ot,"__esModule",{value:!0});ot.extendSubschemaMode=ot.extendSubschemaData=ot.getSubschema=void 0;const Ve=G,ho=re;function jc(t,{keyword:e,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:i,topSchemaRef:a}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){const l=t.schema[e];return r===void 0?{schema:l,schemaPath:(0,Ve._)`${t.schemaPath}${(0,Ve.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,Ve._)`${t.schemaPath}${(0,Ve.getProperty)(e)}${(0,Ve.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,ho.escapeFragment)(r)}`}}if(n!==void 0){if(s===void 0||i===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:a,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}ot.getSubschema=jc;function Ic(t,e,{dataProp:r,dataPropType:n,data:s,dataTypes:i,propertyName:a}){if(s!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:l}=e;if(r!==void 0){const{errorPath:u,dataPathArr:f,opts:y}=e,k=l.let("data",(0,Ve._)`${e.data}${(0,Ve.getProperty)(r)}`,!0);p(k),t.errorPath=(0,Ve.str)`${u}${(0,ho.getErrorPath)(r,n,y.jsPropertySyntax)}`,t.parentDataProperty=(0,Ve._)`${r}`,t.dataPathArr=[...f,t.parentDataProperty]}if(s!==void 0){const u=s instanceof Ve.Name?s:l.let("data",s,!0);p(u),a!==void 0&&(t.propertyName=a)}i&&(t.dataTypes=i);function p(u){t.data=u,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,u]}}ot.extendSubschemaData=Ic;function Dc(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:i}){n!==void 0&&(t.compositeRule=n),s!==void 0&&(t.createErrors=s),i!==void 0&&(t.allErrors=i),t.jtdDiscriminator=e,t.jtdMetadata=r}ot.extendSubschemaMode=Dc;var $e={},mo=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,s,i;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!t(e[s],r[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=n;s--!==0;){var a=i[s];if(!t(e[a],r[a]))return!1}return!0}return e!==e&&r!==r},yo={exports:{}},it=yo.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};Dr(e,n,s,t,"",t)};it.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};it.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};it.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};it.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};function Dr(t,e,r,n,s,i,a,l,p,u){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,s,i,a,l,p,u);for(var f in n){var y=n[f];if(Array.isArray(y)){if(f in it.arrayKeywords)for(var k=0;k<y.length;k++)Dr(t,e,r,y[k],s+"/"+f+"/"+k,i,s,f,n,k)}else if(f in it.propsKeywords){if(y&&typeof y=="object")for(var R in y)Dr(t,e,r,y[R],s+"/"+f+"/"+Ac(R),i,s,f,n,R)}else(f in it.keywords||t.allKeys&&!(f in it.skipKeywords))&&Dr(t,e,r,y,s+"/"+f,i,s,f,n)}r(n,s,i,a,l,p,u)}}function Ac(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}var Fc=yo.exports;Object.defineProperty($e,"__esModule",{value:!0});$e.getSchemaRefs=$e.resolveUrl=$e.normalizeId=$e._getFullPath=$e.getFullPath=$e.inlineRef=void 0;const qc=re,Mc=mo,Uc=Fc,Lc=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Hc(t,e=!0){return typeof t=="boolean"?!0:e===!0?!En(t):e?go(t)<=e:!1}$e.inlineRef=Hc;const zc=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function En(t){for(const e in t){if(zc.has(e))return!0;const r=t[e];if(Array.isArray(r)&&r.some(En)||typeof r=="object"&&En(r))return!0}return!1}function go(t){let e=0;for(const r in t){if(r==="$ref")return 1/0;if(e++,!Lc.has(r)&&(typeof t[r]=="object"&&(0,qc.eachItem)(t[r],n=>e+=go(n)),e===1/0))return 1/0}return e}function $o(t,e="",r){r!==!1&&(e=Ut(e));const n=t.parse(e);return _o(t,n)}$e.getFullPath=$o;function _o(t,e){return t.serialize(e).split("#")[0]+"#"}$e._getFullPath=_o;const Vc=/#\/?$/;function Ut(t){return t?t.replace(Vc,""):""}$e.normalizeId=Ut;function Wc(t,e,r){return r=Ut(r),t.resolve(e,r)}$e.resolveUrl=Wc;const xc=/^[a-z_][-a-z0-9._]*$/i;function Bc(t,e){if(typeof t=="boolean")return{};const{schemaId:r,uriResolver:n}=this.opts,s=Ut(t[r]||e),i={"":s},a=$o(n,s,!1),l={},p=new Set;return Uc(t,{allKeys:!0},(y,k,R,w)=>{if(w===void 0)return;const S=a+k;let _=i[w];typeof y[r]=="string"&&(_=g.call(this,y[r])),T.call(this,y.$anchor),T.call(this,y.$dynamicAnchor),i[k]=_;function g(O){const j=this.opts.uriResolver.resolve;if(O=Ut(_?j(_,O):O),p.has(O))throw f(O);p.add(O);let A=this.refs[O];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?u(y,A.schema,O):O!==Ut(S)&&(O[0]==="#"?(u(y,l[O],O),l[O]=y):this.refs[O]=S),O}function T(O){if(typeof O=="string"){if(!xc.test(O))throw new Error(`invalid anchor "${O}"`);g.call(this,`#${O}`)}}}),l;function u(y,k,R){if(k!==void 0&&!Mc(y,k))throw f(R)}function f(y){return new Error(`reference "${y}" resolves to more than one schema`)}}$e.getSchemaRefs=Bc;Object.defineProperty(De,"__esModule",{value:!0});De.getData=De.KeywordCxt=De.validateFunctionCode=void 0;const wo=Bt,Ks=_r,Hn=Qe,Ur=_r,Gc=ln,lr=We,yn=ot,U=G,V=Ke,Kc=$e,Ze=re,or=$r;function Jc(t){if(Po(t)&&(Eo(t),bo(t))){Zc(t);return}vo(t,()=>(0,wo.topBoolOrEmptySchema)(t))}De.validateFunctionCode=Jc;function vo({gen:t,validateName:e,schema:r,schemaEnv:n,opts:s},i){s.code.es5?t.func(e,(0,U._)`${V.default.data}, ${V.default.valCxt}`,n.$async,()=>{t.code((0,U._)`"use strict"; ${Js(r,s)}`),Qc(t,s),t.code(i)}):t.func(e,(0,U._)`${V.default.data}, ${Yc(s)}`,n.$async,()=>t.code(Js(r,s)).code(i))}function Yc(t){return(0,U._)`{${V.default.instancePath}="", ${V.default.parentData}, ${V.default.parentDataProperty}, ${V.default.rootData}=${V.default.data}${t.dynamicRef?(0,U._)`, ${V.default.dynamicAnchors}={}`:U.nil}}={}`}function Qc(t,e){t.if(V.default.valCxt,()=>{t.var(V.default.instancePath,(0,U._)`${V.default.valCxt}.${V.default.instancePath}`),t.var(V.default.parentData,(0,U._)`${V.default.valCxt}.${V.default.parentData}`),t.var(V.default.parentDataProperty,(0,U._)`${V.default.valCxt}.${V.default.parentDataProperty}`),t.var(V.default.rootData,(0,U._)`${V.default.valCxt}.${V.default.rootData}`),e.dynamicRef&&t.var(V.default.dynamicAnchors,(0,U._)`${V.default.valCxt}.${V.default.dynamicAnchors}`)},()=>{t.var(V.default.instancePath,(0,U._)`""`),t.var(V.default.parentData,(0,U._)`undefined`),t.var(V.default.parentDataProperty,(0,U._)`undefined`),t.var(V.default.rootData,V.default.data),e.dynamicRef&&t.var(V.default.dynamicAnchors,(0,U._)`{}`)})}function Zc(t){const{schema:e,opts:r,gen:n}=t;vo(t,()=>{r.$comment&&e.$comment&&To(t),nl(t),n.let(V.default.vErrors,null),n.let(V.default.errors,0),r.unevaluated&&Xc(t),So(t),ol(t)})}function Xc(t){const{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,U._)`${r}.evaluated`),e.if((0,U._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,U._)`${t.evaluated}.props`,(0,U._)`undefined`)),e.if((0,U._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,U._)`${t.evaluated}.items`,(0,U._)`undefined`))}function Js(t,e){const r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,U._)`/*# sourceURL=${r} */`:U.nil}function el(t,e){if(Po(t)&&(Eo(t),bo(t))){tl(t,e);return}(0,wo.boolOrEmptySchema)(t,e)}function bo({schema:t,self:e}){if(typeof t=="boolean")return!t;for(const r in t)if(e.RULES.all[r])return!0;return!1}function Po(t){return typeof t.schema!="boolean"}function tl(t,e){const{schema:r,gen:n,opts:s}=t;s.$comment&&r.$comment&&To(t),sl(t),il(t);const i=n.const("_errs",V.default.errors);So(t,i),n.var(e,(0,U._)`${i} === ${V.default.errors}`)}function Eo(t){(0,Ze.checkUnknownRules)(t),rl(t)}function So(t,e){if(t.opts.jtd)return Ys(t,[],!1,e);const r=(0,Ks.getSchemaTypes)(t.schema),n=(0,Ks.coerceAndCheckDataType)(t,r);Ys(t,r,!n,e)}function rl(t){const{schema:e,errSchemaPath:r,opts:n,self:s}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Ze.schemaHasRulesButRef)(e,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function nl(t){const{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Ze.checkStrictMode)(t,"default is ignored in the schema root")}function sl(t){const e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,Kc.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function il(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function To({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:s}){const i=r.$comment;if(s.$comment===!0)t.code((0,U._)`${V.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){const a=(0,U.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,U._)`${V.default.self}.opts.$comment(${i}, ${a}, ${l}.schema)`)}}function ol(t){const{gen:e,schemaEnv:r,validateName:n,ValidationError:s,opts:i}=t;r.$async?e.if((0,U._)`${V.default.errors} === 0`,()=>e.return(V.default.data),()=>e.throw((0,U._)`new ${s}(${V.default.vErrors})`)):(e.assign((0,U._)`${n}.errors`,V.default.vErrors),i.unevaluated&&al(t),e.return((0,U._)`${V.default.errors} === 0`))}function al({gen:t,evaluated:e,props:r,items:n}){r instanceof U.Name&&t.assign((0,U._)`${e}.props`,r),n instanceof U.Name&&t.assign((0,U._)`${e}.items`,n)}function Ys(t,e,r,n){const{gen:s,schema:i,data:a,allErrors:l,opts:p,self:u}=t,{RULES:f}=u;if(i.$ref&&(p.ignoreKeywordsWithRef||!(0,Ze.schemaHasRulesButRef)(i,f))){s.block(()=>Oo(t,"$ref",f.all.$ref.definition));return}p.jtd||cl(t,e),s.block(()=>{for(const k of f.rules)y(k);y(f.post)});function y(k){(0,Hn.shouldUseGroup)(i,k)&&(k.type?(s.if((0,Ur.checkDataType)(k.type,a,p.strictNumbers)),Qs(t,k),e.length===1&&e[0]===k.type&&r&&(s.else(),(0,Ur.reportTypeError)(t)),s.endIf()):Qs(t,k),l||s.if((0,U._)`${V.default.errors} === ${n||0}`))}}function Qs(t,e){const{gen:r,schema:n,opts:{useDefaults:s}}=t;s&&(0,Gc.assignDefaults)(t,e.type),r.block(()=>{for(const i of e.rules)(0,Hn.shouldUseRule)(n,i)&&Oo(t,i.keyword,i.definition,e.type)})}function cl(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(ll(t,e),t.opts.allowUnionTypes||ul(t,e),dl(t,t.dataTypes))}function ll(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{ko(t.dataTypes,r)||zn(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),fl(t,e)}}function ul(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&zn(t,"use allowUnionTypes to allow union type keyword")}function dl(t,e){const r=t.self.RULES.all;for(const n in r){const s=r[n];if(typeof s=="object"&&(0,Hn.shouldUseRule)(t.schema,s)){const{type:i}=s.definition;i.length&&!i.some(a=>pl(e,a))&&zn(t,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function pl(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function ko(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function fl(t,e){const r=[];for(const n of t.dataTypes)ko(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function zn(t,e){const r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Ze.checkStrictMode)(t,e,t.opts.strictTypes)}class Ro{constructor(e,r,n){if((0,lr.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Ze.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",Co(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,lr.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",V.default.errors))}result(e,r,n){this.failResult((0,U.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,U.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}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:r}=this;this.fail((0,U._)`${r} !== undefined && (${(0,U.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?or.reportExtraError:or.reportError)(this,this.def.error,r)}$dataError(){(0,or.reportError)(this,this.def.$dataError||or.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,or.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=U.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=U.nil,r=U.nil){if(!this.$data)return;const{gen:n,schemaCode:s,schemaType:i,def:a}=this;n.if((0,U.or)((0,U._)`${s} === undefined`,r)),e!==U.nil&&n.assign(e,!0),(i.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==U.nil&&n.assign(e,!1)),n.else()}invalid$data(){const{gen:e,schemaCode:r,schemaType:n,def:s,it:i}=this;return(0,U.or)(a(),l());function a(){if(n.length){if(!(r instanceof U.Name))throw new Error("ajv implementation error");const p=Array.isArray(n)?n:[n];return(0,U._)`${(0,Ur.checkDataTypes)(p,r,i.opts.strictNumbers,Ur.DataType.Wrong)}`}return U.nil}function l(){if(s.validateSchema){const p=e.scopeValue("validate$data",{ref:s.validateSchema});return(0,U._)`!${p}(${r})`}return U.nil}}subschema(e,r){const n=(0,yn.getSubschema)(this.it,e);(0,yn.extendSubschemaData)(n,this.it,e),(0,yn.extendSubschemaMode)(n,e);const s={...this.it,...n,items:void 0,props:void 0};return el(s,r),s}mergeEvaluated(e,r){const{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Ze.mergeEvaluated.props(s,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Ze.mergeEvaluated.items(s,e.items,n.items,r)))}mergeValidEvaluated(e,r){const{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(r,()=>this.mergeEvaluated(e,U.Name)),!0}}De.KeywordCxt=Ro;function Oo(t,e,r,n){const s=new Ro(t,r,e);"code"in r?r.code(s,n):s.$data&&r.validate?(0,lr.funcKeywordCode)(s,r):"macro"in r?(0,lr.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,lr.funcKeywordCode)(s,r)}const hl=/^\/(?:[^~]|~0|~1)*$/,ml=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Co(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let s,i;if(t==="")return V.default.rootData;if(t[0]==="/"){if(!hl.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);s=t,i=V.default.rootData}else{const u=ml.exec(t);if(!u)throw new Error(`Invalid JSON-pointer: ${t}`);const f=+u[1];if(s=u[2],s==="#"){if(f>=e)throw new Error(p("property/index",f));return n[e-f]}if(f>e)throw new Error(p("data",f));if(i=r[e-f],!s)return i}let a=i;const l=s.split("/");for(const u of l)u&&(i=(0,U._)`${i}${(0,U.getProperty)((0,Ze.unescapeJsonPointer)(u))}`,a=(0,U._)`${a} && ${i}`);return a;function p(u,f){return`Cannot access ${u} ${f} levels up, current level is ${e}`}}De.getData=Co;var wr={};Object.defineProperty(wr,"__esModule",{value:!0});class yl extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}wr.default=yl;var vr={};Object.defineProperty(vr,"__esModule",{value:!0});const gn=$e;class gl extends Error{constructor(e,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,gn.resolveUrl)(e,r,n),this.missingSchema=(0,gn.normalizeId)((0,gn.getFullPath)(e,this.missingRef))}}vr.default=gl;var Se={};Object.defineProperty(Se,"__esModule",{value:!0});Se.resolveSchema=Se.getCompilingSchema=Se.resolveRef=Se.compileSchema=Se.SchemaEnv=void 0;const Ne=G,$l=wr,ft=Ke,Ie=$e,Zs=re,_l=De;class un{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Ie.normalizeId)(n==null?void 0:n[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n==null?void 0:n.$async,this.refs={}}}Se.SchemaEnv=un;function Vn(t){const e=No.call(this,t);if(e)return e;const r=(0,Ie.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,a=new Ne.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i});let l;t.$async&&(l=a.scopeValue("Error",{ref:$l.default,code:(0,Ne._)`require("ajv/dist/runtime/validation_error").default`}));const p=a.scopeName("validate");t.validateName=p;const u={gen:a,allErrors:this.opts.allErrors,data:ft.default.data,parentData:ft.default.parentData,parentDataProperty:ft.default.parentDataProperty,dataNames:[ft.default.data],dataPathArr:[Ne.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Ne.stringify)(t.schema)}:{ref:t.schema}),validateName:p,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Ne.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Ne._)`""`,opts:this.opts,self:this};let f;try{this._compilations.add(t),(0,_l.validateFunctionCode)(u),a.optimize(this.opts.code.optimize);const y=a.toString();f=`${a.scopeRefs(ft.default.scope)}return ${y}`,this.opts.code.process&&(f=this.opts.code.process(f,t));const R=new Function(`${ft.default.self}`,`${ft.default.scope}`,f)(this,this.scope.get());if(this.scope.value(p,{ref:R}),R.errors=null,R.schema=t.schema,R.schemaEnv=t,t.$async&&(R.$async=!0),this.opts.code.source===!0&&(R.source={validateName:p,validateCode:y,scopeValues:a._values}),this.opts.unevaluated){const{props:w,items:S}=u;R.evaluated={props:w instanceof Ne.Name?void 0:w,items:S instanceof Ne.Name?void 0:S,dynamicProps:w instanceof Ne.Name,dynamicItems:S instanceof Ne.Name},R.source&&(R.source.evaluated=(0,Ne.stringify)(R.evaluated))}return t.validate=R,t}catch(y){throw delete t.validate,delete t.validateName,f&&this.logger.error("Error compiling schema, function code:",f),y}finally{this._compilations.delete(t)}}Se.compileSchema=Vn;function wl(t,e,r){var n;r=(0,Ie.resolveUrl)(this.opts.uriResolver,e,r);const s=t.refs[r];if(s)return s;let i=Pl.call(this,t,r);if(i===void 0){const a=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:l}=this.opts;a&&(i=new un({schema:a,schemaId:l,root:t,baseId:e}))}if(i!==void 0)return t.refs[r]=vl.call(this,i)}Se.resolveRef=wl;function vl(t){return(0,Ie.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Vn.call(this,t)}function No(t){for(const e of this._compilations)if(bl(e,t))return e}Se.getCompilingSchema=No;function bl(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function Pl(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||dn.call(this,t,e)}function dn(t,e){const r=this.opts.uriResolver.parse(e),n=(0,Ie._getFullPath)(this.opts.uriResolver,r);let s=(0,Ie.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===s)return $n.call(this,r,t);const i=(0,Ie.normalizeId)(n),a=this.refs[i]||this.schemas[i];if(typeof a=="string"){const l=dn.call(this,t,a);return typeof(l==null?void 0:l.schema)!="object"?void 0:$n.call(this,r,l)}if(typeof(a==null?void 0:a.schema)=="object"){if(a.validate||Vn.call(this,a),i===(0,Ie.normalizeId)(e)){const{schema:l}=a,{schemaId:p}=this.opts,u=l[p];return u&&(s=(0,Ie.resolveUrl)(this.opts.uriResolver,s,u)),new un({schema:l,schemaId:p,root:t,baseId:s})}return $n.call(this,r,a)}}Se.resolveSchema=dn;const El=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function $n(t,{baseId:e,schema:r,root:n}){var s;if(((s=t.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(const l of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const p=r[(0,Zs.unescapeFragment)(l)];if(p===void 0)return;r=p;const u=typeof r=="object"&&r[this.opts.schemaId];!El.has(l)&&u&&(e=(0,Ie.resolveUrl)(this.opts.uriResolver,e,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,Zs.schemaHasRulesButRef)(r,this.RULES)){const l=(0,Ie.resolveUrl)(this.opts.uriResolver,e,r.$ref);i=dn.call(this,n,l)}const{schemaId:a}=this.opts;if(i=i||new un({schema:r,schemaId:a,root:n,baseId:e}),i.schema!==i.root.schema)return i}const Sl="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Tl="Meta-schema for $data reference (JSON AnySchema extension proposal)",kl="object",Rl=["$data"],Ol={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Cl=!1,Nl={$id:Sl,description:Tl,type:kl,required:Rl,properties:Ol,additionalProperties:Cl};var Wn={},Sn={exports:{}};/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */(function(t,e){(function(r,n){n(e)})(Qa,function(r){function n(){for(var d=arguments.length,c=Array(d),m=0;m<d;m++)c[m]=arguments[m];if(c.length>1){c[0]=c[0].slice(0,-1);for(var E=c.length-1,P=1;P<E;++P)c[P]=c[P].slice(1,-1);return c[E]=c[E].slice(1),c.join("")}else return c[0]}function s(d){return"(?:"+d+")"}function i(d){return d===void 0?"undefined":d===null?"null":Object.prototype.toString.call(d).split(" ").pop().split("]").shift().toLowerCase()}function a(d){return d.toUpperCase()}function l(d){return d!=null?d instanceof Array?d:typeof d.length!="number"||d.split||d.setInterval||d.call?[d]:Array.prototype.slice.call(d):[]}function p(d,c){var m=d;if(c)for(var E in c)m[E]=c[E];return m}function u(d){var c="[A-Za-z]",m="[0-9]",E=n(m,"[A-Fa-f]"),P=s(s("%[EFef]"+E+"%"+E+E+"%"+E+E)+"|"+s("%[89A-Fa-f]"+E+"%"+E+E)+"|"+s("%"+E+E)),L="[\\:\\/\\?\\#\\[\\]\\@]",H="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",X=n(L,H),se=d?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",ue=d?"[\\uE000-\\uF8FF]":"[]",Y=n(c,m,"[\\-\\.\\_\\~]",se);s(c+n(c,m,"[\\+\\-\\.]")+"*"),s(s(P+"|"+n(Y,H,"[\\:]"))+"*");var ne=s(s("25[0-5]")+"|"+s("2[0-4]"+m)+"|"+s("1"+m+m)+"|"+s("0?[1-9]"+m)+"|0?0?"+m),de=s(ne+"\\."+ne+"\\."+ne+"\\."+ne),x=s(E+"{1,4}"),oe=s(s(x+"\\:"+x)+"|"+de),me=s(s(x+"\\:")+"{6}"+oe),ae=s("\\:\\:"+s(x+"\\:")+"{5}"+oe),Xe=s(s(x)+"?\\:\\:"+s(x+"\\:")+"{4}"+oe),Me=s(s(s(x+"\\:")+"{0,1}"+x)+"?\\:\\:"+s(x+"\\:")+"{3}"+oe),Ue=s(s(s(x+"\\:")+"{0,2}"+x)+"?\\:\\:"+s(x+"\\:")+"{2}"+oe),jt=s(s(s(x+"\\:")+"{0,3}"+x)+"?\\:\\:"+x+"\\:"+oe),dt=s(s(s(x+"\\:")+"{0,4}"+x)+"?\\:\\:"+oe),Oe=s(s(s(x+"\\:")+"{0,5}"+x)+"?\\:\\:"+x),Le=s(s(s(x+"\\:")+"{0,6}"+x)+"?\\:\\:"),pt=s([me,ae,Xe,Me,Ue,jt,dt,Oe,Le].join("|")),Je=s(s(Y+"|"+P)+"+");s("[vV]"+E+"+\\."+n(Y,H,"[\\:]")+"+"),s(s(P+"|"+n(Y,H))+"*");var sr=s(P+"|"+n(Y,H,"[\\:\\@]"));return s(s(P+"|"+n(Y,H,"[\\@]"))+"+"),s(s(sr+"|"+n("[\\/\\?]",ue))+"*"),{NOT_SCHEME:new RegExp(n("[^]",c,m,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(n("[^\\%\\:]",Y,H),"g"),NOT_HOST:new RegExp(n("[^\\%\\[\\]\\:]",Y,H),"g"),NOT_PATH:new RegExp(n("[^\\%\\/\\:\\@]",Y,H),"g"),NOT_PATH_NOSCHEME:new RegExp(n("[^\\%\\/\\@]",Y,H),"g"),NOT_QUERY:new RegExp(n("[^\\%]",Y,H,"[\\:\\@\\/\\?]",ue),"g"),NOT_FRAGMENT:new RegExp(n("[^\\%]",Y,H,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(n("[^]",Y,H),"g"),UNRESERVED:new RegExp(Y,"g"),OTHER_CHARS:new RegExp(n("[^\\%]",Y,X),"g"),PCT_ENCODED:new RegExp(P,"g"),IPV4ADDRESS:new RegExp("^("+de+")$"),IPV6ADDRESS:new RegExp("^\\[?("+pt+")"+s(s("\\%25|\\%(?!"+E+"{2})")+"("+Je+")")+"?\\]?$")}}var f=u(!1),y=u(!0),k=function(){function d(c,m){var E=[],P=!0,L=!1,H=void 0;try{for(var X=c[Symbol.iterator](),se;!(P=(se=X.next()).done)&&(E.push(se.value),!(m&&E.length===m));P=!0);}catch(ue){L=!0,H=ue}finally{try{!P&&X.return&&X.return()}finally{if(L)throw H}}return E}return function(c,m){if(Array.isArray(c))return c;if(Symbol.iterator in Object(c))return d(c,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),R=function(d){if(Array.isArray(d)){for(var c=0,m=Array(d.length);c<d.length;c++)m[c]=d[c];return m}else return Array.from(d)},w=2147483647,S=36,_=1,g=26,T=38,O=700,j=72,A=128,v="-",C=/^xn--/,D=/[^\0-\x7E]/,W=/[\x2E\u3002\uFF0E\uFF61]/g,K={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ce=S-_,Z=Math.floor,ke=String.fromCharCode;function he(d){throw new RangeError(K[d])}function at(d,c){for(var m=[],E=d.length;E--;)m[E]=c(d[E]);return m}function ct(d,c){var m=d.split("@"),E="";m.length>1&&(E=m[0]+"@",d=m[1]),d=d.replace(W,".");var P=d.split("."),L=at(P,c).join(".");return E+L}function Et(d){for(var c=[],m=0,E=d.length;m<E;){var P=d.charCodeAt(m++);if(P>=55296&&P<=56319&&m<E){var L=d.charCodeAt(m++);(L&64512)==56320?c.push(((P&1023)<<10)+(L&1023)+65536):(c.push(P),m--)}else c.push(P)}return c}var Yt=function(c){return String.fromCodePoint.apply(String,R(c))},St=function(c){return c-48<10?c-22:c-65<26?c-65:c-97<26?c-97:S},F=function(c,m){return c+22+75*(c<26)-((m!=0)<<5)},$=function(c,m,E){var P=0;for(c=E?Z(c/O):c>>1,c+=Z(c/m);c>ce*g>>1;P+=S)c=Z(c/ce);return Z(P+(ce+1)*c/(c+T))},I=function(c){var m=[],E=c.length,P=0,L=A,H=j,X=c.lastIndexOf(v);X<0&&(X=0);for(var se=0;se<X;++se)c.charCodeAt(se)>=128&&he("not-basic"),m.push(c.charCodeAt(se));for(var ue=X>0?X+1:0;ue<E;){for(var Y=P,ne=1,de=S;;de+=S){ue>=E&&he("invalid-input");var x=St(c.charCodeAt(ue++));(x>=S||x>Z((w-P)/ne))&&he("overflow"),P+=x*ne;var oe=de<=H?_:de>=H+g?g:de-H;if(x<oe)break;var me=S-oe;ne>Z(w/me)&&he("overflow"),ne*=me}var ae=m.length+1;H=$(P-Y,ae,Y==0),Z(P/ae)>w-L&&he("overflow"),L+=Z(P/ae),P%=ae,m.splice(P++,0,L)}return String.fromCodePoint.apply(String,m)},b=function(c){var m=[];c=Et(c);var E=c.length,P=A,L=0,H=j,X=!0,se=!1,ue=void 0;try{for(var Y=c[Symbol.iterator](),ne;!(X=(ne=Y.next()).done);X=!0){var de=ne.value;de<128&&m.push(ke(de))}}catch(ir){se=!0,ue=ir}finally{try{!X&&Y.return&&Y.return()}finally{if(se)throw ue}}var x=m.length,oe=x;for(x&&m.push(v);oe<E;){var me=w,ae=!0,Xe=!1,Me=void 0;try{for(var Ue=c[Symbol.iterator](),jt;!(ae=(jt=Ue.next()).done);ae=!0){var dt=jt.value;dt>=P&&dt<me&&(me=dt)}}catch(ir){Xe=!0,Me=ir}finally{try{!ae&&Ue.return&&Ue.return()}finally{if(Xe)throw Me}}var Oe=oe+1;me-P>Z((w-L)/Oe)&&he("overflow"),L+=(me-P)*Oe,P=me;var Le=!0,pt=!1,Je=void 0;try{for(var sr=c[Symbol.iterator](),Cs;!(Le=(Cs=sr.next()).done);Le=!0){var Ns=Cs.value;if(Ns<P&&++L>w&&he("overflow"),Ns==P){for(var Er=L,Sr=S;;Sr+=S){var Tr=Sr<=H?_:Sr>=H+g?g:Sr-H;if(Er<Tr)break;var js=Er-Tr,Is=S-Tr;m.push(ke(F(Tr+js%Is,0))),Er=Z(js/Is)}m.push(ke(F(Er,0))),H=$(L,Oe,oe==x),L=0,++oe}}}catch(ir){pt=!0,Je=ir}finally{try{!Le&&sr.return&&sr.return()}finally{if(pt)throw Je}}++L,++P}return m.join("")},o=function(c){return ct(c,function(m){return C.test(m)?I(m.slice(4).toLowerCase()):m})},h=function(c){return ct(c,function(m){return D.test(m)?"xn--"+b(m):m})},N={version:"2.1.0",ucs2:{decode:Et,encode:Yt},decode:I,encode:b,toASCII:h,toUnicode:o},q={};function M(d){var c=d.charCodeAt(0),m=void 0;return c<16?m="%0"+c.toString(16).toUpperCase():c<128?m="%"+c.toString(16).toUpperCase():c<2048?m="%"+(c>>6|192).toString(16).toUpperCase()+"%"+(c&63|128).toString(16).toUpperCase():m="%"+(c>>12|224).toString(16).toUpperCase()+"%"+(c>>6&63|128).toString(16).toUpperCase()+"%"+(c&63|128).toString(16).toUpperCase(),m}function J(d){for(var c="",m=0,E=d.length;m<E;){var P=parseInt(d.substr(m+1,2),16);if(P<128)c+=String.fromCharCode(P),m+=3;else if(P>=194&&P<224){if(E-m>=6){var L=parseInt(d.substr(m+4,2),16);c+=String.fromCharCode((P&31)<<6|L&63)}else c+=d.substr(m,6);m+=6}else if(P>=224){if(E-m>=9){var H=parseInt(d.substr(m+4,2),16),X=parseInt(d.substr(m+7,2),16);c+=String.fromCharCode((P&15)<<12|(H&63)<<6|X&63)}else c+=d.substr(m,9);m+=9}else c+=d.substr(m,3),m+=3}return c}function Q(d,c){function m(E){var P=J(E);return P.match(c.UNRESERVED)?P:E}return d.scheme&&(d.scheme=String(d.scheme).replace(c.PCT_ENCODED,m).toLowerCase().replace(c.NOT_SCHEME,"")),d.userinfo!==void 0&&(d.userinfo=String(d.userinfo).replace(c.PCT_ENCODED,m).replace(c.NOT_USERINFO,M).replace(c.PCT_ENCODED,a)),d.host!==void 0&&(d.host=String(d.host).replace(c.PCT_ENCODED,m).toLowerCase().replace(c.NOT_HOST,M).replace(c.PCT_ENCODED,a)),d.path!==void 0&&(d.path=String(d.path).replace(c.PCT_ENCODED,m).replace(d.scheme?c.NOT_PATH:c.NOT_PATH_NOSCHEME,M).replace(c.PCT_ENCODED,a)),d.query!==void 0&&(d.query=String(d.query).replace(c.PCT_ENCODED,m).replace(c.NOT_QUERY,M).replace(c.PCT_ENCODED,a)),d.fragment!==void 0&&(d.fragment=String(d.fragment).replace(c.PCT_ENCODED,m).replace(c.NOT_FRAGMENT,M).replace(c.PCT_ENCODED,a)),d}function le(d){return d.replace(/^0*(.*)/,"$1")||"0"}function Ae(d,c){var m=d.match(c.IPV4ADDRESS)||[],E=k(m,2),P=E[1];return P?P.split(".").map(le).join("."):d}function Tt(d,c){var m=d.match(c.IPV6ADDRESS)||[],E=k(m,3),P=E[1],L=E[2];if(P){for(var H=P.toLowerCase().split("::").reverse(),X=k(H,2),se=X[0],ue=X[1],Y=ue?ue.split(":").map(le):[],ne=se.split(":").map(le),de=c.IPV4ADDRESS.test(ne[ne.length-1]),x=de?7:8,oe=ne.length-x,me=Array(x),ae=0;ae<x;++ae)me[ae]=Y[ae]||ne[oe+ae]||"";de&&(me[x-1]=Ae(me[x-1],c));var Xe=me.reduce(function(Oe,Le,pt){if(!Le||Le==="0"){var Je=Oe[Oe.length-1];Je&&Je.index+Je.length===pt?Je.length++:Oe.push({index:pt,length:1})}return Oe},[]),Me=Xe.sort(function(Oe,Le){return Le.length-Oe.length})[0],Ue=void 0;if(Me&&Me.length>1){var jt=me.slice(0,Me.index),dt=me.slice(Me.index+Me.length);Ue=jt.join(":")+"::"+dt.join(":")}else Ue=me.join(":");return L&&(Ue+="%"+L),Ue}else return d}var Qt=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Zt="".match(/(){0}/)[1]===void 0;function Te(d){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m={},E=c.iri!==!1?y:f;c.reference==="suffix"&&(d=(c.scheme?c.scheme+":":"")+"//"+d);var P=d.match(Qt);if(P){Zt?(m.scheme=P[1],m.userinfo=P[3],m.host=P[4],m.port=parseInt(P[5],10),m.path=P[6]||"",m.query=P[7],m.fragment=P[8],isNaN(m.port)&&(m.port=P[5])):(m.scheme=P[1]||void 0,m.userinfo=d.indexOf("@")!==-1?P[3]:void 0,m.host=d.indexOf("//")!==-1?P[4]:void 0,m.port=parseInt(P[5],10),m.path=P[6]||"",m.query=d.indexOf("?")!==-1?P[7]:void 0,m.fragment=d.indexOf("#")!==-1?P[8]:void 0,isNaN(m.port)&&(m.port=d.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?P[4]:void 0)),m.host&&(m.host=Tt(Ae(m.host,E),E)),m.scheme===void 0&&m.userinfo===void 0&&m.host===void 0&&m.port===void 0&&!m.path&&m.query===void 0?m.reference="same-document":m.scheme===void 0?m.reference="relative":m.fragment===void 0?m.reference="absolute":m.reference="uri",c.reference&&c.reference!=="suffix"&&c.reference!==m.reference&&(m.error=m.error||"URI is not a "+c.reference+" reference.");var L=q[(c.scheme||m.scheme||"").toLowerCase()];if(!c.unicodeSupport&&(!L||!L.unicodeSupport)){if(m.host&&(c.domainHost||L&&L.domainHost))try{m.host=N.toASCII(m.host.replace(E.PCT_ENCODED,J).toLowerCase())}catch(H){m.error=m.error||"Host's domain name can not be converted to ASCII via punycode: "+H}Q(m,f)}else Q(m,E);L&&L.parse&&L.parse(m,c)}else m.error=m.error||"URI can not be parsed.";return m}function Xt(d,c){var m=c.iri!==!1?y:f,E=[];return d.userinfo!==void 0&&(E.push(d.userinfo),E.push("@")),d.host!==void 0&&E.push(Tt(Ae(String(d.host),m),m).replace(m.IPV6ADDRESS,function(P,L,H){return"["+L+(H?"%25"+H:"")+"]"})),(typeof d.port=="number"||typeof d.port=="string")&&(E.push(":"),E.push(String(d.port))),E.length?E.join(""):void 0}var kt=/^\.\.?\//,Rt=/^\/\.(\/|$)/,Ot=/^\/\.\.(\/|$)/,er=/^\/?(?:.|\n)*?(?=\/|$)/;function Fe(d){for(var c=[];d.length;)if(d.match(kt))d=d.replace(kt,"");else if(d.match(Rt))d=d.replace(Rt,"/");else if(d.match(Ot))d=d.replace(Ot,"/"),c.pop();else if(d==="."||d==="..")d="";else{var m=d.match(er);if(m){var E=m[0];d=d.slice(E.length),c.push(E)}else throw new Error("Unexpected dot segment condition")}return c.join("")}function Pe(d){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=c.iri?y:f,E=[],P=q[(c.scheme||d.scheme||"").toLowerCase()];if(P&&P.serialize&&P.serialize(d,c),d.host&&!m.IPV6ADDRESS.test(d.host)){if(c.domainHost||P&&P.domainHost)try{d.host=c.iri?N.toUnicode(d.host):N.toASCII(d.host.replace(m.PCT_ENCODED,J).toLowerCase())}catch(X){d.error=d.error||"Host's domain name can not be converted to "+(c.iri?"Unicode":"ASCII")+" via punycode: "+X}}Q(d,m),c.reference!=="suffix"&&d.scheme&&(E.push(d.scheme),E.push(":"));var L=Xt(d,c);if(L!==void 0&&(c.reference!=="suffix"&&E.push("//"),E.push(L),d.path&&d.path.charAt(0)!=="/"&&E.push("/")),d.path!==void 0){var H=d.path;!c.absolutePath&&(!P||!P.absolutePath)&&(H=Fe(H)),L===void 0&&(H=H.replace(/^\/\//,"/%2F")),E.push(H)}return d.query!==void 0&&(E.push("?"),E.push(d.query)),d.fragment!==void 0&&(E.push("#"),E.push(d.fragment)),E.join("")}function Ct(d,c){var m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},E=arguments[3],P={};return E||(d=Te(Pe(d,m),m),c=Te(Pe(c,m),m)),m=m||{},!m.tolerant&&c.scheme?(P.scheme=c.scheme,P.userinfo=c.userinfo,P.host=c.host,P.port=c.port,P.path=Fe(c.path||""),P.query=c.query):(c.userinfo!==void 0||c.host!==void 0||c.port!==void 0?(P.userinfo=c.userinfo,P.host=c.host,P.port=c.port,P.path=Fe(c.path||""),P.query=c.query):(c.path?(c.path.charAt(0)==="/"?P.path=Fe(c.path):((d.userinfo!==void 0||d.host!==void 0||d.port!==void 0)&&!d.path?P.path="/"+c.path:d.path?P.path=d.path.slice(0,d.path.lastIndexOf("/")+1)+c.path:P.path=c.path,P.path=Fe(P.path)),P.query=c.query):(P.path=d.path,c.query!==void 0?P.query=c.query:P.query=d.query),P.userinfo=d.userinfo,P.host=d.host,P.port=d.port),P.scheme=d.scheme),P.fragment=c.fragment,P}function tr(d,c,m){var E=p({scheme:"null"},m);return Pe(Ct(Te(d,E),Te(c,E),E,!0),E)}function lt(d,c){return typeof d=="string"?d=Pe(Te(d,c),c):i(d)==="object"&&(d=Te(Pe(d,c),c)),d}function rr(d,c,m){return typeof d=="string"?d=Pe(Te(d,m),m):i(d)==="object"&&(d=Pe(d,m)),typeof c=="string"?c=Pe(Te(c,m),m):i(c)==="object"&&(c=Pe(c,m)),d===c}function Pr(d,c){return d&&d.toString().replace(!c||!c.iri?f.ESCAPE:y.ESCAPE,M)}function Re(d,c){return d&&d.toString().replace(!c||!c.iri?f.PCT_ENCODED:y.PCT_ENCODED,J)}var ut={scheme:"http",domainHost:!0,parse:function(c,m){return c.host||(c.error=c.error||"HTTP URIs must have a host."),c},serialize:function(c,m){var E=String(c.scheme).toLowerCase()==="https";return(c.port===(E?443:80)||c.port==="")&&(c.port=void 0),c.path||(c.path="/"),c}},bs={scheme:"https",domainHost:ut.domainHost,parse:ut.parse,serialize:ut.serialize};function Ps(d){return typeof d.secure=="boolean"?d.secure:String(d.scheme).toLowerCase()==="wss"}var nr={scheme:"ws",domainHost:!0,parse:function(c,m){var E=c;return E.secure=Ps(E),E.resourceName=(E.path||"/")+(E.query?"?"+E.query:""),E.path=void 0,E.query=void 0,E},serialize:function(c,m){if((c.port===(Ps(c)?443:80)||c.port==="")&&(c.port=void 0),typeof c.secure=="boolean"&&(c.scheme=c.secure?"wss":"ws",c.secure=void 0),c.resourceName){var E=c.resourceName.split("?"),P=k(E,2),L=P[0],H=P[1];c.path=L&&L!=="/"?L:void 0,c.query=H,c.resourceName=void 0}return c.fragment=void 0,c}},Es={scheme:"wss",domainHost:nr.domainHost,parse:nr.parse,serialize:nr.serialize},zo={},Ss="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",qe="[0-9A-Fa-f]",Vo=s(s("%[EFef]"+qe+"%"+qe+qe+"%"+qe+qe)+"|"+s("%[89A-Fa-f]"+qe+"%"+qe+qe)+"|"+s("%"+qe+qe)),Wo="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",xo="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",Bo=n(xo,'[\\"\\\\]'),Go="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ko=new RegExp(Ss,"g"),Nt=new RegExp(Vo,"g"),Jo=new RegExp(n("[^]",Wo,"[\\.]",'[\\"]',Bo),"g"),Ts=new RegExp(n("[^]",Ss,Go),"g"),Yo=Ts;function fn(d){var c=J(d);return c.match(Ko)?c:d}var ks={scheme:"mailto",parse:function(c,m){var E=c,P=E.to=E.path?E.path.split(","):[];if(E.path=void 0,E.query){for(var L=!1,H={},X=E.query.split("&"),se=0,ue=X.length;se<ue;++se){var Y=X[se].split("=");switch(Y[0]){case"to":for(var ne=Y[1].split(","),de=0,x=ne.length;de<x;++de)P.push(ne[de]);break;case"subject":E.subject=Re(Y[1],m);break;case"body":E.body=Re(Y[1],m);break;default:L=!0,H[Re(Y[0],m)]=Re(Y[1],m);break}}L&&(E.headers=H)}E.query=void 0;for(var oe=0,me=P.length;oe<me;++oe){var ae=P[oe].split("@");if(ae[0]=Re(ae[0]),m.unicodeSupport)ae[1]=Re(ae[1],m).toLowerCase();else try{ae[1]=N.toASCII(Re(ae[1],m).toLowerCase())}catch(Xe){E.error=E.error||"Email address's domain name can not be converted to ASCII via punycode: "+Xe}P[oe]=ae.join("@")}return E},serialize:function(c,m){var E=c,P=l(c.to);if(P){for(var L=0,H=P.length;L<H;++L){var X=String(P[L]),se=X.lastIndexOf("@"),ue=X.slice(0,se).replace(Nt,fn).replace(Nt,a).replace(Jo,M),Y=X.slice(se+1);try{Y=m.iri?N.toUnicode(Y):N.toASCII(Re(Y,m).toLowerCase())}catch(oe){E.error=E.error||"Email address's domain name can not be converted to "+(m.iri?"Unicode":"ASCII")+" via punycode: "+oe}P[L]=ue+"@"+Y}E.path=P.join(",")}var ne=c.headers=c.headers||{};c.subject&&(ne.subject=c.subject),c.body&&(ne.body=c.body);var de=[];for(var x in ne)ne[x]!==zo[x]&&de.push(x.replace(Nt,fn).replace(Nt,a).replace(Ts,M)+"="+ne[x].replace(Nt,fn).replace(Nt,a).replace(Yo,M));return de.length&&(E.query=de.join("&")),E}},Qo=/^([^\:]+)\:(.*)/,Rs={scheme:"urn",parse:function(c,m){var E=c.path&&c.path.match(Qo),P=c;if(E){var L=m.scheme||P.scheme||"urn",H=E[1].toLowerCase(),X=E[2],se=L+":"+(m.nid||H),ue=q[se];P.nid=H,P.nss=X,P.path=void 0,ue&&(P=ue.parse(P,m))}else P.error=P.error||"URN can not be parsed.";return P},serialize:function(c,m){var E=m.scheme||c.scheme||"urn",P=c.nid,L=E+":"+(m.nid||P),H=q[L];H&&(c=H.serialize(c,m));var X=c,se=c.nss;return X.path=(P||m.nid)+":"+se,X}},Zo=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Os={scheme:"urn:uuid",parse:function(c,m){var E=c;return E.uuid=E.nss,E.nss=void 0,!m.tolerant&&(!E.uuid||!E.uuid.match(Zo))&&(E.error=E.error||"UUID is not valid."),E},serialize:function(c,m){var E=c;return E.nss=(c.uuid||"").toLowerCase(),E}};q[ut.scheme]=ut,q[bs.scheme]=bs,q[nr.scheme]=nr,q[Es.scheme]=Es,q[ks.scheme]=ks,q[Rs.scheme]=Rs,q[Os.scheme]=Os,r.SCHEMES=q,r.pctEncChar=M,r.pctDecChars=J,r.parse=Te,r.removeDotSegments=Fe,r.serialize=Pe,r.resolveComponents=Ct,r.resolve=tr,r.normalize=lt,r.equal=rr,r.escapeComponent=Pr,r.unescapeComponent=Re,Object.defineProperty(r,"__esModule",{value:!0})})})(Sn,Sn.exports);var jl=Sn.exports;Object.defineProperty(Wn,"__esModule",{value:!0});const jo=jl;jo.code='require("ajv/dist/runtime/uri").default';Wn.default=jo;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=De;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return e.KeywordCxt}});var r=G;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=wr,s=vr,i=vt,a=Se,l=G,p=$e,u=_r,f=re,y=Nl,k=Wn,R=(F,$)=>new RegExp(F,$);R.code="new RegExp";const w=["removeAdditional","useDefaults","coerceTypes"],S=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),_={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."},g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},T=200;function O(F){var $,I,b,o,h,N,q,M,J,Q,le,Ae,Tt,Qt,Zt,Te,Xt,kt,Rt,Ot,er,Fe,Pe,Ct,tr;const lt=F.strict,rr=($=F.code)===null||$===void 0?void 0:$.optimize,Pr=rr===!0||rr===void 0?1:rr||0,Re=(b=(I=F.code)===null||I===void 0?void 0:I.regExp)!==null&&b!==void 0?b:R,ut=(o=F.uriResolver)!==null&&o!==void 0?o:k.default;return{strictSchema:(N=(h=F.strictSchema)!==null&&h!==void 0?h:lt)!==null&&N!==void 0?N:!0,strictNumbers:(M=(q=F.strictNumbers)!==null&&q!==void 0?q:lt)!==null&&M!==void 0?M:!0,strictTypes:(Q=(J=F.strictTypes)!==null&&J!==void 0?J:lt)!==null&&Q!==void 0?Q:"log",strictTuples:(Ae=(le=F.strictTuples)!==null&&le!==void 0?le:lt)!==null&&Ae!==void 0?Ae:"log",strictRequired:(Qt=(Tt=F.strictRequired)!==null&&Tt!==void 0?Tt:lt)!==null&&Qt!==void 0?Qt:!1,code:F.code?{...F.code,optimize:Pr,regExp:Re}:{optimize:Pr,regExp:Re},loopRequired:(Zt=F.loopRequired)!==null&&Zt!==void 0?Zt:T,loopEnum:(Te=F.loopEnum)!==null&&Te!==void 0?Te:T,meta:(Xt=F.meta)!==null&&Xt!==void 0?Xt:!0,messages:(kt=F.messages)!==null&&kt!==void 0?kt:!0,inlineRefs:(Rt=F.inlineRefs)!==null&&Rt!==void 0?Rt:!0,schemaId:(Ot=F.schemaId)!==null&&Ot!==void 0?Ot:"$id",addUsedSchema:(er=F.addUsedSchema)!==null&&er!==void 0?er:!0,validateSchema:(Fe=F.validateSchema)!==null&&Fe!==void 0?Fe:!0,validateFormats:(Pe=F.validateFormats)!==null&&Pe!==void 0?Pe:!0,unicodeRegExp:(Ct=F.unicodeRegExp)!==null&&Ct!==void 0?Ct:!0,int32range:(tr=F.int32range)!==null&&tr!==void 0?tr:!0,uriResolver:ut}}class j{constructor($={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...O($)};const{es5:I,lines:b}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:S,es5:I,lines:b}),this.logger=Z($.logger);const o=$.validateFormats;$.validateFormats=!1,this.RULES=(0,i.getRules)(),A.call(this,_,$,"NOT SUPPORTED"),A.call(this,g,$,"DEPRECATED","warn"),this._metaOpts=K.call(this),$.formats&&D.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords&&W.call(this,$.keywords),typeof $.meta=="object"&&this.addMetaSchema($.meta),C.call(this),$.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:$,meta:I,schemaId:b}=this.opts;let o=y;b==="id"&&(o={...y},o.id=o.$id,delete o.$id),I&&$&&this.addMetaSchema(o,o[b],!1)}defaultMeta(){const{meta:$,schemaId:I}=this.opts;return this.opts.defaultMeta=typeof $=="object"?$[I]||$:void 0}validate($,I){let b;if(typeof $=="string"){if(b=this.getSchema($),!b)throw new Error(`no schema with key or ref "${$}"`)}else b=this.compile($);const o=b(I);return"$async"in b||(this.errors=b.errors),o}compile($,I){const b=this._addSchema($,I);return b.validate||this._compileSchemaEnv(b)}compileAsync($,I){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:b}=this.opts;return o.call(this,$,I);async function o(Q,le){await h.call(this,Q.$schema);const Ae=this._addSchema(Q,le);return Ae.validate||N.call(this,Ae)}async function h(Q){Q&&!this.getSchema(Q)&&await o.call(this,{$ref:Q},!0)}async function N(Q){try{return this._compileSchemaEnv(Q)}catch(le){if(!(le instanceof s.default))throw le;return q.call(this,le),await M.call(this,le.missingSchema),N.call(this,Q)}}function q({missingSchema:Q,missingRef:le}){if(this.refs[Q])throw new Error(`AnySchema ${Q} is loaded but ${le} cannot be resolved`)}async function M(Q){const le=await J.call(this,Q);this.refs[Q]||await h.call(this,le.$schema),this.refs[Q]||this.addSchema(le,Q,I)}async function J(Q){const le=this._loading[Q];if(le)return le;try{return await(this._loading[Q]=b(Q))}finally{delete this._loading[Q]}}}addSchema($,I,b,o=this.opts.validateSchema){if(Array.isArray($)){for(const N of $)this.addSchema(N,void 0,b,o);return this}let h;if(typeof $=="object"){const{schemaId:N}=this.opts;if(h=$[N],h!==void 0&&typeof h!="string")throw new Error(`schema ${N} must be string`)}return I=(0,p.normalizeId)(I||h),this._checkUnique(I),this.schemas[I]=this._addSchema($,b,I,o,!0),this}addMetaSchema($,I,b=this.opts.validateSchema){return this.addSchema($,I,!0,b),this}validateSchema($,I){if(typeof $=="boolean")return!0;let b;if(b=$.$schema,b!==void 0&&typeof b!="string")throw new Error("$schema must be a string");if(b=b||this.opts.defaultMeta||this.defaultMeta(),!b)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const o=this.validate(b,$);if(!o&&I){const h="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(h);else throw new Error(h)}return o}getSchema($){let I;for(;typeof(I=v.call(this,$))=="string";)$=I;if(I===void 0){const{schemaId:b}=this.opts,o=new a.SchemaEnv({schema:{},schemaId:b});if(I=a.resolveSchema.call(this,o,$),!I)return;this.refs[$]=I}return I.validate||this._compileSchemaEnv(I)}removeSchema($){if($ instanceof RegExp)return this._removeAllSchemas(this.schemas,$),this._removeAllSchemas(this.refs,$),this;switch(typeof $){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const I=v.call(this,$);return typeof I=="object"&&this._cache.delete(I.schema),delete this.schemas[$],delete this.refs[$],this}case"object":{const I=$;this._cache.delete(I);let b=$[this.opts.schemaId];return b&&(b=(0,p.normalizeId)(b),delete this.schemas[b],delete this.refs[b]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary($){for(const I of $)this.addKeyword(I);return this}addKeyword($,I){let b;if(typeof $=="string")b=$,typeof I=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),I.keyword=b);else if(typeof $=="object"&&I===void 0){if(I=$,b=I.keyword,Array.isArray(b)&&!b.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(he.call(this,b,I),!I)return(0,f.eachItem)(b,h=>at.call(this,h)),this;Et.call(this,I);const o={...I,type:(0,u.getJSONTypes)(I.type),schemaType:(0,u.getJSONTypes)(I.schemaType)};return(0,f.eachItem)(b,o.type.length===0?h=>at.call(this,h,o):h=>o.type.forEach(N=>at.call(this,h,o,N))),this}getKeyword($){const I=this.RULES.all[$];return typeof I=="object"?I.definition:!!I}removeKeyword($){const{RULES:I}=this;delete I.keywords[$],delete I.all[$];for(const b of I.rules){const o=b.rules.findIndex(h=>h.keyword===$);o>=0&&b.rules.splice(o,1)}return this}addFormat($,I){return typeof I=="string"&&(I=new RegExp(I)),this.formats[$]=I,this}errorsText($=this.errors,{separator:I=", ",dataVar:b="data"}={}){return!$||$.length===0?"No errors":$.map(o=>`${b}${o.instancePath} ${o.message}`).reduce((o,h)=>o+I+h)}$dataMetaSchema($,I){const b=this.RULES.all;$=JSON.parse(JSON.stringify($));for(const o of I){const h=o.split("/").slice(1);let N=$;for(const q of h)N=N[q];for(const q in b){const M=b[q];if(typeof M!="object")continue;const{$data:J}=M.definition,Q=N[q];J&&Q&&(N[q]=St(Q))}}return $}_removeAllSchemas($,I){for(const b in $){const o=$[b];(!I||I.test(b))&&(typeof o=="string"?delete $[b]:o&&!o.meta&&(this._cache.delete(o.schema),delete $[b]))}}_addSchema($,I,b,o=this.opts.validateSchema,h=this.opts.addUsedSchema){let N;const{schemaId:q}=this.opts;if(typeof $=="object")N=$[q];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof $!="boolean")throw new Error("schema must be object or boolean")}let M=this._cache.get($);if(M!==void 0)return M;b=(0,p.normalizeId)(N||b);const J=p.getSchemaRefs.call(this,$,b);return M=new a.SchemaEnv({schema:$,schemaId:q,meta:I,baseId:b,localRefs:J}),this._cache.set(M.schema,M),h&&!b.startsWith("#")&&(b&&this._checkUnique(b),this.refs[b]=M),o&&this.validateSchema($,!0),M}_checkUnique($){if(this.schemas[$]||this.refs[$])throw new Error(`schema with key or id "${$}" already exists`)}_compileSchemaEnv($){if($.meta?this._compileMetaSchema($):a.compileSchema.call(this,$),!$.validate)throw new Error("ajv implementation error");return $.validate}_compileMetaSchema($){const I=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,$)}finally{this.opts=I}}}t.default=j,j.ValidationError=n.default,j.MissingRefError=s.default;function A(F,$,I,b="error"){for(const o in F){const h=o;h in $&&this.logger[b](`${I}: option ${o}. ${F[h]}`)}}function v(F){return F=(0,p.normalizeId)(F),this.schemas[F]||this.refs[F]}function C(){const F=this.opts.schemas;if(F)if(Array.isArray(F))this.addSchema(F);else for(const $ in F)this.addSchema(F[$],$)}function D(){for(const F in this.opts.formats){const $=this.opts.formats[F];$&&this.addFormat(F,$)}}function W(F){if(Array.isArray(F)){this.addVocabulary(F);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const $ in F){const I=F[$];I.keyword||(I.keyword=$),this.addKeyword(I)}}function K(){const F={...this.opts};for(const $ of w)delete F[$];return F}const ce={log(){},warn(){},error(){}};function Z(F){if(F===!1)return ce;if(F===void 0)return console;if(F.log&&F.warn&&F.error)return F;throw new Error("logger must implement log, warn and error methods")}const ke=/^[a-z_$][a-z0-9_$:-]*$/i;function he(F,$){const{RULES:I}=this;if((0,f.eachItem)(F,b=>{if(I.keywords[b])throw new Error(`Keyword ${b} is already defined`);if(!ke.test(b))throw new Error(`Keyword ${b} has invalid name`)}),!!$&&$.$data&&!("code"in $||"validate"in $))throw new Error('$data keyword must have "code" or "validate" function')}function at(F,$,I){var b;const o=$==null?void 0:$.post;if(I&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:h}=this;let N=o?h.post:h.rules.find(({type:M})=>M===I);if(N||(N={type:I,rules:[]},h.rules.push(N)),h.keywords[F]=!0,!$)return;const q={keyword:F,definition:{...$,type:(0,u.getJSONTypes)($.type),schemaType:(0,u.getJSONTypes)($.schemaType)}};$.before?ct.call(this,N,q,$.before):N.rules.push(q),h.all[F]=q,(b=$.implements)===null||b===void 0||b.forEach(M=>this.addKeyword(M))}function ct(F,$,I){const b=F.rules.findIndex(o=>o.keyword===I);b>=0?F.rules.splice(b,0,$):(F.rules.push($),this.logger.warn(`rule ${I} is not defined`))}function Et(F){let{metaSchema:$}=F;$!==void 0&&(F.$data&&this.opts.$data&&($=St($)),F.validateSchema=this.compile($,!0))}const Yt={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function St(F){return{anyOf:[F,Yt]}}})(oo);var xn={},Bn={},Gn={};Object.defineProperty(Gn,"__esModule",{value:!0});const Il={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Gn.default=Il;var bt={};Object.defineProperty(bt,"__esModule",{value:!0});bt.callRef=bt.getValidate=void 0;const Dl=vr,Xs=B,Ee=G,At=Ke,ei=Se,kr=re,Al={keyword:"$ref",schemaType:"string",code(t){const{gen:e,schema:r,it:n}=t,{baseId:s,schemaEnv:i,validateName:a,opts:l,self:p}=n,{root:u}=i;if((r==="#"||r==="#/")&&s===u.baseId)return y();const f=ei.resolveRef.call(p,u,s,r);if(f===void 0)throw new Dl.default(n.opts.uriResolver,s,r);if(f instanceof ei.SchemaEnv)return k(f);return R(f);function y(){if(i===u)return Ar(t,a,i,i.$async);const w=e.scopeValue("root",{ref:u});return Ar(t,(0,Ee._)`${w}.validate`,u,u.$async)}function k(w){const S=Io(t,w);Ar(t,S,w,w.$async)}function R(w){const S=e.scopeValue("schema",l.code.source===!0?{ref:w,code:(0,Ee.stringify)(w)}:{ref:w}),_=e.name("valid"),g=t.subschema({schema:w,dataTypes:[],schemaPath:Ee.nil,topSchemaRef:S,errSchemaPath:r},_);t.mergeEvaluated(g),t.ok(_)}}};function Io(t,e){const{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Ee._)`${r.scopeValue("wrapper",{ref:e})}.validate`}bt.getValidate=Io;function Ar(t,e,r,n){const{gen:s,it:i}=t,{allErrors:a,schemaEnv:l,opts:p}=i,u=p.passContext?At.default.this:Ee.nil;n?f():y();function f(){if(!l.$async)throw new Error("async schema referenced by sync schema");const w=s.let("valid");s.try(()=>{s.code((0,Ee._)`await ${(0,Xs.callValidateCode)(t,e,u)}`),R(e),a||s.assign(w,!0)},S=>{s.if((0,Ee._)`!(${S} instanceof ${i.ValidationError})`,()=>s.throw(S)),k(S),a||s.assign(w,!1)}),t.ok(w)}function y(){t.result((0,Xs.callValidateCode)(t,e,u),()=>R(e),()=>k(e))}function k(w){const S=(0,Ee._)`${w}.errors`;s.assign(At.default.vErrors,(0,Ee._)`${At.default.vErrors} === null ? ${S} : ${At.default.vErrors}.concat(${S})`),s.assign(At.default.errors,(0,Ee._)`${At.default.vErrors}.length`)}function R(w){var S;if(!i.opts.unevaluated)return;const _=(S=r==null?void 0:r.validate)===null||S===void 0?void 0:S.evaluated;if(i.props!==!0)if(_&&!_.dynamicProps)_.props!==void 0&&(i.props=kr.mergeEvaluated.props(s,_.props,i.props));else{const g=s.var("props",(0,Ee._)`${w}.evaluated.props`);i.props=kr.mergeEvaluated.props(s,g,i.props,Ee.Name)}if(i.items!==!0)if(_&&!_.dynamicItems)_.items!==void 0&&(i.items=kr.mergeEvaluated.items(s,_.items,i.items));else{const g=s.var("items",(0,Ee._)`${w}.evaluated.items`);i.items=kr.mergeEvaluated.items(s,g,i.items,Ee.Name)}}}bt.callRef=Ar;bt.default=Al;Object.defineProperty(Bn,"__esModule",{value:!0});const Fl=Gn,ql=bt,Ml=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Fl.default,ql.default];Bn.default=Ml;var Kn={},Jn={};Object.defineProperty(Jn,"__esModule",{value:!0});const Lr=G,rt=Lr.operators,Hr={maximum:{okStr:"<=",ok:rt.LTE,fail:rt.GT},minimum:{okStr:">=",ok:rt.GTE,fail:rt.LT},exclusiveMaximum:{okStr:"<",ok:rt.LT,fail:rt.GTE},exclusiveMinimum:{okStr:">",ok:rt.GT,fail:rt.LTE}},Ul={message:({keyword:t,schemaCode:e})=>(0,Lr.str)`must be ${Hr[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Lr._)`{comparison: ${Hr[t].okStr}, limit: ${e}}`},Ll={keyword:Object.keys(Hr),type:"number",schemaType:"number",$data:!0,error:Ul,code(t){const{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,Lr._)`${r} ${Hr[e].fail} ${n} || isNaN(${r})`)}};Jn.default=Ll;var Yn={};Object.defineProperty(Yn,"__esModule",{value:!0});const ur=G,Hl={message:({schemaCode:t})=>(0,ur.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,ur._)`{multipleOf: ${t}}`},zl={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Hl,code(t){const{gen:e,data:r,schemaCode:n,it:s}=t,i=s.opts.multipleOfPrecision,a=e.let("res"),l=i?(0,ur._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${i}`:(0,ur._)`${a} !== parseInt(${a})`;t.fail$data((0,ur._)`(${n} === 0 || (${a} = ${r}/${n}, ${l}))`)}};Yn.default=zl;var Qn={},Zn={};Object.defineProperty(Zn,"__esModule",{value:!0});function Do(t){const e=t.length;let r=0,n=0,s;for(;n<e;)r++,s=t.charCodeAt(n++),s>=55296&&s<=56319&&n<e&&(s=t.charCodeAt(n),(s&64512)===56320&&n++);return r}Zn.default=Do;Do.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(Qn,"__esModule",{value:!0});const mt=G,Vl=re,Wl=Zn,xl={message({keyword:t,schemaCode:e}){const r=t==="maxLength"?"more":"fewer";return(0,mt.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,mt._)`{limit: ${t}}`},Bl={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:xl,code(t){const{keyword:e,data:r,schemaCode:n,it:s}=t,i=e==="maxLength"?mt.operators.GT:mt.operators.LT,a=s.opts.unicode===!1?(0,mt._)`${r}.length`:(0,mt._)`${(0,Vl.useFunc)(t.gen,Wl.default)}(${r})`;t.fail$data((0,mt._)`${a} ${i} ${n}`)}};Qn.default=Bl;var Xn={};Object.defineProperty(Xn,"__esModule",{value:!0});const Gl=B,zr=G,Kl={message:({schemaCode:t})=>(0,zr.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,zr._)`{pattern: ${t}}`},Jl={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Kl,code(t){const{data:e,$data:r,schema:n,schemaCode:s,it:i}=t,a=i.opts.unicodeRegExp?"u":"",l=r?(0,zr._)`(new RegExp(${s}, ${a}))`:(0,Gl.usePattern)(t,n);t.fail$data((0,zr._)`!${l}.test(${e})`)}};Xn.default=Jl;var es={};Object.defineProperty(es,"__esModule",{value:!0});const dr=G,Yl={message({keyword:t,schemaCode:e}){const r=t==="maxProperties"?"more":"fewer";return(0,dr.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,dr._)`{limit: ${t}}`},Ql={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Yl,code(t){const{keyword:e,data:r,schemaCode:n}=t,s=e==="maxProperties"?dr.operators.GT:dr.operators.LT;t.fail$data((0,dr._)`Object.keys(${r}).length ${s} ${n}`)}};es.default=Ql;var ts={};Object.defineProperty(ts,"__esModule",{value:!0});const ar=B,pr=G,Zl=re,Xl={message:({params:{missingProperty:t}})=>(0,pr.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,pr._)`{missingProperty: ${t}}`},eu={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Xl,code(t){const{gen:e,schema:r,schemaCode:n,data:s,$data:i,it:a}=t,{opts:l}=a;if(!i&&r.length===0)return;const p=r.length>=l.loopRequired;if(a.allErrors?u():f(),l.strictRequired){const R=t.parentSchema.properties,{definedProperties:w}=t.it;for(const S of r)if((R==null?void 0:R[S])===void 0&&!w.has(S)){const _=a.schemaEnv.baseId+a.errSchemaPath,g=`required property "${S}" is not defined at "${_}" (strictRequired)`;(0,Zl.checkStrictMode)(a,g,a.opts.strictRequired)}}function u(){if(p||i)t.block$data(pr.nil,y);else for(const R of r)(0,ar.checkReportMissingProp)(t,R)}function f(){const R=e.let("missing");if(p||i){const w=e.let("valid",!0);t.block$data(w,()=>k(R,w)),t.ok(w)}else e.if((0,ar.checkMissingProp)(t,r,R)),(0,ar.reportMissingProp)(t,R),e.else()}function y(){e.forOf("prop",n,R=>{t.setParams({missingProperty:R}),e.if((0,ar.noPropertyInData)(e,s,R,l.ownProperties),()=>t.error())})}function k(R,w){t.setParams({missingProperty:R}),e.forOf(R,n,()=>{e.assign(w,(0,ar.propertyInData)(e,s,R,l.ownProperties)),e.if((0,pr.not)(w),()=>{t.error(),e.break()})},pr.nil)}}};ts.default=eu;var rs={};Object.defineProperty(rs,"__esModule",{value:!0});const fr=G,tu={message({keyword:t,schemaCode:e}){const r=t==="maxItems"?"more":"fewer";return(0,fr.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,fr._)`{limit: ${t}}`},ru={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:tu,code(t){const{keyword:e,data:r,schemaCode:n}=t,s=e==="maxItems"?fr.operators.GT:fr.operators.LT;t.fail$data((0,fr._)`${r}.length ${s} ${n}`)}};rs.default=ru;var ns={},br={};Object.defineProperty(br,"__esModule",{value:!0});const Ao=mo;Ao.code='require("ajv/dist/runtime/equal").default';br.default=Ao;Object.defineProperty(ns,"__esModule",{value:!0});const _n=_r,ge=G,nu=re,su=br,iu={message:({params:{i:t,j:e}})=>(0,ge.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,ge._)`{i: ${t}, j: ${e}}`},ou={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:iu,code(t){const{gen:e,data:r,$data:n,schema:s,parentSchema:i,schemaCode:a,it:l}=t;if(!n&&!s)return;const p=e.let("valid"),u=i.items?(0,_n.getSchemaTypes)(i.items):[];t.block$data(p,f,(0,ge._)`${a} === false`),t.ok(p);function f(){const w=e.let("i",(0,ge._)`${r}.length`),S=e.let("j");t.setParams({i:w,j:S}),e.assign(p,!0),e.if((0,ge._)`${w} > 1`,()=>(y()?k:R)(w,S))}function y(){return u.length>0&&!u.some(w=>w==="object"||w==="array")}function k(w,S){const _=e.name("item"),g=(0,_n.checkDataTypes)(u,_,l.opts.strictNumbers,_n.DataType.Wrong),T=e.const("indices",(0,ge._)`{}`);e.for((0,ge._)`;${w}--;`,()=>{e.let(_,(0,ge._)`${r}[${w}]`),e.if(g,(0,ge._)`continue`),u.length>1&&e.if((0,ge._)`typeof ${_} == "string"`,(0,ge._)`${_} += "_"`),e.if((0,ge._)`typeof ${T}[${_}] == "number"`,()=>{e.assign(S,(0,ge._)`${T}[${_}]`),t.error(),e.assign(p,!1).break()}).code((0,ge._)`${T}[${_}] = ${w}`)})}function R(w,S){const _=(0,nu.useFunc)(e,su.default),g=e.name("outer");e.label(g).for((0,ge._)`;${w}--;`,()=>e.for((0,ge._)`${S} = ${w}; ${S}--;`,()=>e.if((0,ge._)`${_}(${r}[${w}], ${r}[${S}])`,()=>{t.error(),e.assign(p,!1).break(g)})))}}};ns.default=ou;var ss={};Object.defineProperty(ss,"__esModule",{value:!0});const Tn=G,au=re,cu=br,lu={message:"must be equal to constant",params:({schemaCode:t})=>(0,Tn._)`{allowedValue: ${t}}`},uu={keyword:"const",$data:!0,error:lu,code(t){const{gen:e,data:r,$data:n,schemaCode:s,schema:i}=t;n||i&&typeof i=="object"?t.fail$data((0,Tn._)`!${(0,au.useFunc)(e,cu.default)}(${r}, ${s})`):t.fail((0,Tn._)`${i} !== ${r}`)}};ss.default=uu;var is={};Object.defineProperty(is,"__esModule",{value:!0});const cr=G,du=re,pu=br,fu={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,cr._)`{allowedValues: ${t}}`},hu={keyword:"enum",schemaType:"array",$data:!0,error:fu,code(t){const{gen:e,data:r,$data:n,schema:s,schemaCode:i,it:a}=t;if(!n&&s.length===0)throw new Error("enum must have non-empty array");const l=s.length>=a.opts.loopEnum;let p;const u=()=>p??(p=(0,du.useFunc)(e,pu.default));let f;if(l||n)f=e.let("valid"),t.block$data(f,y);else{if(!Array.isArray(s))throw new Error("ajv implementation error");const R=e.const("vSchema",i);f=(0,cr.or)(...s.map((w,S)=>k(R,S)))}t.pass(f);function y(){e.assign(f,!1),e.forOf("v",i,R=>e.if((0,cr._)`${u()}(${r}, ${R})`,()=>e.assign(f,!0).break()))}function k(R,w){const S=s[w];return typeof S=="object"&&S!==null?(0,cr._)`${u()}(${r}, ${R}[${w}])`:(0,cr._)`${r} === ${S}`}}};is.default=hu;Object.defineProperty(Kn,"__esModule",{value:!0});const mu=Jn,yu=Yn,gu=Qn,$u=Xn,_u=es,wu=ts,vu=rs,bu=ns,Pu=ss,Eu=is,Su=[mu.default,yu.default,gu.default,$u.default,_u.default,wu.default,vu.default,bu.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Pu.default,Eu.default];Kn.default=Su;var os={},Kt={};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.validateAdditionalItems=void 0;const yt=G,kn=re,Tu={message:({params:{len:t}})=>(0,yt.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,yt._)`{limit: ${t}}`},ku={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Tu,code(t){const{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,kn.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Fo(t,n)}};function Fo(t,e){const{gen:r,schema:n,data:s,keyword:i,it:a}=t;a.items=!0;const l=r.const("len",(0,yt._)`${s}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,yt._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,kn.alwaysValidSchema)(a,n)){const u=r.var("valid",(0,yt._)`${l} <= ${e.length}`);r.if((0,yt.not)(u),()=>p(u)),t.ok(u)}function p(u){r.forRange("i",e.length,l,f=>{t.subschema({keyword:i,dataProp:f,dataPropType:kn.Type.Num},u),a.allErrors||r.if((0,yt.not)(u),()=>r.break())})}}Kt.validateAdditionalItems=Fo;Kt.default=ku;var as={},Jt={};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.validateTuple=void 0;const ti=G,Fr=re,Ru=B,Ou={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){const{schema:e,it:r}=t;if(Array.isArray(e))return qo(t,"additionalItems",e);r.items=!0,!(0,Fr.alwaysValidSchema)(r,e)&&t.ok((0,Ru.validateArray)(t))}};function qo(t,e,r=t.schema){const{gen:n,parentSchema:s,data:i,keyword:a,it:l}=t;f(s),l.opts.unevaluated&&r.length&&l.items!==!0&&(l.items=Fr.mergeEvaluated.items(n,r.length,l.items));const p=n.name("valid"),u=n.const("len",(0,ti._)`${i}.length`);r.forEach((y,k)=>{(0,Fr.alwaysValidSchema)(l,y)||(n.if((0,ti._)`${u} > ${k}`,()=>t.subschema({keyword:a,schemaProp:k,dataProp:k},p)),t.ok(p))});function f(y){const{opts:k,errSchemaPath:R}=l,w=r.length,S=w===y.minItems&&(w===y.maxItems||y[e]===!1);if(k.strictTuples&&!S){const _=`"${a}" is ${w}-tuple, but minItems or maxItems/${e} are not specified or different at path "${R}"`;(0,Fr.checkStrictMode)(l,_,k.strictTuples)}}}Jt.validateTuple=qo;Jt.default=Ou;Object.defineProperty(as,"__esModule",{value:!0});const Cu=Jt,Nu={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,Cu.validateTuple)(t,"items")};as.default=Nu;var cs={};Object.defineProperty(cs,"__esModule",{value:!0});const ri=G,ju=re,Iu=B,Du=Kt,Au={message:({params:{len:t}})=>(0,ri.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,ri._)`{limit: ${t}}`},Fu={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:Au,code(t){const{schema:e,parentSchema:r,it:n}=t,{prefixItems:s}=r;n.items=!0,!(0,ju.alwaysValidSchema)(n,e)&&(s?(0,Du.validateAdditionalItems)(t,s):t.ok((0,Iu.validateArray)(t)))}};cs.default=Fu;var ls={};Object.defineProperty(ls,"__esModule",{value:!0});const Ce=G,Rr=re,qu={message:({params:{min:t,max:e}})=>e===void 0?(0,Ce.str)`must contain at least ${t} valid item(s)`:(0,Ce.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Ce._)`{minContains: ${t}}`:(0,Ce._)`{minContains: ${t}, maxContains: ${e}}`},Mu={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:qu,code(t){const{gen:e,schema:r,parentSchema:n,data:s,it:i}=t;let a,l;const{minContains:p,maxContains:u}=n;i.opts.next?(a=p===void 0?1:p,l=u):a=1;const f=e.const("len",(0,Ce._)`${s}.length`);if(t.setParams({min:a,max:l}),l===void 0&&a===0){(0,Rr.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&a>l){(0,Rr.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Rr.alwaysValidSchema)(i,r)){let S=(0,Ce._)`${f} >= ${a}`;l!==void 0&&(S=(0,Ce._)`${S} && ${f} <= ${l}`),t.pass(S);return}i.items=!0;const y=e.name("valid");l===void 0&&a===1?R(y,()=>e.if(y,()=>e.break())):a===0?(e.let(y,!0),l!==void 0&&e.if((0,Ce._)`${s}.length > 0`,k)):(e.let(y,!1),k()),t.result(y,()=>t.reset());function k(){const S=e.name("_valid"),_=e.let("count",0);R(S,()=>e.if(S,()=>w(_)))}function R(S,_){e.forRange("i",0,f,g=>{t.subschema({keyword:"contains",dataProp:g,dataPropType:Rr.Type.Num,compositeRule:!0},S),_()})}function w(S){e.code((0,Ce._)`${S}++`),l===void 0?e.if((0,Ce._)`${S} >= ${a}`,()=>e.assign(y,!0).break()):(e.if((0,Ce._)`${S} > ${l}`,()=>e.assign(y,!1).break()),a===1?e.assign(y,!0):e.if((0,Ce._)`${S} >= ${a}`,()=>e.assign(y,!0)))}}};ls.default=Mu;var Mo={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const e=G,r=re,n=B;t.error={message:({params:{property:p,depsCount:u,deps:f}})=>{const y=u===1?"property":"properties";return(0,e.str)`must have ${y} ${f} when property ${p} is present`},params:({params:{property:p,depsCount:u,deps:f,missingProperty:y}})=>(0,e._)`{property: ${p},
851
+ `;this[te].ccall("wasm_set_phpini_entries",null,[ve],[e])}this[te].ccall("php_wasm_init",null,[],[])},Gr=new WeakSet,xi=function(){const e="/tmp/headers.json";if(!this.fileExists(e))throw new Error("SAPI Error: Could not find response headers file.");const r=JSON.parse(this.readFileAsText(e)),n={};for(const s of r.headers){if(!s.includes(": "))continue;const i=s.indexOf(": "),a=s.substring(0,i).toLowerCase(),l=s.substring(i+2);a in n||(n[a]=[]),n[a].push(l)}return{headers:n,httpStatusCode:r.status}},Kr=new WeakSet,Bi=function(e){if(this[te].ccall("wasm_set_request_uri",null,[ve],[e]),e.includes("?")){const r=e.substring(e.indexOf("?")+1);this[te].ccall("wasm_set_query_string",null,[ve],[r])}},Jr=new WeakSet,Gi=function(e,r){this[te].ccall("wasm_set_request_host",null,[ve],[e]);let n;try{n=parseInt(new URL(e).port,10)}catch{}(!n||isNaN(n)||n===80)&&(n=r==="https"?443:80),this[te].ccall("wasm_set_request_port",null,[It],[n]),(r==="https"||!r&&n===443)&&this.addServerGlobalEntry("HTTPS","on")},Yr=new WeakSet,Ki=function(e){this[te].ccall("wasm_set_request_method",null,[ve],[e])},Qr=new WeakSet,Ji=function(e){e.cookie&&this[te].ccall("wasm_set_cookies",null,[ve],[e.cookie]),e["content-type"]&&this[te].ccall("wasm_set_content_type",null,[ve],[e["content-type"]]),e["content-length"]&&this[te].ccall("wasm_set_content_length",null,[It],[parseInt(e["content-length"],10)]);for(const r in e){let n="HTTP_";["content-type","content-length"].includes(r.toLowerCase())&&(n=""),this.addServerGlobalEntry(`${n}${r.toUpperCase().replace(/-/g,"_")}`,e[r])}},Zr=new WeakSet,Yi=function(e){this[te].ccall("wasm_set_request_body",null,[ve],[e]),this[te].ccall("wasm_set_content_length",null,[It],[new TextEncoder().encode(e).length])},Xr=new WeakSet,Qi=function(e){this[te].ccall("wasm_set_path_translated",null,[ve],[e])},en=new WeakSet,Zi=function(){for(const e in z(this,st))this[te].ccall("wasm_add_SERVER_entry",null,[ve,ve],[e,z(this,st)[e]])},tn=new WeakSet,Xi=function(e){const{key:r,name:n,type:s,data:i}=e,a=`/tmp/${Math.random().toFixed(20)}`;this.writeFile(a,i);const l=0;this[te].ccall("wasm_add_uploaded_file",null,[ve,ve,ve,ve,It,It],[r,n,s,a,l,i.byteLength])},rn=new WeakSet,eo=function(e){this[te].ccall("wasm_set_php_code",null,[ve],[e])},nn=new WeakSet,to=async function(){var i;let e,r;try{e=await new Promise((a,l)=>{var u;r=f=>{const y=new Error("Rethrown");y.cause=f.error,y.betterMessage=f.message,l(y)},(u=z(this,vt))==null||u.addEventListener("error",r);const p=this[te].ccall("wasm_sapi_handle_request",It,[],[],{async:!0});return p instanceof Promise?p.then(a,l):a(p)})}catch(a){for(const f in this)typeof this[f]=="function"&&(this[f]=()=>{throw new Error("PHP runtime has crashed – see the earlier error for details.")});this.functionsMaybeMissingFromAsyncify=$a();const l=a,p="betterMessage"in l?l.betterMessage:l.message,u=new Error(p);throw u.cause=l,u}finally{(i=z(this,vt))==null||i.removeEventListener("error",r),pe(this,st,{})}const{headers:n,httpStatusCode:s}=_e(this,Gr,xi).call(this);return new Mt(s,n,this.readFileAsBuffer("/tmp/stdout"),this.readFileAsText("/tmp/stderr"),e)};Be([xe('Could not create directory "{path}"')],Ge.prototype,"mkdir",1);Be([xe('Could not create directory "{path}"')],Ge.prototype,"mkdirTree",1);Be([xe('Could not read "{path}"')],Ge.prototype,"readFileAsText",1);Be([xe('Could not read "{path}"')],Ge.prototype,"readFileAsBuffer",1);Be([xe('Could not write to "{path}"')],Ge.prototype,"writeFile",1);Be([xe('Could not unlink "{path}"')],Ge.prototype,"unlink",1);Be([xe('Could not remove directory "{path}"')],Ge.prototype,"rmdir",1);Be([xe('Could not list files in "{path}"')],Ge.prototype,"listFiles",1);Be([xe('Could not stat "{path}"')],Ge.prototype,"isDir",1);Be([xe('Could not stat "{path}"')],Ge.prototype,"fileExists",1);function ro(t){const e={};for(const r in t)e[r.toLowerCase()]=t[r];return e}const Ua=["vfs","literal","wordpress.org/themes","wordpress.org/plugins","url"];function La(t){return t&&typeof t=="object"&&typeof t.resource=="string"&&Ua.includes(t.resource)}class Pt{static create(e,{semaphore:r,progress:n}){let s;switch(e.resource){case"vfs":s=new Ha(e,n);break;case"literal":s=new za(e,n);break;case"wordpress.org/themes":s=new xa(e,n);break;case"wordpress.org/plugins":s=new Ba(e,n);break;case"url":s=new Wa(e,n);break;default:throw new Error(`Invalid resource: ${e}`)}return s=new Ga(s),r&&(s=new Ka(s,r)),s}setPlayground(e){this.playground=e}get isAsync(){return!1}}class Ha extends Pt{constructor(e,r){super(),this.resource=e,this.progress=r}async resolve(){var r;const e=await this.playground.readFileAsBuffer(this.resource.path);return(r=this.progress)==null||r.set(100),new File([e],this.name)}get name(){return this.resource.path.split("/").pop()||""}}class za extends Pt{constructor(e,r){super(),this.resource=e,this.progress=r}async resolve(){var e;return(e=this.progress)==null||e.set(100),new File([this.resource.contents],this.resource.name)}get name(){return this.resource.name}}class qn extends Pt{constructor(e){super(),this.progress=e}async resolve(){var n,s;(n=this.progress)==null||n.setCaption(this.caption);const e=this.getURL();let r=await fetch(e);if(r=await fa(r,((s=this.progress)==null?void 0:s.loadingListener)??Va),r.status!==200)throw new Error(`Could not download "${e}"`);return new File([await r.blob()],this.name)}get caption(){return`Downloading ${this.name}`}get name(){try{return new URL(this.getURL(),"http://example.com").pathname.split("/").pop()}catch{return this.getURL()}}get isAsync(){return!0}}const Va=()=>{};class Wa extends qn{constructor(e,r){super(r),this.resource=e}getURL(){return this.resource.url}get caption(){return this.resource.caption??super.caption}}class xa extends qn{constructor(e,r){super(r),this.resource=e}get name(){return an(this.resource.slug)}getURL(){return`https://downloads.wordpress.org/theme/${no(this.resource.slug)}`}}class Ba extends qn{constructor(e,r){super(r),this.resource=e}get name(){return an(this.resource.slug)}getURL(){return`https://downloads.wordpress.org/plugin/${no(this.resource.slug)}`}}function no(t){return!t||t.endsWith(".zip")?t:t+".latest-stable.zip"}class so extends Pt{constructor(e){super(),this.resource=e}async resolve(){return this.resource.resolve()}async setPlayground(e){return this.resource.setPlayground(e)}get progress(){return this.resource.progress}set progress(e){this.resource.progress=e}get name(){return this.resource.name}get isAsync(){return this.resource.isAsync}}class Ga extends so{async resolve(){return this.promise||(this.promise=super.resolve()),this.promise}}class Ka extends so{constructor(e,r){super(e),this.semaphore=r}async resolve(){return this.isAsync?this.semaphore.run(()=>super.resolve()):super.resolve()}}var Ja=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ya(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var bn={exports:{}},io={},De={},Bt={},$r={},G={},mr={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class e{}t._CodeOrName=e,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends e{constructor(T){if(super(),!t.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}}}t.Name=r;class n extends e{constructor(T){super(),this._items=typeof T=="string"?[T]:T}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const T=this._items[0];return T===""||T==='""'}get str(){var T;return(T=this._str)!==null&&T!==void 0?T:this._str=this._items.reduce((O,j)=>`${O}${j}`,"")}get names(){var T;return(T=this._names)!==null&&T!==void 0?T:this._names=this._items.reduce((O,j)=>(j instanceof r&&(O[j.str]=(O[j.str]||0)+1),O),{})}}t._Code=n,t.nil=new n("");function s(g,...T){const O=[g[0]];let j=0;for(;j<T.length;)l(O,T[j]),O.push(g[++j]);return new n(O)}t._=s;const i=new n("+");function a(g,...T){const O=[R(g[0])];let j=0;for(;j<T.length;)O.push(i),l(O,T[j]),O.push(i,R(g[++j]));return p(O),new n(O)}t.str=a;function l(g,T){T instanceof n?g.push(...T._items):T instanceof r?g.push(T):g.push(y(T))}t.addCodeArg=l;function p(g){let T=1;for(;T<g.length-1;){if(g[T]===i){const O=u(g[T-1],g[T+1]);if(O!==void 0){g.splice(T-1,3,O);continue}g[T++]="+"}T++}}function u(g,T){if(T==='""')return g;if(g==='""')return T;if(typeof g=="string")return T instanceof r||g[g.length-1]!=='"'?void 0:typeof T!="string"?`${g.slice(0,-1)}${T}"`:T[0]==='"'?g.slice(0,-1)+T.slice(1):void 0;if(typeof T=="string"&&T[0]==='"'&&!(g instanceof r))return`"${g}${T.slice(1)}`}function f(g,T){return T.emptyStr()?g:g.emptyStr()?T:a`${g}${T}`}t.strConcat=f;function y(g){return typeof g=="number"||typeof g=="boolean"||g===null?g:R(Array.isArray(g)?g.join(","):g)}function k(g){return new n(R(g))}t.stringify=k;function R(g){return JSON.stringify(g).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.safeStringify=R;function v(g){return typeof g=="string"&&t.IDENTIFIER.test(g)?new n(`.${g}`):s`[${g}]`}t.getProperty=v;function S(g){if(typeof g=="string"&&t.IDENTIFIER.test(g))return new n(`${g}`);throw new Error(`CodeGen: invalid export name: ${g}, use explicit $id name mapping`)}t.getEsmExportName=S;function _(g){return new n(g.toString())}t.regexpCode=_})(mr);var Pn={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const e=mr;class r extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}}var n;(function(p){p[p.Started=0]="Started",p[p.Completed=1]="Completed"})(n=t.UsedValueState||(t.UsedValueState={})),t.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};class s{constructor({prefixes:u,parent:f}={}){this._names={},this._prefixes=u,this._parent=f}toName(u){return u instanceof e.Name?u:this.name(u)}name(u){return new e.Name(this._newName(u))}_newName(u){const f=this._names[u]||this._nameGroup(u);return`${u}${f.index++}`}_nameGroup(u){var f,y;if(!((y=(f=this._parent)===null||f===void 0?void 0:f._prefixes)===null||y===void 0)&&y.has(u)||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}}t.Scope=s;class i extends e.Name{constructor(u,f){super(f),this.prefix=u}setValue(u,{property:f,itemIndex:y}){this.value=u,this.scopePath=(0,e._)`.${new e.Name(f)}[${y}]`}}t.ValueScopeName=i;const a=(0,e._)`\n`;class l extends s{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts={...u,_n:u.lines?a:e.nil}}get(){return this._scope}name(u){return new i(u,this._newName(u))}value(u,f){var y;if(f.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const k=this.toName(u),{prefix:R}=k,v=(y=f.key)!==null&&y!==void 0?y:f.ref;let S=this._values[R];if(S){const T=S.get(v);if(T)return T}else S=this._values[R]=new Map;S.set(v,k);const _=this._scope[R]||(this._scope[R]=[]),g=_.length;return _[g]=f.ref,k.setValue(f,{property:R,itemIndex:g}),k}getValue(u,f){const y=this._values[u];if(y)return y.get(f)}scopeRefs(u,f=this._values){return this._reduceValues(f,y=>{if(y.scopePath===void 0)throw new Error(`CodeGen: name "${y}" has no value`);return(0,e._)`${u}${y.scopePath}`})}scopeCode(u=this._values,f,y){return this._reduceValues(u,k=>{if(k.value===void 0)throw new Error(`CodeGen: name "${k}" has no value`);return k.value.code},f,y)}_reduceValues(u,f,y={},k){let R=e.nil;for(const v in u){const S=u[v];if(!S)continue;const _=y[v]=y[v]||new Map;S.forEach(g=>{if(_.has(g))return;_.set(g,n.Started);let T=f(g);if(T){const O=this.opts.es5?t.varKinds.var:t.varKinds.const;R=(0,e._)`${R}${O} ${g} = ${T};${this.opts._n}`}else if(T=k==null?void 0:k(g))R=(0,e._)`${R}${T}${this.opts._n}`;else throw new r(g);_.set(g,n.Completed)})}return R}}t.ValueScope=l})(Pn);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const e=mr,r=Pn;var n=mr;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return n.Name}});var s=Pn;Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),t.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class i{optimizeNodes(){return this}optimizeNames(o,h){return this}}class a extends i{constructor(o,h,C){super(),this.varKind=o,this.name=h,this.rhs=C}render({es5:o,_n:h}){const C=o?r.varKinds.var:this.varKind,q=this.rhs===void 0?"":` = ${this.rhs}`;return`${C} ${this.name}${q};`+h}optimizeNames(o,h){if(o[this.name.str])return this.rhs&&(this.rhs=he(this.rhs,o,h)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class l extends i{constructor(o,h,C){super(),this.lhs=o,this.rhs=h,this.sideEffects=C}render({_n:o}){return`${this.lhs} = ${this.rhs};`+o}optimizeNames(o,h){if(!(this.lhs instanceof e.Name&&!o[this.lhs.str]&&!this.sideEffects))return this.rhs=he(this.rhs,o,h),this}get names(){const o=this.lhs instanceof e.Name?{}:{...this.lhs.names};return ke(o,this.rhs)}}class p extends l{constructor(o,h,C,q){super(o,C,q),this.op=h}render({_n:o}){return`${this.lhs} ${this.op}= ${this.rhs};`+o}}class u extends i{constructor(o){super(),this.label=o,this.names={}}render({_n:o}){return`${this.label}:`+o}}class f extends i{constructor(o){super(),this.label=o,this.names={}}render({_n:o}){return`break${this.label?` ${this.label}`:""};`+o}}class y extends i{constructor(o){super(),this.error=o}render({_n:o}){return`throw ${this.error};`+o}get names(){return this.error.names}}class k extends i{constructor(o){super(),this.code=o}render({_n:o}){return`${this.code};`+o}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(o,h){return this.code=he(this.code,o,h),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class R extends i{constructor(o=[]){super(),this.nodes=o}render(o){return this.nodes.reduce((h,C)=>h+C.render(o),"")}optimizeNodes(){const{nodes:o}=this;let h=o.length;for(;h--;){const C=o[h].optimizeNodes();Array.isArray(C)?o.splice(h,1,...C):C?o[h]=C:o.splice(h,1)}return o.length>0?this:void 0}optimizeNames(o,h){const{nodes:C}=this;let q=C.length;for(;q--;){const M=C[q];M.optimizeNames(o,h)||(at(o,M.names),C.splice(q,1))}return C.length>0?this:void 0}get names(){return this.nodes.reduce((o,h)=>Z(o,h.names),{})}}class v extends R{render(o){return"{"+o._n+super.render(o)+"}"+o._n}}class S extends R{}class _ extends v{}_.kind="else";class g extends v{constructor(o,h){super(h),this.condition=o}render(o){let h=`if(${this.condition})`+super.render(o);return this.else&&(h+="else "+this.else.render(o)),h}optimizeNodes(){super.optimizeNodes();const o=this.condition;if(o===!0)return this.nodes;let h=this.else;if(h){const C=h.optimizeNodes();h=this.else=Array.isArray(C)?new _(C):C}if(h)return o===!1?h instanceof g?h:h.nodes:this.nodes.length?this:new g(ct(o),h instanceof g?[h]:h.nodes);if(!(o===!1||!this.nodes.length))return this}optimizeNames(o,h){var C;if(this.else=(C=this.else)===null||C===void 0?void 0:C.optimizeNames(o,h),!!(super.optimizeNames(o,h)||this.else))return this.condition=he(this.condition,o,h),this}get names(){const o=super.names;return ke(o,this.condition),this.else&&Z(o,this.else.names),o}}g.kind="if";class T extends v{}T.kind="for";class O extends T{constructor(o){super(),this.iteration=o}render(o){return`for(${this.iteration})`+super.render(o)}optimizeNames(o,h){if(super.optimizeNames(o,h))return this.iteration=he(this.iteration,o,h),this}get names(){return Z(super.names,this.iteration.names)}}class j extends T{constructor(o,h,C,q){super(),this.varKind=o,this.name=h,this.from=C,this.to=q}render(o){const h=o.es5?r.varKinds.var:this.varKind,{name:C,from:q,to:M}=this;return`for(${h} ${C}=${q}; ${C}<${M}; ${C}++)`+super.render(o)}get names(){const o=ke(super.names,this.from);return ke(o,this.to)}}class A extends T{constructor(o,h,C,q){super(),this.loop=o,this.varKind=h,this.name=C,this.iterable=q}render(o){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(o)}optimizeNames(o,h){if(super.optimizeNames(o,h))return this.iterable=he(this.iterable,o,h),this}get names(){return Z(super.names,this.iterable.names)}}class w extends v{constructor(o,h,C){super(),this.name=o,this.args=h,this.async=C}render(o){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(o)}}w.kind="func";class N extends R{render(o){return"return "+super.render(o)}}N.kind="return";class D extends v{render(o){let h="try"+super.render(o);return this.catch&&(h+=this.catch.render(o)),this.finally&&(h+=this.finally.render(o)),h}optimizeNodes(){var o,h;return super.optimizeNodes(),(o=this.catch)===null||o===void 0||o.optimizeNodes(),(h=this.finally)===null||h===void 0||h.optimizeNodes(),this}optimizeNames(o,h){var C,q;return super.optimizeNames(o,h),(C=this.catch)===null||C===void 0||C.optimizeNames(o,h),(q=this.finally)===null||q===void 0||q.optimizeNames(o,h),this}get names(){const o=super.names;return this.catch&&Z(o,this.catch.names),this.finally&&Z(o,this.finally.names),o}}class W extends v{constructor(o){super(),this.error=o}render(o){return`catch(${this.error})`+super.render(o)}}W.kind="catch";class K extends v{render(o){return"finally"+super.render(o)}}K.kind="finally";class ce{constructor(o,h={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...h,_n:h.lines?`
852
+ `:""},this._extScope=o,this._scope=new r.Scope({parent:o}),this._nodes=[new S]}toString(){return this._root.render(this.opts)}name(o){return this._scope.name(o)}scopeName(o){return this._extScope.name(o)}scopeValue(o,h){const C=this._extScope.value(o,h);return(this._values[C.prefix]||(this._values[C.prefix]=new Set)).add(C),C}getScopeValue(o,h){return this._extScope.getValue(o,h)}scopeRefs(o){return this._extScope.scopeRefs(o,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(o,h,C,q){const M=this._scope.toName(h);return C!==void 0&&q&&(this._constants[M.str]=C),this._leafNode(new a(o,M,C)),M}const(o,h,C){return this._def(r.varKinds.const,o,h,C)}let(o,h,C){return this._def(r.varKinds.let,o,h,C)}var(o,h,C){return this._def(r.varKinds.var,o,h,C)}assign(o,h,C){return this._leafNode(new l(o,h,C))}add(o,h){return this._leafNode(new p(o,t.operators.ADD,h))}code(o){return typeof o=="function"?o():o!==e.nil&&this._leafNode(new k(o)),this}object(...o){const h=["{"];for(const[C,q]of o)h.length>1&&h.push(","),h.push(C),(C!==q||this.opts.es5)&&(h.push(":"),(0,e.addCodeArg)(h,q));return h.push("}"),new e._Code(h)}if(o,h,C){if(this._blockNode(new g(o)),h&&C)this.code(h).else().code(C).endIf();else if(h)this.code(h).endIf();else if(C)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(o){return this._elseNode(new g(o))}else(){return this._elseNode(new _)}endIf(){return this._endBlockNode(g,_)}_for(o,h){return this._blockNode(o),h&&this.code(h).endFor(),this}for(o,h){return this._for(new O(o),h)}forRange(o,h,C,q,M=this.opts.es5?r.varKinds.var:r.varKinds.let){const J=this._scope.toName(o);return this._for(new j(M,J,h,C),()=>q(J))}forOf(o,h,C,q=r.varKinds.const){const M=this._scope.toName(o);if(this.opts.es5){const J=h instanceof e.Name?h:this.var("_arr",h);return this.forRange("_i",0,(0,e._)`${J}.length`,Q=>{this.var(M,(0,e._)`${J}[${Q}]`),C(M)})}return this._for(new A("of",q,M,h),()=>C(M))}forIn(o,h,C,q=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(o,(0,e._)`Object.keys(${h})`,C);const M=this._scope.toName(o);return this._for(new A("in",q,M,h),()=>C(M))}endFor(){return this._endBlockNode(T)}label(o){return this._leafNode(new u(o))}break(o){return this._leafNode(new f(o))}return(o){const h=new N;if(this._blockNode(h),this.code(o),h.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(N)}try(o,h,C){if(!h&&!C)throw new Error('CodeGen: "try" without "catch" and "finally"');const q=new D;if(this._blockNode(q),this.code(o),h){const M=this.name("e");this._currNode=q.catch=new W(M),h(M)}return C&&(this._currNode=q.finally=new K,this.code(C)),this._endBlockNode(W,K)}throw(o){return this._leafNode(new y(o))}block(o,h){return this._blockStarts.push(this._nodes.length),o&&this.code(o).endBlock(h),this}endBlock(o){const h=this._blockStarts.pop();if(h===void 0)throw new Error("CodeGen: not in self-balancing block");const C=this._nodes.length-h;if(C<0||o!==void 0&&C!==o)throw new Error(`CodeGen: wrong number of nodes: ${C} vs ${o} expected`);return this._nodes.length=h,this}func(o,h=e.nil,C,q){return this._blockNode(new w(o,h,C)),q&&this.code(q).endFunc(),this}endFunc(){return this._endBlockNode(w)}optimize(o=1){for(;o-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(o){return this._currNode.nodes.push(o),this}_blockNode(o){this._currNode.nodes.push(o),this._nodes.push(o)}_endBlockNode(o,h){const C=this._currNode;if(C instanceof o||h&&C instanceof h)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${h?`${o.kind}/${h.kind}`:o.kind}"`)}_elseNode(o){const h=this._currNode;if(!(h instanceof g))throw new Error('CodeGen: "else" without "if"');return this._currNode=h.else=o,this}get _root(){return this._nodes[0]}get _currNode(){const o=this._nodes;return o[o.length-1]}set _currNode(o){const h=this._nodes;h[h.length-1]=o}}t.CodeGen=ce;function Z(b,o){for(const h in o)b[h]=(b[h]||0)+(o[h]||0);return b}function ke(b,o){return o instanceof e._CodeOrName?Z(b,o.names):b}function he(b,o,h){if(b instanceof e.Name)return C(b);if(!q(b))return b;return new e._Code(b._items.reduce((M,J)=>(J instanceof e.Name&&(J=C(J)),J instanceof e._Code?M.push(...J._items):M.push(J),M),[]));function C(M){const J=h[M.str];return J===void 0||o[M.str]!==1?M:(delete o[M.str],J)}function q(M){return M instanceof e._Code&&M._items.some(J=>J instanceof e.Name&&o[J.str]===1&&h[J.str]!==void 0)}}function at(b,o){for(const h in o)b[h]=(b[h]||0)-(o[h]||0)}function ct(b){return typeof b=="boolean"||typeof b=="number"||b===null?!b:(0,e._)`!${I(b)}`}t.not=ct;const Et=$(t.operators.AND);function Yt(...b){return b.reduce(Et)}t.and=Yt;const St=$(t.operators.OR);function F(...b){return b.reduce(St)}t.or=F;function $(b){return(o,h)=>o===e.nil?h:h===e.nil?o:(0,e._)`${I(o)} ${b} ${I(h)}`}function I(b){return b instanceof e.Name?b:(0,e._)`(${b})`}})(G);var re={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const e=G,r=mr;function n(w){const N={};for(const D of w)N[D]=!0;return N}t.toHash=n;function s(w,N){return typeof N=="boolean"?N:Object.keys(N).length===0?!0:(i(w,N),!a(N,w.self.RULES.all))}t.alwaysValidSchema=s;function i(w,N=w.schema){const{opts:D,self:W}=w;if(!D.strictSchema||typeof N=="boolean")return;const K=W.RULES.keywords;for(const ce in N)K[ce]||A(w,`unknown keyword: "${ce}"`)}t.checkUnknownRules=i;function a(w,N){if(typeof w=="boolean")return!w;for(const D in w)if(N[D])return!0;return!1}t.schemaHasRules=a;function l(w,N){if(typeof w=="boolean")return!w;for(const D in w)if(D!=="$ref"&&N.all[D])return!0;return!1}t.schemaHasRulesButRef=l;function p({topSchemaRef:w,schemaPath:N},D,W,K){if(!K){if(typeof D=="number"||typeof D=="boolean")return D;if(typeof D=="string")return(0,e._)`${D}`}return(0,e._)`${w}${N}${(0,e.getProperty)(W)}`}t.schemaRefOrVal=p;function u(w){return k(decodeURIComponent(w))}t.unescapeFragment=u;function f(w){return encodeURIComponent(y(w))}t.escapeFragment=f;function y(w){return typeof w=="number"?`${w}`:w.replace(/~/g,"~0").replace(/\//g,"~1")}t.escapeJsonPointer=y;function k(w){return w.replace(/~1/g,"/").replace(/~0/g,"~")}t.unescapeJsonPointer=k;function R(w,N){if(Array.isArray(w))for(const D of w)N(D);else N(w)}t.eachItem=R;function v({mergeNames:w,mergeToName:N,mergeValues:D,resultToName:W}){return(K,ce,Z,ke)=>{const he=Z===void 0?ce:Z instanceof e.Name?(ce instanceof e.Name?w(K,ce,Z):N(K,ce,Z),Z):ce instanceof e.Name?(N(K,Z,ce),ce):D(ce,Z);return ke===e.Name&&!(he instanceof e.Name)?W(K,he):he}}t.mergeEvaluated={props:v({mergeNames:(w,N,D)=>w.if((0,e._)`${D} !== true && ${N} !== undefined`,()=>{w.if((0,e._)`${N} === true`,()=>w.assign(D,!0),()=>w.assign(D,(0,e._)`${D} || {}`).code((0,e._)`Object.assign(${D}, ${N})`))}),mergeToName:(w,N,D)=>w.if((0,e._)`${D} !== true`,()=>{N===!0?w.assign(D,!0):(w.assign(D,(0,e._)`${D} || {}`),_(w,D,N))}),mergeValues:(w,N)=>w===!0?!0:{...w,...N},resultToName:S}),items:v({mergeNames:(w,N,D)=>w.if((0,e._)`${D} !== true && ${N} !== undefined`,()=>w.assign(D,(0,e._)`${N} === true ? true : ${D} > ${N} ? ${D} : ${N}`)),mergeToName:(w,N,D)=>w.if((0,e._)`${D} !== true`,()=>w.assign(D,N===!0?!0:(0,e._)`${D} > ${N} ? ${D} : ${N}`)),mergeValues:(w,N)=>w===!0?!0:Math.max(w,N),resultToName:(w,N)=>w.var("items",N)})};function S(w,N){if(N===!0)return w.var("props",!0);const D=w.var("props",(0,e._)`{}`);return N!==void 0&&_(w,D,N),D}t.evaluatedPropsToName=S;function _(w,N,D){Object.keys(D).forEach(W=>w.assign((0,e._)`${N}${(0,e.getProperty)(W)}`,!0))}t.setEvaluated=_;const g={};function T(w,N){return w.scopeValue("func",{ref:N,code:g[N.code]||(g[N.code]=new r._Code(N.code))})}t.useFunc=T;var O;(function(w){w[w.Num=0]="Num",w[w.Str=1]="Str"})(O=t.Type||(t.Type={}));function j(w,N,D){if(w instanceof e.Name){const W=N===O.Num;return D?W?(0,e._)`"[" + ${w} + "]"`:(0,e._)`"['" + ${w} + "']"`:W?(0,e._)`"/" + ${w}`:(0,e._)`"/" + ${w}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return D?(0,e.getProperty)(w).toString():"/"+y(w)}t.getErrorPath=j;function A(w,N,D=w.opts.strictSchema){if(D){if(N=`strict mode: ${N}`,D===!0)throw new Error(N);w.self.logger.warn(N)}}t.checkStrictMode=A})(re);var Ke={};Object.defineProperty(Ke,"__esModule",{value:!0});const we=G,Qa={data:new we.Name("data"),valCxt:new we.Name("valCxt"),instancePath:new we.Name("instancePath"),parentData:new we.Name("parentData"),parentDataProperty:new we.Name("parentDataProperty"),rootData:new we.Name("rootData"),dynamicAnchors:new we.Name("dynamicAnchors"),vErrors:new we.Name("vErrors"),errors:new we.Name("errors"),this:new we.Name("this"),self:new we.Name("self"),scope:new we.Name("scope"),json:new we.Name("json"),jsonPos:new we.Name("jsonPos"),jsonLen:new we.Name("jsonLen"),jsonPart:new we.Name("jsonPart")};Ke.default=Qa;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const e=G,r=re,n=Ke;t.keywordError={message:({keyword:_})=>(0,e.str)`must pass "${_}" keyword validation`},t.keyword$DataError={message:({keyword:_,schemaType:g})=>g?(0,e.str)`"${_}" keyword must be ${g} ($data)`:(0,e.str)`"${_}" keyword is invalid ($data)`};function s(_,g=t.keywordError,T,O){const{it:j}=_,{gen:A,compositeRule:w,allErrors:N}=j,D=y(_,g,T);O??(w||N)?p(A,D):u(j,(0,e._)`[${D}]`)}t.reportError=s;function i(_,g=t.keywordError,T){const{it:O}=_,{gen:j,compositeRule:A,allErrors:w}=O,N=y(_,g,T);p(j,N),A||w||u(O,n.default.vErrors)}t.reportExtraError=i;function a(_,g){_.assign(n.default.errors,g),_.if((0,e._)`${n.default.vErrors} !== null`,()=>_.if(g,()=>_.assign((0,e._)`${n.default.vErrors}.length`,g),()=>_.assign(n.default.vErrors,null)))}t.resetErrorsCount=a;function l({gen:_,keyword:g,schemaValue:T,data:O,errsCount:j,it:A}){if(j===void 0)throw new Error("ajv implementation error");const w=_.name("err");_.forRange("i",j,n.default.errors,N=>{_.const(w,(0,e._)`${n.default.vErrors}[${N}]`),_.if((0,e._)`${w}.instancePath === undefined`,()=>_.assign((0,e._)`${w}.instancePath`,(0,e.strConcat)(n.default.instancePath,A.errorPath))),_.assign((0,e._)`${w}.schemaPath`,(0,e.str)`${A.errSchemaPath}/${g}`),A.opts.verbose&&(_.assign((0,e._)`${w}.schema`,T),_.assign((0,e._)`${w}.data`,O))})}t.extendErrors=l;function p(_,g){const T=_.const("err",g);_.if((0,e._)`${n.default.vErrors} === null`,()=>_.assign(n.default.vErrors,(0,e._)`[${T}]`),(0,e._)`${n.default.vErrors}.push(${T})`),_.code((0,e._)`${n.default.errors}++`)}function u(_,g){const{gen:T,validateName:O,schemaEnv:j}=_;j.$async?T.throw((0,e._)`new ${_.ValidationError}(${g})`):(T.assign((0,e._)`${O}.errors`,g),T.return(!1))}const f={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function y(_,g,T){const{createErrors:O}=_.it;return O===!1?(0,e._)`{}`:k(_,g,T)}function k(_,g,T={}){const{gen:O,it:j}=_,A=[R(j,T),v(_,T)];return S(_,g,A),O.object(...A)}function R({errorPath:_},{instancePath:g}){const T=g?(0,e.str)`${_}${(0,r.getErrorPath)(g,r.Type.Str)}`:_;return[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,T)]}function v({keyword:_,it:{errSchemaPath:g}},{schemaPath:T,parentSchema:O}){let j=O?g:(0,e.str)`${g}/${_}`;return T&&(j=(0,e.str)`${j}${(0,r.getErrorPath)(T,r.Type.Str)}`),[f.schemaPath,j]}function S(_,{params:g,message:T},O){const{keyword:j,data:A,schemaValue:w,it:N}=_,{opts:D,propertyName:W,topSchemaRef:K,schemaPath:ce}=N;O.push([f.keyword,j],[f.params,typeof g=="function"?g(_):g||(0,e._)`{}`]),D.messages&&O.push([f.message,typeof T=="function"?T(_):T]),D.verbose&&O.push([f.schema,w],[f.parentSchema,(0,e._)`${K}${ce}`],[n.default.data,A]),W&&O.push([f.propertyName,W])}})($r);Object.defineProperty(Bt,"__esModule",{value:!0});Bt.boolOrEmptySchema=Bt.topBoolOrEmptySchema=void 0;const Za=$r,Xa=G,ec=Ke,tc={message:"boolean schema is false"};function rc(t){const{gen:e,schema:r,validateName:n}=t;r===!1?oo(t,!1):typeof r=="object"&&r.$async===!0?e.return(ec.default.data):(e.assign((0,Xa._)`${n}.errors`,null),e.return(!0))}Bt.topBoolOrEmptySchema=rc;function nc(t,e){const{gen:r,schema:n}=t;n===!1?(r.var(e,!1),oo(t)):r.var(e,!0)}Bt.boolOrEmptySchema=nc;function oo(t,e){const{gen:r,data:n}=t,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,Za.reportError)(s,tc,void 0,e)}var _r={},wt={};Object.defineProperty(wt,"__esModule",{value:!0});wt.getRules=wt.isJSONType=void 0;const sc=["string","number","integer","boolean","null","object","array"],ic=new Set(sc);function oc(t){return typeof t=="string"&&ic.has(t)}wt.isJSONType=oc;function ac(){const t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}wt.getRules=ac;var Qe={};Object.defineProperty(Qe,"__esModule",{value:!0});Qe.shouldUseRule=Qe.shouldUseGroup=Qe.schemaHasRulesForType=void 0;function cc({schema:t,self:e},r){const n=e.RULES.types[r];return n&&n!==!0&&ao(t,n)}Qe.schemaHasRulesForType=cc;function ao(t,e){return e.rules.some(r=>co(t,r))}Qe.shouldUseGroup=ao;function co(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Qe.shouldUseRule=co;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const e=wt,r=Qe,n=$r,s=G,i=re;var a;(function(O){O[O.Correct=0]="Correct",O[O.Wrong=1]="Wrong"})(a=t.DataType||(t.DataType={}));function l(O){const j=p(O.type);if(j.includes("null")){if(O.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!j.length&&O.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');O.nullable===!0&&j.push("null")}return j}t.getSchemaTypes=l;function p(O){const j=Array.isArray(O)?O:O?[O]:[];if(j.every(e.isJSONType))return j;throw new Error("type must be JSONType or JSONType[]: "+j.join(","))}t.getJSONTypes=p;function u(O,j){const{gen:A,data:w,opts:N}=O,D=y(j,N.coerceTypes),W=j.length>0&&!(D.length===0&&j.length===1&&(0,r.schemaHasRulesForType)(O,j[0]));if(W){const K=S(j,w,N.strictNumbers,a.Wrong);A.if(K,()=>{D.length?k(O,j,D):g(O)})}return W}t.coerceAndCheckDataType=u;const f=new Set(["string","number","integer","boolean","null"]);function y(O,j){return j?O.filter(A=>f.has(A)||j==="array"&&A==="array"):[]}function k(O,j,A){const{gen:w,data:N,opts:D}=O,W=w.let("dataType",(0,s._)`typeof ${N}`),K=w.let("coerced",(0,s._)`undefined`);D.coerceTypes==="array"&&w.if((0,s._)`${W} == 'object' && Array.isArray(${N}) && ${N}.length == 1`,()=>w.assign(N,(0,s._)`${N}[0]`).assign(W,(0,s._)`typeof ${N}`).if(S(j,N,D.strictNumbers),()=>w.assign(K,N))),w.if((0,s._)`${K} !== undefined`);for(const Z of A)(f.has(Z)||Z==="array"&&D.coerceTypes==="array")&&ce(Z);w.else(),g(O),w.endIf(),w.if((0,s._)`${K} !== undefined`,()=>{w.assign(N,K),R(O,K)});function ce(Z){switch(Z){case"string":w.elseIf((0,s._)`${W} == "number" || ${W} == "boolean"`).assign(K,(0,s._)`"" + ${N}`).elseIf((0,s._)`${N} === null`).assign(K,(0,s._)`""`);return;case"number":w.elseIf((0,s._)`${W} == "boolean" || ${N} === null
853
+ || (${W} == "string" && ${N} && ${N} == +${N})`).assign(K,(0,s._)`+${N}`);return;case"integer":w.elseIf((0,s._)`${W} === "boolean" || ${N} === null
854
+ || (${W} === "string" && ${N} && ${N} == +${N} && !(${N} % 1))`).assign(K,(0,s._)`+${N}`);return;case"boolean":w.elseIf((0,s._)`${N} === "false" || ${N} === 0 || ${N} === null`).assign(K,!1).elseIf((0,s._)`${N} === "true" || ${N} === 1`).assign(K,!0);return;case"null":w.elseIf((0,s._)`${N} === "" || ${N} === 0 || ${N} === false`),w.assign(K,null);return;case"array":w.elseIf((0,s._)`${W} === "string" || ${W} === "number"
855
+ || ${W} === "boolean" || ${N} === null`).assign(K,(0,s._)`[${N}]`)}}}function R({gen:O,parentData:j,parentDataProperty:A},w){O.if((0,s._)`${j} !== undefined`,()=>O.assign((0,s._)`${j}[${A}]`,w))}function v(O,j,A,w=a.Correct){const N=w===a.Correct?s.operators.EQ:s.operators.NEQ;let D;switch(O){case"null":return(0,s._)`${j} ${N} null`;case"array":D=(0,s._)`Array.isArray(${j})`;break;case"object":D=(0,s._)`${j} && typeof ${j} == "object" && !Array.isArray(${j})`;break;case"integer":D=W((0,s._)`!(${j} % 1) && !isNaN(${j})`);break;case"number":D=W();break;default:return(0,s._)`typeof ${j} ${N} ${O}`}return w===a.Correct?D:(0,s.not)(D);function W(K=s.nil){return(0,s.and)((0,s._)`typeof ${j} == "number"`,K,A?(0,s._)`isFinite(${j})`:s.nil)}}t.checkDataType=v;function S(O,j,A,w){if(O.length===1)return v(O[0],j,A,w);let N;const D=(0,i.toHash)(O);if(D.array&&D.object){const W=(0,s._)`typeof ${j} != "object"`;N=D.null?W:(0,s._)`!${j} || ${W}`,delete D.null,delete D.array,delete D.object}else N=s.nil;D.number&&delete D.integer;for(const W in D)N=(0,s.and)(N,v(W,j,A,w));return N}t.checkDataTypes=S;const _={message:({schema:O})=>`must be ${O}`,params:({schema:O,schemaValue:j})=>typeof O=="string"?(0,s._)`{type: ${O}}`:(0,s._)`{type: ${j}}`};function g(O){const j=T(O);(0,n.reportError)(j,_)}t.reportTypeError=g;function T(O){const{gen:j,data:A,schema:w}=O,N=(0,i.schemaRefOrVal)(O,w,"type");return{gen:j,keyword:"type",data:A,schema:w.type,schemaCode:N,schemaValue:N,parentSchema:w,params:{},it:O}}})(_r);var cn={};Object.defineProperty(cn,"__esModule",{value:!0});cn.assignDefaults=void 0;const Dt=G,lc=re;function uc(t,e){const{properties:r,items:n}=t.schema;if(e==="object"&&r)for(const s in r)Bs(t,s,r[s].default);else e==="array"&&Array.isArray(n)&&n.forEach((s,i)=>Bs(t,i,s.default))}cn.assignDefaults=uc;function Bs(t,e,r){const{gen:n,compositeRule:s,data:i,opts:a}=t;if(r===void 0)return;const l=(0,Dt._)`${i}${(0,Dt.getProperty)(e)}`;if(s){(0,lc.checkStrictMode)(t,`default is ignored for: ${l}`);return}let p=(0,Dt._)`${l} === undefined`;a.useDefaults==="empty"&&(p=(0,Dt._)`${p} || ${l} === null || ${l} === ""`),n.if(p,(0,Dt._)`${l} = ${(0,Dt.stringify)(r)}`)}var We={},B={};Object.defineProperty(B,"__esModule",{value:!0});B.validateUnion=B.validateArray=B.usePattern=B.callValidateCode=B.schemaProperties=B.allSchemaProperties=B.noPropertyInData=B.propertyInData=B.isOwnProperty=B.hasPropFunc=B.reportMissingProp=B.checkMissingProp=B.checkReportMissingProp=void 0;const ie=G,Mn=re,tt=Ke,dc=re;function pc(t,e){const{gen:r,data:n,it:s}=t;r.if(Ln(r,n,e,s.opts.ownProperties),()=>{t.setParams({missingProperty:(0,ie._)`${e}`},!0),t.error()})}B.checkReportMissingProp=pc;function fc({gen:t,data:e,it:{opts:r}},n,s){return(0,ie.or)(...n.map(i=>(0,ie.and)(Ln(t,e,i,r.ownProperties),(0,ie._)`${s} = ${i}`)))}B.checkMissingProp=fc;function hc(t,e){t.setParams({missingProperty:e},!0),t.error()}B.reportMissingProp=hc;function lo(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ie._)`Object.prototype.hasOwnProperty`})}B.hasPropFunc=lo;function Un(t,e,r){return(0,ie._)`${lo(t)}.call(${e}, ${r})`}B.isOwnProperty=Un;function mc(t,e,r,n){const s=(0,ie._)`${e}${(0,ie.getProperty)(r)} !== undefined`;return n?(0,ie._)`${s} && ${Un(t,e,r)}`:s}B.propertyInData=mc;function Ln(t,e,r,n){const s=(0,ie._)`${e}${(0,ie.getProperty)(r)} === undefined`;return n?(0,ie.or)(s,(0,ie.not)(Un(t,e,r))):s}B.noPropertyInData=Ln;function uo(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}B.allSchemaProperties=uo;function yc(t,e){return uo(e).filter(r=>!(0,Mn.alwaysValidSchema)(t,e[r]))}B.schemaProperties=yc;function gc({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:i},it:a},l,p,u){const f=u?(0,ie._)`${t}, ${e}, ${n}${s}`:e,y=[[tt.default.instancePath,(0,ie.strConcat)(tt.default.instancePath,i)],[tt.default.parentData,a.parentData],[tt.default.parentDataProperty,a.parentDataProperty],[tt.default.rootData,tt.default.rootData]];a.opts.dynamicRef&&y.push([tt.default.dynamicAnchors,tt.default.dynamicAnchors]);const k=(0,ie._)`${f}, ${r.object(...y)}`;return p!==ie.nil?(0,ie._)`${l}.call(${p}, ${k})`:(0,ie._)`${l}(${k})`}B.callValidateCode=gc;const $c=(0,ie._)`new RegExp`;function _c({gen:t,it:{opts:e}},r){const n=e.unicodeRegExp?"u":"",{regExp:s}=e.code,i=s(r,n);return t.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,ie._)`${s.code==="new RegExp"?$c:(0,dc.useFunc)(t,s)}(${r}, ${n})`})}B.usePattern=_c;function vc(t){const{gen:e,data:r,keyword:n,it:s}=t,i=e.name("valid");if(s.allErrors){const l=e.let("valid",!0);return a(()=>e.assign(l,!1)),l}return e.var(i,!0),a(()=>e.break()),i;function a(l){const p=e.const("len",(0,ie._)`${r}.length`);e.forRange("i",0,p,u=>{t.subschema({keyword:n,dataProp:u,dataPropType:Mn.Type.Num},i),e.if((0,ie.not)(i),l)})}}B.validateArray=vc;function wc(t){const{gen:e,schema:r,keyword:n,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(p=>(0,Mn.alwaysValidSchema)(s,p))&&!s.opts.unevaluated)return;const a=e.let("valid",!1),l=e.name("_valid");e.block(()=>r.forEach((p,u)=>{const f=t.subschema({keyword:n,schemaProp:u,compositeRule:!0},l);e.assign(a,(0,ie._)`${a} || ${l}`),t.mergeValidEvaluated(f,l)||e.if((0,ie.not)(a))})),t.result(a,()=>t.reset(),()=>t.error(!0))}B.validateUnion=wc;Object.defineProperty(We,"__esModule",{value:!0});We.validateKeywordUsage=We.validSchemaType=We.funcKeywordCode=We.macroKeywordCode=void 0;const be=G,ht=Ke,bc=B,Pc=$r;function Ec(t,e){const{gen:r,keyword:n,schema:s,parentSchema:i,it:a}=t,l=e.macro.call(a.self,s,i,a),p=po(r,n,l);a.opts.validateSchema!==!1&&a.self.validateSchema(l,!0);const u=r.name("valid");t.subschema({schema:l,schemaPath:be.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:p,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}We.macroKeywordCode=Ec;function Sc(t,e){var r;const{gen:n,keyword:s,schema:i,parentSchema:a,$data:l,it:p}=t;kc(p,e);const u=!l&&e.compile?e.compile.call(p.self,i,a,p):e.validate,f=po(n,s,u),y=n.let("valid");t.block$data(y,k),t.ok((r=e.valid)!==null&&r!==void 0?r:y);function k(){if(e.errors===!1)S(),e.modifying&&Gs(t),_(()=>t.error());else{const g=e.async?R():v();e.modifying&&Gs(t),_(()=>Tc(t,g))}}function R(){const g=n.let("ruleErrs",null);return n.try(()=>S((0,be._)`await `),T=>n.assign(y,!1).if((0,be._)`${T} instanceof ${p.ValidationError}`,()=>n.assign(g,(0,be._)`${T}.errors`),()=>n.throw(T))),g}function v(){const g=(0,be._)`${f}.errors`;return n.assign(g,null),S(be.nil),g}function S(g=e.async?(0,be._)`await `:be.nil){const T=p.opts.passContext?ht.default.this:ht.default.self,O=!("compile"in e&&!l||e.schema===!1);n.assign(y,(0,be._)`${g}${(0,bc.callValidateCode)(t,f,T,O)}`,e.modifying)}function _(g){var T;n.if((0,be.not)((T=e.valid)!==null&&T!==void 0?T:y),g)}}We.funcKeywordCode=Sc;function Gs(t){const{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,be._)`${n.parentData}[${n.parentDataProperty}]`))}function Tc(t,e){const{gen:r}=t;r.if((0,be._)`Array.isArray(${e})`,()=>{r.assign(ht.default.vErrors,(0,be._)`${ht.default.vErrors} === null ? ${e} : ${ht.default.vErrors}.concat(${e})`).assign(ht.default.errors,(0,be._)`${ht.default.vErrors}.length`),(0,Pc.extendErrors)(t)},()=>t.error())}function kc({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function po(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,be.stringify)(r)})}function Rc(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}We.validSchemaType=Rc;function Oc({schema:t,opts:e,self:r,errSchemaPath:n},s,i){if(Array.isArray(s.keyword)?!s.keyword.includes(i):s.keyword!==i)throw new Error("ajv implementation error");const a=s.dependencies;if(a!=null&&a.some(l=>!Object.prototype.hasOwnProperty.call(t,l)))throw new Error(`parent schema must have dependencies of ${i}: ${a.join(",")}`);if(s.validateSchema&&!s.validateSchema(t[i])){const p=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(p);else throw new Error(p)}}We.validateKeywordUsage=Oc;var ot={};Object.defineProperty(ot,"__esModule",{value:!0});ot.extendSubschemaMode=ot.extendSubschemaData=ot.getSubschema=void 0;const Ve=G,fo=re;function Nc(t,{keyword:e,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:i,topSchemaRef:a}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){const l=t.schema[e];return r===void 0?{schema:l,schemaPath:(0,Ve._)`${t.schemaPath}${(0,Ve.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:l[r],schemaPath:(0,Ve._)`${t.schemaPath}${(0,Ve.getProperty)(e)}${(0,Ve.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,fo.escapeFragment)(r)}`}}if(n!==void 0){if(s===void 0||i===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:a,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}ot.getSubschema=Nc;function Cc(t,e,{dataProp:r,dataPropType:n,data:s,dataTypes:i,propertyName:a}){if(s!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:l}=e;if(r!==void 0){const{errorPath:u,dataPathArr:f,opts:y}=e,k=l.let("data",(0,Ve._)`${e.data}${(0,Ve.getProperty)(r)}`,!0);p(k),t.errorPath=(0,Ve.str)`${u}${(0,fo.getErrorPath)(r,n,y.jsPropertySyntax)}`,t.parentDataProperty=(0,Ve._)`${r}`,t.dataPathArr=[...f,t.parentDataProperty]}if(s!==void 0){const u=s instanceof Ve.Name?s:l.let("data",s,!0);p(u),a!==void 0&&(t.propertyName=a)}i&&(t.dataTypes=i);function p(u){t.data=u,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,u]}}ot.extendSubschemaData=Cc;function jc(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:i}){n!==void 0&&(t.compositeRule=n),s!==void 0&&(t.createErrors=s),i!==void 0&&(t.allErrors=i),t.jtdDiscriminator=e,t.jtdMetadata=r}ot.extendSubschemaMode=jc;var $e={},ho=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,s,i;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!t(e[s],r[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=n;s--!==0;){var a=i[s];if(!t(e[a],r[a]))return!1}return!0}return e!==e&&r!==r},mo={exports:{}},it=mo.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};Ir(e,n,s,t,"",t)};it.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};it.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};it.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};it.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};function Ir(t,e,r,n,s,i,a,l,p,u){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,s,i,a,l,p,u);for(var f in n){var y=n[f];if(Array.isArray(y)){if(f in it.arrayKeywords)for(var k=0;k<y.length;k++)Ir(t,e,r,y[k],s+"/"+f+"/"+k,i,s,f,n,k)}else if(f in it.propsKeywords){if(y&&typeof y=="object")for(var R in y)Ir(t,e,r,y[R],s+"/"+f+"/"+Ic(R),i,s,f,n,R)}else(f in it.keywords||t.allKeys&&!(f in it.skipKeywords))&&Ir(t,e,r,y,s+"/"+f,i,s,f,n)}r(n,s,i,a,l,p,u)}}function Ic(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}var Dc=mo.exports;Object.defineProperty($e,"__esModule",{value:!0});$e.getSchemaRefs=$e.resolveUrl=$e.normalizeId=$e._getFullPath=$e.getFullPath=$e.inlineRef=void 0;const Ac=re,Fc=ho,qc=Dc,Mc=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Uc(t,e=!0){return typeof t=="boolean"?!0:e===!0?!En(t):e?yo(t)<=e:!1}$e.inlineRef=Uc;const Lc=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function En(t){for(const e in t){if(Lc.has(e))return!0;const r=t[e];if(Array.isArray(r)&&r.some(En)||typeof r=="object"&&En(r))return!0}return!1}function yo(t){let e=0;for(const r in t){if(r==="$ref")return 1/0;if(e++,!Mc.has(r)&&(typeof t[r]=="object"&&(0,Ac.eachItem)(t[r],n=>e+=yo(n)),e===1/0))return 1/0}return e}function go(t,e="",r){r!==!1&&(e=Ut(e));const n=t.parse(e);return $o(t,n)}$e.getFullPath=go;function $o(t,e){return t.serialize(e).split("#")[0]+"#"}$e._getFullPath=$o;const Hc=/#\/?$/;function Ut(t){return t?t.replace(Hc,""):""}$e.normalizeId=Ut;function zc(t,e,r){return r=Ut(r),t.resolve(e,r)}$e.resolveUrl=zc;const Vc=/^[a-z_][-a-z0-9._]*$/i;function Wc(t,e){if(typeof t=="boolean")return{};const{schemaId:r,uriResolver:n}=this.opts,s=Ut(t[r]||e),i={"":s},a=go(n,s,!1),l={},p=new Set;return qc(t,{allKeys:!0},(y,k,R,v)=>{if(v===void 0)return;const S=a+k;let _=i[v];typeof y[r]=="string"&&(_=g.call(this,y[r])),T.call(this,y.$anchor),T.call(this,y.$dynamicAnchor),i[k]=_;function g(O){const j=this.opts.uriResolver.resolve;if(O=Ut(_?j(_,O):O),p.has(O))throw f(O);p.add(O);let A=this.refs[O];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?u(y,A.schema,O):O!==Ut(S)&&(O[0]==="#"?(u(y,l[O],O),l[O]=y):this.refs[O]=S),O}function T(O){if(typeof O=="string"){if(!Vc.test(O))throw new Error(`invalid anchor "${O}"`);g.call(this,`#${O}`)}}}),l;function u(y,k,R){if(k!==void 0&&!Fc(y,k))throw f(R)}function f(y){return new Error(`reference "${y}" resolves to more than one schema`)}}$e.getSchemaRefs=Wc;Object.defineProperty(De,"__esModule",{value:!0});De.getData=De.KeywordCxt=De.validateFunctionCode=void 0;const _o=Bt,Ks=_r,Hn=Qe,Mr=_r,xc=cn,lr=We,yn=ot,U=G,V=Ke,Bc=$e,Ze=re,or=$r;function Gc(t){if(bo(t)&&(Po(t),wo(t))){Yc(t);return}vo(t,()=>(0,_o.topBoolOrEmptySchema)(t))}De.validateFunctionCode=Gc;function vo({gen:t,validateName:e,schema:r,schemaEnv:n,opts:s},i){s.code.es5?t.func(e,(0,U._)`${V.default.data}, ${V.default.valCxt}`,n.$async,()=>{t.code((0,U._)`"use strict"; ${Js(r,s)}`),Jc(t,s),t.code(i)}):t.func(e,(0,U._)`${V.default.data}, ${Kc(s)}`,n.$async,()=>t.code(Js(r,s)).code(i))}function Kc(t){return(0,U._)`{${V.default.instancePath}="", ${V.default.parentData}, ${V.default.parentDataProperty}, ${V.default.rootData}=${V.default.data}${t.dynamicRef?(0,U._)`, ${V.default.dynamicAnchors}={}`:U.nil}}={}`}function Jc(t,e){t.if(V.default.valCxt,()=>{t.var(V.default.instancePath,(0,U._)`${V.default.valCxt}.${V.default.instancePath}`),t.var(V.default.parentData,(0,U._)`${V.default.valCxt}.${V.default.parentData}`),t.var(V.default.parentDataProperty,(0,U._)`${V.default.valCxt}.${V.default.parentDataProperty}`),t.var(V.default.rootData,(0,U._)`${V.default.valCxt}.${V.default.rootData}`),e.dynamicRef&&t.var(V.default.dynamicAnchors,(0,U._)`${V.default.valCxt}.${V.default.dynamicAnchors}`)},()=>{t.var(V.default.instancePath,(0,U._)`""`),t.var(V.default.parentData,(0,U._)`undefined`),t.var(V.default.parentDataProperty,(0,U._)`undefined`),t.var(V.default.rootData,V.default.data),e.dynamicRef&&t.var(V.default.dynamicAnchors,(0,U._)`{}`)})}function Yc(t){const{schema:e,opts:r,gen:n}=t;vo(t,()=>{r.$comment&&e.$comment&&So(t),tl(t),n.let(V.default.vErrors,null),n.let(V.default.errors,0),r.unevaluated&&Qc(t),Eo(t),sl(t)})}function Qc(t){const{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,U._)`${r}.evaluated`),e.if((0,U._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,U._)`${t.evaluated}.props`,(0,U._)`undefined`)),e.if((0,U._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,U._)`${t.evaluated}.items`,(0,U._)`undefined`))}function Js(t,e){const r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,U._)`/*# sourceURL=${r} */`:U.nil}function Zc(t,e){if(bo(t)&&(Po(t),wo(t))){Xc(t,e);return}(0,_o.boolOrEmptySchema)(t,e)}function wo({schema:t,self:e}){if(typeof t=="boolean")return!t;for(const r in t)if(e.RULES.all[r])return!0;return!1}function bo(t){return typeof t.schema!="boolean"}function Xc(t,e){const{schema:r,gen:n,opts:s}=t;s.$comment&&r.$comment&&So(t),rl(t),nl(t);const i=n.const("_errs",V.default.errors);Eo(t,i),n.var(e,(0,U._)`${i} === ${V.default.errors}`)}function Po(t){(0,Ze.checkUnknownRules)(t),el(t)}function Eo(t,e){if(t.opts.jtd)return Ys(t,[],!1,e);const r=(0,Ks.getSchemaTypes)(t.schema),n=(0,Ks.coerceAndCheckDataType)(t,r);Ys(t,r,!n,e)}function el(t){const{schema:e,errSchemaPath:r,opts:n,self:s}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Ze.schemaHasRulesButRef)(e,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function tl(t){const{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Ze.checkStrictMode)(t,"default is ignored in the schema root")}function rl(t){const e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,Bc.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function nl(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function So({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:s}){const i=r.$comment;if(s.$comment===!0)t.code((0,U._)`${V.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){const a=(0,U.str)`${n}/$comment`,l=t.scopeValue("root",{ref:e.root});t.code((0,U._)`${V.default.self}.opts.$comment(${i}, ${a}, ${l}.schema)`)}}function sl(t){const{gen:e,schemaEnv:r,validateName:n,ValidationError:s,opts:i}=t;r.$async?e.if((0,U._)`${V.default.errors} === 0`,()=>e.return(V.default.data),()=>e.throw((0,U._)`new ${s}(${V.default.vErrors})`)):(e.assign((0,U._)`${n}.errors`,V.default.vErrors),i.unevaluated&&il(t),e.return((0,U._)`${V.default.errors} === 0`))}function il({gen:t,evaluated:e,props:r,items:n}){r instanceof U.Name&&t.assign((0,U._)`${e}.props`,r),n instanceof U.Name&&t.assign((0,U._)`${e}.items`,n)}function Ys(t,e,r,n){const{gen:s,schema:i,data:a,allErrors:l,opts:p,self:u}=t,{RULES:f}=u;if(i.$ref&&(p.ignoreKeywordsWithRef||!(0,Ze.schemaHasRulesButRef)(i,f))){s.block(()=>Ro(t,"$ref",f.all.$ref.definition));return}p.jtd||ol(t,e),s.block(()=>{for(const k of f.rules)y(k);y(f.post)});function y(k){(0,Hn.shouldUseGroup)(i,k)&&(k.type?(s.if((0,Mr.checkDataType)(k.type,a,p.strictNumbers)),Qs(t,k),e.length===1&&e[0]===k.type&&r&&(s.else(),(0,Mr.reportTypeError)(t)),s.endIf()):Qs(t,k),l||s.if((0,U._)`${V.default.errors} === ${n||0}`))}}function Qs(t,e){const{gen:r,schema:n,opts:{useDefaults:s}}=t;s&&(0,xc.assignDefaults)(t,e.type),r.block(()=>{for(const i of e.rules)(0,Hn.shouldUseRule)(n,i)&&Ro(t,i.keyword,i.definition,e.type)})}function ol(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(al(t,e),t.opts.allowUnionTypes||cl(t,e),ll(t,t.dataTypes))}function al(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{To(t.dataTypes,r)||zn(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),dl(t,e)}}function cl(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&zn(t,"use allowUnionTypes to allow union type keyword")}function ll(t,e){const r=t.self.RULES.all;for(const n in r){const s=r[n];if(typeof s=="object"&&(0,Hn.shouldUseRule)(t.schema,s)){const{type:i}=s.definition;i.length&&!i.some(a=>ul(e,a))&&zn(t,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function ul(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function To(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function dl(t,e){const r=[];for(const n of t.dataTypes)To(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function zn(t,e){const r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Ze.checkStrictMode)(t,e,t.opts.strictTypes)}class ko{constructor(e,r,n){if((0,lr.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Ze.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",Oo(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,lr.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",V.default.errors))}result(e,r,n){this.failResult((0,U.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,U.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}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:r}=this;this.fail((0,U._)`${r} !== undefined && (${(0,U.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?or.reportExtraError:or.reportError)(this,this.def.error,r)}$dataError(){(0,or.reportError)(this,this.def.$dataError||or.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,or.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=U.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=U.nil,r=U.nil){if(!this.$data)return;const{gen:n,schemaCode:s,schemaType:i,def:a}=this;n.if((0,U.or)((0,U._)`${s} === undefined`,r)),e!==U.nil&&n.assign(e,!0),(i.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==U.nil&&n.assign(e,!1)),n.else()}invalid$data(){const{gen:e,schemaCode:r,schemaType:n,def:s,it:i}=this;return(0,U.or)(a(),l());function a(){if(n.length){if(!(r instanceof U.Name))throw new Error("ajv implementation error");const p=Array.isArray(n)?n:[n];return(0,U._)`${(0,Mr.checkDataTypes)(p,r,i.opts.strictNumbers,Mr.DataType.Wrong)}`}return U.nil}function l(){if(s.validateSchema){const p=e.scopeValue("validate$data",{ref:s.validateSchema});return(0,U._)`!${p}(${r})`}return U.nil}}subschema(e,r){const n=(0,yn.getSubschema)(this.it,e);(0,yn.extendSubschemaData)(n,this.it,e),(0,yn.extendSubschemaMode)(n,e);const s={...this.it,...n,items:void 0,props:void 0};return Zc(s,r),s}mergeEvaluated(e,r){const{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Ze.mergeEvaluated.props(s,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Ze.mergeEvaluated.items(s,e.items,n.items,r)))}mergeValidEvaluated(e,r){const{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(r,()=>this.mergeEvaluated(e,U.Name)),!0}}De.KeywordCxt=ko;function Ro(t,e,r,n){const s=new ko(t,r,e);"code"in r?r.code(s,n):s.$data&&r.validate?(0,lr.funcKeywordCode)(s,r):"macro"in r?(0,lr.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,lr.funcKeywordCode)(s,r)}const pl=/^\/(?:[^~]|~0|~1)*$/,fl=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Oo(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let s,i;if(t==="")return V.default.rootData;if(t[0]==="/"){if(!pl.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);s=t,i=V.default.rootData}else{const u=fl.exec(t);if(!u)throw new Error(`Invalid JSON-pointer: ${t}`);const f=+u[1];if(s=u[2],s==="#"){if(f>=e)throw new Error(p("property/index",f));return n[e-f]}if(f>e)throw new Error(p("data",f));if(i=r[e-f],!s)return i}let a=i;const l=s.split("/");for(const u of l)u&&(i=(0,U._)`${i}${(0,U.getProperty)((0,Ze.unescapeJsonPointer)(u))}`,a=(0,U._)`${a} && ${i}`);return a;function p(u,f){return`Cannot access ${u} ${f} levels up, current level is ${e}`}}De.getData=Oo;var vr={};Object.defineProperty(vr,"__esModule",{value:!0});class hl extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}vr.default=hl;var wr={};Object.defineProperty(wr,"__esModule",{value:!0});const gn=$e;class ml extends Error{constructor(e,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,gn.resolveUrl)(e,r,n),this.missingSchema=(0,gn.normalizeId)((0,gn.getFullPath)(e,this.missingRef))}}wr.default=ml;var Se={};Object.defineProperty(Se,"__esModule",{value:!0});Se.resolveSchema=Se.getCompilingSchema=Se.resolveRef=Se.compileSchema=Se.SchemaEnv=void 0;const Ce=G,yl=vr,ft=Ke,Ie=$e,Zs=re,gl=De;class ln{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Ie.normalizeId)(n==null?void 0:n[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n==null?void 0:n.$async,this.refs={}}}Se.SchemaEnv=ln;function Vn(t){const e=No.call(this,t);if(e)return e;const r=(0,Ie.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,a=new Ce.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i});let l;t.$async&&(l=a.scopeValue("Error",{ref:yl.default,code:(0,Ce._)`require("ajv/dist/runtime/validation_error").default`}));const p=a.scopeName("validate");t.validateName=p;const u={gen:a,allErrors:this.opts.allErrors,data:ft.default.data,parentData:ft.default.parentData,parentDataProperty:ft.default.parentDataProperty,dataNames:[ft.default.data],dataPathArr:[Ce.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Ce.stringify)(t.schema)}:{ref:t.schema}),validateName:p,ValidationError:l,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Ce.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Ce._)`""`,opts:this.opts,self:this};let f;try{this._compilations.add(t),(0,gl.validateFunctionCode)(u),a.optimize(this.opts.code.optimize);const y=a.toString();f=`${a.scopeRefs(ft.default.scope)}return ${y}`,this.opts.code.process&&(f=this.opts.code.process(f,t));const R=new Function(`${ft.default.self}`,`${ft.default.scope}`,f)(this,this.scope.get());if(this.scope.value(p,{ref:R}),R.errors=null,R.schema=t.schema,R.schemaEnv=t,t.$async&&(R.$async=!0),this.opts.code.source===!0&&(R.source={validateName:p,validateCode:y,scopeValues:a._values}),this.opts.unevaluated){const{props:v,items:S}=u;R.evaluated={props:v instanceof Ce.Name?void 0:v,items:S instanceof Ce.Name?void 0:S,dynamicProps:v instanceof Ce.Name,dynamicItems:S instanceof Ce.Name},R.source&&(R.source.evaluated=(0,Ce.stringify)(R.evaluated))}return t.validate=R,t}catch(y){throw delete t.validate,delete t.validateName,f&&this.logger.error("Error compiling schema, function code:",f),y}finally{this._compilations.delete(t)}}Se.compileSchema=Vn;function $l(t,e,r){var n;r=(0,Ie.resolveUrl)(this.opts.uriResolver,e,r);const s=t.refs[r];if(s)return s;let i=wl.call(this,t,r);if(i===void 0){const a=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:l}=this.opts;a&&(i=new ln({schema:a,schemaId:l,root:t,baseId:e}))}if(i!==void 0)return t.refs[r]=_l.call(this,i)}Se.resolveRef=$l;function _l(t){return(0,Ie.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Vn.call(this,t)}function No(t){for(const e of this._compilations)if(vl(e,t))return e}Se.getCompilingSchema=No;function vl(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function wl(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||un.call(this,t,e)}function un(t,e){const r=this.opts.uriResolver.parse(e),n=(0,Ie._getFullPath)(this.opts.uriResolver,r);let s=(0,Ie.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===s)return $n.call(this,r,t);const i=(0,Ie.normalizeId)(n),a=this.refs[i]||this.schemas[i];if(typeof a=="string"){const l=un.call(this,t,a);return typeof(l==null?void 0:l.schema)!="object"?void 0:$n.call(this,r,l)}if(typeof(a==null?void 0:a.schema)=="object"){if(a.validate||Vn.call(this,a),i===(0,Ie.normalizeId)(e)){const{schema:l}=a,{schemaId:p}=this.opts,u=l[p];return u&&(s=(0,Ie.resolveUrl)(this.opts.uriResolver,s,u)),new ln({schema:l,schemaId:p,root:t,baseId:s})}return $n.call(this,r,a)}}Se.resolveSchema=un;const bl=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function $n(t,{baseId:e,schema:r,root:n}){var s;if(((s=t.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(const l of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const p=r[(0,Zs.unescapeFragment)(l)];if(p===void 0)return;r=p;const u=typeof r=="object"&&r[this.opts.schemaId];!bl.has(l)&&u&&(e=(0,Ie.resolveUrl)(this.opts.uriResolver,e,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,Zs.schemaHasRulesButRef)(r,this.RULES)){const l=(0,Ie.resolveUrl)(this.opts.uriResolver,e,r.$ref);i=un.call(this,n,l)}const{schemaId:a}=this.opts;if(i=i||new ln({schema:r,schemaId:a,root:n,baseId:e}),i.schema!==i.root.schema)return i}const Pl="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",El="Meta-schema for $data reference (JSON AnySchema extension proposal)",Sl="object",Tl=["$data"],kl={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Rl=!1,Ol={$id:Pl,description:El,type:Sl,required:Tl,properties:kl,additionalProperties:Rl};var Wn={},Sn={exports:{}};/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */(function(t,e){(function(r,n){n(e)})(Ja,function(r){function n(){for(var d=arguments.length,c=Array(d),m=0;m<d;m++)c[m]=arguments[m];if(c.length>1){c[0]=c[0].slice(0,-1);for(var E=c.length-1,P=1;P<E;++P)c[P]=c[P].slice(1,-1);return c[E]=c[E].slice(1),c.join("")}else return c[0]}function s(d){return"(?:"+d+")"}function i(d){return d===void 0?"undefined":d===null?"null":Object.prototype.toString.call(d).split(" ").pop().split("]").shift().toLowerCase()}function a(d){return d.toUpperCase()}function l(d){return d!=null?d instanceof Array?d:typeof d.length!="number"||d.split||d.setInterval||d.call?[d]:Array.prototype.slice.call(d):[]}function p(d,c){var m=d;if(c)for(var E in c)m[E]=c[E];return m}function u(d){var c="[A-Za-z]",m="[0-9]",E=n(m,"[A-Fa-f]"),P=s(s("%[EFef]"+E+"%"+E+E+"%"+E+E)+"|"+s("%[89A-Fa-f]"+E+"%"+E+E)+"|"+s("%"+E+E)),L="[\\:\\/\\?\\#\\[\\]\\@]",H="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",X=n(L,H),se=d?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",ue=d?"[\\uE000-\\uF8FF]":"[]",Y=n(c,m,"[\\-\\.\\_\\~]",se);s(c+n(c,m,"[\\+\\-\\.]")+"*"),s(s(P+"|"+n(Y,H,"[\\:]"))+"*");var ne=s(s("25[0-5]")+"|"+s("2[0-4]"+m)+"|"+s("1"+m+m)+"|"+s("0?[1-9]"+m)+"|0?0?"+m),de=s(ne+"\\."+ne+"\\."+ne+"\\."+ne),x=s(E+"{1,4}"),oe=s(s(x+"\\:"+x)+"|"+de),me=s(s(x+"\\:")+"{6}"+oe),ae=s("\\:\\:"+s(x+"\\:")+"{5}"+oe),Xe=s(s(x)+"?\\:\\:"+s(x+"\\:")+"{4}"+oe),Me=s(s(s(x+"\\:")+"{0,1}"+x)+"?\\:\\:"+s(x+"\\:")+"{3}"+oe),Ue=s(s(s(x+"\\:")+"{0,2}"+x)+"?\\:\\:"+s(x+"\\:")+"{2}"+oe),jt=s(s(s(x+"\\:")+"{0,3}"+x)+"?\\:\\:"+x+"\\:"+oe),dt=s(s(s(x+"\\:")+"{0,4}"+x)+"?\\:\\:"+oe),Oe=s(s(s(x+"\\:")+"{0,5}"+x)+"?\\:\\:"+x),Le=s(s(s(x+"\\:")+"{0,6}"+x)+"?\\:\\:"),pt=s([me,ae,Xe,Me,Ue,jt,dt,Oe,Le].join("|")),Je=s(s(Y+"|"+P)+"+");s("[vV]"+E+"+\\."+n(Y,H,"[\\:]")+"+"),s(s(P+"|"+n(Y,H))+"*");var sr=s(P+"|"+n(Y,H,"[\\:\\@]"));return s(s(P+"|"+n(Y,H,"[\\@]"))+"+"),s(s(sr+"|"+n("[\\/\\?]",ue))+"*"),{NOT_SCHEME:new RegExp(n("[^]",c,m,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(n("[^\\%\\:]",Y,H),"g"),NOT_HOST:new RegExp(n("[^\\%\\[\\]\\:]",Y,H),"g"),NOT_PATH:new RegExp(n("[^\\%\\/\\:\\@]",Y,H),"g"),NOT_PATH_NOSCHEME:new RegExp(n("[^\\%\\/\\@]",Y,H),"g"),NOT_QUERY:new RegExp(n("[^\\%]",Y,H,"[\\:\\@\\/\\?]",ue),"g"),NOT_FRAGMENT:new RegExp(n("[^\\%]",Y,H,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(n("[^]",Y,H),"g"),UNRESERVED:new RegExp(Y,"g"),OTHER_CHARS:new RegExp(n("[^\\%]",Y,X),"g"),PCT_ENCODED:new RegExp(P,"g"),IPV4ADDRESS:new RegExp("^("+de+")$"),IPV6ADDRESS:new RegExp("^\\[?("+pt+")"+s(s("\\%25|\\%(?!"+E+"{2})")+"("+Je+")")+"?\\]?$")}}var f=u(!1),y=u(!0),k=function(){function d(c,m){var E=[],P=!0,L=!1,H=void 0;try{for(var X=c[Symbol.iterator](),se;!(P=(se=X.next()).done)&&(E.push(se.value),!(m&&E.length===m));P=!0);}catch(ue){L=!0,H=ue}finally{try{!P&&X.return&&X.return()}finally{if(L)throw H}}return E}return function(c,m){if(Array.isArray(c))return c;if(Symbol.iterator in Object(c))return d(c,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),R=function(d){if(Array.isArray(d)){for(var c=0,m=Array(d.length);c<d.length;c++)m[c]=d[c];return m}else return Array.from(d)},v=2147483647,S=36,_=1,g=26,T=38,O=700,j=72,A=128,w="-",N=/^xn--/,D=/[^\0-\x7E]/,W=/[\x2E\u3002\uFF0E\uFF61]/g,K={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ce=S-_,Z=Math.floor,ke=String.fromCharCode;function he(d){throw new RangeError(K[d])}function at(d,c){for(var m=[],E=d.length;E--;)m[E]=c(d[E]);return m}function ct(d,c){var m=d.split("@"),E="";m.length>1&&(E=m[0]+"@",d=m[1]),d=d.replace(W,".");var P=d.split("."),L=at(P,c).join(".");return E+L}function Et(d){for(var c=[],m=0,E=d.length;m<E;){var P=d.charCodeAt(m++);if(P>=55296&&P<=56319&&m<E){var L=d.charCodeAt(m++);(L&64512)==56320?c.push(((P&1023)<<10)+(L&1023)+65536):(c.push(P),m--)}else c.push(P)}return c}var Yt=function(c){return String.fromCodePoint.apply(String,R(c))},St=function(c){return c-48<10?c-22:c-65<26?c-65:c-97<26?c-97:S},F=function(c,m){return c+22+75*(c<26)-((m!=0)<<5)},$=function(c,m,E){var P=0;for(c=E?Z(c/O):c>>1,c+=Z(c/m);c>ce*g>>1;P+=S)c=Z(c/ce);return Z(P+(ce+1)*c/(c+T))},I=function(c){var m=[],E=c.length,P=0,L=A,H=j,X=c.lastIndexOf(w);X<0&&(X=0);for(var se=0;se<X;++se)c.charCodeAt(se)>=128&&he("not-basic"),m.push(c.charCodeAt(se));for(var ue=X>0?X+1:0;ue<E;){for(var Y=P,ne=1,de=S;;de+=S){ue>=E&&he("invalid-input");var x=St(c.charCodeAt(ue++));(x>=S||x>Z((v-P)/ne))&&he("overflow"),P+=x*ne;var oe=de<=H?_:de>=H+g?g:de-H;if(x<oe)break;var me=S-oe;ne>Z(v/me)&&he("overflow"),ne*=me}var ae=m.length+1;H=$(P-Y,ae,Y==0),Z(P/ae)>v-L&&he("overflow"),L+=Z(P/ae),P%=ae,m.splice(P++,0,L)}return String.fromCodePoint.apply(String,m)},b=function(c){var m=[];c=Et(c);var E=c.length,P=A,L=0,H=j,X=!0,se=!1,ue=void 0;try{for(var Y=c[Symbol.iterator](),ne;!(X=(ne=Y.next()).done);X=!0){var de=ne.value;de<128&&m.push(ke(de))}}catch(ir){se=!0,ue=ir}finally{try{!X&&Y.return&&Y.return()}finally{if(se)throw ue}}var x=m.length,oe=x;for(x&&m.push(w);oe<E;){var me=v,ae=!0,Xe=!1,Me=void 0;try{for(var Ue=c[Symbol.iterator](),jt;!(ae=(jt=Ue.next()).done);ae=!0){var dt=jt.value;dt>=P&&dt<me&&(me=dt)}}catch(ir){Xe=!0,Me=ir}finally{try{!ae&&Ue.return&&Ue.return()}finally{if(Xe)throw Me}}var Oe=oe+1;me-P>Z((v-L)/Oe)&&he("overflow"),L+=(me-P)*Oe,P=me;var Le=!0,pt=!1,Je=void 0;try{for(var sr=c[Symbol.iterator](),Ns;!(Le=(Ns=sr.next()).done);Le=!0){var Cs=Ns.value;if(Cs<P&&++L>v&&he("overflow"),Cs==P){for(var Er=L,Sr=S;;Sr+=S){var Tr=Sr<=H?_:Sr>=H+g?g:Sr-H;if(Er<Tr)break;var js=Er-Tr,Is=S-Tr;m.push(ke(F(Tr+js%Is,0))),Er=Z(js/Is)}m.push(ke(F(Er,0))),H=$(L,Oe,oe==x),L=0,++oe}}}catch(ir){pt=!0,Je=ir}finally{try{!Le&&sr.return&&sr.return()}finally{if(pt)throw Je}}++L,++P}return m.join("")},o=function(c){return ct(c,function(m){return N.test(m)?I(m.slice(4).toLowerCase()):m})},h=function(c){return ct(c,function(m){return D.test(m)?"xn--"+b(m):m})},C={version:"2.1.0",ucs2:{decode:Et,encode:Yt},decode:I,encode:b,toASCII:h,toUnicode:o},q={};function M(d){var c=d.charCodeAt(0),m=void 0;return c<16?m="%0"+c.toString(16).toUpperCase():c<128?m="%"+c.toString(16).toUpperCase():c<2048?m="%"+(c>>6|192).toString(16).toUpperCase()+"%"+(c&63|128).toString(16).toUpperCase():m="%"+(c>>12|224).toString(16).toUpperCase()+"%"+(c>>6&63|128).toString(16).toUpperCase()+"%"+(c&63|128).toString(16).toUpperCase(),m}function J(d){for(var c="",m=0,E=d.length;m<E;){var P=parseInt(d.substr(m+1,2),16);if(P<128)c+=String.fromCharCode(P),m+=3;else if(P>=194&&P<224){if(E-m>=6){var L=parseInt(d.substr(m+4,2),16);c+=String.fromCharCode((P&31)<<6|L&63)}else c+=d.substr(m,6);m+=6}else if(P>=224){if(E-m>=9){var H=parseInt(d.substr(m+4,2),16),X=parseInt(d.substr(m+7,2),16);c+=String.fromCharCode((P&15)<<12|(H&63)<<6|X&63)}else c+=d.substr(m,9);m+=9}else c+=d.substr(m,3),m+=3}return c}function Q(d,c){function m(E){var P=J(E);return P.match(c.UNRESERVED)?P:E}return d.scheme&&(d.scheme=String(d.scheme).replace(c.PCT_ENCODED,m).toLowerCase().replace(c.NOT_SCHEME,"")),d.userinfo!==void 0&&(d.userinfo=String(d.userinfo).replace(c.PCT_ENCODED,m).replace(c.NOT_USERINFO,M).replace(c.PCT_ENCODED,a)),d.host!==void 0&&(d.host=String(d.host).replace(c.PCT_ENCODED,m).toLowerCase().replace(c.NOT_HOST,M).replace(c.PCT_ENCODED,a)),d.path!==void 0&&(d.path=String(d.path).replace(c.PCT_ENCODED,m).replace(d.scheme?c.NOT_PATH:c.NOT_PATH_NOSCHEME,M).replace(c.PCT_ENCODED,a)),d.query!==void 0&&(d.query=String(d.query).replace(c.PCT_ENCODED,m).replace(c.NOT_QUERY,M).replace(c.PCT_ENCODED,a)),d.fragment!==void 0&&(d.fragment=String(d.fragment).replace(c.PCT_ENCODED,m).replace(c.NOT_FRAGMENT,M).replace(c.PCT_ENCODED,a)),d}function le(d){return d.replace(/^0*(.*)/,"$1")||"0"}function Ae(d,c){var m=d.match(c.IPV4ADDRESS)||[],E=k(m,2),P=E[1];return P?P.split(".").map(le).join("."):d}function Tt(d,c){var m=d.match(c.IPV6ADDRESS)||[],E=k(m,3),P=E[1],L=E[2];if(P){for(var H=P.toLowerCase().split("::").reverse(),X=k(H,2),se=X[0],ue=X[1],Y=ue?ue.split(":").map(le):[],ne=se.split(":").map(le),de=c.IPV4ADDRESS.test(ne[ne.length-1]),x=de?7:8,oe=ne.length-x,me=Array(x),ae=0;ae<x;++ae)me[ae]=Y[ae]||ne[oe+ae]||"";de&&(me[x-1]=Ae(me[x-1],c));var Xe=me.reduce(function(Oe,Le,pt){if(!Le||Le==="0"){var Je=Oe[Oe.length-1];Je&&Je.index+Je.length===pt?Je.length++:Oe.push({index:pt,length:1})}return Oe},[]),Me=Xe.sort(function(Oe,Le){return Le.length-Oe.length})[0],Ue=void 0;if(Me&&Me.length>1){var jt=me.slice(0,Me.index),dt=me.slice(Me.index+Me.length);Ue=jt.join(":")+"::"+dt.join(":")}else Ue=me.join(":");return L&&(Ue+="%"+L),Ue}else return d}var Qt=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Zt="".match(/(){0}/)[1]===void 0;function Te(d){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m={},E=c.iri!==!1?y:f;c.reference==="suffix"&&(d=(c.scheme?c.scheme+":":"")+"//"+d);var P=d.match(Qt);if(P){Zt?(m.scheme=P[1],m.userinfo=P[3],m.host=P[4],m.port=parseInt(P[5],10),m.path=P[6]||"",m.query=P[7],m.fragment=P[8],isNaN(m.port)&&(m.port=P[5])):(m.scheme=P[1]||void 0,m.userinfo=d.indexOf("@")!==-1?P[3]:void 0,m.host=d.indexOf("//")!==-1?P[4]:void 0,m.port=parseInt(P[5],10),m.path=P[6]||"",m.query=d.indexOf("?")!==-1?P[7]:void 0,m.fragment=d.indexOf("#")!==-1?P[8]:void 0,isNaN(m.port)&&(m.port=d.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?P[4]:void 0)),m.host&&(m.host=Tt(Ae(m.host,E),E)),m.scheme===void 0&&m.userinfo===void 0&&m.host===void 0&&m.port===void 0&&!m.path&&m.query===void 0?m.reference="same-document":m.scheme===void 0?m.reference="relative":m.fragment===void 0?m.reference="absolute":m.reference="uri",c.reference&&c.reference!=="suffix"&&c.reference!==m.reference&&(m.error=m.error||"URI is not a "+c.reference+" reference.");var L=q[(c.scheme||m.scheme||"").toLowerCase()];if(!c.unicodeSupport&&(!L||!L.unicodeSupport)){if(m.host&&(c.domainHost||L&&L.domainHost))try{m.host=C.toASCII(m.host.replace(E.PCT_ENCODED,J).toLowerCase())}catch(H){m.error=m.error||"Host's domain name can not be converted to ASCII via punycode: "+H}Q(m,f)}else Q(m,E);L&&L.parse&&L.parse(m,c)}else m.error=m.error||"URI can not be parsed.";return m}function Xt(d,c){var m=c.iri!==!1?y:f,E=[];return d.userinfo!==void 0&&(E.push(d.userinfo),E.push("@")),d.host!==void 0&&E.push(Tt(Ae(String(d.host),m),m).replace(m.IPV6ADDRESS,function(P,L,H){return"["+L+(H?"%25"+H:"")+"]"})),(typeof d.port=="number"||typeof d.port=="string")&&(E.push(":"),E.push(String(d.port))),E.length?E.join(""):void 0}var kt=/^\.\.?\//,Rt=/^\/\.(\/|$)/,Ot=/^\/\.\.(\/|$)/,er=/^\/?(?:.|\n)*?(?=\/|$)/;function Fe(d){for(var c=[];d.length;)if(d.match(kt))d=d.replace(kt,"");else if(d.match(Rt))d=d.replace(Rt,"/");else if(d.match(Ot))d=d.replace(Ot,"/"),c.pop();else if(d==="."||d==="..")d="";else{var m=d.match(er);if(m){var E=m[0];d=d.slice(E.length),c.push(E)}else throw new Error("Unexpected dot segment condition")}return c.join("")}function Pe(d){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=c.iri?y:f,E=[],P=q[(c.scheme||d.scheme||"").toLowerCase()];if(P&&P.serialize&&P.serialize(d,c),d.host&&!m.IPV6ADDRESS.test(d.host)){if(c.domainHost||P&&P.domainHost)try{d.host=c.iri?C.toUnicode(d.host):C.toASCII(d.host.replace(m.PCT_ENCODED,J).toLowerCase())}catch(X){d.error=d.error||"Host's domain name can not be converted to "+(c.iri?"Unicode":"ASCII")+" via punycode: "+X}}Q(d,m),c.reference!=="suffix"&&d.scheme&&(E.push(d.scheme),E.push(":"));var L=Xt(d,c);if(L!==void 0&&(c.reference!=="suffix"&&E.push("//"),E.push(L),d.path&&d.path.charAt(0)!=="/"&&E.push("/")),d.path!==void 0){var H=d.path;!c.absolutePath&&(!P||!P.absolutePath)&&(H=Fe(H)),L===void 0&&(H=H.replace(/^\/\//,"/%2F")),E.push(H)}return d.query!==void 0&&(E.push("?"),E.push(d.query)),d.fragment!==void 0&&(E.push("#"),E.push(d.fragment)),E.join("")}function Nt(d,c){var m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},E=arguments[3],P={};return E||(d=Te(Pe(d,m),m),c=Te(Pe(c,m),m)),m=m||{},!m.tolerant&&c.scheme?(P.scheme=c.scheme,P.userinfo=c.userinfo,P.host=c.host,P.port=c.port,P.path=Fe(c.path||""),P.query=c.query):(c.userinfo!==void 0||c.host!==void 0||c.port!==void 0?(P.userinfo=c.userinfo,P.host=c.host,P.port=c.port,P.path=Fe(c.path||""),P.query=c.query):(c.path?(c.path.charAt(0)==="/"?P.path=Fe(c.path):((d.userinfo!==void 0||d.host!==void 0||d.port!==void 0)&&!d.path?P.path="/"+c.path:d.path?P.path=d.path.slice(0,d.path.lastIndexOf("/")+1)+c.path:P.path=c.path,P.path=Fe(P.path)),P.query=c.query):(P.path=d.path,c.query!==void 0?P.query=c.query:P.query=d.query),P.userinfo=d.userinfo,P.host=d.host,P.port=d.port),P.scheme=d.scheme),P.fragment=c.fragment,P}function tr(d,c,m){var E=p({scheme:"null"},m);return Pe(Nt(Te(d,E),Te(c,E),E,!0),E)}function lt(d,c){return typeof d=="string"?d=Pe(Te(d,c),c):i(d)==="object"&&(d=Te(Pe(d,c),c)),d}function rr(d,c,m){return typeof d=="string"?d=Pe(Te(d,m),m):i(d)==="object"&&(d=Pe(d,m)),typeof c=="string"?c=Pe(Te(c,m),m):i(c)==="object"&&(c=Pe(c,m)),d===c}function Pr(d,c){return d&&d.toString().replace(!c||!c.iri?f.ESCAPE:y.ESCAPE,M)}function Re(d,c){return d&&d.toString().replace(!c||!c.iri?f.PCT_ENCODED:y.PCT_ENCODED,J)}var ut={scheme:"http",domainHost:!0,parse:function(c,m){return c.host||(c.error=c.error||"HTTP URIs must have a host."),c},serialize:function(c,m){var E=String(c.scheme).toLowerCase()==="https";return(c.port===(E?443:80)||c.port==="")&&(c.port=void 0),c.path||(c.path="/"),c}},bs={scheme:"https",domainHost:ut.domainHost,parse:ut.parse,serialize:ut.serialize};function Ps(d){return typeof d.secure=="boolean"?d.secure:String(d.scheme).toLowerCase()==="wss"}var nr={scheme:"ws",domainHost:!0,parse:function(c,m){var E=c;return E.secure=Ps(E),E.resourceName=(E.path||"/")+(E.query?"?"+E.query:""),E.path=void 0,E.query=void 0,E},serialize:function(c,m){if((c.port===(Ps(c)?443:80)||c.port==="")&&(c.port=void 0),typeof c.secure=="boolean"&&(c.scheme=c.secure?"wss":"ws",c.secure=void 0),c.resourceName){var E=c.resourceName.split("?"),P=k(E,2),L=P[0],H=P[1];c.path=L&&L!=="/"?L:void 0,c.query=H,c.resourceName=void 0}return c.fragment=void 0,c}},Es={scheme:"wss",domainHost:nr.domainHost,parse:nr.parse,serialize:nr.serialize},Ho={},Ss="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",qe="[0-9A-Fa-f]",zo=s(s("%[EFef]"+qe+"%"+qe+qe+"%"+qe+qe)+"|"+s("%[89A-Fa-f]"+qe+"%"+qe+qe)+"|"+s("%"+qe+qe)),Vo="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Wo="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",xo=n(Wo,'[\\"\\\\]'),Bo="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Go=new RegExp(Ss,"g"),Ct=new RegExp(zo,"g"),Ko=new RegExp(n("[^]",Vo,"[\\.]",'[\\"]',xo),"g"),Ts=new RegExp(n("[^]",Ss,Bo),"g"),Jo=Ts;function pn(d){var c=J(d);return c.match(Go)?c:d}var ks={scheme:"mailto",parse:function(c,m){var E=c,P=E.to=E.path?E.path.split(","):[];if(E.path=void 0,E.query){for(var L=!1,H={},X=E.query.split("&"),se=0,ue=X.length;se<ue;++se){var Y=X[se].split("=");switch(Y[0]){case"to":for(var ne=Y[1].split(","),de=0,x=ne.length;de<x;++de)P.push(ne[de]);break;case"subject":E.subject=Re(Y[1],m);break;case"body":E.body=Re(Y[1],m);break;default:L=!0,H[Re(Y[0],m)]=Re(Y[1],m);break}}L&&(E.headers=H)}E.query=void 0;for(var oe=0,me=P.length;oe<me;++oe){var ae=P[oe].split("@");if(ae[0]=Re(ae[0]),m.unicodeSupport)ae[1]=Re(ae[1],m).toLowerCase();else try{ae[1]=C.toASCII(Re(ae[1],m).toLowerCase())}catch(Xe){E.error=E.error||"Email address's domain name can not be converted to ASCII via punycode: "+Xe}P[oe]=ae.join("@")}return E},serialize:function(c,m){var E=c,P=l(c.to);if(P){for(var L=0,H=P.length;L<H;++L){var X=String(P[L]),se=X.lastIndexOf("@"),ue=X.slice(0,se).replace(Ct,pn).replace(Ct,a).replace(Ko,M),Y=X.slice(se+1);try{Y=m.iri?C.toUnicode(Y):C.toASCII(Re(Y,m).toLowerCase())}catch(oe){E.error=E.error||"Email address's domain name can not be converted to "+(m.iri?"Unicode":"ASCII")+" via punycode: "+oe}P[L]=ue+"@"+Y}E.path=P.join(",")}var ne=c.headers=c.headers||{};c.subject&&(ne.subject=c.subject),c.body&&(ne.body=c.body);var de=[];for(var x in ne)ne[x]!==Ho[x]&&de.push(x.replace(Ct,pn).replace(Ct,a).replace(Ts,M)+"="+ne[x].replace(Ct,pn).replace(Ct,a).replace(Jo,M));return de.length&&(E.query=de.join("&")),E}},Yo=/^([^\:]+)\:(.*)/,Rs={scheme:"urn",parse:function(c,m){var E=c.path&&c.path.match(Yo),P=c;if(E){var L=m.scheme||P.scheme||"urn",H=E[1].toLowerCase(),X=E[2],se=L+":"+(m.nid||H),ue=q[se];P.nid=H,P.nss=X,P.path=void 0,ue&&(P=ue.parse(P,m))}else P.error=P.error||"URN can not be parsed.";return P},serialize:function(c,m){var E=m.scheme||c.scheme||"urn",P=c.nid,L=E+":"+(m.nid||P),H=q[L];H&&(c=H.serialize(c,m));var X=c,se=c.nss;return X.path=(P||m.nid)+":"+se,X}},Qo=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Os={scheme:"urn:uuid",parse:function(c,m){var E=c;return E.uuid=E.nss,E.nss=void 0,!m.tolerant&&(!E.uuid||!E.uuid.match(Qo))&&(E.error=E.error||"UUID is not valid."),E},serialize:function(c,m){var E=c;return E.nss=(c.uuid||"").toLowerCase(),E}};q[ut.scheme]=ut,q[bs.scheme]=bs,q[nr.scheme]=nr,q[Es.scheme]=Es,q[ks.scheme]=ks,q[Rs.scheme]=Rs,q[Os.scheme]=Os,r.SCHEMES=q,r.pctEncChar=M,r.pctDecChars=J,r.parse=Te,r.removeDotSegments=Fe,r.serialize=Pe,r.resolveComponents=Nt,r.resolve=tr,r.normalize=lt,r.equal=rr,r.escapeComponent=Pr,r.unescapeComponent=Re,Object.defineProperty(r,"__esModule",{value:!0})})})(Sn,Sn.exports);var Nl=Sn.exports;Object.defineProperty(Wn,"__esModule",{value:!0});const Co=Nl;Co.code='require("ajv/dist/runtime/uri").default';Wn.default=Co;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=De;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return e.KeywordCxt}});var r=G;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=vr,s=wr,i=wt,a=Se,l=G,p=$e,u=_r,f=re,y=Ol,k=Wn,R=(F,$)=>new RegExp(F,$);R.code="new RegExp";const v=["removeAdditional","useDefaults","coerceTypes"],S=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),_={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."},g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},T=200;function O(F){var $,I,b,o,h,C,q,M,J,Q,le,Ae,Tt,Qt,Zt,Te,Xt,kt,Rt,Ot,er,Fe,Pe,Nt,tr;const lt=F.strict,rr=($=F.code)===null||$===void 0?void 0:$.optimize,Pr=rr===!0||rr===void 0?1:rr||0,Re=(b=(I=F.code)===null||I===void 0?void 0:I.regExp)!==null&&b!==void 0?b:R,ut=(o=F.uriResolver)!==null&&o!==void 0?o:k.default;return{strictSchema:(C=(h=F.strictSchema)!==null&&h!==void 0?h:lt)!==null&&C!==void 0?C:!0,strictNumbers:(M=(q=F.strictNumbers)!==null&&q!==void 0?q:lt)!==null&&M!==void 0?M:!0,strictTypes:(Q=(J=F.strictTypes)!==null&&J!==void 0?J:lt)!==null&&Q!==void 0?Q:"log",strictTuples:(Ae=(le=F.strictTuples)!==null&&le!==void 0?le:lt)!==null&&Ae!==void 0?Ae:"log",strictRequired:(Qt=(Tt=F.strictRequired)!==null&&Tt!==void 0?Tt:lt)!==null&&Qt!==void 0?Qt:!1,code:F.code?{...F.code,optimize:Pr,regExp:Re}:{optimize:Pr,regExp:Re},loopRequired:(Zt=F.loopRequired)!==null&&Zt!==void 0?Zt:T,loopEnum:(Te=F.loopEnum)!==null&&Te!==void 0?Te:T,meta:(Xt=F.meta)!==null&&Xt!==void 0?Xt:!0,messages:(kt=F.messages)!==null&&kt!==void 0?kt:!0,inlineRefs:(Rt=F.inlineRefs)!==null&&Rt!==void 0?Rt:!0,schemaId:(Ot=F.schemaId)!==null&&Ot!==void 0?Ot:"$id",addUsedSchema:(er=F.addUsedSchema)!==null&&er!==void 0?er:!0,validateSchema:(Fe=F.validateSchema)!==null&&Fe!==void 0?Fe:!0,validateFormats:(Pe=F.validateFormats)!==null&&Pe!==void 0?Pe:!0,unicodeRegExp:(Nt=F.unicodeRegExp)!==null&&Nt!==void 0?Nt:!0,int32range:(tr=F.int32range)!==null&&tr!==void 0?tr:!0,uriResolver:ut}}class j{constructor($={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...O($)};const{es5:I,lines:b}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:S,es5:I,lines:b}),this.logger=Z($.logger);const o=$.validateFormats;$.validateFormats=!1,this.RULES=(0,i.getRules)(),A.call(this,_,$,"NOT SUPPORTED"),A.call(this,g,$,"DEPRECATED","warn"),this._metaOpts=K.call(this),$.formats&&D.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords&&W.call(this,$.keywords),typeof $.meta=="object"&&this.addMetaSchema($.meta),N.call(this),$.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:$,meta:I,schemaId:b}=this.opts;let o=y;b==="id"&&(o={...y},o.id=o.$id,delete o.$id),I&&$&&this.addMetaSchema(o,o[b],!1)}defaultMeta(){const{meta:$,schemaId:I}=this.opts;return this.opts.defaultMeta=typeof $=="object"?$[I]||$:void 0}validate($,I){let b;if(typeof $=="string"){if(b=this.getSchema($),!b)throw new Error(`no schema with key or ref "${$}"`)}else b=this.compile($);const o=b(I);return"$async"in b||(this.errors=b.errors),o}compile($,I){const b=this._addSchema($,I);return b.validate||this._compileSchemaEnv(b)}compileAsync($,I){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:b}=this.opts;return o.call(this,$,I);async function o(Q,le){await h.call(this,Q.$schema);const Ae=this._addSchema(Q,le);return Ae.validate||C.call(this,Ae)}async function h(Q){Q&&!this.getSchema(Q)&&await o.call(this,{$ref:Q},!0)}async function C(Q){try{return this._compileSchemaEnv(Q)}catch(le){if(!(le instanceof s.default))throw le;return q.call(this,le),await M.call(this,le.missingSchema),C.call(this,Q)}}function q({missingSchema:Q,missingRef:le}){if(this.refs[Q])throw new Error(`AnySchema ${Q} is loaded but ${le} cannot be resolved`)}async function M(Q){const le=await J.call(this,Q);this.refs[Q]||await h.call(this,le.$schema),this.refs[Q]||this.addSchema(le,Q,I)}async function J(Q){const le=this._loading[Q];if(le)return le;try{return await(this._loading[Q]=b(Q))}finally{delete this._loading[Q]}}}addSchema($,I,b,o=this.opts.validateSchema){if(Array.isArray($)){for(const C of $)this.addSchema(C,void 0,b,o);return this}let h;if(typeof $=="object"){const{schemaId:C}=this.opts;if(h=$[C],h!==void 0&&typeof h!="string")throw new Error(`schema ${C} must be string`)}return I=(0,p.normalizeId)(I||h),this._checkUnique(I),this.schemas[I]=this._addSchema($,b,I,o,!0),this}addMetaSchema($,I,b=this.opts.validateSchema){return this.addSchema($,I,!0,b),this}validateSchema($,I){if(typeof $=="boolean")return!0;let b;if(b=$.$schema,b!==void 0&&typeof b!="string")throw new Error("$schema must be a string");if(b=b||this.opts.defaultMeta||this.defaultMeta(),!b)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const o=this.validate(b,$);if(!o&&I){const h="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(h);else throw new Error(h)}return o}getSchema($){let I;for(;typeof(I=w.call(this,$))=="string";)$=I;if(I===void 0){const{schemaId:b}=this.opts,o=new a.SchemaEnv({schema:{},schemaId:b});if(I=a.resolveSchema.call(this,o,$),!I)return;this.refs[$]=I}return I.validate||this._compileSchemaEnv(I)}removeSchema($){if($ instanceof RegExp)return this._removeAllSchemas(this.schemas,$),this._removeAllSchemas(this.refs,$),this;switch(typeof $){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const I=w.call(this,$);return typeof I=="object"&&this._cache.delete(I.schema),delete this.schemas[$],delete this.refs[$],this}case"object":{const I=$;this._cache.delete(I);let b=$[this.opts.schemaId];return b&&(b=(0,p.normalizeId)(b),delete this.schemas[b],delete this.refs[b]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary($){for(const I of $)this.addKeyword(I);return this}addKeyword($,I){let b;if(typeof $=="string")b=$,typeof I=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),I.keyword=b);else if(typeof $=="object"&&I===void 0){if(I=$,b=I.keyword,Array.isArray(b)&&!b.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(he.call(this,b,I),!I)return(0,f.eachItem)(b,h=>at.call(this,h)),this;Et.call(this,I);const o={...I,type:(0,u.getJSONTypes)(I.type),schemaType:(0,u.getJSONTypes)(I.schemaType)};return(0,f.eachItem)(b,o.type.length===0?h=>at.call(this,h,o):h=>o.type.forEach(C=>at.call(this,h,o,C))),this}getKeyword($){const I=this.RULES.all[$];return typeof I=="object"?I.definition:!!I}removeKeyword($){const{RULES:I}=this;delete I.keywords[$],delete I.all[$];for(const b of I.rules){const o=b.rules.findIndex(h=>h.keyword===$);o>=0&&b.rules.splice(o,1)}return this}addFormat($,I){return typeof I=="string"&&(I=new RegExp(I)),this.formats[$]=I,this}errorsText($=this.errors,{separator:I=", ",dataVar:b="data"}={}){return!$||$.length===0?"No errors":$.map(o=>`${b}${o.instancePath} ${o.message}`).reduce((o,h)=>o+I+h)}$dataMetaSchema($,I){const b=this.RULES.all;$=JSON.parse(JSON.stringify($));for(const o of I){const h=o.split("/").slice(1);let C=$;for(const q of h)C=C[q];for(const q in b){const M=b[q];if(typeof M!="object")continue;const{$data:J}=M.definition,Q=C[q];J&&Q&&(C[q]=St(Q))}}return $}_removeAllSchemas($,I){for(const b in $){const o=$[b];(!I||I.test(b))&&(typeof o=="string"?delete $[b]:o&&!o.meta&&(this._cache.delete(o.schema),delete $[b]))}}_addSchema($,I,b,o=this.opts.validateSchema,h=this.opts.addUsedSchema){let C;const{schemaId:q}=this.opts;if(typeof $=="object")C=$[q];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof $!="boolean")throw new Error("schema must be object or boolean")}let M=this._cache.get($);if(M!==void 0)return M;b=(0,p.normalizeId)(C||b);const J=p.getSchemaRefs.call(this,$,b);return M=new a.SchemaEnv({schema:$,schemaId:q,meta:I,baseId:b,localRefs:J}),this._cache.set(M.schema,M),h&&!b.startsWith("#")&&(b&&this._checkUnique(b),this.refs[b]=M),o&&this.validateSchema($,!0),M}_checkUnique($){if(this.schemas[$]||this.refs[$])throw new Error(`schema with key or id "${$}" already exists`)}_compileSchemaEnv($){if($.meta?this._compileMetaSchema($):a.compileSchema.call(this,$),!$.validate)throw new Error("ajv implementation error");return $.validate}_compileMetaSchema($){const I=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,$)}finally{this.opts=I}}}t.default=j,j.ValidationError=n.default,j.MissingRefError=s.default;function A(F,$,I,b="error"){for(const o in F){const h=o;h in $&&this.logger[b](`${I}: option ${o}. ${F[h]}`)}}function w(F){return F=(0,p.normalizeId)(F),this.schemas[F]||this.refs[F]}function N(){const F=this.opts.schemas;if(F)if(Array.isArray(F))this.addSchema(F);else for(const $ in F)this.addSchema(F[$],$)}function D(){for(const F in this.opts.formats){const $=this.opts.formats[F];$&&this.addFormat(F,$)}}function W(F){if(Array.isArray(F)){this.addVocabulary(F);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const $ in F){const I=F[$];I.keyword||(I.keyword=$),this.addKeyword(I)}}function K(){const F={...this.opts};for(const $ of v)delete F[$];return F}const ce={log(){},warn(){},error(){}};function Z(F){if(F===!1)return ce;if(F===void 0)return console;if(F.log&&F.warn&&F.error)return F;throw new Error("logger must implement log, warn and error methods")}const ke=/^[a-z_$][a-z0-9_$:-]*$/i;function he(F,$){const{RULES:I}=this;if((0,f.eachItem)(F,b=>{if(I.keywords[b])throw new Error(`Keyword ${b} is already defined`);if(!ke.test(b))throw new Error(`Keyword ${b} has invalid name`)}),!!$&&$.$data&&!("code"in $||"validate"in $))throw new Error('$data keyword must have "code" or "validate" function')}function at(F,$,I){var b;const o=$==null?void 0:$.post;if(I&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:h}=this;let C=o?h.post:h.rules.find(({type:M})=>M===I);if(C||(C={type:I,rules:[]},h.rules.push(C)),h.keywords[F]=!0,!$)return;const q={keyword:F,definition:{...$,type:(0,u.getJSONTypes)($.type),schemaType:(0,u.getJSONTypes)($.schemaType)}};$.before?ct.call(this,C,q,$.before):C.rules.push(q),h.all[F]=q,(b=$.implements)===null||b===void 0||b.forEach(M=>this.addKeyword(M))}function ct(F,$,I){const b=F.rules.findIndex(o=>o.keyword===I);b>=0?F.rules.splice(b,0,$):(F.rules.push($),this.logger.warn(`rule ${I} is not defined`))}function Et(F){let{metaSchema:$}=F;$!==void 0&&(F.$data&&this.opts.$data&&($=St($)),F.validateSchema=this.compile($,!0))}const Yt={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function St(F){return{anyOf:[F,Yt]}}})(io);var xn={},Bn={},Gn={};Object.defineProperty(Gn,"__esModule",{value:!0});const Cl={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Gn.default=Cl;var bt={};Object.defineProperty(bt,"__esModule",{value:!0});bt.callRef=bt.getValidate=void 0;const jl=wr,Xs=B,Ee=G,At=Ke,ei=Se,kr=re,Il={keyword:"$ref",schemaType:"string",code(t){const{gen:e,schema:r,it:n}=t,{baseId:s,schemaEnv:i,validateName:a,opts:l,self:p}=n,{root:u}=i;if((r==="#"||r==="#/")&&s===u.baseId)return y();const f=ei.resolveRef.call(p,u,s,r);if(f===void 0)throw new jl.default(n.opts.uriResolver,s,r);if(f instanceof ei.SchemaEnv)return k(f);return R(f);function y(){if(i===u)return Dr(t,a,i,i.$async);const v=e.scopeValue("root",{ref:u});return Dr(t,(0,Ee._)`${v}.validate`,u,u.$async)}function k(v){const S=jo(t,v);Dr(t,S,v,v.$async)}function R(v){const S=e.scopeValue("schema",l.code.source===!0?{ref:v,code:(0,Ee.stringify)(v)}:{ref:v}),_=e.name("valid"),g=t.subschema({schema:v,dataTypes:[],schemaPath:Ee.nil,topSchemaRef:S,errSchemaPath:r},_);t.mergeEvaluated(g),t.ok(_)}}};function jo(t,e){const{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Ee._)`${r.scopeValue("wrapper",{ref:e})}.validate`}bt.getValidate=jo;function Dr(t,e,r,n){const{gen:s,it:i}=t,{allErrors:a,schemaEnv:l,opts:p}=i,u=p.passContext?At.default.this:Ee.nil;n?f():y();function f(){if(!l.$async)throw new Error("async schema referenced by sync schema");const v=s.let("valid");s.try(()=>{s.code((0,Ee._)`await ${(0,Xs.callValidateCode)(t,e,u)}`),R(e),a||s.assign(v,!0)},S=>{s.if((0,Ee._)`!(${S} instanceof ${i.ValidationError})`,()=>s.throw(S)),k(S),a||s.assign(v,!1)}),t.ok(v)}function y(){t.result((0,Xs.callValidateCode)(t,e,u),()=>R(e),()=>k(e))}function k(v){const S=(0,Ee._)`${v}.errors`;s.assign(At.default.vErrors,(0,Ee._)`${At.default.vErrors} === null ? ${S} : ${At.default.vErrors}.concat(${S})`),s.assign(At.default.errors,(0,Ee._)`${At.default.vErrors}.length`)}function R(v){var S;if(!i.opts.unevaluated)return;const _=(S=r==null?void 0:r.validate)===null||S===void 0?void 0:S.evaluated;if(i.props!==!0)if(_&&!_.dynamicProps)_.props!==void 0&&(i.props=kr.mergeEvaluated.props(s,_.props,i.props));else{const g=s.var("props",(0,Ee._)`${v}.evaluated.props`);i.props=kr.mergeEvaluated.props(s,g,i.props,Ee.Name)}if(i.items!==!0)if(_&&!_.dynamicItems)_.items!==void 0&&(i.items=kr.mergeEvaluated.items(s,_.items,i.items));else{const g=s.var("items",(0,Ee._)`${v}.evaluated.items`);i.items=kr.mergeEvaluated.items(s,g,i.items,Ee.Name)}}}bt.callRef=Dr;bt.default=Il;Object.defineProperty(Bn,"__esModule",{value:!0});const Dl=Gn,Al=bt,Fl=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Dl.default,Al.default];Bn.default=Fl;var Kn={},Jn={};Object.defineProperty(Jn,"__esModule",{value:!0});const Ur=G,rt=Ur.operators,Lr={maximum:{okStr:"<=",ok:rt.LTE,fail:rt.GT},minimum:{okStr:">=",ok:rt.GTE,fail:rt.LT},exclusiveMaximum:{okStr:"<",ok:rt.LT,fail:rt.GTE},exclusiveMinimum:{okStr:">",ok:rt.GT,fail:rt.LTE}},ql={message:({keyword:t,schemaCode:e})=>(0,Ur.str)`must be ${Lr[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Ur._)`{comparison: ${Lr[t].okStr}, limit: ${e}}`},Ml={keyword:Object.keys(Lr),type:"number",schemaType:"number",$data:!0,error:ql,code(t){const{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,Ur._)`${r} ${Lr[e].fail} ${n} || isNaN(${r})`)}};Jn.default=Ml;var Yn={};Object.defineProperty(Yn,"__esModule",{value:!0});const ur=G,Ul={message:({schemaCode:t})=>(0,ur.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,ur._)`{multipleOf: ${t}}`},Ll={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Ul,code(t){const{gen:e,data:r,schemaCode:n,it:s}=t,i=s.opts.multipleOfPrecision,a=e.let("res"),l=i?(0,ur._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${i}`:(0,ur._)`${a} !== parseInt(${a})`;t.fail$data((0,ur._)`(${n} === 0 || (${a} = ${r}/${n}, ${l}))`)}};Yn.default=Ll;var Qn={},Zn={};Object.defineProperty(Zn,"__esModule",{value:!0});function Io(t){const e=t.length;let r=0,n=0,s;for(;n<e;)r++,s=t.charCodeAt(n++),s>=55296&&s<=56319&&n<e&&(s=t.charCodeAt(n),(s&64512)===56320&&n++);return r}Zn.default=Io;Io.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(Qn,"__esModule",{value:!0});const mt=G,Hl=re,zl=Zn,Vl={message({keyword:t,schemaCode:e}){const r=t==="maxLength"?"more":"fewer";return(0,mt.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,mt._)`{limit: ${t}}`},Wl={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Vl,code(t){const{keyword:e,data:r,schemaCode:n,it:s}=t,i=e==="maxLength"?mt.operators.GT:mt.operators.LT,a=s.opts.unicode===!1?(0,mt._)`${r}.length`:(0,mt._)`${(0,Hl.useFunc)(t.gen,zl.default)}(${r})`;t.fail$data((0,mt._)`${a} ${i} ${n}`)}};Qn.default=Wl;var Xn={};Object.defineProperty(Xn,"__esModule",{value:!0});const xl=B,Hr=G,Bl={message:({schemaCode:t})=>(0,Hr.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Hr._)`{pattern: ${t}}`},Gl={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Bl,code(t){const{data:e,$data:r,schema:n,schemaCode:s,it:i}=t,a=i.opts.unicodeRegExp?"u":"",l=r?(0,Hr._)`(new RegExp(${s}, ${a}))`:(0,xl.usePattern)(t,n);t.fail$data((0,Hr._)`!${l}.test(${e})`)}};Xn.default=Gl;var es={};Object.defineProperty(es,"__esModule",{value:!0});const dr=G,Kl={message({keyword:t,schemaCode:e}){const r=t==="maxProperties"?"more":"fewer";return(0,dr.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,dr._)`{limit: ${t}}`},Jl={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Kl,code(t){const{keyword:e,data:r,schemaCode:n}=t,s=e==="maxProperties"?dr.operators.GT:dr.operators.LT;t.fail$data((0,dr._)`Object.keys(${r}).length ${s} ${n}`)}};es.default=Jl;var ts={};Object.defineProperty(ts,"__esModule",{value:!0});const ar=B,pr=G,Yl=re,Ql={message:({params:{missingProperty:t}})=>(0,pr.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,pr._)`{missingProperty: ${t}}`},Zl={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Ql,code(t){const{gen:e,schema:r,schemaCode:n,data:s,$data:i,it:a}=t,{opts:l}=a;if(!i&&r.length===0)return;const p=r.length>=l.loopRequired;if(a.allErrors?u():f(),l.strictRequired){const R=t.parentSchema.properties,{definedProperties:v}=t.it;for(const S of r)if((R==null?void 0:R[S])===void 0&&!v.has(S)){const _=a.schemaEnv.baseId+a.errSchemaPath,g=`required property "${S}" is not defined at "${_}" (strictRequired)`;(0,Yl.checkStrictMode)(a,g,a.opts.strictRequired)}}function u(){if(p||i)t.block$data(pr.nil,y);else for(const R of r)(0,ar.checkReportMissingProp)(t,R)}function f(){const R=e.let("missing");if(p||i){const v=e.let("valid",!0);t.block$data(v,()=>k(R,v)),t.ok(v)}else e.if((0,ar.checkMissingProp)(t,r,R)),(0,ar.reportMissingProp)(t,R),e.else()}function y(){e.forOf("prop",n,R=>{t.setParams({missingProperty:R}),e.if((0,ar.noPropertyInData)(e,s,R,l.ownProperties),()=>t.error())})}function k(R,v){t.setParams({missingProperty:R}),e.forOf(R,n,()=>{e.assign(v,(0,ar.propertyInData)(e,s,R,l.ownProperties)),e.if((0,pr.not)(v),()=>{t.error(),e.break()})},pr.nil)}}};ts.default=Zl;var rs={};Object.defineProperty(rs,"__esModule",{value:!0});const fr=G,Xl={message({keyword:t,schemaCode:e}){const r=t==="maxItems"?"more":"fewer";return(0,fr.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,fr._)`{limit: ${t}}`},eu={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Xl,code(t){const{keyword:e,data:r,schemaCode:n}=t,s=e==="maxItems"?fr.operators.GT:fr.operators.LT;t.fail$data((0,fr._)`${r}.length ${s} ${n}`)}};rs.default=eu;var ns={},br={};Object.defineProperty(br,"__esModule",{value:!0});const Do=ho;Do.code='require("ajv/dist/runtime/equal").default';br.default=Do;Object.defineProperty(ns,"__esModule",{value:!0});const _n=_r,ge=G,tu=re,ru=br,nu={message:({params:{i:t,j:e}})=>(0,ge.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,ge._)`{i: ${t}, j: ${e}}`},su={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:nu,code(t){const{gen:e,data:r,$data:n,schema:s,parentSchema:i,schemaCode:a,it:l}=t;if(!n&&!s)return;const p=e.let("valid"),u=i.items?(0,_n.getSchemaTypes)(i.items):[];t.block$data(p,f,(0,ge._)`${a} === false`),t.ok(p);function f(){const v=e.let("i",(0,ge._)`${r}.length`),S=e.let("j");t.setParams({i:v,j:S}),e.assign(p,!0),e.if((0,ge._)`${v} > 1`,()=>(y()?k:R)(v,S))}function y(){return u.length>0&&!u.some(v=>v==="object"||v==="array")}function k(v,S){const _=e.name("item"),g=(0,_n.checkDataTypes)(u,_,l.opts.strictNumbers,_n.DataType.Wrong),T=e.const("indices",(0,ge._)`{}`);e.for((0,ge._)`;${v}--;`,()=>{e.let(_,(0,ge._)`${r}[${v}]`),e.if(g,(0,ge._)`continue`),u.length>1&&e.if((0,ge._)`typeof ${_} == "string"`,(0,ge._)`${_} += "_"`),e.if((0,ge._)`typeof ${T}[${_}] == "number"`,()=>{e.assign(S,(0,ge._)`${T}[${_}]`),t.error(),e.assign(p,!1).break()}).code((0,ge._)`${T}[${_}] = ${v}`)})}function R(v,S){const _=(0,tu.useFunc)(e,ru.default),g=e.name("outer");e.label(g).for((0,ge._)`;${v}--;`,()=>e.for((0,ge._)`${S} = ${v}; ${S}--;`,()=>e.if((0,ge._)`${_}(${r}[${v}], ${r}[${S}])`,()=>{t.error(),e.assign(p,!1).break(g)})))}}};ns.default=su;var ss={};Object.defineProperty(ss,"__esModule",{value:!0});const Tn=G,iu=re,ou=br,au={message:"must be equal to constant",params:({schemaCode:t})=>(0,Tn._)`{allowedValue: ${t}}`},cu={keyword:"const",$data:!0,error:au,code(t){const{gen:e,data:r,$data:n,schemaCode:s,schema:i}=t;n||i&&typeof i=="object"?t.fail$data((0,Tn._)`!${(0,iu.useFunc)(e,ou.default)}(${r}, ${s})`):t.fail((0,Tn._)`${i} !== ${r}`)}};ss.default=cu;var is={};Object.defineProperty(is,"__esModule",{value:!0});const cr=G,lu=re,uu=br,du={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,cr._)`{allowedValues: ${t}}`},pu={keyword:"enum",schemaType:"array",$data:!0,error:du,code(t){const{gen:e,data:r,$data:n,schema:s,schemaCode:i,it:a}=t;if(!n&&s.length===0)throw new Error("enum must have non-empty array");const l=s.length>=a.opts.loopEnum;let p;const u=()=>p??(p=(0,lu.useFunc)(e,uu.default));let f;if(l||n)f=e.let("valid"),t.block$data(f,y);else{if(!Array.isArray(s))throw new Error("ajv implementation error");const R=e.const("vSchema",i);f=(0,cr.or)(...s.map((v,S)=>k(R,S)))}t.pass(f);function y(){e.assign(f,!1),e.forOf("v",i,R=>e.if((0,cr._)`${u()}(${r}, ${R})`,()=>e.assign(f,!0).break()))}function k(R,v){const S=s[v];return typeof S=="object"&&S!==null?(0,cr._)`${u()}(${r}, ${R}[${v}])`:(0,cr._)`${r} === ${S}`}}};is.default=pu;Object.defineProperty(Kn,"__esModule",{value:!0});const fu=Jn,hu=Yn,mu=Qn,yu=Xn,gu=es,$u=ts,_u=rs,vu=ns,wu=ss,bu=is,Pu=[fu.default,hu.default,mu.default,yu.default,gu.default,$u.default,_u.default,vu.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},wu.default,bu.default];Kn.default=Pu;var os={},Kt={};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.validateAdditionalItems=void 0;const yt=G,kn=re,Eu={message:({params:{len:t}})=>(0,yt.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,yt._)`{limit: ${t}}`},Su={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Eu,code(t){const{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,kn.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Ao(t,n)}};function Ao(t,e){const{gen:r,schema:n,data:s,keyword:i,it:a}=t;a.items=!0;const l=r.const("len",(0,yt._)`${s}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,yt._)`${l} <= ${e.length}`);else if(typeof n=="object"&&!(0,kn.alwaysValidSchema)(a,n)){const u=r.var("valid",(0,yt._)`${l} <= ${e.length}`);r.if((0,yt.not)(u),()=>p(u)),t.ok(u)}function p(u){r.forRange("i",e.length,l,f=>{t.subschema({keyword:i,dataProp:f,dataPropType:kn.Type.Num},u),a.allErrors||r.if((0,yt.not)(u),()=>r.break())})}}Kt.validateAdditionalItems=Ao;Kt.default=Su;var as={},Jt={};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.validateTuple=void 0;const ti=G,Ar=re,Tu=B,ku={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){const{schema:e,it:r}=t;if(Array.isArray(e))return Fo(t,"additionalItems",e);r.items=!0,!(0,Ar.alwaysValidSchema)(r,e)&&t.ok((0,Tu.validateArray)(t))}};function Fo(t,e,r=t.schema){const{gen:n,parentSchema:s,data:i,keyword:a,it:l}=t;f(s),l.opts.unevaluated&&r.length&&l.items!==!0&&(l.items=Ar.mergeEvaluated.items(n,r.length,l.items));const p=n.name("valid"),u=n.const("len",(0,ti._)`${i}.length`);r.forEach((y,k)=>{(0,Ar.alwaysValidSchema)(l,y)||(n.if((0,ti._)`${u} > ${k}`,()=>t.subschema({keyword:a,schemaProp:k,dataProp:k},p)),t.ok(p))});function f(y){const{opts:k,errSchemaPath:R}=l,v=r.length,S=v===y.minItems&&(v===y.maxItems||y[e]===!1);if(k.strictTuples&&!S){const _=`"${a}" is ${v}-tuple, but minItems or maxItems/${e} are not specified or different at path "${R}"`;(0,Ar.checkStrictMode)(l,_,k.strictTuples)}}}Jt.validateTuple=Fo;Jt.default=ku;Object.defineProperty(as,"__esModule",{value:!0});const Ru=Jt,Ou={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,Ru.validateTuple)(t,"items")};as.default=Ou;var cs={};Object.defineProperty(cs,"__esModule",{value:!0});const ri=G,Nu=re,Cu=B,ju=Kt,Iu={message:({params:{len:t}})=>(0,ri.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,ri._)`{limit: ${t}}`},Du={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:Iu,code(t){const{schema:e,parentSchema:r,it:n}=t,{prefixItems:s}=r;n.items=!0,!(0,Nu.alwaysValidSchema)(n,e)&&(s?(0,ju.validateAdditionalItems)(t,s):t.ok((0,Cu.validateArray)(t)))}};cs.default=Du;var ls={};Object.defineProperty(ls,"__esModule",{value:!0});const Ne=G,Rr=re,Au={message:({params:{min:t,max:e}})=>e===void 0?(0,Ne.str)`must contain at least ${t} valid item(s)`:(0,Ne.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Ne._)`{minContains: ${t}}`:(0,Ne._)`{minContains: ${t}, maxContains: ${e}}`},Fu={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Au,code(t){const{gen:e,schema:r,parentSchema:n,data:s,it:i}=t;let a,l;const{minContains:p,maxContains:u}=n;i.opts.next?(a=p===void 0?1:p,l=u):a=1;const f=e.const("len",(0,Ne._)`${s}.length`);if(t.setParams({min:a,max:l}),l===void 0&&a===0){(0,Rr.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&a>l){(0,Rr.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Rr.alwaysValidSchema)(i,r)){let S=(0,Ne._)`${f} >= ${a}`;l!==void 0&&(S=(0,Ne._)`${S} && ${f} <= ${l}`),t.pass(S);return}i.items=!0;const y=e.name("valid");l===void 0&&a===1?R(y,()=>e.if(y,()=>e.break())):a===0?(e.let(y,!0),l!==void 0&&e.if((0,Ne._)`${s}.length > 0`,k)):(e.let(y,!1),k()),t.result(y,()=>t.reset());function k(){const S=e.name("_valid"),_=e.let("count",0);R(S,()=>e.if(S,()=>v(_)))}function R(S,_){e.forRange("i",0,f,g=>{t.subschema({keyword:"contains",dataProp:g,dataPropType:Rr.Type.Num,compositeRule:!0},S),_()})}function v(S){e.code((0,Ne._)`${S}++`),l===void 0?e.if((0,Ne._)`${S} >= ${a}`,()=>e.assign(y,!0).break()):(e.if((0,Ne._)`${S} > ${l}`,()=>e.assign(y,!1).break()),a===1?e.assign(y,!0):e.if((0,Ne._)`${S} >= ${a}`,()=>e.assign(y,!0)))}}};ls.default=Fu;var qo={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const e=G,r=re,n=B;t.error={message:({params:{property:p,depsCount:u,deps:f}})=>{const y=u===1?"property":"properties";return(0,e.str)`must have ${y} ${f} when property ${p} is present`},params:({params:{property:p,depsCount:u,deps:f,missingProperty:y}})=>(0,e._)`{property: ${p},
900
856
  missingProperty: ${y},
901
857
  depsCount: ${u},
902
- deps: ${f}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(p){const[u,f]=i(p);a(p,u),l(p,f)}};function i({schema:p}){const u={},f={};for(const y in p){if(y==="__proto__")continue;const k=Array.isArray(p[y])?u:f;k[y]=p[y]}return[u,f]}function a(p,u=p.schema){const{gen:f,data:y,it:k}=p;if(Object.keys(u).length===0)return;const R=f.let("missing");for(const w in u){const S=u[w];if(S.length===0)continue;const _=(0,n.propertyInData)(f,y,w,k.opts.ownProperties);p.setParams({property:w,depsCount:S.length,deps:S.join(", ")}),k.allErrors?f.if(_,()=>{for(const g of S)(0,n.checkReportMissingProp)(p,g)}):(f.if((0,e._)`${_} && (${(0,n.checkMissingProp)(p,S,R)})`),(0,n.reportMissingProp)(p,R),f.else())}}t.validatePropertyDeps=a;function l(p,u=p.schema){const{gen:f,data:y,keyword:k,it:R}=p,w=f.name("valid");for(const S in u)(0,r.alwaysValidSchema)(R,u[S])||(f.if((0,n.propertyInData)(f,y,S,R.opts.ownProperties),()=>{const _=p.subschema({keyword:k,schemaProp:S},w);p.mergeValidEvaluated(_,w)},()=>f.var(w,!0)),p.ok(w))}t.validateSchemaDeps=l,t.default=s})(Mo);var us={};Object.defineProperty(us,"__esModule",{value:!0});const Uo=G,Uu=re,Lu={message:"property name must be valid",params:({params:t})=>(0,Uo._)`{propertyName: ${t.propertyName}}`},Hu={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Lu,code(t){const{gen:e,schema:r,data:n,it:s}=t;if((0,Uu.alwaysValidSchema)(s,r))return;const i=e.name("valid");e.forIn("key",n,a=>{t.setParams({propertyName:a}),t.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},i),e.if((0,Uo.not)(i),()=>{t.error(!0),s.allErrors||e.break()})}),t.ok(i)}};us.default=Hu;var pn={};Object.defineProperty(pn,"__esModule",{value:!0});const Or=B,je=G,zu=Ke,Cr=re,Vu={message:"must NOT have additional properties",params:({params:t})=>(0,je._)`{additionalProperty: ${t.additionalProperty}}`},Wu={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Vu,code(t){const{gen:e,schema:r,parentSchema:n,data:s,errsCount:i,it:a}=t;if(!i)throw new Error("ajv implementation error");const{allErrors:l,opts:p}=a;if(a.props=!0,p.removeAdditional!=="all"&&(0,Cr.alwaysValidSchema)(a,r))return;const u=(0,Or.allSchemaProperties)(n.properties),f=(0,Or.allSchemaProperties)(n.patternProperties);y(),t.ok((0,je._)`${i} === ${zu.default.errors}`);function y(){e.forIn("key",s,_=>{!u.length&&!f.length?w(_):e.if(k(_),()=>w(_))})}function k(_){let g;if(u.length>8){const T=(0,Cr.schemaRefOrVal)(a,n.properties,"properties");g=(0,Or.isOwnProperty)(e,T,_)}else u.length?g=(0,je.or)(...u.map(T=>(0,je._)`${_} === ${T}`)):g=je.nil;return f.length&&(g=(0,je.or)(g,...f.map(T=>(0,je._)`${(0,Or.usePattern)(t,T)}.test(${_})`))),(0,je.not)(g)}function R(_){e.code((0,je._)`delete ${s}[${_}]`)}function w(_){if(p.removeAdditional==="all"||p.removeAdditional&&r===!1){R(_);return}if(r===!1){t.setParams({additionalProperty:_}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,Cr.alwaysValidSchema)(a,r)){const g=e.name("valid");p.removeAdditional==="failing"?(S(_,g,!1),e.if((0,je.not)(g),()=>{t.reset(),R(_)})):(S(_,g),l||e.if((0,je.not)(g),()=>e.break()))}}function S(_,g,T){const O={keyword:"additionalProperties",dataProp:_,dataPropType:Cr.Type.Str};T===!1&&Object.assign(O,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(O,g)}}};pn.default=Wu;var ds={};Object.defineProperty(ds,"__esModule",{value:!0});const xu=De,ni=B,wn=re,si=pn,Bu={keyword:"properties",type:"object",schemaType:"object",code(t){const{gen:e,schema:r,parentSchema:n,data:s,it:i}=t;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&si.default.code(new xu.KeywordCxt(i,si.default,"additionalProperties"));const a=(0,ni.allSchemaProperties)(r);for(const y of a)i.definedProperties.add(y);i.opts.unevaluated&&a.length&&i.props!==!0&&(i.props=wn.mergeEvaluated.props(e,(0,wn.toHash)(a),i.props));const l=a.filter(y=>!(0,wn.alwaysValidSchema)(i,r[y]));if(l.length===0)return;const p=e.name("valid");for(const y of l)u(y)?f(y):(e.if((0,ni.propertyInData)(e,s,y,i.opts.ownProperties)),f(y),i.allErrors||e.else().var(p,!0),e.endIf()),t.it.definedProperties.add(y),t.ok(p);function u(y){return i.opts.useDefaults&&!i.compositeRule&&r[y].default!==void 0}function f(y){t.subschema({keyword:"properties",schemaProp:y,dataProp:y},p)}}};ds.default=Bu;var ps={};Object.defineProperty(ps,"__esModule",{value:!0});const ii=B,Nr=G,oi=re,ai=re,Gu={keyword:"patternProperties",type:"object",schemaType:"object",code(t){const{gen:e,schema:r,data:n,parentSchema:s,it:i}=t,{opts:a}=i,l=(0,ii.allSchemaProperties)(r),p=l.filter(S=>(0,oi.alwaysValidSchema)(i,r[S]));if(l.length===0||p.length===l.length&&(!i.opts.unevaluated||i.props===!0))return;const u=a.strictSchema&&!a.allowMatchingProperties&&s.properties,f=e.name("valid");i.props!==!0&&!(i.props instanceof Nr.Name)&&(i.props=(0,ai.evaluatedPropsToName)(e,i.props));const{props:y}=i;k();function k(){for(const S of l)u&&R(S),i.allErrors?w(S):(e.var(f,!0),w(S),e.if(f))}function R(S){for(const _ in u)new RegExp(S).test(_)&&(0,oi.checkStrictMode)(i,`property ${_} matches pattern ${S} (use allowMatchingProperties)`)}function w(S){e.forIn("key",n,_=>{e.if((0,Nr._)`${(0,ii.usePattern)(t,S)}.test(${_})`,()=>{const g=p.includes(S);g||t.subschema({keyword:"patternProperties",schemaProp:S,dataProp:_,dataPropType:ai.Type.Str},f),i.opts.unevaluated&&y!==!0?e.assign((0,Nr._)`${y}[${_}]`,!0):!g&&!i.allErrors&&e.if((0,Nr.not)(f),()=>e.break())})})}}};ps.default=Gu;var fs={};Object.defineProperty(fs,"__esModule",{value:!0});const Ku=re,Ju={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){const{gen:e,schema:r,it:n}=t;if((0,Ku.alwaysValidSchema)(n,r)){t.fail();return}const s=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),t.failResult(s,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};fs.default=Ju;var hs={};Object.defineProperty(hs,"__esModule",{value:!0});const Yu=B,Qu={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Yu.validateUnion,error:{message:"must match a schema in anyOf"}};hs.default=Qu;var ms={};Object.defineProperty(ms,"__esModule",{value:!0});const qr=G,Zu=re,Xu={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,qr._)`{passingSchemas: ${t.passing}}`},ed={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Xu,code(t){const{gen:e,schema:r,parentSchema:n,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;const i=r,a=e.let("valid",!1),l=e.let("passing",null),p=e.name("_valid");t.setParams({passing:l}),e.block(u),t.result(a,()=>t.reset(),()=>t.error(!0));function u(){i.forEach((f,y)=>{let k;(0,Zu.alwaysValidSchema)(s,f)?e.var(p,!0):k=t.subschema({keyword:"oneOf",schemaProp:y,compositeRule:!0},p),y>0&&e.if((0,qr._)`${p} && ${a}`).assign(a,!1).assign(l,(0,qr._)`[${l}, ${y}]`).else(),e.if(p,()=>{e.assign(a,!0),e.assign(l,y),k&&t.mergeEvaluated(k,qr.Name)})})}}};ms.default=ed;var ys={};Object.defineProperty(ys,"__esModule",{value:!0});const td=re,rd={keyword:"allOf",schemaType:"array",code(t){const{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");const s=e.name("valid");r.forEach((i,a)=>{if((0,td.alwaysValidSchema)(n,i))return;const l=t.subschema({keyword:"allOf",schemaProp:a},s);t.ok(s),t.mergeEvaluated(l)})}};ys.default=rd;var gs={};Object.defineProperty(gs,"__esModule",{value:!0});const Vr=G,Lo=re,nd={message:({params:t})=>(0,Vr.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Vr._)`{failingKeyword: ${t.ifClause}}`},sd={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:nd,code(t){const{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,Lo.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const s=ci(n,"then"),i=ci(n,"else");if(!s&&!i)return;const a=e.let("valid",!0),l=e.name("_valid");if(p(),t.reset(),s&&i){const f=e.let("ifClause");t.setParams({ifClause:f}),e.if(l,u("then",f),u("else",f))}else s?e.if(l,u("then")):e.if((0,Vr.not)(l),u("else"));t.pass(a,()=>t.error(!0));function p(){const f=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);t.mergeEvaluated(f)}function u(f,y){return()=>{const k=t.subschema({keyword:f},l);e.assign(a,l),t.mergeValidEvaluated(k,a),y?e.assign(y,(0,Vr._)`${f}`):t.setParams({ifClause:f})}}}};function ci(t,e){const r=t.schema[e];return r!==void 0&&!(0,Lo.alwaysValidSchema)(t,r)}gs.default=sd;var $s={};Object.defineProperty($s,"__esModule",{value:!0});const id=re,od={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,id.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};$s.default=od;Object.defineProperty(os,"__esModule",{value:!0});const ad=Kt,cd=as,ld=Jt,ud=cs,dd=ls,pd=Mo,fd=us,hd=pn,md=ds,yd=ps,gd=fs,$d=hs,_d=ms,wd=ys,vd=gs,bd=$s;function Pd(t=!1){const e=[gd.default,$d.default,_d.default,wd.default,vd.default,bd.default,fd.default,hd.default,pd.default,md.default,yd.default];return t?e.push(cd.default,ud.default):e.push(ad.default,ld.default),e.push(dd.default),e}os.default=Pd;var _s={},ws={};Object.defineProperty(ws,"__esModule",{value:!0});const fe=G,Ed={message:({schemaCode:t})=>(0,fe.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,fe._)`{format: ${t}}`},Sd={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Ed,code(t,e){const{gen:r,data:n,$data:s,schema:i,schemaCode:a,it:l}=t,{opts:p,errSchemaPath:u,schemaEnv:f,self:y}=l;if(!p.validateFormats)return;s?k():R();function k(){const w=r.scopeValue("formats",{ref:y.formats,code:p.code.formats}),S=r.const("fDef",(0,fe._)`${w}[${a}]`),_=r.let("fType"),g=r.let("format");r.if((0,fe._)`typeof ${S} == "object" && !(${S} instanceof RegExp)`,()=>r.assign(_,(0,fe._)`${S}.type || "string"`).assign(g,(0,fe._)`${S}.validate`),()=>r.assign(_,(0,fe._)`"string"`).assign(g,S)),t.fail$data((0,fe.or)(T(),O()));function T(){return p.strictSchema===!1?fe.nil:(0,fe._)`${a} && !${g}`}function O(){const j=f.$async?(0,fe._)`(${S}.async ? await ${g}(${n}) : ${g}(${n}))`:(0,fe._)`${g}(${n})`,A=(0,fe._)`(typeof ${g} == "function" ? ${j} : ${g}.test(${n}))`;return(0,fe._)`${g} && ${g} !== true && ${_} === ${e} && !${A}`}}function R(){const w=y.formats[i];if(!w){T();return}if(w===!0)return;const[S,_,g]=O(w);S===e&&t.pass(j());function T(){if(p.strictSchema===!1){y.logger.warn(A());return}throw new Error(A());function A(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function O(A){const v=A instanceof RegExp?(0,fe.regexpCode)(A):p.code.formats?(0,fe._)`${p.code.formats}${(0,fe.getProperty)(i)}`:void 0,C=r.scopeValue("formats",{key:i,ref:A,code:v});return typeof A=="object"&&!(A instanceof RegExp)?[A.type||"string",A.validate,(0,fe._)`${C}.validate`]:["string",A,C]}function j(){if(typeof w=="object"&&!(w instanceof RegExp)&&w.async){if(!f.$async)throw new Error("async format in sync schema");return(0,fe._)`await ${g}(${n})`}return typeof _=="function"?(0,fe._)`${g}(${n})`:(0,fe._)`${g}.test(${n})`}}}};ws.default=Sd;Object.defineProperty(_s,"__esModule",{value:!0});const Td=ws,kd=[Td.default];_s.default=kd;var Gt={};Object.defineProperty(Gt,"__esModule",{value:!0});Gt.contentVocabulary=Gt.metadataVocabulary=void 0;Gt.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Gt.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(xn,"__esModule",{value:!0});const Rd=Bn,Od=Kn,Cd=os,Nd=_s,li=Gt,jd=[Rd.default,Od.default,(0,Cd.default)(),Nd.default,li.metadataVocabulary,li.contentVocabulary];xn.default=jd;var vs={},Ho={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(t.DiscrError||(t.DiscrError={}))})(Ho);Object.defineProperty(vs,"__esModule",{value:!0});const Ft=G,Rn=Ho,ui=Se,Id=re,Dd={message:({params:{discrError:t,tagName:e}})=>t===Rn.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Ft._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},Ad={keyword:"discriminator",type:"object",schemaType:"object",error:Dd,code(t){const{gen:e,data:r,schema:n,parentSchema:s,it:i}=t,{oneOf:a}=s;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");const l=n.propertyName;if(typeof l!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");const p=e.let("valid",!1),u=e.const("tag",(0,Ft._)`${r}${(0,Ft.getProperty)(l)}`);e.if((0,Ft._)`typeof ${u} == "string"`,()=>f(),()=>t.error(!1,{discrError:Rn.DiscrError.Tag,tag:u,tagName:l})),t.ok(p);function f(){const R=k();e.if(!1);for(const w in R)e.elseIf((0,Ft._)`${u} === ${w}`),e.assign(p,y(R[w]));e.else(),t.error(!1,{discrError:Rn.DiscrError.Mapping,tag:u,tagName:l}),e.endIf()}function y(R){const w=e.name("valid"),S=t.subschema({keyword:"oneOf",schemaProp:R},w);return t.mergeEvaluated(S,Ft.Name),w}function k(){var R;const w={},S=g(s);let _=!0;for(let j=0;j<a.length;j++){let A=a[j];A!=null&&A.$ref&&!(0,Id.schemaHasRulesButRef)(A,i.self.RULES)&&(A=ui.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,A==null?void 0:A.$ref),A instanceof ui.SchemaEnv&&(A=A.schema));const v=(R=A==null?void 0:A.properties)===null||R===void 0?void 0:R[l];if(typeof v!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);_=_&&(S||g(A)),T(v,j)}if(!_)throw new Error(`discriminator: "${l}" must be required`);return w;function g({required:j}){return Array.isArray(j)&&j.includes(l)}function T(j,A){if(j.const)O(j.const,A);else if(j.enum)for(const v of j.enum)O(v,A);else throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`)}function O(j,A){if(typeof j!="string"||j in w)throw new Error(`discriminator: "${l}" values must be unique strings`);w[j]=A}}}};vs.default=Ad;const Fd="http://json-schema.org/draft-07/schema#",qd="http://json-schema.org/draft-07/schema#",Md="Core schema meta-schema",Ud={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Ld=["object","boolean"],Hd={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},zd={$schema:Fd,$id:qd,title:Md,definitions:Ud,type:Ld,properties:Hd,default:!0};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;const r=oo,n=xn,s=vs,i=zd,a=["/properties"],l="http://json-schema.org/draft-07/schema";class p extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(w=>this.addVocabulary(w)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const w=this.opts.$data?this.$dataMetaSchema(i,a):i;this.addMetaSchema(w,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.exports=e=p,Object.defineProperty(e,"__esModule",{value:!0}),e.default=p;var u=De;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var f=G;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});var y=wr;Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return y.default}});var k=vr;Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return k.default}})})(bn,bn.exports);var Vd=bn.exports;const Wd=Za(Vd),xd="http://json-schema.org/schema",Bd="#/definitions/Blueprint",Gd={Blueprint:{type:"object",properties:{landingPage:{type:"string",description:"The URL to navigate to after the blueprint has been run."},description:{type:"string",description:"Optional description. It doesn't do anything but is exposed as a courtesy to developers who may want to document which blueprint file does what."},preferredVersions:{type:"object",properties:{php:{anyOf:[{$ref:"#/definitions/SupportedPHPVersion"},{type:"string",const:"latest"}],description:"The preferred PHP version to use. If not specified, the latest supported version will be used"},wp:{type:"string",description:"The preferred WordPress version to use. If not specified, the latest supported version will be used"}},required:["php","wp"],additionalProperties:!1,description:"The preferred PHP and WordPress versions to use."},features:{type:"object",properties:{networking:{type:"boolean",description:"Should boot with support for network request via wp_safe_remote_get?"}},additionalProperties:!1},constants:{type:"object",additionalProperties:{type:"string"},description:"PHP Constants to define on every request",deprecated:"This experimental option will change without warning.\nUse `steps` instead."},plugins:{type:"array",items:{anyOf:[{type:"string"},{$ref:"#/definitions/FileReference"}]},description:"WordPress plugins to install and activate",deprecated:"This experimental option will change without warning.\nUse `steps` instead."},siteOptions:{type:"object",additionalProperties:{type:"string"},properties:{blogname:{type:"string",description:"The site title"}},description:"WordPress site options to define",deprecated:"This experimental option will change without warning.\nUse `steps` instead."},login:{anyOf:[{type:"boolean"},{type:"object",properties:{username:{type:"string"},password:{type:"string"}},required:["username","password"],additionalProperties:!1}],description:"User to log in as. If true, logs the user in as admin/password."},phpExtensionBundles:{type:"array",items:{$ref:"#/definitions/SupportedPHPExtensionBundle"},description:"The PHP extensions to use."},steps:{type:"array",items:{anyOf:[{$ref:"#/definitions/StepDefinition"},{type:"string"},{not:{}},{type:"boolean",const:!1},{type:"null"}]},description:"The steps to run after every other operation in this Blueprint was executed."},$schema:{type:"string"}},additionalProperties:!1},SupportedPHPVersion:{type:"string",enum:["8.3","8.2","8.1","8.0","7.4","7.3","7.2","7.1","7.0"]},FileReference:{anyOf:[{$ref:"#/definitions/VFSReference"},{$ref:"#/definitions/LiteralReference"},{$ref:"#/definitions/CoreThemeReference"},{$ref:"#/definitions/CorePluginReference"},{$ref:"#/definitions/UrlReference"}]},VFSReference:{type:"object",properties:{resource:{type:"string",const:"vfs",description:"Identifies the file resource as Virtual File System (VFS)"},path:{type:"string",description:"The path to the file in the VFS"}},required:["resource","path"],additionalProperties:!1},LiteralReference:{type:"object",properties:{resource:{type:"string",const:"literal",description:"Identifies the file resource as a literal file"},name:{type:"string",description:"The name of the file"},contents:{anyOf:[{type:"string"},{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}}],description:"The contents of the file"}},required:["resource","name","contents"],additionalProperties:!1},CoreThemeReference:{type:"object",properties:{resource:{type:"string",const:"wordpress.org/themes",description:"Identifies the file resource as a WordPress Core theme"},slug:{type:"string",description:"The slug of the WordPress Core theme"}},required:["resource","slug"],additionalProperties:!1},CorePluginReference:{type:"object",properties:{resource:{type:"string",const:"wordpress.org/plugins",description:"Identifies the file resource as a WordPress Core plugin"},slug:{type:"string",description:"The slug of the WordPress Core plugin"}},required:["resource","slug"],additionalProperties:!1},UrlReference:{type:"object",properties:{resource:{type:"string",const:"url",description:"Identifies the file resource as a URL"},url:{type:"string",description:"The URL of the file"},caption:{type:"string",description:"Optional caption for displaying a progress message"}},required:["resource","url"],additionalProperties:!1},SupportedPHPExtensionBundle:{type:"string",const:"kitchen-sink"},StepDefinition:{type:"object",discriminator:{propertyName:"step"},required:["step"],oneOf:[{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"activatePlugin"},pluginPath:{type:"string",description:"Path to the plugin directory as absolute path (/wordpress/wp-content/plugins/plugin-name); or the plugin entry file relative to the plugins directory (plugin-name/plugin-name.php)."},pluginName:{type:"string",description:"Optional. Plugin name to display in the progress bar."}},required:["pluginPath","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"activateTheme"},themeFolderName:{type:"string",description:"The name of the theme folder inside wp-content/themes/"}},required:["step","themeFolderName"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"applyWordPressPatches"},siteUrl:{type:"string"},wordpressPath:{type:"string"},addPhpInfo:{type:"boolean"},patchSecrets:{type:"boolean"},disableSiteHealth:{type:"boolean"},disableWpNewBlogNotification:{type:"boolean"},makeEditorFrameControlled:{type:"boolean"},prepareForRunningInsideWebBrowser:{type:"boolean"},addFetchNetworkTransport:{type:"boolean"}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"cp"},fromPath:{type:"string",description:"Source path"},toPath:{type:"string",description:"Target path"}},required:["fromPath","step","toPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"defineWpConfigConsts"},consts:{type:"object",additionalProperties:{},description:"The constants to define"},method:{type:"string",enum:["rewrite-wp-config","define-before-run"],description:`The method of defining the constants. Possible values are:
858
+ deps: ${f}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(p){const[u,f]=i(p);a(p,u),l(p,f)}};function i({schema:p}){const u={},f={};for(const y in p){if(y==="__proto__")continue;const k=Array.isArray(p[y])?u:f;k[y]=p[y]}return[u,f]}function a(p,u=p.schema){const{gen:f,data:y,it:k}=p;if(Object.keys(u).length===0)return;const R=f.let("missing");for(const v in u){const S=u[v];if(S.length===0)continue;const _=(0,n.propertyInData)(f,y,v,k.opts.ownProperties);p.setParams({property:v,depsCount:S.length,deps:S.join(", ")}),k.allErrors?f.if(_,()=>{for(const g of S)(0,n.checkReportMissingProp)(p,g)}):(f.if((0,e._)`${_} && (${(0,n.checkMissingProp)(p,S,R)})`),(0,n.reportMissingProp)(p,R),f.else())}}t.validatePropertyDeps=a;function l(p,u=p.schema){const{gen:f,data:y,keyword:k,it:R}=p,v=f.name("valid");for(const S in u)(0,r.alwaysValidSchema)(R,u[S])||(f.if((0,n.propertyInData)(f,y,S,R.opts.ownProperties),()=>{const _=p.subschema({keyword:k,schemaProp:S},v);p.mergeValidEvaluated(_,v)},()=>f.var(v,!0)),p.ok(v))}t.validateSchemaDeps=l,t.default=s})(qo);var us={};Object.defineProperty(us,"__esModule",{value:!0});const Mo=G,qu=re,Mu={message:"property name must be valid",params:({params:t})=>(0,Mo._)`{propertyName: ${t.propertyName}}`},Uu={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Mu,code(t){const{gen:e,schema:r,data:n,it:s}=t;if((0,qu.alwaysValidSchema)(s,r))return;const i=e.name("valid");e.forIn("key",n,a=>{t.setParams({propertyName:a}),t.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},i),e.if((0,Mo.not)(i),()=>{t.error(!0),s.allErrors||e.break()})}),t.ok(i)}};us.default=Uu;var dn={};Object.defineProperty(dn,"__esModule",{value:!0});const Or=B,je=G,Lu=Ke,Nr=re,Hu={message:"must NOT have additional properties",params:({params:t})=>(0,je._)`{additionalProperty: ${t.additionalProperty}}`},zu={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Hu,code(t){const{gen:e,schema:r,parentSchema:n,data:s,errsCount:i,it:a}=t;if(!i)throw new Error("ajv implementation error");const{allErrors:l,opts:p}=a;if(a.props=!0,p.removeAdditional!=="all"&&(0,Nr.alwaysValidSchema)(a,r))return;const u=(0,Or.allSchemaProperties)(n.properties),f=(0,Or.allSchemaProperties)(n.patternProperties);y(),t.ok((0,je._)`${i} === ${Lu.default.errors}`);function y(){e.forIn("key",s,_=>{!u.length&&!f.length?v(_):e.if(k(_),()=>v(_))})}function k(_){let g;if(u.length>8){const T=(0,Nr.schemaRefOrVal)(a,n.properties,"properties");g=(0,Or.isOwnProperty)(e,T,_)}else u.length?g=(0,je.or)(...u.map(T=>(0,je._)`${_} === ${T}`)):g=je.nil;return f.length&&(g=(0,je.or)(g,...f.map(T=>(0,je._)`${(0,Or.usePattern)(t,T)}.test(${_})`))),(0,je.not)(g)}function R(_){e.code((0,je._)`delete ${s}[${_}]`)}function v(_){if(p.removeAdditional==="all"||p.removeAdditional&&r===!1){R(_);return}if(r===!1){t.setParams({additionalProperty:_}),t.error(),l||e.break();return}if(typeof r=="object"&&!(0,Nr.alwaysValidSchema)(a,r)){const g=e.name("valid");p.removeAdditional==="failing"?(S(_,g,!1),e.if((0,je.not)(g),()=>{t.reset(),R(_)})):(S(_,g),l||e.if((0,je.not)(g),()=>e.break()))}}function S(_,g,T){const O={keyword:"additionalProperties",dataProp:_,dataPropType:Nr.Type.Str};T===!1&&Object.assign(O,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(O,g)}}};dn.default=zu;var ds={};Object.defineProperty(ds,"__esModule",{value:!0});const Vu=De,ni=B,vn=re,si=dn,Wu={keyword:"properties",type:"object",schemaType:"object",code(t){const{gen:e,schema:r,parentSchema:n,data:s,it:i}=t;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&si.default.code(new Vu.KeywordCxt(i,si.default,"additionalProperties"));const a=(0,ni.allSchemaProperties)(r);for(const y of a)i.definedProperties.add(y);i.opts.unevaluated&&a.length&&i.props!==!0&&(i.props=vn.mergeEvaluated.props(e,(0,vn.toHash)(a),i.props));const l=a.filter(y=>!(0,vn.alwaysValidSchema)(i,r[y]));if(l.length===0)return;const p=e.name("valid");for(const y of l)u(y)?f(y):(e.if((0,ni.propertyInData)(e,s,y,i.opts.ownProperties)),f(y),i.allErrors||e.else().var(p,!0),e.endIf()),t.it.definedProperties.add(y),t.ok(p);function u(y){return i.opts.useDefaults&&!i.compositeRule&&r[y].default!==void 0}function f(y){t.subschema({keyword:"properties",schemaProp:y,dataProp:y},p)}}};ds.default=Wu;var ps={};Object.defineProperty(ps,"__esModule",{value:!0});const ii=B,Cr=G,oi=re,ai=re,xu={keyword:"patternProperties",type:"object",schemaType:"object",code(t){const{gen:e,schema:r,data:n,parentSchema:s,it:i}=t,{opts:a}=i,l=(0,ii.allSchemaProperties)(r),p=l.filter(S=>(0,oi.alwaysValidSchema)(i,r[S]));if(l.length===0||p.length===l.length&&(!i.opts.unevaluated||i.props===!0))return;const u=a.strictSchema&&!a.allowMatchingProperties&&s.properties,f=e.name("valid");i.props!==!0&&!(i.props instanceof Cr.Name)&&(i.props=(0,ai.evaluatedPropsToName)(e,i.props));const{props:y}=i;k();function k(){for(const S of l)u&&R(S),i.allErrors?v(S):(e.var(f,!0),v(S),e.if(f))}function R(S){for(const _ in u)new RegExp(S).test(_)&&(0,oi.checkStrictMode)(i,`property ${_} matches pattern ${S} (use allowMatchingProperties)`)}function v(S){e.forIn("key",n,_=>{e.if((0,Cr._)`${(0,ii.usePattern)(t,S)}.test(${_})`,()=>{const g=p.includes(S);g||t.subschema({keyword:"patternProperties",schemaProp:S,dataProp:_,dataPropType:ai.Type.Str},f),i.opts.unevaluated&&y!==!0?e.assign((0,Cr._)`${y}[${_}]`,!0):!g&&!i.allErrors&&e.if((0,Cr.not)(f),()=>e.break())})})}}};ps.default=xu;var fs={};Object.defineProperty(fs,"__esModule",{value:!0});const Bu=re,Gu={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){const{gen:e,schema:r,it:n}=t;if((0,Bu.alwaysValidSchema)(n,r)){t.fail();return}const s=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),t.failResult(s,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};fs.default=Gu;var hs={};Object.defineProperty(hs,"__esModule",{value:!0});const Ku=B,Ju={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Ku.validateUnion,error:{message:"must match a schema in anyOf"}};hs.default=Ju;var ms={};Object.defineProperty(ms,"__esModule",{value:!0});const Fr=G,Yu=re,Qu={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Fr._)`{passingSchemas: ${t.passing}}`},Zu={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Qu,code(t){const{gen:e,schema:r,parentSchema:n,it:s}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;const i=r,a=e.let("valid",!1),l=e.let("passing",null),p=e.name("_valid");t.setParams({passing:l}),e.block(u),t.result(a,()=>t.reset(),()=>t.error(!0));function u(){i.forEach((f,y)=>{let k;(0,Yu.alwaysValidSchema)(s,f)?e.var(p,!0):k=t.subschema({keyword:"oneOf",schemaProp:y,compositeRule:!0},p),y>0&&e.if((0,Fr._)`${p} && ${a}`).assign(a,!1).assign(l,(0,Fr._)`[${l}, ${y}]`).else(),e.if(p,()=>{e.assign(a,!0),e.assign(l,y),k&&t.mergeEvaluated(k,Fr.Name)})})}}};ms.default=Zu;var ys={};Object.defineProperty(ys,"__esModule",{value:!0});const Xu=re,ed={keyword:"allOf",schemaType:"array",code(t){const{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");const s=e.name("valid");r.forEach((i,a)=>{if((0,Xu.alwaysValidSchema)(n,i))return;const l=t.subschema({keyword:"allOf",schemaProp:a},s);t.ok(s),t.mergeEvaluated(l)})}};ys.default=ed;var gs={};Object.defineProperty(gs,"__esModule",{value:!0});const zr=G,Uo=re,td={message:({params:t})=>(0,zr.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,zr._)`{failingKeyword: ${t.ifClause}}`},rd={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:td,code(t){const{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,Uo.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const s=ci(n,"then"),i=ci(n,"else");if(!s&&!i)return;const a=e.let("valid",!0),l=e.name("_valid");if(p(),t.reset(),s&&i){const f=e.let("ifClause");t.setParams({ifClause:f}),e.if(l,u("then",f),u("else",f))}else s?e.if(l,u("then")):e.if((0,zr.not)(l),u("else"));t.pass(a,()=>t.error(!0));function p(){const f=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);t.mergeEvaluated(f)}function u(f,y){return()=>{const k=t.subschema({keyword:f},l);e.assign(a,l),t.mergeValidEvaluated(k,a),y?e.assign(y,(0,zr._)`${f}`):t.setParams({ifClause:f})}}}};function ci(t,e){const r=t.schema[e];return r!==void 0&&!(0,Uo.alwaysValidSchema)(t,r)}gs.default=rd;var $s={};Object.defineProperty($s,"__esModule",{value:!0});const nd=re,sd={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,nd.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};$s.default=sd;Object.defineProperty(os,"__esModule",{value:!0});const id=Kt,od=as,ad=Jt,cd=cs,ld=ls,ud=qo,dd=us,pd=dn,fd=ds,hd=ps,md=fs,yd=hs,gd=ms,$d=ys,_d=gs,vd=$s;function wd(t=!1){const e=[md.default,yd.default,gd.default,$d.default,_d.default,vd.default,dd.default,pd.default,ud.default,fd.default,hd.default];return t?e.push(od.default,cd.default):e.push(id.default,ad.default),e.push(ld.default),e}os.default=wd;var _s={},vs={};Object.defineProperty(vs,"__esModule",{value:!0});const fe=G,bd={message:({schemaCode:t})=>(0,fe.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,fe._)`{format: ${t}}`},Pd={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:bd,code(t,e){const{gen:r,data:n,$data:s,schema:i,schemaCode:a,it:l}=t,{opts:p,errSchemaPath:u,schemaEnv:f,self:y}=l;if(!p.validateFormats)return;s?k():R();function k(){const v=r.scopeValue("formats",{ref:y.formats,code:p.code.formats}),S=r.const("fDef",(0,fe._)`${v}[${a}]`),_=r.let("fType"),g=r.let("format");r.if((0,fe._)`typeof ${S} == "object" && !(${S} instanceof RegExp)`,()=>r.assign(_,(0,fe._)`${S}.type || "string"`).assign(g,(0,fe._)`${S}.validate`),()=>r.assign(_,(0,fe._)`"string"`).assign(g,S)),t.fail$data((0,fe.or)(T(),O()));function T(){return p.strictSchema===!1?fe.nil:(0,fe._)`${a} && !${g}`}function O(){const j=f.$async?(0,fe._)`(${S}.async ? await ${g}(${n}) : ${g}(${n}))`:(0,fe._)`${g}(${n})`,A=(0,fe._)`(typeof ${g} == "function" ? ${j} : ${g}.test(${n}))`;return(0,fe._)`${g} && ${g} !== true && ${_} === ${e} && !${A}`}}function R(){const v=y.formats[i];if(!v){T();return}if(v===!0)return;const[S,_,g]=O(v);S===e&&t.pass(j());function T(){if(p.strictSchema===!1){y.logger.warn(A());return}throw new Error(A());function A(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function O(A){const w=A instanceof RegExp?(0,fe.regexpCode)(A):p.code.formats?(0,fe._)`${p.code.formats}${(0,fe.getProperty)(i)}`:void 0,N=r.scopeValue("formats",{key:i,ref:A,code:w});return typeof A=="object"&&!(A instanceof RegExp)?[A.type||"string",A.validate,(0,fe._)`${N}.validate`]:["string",A,N]}function j(){if(typeof v=="object"&&!(v instanceof RegExp)&&v.async){if(!f.$async)throw new Error("async format in sync schema");return(0,fe._)`await ${g}(${n})`}return typeof _=="function"?(0,fe._)`${g}(${n})`:(0,fe._)`${g}.test(${n})`}}}};vs.default=Pd;Object.defineProperty(_s,"__esModule",{value:!0});const Ed=vs,Sd=[Ed.default];_s.default=Sd;var Gt={};Object.defineProperty(Gt,"__esModule",{value:!0});Gt.contentVocabulary=Gt.metadataVocabulary=void 0;Gt.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Gt.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(xn,"__esModule",{value:!0});const Td=Bn,kd=Kn,Rd=os,Od=_s,li=Gt,Nd=[Td.default,kd.default,(0,Rd.default)(),Od.default,li.metadataVocabulary,li.contentVocabulary];xn.default=Nd;var ws={},Lo={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(t.DiscrError||(t.DiscrError={}))})(Lo);Object.defineProperty(ws,"__esModule",{value:!0});const Ft=G,Rn=Lo,ui=Se,Cd=re,jd={message:({params:{discrError:t,tagName:e}})=>t===Rn.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Ft._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},Id={keyword:"discriminator",type:"object",schemaType:"object",error:jd,code(t){const{gen:e,data:r,schema:n,parentSchema:s,it:i}=t,{oneOf:a}=s;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");const l=n.propertyName;if(typeof l!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");const p=e.let("valid",!1),u=e.const("tag",(0,Ft._)`${r}${(0,Ft.getProperty)(l)}`);e.if((0,Ft._)`typeof ${u} == "string"`,()=>f(),()=>t.error(!1,{discrError:Rn.DiscrError.Tag,tag:u,tagName:l})),t.ok(p);function f(){const R=k();e.if(!1);for(const v in R)e.elseIf((0,Ft._)`${u} === ${v}`),e.assign(p,y(R[v]));e.else(),t.error(!1,{discrError:Rn.DiscrError.Mapping,tag:u,tagName:l}),e.endIf()}function y(R){const v=e.name("valid"),S=t.subschema({keyword:"oneOf",schemaProp:R},v);return t.mergeEvaluated(S,Ft.Name),v}function k(){var R;const v={},S=g(s);let _=!0;for(let j=0;j<a.length;j++){let A=a[j];A!=null&&A.$ref&&!(0,Cd.schemaHasRulesButRef)(A,i.self.RULES)&&(A=ui.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,A==null?void 0:A.$ref),A instanceof ui.SchemaEnv&&(A=A.schema));const w=(R=A==null?void 0:A.properties)===null||R===void 0?void 0:R[l];if(typeof w!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);_=_&&(S||g(A)),T(w,j)}if(!_)throw new Error(`discriminator: "${l}" must be required`);return v;function g({required:j}){return Array.isArray(j)&&j.includes(l)}function T(j,A){if(j.const)O(j.const,A);else if(j.enum)for(const w of j.enum)O(w,A);else throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`)}function O(j,A){if(typeof j!="string"||j in v)throw new Error(`discriminator: "${l}" values must be unique strings`);v[j]=A}}}};ws.default=Id;const Dd="http://json-schema.org/draft-07/schema#",Ad="http://json-schema.org/draft-07/schema#",Fd="Core schema meta-schema",qd={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Md=["object","boolean"],Ud={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},Ld={$schema:Dd,$id:Ad,title:Fd,definitions:qd,type:Md,properties:Ud,default:!0};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;const r=io,n=xn,s=ws,i=Ld,a=["/properties"],l="http://json-schema.org/draft-07/schema";class p extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(v=>this.addVocabulary(v)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const v=this.opts.$data?this.$dataMetaSchema(i,a):i;this.addMetaSchema(v,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.exports=e=p,Object.defineProperty(e,"__esModule",{value:!0}),e.default=p;var u=De;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var f=G;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});var y=vr;Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return y.default}});var k=wr;Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return k.default}})})(bn,bn.exports);var Hd=bn.exports;const zd=Ya(Hd),Vd="http://json-schema.org/schema",Wd="#/definitions/Blueprint",xd={Blueprint:{type:"object",properties:{landingPage:{type:"string",description:"The URL to navigate to after the blueprint has been run."},description:{type:"string",description:"Optional description. It doesn't do anything but is exposed as a courtesy to developers who may want to document which blueprint file does what."},preferredVersions:{type:"object",properties:{php:{anyOf:[{$ref:"#/definitions/SupportedPHPVersion"},{type:"string",const:"latest"}],description:"The preferred PHP version to use. If not specified, the latest supported version will be used"},wp:{type:"string",description:"The preferred WordPress version to use. If not specified, the latest supported version will be used"}},required:["php","wp"],additionalProperties:!1,description:"The preferred PHP and WordPress versions to use."},features:{type:"object",properties:{networking:{type:"boolean",description:"Should boot with support for network request via wp_safe_remote_get?"}},additionalProperties:!1},constants:{type:"object",additionalProperties:{type:"string"},description:"PHP Constants to define on every request",deprecated:"This experimental option will change without warning.\nUse `steps` instead."},plugins:{type:"array",items:{anyOf:[{type:"string"},{$ref:"#/definitions/FileReference"}]},description:"WordPress plugins to install and activate",deprecated:"This experimental option will change without warning.\nUse `steps` instead."},siteOptions:{type:"object",additionalProperties:{type:"string"},properties:{blogname:{type:"string",description:"The site title"}},description:"WordPress site options to define",deprecated:"This experimental option will change without warning.\nUse `steps` instead."},login:{anyOf:[{type:"boolean"},{type:"object",properties:{username:{type:"string"},password:{type:"string"}},required:["username","password"],additionalProperties:!1}],description:"User to log in as. If true, logs the user in as admin/password."},phpExtensionBundles:{type:"array",items:{$ref:"#/definitions/SupportedPHPExtensionBundle"},description:"The PHP extensions to use."},steps:{type:"array",items:{anyOf:[{$ref:"#/definitions/StepDefinition"},{type:"string"},{not:{}},{type:"boolean",const:!1},{type:"null"}]},description:"The steps to run after every other operation in this Blueprint was executed."},$schema:{type:"string"}},additionalProperties:!1},SupportedPHPVersion:{type:"string",enum:["8.3","8.2","8.1","8.0","7.4","7.3","7.2","7.1","7.0"]},FileReference:{anyOf:[{$ref:"#/definitions/VFSReference"},{$ref:"#/definitions/LiteralReference"},{$ref:"#/definitions/CoreThemeReference"},{$ref:"#/definitions/CorePluginReference"},{$ref:"#/definitions/UrlReference"}]},VFSReference:{type:"object",properties:{resource:{type:"string",const:"vfs",description:"Identifies the file resource as Virtual File System (VFS)"},path:{type:"string",description:"The path to the file in the VFS"}},required:["resource","path"],additionalProperties:!1},LiteralReference:{type:"object",properties:{resource:{type:"string",const:"literal",description:"Identifies the file resource as a literal file"},name:{type:"string",description:"The name of the file"},contents:{anyOf:[{type:"string"},{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}}],description:"The contents of the file"}},required:["resource","name","contents"],additionalProperties:!1},CoreThemeReference:{type:"object",properties:{resource:{type:"string",const:"wordpress.org/themes",description:"Identifies the file resource as a WordPress Core theme"},slug:{type:"string",description:"The slug of the WordPress Core theme"}},required:["resource","slug"],additionalProperties:!1},CorePluginReference:{type:"object",properties:{resource:{type:"string",const:"wordpress.org/plugins",description:"Identifies the file resource as a WordPress Core plugin"},slug:{type:"string",description:"The slug of the WordPress Core plugin"}},required:["resource","slug"],additionalProperties:!1},UrlReference:{type:"object",properties:{resource:{type:"string",const:"url",description:"Identifies the file resource as a URL"},url:{type:"string",description:"The URL of the file"},caption:{type:"string",description:"Optional caption for displaying a progress message"}},required:["resource","url"],additionalProperties:!1},SupportedPHPExtensionBundle:{type:"string",const:"kitchen-sink"},StepDefinition:{type:"object",discriminator:{propertyName:"step"},required:["step"],oneOf:[{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"activatePlugin"},pluginPath:{type:"string",description:"Path to the plugin directory as absolute path (/wordpress/wp-content/plugins/plugin-name); or the plugin entry file relative to the plugins directory (plugin-name/plugin-name.php)."},pluginName:{type:"string",description:"Optional. Plugin name to display in the progress bar."}},required:["pluginPath","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"activateTheme"},themeFolderName:{type:"string",description:"The name of the theme folder inside wp-content/themes/"}},required:["step","themeFolderName"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"applyWordPressPatches"},siteUrl:{type:"string"},wordpressPath:{type:"string"},addPhpInfo:{type:"boolean"},patchSecrets:{type:"boolean"},disableSiteHealth:{type:"boolean"},disableWpNewBlogNotification:{type:"boolean"},prepareForRunningInsideWebBrowser:{type:"boolean"},addFetchNetworkTransport:{type:"boolean"}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"cp"},fromPath:{type:"string",description:"Source path"},toPath:{type:"string",description:"Target path"}},required:["fromPath","step","toPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"defineWpConfigConsts"},consts:{type:"object",additionalProperties:{},description:"The constants to define"},method:{type:"string",enum:["rewrite-wp-config","define-before-run"],description:`The method of defining the constants. Possible values are:
903
859
 
904
860
  - rewrite-wp-config: Default. Rewrites the wp-config.php file to explicitly call define() with the requested name and value. This method alters the file on the disk, but it doesn't conflict with existing define() calls in wp-config.php.
905
861
  - define-before-run: Defines the constant before running the requested script. It doesn't alter any files on the disk, but constants defined this way may conflict with existing define() calls in wp-config.php.`},virtualize:{type:"boolean",deprecated:`This option is noop and will be removed in a future version.
906
862
  This option is only kept in here to avoid breaking Blueprint schema validation
907
- for existing apps using this option.`}},required:["consts","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"defineSiteUrl"},siteUrl:{type:"string",description:"The URL"}},required:["siteUrl","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"importFile"},file:{$ref:"#/definitions/FileReference",description:"The file to import"}},required:["file","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"importWordPressFiles"},wordPressFilesZip:{$ref:"#/definitions/FileReference",description:"The zip file containing the top-level WordPress files and directories."},pathInZip:{type:"string",description:"The path inside the zip file where the WordPress files are."}},required:["step","wordPressFilesZip"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"installPlugin",description:"The step identifier."},pluginZipFile:{$ref:"#/definitions/FileReference",description:"The plugin zip file to install."},options:{$ref:"#/definitions/InstallPluginOptions",description:"Optional installation options."}},required:["pluginZipFile","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"installTheme",description:"The step identifier."},themeZipFile:{$ref:"#/definitions/FileReference",description:"The theme zip file to install."},options:{type:"object",properties:{activate:{type:"boolean",description:"Whether to activate the theme after installing it."}},additionalProperties:!1,description:"Optional installation options."}},required:["step","themeZipFile"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"login"},username:{type:"string",description:"The user to log in as. Defaults to 'admin'."},password:{type:"string",description:"The password to log in with. Defaults to 'password'."}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"mkdir"},path:{type:"string",description:"The path of the directory you want to create"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"mv"},fromPath:{type:"string",description:"Source path"},toPath:{type:"string",description:"Target path"}},required:["fromPath","step","toPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"request"},request:{$ref:"#/definitions/PHPRequest",description:"Request details (See /wordpress-playground/api/universal/interface/PHPRequest)"}},required:["request","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"rm"},path:{type:"string",description:"The path to remove"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"rmdir"},path:{type:"string",description:"The path to remove"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runPHP",description:"The step identifier."},code:{type:"string",description:"The PHP code to run."}},required:["code","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runPHPWithOptions"},options:{$ref:"#/definitions/PHPRunOptions",description:"Run options (See /wordpress-playground/api/universal/interface/PHPRunOptions)"}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runWpInstallationWizard"},options:{$ref:"#/definitions/WordPressInstallationOptions"}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runSql",description:"The step identifier."},sql:{$ref:"#/definitions/FileReference",description:"The SQL to run. Each non-empty line must contain a valid SQL query."}},required:["sql","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"setPhpIniEntry"},key:{type:"string",description:'Entry name e.g. "display_errors"'},value:{type:"string",description:'Entry value as a string e.g. "1"'}},required:["key","step","value"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"setSiteOptions",description:'The name of the step. Must be "setSiteOptions".'},options:{type:"object",additionalProperties:{},description:"The options to set on the site."}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"unzip"},zipPath:{type:"string",description:"The zip file to extract"},extractToPath:{type:"string",description:"The path to extract the zip file to"}},required:["extractToPath","step","zipPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"updateUserMeta"},meta:{type:"object",additionalProperties:{},description:'An object of user meta values to set, e.g. { "first_name": "John" }'},userId:{type:"number",description:"User ID"}},required:["meta","step","userId"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"writeFile"},path:{type:"string",description:"The path of the file to write to"},data:{anyOf:[{$ref:"#/definitions/FileReference"},{type:"string"},{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}}],description:"The data to write"}},required:["data","path","step"]}]},InstallPluginOptions:{type:"object",properties:{activate:{type:"boolean",description:"Whether to activate the plugin after installing it."}},additionalProperties:!1},PHPRequest:{type:"object",properties:{method:{$ref:"#/definitions/HTTPMethod",description:"Request method. Default: `GET`."},url:{type:"string",description:"Request path or absolute URL."},headers:{$ref:"#/definitions/PHPRequestHeaders",description:"Request headers."},files:{type:"object",additionalProperties:{type:"object",properties:{size:{type:"number"},type:{type:"string"},lastModified:{type:"number"},name:{type:"string"},webkitRelativePath:{type:"string"}},required:["lastModified","name","size","type","webkitRelativePath"],additionalProperties:!1},description:"Uploaded files"},body:{type:"string",description:"Request body without the files."},formData:{type:"object",additionalProperties:{},description:"Form data. If set, the request body will be ignored and the content-type header will be set to `application/x-www-form-urlencoded`."}},required:["url"],additionalProperties:!1},HTTPMethod:{type:"string",enum:["GET","POST","HEAD","OPTIONS","PATCH","PUT","DELETE"]},PHPRequestHeaders:{type:"object",additionalProperties:{type:"string"}},PHPRunOptions:{type:"object",properties:{relativeUri:{type:"string",description:"Request path following the domain:port part."},scriptPath:{type:"string",description:"Path of the .php file to execute."},protocol:{type:"string",description:"Request protocol."},method:{$ref:"#/definitions/HTTPMethod",description:"Request method. Default: `GET`."},headers:{$ref:"#/definitions/PHPRequestHeaders",description:"Request headers."},body:{type:"string",description:"Request body without the files."},fileInfos:{type:"array",items:{$ref:"#/definitions/FileInfo"},description:"Uploaded files."},code:{type:"string",description:"The code snippet to eval instead of a php file."}},additionalProperties:!1},FileInfo:{type:"object",properties:{key:{type:"string"},name:{type:"string"},type:{type:"string"},data:{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}}},required:["key","name","type","data"],additionalProperties:!1},WordPressInstallationOptions:{type:"object",properties:{adminUsername:{type:"string"},adminPassword:{type:"string"}},additionalProperties:!1}},Kd={$schema:xd,$ref:Bd,definitions:Gd};function Jd(t,{progress:e=new An,semaphore:r=new jn({concurrency:3}),onStepCompleted:n=()=>{}}={}){var u,f,y;if(t={...t,steps:(t.steps||[]).filter(ep)},t.constants&&t.steps.unshift({step:"defineWpConfigConsts",consts:t.constants}),t.siteOptions&&t.steps.unshift({step:"setSiteOptions",options:t.siteOptions}),t.plugins){const k=t.plugins.map(R=>typeof R=="string"?R.startsWith("https://")?{resource:"url",url:R}:{resource:"wordpress.org/plugins",slug:R}:R).map(R=>({step:"installPlugin",pluginZipFile:R}));t.steps.unshift(...k)}t.login&&t.steps.push({step:"login",...t.login===!0?{username:"admin",password:"password"}:t.login});const{valid:s,errors:i}=Qd(t);if(!s){const k=new Error(`Invalid blueprint: ${i[0].message} at ${i[0].instancePath}`);throw k.errors=i,k}const a=t.steps||[],l=a.reduce((k,R)=>{var w;return k+(((w=R.progress)==null?void 0:w.weight)||1)},0),p=a.map(k=>tp(k,{semaphore:r,rootProgressTracker:e,totalProgressWeight:l}));return{versions:{php:Zd((u=t.preferredVersions)==null?void 0:u.php,Li,Ta),wp:((f=t.preferredVersions)==null?void 0:f.wp)||"latest"},phpExtensions:Xd([],t.phpExtensionBundles||[]),features:{networking:((y=t.features)==null?void 0:y.networking)??!1},run:async k=>{try{for(const{resources:R}of p)for(const w of R)w.setPlayground(k),w.isAsync&&w.resolve();for(const{run:R,step:w}of p){const S=await R(k);n(S,w)}}finally{try{await k.goTo(t.landingPage||"/")}catch{}e.finish()}}}}const Yd=new Wd({discriminator:!0});let jr;function Qd(t){var s;jr=Yd.compile(Kd);const e=jr(t);if(e)return{valid:e};const r=new Set;for(const i of jr.errors)i.schemaPath.startsWith("#/properties/steps/items/anyOf")||r.add(i.instancePath);const n=(s=jr.errors)==null?void 0:s.filter(i=>!(i.schemaPath.startsWith("#/properties/steps/items/anyOf")&&r.has(i.instancePath)));return{valid:e,errors:n}}function Zd(t,e,r){return t&&e.includes(t)?t:r}function Xd(t,e){const r=Hi.filter(s=>t.includes(s)),n=e.flatMap(s=>s in Vs?Vs[s]:[]);return Array.from(new Set([...r,...n]))}function ep(t){return!!(typeof t=="object"&&t)}function tp(t,{semaphore:e,rootProgressTracker:r,totalProgressWeight:n}){var f;const s=r.stage((((f=t.progress)==null?void 0:f.weight)||1)/n),i={};for(const y of Object.keys(t)){let k=t[y];za(k)&&(k=Pt.create(k,{semaphore:e})),i[y]=k}const a=async y=>{var k;try{return s.fillSlowly(),await fa[t.step](y,await rp(i),{tracker:s,initialCaption:(k=t.progress)==null?void 0:k.caption})}finally{s.finish()}},l=di(i),p=di(i).filter(y=>y.isAsync),u=1/(p.length+1);for(const y of p)y.progress=s.stage(u);return{run:a,step:t,resources:l}}function di(t){const e=[];for(const r in t){const n=t[r];n instanceof Pt&&e.push(n)}return e}async function rp(t){const e={};for(const r in t){const n=t[r];n instanceof Pt?e[r]=await n.resolve():e[r]=n}return e}async function np(t,e){await t.run(e)}function sp(){}exports.activatePlugin=Cn;exports.activateTheme=Nn;exports.applyWordPressPatches=hi;exports.compileBlueprint=Jd;exports.cp=vi;exports.defineSiteUrl=Si;exports.defineWpConfigConsts=qt;exports.exportWXR=Oi;exports.exportWXZ=Ci;exports.importFile=Ti;exports.importWordPressFiles=Ri;exports.installPlugin=ji;exports.installTheme=Ii;exports.login=Di;exports.mkdir=Pi;exports.mv=bi;exports.request=wi;exports.rm=In;exports.rmdir=Ei;exports.runBlueprintSteps=np;exports.runPHP=yi;exports.runPHPWithOptions=gi;exports.runSql=$i;exports.runWpInstallationWizard=Ai;exports.setPhpIniEntry=_i;exports.setPluginProxyURL=sp;exports.setSiteOptions=Fi;exports.unzip=an;exports.updateUserMeta=qi;exports.wpContentFilesExcludedFromExport=On;exports.writeFile=Dn;exports.zipWpContent=Ui;
863
+ for existing apps using this option.`}},required:["consts","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"defineSiteUrl"},siteUrl:{type:"string",description:"The URL"}},required:["siteUrl","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"importFile"},file:{$ref:"#/definitions/FileReference",description:"The file to import"}},required:["file","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"importWordPressFiles"},wordPressFilesZip:{$ref:"#/definitions/FileReference",description:"The zip file containing the top-level WordPress files and directories."},pathInZip:{type:"string",description:"The path inside the zip file where the WordPress files are."}},required:["step","wordPressFilesZip"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"installPlugin",description:"The step identifier."},pluginZipFile:{$ref:"#/definitions/FileReference",description:"The plugin zip file to install."},options:{$ref:"#/definitions/InstallPluginOptions",description:"Optional installation options."}},required:["pluginZipFile","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"installTheme",description:"The step identifier."},themeZipFile:{$ref:"#/definitions/FileReference",description:"The theme zip file to install."},options:{type:"object",properties:{activate:{type:"boolean",description:"Whether to activate the theme after installing it."}},additionalProperties:!1,description:"Optional installation options."}},required:["step","themeZipFile"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"login"},username:{type:"string",description:"The user to log in as. Defaults to 'admin'."},password:{type:"string",description:"The password to log in with. Defaults to 'password'."}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"mkdir"},path:{type:"string",description:"The path of the directory you want to create"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"mv"},fromPath:{type:"string",description:"Source path"},toPath:{type:"string",description:"Target path"}},required:["fromPath","step","toPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"request"},request:{$ref:"#/definitions/PHPRequest",description:"Request details (See /wordpress-playground/api/universal/interface/PHPRequest)"}},required:["request","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"rm"},path:{type:"string",description:"The path to remove"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"rmdir"},path:{type:"string",description:"The path to remove"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runPHP",description:"The step identifier."},code:{type:"string",description:"The PHP code to run."}},required:["code","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runPHPWithOptions"},options:{$ref:"#/definitions/PHPRunOptions",description:"Run options (See /wordpress-playground/api/universal/interface/PHPRunOptions)"}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runWpInstallationWizard"},options:{$ref:"#/definitions/WordPressInstallationOptions"}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runSql",description:"The step identifier."},sql:{$ref:"#/definitions/FileReference",description:"The SQL to run. Each non-empty line must contain a valid SQL query."}},required:["sql","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"setPhpIniEntry"},key:{type:"string",description:'Entry name e.g. "display_errors"'},value:{type:"string",description:'Entry value as a string e.g. "1"'}},required:["key","step","value"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"setSiteOptions",description:'The name of the step. Must be "setSiteOptions".'},options:{type:"object",additionalProperties:{},description:"The options to set on the site."}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"unzip"},zipPath:{type:"string",description:"The zip file to extract"},extractToPath:{type:"string",description:"The path to extract the zip file to"}},required:["extractToPath","step","zipPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"updateUserMeta"},meta:{type:"object",additionalProperties:{},description:'An object of user meta values to set, e.g. { "first_name": "John" }'},userId:{type:"number",description:"User ID"}},required:["meta","step","userId"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"writeFile"},path:{type:"string",description:"The path of the file to write to"},data:{anyOf:[{$ref:"#/definitions/FileReference"},{type:"string"},{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}}],description:"The data to write"}},required:["data","path","step"]}]},InstallPluginOptions:{type:"object",properties:{activate:{type:"boolean",description:"Whether to activate the plugin after installing it."}},additionalProperties:!1},PHPRequest:{type:"object",properties:{method:{$ref:"#/definitions/HTTPMethod",description:"Request method. Default: `GET`."},url:{type:"string",description:"Request path or absolute URL."},headers:{$ref:"#/definitions/PHPRequestHeaders",description:"Request headers."},files:{type:"object",additionalProperties:{type:"object",properties:{size:{type:"number"},type:{type:"string"},lastModified:{type:"number"},name:{type:"string"},webkitRelativePath:{type:"string"}},required:["lastModified","name","size","type","webkitRelativePath"],additionalProperties:!1},description:"Uploaded files"},body:{type:"string",description:"Request body without the files."},formData:{type:"object",additionalProperties:{},description:"Form data. If set, the request body will be ignored and the content-type header will be set to `application/x-www-form-urlencoded`."}},required:["url"],additionalProperties:!1},HTTPMethod:{type:"string",enum:["GET","POST","HEAD","OPTIONS","PATCH","PUT","DELETE"]},PHPRequestHeaders:{type:"object",additionalProperties:{type:"string"}},PHPRunOptions:{type:"object",properties:{relativeUri:{type:"string",description:"Request path following the domain:port part."},scriptPath:{type:"string",description:"Path of the .php file to execute."},protocol:{type:"string",description:"Request protocol."},method:{$ref:"#/definitions/HTTPMethod",description:"Request method. Default: `GET`."},headers:{$ref:"#/definitions/PHPRequestHeaders",description:"Request headers."},body:{type:"string",description:"Request body without the files."},fileInfos:{type:"array",items:{$ref:"#/definitions/FileInfo"},description:"Uploaded files."},code:{type:"string",description:"The code snippet to eval instead of a php file."}},additionalProperties:!1},FileInfo:{type:"object",properties:{key:{type:"string"},name:{type:"string"},type:{type:"string"},data:{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}}},required:["key","name","type","data"],additionalProperties:!1},WordPressInstallationOptions:{type:"object",properties:{adminUsername:{type:"string"},adminPassword:{type:"string"}},additionalProperties:!1}},Bd={$schema:Vd,$ref:Wd,definitions:xd};function Gd(t,{progress:e=new An,semaphore:r=new jn({concurrency:3}),onStepCompleted:n=()=>{}}={}){var u,f,y;if(t={...t,steps:(t.steps||[]).filter(Zd)},t.constants&&t.steps.unshift({step:"defineWpConfigConsts",consts:t.constants}),t.siteOptions&&t.steps.unshift({step:"setSiteOptions",options:t.siteOptions}),t.plugins){const k=t.plugins.map(R=>typeof R=="string"?R.startsWith("https://")?{resource:"url",url:R}:{resource:"wordpress.org/plugins",slug:R}:R).map(R=>({step:"installPlugin",pluginZipFile:R}));t.steps.unshift(...k)}t.login&&t.steps.push({step:"login",...t.login===!0?{username:"admin",password:"password"}:t.login});const{valid:s,errors:i}=Jd(t);if(!s){const k=new Error(`Invalid blueprint: ${i[0].message} at ${i[0].instancePath}`);throw k.errors=i,k}const a=t.steps||[],l=a.reduce((k,R)=>{var v;return k+(((v=R.progress)==null?void 0:v.weight)||1)},0),p=a.map(k=>Xd(k,{semaphore:r,rootProgressTracker:e,totalProgressWeight:l}));return{versions:{php:Yd((u=t.preferredVersions)==null?void 0:u.php,Ui,Ea),wp:((f=t.preferredVersions)==null?void 0:f.wp)||"latest"},phpExtensions:Qd([],t.phpExtensionBundles||[]),features:{networking:((y=t.features)==null?void 0:y.networking)??!1},run:async k=>{try{for(const{resources:R}of p)for(const v of R)v.setPlayground(k),v.isAsync&&v.resolve();for(const{run:R,step:v}of p){const S=await R(k);n(S,v)}}finally{try{await k.goTo(t.landingPage||"/")}catch{}e.finish()}}}}const Kd=new zd({discriminator:!0});let jr;function Jd(t){var s;jr=Kd.compile(Bd);const e=jr(t);if(e)return{valid:e};const r=new Set;for(const i of jr.errors)i.schemaPath.startsWith("#/properties/steps/items/anyOf")||r.add(i.instancePath);const n=(s=jr.errors)==null?void 0:s.filter(i=>!(i.schemaPath.startsWith("#/properties/steps/items/anyOf")&&r.has(i.instancePath)));return{valid:e,errors:n}}function Yd(t,e,r){return t&&e.includes(t)?t:r}function Qd(t,e){const r=Li.filter(s=>t.includes(s)),n=e.flatMap(s=>s in Vs?Vs[s]:[]);return Array.from(new Set([...r,...n]))}function Zd(t){return!!(typeof t=="object"&&t)}function Xd(t,{semaphore:e,rootProgressTracker:r,totalProgressWeight:n}){var f;const s=r.stage((((f=t.progress)==null?void 0:f.weight)||1)/n),i={};for(const y of Object.keys(t)){let k=t[y];La(k)&&(k=Pt.create(k,{semaphore:e})),i[y]=k}const a=async y=>{var k;try{return s.fillSlowly(),await da[t.step](y,await ep(i),{tracker:s,initialCaption:(k=t.progress)==null?void 0:k.caption})}finally{s.finish()}},l=di(i),p=di(i).filter(y=>y.isAsync),u=1/(p.length+1);for(const y of p)y.progress=s.stage(u);return{run:a,step:t,resources:l}}function di(t){const e=[];for(const r in t){const n=t[r];n instanceof Pt&&e.push(n)}return e}async function ep(t){const e={};for(const r in t){const n=t[r];n instanceof Pt?e[r]=await n.resolve():e[r]=n}return e}async function tp(t,e){await t.run(e)}function rp(){}exports.activatePlugin=Nn;exports.activateTheme=Cn;exports.applyWordPressPatches=hi;exports.compileBlueprint=Gd;exports.cp=vi;exports.defineSiteUrl=Ei;exports.defineWpConfigConsts=qt;exports.exportWXR=Ri;exports.exportWXZ=Oi;exports.importFile=Si;exports.importWordPressFiles=ki;exports.installPlugin=Ci;exports.installTheme=ji;exports.login=Ii;exports.mkdir=bi;exports.mv=wi;exports.request=_i;exports.rm=In;exports.rmdir=Pi;exports.runBlueprintSteps=tp;exports.runPHP=mi;exports.runPHPWithOptions=yi;exports.runSql=gi;exports.runWpInstallationWizard=Di;exports.setPhpIniEntry=$i;exports.setPluginProxyURL=rp;exports.setSiteOptions=Ai;exports.unzip=on;exports.updateUserMeta=Fi;exports.wpContentFilesExcludedFromExport=On;exports.writeFile=Dn;exports.zipWpContent=Mi;