@wp-playground/client 0.9.18 → 0.9.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/index.cjs +130 -45
  2. package/index.d.ts +52 -8
  3. package/index.js +1507 -1297
  4. package/package.json +2 -2
package/index.cjs CHANGED
@@ -1,15 +1,15 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Qs=function(){var e;return typeof process<"u"&&((e=process.release)==null?void 0:e.name)==="node"?"NODE":typeof window<"u"?"WEB":typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?"WORKER":"NODE"}();if(Qs==="NODE"){let e=function(r){return new Promise(function(n,s){r.onload=r.onerror=function(i){r.onload=r.onerror=null,i.type==="load"?n(r.result):s(new Error("Failed to read the blob/file"))}})},t=function(){const r=new Uint8Array([1,2,3,4]),s=new File([r],"test").stream();try{return s.getReader({mode:"byob"}),!0}catch{return!1}};if(typeof File>"u"){class r extends Blob{constructor(s,i,o){super(s);let u;o!=null&&o.lastModified&&(u=new Date),(!u||isNaN(u.getFullYear()))&&(u=new Date),this.lastModifiedDate=u,this.lastModified=u.getMilliseconds(),this.name=i||""}}global.File=r}typeof Blob.prototype.arrayBuffer>"u"&&(Blob.prototype.arrayBuffer=function(){const n=new FileReader;return n.readAsArrayBuffer(this),e(n)}),typeof Blob.prototype.text>"u"&&(Blob.prototype.text=function(){const n=new FileReader;return n.readAsText(this),e(n)}),(typeof Blob.prototype.stream>"u"||!t())&&(Blob.prototype.stream=function(){let r=0;const n=this;return new ReadableStream({type:"bytes",autoAllocateChunkSize:512*1024,async pull(s){const i=s.byobRequest.view,u=await n.slice(r,r+i.byteLength).arrayBuffer(),f=new Uint8Array(u);new Uint8Array(i.buffer).set(f);const l=f.byteLength;s.byobRequest.respond(l),r+=l,r>=n.size&&s.close()}})})}if(Qs==="NODE"&&typeof CustomEvent>"u"){class e extends Event{constructor(r,n={}){super(r,n),this.detail=n.detail}initCustomEvent(){}}globalThis.CustomEvent=e}const pn=["db.php","plugins/akismet","plugins/hello.php","plugins/wordpress-importer","mu-plugins/sqlite-database-integration","mu-plugins/playground-includes","mu-plugins/0-playground.php","mu-plugins/0-sqlite.php","themes/twentytwenty","themes/twentytwentyone","themes/twentytwentytwo","themes/twentytwentythree","themes/twentytwentyfour","themes/twentytwentyfive","themes/twentytwentysix"],Ys=Symbol("SleepFinished");function Io(e){return new Promise(t=>{setTimeout(()=>t(Ys),e)})}class jo extends Error{constructor(){super("Acquiring lock timed out")}}class Ao{constructor({concurrency:t,timeout:r}){this._running=0,this.concurrency=t,this.timeout=r,this.queue=[]}get remaining(){return this.concurrency-this.running}get running(){return this._running}async acquire(){for(;;)if(this._running>=this.concurrency){const t=new Promise(r=>{this.queue.push(r)});this.timeout!==void 0?await Promise.race([t,Io(this.timeout)]).then(r=>{if(r===Ys)throw new jo}):await t}else{this._running++;let t=!1;return()=>{t||(t=!0,this._running--,this.queue.length>0&&this.queue.shift()())}}}async run(t){const r=await this.acquire();try{return await t()}finally{r()}}}function ue(...e){let t=e.join("/");const r=t[0]==="/",n=t.substring(t.length-1)==="/";return t=Xs(t),!t&&!r&&(t="."),t&&n&&(t+="/"),t}function Zs(e){if(e==="/")return"/";e=Xs(e);const t=e.lastIndexOf("/");return t===-1?"":t===0?"/":e.substr(0,t)}function Xs(e){const t=e[0]==="/";return e=Do(e.split("/").filter(r=>!!r),!t).join("/"),(t?"/":"")+e.replace(/\/$/,"")}function Do(e,t){let r=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s==="."?e.splice(n,1):s===".."?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e}function ei(e=36,t="!@#$%^&*()_+=-[]/.,<>?"){const r="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"+t;let n="";for(let s=e;s>0;--s)n+=r[Math.floor(Math.random()*r.length)];return n}function Mo(){return ei(36,"-_")}function pe(e){return`json_decode(base64_decode('${Lo(JSON.stringify(e))}'), true)`}function Zt(e){const t={};for(const r in e)t[r]=pe(e[r]);return t}function Lo(e){return Fo(new TextEncoder().encode(e))}function Fo(e){const t=String.fromCodePoint(...e);return btoa(t)}const qo="playground-log",$s=(e,...t)=>{ye.dispatchEvent(new CustomEvent(qo,{detail:{log:e,args:t}}))},Uo=(e,...t)=>{switch(typeof e.message=="string"?e.message=rn(e.message):e.message.message&&typeof e.message.message=="string"&&(e.message.message=rn(e.message.message)),e.severity){case"Debug":console.debug(e.message,...t);break;case"Info":console.info(e.message,...t);break;case"Warn":console.warn(e.message,...t);break;case"Error":console.error(e.message,...t);break;case"Fatal":console.error(e.message,...t);break;default:console.log(e.message,...t)}},Vo=e=>e instanceof Error?[e.message,e.stack].join(`
2
- `):JSON.stringify(e,null,2),ti=[],_s=e=>{ti.push(e)},tn=e=>{if(e.raw===!0)_s(e.message);else{const t=xo(typeof e.message=="object"?Vo(e.message):e.message,e.severity??"Info",e.prefix??"JavaScript");_s(t)}};class zo extends EventTarget{constructor(t=[]){super(),this.handlers=t,this.fatalErrorEvent="playground-fatal-error"}getLogs(){return this.handlers.includes(tn)?[...ti]:(this.error(`Logs aren't stored because the logToMemory handler isn't registered.
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ys=function(){var e;return typeof process<"u"&&((e=process.release)==null?void 0:e.name)==="node"?"NODE":typeof window<"u"?"WEB":typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?"WORKER":"NODE"}();if(Ys==="NODE"){let e=function(r){return new Promise(function(n,s){r.onload=r.onerror=function(i){r.onload=r.onerror=null,i.type==="load"?n(r.result):s(new Error("Failed to read the blob/file"))}})},t=function(){const r=new Uint8Array([1,2,3,4]),s=new File([r],"test").stream();try{return s.getReader({mode:"byob"}),!0}catch{return!1}};if(typeof File>"u"){class r extends Blob{constructor(s,i,o){super(s);let u;o!=null&&o.lastModified&&(u=new Date),(!u||isNaN(u.getFullYear()))&&(u=new Date),this.lastModifiedDate=u,this.lastModified=u.getMilliseconds(),this.name=i||""}}global.File=r}typeof Blob.prototype.arrayBuffer>"u"&&(Blob.prototype.arrayBuffer=function(){const n=new FileReader;return n.readAsArrayBuffer(this),e(n)}),typeof Blob.prototype.text>"u"&&(Blob.prototype.text=function(){const n=new FileReader;return n.readAsText(this),e(n)}),(typeof Blob.prototype.stream>"u"||!t())&&(Blob.prototype.stream=function(){let r=0;const n=this;return new ReadableStream({type:"bytes",autoAllocateChunkSize:512*1024,async pull(s){const i=s.byobRequest.view,u=await n.slice(r,r+i.byteLength).arrayBuffer(),f=new Uint8Array(u);new Uint8Array(i.buffer).set(f);const l=f.byteLength;s.byobRequest.respond(l),r+=l,r>=n.size&&s.close()}})})}if(Ys==="NODE"&&typeof CustomEvent>"u"){class e extends Event{constructor(r,n={}){super(r,n),this.detail=n.detail}initCustomEvent(){}}globalThis.CustomEvent=e}const pn=["db.php","plugins/akismet","plugins/hello.php","plugins/wordpress-importer","mu-plugins/sqlite-database-integration","mu-plugins/playground-includes","mu-plugins/0-playground.php","mu-plugins/0-sqlite.php","themes/twentytwenty","themes/twentytwentyone","themes/twentytwentytwo","themes/twentytwentythree","themes/twentytwentyfour","themes/twentytwentyfive","themes/twentytwentysix"],Zs=Symbol("SleepFinished");function Do(e){return new Promise(t=>{setTimeout(()=>t(Zs),e)})}class Mo extends Error{constructor(){super("Acquiring lock timed out")}}class Lo{constructor({concurrency:t,timeout:r}){this._running=0,this.concurrency=t,this.timeout=r,this.queue=[]}get remaining(){return this.concurrency-this.running}get running(){return this._running}async acquire(){for(;;)if(this._running>=this.concurrency){const t=new Promise(r=>{this.queue.push(r)});this.timeout!==void 0?await Promise.race([t,Do(this.timeout)]).then(r=>{if(r===Zs)throw new Mo}):await t}else{this._running++;let t=!1;return()=>{t||(t=!0,this._running--,this.queue.length>0&&this.queue.shift()())}}}async run(t){const r=await this.acquire();try{return await t()}finally{r()}}}function de(...e){let t=e.join("/");const r=t[0]==="/",n=t.substring(t.length-1)==="/";return t=ei(t),!t&&!r&&(t="."),t&&n&&(t+="/"),t}function Xs(e){if(e==="/")return"/";e=ei(e);const t=e.lastIndexOf("/");return t===-1?"":t===0?"/":e.substr(0,t)}function ei(e){const t=e[0]==="/";return e=Fo(e.split("/").filter(r=>!!r),!t).join("/"),(t?"/":"")+e.replace(/\/$/,"")}function Fo(e,t){let r=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s==="."?e.splice(n,1):s===".."?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e}function ti(e=36,t="!@#$%^&*()_+=-[]/.,<>?"){const r="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"+t;let n="";for(let s=e;s>0;--s)n+=r[Math.floor(Math.random()*r.length)];return n}function qo(){return ti(36,"-_")}function ae(e){return`json_decode(base64_decode('${Uo(JSON.stringify(e))}'), true)`}function Zt(e){const t={};for(const r in e)t[r]=ae(e[r]);return t}function Uo(e){return zo(new TextEncoder().encode(e))}function zo(e){const t=String.fromCodePoint(...e);return btoa(t)}const Vo="playground-log",_s=(e,...t)=>{he.dispatchEvent(new CustomEvent(Vo,{detail:{log:e,args:t}}))},Wo=(e,...t)=>{switch(typeof e.message=="string"?e.message=rn(e.message):e.message.message&&typeof e.message.message=="string"&&(e.message.message=rn(e.message.message)),e.severity){case"Debug":console.debug(e.message,...t);break;case"Info":console.info(e.message,...t);break;case"Warn":console.warn(e.message,...t);break;case"Error":console.error(e.message,...t);break;case"Fatal":console.error(e.message,...t);break;default:console.log(e.message,...t)}},xo=e=>e instanceof Error?[e.message,e.stack].join(`
2
+ `):JSON.stringify(e,null,2),ri=[],ws=e=>{ri.push(e)},tn=e=>{if(e.raw===!0)ws(e.message);else{const t=Go(typeof e.message=="object"?xo(e.message):e.message,e.severity??"Info",e.prefix??"JavaScript");ws(t)}};class Ho extends EventTarget{constructor(t=[]){super(),this.handlers=t,this.fatalErrorEvent="playground-fatal-error"}getLogs(){return this.handlers.includes(tn)?[...ri]:(this.error(`Logs aren't stored because the logToMemory handler isn't registered.
3
3
  If you're using a custom logger instance, make sure to register logToMemory handler.
4
- `),[])}logMessage(t,...r){for(const n of this.handlers)n(t,...r)}log(t,...r){this.logMessage({message:t,severity:void 0,prefix:"JavaScript",raw:!1},...r)}debug(t,...r){this.logMessage({message:t,severity:"Debug",prefix:"JavaScript",raw:!1},...r)}info(t,...r){this.logMessage({message:t,severity:"Info",prefix:"JavaScript",raw:!1},...r)}warn(t,...r){this.logMessage({message:t,severity:"Warn",prefix:"JavaScript",raw:!1},...r)}error(t,...r){this.logMessage({message:t,severity:"Error",prefix:"JavaScript",raw:!1},...r)}}const Wo=()=>{try{if(process.env.NODE_ENV==="test")return[tn,$s]}catch{}return[tn,Uo,$s]},ye=new zo(Wo()),rn=e=>e.replace(/\t/g,""),xo=(e,t,r)=>{const n=new Date,s=new Intl.DateTimeFormat("en-GB",{year:"numeric",month:"short",day:"2-digit",timeZone:"UTC"}).format(n).replace(/ /g,"-"),i=new Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1,timeZone:"UTC",timeZoneName:"short"}).format(n),o=s+" "+i;return e=rn(e),`[${o}] ${r} ${t}: ${e}`};let xr=0;const ws="/wordpress/wp-content/debug.log",Ho=async e=>await e.fileExists(ws)?await e.readFileAsText(ws):"",Bo=(e,t)=>{t.addEventListener("request.end",async()=>{const r=await Ho(t);if(r.length>xr){const n=r.substring(xr);e.logMessage({message:n,raw:!0}),xr=r.length}}),t.addEventListener("request.error",r=>{r=r,r.error&&(e.logMessage({message:`${r.error.message} ${r.error.stack}`,severity:"Fatal",prefix:r.source==="request"?"PHP":"WASM Crash"}),e.dispatchEvent(new CustomEvent(e.fatalErrorEvent,{detail:{logs:e.getLogs(),source:r.source}})))})},Ar=async(e,{pluginPath:t,pluginName:r},n)=>{n==null||n.tracker.setCaption(`Activating ${r||t}`);const s=await e.documentRoot,i=await e.run({code:`<?php
4
+ `),[])}logMessage(t,...r){for(const n of this.handlers)n(t,...r)}log(t,...r){this.logMessage({message:t,severity:void 0,prefix:"JavaScript",raw:!1},...r)}debug(t,...r){this.logMessage({message:t,severity:"Debug",prefix:"JavaScript",raw:!1},...r)}info(t,...r){this.logMessage({message:t,severity:"Info",prefix:"JavaScript",raw:!1},...r)}warn(t,...r){this.logMessage({message:t,severity:"Warn",prefix:"JavaScript",raw:!1},...r)}error(t,...r){this.logMessage({message:t,severity:"Error",prefix:"JavaScript",raw:!1},...r)}}const Bo=()=>{try{if(process.env.NODE_ENV==="test")return[tn,_s]}catch{}return[tn,Wo,_s]},he=new Ho(Bo()),rn=e=>e.replace(/\t/g,""),Go=(e,t,r)=>{const n=new Date,s=new Intl.DateTimeFormat("en-GB",{year:"numeric",month:"short",day:"2-digit",timeZone:"UTC"}).format(n).replace(/ /g,"-"),i=new Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1,timeZone:"UTC",timeZoneName:"short"}).format(n),o=s+" "+i;return e=rn(e),`[${o}] ${r} ${t}: ${e}`};let xr=0;const vs="/wordpress/wp-content/debug.log",Ko=async e=>await e.fileExists(vs)?await e.readFileAsText(vs):"",Jo=(e,t)=>{t.addEventListener("request.end",async()=>{const r=await Ko(t);if(r.length>xr){const n=r.substring(xr);e.logMessage({message:n,raw:!0}),xr=r.length}}),t.addEventListener("request.error",r=>{r=r,r.error&&(e.logMessage({message:`${r.error.message} ${r.error.stack}`,severity:"Fatal",prefix:r.source==="request"?"PHP":"WASM Crash"}),e.dispatchEvent(new CustomEvent(e.fatalErrorEvent,{detail:{logs:e.getLogs(),source:r.source}})))})},Ar=async(e,{pluginPath:t,pluginName:r},n)=>{n==null||n.tracker.setCaption(`Activating ${r||t}`);const s=await e.documentRoot,i=await e.run({code:`<?php
5
5
  define( 'WP_ADMIN', true );
6
- require_once( ${pe(s)}. "/wp-load.php" );
7
- require_once( ${pe(s)}. "/wp-admin/includes/plugin.php" );
6
+ require_once( ${ae(s)}. "/wp-load.php" );
7
+ require_once( ${ae(s)}. "/wp-admin/includes/plugin.php" );
8
8
 
9
9
  // Set current user to admin
10
10
  wp_set_current_user( get_users(array('role' => 'Administrator') )[0]->ID );
11
11
 
12
- $plugin_path = ${pe(t)};
12
+ $plugin_path = ${ae(t)};
13
13
  $response = false;
14
14
  if (!is_dir($plugin_path)) {
15
15
  $response = activate_plugin($plugin_path);
@@ -33,7 +33,7 @@
33
33
  }
34
34
 
35
35
  throw new Exception( 'Unable to activate plugin' );
36
- `});if(i.text!=="Plugin activated successfully")throw ye.debug(i),new Error(`Plugin ${t} could not be activated – WordPress exited with no error. Sometimes, when $_SERVER or site options are not configured correctly, WordPress exits early with a 301 redirect. Inspect the "debug" logs in the console for more details`)},hn=async(e,{themeFolderName:t},r)=>{r==null||r.tracker.setCaption(`Activating ${t}`);const n=await e.documentRoot,s=`${n}/wp-content/themes/${t}`;if(!await e.fileExists(s))throw new Error(`
36
+ `});if(i.text!=="Plugin activated successfully")throw he.debug(i),new Error(`Plugin ${t} could not be activated – WordPress exited with no error. Sometimes, when $_SERVER or site options are not configured correctly, WordPress exits early with a 301 redirect. Inspect the "debug" logs in the console for more details`)},hn=async(e,{themeFolderName:t},r)=>{r==null||r.tracker.setCaption(`Activating ${t}`);const n=await e.documentRoot,s=`${n}/wp-content/themes/${t}`;if(!await e.fileExists(s))throw new Error(`
37
37
  Couldn't activate theme ${t}.
38
38
  Theme not found at the provided theme path: ${s}.
39
39
  Check the theme path to ensure it's correct.
@@ -52,7 +52,7 @@
52
52
  throw new Exception( 'Theme ' . getenv('themeFolderName') . ' could not be activated.' );
53
53
  }
54
54
  die('Theme activated successfully');
55
- `,env:{docroot:n,themeFolderName:t}});if(i.text!=="Theme activated successfully")throw ye.debug(i),new Error(`Theme ${t} could not be activated – WordPress exited with no error. Sometimes, when $_SERVER or site options are not configured correctly, WordPress exits early with a 301 redirect. Inspect the "debug" logs in the console for more details`)},ri=async(e,{code:t})=>await e.run({code:t}),ni=async(e,{options:t})=>await e.run(t),mn=async(e,{path:t})=>{await e.unlink(t)},si=async(e,{sql:t},r)=>{r==null||r.tracker.setCaption("Executing SQL Queries");const n=`/tmp/${Mo()}.sql`;await e.writeFile(n,new Uint8Array(await t.arrayBuffer()));const s=await e.documentRoot,i=Zt({docroot:s,sqlFilename:n}),o=await e.run({code:`<?php
55
+ `,env:{docroot:n,themeFolderName:t}});if(i.text!=="Theme activated successfully")throw he.debug(i),new Error(`Theme ${t} could not be activated – WordPress exited with no error. Sometimes, when $_SERVER or site options are not configured correctly, WordPress exits early with a 301 redirect. Inspect the "debug" logs in the console for more details`)},ni=async(e,{code:t})=>await e.run({code:t}),si=async(e,{options:t})=>await e.run(t),mn=async(e,{path:t})=>{await e.unlink(t)},ii=async(e,{sql:t},r)=>{r==null||r.tracker.setCaption("Executing SQL Queries");const n=`/tmp/${qo()}.sql`;await e.writeFile(n,new Uint8Array(await t.arrayBuffer()));const s=await e.documentRoot,i=Zt({docroot:s,sqlFilename:n}),o=await e.run({code:`<?php
56
56
  require_once ${i.docroot} . '/wp-load.php';
57
57
 
58
58
  $handle = fopen(${i.sqlFilename}, 'r');
@@ -71,7 +71,7 @@
71
71
  $wpdb->query($buffer);
72
72
  $buffer = '';
73
73
  }
74
- `});return await mn(e,{path:n}),o},br=async(e,{request:t})=>{ye.warn('Deprecated: The Blueprint step "request" is deprecated and will be removed in a future release.');const r=await e.request(t);if(r.httpStatusCode>399||r.httpStatusCode<200)throw ye.warn("WordPress response was",{response:r}),new Error(`Request failed with status ${r.httpStatusCode}`);return r},Go=`<?php
74
+ `});return await mn(e,{path:n}),o},br=async(e,{request:t})=>{he.warn('Deprecated: The Blueprint step "request" is deprecated and will be removed in a future release.');const r=await e.request(t);if(r.httpStatusCode>399||r.httpStatusCode<200)throw he.warn("WordPress response was",{response:r}),new Error(`Request failed with status ${r.httpStatusCode}`);return r},Qo=`<?php
75
75
 
76
76
  /**
77
77
  * Rewrites the wp-config.php file to ensure specific constants are defined
@@ -402,33 +402,33 @@ function skip_whitespace($tokens) {
402
402
  }
403
403
  return $output;
404
404
  }
405
- `,Qt=async(e,{consts:t,method:r="define-before-run"})=>{switch(r){case"define-before-run":await Ko(e,t);break;case"rewrite-wp-config":{const n=await e.documentRoot,s=ue(n,"/wp-config.php"),i=await e.readFileAsText(s),o=await Jo(e,i,t);await e.writeFile(s,o);break}default:throw new Error(`Invalid method: ${r}`)}};async function Ko(e,t){for(const r in t)await e.defineConstant(r,t[r])}async function Jo(e,t,r){await e.writeFile("/tmp/code.php",t);const n=Zt({consts:r});return await e.run({code:`${Go}
405
+ `,Qt=async(e,{consts:t,method:r="define-before-run"})=>{switch(r){case"define-before-run":await Yo(e,t);break;case"rewrite-wp-config":{const n=await e.documentRoot,s=de(n,"/wp-config.php"),i=await e.readFileAsText(s),o=await Zo(e,i,t);await e.writeFile(s,o);break}default:throw new Error(`Invalid method: ${r}`)}};async function Yo(e,t){for(const r in t)await e.defineConstant(r,t[r])}async function Zo(e,t,r){await e.writeFile("/tmp/code.php",t);const n=Zt({consts:r});return await e.run({code:`${Qo}
406
406
  $wp_config_path = '/tmp/code.php';
407
407
  $wp_config = file_get_contents($wp_config_path);
408
408
  $new_wp_config = rewrite_wp_config_to_define_constants($wp_config, ${n.consts});
409
409
  file_put_contents($wp_config_path, $new_wp_config);
410
- `}),await e.readFileAsText("/tmp/code.php")}const Er=async(e,{username:t="admin",password:r="password"}={},n)=>{var i,o,u;n==null||n.tracker.setCaption((n==null?void 0:n.initialCaption)||"Logging in"),await e.request({url:"/wp-login.php"});const s=await e.request({url:"/wp-login.php",method:"POST",body:{log:t,pwd:r,rememberme:"forever"}});if(!((u=(o=(i=s.headers)==null?void 0:i.location)==null?void 0:o[0])!=null&&u.includes("/wp-admin/")))throw ye.warn("WordPress response was",{response:s,text:s.text}),new Error(`Failed to log in as ${t} with password ${r}`)},yn=async(e,{options:t})=>{const r=await e.documentRoot;await e.run({code:`<?php
411
- include ${pe(r)} . '/wp-load.php';
412
- $site_options = ${pe(t)};
410
+ `}),await e.readFileAsText("/tmp/code.php")}const Er=async(e,{username:t="admin",password:r="password"}={},n)=>{var i,o,u;n==null||n.tracker.setCaption((n==null?void 0:n.initialCaption)||"Logging in"),await e.request({url:"/wp-login.php"});const s=await e.request({url:"/wp-login.php",method:"POST",body:{log:t,pwd:r,rememberme:"forever"}});if(!((u=(o=(i=s.headers)==null?void 0:i.location)==null?void 0:o[0])!=null&&u.includes("/wp-admin/")))throw he.warn("WordPress response was",{response:s,text:s.text}),new Error(`Failed to log in as ${t} with password ${r}`)},yn=async(e,{options:t})=>{const r=await e.documentRoot;await e.run({code:`<?php
411
+ include ${ae(r)} . '/wp-load.php';
412
+ $site_options = ${ae(t)};
413
413
  foreach($site_options as $name => $value) {
414
414
  update_option($name, $value);
415
415
  }
416
416
  echo "Success";
417
- `})},ii=async(e,{meta:t,userId:r})=>{const n=await e.documentRoot;await e.run({code:`<?php
418
- include ${pe(n)} . '/wp-load.php';
419
- $meta = ${pe(t)};
417
+ `})},oi=async(e,{meta:t,userId:r})=>{const n=await e.documentRoot;await e.run({code:`<?php
418
+ include ${ae(n)} . '/wp-load.php';
419
+ $meta = ${ae(t)};
420
420
  foreach($meta as $name => $value) {
421
- update_user_meta(${pe(r)}, $name, $value);
421
+ update_user_meta(${ae(r)}, $name, $value);
422
422
  }
423
- `})};function oi(e){return e.pathname.startsWith("/scope:")}function Qo(e){return oi(e)?e.pathname.split("/")[1].split(":")[1]:null}const ai=async e=>{var b;await Qt(e,{consts:{WP_ALLOW_MULTISITE:1}});const t=new URL(await e.absoluteUrl);if(t.port!==""){let E=`The current host is ${t.host}, but WordPress multisites do not support custom ports.`;throw t.hostname==="localhost"&&(E+=" For development, you can set up a playground.test domain using the instructions at https://wordpress.github.io/wordpress-playground/contributing/code."),new Error(E)}const r=t.pathname.replace(/\/$/,"")+"/",n=`${t.protocol}//${t.hostname}${r}`;await yn(e,{options:{siteurl:n,home:n}}),await Er(e,{});const s=await e.documentRoot,o=(await e.run({code:`<?php
423
+ `})};function ai(e){return e.pathname.startsWith("/scope:")}function Xo(e){return ai(e)?e.pathname.split("/")[1].split(":")[1]:null}const ci=async e=>{var _;await Qt(e,{consts:{WP_ALLOW_MULTISITE:1}});const t=new URL(await e.absoluteUrl);if(t.port!==""){let b=`The current host is ${t.host}, but WordPress multisites do not support custom ports.`;throw t.hostname==="localhost"&&(b+=" For development, you can set up a playground.test domain using the instructions at https://wordpress.github.io/wordpress-playground/contributing/code."),new Error(b)}const r=t.pathname.replace(/\/$/,"")+"/",n=`${t.protocol}//${t.hostname}${r}`;await yn(e,{options:{siteurl:n,home:n}}),await Er(e,{});const s=await e.documentRoot,o=(await e.run({code:`<?php
424
424
  define( 'WP_ADMIN', true );
425
- require_once(${pe(s)} . "/wp-load.php");
425
+ require_once(${ae(s)} . "/wp-load.php");
426
426
 
427
427
  // Set current user to admin
428
428
  ( get_users(array('role' => 'Administrator') )[0] );
429
429
 
430
- require_once(${pe(s)} . "/wp-admin/includes/plugin.php");
431
- $plugins_root = ${pe(s)} . "/wp-content/plugins";
430
+ require_once(${ae(s)} . "/wp-admin/includes/plugin.php");
431
+ $plugins_root = ${ae(s)} . "/wp-content/plugins";
432
432
  $plugins = glob($plugins_root . "/*");
433
433
 
434
434
  $deactivated_plugins = [];
@@ -452,9 +452,9 @@ foreach($plugins as $plugin_path) {
452
452
  }
453
453
  }
454
454
  echo json_encode($deactivated_plugins);
455
- `})).json,f=(b=(await br(e,{request:{url:"/wp-admin/network.php"}})).text.match(/name="_wpnonce"\s+value="([^"]+)"/))==null?void 0:b[1],l=await br(e,{request:{url:"/wp-admin/network.php",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:Yo({_wpnonce:f,_wp_http_referer:r+"wp-admin/network.php",sitename:"My WordPress Website Sites",email:"admin@localhost.com",submit:"Install"})}});if(l.httpStatusCode!==200)throw ye.warn("WordPress response was",{response:l,text:l.text,headers:l.headers}),new Error(`Failed to enable multisite. Response code was ${l.httpStatusCode}`);await Qt(e,{consts:{MULTISITE:!0,SUBDOMAIN_INSTALL:!1,SITE_ID_CURRENT_SITE:1,BLOG_ID_CURRENT_SITE:1,DOMAIN_CURRENT_SITE:t.hostname,PATH_CURRENT_SITE:r}});const d=new URL(await e.absoluteUrl),p=oi(d)?"scope:"+Qo(d):null;await e.writeFile("/internal/shared/preload/sunrise.php",`<?php
456
- $_SERVER['HTTP_HOST'] = ${pe(d.hostname)};
457
- $folder = ${pe(p)};
455
+ `})).json,f=(_=(await br(e,{request:{url:"/wp-admin/network.php"}})).text.match(/name="_wpnonce"\s+value="([^"]+)"/))==null?void 0:_[1],l=await br(e,{request:{url:"/wp-admin/network.php",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:ea({_wpnonce:f,_wp_http_referer:r+"wp-admin/network.php",sitename:"My WordPress Website Sites",email:"admin@localhost.com",submit:"Install"})}});if(l.httpStatusCode!==200)throw he.warn("WordPress response was",{response:l,text:l.text,headers:l.headers}),new Error(`Failed to enable multisite. Response code was ${l.httpStatusCode}`);await Qt(e,{consts:{MULTISITE:!0,SUBDOMAIN_INSTALL:!1,SITE_ID_CURRENT_SITE:1,BLOG_ID_CURRENT_SITE:1,DOMAIN_CURRENT_SITE:t.hostname,PATH_CURRENT_SITE:r}});const d=new URL(await e.absoluteUrl),p=ai(d)?"scope:"+Xo(d):null;await e.writeFile("/internal/shared/preload/sunrise.php",`<?php
456
+ $_SERVER['HTTP_HOST'] = ${ae(d.hostname)};
457
+ $folder = ${ae(p)};
458
458
  if ($folder && strpos($_SERVER['REQUEST_URI'],"/$folder") === false) {
459
459
  $_SERVER['REQUEST_URI'] = "/$folder/" . ltrim($_SERVER['REQUEST_URI'], '/');
460
460
  }
@@ -462,9 +462,9 @@ echo json_encode($deactivated_plugins);
462
462
  if ( !defined( 'BLOG_ID_CURRENT_SITE' ) ) {
463
463
  define( 'BLOG_ID_CURRENT_SITE', 1 );
464
464
  }
465
- `),await Er(e,{});for(const E of o)await Ar(e,{pluginPath:E})};function Yo(e){return Object.keys(e).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t])).join("&")}const ci=async(e,{fromPath:t,toPath:r})=>{await e.writeFile(r,await e.readFileAsBuffer(t))},li=async(e,{fromPath:t,toPath:r})=>{await e.mv(t,r)},ui=async(e,{path:t})=>{await e.mkdir(t)},di=async(e,{path:t})=>{await e.rmdir(t)},gn=async(e,{path:t,data:r})=>{r instanceof File&&(r=new Uint8Array(await r.arrayBuffer())),t.startsWith("/wordpress/wp-content/mu-plugins")&&!await e.fileExists("/wordpress/wp-content/mu-plugins")&&await e.mkdir("/wordpress/wp-content/mu-plugins"),await e.writeFile(t,r)},$n=async(e,{siteUrl:t})=>{await Qt(e,{consts:{WP_HOME:t,WP_SITEURL:t}})},fi=async(e,{file:t},r)=>{var s;(s=r==null?void 0:r.tracker)==null||s.setCaption("Importing content"),await gn(e,{path:"/tmp/import.wxr",data:t});const n=await e.documentRoot;await e.run({code:`<?php
466
- require ${pe(n)} . '/wp-load.php';
467
- require ${pe(n)} . '/wp-admin/includes/admin.php';
465
+ `),await Er(e,{});for(const b of o)await Ar(e,{pluginPath:b})};function ea(e){return Object.keys(e).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t])).join("&")}const li=async(e,{fromPath:t,toPath:r})=>{await e.writeFile(r,await e.readFileAsBuffer(t))},ui=async(e,{fromPath:t,toPath:r})=>{await e.mv(t,r)},di=async(e,{path:t})=>{await e.mkdir(t)},fi=async(e,{path:t})=>{await e.rmdir(t)},gn=async(e,{path:t,data:r})=>{r instanceof File&&(r=new Uint8Array(await r.arrayBuffer())),t.startsWith("/wordpress/wp-content/mu-plugins")&&!await e.fileExists("/wordpress/wp-content/mu-plugins")&&await e.mkdir("/wordpress/wp-content/mu-plugins"),await e.writeFile(t,r)},$n=async(e,{siteUrl:t})=>{await Qt(e,{consts:{WP_HOME:t,WP_SITEURL:t}})},pi=async(e,{file:t},r)=>{var s;(s=r==null?void 0:r.tracker)==null||s.setCaption("Importing content"),await gn(e,{path:"/tmp/import.wxr",data:t});const n=await e.documentRoot;await e.run({code:`<?php
466
+ require ${ae(n)} . '/wp-load.php';
467
+ require ${ae(n)} . '/wp-admin/includes/admin.php';
468
468
 
469
469
  kses_remove_filters();
470
470
  $admin_id = get_users(array('role' => 'Administrator') )[0]->ID;
@@ -482,7 +482,54 @@ echo json_encode($deactivated_plugins);
482
482
  });
483
483
 
484
484
  $result = $importer->import( '/tmp/import.wxr' );
485
- `})},Hr="/tmp/file.zip",Zo=async(e,t,r)=>{if(t instanceof File){const s=t;t=Hr,await e.writeFile(t,new Uint8Array(await s.arrayBuffer()))}const n=Zt({zipPath:t,extractToPath:r});await e.run({code:`<?php
485
+ `})},_n=async(e,{themeSlug:t=""},r)=>{var s;(s=r==null?void 0:r.tracker)==null||s.setCaption("Importing theme starter content");const n=await e.documentRoot;await e.run({code:`<?php
486
+
487
+ /**
488
+ * Ensure that the customizer loads as an admin user.
489
+ *
490
+ * For compatibility with themes, this MUST be run prior to theme inclusion, which is why this is a plugins_loaded filter instead
491
+ * of running _wp_customize_include() manually after load.
492
+ */
493
+ function importThemeStarterContent_plugins_loaded() {
494
+ // Set as the admin user, this ensures we can customize the site.
495
+ wp_set_current_user(
496
+ get_users( [ 'role' => 'Administrator' ] )[0]
497
+ );
498
+
499
+ // Force the site to be fresh, although it should already be.
500
+ add_filter( 'pre_option_fresh_site', '__return_true' );
501
+
502
+ /*
503
+ * Simulate this request as the customizer loading with the current theme in preview mode.
504
+ *
505
+ * See _wp_customize_include()
506
+ */
507
+ $_REQUEST['wp_customize'] = 'on';
508
+ $_REQUEST['customize_theme'] = ${ae(t)} ?: get_stylesheet();
509
+
510
+ /*
511
+ * Claim this is a ajax request saving settings, to avoid the preview filters being applied.
512
+ */
513
+ $_REQUEST['action'] = 'customize_save';
514
+ add_filter( 'wp_doing_ajax', '__return_true' );
515
+
516
+ $_GET = $_REQUEST;
517
+ }
518
+ playground_add_filter( 'plugins_loaded', 'importThemeStarterContent_plugins_loaded', 0 );
519
+
520
+ require ${ae(n)} . '/wp-load.php';
521
+
522
+ // Return early if there's no starter content.
523
+ if ( ! get_theme_starter_content() ) {
524
+ return;
525
+ }
526
+
527
+ // Import the Starter Content.
528
+ $wp_customize->import_theme_starter_content();
529
+
530
+ // Publish the changeset, which publishes the starter content.
531
+ wp_publish_post( $wp_customize->changeset_post_id() );
532
+ `})},Hr="/tmp/file.zip",hi=async(e,t,r)=>{if(t instanceof File){const s=t;t=Hr,await e.writeFile(t,new Uint8Array(await s.arrayBuffer()))}const n=Zt({zipPath:t,extractToPath:r});await e.run({code:`<?php
486
533
  function unzip($zipPath, $extractTo, $overwrite = true)
487
534
  {
488
535
  if (!is_dir($extractTo)) {
@@ -499,10 +546,10 @@ echo json_encode($deactivated_plugins);
499
546
  }
500
547
  }
501
548
  unzip(${n.zipPath}, ${n.extractToPath});
502
- `}),await e.fileExists(Hr)&&await e.unlink(Hr)},Dr=async(e,{zipFile:t,zipPath:r,extractToPath:n})=>{if(r)ye.warn('The "zipPath" option of the unzip() Blueprint step is deprecated and will be removed. Use "zipFile" instead.');else if(!t)throw new Error("Either zipPath or zipFile must be provided");await Zo(e,t||r,n)},pi=async(e,{wordPressFilesZip:t,pathInZip:r=""})=>{const n=await e.documentRoot;let s=ue("/tmp","import");await e.mkdir(s),await Dr(e,{zipFile:t,extractToPath:s}),s=ue(s,r);const i=ue(s,"wp-content"),o=ue(n,"wp-content");for(const d of pn){const p=ue(i,d);await vs(e,p);const b=ue(o,d);await e.fileExists(b)&&(await e.mkdir(Zs(p)),await e.mv(b,p))}const u=ue(s,"wp-content","database");await e.fileExists(u)||await e.mv(ue(n,"wp-content","database"),u);const f=await e.listFiles(s);for(const d of f)await vs(e,ue(n,d)),await e.mv(ue(s,d),ue(n,d));await e.rmdir(s),await $n(e,{siteUrl:await e.absoluteUrl});const l=pe(ue(n,"wp-admin","upgrade.php"));await e.run({code:`<?php
549
+ `}),await e.fileExists(Hr)&&await e.unlink(Hr)},Dr=async(e,{zipFile:t,zipPath:r,extractToPath:n})=>{if(r)he.warn('The "zipPath" option of the unzip() Blueprint step is deprecated and will be removed. Use "zipFile" instead.');else if(!t)throw new Error("Either zipPath or zipFile must be provided");await hi(e,t||r,n)},mi=async(e,{wordPressFilesZip:t,pathInZip:r=""})=>{const n=await e.documentRoot;let s=de("/tmp","import");await e.mkdir(s),await Dr(e,{zipFile:t,extractToPath:s}),s=de(s,r);const i=de(s,"wp-content"),o=de(n,"wp-content");for(const d of pn){const p=de(i,d);await bs(e,p);const _=de(o,d);await e.fileExists(_)&&(await e.mkdir(Xs(p)),await e.mv(_,p))}const u=de(s,"wp-content","database");await e.fileExists(u)||await e.mv(de(n,"wp-content","database"),u);const f=await e.listFiles(s);for(const d of f)await bs(e,de(n,d)),await e.mv(de(s,d),de(n,d));await e.rmdir(s),await $n(e,{siteUrl:await e.absoluteUrl});const l=ae(de(n,"wp-admin","upgrade.php"));await e.run({code:`<?php
503
550
  $_GET['step'] = 'upgrade_db';
504
551
  require ${l};
505
- `})};async function vs(e,t){await e.fileExists(t)&&(await e.isDir(t)?await e.rmdir(t):await e.unlink(t))}async function hi(e){const t=await e.request({url:"/wp-admin/export.php?download=true&content=all"});return new File([t.bytes],"export.xml")}async function mi(e,{targetPath:t,zipFile:r,ifAlreadyInstalled:n="overwrite"}){const i=r.name.replace(/\.zip$/,""),o=ue(await e.documentRoot,"wp-content"),u=ue(o,ei()),f=ue(u,"assets",i);await e.fileExists(f)&&await e.rmdir(u,{recursive:!0}),await e.mkdir(u);try{await Dr(e,{zipFile:r,extractToPath:f});let l=await e.listFiles(f,{prependPath:!0});l=l.filter(P=>!P.endsWith("/__MACOSX"));const d=l.length===1&&await e.isDir(l[0]);let p,b="";d?(b=l[0],p=l[0].split("/").pop()):(b=f,p=i);const E=`${t}/${p}`;if(await e.fileExists(E)){if(!await e.isDir(E))throw new Error(`Cannot install asset ${p} to ${E} because a file with the same name already exists. Note it's a file, not a directory! Is this by mistake?`);if(n==="overwrite")await e.rmdir(E,{recursive:!0});else{if(n==="skip")return{assetFolderPath:E,assetFolderName:p};throw new Error(`Cannot install asset ${p} to ${t} because it already exists and the ifAlreadyInstalled option was set to ${n}`)}}return await e.mv(b,E),{assetFolderPath:E,assetFolderName:p}}finally{await e.rmdir(u,{recursive:!0})}}function Mr(e){const t=e.split(".").shift().replace(/-/g," ");return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}const yi=async(e,{pluginZipFile:t,ifAlreadyInstalled:r,options:n={}},s)=>{const i=t.name.split("/").pop()||"plugin.zip",o=Mr(i);s==null||s.tracker.setCaption(`Installing the ${o} plugin`);const{assetFolderPath:u}=await mi(e,{ifAlreadyInstalled:r,zipFile:t,targetPath:`${await e.documentRoot}/wp-content/plugins`});("activate"in n?n.activate:!0)&&await Ar(e,{pluginPath:u,pluginName:o},s)},gi=async(e,{themeZipFile:t,ifAlreadyInstalled:r,options:n={}},s)=>{const i=Mr(t.name);s==null||s.tracker.setCaption(`Installing the ${i} theme`);const{assetFolderName:o}=await mi(e,{ifAlreadyInstalled:r,zipFile:t,targetPath:`${await e.documentRoot}/wp-content/themes`});("activate"in n?n.activate:!0)&&await hn(e,{themeFolderName:o},s)},$i=async(e,t,r)=>{var s;(s=r==null?void 0:r.tracker)==null||s.setCaption("Resetting WordPress data");const n=await e.documentRoot;await e.run({env:{DOCROOT:n},code:`<?php
552
+ `})};async function bs(e,t){await e.fileExists(t)&&(await e.isDir(t)?await e.rmdir(t):await e.unlink(t))}async function yi(e){const t=await e.request({url:"/wp-admin/export.php?download=true&content=all"});return new File([t.bytes],"export.xml")}async function gi(e,{targetPath:t,zipFile:r,ifAlreadyInstalled:n="overwrite"}){const i=r.name.replace(/\.zip$/,""),o=de(await e.documentRoot,"wp-content"),u=de(o,ti()),f=de(u,"assets",i);await e.fileExists(f)&&await e.rmdir(u,{recursive:!0}),await e.mkdir(u);try{await Dr(e,{zipFile:r,extractToPath:f});let l=await e.listFiles(f,{prependPath:!0});l=l.filter(P=>!P.endsWith("/__MACOSX"));const d=l.length===1&&await e.isDir(l[0]);let p,_="";d?(_=l[0],p=l[0].split("/").pop()):(_=f,p=i);const b=`${t}/${p}`;if(await e.fileExists(b)){if(!await e.isDir(b))throw new Error(`Cannot install asset ${p} to ${b} because a file with the same name already exists. Note it's a file, not a directory! Is this by mistake?`);if(n==="overwrite")await e.rmdir(b,{recursive:!0});else{if(n==="skip")return{assetFolderPath:b,assetFolderName:p};throw new Error(`Cannot install asset ${p} to ${t} because it already exists and the ifAlreadyInstalled option was set to ${n}`)}}return await e.mv(_,b),{assetFolderPath:b,assetFolderName:p}}finally{await e.rmdir(u,{recursive:!0})}}function Mr(e){const t=e.split(".").shift().replace(/-/g," ");return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}const $i=async(e,{pluginZipFile:t,ifAlreadyInstalled:r,options:n={}},s)=>{const i=t.name.split("/").pop()||"plugin.zip",o=Mr(i);s==null||s.tracker.setCaption(`Installing the ${o} plugin`);const{assetFolderPath:u}=await gi(e,{ifAlreadyInstalled:r,zipFile:t,targetPath:`${await e.documentRoot}/wp-content/plugins`});("activate"in n?n.activate:!0)&&await Ar(e,{pluginPath:u,pluginName:o},s)},_i=async(e,{themeZipFile:t,ifAlreadyInstalled:r,options:n={}},s)=>{const i=Mr(t.name);s==null||s.tracker.setCaption(`Installing the ${i} theme`);const{assetFolderName:o}=await gi(e,{ifAlreadyInstalled:r,zipFile:t,targetPath:`${await e.documentRoot}/wp-content/themes`});("activate"in n?n.activate:!0)&&await hn(e,{themeFolderName:o},s),("importStarterContent"in n?n.importStarterContent:!1)&&await _n(e,{themeSlug:o},s)},wi=async(e,t,r)=>{var s;(s=r==null?void 0:r.tracker)==null||s.setCaption("Resetting WordPress data");const n=await e.documentRoot;await e.run({env:{DOCROOT:n},code:`<?php
506
553
  require getenv('DOCROOT') . '/wp-load.php';
507
554
 
508
555
  $GLOBALS['@pdo']->query('DELETE FROM wp_posts WHERE id > 0');
@@ -516,11 +563,11 @@ echo json_encode($deactivated_plugins);
516
563
 
517
564
  $GLOBALS['@pdo']->query('DELETE FROM wp_commentmeta');
518
565
  $GLOBALS['@pdo']->query("UPDATE SQLITE_SEQUENCE SET SEQ=0 WHERE NAME='wp_commentmeta'");
519
- `})},_i=async(e,{options:t})=>{await e.request({url:"/wp-admin/install.php?step=2",method:"POST",body:{language:"en",prefix:"wp_",weblog_title:"My WordPress Website",user_name:t.adminPassword||"admin",admin_password:t.adminPassword||"password",admin_password2:t.adminPassword||"password",Submit:"Install WordPress",pw_weak:"1",admin_email:"admin@localhost.com"}})},wi=async(e,{selfContained:t=!1}={})=>{const r="/tmp/wordpress-playground.zip",n=await e.documentRoot,s=ue(n,"wp-content");let i=pn;t&&(i=i.filter(f=>!f.startsWith("themes/twenty")).filter(f=>f!=="mu-plugins/sqlite-database-integration"));const o=Zt({zipPath:r,wpContentPath:s,documentRoot:n,exceptPaths:i.map(f=>ue(n,"wp-content",f)),additionalPaths:t?{[ue(n,"wp-config.php")]:"wp-config.php"}:{}});await ea(e,`zipDir(${o.wpContentPath}, ${o.zipPath}, array(
566
+ `})},vi=async(e,{options:t})=>{await e.request({url:"/wp-admin/install.php?step=2",method:"POST",body:{language:"en",prefix:"wp_",weblog_title:"My WordPress Website",user_name:t.adminPassword||"admin",admin_password:t.adminPassword||"password",admin_password2:t.adminPassword||"password",Submit:"Install WordPress",pw_weak:"1",admin_email:"admin@localhost.com"}})},bi=async(e,{selfContained:t=!1}={})=>{const r="/tmp/wordpress-playground.zip",n=await e.documentRoot,s=de(n,"wp-content");let i=pn;t&&(i=i.filter(f=>!f.startsWith("themes/twenty")).filter(f=>f!=="mu-plugins/sqlite-database-integration"));const o=Zt({zipPath:r,wpContentPath:s,documentRoot:n,exceptPaths:i.map(f=>de(n,"wp-content",f)),additionalPaths:t?{[de(n,"wp-config.php")]:"wp-config.php"}:{}});await ra(e,`zipDir(${o.wpContentPath}, ${o.zipPath}, array(
520
567
  'exclude_paths' => ${o.exceptPaths},
521
568
  'zip_root' => ${o.documentRoot},
522
569
  'additional_paths' => ${o.additionalPaths}
523
- ));`);const u=await e.readFileAsBuffer(r);return e.unlink(r),u},Xo=`<?php
570
+ ));`);const u=await e.readFileAsBuffer(r);return e.unlink(r),u},ta=`<?php
524
571
 
525
572
  function zipDir($root, $output, $options = array())
526
573
  {
@@ -579,7 +626,7 @@ function join_paths()
579
626
 
580
627
  return preg_replace('#/+#', '/', join('/', $paths));
581
628
  }
582
- `;async function ea(e,t){return await e.run({code:Xo+t})}const vi=async(e,{command:t,wpCliPath:r="/tmp/wp-cli.phar"})=>{if(!await e.fileExists(r))throw new Error(`wp-cli.phar not found at ${r}`);let n;if(typeof t=="string"?(t=t.trim(),n=ta(t)):n=t,n.shift()!=="wp")throw new Error('The first argument must be "wp".');await e.writeFile("/tmp/stdout",""),await e.writeFile("/tmp/stderr",""),await e.writeFile("/wordpress/run-cli.php",`<?php
629
+ `;async function ra(e,t){return await e.run({code:ta+t})}const Ei=async(e,{command:t,wpCliPath:r="/tmp/wp-cli.phar"})=>{if(!await e.fileExists(r))throw new Error(`wp-cli.phar not found at ${r}`);let n;if(typeof t=="string"?(t=t.trim(),n=na(t)):n=t,n.shift()!=="wp")throw new Error('The first argument must be "wp".');await e.writeFile("/tmp/stdout",""),await e.writeFile("/tmp/stderr",""),await e.writeFile("/wordpress/run-cli.php",`<?php
583
630
  // Set up the environment to emulate a shell script
584
631
  // call.
585
632
 
@@ -592,7 +639,7 @@ function join_paths()
592
639
  $GLOBALS['argv'] = array_merge([
593
640
  "/tmp/wp-cli.phar",
594
641
  "--path=/wordpress"
595
- ], ${pe(n)});
642
+ ], ${ae(n)});
596
643
 
597
644
  // Provide stdin, stdout, stderr streams outside of
598
645
  // the CLI SAPI.
@@ -600,10 +647,48 @@ function join_paths()
600
647
  define('STDOUT', fopen('php://stdout', 'wb'));
601
648
  define('STDERR', fopen('php://stderr', 'wb'));
602
649
 
603
- require( ${pe(r)} );
604
- `);const i=await e.run({scriptPath:"/wordpress/run-cli.php"});if(i.errors)throw new Error(i.errors);return i};function ta(e){let n=0,s="";const i=[];let o="";for(let u=0;u<e.length;u++){const f=e[u];n===0?f==='"'||f==="'"?(n=1,s=f):f.match(/\s/)?(o&&i.push(o),o=""):o+=f:n===1&&(f==="\\"?(u++,o+=e[u]):f===s?(n=0,s=""):o+=f)}return o&&i.push(o),i}const ra=Object.freeze(Object.defineProperty({__proto__:null,activatePlugin:Ar,activateTheme:hn,cp:ci,defineSiteUrl:$n,defineWpConfigConsts:Qt,enableMultisite:ai,exportWXR:hi,importWordPressFiles:pi,importWxr:fi,installPlugin:yi,installTheme:gi,login:Er,mkdir:ui,mv:li,request:br,resetData:$i,rm:mn,rmdir:di,runPHP:ri,runPHPWithOptions:ni,runSql:si,runWpInstallationWizard:_i,setSiteOptions:yn,unzip:Dr,updateUserMeta:ii,wpCLI:vi,writeFile:gn,zipWpContent:wi},Symbol.toStringTag,{value:"Module"})),na=5*1024*1024;function sa(e,t){const r=e.headers.get("content-length")||"",n=parseInt(r,10)||na;function s(i,o){t(new CustomEvent("progress",{detail:{loaded:i,total:o}}))}return new Response(new ReadableStream({async start(i){if(!e.body){i.close();return}const o=e.body.getReader();let u=0;for(;;)try{const{done:f,value:l}=await o.read();if(l&&(u+=l.byteLength),f){s(u,u),i.close();break}else s(u,n),i.enqueue(l)}catch(f){ye.error({e:f}),i.error(f);break}}}),{status:e.status,statusText:e.statusText,headers:e.headers})}const Br=1e-5;class Lr extends EventTarget{constructor({weight:t=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=t,this._selfCaption=r,this._fillTime=n}stage(t,r=""){if(t||(t=this._selfWeight),this._selfWeight-t<-Br)throw new Error(`Cannot add a stage with weight ${t} as the total weight of registered stages would exceed 1.`);this._selfWeight-=t;const n=new Lr({caption:r,weight:t,fillTime:this._fillTime});return this._subTrackers.push(n),n.addEventListener("progress",()=>this.notifyProgress()),n.addEventListener("done",()=>{this.done&&this.notifyDone()}),n}fillSlowly({stopBeforeFinishing:t=!0}={}){if(this._isFilling)return;this._isFilling=!0;const r=100,n=this._fillTime/r;this._fillInterval=setInterval(()=>{this.set(this._selfProgress+1),t&&this._selfProgress>=99&&clearInterval(this._fillInterval)},n)}set(t){this._selfProgress=Math.min(t,100),this.notifyProgress(),this._selfProgress+Br>=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 t=this._subTrackers.length-1;t>=0;t--)if(!this._subTrackers[t].done){const r=this._subTrackers[t].caption;if(r)return r}return this._selfCaption}setCaption(t){this._selfCaption=t,this.notifyProgress()}get done(){return this.progress+Br>=100}get progress(){if(this._selfDone)return 100;const t=this._subTrackers.reduce((r,n)=>r+n.progress*n.weight,this._selfProgress*this._selfWeight);return Math.round(t*1e4)/1e4}get weight(){return this._weight}get observer(){return this._progressObserver||(this._progressObserver=t=>{this.set(t)}),this._progressObserver}get loadingListener(){return this._loadingListener||(this._loadingListener=t=>{this.set(t.detail.loaded/t.detail.total*100)}),this._loadingListener}pipe(t){t.setProgress({progress:this.progress,caption:this.caption}),this.addEventListener("progress",r=>{t.setProgress({progress:r.detail.progress,caption:r.detail.caption})}),this.addEventListener("done",()=>{t.setLoaded()})}addEventListener(t,r){super.addEventListener(t,r)}removeEventListener(t,r){super.removeEventListener(t,r)}notifyProgress(){const t=this;this.dispatchEvent(new CustomEvent("progress",{detail:{get progress(){return t.progress},get caption(){return t.caption}}}))}notifyDone(){this.dispatchEvent(new CustomEvent("done"))}}const Pr={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 ia(e){const t=typeof e=="object"?e==null?void 0:e.errno:null;if(t in Pr)return Pr[t]}function Ue(e=""){return function(r,n,s){const i=s.value;s.value=function(...o){try{return i.apply(this,o)}catch(u){const f=typeof u=="object"?u==null?void 0:u.errno:null;if(f in Pr){const l=Pr[f],d=typeof o[1]=="string"?o[1]:null,p=d!==null?e.replaceAll("{path}",d):e;throw new Error(`${p}: ${l}`,{cause:u})}throw u}}}}var oa=Object.defineProperty,aa=Object.getOwnPropertyDescriptor,Ve=(e,t,r,n)=>{for(var s=n>1?void 0:n?aa(t,r):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(n?o(t,r,s):o(s))||s);return n&&s&&oa(t,r,s),s};const ze=class Te{static readFileAsText(t,r){return new TextDecoder().decode(Te.readFileAsBuffer(t,r))}static readFileAsBuffer(t,r){return t.readFile(r)}static writeFile(t,r,n){t.writeFile(r,n)}static unlink(t,r){t.unlink(r)}static mv(t,r,n){try{const s=t.lookupPath(r).node.mount,i=Te.fileExists(t,n)?t.lookupPath(n).node.mount:t.lookupPath(Zs(n)).node.mount;s.mountpoint!==i.mountpoint?(Te.copyRecursive(t,r,n),Te.rmdir(t,r,{recursive:!0})):t.rename(r,n)}catch(s){const i=ia(s);throw i?new Error(`Could not move ${r} to ${n}: ${i}`,{cause:s}):s}}static rmdir(t,r,n={recursive:!0}){n!=null&&n.recursive&&Te.listFiles(t,r).forEach(s=>{const i=`${r}/${s}`;Te.isDir(t,i)?Te.rmdir(t,i,n):Te.unlink(t,i)}),t.rmdir(r)}static listFiles(t,r,n={prependPath:!1}){if(!Te.fileExists(t,r))return[];try{const s=t.readdir(r).filter(i=>i!=="."&&i!=="..");if(n.prependPath){const i=r.replace(/\/$/,"");return s.map(o=>`${i}/${o}`)}return s}catch(s){return ye.error(s,{path:r}),[]}}static isDir(t,r){return Te.fileExists(t,r)?t.isDir(t.lookupPath(r).node.mode):!1}static fileExists(t,r){try{return t.lookupPath(r),!0}catch{return!1}}static mkdir(t,r){t.mkdirTree(r)}static copyRecursive(t,r,n){const s=t.lookupPath(r).node;if(t.isDir(s.mode)){t.mkdirTree(n);const i=t.readdir(r).filter(o=>o!=="."&&o!=="..");for(const o of i)Te.copyRecursive(t,ue(r,o),ue(n,o))}else t.writeFile(n,t.readFile(r))}};Ve([Ue('Could not read "{path}"')],ze,"readFileAsText",1);Ve([Ue('Could not read "{path}"')],ze,"readFileAsBuffer",1);Ve([Ue('Could not write to "{path}"')],ze,"writeFile",1);Ve([Ue('Could not unlink "{path}"')],ze,"unlink",1);Ve([Ue('Could not remove directory "{path}"')],ze,"rmdir",1);Ve([Ue('Could not list files in "{path}"')],ze,"listFiles",1);Ve([Ue('Could not stat "{path}"')],ze,"isDir",1);Ve([Ue('Could not stat "{path}"')],ze,"fileExists",1);Ve([Ue('Could not create directory "{path}"')],ze,"mkdir",1);Ve([Ue('Could not copy files from "{path}"')],ze,"copyRecursive",1);const ca={500:"Internal Server Error",502:"Bad Gateway",404:"Not Found",403:"Forbidden",401:"Unauthorized",400:"Bad Request",301:"Moved Permanently",302:"Found",307:"Temporary Redirect",308:"Permanent Redirect",204:"No Content",201:"Created",200:"OK"};class Sr{constructor(t,r,n,s="",i=0){this.httpStatusCode=t,this.headers=r,this.bytes=n,this.exitCode=i,this.errors=s}static forHttpCode(t,r=""){return new Sr(t,{},new TextEncoder().encode(r||ca[t]||""))}static fromRawData(t){return new Sr(t.httpStatusCode,t.headers,t.bytes,t.errors,t.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)}}(function(){var e;return typeof process<"u"&&((e=process.release)==null?void 0:e.name)==="node"?"NODE":typeof window<"u"?"WEB":typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?"WORKER":"NODE"})();const bs="/internal/shared/php.ini";var la=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ua(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}const{hasOwnProperty:Gr}=Object.prototype,nn=(e,t={})=>{typeof t=="string"&&(t={section:t}),t.align=t.align===!0,t.newline=t.newline===!0,t.sort=t.sort===!0,t.whitespace=t.whitespace===!0||t.align===!0,t.platform=t.platform||typeof process<"u"&&process.platform,t.bracketedArray=t.bracketedArray!==!1;const r=t.platform==="win32"?`\r
650
+ require( ${ae(r)} );
651
+ `);const i=await e.run({scriptPath:"/wordpress/run-cli.php"});if(i.errors)throw new Error(i.errors);return i};function na(e){let n=0,s="";const i=[];let o="";for(let u=0;u<e.length;u++){const f=e[u];n===0?f==='"'||f==="'"?(n=1,s=f):f.match(/\s/)?(o&&i.push(o),o=""):o+=f:n===1&&(f==="\\"?(u++,o+=e[u]):f===s?(n=0,s=""):o+=f)}return o&&i.push(o),i}const Pi=async(e,{language:t},r)=>{r==null||r.tracker.setCaption((r==null?void 0:r.initialCaption)||"Translating"),await e.defineConstant("WPLANG",t);const n=await e.documentRoot,i=[{url:`https://downloads.wordpress.org/translation/core/${(await e.run({code:`<?php
652
+ require '${n}/wp-includes/version.php';
653
+ echo $wp_version;
654
+ `})).text}/${t}.zip`,type:"core"}],u=(await e.run({code:`<?php
655
+ require_once('${n}/wp-load.php');
656
+ require_once('${n}/wp-admin/includes/plugin.php');
657
+ echo json_encode(
658
+ array_values(
659
+ array_map(
660
+ function($plugin) {
661
+ return [
662
+ 'slug' => $plugin['TextDomain'],
663
+ 'version' => $plugin['Version']
664
+ ];
665
+ },
666
+ array_filter(
667
+ get_plugins(),
668
+ function($plugin) {
669
+ return !empty($plugin['TextDomain']);
670
+ }
671
+ )
672
+ )
673
+ )
674
+ );`})).json;for(const{slug:d,version:p}of u)i.push({url:`https://downloads.wordpress.org/translation/plugin/${d}/${p}/${t}.zip`,type:"plugin"});const l=(await e.run({code:`<?php
675
+ require_once('${n}/wp-load.php');
676
+ require_once('${n}/wp-admin/includes/theme.php');
677
+ echo json_encode(
678
+ array_values(
679
+ array_map(
680
+ function($theme) {
681
+ return [
682
+ 'slug' => $theme->get('TextDomain'),
683
+ 'version' => $theme->get('Version')
684
+ ];
685
+ },
686
+ wp_get_themes()
687
+ )
688
+ )
689
+ );`})).json;for(const{slug:d,version:p}of l)i.push({url:`https://downloads.wordpress.org/translation/theme/${d}/${p}/${t}.zip`,type:"theme"});await e.isDir(`${n}/wp-content/languages/plugins`)||await e.mkdir(`${n}/wp-content/languages/plugins`),await e.isDir(`${n}/wp-content/languages/themes`)||await e.mkdir(`${n}/wp-content/languages/themes`);for(const{url:d,type:p}of i)try{const _=await fetch(d);if(!_.ok)throw new Error(`Failed to download translations for ${p}: ${_.statusText}`);let b=`${n}/wp-content/languages`;p==="plugin"?b+="/plugins":p==="theme"&&(b+="/themes"),await hi(e,new File([await _.blob()],`${t}-${p}.zip`),b)}catch(_){if(p==="core")throw new Error(`Failed to download translations for WordPress. Please check if the language code ${t} is correct. You can find all available languages and translations on https://translate.wordpress.org/.`);he.warn(`Error downloading translations for ${p}: ${_}`)}},sa=Object.freeze(Object.defineProperty({__proto__:null,activatePlugin:Ar,activateTheme:hn,cp:li,defineSiteUrl:$n,defineWpConfigConsts:Qt,enableMultisite:ci,exportWXR:yi,importThemeStarterContent:_n,importWordPressFiles:mi,importWxr:pi,installPlugin:$i,installTheme:_i,login:Er,mkdir:di,mv:ui,request:br,resetData:wi,rm:mn,rmdir:fi,runPHP:ni,runPHPWithOptions:si,runSql:ii,runWpInstallationWizard:vi,setSiteLanguage:Pi,setSiteOptions:yn,unzip:Dr,updateUserMeta:oi,wpCLI:Ei,writeFile:gn,zipWpContent:bi},Symbol.toStringTag,{value:"Module"})),ia=5*1024*1024;function oa(e,t){const r=e.headers.get("content-length")||"",n=parseInt(r,10)||ia;function s(i,o){t(new CustomEvent("progress",{detail:{loaded:i,total:o}}))}return new Response(new ReadableStream({async start(i){if(!e.body){i.close();return}const o=e.body.getReader();let u=0;for(;;)try{const{done:f,value:l}=await o.read();if(l&&(u+=l.byteLength),f){s(u,u),i.close();break}else s(u,n),i.enqueue(l)}catch(f){he.error({e:f}),i.error(f);break}}}),{status:e.status,statusText:e.statusText,headers:e.headers})}const Br=1e-5;class Lr extends EventTarget{constructor({weight:t=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=t,this._selfCaption=r,this._fillTime=n}stage(t,r=""){if(t||(t=this._selfWeight),this._selfWeight-t<-Br)throw new Error(`Cannot add a stage with weight ${t} as the total weight of registered stages would exceed 1.`);this._selfWeight-=t;const n=new Lr({caption:r,weight:t,fillTime:this._fillTime});return this._subTrackers.push(n),n.addEventListener("progress",()=>this.notifyProgress()),n.addEventListener("done",()=>{this.done&&this.notifyDone()}),n}fillSlowly({stopBeforeFinishing:t=!0}={}){if(this._isFilling)return;this._isFilling=!0;const r=100,n=this._fillTime/r;this._fillInterval=setInterval(()=>{this.set(this._selfProgress+1),t&&this._selfProgress>=99&&clearInterval(this._fillInterval)},n)}set(t){this._selfProgress=Math.min(t,100),this.notifyProgress(),this._selfProgress+Br>=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 t=this._subTrackers.length-1;t>=0;t--)if(!this._subTrackers[t].done){const r=this._subTrackers[t].caption;if(r)return r}return this._selfCaption}setCaption(t){this._selfCaption=t,this.notifyProgress()}get done(){return this.progress+Br>=100}get progress(){if(this._selfDone)return 100;const t=this._subTrackers.reduce((r,n)=>r+n.progress*n.weight,this._selfProgress*this._selfWeight);return Math.round(t*1e4)/1e4}get weight(){return this._weight}get observer(){return this._progressObserver||(this._progressObserver=t=>{this.set(t)}),this._progressObserver}get loadingListener(){return this._loadingListener||(this._loadingListener=t=>{this.set(t.detail.loaded/t.detail.total*100)}),this._loadingListener}pipe(t){t.setProgress({progress:this.progress,caption:this.caption}),this.addEventListener("progress",r=>{t.setProgress({progress:r.detail.progress,caption:r.detail.caption})}),this.addEventListener("done",()=>{t.setLoaded()})}addEventListener(t,r){super.addEventListener(t,r)}removeEventListener(t,r){super.removeEventListener(t,r)}notifyProgress(){const t=this;this.dispatchEvent(new CustomEvent("progress",{detail:{get progress(){return t.progress},get caption(){return t.caption}}}))}notifyDone(){this.dispatchEvent(new CustomEvent("done"))}}const Pr={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 aa(e){const t=typeof e=="object"?e==null?void 0:e.errno:null;if(t in Pr)return Pr[t]}function Ue(e=""){return function(r,n,s){const i=s.value;s.value=function(...o){try{return i.apply(this,o)}catch(u){const f=typeof u=="object"?u==null?void 0:u.errno:null;if(f in Pr){const l=Pr[f],d=typeof o[1]=="string"?o[1]:null,p=d!==null?e.replaceAll("{path}",d):e;throw new Error(`${p}: ${l}`,{cause:u})}throw u}}}}var ca=Object.defineProperty,la=Object.getOwnPropertyDescriptor,ze=(e,t,r,n)=>{for(var s=n>1?void 0:n?la(t,r):t,i=e.length-1,o;i>=0;i--)(o=e[i])&&(s=(n?o(t,r,s):o(s))||s);return n&&s&&ca(t,r,s),s};const Ve=class Te{static readFileAsText(t,r){return new TextDecoder().decode(Te.readFileAsBuffer(t,r))}static readFileAsBuffer(t,r){return t.readFile(r)}static writeFile(t,r,n){t.writeFile(r,n)}static unlink(t,r){t.unlink(r)}static mv(t,r,n){try{const s=t.lookupPath(r).node.mount,i=Te.fileExists(t,n)?t.lookupPath(n).node.mount:t.lookupPath(Xs(n)).node.mount;s.mountpoint!==i.mountpoint?(Te.copyRecursive(t,r,n),Te.rmdir(t,r,{recursive:!0})):t.rename(r,n)}catch(s){const i=aa(s);throw i?new Error(`Could not move ${r} to ${n}: ${i}`,{cause:s}):s}}static rmdir(t,r,n={recursive:!0}){n!=null&&n.recursive&&Te.listFiles(t,r).forEach(s=>{const i=`${r}/${s}`;Te.isDir(t,i)?Te.rmdir(t,i,n):Te.unlink(t,i)}),t.rmdir(r)}static listFiles(t,r,n={prependPath:!1}){if(!Te.fileExists(t,r))return[];try{const s=t.readdir(r).filter(i=>i!=="."&&i!=="..");if(n.prependPath){const i=r.replace(/\/$/,"");return s.map(o=>`${i}/${o}`)}return s}catch(s){return he.error(s,{path:r}),[]}}static isDir(t,r){return Te.fileExists(t,r)?t.isDir(t.lookupPath(r).node.mode):!1}static fileExists(t,r){try{return t.lookupPath(r),!0}catch{return!1}}static mkdir(t,r){t.mkdirTree(r)}static copyRecursive(t,r,n){const s=t.lookupPath(r).node;if(t.isDir(s.mode)){t.mkdirTree(n);const i=t.readdir(r).filter(o=>o!=="."&&o!=="..");for(const o of i)Te.copyRecursive(t,de(r,o),de(n,o))}else t.writeFile(n,t.readFile(r))}};ze([Ue('Could not read "{path}"')],Ve,"readFileAsText",1);ze([Ue('Could not read "{path}"')],Ve,"readFileAsBuffer",1);ze([Ue('Could not write to "{path}"')],Ve,"writeFile",1);ze([Ue('Could not unlink "{path}"')],Ve,"unlink",1);ze([Ue('Could not remove directory "{path}"')],Ve,"rmdir",1);ze([Ue('Could not list files in "{path}"')],Ve,"listFiles",1);ze([Ue('Could not stat "{path}"')],Ve,"isDir",1);ze([Ue('Could not stat "{path}"')],Ve,"fileExists",1);ze([Ue('Could not create directory "{path}"')],Ve,"mkdir",1);ze([Ue('Could not copy files from "{path}"')],Ve,"copyRecursive",1);const ua={500:"Internal Server Error",502:"Bad Gateway",404:"Not Found",403:"Forbidden",401:"Unauthorized",400:"Bad Request",301:"Moved Permanently",302:"Found",307:"Temporary Redirect",308:"Permanent Redirect",204:"No Content",201:"Created",200:"OK"};class Sr{constructor(t,r,n,s="",i=0){this.httpStatusCode=t,this.headers=r,this.bytes=n,this.exitCode=i,this.errors=s}static forHttpCode(t,r=""){return new Sr(t,{},new TextEncoder().encode(r||ua[t]||""))}static fromRawData(t){return new Sr(t.httpStatusCode,t.headers,t.bytes,t.errors,t.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)}}(function(){var e;return typeof process<"u"&&((e=process.release)==null?void 0:e.name)==="node"?"NODE":typeof window<"u"?"WEB":typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?"WORKER":"NODE"})();const Es="/internal/shared/php.ini";var da=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}const{hasOwnProperty:Gr}=Object.prototype,nn=(e,t={})=>{typeof t=="string"&&(t={section:t}),t.align=t.align===!0,t.newline=t.newline===!0,t.sort=t.sort===!0,t.whitespace=t.whitespace===!0||t.align===!0,t.platform=t.platform||typeof process<"u"&&process.platform,t.bracketedArray=t.bracketedArray!==!1;const r=t.platform==="win32"?`\r
605
690
  `:`
606
- `,n=t.whitespace?" = ":"=",s=[],i=t.sort?Object.keys(e).sort():Object.keys(e);let o=0;t.align&&(o=He(i.filter(l=>e[l]===null||Array.isArray(e[l])||typeof e[l]!="object").map(l=>Array.isArray(e[l])?`${l}[]`:l).concat([""]).reduce((l,d)=>He(l).length>=He(d).length?l:d)).length);let u="";const f=t.bracketedArray?"[]":"";for(const l of i){const d=e[l];if(d&&Array.isArray(d))for(const p of d)u+=He(`${l}${f}`).padEnd(o," ")+n+He(p)+r;else d&&typeof d=="object"?s.push(l):u+=He(l).padEnd(o," ")+n+He(d)+r}t.section&&u.length&&(u="["+He(t.section)+"]"+(t.newline?r+r:r)+u);for(const l of s){const d=bi(l,".").join("\\."),p=(t.section?t.section+".":"")+d,b=nn(e[l],{...t,section:p});u.length&&b.length&&(u+=r),u+=b}return u};function bi(e,t){var r=0,n=0,s=0,i=[];do if(s=e.indexOf(t,r),s!==-1){if(r=s+t.length,s>0&&e[s-1]==="\\")continue;i.push(e.slice(n,s)),n=s+t.length}while(s!==-1);return i.push(e.slice(n)),i}const Es=(e,t={})=>{t.bracketedArray=t.bracketedArray!==!1;const r=Object.create(null);let n=r,s=null;const i=/^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i,o=e.split(/[\r\n]+/g),u={};for(const l of o){if(!l||l.match(/^\s*[;#]/)||l.match(/^\s*$/))continue;const d=l.match(i);if(!d)continue;if(d[1]!==void 0){if(s=mr(d[1]),s==="__proto__"){n=Object.create(null);continue}n=r[s]=r[s]||Object.create(null);continue}const p=mr(d[2]);let b;t.bracketedArray?b=p.length>2&&p.slice(-2)==="[]":(u[p]=((u==null?void 0:u[p])||0)+1,b=u[p]>1);const E=b?p.slice(0,-2):p;if(E==="__proto__")continue;const P=d[3]?mr(d[4]):!0,O=P==="true"||P==="false"||P==="null"?JSON.parse(P):P;b&&(Gr.call(n,E)?Array.isArray(n[E])||(n[E]=[n[E]]):n[E]=[]),Array.isArray(n[E])?n[E].push(O):n[E]=O}const f=[];for(const l of Object.keys(r)){if(!Gr.call(r,l)||typeof r[l]!="object"||Array.isArray(r[l]))continue;const d=bi(l,".");n=r;const p=d.pop(),b=p.replace(/\\\./g,".");for(const E of d)E!=="__proto__"&&((!Gr.call(n,E)||typeof n[E]!="object")&&(n[E]=Object.create(null)),n=n[E]);n===r&&b===p||(n[b]=r[l],f.push(l))}for(const l of f)delete r[l];return r},Ei=e=>e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"),He=e=>typeof e!="string"||e.match(/[=\r\n]/)||e.match(/^\[/)||e.length>1&&Ei(e)||e!==e.trim()?JSON.stringify(e):e.split(";").join("\\;").split("#").join("\\#"),mr=e=>{if(e=(e||"").trim(),Ei(e)){e.charAt(0)==="'"&&(e=e.slice(1,-1));try{e=JSON.parse(e)}catch{}}else{let t=!1,r="";for(let n=0,s=e.length;n<s;n++){const i=e.charAt(n);if(t)"\\;#".indexOf(i)!==-1?r+=i:r+="\\"+i,t=!1;else{if(";#".indexOf(i)!==-1)break;i==="\\"?t=!0:r+=i}}return t&&(r+="\\"),r.trim()}return e};var Ps={parse:Es,decode:Es,stringify:nn,encode:nn,safe:He,unsafe:mr};async function da(e,t){const r=Ps.parse(await e.readFileAsText(bs));for(const[n,s]of Object.entries(t))s==null?delete r[n]:r[n]=s;await e.writeFile(bs,Ps.stringify(r))}ReadableStream.prototype[Symbol.asyncIterator]||(ReadableStream.prototype[Symbol.asyncIterator]=async function*(){const e=this.getReader();try{for(;;){const{done:t,value:r}=await e.read();if(t)return;yield r}}finally{e.releaseLock()}},ReadableStream.prototype.iterate=ReadableStream.prototype[Symbol.asyncIterator]);const Fr=["8.3","8.2","8.1","8.0","7.4","7.3","7.2","7.1","7.0"],Pi=Fr[0],fa=Fr,Si=["iconv","mbstring","xml-bundle","gd"],Ss={"kitchen-sink":Si,light:[]},pa=["vfs","literal","wordpress.org/themes","wordpress.org/plugins","url"];function ha(e){return e&&typeof e=="object"&&typeof e.resource=="string"&&pa.includes(e.resource)}class ft{static create(t,{semaphore:r,progress:n}){let s;switch(t.resource){case"vfs":s=new ma(t,n);break;case"literal":s=new ya(t,n);break;case"wordpress.org/themes":s=new _a(t,n);break;case"wordpress.org/plugins":s=new wa(t,n);break;case"url":s=new $a(t,n);break;default:throw new Error(`Invalid resource: ${t}`)}return s=new va(s),r&&(s=new ba(s,r)),s}setPlayground(t){this.playground=t}get isAsync(){return!1}}class ma extends ft{constructor(t,r){super(),this.resource=t,this.progress=r}async resolve(){var r;const t=await this.playground.readFileAsBuffer(this.resource.path);return(r=this.progress)==null||r.set(100),new File([t],this.name)}get name(){return this.resource.path.split("/").pop()||""}}class ya extends ft{constructor(t,r){super(),this.resource=t,this.progress=r}async resolve(){var t;return(t=this.progress)==null||t.set(100),new File([this.resource.contents],this.resource.name)}get name(){return this.resource.name}}class _n extends ft{constructor(t){super(),this.progress=t}async resolve(){var r,n;(r=this.progress)==null||r.setCaption(this.caption);const t=this.getURL();try{let s=await fetch(t);if(!s.ok)throw new Error(`Could not download "${t}"`);if(s=await sa(s,((n=this.progress)==null?void 0:n.loadingListener)??ga),s.status!==200)throw new Error(`Could not download "${t}"`);return new File([await s.blob()],this.name)}catch(s){throw new Error(`Could not download "${t}".
691
+ `,n=t.whitespace?" = ":"=",s=[],i=t.sort?Object.keys(e).sort():Object.keys(e);let o=0;t.align&&(o=He(i.filter(l=>e[l]===null||Array.isArray(e[l])||typeof e[l]!="object").map(l=>Array.isArray(e[l])?`${l}[]`:l).concat([""]).reduce((l,d)=>He(l).length>=He(d).length?l:d)).length);let u="";const f=t.bracketedArray?"[]":"";for(const l of i){const d=e[l];if(d&&Array.isArray(d))for(const p of d)u+=He(`${l}${f}`).padEnd(o," ")+n+He(p)+r;else d&&typeof d=="object"?s.push(l):u+=He(l).padEnd(o," ")+n+He(d)+r}t.section&&u.length&&(u="["+He(t.section)+"]"+(t.newline?r+r:r)+u);for(const l of s){const d=Si(l,".").join("\\."),p=(t.section?t.section+".":"")+d,_=nn(e[l],{...t,section:p});u.length&&_.length&&(u+=r),u+=_}return u};function Si(e,t){var r=0,n=0,s=0,i=[];do if(s=e.indexOf(t,r),s!==-1){if(r=s+t.length,s>0&&e[s-1]==="\\")continue;i.push(e.slice(n,s)),n=s+t.length}while(s!==-1);return i.push(e.slice(n)),i}const Ps=(e,t={})=>{t.bracketedArray=t.bracketedArray!==!1;const r=Object.create(null);let n=r,s=null;const i=/^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i,o=e.split(/[\r\n]+/g),u={};for(const l of o){if(!l||l.match(/^\s*[;#]/)||l.match(/^\s*$/))continue;const d=l.match(i);if(!d)continue;if(d[1]!==void 0){if(s=mr(d[1]),s==="__proto__"){n=Object.create(null);continue}n=r[s]=r[s]||Object.create(null);continue}const p=mr(d[2]);let _;t.bracketedArray?_=p.length>2&&p.slice(-2)==="[]":(u[p]=((u==null?void 0:u[p])||0)+1,_=u[p]>1);const b=_?p.slice(0,-2):p;if(b==="__proto__")continue;const P=d[3]?mr(d[4]):!0,O=P==="true"||P==="false"||P==="null"?JSON.parse(P):P;_&&(Gr.call(n,b)?Array.isArray(n[b])||(n[b]=[n[b]]):n[b]=[]),Array.isArray(n[b])?n[b].push(O):n[b]=O}const f=[];for(const l of Object.keys(r)){if(!Gr.call(r,l)||typeof r[l]!="object"||Array.isArray(r[l]))continue;const d=Si(l,".");n=r;const p=d.pop(),_=p.replace(/\\\./g,".");for(const b of d)b!=="__proto__"&&((!Gr.call(n,b)||typeof n[b]!="object")&&(n[b]=Object.create(null)),n=n[b]);n===r&&_===p||(n[_]=r[l],f.push(l))}for(const l of f)delete r[l];return r},Ti=e=>e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"),He=e=>typeof e!="string"||e.match(/[=\r\n]/)||e.match(/^\[/)||e.length>1&&Ti(e)||e!==e.trim()?JSON.stringify(e):e.split(";").join("\\;").split("#").join("\\#"),mr=e=>{if(e=(e||"").trim(),Ti(e)){e.charAt(0)==="'"&&(e=e.slice(1,-1));try{e=JSON.parse(e)}catch{}}else{let t=!1,r="";for(let n=0,s=e.length;n<s;n++){const i=e.charAt(n);if(t)"\\;#".indexOf(i)!==-1?r+=i:r+="\\"+i,t=!1;else{if(";#".indexOf(i)!==-1)break;i==="\\"?t=!0:r+=i}}return t&&(r+="\\"),r.trim()}return e};var Ss={parse:Ps,decode:Ps,stringify:nn,encode:nn,safe:He,unsafe:mr};async function pa(e,t){const r=Ss.parse(await e.readFileAsText(Es));for(const[n,s]of Object.entries(t))s==null?delete r[n]:r[n]=s;await e.writeFile(Es,Ss.stringify(r))}ReadableStream.prototype[Symbol.asyncIterator]||(ReadableStream.prototype[Symbol.asyncIterator]=async function*(){const e=this.getReader();try{for(;;){const{done:t,value:r}=await e.read();if(t)return;yield r}}finally{e.releaseLock()}},ReadableStream.prototype.iterate=ReadableStream.prototype[Symbol.asyncIterator]);const Fr=["8.3","8.2","8.1","8.0","7.4","7.3","7.2","7.1","7.0"],Ri=Fr[0],ha=Fr,ki=["iconv","mbstring","xml-bundle","gd"],Ts={"kitchen-sink":ki,light:[]},ma=["vfs","literal","wordpress.org/themes","wordpress.org/plugins","url"];function ya(e){return e&&typeof e=="object"&&typeof e.resource=="string"&&ma.includes(e.resource)}class ft{static create(t,{semaphore:r,progress:n}){let s;switch(t.resource){case"vfs":s=new ga(t,n);break;case"literal":s=new $a(t,n);break;case"wordpress.org/themes":s=new va(t,n);break;case"wordpress.org/plugins":s=new ba(t,n);break;case"url":s=new wa(t,n);break;default:throw new Error(`Invalid resource: ${t}`)}return s=new Ea(s),r&&(s=new Pa(s,r)),s}setPlayground(t){this.playground=t}get isAsync(){return!1}}class ga extends ft{constructor(t,r){super(),this.resource=t,this.progress=r}async resolve(){var r;const t=await this.playground.readFileAsBuffer(this.resource.path);return(r=this.progress)==null||r.set(100),new File([t],this.name)}get name(){return this.resource.path.split("/").pop()||""}}class $a extends ft{constructor(t,r){super(),this.resource=t,this.progress=r}async resolve(){var t;return(t=this.progress)==null||t.set(100),new File([this.resource.contents],this.resource.name)}get name(){return this.resource.name}}class wn extends ft{constructor(t){super(),this.progress=t}async resolve(){var r,n;(r=this.progress)==null||r.setCaption(this.caption);const t=this.getURL();try{let s=await fetch(t);if(!s.ok)throw new Error(`Could not download "${t}"`);if(s=await oa(s,((n=this.progress)==null?void 0:n.loadingListener)??_a),s.status!==200)throw new Error(`Could not download "${t}"`);return new File([await s.blob()],this.name)}catch(s){throw new Error(`Could not download "${t}".
607
692
  Check if the URL is correct and the server is reachable.
608
693
  If it is reachable, the server might be blocking the request.
609
694
  Check the browser console and network tabs for more information.
@@ -627,21 +712,21 @@ function join_paths()
627
712
  https://raw.githubusercontent.com/username/repository/branch/filename
628
713
 
629
714
  Error:
630
- ${s}`)}}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 ga=()=>{};class $a extends _n{constructor(t,r){super(r),this.resource=t}getURL(){return this.resource.url}get caption(){return this.resource.caption??super.caption}}class _a extends _n{constructor(t,r){super(r),this.resource=t}get name(){return Mr(this.resource.slug)}getURL(){return`https://downloads.wordpress.org/theme/${Ti(this.resource.slug)}`}}class wa extends _n{constructor(t,r){super(r),this.resource=t}get name(){return Mr(this.resource.slug)}getURL(){return`https://downloads.wordpress.org/plugin/${Ti(this.resource.slug)}`}}function Ti(e){return!e||e.endsWith(".zip")?e:e+".latest-stable.zip"}class Ri extends ft{constructor(t){super(),this.resource=t}async resolve(){return this.resource.resolve()}async setPlayground(t){return this.resource.setPlayground(t)}get progress(){return this.resource.progress}set progress(t){this.resource.progress=t}get name(){return this.resource.name}get isAsync(){return this.resource.isAsync}}class va extends Ri{async resolve(){return this.promise||(this.promise=super.resolve()),this.promise}}class ba extends Ri{constructor(t,r){super(t),this.semaphore=r}async resolve(){return this.isAsync?this.semaphore.run(()=>super.resolve()):super.resolve()}}var sn={exports:{}},ki={},Ne={},kt={},Xt={},B={},Yt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor($){if(super(),!e.IDENTIFIER.test($))throw new Error("CodeGen: name must be a valid identifier");this.str=$}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor($){super(),this._items=typeof $=="string"?[$]:$}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const $=this._items[0];return $===""||$==='""'}get str(){var $;return($=this._str)!==null&&$!==void 0?$:this._str=this._items.reduce((S,I)=>`${S}${I}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((S,I)=>(I instanceof r&&(S[I.str]=(S[I.str]||0)+1),S),{})}}e._Code=n,e.nil=new n("");function s(g,...$){const S=[g[0]];let I=0;for(;I<$.length;)u(S,$[I]),S.push(g[++I]);return new n(S)}e._=s;const i=new n("+");function o(g,...$){const S=[E(g[0])];let I=0;for(;I<$.length;)S.push(i),u(S,$[I]),S.push(i,E(g[++I]));return f(S),new n(S)}e.str=o;function u(g,$){$ instanceof n?g.push(...$._items):$ instanceof r?g.push($):g.push(p($))}e.addCodeArg=u;function f(g){let $=1;for(;$<g.length-1;){if(g[$]===i){const S=l(g[$-1],g[$+1]);if(S!==void 0){g.splice($-1,3,S);continue}g[$++]="+"}$++}}function l(g,$){if($==='""')return g;if(g==='""')return $;if(typeof g=="string")return $ instanceof r||g[g.length-1]!=='"'?void 0:typeof $!="string"?`${g.slice(0,-1)}${$}"`:$[0]==='"'?g.slice(0,-1)+$.slice(1):void 0;if(typeof $=="string"&&$[0]==='"'&&!(g instanceof r))return`"${g}${$.slice(1)}`}function d(g,$){return $.emptyStr()?g:g.emptyStr()?$:o`${g}${$}`}e.strConcat=d;function p(g){return typeof g=="number"||typeof g=="boolean"||g===null?g:E(Array.isArray(g)?g.join(","):g)}function b(g){return new n(E(g))}e.stringify=b;function E(g){return JSON.stringify(g).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=E;function P(g){return typeof g=="string"&&e.IDENTIFIER.test(g)?new n(`.${g}`):s`[${g}]`}e.getProperty=P;function O(g){if(typeof g=="string"&&e.IDENTIFIER.test(g))return new n(`${g}`);throw new Error(`CodeGen: invalid export name: ${g}, use explicit $id name mapping`)}e.getEsmExportName=O;function _(g){return new n(g.toString())}e.regexpCode=_})(Yt);var on={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=Yt;class r extends Error{constructor(l){super(`CodeGen: "code" for ${l} not defined`),this.value=l.value}}var n;(function(f){f[f.Started=0]="Started",f[f.Completed=1]="Completed"})(n=e.UsedValueState||(e.UsedValueState={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class s{constructor({prefixes:l,parent:d}={}){this._names={},this._prefixes=l,this._parent=d}toName(l){return l instanceof t.Name?l:this.name(l)}name(l){return new t.Name(this._newName(l))}_newName(l){const d=this._names[l]||this._nameGroup(l);return`${l}${d.index++}`}_nameGroup(l){var d,p;if(!((p=(d=this._parent)===null||d===void 0?void 0:d._prefixes)===null||p===void 0)&&p.has(l)||this._prefixes&&!this._prefixes.has(l))throw new Error(`CodeGen: prefix "${l}" is not allowed in this scope`);return this._names[l]={prefix:l,index:0}}}e.Scope=s;class i extends t.Name{constructor(l,d){super(d),this.prefix=l}setValue(l,{property:d,itemIndex:p}){this.value=l,this.scopePath=(0,t._)`.${new t.Name(d)}[${p}]`}}e.ValueScopeName=i;const o=(0,t._)`\n`;class u extends s{constructor(l){super(l),this._values={},this._scope=l.scope,this.opts={...l,_n:l.lines?o:t.nil}}get(){return this._scope}name(l){return new i(l,this._newName(l))}value(l,d){var p;if(d.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const b=this.toName(l),{prefix:E}=b,P=(p=d.key)!==null&&p!==void 0?p:d.ref;let O=this._values[E];if(O){const $=O.get(P);if($)return $}else O=this._values[E]=new Map;O.set(P,b);const _=this._scope[E]||(this._scope[E]=[]),g=_.length;return _[g]=d.ref,b.setValue(d,{property:E,itemIndex:g}),b}getValue(l,d){const p=this._values[l];if(p)return p.get(d)}scopeRefs(l,d=this._values){return this._reduceValues(d,p=>{if(p.scopePath===void 0)throw new Error(`CodeGen: name "${p}" has no value`);return(0,t._)`${l}${p.scopePath}`})}scopeCode(l=this._values,d,p){return this._reduceValues(l,b=>{if(b.value===void 0)throw new Error(`CodeGen: name "${b}" has no value`);return b.value.code},d,p)}_reduceValues(l,d,p={},b){let E=t.nil;for(const P in l){const O=l[P];if(!O)continue;const _=p[P]=p[P]||new Map;O.forEach(g=>{if(_.has(g))return;_.set(g,n.Started);let $=d(g);if($){const S=this.opts.es5?e.varKinds.var:e.varKinds.const;E=(0,t._)`${E}${S} ${g} = ${$};${this.opts._n}`}else if($=b==null?void 0:b(g))E=(0,t._)`${E}${$}${this.opts._n}`;else throw new r(g);_.set(g,n.Completed)})}return E}}e.ValueScope=u})(on);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=Yt,r=on;var n=Yt;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var s=on;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class i{optimizeNodes(){return this}optimizeNames(a,m){return this}}class o extends i{constructor(a,m,N){super(),this.varKind=a,this.name=m,this.rhs=N}render({es5:a,_n:m}){const N=a?r.varKinds.var:this.varKind,L=this.rhs===void 0?"":` = ${this.rhs}`;return`${N} ${this.name}${L};`+m}optimizeNames(a,m){if(a[this.name.str])return this.rhs&&(this.rhs=de(this.rhs,a,m)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class u extends i{constructor(a,m,N){super(),this.lhs=a,this.rhs=m,this.sideEffects=N}render({_n:a}){return`${this.lhs} = ${this.rhs};`+a}optimizeNames(a,m){if(!(this.lhs instanceof t.Name&&!a[this.lhs.str]&&!this.sideEffects))return this.rhs=de(this.rhs,a,m),this}get names(){const a=this.lhs instanceof t.Name?{}:{...this.lhs.names};return Ee(a,this.rhs)}}class f extends u{constructor(a,m,N,L){super(a,N,L),this.op=m}render({_n:a}){return`${this.lhs} ${this.op}= ${this.rhs};`+a}}class l extends i{constructor(a){super(),this.label=a,this.names={}}render({_n:a}){return`${this.label}:`+a}}class d extends i{constructor(a){super(),this.label=a,this.names={}}render({_n:a}){return`break${this.label?` ${this.label}`:""};`+a}}class p extends i{constructor(a){super(),this.error=a}render({_n:a}){return`throw ${this.error};`+a}get names(){return this.error.names}}class b extends i{constructor(a){super(),this.code=a}render({_n:a}){return`${this.code};`+a}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(a,m){return this.code=de(this.code,a,m),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class E extends i{constructor(a=[]){super(),this.nodes=a}render(a){return this.nodes.reduce((m,N)=>m+N.render(a),"")}optimizeNodes(){const{nodes:a}=this;let m=a.length;for(;m--;){const N=a[m].optimizeNodes();Array.isArray(N)?a.splice(m,1,...N):N?a[m]=N:a.splice(m,1)}return a.length>0?this:void 0}optimizeNames(a,m){const{nodes:N}=this;let L=N.length;for(;L--;){const F=N[L];F.optimizeNames(a,m)||(Xe(a,F.names),N.splice(L,1))}return N.length>0?this:void 0}get names(){return this.nodes.reduce((a,m)=>Y(a,m.names),{})}}class P extends E{render(a){return"{"+a._n+super.render(a)+"}"+a._n}}class O extends E{}class _ extends P{}_.kind="else";class g extends P{constructor(a,m){super(m),this.condition=a}render(a){let m=`if(${this.condition})`+super.render(a);return this.else&&(m+="else "+this.else.render(a)),m}optimizeNodes(){super.optimizeNodes();const a=this.condition;if(a===!0)return this.nodes;let m=this.else;if(m){const N=m.optimizeNodes();m=this.else=Array.isArray(N)?new _(N):N}if(m)return a===!1?m instanceof g?m:m.nodes:this.nodes.length?this:new g(et(a),m instanceof g?[m]:m.nodes);if(!(a===!1||!this.nodes.length))return this}optimizeNames(a,m){var N;if(this.else=(N=this.else)===null||N===void 0?void 0:N.optimizeNames(a,m),!!(super.optimizeNames(a,m)||this.else))return this.condition=de(this.condition,a,m),this}get names(){const a=super.names;return Ee(a,this.condition),this.else&&Y(a,this.else.names),a}}g.kind="if";class $ extends P{}$.kind="for";class S extends ${constructor(a){super(),this.iteration=a}render(a){return`for(${this.iteration})`+super.render(a)}optimizeNames(a,m){if(super.optimizeNames(a,m))return this.iteration=de(this.iteration,a,m),this}get names(){return Y(super.names,this.iteration.names)}}class I extends ${constructor(a,m,N,L){super(),this.varKind=a,this.name=m,this.from=N,this.to=L}render(a){const m=a.es5?r.varKinds.var:this.varKind,{name:N,from:L,to:F}=this;return`for(${m} ${N}=${L}; ${N}<${F}; ${N}++)`+super.render(a)}get names(){const a=Ee(super.names,this.from);return Ee(a,this.to)}}class D extends ${constructor(a,m,N,L){super(),this.loop=a,this.varKind=m,this.name=N,this.iterable=L}render(a){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(a)}optimizeNames(a,m){if(super.optimizeNames(a,m))return this.iterable=de(this.iterable,a,m),this}get names(){return Y(super.names,this.iterable.names)}}class v extends P{constructor(a,m,N){super(),this.name=a,this.args=m,this.async=N}render(a){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(a)}}v.kind="func";class C extends E{render(a){return"return "+super.render(a)}}C.kind="return";class A extends P{render(a){let m="try"+super.render(a);return this.catch&&(m+=this.catch.render(a)),this.finally&&(m+=this.finally.render(a)),m}optimizeNodes(){var a,m;return super.optimizeNodes(),(a=this.catch)===null||a===void 0||a.optimizeNodes(),(m=this.finally)===null||m===void 0||m.optimizeNodes(),this}optimizeNames(a,m){var N,L;return super.optimizeNames(a,m),(N=this.catch)===null||N===void 0||N.optimizeNames(a,m),(L=this.finally)===null||L===void 0||L.optimizeNames(a,m),this}get names(){const a=super.names;return this.catch&&Y(a,this.catch.names),this.finally&&Y(a,this.finally.names),a}}class W extends P{constructor(a){super(),this.error=a}render(a){return`catch(${this.error})`+super.render(a)}}W.kind="catch";class G extends P{render(a){return"finally"+super.render(a)}}G.kind="finally";class ie{constructor(a,m={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...m,_n:m.lines?`
631
- `:""},this._extScope=a,this._scope=new r.Scope({parent:a}),this._nodes=[new O]}toString(){return this._root.render(this.opts)}name(a){return this._scope.name(a)}scopeName(a){return this._extScope.name(a)}scopeValue(a,m){const N=this._extScope.value(a,m);return(this._values[N.prefix]||(this._values[N.prefix]=new Set)).add(N),N}getScopeValue(a,m){return this._extScope.getValue(a,m)}scopeRefs(a){return this._extScope.scopeRefs(a,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(a,m,N,L){const F=this._scope.toName(m);return N!==void 0&&L&&(this._constants[F.str]=N),this._leafNode(new o(a,F,N)),F}const(a,m,N){return this._def(r.varKinds.const,a,m,N)}let(a,m,N){return this._def(r.varKinds.let,a,m,N)}var(a,m,N){return this._def(r.varKinds.var,a,m,N)}assign(a,m,N){return this._leafNode(new u(a,m,N))}add(a,m){return this._leafNode(new f(a,e.operators.ADD,m))}code(a){return typeof a=="function"?a():a!==t.nil&&this._leafNode(new b(a)),this}object(...a){const m=["{"];for(const[N,L]of a)m.length>1&&m.push(","),m.push(N),(N!==L||this.opts.es5)&&(m.push(":"),(0,t.addCodeArg)(m,L));return m.push("}"),new t._Code(m)}if(a,m,N){if(this._blockNode(new g(a)),m&&N)this.code(m).else().code(N).endIf();else if(m)this.code(m).endIf();else if(N)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(a){return this._elseNode(new g(a))}else(){return this._elseNode(new _)}endIf(){return this._endBlockNode(g,_)}_for(a,m){return this._blockNode(a),m&&this.code(m).endFor(),this}for(a,m){return this._for(new S(a),m)}forRange(a,m,N,L,F=this.opts.es5?r.varKinds.var:r.varKinds.let){const K=this._scope.toName(a);return this._for(new I(F,K,m,N),()=>L(K))}forOf(a,m,N,L=r.varKinds.const){const F=this._scope.toName(a);if(this.opts.es5){const K=m instanceof t.Name?m:this.var("_arr",m);return this.forRange("_i",0,(0,t._)`${K}.length`,Q=>{this.var(F,(0,t._)`${K}[${Q}]`),N(F)})}return this._for(new D("of",L,F,m),()=>N(F))}forIn(a,m,N,L=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(a,(0,t._)`Object.keys(${m})`,N);const F=this._scope.toName(a);return this._for(new D("in",L,F,m),()=>N(F))}endFor(){return this._endBlockNode($)}label(a){return this._leafNode(new l(a))}break(a){return this._leafNode(new d(a))}return(a){const m=new C;if(this._blockNode(m),this.code(a),m.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(C)}try(a,m,N){if(!m&&!N)throw new Error('CodeGen: "try" without "catch" and "finally"');const L=new A;if(this._blockNode(L),this.code(a),m){const F=this.name("e");this._currNode=L.catch=new W(F),m(F)}return N&&(this._currNode=L.finally=new G,this.code(N)),this._endBlockNode(W,G)}throw(a){return this._leafNode(new p(a))}block(a,m){return this._blockStarts.push(this._nodes.length),a&&this.code(a).endBlock(m),this}endBlock(a){const m=this._blockStarts.pop();if(m===void 0)throw new Error("CodeGen: not in self-balancing block");const N=this._nodes.length-m;if(N<0||a!==void 0&&N!==a)throw new Error(`CodeGen: wrong number of nodes: ${N} vs ${a} expected`);return this._nodes.length=m,this}func(a,m=t.nil,N,L){return this._blockNode(new v(a,m,N)),L&&this.code(L).endFunc(),this}endFunc(){return this._endBlockNode(v)}optimize(a=1){for(;a-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(a){return this._currNode.nodes.push(a),this}_blockNode(a){this._currNode.nodes.push(a),this._nodes.push(a)}_endBlockNode(a,m){const N=this._currNode;if(N instanceof a||m&&N instanceof m)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${m?`${a.kind}/${m.kind}`:a.kind}"`)}_elseNode(a){const m=this._currNode;if(!(m instanceof g))throw new Error('CodeGen: "else" without "if"');return this._currNode=m.else=a,this}get _root(){return this._nodes[0]}get _currNode(){const a=this._nodes;return a[a.length-1]}set _currNode(a){const m=this._nodes;m[m.length-1]=a}}e.CodeGen=ie;function Y(T,a){for(const m in a)T[m]=(T[m]||0)+(a[m]||0);return T}function Ee(T,a){return a instanceof t._CodeOrName?Y(T,a.names):T}function de(T,a,m){if(T instanceof t.Name)return N(T);if(!L(T))return T;return new t._Code(T._items.reduce((F,K)=>(K instanceof t.Name&&(K=N(K)),K instanceof t._Code?F.push(...K._items):F.push(K),F),[]));function N(F){const K=m[F.str];return K===void 0||a[F.str]!==1?F:(delete a[F.str],K)}function L(F){return F instanceof t._Code&&F._items.some(K=>K instanceof t.Name&&a[K.str]===1&&m[K.str]!==void 0)}}function Xe(T,a){for(const m in a)T[m]=(T[m]||0)-(a[m]||0)}function et(T){return typeof T=="boolean"||typeof T=="number"||T===null?!T:(0,t._)`!${j(T)}`}e.not=et;const pt=w(e.operators.AND);function It(...T){return T.reduce(pt)}e.and=It;const ht=w(e.operators.OR);function M(...T){return T.reduce(ht)}e.or=M;function w(T){return(a,m)=>a===t.nil?m:m===t.nil?a:(0,t._)`${j(a)} ${T} ${j(m)}`}function j(T){return T instanceof t.Name?T:(0,t._)`(${T})`}})(B);var X={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;const t=B,r=Yt;function n(v){const C={};for(const A of v)C[A]=!0;return C}e.toHash=n;function s(v,C){return typeof C=="boolean"?C:Object.keys(C).length===0?!0:(i(v,C),!o(C,v.self.RULES.all))}e.alwaysValidSchema=s;function i(v,C=v.schema){const{opts:A,self:W}=v;if(!A.strictSchema||typeof C=="boolean")return;const G=W.RULES.keywords;for(const ie in C)G[ie]||D(v,`unknown keyword: "${ie}"`)}e.checkUnknownRules=i;function o(v,C){if(typeof v=="boolean")return!v;for(const A in v)if(C[A])return!0;return!1}e.schemaHasRules=o;function u(v,C){if(typeof v=="boolean")return!v;for(const A in v)if(A!=="$ref"&&C.all[A])return!0;return!1}e.schemaHasRulesButRef=u;function f({topSchemaRef:v,schemaPath:C},A,W,G){if(!G){if(typeof A=="number"||typeof A=="boolean")return A;if(typeof A=="string")return(0,t._)`${A}`}return(0,t._)`${v}${C}${(0,t.getProperty)(W)}`}e.schemaRefOrVal=f;function l(v){return b(decodeURIComponent(v))}e.unescapeFragment=l;function d(v){return encodeURIComponent(p(v))}e.escapeFragment=d;function p(v){return typeof v=="number"?`${v}`:v.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=p;function b(v){return v.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=b;function E(v,C){if(Array.isArray(v))for(const A of v)C(A);else C(v)}e.eachItem=E;function P({mergeNames:v,mergeToName:C,mergeValues:A,resultToName:W}){return(G,ie,Y,Ee)=>{const de=Y===void 0?ie:Y instanceof t.Name?(ie instanceof t.Name?v(G,ie,Y):C(G,ie,Y),Y):ie instanceof t.Name?(C(G,Y,ie),ie):A(ie,Y);return Ee===t.Name&&!(de instanceof t.Name)?W(G,de):de}}e.mergeEvaluated={props:P({mergeNames:(v,C,A)=>v.if((0,t._)`${A} !== true && ${C} !== undefined`,()=>{v.if((0,t._)`${C} === true`,()=>v.assign(A,!0),()=>v.assign(A,(0,t._)`${A} || {}`).code((0,t._)`Object.assign(${A}, ${C})`))}),mergeToName:(v,C,A)=>v.if((0,t._)`${A} !== true`,()=>{C===!0?v.assign(A,!0):(v.assign(A,(0,t._)`${A} || {}`),_(v,A,C))}),mergeValues:(v,C)=>v===!0?!0:{...v,...C},resultToName:O}),items:P({mergeNames:(v,C,A)=>v.if((0,t._)`${A} !== true && ${C} !== undefined`,()=>v.assign(A,(0,t._)`${C} === true ? true : ${A} > ${C} ? ${A} : ${C}`)),mergeToName:(v,C,A)=>v.if((0,t._)`${A} !== true`,()=>v.assign(A,C===!0?!0:(0,t._)`${A} > ${C} ? ${A} : ${C}`)),mergeValues:(v,C)=>v===!0?!0:Math.max(v,C),resultToName:(v,C)=>v.var("items",C)})};function O(v,C){if(C===!0)return v.var("props",!0);const A=v.var("props",(0,t._)`{}`);return C!==void 0&&_(v,A,C),A}e.evaluatedPropsToName=O;function _(v,C,A){Object.keys(A).forEach(W=>v.assign((0,t._)`${C}${(0,t.getProperty)(W)}`,!0))}e.setEvaluated=_;const g={};function $(v,C){return v.scopeValue("func",{ref:C,code:g[C.code]||(g[C.code]=new r._Code(C.code))})}e.useFunc=$;var S;(function(v){v[v.Num=0]="Num",v[v.Str=1]="Str"})(S=e.Type||(e.Type={}));function I(v,C,A){if(v instanceof t.Name){const W=C===S.Num;return A?W?(0,t._)`"[" + ${v} + "]"`:(0,t._)`"['" + ${v} + "']"`:W?(0,t._)`"/" + ${v}`:(0,t._)`"/" + ${v}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return A?(0,t.getProperty)(v).toString():"/"+p(v)}e.getErrorPath=I;function D(v,C,A=v.opts.strictSchema){if(A){if(C=`strict mode: ${C}`,A===!0)throw new Error(C);v.self.logger.warn(C)}}e.checkStrictMode=D})(X);var We={};Object.defineProperty(We,"__esModule",{value:!0});const ge=B,Ea={data:new ge.Name("data"),valCxt:new ge.Name("valCxt"),instancePath:new ge.Name("instancePath"),parentData:new ge.Name("parentData"),parentDataProperty:new ge.Name("parentDataProperty"),rootData:new ge.Name("rootData"),dynamicAnchors:new ge.Name("dynamicAnchors"),vErrors:new ge.Name("vErrors"),errors:new ge.Name("errors"),this:new ge.Name("this"),self:new ge.Name("self"),scope:new ge.Name("scope"),json:new ge.Name("json"),jsonPos:new ge.Name("jsonPos"),jsonLen:new ge.Name("jsonLen"),jsonPart:new ge.Name("jsonPart")};We.default=Ea;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=B,r=X,n=We;e.keywordError={message:({keyword:_})=>(0,t.str)`must pass "${_}" keyword validation`},e.keyword$DataError={message:({keyword:_,schemaType:g})=>g?(0,t.str)`"${_}" keyword must be ${g} ($data)`:(0,t.str)`"${_}" keyword is invalid ($data)`};function s(_,g=e.keywordError,$,S){const{it:I}=_,{gen:D,compositeRule:v,allErrors:C}=I,A=p(_,g,$);S??(v||C)?f(D,A):l(I,(0,t._)`[${A}]`)}e.reportError=s;function i(_,g=e.keywordError,$){const{it:S}=_,{gen:I,compositeRule:D,allErrors:v}=S,C=p(_,g,$);f(I,C),D||v||l(S,n.default.vErrors)}e.reportExtraError=i;function o(_,g){_.assign(n.default.errors,g),_.if((0,t._)`${n.default.vErrors} !== null`,()=>_.if(g,()=>_.assign((0,t._)`${n.default.vErrors}.length`,g),()=>_.assign(n.default.vErrors,null)))}e.resetErrorsCount=o;function u({gen:_,keyword:g,schemaValue:$,data:S,errsCount:I,it:D}){if(I===void 0)throw new Error("ajv implementation error");const v=_.name("err");_.forRange("i",I,n.default.errors,C=>{_.const(v,(0,t._)`${n.default.vErrors}[${C}]`),_.if((0,t._)`${v}.instancePath === undefined`,()=>_.assign((0,t._)`${v}.instancePath`,(0,t.strConcat)(n.default.instancePath,D.errorPath))),_.assign((0,t._)`${v}.schemaPath`,(0,t.str)`${D.errSchemaPath}/${g}`),D.opts.verbose&&(_.assign((0,t._)`${v}.schema`,$),_.assign((0,t._)`${v}.data`,S))})}e.extendErrors=u;function f(_,g){const $=_.const("err",g);_.if((0,t._)`${n.default.vErrors} === null`,()=>_.assign(n.default.vErrors,(0,t._)`[${$}]`),(0,t._)`${n.default.vErrors}.push(${$})`),_.code((0,t._)`${n.default.errors}++`)}function l(_,g){const{gen:$,validateName:S,schemaEnv:I}=_;I.$async?$.throw((0,t._)`new ${_.ValidationError}(${g})`):($.assign((0,t._)`${S}.errors`,g),$.return(!1))}const d={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function p(_,g,$){const{createErrors:S}=_.it;return S===!1?(0,t._)`{}`:b(_,g,$)}function b(_,g,$={}){const{gen:S,it:I}=_,D=[E(I,$),P(_,$)];return O(_,g,D),S.object(...D)}function E({errorPath:_},{instancePath:g}){const $=g?(0,t.str)`${_}${(0,r.getErrorPath)(g,r.Type.Str)}`:_;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,$)]}function P({keyword:_,it:{errSchemaPath:g}},{schemaPath:$,parentSchema:S}){let I=S?g:(0,t.str)`${g}/${_}`;return $&&(I=(0,t.str)`${I}${(0,r.getErrorPath)($,r.Type.Str)}`),[d.schemaPath,I]}function O(_,{params:g,message:$},S){const{keyword:I,data:D,schemaValue:v,it:C}=_,{opts:A,propertyName:W,topSchemaRef:G,schemaPath:ie}=C;S.push([d.keyword,I],[d.params,typeof g=="function"?g(_):g||(0,t._)`{}`]),A.messages&&S.push([d.message,typeof $=="function"?$(_):$]),A.verbose&&S.push([d.schema,v],[d.parentSchema,(0,t._)`${G}${ie}`],[n.default.data,D]),W&&S.push([d.propertyName,W])}})(Xt);Object.defineProperty(kt,"__esModule",{value:!0});kt.boolOrEmptySchema=kt.topBoolOrEmptySchema=void 0;const Pa=Xt,Sa=B,Ta=We,Ra={message:"boolean schema is false"};function ka(e){const{gen:t,schema:r,validateName:n}=e;r===!1?Oi(e,!1):typeof r=="object"&&r.$async===!0?t.return(Ta.default.data):(t.assign((0,Sa._)`${n}.errors`,null),t.return(!0))}kt.topBoolOrEmptySchema=ka;function Oa(e,t){const{gen:r,schema:n}=e;n===!1?(r.var(t,!1),Oi(e)):r.var(t,!0)}kt.boolOrEmptySchema=Oa;function Oi(e,t){const{gen:r,data:n}=e,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,Pa.reportError)(s,Ra,void 0,t)}var er={},ut={};Object.defineProperty(ut,"__esModule",{value:!0});ut.getRules=ut.isJSONType=void 0;const Ca=["string","number","integer","boolean","null","object","array"],Na=new Set(Ca);function Ia(e){return typeof e=="string"&&Na.has(e)}ut.isJSONType=Ia;function ja(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}ut.getRules=ja;var Be={};Object.defineProperty(Be,"__esModule",{value:!0});Be.shouldUseRule=Be.shouldUseGroup=Be.schemaHasRulesForType=void 0;function Aa({schema:e,self:t},r){const n=t.RULES.types[r];return n&&n!==!0&&Ci(e,n)}Be.schemaHasRulesForType=Aa;function Ci(e,t){return t.rules.some(r=>Ni(e,r))}Be.shouldUseGroup=Ci;function Ni(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}Be.shouldUseRule=Ni;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;const t=ut,r=Be,n=Xt,s=B,i=X;var o;(function(S){S[S.Correct=0]="Correct",S[S.Wrong=1]="Wrong"})(o=e.DataType||(e.DataType={}));function u(S){const I=f(S.type);if(I.includes("null")){if(S.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!I.length&&S.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');S.nullable===!0&&I.push("null")}return I}e.getSchemaTypes=u;function f(S){const I=Array.isArray(S)?S:S?[S]:[];if(I.every(t.isJSONType))return I;throw new Error("type must be JSONType or JSONType[]: "+I.join(","))}e.getJSONTypes=f;function l(S,I){const{gen:D,data:v,opts:C}=S,A=p(I,C.coerceTypes),W=I.length>0&&!(A.length===0&&I.length===1&&(0,r.schemaHasRulesForType)(S,I[0]));if(W){const G=O(I,v,C.strictNumbers,o.Wrong);D.if(G,()=>{A.length?b(S,I,A):g(S)})}return W}e.coerceAndCheckDataType=l;const d=new Set(["string","number","integer","boolean","null"]);function p(S,I){return I?S.filter(D=>d.has(D)||I==="array"&&D==="array"):[]}function b(S,I,D){const{gen:v,data:C,opts:A}=S,W=v.let("dataType",(0,s._)`typeof ${C}`),G=v.let("coerced",(0,s._)`undefined`);A.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(O(I,C,A.strictNumbers),()=>v.assign(G,C))),v.if((0,s._)`${G} !== undefined`);for(const Y of D)(d.has(Y)||Y==="array"&&A.coerceTypes==="array")&&ie(Y);v.else(),g(S),v.endIf(),v.if((0,s._)`${G} !== undefined`,()=>{v.assign(C,G),E(S,G)});function ie(Y){switch(Y){case"string":v.elseIf((0,s._)`${W} == "number" || ${W} == "boolean"`).assign(G,(0,s._)`"" + ${C}`).elseIf((0,s._)`${C} === null`).assign(G,(0,s._)`""`);return;case"number":v.elseIf((0,s._)`${W} == "boolean" || ${C} === null
632
- || (${W} == "string" && ${C} && ${C} == +${C})`).assign(G,(0,s._)`+${C}`);return;case"integer":v.elseIf((0,s._)`${W} === "boolean" || ${C} === null
633
- || (${W} === "string" && ${C} && ${C} == +${C} && !(${C} % 1))`).assign(G,(0,s._)`+${C}`);return;case"boolean":v.elseIf((0,s._)`${C} === "false" || ${C} === 0 || ${C} === null`).assign(G,!1).elseIf((0,s._)`${C} === "true" || ${C} === 1`).assign(G,!0);return;case"null":v.elseIf((0,s._)`${C} === "" || ${C} === 0 || ${C} === false`),v.assign(G,null);return;case"array":v.elseIf((0,s._)`${W} === "string" || ${W} === "number"
634
- || ${W} === "boolean" || ${C} === null`).assign(G,(0,s._)`[${C}]`)}}}function E({gen:S,parentData:I,parentDataProperty:D},v){S.if((0,s._)`${I} !== undefined`,()=>S.assign((0,s._)`${I}[${D}]`,v))}function P(S,I,D,v=o.Correct){const C=v===o.Correct?s.operators.EQ:s.operators.NEQ;let A;switch(S){case"null":return(0,s._)`${I} ${C} null`;case"array":A=(0,s._)`Array.isArray(${I})`;break;case"object":A=(0,s._)`${I} && typeof ${I} == "object" && !Array.isArray(${I})`;break;case"integer":A=W((0,s._)`!(${I} % 1) && !isNaN(${I})`);break;case"number":A=W();break;default:return(0,s._)`typeof ${I} ${C} ${S}`}return v===o.Correct?A:(0,s.not)(A);function W(G=s.nil){return(0,s.and)((0,s._)`typeof ${I} == "number"`,G,D?(0,s._)`isFinite(${I})`:s.nil)}}e.checkDataType=P;function O(S,I,D,v){if(S.length===1)return P(S[0],I,D,v);let C;const A=(0,i.toHash)(S);if(A.array&&A.object){const W=(0,s._)`typeof ${I} != "object"`;C=A.null?W:(0,s._)`!${I} || ${W}`,delete A.null,delete A.array,delete A.object}else C=s.nil;A.number&&delete A.integer;for(const W in A)C=(0,s.and)(C,P(W,I,D,v));return C}e.checkDataTypes=O;const _={message:({schema:S})=>`must be ${S}`,params:({schema:S,schemaValue:I})=>typeof S=="string"?(0,s._)`{type: ${S}}`:(0,s._)`{type: ${I}}`};function g(S){const I=$(S);(0,n.reportError)(I,_)}e.reportTypeError=g;function $(S){const{gen:I,data:D,schema:v}=S,C=(0,i.schemaRefOrVal)(S,v,"type");return{gen:I,keyword:"type",data:D,schema:v.type,schemaCode:C,schemaValue:C,parentSchema:v,params:{},it:S}}})(er);var qr={};Object.defineProperty(qr,"__esModule",{value:!0});qr.assignDefaults=void 0;const bt=B,Da=X;function Ma(e,t){const{properties:r,items:n}=e.schema;if(t==="object"&&r)for(const s in r)Ts(e,s,r[s].default);else t==="array"&&Array.isArray(n)&&n.forEach((s,i)=>Ts(e,i,s.default))}qr.assignDefaults=Ma;function Ts(e,t,r){const{gen:n,compositeRule:s,data:i,opts:o}=e;if(r===void 0)return;const u=(0,bt._)`${i}${(0,bt.getProperty)(t)}`;if(s){(0,Da.checkStrictMode)(e,`default is ignored for: ${u}`);return}let f=(0,bt._)`${u} === undefined`;o.useDefaults==="empty"&&(f=(0,bt._)`${f} || ${u} === null || ${u} === ""`),n.if(f,(0,bt._)`${u} = ${(0,bt.stringify)(r)}`)}var qe={},H={};Object.defineProperty(H,"__esModule",{value:!0});H.validateUnion=H.validateArray=H.usePattern=H.callValidateCode=H.schemaProperties=H.allSchemaProperties=H.noPropertyInData=H.propertyInData=H.isOwnProperty=H.hasPropFunc=H.reportMissingProp=H.checkMissingProp=H.checkReportMissingProp=void 0;const re=B,wn=X,Je=We,La=X;function Fa(e,t){const{gen:r,data:n,it:s}=e;r.if(bn(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:(0,re._)`${t}`},!0),e.error()})}H.checkReportMissingProp=Fa;function qa({gen:e,data:t,it:{opts:r}},n,s){return(0,re.or)(...n.map(i=>(0,re.and)(bn(e,t,i,r.ownProperties),(0,re._)`${s} = ${i}`)))}H.checkMissingProp=qa;function Ua(e,t){e.setParams({missingProperty:t},!0),e.error()}H.reportMissingProp=Ua;function Ii(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,re._)`Object.prototype.hasOwnProperty`})}H.hasPropFunc=Ii;function vn(e,t,r){return(0,re._)`${Ii(e)}.call(${t}, ${r})`}H.isOwnProperty=vn;function Va(e,t,r,n){const s=(0,re._)`${t}${(0,re.getProperty)(r)} !== undefined`;return n?(0,re._)`${s} && ${vn(e,t,r)}`:s}H.propertyInData=Va;function bn(e,t,r,n){const s=(0,re._)`${t}${(0,re.getProperty)(r)} === undefined`;return n?(0,re.or)(s,(0,re.not)(vn(e,t,r))):s}H.noPropertyInData=bn;function ji(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}H.allSchemaProperties=ji;function za(e,t){return ji(t).filter(r=>!(0,wn.alwaysValidSchema)(e,t[r]))}H.schemaProperties=za;function Wa({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:i},it:o},u,f,l){const d=l?(0,re._)`${e}, ${t}, ${n}${s}`:t,p=[[Je.default.instancePath,(0,re.strConcat)(Je.default.instancePath,i)],[Je.default.parentData,o.parentData],[Je.default.parentDataProperty,o.parentDataProperty],[Je.default.rootData,Je.default.rootData]];o.opts.dynamicRef&&p.push([Je.default.dynamicAnchors,Je.default.dynamicAnchors]);const b=(0,re._)`${d}, ${r.object(...p)}`;return f!==re.nil?(0,re._)`${u}.call(${f}, ${b})`:(0,re._)`${u}(${b})`}H.callValidateCode=Wa;const xa=(0,re._)`new RegExp`;function Ha({gen:e,it:{opts:t}},r){const n=t.unicodeRegExp?"u":"",{regExp:s}=t.code,i=s(r,n);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,re._)`${s.code==="new RegExp"?xa:(0,La.useFunc)(e,s)}(${r}, ${n})`})}H.usePattern=Ha;function Ba(e){const{gen:t,data:r,keyword:n,it:s}=e,i=t.name("valid");if(s.allErrors){const u=t.let("valid",!0);return o(()=>t.assign(u,!1)),u}return t.var(i,!0),o(()=>t.break()),i;function o(u){const f=t.const("len",(0,re._)`${r}.length`);t.forRange("i",0,f,l=>{e.subschema({keyword:n,dataProp:l,dataPropType:wn.Type.Num},i),t.if((0,re.not)(i),u)})}}H.validateArray=Ba;function Ga(e){const{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(f=>(0,wn.alwaysValidSchema)(s,f))&&!s.opts.unevaluated)return;const o=t.let("valid",!1),u=t.name("_valid");t.block(()=>r.forEach((f,l)=>{const d=e.subschema({keyword:n,schemaProp:l,compositeRule:!0},u);t.assign(o,(0,re._)`${o} || ${u}`),e.mergeValidEvaluated(d,u)||t.if((0,re.not)(o))})),e.result(o,()=>e.reset(),()=>e.error(!0))}H.validateUnion=Ga;Object.defineProperty(qe,"__esModule",{value:!0});qe.validateKeywordUsage=qe.validSchemaType=qe.funcKeywordCode=qe.macroKeywordCode=void 0;const $e=B,ot=We,Ka=H,Ja=Xt;function Qa(e,t){const{gen:r,keyword:n,schema:s,parentSchema:i,it:o}=e,u=t.macro.call(o.self,s,i,o),f=Ai(r,n,u);o.opts.validateSchema!==!1&&o.self.validateSchema(u,!0);const l=r.name("valid");e.subschema({schema:u,schemaPath:$e.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:f,compositeRule:!0},l),e.pass(l,()=>e.error(!0))}qe.macroKeywordCode=Qa;function Ya(e,t){var r;const{gen:n,keyword:s,schema:i,parentSchema:o,$data:u,it:f}=e;Xa(f,t);const l=!u&&t.compile?t.compile.call(f.self,i,o,f):t.validate,d=Ai(n,s,l),p=n.let("valid");e.block$data(p,b),e.ok((r=t.valid)!==null&&r!==void 0?r:p);function b(){if(t.errors===!1)O(),t.modifying&&Rs(e),_(()=>e.error());else{const g=t.async?E():P();t.modifying&&Rs(e),_(()=>Za(e,g))}}function E(){const g=n.let("ruleErrs",null);return n.try(()=>O((0,$e._)`await `),$=>n.assign(p,!1).if((0,$e._)`${$} instanceof ${f.ValidationError}`,()=>n.assign(g,(0,$e._)`${$}.errors`),()=>n.throw($))),g}function P(){const g=(0,$e._)`${d}.errors`;return n.assign(g,null),O($e.nil),g}function O(g=t.async?(0,$e._)`await `:$e.nil){const $=f.opts.passContext?ot.default.this:ot.default.self,S=!("compile"in t&&!u||t.schema===!1);n.assign(p,(0,$e._)`${g}${(0,Ka.callValidateCode)(e,d,$,S)}`,t.modifying)}function _(g){var $;n.if((0,$e.not)(($=t.valid)!==null&&$!==void 0?$:p),g)}}qe.funcKeywordCode=Ya;function Rs(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,$e._)`${n.parentData}[${n.parentDataProperty}]`))}function Za(e,t){const{gen:r}=e;r.if((0,$e._)`Array.isArray(${t})`,()=>{r.assign(ot.default.vErrors,(0,$e._)`${ot.default.vErrors} === null ? ${t} : ${ot.default.vErrors}.concat(${t})`).assign(ot.default.errors,(0,$e._)`${ot.default.vErrors}.length`),(0,Ja.extendErrors)(e)},()=>e.error())}function Xa({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function Ai(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,$e.stringify)(r)})}function ec(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}qe.validSchemaType=ec;function tc({schema:e,opts:t,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 o=s.dependencies;if(o!=null&&o.some(u=>!Object.prototype.hasOwnProperty.call(e,u)))throw new Error(`parent schema must have dependencies of ${i}: ${o.join(",")}`);if(s.validateSchema&&!s.validateSchema(e[i])){const f=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(f);else throw new Error(f)}}qe.validateKeywordUsage=tc;var Ze={};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.extendSubschemaMode=Ze.extendSubschemaData=Ze.getSubschema=void 0;const Fe=B,Di=X;function rc(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:i,topSchemaRef:o}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){const u=e.schema[t];return r===void 0?{schema:u,schemaPath:(0,Fe._)`${e.schemaPath}${(0,Fe.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:u[r],schemaPath:(0,Fe._)`${e.schemaPath}${(0,Fe.getProperty)(t)}${(0,Fe.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,Di.escapeFragment)(r)}`}}if(n!==void 0){if(s===void 0||i===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:o,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}Ze.getSubschema=rc;function nc(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:i,propertyName:o}){if(s!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:u}=t;if(r!==void 0){const{errorPath:l,dataPathArr:d,opts:p}=t,b=u.let("data",(0,Fe._)`${t.data}${(0,Fe.getProperty)(r)}`,!0);f(b),e.errorPath=(0,Fe.str)`${l}${(0,Di.getErrorPath)(r,n,p.jsPropertySyntax)}`,e.parentDataProperty=(0,Fe._)`${r}`,e.dataPathArr=[...d,e.parentDataProperty]}if(s!==void 0){const l=s instanceof Fe.Name?s:u.let("data",s,!0);f(l),o!==void 0&&(e.propertyName=o)}i&&(e.dataTypes=i);function f(l){e.data=l,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,l]}}Ze.extendSubschemaData=nc;function sc(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:i}){n!==void 0&&(e.compositeRule=n),s!==void 0&&(e.createErrors=s),i!==void 0&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}Ze.extendSubschemaMode=sc;var me={},Mi=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),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 o=i[s];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r},Li={exports:{}},Ye=Li.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};yr(t,n,s,e,"",e)};Ye.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Ye.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Ye.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Ye.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 yr(e,t,r,n,s,i,o,u,f,l){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,s,i,o,u,f,l);for(var d in n){var p=n[d];if(Array.isArray(p)){if(d in Ye.arrayKeywords)for(var b=0;b<p.length;b++)yr(e,t,r,p[b],s+"/"+d+"/"+b,i,s,d,n,b)}else if(d in Ye.propsKeywords){if(p&&typeof p=="object")for(var E in p)yr(e,t,r,p[E],s+"/"+d+"/"+ic(E),i,s,d,n,E)}else(d in Ye.keywords||e.allKeys&&!(d in Ye.skipKeywords))&&yr(e,t,r,p,s+"/"+d,i,s,d,n)}r(n,s,i,o,u,f,l)}}function ic(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var oc=Li.exports;Object.defineProperty(me,"__esModule",{value:!0});me.getSchemaRefs=me.resolveUrl=me.normalizeId=me._getFullPath=me.getFullPath=me.inlineRef=void 0;const ac=X,cc=Mi,lc=oc,uc=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function dc(e,t=!0){return typeof e=="boolean"?!0:t===!0?!an(e):t?Fi(e)<=t:!1}me.inlineRef=dc;const fc=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function an(e){for(const t in e){if(fc.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(an)||typeof r=="object"&&an(r))return!0}return!1}function Fi(e){let t=0;for(const r in e){if(r==="$ref")return 1/0;if(t++,!uc.has(r)&&(typeof e[r]=="object"&&(0,ac.eachItem)(e[r],n=>t+=Fi(n)),t===1/0))return 1/0}return t}function qi(e,t="",r){r!==!1&&(t=Rt(t));const n=e.parse(t);return Ui(e,n)}me.getFullPath=qi;function Ui(e,t){return e.serialize(t).split("#")[0]+"#"}me._getFullPath=Ui;const pc=/#\/?$/;function Rt(e){return e?e.replace(pc,""):""}me.normalizeId=Rt;function hc(e,t,r){return r=Rt(r),e.resolve(t,r)}me.resolveUrl=hc;const mc=/^[a-z_][-a-z0-9._]*$/i;function yc(e,t){if(typeof e=="boolean")return{};const{schemaId:r,uriResolver:n}=this.opts,s=Rt(e[r]||t),i={"":s},o=qi(n,s,!1),u={},f=new Set;return lc(e,{allKeys:!0},(p,b,E,P)=>{if(P===void 0)return;const O=o+b;let _=i[P];typeof p[r]=="string"&&(_=g.call(this,p[r])),$.call(this,p.$anchor),$.call(this,p.$dynamicAnchor),i[b]=_;function g(S){const I=this.opts.uriResolver.resolve;if(S=Rt(_?I(_,S):S),f.has(S))throw d(S);f.add(S);let D=this.refs[S];return typeof D=="string"&&(D=this.refs[D]),typeof D=="object"?l(p,D.schema,S):S!==Rt(O)&&(S[0]==="#"?(l(p,u[S],S),u[S]=p):this.refs[S]=O),S}function $(S){if(typeof S=="string"){if(!mc.test(S))throw new Error(`invalid anchor "${S}"`);g.call(this,`#${S}`)}}}),u;function l(p,b,E){if(b!==void 0&&!cc(p,b))throw d(E)}function d(p){return new Error(`reference "${p}" resolves to more than one schema`)}}me.getSchemaRefs=yc;Object.defineProperty(Ne,"__esModule",{value:!0});Ne.getData=Ne.KeywordCxt=Ne.validateFunctionCode=void 0;const Vi=kt,ks=er,En=Be,Tr=er,gc=qr,Ht=qe,Kr=Ze,q=B,z=We,$c=me,Ge=X,zt=Xt;function _c(e){if(xi(e)&&(Hi(e),Wi(e))){bc(e);return}zi(e,()=>(0,Vi.topBoolOrEmptySchema)(e))}Ne.validateFunctionCode=_c;function zi({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},i){s.code.es5?e.func(t,(0,q._)`${z.default.data}, ${z.default.valCxt}`,n.$async,()=>{e.code((0,q._)`"use strict"; ${Os(r,s)}`),vc(e,s),e.code(i)}):e.func(t,(0,q._)`${z.default.data}, ${wc(s)}`,n.$async,()=>e.code(Os(r,s)).code(i))}function wc(e){return(0,q._)`{${z.default.instancePath}="", ${z.default.parentData}, ${z.default.parentDataProperty}, ${z.default.rootData}=${z.default.data}${e.dynamicRef?(0,q._)`, ${z.default.dynamicAnchors}={}`:q.nil}}={}`}function vc(e,t){e.if(z.default.valCxt,()=>{e.var(z.default.instancePath,(0,q._)`${z.default.valCxt}.${z.default.instancePath}`),e.var(z.default.parentData,(0,q._)`${z.default.valCxt}.${z.default.parentData}`),e.var(z.default.parentDataProperty,(0,q._)`${z.default.valCxt}.${z.default.parentDataProperty}`),e.var(z.default.rootData,(0,q._)`${z.default.valCxt}.${z.default.rootData}`),t.dynamicRef&&e.var(z.default.dynamicAnchors,(0,q._)`${z.default.valCxt}.${z.default.dynamicAnchors}`)},()=>{e.var(z.default.instancePath,(0,q._)`""`),e.var(z.default.parentData,(0,q._)`undefined`),e.var(z.default.parentDataProperty,(0,q._)`undefined`),e.var(z.default.rootData,z.default.data),t.dynamicRef&&e.var(z.default.dynamicAnchors,(0,q._)`{}`)})}function bc(e){const{schema:t,opts:r,gen:n}=e;zi(e,()=>{r.$comment&&t.$comment&&Gi(e),Rc(e),n.let(z.default.vErrors,null),n.let(z.default.errors,0),r.unevaluated&&Ec(e),Bi(e),Cc(e)})}function Ec(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,q._)`${r}.evaluated`),t.if((0,q._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,q._)`${e.evaluated}.props`,(0,q._)`undefined`)),t.if((0,q._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,q._)`${e.evaluated}.items`,(0,q._)`undefined`))}function Os(e,t){const r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,q._)`/*# sourceURL=${r} */`:q.nil}function Pc(e,t){if(xi(e)&&(Hi(e),Wi(e))){Sc(e,t);return}(0,Vi.boolOrEmptySchema)(e,t)}function Wi({schema:e,self:t}){if(typeof e=="boolean")return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function xi(e){return typeof e.schema!="boolean"}function Sc(e,t){const{schema:r,gen:n,opts:s}=e;s.$comment&&r.$comment&&Gi(e),kc(e),Oc(e);const i=n.const("_errs",z.default.errors);Bi(e,i),n.var(t,(0,q._)`${i} === ${z.default.errors}`)}function Hi(e){(0,Ge.checkUnknownRules)(e),Tc(e)}function Bi(e,t){if(e.opts.jtd)return Cs(e,[],!1,t);const r=(0,ks.getSchemaTypes)(e.schema),n=(0,ks.coerceAndCheckDataType)(e,r);Cs(e,r,!n,t)}function Tc(e){const{schema:t,errSchemaPath:r,opts:n,self:s}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,Ge.schemaHasRulesButRef)(t,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function Rc(e){const{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Ge.checkStrictMode)(e,"default is ignored in the schema root")}function kc(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,$c.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function Oc(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function Gi({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:s}){const i=r.$comment;if(s.$comment===!0)e.code((0,q._)`${z.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){const o=(0,q.str)`${n}/$comment`,u=e.scopeValue("root",{ref:t.root});e.code((0,q._)`${z.default.self}.opts.$comment(${i}, ${o}, ${u}.schema)`)}}function Cc(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:i}=e;r.$async?t.if((0,q._)`${z.default.errors} === 0`,()=>t.return(z.default.data),()=>t.throw((0,q._)`new ${s}(${z.default.vErrors})`)):(t.assign((0,q._)`${n}.errors`,z.default.vErrors),i.unevaluated&&Nc(e),t.return((0,q._)`${z.default.errors} === 0`))}function Nc({gen:e,evaluated:t,props:r,items:n}){r instanceof q.Name&&e.assign((0,q._)`${t}.props`,r),n instanceof q.Name&&e.assign((0,q._)`${t}.items`,n)}function Cs(e,t,r,n){const{gen:s,schema:i,data:o,allErrors:u,opts:f,self:l}=e,{RULES:d}=l;if(i.$ref&&(f.ignoreKeywordsWithRef||!(0,Ge.schemaHasRulesButRef)(i,d))){s.block(()=>Qi(e,"$ref",d.all.$ref.definition));return}f.jtd||Ic(e,t),s.block(()=>{for(const b of d.rules)p(b);p(d.post)});function p(b){(0,En.shouldUseGroup)(i,b)&&(b.type?(s.if((0,Tr.checkDataType)(b.type,o,f.strictNumbers)),Ns(e,b),t.length===1&&t[0]===b.type&&r&&(s.else(),(0,Tr.reportTypeError)(e)),s.endIf()):Ns(e,b),u||s.if((0,q._)`${z.default.errors} === ${n||0}`))}}function Ns(e,t){const{gen:r,schema:n,opts:{useDefaults:s}}=e;s&&(0,gc.assignDefaults)(e,t.type),r.block(()=>{for(const i of t.rules)(0,En.shouldUseRule)(n,i)&&Qi(e,i.keyword,i.definition,t.type)})}function Ic(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(jc(e,t),e.opts.allowUnionTypes||Ac(e,t),Dc(e,e.dataTypes))}function jc(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{Ki(e.dataTypes,r)||Pn(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),Lc(e,t)}}function Ac(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&Pn(e,"use allowUnionTypes to allow union type keyword")}function Dc(e,t){const r=e.self.RULES.all;for(const n in r){const s=r[n];if(typeof s=="object"&&(0,En.shouldUseRule)(e.schema,s)){const{type:i}=s.definition;i.length&&!i.some(o=>Mc(t,o))&&Pn(e,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function Mc(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function Ki(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function Lc(e,t){const r=[];for(const n of e.dataTypes)Ki(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function Pn(e,t){const r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,Ge.checkStrictMode)(e,t,e.opts.strictTypes)}class Ji{constructor(t,r,n){if((0,Ht.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Ge.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",Yi(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Ht.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=t.gen.const("_errs",z.default.errors))}result(t,r,n){this.failResult((0,q.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,q.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);const{schemaCode:r}=this;this.fail((0,q._)`${r} !== undefined && (${(0,q.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?zt.reportExtraError:zt.reportError)(this,this.def.error,r)}$dataError(){(0,zt.reportError)(this,this.def.$dataError||zt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,zt.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=q.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=q.nil,r=q.nil){if(!this.$data)return;const{gen:n,schemaCode:s,schemaType:i,def:o}=this;n.if((0,q.or)((0,q._)`${s} === undefined`,r)),t!==q.nil&&n.assign(t,!0),(i.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==q.nil&&n.assign(t,!1)),n.else()}invalid$data(){const{gen:t,schemaCode:r,schemaType:n,def:s,it:i}=this;return(0,q.or)(o(),u());function o(){if(n.length){if(!(r instanceof q.Name))throw new Error("ajv implementation error");const f=Array.isArray(n)?n:[n];return(0,q._)`${(0,Tr.checkDataTypes)(f,r,i.opts.strictNumbers,Tr.DataType.Wrong)}`}return q.nil}function u(){if(s.validateSchema){const f=t.scopeValue("validate$data",{ref:s.validateSchema});return(0,q._)`!${f}(${r})`}return q.nil}}subschema(t,r){const n=(0,Kr.getSubschema)(this.it,t);(0,Kr.extendSubschemaData)(n,this.it,t),(0,Kr.extendSubschemaMode)(n,t);const s={...this.it,...n,items:void 0,props:void 0};return Pc(s,r),s}mergeEvaluated(t,r){const{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=Ge.mergeEvaluated.props(s,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=Ge.mergeEvaluated.items(s,t.items,n.items,r)))}mergeValidEvaluated(t,r){const{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(r,()=>this.mergeEvaluated(t,q.Name)),!0}}Ne.KeywordCxt=Ji;function Qi(e,t,r,n){const s=new Ji(e,r,t);"code"in r?r.code(s,n):s.$data&&r.validate?(0,Ht.funcKeywordCode)(s,r):"macro"in r?(0,Ht.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,Ht.funcKeywordCode)(s,r)}const Fc=/^\/(?:[^~]|~0|~1)*$/,qc=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Yi(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,i;if(e==="")return z.default.rootData;if(e[0]==="/"){if(!Fc.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);s=e,i=z.default.rootData}else{const l=qc.exec(e);if(!l)throw new Error(`Invalid JSON-pointer: ${e}`);const d=+l[1];if(s=l[2],s==="#"){if(d>=t)throw new Error(f("property/index",d));return n[t-d]}if(d>t)throw new Error(f("data",d));if(i=r[t-d],!s)return i}let o=i;const u=s.split("/");for(const l of u)l&&(i=(0,q._)`${i}${(0,q.getProperty)((0,Ge.unescapeJsonPointer)(l))}`,o=(0,q._)`${o} && ${i}`);return o;function f(l,d){return`Cannot access ${l} ${d} levels up, current level is ${t}`}}Ne.getData=Yi;var tr={};Object.defineProperty(tr,"__esModule",{value:!0});class Uc extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}tr.default=Uc;var rr={};Object.defineProperty(rr,"__esModule",{value:!0});const Jr=me;class Vc extends Error{constructor(t,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Jr.resolveUrl)(t,r,n),this.missingSchema=(0,Jr.normalizeId)((0,Jr.getFullPath)(t,this.missingRef))}}rr.default=Vc;var ve={};Object.defineProperty(ve,"__esModule",{value:!0});ve.resolveSchema=ve.getCompilingSchema=ve.resolveRef=ve.compileSchema=ve.SchemaEnv=void 0;const ke=B,zc=tr,it=We,Ce=me,Is=X,Wc=Ne;class Ur{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,Ce.normalizeId)(n==null?void 0:n[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n==null?void 0:n.$async,this.refs={}}}ve.SchemaEnv=Ur;function Sn(e){const t=Zi.call(this,e);if(t)return t;const r=(0,Ce.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new ke.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i});let u;e.$async&&(u=o.scopeValue("Error",{ref:zc.default,code:(0,ke._)`require("ajv/dist/runtime/validation_error").default`}));const f=o.scopeName("validate");e.validateName=f;const l={gen:o,allErrors:this.opts.allErrors,data:it.default.data,parentData:it.default.parentData,parentDataProperty:it.default.parentDataProperty,dataNames:[it.default.data],dataPathArr:[ke.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,ke.stringify)(e.schema)}:{ref:e.schema}),validateName:f,ValidationError:u,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:ke.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,ke._)`""`,opts:this.opts,self:this};let d;try{this._compilations.add(e),(0,Wc.validateFunctionCode)(l),o.optimize(this.opts.code.optimize);const p=o.toString();d=`${o.scopeRefs(it.default.scope)}return ${p}`,this.opts.code.process&&(d=this.opts.code.process(d,e));const E=new Function(`${it.default.self}`,`${it.default.scope}`,d)(this,this.scope.get());if(this.scope.value(f,{ref:E}),E.errors=null,E.schema=e.schema,E.schemaEnv=e,e.$async&&(E.$async=!0),this.opts.code.source===!0&&(E.source={validateName:f,validateCode:p,scopeValues:o._values}),this.opts.unevaluated){const{props:P,items:O}=l;E.evaluated={props:P instanceof ke.Name?void 0:P,items:O instanceof ke.Name?void 0:O,dynamicProps:P instanceof ke.Name,dynamicItems:O instanceof ke.Name},E.source&&(E.source.evaluated=(0,ke.stringify)(E.evaluated))}return e.validate=E,e}catch(p){throw delete e.validate,delete e.validateName,d&&this.logger.error("Error compiling schema, function code:",d),p}finally{this._compilations.delete(e)}}ve.compileSchema=Sn;function xc(e,t,r){var n;r=(0,Ce.resolveUrl)(this.opts.uriResolver,t,r);const s=e.refs[r];if(s)return s;let i=Gc.call(this,e,r);if(i===void 0){const o=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:u}=this.opts;o&&(i=new Ur({schema:o,schemaId:u,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=Hc.call(this,i)}ve.resolveRef=xc;function Hc(e){return(0,Ce.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Sn.call(this,e)}function Zi(e){for(const t of this._compilations)if(Bc(t,e))return t}ve.getCompilingSchema=Zi;function Bc(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Gc(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||Vr.call(this,e,t)}function Vr(e,t){const r=this.opts.uriResolver.parse(t),n=(0,Ce._getFullPath)(this.opts.uriResolver,r);let s=(0,Ce.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return Qr.call(this,r,e);const i=(0,Ce.normalizeId)(n),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){const u=Vr.call(this,e,o);return typeof(u==null?void 0:u.schema)!="object"?void 0:Qr.call(this,r,u)}if(typeof(o==null?void 0:o.schema)=="object"){if(o.validate||Sn.call(this,o),i===(0,Ce.normalizeId)(t)){const{schema:u}=o,{schemaId:f}=this.opts,l=u[f];return l&&(s=(0,Ce.resolveUrl)(this.opts.uriResolver,s,l)),new Ur({schema:u,schemaId:f,root:e,baseId:s})}return Qr.call(this,r,o)}}ve.resolveSchema=Vr;const Kc=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Qr(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(const u of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const f=r[(0,Is.unescapeFragment)(u)];if(f===void 0)return;r=f;const l=typeof r=="object"&&r[this.opts.schemaId];!Kc.has(u)&&l&&(t=(0,Ce.resolveUrl)(this.opts.uriResolver,t,l))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,Is.schemaHasRulesButRef)(r,this.RULES)){const u=(0,Ce.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=Vr.call(this,n,u)}const{schemaId:o}=this.opts;if(i=i||new Ur({schema:r,schemaId:o,root:n,baseId:t}),i.schema!==i.root.schema)return i}const Jc="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Qc="Meta-schema for $data reference (JSON AnySchema extension proposal)",Yc="object",Zc=["$data"],Xc={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},el=!1,tl={$id:Jc,description:Qc,type:Yc,required:Zc,properties:Xc,additionalProperties:el};var Tn={},cn={exports:{}};/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */(function(e,t){(function(r,n){n(t)})(la,function(r){function n(){for(var h=arguments.length,c=Array(h),y=0;y<h;y++)c[y]=arguments[y];if(c.length>1){c[0]=c[0].slice(0,-1);for(var k=c.length-1,R=1;R<k;++R)c[R]=c[R].slice(1,-1);return c[k]=c[k].slice(1),c.join("")}else return c[0]}function s(h){return"(?:"+h+")"}function i(h){return h===void 0?"undefined":h===null?"null":Object.prototype.toString.call(h).split(" ").pop().split("]").shift().toLowerCase()}function o(h){return h.toUpperCase()}function u(h){return h!=null?h instanceof Array?h:typeof h.length!="number"||h.split||h.setInterval||h.call?[h]:Array.prototype.slice.call(h):[]}function f(h,c){var y=h;if(c)for(var k in c)y[k]=c[k];return y}function l(h){var c="[A-Za-z]",y="[0-9]",k=n(y,"[A-Fa-f]"),R=s(s("%[EFef]"+k+"%"+k+k+"%"+k+k)+"|"+s("%[89A-Fa-f]"+k+"%"+k+k)+"|"+s("%"+k+k)),U="[\\:\\/\\?\\#\\[\\]\\@]",V="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",Z=n(U,V),te=h?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",ae=h?"[\\uE000-\\uF8FF]":"[]",J=n(c,y,"[\\-\\.\\_\\~]",te);s(c+n(c,y,"[\\+\\-\\.]")+"*"),s(s(R+"|"+n(J,V,"[\\:]"))+"*");var ee=s(s("25[0-5]")+"|"+s("2[0-4]"+y)+"|"+s("1"+y+y)+"|"+s("0?[1-9]"+y)+"|0?0?"+y),ce=s(ee+"\\."+ee+"\\."+ee+"\\."+ee),x=s(k+"{1,4}"),ne=s(s(x+"\\:"+x)+"|"+ce),fe=s(s(x+"\\:")+"{6}"+ne),se=s("\\:\\:"+s(x+"\\:")+"{5}"+ne),Ke=s(s(x)+"?\\:\\:"+s(x+"\\:")+"{4}"+ne),De=s(s(s(x+"\\:")+"{0,1}"+x)+"?\\:\\:"+s(x+"\\:")+"{3}"+ne),Me=s(s(s(x+"\\:")+"{0,2}"+x)+"?\\:\\:"+s(x+"\\:")+"{2}"+ne),vt=s(s(s(x+"\\:")+"{0,3}"+x)+"?\\:\\:"+x+"\\:"+ne),nt=s(s(s(x+"\\:")+"{0,4}"+x)+"?\\:\\:"+ne),Se=s(s(s(x+"\\:")+"{0,5}"+x)+"?\\:\\:"+x),Le=s(s(s(x+"\\:")+"{0,6}"+x)+"?\\:\\:"),st=s([fe,se,Ke,De,Me,vt,nt,Se,Le].join("|")),xe=s(s(J+"|"+R)+"+");s("[vV]"+k+"+\\."+n(J,V,"[\\:]")+"+"),s(s(R+"|"+n(J,V))+"*");var Ut=s(R+"|"+n(J,V,"[\\:\\@]"));return s(s(R+"|"+n(J,V,"[\\@]"))+"+"),s(s(Ut+"|"+n("[\\/\\?]",ae))+"*"),{NOT_SCHEME:new RegExp(n("[^]",c,y,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(n("[^\\%\\:]",J,V),"g"),NOT_HOST:new RegExp(n("[^\\%\\[\\]\\:]",J,V),"g"),NOT_PATH:new RegExp(n("[^\\%\\/\\:\\@]",J,V),"g"),NOT_PATH_NOSCHEME:new RegExp(n("[^\\%\\/\\@]",J,V),"g"),NOT_QUERY:new RegExp(n("[^\\%]",J,V,"[\\:\\@\\/\\?]",ae),"g"),NOT_FRAGMENT:new RegExp(n("[^\\%]",J,V,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(n("[^]",J,V),"g"),UNRESERVED:new RegExp(J,"g"),OTHER_CHARS:new RegExp(n("[^\\%]",J,Z),"g"),PCT_ENCODED:new RegExp(R,"g"),IPV4ADDRESS:new RegExp("^("+ce+")$"),IPV6ADDRESS:new RegExp("^\\[?("+st+")"+s(s("\\%25|\\%(?!"+k+"{2})")+"("+xe+")")+"?\\]?$")}}var d=l(!1),p=l(!0),b=function(){function h(c,y){var k=[],R=!0,U=!1,V=void 0;try{for(var Z=c[Symbol.iterator](),te;!(R=(te=Z.next()).done)&&(k.push(te.value),!(y&&k.length===y));R=!0);}catch(ae){U=!0,V=ae}finally{try{!R&&Z.return&&Z.return()}finally{if(U)throw V}}return k}return function(c,y){if(Array.isArray(c))return c;if(Symbol.iterator in Object(c))return h(c,y);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),E=function(h){if(Array.isArray(h)){for(var c=0,y=Array(h.length);c<h.length;c++)y[c]=h[c];return y}else return Array.from(h)},P=2147483647,O=36,_=1,g=26,$=38,S=700,I=72,D=128,v="-",C=/^xn--/,A=/[^\0-\x7E]/,W=/[\x2E\u3002\uFF0E\uFF61]/g,G={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ie=O-_,Y=Math.floor,Ee=String.fromCharCode;function de(h){throw new RangeError(G[h])}function Xe(h,c){for(var y=[],k=h.length;k--;)y[k]=c(h[k]);return y}function et(h,c){var y=h.split("@"),k="";y.length>1&&(k=y[0]+"@",h=y[1]),h=h.replace(W,".");var R=h.split("."),U=Xe(R,c).join(".");return k+U}function pt(h){for(var c=[],y=0,k=h.length;y<k;){var R=h.charCodeAt(y++);if(R>=55296&&R<=56319&&y<k){var U=h.charCodeAt(y++);(U&64512)==56320?c.push(((R&1023)<<10)+(U&1023)+65536):(c.push(R),y--)}else c.push(R)}return c}var It=function(c){return String.fromCodePoint.apply(String,E(c))},ht=function(c){return c-48<10?c-22:c-65<26?c-65:c-97<26?c-97:O},M=function(c,y){return c+22+75*(c<26)-((y!=0)<<5)},w=function(c,y,k){var R=0;for(c=k?Y(c/S):c>>1,c+=Y(c/y);c>ie*g>>1;R+=O)c=Y(c/ie);return Y(R+(ie+1)*c/(c+$))},j=function(c){var y=[],k=c.length,R=0,U=D,V=I,Z=c.lastIndexOf(v);Z<0&&(Z=0);for(var te=0;te<Z;++te)c.charCodeAt(te)>=128&&de("not-basic"),y.push(c.charCodeAt(te));for(var ae=Z>0?Z+1:0;ae<k;){for(var J=R,ee=1,ce=O;;ce+=O){ae>=k&&de("invalid-input");var x=ht(c.charCodeAt(ae++));(x>=O||x>Y((P-R)/ee))&&de("overflow"),R+=x*ee;var ne=ce<=V?_:ce>=V+g?g:ce-V;if(x<ne)break;var fe=O-ne;ee>Y(P/fe)&&de("overflow"),ee*=fe}var se=y.length+1;V=w(R-J,se,J==0),Y(R/se)>P-U&&de("overflow"),U+=Y(R/se),R%=se,y.splice(R++,0,U)}return String.fromCodePoint.apply(String,y)},T=function(c){var y=[];c=pt(c);var k=c.length,R=D,U=0,V=I,Z=!0,te=!1,ae=void 0;try{for(var J=c[Symbol.iterator](),ee;!(Z=(ee=J.next()).done);Z=!0){var ce=ee.value;ce<128&&y.push(Ee(ce))}}catch(Vt){te=!0,ae=Vt}finally{try{!Z&&J.return&&J.return()}finally{if(te)throw ae}}var x=y.length,ne=x;for(x&&y.push(v);ne<k;){var fe=P,se=!0,Ke=!1,De=void 0;try{for(var Me=c[Symbol.iterator](),vt;!(se=(vt=Me.next()).done);se=!0){var nt=vt.value;nt>=R&&nt<fe&&(fe=nt)}}catch(Vt){Ke=!0,De=Vt}finally{try{!se&&Me.return&&Me.return()}finally{if(Ke)throw De}}var Se=ne+1;fe-R>Y((P-U)/Se)&&de("overflow"),U+=(fe-R)*Se,R=fe;var Le=!0,st=!1,xe=void 0;try{for(var Ut=c[Symbol.iterator](),hs;!(Le=(hs=Ut.next()).done);Le=!0){var ms=hs.value;if(ms<R&&++U>P&&de("overflow"),ms==R){for(var ir=U,or=O;;or+=O){var ar=or<=V?_:or>=V+g?g:or-V;if(ir<ar)break;var ys=ir-ar,gs=O-ar;y.push(Ee(M(ar+ys%gs,0))),ir=Y(ys/gs)}y.push(Ee(M(ir,0))),V=w(U,Se,ne==x),U=0,++ne}}}catch(Vt){st=!0,xe=Vt}finally{try{!Le&&Ut.return&&Ut.return()}finally{if(st)throw xe}}++U,++R}return y.join("")},a=function(c){return et(c,function(y){return C.test(y)?j(y.slice(4).toLowerCase()):y})},m=function(c){return et(c,function(y){return A.test(y)?"xn--"+T(y):y})},N={version:"2.1.0",ucs2:{decode:pt,encode:It},decode:j,encode:T,toASCII:m,toUnicode:a},L={};function F(h){var c=h.charCodeAt(0),y=void 0;return c<16?y="%0"+c.toString(16).toUpperCase():c<128?y="%"+c.toString(16).toUpperCase():c<2048?y="%"+(c>>6|192).toString(16).toUpperCase()+"%"+(c&63|128).toString(16).toUpperCase():y="%"+(c>>12|224).toString(16).toUpperCase()+"%"+(c>>6&63|128).toString(16).toUpperCase()+"%"+(c&63|128).toString(16).toUpperCase(),y}function K(h){for(var c="",y=0,k=h.length;y<k;){var R=parseInt(h.substr(y+1,2),16);if(R<128)c+=String.fromCharCode(R),y+=3;else if(R>=194&&R<224){if(k-y>=6){var U=parseInt(h.substr(y+4,2),16);c+=String.fromCharCode((R&31)<<6|U&63)}else c+=h.substr(y,6);y+=6}else if(R>=224){if(k-y>=9){var V=parseInt(h.substr(y+4,2),16),Z=parseInt(h.substr(y+7,2),16);c+=String.fromCharCode((R&15)<<12|(V&63)<<6|Z&63)}else c+=h.substr(y,9);y+=9}else c+=h.substr(y,3),y+=3}return c}function Q(h,c){function y(k){var R=K(k);return R.match(c.UNRESERVED)?R:k}return h.scheme&&(h.scheme=String(h.scheme).replace(c.PCT_ENCODED,y).toLowerCase().replace(c.NOT_SCHEME,"")),h.userinfo!==void 0&&(h.userinfo=String(h.userinfo).replace(c.PCT_ENCODED,y).replace(c.NOT_USERINFO,F).replace(c.PCT_ENCODED,o)),h.host!==void 0&&(h.host=String(h.host).replace(c.PCT_ENCODED,y).toLowerCase().replace(c.NOT_HOST,F).replace(c.PCT_ENCODED,o)),h.path!==void 0&&(h.path=String(h.path).replace(c.PCT_ENCODED,y).replace(h.scheme?c.NOT_PATH:c.NOT_PATH_NOSCHEME,F).replace(c.PCT_ENCODED,o)),h.query!==void 0&&(h.query=String(h.query).replace(c.PCT_ENCODED,y).replace(c.NOT_QUERY,F).replace(c.PCT_ENCODED,o)),h.fragment!==void 0&&(h.fragment=String(h.fragment).replace(c.PCT_ENCODED,y).replace(c.NOT_FRAGMENT,F).replace(c.PCT_ENCODED,o)),h}function oe(h){return h.replace(/^0*(.*)/,"$1")||"0"}function Ie(h,c){var y=h.match(c.IPV4ADDRESS)||[],k=b(y,2),R=k[1];return R?R.split(".").map(oe).join("."):h}function mt(h,c){var y=h.match(c.IPV6ADDRESS)||[],k=b(y,3),R=k[1],U=k[2];if(R){for(var V=R.toLowerCase().split("::").reverse(),Z=b(V,2),te=Z[0],ae=Z[1],J=ae?ae.split(":").map(oe):[],ee=te.split(":").map(oe),ce=c.IPV4ADDRESS.test(ee[ee.length-1]),x=ce?7:8,ne=ee.length-x,fe=Array(x),se=0;se<x;++se)fe[se]=J[se]||ee[ne+se]||"";ce&&(fe[x-1]=Ie(fe[x-1],c));var Ke=fe.reduce(function(Se,Le,st){if(!Le||Le==="0"){var xe=Se[Se.length-1];xe&&xe.index+xe.length===st?xe.length++:Se.push({index:st,length:1})}return Se},[]),De=Ke.sort(function(Se,Le){return Le.length-Se.length})[0],Me=void 0;if(De&&De.length>1){var vt=fe.slice(0,De.index),nt=fe.slice(De.index+De.length);Me=vt.join(":")+"::"+nt.join(":")}else Me=fe.join(":");return U&&(Me+="%"+U),Me}else return h}var jt=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,At="".match(/(){0}/)[1]===void 0;function be(h){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y={},k=c.iri!==!1?p:d;c.reference==="suffix"&&(h=(c.scheme?c.scheme+":":"")+"//"+h);var R=h.match(jt);if(R){At?(y.scheme=R[1],y.userinfo=R[3],y.host=R[4],y.port=parseInt(R[5],10),y.path=R[6]||"",y.query=R[7],y.fragment=R[8],isNaN(y.port)&&(y.port=R[5])):(y.scheme=R[1]||void 0,y.userinfo=h.indexOf("@")!==-1?R[3]:void 0,y.host=h.indexOf("//")!==-1?R[4]:void 0,y.port=parseInt(R[5],10),y.path=R[6]||"",y.query=h.indexOf("?")!==-1?R[7]:void 0,y.fragment=h.indexOf("#")!==-1?R[8]:void 0,isNaN(y.port)&&(y.port=h.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?R[4]:void 0)),y.host&&(y.host=mt(Ie(y.host,k),k)),y.scheme===void 0&&y.userinfo===void 0&&y.host===void 0&&y.port===void 0&&!y.path&&y.query===void 0?y.reference="same-document":y.scheme===void 0?y.reference="relative":y.fragment===void 0?y.reference="absolute":y.reference="uri",c.reference&&c.reference!=="suffix"&&c.reference!==y.reference&&(y.error=y.error||"URI is not a "+c.reference+" reference.");var U=L[(c.scheme||y.scheme||"").toLowerCase()];if(!c.unicodeSupport&&(!U||!U.unicodeSupport)){if(y.host&&(c.domainHost||U&&U.domainHost))try{y.host=N.toASCII(y.host.replace(k.PCT_ENCODED,K).toLowerCase())}catch(V){y.error=y.error||"Host's domain name can not be converted to ASCII via punycode: "+V}Q(y,d)}else Q(y,k);U&&U.parse&&U.parse(y,c)}else y.error=y.error||"URI can not be parsed.";return y}function Dt(h,c){var y=c.iri!==!1?p:d,k=[];return h.userinfo!==void 0&&(k.push(h.userinfo),k.push("@")),h.host!==void 0&&k.push(mt(Ie(String(h.host),y),y).replace(y.IPV6ADDRESS,function(R,U,V){return"["+U+(V?"%25"+V:"")+"]"})),(typeof h.port=="number"||typeof h.port=="string")&&(k.push(":"),k.push(String(h.port))),k.length?k.join(""):void 0}var yt=/^\.\.?\//,gt=/^\/\.(\/|$)/,$t=/^\/\.\.(\/|$)/,Mt=/^\/?(?:.|\n)*?(?=\/|$)/;function je(h){for(var c=[];h.length;)if(h.match(yt))h=h.replace(yt,"");else if(h.match(gt))h=h.replace(gt,"/");else if(h.match($t))h=h.replace($t,"/"),c.pop();else if(h==="."||h==="..")h="";else{var y=h.match(Mt);if(y){var k=y[0];h=h.slice(k.length),c.push(k)}else throw new Error("Unexpected dot segment condition")}return c.join("")}function _e(h){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y=c.iri?p:d,k=[],R=L[(c.scheme||h.scheme||"").toLowerCase()];if(R&&R.serialize&&R.serialize(h,c),h.host&&!y.IPV6ADDRESS.test(h.host)){if(c.domainHost||R&&R.domainHost)try{h.host=c.iri?N.toUnicode(h.host):N.toASCII(h.host.replace(y.PCT_ENCODED,K).toLowerCase())}catch(Z){h.error=h.error||"Host's domain name can not be converted to "+(c.iri?"Unicode":"ASCII")+" via punycode: "+Z}}Q(h,y),c.reference!=="suffix"&&h.scheme&&(k.push(h.scheme),k.push(":"));var U=Dt(h,c);if(U!==void 0&&(c.reference!=="suffix"&&k.push("//"),k.push(U),h.path&&h.path.charAt(0)!=="/"&&k.push("/")),h.path!==void 0){var V=h.path;!c.absolutePath&&(!R||!R.absolutePath)&&(V=je(V)),U===void 0&&(V=V.replace(/^\/\//,"/%2F")),k.push(V)}return h.query!==void 0&&(k.push("?"),k.push(h.query)),h.fragment!==void 0&&(k.push("#"),k.push(h.fragment)),k.join("")}function _t(h,c){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},k=arguments[3],R={};return k||(h=be(_e(h,y),y),c=be(_e(c,y),y)),y=y||{},!y.tolerant&&c.scheme?(R.scheme=c.scheme,R.userinfo=c.userinfo,R.host=c.host,R.port=c.port,R.path=je(c.path||""),R.query=c.query):(c.userinfo!==void 0||c.host!==void 0||c.port!==void 0?(R.userinfo=c.userinfo,R.host=c.host,R.port=c.port,R.path=je(c.path||""),R.query=c.query):(c.path?(c.path.charAt(0)==="/"?R.path=je(c.path):((h.userinfo!==void 0||h.host!==void 0||h.port!==void 0)&&!h.path?R.path="/"+c.path:h.path?R.path=h.path.slice(0,h.path.lastIndexOf("/")+1)+c.path:R.path=c.path,R.path=je(R.path)),R.query=c.query):(R.path=h.path,c.query!==void 0?R.query=c.query:R.query=h.query),R.userinfo=h.userinfo,R.host=h.host,R.port=h.port),R.scheme=h.scheme),R.fragment=c.fragment,R}function Lt(h,c,y){var k=f({scheme:"null"},y);return _e(_t(be(h,k),be(c,k),k,!0),k)}function tt(h,c){return typeof h=="string"?h=_e(be(h,c),c):i(h)==="object"&&(h=be(_e(h,c),c)),h}function Ft(h,c,y){return typeof h=="string"?h=_e(be(h,y),y):i(h)==="object"&&(h=_e(h,y)),typeof c=="string"?c=_e(be(c,y),y):i(c)==="object"&&(c=_e(c,y)),h===c}function sr(h,c){return h&&h.toString().replace(!c||!c.iri?d.ESCAPE:p.ESCAPE,F)}function Pe(h,c){return h&&h.toString().replace(!c||!c.iri?d.PCT_ENCODED:p.PCT_ENCODED,K)}var rt={scheme:"http",domainHost:!0,parse:function(c,y){return c.host||(c.error=c.error||"HTTP URIs must have a host."),c},serialize:function(c,y){var k=String(c.scheme).toLowerCase()==="https";return(c.port===(k?443:80)||c.port==="")&&(c.port=void 0),c.path||(c.path="/"),c}},os={scheme:"https",domainHost:rt.domainHost,parse:rt.parse,serialize:rt.serialize};function as(h){return typeof h.secure=="boolean"?h.secure:String(h.scheme).toLowerCase()==="wss"}var qt={scheme:"ws",domainHost:!0,parse:function(c,y){var k=c;return k.secure=as(k),k.resourceName=(k.path||"/")+(k.query?"?"+k.query:""),k.path=void 0,k.query=void 0,k},serialize:function(c,y){if((c.port===(as(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 k=c.resourceName.split("?"),R=b(k,2),U=R[0],V=R[1];c.path=U&&U!=="/"?U:void 0,c.query=V,c.resourceName=void 0}return c.fragment=void 0,c}},cs={scheme:"wss",domainHost:qt.domainHost,parse:qt.parse,serialize:qt.serialize},vo={},ls="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Ae="[0-9A-Fa-f]",bo=s(s("%[EFef]"+Ae+"%"+Ae+Ae+"%"+Ae+Ae)+"|"+s("%[89A-Fa-f]"+Ae+"%"+Ae+Ae)+"|"+s("%"+Ae+Ae)),Eo="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Po="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",So=n(Po,'[\\"\\\\]'),To="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ro=new RegExp(ls,"g"),wt=new RegExp(bo,"g"),ko=new RegExp(n("[^]",Eo,"[\\.]",'[\\"]',So),"g"),us=new RegExp(n("[^]",ls,To),"g"),Oo=us;function Wr(h){var c=K(h);return c.match(Ro)?c:h}var ds={scheme:"mailto",parse:function(c,y){var k=c,R=k.to=k.path?k.path.split(","):[];if(k.path=void 0,k.query){for(var U=!1,V={},Z=k.query.split("&"),te=0,ae=Z.length;te<ae;++te){var J=Z[te].split("=");switch(J[0]){case"to":for(var ee=J[1].split(","),ce=0,x=ee.length;ce<x;++ce)R.push(ee[ce]);break;case"subject":k.subject=Pe(J[1],y);break;case"body":k.body=Pe(J[1],y);break;default:U=!0,V[Pe(J[0],y)]=Pe(J[1],y);break}}U&&(k.headers=V)}k.query=void 0;for(var ne=0,fe=R.length;ne<fe;++ne){var se=R[ne].split("@");if(se[0]=Pe(se[0]),y.unicodeSupport)se[1]=Pe(se[1],y).toLowerCase();else try{se[1]=N.toASCII(Pe(se[1],y).toLowerCase())}catch(Ke){k.error=k.error||"Email address's domain name can not be converted to ASCII via punycode: "+Ke}R[ne]=se.join("@")}return k},serialize:function(c,y){var k=c,R=u(c.to);if(R){for(var U=0,V=R.length;U<V;++U){var Z=String(R[U]),te=Z.lastIndexOf("@"),ae=Z.slice(0,te).replace(wt,Wr).replace(wt,o).replace(ko,F),J=Z.slice(te+1);try{J=y.iri?N.toUnicode(J):N.toASCII(Pe(J,y).toLowerCase())}catch(ne){k.error=k.error||"Email address's domain name can not be converted to "+(y.iri?"Unicode":"ASCII")+" via punycode: "+ne}R[U]=ae+"@"+J}k.path=R.join(",")}var ee=c.headers=c.headers||{};c.subject&&(ee.subject=c.subject),c.body&&(ee.body=c.body);var ce=[];for(var x in ee)ee[x]!==vo[x]&&ce.push(x.replace(wt,Wr).replace(wt,o).replace(us,F)+"="+ee[x].replace(wt,Wr).replace(wt,o).replace(Oo,F));return ce.length&&(k.query=ce.join("&")),k}},Co=/^([^\:]+)\:(.*)/,fs={scheme:"urn",parse:function(c,y){var k=c.path&&c.path.match(Co),R=c;if(k){var U=y.scheme||R.scheme||"urn",V=k[1].toLowerCase(),Z=k[2],te=U+":"+(y.nid||V),ae=L[te];R.nid=V,R.nss=Z,R.path=void 0,ae&&(R=ae.parse(R,y))}else R.error=R.error||"URN can not be parsed.";return R},serialize:function(c,y){var k=y.scheme||c.scheme||"urn",R=c.nid,U=k+":"+(y.nid||R),V=L[U];V&&(c=V.serialize(c,y));var Z=c,te=c.nss;return Z.path=(R||y.nid)+":"+te,Z}},No=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,ps={scheme:"urn:uuid",parse:function(c,y){var k=c;return k.uuid=k.nss,k.nss=void 0,!y.tolerant&&(!k.uuid||!k.uuid.match(No))&&(k.error=k.error||"UUID is not valid."),k},serialize:function(c,y){var k=c;return k.nss=(c.uuid||"").toLowerCase(),k}};L[rt.scheme]=rt,L[os.scheme]=os,L[qt.scheme]=qt,L[cs.scheme]=cs,L[ds.scheme]=ds,L[fs.scheme]=fs,L[ps.scheme]=ps,r.SCHEMES=L,r.pctEncChar=F,r.pctDecChars=K,r.parse=be,r.removeDotSegments=je,r.serialize=_e,r.resolveComponents=_t,r.resolve=Lt,r.normalize=tt,r.equal=Ft,r.escapeComponent=sr,r.unescapeComponent=Pe,Object.defineProperty(r,"__esModule",{value:!0})})})(cn,cn.exports);var rl=cn.exports;Object.defineProperty(Tn,"__esModule",{value:!0});const Xi=rl;Xi.code='require("ajv/dist/runtime/uri").default';Tn.default=Xi;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Ne;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=B;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=tr,s=rr,i=ut,o=ve,u=B,f=me,l=er,d=X,p=tl,b=Tn,E=(M,w)=>new RegExp(M,w);E.code="new RegExp";const P=["removeAdditional","useDefaults","coerceTypes"],O=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.'},$=200;function S(M){var w,j,T,a,m,N,L,F,K,Q,oe,Ie,mt,jt,At,be,Dt,yt,gt,$t,Mt,je,_e,_t,Lt;const tt=M.strict,Ft=(w=M.code)===null||w===void 0?void 0:w.optimize,sr=Ft===!0||Ft===void 0?1:Ft||0,Pe=(T=(j=M.code)===null||j===void 0?void 0:j.regExp)!==null&&T!==void 0?T:E,rt=(a=M.uriResolver)!==null&&a!==void 0?a:b.default;return{strictSchema:(N=(m=M.strictSchema)!==null&&m!==void 0?m:tt)!==null&&N!==void 0?N:!0,strictNumbers:(F=(L=M.strictNumbers)!==null&&L!==void 0?L:tt)!==null&&F!==void 0?F:!0,strictTypes:(Q=(K=M.strictTypes)!==null&&K!==void 0?K:tt)!==null&&Q!==void 0?Q:"log",strictTuples:(Ie=(oe=M.strictTuples)!==null&&oe!==void 0?oe:tt)!==null&&Ie!==void 0?Ie:"log",strictRequired:(jt=(mt=M.strictRequired)!==null&&mt!==void 0?mt:tt)!==null&&jt!==void 0?jt:!1,code:M.code?{...M.code,optimize:sr,regExp:Pe}:{optimize:sr,regExp:Pe},loopRequired:(At=M.loopRequired)!==null&&At!==void 0?At:$,loopEnum:(be=M.loopEnum)!==null&&be!==void 0?be:$,meta:(Dt=M.meta)!==null&&Dt!==void 0?Dt:!0,messages:(yt=M.messages)!==null&&yt!==void 0?yt:!0,inlineRefs:(gt=M.inlineRefs)!==null&&gt!==void 0?gt:!0,schemaId:($t=M.schemaId)!==null&&$t!==void 0?$t:"$id",addUsedSchema:(Mt=M.addUsedSchema)!==null&&Mt!==void 0?Mt:!0,validateSchema:(je=M.validateSchema)!==null&&je!==void 0?je:!0,validateFormats:(_e=M.validateFormats)!==null&&_e!==void 0?_e:!0,unicodeRegExp:(_t=M.unicodeRegExp)!==null&&_t!==void 0?_t:!0,int32range:(Lt=M.int32range)!==null&&Lt!==void 0?Lt:!0,uriResolver:rt}}class I{constructor(w={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,w=this.opts={...w,...S(w)};const{es5:j,lines:T}=this.opts.code;this.scope=new u.ValueScope({scope:{},prefixes:O,es5:j,lines:T}),this.logger=Y(w.logger);const a=w.validateFormats;w.validateFormats=!1,this.RULES=(0,i.getRules)(),D.call(this,_,w,"NOT SUPPORTED"),D.call(this,g,w,"DEPRECATED","warn"),this._metaOpts=G.call(this),w.formats&&A.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),w.keywords&&W.call(this,w.keywords),typeof w.meta=="object"&&this.addMetaSchema(w.meta),C.call(this),w.validateFormats=a}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:w,meta:j,schemaId:T}=this.opts;let a=p;T==="id"&&(a={...p},a.id=a.$id,delete a.$id),j&&w&&this.addMetaSchema(a,a[T],!1)}defaultMeta(){const{meta:w,schemaId:j}=this.opts;return this.opts.defaultMeta=typeof w=="object"?w[j]||w:void 0}validate(w,j){let T;if(typeof w=="string"){if(T=this.getSchema(w),!T)throw new Error(`no schema with key or ref "${w}"`)}else T=this.compile(w);const a=T(j);return"$async"in T||(this.errors=T.errors),a}compile(w,j){const T=this._addSchema(w,j);return T.validate||this._compileSchemaEnv(T)}compileAsync(w,j){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:T}=this.opts;return a.call(this,w,j);async function a(Q,oe){await m.call(this,Q.$schema);const Ie=this._addSchema(Q,oe);return Ie.validate||N.call(this,Ie)}async function m(Q){Q&&!this.getSchema(Q)&&await a.call(this,{$ref:Q},!0)}async function N(Q){try{return this._compileSchemaEnv(Q)}catch(oe){if(!(oe instanceof s.default))throw oe;return L.call(this,oe),await F.call(this,oe.missingSchema),N.call(this,Q)}}function L({missingSchema:Q,missingRef:oe}){if(this.refs[Q])throw new Error(`AnySchema ${Q} is loaded but ${oe} cannot be resolved`)}async function F(Q){const oe=await K.call(this,Q);this.refs[Q]||await m.call(this,oe.$schema),this.refs[Q]||this.addSchema(oe,Q,j)}async function K(Q){const oe=this._loading[Q];if(oe)return oe;try{return await(this._loading[Q]=T(Q))}finally{delete this._loading[Q]}}}addSchema(w,j,T,a=this.opts.validateSchema){if(Array.isArray(w)){for(const N of w)this.addSchema(N,void 0,T,a);return this}let m;if(typeof w=="object"){const{schemaId:N}=this.opts;if(m=w[N],m!==void 0&&typeof m!="string")throw new Error(`schema ${N} must be string`)}return j=(0,f.normalizeId)(j||m),this._checkUnique(j),this.schemas[j]=this._addSchema(w,T,j,a,!0),this}addMetaSchema(w,j,T=this.opts.validateSchema){return this.addSchema(w,j,!0,T),this}validateSchema(w,j){if(typeof w=="boolean")return!0;let T;if(T=w.$schema,T!==void 0&&typeof T!="string")throw new Error("$schema must be a string");if(T=T||this.opts.defaultMeta||this.defaultMeta(),!T)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const a=this.validate(T,w);if(!a&&j){const m="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(m);else throw new Error(m)}return a}getSchema(w){let j;for(;typeof(j=v.call(this,w))=="string";)w=j;if(j===void 0){const{schemaId:T}=this.opts,a=new o.SchemaEnv({schema:{},schemaId:T});if(j=o.resolveSchema.call(this,a,w),!j)return;this.refs[w]=j}return j.validate||this._compileSchemaEnv(j)}removeSchema(w){if(w instanceof RegExp)return this._removeAllSchemas(this.schemas,w),this._removeAllSchemas(this.refs,w),this;switch(typeof w){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const j=v.call(this,w);return typeof j=="object"&&this._cache.delete(j.schema),delete this.schemas[w],delete this.refs[w],this}case"object":{const j=w;this._cache.delete(j);let T=w[this.opts.schemaId];return T&&(T=(0,f.normalizeId)(T),delete this.schemas[T],delete this.refs[T]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(w){for(const j of w)this.addKeyword(j);return this}addKeyword(w,j){let T;if(typeof w=="string")T=w,typeof j=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),j.keyword=T);else if(typeof w=="object"&&j===void 0){if(j=w,T=j.keyword,Array.isArray(T)&&!T.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(de.call(this,T,j),!j)return(0,d.eachItem)(T,m=>Xe.call(this,m)),this;pt.call(this,j);const a={...j,type:(0,l.getJSONTypes)(j.type),schemaType:(0,l.getJSONTypes)(j.schemaType)};return(0,d.eachItem)(T,a.type.length===0?m=>Xe.call(this,m,a):m=>a.type.forEach(N=>Xe.call(this,m,a,N))),this}getKeyword(w){const j=this.RULES.all[w];return typeof j=="object"?j.definition:!!j}removeKeyword(w){const{RULES:j}=this;delete j.keywords[w],delete j.all[w];for(const T of j.rules){const a=T.rules.findIndex(m=>m.keyword===w);a>=0&&T.rules.splice(a,1)}return this}addFormat(w,j){return typeof j=="string"&&(j=new RegExp(j)),this.formats[w]=j,this}errorsText(w=this.errors,{separator:j=", ",dataVar:T="data"}={}){return!w||w.length===0?"No errors":w.map(a=>`${T}${a.instancePath} ${a.message}`).reduce((a,m)=>a+j+m)}$dataMetaSchema(w,j){const T=this.RULES.all;w=JSON.parse(JSON.stringify(w));for(const a of j){const m=a.split("/").slice(1);let N=w;for(const L of m)N=N[L];for(const L in T){const F=T[L];if(typeof F!="object")continue;const{$data:K}=F.definition,Q=N[L];K&&Q&&(N[L]=ht(Q))}}return w}_removeAllSchemas(w,j){for(const T in w){const a=w[T];(!j||j.test(T))&&(typeof a=="string"?delete w[T]:a&&!a.meta&&(this._cache.delete(a.schema),delete w[T]))}}_addSchema(w,j,T,a=this.opts.validateSchema,m=this.opts.addUsedSchema){let N;const{schemaId:L}=this.opts;if(typeof w=="object")N=w[L];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof w!="boolean")throw new Error("schema must be object or boolean")}let F=this._cache.get(w);if(F!==void 0)return F;T=(0,f.normalizeId)(N||T);const K=f.getSchemaRefs.call(this,w,T);return F=new o.SchemaEnv({schema:w,schemaId:L,meta:j,baseId:T,localRefs:K}),this._cache.set(F.schema,F),m&&!T.startsWith("#")&&(T&&this._checkUnique(T),this.refs[T]=F),a&&this.validateSchema(w,!0),F}_checkUnique(w){if(this.schemas[w]||this.refs[w])throw new Error(`schema with key or id "${w}" already exists`)}_compileSchemaEnv(w){if(w.meta?this._compileMetaSchema(w):o.compileSchema.call(this,w),!w.validate)throw new Error("ajv implementation error");return w.validate}_compileMetaSchema(w){const j=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,w)}finally{this.opts=j}}}e.default=I,I.ValidationError=n.default,I.MissingRefError=s.default;function D(M,w,j,T="error"){for(const a in M){const m=a;m in w&&this.logger[T](`${j}: option ${a}. ${M[m]}`)}}function v(M){return M=(0,f.normalizeId)(M),this.schemas[M]||this.refs[M]}function C(){const M=this.opts.schemas;if(M)if(Array.isArray(M))this.addSchema(M);else for(const w in M)this.addSchema(M[w],w)}function A(){for(const M in this.opts.formats){const w=this.opts.formats[M];w&&this.addFormat(M,w)}}function W(M){if(Array.isArray(M)){this.addVocabulary(M);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const w in M){const j=M[w];j.keyword||(j.keyword=w),this.addKeyword(j)}}function G(){const M={...this.opts};for(const w of P)delete M[w];return M}const ie={log(){},warn(){},error(){}};function Y(M){if(M===!1)return ie;if(M===void 0)return console;if(M.log&&M.warn&&M.error)return M;throw new Error("logger must implement log, warn and error methods")}const Ee=/^[a-z_$][a-z0-9_$:-]*$/i;function de(M,w){const{RULES:j}=this;if((0,d.eachItem)(M,T=>{if(j.keywords[T])throw new Error(`Keyword ${T} is already defined`);if(!Ee.test(T))throw new Error(`Keyword ${T} has invalid name`)}),!!w&&w.$data&&!("code"in w||"validate"in w))throw new Error('$data keyword must have "code" or "validate" function')}function Xe(M,w,j){var T;const a=w==null?void 0:w.post;if(j&&a)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:m}=this;let N=a?m.post:m.rules.find(({type:F})=>F===j);if(N||(N={type:j,rules:[]},m.rules.push(N)),m.keywords[M]=!0,!w)return;const L={keyword:M,definition:{...w,type:(0,l.getJSONTypes)(w.type),schemaType:(0,l.getJSONTypes)(w.schemaType)}};w.before?et.call(this,N,L,w.before):N.rules.push(L),m.all[M]=L,(T=w.implements)===null||T===void 0||T.forEach(F=>this.addKeyword(F))}function et(M,w,j){const T=M.rules.findIndex(a=>a.keyword===j);T>=0?M.rules.splice(T,0,w):(M.rules.push(w),this.logger.warn(`rule ${j} is not defined`))}function pt(M){let{metaSchema:w}=M;w!==void 0&&(M.$data&&this.opts.$data&&(w=ht(w)),M.validateSchema=this.compile(w,!0))}const It={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ht(M){return{anyOf:[M,It]}}})(ki);var Rn={},kn={},On={};Object.defineProperty(On,"__esModule",{value:!0});const nl={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};On.default=nl;var dt={};Object.defineProperty(dt,"__esModule",{value:!0});dt.callRef=dt.getValidate=void 0;const sl=rr,js=H,we=B,Et=We,As=ve,cr=X,il={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:i,validateName:o,opts:u,self:f}=n,{root:l}=i;if((r==="#"||r==="#/")&&s===l.baseId)return p();const d=As.resolveRef.call(f,l,s,r);if(d===void 0)throw new sl.default(n.opts.uriResolver,s,r);if(d instanceof As.SchemaEnv)return b(d);return E(d);function p(){if(i===l)return gr(e,o,i,i.$async);const P=t.scopeValue("root",{ref:l});return gr(e,(0,we._)`${P}.validate`,l,l.$async)}function b(P){const O=eo(e,P);gr(e,O,P,P.$async)}function E(P){const O=t.scopeValue("schema",u.code.source===!0?{ref:P,code:(0,we.stringify)(P)}:{ref:P}),_=t.name("valid"),g=e.subschema({schema:P,dataTypes:[],schemaPath:we.nil,topSchemaRef:O,errSchemaPath:r},_);e.mergeEvaluated(g),e.ok(_)}}};function eo(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,we._)`${r.scopeValue("wrapper",{ref:t})}.validate`}dt.getValidate=eo;function gr(e,t,r,n){const{gen:s,it:i}=e,{allErrors:o,schemaEnv:u,opts:f}=i,l=f.passContext?Et.default.this:we.nil;n?d():p();function d(){if(!u.$async)throw new Error("async schema referenced by sync schema");const P=s.let("valid");s.try(()=>{s.code((0,we._)`await ${(0,js.callValidateCode)(e,t,l)}`),E(t),o||s.assign(P,!0)},O=>{s.if((0,we._)`!(${O} instanceof ${i.ValidationError})`,()=>s.throw(O)),b(O),o||s.assign(P,!1)}),e.ok(P)}function p(){e.result((0,js.callValidateCode)(e,t,l),()=>E(t),()=>b(t))}function b(P){const O=(0,we._)`${P}.errors`;s.assign(Et.default.vErrors,(0,we._)`${Et.default.vErrors} === null ? ${O} : ${Et.default.vErrors}.concat(${O})`),s.assign(Et.default.errors,(0,we._)`${Et.default.vErrors}.length`)}function E(P){var O;if(!i.opts.unevaluated)return;const _=(O=r==null?void 0:r.validate)===null||O===void 0?void 0:O.evaluated;if(i.props!==!0)if(_&&!_.dynamicProps)_.props!==void 0&&(i.props=cr.mergeEvaluated.props(s,_.props,i.props));else{const g=s.var("props",(0,we._)`${P}.evaluated.props`);i.props=cr.mergeEvaluated.props(s,g,i.props,we.Name)}if(i.items!==!0)if(_&&!_.dynamicItems)_.items!==void 0&&(i.items=cr.mergeEvaluated.items(s,_.items,i.items));else{const g=s.var("items",(0,we._)`${P}.evaluated.items`);i.items=cr.mergeEvaluated.items(s,g,i.items,we.Name)}}}dt.callRef=gr;dt.default=il;Object.defineProperty(kn,"__esModule",{value:!0});const ol=On,al=dt,cl=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",ol.default,al.default];kn.default=cl;var Cn={},Nn={};Object.defineProperty(Nn,"__esModule",{value:!0});const Rr=B,Qe=Rr.operators,kr={maximum:{okStr:"<=",ok:Qe.LTE,fail:Qe.GT},minimum:{okStr:">=",ok:Qe.GTE,fail:Qe.LT},exclusiveMaximum:{okStr:"<",ok:Qe.LT,fail:Qe.GTE},exclusiveMinimum:{okStr:">",ok:Qe.GT,fail:Qe.LTE}},ll={message:({keyword:e,schemaCode:t})=>(0,Rr.str)`must be ${kr[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Rr._)`{comparison: ${kr[e].okStr}, limit: ${t}}`},ul={keyword:Object.keys(kr),type:"number",schemaType:"number",$data:!0,error:ll,code(e){const{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,Rr._)`${r} ${kr[t].fail} ${n} || isNaN(${r})`)}};Nn.default=ul;var In={};Object.defineProperty(In,"__esModule",{value:!0});const Bt=B,dl={message:({schemaCode:e})=>(0,Bt.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Bt._)`{multipleOf: ${e}}`},fl={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:dl,code(e){const{gen:t,data:r,schemaCode:n,it:s}=e,i=s.opts.multipleOfPrecision,o=t.let("res"),u=i?(0,Bt._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:(0,Bt._)`${o} !== parseInt(${o})`;e.fail$data((0,Bt._)`(${n} === 0 || (${o} = ${r}/${n}, ${u}))`)}};In.default=fl;var jn={},An={};Object.defineProperty(An,"__esModule",{value:!0});function to(e){const t=e.length;let r=0,n=0,s;for(;n<t;)r++,s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<t&&(s=e.charCodeAt(n),(s&64512)===56320&&n++);return r}An.default=to;to.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(jn,"__esModule",{value:!0});const at=B,pl=X,hl=An,ml={message({keyword:e,schemaCode:t}){const r=e==="maxLength"?"more":"fewer";return(0,at.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,at._)`{limit: ${e}}`},yl={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:ml,code(e){const{keyword:t,data:r,schemaCode:n,it:s}=e,i=t==="maxLength"?at.operators.GT:at.operators.LT,o=s.opts.unicode===!1?(0,at._)`${r}.length`:(0,at._)`${(0,pl.useFunc)(e.gen,hl.default)}(${r})`;e.fail$data((0,at._)`${o} ${i} ${n}`)}};jn.default=yl;var Dn={};Object.defineProperty(Dn,"__esModule",{value:!0});const gl=H,Or=B,$l={message:({schemaCode:e})=>(0,Or.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Or._)`{pattern: ${e}}`},_l={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:$l,code(e){const{data:t,$data:r,schema:n,schemaCode:s,it:i}=e,o=i.opts.unicodeRegExp?"u":"",u=r?(0,Or._)`(new RegExp(${s}, ${o}))`:(0,gl.usePattern)(e,n);e.fail$data((0,Or._)`!${u}.test(${t})`)}};Dn.default=_l;var Mn={};Object.defineProperty(Mn,"__esModule",{value:!0});const Gt=B,wl={message({keyword:e,schemaCode:t}){const r=e==="maxProperties"?"more":"fewer";return(0,Gt.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,Gt._)`{limit: ${e}}`},vl={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:wl,code(e){const{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?Gt.operators.GT:Gt.operators.LT;e.fail$data((0,Gt._)`Object.keys(${r}).length ${s} ${n}`)}};Mn.default=vl;var Ln={};Object.defineProperty(Ln,"__esModule",{value:!0});const Wt=H,Kt=B,bl=X,El={message:({params:{missingProperty:e}})=>(0,Kt.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Kt._)`{missingProperty: ${e}}`},Pl={keyword:"required",type:"object",schemaType:"array",$data:!0,error:El,code(e){const{gen:t,schema:r,schemaCode:n,data:s,$data:i,it:o}=e,{opts:u}=o;if(!i&&r.length===0)return;const f=r.length>=u.loopRequired;if(o.allErrors?l():d(),u.strictRequired){const E=e.parentSchema.properties,{definedProperties:P}=e.it;for(const O of r)if((E==null?void 0:E[O])===void 0&&!P.has(O)){const _=o.schemaEnv.baseId+o.errSchemaPath,g=`required property "${O}" is not defined at "${_}" (strictRequired)`;(0,bl.checkStrictMode)(o,g,o.opts.strictRequired)}}function l(){if(f||i)e.block$data(Kt.nil,p);else for(const E of r)(0,Wt.checkReportMissingProp)(e,E)}function d(){const E=t.let("missing");if(f||i){const P=t.let("valid",!0);e.block$data(P,()=>b(E,P)),e.ok(P)}else t.if((0,Wt.checkMissingProp)(e,r,E)),(0,Wt.reportMissingProp)(e,E),t.else()}function p(){t.forOf("prop",n,E=>{e.setParams({missingProperty:E}),t.if((0,Wt.noPropertyInData)(t,s,E,u.ownProperties),()=>e.error())})}function b(E,P){e.setParams({missingProperty:E}),t.forOf(E,n,()=>{t.assign(P,(0,Wt.propertyInData)(t,s,E,u.ownProperties)),t.if((0,Kt.not)(P),()=>{e.error(),t.break()})},Kt.nil)}}};Ln.default=Pl;var Fn={};Object.defineProperty(Fn,"__esModule",{value:!0});const Jt=B,Sl={message({keyword:e,schemaCode:t}){const r=e==="maxItems"?"more":"fewer";return(0,Jt.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,Jt._)`{limit: ${e}}`},Tl={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Sl,code(e){const{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?Jt.operators.GT:Jt.operators.LT;e.fail$data((0,Jt._)`${r}.length ${s} ${n}`)}};Fn.default=Tl;var qn={},nr={};Object.defineProperty(nr,"__esModule",{value:!0});const ro=Mi;ro.code='require("ajv/dist/runtime/equal").default';nr.default=ro;Object.defineProperty(qn,"__esModule",{value:!0});const Yr=er,he=B,Rl=X,kl=nr,Ol={message:({params:{i:e,j:t}})=>(0,he.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,he._)`{i: ${e}, j: ${t}}`},Cl={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Ol,code(e){const{gen:t,data:r,$data:n,schema:s,parentSchema:i,schemaCode:o,it:u}=e;if(!n&&!s)return;const f=t.let("valid"),l=i.items?(0,Yr.getSchemaTypes)(i.items):[];e.block$data(f,d,(0,he._)`${o} === false`),e.ok(f);function d(){const P=t.let("i",(0,he._)`${r}.length`),O=t.let("j");e.setParams({i:P,j:O}),t.assign(f,!0),t.if((0,he._)`${P} > 1`,()=>(p()?b:E)(P,O))}function p(){return l.length>0&&!l.some(P=>P==="object"||P==="array")}function b(P,O){const _=t.name("item"),g=(0,Yr.checkDataTypes)(l,_,u.opts.strictNumbers,Yr.DataType.Wrong),$=t.const("indices",(0,he._)`{}`);t.for((0,he._)`;${P}--;`,()=>{t.let(_,(0,he._)`${r}[${P}]`),t.if(g,(0,he._)`continue`),l.length>1&&t.if((0,he._)`typeof ${_} == "string"`,(0,he._)`${_} += "_"`),t.if((0,he._)`typeof ${$}[${_}] == "number"`,()=>{t.assign(O,(0,he._)`${$}[${_}]`),e.error(),t.assign(f,!1).break()}).code((0,he._)`${$}[${_}] = ${P}`)})}function E(P,O){const _=(0,Rl.useFunc)(t,kl.default),g=t.name("outer");t.label(g).for((0,he._)`;${P}--;`,()=>t.for((0,he._)`${O} = ${P}; ${O}--;`,()=>t.if((0,he._)`${_}(${r}[${P}], ${r}[${O}])`,()=>{e.error(),t.assign(f,!1).break(g)})))}}};qn.default=Cl;var Un={};Object.defineProperty(Un,"__esModule",{value:!0});const ln=B,Nl=X,Il=nr,jl={message:"must be equal to constant",params:({schemaCode:e})=>(0,ln._)`{allowedValue: ${e}}`},Al={keyword:"const",$data:!0,error:jl,code(e){const{gen:t,data:r,$data:n,schemaCode:s,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,ln._)`!${(0,Nl.useFunc)(t,Il.default)}(${r}, ${s})`):e.fail((0,ln._)`${i} !== ${r}`)}};Un.default=Al;var Vn={};Object.defineProperty(Vn,"__esModule",{value:!0});const xt=B,Dl=X,Ml=nr,Ll={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,xt._)`{allowedValues: ${e}}`},Fl={keyword:"enum",schemaType:"array",$data:!0,error:Ll,code(e){const{gen:t,data:r,$data:n,schema:s,schemaCode:i,it:o}=e;if(!n&&s.length===0)throw new Error("enum must have non-empty array");const u=s.length>=o.opts.loopEnum;let f;const l=()=>f??(f=(0,Dl.useFunc)(t,Ml.default));let d;if(u||n)d=t.let("valid"),e.block$data(d,p);else{if(!Array.isArray(s))throw new Error("ajv implementation error");const E=t.const("vSchema",i);d=(0,xt.or)(...s.map((P,O)=>b(E,O)))}e.pass(d);function p(){t.assign(d,!1),t.forOf("v",i,E=>t.if((0,xt._)`${l()}(${r}, ${E})`,()=>t.assign(d,!0).break()))}function b(E,P){const O=s[P];return typeof O=="object"&&O!==null?(0,xt._)`${l()}(${r}, ${E}[${P}])`:(0,xt._)`${r} === ${O}`}}};Vn.default=Fl;Object.defineProperty(Cn,"__esModule",{value:!0});const ql=Nn,Ul=In,Vl=jn,zl=Dn,Wl=Mn,xl=Ln,Hl=Fn,Bl=qn,Gl=Un,Kl=Vn,Jl=[ql.default,Ul.default,Vl.default,zl.default,Wl.default,xl.default,Hl.default,Bl.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Gl.default,Kl.default];Cn.default=Jl;var zn={},Ct={};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.validateAdditionalItems=void 0;const ct=B,un=X,Ql={message:({params:{len:e}})=>(0,ct.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,ct._)`{limit: ${e}}`},Yl={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Ql,code(e){const{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,un.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}no(e,n)}};function no(e,t){const{gen:r,schema:n,data:s,keyword:i,it:o}=e;o.items=!0;const u=r.const("len",(0,ct._)`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,ct._)`${u} <= ${t.length}`);else if(typeof n=="object"&&!(0,un.alwaysValidSchema)(o,n)){const l=r.var("valid",(0,ct._)`${u} <= ${t.length}`);r.if((0,ct.not)(l),()=>f(l)),e.ok(l)}function f(l){r.forRange("i",t.length,u,d=>{e.subschema({keyword:i,dataProp:d,dataPropType:un.Type.Num},l),o.allErrors||r.if((0,ct.not)(l),()=>r.break())})}}Ct.validateAdditionalItems=no;Ct.default=Yl;var Wn={},Nt={};Object.defineProperty(Nt,"__esModule",{value:!0});Nt.validateTuple=void 0;const Ds=B,$r=X,Zl=H,Xl={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return so(e,"additionalItems",t);r.items=!0,!(0,$r.alwaysValidSchema)(r,t)&&e.ok((0,Zl.validateArray)(e))}};function so(e,t,r=e.schema){const{gen:n,parentSchema:s,data:i,keyword:o,it:u}=e;d(s),u.opts.unevaluated&&r.length&&u.items!==!0&&(u.items=$r.mergeEvaluated.items(n,r.length,u.items));const f=n.name("valid"),l=n.const("len",(0,Ds._)`${i}.length`);r.forEach((p,b)=>{(0,$r.alwaysValidSchema)(u,p)||(n.if((0,Ds._)`${l} > ${b}`,()=>e.subschema({keyword:o,schemaProp:b,dataProp:b},f)),e.ok(f))});function d(p){const{opts:b,errSchemaPath:E}=u,P=r.length,O=P===p.minItems&&(P===p.maxItems||p[t]===!1);if(b.strictTuples&&!O){const _=`"${o}" is ${P}-tuple, but minItems or maxItems/${t} are not specified or different at path "${E}"`;(0,$r.checkStrictMode)(u,_,b.strictTuples)}}}Nt.validateTuple=so;Nt.default=Xl;Object.defineProperty(Wn,"__esModule",{value:!0});const eu=Nt,tu={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,eu.validateTuple)(e,"items")};Wn.default=tu;var xn={};Object.defineProperty(xn,"__esModule",{value:!0});const Ms=B,ru=X,nu=H,su=Ct,iu={message:({params:{len:e}})=>(0,Ms.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Ms._)`{limit: ${e}}`},ou={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:iu,code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;n.items=!0,!(0,ru.alwaysValidSchema)(n,t)&&(s?(0,su.validateAdditionalItems)(e,s):e.ok((0,nu.validateArray)(e)))}};xn.default=ou;var Hn={};Object.defineProperty(Hn,"__esModule",{value:!0});const Re=B,lr=X,au={message:({params:{min:e,max:t}})=>t===void 0?(0,Re.str)`must contain at least ${e} valid item(s)`:(0,Re.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,Re._)`{minContains: ${e}}`:(0,Re._)`{minContains: ${e}, maxContains: ${t}}`},cu={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:au,code(e){const{gen:t,schema:r,parentSchema:n,data:s,it:i}=e;let o,u;const{minContains:f,maxContains:l}=n;i.opts.next?(o=f===void 0?1:f,u=l):o=1;const d=t.const("len",(0,Re._)`${s}.length`);if(e.setParams({min:o,max:u}),u===void 0&&o===0){(0,lr.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(u!==void 0&&o>u){(0,lr.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,lr.alwaysValidSchema)(i,r)){let O=(0,Re._)`${d} >= ${o}`;u!==void 0&&(O=(0,Re._)`${O} && ${d} <= ${u}`),e.pass(O);return}i.items=!0;const p=t.name("valid");u===void 0&&o===1?E(p,()=>t.if(p,()=>t.break())):o===0?(t.let(p,!0),u!==void 0&&t.if((0,Re._)`${s}.length > 0`,b)):(t.let(p,!1),b()),e.result(p,()=>e.reset());function b(){const O=t.name("_valid"),_=t.let("count",0);E(O,()=>t.if(O,()=>P(_)))}function E(O,_){t.forRange("i",0,d,g=>{e.subschema({keyword:"contains",dataProp:g,dataPropType:lr.Type.Num,compositeRule:!0},O),_()})}function P(O){t.code((0,Re._)`${O}++`),u===void 0?t.if((0,Re._)`${O} >= ${o}`,()=>t.assign(p,!0).break()):(t.if((0,Re._)`${O} > ${u}`,()=>t.assign(p,!1).break()),o===1?t.assign(p,!0):t.if((0,Re._)`${O} >= ${o}`,()=>t.assign(p,!0)))}}};Hn.default=cu;var io={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=B,r=X,n=H;e.error={message:({params:{property:f,depsCount:l,deps:d}})=>{const p=l===1?"property":"properties";return(0,t.str)`must have ${p} ${d} when property ${f} is present`},params:({params:{property:f,depsCount:l,deps:d,missingProperty:p}})=>(0,t._)`{property: ${f},
715
+ ${s}`)}}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 _a=()=>{};class wa extends wn{constructor(t,r){super(r),this.resource=t}getURL(){return this.resource.url}get caption(){return this.resource.caption??super.caption}}class va extends wn{constructor(t,r){super(r),this.resource=t}get name(){return Mr(this.resource.slug)}getURL(){return`https://downloads.wordpress.org/theme/${Oi(this.resource.slug)}`}}class ba extends wn{constructor(t,r){super(r),this.resource=t}get name(){return Mr(this.resource.slug)}getURL(){return`https://downloads.wordpress.org/plugin/${Oi(this.resource.slug)}`}}function Oi(e){return!e||e.endsWith(".zip")?e:e+".latest-stable.zip"}class Ci extends ft{constructor(t){super(),this.resource=t}async resolve(){return this.resource.resolve()}async setPlayground(t){return this.resource.setPlayground(t)}get progress(){return this.resource.progress}set progress(t){this.resource.progress=t}get name(){return this.resource.name}get isAsync(){return this.resource.isAsync}}class Ea extends Ci{async resolve(){return this.promise||(this.promise=super.resolve()),this.promise}}class Pa extends Ci{constructor(t,r){super(t),this.semaphore=r}async resolve(){return this.isAsync?this.semaphore.run(()=>super.resolve()):super.resolve()}}var sn={exports:{}},Ni={},Ne={},kt={},Xt={},B={},Yt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor($){if(super(),!e.IDENTIFIER.test($))throw new Error("CodeGen: name must be a valid identifier");this.str=$}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor($){super(),this._items=typeof $=="string"?[$]:$}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const $=this._items[0];return $===""||$==='""'}get str(){var $;return($=this._str)!==null&&$!==void 0?$:this._str=this._items.reduce((S,I)=>`${S}${I}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((S,I)=>(I instanceof r&&(S[I.str]=(S[I.str]||0)+1),S),{})}}e._Code=n,e.nil=new n("");function s(g,...$){const S=[g[0]];let I=0;for(;I<$.length;)u(S,$[I]),S.push(g[++I]);return new n(S)}e._=s;const i=new n("+");function o(g,...$){const S=[b(g[0])];let I=0;for(;I<$.length;)S.push(i),u(S,$[I]),S.push(i,b(g[++I]));return f(S),new n(S)}e.str=o;function u(g,$){$ instanceof n?g.push(...$._items):$ instanceof r?g.push($):g.push(p($))}e.addCodeArg=u;function f(g){let $=1;for(;$<g.length-1;){if(g[$]===i){const S=l(g[$-1],g[$+1]);if(S!==void 0){g.splice($-1,3,S);continue}g[$++]="+"}$++}}function l(g,$){if($==='""')return g;if(g==='""')return $;if(typeof g=="string")return $ instanceof r||g[g.length-1]!=='"'?void 0:typeof $!="string"?`${g.slice(0,-1)}${$}"`:$[0]==='"'?g.slice(0,-1)+$.slice(1):void 0;if(typeof $=="string"&&$[0]==='"'&&!(g instanceof r))return`"${g}${$.slice(1)}`}function d(g,$){return $.emptyStr()?g:g.emptyStr()?$:o`${g}${$}`}e.strConcat=d;function p(g){return typeof g=="number"||typeof g=="boolean"||g===null?g:b(Array.isArray(g)?g.join(","):g)}function _(g){return new n(b(g))}e.stringify=_;function b(g){return JSON.stringify(g).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=b;function P(g){return typeof g=="string"&&e.IDENTIFIER.test(g)?new n(`.${g}`):s`[${g}]`}e.getProperty=P;function O(g){if(typeof g=="string"&&e.IDENTIFIER.test(g))return new n(`${g}`);throw new Error(`CodeGen: invalid export name: ${g}, use explicit $id name mapping`)}e.getEsmExportName=O;function w(g){return new n(g.toString())}e.regexpCode=w})(Yt);var on={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=Yt;class r extends Error{constructor(l){super(`CodeGen: "code" for ${l} not defined`),this.value=l.value}}var n;(function(f){f[f.Started=0]="Started",f[f.Completed=1]="Completed"})(n=e.UsedValueState||(e.UsedValueState={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class s{constructor({prefixes:l,parent:d}={}){this._names={},this._prefixes=l,this._parent=d}toName(l){return l instanceof t.Name?l:this.name(l)}name(l){return new t.Name(this._newName(l))}_newName(l){const d=this._names[l]||this._nameGroup(l);return`${l}${d.index++}`}_nameGroup(l){var d,p;if(!((p=(d=this._parent)===null||d===void 0?void 0:d._prefixes)===null||p===void 0)&&p.has(l)||this._prefixes&&!this._prefixes.has(l))throw new Error(`CodeGen: prefix "${l}" is not allowed in this scope`);return this._names[l]={prefix:l,index:0}}}e.Scope=s;class i extends t.Name{constructor(l,d){super(d),this.prefix=l}setValue(l,{property:d,itemIndex:p}){this.value=l,this.scopePath=(0,t._)`.${new t.Name(d)}[${p}]`}}e.ValueScopeName=i;const o=(0,t._)`\n`;class u extends s{constructor(l){super(l),this._values={},this._scope=l.scope,this.opts={...l,_n:l.lines?o:t.nil}}get(){return this._scope}name(l){return new i(l,this._newName(l))}value(l,d){var p;if(d.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const _=this.toName(l),{prefix:b}=_,P=(p=d.key)!==null&&p!==void 0?p:d.ref;let O=this._values[b];if(O){const $=O.get(P);if($)return $}else O=this._values[b]=new Map;O.set(P,_);const w=this._scope[b]||(this._scope[b]=[]),g=w.length;return w[g]=d.ref,_.setValue(d,{property:b,itemIndex:g}),_}getValue(l,d){const p=this._values[l];if(p)return p.get(d)}scopeRefs(l,d=this._values){return this._reduceValues(d,p=>{if(p.scopePath===void 0)throw new Error(`CodeGen: name "${p}" has no value`);return(0,t._)`${l}${p.scopePath}`})}scopeCode(l=this._values,d,p){return this._reduceValues(l,_=>{if(_.value===void 0)throw new Error(`CodeGen: name "${_}" has no value`);return _.value.code},d,p)}_reduceValues(l,d,p={},_){let b=t.nil;for(const P in l){const O=l[P];if(!O)continue;const w=p[P]=p[P]||new Map;O.forEach(g=>{if(w.has(g))return;w.set(g,n.Started);let $=d(g);if($){const S=this.opts.es5?e.varKinds.var:e.varKinds.const;b=(0,t._)`${b}${S} ${g} = ${$};${this.opts._n}`}else if($=_==null?void 0:_(g))b=(0,t._)`${b}${$}${this.opts._n}`;else throw new r(g);w.set(g,n.Completed)})}return b}}e.ValueScope=u})(on);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=Yt,r=on;var n=Yt;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var s=on;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class i{optimizeNodes(){return this}optimizeNames(a,m){return this}}class o extends i{constructor(a,m,N){super(),this.varKind=a,this.name=m,this.rhs=N}render({es5:a,_n:m}){const N=a?r.varKinds.var:this.varKind,L=this.rhs===void 0?"":` = ${this.rhs}`;return`${N} ${this.name}${L};`+m}optimizeNames(a,m){if(a[this.name.str])return this.rhs&&(this.rhs=fe(this.rhs,a,m)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class u extends i{constructor(a,m,N){super(),this.lhs=a,this.rhs=m,this.sideEffects=N}render({_n:a}){return`${this.lhs} = ${this.rhs};`+a}optimizeNames(a,m){if(!(this.lhs instanceof t.Name&&!a[this.lhs.str]&&!this.sideEffects))return this.rhs=fe(this.rhs,a,m),this}get names(){const a=this.lhs instanceof t.Name?{}:{...this.lhs.names};return Ee(a,this.rhs)}}class f extends u{constructor(a,m,N,L){super(a,N,L),this.op=m}render({_n:a}){return`${this.lhs} ${this.op}= ${this.rhs};`+a}}class l extends i{constructor(a){super(),this.label=a,this.names={}}render({_n:a}){return`${this.label}:`+a}}class d extends i{constructor(a){super(),this.label=a,this.names={}}render({_n:a}){return`break${this.label?` ${this.label}`:""};`+a}}class p extends i{constructor(a){super(),this.error=a}render({_n:a}){return`throw ${this.error};`+a}get names(){return this.error.names}}class _ extends i{constructor(a){super(),this.code=a}render({_n:a}){return`${this.code};`+a}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(a,m){return this.code=fe(this.code,a,m),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class b extends i{constructor(a=[]){super(),this.nodes=a}render(a){return this.nodes.reduce((m,N)=>m+N.render(a),"")}optimizeNodes(){const{nodes:a}=this;let m=a.length;for(;m--;){const N=a[m].optimizeNodes();Array.isArray(N)?a.splice(m,1,...N):N?a[m]=N:a.splice(m,1)}return a.length>0?this:void 0}optimizeNames(a,m){const{nodes:N}=this;let L=N.length;for(;L--;){const F=N[L];F.optimizeNames(a,m)||(Xe(a,F.names),N.splice(L,1))}return N.length>0?this:void 0}get names(){return this.nodes.reduce((a,m)=>Y(a,m.names),{})}}class P extends b{render(a){return"{"+a._n+super.render(a)+"}"+a._n}}class O extends b{}class w extends P{}w.kind="else";class g extends P{constructor(a,m){super(m),this.condition=a}render(a){let m=`if(${this.condition})`+super.render(a);return this.else&&(m+="else "+this.else.render(a)),m}optimizeNodes(){super.optimizeNodes();const a=this.condition;if(a===!0)return this.nodes;let m=this.else;if(m){const N=m.optimizeNodes();m=this.else=Array.isArray(N)?new w(N):N}if(m)return a===!1?m instanceof g?m:m.nodes:this.nodes.length?this:new g(et(a),m instanceof g?[m]:m.nodes);if(!(a===!1||!this.nodes.length))return this}optimizeNames(a,m){var N;if(this.else=(N=this.else)===null||N===void 0?void 0:N.optimizeNames(a,m),!!(super.optimizeNames(a,m)||this.else))return this.condition=fe(this.condition,a,m),this}get names(){const a=super.names;return Ee(a,this.condition),this.else&&Y(a,this.else.names),a}}g.kind="if";class $ extends P{}$.kind="for";class S extends ${constructor(a){super(),this.iteration=a}render(a){return`for(${this.iteration})`+super.render(a)}optimizeNames(a,m){if(super.optimizeNames(a,m))return this.iteration=fe(this.iteration,a,m),this}get names(){return Y(super.names,this.iteration.names)}}class I extends ${constructor(a,m,N,L){super(),this.varKind=a,this.name=m,this.from=N,this.to=L}render(a){const m=a.es5?r.varKinds.var:this.varKind,{name:N,from:L,to:F}=this;return`for(${m} ${N}=${L}; ${N}<${F}; ${N}++)`+super.render(a)}get names(){const a=Ee(super.names,this.from);return Ee(a,this.to)}}class D extends ${constructor(a,m,N,L){super(),this.loop=a,this.varKind=m,this.name=N,this.iterable=L}render(a){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(a)}optimizeNames(a,m){if(super.optimizeNames(a,m))return this.iterable=fe(this.iterable,a,m),this}get names(){return Y(super.names,this.iterable.names)}}class E extends P{constructor(a,m,N){super(),this.name=a,this.args=m,this.async=N}render(a){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(a)}}E.kind="func";class C extends b{render(a){return"return "+super.render(a)}}C.kind="return";class A extends P{render(a){let m="try"+super.render(a);return this.catch&&(m+=this.catch.render(a)),this.finally&&(m+=this.finally.render(a)),m}optimizeNodes(){var a,m;return super.optimizeNodes(),(a=this.catch)===null||a===void 0||a.optimizeNodes(),(m=this.finally)===null||m===void 0||m.optimizeNodes(),this}optimizeNames(a,m){var N,L;return super.optimizeNames(a,m),(N=this.catch)===null||N===void 0||N.optimizeNames(a,m),(L=this.finally)===null||L===void 0||L.optimizeNames(a,m),this}get names(){const a=super.names;return this.catch&&Y(a,this.catch.names),this.finally&&Y(a,this.finally.names),a}}class W extends P{constructor(a){super(),this.error=a}render(a){return`catch(${this.error})`+super.render(a)}}W.kind="catch";class G extends P{render(a){return"finally"+super.render(a)}}G.kind="finally";class ie{constructor(a,m={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...m,_n:m.lines?`
716
+ `:""},this._extScope=a,this._scope=new r.Scope({parent:a}),this._nodes=[new O]}toString(){return this._root.render(this.opts)}name(a){return this._scope.name(a)}scopeName(a){return this._extScope.name(a)}scopeValue(a,m){const N=this._extScope.value(a,m);return(this._values[N.prefix]||(this._values[N.prefix]=new Set)).add(N),N}getScopeValue(a,m){return this._extScope.getValue(a,m)}scopeRefs(a){return this._extScope.scopeRefs(a,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(a,m,N,L){const F=this._scope.toName(m);return N!==void 0&&L&&(this._constants[F.str]=N),this._leafNode(new o(a,F,N)),F}const(a,m,N){return this._def(r.varKinds.const,a,m,N)}let(a,m,N){return this._def(r.varKinds.let,a,m,N)}var(a,m,N){return this._def(r.varKinds.var,a,m,N)}assign(a,m,N){return this._leafNode(new u(a,m,N))}add(a,m){return this._leafNode(new f(a,e.operators.ADD,m))}code(a){return typeof a=="function"?a():a!==t.nil&&this._leafNode(new _(a)),this}object(...a){const m=["{"];for(const[N,L]of a)m.length>1&&m.push(","),m.push(N),(N!==L||this.opts.es5)&&(m.push(":"),(0,t.addCodeArg)(m,L));return m.push("}"),new t._Code(m)}if(a,m,N){if(this._blockNode(new g(a)),m&&N)this.code(m).else().code(N).endIf();else if(m)this.code(m).endIf();else if(N)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(a){return this._elseNode(new g(a))}else(){return this._elseNode(new w)}endIf(){return this._endBlockNode(g,w)}_for(a,m){return this._blockNode(a),m&&this.code(m).endFor(),this}for(a,m){return this._for(new S(a),m)}forRange(a,m,N,L,F=this.opts.es5?r.varKinds.var:r.varKinds.let){const K=this._scope.toName(a);return this._for(new I(F,K,m,N),()=>L(K))}forOf(a,m,N,L=r.varKinds.const){const F=this._scope.toName(a);if(this.opts.es5){const K=m instanceof t.Name?m:this.var("_arr",m);return this.forRange("_i",0,(0,t._)`${K}.length`,Q=>{this.var(F,(0,t._)`${K}[${Q}]`),N(F)})}return this._for(new D("of",L,F,m),()=>N(F))}forIn(a,m,N,L=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(a,(0,t._)`Object.keys(${m})`,N);const F=this._scope.toName(a);return this._for(new D("in",L,F,m),()=>N(F))}endFor(){return this._endBlockNode($)}label(a){return this._leafNode(new l(a))}break(a){return this._leafNode(new d(a))}return(a){const m=new C;if(this._blockNode(m),this.code(a),m.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(C)}try(a,m,N){if(!m&&!N)throw new Error('CodeGen: "try" without "catch" and "finally"');const L=new A;if(this._blockNode(L),this.code(a),m){const F=this.name("e");this._currNode=L.catch=new W(F),m(F)}return N&&(this._currNode=L.finally=new G,this.code(N)),this._endBlockNode(W,G)}throw(a){return this._leafNode(new p(a))}block(a,m){return this._blockStarts.push(this._nodes.length),a&&this.code(a).endBlock(m),this}endBlock(a){const m=this._blockStarts.pop();if(m===void 0)throw new Error("CodeGen: not in self-balancing block");const N=this._nodes.length-m;if(N<0||a!==void 0&&N!==a)throw new Error(`CodeGen: wrong number of nodes: ${N} vs ${a} expected`);return this._nodes.length=m,this}func(a,m=t.nil,N,L){return this._blockNode(new E(a,m,N)),L&&this.code(L).endFunc(),this}endFunc(){return this._endBlockNode(E)}optimize(a=1){for(;a-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(a){return this._currNode.nodes.push(a),this}_blockNode(a){this._currNode.nodes.push(a),this._nodes.push(a)}_endBlockNode(a,m){const N=this._currNode;if(N instanceof a||m&&N instanceof m)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${m?`${a.kind}/${m.kind}`:a.kind}"`)}_elseNode(a){const m=this._currNode;if(!(m instanceof g))throw new Error('CodeGen: "else" without "if"');return this._currNode=m.else=a,this}get _root(){return this._nodes[0]}get _currNode(){const a=this._nodes;return a[a.length-1]}set _currNode(a){const m=this._nodes;m[m.length-1]=a}}e.CodeGen=ie;function Y(T,a){for(const m in a)T[m]=(T[m]||0)+(a[m]||0);return T}function Ee(T,a){return a instanceof t._CodeOrName?Y(T,a.names):T}function fe(T,a,m){if(T instanceof t.Name)return N(T);if(!L(T))return T;return new t._Code(T._items.reduce((F,K)=>(K instanceof t.Name&&(K=N(K)),K instanceof t._Code?F.push(...K._items):F.push(K),F),[]));function N(F){const K=m[F.str];return K===void 0||a[F.str]!==1?F:(delete a[F.str],K)}function L(F){return F instanceof t._Code&&F._items.some(K=>K instanceof t.Name&&a[K.str]===1&&m[K.str]!==void 0)}}function Xe(T,a){for(const m in a)T[m]=(T[m]||0)-(a[m]||0)}function et(T){return typeof T=="boolean"||typeof T=="number"||T===null?!T:(0,t._)`!${j(T)}`}e.not=et;const pt=v(e.operators.AND);function It(...T){return T.reduce(pt)}e.and=It;const ht=v(e.operators.OR);function M(...T){return T.reduce(ht)}e.or=M;function v(T){return(a,m)=>a===t.nil?m:m===t.nil?a:(0,t._)`${j(a)} ${T} ${j(m)}`}function j(T){return T instanceof t.Name?T:(0,t._)`(${T})`}})(B);var X={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;const t=B,r=Yt;function n(E){const C={};for(const A of E)C[A]=!0;return C}e.toHash=n;function s(E,C){return typeof C=="boolean"?C:Object.keys(C).length===0?!0:(i(E,C),!o(C,E.self.RULES.all))}e.alwaysValidSchema=s;function i(E,C=E.schema){const{opts:A,self:W}=E;if(!A.strictSchema||typeof C=="boolean")return;const G=W.RULES.keywords;for(const ie in C)G[ie]||D(E,`unknown keyword: "${ie}"`)}e.checkUnknownRules=i;function o(E,C){if(typeof E=="boolean")return!E;for(const A in E)if(C[A])return!0;return!1}e.schemaHasRules=o;function u(E,C){if(typeof E=="boolean")return!E;for(const A in E)if(A!=="$ref"&&C.all[A])return!0;return!1}e.schemaHasRulesButRef=u;function f({topSchemaRef:E,schemaPath:C},A,W,G){if(!G){if(typeof A=="number"||typeof A=="boolean")return A;if(typeof A=="string")return(0,t._)`${A}`}return(0,t._)`${E}${C}${(0,t.getProperty)(W)}`}e.schemaRefOrVal=f;function l(E){return _(decodeURIComponent(E))}e.unescapeFragment=l;function d(E){return encodeURIComponent(p(E))}e.escapeFragment=d;function p(E){return typeof E=="number"?`${E}`:E.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=p;function _(E){return E.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=_;function b(E,C){if(Array.isArray(E))for(const A of E)C(A);else C(E)}e.eachItem=b;function P({mergeNames:E,mergeToName:C,mergeValues:A,resultToName:W}){return(G,ie,Y,Ee)=>{const fe=Y===void 0?ie:Y instanceof t.Name?(ie instanceof t.Name?E(G,ie,Y):C(G,ie,Y),Y):ie instanceof t.Name?(C(G,Y,ie),ie):A(ie,Y);return Ee===t.Name&&!(fe instanceof t.Name)?W(G,fe):fe}}e.mergeEvaluated={props:P({mergeNames:(E,C,A)=>E.if((0,t._)`${A} !== true && ${C} !== undefined`,()=>{E.if((0,t._)`${C} === true`,()=>E.assign(A,!0),()=>E.assign(A,(0,t._)`${A} || {}`).code((0,t._)`Object.assign(${A}, ${C})`))}),mergeToName:(E,C,A)=>E.if((0,t._)`${A} !== true`,()=>{C===!0?E.assign(A,!0):(E.assign(A,(0,t._)`${A} || {}`),w(E,A,C))}),mergeValues:(E,C)=>E===!0?!0:{...E,...C},resultToName:O}),items:P({mergeNames:(E,C,A)=>E.if((0,t._)`${A} !== true && ${C} !== undefined`,()=>E.assign(A,(0,t._)`${C} === true ? true : ${A} > ${C} ? ${A} : ${C}`)),mergeToName:(E,C,A)=>E.if((0,t._)`${A} !== true`,()=>E.assign(A,C===!0?!0:(0,t._)`${A} > ${C} ? ${A} : ${C}`)),mergeValues:(E,C)=>E===!0?!0:Math.max(E,C),resultToName:(E,C)=>E.var("items",C)})};function O(E,C){if(C===!0)return E.var("props",!0);const A=E.var("props",(0,t._)`{}`);return C!==void 0&&w(E,A,C),A}e.evaluatedPropsToName=O;function w(E,C,A){Object.keys(A).forEach(W=>E.assign((0,t._)`${C}${(0,t.getProperty)(W)}`,!0))}e.setEvaluated=w;const g={};function $(E,C){return E.scopeValue("func",{ref:C,code:g[C.code]||(g[C.code]=new r._Code(C.code))})}e.useFunc=$;var S;(function(E){E[E.Num=0]="Num",E[E.Str=1]="Str"})(S=e.Type||(e.Type={}));function I(E,C,A){if(E instanceof t.Name){const W=C===S.Num;return A?W?(0,t._)`"[" + ${E} + "]"`:(0,t._)`"['" + ${E} + "']"`:W?(0,t._)`"/" + ${E}`:(0,t._)`"/" + ${E}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return A?(0,t.getProperty)(E).toString():"/"+p(E)}e.getErrorPath=I;function D(E,C,A=E.opts.strictSchema){if(A){if(C=`strict mode: ${C}`,A===!0)throw new Error(C);E.self.logger.warn(C)}}e.checkStrictMode=D})(X);var We={};Object.defineProperty(We,"__esModule",{value:!0});const ge=B,Sa={data:new ge.Name("data"),valCxt:new ge.Name("valCxt"),instancePath:new ge.Name("instancePath"),parentData:new ge.Name("parentData"),parentDataProperty:new ge.Name("parentDataProperty"),rootData:new ge.Name("rootData"),dynamicAnchors:new ge.Name("dynamicAnchors"),vErrors:new ge.Name("vErrors"),errors:new ge.Name("errors"),this:new ge.Name("this"),self:new ge.Name("self"),scope:new ge.Name("scope"),json:new ge.Name("json"),jsonPos:new ge.Name("jsonPos"),jsonLen:new ge.Name("jsonLen"),jsonPart:new ge.Name("jsonPart")};We.default=Sa;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=B,r=X,n=We;e.keywordError={message:({keyword:w})=>(0,t.str)`must pass "${w}" keyword validation`},e.keyword$DataError={message:({keyword:w,schemaType:g})=>g?(0,t.str)`"${w}" keyword must be ${g} ($data)`:(0,t.str)`"${w}" keyword is invalid ($data)`};function s(w,g=e.keywordError,$,S){const{it:I}=w,{gen:D,compositeRule:E,allErrors:C}=I,A=p(w,g,$);S??(E||C)?f(D,A):l(I,(0,t._)`[${A}]`)}e.reportError=s;function i(w,g=e.keywordError,$){const{it:S}=w,{gen:I,compositeRule:D,allErrors:E}=S,C=p(w,g,$);f(I,C),D||E||l(S,n.default.vErrors)}e.reportExtraError=i;function o(w,g){w.assign(n.default.errors,g),w.if((0,t._)`${n.default.vErrors} !== null`,()=>w.if(g,()=>w.assign((0,t._)`${n.default.vErrors}.length`,g),()=>w.assign(n.default.vErrors,null)))}e.resetErrorsCount=o;function u({gen:w,keyword:g,schemaValue:$,data:S,errsCount:I,it:D}){if(I===void 0)throw new Error("ajv implementation error");const E=w.name("err");w.forRange("i",I,n.default.errors,C=>{w.const(E,(0,t._)`${n.default.vErrors}[${C}]`),w.if((0,t._)`${E}.instancePath === undefined`,()=>w.assign((0,t._)`${E}.instancePath`,(0,t.strConcat)(n.default.instancePath,D.errorPath))),w.assign((0,t._)`${E}.schemaPath`,(0,t.str)`${D.errSchemaPath}/${g}`),D.opts.verbose&&(w.assign((0,t._)`${E}.schema`,$),w.assign((0,t._)`${E}.data`,S))})}e.extendErrors=u;function f(w,g){const $=w.const("err",g);w.if((0,t._)`${n.default.vErrors} === null`,()=>w.assign(n.default.vErrors,(0,t._)`[${$}]`),(0,t._)`${n.default.vErrors}.push(${$})`),w.code((0,t._)`${n.default.errors}++`)}function l(w,g){const{gen:$,validateName:S,schemaEnv:I}=w;I.$async?$.throw((0,t._)`new ${w.ValidationError}(${g})`):($.assign((0,t._)`${S}.errors`,g),$.return(!1))}const d={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function p(w,g,$){const{createErrors:S}=w.it;return S===!1?(0,t._)`{}`:_(w,g,$)}function _(w,g,$={}){const{gen:S,it:I}=w,D=[b(I,$),P(w,$)];return O(w,g,D),S.object(...D)}function b({errorPath:w},{instancePath:g}){const $=g?(0,t.str)`${w}${(0,r.getErrorPath)(g,r.Type.Str)}`:w;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,$)]}function P({keyword:w,it:{errSchemaPath:g}},{schemaPath:$,parentSchema:S}){let I=S?g:(0,t.str)`${g}/${w}`;return $&&(I=(0,t.str)`${I}${(0,r.getErrorPath)($,r.Type.Str)}`),[d.schemaPath,I]}function O(w,{params:g,message:$},S){const{keyword:I,data:D,schemaValue:E,it:C}=w,{opts:A,propertyName:W,topSchemaRef:G,schemaPath:ie}=C;S.push([d.keyword,I],[d.params,typeof g=="function"?g(w):g||(0,t._)`{}`]),A.messages&&S.push([d.message,typeof $=="function"?$(w):$]),A.verbose&&S.push([d.schema,E],[d.parentSchema,(0,t._)`${G}${ie}`],[n.default.data,D]),W&&S.push([d.propertyName,W])}})(Xt);Object.defineProperty(kt,"__esModule",{value:!0});kt.boolOrEmptySchema=kt.topBoolOrEmptySchema=void 0;const Ta=Xt,Ra=B,ka=We,Oa={message:"boolean schema is false"};function Ca(e){const{gen:t,schema:r,validateName:n}=e;r===!1?Ii(e,!1):typeof r=="object"&&r.$async===!0?t.return(ka.default.data):(t.assign((0,Ra._)`${n}.errors`,null),t.return(!0))}kt.topBoolOrEmptySchema=Ca;function Na(e,t){const{gen:r,schema:n}=e;n===!1?(r.var(t,!1),Ii(e)):r.var(t,!0)}kt.boolOrEmptySchema=Na;function Ii(e,t){const{gen:r,data:n}=e,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,Ta.reportError)(s,Oa,void 0,t)}var er={},ut={};Object.defineProperty(ut,"__esModule",{value:!0});ut.getRules=ut.isJSONType=void 0;const Ia=["string","number","integer","boolean","null","object","array"],ja=new Set(Ia);function Aa(e){return typeof e=="string"&&ja.has(e)}ut.isJSONType=Aa;function Da(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}ut.getRules=Da;var Be={};Object.defineProperty(Be,"__esModule",{value:!0});Be.shouldUseRule=Be.shouldUseGroup=Be.schemaHasRulesForType=void 0;function Ma({schema:e,self:t},r){const n=t.RULES.types[r];return n&&n!==!0&&ji(e,n)}Be.schemaHasRulesForType=Ma;function ji(e,t){return t.rules.some(r=>Ai(e,r))}Be.shouldUseGroup=ji;function Ai(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}Be.shouldUseRule=Ai;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;const t=ut,r=Be,n=Xt,s=B,i=X;var o;(function(S){S[S.Correct=0]="Correct",S[S.Wrong=1]="Wrong"})(o=e.DataType||(e.DataType={}));function u(S){const I=f(S.type);if(I.includes("null")){if(S.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!I.length&&S.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');S.nullable===!0&&I.push("null")}return I}e.getSchemaTypes=u;function f(S){const I=Array.isArray(S)?S:S?[S]:[];if(I.every(t.isJSONType))return I;throw new Error("type must be JSONType or JSONType[]: "+I.join(","))}e.getJSONTypes=f;function l(S,I){const{gen:D,data:E,opts:C}=S,A=p(I,C.coerceTypes),W=I.length>0&&!(A.length===0&&I.length===1&&(0,r.schemaHasRulesForType)(S,I[0]));if(W){const G=O(I,E,C.strictNumbers,o.Wrong);D.if(G,()=>{A.length?_(S,I,A):g(S)})}return W}e.coerceAndCheckDataType=l;const d=new Set(["string","number","integer","boolean","null"]);function p(S,I){return I?S.filter(D=>d.has(D)||I==="array"&&D==="array"):[]}function _(S,I,D){const{gen:E,data:C,opts:A}=S,W=E.let("dataType",(0,s._)`typeof ${C}`),G=E.let("coerced",(0,s._)`undefined`);A.coerceTypes==="array"&&E.if((0,s._)`${W} == 'object' && Array.isArray(${C}) && ${C}.length == 1`,()=>E.assign(C,(0,s._)`${C}[0]`).assign(W,(0,s._)`typeof ${C}`).if(O(I,C,A.strictNumbers),()=>E.assign(G,C))),E.if((0,s._)`${G} !== undefined`);for(const Y of D)(d.has(Y)||Y==="array"&&A.coerceTypes==="array")&&ie(Y);E.else(),g(S),E.endIf(),E.if((0,s._)`${G} !== undefined`,()=>{E.assign(C,G),b(S,G)});function ie(Y){switch(Y){case"string":E.elseIf((0,s._)`${W} == "number" || ${W} == "boolean"`).assign(G,(0,s._)`"" + ${C}`).elseIf((0,s._)`${C} === null`).assign(G,(0,s._)`""`);return;case"number":E.elseIf((0,s._)`${W} == "boolean" || ${C} === null
717
+ || (${W} == "string" && ${C} && ${C} == +${C})`).assign(G,(0,s._)`+${C}`);return;case"integer":E.elseIf((0,s._)`${W} === "boolean" || ${C} === null
718
+ || (${W} === "string" && ${C} && ${C} == +${C} && !(${C} % 1))`).assign(G,(0,s._)`+${C}`);return;case"boolean":E.elseIf((0,s._)`${C} === "false" || ${C} === 0 || ${C} === null`).assign(G,!1).elseIf((0,s._)`${C} === "true" || ${C} === 1`).assign(G,!0);return;case"null":E.elseIf((0,s._)`${C} === "" || ${C} === 0 || ${C} === false`),E.assign(G,null);return;case"array":E.elseIf((0,s._)`${W} === "string" || ${W} === "number"
719
+ || ${W} === "boolean" || ${C} === null`).assign(G,(0,s._)`[${C}]`)}}}function b({gen:S,parentData:I,parentDataProperty:D},E){S.if((0,s._)`${I} !== undefined`,()=>S.assign((0,s._)`${I}[${D}]`,E))}function P(S,I,D,E=o.Correct){const C=E===o.Correct?s.operators.EQ:s.operators.NEQ;let A;switch(S){case"null":return(0,s._)`${I} ${C} null`;case"array":A=(0,s._)`Array.isArray(${I})`;break;case"object":A=(0,s._)`${I} && typeof ${I} == "object" && !Array.isArray(${I})`;break;case"integer":A=W((0,s._)`!(${I} % 1) && !isNaN(${I})`);break;case"number":A=W();break;default:return(0,s._)`typeof ${I} ${C} ${S}`}return E===o.Correct?A:(0,s.not)(A);function W(G=s.nil){return(0,s.and)((0,s._)`typeof ${I} == "number"`,G,D?(0,s._)`isFinite(${I})`:s.nil)}}e.checkDataType=P;function O(S,I,D,E){if(S.length===1)return P(S[0],I,D,E);let C;const A=(0,i.toHash)(S);if(A.array&&A.object){const W=(0,s._)`typeof ${I} != "object"`;C=A.null?W:(0,s._)`!${I} || ${W}`,delete A.null,delete A.array,delete A.object}else C=s.nil;A.number&&delete A.integer;for(const W in A)C=(0,s.and)(C,P(W,I,D,E));return C}e.checkDataTypes=O;const w={message:({schema:S})=>`must be ${S}`,params:({schema:S,schemaValue:I})=>typeof S=="string"?(0,s._)`{type: ${S}}`:(0,s._)`{type: ${I}}`};function g(S){const I=$(S);(0,n.reportError)(I,w)}e.reportTypeError=g;function $(S){const{gen:I,data:D,schema:E}=S,C=(0,i.schemaRefOrVal)(S,E,"type");return{gen:I,keyword:"type",data:D,schema:E.type,schemaCode:C,schemaValue:C,parentSchema:E,params:{},it:S}}})(er);var qr={};Object.defineProperty(qr,"__esModule",{value:!0});qr.assignDefaults=void 0;const bt=B,La=X;function Fa(e,t){const{properties:r,items:n}=e.schema;if(t==="object"&&r)for(const s in r)Rs(e,s,r[s].default);else t==="array"&&Array.isArray(n)&&n.forEach((s,i)=>Rs(e,i,s.default))}qr.assignDefaults=Fa;function Rs(e,t,r){const{gen:n,compositeRule:s,data:i,opts:o}=e;if(r===void 0)return;const u=(0,bt._)`${i}${(0,bt.getProperty)(t)}`;if(s){(0,La.checkStrictMode)(e,`default is ignored for: ${u}`);return}let f=(0,bt._)`${u} === undefined`;o.useDefaults==="empty"&&(f=(0,bt._)`${f} || ${u} === null || ${u} === ""`),n.if(f,(0,bt._)`${u} = ${(0,bt.stringify)(r)}`)}var qe={},H={};Object.defineProperty(H,"__esModule",{value:!0});H.validateUnion=H.validateArray=H.usePattern=H.callValidateCode=H.schemaProperties=H.allSchemaProperties=H.noPropertyInData=H.propertyInData=H.isOwnProperty=H.hasPropFunc=H.reportMissingProp=H.checkMissingProp=H.checkReportMissingProp=void 0;const re=B,vn=X,Je=We,qa=X;function Ua(e,t){const{gen:r,data:n,it:s}=e;r.if(En(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:(0,re._)`${t}`},!0),e.error()})}H.checkReportMissingProp=Ua;function za({gen:e,data:t,it:{opts:r}},n,s){return(0,re.or)(...n.map(i=>(0,re.and)(En(e,t,i,r.ownProperties),(0,re._)`${s} = ${i}`)))}H.checkMissingProp=za;function Va(e,t){e.setParams({missingProperty:t},!0),e.error()}H.reportMissingProp=Va;function Di(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,re._)`Object.prototype.hasOwnProperty`})}H.hasPropFunc=Di;function bn(e,t,r){return(0,re._)`${Di(e)}.call(${t}, ${r})`}H.isOwnProperty=bn;function Wa(e,t,r,n){const s=(0,re._)`${t}${(0,re.getProperty)(r)} !== undefined`;return n?(0,re._)`${s} && ${bn(e,t,r)}`:s}H.propertyInData=Wa;function En(e,t,r,n){const s=(0,re._)`${t}${(0,re.getProperty)(r)} === undefined`;return n?(0,re.or)(s,(0,re.not)(bn(e,t,r))):s}H.noPropertyInData=En;function Mi(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}H.allSchemaProperties=Mi;function xa(e,t){return Mi(t).filter(r=>!(0,vn.alwaysValidSchema)(e,t[r]))}H.schemaProperties=xa;function Ha({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:i},it:o},u,f,l){const d=l?(0,re._)`${e}, ${t}, ${n}${s}`:t,p=[[Je.default.instancePath,(0,re.strConcat)(Je.default.instancePath,i)],[Je.default.parentData,o.parentData],[Je.default.parentDataProperty,o.parentDataProperty],[Je.default.rootData,Je.default.rootData]];o.opts.dynamicRef&&p.push([Je.default.dynamicAnchors,Je.default.dynamicAnchors]);const _=(0,re._)`${d}, ${r.object(...p)}`;return f!==re.nil?(0,re._)`${u}.call(${f}, ${_})`:(0,re._)`${u}(${_})`}H.callValidateCode=Ha;const Ba=(0,re._)`new RegExp`;function Ga({gen:e,it:{opts:t}},r){const n=t.unicodeRegExp?"u":"",{regExp:s}=t.code,i=s(r,n);return e.scopeValue("pattern",{key:i.toString(),ref:i,code:(0,re._)`${s.code==="new RegExp"?Ba:(0,qa.useFunc)(e,s)}(${r}, ${n})`})}H.usePattern=Ga;function Ka(e){const{gen:t,data:r,keyword:n,it:s}=e,i=t.name("valid");if(s.allErrors){const u=t.let("valid",!0);return o(()=>t.assign(u,!1)),u}return t.var(i,!0),o(()=>t.break()),i;function o(u){const f=t.const("len",(0,re._)`${r}.length`);t.forRange("i",0,f,l=>{e.subschema({keyword:n,dataProp:l,dataPropType:vn.Type.Num},i),t.if((0,re.not)(i),u)})}}H.validateArray=Ka;function Ja(e){const{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(f=>(0,vn.alwaysValidSchema)(s,f))&&!s.opts.unevaluated)return;const o=t.let("valid",!1),u=t.name("_valid");t.block(()=>r.forEach((f,l)=>{const d=e.subschema({keyword:n,schemaProp:l,compositeRule:!0},u);t.assign(o,(0,re._)`${o} || ${u}`),e.mergeValidEvaluated(d,u)||t.if((0,re.not)(o))})),e.result(o,()=>e.reset(),()=>e.error(!0))}H.validateUnion=Ja;Object.defineProperty(qe,"__esModule",{value:!0});qe.validateKeywordUsage=qe.validSchemaType=qe.funcKeywordCode=qe.macroKeywordCode=void 0;const $e=B,ot=We,Qa=H,Ya=Xt;function Za(e,t){const{gen:r,keyword:n,schema:s,parentSchema:i,it:o}=e,u=t.macro.call(o.self,s,i,o),f=Li(r,n,u);o.opts.validateSchema!==!1&&o.self.validateSchema(u,!0);const l=r.name("valid");e.subschema({schema:u,schemaPath:$e.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:f,compositeRule:!0},l),e.pass(l,()=>e.error(!0))}qe.macroKeywordCode=Za;function Xa(e,t){var r;const{gen:n,keyword:s,schema:i,parentSchema:o,$data:u,it:f}=e;tc(f,t);const l=!u&&t.compile?t.compile.call(f.self,i,o,f):t.validate,d=Li(n,s,l),p=n.let("valid");e.block$data(p,_),e.ok((r=t.valid)!==null&&r!==void 0?r:p);function _(){if(t.errors===!1)O(),t.modifying&&ks(e),w(()=>e.error());else{const g=t.async?b():P();t.modifying&&ks(e),w(()=>ec(e,g))}}function b(){const g=n.let("ruleErrs",null);return n.try(()=>O((0,$e._)`await `),$=>n.assign(p,!1).if((0,$e._)`${$} instanceof ${f.ValidationError}`,()=>n.assign(g,(0,$e._)`${$}.errors`),()=>n.throw($))),g}function P(){const g=(0,$e._)`${d}.errors`;return n.assign(g,null),O($e.nil),g}function O(g=t.async?(0,$e._)`await `:$e.nil){const $=f.opts.passContext?ot.default.this:ot.default.self,S=!("compile"in t&&!u||t.schema===!1);n.assign(p,(0,$e._)`${g}${(0,Qa.callValidateCode)(e,d,$,S)}`,t.modifying)}function w(g){var $;n.if((0,$e.not)(($=t.valid)!==null&&$!==void 0?$:p),g)}}qe.funcKeywordCode=Xa;function ks(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,$e._)`${n.parentData}[${n.parentDataProperty}]`))}function ec(e,t){const{gen:r}=e;r.if((0,$e._)`Array.isArray(${t})`,()=>{r.assign(ot.default.vErrors,(0,$e._)`${ot.default.vErrors} === null ? ${t} : ${ot.default.vErrors}.concat(${t})`).assign(ot.default.errors,(0,$e._)`${ot.default.vErrors}.length`),(0,Ya.extendErrors)(e)},()=>e.error())}function tc({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function Li(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,$e.stringify)(r)})}function rc(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e>"u")}qe.validSchemaType=rc;function nc({schema:e,opts:t,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 o=s.dependencies;if(o!=null&&o.some(u=>!Object.prototype.hasOwnProperty.call(e,u)))throw new Error(`parent schema must have dependencies of ${i}: ${o.join(",")}`);if(s.validateSchema&&!s.validateSchema(e[i])){const f=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(f);else throw new Error(f)}}qe.validateKeywordUsage=nc;var Ze={};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.extendSubschemaMode=Ze.extendSubschemaData=Ze.getSubschema=void 0;const Fe=B,Fi=X;function sc(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:i,topSchemaRef:o}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){const u=e.schema[t];return r===void 0?{schema:u,schemaPath:(0,Fe._)`${e.schemaPath}${(0,Fe.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:u[r],schemaPath:(0,Fe._)`${e.schemaPath}${(0,Fe.getProperty)(t)}${(0,Fe.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,Fi.escapeFragment)(r)}`}}if(n!==void 0){if(s===void 0||i===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:o,errSchemaPath:i}}throw new Error('either "keyword" or "schema" must be passed')}Ze.getSubschema=sc;function ic(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:i,propertyName:o}){if(s!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:u}=t;if(r!==void 0){const{errorPath:l,dataPathArr:d,opts:p}=t,_=u.let("data",(0,Fe._)`${t.data}${(0,Fe.getProperty)(r)}`,!0);f(_),e.errorPath=(0,Fe.str)`${l}${(0,Fi.getErrorPath)(r,n,p.jsPropertySyntax)}`,e.parentDataProperty=(0,Fe._)`${r}`,e.dataPathArr=[...d,e.parentDataProperty]}if(s!==void 0){const l=s instanceof Fe.Name?s:u.let("data",s,!0);f(l),o!==void 0&&(e.propertyName=o)}i&&(e.dataTypes=i);function f(l){e.data=l,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,l]}}Ze.extendSubschemaData=ic;function oc(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:i}){n!==void 0&&(e.compositeRule=n),s!==void 0&&(e.createErrors=s),i!==void 0&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}Ze.extendSubschemaMode=oc;var ye={},qi=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),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 o=i[s];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r},Ui={exports:{}},Ye=Ui.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};yr(t,n,s,e,"",e)};Ye.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Ye.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Ye.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Ye.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 yr(e,t,r,n,s,i,o,u,f,l){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,s,i,o,u,f,l);for(var d in n){var p=n[d];if(Array.isArray(p)){if(d in Ye.arrayKeywords)for(var _=0;_<p.length;_++)yr(e,t,r,p[_],s+"/"+d+"/"+_,i,s,d,n,_)}else if(d in Ye.propsKeywords){if(p&&typeof p=="object")for(var b in p)yr(e,t,r,p[b],s+"/"+d+"/"+ac(b),i,s,d,n,b)}else(d in Ye.keywords||e.allKeys&&!(d in Ye.skipKeywords))&&yr(e,t,r,p,s+"/"+d,i,s,d,n)}r(n,s,i,o,u,f,l)}}function ac(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var cc=Ui.exports;Object.defineProperty(ye,"__esModule",{value:!0});ye.getSchemaRefs=ye.resolveUrl=ye.normalizeId=ye._getFullPath=ye.getFullPath=ye.inlineRef=void 0;const lc=X,uc=qi,dc=cc,fc=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function pc(e,t=!0){return typeof e=="boolean"?!0:t===!0?!an(e):t?zi(e)<=t:!1}ye.inlineRef=pc;const hc=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function an(e){for(const t in e){if(hc.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(an)||typeof r=="object"&&an(r))return!0}return!1}function zi(e){let t=0;for(const r in e){if(r==="$ref")return 1/0;if(t++,!fc.has(r)&&(typeof e[r]=="object"&&(0,lc.eachItem)(e[r],n=>t+=zi(n)),t===1/0))return 1/0}return t}function Vi(e,t="",r){r!==!1&&(t=Rt(t));const n=e.parse(t);return Wi(e,n)}ye.getFullPath=Vi;function Wi(e,t){return e.serialize(t).split("#")[0]+"#"}ye._getFullPath=Wi;const mc=/#\/?$/;function Rt(e){return e?e.replace(mc,""):""}ye.normalizeId=Rt;function yc(e,t,r){return r=Rt(r),e.resolve(t,r)}ye.resolveUrl=yc;const gc=/^[a-z_][-a-z0-9._]*$/i;function $c(e,t){if(typeof e=="boolean")return{};const{schemaId:r,uriResolver:n}=this.opts,s=Rt(e[r]||t),i={"":s},o=Vi(n,s,!1),u={},f=new Set;return dc(e,{allKeys:!0},(p,_,b,P)=>{if(P===void 0)return;const O=o+_;let w=i[P];typeof p[r]=="string"&&(w=g.call(this,p[r])),$.call(this,p.$anchor),$.call(this,p.$dynamicAnchor),i[_]=w;function g(S){const I=this.opts.uriResolver.resolve;if(S=Rt(w?I(w,S):S),f.has(S))throw d(S);f.add(S);let D=this.refs[S];return typeof D=="string"&&(D=this.refs[D]),typeof D=="object"?l(p,D.schema,S):S!==Rt(O)&&(S[0]==="#"?(l(p,u[S],S),u[S]=p):this.refs[S]=O),S}function $(S){if(typeof S=="string"){if(!gc.test(S))throw new Error(`invalid anchor "${S}"`);g.call(this,`#${S}`)}}}),u;function l(p,_,b){if(_!==void 0&&!uc(p,_))throw d(b)}function d(p){return new Error(`reference "${p}" resolves to more than one schema`)}}ye.getSchemaRefs=$c;Object.defineProperty(Ne,"__esModule",{value:!0});Ne.getData=Ne.KeywordCxt=Ne.validateFunctionCode=void 0;const xi=kt,Os=er,Pn=Be,Tr=er,_c=qr,Ht=qe,Kr=Ze,q=B,V=We,wc=ye,Ge=X,Vt=Xt;function vc(e){if(Gi(e)&&(Ki(e),Bi(e))){Pc(e);return}Hi(e,()=>(0,xi.topBoolOrEmptySchema)(e))}Ne.validateFunctionCode=vc;function Hi({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},i){s.code.es5?e.func(t,(0,q._)`${V.default.data}, ${V.default.valCxt}`,n.$async,()=>{e.code((0,q._)`"use strict"; ${Cs(r,s)}`),Ec(e,s),e.code(i)}):e.func(t,(0,q._)`${V.default.data}, ${bc(s)}`,n.$async,()=>e.code(Cs(r,s)).code(i))}function bc(e){return(0,q._)`{${V.default.instancePath}="", ${V.default.parentData}, ${V.default.parentDataProperty}, ${V.default.rootData}=${V.default.data}${e.dynamicRef?(0,q._)`, ${V.default.dynamicAnchors}={}`:q.nil}}={}`}function Ec(e,t){e.if(V.default.valCxt,()=>{e.var(V.default.instancePath,(0,q._)`${V.default.valCxt}.${V.default.instancePath}`),e.var(V.default.parentData,(0,q._)`${V.default.valCxt}.${V.default.parentData}`),e.var(V.default.parentDataProperty,(0,q._)`${V.default.valCxt}.${V.default.parentDataProperty}`),e.var(V.default.rootData,(0,q._)`${V.default.valCxt}.${V.default.rootData}`),t.dynamicRef&&e.var(V.default.dynamicAnchors,(0,q._)`${V.default.valCxt}.${V.default.dynamicAnchors}`)},()=>{e.var(V.default.instancePath,(0,q._)`""`),e.var(V.default.parentData,(0,q._)`undefined`),e.var(V.default.parentDataProperty,(0,q._)`undefined`),e.var(V.default.rootData,V.default.data),t.dynamicRef&&e.var(V.default.dynamicAnchors,(0,q._)`{}`)})}function Pc(e){const{schema:t,opts:r,gen:n}=e;Hi(e,()=>{r.$comment&&t.$comment&&Qi(e),Oc(e),n.let(V.default.vErrors,null),n.let(V.default.errors,0),r.unevaluated&&Sc(e),Ji(e),Ic(e)})}function Sc(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,q._)`${r}.evaluated`),t.if((0,q._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,q._)`${e.evaluated}.props`,(0,q._)`undefined`)),t.if((0,q._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,q._)`${e.evaluated}.items`,(0,q._)`undefined`))}function Cs(e,t){const r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,q._)`/*# sourceURL=${r} */`:q.nil}function Tc(e,t){if(Gi(e)&&(Ki(e),Bi(e))){Rc(e,t);return}(0,xi.boolOrEmptySchema)(e,t)}function Bi({schema:e,self:t}){if(typeof e=="boolean")return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function Gi(e){return typeof e.schema!="boolean"}function Rc(e,t){const{schema:r,gen:n,opts:s}=e;s.$comment&&r.$comment&&Qi(e),Cc(e),Nc(e);const i=n.const("_errs",V.default.errors);Ji(e,i),n.var(t,(0,q._)`${i} === ${V.default.errors}`)}function Ki(e){(0,Ge.checkUnknownRules)(e),kc(e)}function Ji(e,t){if(e.opts.jtd)return Ns(e,[],!1,t);const r=(0,Os.getSchemaTypes)(e.schema),n=(0,Os.coerceAndCheckDataType)(e,r);Ns(e,r,!n,t)}function kc(e){const{schema:t,errSchemaPath:r,opts:n,self:s}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,Ge.schemaHasRulesButRef)(t,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function Oc(e){const{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Ge.checkStrictMode)(e,"default is ignored in the schema root")}function Cc(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,wc.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function Nc(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function Qi({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:s}){const i=r.$comment;if(s.$comment===!0)e.code((0,q._)`${V.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){const o=(0,q.str)`${n}/$comment`,u=e.scopeValue("root",{ref:t.root});e.code((0,q._)`${V.default.self}.opts.$comment(${i}, ${o}, ${u}.schema)`)}}function Ic(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:i}=e;r.$async?t.if((0,q._)`${V.default.errors} === 0`,()=>t.return(V.default.data),()=>t.throw((0,q._)`new ${s}(${V.default.vErrors})`)):(t.assign((0,q._)`${n}.errors`,V.default.vErrors),i.unevaluated&&jc(e),t.return((0,q._)`${V.default.errors} === 0`))}function jc({gen:e,evaluated:t,props:r,items:n}){r instanceof q.Name&&e.assign((0,q._)`${t}.props`,r),n instanceof q.Name&&e.assign((0,q._)`${t}.items`,n)}function Ns(e,t,r,n){const{gen:s,schema:i,data:o,allErrors:u,opts:f,self:l}=e,{RULES:d}=l;if(i.$ref&&(f.ignoreKeywordsWithRef||!(0,Ge.schemaHasRulesButRef)(i,d))){s.block(()=>Xi(e,"$ref",d.all.$ref.definition));return}f.jtd||Ac(e,t),s.block(()=>{for(const _ of d.rules)p(_);p(d.post)});function p(_){(0,Pn.shouldUseGroup)(i,_)&&(_.type?(s.if((0,Tr.checkDataType)(_.type,o,f.strictNumbers)),Is(e,_),t.length===1&&t[0]===_.type&&r&&(s.else(),(0,Tr.reportTypeError)(e)),s.endIf()):Is(e,_),u||s.if((0,q._)`${V.default.errors} === ${n||0}`))}}function Is(e,t){const{gen:r,schema:n,opts:{useDefaults:s}}=e;s&&(0,_c.assignDefaults)(e,t.type),r.block(()=>{for(const i of t.rules)(0,Pn.shouldUseRule)(n,i)&&Xi(e,i.keyword,i.definition,t.type)})}function Ac(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(Dc(e,t),e.opts.allowUnionTypes||Mc(e,t),Lc(e,e.dataTypes))}function Dc(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{Yi(e.dataTypes,r)||Sn(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),qc(e,t)}}function Mc(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&Sn(e,"use allowUnionTypes to allow union type keyword")}function Lc(e,t){const r=e.self.RULES.all;for(const n in r){const s=r[n];if(typeof s=="object"&&(0,Pn.shouldUseRule)(e.schema,s)){const{type:i}=s.definition;i.length&&!i.some(o=>Fc(t,o))&&Sn(e,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function Fc(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function Yi(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function qc(e,t){const r=[];for(const n of e.dataTypes)Yi(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function Sn(e,t){const r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,Ge.checkStrictMode)(e,t,e.opts.strictTypes)}class Zi{constructor(t,r,n){if((0,Ht.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Ge.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",eo(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Ht.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=t.gen.const("_errs",V.default.errors))}result(t,r,n){this.failResult((0,q.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,q.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);const{schemaCode:r}=this;this.fail((0,q._)`${r} !== undefined && (${(0,q.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?Vt.reportExtraError:Vt.reportError)(this,this.def.error,r)}$dataError(){(0,Vt.reportError)(this,this.def.$dataError||Vt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Vt.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=q.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=q.nil,r=q.nil){if(!this.$data)return;const{gen:n,schemaCode:s,schemaType:i,def:o}=this;n.if((0,q.or)((0,q._)`${s} === undefined`,r)),t!==q.nil&&n.assign(t,!0),(i.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==q.nil&&n.assign(t,!1)),n.else()}invalid$data(){const{gen:t,schemaCode:r,schemaType:n,def:s,it:i}=this;return(0,q.or)(o(),u());function o(){if(n.length){if(!(r instanceof q.Name))throw new Error("ajv implementation error");const f=Array.isArray(n)?n:[n];return(0,q._)`${(0,Tr.checkDataTypes)(f,r,i.opts.strictNumbers,Tr.DataType.Wrong)}`}return q.nil}function u(){if(s.validateSchema){const f=t.scopeValue("validate$data",{ref:s.validateSchema});return(0,q._)`!${f}(${r})`}return q.nil}}subschema(t,r){const n=(0,Kr.getSubschema)(this.it,t);(0,Kr.extendSubschemaData)(n,this.it,t),(0,Kr.extendSubschemaMode)(n,t);const s={...this.it,...n,items:void 0,props:void 0};return Tc(s,r),s}mergeEvaluated(t,r){const{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=Ge.mergeEvaluated.props(s,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=Ge.mergeEvaluated.items(s,t.items,n.items,r)))}mergeValidEvaluated(t,r){const{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(r,()=>this.mergeEvaluated(t,q.Name)),!0}}Ne.KeywordCxt=Zi;function Xi(e,t,r,n){const s=new Zi(e,r,t);"code"in r?r.code(s,n):s.$data&&r.validate?(0,Ht.funcKeywordCode)(s,r):"macro"in r?(0,Ht.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,Ht.funcKeywordCode)(s,r)}const Uc=/^\/(?:[^~]|~0|~1)*$/,zc=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function eo(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,i;if(e==="")return V.default.rootData;if(e[0]==="/"){if(!Uc.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);s=e,i=V.default.rootData}else{const l=zc.exec(e);if(!l)throw new Error(`Invalid JSON-pointer: ${e}`);const d=+l[1];if(s=l[2],s==="#"){if(d>=t)throw new Error(f("property/index",d));return n[t-d]}if(d>t)throw new Error(f("data",d));if(i=r[t-d],!s)return i}let o=i;const u=s.split("/");for(const l of u)l&&(i=(0,q._)`${i}${(0,q.getProperty)((0,Ge.unescapeJsonPointer)(l))}`,o=(0,q._)`${o} && ${i}`);return o;function f(l,d){return`Cannot access ${l} ${d} levels up, current level is ${t}`}}Ne.getData=eo;var tr={};Object.defineProperty(tr,"__esModule",{value:!0});class Vc extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}tr.default=Vc;var rr={};Object.defineProperty(rr,"__esModule",{value:!0});const Jr=ye;class Wc extends Error{constructor(t,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Jr.resolveUrl)(t,r,n),this.missingSchema=(0,Jr.normalizeId)((0,Jr.getFullPath)(t,this.missingRef))}}rr.default=Wc;var ve={};Object.defineProperty(ve,"__esModule",{value:!0});ve.resolveSchema=ve.getCompilingSchema=ve.resolveRef=ve.compileSchema=ve.SchemaEnv=void 0;const ke=B,xc=tr,it=We,Ce=ye,js=X,Hc=Ne;class Ur{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,Ce.normalizeId)(n==null?void 0:n[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n==null?void 0:n.$async,this.refs={}}}ve.SchemaEnv=Ur;function Tn(e){const t=to.call(this,e);if(t)return t;const r=(0,Ce.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:i}=this.opts,o=new ke.CodeGen(this.scope,{es5:n,lines:s,ownProperties:i});let u;e.$async&&(u=o.scopeValue("Error",{ref:xc.default,code:(0,ke._)`require("ajv/dist/runtime/validation_error").default`}));const f=o.scopeName("validate");e.validateName=f;const l={gen:o,allErrors:this.opts.allErrors,data:it.default.data,parentData:it.default.parentData,parentDataProperty:it.default.parentDataProperty,dataNames:[it.default.data],dataPathArr:[ke.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,ke.stringify)(e.schema)}:{ref:e.schema}),validateName:f,ValidationError:u,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:ke.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,ke._)`""`,opts:this.opts,self:this};let d;try{this._compilations.add(e),(0,Hc.validateFunctionCode)(l),o.optimize(this.opts.code.optimize);const p=o.toString();d=`${o.scopeRefs(it.default.scope)}return ${p}`,this.opts.code.process&&(d=this.opts.code.process(d,e));const b=new Function(`${it.default.self}`,`${it.default.scope}`,d)(this,this.scope.get());if(this.scope.value(f,{ref:b}),b.errors=null,b.schema=e.schema,b.schemaEnv=e,e.$async&&(b.$async=!0),this.opts.code.source===!0&&(b.source={validateName:f,validateCode:p,scopeValues:o._values}),this.opts.unevaluated){const{props:P,items:O}=l;b.evaluated={props:P instanceof ke.Name?void 0:P,items:O instanceof ke.Name?void 0:O,dynamicProps:P instanceof ke.Name,dynamicItems:O instanceof ke.Name},b.source&&(b.source.evaluated=(0,ke.stringify)(b.evaluated))}return e.validate=b,e}catch(p){throw delete e.validate,delete e.validateName,d&&this.logger.error("Error compiling schema, function code:",d),p}finally{this._compilations.delete(e)}}ve.compileSchema=Tn;function Bc(e,t,r){var n;r=(0,Ce.resolveUrl)(this.opts.uriResolver,t,r);const s=e.refs[r];if(s)return s;let i=Jc.call(this,e,r);if(i===void 0){const o=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:u}=this.opts;o&&(i=new Ur({schema:o,schemaId:u,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=Gc.call(this,i)}ve.resolveRef=Bc;function Gc(e){return(0,Ce.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Tn.call(this,e)}function to(e){for(const t of this._compilations)if(Kc(t,e))return t}ve.getCompilingSchema=to;function Kc(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Jc(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||zr.call(this,e,t)}function zr(e,t){const r=this.opts.uriResolver.parse(t),n=(0,Ce._getFullPath)(this.opts.uriResolver,r);let s=(0,Ce.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return Qr.call(this,r,e);const i=(0,Ce.normalizeId)(n),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){const u=zr.call(this,e,o);return typeof(u==null?void 0:u.schema)!="object"?void 0:Qr.call(this,r,u)}if(typeof(o==null?void 0:o.schema)=="object"){if(o.validate||Tn.call(this,o),i===(0,Ce.normalizeId)(t)){const{schema:u}=o,{schemaId:f}=this.opts,l=u[f];return l&&(s=(0,Ce.resolveUrl)(this.opts.uriResolver,s,l)),new Ur({schema:u,schemaId:f,root:e,baseId:s})}return Qr.call(this,r,o)}}ve.resolveSchema=zr;const Qc=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Qr(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(const u of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const f=r[(0,js.unescapeFragment)(u)];if(f===void 0)return;r=f;const l=typeof r=="object"&&r[this.opts.schemaId];!Qc.has(u)&&l&&(t=(0,Ce.resolveUrl)(this.opts.uriResolver,t,l))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,js.schemaHasRulesButRef)(r,this.RULES)){const u=(0,Ce.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=zr.call(this,n,u)}const{schemaId:o}=this.opts;if(i=i||new Ur({schema:r,schemaId:o,root:n,baseId:t}),i.schema!==i.root.schema)return i}const Yc="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Zc="Meta-schema for $data reference (JSON AnySchema extension proposal)",Xc="object",el=["$data"],tl={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},rl=!1,nl={$id:Yc,description:Zc,type:Xc,required:el,properties:tl,additionalProperties:rl};var Rn={},cn={exports:{}};/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */(function(e,t){(function(r,n){n(t)})(da,function(r){function n(){for(var h=arguments.length,c=Array(h),y=0;y<h;y++)c[y]=arguments[y];if(c.length>1){c[0]=c[0].slice(0,-1);for(var k=c.length-1,R=1;R<k;++R)c[R]=c[R].slice(1,-1);return c[k]=c[k].slice(1),c.join("")}else return c[0]}function s(h){return"(?:"+h+")"}function i(h){return h===void 0?"undefined":h===null?"null":Object.prototype.toString.call(h).split(" ").pop().split("]").shift().toLowerCase()}function o(h){return h.toUpperCase()}function u(h){return h!=null?h instanceof Array?h:typeof h.length!="number"||h.split||h.setInterval||h.call?[h]:Array.prototype.slice.call(h):[]}function f(h,c){var y=h;if(c)for(var k in c)y[k]=c[k];return y}function l(h){var c="[A-Za-z]",y="[0-9]",k=n(y,"[A-Fa-f]"),R=s(s("%[EFef]"+k+"%"+k+k+"%"+k+k)+"|"+s("%[89A-Fa-f]"+k+"%"+k+k)+"|"+s("%"+k+k)),U="[\\:\\/\\?\\#\\[\\]\\@]",z="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",Z=n(U,z),te=h?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",ce=h?"[\\uE000-\\uF8FF]":"[]",J=n(c,y,"[\\-\\.\\_\\~]",te);s(c+n(c,y,"[\\+\\-\\.]")+"*"),s(s(R+"|"+n(J,z,"[\\:]"))+"*");var ee=s(s("25[0-5]")+"|"+s("2[0-4]"+y)+"|"+s("1"+y+y)+"|"+s("0?[1-9]"+y)+"|0?0?"+y),le=s(ee+"\\."+ee+"\\."+ee+"\\."+ee),x=s(k+"{1,4}"),ne=s(s(x+"\\:"+x)+"|"+le),pe=s(s(x+"\\:")+"{6}"+ne),se=s("\\:\\:"+s(x+"\\:")+"{5}"+ne),Ke=s(s(x)+"?\\:\\:"+s(x+"\\:")+"{4}"+ne),De=s(s(s(x+"\\:")+"{0,1}"+x)+"?\\:\\:"+s(x+"\\:")+"{3}"+ne),Me=s(s(s(x+"\\:")+"{0,2}"+x)+"?\\:\\:"+s(x+"\\:")+"{2}"+ne),vt=s(s(s(x+"\\:")+"{0,3}"+x)+"?\\:\\:"+x+"\\:"+ne),nt=s(s(s(x+"\\:")+"{0,4}"+x)+"?\\:\\:"+ne),Se=s(s(s(x+"\\:")+"{0,5}"+x)+"?\\:\\:"+x),Le=s(s(s(x+"\\:")+"{0,6}"+x)+"?\\:\\:"),st=s([pe,se,Ke,De,Me,vt,nt,Se,Le].join("|")),xe=s(s(J+"|"+R)+"+");s("[vV]"+k+"+\\."+n(J,z,"[\\:]")+"+"),s(s(R+"|"+n(J,z))+"*");var Ut=s(R+"|"+n(J,z,"[\\:\\@]"));return s(s(R+"|"+n(J,z,"[\\@]"))+"+"),s(s(Ut+"|"+n("[\\/\\?]",ce))+"*"),{NOT_SCHEME:new RegExp(n("[^]",c,y,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(n("[^\\%\\:]",J,z),"g"),NOT_HOST:new RegExp(n("[^\\%\\[\\]\\:]",J,z),"g"),NOT_PATH:new RegExp(n("[^\\%\\/\\:\\@]",J,z),"g"),NOT_PATH_NOSCHEME:new RegExp(n("[^\\%\\/\\@]",J,z),"g"),NOT_QUERY:new RegExp(n("[^\\%]",J,z,"[\\:\\@\\/\\?]",ce),"g"),NOT_FRAGMENT:new RegExp(n("[^\\%]",J,z,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(n("[^]",J,z),"g"),UNRESERVED:new RegExp(J,"g"),OTHER_CHARS:new RegExp(n("[^\\%]",J,Z),"g"),PCT_ENCODED:new RegExp(R,"g"),IPV4ADDRESS:new RegExp("^("+le+")$"),IPV6ADDRESS:new RegExp("^\\[?("+st+")"+s(s("\\%25|\\%(?!"+k+"{2})")+"("+xe+")")+"?\\]?$")}}var d=l(!1),p=l(!0),_=function(){function h(c,y){var k=[],R=!0,U=!1,z=void 0;try{for(var Z=c[Symbol.iterator](),te;!(R=(te=Z.next()).done)&&(k.push(te.value),!(y&&k.length===y));R=!0);}catch(ce){U=!0,z=ce}finally{try{!R&&Z.return&&Z.return()}finally{if(U)throw z}}return k}return function(c,y){if(Array.isArray(c))return c;if(Symbol.iterator in Object(c))return h(c,y);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),b=function(h){if(Array.isArray(h)){for(var c=0,y=Array(h.length);c<h.length;c++)y[c]=h[c];return y}else return Array.from(h)},P=2147483647,O=36,w=1,g=26,$=38,S=700,I=72,D=128,E="-",C=/^xn--/,A=/[^\0-\x7E]/,W=/[\x2E\u3002\uFF0E\uFF61]/g,G={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ie=O-w,Y=Math.floor,Ee=String.fromCharCode;function fe(h){throw new RangeError(G[h])}function Xe(h,c){for(var y=[],k=h.length;k--;)y[k]=c(h[k]);return y}function et(h,c){var y=h.split("@"),k="";y.length>1&&(k=y[0]+"@",h=y[1]),h=h.replace(W,".");var R=h.split("."),U=Xe(R,c).join(".");return k+U}function pt(h){for(var c=[],y=0,k=h.length;y<k;){var R=h.charCodeAt(y++);if(R>=55296&&R<=56319&&y<k){var U=h.charCodeAt(y++);(U&64512)==56320?c.push(((R&1023)<<10)+(U&1023)+65536):(c.push(R),y--)}else c.push(R)}return c}var It=function(c){return String.fromCodePoint.apply(String,b(c))},ht=function(c){return c-48<10?c-22:c-65<26?c-65:c-97<26?c-97:O},M=function(c,y){return c+22+75*(c<26)-((y!=0)<<5)},v=function(c,y,k){var R=0;for(c=k?Y(c/S):c>>1,c+=Y(c/y);c>ie*g>>1;R+=O)c=Y(c/ie);return Y(R+(ie+1)*c/(c+$))},j=function(c){var y=[],k=c.length,R=0,U=D,z=I,Z=c.lastIndexOf(E);Z<0&&(Z=0);for(var te=0;te<Z;++te)c.charCodeAt(te)>=128&&fe("not-basic"),y.push(c.charCodeAt(te));for(var ce=Z>0?Z+1:0;ce<k;){for(var J=R,ee=1,le=O;;le+=O){ce>=k&&fe("invalid-input");var x=ht(c.charCodeAt(ce++));(x>=O||x>Y((P-R)/ee))&&fe("overflow"),R+=x*ee;var ne=le<=z?w:le>=z+g?g:le-z;if(x<ne)break;var pe=O-ne;ee>Y(P/pe)&&fe("overflow"),ee*=pe}var se=y.length+1;z=v(R-J,se,J==0),Y(R/se)>P-U&&fe("overflow"),U+=Y(R/se),R%=se,y.splice(R++,0,U)}return String.fromCodePoint.apply(String,y)},T=function(c){var y=[];c=pt(c);var k=c.length,R=D,U=0,z=I,Z=!0,te=!1,ce=void 0;try{for(var J=c[Symbol.iterator](),ee;!(Z=(ee=J.next()).done);Z=!0){var le=ee.value;le<128&&y.push(Ee(le))}}catch(zt){te=!0,ce=zt}finally{try{!Z&&J.return&&J.return()}finally{if(te)throw ce}}var x=y.length,ne=x;for(x&&y.push(E);ne<k;){var pe=P,se=!0,Ke=!1,De=void 0;try{for(var Me=c[Symbol.iterator](),vt;!(se=(vt=Me.next()).done);se=!0){var nt=vt.value;nt>=R&&nt<pe&&(pe=nt)}}catch(zt){Ke=!0,De=zt}finally{try{!se&&Me.return&&Me.return()}finally{if(Ke)throw De}}var Se=ne+1;pe-R>Y((P-U)/Se)&&fe("overflow"),U+=(pe-R)*Se,R=pe;var Le=!0,st=!1,xe=void 0;try{for(var Ut=c[Symbol.iterator](),ms;!(Le=(ms=Ut.next()).done);Le=!0){var ys=ms.value;if(ys<R&&++U>P&&fe("overflow"),ys==R){for(var ir=U,or=O;;or+=O){var ar=or<=z?w:or>=z+g?g:or-z;if(ir<ar)break;var gs=ir-ar,$s=O-ar;y.push(Ee(M(ar+gs%$s,0))),ir=Y(gs/$s)}y.push(Ee(M(ir,0))),z=v(U,Se,ne==x),U=0,++ne}}}catch(zt){st=!0,xe=zt}finally{try{!Le&&Ut.return&&Ut.return()}finally{if(st)throw xe}}++U,++R}return y.join("")},a=function(c){return et(c,function(y){return C.test(y)?j(y.slice(4).toLowerCase()):y})},m=function(c){return et(c,function(y){return A.test(y)?"xn--"+T(y):y})},N={version:"2.1.0",ucs2:{decode:pt,encode:It},decode:j,encode:T,toASCII:m,toUnicode:a},L={};function F(h){var c=h.charCodeAt(0),y=void 0;return c<16?y="%0"+c.toString(16).toUpperCase():c<128?y="%"+c.toString(16).toUpperCase():c<2048?y="%"+(c>>6|192).toString(16).toUpperCase()+"%"+(c&63|128).toString(16).toUpperCase():y="%"+(c>>12|224).toString(16).toUpperCase()+"%"+(c>>6&63|128).toString(16).toUpperCase()+"%"+(c&63|128).toString(16).toUpperCase(),y}function K(h){for(var c="",y=0,k=h.length;y<k;){var R=parseInt(h.substr(y+1,2),16);if(R<128)c+=String.fromCharCode(R),y+=3;else if(R>=194&&R<224){if(k-y>=6){var U=parseInt(h.substr(y+4,2),16);c+=String.fromCharCode((R&31)<<6|U&63)}else c+=h.substr(y,6);y+=6}else if(R>=224){if(k-y>=9){var z=parseInt(h.substr(y+4,2),16),Z=parseInt(h.substr(y+7,2),16);c+=String.fromCharCode((R&15)<<12|(z&63)<<6|Z&63)}else c+=h.substr(y,9);y+=9}else c+=h.substr(y,3),y+=3}return c}function Q(h,c){function y(k){var R=K(k);return R.match(c.UNRESERVED)?R:k}return h.scheme&&(h.scheme=String(h.scheme).replace(c.PCT_ENCODED,y).toLowerCase().replace(c.NOT_SCHEME,"")),h.userinfo!==void 0&&(h.userinfo=String(h.userinfo).replace(c.PCT_ENCODED,y).replace(c.NOT_USERINFO,F).replace(c.PCT_ENCODED,o)),h.host!==void 0&&(h.host=String(h.host).replace(c.PCT_ENCODED,y).toLowerCase().replace(c.NOT_HOST,F).replace(c.PCT_ENCODED,o)),h.path!==void 0&&(h.path=String(h.path).replace(c.PCT_ENCODED,y).replace(h.scheme?c.NOT_PATH:c.NOT_PATH_NOSCHEME,F).replace(c.PCT_ENCODED,o)),h.query!==void 0&&(h.query=String(h.query).replace(c.PCT_ENCODED,y).replace(c.NOT_QUERY,F).replace(c.PCT_ENCODED,o)),h.fragment!==void 0&&(h.fragment=String(h.fragment).replace(c.PCT_ENCODED,y).replace(c.NOT_FRAGMENT,F).replace(c.PCT_ENCODED,o)),h}function oe(h){return h.replace(/^0*(.*)/,"$1")||"0"}function Ie(h,c){var y=h.match(c.IPV4ADDRESS)||[],k=_(y,2),R=k[1];return R?R.split(".").map(oe).join("."):h}function mt(h,c){var y=h.match(c.IPV6ADDRESS)||[],k=_(y,3),R=k[1],U=k[2];if(R){for(var z=R.toLowerCase().split("::").reverse(),Z=_(z,2),te=Z[0],ce=Z[1],J=ce?ce.split(":").map(oe):[],ee=te.split(":").map(oe),le=c.IPV4ADDRESS.test(ee[ee.length-1]),x=le?7:8,ne=ee.length-x,pe=Array(x),se=0;se<x;++se)pe[se]=J[se]||ee[ne+se]||"";le&&(pe[x-1]=Ie(pe[x-1],c));var Ke=pe.reduce(function(Se,Le,st){if(!Le||Le==="0"){var xe=Se[Se.length-1];xe&&xe.index+xe.length===st?xe.length++:Se.push({index:st,length:1})}return Se},[]),De=Ke.sort(function(Se,Le){return Le.length-Se.length})[0],Me=void 0;if(De&&De.length>1){var vt=pe.slice(0,De.index),nt=pe.slice(De.index+De.length);Me=vt.join(":")+"::"+nt.join(":")}else Me=pe.join(":");return U&&(Me+="%"+U),Me}else return h}var jt=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,At="".match(/(){0}/)[1]===void 0;function be(h){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y={},k=c.iri!==!1?p:d;c.reference==="suffix"&&(h=(c.scheme?c.scheme+":":"")+"//"+h);var R=h.match(jt);if(R){At?(y.scheme=R[1],y.userinfo=R[3],y.host=R[4],y.port=parseInt(R[5],10),y.path=R[6]||"",y.query=R[7],y.fragment=R[8],isNaN(y.port)&&(y.port=R[5])):(y.scheme=R[1]||void 0,y.userinfo=h.indexOf("@")!==-1?R[3]:void 0,y.host=h.indexOf("//")!==-1?R[4]:void 0,y.port=parseInt(R[5],10),y.path=R[6]||"",y.query=h.indexOf("?")!==-1?R[7]:void 0,y.fragment=h.indexOf("#")!==-1?R[8]:void 0,isNaN(y.port)&&(y.port=h.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?R[4]:void 0)),y.host&&(y.host=mt(Ie(y.host,k),k)),y.scheme===void 0&&y.userinfo===void 0&&y.host===void 0&&y.port===void 0&&!y.path&&y.query===void 0?y.reference="same-document":y.scheme===void 0?y.reference="relative":y.fragment===void 0?y.reference="absolute":y.reference="uri",c.reference&&c.reference!=="suffix"&&c.reference!==y.reference&&(y.error=y.error||"URI is not a "+c.reference+" reference.");var U=L[(c.scheme||y.scheme||"").toLowerCase()];if(!c.unicodeSupport&&(!U||!U.unicodeSupport)){if(y.host&&(c.domainHost||U&&U.domainHost))try{y.host=N.toASCII(y.host.replace(k.PCT_ENCODED,K).toLowerCase())}catch(z){y.error=y.error||"Host's domain name can not be converted to ASCII via punycode: "+z}Q(y,d)}else Q(y,k);U&&U.parse&&U.parse(y,c)}else y.error=y.error||"URI can not be parsed.";return y}function Dt(h,c){var y=c.iri!==!1?p:d,k=[];return h.userinfo!==void 0&&(k.push(h.userinfo),k.push("@")),h.host!==void 0&&k.push(mt(Ie(String(h.host),y),y).replace(y.IPV6ADDRESS,function(R,U,z){return"["+U+(z?"%25"+z:"")+"]"})),(typeof h.port=="number"||typeof h.port=="string")&&(k.push(":"),k.push(String(h.port))),k.length?k.join(""):void 0}var yt=/^\.\.?\//,gt=/^\/\.(\/|$)/,$t=/^\/\.\.(\/|$)/,Mt=/^\/?(?:.|\n)*?(?=\/|$)/;function je(h){for(var c=[];h.length;)if(h.match(yt))h=h.replace(yt,"");else if(h.match(gt))h=h.replace(gt,"/");else if(h.match($t))h=h.replace($t,"/"),c.pop();else if(h==="."||h==="..")h="";else{var y=h.match(Mt);if(y){var k=y[0];h=h.slice(k.length),c.push(k)}else throw new Error("Unexpected dot segment condition")}return c.join("")}function _e(h){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y=c.iri?p:d,k=[],R=L[(c.scheme||h.scheme||"").toLowerCase()];if(R&&R.serialize&&R.serialize(h,c),h.host&&!y.IPV6ADDRESS.test(h.host)){if(c.domainHost||R&&R.domainHost)try{h.host=c.iri?N.toUnicode(h.host):N.toASCII(h.host.replace(y.PCT_ENCODED,K).toLowerCase())}catch(Z){h.error=h.error||"Host's domain name can not be converted to "+(c.iri?"Unicode":"ASCII")+" via punycode: "+Z}}Q(h,y),c.reference!=="suffix"&&h.scheme&&(k.push(h.scheme),k.push(":"));var U=Dt(h,c);if(U!==void 0&&(c.reference!=="suffix"&&k.push("//"),k.push(U),h.path&&h.path.charAt(0)!=="/"&&k.push("/")),h.path!==void 0){var z=h.path;!c.absolutePath&&(!R||!R.absolutePath)&&(z=je(z)),U===void 0&&(z=z.replace(/^\/\//,"/%2F")),k.push(z)}return h.query!==void 0&&(k.push("?"),k.push(h.query)),h.fragment!==void 0&&(k.push("#"),k.push(h.fragment)),k.join("")}function _t(h,c){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},k=arguments[3],R={};return k||(h=be(_e(h,y),y),c=be(_e(c,y),y)),y=y||{},!y.tolerant&&c.scheme?(R.scheme=c.scheme,R.userinfo=c.userinfo,R.host=c.host,R.port=c.port,R.path=je(c.path||""),R.query=c.query):(c.userinfo!==void 0||c.host!==void 0||c.port!==void 0?(R.userinfo=c.userinfo,R.host=c.host,R.port=c.port,R.path=je(c.path||""),R.query=c.query):(c.path?(c.path.charAt(0)==="/"?R.path=je(c.path):((h.userinfo!==void 0||h.host!==void 0||h.port!==void 0)&&!h.path?R.path="/"+c.path:h.path?R.path=h.path.slice(0,h.path.lastIndexOf("/")+1)+c.path:R.path=c.path,R.path=je(R.path)),R.query=c.query):(R.path=h.path,c.query!==void 0?R.query=c.query:R.query=h.query),R.userinfo=h.userinfo,R.host=h.host,R.port=h.port),R.scheme=h.scheme),R.fragment=c.fragment,R}function Lt(h,c,y){var k=f({scheme:"null"},y);return _e(_t(be(h,k),be(c,k),k,!0),k)}function tt(h,c){return typeof h=="string"?h=_e(be(h,c),c):i(h)==="object"&&(h=be(_e(h,c),c)),h}function Ft(h,c,y){return typeof h=="string"?h=_e(be(h,y),y):i(h)==="object"&&(h=_e(h,y)),typeof c=="string"?c=_e(be(c,y),y):i(c)==="object"&&(c=_e(c,y)),h===c}function sr(h,c){return h&&h.toString().replace(!c||!c.iri?d.ESCAPE:p.ESCAPE,F)}function Pe(h,c){return h&&h.toString().replace(!c||!c.iri?d.PCT_ENCODED:p.PCT_ENCODED,K)}var rt={scheme:"http",domainHost:!0,parse:function(c,y){return c.host||(c.error=c.error||"HTTP URIs must have a host."),c},serialize:function(c,y){var k=String(c.scheme).toLowerCase()==="https";return(c.port===(k?443:80)||c.port==="")&&(c.port=void 0),c.path||(c.path="/"),c}},as={scheme:"https",domainHost:rt.domainHost,parse:rt.parse,serialize:rt.serialize};function cs(h){return typeof h.secure=="boolean"?h.secure:String(h.scheme).toLowerCase()==="wss"}var qt={scheme:"ws",domainHost:!0,parse:function(c,y){var k=c;return k.secure=cs(k),k.resourceName=(k.path||"/")+(k.query?"?"+k.query:""),k.path=void 0,k.query=void 0,k},serialize:function(c,y){if((c.port===(cs(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 k=c.resourceName.split("?"),R=_(k,2),U=R[0],z=R[1];c.path=U&&U!=="/"?U:void 0,c.query=z,c.resourceName=void 0}return c.fragment=void 0,c}},ls={scheme:"wss",domainHost:qt.domainHost,parse:qt.parse,serialize:qt.serialize},Po={},us="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Ae="[0-9A-Fa-f]",So=s(s("%[EFef]"+Ae+"%"+Ae+Ae+"%"+Ae+Ae)+"|"+s("%[89A-Fa-f]"+Ae+"%"+Ae+Ae)+"|"+s("%"+Ae+Ae)),To="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Ro="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",ko=n(Ro,'[\\"\\\\]'),Oo="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Co=new RegExp(us,"g"),wt=new RegExp(So,"g"),No=new RegExp(n("[^]",To,"[\\.]",'[\\"]',ko),"g"),ds=new RegExp(n("[^]",us,Oo),"g"),Io=ds;function Wr(h){var c=K(h);return c.match(Co)?c:h}var fs={scheme:"mailto",parse:function(c,y){var k=c,R=k.to=k.path?k.path.split(","):[];if(k.path=void 0,k.query){for(var U=!1,z={},Z=k.query.split("&"),te=0,ce=Z.length;te<ce;++te){var J=Z[te].split("=");switch(J[0]){case"to":for(var ee=J[1].split(","),le=0,x=ee.length;le<x;++le)R.push(ee[le]);break;case"subject":k.subject=Pe(J[1],y);break;case"body":k.body=Pe(J[1],y);break;default:U=!0,z[Pe(J[0],y)]=Pe(J[1],y);break}}U&&(k.headers=z)}k.query=void 0;for(var ne=0,pe=R.length;ne<pe;++ne){var se=R[ne].split("@");if(se[0]=Pe(se[0]),y.unicodeSupport)se[1]=Pe(se[1],y).toLowerCase();else try{se[1]=N.toASCII(Pe(se[1],y).toLowerCase())}catch(Ke){k.error=k.error||"Email address's domain name can not be converted to ASCII via punycode: "+Ke}R[ne]=se.join("@")}return k},serialize:function(c,y){var k=c,R=u(c.to);if(R){for(var U=0,z=R.length;U<z;++U){var Z=String(R[U]),te=Z.lastIndexOf("@"),ce=Z.slice(0,te).replace(wt,Wr).replace(wt,o).replace(No,F),J=Z.slice(te+1);try{J=y.iri?N.toUnicode(J):N.toASCII(Pe(J,y).toLowerCase())}catch(ne){k.error=k.error||"Email address's domain name can not be converted to "+(y.iri?"Unicode":"ASCII")+" via punycode: "+ne}R[U]=ce+"@"+J}k.path=R.join(",")}var ee=c.headers=c.headers||{};c.subject&&(ee.subject=c.subject),c.body&&(ee.body=c.body);var le=[];for(var x in ee)ee[x]!==Po[x]&&le.push(x.replace(wt,Wr).replace(wt,o).replace(ds,F)+"="+ee[x].replace(wt,Wr).replace(wt,o).replace(Io,F));return le.length&&(k.query=le.join("&")),k}},jo=/^([^\:]+)\:(.*)/,ps={scheme:"urn",parse:function(c,y){var k=c.path&&c.path.match(jo),R=c;if(k){var U=y.scheme||R.scheme||"urn",z=k[1].toLowerCase(),Z=k[2],te=U+":"+(y.nid||z),ce=L[te];R.nid=z,R.nss=Z,R.path=void 0,ce&&(R=ce.parse(R,y))}else R.error=R.error||"URN can not be parsed.";return R},serialize:function(c,y){var k=y.scheme||c.scheme||"urn",R=c.nid,U=k+":"+(y.nid||R),z=L[U];z&&(c=z.serialize(c,y));var Z=c,te=c.nss;return Z.path=(R||y.nid)+":"+te,Z}},Ao=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,hs={scheme:"urn:uuid",parse:function(c,y){var k=c;return k.uuid=k.nss,k.nss=void 0,!y.tolerant&&(!k.uuid||!k.uuid.match(Ao))&&(k.error=k.error||"UUID is not valid."),k},serialize:function(c,y){var k=c;return k.nss=(c.uuid||"").toLowerCase(),k}};L[rt.scheme]=rt,L[as.scheme]=as,L[qt.scheme]=qt,L[ls.scheme]=ls,L[fs.scheme]=fs,L[ps.scheme]=ps,L[hs.scheme]=hs,r.SCHEMES=L,r.pctEncChar=F,r.pctDecChars=K,r.parse=be,r.removeDotSegments=je,r.serialize=_e,r.resolveComponents=_t,r.resolve=Lt,r.normalize=tt,r.equal=Ft,r.escapeComponent=sr,r.unescapeComponent=Pe,Object.defineProperty(r,"__esModule",{value:!0})})})(cn,cn.exports);var sl=cn.exports;Object.defineProperty(Rn,"__esModule",{value:!0});const ro=sl;ro.code='require("ajv/dist/runtime/uri").default';Rn.default=ro;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Ne;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=B;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=tr,s=rr,i=ut,o=ve,u=B,f=ye,l=er,d=X,p=nl,_=Rn,b=(M,v)=>new RegExp(M,v);b.code="new RegExp";const P=["removeAdditional","useDefaults","coerceTypes"],O=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),w={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.'},$=200;function S(M){var v,j,T,a,m,N,L,F,K,Q,oe,Ie,mt,jt,At,be,Dt,yt,gt,$t,Mt,je,_e,_t,Lt;const tt=M.strict,Ft=(v=M.code)===null||v===void 0?void 0:v.optimize,sr=Ft===!0||Ft===void 0?1:Ft||0,Pe=(T=(j=M.code)===null||j===void 0?void 0:j.regExp)!==null&&T!==void 0?T:b,rt=(a=M.uriResolver)!==null&&a!==void 0?a:_.default;return{strictSchema:(N=(m=M.strictSchema)!==null&&m!==void 0?m:tt)!==null&&N!==void 0?N:!0,strictNumbers:(F=(L=M.strictNumbers)!==null&&L!==void 0?L:tt)!==null&&F!==void 0?F:!0,strictTypes:(Q=(K=M.strictTypes)!==null&&K!==void 0?K:tt)!==null&&Q!==void 0?Q:"log",strictTuples:(Ie=(oe=M.strictTuples)!==null&&oe!==void 0?oe:tt)!==null&&Ie!==void 0?Ie:"log",strictRequired:(jt=(mt=M.strictRequired)!==null&&mt!==void 0?mt:tt)!==null&&jt!==void 0?jt:!1,code:M.code?{...M.code,optimize:sr,regExp:Pe}:{optimize:sr,regExp:Pe},loopRequired:(At=M.loopRequired)!==null&&At!==void 0?At:$,loopEnum:(be=M.loopEnum)!==null&&be!==void 0?be:$,meta:(Dt=M.meta)!==null&&Dt!==void 0?Dt:!0,messages:(yt=M.messages)!==null&&yt!==void 0?yt:!0,inlineRefs:(gt=M.inlineRefs)!==null&&gt!==void 0?gt:!0,schemaId:($t=M.schemaId)!==null&&$t!==void 0?$t:"$id",addUsedSchema:(Mt=M.addUsedSchema)!==null&&Mt!==void 0?Mt:!0,validateSchema:(je=M.validateSchema)!==null&&je!==void 0?je:!0,validateFormats:(_e=M.validateFormats)!==null&&_e!==void 0?_e:!0,unicodeRegExp:(_t=M.unicodeRegExp)!==null&&_t!==void 0?_t:!0,int32range:(Lt=M.int32range)!==null&&Lt!==void 0?Lt:!0,uriResolver:rt}}class I{constructor(v={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,v=this.opts={...v,...S(v)};const{es5:j,lines:T}=this.opts.code;this.scope=new u.ValueScope({scope:{},prefixes:O,es5:j,lines:T}),this.logger=Y(v.logger);const a=v.validateFormats;v.validateFormats=!1,this.RULES=(0,i.getRules)(),D.call(this,w,v,"NOT SUPPORTED"),D.call(this,g,v,"DEPRECATED","warn"),this._metaOpts=G.call(this),v.formats&&A.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),v.keywords&&W.call(this,v.keywords),typeof v.meta=="object"&&this.addMetaSchema(v.meta),C.call(this),v.validateFormats=a}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:v,meta:j,schemaId:T}=this.opts;let a=p;T==="id"&&(a={...p},a.id=a.$id,delete a.$id),j&&v&&this.addMetaSchema(a,a[T],!1)}defaultMeta(){const{meta:v,schemaId:j}=this.opts;return this.opts.defaultMeta=typeof v=="object"?v[j]||v:void 0}validate(v,j){let T;if(typeof v=="string"){if(T=this.getSchema(v),!T)throw new Error(`no schema with key or ref "${v}"`)}else T=this.compile(v);const a=T(j);return"$async"in T||(this.errors=T.errors),a}compile(v,j){const T=this._addSchema(v,j);return T.validate||this._compileSchemaEnv(T)}compileAsync(v,j){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:T}=this.opts;return a.call(this,v,j);async function a(Q,oe){await m.call(this,Q.$schema);const Ie=this._addSchema(Q,oe);return Ie.validate||N.call(this,Ie)}async function m(Q){Q&&!this.getSchema(Q)&&await a.call(this,{$ref:Q},!0)}async function N(Q){try{return this._compileSchemaEnv(Q)}catch(oe){if(!(oe instanceof s.default))throw oe;return L.call(this,oe),await F.call(this,oe.missingSchema),N.call(this,Q)}}function L({missingSchema:Q,missingRef:oe}){if(this.refs[Q])throw new Error(`AnySchema ${Q} is loaded but ${oe} cannot be resolved`)}async function F(Q){const oe=await K.call(this,Q);this.refs[Q]||await m.call(this,oe.$schema),this.refs[Q]||this.addSchema(oe,Q,j)}async function K(Q){const oe=this._loading[Q];if(oe)return oe;try{return await(this._loading[Q]=T(Q))}finally{delete this._loading[Q]}}}addSchema(v,j,T,a=this.opts.validateSchema){if(Array.isArray(v)){for(const N of v)this.addSchema(N,void 0,T,a);return this}let m;if(typeof v=="object"){const{schemaId:N}=this.opts;if(m=v[N],m!==void 0&&typeof m!="string")throw new Error(`schema ${N} must be string`)}return j=(0,f.normalizeId)(j||m),this._checkUnique(j),this.schemas[j]=this._addSchema(v,T,j,a,!0),this}addMetaSchema(v,j,T=this.opts.validateSchema){return this.addSchema(v,j,!0,T),this}validateSchema(v,j){if(typeof v=="boolean")return!0;let T;if(T=v.$schema,T!==void 0&&typeof T!="string")throw new Error("$schema must be a string");if(T=T||this.opts.defaultMeta||this.defaultMeta(),!T)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const a=this.validate(T,v);if(!a&&j){const m="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(m);else throw new Error(m)}return a}getSchema(v){let j;for(;typeof(j=E.call(this,v))=="string";)v=j;if(j===void 0){const{schemaId:T}=this.opts,a=new o.SchemaEnv({schema:{},schemaId:T});if(j=o.resolveSchema.call(this,a,v),!j)return;this.refs[v]=j}return j.validate||this._compileSchemaEnv(j)}removeSchema(v){if(v instanceof RegExp)return this._removeAllSchemas(this.schemas,v),this._removeAllSchemas(this.refs,v),this;switch(typeof v){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const j=E.call(this,v);return typeof j=="object"&&this._cache.delete(j.schema),delete this.schemas[v],delete this.refs[v],this}case"object":{const j=v;this._cache.delete(j);let T=v[this.opts.schemaId];return T&&(T=(0,f.normalizeId)(T),delete this.schemas[T],delete this.refs[T]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(v){for(const j of v)this.addKeyword(j);return this}addKeyword(v,j){let T;if(typeof v=="string")T=v,typeof j=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),j.keyword=T);else if(typeof v=="object"&&j===void 0){if(j=v,T=j.keyword,Array.isArray(T)&&!T.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(fe.call(this,T,j),!j)return(0,d.eachItem)(T,m=>Xe.call(this,m)),this;pt.call(this,j);const a={...j,type:(0,l.getJSONTypes)(j.type),schemaType:(0,l.getJSONTypes)(j.schemaType)};return(0,d.eachItem)(T,a.type.length===0?m=>Xe.call(this,m,a):m=>a.type.forEach(N=>Xe.call(this,m,a,N))),this}getKeyword(v){const j=this.RULES.all[v];return typeof j=="object"?j.definition:!!j}removeKeyword(v){const{RULES:j}=this;delete j.keywords[v],delete j.all[v];for(const T of j.rules){const a=T.rules.findIndex(m=>m.keyword===v);a>=0&&T.rules.splice(a,1)}return this}addFormat(v,j){return typeof j=="string"&&(j=new RegExp(j)),this.formats[v]=j,this}errorsText(v=this.errors,{separator:j=", ",dataVar:T="data"}={}){return!v||v.length===0?"No errors":v.map(a=>`${T}${a.instancePath} ${a.message}`).reduce((a,m)=>a+j+m)}$dataMetaSchema(v,j){const T=this.RULES.all;v=JSON.parse(JSON.stringify(v));for(const a of j){const m=a.split("/").slice(1);let N=v;for(const L of m)N=N[L];for(const L in T){const F=T[L];if(typeof F!="object")continue;const{$data:K}=F.definition,Q=N[L];K&&Q&&(N[L]=ht(Q))}}return v}_removeAllSchemas(v,j){for(const T in v){const a=v[T];(!j||j.test(T))&&(typeof a=="string"?delete v[T]:a&&!a.meta&&(this._cache.delete(a.schema),delete v[T]))}}_addSchema(v,j,T,a=this.opts.validateSchema,m=this.opts.addUsedSchema){let N;const{schemaId:L}=this.opts;if(typeof v=="object")N=v[L];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof v!="boolean")throw new Error("schema must be object or boolean")}let F=this._cache.get(v);if(F!==void 0)return F;T=(0,f.normalizeId)(N||T);const K=f.getSchemaRefs.call(this,v,T);return F=new o.SchemaEnv({schema:v,schemaId:L,meta:j,baseId:T,localRefs:K}),this._cache.set(F.schema,F),m&&!T.startsWith("#")&&(T&&this._checkUnique(T),this.refs[T]=F),a&&this.validateSchema(v,!0),F}_checkUnique(v){if(this.schemas[v]||this.refs[v])throw new Error(`schema with key or id "${v}" already exists`)}_compileSchemaEnv(v){if(v.meta?this._compileMetaSchema(v):o.compileSchema.call(this,v),!v.validate)throw new Error("ajv implementation error");return v.validate}_compileMetaSchema(v){const j=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,v)}finally{this.opts=j}}}e.default=I,I.ValidationError=n.default,I.MissingRefError=s.default;function D(M,v,j,T="error"){for(const a in M){const m=a;m in v&&this.logger[T](`${j}: option ${a}. ${M[m]}`)}}function E(M){return M=(0,f.normalizeId)(M),this.schemas[M]||this.refs[M]}function C(){const M=this.opts.schemas;if(M)if(Array.isArray(M))this.addSchema(M);else for(const v in M)this.addSchema(M[v],v)}function A(){for(const M in this.opts.formats){const v=this.opts.formats[M];v&&this.addFormat(M,v)}}function W(M){if(Array.isArray(M)){this.addVocabulary(M);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const v in M){const j=M[v];j.keyword||(j.keyword=v),this.addKeyword(j)}}function G(){const M={...this.opts};for(const v of P)delete M[v];return M}const ie={log(){},warn(){},error(){}};function Y(M){if(M===!1)return ie;if(M===void 0)return console;if(M.log&&M.warn&&M.error)return M;throw new Error("logger must implement log, warn and error methods")}const Ee=/^[a-z_$][a-z0-9_$:-]*$/i;function fe(M,v){const{RULES:j}=this;if((0,d.eachItem)(M,T=>{if(j.keywords[T])throw new Error(`Keyword ${T} is already defined`);if(!Ee.test(T))throw new Error(`Keyword ${T} has invalid name`)}),!!v&&v.$data&&!("code"in v||"validate"in v))throw new Error('$data keyword must have "code" or "validate" function')}function Xe(M,v,j){var T;const a=v==null?void 0:v.post;if(j&&a)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:m}=this;let N=a?m.post:m.rules.find(({type:F})=>F===j);if(N||(N={type:j,rules:[]},m.rules.push(N)),m.keywords[M]=!0,!v)return;const L={keyword:M,definition:{...v,type:(0,l.getJSONTypes)(v.type),schemaType:(0,l.getJSONTypes)(v.schemaType)}};v.before?et.call(this,N,L,v.before):N.rules.push(L),m.all[M]=L,(T=v.implements)===null||T===void 0||T.forEach(F=>this.addKeyword(F))}function et(M,v,j){const T=M.rules.findIndex(a=>a.keyword===j);T>=0?M.rules.splice(T,0,v):(M.rules.push(v),this.logger.warn(`rule ${j} is not defined`))}function pt(M){let{metaSchema:v}=M;v!==void 0&&(M.$data&&this.opts.$data&&(v=ht(v)),M.validateSchema=this.compile(v,!0))}const It={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ht(M){return{anyOf:[M,It]}}})(Ni);var kn={},On={},Cn={};Object.defineProperty(Cn,"__esModule",{value:!0});const il={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Cn.default=il;var dt={};Object.defineProperty(dt,"__esModule",{value:!0});dt.callRef=dt.getValidate=void 0;const ol=rr,As=H,we=B,Et=We,Ds=ve,cr=X,al={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:i,validateName:o,opts:u,self:f}=n,{root:l}=i;if((r==="#"||r==="#/")&&s===l.baseId)return p();const d=Ds.resolveRef.call(f,l,s,r);if(d===void 0)throw new ol.default(n.opts.uriResolver,s,r);if(d instanceof Ds.SchemaEnv)return _(d);return b(d);function p(){if(i===l)return gr(e,o,i,i.$async);const P=t.scopeValue("root",{ref:l});return gr(e,(0,we._)`${P}.validate`,l,l.$async)}function _(P){const O=no(e,P);gr(e,O,P,P.$async)}function b(P){const O=t.scopeValue("schema",u.code.source===!0?{ref:P,code:(0,we.stringify)(P)}:{ref:P}),w=t.name("valid"),g=e.subschema({schema:P,dataTypes:[],schemaPath:we.nil,topSchemaRef:O,errSchemaPath:r},w);e.mergeEvaluated(g),e.ok(w)}}};function no(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,we._)`${r.scopeValue("wrapper",{ref:t})}.validate`}dt.getValidate=no;function gr(e,t,r,n){const{gen:s,it:i}=e,{allErrors:o,schemaEnv:u,opts:f}=i,l=f.passContext?Et.default.this:we.nil;n?d():p();function d(){if(!u.$async)throw new Error("async schema referenced by sync schema");const P=s.let("valid");s.try(()=>{s.code((0,we._)`await ${(0,As.callValidateCode)(e,t,l)}`),b(t),o||s.assign(P,!0)},O=>{s.if((0,we._)`!(${O} instanceof ${i.ValidationError})`,()=>s.throw(O)),_(O),o||s.assign(P,!1)}),e.ok(P)}function p(){e.result((0,As.callValidateCode)(e,t,l),()=>b(t),()=>_(t))}function _(P){const O=(0,we._)`${P}.errors`;s.assign(Et.default.vErrors,(0,we._)`${Et.default.vErrors} === null ? ${O} : ${Et.default.vErrors}.concat(${O})`),s.assign(Et.default.errors,(0,we._)`${Et.default.vErrors}.length`)}function b(P){var O;if(!i.opts.unevaluated)return;const w=(O=r==null?void 0:r.validate)===null||O===void 0?void 0:O.evaluated;if(i.props!==!0)if(w&&!w.dynamicProps)w.props!==void 0&&(i.props=cr.mergeEvaluated.props(s,w.props,i.props));else{const g=s.var("props",(0,we._)`${P}.evaluated.props`);i.props=cr.mergeEvaluated.props(s,g,i.props,we.Name)}if(i.items!==!0)if(w&&!w.dynamicItems)w.items!==void 0&&(i.items=cr.mergeEvaluated.items(s,w.items,i.items));else{const g=s.var("items",(0,we._)`${P}.evaluated.items`);i.items=cr.mergeEvaluated.items(s,g,i.items,we.Name)}}}dt.callRef=gr;dt.default=al;Object.defineProperty(On,"__esModule",{value:!0});const cl=Cn,ll=dt,ul=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",cl.default,ll.default];On.default=ul;var Nn={},In={};Object.defineProperty(In,"__esModule",{value:!0});const Rr=B,Qe=Rr.operators,kr={maximum:{okStr:"<=",ok:Qe.LTE,fail:Qe.GT},minimum:{okStr:">=",ok:Qe.GTE,fail:Qe.LT},exclusiveMaximum:{okStr:"<",ok:Qe.LT,fail:Qe.GTE},exclusiveMinimum:{okStr:">",ok:Qe.GT,fail:Qe.LTE}},dl={message:({keyword:e,schemaCode:t})=>(0,Rr.str)`must be ${kr[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,Rr._)`{comparison: ${kr[e].okStr}, limit: ${t}}`},fl={keyword:Object.keys(kr),type:"number",schemaType:"number",$data:!0,error:dl,code(e){const{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,Rr._)`${r} ${kr[t].fail} ${n} || isNaN(${r})`)}};In.default=fl;var jn={};Object.defineProperty(jn,"__esModule",{value:!0});const Bt=B,pl={message:({schemaCode:e})=>(0,Bt.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,Bt._)`{multipleOf: ${e}}`},hl={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:pl,code(e){const{gen:t,data:r,schemaCode:n,it:s}=e,i=s.opts.multipleOfPrecision,o=t.let("res"),u=i?(0,Bt._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:(0,Bt._)`${o} !== parseInt(${o})`;e.fail$data((0,Bt._)`(${n} === 0 || (${o} = ${r}/${n}, ${u}))`)}};jn.default=hl;var An={},Dn={};Object.defineProperty(Dn,"__esModule",{value:!0});function so(e){const t=e.length;let r=0,n=0,s;for(;n<t;)r++,s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<t&&(s=e.charCodeAt(n),(s&64512)===56320&&n++);return r}Dn.default=so;so.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(An,"__esModule",{value:!0});const at=B,ml=X,yl=Dn,gl={message({keyword:e,schemaCode:t}){const r=e==="maxLength"?"more":"fewer";return(0,at.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,at._)`{limit: ${e}}`},$l={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:gl,code(e){const{keyword:t,data:r,schemaCode:n,it:s}=e,i=t==="maxLength"?at.operators.GT:at.operators.LT,o=s.opts.unicode===!1?(0,at._)`${r}.length`:(0,at._)`${(0,ml.useFunc)(e.gen,yl.default)}(${r})`;e.fail$data((0,at._)`${o} ${i} ${n}`)}};An.default=$l;var Mn={};Object.defineProperty(Mn,"__esModule",{value:!0});const _l=H,Or=B,wl={message:({schemaCode:e})=>(0,Or.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Or._)`{pattern: ${e}}`},vl={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:wl,code(e){const{data:t,$data:r,schema:n,schemaCode:s,it:i}=e,o=i.opts.unicodeRegExp?"u":"",u=r?(0,Or._)`(new RegExp(${s}, ${o}))`:(0,_l.usePattern)(e,n);e.fail$data((0,Or._)`!${u}.test(${t})`)}};Mn.default=vl;var Ln={};Object.defineProperty(Ln,"__esModule",{value:!0});const Gt=B,bl={message({keyword:e,schemaCode:t}){const r=e==="maxProperties"?"more":"fewer";return(0,Gt.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,Gt._)`{limit: ${e}}`},El={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:bl,code(e){const{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?Gt.operators.GT:Gt.operators.LT;e.fail$data((0,Gt._)`Object.keys(${r}).length ${s} ${n}`)}};Ln.default=El;var Fn={};Object.defineProperty(Fn,"__esModule",{value:!0});const Wt=H,Kt=B,Pl=X,Sl={message:({params:{missingProperty:e}})=>(0,Kt.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,Kt._)`{missingProperty: ${e}}`},Tl={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Sl,code(e){const{gen:t,schema:r,schemaCode:n,data:s,$data:i,it:o}=e,{opts:u}=o;if(!i&&r.length===0)return;const f=r.length>=u.loopRequired;if(o.allErrors?l():d(),u.strictRequired){const b=e.parentSchema.properties,{definedProperties:P}=e.it;for(const O of r)if((b==null?void 0:b[O])===void 0&&!P.has(O)){const w=o.schemaEnv.baseId+o.errSchemaPath,g=`required property "${O}" is not defined at "${w}" (strictRequired)`;(0,Pl.checkStrictMode)(o,g,o.opts.strictRequired)}}function l(){if(f||i)e.block$data(Kt.nil,p);else for(const b of r)(0,Wt.checkReportMissingProp)(e,b)}function d(){const b=t.let("missing");if(f||i){const P=t.let("valid",!0);e.block$data(P,()=>_(b,P)),e.ok(P)}else t.if((0,Wt.checkMissingProp)(e,r,b)),(0,Wt.reportMissingProp)(e,b),t.else()}function p(){t.forOf("prop",n,b=>{e.setParams({missingProperty:b}),t.if((0,Wt.noPropertyInData)(t,s,b,u.ownProperties),()=>e.error())})}function _(b,P){e.setParams({missingProperty:b}),t.forOf(b,n,()=>{t.assign(P,(0,Wt.propertyInData)(t,s,b,u.ownProperties)),t.if((0,Kt.not)(P),()=>{e.error(),t.break()})},Kt.nil)}}};Fn.default=Tl;var qn={};Object.defineProperty(qn,"__esModule",{value:!0});const Jt=B,Rl={message({keyword:e,schemaCode:t}){const r=e==="maxItems"?"more":"fewer";return(0,Jt.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,Jt._)`{limit: ${e}}`},kl={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Rl,code(e){const{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?Jt.operators.GT:Jt.operators.LT;e.fail$data((0,Jt._)`${r}.length ${s} ${n}`)}};qn.default=kl;var Un={},nr={};Object.defineProperty(nr,"__esModule",{value:!0});const io=qi;io.code='require("ajv/dist/runtime/equal").default';nr.default=io;Object.defineProperty(Un,"__esModule",{value:!0});const Yr=er,me=B,Ol=X,Cl=nr,Nl={message:({params:{i:e,j:t}})=>(0,me.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,me._)`{i: ${e}, j: ${t}}`},Il={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Nl,code(e){const{gen:t,data:r,$data:n,schema:s,parentSchema:i,schemaCode:o,it:u}=e;if(!n&&!s)return;const f=t.let("valid"),l=i.items?(0,Yr.getSchemaTypes)(i.items):[];e.block$data(f,d,(0,me._)`${o} === false`),e.ok(f);function d(){const P=t.let("i",(0,me._)`${r}.length`),O=t.let("j");e.setParams({i:P,j:O}),t.assign(f,!0),t.if((0,me._)`${P} > 1`,()=>(p()?_:b)(P,O))}function p(){return l.length>0&&!l.some(P=>P==="object"||P==="array")}function _(P,O){const w=t.name("item"),g=(0,Yr.checkDataTypes)(l,w,u.opts.strictNumbers,Yr.DataType.Wrong),$=t.const("indices",(0,me._)`{}`);t.for((0,me._)`;${P}--;`,()=>{t.let(w,(0,me._)`${r}[${P}]`),t.if(g,(0,me._)`continue`),l.length>1&&t.if((0,me._)`typeof ${w} == "string"`,(0,me._)`${w} += "_"`),t.if((0,me._)`typeof ${$}[${w}] == "number"`,()=>{t.assign(O,(0,me._)`${$}[${w}]`),e.error(),t.assign(f,!1).break()}).code((0,me._)`${$}[${w}] = ${P}`)})}function b(P,O){const w=(0,Ol.useFunc)(t,Cl.default),g=t.name("outer");t.label(g).for((0,me._)`;${P}--;`,()=>t.for((0,me._)`${O} = ${P}; ${O}--;`,()=>t.if((0,me._)`${w}(${r}[${P}], ${r}[${O}])`,()=>{e.error(),t.assign(f,!1).break(g)})))}}};Un.default=Il;var zn={};Object.defineProperty(zn,"__esModule",{value:!0});const ln=B,jl=X,Al=nr,Dl={message:"must be equal to constant",params:({schemaCode:e})=>(0,ln._)`{allowedValue: ${e}}`},Ml={keyword:"const",$data:!0,error:Dl,code(e){const{gen:t,data:r,$data:n,schemaCode:s,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,ln._)`!${(0,jl.useFunc)(t,Al.default)}(${r}, ${s})`):e.fail((0,ln._)`${i} !== ${r}`)}};zn.default=Ml;var Vn={};Object.defineProperty(Vn,"__esModule",{value:!0});const xt=B,Ll=X,Fl=nr,ql={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,xt._)`{allowedValues: ${e}}`},Ul={keyword:"enum",schemaType:"array",$data:!0,error:ql,code(e){const{gen:t,data:r,$data:n,schema:s,schemaCode:i,it:o}=e;if(!n&&s.length===0)throw new Error("enum must have non-empty array");const u=s.length>=o.opts.loopEnum;let f;const l=()=>f??(f=(0,Ll.useFunc)(t,Fl.default));let d;if(u||n)d=t.let("valid"),e.block$data(d,p);else{if(!Array.isArray(s))throw new Error("ajv implementation error");const b=t.const("vSchema",i);d=(0,xt.or)(...s.map((P,O)=>_(b,O)))}e.pass(d);function p(){t.assign(d,!1),t.forOf("v",i,b=>t.if((0,xt._)`${l()}(${r}, ${b})`,()=>t.assign(d,!0).break()))}function _(b,P){const O=s[P];return typeof O=="object"&&O!==null?(0,xt._)`${l()}(${r}, ${b}[${P}])`:(0,xt._)`${r} === ${O}`}}};Vn.default=Ul;Object.defineProperty(Nn,"__esModule",{value:!0});const zl=In,Vl=jn,Wl=An,xl=Mn,Hl=Ln,Bl=Fn,Gl=qn,Kl=Un,Jl=zn,Ql=Vn,Yl=[zl.default,Vl.default,Wl.default,xl.default,Hl.default,Bl.default,Gl.default,Kl.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Jl.default,Ql.default];Nn.default=Yl;var Wn={},Ct={};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.validateAdditionalItems=void 0;const ct=B,un=X,Zl={message:({params:{len:e}})=>(0,ct.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,ct._)`{limit: ${e}}`},Xl={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Zl,code(e){const{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,un.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}oo(e,n)}};function oo(e,t){const{gen:r,schema:n,data:s,keyword:i,it:o}=e;o.items=!0;const u=r.const("len",(0,ct._)`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,ct._)`${u} <= ${t.length}`);else if(typeof n=="object"&&!(0,un.alwaysValidSchema)(o,n)){const l=r.var("valid",(0,ct._)`${u} <= ${t.length}`);r.if((0,ct.not)(l),()=>f(l)),e.ok(l)}function f(l){r.forRange("i",t.length,u,d=>{e.subschema({keyword:i,dataProp:d,dataPropType:un.Type.Num},l),o.allErrors||r.if((0,ct.not)(l),()=>r.break())})}}Ct.validateAdditionalItems=oo;Ct.default=Xl;var xn={},Nt={};Object.defineProperty(Nt,"__esModule",{value:!0});Nt.validateTuple=void 0;const Ms=B,$r=X,eu=H,tu={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return ao(e,"additionalItems",t);r.items=!0,!(0,$r.alwaysValidSchema)(r,t)&&e.ok((0,eu.validateArray)(e))}};function ao(e,t,r=e.schema){const{gen:n,parentSchema:s,data:i,keyword:o,it:u}=e;d(s),u.opts.unevaluated&&r.length&&u.items!==!0&&(u.items=$r.mergeEvaluated.items(n,r.length,u.items));const f=n.name("valid"),l=n.const("len",(0,Ms._)`${i}.length`);r.forEach((p,_)=>{(0,$r.alwaysValidSchema)(u,p)||(n.if((0,Ms._)`${l} > ${_}`,()=>e.subschema({keyword:o,schemaProp:_,dataProp:_},f)),e.ok(f))});function d(p){const{opts:_,errSchemaPath:b}=u,P=r.length,O=P===p.minItems&&(P===p.maxItems||p[t]===!1);if(_.strictTuples&&!O){const w=`"${o}" is ${P}-tuple, but minItems or maxItems/${t} are not specified or different at path "${b}"`;(0,$r.checkStrictMode)(u,w,_.strictTuples)}}}Nt.validateTuple=ao;Nt.default=tu;Object.defineProperty(xn,"__esModule",{value:!0});const ru=Nt,nu={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,ru.validateTuple)(e,"items")};xn.default=nu;var Hn={};Object.defineProperty(Hn,"__esModule",{value:!0});const Ls=B,su=X,iu=H,ou=Ct,au={message:({params:{len:e}})=>(0,Ls.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,Ls._)`{limit: ${e}}`},cu={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:au,code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;n.items=!0,!(0,su.alwaysValidSchema)(n,t)&&(s?(0,ou.validateAdditionalItems)(e,s):e.ok((0,iu.validateArray)(e)))}};Hn.default=cu;var Bn={};Object.defineProperty(Bn,"__esModule",{value:!0});const Re=B,lr=X,lu={message:({params:{min:e,max:t}})=>t===void 0?(0,Re.str)`must contain at least ${e} valid item(s)`:(0,Re.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,Re._)`{minContains: ${e}}`:(0,Re._)`{minContains: ${e}, maxContains: ${t}}`},uu={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:lu,code(e){const{gen:t,schema:r,parentSchema:n,data:s,it:i}=e;let o,u;const{minContains:f,maxContains:l}=n;i.opts.next?(o=f===void 0?1:f,u=l):o=1;const d=t.const("len",(0,Re._)`${s}.length`);if(e.setParams({min:o,max:u}),u===void 0&&o===0){(0,lr.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(u!==void 0&&o>u){(0,lr.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,lr.alwaysValidSchema)(i,r)){let O=(0,Re._)`${d} >= ${o}`;u!==void 0&&(O=(0,Re._)`${O} && ${d} <= ${u}`),e.pass(O);return}i.items=!0;const p=t.name("valid");u===void 0&&o===1?b(p,()=>t.if(p,()=>t.break())):o===0?(t.let(p,!0),u!==void 0&&t.if((0,Re._)`${s}.length > 0`,_)):(t.let(p,!1),_()),e.result(p,()=>e.reset());function _(){const O=t.name("_valid"),w=t.let("count",0);b(O,()=>t.if(O,()=>P(w)))}function b(O,w){t.forRange("i",0,d,g=>{e.subschema({keyword:"contains",dataProp:g,dataPropType:lr.Type.Num,compositeRule:!0},O),w()})}function P(O){t.code((0,Re._)`${O}++`),u===void 0?t.if((0,Re._)`${O} >= ${o}`,()=>t.assign(p,!0).break()):(t.if((0,Re._)`${O} > ${u}`,()=>t.assign(p,!1).break()),o===1?t.assign(p,!0):t.if((0,Re._)`${O} >= ${o}`,()=>t.assign(p,!0)))}}};Bn.default=uu;var co={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=B,r=X,n=H;e.error={message:({params:{property:f,depsCount:l,deps:d}})=>{const p=l===1?"property":"properties";return(0,t.str)`must have ${p} ${d} when property ${f} is present`},params:({params:{property:f,depsCount:l,deps:d,missingProperty:p}})=>(0,t._)`{property: ${f},
635
720
  missingProperty: ${p},
636
721
  depsCount: ${l},
637
- deps: ${d}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(f){const[l,d]=i(f);o(f,l),u(f,d)}};function i({schema:f}){const l={},d={};for(const p in f){if(p==="__proto__")continue;const b=Array.isArray(f[p])?l:d;b[p]=f[p]}return[l,d]}function o(f,l=f.schema){const{gen:d,data:p,it:b}=f;if(Object.keys(l).length===0)return;const E=d.let("missing");for(const P in l){const O=l[P];if(O.length===0)continue;const _=(0,n.propertyInData)(d,p,P,b.opts.ownProperties);f.setParams({property:P,depsCount:O.length,deps:O.join(", ")}),b.allErrors?d.if(_,()=>{for(const g of O)(0,n.checkReportMissingProp)(f,g)}):(d.if((0,t._)`${_} && (${(0,n.checkMissingProp)(f,O,E)})`),(0,n.reportMissingProp)(f,E),d.else())}}e.validatePropertyDeps=o;function u(f,l=f.schema){const{gen:d,data:p,keyword:b,it:E}=f,P=d.name("valid");for(const O in l)(0,r.alwaysValidSchema)(E,l[O])||(d.if((0,n.propertyInData)(d,p,O,E.opts.ownProperties),()=>{const _=f.subschema({keyword:b,schemaProp:O},P);f.mergeValidEvaluated(_,P)},()=>d.var(P,!0)),f.ok(P))}e.validateSchemaDeps=u,e.default=s})(io);var Bn={};Object.defineProperty(Bn,"__esModule",{value:!0});const oo=B,lu=X,uu={message:"property name must be valid",params:({params:e})=>(0,oo._)`{propertyName: ${e.propertyName}}`},du={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:uu,code(e){const{gen:t,schema:r,data:n,it:s}=e;if((0,lu.alwaysValidSchema)(s,r))return;const i=t.name("valid");t.forIn("key",n,o=>{e.setParams({propertyName:o}),e.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},i),t.if((0,oo.not)(i),()=>{e.error(!0),s.allErrors||t.break()})}),e.ok(i)}};Bn.default=du;var zr={};Object.defineProperty(zr,"__esModule",{value:!0});const ur=H,Oe=B,fu=We,dr=X,pu={message:"must NOT have additional properties",params:({params:e})=>(0,Oe._)`{additionalProperty: ${e.additionalProperty}}`},hu={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:pu,code(e){const{gen:t,schema:r,parentSchema:n,data:s,errsCount:i,it:o}=e;if(!i)throw new Error("ajv implementation error");const{allErrors:u,opts:f}=o;if(o.props=!0,f.removeAdditional!=="all"&&(0,dr.alwaysValidSchema)(o,r))return;const l=(0,ur.allSchemaProperties)(n.properties),d=(0,ur.allSchemaProperties)(n.patternProperties);p(),e.ok((0,Oe._)`${i} === ${fu.default.errors}`);function p(){t.forIn("key",s,_=>{!l.length&&!d.length?P(_):t.if(b(_),()=>P(_))})}function b(_){let g;if(l.length>8){const $=(0,dr.schemaRefOrVal)(o,n.properties,"properties");g=(0,ur.isOwnProperty)(t,$,_)}else l.length?g=(0,Oe.or)(...l.map($=>(0,Oe._)`${_} === ${$}`)):g=Oe.nil;return d.length&&(g=(0,Oe.or)(g,...d.map($=>(0,Oe._)`${(0,ur.usePattern)(e,$)}.test(${_})`))),(0,Oe.not)(g)}function E(_){t.code((0,Oe._)`delete ${s}[${_}]`)}function P(_){if(f.removeAdditional==="all"||f.removeAdditional&&r===!1){E(_);return}if(r===!1){e.setParams({additionalProperty:_}),e.error(),u||t.break();return}if(typeof r=="object"&&!(0,dr.alwaysValidSchema)(o,r)){const g=t.name("valid");f.removeAdditional==="failing"?(O(_,g,!1),t.if((0,Oe.not)(g),()=>{e.reset(),E(_)})):(O(_,g),u||t.if((0,Oe.not)(g),()=>t.break()))}}function O(_,g,$){const S={keyword:"additionalProperties",dataProp:_,dataPropType:dr.Type.Str};$===!1&&Object.assign(S,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(S,g)}}};zr.default=hu;var Gn={};Object.defineProperty(Gn,"__esModule",{value:!0});const mu=Ne,Ls=H,Zr=X,Fs=zr,yu={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:n,data:s,it:i}=e;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&Fs.default.code(new mu.KeywordCxt(i,Fs.default,"additionalProperties"));const o=(0,Ls.allSchemaProperties)(r);for(const p of o)i.definedProperties.add(p);i.opts.unevaluated&&o.length&&i.props!==!0&&(i.props=Zr.mergeEvaluated.props(t,(0,Zr.toHash)(o),i.props));const u=o.filter(p=>!(0,Zr.alwaysValidSchema)(i,r[p]));if(u.length===0)return;const f=t.name("valid");for(const p of u)l(p)?d(p):(t.if((0,Ls.propertyInData)(t,s,p,i.opts.ownProperties)),d(p),i.allErrors||t.else().var(f,!0),t.endIf()),e.it.definedProperties.add(p),e.ok(f);function l(p){return i.opts.useDefaults&&!i.compositeRule&&r[p].default!==void 0}function d(p){e.subschema({keyword:"properties",schemaProp:p,dataProp:p},f)}}};Gn.default=yu;var Kn={};Object.defineProperty(Kn,"__esModule",{value:!0});const qs=H,fr=B,Us=X,Vs=X,gu={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:n,parentSchema:s,it:i}=e,{opts:o}=i,u=(0,qs.allSchemaProperties)(r),f=u.filter(O=>(0,Us.alwaysValidSchema)(i,r[O]));if(u.length===0||f.length===u.length&&(!i.opts.unevaluated||i.props===!0))return;const l=o.strictSchema&&!o.allowMatchingProperties&&s.properties,d=t.name("valid");i.props!==!0&&!(i.props instanceof fr.Name)&&(i.props=(0,Vs.evaluatedPropsToName)(t,i.props));const{props:p}=i;b();function b(){for(const O of u)l&&E(O),i.allErrors?P(O):(t.var(d,!0),P(O),t.if(d))}function E(O){for(const _ in l)new RegExp(O).test(_)&&(0,Us.checkStrictMode)(i,`property ${_} matches pattern ${O} (use allowMatchingProperties)`)}function P(O){t.forIn("key",n,_=>{t.if((0,fr._)`${(0,qs.usePattern)(e,O)}.test(${_})`,()=>{const g=f.includes(O);g||e.subschema({keyword:"patternProperties",schemaProp:O,dataProp:_,dataPropType:Vs.Type.Str},d),i.opts.unevaluated&&p!==!0?t.assign((0,fr._)`${p}[${_}]`,!0):!g&&!i.allErrors&&t.if((0,fr.not)(d),()=>t.break())})})}}};Kn.default=gu;var Jn={};Object.defineProperty(Jn,"__esModule",{value:!0});const $u=X,_u={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:n}=e;if((0,$u.alwaysValidSchema)(n,r)){e.fail();return}const s=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),e.failResult(s,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Jn.default=_u;var Qn={};Object.defineProperty(Qn,"__esModule",{value:!0});const wu=H,vu={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:wu.validateUnion,error:{message:"must match a schema in anyOf"}};Qn.default=vu;var Yn={};Object.defineProperty(Yn,"__esModule",{value:!0});const _r=B,bu=X,Eu={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,_r._)`{passingSchemas: ${e.passing}}`},Pu={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Eu,code(e){const{gen:t,schema:r,parentSchema:n,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;const i=r,o=t.let("valid",!1),u=t.let("passing",null),f=t.name("_valid");e.setParams({passing:u}),t.block(l),e.result(o,()=>e.reset(),()=>e.error(!0));function l(){i.forEach((d,p)=>{let b;(0,bu.alwaysValidSchema)(s,d)?t.var(f,!0):b=e.subschema({keyword:"oneOf",schemaProp:p,compositeRule:!0},f),p>0&&t.if((0,_r._)`${f} && ${o}`).assign(o,!1).assign(u,(0,_r._)`[${u}, ${p}]`).else(),t.if(f,()=>{t.assign(o,!0),t.assign(u,p),b&&e.mergeEvaluated(b,_r.Name)})})}}};Yn.default=Pu;var Zn={};Object.defineProperty(Zn,"__esModule",{value:!0});const Su=X,Tu={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const s=t.name("valid");r.forEach((i,o)=>{if((0,Su.alwaysValidSchema)(n,i))return;const u=e.subschema({keyword:"allOf",schemaProp:o},s);e.ok(s),e.mergeEvaluated(u)})}};Zn.default=Tu;var Xn={};Object.defineProperty(Xn,"__esModule",{value:!0});const Cr=B,ao=X,Ru={message:({params:e})=>(0,Cr.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Cr._)`{failingKeyword: ${e.ifClause}}`},ku={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Ru,code(e){const{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,ao.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const s=zs(n,"then"),i=zs(n,"else");if(!s&&!i)return;const o=t.let("valid",!0),u=t.name("_valid");if(f(),e.reset(),s&&i){const d=t.let("ifClause");e.setParams({ifClause:d}),t.if(u,l("then",d),l("else",d))}else s?t.if(u,l("then")):t.if((0,Cr.not)(u),l("else"));e.pass(o,()=>e.error(!0));function f(){const d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(d)}function l(d,p){return()=>{const b=e.subschema({keyword:d},u);t.assign(o,u),e.mergeValidEvaluated(b,o),p?t.assign(p,(0,Cr._)`${d}`):e.setParams({ifClause:d})}}}};function zs(e,t){const r=e.schema[t];return r!==void 0&&!(0,ao.alwaysValidSchema)(e,r)}Xn.default=ku;var es={};Object.defineProperty(es,"__esModule",{value:!0});const Ou=X,Cu={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,Ou.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};es.default=Cu;Object.defineProperty(zn,"__esModule",{value:!0});const Nu=Ct,Iu=Wn,ju=Nt,Au=xn,Du=Hn,Mu=io,Lu=Bn,Fu=zr,qu=Gn,Uu=Kn,Vu=Jn,zu=Qn,Wu=Yn,xu=Zn,Hu=Xn,Bu=es;function Gu(e=!1){const t=[Vu.default,zu.default,Wu.default,xu.default,Hu.default,Bu.default,Lu.default,Fu.default,Mu.default,qu.default,Uu.default];return e?t.push(Iu.default,Au.default):t.push(Nu.default,ju.default),t.push(Du.default),t}zn.default=Gu;var ts={},rs={};Object.defineProperty(rs,"__esModule",{value:!0});const le=B,Ku={message:({schemaCode:e})=>(0,le.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,le._)`{format: ${e}}`},Ju={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Ku,code(e,t){const{gen:r,data:n,$data:s,schema:i,schemaCode:o,it:u}=e,{opts:f,errSchemaPath:l,schemaEnv:d,self:p}=u;if(!f.validateFormats)return;s?b():E();function b(){const P=r.scopeValue("formats",{ref:p.formats,code:f.code.formats}),O=r.const("fDef",(0,le._)`${P}[${o}]`),_=r.let("fType"),g=r.let("format");r.if((0,le._)`typeof ${O} == "object" && !(${O} instanceof RegExp)`,()=>r.assign(_,(0,le._)`${O}.type || "string"`).assign(g,(0,le._)`${O}.validate`),()=>r.assign(_,(0,le._)`"string"`).assign(g,O)),e.fail$data((0,le.or)($(),S()));function $(){return f.strictSchema===!1?le.nil:(0,le._)`${o} && !${g}`}function S(){const I=d.$async?(0,le._)`(${O}.async ? await ${g}(${n}) : ${g}(${n}))`:(0,le._)`${g}(${n})`,D=(0,le._)`(typeof ${g} == "function" ? ${I} : ${g}.test(${n}))`;return(0,le._)`${g} && ${g} !== true && ${_} === ${t} && !${D}`}}function E(){const P=p.formats[i];if(!P){$();return}if(P===!0)return;const[O,_,g]=S(P);O===t&&e.pass(I());function $(){if(f.strictSchema===!1){p.logger.warn(D());return}throw new Error(D());function D(){return`unknown format "${i}" ignored in schema at path "${l}"`}}function S(D){const v=D instanceof RegExp?(0,le.regexpCode)(D):f.code.formats?(0,le._)`${f.code.formats}${(0,le.getProperty)(i)}`:void 0,C=r.scopeValue("formats",{key:i,ref:D,code:v});return typeof D=="object"&&!(D instanceof RegExp)?[D.type||"string",D.validate,(0,le._)`${C}.validate`]:["string",D,C]}function I(){if(typeof P=="object"&&!(P instanceof RegExp)&&P.async){if(!d.$async)throw new Error("async format in sync schema");return(0,le._)`await ${g}(${n})`}return typeof _=="function"?(0,le._)`${g}(${n})`:(0,le._)`${g}.test(${n})`}}}};rs.default=Ju;Object.defineProperty(ts,"__esModule",{value:!0});const Qu=rs,Yu=[Qu.default];ts.default=Yu;var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.contentVocabulary=Ot.metadataVocabulary=void 0;Ot.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Ot.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(Rn,"__esModule",{value:!0});const Zu=kn,Xu=Cn,ed=zn,td=ts,Ws=Ot,rd=[Zu.default,Xu.default,(0,ed.default)(),td.default,Ws.metadataVocabulary,Ws.contentVocabulary];Rn.default=rd;var ns={},co={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,function(t){t.Tag="tag",t.Mapping="mapping"}(e.DiscrError||(e.DiscrError={}))})(co);Object.defineProperty(ns,"__esModule",{value:!0});const Pt=B,dn=co,xs=ve,nd=X,sd={message:({params:{discrError:e,tagName:t}})=>e===dn.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Pt._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},id={keyword:"discriminator",type:"object",schemaType:"object",error:sd,code(e){const{gen:t,data:r,schema:n,parentSchema:s,it:i}=e,{oneOf:o}=s;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");const u=n.propertyName;if(typeof u!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");const f=t.let("valid",!1),l=t.const("tag",(0,Pt._)`${r}${(0,Pt.getProperty)(u)}`);t.if((0,Pt._)`typeof ${l} == "string"`,()=>d(),()=>e.error(!1,{discrError:dn.DiscrError.Tag,tag:l,tagName:u})),e.ok(f);function d(){const E=b();t.if(!1);for(const P in E)t.elseIf((0,Pt._)`${l} === ${P}`),t.assign(f,p(E[P]));t.else(),e.error(!1,{discrError:dn.DiscrError.Mapping,tag:l,tagName:u}),t.endIf()}function p(E){const P=t.name("valid"),O=e.subschema({keyword:"oneOf",schemaProp:E},P);return e.mergeEvaluated(O,Pt.Name),P}function b(){var E;const P={},O=g(s);let _=!0;for(let I=0;I<o.length;I++){let D=o[I];D!=null&&D.$ref&&!(0,nd.schemaHasRulesButRef)(D,i.self.RULES)&&(D=xs.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,D==null?void 0:D.$ref),D instanceof xs.SchemaEnv&&(D=D.schema));const v=(E=D==null?void 0:D.properties)===null||E===void 0?void 0:E[u];if(typeof v!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${u}"`);_=_&&(O||g(D)),$(v,I)}if(!_)throw new Error(`discriminator: "${u}" must be required`);return P;function g({required:I}){return Array.isArray(I)&&I.includes(u)}function $(I,D){if(I.const)S(I.const,D);else if(I.enum)for(const v of I.enum)S(v,D);else throw new Error(`discriminator: "properties/${u}" must have "const" or "enum"`)}function S(I,D){if(typeof I!="string"||I in P)throw new Error(`discriminator: "${u}" values must be unique strings`);P[I]=D}}}};ns.default=id;const od="http://json-schema.org/draft-07/schema#",ad="http://json-schema.org/draft-07/schema#",cd="Core schema meta-schema",ld={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:[]}},ud=["object","boolean"],dd={$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:"#"}},fd={$schema:od,$id:ad,title:cd,definitions:ld,type:ud,properties:dd,default:!0};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const r=ki,n=Rn,s=ns,i=fd,o=["/properties"],u="http://json-schema.org/draft-07/schema";class f extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(P=>this.addVocabulary(P)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const P=this.opts.$data?this.$dataMetaSchema(i,o):i;this.addMetaSchema(P,u,!1),this.refs["http://json-schema.org/schema"]=u}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}}e.exports=t=f,Object.defineProperty(t,"__esModule",{value:!0}),t.default=f;var l=Ne;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var d=B;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var p=tr;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return p.default}});var b=rr;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return b.default}})})(sn,sn.exports);var pd=sn.exports;const hd=ua(pd),md="http://json-schema.org/schema",yd="#/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.",deprecated:"Use meta.description instead."},meta:{type:"object",properties:{title:{type:"string",description:"A clear and concise name for your Blueprint."},description:{type:"string",description:"A brief explanation of what your Blueprint offers."},author:{type:"string",description:"A GitHub username of the author of this Blueprint."},categories:{type:"array",items:{type:"string"},description:"Relevant categories to help users find your Blueprint in the future Blueprints section on WordPress.org."}},required:["title","author"],additionalProperties:!1,description:"Optional metadata. Used by the Blueprints gallery at https://github.com/WordPress/blueprints"},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",enum:["kitchen-sink","light"]},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:"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 in wp-config.php. Possible values are:
722
+ deps: ${d}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(f){const[l,d]=i(f);o(f,l),u(f,d)}};function i({schema:f}){const l={},d={};for(const p in f){if(p==="__proto__")continue;const _=Array.isArray(f[p])?l:d;_[p]=f[p]}return[l,d]}function o(f,l=f.schema){const{gen:d,data:p,it:_}=f;if(Object.keys(l).length===0)return;const b=d.let("missing");for(const P in l){const O=l[P];if(O.length===0)continue;const w=(0,n.propertyInData)(d,p,P,_.opts.ownProperties);f.setParams({property:P,depsCount:O.length,deps:O.join(", ")}),_.allErrors?d.if(w,()=>{for(const g of O)(0,n.checkReportMissingProp)(f,g)}):(d.if((0,t._)`${w} && (${(0,n.checkMissingProp)(f,O,b)})`),(0,n.reportMissingProp)(f,b),d.else())}}e.validatePropertyDeps=o;function u(f,l=f.schema){const{gen:d,data:p,keyword:_,it:b}=f,P=d.name("valid");for(const O in l)(0,r.alwaysValidSchema)(b,l[O])||(d.if((0,n.propertyInData)(d,p,O,b.opts.ownProperties),()=>{const w=f.subschema({keyword:_,schemaProp:O},P);f.mergeValidEvaluated(w,P)},()=>d.var(P,!0)),f.ok(P))}e.validateSchemaDeps=u,e.default=s})(co);var Gn={};Object.defineProperty(Gn,"__esModule",{value:!0});const lo=B,du=X,fu={message:"property name must be valid",params:({params:e})=>(0,lo._)`{propertyName: ${e.propertyName}}`},pu={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:fu,code(e){const{gen:t,schema:r,data:n,it:s}=e;if((0,du.alwaysValidSchema)(s,r))return;const i=t.name("valid");t.forIn("key",n,o=>{e.setParams({propertyName:o}),e.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},i),t.if((0,lo.not)(i),()=>{e.error(!0),s.allErrors||t.break()})}),e.ok(i)}};Gn.default=pu;var Vr={};Object.defineProperty(Vr,"__esModule",{value:!0});const ur=H,Oe=B,hu=We,dr=X,mu={message:"must NOT have additional properties",params:({params:e})=>(0,Oe._)`{additionalProperty: ${e.additionalProperty}}`},yu={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:mu,code(e){const{gen:t,schema:r,parentSchema:n,data:s,errsCount:i,it:o}=e;if(!i)throw new Error("ajv implementation error");const{allErrors:u,opts:f}=o;if(o.props=!0,f.removeAdditional!=="all"&&(0,dr.alwaysValidSchema)(o,r))return;const l=(0,ur.allSchemaProperties)(n.properties),d=(0,ur.allSchemaProperties)(n.patternProperties);p(),e.ok((0,Oe._)`${i} === ${hu.default.errors}`);function p(){t.forIn("key",s,w=>{!l.length&&!d.length?P(w):t.if(_(w),()=>P(w))})}function _(w){let g;if(l.length>8){const $=(0,dr.schemaRefOrVal)(o,n.properties,"properties");g=(0,ur.isOwnProperty)(t,$,w)}else l.length?g=(0,Oe.or)(...l.map($=>(0,Oe._)`${w} === ${$}`)):g=Oe.nil;return d.length&&(g=(0,Oe.or)(g,...d.map($=>(0,Oe._)`${(0,ur.usePattern)(e,$)}.test(${w})`))),(0,Oe.not)(g)}function b(w){t.code((0,Oe._)`delete ${s}[${w}]`)}function P(w){if(f.removeAdditional==="all"||f.removeAdditional&&r===!1){b(w);return}if(r===!1){e.setParams({additionalProperty:w}),e.error(),u||t.break();return}if(typeof r=="object"&&!(0,dr.alwaysValidSchema)(o,r)){const g=t.name("valid");f.removeAdditional==="failing"?(O(w,g,!1),t.if((0,Oe.not)(g),()=>{e.reset(),b(w)})):(O(w,g),u||t.if((0,Oe.not)(g),()=>t.break()))}}function O(w,g,$){const S={keyword:"additionalProperties",dataProp:w,dataPropType:dr.Type.Str};$===!1&&Object.assign(S,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(S,g)}}};Vr.default=yu;var Kn={};Object.defineProperty(Kn,"__esModule",{value:!0});const gu=Ne,Fs=H,Zr=X,qs=Vr,$u={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:n,data:s,it:i}=e;i.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&qs.default.code(new gu.KeywordCxt(i,qs.default,"additionalProperties"));const o=(0,Fs.allSchemaProperties)(r);for(const p of o)i.definedProperties.add(p);i.opts.unevaluated&&o.length&&i.props!==!0&&(i.props=Zr.mergeEvaluated.props(t,(0,Zr.toHash)(o),i.props));const u=o.filter(p=>!(0,Zr.alwaysValidSchema)(i,r[p]));if(u.length===0)return;const f=t.name("valid");for(const p of u)l(p)?d(p):(t.if((0,Fs.propertyInData)(t,s,p,i.opts.ownProperties)),d(p),i.allErrors||t.else().var(f,!0),t.endIf()),e.it.definedProperties.add(p),e.ok(f);function l(p){return i.opts.useDefaults&&!i.compositeRule&&r[p].default!==void 0}function d(p){e.subschema({keyword:"properties",schemaProp:p,dataProp:p},f)}}};Kn.default=$u;var Jn={};Object.defineProperty(Jn,"__esModule",{value:!0});const Us=H,fr=B,zs=X,Vs=X,_u={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:n,parentSchema:s,it:i}=e,{opts:o}=i,u=(0,Us.allSchemaProperties)(r),f=u.filter(O=>(0,zs.alwaysValidSchema)(i,r[O]));if(u.length===0||f.length===u.length&&(!i.opts.unevaluated||i.props===!0))return;const l=o.strictSchema&&!o.allowMatchingProperties&&s.properties,d=t.name("valid");i.props!==!0&&!(i.props instanceof fr.Name)&&(i.props=(0,Vs.evaluatedPropsToName)(t,i.props));const{props:p}=i;_();function _(){for(const O of u)l&&b(O),i.allErrors?P(O):(t.var(d,!0),P(O),t.if(d))}function b(O){for(const w in l)new RegExp(O).test(w)&&(0,zs.checkStrictMode)(i,`property ${w} matches pattern ${O} (use allowMatchingProperties)`)}function P(O){t.forIn("key",n,w=>{t.if((0,fr._)`${(0,Us.usePattern)(e,O)}.test(${w})`,()=>{const g=f.includes(O);g||e.subschema({keyword:"patternProperties",schemaProp:O,dataProp:w,dataPropType:Vs.Type.Str},d),i.opts.unevaluated&&p!==!0?t.assign((0,fr._)`${p}[${w}]`,!0):!g&&!i.allErrors&&t.if((0,fr.not)(d),()=>t.break())})})}}};Jn.default=_u;var Qn={};Object.defineProperty(Qn,"__esModule",{value:!0});const wu=X,vu={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:n}=e;if((0,wu.alwaysValidSchema)(n,r)){e.fail();return}const s=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),e.failResult(s,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Qn.default=vu;var Yn={};Object.defineProperty(Yn,"__esModule",{value:!0});const bu=H,Eu={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:bu.validateUnion,error:{message:"must match a schema in anyOf"}};Yn.default=Eu;var Zn={};Object.defineProperty(Zn,"__esModule",{value:!0});const _r=B,Pu=X,Su={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,_r._)`{passingSchemas: ${e.passing}}`},Tu={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Su,code(e){const{gen:t,schema:r,parentSchema:n,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;const i=r,o=t.let("valid",!1),u=t.let("passing",null),f=t.name("_valid");e.setParams({passing:u}),t.block(l),e.result(o,()=>e.reset(),()=>e.error(!0));function l(){i.forEach((d,p)=>{let _;(0,Pu.alwaysValidSchema)(s,d)?t.var(f,!0):_=e.subschema({keyword:"oneOf",schemaProp:p,compositeRule:!0},f),p>0&&t.if((0,_r._)`${f} && ${o}`).assign(o,!1).assign(u,(0,_r._)`[${u}, ${p}]`).else(),t.if(f,()=>{t.assign(o,!0),t.assign(u,p),_&&e.mergeEvaluated(_,_r.Name)})})}}};Zn.default=Tu;var Xn={};Object.defineProperty(Xn,"__esModule",{value:!0});const Ru=X,ku={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const s=t.name("valid");r.forEach((i,o)=>{if((0,Ru.alwaysValidSchema)(n,i))return;const u=e.subschema({keyword:"allOf",schemaProp:o},s);e.ok(s),e.mergeEvaluated(u)})}};Xn.default=ku;var es={};Object.defineProperty(es,"__esModule",{value:!0});const Cr=B,uo=X,Ou={message:({params:e})=>(0,Cr.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Cr._)`{failingKeyword: ${e.ifClause}}`},Cu={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Ou,code(e){const{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,uo.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const s=Ws(n,"then"),i=Ws(n,"else");if(!s&&!i)return;const o=t.let("valid",!0),u=t.name("_valid");if(f(),e.reset(),s&&i){const d=t.let("ifClause");e.setParams({ifClause:d}),t.if(u,l("then",d),l("else",d))}else s?t.if(u,l("then")):t.if((0,Cr.not)(u),l("else"));e.pass(o,()=>e.error(!0));function f(){const d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(d)}function l(d,p){return()=>{const _=e.subschema({keyword:d},u);t.assign(o,u),e.mergeValidEvaluated(_,o),p?t.assign(p,(0,Cr._)`${d}`):e.setParams({ifClause:d})}}}};function Ws(e,t){const r=e.schema[t];return r!==void 0&&!(0,uo.alwaysValidSchema)(e,r)}es.default=Cu;var ts={};Object.defineProperty(ts,"__esModule",{value:!0});const Nu=X,Iu={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,Nu.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};ts.default=Iu;Object.defineProperty(Wn,"__esModule",{value:!0});const ju=Ct,Au=xn,Du=Nt,Mu=Hn,Lu=Bn,Fu=co,qu=Gn,Uu=Vr,zu=Kn,Vu=Jn,Wu=Qn,xu=Yn,Hu=Zn,Bu=Xn,Gu=es,Ku=ts;function Ju(e=!1){const t=[Wu.default,xu.default,Hu.default,Bu.default,Gu.default,Ku.default,qu.default,Uu.default,Fu.default,zu.default,Vu.default];return e?t.push(Au.default,Mu.default):t.push(ju.default,Du.default),t.push(Lu.default),t}Wn.default=Ju;var rs={},ns={};Object.defineProperty(ns,"__esModule",{value:!0});const ue=B,Qu={message:({schemaCode:e})=>(0,ue.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,ue._)`{format: ${e}}`},Yu={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Qu,code(e,t){const{gen:r,data:n,$data:s,schema:i,schemaCode:o,it:u}=e,{opts:f,errSchemaPath:l,schemaEnv:d,self:p}=u;if(!f.validateFormats)return;s?_():b();function _(){const P=r.scopeValue("formats",{ref:p.formats,code:f.code.formats}),O=r.const("fDef",(0,ue._)`${P}[${o}]`),w=r.let("fType"),g=r.let("format");r.if((0,ue._)`typeof ${O} == "object" && !(${O} instanceof RegExp)`,()=>r.assign(w,(0,ue._)`${O}.type || "string"`).assign(g,(0,ue._)`${O}.validate`),()=>r.assign(w,(0,ue._)`"string"`).assign(g,O)),e.fail$data((0,ue.or)($(),S()));function $(){return f.strictSchema===!1?ue.nil:(0,ue._)`${o} && !${g}`}function S(){const I=d.$async?(0,ue._)`(${O}.async ? await ${g}(${n}) : ${g}(${n}))`:(0,ue._)`${g}(${n})`,D=(0,ue._)`(typeof ${g} == "function" ? ${I} : ${g}.test(${n}))`;return(0,ue._)`${g} && ${g} !== true && ${w} === ${t} && !${D}`}}function b(){const P=p.formats[i];if(!P){$();return}if(P===!0)return;const[O,w,g]=S(P);O===t&&e.pass(I());function $(){if(f.strictSchema===!1){p.logger.warn(D());return}throw new Error(D());function D(){return`unknown format "${i}" ignored in schema at path "${l}"`}}function S(D){const E=D instanceof RegExp?(0,ue.regexpCode)(D):f.code.formats?(0,ue._)`${f.code.formats}${(0,ue.getProperty)(i)}`:void 0,C=r.scopeValue("formats",{key:i,ref:D,code:E});return typeof D=="object"&&!(D instanceof RegExp)?[D.type||"string",D.validate,(0,ue._)`${C}.validate`]:["string",D,C]}function I(){if(typeof P=="object"&&!(P instanceof RegExp)&&P.async){if(!d.$async)throw new Error("async format in sync schema");return(0,ue._)`await ${g}(${n})`}return typeof w=="function"?(0,ue._)`${g}(${n})`:(0,ue._)`${g}.test(${n})`}}}};ns.default=Yu;Object.defineProperty(rs,"__esModule",{value:!0});const Zu=ns,Xu=[Zu.default];rs.default=Xu;var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.contentVocabulary=Ot.metadataVocabulary=void 0;Ot.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Ot.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(kn,"__esModule",{value:!0});const ed=On,td=Nn,rd=Wn,nd=rs,xs=Ot,sd=[ed.default,td.default,(0,rd.default)(),nd.default,xs.metadataVocabulary,xs.contentVocabulary];kn.default=sd;var ss={},fo={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,function(t){t.Tag="tag",t.Mapping="mapping"}(e.DiscrError||(e.DiscrError={}))})(fo);Object.defineProperty(ss,"__esModule",{value:!0});const Pt=B,dn=fo,Hs=ve,id=X,od={message:({params:{discrError:e,tagName:t}})=>e===dn.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Pt._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},ad={keyword:"discriminator",type:"object",schemaType:"object",error:od,code(e){const{gen:t,data:r,schema:n,parentSchema:s,it:i}=e,{oneOf:o}=s;if(!i.opts.discriminator)throw new Error("discriminator: requires discriminator option");const u=n.propertyName;if(typeof u!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");const f=t.let("valid",!1),l=t.const("tag",(0,Pt._)`${r}${(0,Pt.getProperty)(u)}`);t.if((0,Pt._)`typeof ${l} == "string"`,()=>d(),()=>e.error(!1,{discrError:dn.DiscrError.Tag,tag:l,tagName:u})),e.ok(f);function d(){const b=_();t.if(!1);for(const P in b)t.elseIf((0,Pt._)`${l} === ${P}`),t.assign(f,p(b[P]));t.else(),e.error(!1,{discrError:dn.DiscrError.Mapping,tag:l,tagName:u}),t.endIf()}function p(b){const P=t.name("valid"),O=e.subschema({keyword:"oneOf",schemaProp:b},P);return e.mergeEvaluated(O,Pt.Name),P}function _(){var b;const P={},O=g(s);let w=!0;for(let I=0;I<o.length;I++){let D=o[I];D!=null&&D.$ref&&!(0,id.schemaHasRulesButRef)(D,i.self.RULES)&&(D=Hs.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,D==null?void 0:D.$ref),D instanceof Hs.SchemaEnv&&(D=D.schema));const E=(b=D==null?void 0:D.properties)===null||b===void 0?void 0:b[u];if(typeof E!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${u}"`);w=w&&(O||g(D)),$(E,I)}if(!w)throw new Error(`discriminator: "${u}" must be required`);return P;function g({required:I}){return Array.isArray(I)&&I.includes(u)}function $(I,D){if(I.const)S(I.const,D);else if(I.enum)for(const E of I.enum)S(E,D);else throw new Error(`discriminator: "properties/${u}" must have "const" or "enum"`)}function S(I,D){if(typeof I!="string"||I in P)throw new Error(`discriminator: "${u}" values must be unique strings`);P[I]=D}}}};ss.default=ad;const cd="http://json-schema.org/draft-07/schema#",ld="http://json-schema.org/draft-07/schema#",ud="Core schema meta-schema",dd={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:[]}},fd=["object","boolean"],pd={$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:"#"}},hd={$schema:cd,$id:ld,title:ud,definitions:dd,type:fd,properties:pd,default:!0};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const r=Ni,n=kn,s=ss,i=hd,o=["/properties"],u="http://json-schema.org/draft-07/schema";class f extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(P=>this.addVocabulary(P)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const P=this.opts.$data?this.$dataMetaSchema(i,o):i;this.addMetaSchema(P,u,!1),this.refs["http://json-schema.org/schema"]=u}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}}e.exports=t=f,Object.defineProperty(t,"__esModule",{value:!0}),t.default=f;var l=Ne;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var d=B;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var p=tr;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return p.default}});var _=rr;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return _.default}})})(sn,sn.exports);var md=sn.exports;const yd=fa(md),gd="http://json-schema.org/schema",$d="#/definitions/Blueprint",_d={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.",deprecated:"Use meta.description instead."},meta:{type:"object",properties:{title:{type:"string",description:"A clear and concise name for your Blueprint."},description:{type:"string",description:"A brief explanation of what your Blueprint offers."},author:{type:"string",description:"A GitHub username of the author of this Blueprint."},categories:{type:"array",items:{type:"string"},description:"Relevant categories to help users find your Blueprint in the future Blueprints section on WordPress.org."}},required:["title","author"],additionalProperties:!1,description:"Optional metadata. Used by the Blueprints gallery at https://github.com/WordPress/blueprints"},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"},plugins:{type:"array",items:{anyOf:[{type:"string"},{$ref:"#/definitions/FileReference"}]},description:"WordPress plugins to install and activate"},siteOptions:{type:"object",additionalProperties:{type:"string"},properties:{blogname:{type:"string",description:"The site title"}},description:"WordPress site options to define"},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",enum:["kitchen-sink","light"]},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:"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 in wp-config.php. Possible values are:
638
723
 
639
724
  - 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.
640
725
 
641
726
  - 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.
642
727
  This option is only kept in here to avoid breaking Blueprint schema validation
643
- 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:"enableMultisite"}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"importWxr"},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},ifAlreadyInstalled:{type:"string",enum:["overwrite","skip","error"],description:"What to do if the asset already exists."},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},ifAlreadyInstalled:{type:"string",enum:["overwrite","skip","error"],description:"What to do if the asset already exists."},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:"resetData"}},required:["step"]},{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:"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"},zipFile:{$ref:"#/definitions/FileReference",description:"The zip file to extract"},zipPath:{type:"string",description:"The path of the zip file to extract",deprecated:"Use zipFile instead."},extractToPath:{type:"string",description:"The path to extract the zip file to"}},required:["extractToPath","step"]},{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"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"wp-cli",description:"The step identifier."},command:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:"The WP CLI command to run."},wpCliPath:{type:"string",description:"wp-cli.phar path"}},required:["command","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."},body:{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"}},{type:"object",additionalProperties:{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"}},{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:"Request body. If an object is given, the request will be encoded as multipart and sent with a `multipart/form-data` header."}},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:{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:"Request body."},env:{type:"object",additionalProperties:{type:"string"},description:"Environment variables to set for this run."},$_SERVER:{type:"object",additionalProperties:{type:"string"},description:"$_SERVER entries to set for this run."},code:{type:"string",description:"The code snippet to eval instead of a php file."}},additionalProperties:!1},WordPressInstallationOptions:{type:"object",properties:{adminUsername:{type:"string"},adminPassword:{type:"string"}},additionalProperties:!1}},$d={$schema:md,$ref:yd,definitions:gd},{wpCLI:_d,...Hs}=ra,wd={...Hs,"wp-cli":_d,importFile:Hs.importWxr};function lo(e,{progress:t=new Lr,semaphore:r=new Ao({concurrency:3}),onStepCompleted:n=()=>{}}={}){var p,b,E,P,O,_,g;e={...e,steps:(e.steps||[]).filter(Sd).filter(Td)};for(const $ of e.steps)typeof $=="object"&&$.step==="importFile"&&($.step="importWxr",ye.warn('The "importFile" step is deprecated. Use "importWxr" instead.'));if(e.constants&&e.steps.unshift({step:"defineWpConfigConsts",consts:e.constants}),e.siteOptions&&e.steps.unshift({step:"setSiteOptions",options:e.siteOptions}),e.plugins){const $=e.plugins.map(S=>typeof S=="string"?S.startsWith("https://")?{resource:"url",url:S}:{resource:"wordpress.org/plugins",slug:S}:S).map(S=>({step:"installPlugin",pluginZipFile:S}));e.steps.unshift(...$)}e.login&&e.steps.push({step:"login",...e.login===!0?{username:"admin",password:"password"}:e.login}),e.phpExtensionBundles||(e.phpExtensionBundles=[]),e.phpExtensionBundles||(e.phpExtensionBundles=[]),e.phpExtensionBundles.length===0&&e.phpExtensionBundles.push("kitchen-sink");const s=(p=e.steps)==null?void 0:p.findIndex($=>typeof $=="object"&&($==null?void 0:$.step)==="wp-cli");s!==void 0&&s>-1&&(e.phpExtensionBundles.includes("light")&&(e.phpExtensionBundles=e.phpExtensionBundles.filter($=>$!=="light"),ye.warn("The wpCli step used in your Blueprint requires the iconv and mbstring PHP extensions. However, you did not specify the kitchen-sink extension bundle. Playground will override your choice and load the kitchen-sink PHP extensions bundle to prevent the WP-CLI step from failing. ")),(b=e.steps)==null||b.splice(s,0,{step:"writeFile",data:{resource:"url",url:"https://playground.wordpress.net/wp-cli.phar"},path:"/tmp/wp-cli.phar"}));const i=(E=e.steps)==null?void 0:E.findIndex($=>typeof $=="object"&&($==null?void 0:$.step)==="importWxr");i!==void 0&&i>-1&&(e.phpExtensionBundles.includes("light")&&(e.phpExtensionBundles=e.phpExtensionBundles.filter($=>$!=="light"),ye.warn("The importWxr step used in your Blueprint requires the iconv and mbstring PHP extensions. However, you did not specify the kitchen-sink extension bundle. Playground will override your choice and load the kitchen-sink PHP extensions bundle to prevent the WP-CLI step from failing. ")),(P=e.steps)==null||P.splice(i,0,{step:"installPlugin",pluginZipFile:{resource:"url",url:"https://playground.wordpress.net/wordpress-importer.zip",caption:"Downloading the WordPress Importer plugin"}}));const{valid:o,errors:u}=bd(e);if(!o){const $=new Error(`Invalid blueprint: ${u[0].message} at ${u[0].instancePath}`);throw $.errors=u,$}const f=e.steps||[],l=f.reduce(($,S)=>{var I;return $+(((I=S.progress)==null?void 0:I.weight)||1)},0),d=f.map($=>Rd($,{semaphore:r,rootProgressTracker:t,totalProgressWeight:l}));return{versions:{php:Ed((O=e.preferredVersions)==null?void 0:O.php,Fr,Pi),wp:((_=e.preferredVersions)==null?void 0:_.wp)||"latest"},phpExtensions:Pd([],e.phpExtensionBundles||[]),features:{networking:((g=e.features)==null?void 0:g.networking)??!1},run:async $=>{try{for(const{resources:S}of d)for(const I of S)I.setPlayground($),I.isAsync&&I.resolve();for(const[S,{run:I,step:D}]of Object.entries(d))try{const v=await I($);n(v,D)}catch(v){throw ye.error(v),new Error(`Error when executing the blueprint step #${S} (${JSON.stringify(D)}) ${v instanceof Error?`: ${v.message}`:v}`,{cause:v})}}finally{try{await $.goTo(e.landingPage||"/")}catch{}t.finish()}}}}const vd=new hd({discriminator:!0});let pr;function bd(e){var s;pr=vd.compile($d);const t=pr(e);if(t)return{valid:t};const r=new Set;for(const i of pr.errors)i.schemaPath.startsWith("#/properties/steps/items/anyOf")||r.add(i.instancePath);const n=(s=pr.errors)==null?void 0:s.filter(i=>!(i.schemaPath.startsWith("#/properties/steps/items/anyOf")&&r.has(i.instancePath)));return{valid:t,errors:n}}function Ed(e,t,r){return e&&t.includes(e)?e:r}function Pd(e,t){const r=Si.filter(s=>e.includes(s)),n=t.flatMap(s=>s in Ss?Ss[s]:[]);return Array.from(new Set([...r,...n]))}function Sd(e){return!!(typeof e=="object"&&e)}function Td(e){return["setPhpIniEntry","request"].includes(e.step)?(ye.warn(`The "${e.step}" Blueprint is no longer supported and you can remove it from your Blueprint.`),!1):!0}function Rd(e,{semaphore:t,rootProgressTracker:r,totalProgressWeight:n}){var d;const s=r.stage((((d=e.progress)==null?void 0:d.weight)||1)/n),i={};for(const p of Object.keys(e)){let b=e[p];ha(b)&&(b=ft.create(b,{semaphore:t})),i[p]=b}const o=async p=>{var b;try{return s.fillSlowly(),await wd[e.step](p,await kd(i),{tracker:s,initialCaption:(b=e.progress)==null?void 0:b.caption})}finally{s.finish()}},u=Bs(i),f=Bs(i).filter(p=>p.isAsync),l=1/(f.length+1);for(const p of f)p.progress=s.stage(l);return{run:o,step:e,resources:u}}function Bs(e){const t=[];for(const r in e){const n=e[r];n instanceof ft&&t.push(n)}return t}async function kd(e){const t={};for(const r in e){const n=e[r];n instanceof ft?t[r]=await n.resolve():t[r]=n}return t}async function uo(e,t){await e.run(t)}function Od(){}/**
728
+ 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:"enableMultisite"}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"importWxr"},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:"importThemeStarterContent",description:"The step identifier."},themeSlug:{type:"string",description:"The name of the theme to import content from."}},required:["step","themeSlug"]},{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},ifAlreadyInstalled:{type:"string",enum:["overwrite","skip","error"],description:"What to do if the asset already exists."},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},ifAlreadyInstalled:{type:"string",enum:["overwrite","skip","error"],description:"What to do if the asset already exists."},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."},importStarterContent:{type:"boolean",description:"Whether to import the theme's starter content 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:"resetData"}},required:["step"]},{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:"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"},zipFile:{$ref:"#/definitions/FileReference",description:"The zip file to extract"},zipPath:{type:"string",description:"The path of the zip file to extract",deprecated:"Use zipFile instead."},extractToPath:{type:"string",description:"The path to extract the zip file to"}},required:["extractToPath","step"]},{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"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"wp-cli",description:"The step identifier."},command:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:"The WP CLI command to run."},wpCliPath:{type:"string",description:"wp-cli.phar path"}},required:["command","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"setSiteLanguage"},language:{type:"string",description:"The language to set, e.g. 'en_US'"}},required:["language","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."},body:{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"}},{type:"object",additionalProperties:{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"}},{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:"Request body. If an object is given, the request will be encoded as multipart and sent with a `multipart/form-data` header."}},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:{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:"Request body."},env:{type:"object",additionalProperties:{type:"string"},description:"Environment variables to set for this run."},$_SERVER:{type:"object",additionalProperties:{type:"string"},description:"$_SERVER entries to set for this run."},code:{type:"string",description:"The code snippet to eval instead of a php file."}},additionalProperties:!1},WordPressInstallationOptions:{type:"object",properties:{adminUsername:{type:"string"},adminPassword:{type:"string"}},additionalProperties:!1}},wd={$schema:gd,$ref:$d,definitions:_d},{wpCLI:vd,...Bs}=sa,bd={...Bs,"wp-cli":vd,importFile:Bs.importWxr};function po(e,{progress:t=new Lr,semaphore:r=new Lo({concurrency:3}),onStepCompleted:n=()=>{}}={}){var p,_,b,P,O,w,g;e={...e,steps:(e.steps||[]).filter(Rd).filter(kd)};for(const $ of e.steps)typeof $=="object"&&$.step==="importFile"&&($.step="importWxr",he.warn('The "importFile" step is deprecated. Use "importWxr" instead.'));if(e.constants&&e.steps.unshift({step:"defineWpConfigConsts",consts:e.constants}),e.siteOptions&&e.steps.unshift({step:"setSiteOptions",options:e.siteOptions}),e.plugins){const $=e.plugins.map(S=>typeof S=="string"?S.startsWith("https://")?{resource:"url",url:S}:{resource:"wordpress.org/plugins",slug:S}:S).map(S=>({step:"installPlugin",pluginZipFile:S}));e.steps.unshift(...$)}e.login&&e.steps.push({step:"login",...e.login===!0?{username:"admin",password:"password"}:e.login}),e.phpExtensionBundles||(e.phpExtensionBundles=[]),e.phpExtensionBundles||(e.phpExtensionBundles=[]),e.phpExtensionBundles.length===0&&e.phpExtensionBundles.push("kitchen-sink");const s=(p=e.steps)==null?void 0:p.findIndex($=>typeof $=="object"&&($==null?void 0:$.step)==="wp-cli");s!==void 0&&s>-1&&(e.phpExtensionBundles.includes("light")&&(e.phpExtensionBundles=e.phpExtensionBundles.filter($=>$!=="light"),he.warn("The wpCli step used in your Blueprint requires the iconv and mbstring PHP extensions. However, you did not specify the kitchen-sink extension bundle. Playground will override your choice and load the kitchen-sink PHP extensions bundle to prevent the WP-CLI step from failing. ")),(_=e.steps)==null||_.splice(s,0,{step:"writeFile",data:{resource:"url",url:"https://playground.wordpress.net/wp-cli.phar"},path:"/tmp/wp-cli.phar"}));const i=(b=e.steps)==null?void 0:b.findIndex($=>typeof $=="object"&&($==null?void 0:$.step)==="importWxr");i!==void 0&&i>-1&&(e.phpExtensionBundles.includes("light")&&(e.phpExtensionBundles=e.phpExtensionBundles.filter($=>$!=="light"),he.warn("The importWxr step used in your Blueprint requires the iconv and mbstring PHP extensions. However, you did not specify the kitchen-sink extension bundle. Playground will override your choice and load the kitchen-sink PHP extensions bundle to prevent the WP-CLI step from failing. ")),(P=e.steps)==null||P.splice(i,0,{step:"installPlugin",pluginZipFile:{resource:"url",url:"https://playground.wordpress.net/wordpress-importer.zip",caption:"Downloading the WordPress Importer plugin"}}));const{valid:o,errors:u}=Pd(e);if(!o){const $=new Error(`Invalid blueprint: ${u[0].message} at ${u[0].instancePath}`);throw $.errors=u,$}const f=e.steps||[],l=f.reduce(($,S)=>{var I;return $+(((I=S.progress)==null?void 0:I.weight)||1)},0),d=f.map($=>Od($,{semaphore:r,rootProgressTracker:t,totalProgressWeight:l}));return{versions:{php:Sd((O=e.preferredVersions)==null?void 0:O.php,Fr,Ri),wp:((w=e.preferredVersions)==null?void 0:w.wp)||"latest"},phpExtensions:Td([],e.phpExtensionBundles||[]),features:{networking:((g=e.features)==null?void 0:g.networking)??!1},run:async $=>{try{for(const{resources:S}of d)for(const I of S)I.setPlayground($),I.isAsync&&I.resolve();for(const[S,{run:I,step:D}]of Object.entries(d))try{const E=await I($);n(E,D)}catch(E){throw he.error(E),new Error(`Error when executing the blueprint step #${S} (${JSON.stringify(D)}) ${E instanceof Error?`: ${E.message}`:E}`,{cause:E})}}finally{try{await $.goTo(e.landingPage||"/")}catch{}t.finish()}}}}const Ed=new yd({discriminator:!0});let pr;function Pd(e){var s;pr=Ed.compile(wd);const t=pr(e);if(t)return{valid:t};const r=new Set;for(const i of pr.errors)i.schemaPath.startsWith("#/properties/steps/items/anyOf")||r.add(i.instancePath);const n=(s=pr.errors)==null?void 0:s.filter(i=>!(i.schemaPath.startsWith("#/properties/steps/items/anyOf")&&r.has(i.instancePath)));return{valid:t,errors:n}}function Sd(e,t,r){return e&&t.includes(e)?e:r}function Td(e,t){const r=ki.filter(s=>e.includes(s)),n=t.flatMap(s=>s in Ts?Ts[s]:[]);return Array.from(new Set([...r,...n]))}function Rd(e){return!!(typeof e=="object"&&e)}function kd(e){return["setPhpIniEntry","request"].includes(e.step)?(he.warn(`The "${e.step}" Blueprint is no longer supported and you can remove it from your Blueprint.`),!1):!0}function Od(e,{semaphore:t,rootProgressTracker:r,totalProgressWeight:n}){var d;const s=r.stage((((d=e.progress)==null?void 0:d.weight)||1)/n),i={};for(const p of Object.keys(e)){let _=e[p];ya(_)&&(_=ft.create(_,{semaphore:t})),i[p]=_}const o=async p=>{var _;try{return s.fillSlowly(),await bd[e.step](p,await Cd(i),{tracker:s,initialCaption:(_=e.progress)==null?void 0:_.caption})}finally{s.finish()}},u=Gs(i),f=Gs(i).filter(p=>p.isAsync),l=1/(f.length+1);for(const p of f)p.progress=s.stage(l);return{run:o,step:e,resources:u}}function Gs(e){const t=[];for(const r in e){const n=e[r];n instanceof ft&&t.push(n)}return t}async function Cd(e){const t={};for(const r in e){const n=e[r];n instanceof ft?t[r]=await n.resolve():t[r]=n}return t}async function ho(e,t){await e.run(t)}function Nd(){}/**
644
729
  * @license
645
730
  * Copyright 2019 Google LLC
646
731
  * SPDX-License-Identifier: Apache-2.0
647
- */const fo=Symbol("Comlink.proxy"),Cd=Symbol("Comlink.endpoint"),Nd=Symbol("Comlink.releaseProxy"),Xr=Symbol("Comlink.finalizer"),wr=Symbol("Comlink.thrown"),po=e=>typeof e=="object"&&e!==null||typeof e=="function",Id={canHandle:e=>po(e)&&e[fo],serialize(e){const{port1:t,port2:r}=new MessageChannel;return ss(e,t),[r,[r]]},deserialize(e){return e.start(),is(e)}},jd={canHandle:e=>po(e)&&wr in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},Tt=new Map([["proxy",Id],["throw",jd]]);function Ad(e,t){for(const r of e)if(t===r||r==="*"||r instanceof RegExp&&r.test(t))return!0;return!1}function ss(e,t=globalThis,r=["*"]){t.addEventListener("message",function n(s){if(!s||!s.data)return;if(!Ad(r,s.origin)){console.warn(`Invalid origin '${s.origin}' for comlink proxy`);return}const{id:i,type:o,path:u}=Object.assign({path:[]},s.data),f=(s.data.argumentList||[]).map(lt);let l;try{const d=u.slice(0,-1).reduce((b,E)=>b[E],e),p=u.reduce((b,E)=>b[E],e);switch(o){case"GET":l=p;break;case"SET":d[u.slice(-1)[0]]=lt(s.data.value),l=!0;break;case"APPLY":l=p.apply(d,f);break;case"CONSTRUCT":{const b=new p(...f);l=go(b)}break;case"ENDPOINT":{const{port1:b,port2:E}=new MessageChannel;ss(e,E),l=qd(b,[b])}break;case"RELEASE":l=void 0;break;default:return}}catch(d){l={value:d,[wr]:0}}Promise.resolve(l).catch(d=>({value:d,[wr]:0})).then(d=>{const[p,b]=jr(d);t.postMessage(Object.assign(Object.assign({},p),{id:i}),b),o==="RELEASE"&&(t.removeEventListener("message",n),ho(t),Xr in e&&typeof e[Xr]=="function"&&e[Xr]())}).catch(d=>{const[p,b]=jr({value:new TypeError("Unserializable return value"),[wr]:0});t.postMessage(Object.assign(Object.assign({},p),{id:i}),b)})}),t.start&&t.start()}function Dd(e){return e.constructor.name==="MessagePort"}function ho(e){Dd(e)&&e.close()}function is(e,t){return fn(e,[],t)}function hr(e){if(e)throw new Error("Proxy has been released and is not useable")}function mo(e){return St(e,{type:"RELEASE"}).then(()=>{ho(e)})}const Nr=new WeakMap,Ir="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(Nr.get(e)||0)-1;Nr.set(e,t),t===0&&mo(e)});function Md(e,t){const r=(Nr.get(t)||0)+1;Nr.set(t,r),Ir&&Ir.register(e,t,e)}function Ld(e){Ir&&Ir.unregister(e)}function fn(e,t=[],r=function(){}){let n=!1;const s=new Proxy(r,{get(i,o){if(hr(n),o===Nd)return()=>{Ld(s),mo(e),n=!0};if(o==="then"){if(t.length===0)return{then:()=>s};const u=St(e,{type:"GET",path:t.map(f=>f.toString())}).then(lt);return u.then.bind(u)}return fn(e,[...t,o])},set(i,o,u){hr(n);const[f,l]=jr(u);return St(e,{type:"SET",path:[...t,o].map(d=>d.toString()),value:f},l).then(lt)},apply(i,o,u){hr(n);const f=t[t.length-1];if(f===Cd)return St(e,{type:"ENDPOINT"}).then(lt);if(f==="bind")return fn(e,t.slice(0,-1));const[l,d]=Gs(u);return St(e,{type:"APPLY",path:t.map(p=>p.toString()),argumentList:l},d).then(lt)},construct(i,o){hr(n);const[u,f]=Gs(o);return St(e,{type:"CONSTRUCT",path:t.map(l=>l.toString()),argumentList:u},f).then(lt)}});return Md(s,e),s}function Fd(e){return Array.prototype.concat.apply([],e)}function Gs(e){const t=e.map(jr);return[t.map(r=>r[0]),Fd(t.map(r=>r[1]))]}const yo=new WeakMap;function qd(e,t){return yo.set(e,t),e}function go(e){return Object.assign(e,{[fo]:!0})}function Ud(e,t=globalThis,r="*"){return{postMessage:(n,s)=>e.postMessage(n,r,s),addEventListener:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t)}}function jr(e){for(const[t,r]of Tt)if(r.canHandle(e)){const[n,s]=r.serialize(e);return[{type:"HANDLER",name:t,value:n},s]}return[{type:"RAW",value:e},yo.get(e)||[]]}function lt(e){switch(e.type){case"HANDLER":return Tt.get(e.name).deserialize(e.value);case"RAW":return e.value}}function St(e,t,r){return new Promise(n=>{const s=Vd();e.addEventListener("message",function i(o){!o.data||!o.data.id||o.data.id!==s||(e.removeEventListener("message",i),n(o.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:s},t),r)})}function Vd(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}function $o(e,t=void 0){Wd();const r=e instanceof Worker?e:Ud(e,t),n=is(r),s=_o(n);return new Proxy(s,{get:(i,o)=>o==="isConnected"?async()=>{for(;;)try{await zd(n.isConnected(),200);break}catch{}}:n[o]})}async function zd(e,t){return new Promise((r,n)=>{setTimeout(n,t),e.then(r)})}let Ks=!1;function Wd(){if(Ks)return;Ks=!0,Tt.set("EVENT",{canHandle:r=>r instanceof CustomEvent,serialize:r=>[{detail:r.detail},[]],deserialize:r=>r}),Tt.set("FUNCTION",{canHandle:r=>typeof r=="function",serialize(r){const{port1:n,port2:s}=new MessageChannel;return ss(r,n),[s,[s]]},deserialize(r){return r.start(),is(r)}}),Tt.set("PHPResponse",{canHandle:r=>typeof r=="object"&&r!==null&&"headers"in r&&"bytes"in r&&"errors"in r&&"exitCode"in r&&"httpStatusCode"in r,serialize(r){return[r.toRawData(),[]]},deserialize(r){return Sr.fromRawData(r)}});const e=Tt.get("throw"),t=e==null?void 0:e.serialize;e.serialize=({value:r})=>{const n=t({value:r});return r.response&&(n[0].value.response=r.response),r.source&&(n[0].value.source=r.source),n}}function _o(e){return new Proxy(e,{get(t,r){switch(typeof t[r]){case"function":return(...n)=>t[r](...n);case"object":return t[r]===null?t[r]:_o(t[r]);case"undefined":case"number":case"string":return t[r];default:return go(t[r])}}})}async function wo({iframe:e,blueprint:t,remoteUrl:r,progressTracker:n=new Lr,disableProgressBar:s,onBlueprintStepCompleted:i,onClientConnected:o=()=>{},sapiName:u,onBeforeBlueprint:f,siteSlug:l}){if(Hd(r),xd(e),r=en(r,{progressbar:!s}),n.setCaption("Preparing WordPress"),!t){const b=await Js(e,en(r,{"php-extension":"kitchen-sink","site-slug":l}),n);return o(b),b}const d=lo(t,{progress:n.stage(.5),onStepCompleted:i}),p=await Js(e,en(r,{php:d.versions.php,wp:d.versions.wp,"sapi-name":u,"php-extension":d.phpExtensions,networking:d.features.networking?"yes":"no","site-slug":l}),n);return Bo(ye,p),o(p),f&&await f(),await uo(d,p),n.finish(),p}function xd(e){var t,r;(t=e.sandbox)!=null&&t.length&&!((r=e.sandbox)!=null&&r.contains("allow-storage-access-by-user-activation"))&&e.sandbox.add("allow-storage-access-by-user-activation")}async function Js(e,t,r){await new Promise(i=>{e.src=t,e.addEventListener("load",i,!1)});const n=$o(e.contentWindow,e.ownerDocument.defaultView);await n.isConnected(),r.pipe(n);const s=r.stage();return await n.onDownloadProgress(s.loadingListener),await n.isReady(),s.finish(),n}const vr="https://playground.wordpress.net";function Hd(e){const t=new URL(e,vr);if((t.origin===vr||t.hostname==="localhost")&&t.pathname!=="/remote.html")throw new Error(`Invalid remote URL: ${t}. Expected origin to be ${vr}/remote.html.`)}function en(e,t){const r=new URL(e,vr),n=new URLSearchParams(r.search);for(const[s,i]of Object.entries(t))if(i!=null&&i!==!1)if(Array.isArray(i))for(const o of i)n.append(s,o.toString());else n.set(s,i.toString());return r.search=n.toString(),r.toString()}async function Bd(e,t){if(ye.warn("`connectPlayground` is deprecated and will be removed. Use `startPlayground` instead."),t!=null&&t.loadRemote)return wo({iframe:e,remoteUrl:t.loadRemote});const r=$o(e.contentWindow,e.ownerDocument.defaultView);return await r.isConnected(),r}exports.LatestSupportedPHPVersion=Pi;exports.SupportedPHPVersions=Fr;exports.SupportedPHPVersionsList=fa;exports.activatePlugin=Ar;exports.activateTheme=hn;exports.compileBlueprint=lo;exports.connectPlayground=Bd;exports.cp=ci;exports.defineSiteUrl=$n;exports.defineWpConfigConsts=Qt;exports.enableMultisite=ai;exports.exportWXR=hi;exports.importWordPressFiles=pi;exports.importWxr=fi;exports.installPlugin=yi;exports.installTheme=gi;exports.login=Er;exports.mkdir=ui;exports.mv=li;exports.phpVar=pe;exports.phpVars=Zt;exports.request=br;exports.resetData=$i;exports.rm=mn;exports.rmdir=di;exports.runBlueprintSteps=uo;exports.runPHP=ri;exports.runPHPWithOptions=ni;exports.runSql=si;exports.runWpInstallationWizard=_i;exports.setPhpIniEntries=da;exports.setPluginProxyURL=Od;exports.setSiteOptions=yn;exports.startPlaygroundWeb=wo;exports.unzip=Dr;exports.updateUserMeta=ii;exports.wpCLI=vi;exports.wpContentFilesExcludedFromExport=pn;exports.writeFile=gn;exports.zipWpContent=wi;
732
+ */const mo=Symbol("Comlink.proxy"),Id=Symbol("Comlink.endpoint"),jd=Symbol("Comlink.releaseProxy"),Xr=Symbol("Comlink.finalizer"),wr=Symbol("Comlink.thrown"),yo=e=>typeof e=="object"&&e!==null||typeof e=="function",Ad={canHandle:e=>yo(e)&&e[mo],serialize(e){const{port1:t,port2:r}=new MessageChannel;return is(e,t),[r,[r]]},deserialize(e){return e.start(),os(e)}},Dd={canHandle:e=>yo(e)&&wr in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},Tt=new Map([["proxy",Ad],["throw",Dd]]);function Md(e,t){for(const r of e)if(t===r||r==="*"||r instanceof RegExp&&r.test(t))return!0;return!1}function is(e,t=globalThis,r=["*"]){t.addEventListener("message",function n(s){if(!s||!s.data)return;if(!Md(r,s.origin)){console.warn(`Invalid origin '${s.origin}' for comlink proxy`);return}const{id:i,type:o,path:u}=Object.assign({path:[]},s.data),f=(s.data.argumentList||[]).map(lt);let l;try{const d=u.slice(0,-1).reduce((_,b)=>_[b],e),p=u.reduce((_,b)=>_[b],e);switch(o){case"GET":l=p;break;case"SET":d[u.slice(-1)[0]]=lt(s.data.value),l=!0;break;case"APPLY":l=p.apply(d,f);break;case"CONSTRUCT":{const _=new p(...f);l=wo(_)}break;case"ENDPOINT":{const{port1:_,port2:b}=new MessageChannel;is(e,b),l=zd(_,[_])}break;case"RELEASE":l=void 0;break;default:return}}catch(d){l={value:d,[wr]:0}}Promise.resolve(l).catch(d=>({value:d,[wr]:0})).then(d=>{const[p,_]=jr(d);t.postMessage(Object.assign(Object.assign({},p),{id:i}),_),o==="RELEASE"&&(t.removeEventListener("message",n),go(t),Xr in e&&typeof e[Xr]=="function"&&e[Xr]())}).catch(d=>{const[p,_]=jr({value:new TypeError("Unserializable return value"),[wr]:0});t.postMessage(Object.assign(Object.assign({},p),{id:i}),_)})}),t.start&&t.start()}function Ld(e){return e.constructor.name==="MessagePort"}function go(e){Ld(e)&&e.close()}function os(e,t){return fn(e,[],t)}function hr(e){if(e)throw new Error("Proxy has been released and is not useable")}function $o(e){return St(e,{type:"RELEASE"}).then(()=>{go(e)})}const Nr=new WeakMap,Ir="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(Nr.get(e)||0)-1;Nr.set(e,t),t===0&&$o(e)});function Fd(e,t){const r=(Nr.get(t)||0)+1;Nr.set(t,r),Ir&&Ir.register(e,t,e)}function qd(e){Ir&&Ir.unregister(e)}function fn(e,t=[],r=function(){}){let n=!1;const s=new Proxy(r,{get(i,o){if(hr(n),o===jd)return()=>{qd(s),$o(e),n=!0};if(o==="then"){if(t.length===0)return{then:()=>s};const u=St(e,{type:"GET",path:t.map(f=>f.toString())}).then(lt);return u.then.bind(u)}return fn(e,[...t,o])},set(i,o,u){hr(n);const[f,l]=jr(u);return St(e,{type:"SET",path:[...t,o].map(d=>d.toString()),value:f},l).then(lt)},apply(i,o,u){hr(n);const f=t[t.length-1];if(f===Id)return St(e,{type:"ENDPOINT"}).then(lt);if(f==="bind")return fn(e,t.slice(0,-1));const[l,d]=Ks(u);return St(e,{type:"APPLY",path:t.map(p=>p.toString()),argumentList:l},d).then(lt)},construct(i,o){hr(n);const[u,f]=Ks(o);return St(e,{type:"CONSTRUCT",path:t.map(l=>l.toString()),argumentList:u},f).then(lt)}});return Fd(s,e),s}function Ud(e){return Array.prototype.concat.apply([],e)}function Ks(e){const t=e.map(jr);return[t.map(r=>r[0]),Ud(t.map(r=>r[1]))]}const _o=new WeakMap;function zd(e,t){return _o.set(e,t),e}function wo(e){return Object.assign(e,{[mo]:!0})}function Vd(e,t=globalThis,r="*"){return{postMessage:(n,s)=>e.postMessage(n,r,s),addEventListener:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t)}}function jr(e){for(const[t,r]of Tt)if(r.canHandle(e)){const[n,s]=r.serialize(e);return[{type:"HANDLER",name:t,value:n},s]}return[{type:"RAW",value:e},_o.get(e)||[]]}function lt(e){switch(e.type){case"HANDLER":return Tt.get(e.name).deserialize(e.value);case"RAW":return e.value}}function St(e,t,r){return new Promise(n=>{const s=Wd();e.addEventListener("message",function i(o){!o.data||!o.data.id||o.data.id!==s||(e.removeEventListener("message",i),n(o.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:s},t),r)})}function Wd(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}function vo(e,t=void 0){Hd();const r=e instanceof Worker?e:Vd(e,t),n=os(r),s=bo(n);return new Proxy(s,{get:(i,o)=>o==="isConnected"?async()=>{for(;;)try{await xd(n.isConnected(),200);break}catch{}}:n[o]})}async function xd(e,t){return new Promise((r,n)=>{setTimeout(n,t),e.then(r)})}let Js=!1;function Hd(){if(Js)return;Js=!0,Tt.set("EVENT",{canHandle:r=>r instanceof CustomEvent,serialize:r=>[{detail:r.detail},[]],deserialize:r=>r}),Tt.set("FUNCTION",{canHandle:r=>typeof r=="function",serialize(r){const{port1:n,port2:s}=new MessageChannel;return is(r,n),[s,[s]]},deserialize(r){return r.start(),os(r)}}),Tt.set("PHPResponse",{canHandle:r=>typeof r=="object"&&r!==null&&"headers"in r&&"bytes"in r&&"errors"in r&&"exitCode"in r&&"httpStatusCode"in r,serialize(r){return[r.toRawData(),[]]},deserialize(r){return Sr.fromRawData(r)}});const e=Tt.get("throw"),t=e==null?void 0:e.serialize;e.serialize=({value:r})=>{const n=t({value:r});return r.response&&(n[0].value.response=r.response),r.source&&(n[0].value.source=r.source),n}}function bo(e){return new Proxy(e,{get(t,r){switch(typeof t[r]){case"function":return(...n)=>t[r](...n);case"object":return t[r]===null?t[r]:bo(t[r]);case"undefined":case"number":case"string":return t[r];default:return wo(t[r])}}})}async function Eo({iframe:e,blueprint:t,remoteUrl:r,progressTracker:n=new Lr,disableProgressBar:s,onBlueprintStepCompleted:i,onClientConnected:o=()=>{},sapiName:u,onBeforeBlueprint:f,siteSlug:l}){if(Gd(r),Bd(e),r=en(r,{progressbar:!s}),n.setCaption("Preparing WordPress"),!t){const _=await Qs(e,en(r,{"php-extension":"kitchen-sink","site-slug":l}),n);return o(_),_}const d=po(t,{progress:n.stage(.5),onStepCompleted:i}),p=await Qs(e,en(r,{php:d.versions.php,wp:d.versions.wp,"sapi-name":u,"php-extension":d.phpExtensions,networking:d.features.networking?"yes":"no","site-slug":l}),n);return Jo(he,p),o(p),f&&await f(),await ho(d,p),n.finish(),p}function Bd(e){var t,r;(t=e.sandbox)!=null&&t.length&&!((r=e.sandbox)!=null&&r.contains("allow-storage-access-by-user-activation"))&&e.sandbox.add("allow-storage-access-by-user-activation")}async function Qs(e,t,r){await new Promise(i=>{e.src=t,e.addEventListener("load",i,!1)});const n=vo(e.contentWindow,e.ownerDocument.defaultView);await n.isConnected(),r.pipe(n);const s=r.stage();return await n.onDownloadProgress(s.loadingListener),await n.isReady(),s.finish(),n}const vr="https://playground.wordpress.net";function Gd(e){const t=new URL(e,vr);if((t.origin===vr||t.hostname==="localhost")&&t.pathname!=="/remote.html")throw new Error(`Invalid remote URL: ${t}. Expected origin to be ${vr}/remote.html.`)}function en(e,t){const r=new URL(e,vr),n=new URLSearchParams(r.search);for(const[s,i]of Object.entries(t))if(i!=null&&i!==!1)if(Array.isArray(i))for(const o of i)n.append(s,o.toString());else n.set(s,i.toString());return r.search=n.toString(),r.toString()}async function Kd(e,t){if(he.warn("`connectPlayground` is deprecated and will be removed. Use `startPlayground` instead."),t!=null&&t.loadRemote)return Eo({iframe:e,remoteUrl:t.loadRemote});const r=vo(e.contentWindow,e.ownerDocument.defaultView);return await r.isConnected(),r}exports.LatestSupportedPHPVersion=Ri;exports.SupportedPHPVersions=Fr;exports.SupportedPHPVersionsList=ha;exports.activatePlugin=Ar;exports.activateTheme=hn;exports.compileBlueprint=po;exports.connectPlayground=Kd;exports.cp=li;exports.defineSiteUrl=$n;exports.defineWpConfigConsts=Qt;exports.enableMultisite=ci;exports.exportWXR=yi;exports.importThemeStarterContent=_n;exports.importWordPressFiles=mi;exports.importWxr=pi;exports.installPlugin=$i;exports.installTheme=_i;exports.login=Er;exports.mkdir=di;exports.mv=ui;exports.phpVar=ae;exports.phpVars=Zt;exports.request=br;exports.resetData=wi;exports.rm=mn;exports.rmdir=fi;exports.runBlueprintSteps=ho;exports.runPHP=ni;exports.runPHPWithOptions=si;exports.runSql=ii;exports.runWpInstallationWizard=vi;exports.setPhpIniEntries=pa;exports.setPluginProxyURL=Nd;exports.setSiteLanguage=Pi;exports.setSiteOptions=yn;exports.startPlaygroundWeb=Eo;exports.unzip=Dr;exports.updateUserMeta=oi;exports.wpCLI=Ei;exports.wpContentFilesExcludedFromExport=pn;exports.writeFile=gn;exports.zipWpContent=bi;