@wp-playground/client 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +16 -16
- package/index.js +414 -413
- package/package.json +2 -2
package/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var En=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var H=(e,t,r)=>(En(e,t,"read from private field"),r?r.call(e):t.get(e)),ee=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},pe=(e,t,r,n)=>(En(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);var
|
|
1
|
+
"use strict";var En=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var H=(e,t,r)=>(En(e,t,"read from private field"),r?r.call(e):t.get(e)),ee=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},pe=(e,t,r,n)=>(En(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);var we=(e,t,r)=>(En(e,t,"access private method"),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});if(typeof File>"u"){class e extends Blob{constructor(r,n,s){super(r);let i;s!=null&&s.lastModified&&(i=new Date),(!i||isNaN(i.getFullYear()))&&(i=new Date),this.lastModifiedDate=i,this.lastModified=i.getMilliseconds(),this.name=n||""}}global.File=e}function Ni(e){return new Promise(function(t,r){e.onload=e.onerror=function(n){e.onload=e.onerror=null,n.type==="load"?t(e.result):r(new Error("Failed to read the blob/file"))}})}typeof Blob.prototype.arrayBuffer>"u"&&(Blob.prototype.arrayBuffer=function(){const t=new FileReader;return t.readAsArrayBuffer(this),Ni(t)});typeof Blob.prototype.text>"u"&&(Blob.prototype.text=function(){const t=new FileReader;return t.readAsText(this),Ni(t)});function Oa(){const e=new Uint8Array([1,2,3,4]),r=new File([e],"test").stream();try{return r.getReader({mode:"byob"}),r.getReader({mode:"byob"}),!0}catch{return!1}}(typeof Blob.prototype.stream>"u"||!Oa())&&(Blob.prototype.stream=function(){let e=0;const t=this;return new ReadableStream({type:"bytes",autoAllocateChunkSize:512*1024,async pull(r){const n=r.byobRequest.view,i=await t.slice(e,e+n.byteLength).arrayBuffer(),o=new Uint8Array(i);new Uint8Array(n.buffer).set(o);const l=o.byteLength;r.byobRequest.respond(l),e+=l,e>=t.size&&r.close()}})});if(typeof CustomEvent>"u"){class e extends Event{constructor(r,n={}){super(r,n),this.detail=n.detail}initCustomEvent(){}}globalThis.CustomEvent=e}const Ks=`<?php
|
|
2
2
|
|
|
3
3
|
function zipDir($root, $output, $options = array())
|
|
4
4
|
{
|
|
@@ -441,7 +441,7 @@ if (defined('USE_FETCH_FOR_REQUESTS') && USE_FETCH_FOR_REQUESTS) {
|
|
|
441
441
|
srcDoc: undefined
|
|
442
442
|
})
|
|
443
443
|
)
|
|
444
|
-
});`;for(const s of r)await e.fileExists(s)&&await dr(e,s,i=>`${n} ${i.replace(/\(\s*"iframe",/,"(__playground_ControlledIframe,")}`);await e.writeFile(`${t}/wp-includes/empty.html`,"<!doctype html><script>const hash = window.location.hash.substring(1); if ( hash ) document.write(decodeURIComponent(hash))<\/script>")}const Ai=async(e,{code:t})=>await e.run({code:t}),Di=async(e,{options:t})=>await e.run(t),Wn=async(e,{path:t})=>{await e.unlink(t)};class xn{constructor({concurrency:t}){this._running=0,this.concurrency=t,this.queue=[]}get running(){return this._running}async acquire(){for(;;)if(this._running>=this.concurrency)await new Promise(t=>this.queue.push(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
|
|
444
|
+
});`;for(const s of r)await e.fileExists(s)&&await dr(e,s,i=>`${n} ${i.replace(/\(\s*"iframe",/,"(__playground_ControlledIframe,")}`);await e.writeFile(`${t}/wp-includes/empty.html`,"<!doctype html><script>const hash = window.location.hash.substring(1); if ( hash ) document.write(decodeURIComponent(hash))<\/script>")}const Ai=async(e,{code:t})=>await e.run({code:t}),Di=async(e,{options:t})=>await e.run(t),Wn=async(e,{path:t})=>{await e.unlink(t)};class xn{constructor({concurrency:t}){this._running=0,this.concurrency=t,this.queue=[]}get running(){return this._running}async acquire(){for(;;)if(this._running>=this.concurrency)await new Promise(t=>this.queue.push(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 ye(...e){let t=e.join("/");const r=t[0]==="/",n=t.substring(t.length-1)==="/";return t=Fi(t),!t&&!r&&(t="."),t&&n&&(t+="/"),t}function Aa(e){if(e==="/")return"/";e=Fi(e);const t=e.lastIndexOf("/");return t===-1?"":t===0?"/":e.substr(0,t)}function Fi(e){const t=e[0]==="/";return e=Da(e.split("/").filter(r=>!!r),!t).join("/"),(t?"/":"")+e.replace(/\/$/,"")}function Da(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 Gt(e){return`json_decode(base64_decode('${Fa(JSON.stringify(e))}'), true)`}function mn(e){const t={};for(const r in e)t[r]=Gt(e[r]);return t}function Fa(e){return qa(new TextEncoder().encode(e))}function qa(e){const t=String.fromCodePoint(...e);return btoa(t)}const qi=async(e,{sql:t},r)=>{r==null||r.tracker.setCaption("Executing SQL Queries");const n=`/tmp/${crypto.randomUUID()}.sql`;await e.writeFile(n,new Uint8Array(await t.arrayBuffer()));const s=await e.documentRoot,i=mn({docroot:s,sqlFilename:n}),o=await e.run({code:`<?php
|
|
445
445
|
require_once ${i.docroot} . '/wp-load.php';
|
|
446
446
|
|
|
447
447
|
$handle = fopen(${i.sqlFilename}, 'r');
|
|
@@ -460,10 +460,10 @@ if (defined('USE_FETCH_FOR_REQUESTS') && USE_FETCH_FOR_REQUESTS) {
|
|
|
460
460
|
$wpdb->query($buffer);
|
|
461
461
|
$buffer = '';
|
|
462
462
|
}
|
|
463
|
-
`});return await Wn(e,{path:n}),o},Mi=async(e,{key:t,value:r})=>{await e.setPhpIniEntry(t,r)},Ui=async(e,{request:t})=>await e.request(t),Li=async(e,{fromPath:t,toPath:r})=>{await e.writeFile(r,await e.readFileAsBuffer(t))},zi=async(e,{fromPath:t,toPath:r})=>{await e.mv(t,r)},Hi=async(e,{path:t})=>{await e.mkdir(t)},Vi=async(e,{path:t})=>{await e.rmdir(t)},Bn=async(e,{path:t,data:r})=>{r instanceof File&&(r=await Ca(r)),await e.writeFile(t,r)},Wi=async(e,{siteUrl:t})=>{await Lt(e,{consts:{WP_HOME:t,WP_SITEURL:t}})},xi=async(e,{file:t})=>{var l;const r=await e.request({url:"/wp-admin/admin.php?import=wordpress"}),n=(l=Gs(r).getElementById("import-upload-form"))==null?void 0:l.getAttribute("action"),s=await e.request({url:`/wp-admin/${n}`,method:"POST",files:{import:t}}),i=Gs(s).querySelector("#wpbody-content form");if(!i)throw console.log(s.text),new Error("Could not find an importer form in response. See the response text above for details.");const o=Ma(i);o.fetch_attachments="1";for(const
|
|
463
|
+
`});return await Wn(e,{path:n}),o},Mi=async(e,{key:t,value:r})=>{await e.setPhpIniEntry(t,r)},Ui=async(e,{request:t})=>await e.request(t),Li=async(e,{fromPath:t,toPath:r})=>{await e.writeFile(r,await e.readFileAsBuffer(t))},zi=async(e,{fromPath:t,toPath:r})=>{await e.mv(t,r)},Hi=async(e,{path:t})=>{await e.mkdir(t)},Vi=async(e,{path:t})=>{await e.rmdir(t)},Bn=async(e,{path:t,data:r})=>{r instanceof File&&(r=await Ca(r)),await e.writeFile(t,r)},Wi=async(e,{siteUrl:t})=>{await Lt(e,{consts:{WP_HOME:t,WP_SITEURL:t}})},xi=async(e,{file:t})=>{var l;const r=await e.request({url:"/wp-admin/admin.php?import=wordpress"}),n=(l=Gs(r).getElementById("import-upload-form"))==null?void 0:l.getAttribute("action"),s=await e.request({url:`/wp-admin/${n}`,method:"POST",files:{import:t}}),i=Gs(s).querySelector("#wpbody-content form");if(!i)throw console.log(s.text),new Error("Could not find an importer form in response. See the response text above for details.");const o=Ma(i);o.fetch_attachments="1";for(const d in o)if(d.startsWith("user_map[")){const u="user_new["+d.slice(9,-1)+"]";o[u]="1"}await e.request({url:i.action,method:"POST",formData:o})};function Gs(e){return new DOMParser().parseFromString(e.text,"text/html")}function Ma(e){return Object.fromEntries(new FormData(e).entries())}const yn=async(e,{zipPath:t,extractToPath:r})=>{const n=mn({zipPath:t,extractToPath:r});await ki(e,`unzip(${n.zipPath}, ${n.extractToPath});`)},Bi=async(e,{wordPressFilesZip:t,pathInZip:r=""})=>{const n="/import.zip";await e.writeFile(n,new Uint8Array(await t.arrayBuffer()));const s=await e.documentRoot;let i=ye("/tmp","import");await e.mkdir(i),await yn(e,{zipPath:n,extractToPath:i}),await e.unlink(n),i=ye(i,r);const o=ye(i,"wp-content"),l=ye(s,"wp-content");for(const h of zn){const _=ye(o,h);await Js(e,_);const T=ye(l,h);await e.fileExists(T)&&(await e.mkdir(Aa(_)),await e.mv(T,_))}const d=ye(i,"wp-content","database");await e.fileExists(d)||await e.mv(ye(s,"wp-content","database"),d);const u=await e.listFiles(i);for(const h of u)await Js(e,ye(s,h)),await e.mv(ye(i,h),ye(s,h));await e.rmdir(i);const p=Gt(ye(s,"wp-admin","upgrade.php"));await e.run({code:`<?php
|
|
464
464
|
$_GET['step'] = 'upgrade_db';
|
|
465
|
-
require ${
|
|
466
|
-
`})};async function Js(e,t){await e.fileExists(t)&&(await e.isDir(t)?await e.rmdir(t):await e.unlink(t))}async function Ki(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){const t=await e.request({url:"/wp-admin/export.php?download=true&content=all&export_wxz=1"});return new File([t.bytes],"export.wxz")}async function Ji(e,{targetPath:t,zipFile:r}){const n=r.name,s=n.replace(/\.zip$/,""),i
|
|
465
|
+
require ${p};
|
|
466
|
+
`})};async function Js(e,t){await e.fileExists(t)&&(await e.isDir(t)?await e.rmdir(t):await e.unlink(t))}async function Ki(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){const t=await e.request({url:"/wp-admin/export.php?download=true&content=all&export_wxz=1"});return new File([t.bytes],"export.wxz")}async function Ji(e,{targetPath:t,zipFile:r}){const n=r.name,s=n.replace(/\.zip$/,""),i=ye(await e.documentRoot,"wp-content"),o=ye(i,crypto.randomUUID()),l=ye(o,n),d=ye(o,"assets",s);await e.fileExists(d)&&await e.rmdir(o,{recursive:!0}),await e.mkdir(o),await Bn(e,{path:l,data:r});try{await yn(e,{zipPath:l,extractToPath:d});const u=await e.listFiles(d,{prependPath:!0}),p=u.length===1&&await e.isDir(u[0]);let h,_="";p?(_=u[0],h=u[0].split("/").pop()):(_=d,h=s);const T=`${t}/${h}`;return await e.mv(_,T),{assetFolderPath:T,assetFolderName:h}}finally{await e.rmdir(o,{recursive:!0})}}const Yi=async(e,{pluginZipFile:t,options:r={}},n)=>{const s=t.name.split("/").pop()||"plugin.zip",i=hn(s);n==null||n.tracker.setCaption(`Installing the ${i} plugin`);try{const{assetFolderPath:o}=await Ji(e,{zipFile:t,targetPath:`${await e.documentRoot}/wp-content/plugins`});("activate"in r?r.activate:!0)&&await Hn(e,{pluginPath:o,pluginName:i},n),await Ua(e)}catch(o){console.error(`Proceeding without the ${i} plugin. Could not install it in wp-admin. The original error was: ${o}`),console.error(o)}};async function Ua(e){await e.isDir("/wordpress/wp-content/plugins/gutenberg")&&!await e.fileExists("/wordpress/.gutenberg-patched")&&(await e.writeFile("/wordpress/.gutenberg-patched","1"),await Ii(e,"/wordpress",["/wordpress/wp-content/plugins/gutenberg/build/block-editor/index.js","/wordpress/wp-content/plugins/gutenberg/build/block-editor/index.min.js"]))}const Zi=async(e,{themeZipFile:t,options:r={}},n)=>{const s=hn(t.name);n==null||n.tracker.setCaption(`Installing the ${s} theme`);try{const{assetFolderName:i}=await Ji(e,{zipFile:t,targetPath:`${await e.documentRoot}/wp-content/themes`});("activate"in r?r.activate:!0)&&await Vn(e,{themeFolderName:i},n)}catch(i){console.error(`Proceeding without the ${s} theme. Could not install it in wp-admin. The original error was: ${i}`),console.error(i)}},Qi=async(e,{username:t="admin",password:r="password"}={},n)=>{n==null||n.tracker.setCaption((n==null?void 0:n.initialCaption)||"Logging in"),await e.request({url:"/wp-login.php"}),await e.request({url:"/wp-login.php",method:"POST",formData:{log:t,pwd:r,rememberme:"forever"}})},Xi=async(e,{options:t})=>{await e.request({url:"/wp-admin/install.php?step=2",method:"POST",formData:{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"}})},eo=async(e,{options:t})=>{const r=`<?php
|
|
467
467
|
include 'wordpress/wp-load.php';
|
|
468
468
|
$site_options = ${Gt(t)};
|
|
469
469
|
foreach($site_options as $name => $value) {
|
|
@@ -477,11 +477,11 @@ if (defined('USE_FETCH_FOR_REQUESTS') && USE_FETCH_FOR_REQUESTS) {
|
|
|
477
477
|
update_user_meta(${Gt(r)}, $name, $value);
|
|
478
478
|
}
|
|
479
479
|
echo "Success";
|
|
480
|
-
`,s=await e.run({code:n});return ro(s),{code:n,result:s}};async function ro(e){if(e.text!=="Success")throw console.log(e),new Error(`Failed to run code: ${e.text} ${e.errors}`)}const no=async(e,{selfContained:t=!1}={})=>{const r="/tmp/wordpress-playground.zip",n=await e.documentRoot,s=
|
|
480
|
+
`,s=await e.run({code:n});return ro(s),{code:n,result:s}};async function ro(e){if(e.text!=="Success")throw console.log(e),new Error(`Failed to run code: ${e.text} ${e.errors}`)}const no=async(e,{selfContained:t=!1}={})=>{const r="/tmp/wordpress-playground.zip",n=await e.documentRoot,s=ye(n,"wp-content");let i=zn;t&&(i=i.filter(d=>!d.startsWith("themes/twenty")).filter(d=>d!=="plugins/sqlite-database-integration"));const o=mn({zipPath:r,wpContentPath:s,documentRoot:n,exceptPaths:i.map(d=>ye(n,"wp-content",d)),additionalPaths:t?{[ye(n,"wp-config.php")]:"wp-config.php"}:{}});await ki(e,`zipDir(${o.wpContentPath}, ${o.zipPath}, array(
|
|
481
481
|
'exclude_paths' => ${o.exceptPaths},
|
|
482
482
|
'zip_root' => ${o.documentRoot},
|
|
483
483
|
'additional_paths' => ${o.additionalPaths}
|
|
484
|
-
));`);const l=await e.readFileAsBuffer(r);return e.unlink(r),l},La=Object.freeze(Object.defineProperty({__proto__:null,activatePlugin:Hn,activateTheme:Vn,applyWordPressPatches:ji,cp:Li,defineSiteUrl:Wi,defineWpConfigConsts:Lt,exportWXR:Ki,exportWXZ:Gi,importFile:xi,importWordPressFiles:Bi,installPlugin:Yi,installTheme:Zi,login:Qi,mkdir:Hi,mv:zi,request:Ui,rm:Wn,rmdir:Vi,runPHP:Ai,runPHPWithOptions:Di,runSql:qi,runWpInstallationWizard:Xi,setPhpIniEntry:Mi,setSiteOptions:eo,unzip:yn,updateUserMeta:to,writeFile:Bn,zipWpContent:no},Symbol.toStringTag,{value:"Module"})),za=5*1024*1024;function Ha(e,t){const r=e.headers.get("content-length")||"",n=parseInt(r,10)||za;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 l=0;for(;;)try{const{done:
|
|
484
|
+
));`);const l=await e.readFileAsBuffer(r);return e.unlink(r),l},La=Object.freeze(Object.defineProperty({__proto__:null,activatePlugin:Hn,activateTheme:Vn,applyWordPressPatches:ji,cp:Li,defineSiteUrl:Wi,defineWpConfigConsts:Lt,exportWXR:Ki,exportWXZ:Gi,importFile:xi,importWordPressFiles:Bi,installPlugin:Yi,installTheme:Zi,login:Qi,mkdir:Hi,mv:zi,request:Ui,rm:Wn,rmdir:Vi,runPHP:Ai,runPHPWithOptions:Di,runSql:qi,runWpInstallationWizard:Xi,setPhpIniEntry:Mi,setSiteOptions:eo,unzip:yn,updateUserMeta:to,writeFile:Bn,zipWpContent:no},Symbol.toStringTag,{value:"Module"})),za=5*1024*1024;function Ha(e,t){const r=e.headers.get("content-length")||"",n=parseInt(r,10)||za;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 l=0;for(;;)try{const{done:d,value:u}=await o.read();if(u&&(l+=u.byteLength),d){s(l,l),i.close();break}else s(l,n),i.enqueue(u)}catch(d){console.error({e:d}),i.error(d);break}}}),{status:e.status,statusText:e.statusText,headers:e.headers})}const Sn=1e-5;class gn 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<-Sn)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 gn({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+Sn>=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+Sn>=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 Ys=Symbol("error"),Zs=Symbol("message");class Kn extends Event{constructor(t,r={}){super(t),this[Ys]=r.error===void 0?null:r.error,this[Zs]=r.message===void 0?"":r.message}get error(){return this[Ys]}get message(){return this[Zs]}}Object.defineProperty(Kn.prototype,"error",{enumerable:!0});Object.defineProperty(Kn.prototype,"message",{enumerable:!0});const Va=typeof globalThis.ErrorEvent=="function"?globalThis.ErrorEvent:Kn;function Wa(e){return e instanceof Error?"exitCode"in e&&(e==null?void 0:e.exitCode)===0||(e==null?void 0:e.name)==="ExitStatus"&&"status"in e&&e.status===0:!1}class xa extends EventTarget{constructor(){super(...arguments),this.listenersCount=0}addEventListener(t,r){++this.listenersCount,super.addEventListener(t,r)}removeEventListener(t,r){--this.listenersCount,super.removeEventListener(t,r)}hasListeners(){return this.listenersCount>0}}function Ba(e){e.asm={...e.asm};const t=new xa;for(const r in e.asm)if(typeof e.asm[r]=="function"){const n=e.asm[r];e.asm[r]=function(...s){var i;try{return n(...s)}catch(o){if(!(o instanceof Error))throw o;const l=Ga(o,(i=e.lastAsyncifyStackSource)==null?void 0:i.stack);if(e.lastAsyncifyStackSource&&(o.cause=e.lastAsyncifyStackSource),t.hasListeners()){t.dispatchEvent(new Va("error",{error:o,message:l}));return}throw Wa(o)||Za(l),o}}}return t}let jn=[];function Ka(){return jn}function Ga(e,t){if(e.message==="unreachable"){let r=Ja;t||(r+=`
|
|
485
485
|
|
|
486
486
|
This stack trace is lacking. For a better one initialize
|
|
487
487
|
the PHP runtime with { debug: true }, e.g. PHPNode.load('8.1', { debug: true }).
|
|
@@ -515,9 +515,9 @@ CLI option:
|
|
|
515
515
|
${ei}
|
|
516
516
|
${Ya} WASM ERROR${Xs}${Qs}`);for(const t of e.split(`
|
|
517
517
|
`))console.log(`${ei} ${t} `);console.log(`${Xs}`)}}function Qa(e){try{const t=e.split(`
|
|
518
|
-
`).slice(1).map(r=>{const n=r.trim().substring(3).split(" ");return{fn:n.length>=2?n[0]:"<unknown>",isWasm:r.includes("wasm://")}}).filter(({fn:r,isWasm:n})=>n&&!r.startsWith("dynCall_")&&!r.startsWith("invoke_")).map(({fn:r})=>r);return Array.from(new Set(t))}catch{return[]}}class bt{constructor(t,r,n,s="",i=0){this.httpStatusCode=t,this.headers=r,this.bytes=n,this.exitCode=i,this.errors=s}static fromRawData(t){return new bt(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)}}const $n=["8.3","8.2","8.1","8.0","7.4","7.3","7.2","7.1","7.0"],so=$n[0],Xa=$n,io=["iconv","mbstring","xml-bundle","gd"],ri={"kitchen-sink":io};var $t,Ht;class ec{constructor(t,r={}){ee(this,$t,void 0);ee(this,Ht,void 0);this.requestHandler=t,pe(this,$t,{}),pe(this,Ht,{handleRedirects:!1,maxRedirects:4,...r})}async request(t,r=0){const n=await this.requestHandler.request({...t,headers:{...t.headers,cookie:this.serializeCookies()}});if(n.headers["set-cookie"]&&this.setCookies(n.headers["set-cookie"]),H(this,Ht).handleRedirects&&n.headers.location&&r<H(this,Ht).maxRedirects){const s=new URL(n.headers.location[0],this.requestHandler.absoluteUrl);return this.request({url:s.toString(),method:"GET",headers:{}},r+1)}return n}pathToInternalUrl(t){return this.requestHandler.pathToInternalUrl(t)}internalUrlToPath(t){return this.requestHandler.internalUrlToPath(t)}get absoluteUrl(){return this.requestHandler.absoluteUrl}get documentRoot(){return this.requestHandler.documentRoot}setCookies(t){for(const r of t)try{if(!r.includes("="))continue;const n=r.indexOf("="),s=r.substring(0,n),i=r.substring(n+1).split(";")[0];H(this,$t)[s]=i}catch(n){console.error(n)}}serializeCookies(){const t=[];for(const r in H(this,$t))t.push(`${r}=${H(this,$t)[r]}`);return t.join("; ")}}$t=new WeakMap,Ht=new WeakMap;const tc="http://example.com";function ni(e){return e.toString().substring(e.origin.length)}function si(e,t){return!t||!e.startsWith(t)?e:e.substring(t.length)}function rc(e,t){return!t||e.startsWith(t)?e:t+e}var We,Vt,
|
|
518
|
+
`).slice(1).map(r=>{const n=r.trim().substring(3).split(" ");return{fn:n.length>=2?n[0]:"<unknown>",isWasm:r.includes("wasm://")}}).filter(({fn:r,isWasm:n})=>n&&!r.startsWith("dynCall_")&&!r.startsWith("invoke_")).map(({fn:r})=>r);return Array.from(new Set(t))}catch{return[]}}class bt{constructor(t,r,n,s="",i=0){this.httpStatusCode=t,this.headers=r,this.bytes=n,this.exitCode=i,this.errors=s}static fromRawData(t){return new bt(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)}}const $n=["8.3","8.2","8.1","8.0","7.4","7.3","7.2","7.1","7.0"],so=$n[0],Xa=$n,io=["iconv","mbstring","xml-bundle","gd"],ri={"kitchen-sink":io};var $t,Ht;class ec{constructor(t,r={}){ee(this,$t,void 0);ee(this,Ht,void 0);this.requestHandler=t,pe(this,$t,{}),pe(this,Ht,{handleRedirects:!1,maxRedirects:4,...r})}async request(t,r=0){const n=await this.requestHandler.request({...t,headers:{...t.headers,cookie:this.serializeCookies()}});if(n.headers["set-cookie"]&&this.setCookies(n.headers["set-cookie"]),H(this,Ht).handleRedirects&&n.headers.location&&r<H(this,Ht).maxRedirects){const s=new URL(n.headers.location[0],this.requestHandler.absoluteUrl);return this.request({url:s.toString(),method:"GET",headers:{}},r+1)}return n}pathToInternalUrl(t){return this.requestHandler.pathToInternalUrl(t)}internalUrlToPath(t){return this.requestHandler.internalUrlToPath(t)}get absoluteUrl(){return this.requestHandler.absoluteUrl}get documentRoot(){return this.requestHandler.documentRoot}setCookies(t){for(const r of t)try{if(!r.includes("="))continue;const n=r.indexOf("="),s=r.substring(0,n),i=r.substring(n+1).split(";")[0];H(this,$t)[s]=i}catch(n){console.error(n)}}serializeCookies(){const t=[];for(const r in H(this,$t))t.push(`${r}=${H(this,$t)[r]}`);return t.join("; ")}}$t=new WeakMap,Ht=new WeakMap;const tc="http://example.com";function ni(e){return e.toString().substring(e.origin.length)}function si(e,t){return!t||!e.startsWith(t)?e:e.substring(t.length)}function rc(e,t){return!t||e.startsWith(t)?e:t+e}var We,Vt,_r,wt,Wt,xe,xt,Bt,Qr,oo,Xr,ao,en,co;class nc{constructor(t,r={}){ee(this,Qr);ee(this,Xr);ee(this,en);ee(this,We,void 0);ee(this,Vt,void 0);ee(this,_r,void 0);ee(this,wt,void 0);ee(this,Wt,void 0);ee(this,xe,void 0);ee(this,xt,void 0);ee(this,Bt,void 0);pe(this,Bt,new xn({concurrency:1}));const{documentRoot:n="/www/",absoluteUrl:s=typeof location=="object"?location==null?void 0:location.href:""}=r;this.php=t,pe(this,We,n);const i=new URL(s);pe(this,_r,i.hostname),pe(this,wt,i.port?Number(i.port):i.protocol==="https:"?443:80),pe(this,Vt,(i.protocol||"").replace(":",""));const o=H(this,wt)!==443&&H(this,wt)!==80;pe(this,Wt,[H(this,_r),o?`:${H(this,wt)}`:""].join("")),pe(this,xe,i.pathname.replace(/\/+$/,"")),pe(this,xt,[`${H(this,Vt)}://`,H(this,Wt),H(this,xe)].join(""))}pathToInternalUrl(t){return`${this.absoluteUrl}${t}`}internalUrlToPath(t){const r=new URL(t);return r.pathname.startsWith(H(this,xe))&&(r.pathname=r.pathname.slice(H(this,xe).length)),ni(r)}get isRequestRunning(){return H(this,Bt).running>0}get absoluteUrl(){return H(this,xt)}get documentRoot(){return H(this,We)}async request(t){const r=t.url.startsWith("http://")||t.url.startsWith("https://"),n=new URL(t.url,r?void 0:tc),s=si(n.pathname,H(this,xe)),i=`${H(this,We)}${s}`;return oc(i)?await we(this,Xr,ao).call(this,t,n):we(this,Qr,oo).call(this,i)}}We=new WeakMap,Vt=new WeakMap,_r=new WeakMap,wt=new WeakMap,Wt=new WeakMap,xe=new WeakMap,xt=new WeakMap,Bt=new WeakMap,Qr=new WeakSet,oo=function(t){if(!this.php.fileExists(t))return new bt(404,{"x-file-type":["static"]},new TextEncoder().encode("404 File not found"));const r=this.php.readFileAsBuffer(t);return new bt(200,{"content-length":[`${r.byteLength}`],"content-type":[ic(t)],"accept-ranges":["bytes"],"cache-control":["public, max-age=0"]},r)},Xr=new WeakSet,ao=async function(t,r){var s;const n=await H(this,Bt).acquire();try{this.php.addServerGlobalEntry("DOCUMENT_ROOT",H(this,We)),this.php.addServerGlobalEntry("HTTPS",H(this,xt).startsWith("https://")?"on":"");let i="GET";const o={host:H(this,Wt),...bo(t.headers||{})},l=[];if(t.files&&Object.keys(t.files).length){i="POST";for(const p in t.files){const h=t.files[p];l.push({key:p,name:h.name,type:h.type,data:new Uint8Array(await h.arrayBuffer())})}(s=o["content-type"])!=null&&s.startsWith("multipart/form-data")&&(t.formData=sc(t.body||""),o["content-type"]="application/x-www-form-urlencoded",delete t.body)}let d;t.formData!==void 0?(i="POST",o["content-type"]=o["content-type"]||"application/x-www-form-urlencoded",d=new URLSearchParams(t.formData).toString()):d=t.body;let u;try{u=we(this,en,co).call(this,r.pathname)}catch{return new bt(404,{},new TextEncoder().encode("404 File not found"))}return await this.php.run({relativeUri:rc(ni(r),H(this,xe)),protocol:H(this,Vt),method:t.method||i,body:d,fileInfos:l,scriptPath:u,headers:o})}finally{n()}},en=new WeakSet,co=function(t){let r=si(t,H(this,xe));r.includes(".php")?r=r.split(".php")[0]+".php":(r.endsWith("/")||(r+="/"),r.endsWith("index.php")||(r+="index.php"));const n=`${H(this,We)}${r}`;if(this.php.fileExists(n))return n;if(!this.php.fileExists(`${H(this,We)}/index.php`))throw new Error(`File not found: ${n}`);return`${H(this,We)}/index.php`};function sc(e){const t={},r=e.match(/--(.*)\r\n/);if(!r)return t;const n=r[1],s=e.split(`--${n}`);return s.shift(),s.pop(),s.forEach(i=>{const o=i.indexOf(`\r
|
|
519
519
|
\r
|
|
520
|
-
`),l=i.substring(0,o).trim(),
|
|
520
|
+
`),l=i.substring(0,o).trim(),d=i.substring(o+4).trim(),u=l.match(/name="([^"]+)"/);if(u){const p=u[1];t[p]=d}}),t}function ic(e){switch(e.split(".").pop()){case"css":return"text/css";case"js":return"application/javascript";case"png":return"image/png";case"jpg":case"jpeg":return"image/jpeg";case"gif":return"image/gif";case"svg":return"image/svg+xml";case"woff":return"font/woff";case"woff2":return"font/woff2";case"ttf":return"font/ttf";case"otf":return"font/otf";case"eot":return"font/eot";case"ico":return"image/x-icon";case"html":return"text/html";case"json":return"application/json";case"xml":return"application/xml";case"txt":case"md":return"text/plain";default:return"application-octet-stream"}}function oc(e){return ac(e)||cc(e)}function ac(e){return e.endsWith(".php")||e.includes(".php/")}function cc(e){return!e.split("/").pop().includes(".")}const ii={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 De(e=""){return function(r,n,s){const i=s.value;s.value=function(...o){try{return i.apply(this,o)}catch(l){const d=typeof l=="object"?l==null?void 0:l.errno:null;if(d in ii){const u=ii[d],p=typeof o[0]=="string"?o[0]:null,h=p!==null?e.replaceAll("{path}",p):e;throw new Error(`${h}: ${u}`,{cause:l})}throw l}}}}const lc=new Map;function uc(e){return lc.get(e)}(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"})();var dc=Object.defineProperty,pc=Object.getOwnPropertyDescriptor,Fe=(e,t,r,n)=>{for(var s=n>1?void 0:n?pc(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&&dc(t,r,s),s};const _e="string",Dt="number",te=Symbol("__private__dont__use");var _t,nt,vt,st,Ye,Kt,vr,tn,lo,rn,uo,nn,po,sn,fo,on,ho,an,mo,cn,yo,ln,go,un,$o,dn,wo,pn,_o,fn,vo;class qe{constructor(t,r){ee(this,tn);ee(this,rn);ee(this,nn);ee(this,sn);ee(this,on);ee(this,an);ee(this,cn);ee(this,ln);ee(this,un);ee(this,dn);ee(this,pn);ee(this,fn);ee(this,_t,void 0);ee(this,nt,void 0);ee(this,vt,void 0);ee(this,st,void 0);ee(this,Ye,void 0);ee(this,Kt,void 0);ee(this,vr,void 0);pe(this,_t,[]),pe(this,nt,!1),pe(this,vt,null),pe(this,st,{}),pe(this,Ye,new Map),pe(this,Kt,[]),pe(this,vr,new xn({concurrency:1})),t!==void 0&&this.initializeRuntime(t),r&&(this.requestHandler=new ec(new nc(this,r)))}addEventListener(t,r){H(this,Ye).has(t)||H(this,Ye).set(t,new Set),H(this,Ye).get(t).add(r)}removeEventListener(t,r){var n;(n=H(this,Ye).get(t))==null||n.delete(r)}dispatchEvent(t){const r=H(this,Ye).get(t.type);if(r)for(const n of r)n(t)}async onMessage(t){H(this,Kt).push(t)}async setSpawnHandler(t){this[te].spawnProcess=t}get absoluteUrl(){return this.requestHandler.requestHandler.absoluteUrl}get documentRoot(){return this.requestHandler.requestHandler.documentRoot}pathToInternalUrl(t){return this.requestHandler.requestHandler.pathToInternalUrl(t)}internalUrlToPath(t){return this.requestHandler.requestHandler.internalUrlToPath(t)}initializeRuntime(t){if(this[te])throw new Error("PHP runtime already initialized.");const r=uc(t);if(!r)throw new Error("Invalid PHP runtime id.");this[te]=r,r.onMessage=async n=>{for(const s of H(this,Kt)){const i=await s(n);if(i)return i}return""},pe(this,vt,Ba(r))}setPhpIniPath(t){if(H(this,nt))throw new Error("Cannot set PHP ini path after calling run().");this[te].ccall("wasm_set_phpini_path",null,["string"],[t])}setPhpIniEntry(t,r){if(H(this,nt))throw new Error("Cannot set PHP ini entries after calling run().");H(this,_t).push([t,r])}chdir(t){this[te].FS.chdir(t)}async request(t,r){if(!this.requestHandler)throw new Error("No request handler available.");return this.requestHandler.request(t,r)}async run(t){const r=await H(this,vr).acquire();try{H(this,nt)||(we(this,tn,lo).call(this),pe(this,nt,!0)),we(this,ln,go).call(this,t.scriptPath||""),we(this,nn,po).call(this,t.relativeUri||""),we(this,on,ho).call(this,t.method||"GET");const n=bo(t.headers||{}),s=n.host||"example.com:443";if(we(this,sn,fo).call(this,s,t.protocol||"http"),we(this,an,mo).call(this,n),t.body&&we(this,cn,yo).call(this,t.body),t.fileInfos)for(const i of t.fileInfos)we(this,dn,wo).call(this,i);return t.code&&we(this,pn,_o).call(this," ?>"+t.code),we(this,un,$o).call(this),await we(this,fn,vo).call(this)}finally{r(),this.dispatchEvent({type:"request.end"})}}addServerGlobalEntry(t,r){H(this,st)[t]=r}defineConstant(t,r){let n={};try{n=JSON.parse(this.fileExists("/tmp/consts.json")&&this.readFileAsText("/tmp/consts.json")||"{}")}catch{}this.writeFile("/tmp/consts.json",JSON.stringify({...n,[t]:r}))}mkdir(t){this[te].FS.mkdirTree(t)}mkdirTree(t){this.mkdir(t)}readFileAsText(t){return new TextDecoder().decode(this.readFileAsBuffer(t))}readFileAsBuffer(t){return this[te].FS.readFile(t)}writeFile(t,r){this[te].FS.writeFile(t,r)}unlink(t){this[te].FS.unlink(t)}mv(t,r){this[te].FS.rename(t,r)}rmdir(t,r={recursive:!0}){r!=null&&r.recursive&&this.listFiles(t).forEach(n=>{const s=`${t}/${n}`;this.isDir(s)?this.rmdir(s,r):this.unlink(s)}),this[te].FS.rmdir(t)}listFiles(t,r={prependPath:!1}){if(!this.fileExists(t))return[];try{const n=this[te].FS.readdir(t).filter(s=>s!=="."&&s!=="..");if(r.prependPath){const s=t.replace(/\/$/,"");return n.map(i=>`${s}/${i}`)}return n}catch(n){return console.error(n,{path:t}),[]}}isDir(t){return this.fileExists(t)?this[te].FS.isDir(this[te].FS.lookupPath(t).node.mode):!1}fileExists(t){try{return this[te].FS.lookupPath(t),!0}catch{return!1}}exit(t=0){return this[te]._exit(t)}}_t=new WeakMap,nt=new WeakMap,vt=new WeakMap,st=new WeakMap,Ye=new WeakMap,Kt=new WeakMap,vr=new WeakMap,tn=new WeakSet,lo=function(){if(this.setPhpIniEntry("auto_prepend_file","/tmp/consts.php"),this.fileExists("/tmp/consts.php")||this.writeFile("/tmp/consts.php",`<?php
|
|
521
521
|
if(file_exists('/tmp/consts.json')) {
|
|
522
522
|
$consts = json_decode(file_get_contents('/tmp/consts.json'), true);
|
|
523
523
|
foreach ($consts as $const => $value) {
|
|
@@ -525,20 +525,20 @@ ${Ya} WASM ERROR${Xs}${Qs}`);for(const t of e.split(`
|
|
|
525
525
|
define($const, $value);
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
|
-
}`),H(this,
|
|
528
|
+
}`),H(this,_t).length>0){const t=H(this,_t).map(([r,n])=>`${r}=${n}`).join(`
|
|
529
529
|
`)+`
|
|
530
530
|
|
|
531
|
-
`;this[te].ccall("wasm_set_phpini_entries",null,[_e],[t])}this[te].ccall("php_wasm_init",null,[],[])},rn=new WeakSet,uo=function(){const t="/tmp/headers.json";if(!this.fileExists(t))throw new Error("SAPI Error: Could not find response headers file.");const r=JSON.parse(this.readFileAsText(t)),n={};for(const s of r.headers){if(!s.includes(": "))continue;const i=s.indexOf(": "),o=s.substring(0,i).toLowerCase(),l=s.substring(i+2);o in n||(n[o]=[]),n[o].push(l)}return{headers:n,httpStatusCode:r.status}},nn=new WeakSet,po=function(t){if(this[te].ccall("wasm_set_request_uri",null,[_e],[t]),t.includes("?")){const r=t.substring(t.indexOf("?")+1);this[te].ccall("wasm_set_query_string",null,[_e],[r])}},sn=new WeakSet,fo=function(t,r){this[te].ccall("wasm_set_request_host",null,[_e],[t]);let n;try{n=parseInt(new URL(t).port,10)}catch{}(!n||isNaN(n)||n===80)&&(n=r==="https"?443:80),this[te].ccall("wasm_set_request_port",null,[Dt],[n]),(r==="https"||!r&&n===443)&&this.addServerGlobalEntry("HTTPS","on")},on=new WeakSet,ho=function(t){this[te].ccall("wasm_set_request_method",null,[_e],[t])},an=new WeakSet,mo=function(t){t.cookie&&this[te].ccall("wasm_set_cookies",null,[_e],[t.cookie]),t["content-type"]&&this[te].ccall("wasm_set_content_type",null,[_e],[t["content-type"]]),t["content-length"]&&this[te].ccall("wasm_set_content_length",null,[Dt],[parseInt(t["content-length"],10)]);for(const r in t){let n="HTTP_";["content-type","content-length"].includes(r.toLowerCase())&&(n=""),this.addServerGlobalEntry(`${n}${r.toUpperCase().replace(/-/g,"_")}`,t[r])}},cn=new WeakSet,yo=function(t){this[te].ccall("wasm_set_request_body",null,[_e],[t]),this[te].ccall("wasm_set_content_length",null,[Dt],[new TextEncoder().encode(t).length])},ln=new WeakSet,go=function(t){this[te].ccall("wasm_set_path_translated",null,[_e],[t])},un=new WeakSet,$o=function(){for(const t in H(this,st))this[te].ccall("wasm_add_SERVER_entry",null,[_e,_e],[t,H(this,st)[t]])},dn=new WeakSet,_o=function(t){const{key:r,name:n,type:s,data:i}=t,o=`/tmp/${Math.random().toFixed(20)}`;this.writeFile(o,i);const l=0;this[te].ccall("wasm_add_uploaded_file",null,[_e,_e,_e,_e,Dt,Dt],[r,n,s,o,l,i.byteLength])},pn=new WeakSet,wo=function(t){this[te].ccall("wasm_set_php_code",null,[_e],[t])},fn=new WeakSet,vo=async function(){var i;let t,r;try{t=await new Promise((o,l)=>{var u;r=d=>{const h=new Error("Rethrown");h.cause=d.error,h.betterMessage=d.message,l(h)},(u=H(this,vt))==null||u.addEventListener("error",r);const p=this[te].ccall("wasm_sapi_handle_request",Dt,[],[],{async:!0});return p instanceof Promise?p.then(o,l):o(p)})}catch(o){for(const d in this)typeof this[d]=="function"&&(this[d]=()=>{throw new Error("PHP runtime has crashed – see the earlier error for details.")});this.functionsMaybeMissingFromAsyncify=Ka();const l=o,p="betterMessage"in l?l.betterMessage:l.message,u=new Error(p);throw u.cause=l,u}finally{(i=H(this,vt))==null||i.removeEventListener("error",r),pe(this,st,{})}const{headers:n,httpStatusCode:s}=$e(this,rn,uo).call(this);return new bt(s,n,this.readFileAsBuffer("/tmp/stdout"),this.readFileAsText("/tmp/stderr"),t)};Fe([De('Could not create directory "{path}"')],qe.prototype,"mkdir",1);Fe([De('Could not create directory "{path}"')],qe.prototype,"mkdirTree",1);Fe([De('Could not read "{path}"')],qe.prototype,"readFileAsText",1);Fe([De('Could not read "{path}"')],qe.prototype,"readFileAsBuffer",1);Fe([De('Could not write to "{path}"')],qe.prototype,"writeFile",1);Fe([De('Could not unlink "{path}"')],qe.prototype,"unlink",1);Fe([De('Could not move "{path}"')],qe.prototype,"mv",1);Fe([De('Could not remove directory "{path}"')],qe.prototype,"rmdir",1);Fe([De('Could not list files in "{path}"')],qe.prototype,"listFiles",1);Fe([De('Could not stat "{path}"')],qe.prototype,"isDir",1);Fe([De('Could not stat "{path}"')],qe.prototype,"fileExists",1);function bo(e){const t={};for(const r in e)t[r.toLowerCase()]=e[r];return t}const fc=["vfs","literal","wordpress.org/themes","wordpress.org/plugins","url"];function hc(e){return e&&typeof e=="object"&&typeof e.resource=="string"&&fc.includes(e.resource)}class St{static create(t,{semaphore:r,progress:n}){let s;switch(t.resource){case"vfs":s=new mc(t,n);break;case"literal":s=new yc(t,n);break;case"wordpress.org/themes":s=new _c(t,n);break;case"wordpress.org/plugins":s=new wc(t,n);break;case"url":s=new $c(t,n);break;default:throw new Error(`Invalid resource: ${t}`)}return s=new vc(s),r&&(s=new bc(s,r)),s}setPlayground(t){this.playground=t}get isAsync(){return!1}}class mc extends St{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 yc extends St{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 Gn extends St{constructor(t){super(),this.progress=t}async resolve(){var n,s;(n=this.progress)==null||n.setCaption(this.caption);const t=this.getURL();let r=await fetch(t);if(r=await Ha(r,((s=this.progress)==null?void 0:s.loadingListener)??gc),r.status!==200)throw new Error(`Could not download "${t}"`);return new File([await r.blob()],this.name)}get caption(){return`Downloading ${this.name}`}get name(){try{return new URL(this.getURL(),"http://example.com").pathname.split("/").pop()}catch{return this.getURL()}}get isAsync(){return!0}}const gc=()=>{};class $c extends Gn{constructor(t,r){super(r),this.resource=t}getURL(){return this.resource.url}get caption(){return this.resource.caption??super.caption}}class _c extends Gn{constructor(t,r){super(r),this.resource=t}get name(){return hn(this.resource.slug)}getURL(){return`https://downloads.wordpress.org/theme/${Po(this.resource.slug)}`}}class wc extends Gn{constructor(t,r){super(r),this.resource=t}get name(){return hn(this.resource.slug)}getURL(){return`https://downloads.wordpress.org/plugin/${Po(this.resource.slug)}`}}function Po(e){return!e||e.endsWith(".zip")?e:e+".latest-stable.zip"}class Eo extends St{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 vc extends Eo{async resolve(){return this.promise||(this.promise=super.resolve()),this.promise}}class bc extends Eo{constructor(t,r){super(t),this.semaphore=r}async resolve(){return this.isAsync?this.semaphore.run(()=>super.resolve()):super.resolve()}}var Pc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ec(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var In={exports:{}},So={},Ae={},Jt={},br={},K={},_r={};(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(O){if(super(),!e.IDENTIFIER.test(O))throw new Error("CodeGen: name must be a valid identifier");this.str=O}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(O){super(),this._items=typeof O=="string"?[O]:O}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const O=this._items[0];return O===""||O==='""'}get str(){var O;return(O=this._str)!==null&&O!==void 0?O:this._str=this._items.reduce((C,j)=>`${C}${j}`,"")}get names(){var O;return(O=this._names)!==null&&O!==void 0?O:this._names=this._items.reduce((C,j)=>(j instanceof r&&(C[j.str]=(C[j.str]||0)+1),C),{})}}e._Code=n,e.nil=new n("");function s(g,...O){const C=[g[0]];let j=0;for(;j<O.length;)l(C,O[j]),C.push(g[++j]);return new n(C)}e._=s;const i=new n("+");function o(g,...O){const C=[T(g[0])];let j=0;for(;j<O.length;)C.push(i),l(C,O[j]),C.push(i,T(g[++j]));return p(C),new n(C)}e.str=o;function l(g,O){O instanceof n?g.push(...O._items):O instanceof r?g.push(O):g.push(h(O))}e.addCodeArg=l;function p(g){let O=1;for(;O<g.length-1;){if(g[O]===i){const C=u(g[O-1],g[O+1]);if(C!==void 0){g.splice(O-1,3,C);continue}g[O++]="+"}O++}}function u(g,O){if(O==='""')return g;if(g==='""')return O;if(typeof g=="string")return O instanceof r||g[g.length-1]!=='"'?void 0:typeof O!="string"?`${g.slice(0,-1)}${O}"`:O[0]==='"'?g.slice(0,-1)+O.slice(1):void 0;if(typeof O=="string"&&O[0]==='"'&&!(g instanceof r))return`"${g}${O.slice(1)}`}function d(g,O){return O.emptyStr()?g:g.emptyStr()?O:o`${g}${O}`}e.strConcat=d;function h(g){return typeof g=="number"||typeof g=="boolean"||g===null?g:T(Array.isArray(g)?g.join(","):g)}function w(g){return new n(T(g))}e.stringify=w;function T(g){return JSON.stringify(g).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=T;function v(g){return typeof g=="string"&&e.IDENTIFIER.test(g)?new n(`.${g}`):s`[${g}]`}e.getProperty=v;function R(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=R;function _(g){return new n(g.toString())}e.regexpCode=_})(_r);var An={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=_r;class r extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}}var n;(function(p){p[p.Started=0]="Started",p[p.Completed=1]="Completed"})(n=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:u,parent:d}={}){this._names={},this._prefixes=u,this._parent=d}toName(u){return u instanceof t.Name?u:this.name(u)}name(u){return new t.Name(this._newName(u))}_newName(u){const d=this._names[u]||this._nameGroup(u);return`${u}${d.index++}`}_nameGroup(u){var d,h;if(!((h=(d=this._parent)===null||d===void 0?void 0:d._prefixes)===null||h===void 0)&&h.has(u)||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}}e.Scope=s;class i extends t.Name{constructor(u,d){super(d),this.prefix=u}setValue(u,{property:d,itemIndex:h}){this.value=u,this.scopePath=(0,t._)`.${new t.Name(d)}[${h}]`}}e.ValueScopeName=i;const o=(0,t._)`\n`;class l extends s{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts={...u,_n:u.lines?o:t.nil}}get(){return this._scope}name(u){return new i(u,this._newName(u))}value(u,d){var h;if(d.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const w=this.toName(u),{prefix:T}=w,v=(h=d.key)!==null&&h!==void 0?h:d.ref;let R=this._values[T];if(R){const O=R.get(v);if(O)return O}else R=this._values[T]=new Map;R.set(v,w);const _=this._scope[T]||(this._scope[T]=[]),g=_.length;return _[g]=d.ref,w.setValue(d,{property:T,itemIndex:g}),w}getValue(u,d){const h=this._values[u];if(h)return h.get(d)}scopeRefs(u,d=this._values){return this._reduceValues(d,h=>{if(h.scopePath===void 0)throw new Error(`CodeGen: name "${h}" has no value`);return(0,t._)`${u}${h.scopePath}`})}scopeCode(u=this._values,d,h){return this._reduceValues(u,w=>{if(w.value===void 0)throw new Error(`CodeGen: name "${w}" has no value`);return w.value.code},d,h)}_reduceValues(u,d,h={},w){let T=t.nil;for(const v in u){const R=u[v];if(!R)continue;const _=h[v]=h[v]||new Map;R.forEach(g=>{if(_.has(g))return;_.set(g,n.Started);let O=d(g);if(O){const C=this.opts.es5?e.varKinds.var:e.varKinds.const;T=(0,t._)`${T}${C} ${g} = ${O};${this.opts._n}`}else if(O=w==null?void 0:w(g))T=(0,t._)`${T}${O}${this.opts._n}`;else throw new r(g);_.set(g,n.Completed)})}return T}}e.ValueScope=l})(An);(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=_r,r=An;var n=_r;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=An;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,k){super(),this.varKind=a,this.name=m,this.rhs=k}render({es5:a,_n:m}){const k=a?r.varKinds.var:this.varKind,q=this.rhs===void 0?"":` = ${this.rhs}`;return`${k} ${this.name}${q};`+m}optimizeNames(a,m){if(a[this.name.str])return this.rhs&&(this.rhs=he(this.rhs,a,m)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class l extends i{constructor(a,m,k){super(),this.lhs=a,this.rhs=m,this.sideEffects=k}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=he(this.rhs,a,m),this}get names(){const a=this.lhs instanceof t.Name?{}:{...this.lhs.names};return Re(a,this.rhs)}}class p extends l{constructor(a,m,k,q){super(a,k,q),this.op=m}render({_n:a}){return`${this.lhs} ${this.op}= ${this.rhs};`+a}}class u 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 h extends i{constructor(a){super(),this.error=a}render({_n:a}){return`throw ${this.error};`+a}get names(){return this.error.names}}class w 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=he(this.code,a,m),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class T extends i{constructor(a=[]){super(),this.nodes=a}render(a){return this.nodes.reduce((m,k)=>m+k.render(a),"")}optimizeNodes(){const{nodes:a}=this;let m=a.length;for(;m--;){const k=a[m].optimizeNodes();Array.isArray(k)?a.splice(m,1,...k):k?a[m]=k:a.splice(m,1)}return a.length>0?this:void 0}optimizeNames(a,m){const{nodes:k}=this;let q=k.length;for(;q--;){const M=k[q];M.optimizeNames(a,m)||(at(a,M.names),k.splice(q,1))}return k.length>0?this:void 0}get names(){return this.nodes.reduce((a,m)=>Q(a,m.names),{})}}class v extends T{render(a){return"{"+a._n+super.render(a)+"}"+a._n}}class R extends T{}class _ extends v{}_.kind="else";class g extends v{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 k=m.optimizeNodes();m=this.else=Array.isArray(k)?new _(k):k}if(m)return a===!1?m instanceof g?m:m.nodes:this.nodes.length?this:new g(ct(a),m instanceof g?[m]:m.nodes);if(!(a===!1||!this.nodes.length))return this}optimizeNames(a,m){var k;if(this.else=(k=this.else)===null||k===void 0?void 0:k.optimizeNames(a,m),!!(super.optimizeNames(a,m)||this.else))return this.condition=he(this.condition,a,m),this}get names(){const a=super.names;return Re(a,this.condition),this.else&&Q(a,this.else.names),a}}g.kind="if";class O extends v{}O.kind="for";class C extends O{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=he(this.iteration,a,m),this}get names(){return Q(super.names,this.iteration.names)}}class j extends O{constructor(a,m,k,q){super(),this.varKind=a,this.name=m,this.from=k,this.to=q}render(a){const m=a.es5?r.varKinds.var:this.varKind,{name:k,from:q,to:M}=this;return`for(${m} ${k}=${q}; ${k}<${M}; ${k}++)`+super.render(a)}get names(){const a=Re(super.names,this.from);return Re(a,this.to)}}class D extends O{constructor(a,m,k,q){super(),this.loop=a,this.varKind=m,this.name=k,this.iterable=q}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=he(this.iterable,a,m),this}get names(){return Q(super.names,this.iterable.names)}}class b extends v{constructor(a,m,k){super(),this.name=a,this.args=m,this.async=k}render(a){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(a)}}b.kind="func";class N extends T{render(a){return"return "+super.render(a)}}N.kind="return";class A extends v{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 k,q;return super.optimizeNames(a,m),(k=this.catch)===null||k===void 0||k.optimizeNames(a,m),(q=this.finally)===null||q===void 0||q.optimizeNames(a,m),this}get names(){const a=super.names;return this.catch&&Q(a,this.catch.names),this.finally&&Q(a,this.finally.names),a}}class W extends v{constructor(a){super(),this.error=a}render(a){return`catch(${this.error})`+super.render(a)}}W.kind="catch";class G extends v{render(a){return"finally"+super.render(a)}}G.kind="finally";class ce{constructor(a,m={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...m,_n:m.lines?`
|
|
532
|
-
`:""},this._extScope=a,this._scope=new r.Scope({parent:a}),this._nodes=[new R]}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 k=this._extScope.value(a,m);return(this._values[k.prefix]||(this._values[k.prefix]=new Set)).add(k),k}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,k,q){const M=this._scope.toName(m);return k!==void 0&&q&&(this._constants[M.str]=k),this._leafNode(new o(a,M,k)),M}const(a,m,k){return this._def(r.varKinds.const,a,m,k)}let(a,m,k){return this._def(r.varKinds.let,a,m,k)}var(a,m,k){return this._def(r.varKinds.var,a,m,k)}assign(a,m,k){return this._leafNode(new l(a,m,k))}add(a,m){return this._leafNode(new p(a,e.operators.ADD,m))}code(a){return typeof a=="function"?a():a!==t.nil&&this._leafNode(new w(a)),this}object(...a){const m=["{"];for(const[k,q]of a)m.length>1&&m.push(","),m.push(k),(k!==q||this.opts.es5)&&(m.push(":"),(0,t.addCodeArg)(m,q));return m.push("}"),new t._Code(m)}if(a,m,k){if(this._blockNode(new g(a)),m&&k)this.code(m).else().code(k).endIf();else if(m)this.code(m).endIf();else if(k)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 C(a),m)}forRange(a,m,k,q,M=this.opts.es5?r.varKinds.var:r.varKinds.let){const J=this._scope.toName(a);return this._for(new j(M,J,m,k),()=>q(J))}forOf(a,m,k,q=r.varKinds.const){const M=this._scope.toName(a);if(this.opts.es5){const J=m instanceof t.Name?m:this.var("_arr",m);return this.forRange("_i",0,(0,t._)`${J}.length`,Z=>{this.var(M,(0,t._)`${J}[${Z}]`),k(M)})}return this._for(new D("of",q,M,m),()=>k(M))}forIn(a,m,k,q=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(a,(0,t._)`Object.keys(${m})`,k);const M=this._scope.toName(a);return this._for(new D("in",q,M,m),()=>k(M))}endFor(){return this._endBlockNode(O)}label(a){return this._leafNode(new u(a))}break(a){return this._leafNode(new d(a))}return(a){const m=new N;if(this._blockNode(m),this.code(a),m.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(N)}try(a,m,k){if(!m&&!k)throw new Error('CodeGen: "try" without "catch" and "finally"');const q=new A;if(this._blockNode(q),this.code(a),m){const M=this.name("e");this._currNode=q.catch=new W(M),m(M)}return k&&(this._currNode=q.finally=new G,this.code(k)),this._endBlockNode(W,G)}throw(a){return this._leafNode(new h(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 k=this._nodes.length-m;if(k<0||a!==void 0&&k!==a)throw new Error(`CodeGen: wrong number of nodes: ${k} vs ${a} expected`);return this._nodes.length=m,this}func(a,m=t.nil,k,q){return this._blockNode(new b(a,m,k)),q&&this.code(q).endFunc(),this}endFunc(){return this._endBlockNode(b)}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 k=this._currNode;if(k instanceof a||m&&k 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=ce;function Q(P,a){for(const m in a)P[m]=(P[m]||0)+(a[m]||0);return P}function Re(P,a){return a instanceof t._CodeOrName?Q(P,a.names):P}function he(P,a,m){if(P instanceof t.Name)return k(P);if(!q(P))return P;return new t._Code(P._items.reduce((M,J)=>(J instanceof t.Name&&(J=k(J)),J instanceof t._Code?M.push(...J._items):M.push(J),M),[]));function k(M){const J=m[M.str];return J===void 0||a[M.str]!==1?M:(delete a[M.str],J)}function q(M){return M instanceof t._Code&&M._items.some(J=>J instanceof t.Name&&a[J.str]===1&&m[J.str]!==void 0)}}function at(P,a){for(const m in a)P[m]=(P[m]||0)-(a[m]||0)}function ct(P){return typeof P=="boolean"||typeof P=="number"||P===null?!P:(0,t._)`!${I(P)}`}e.not=ct;const Tt=$(e.operators.AND);function Xt(...P){return P.reduce(Tt)}e.and=Xt;const Rt=$(e.operators.OR);function F(...P){return P.reduce(Rt)}e.or=F;function $(P){return(a,m)=>a===t.nil?m:m===t.nil?a:(0,t._)`${I(a)} ${P} ${I(m)}`}function I(P){return P instanceof t.Name?P:(0,t._)`(${P})`}})(K);var re={};(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=K,r=_r;function n(b){const N={};for(const A of b)N[A]=!0;return N}e.toHash=n;function s(b,N){return typeof N=="boolean"?N:Object.keys(N).length===0?!0:(i(b,N),!o(N,b.self.RULES.all))}e.alwaysValidSchema=s;function i(b,N=b.schema){const{opts:A,self:W}=b;if(!A.strictSchema||typeof N=="boolean")return;const G=W.RULES.keywords;for(const ce in N)G[ce]||D(b,`unknown keyword: "${ce}"`)}e.checkUnknownRules=i;function o(b,N){if(typeof b=="boolean")return!b;for(const A in b)if(N[A])return!0;return!1}e.schemaHasRules=o;function l(b,N){if(typeof b=="boolean")return!b;for(const A in b)if(A!=="$ref"&&N.all[A])return!0;return!1}e.schemaHasRulesButRef=l;function p({topSchemaRef:b,schemaPath:N},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._)`${b}${N}${(0,t.getProperty)(W)}`}e.schemaRefOrVal=p;function u(b){return w(decodeURIComponent(b))}e.unescapeFragment=u;function d(b){return encodeURIComponent(h(b))}e.escapeFragment=d;function h(b){return typeof b=="number"?`${b}`:b.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=h;function w(b){return b.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=w;function T(b,N){if(Array.isArray(b))for(const A of b)N(A);else N(b)}e.eachItem=T;function v({mergeNames:b,mergeToName:N,mergeValues:A,resultToName:W}){return(G,ce,Q,Re)=>{const he=Q===void 0?ce:Q instanceof t.Name?(ce instanceof t.Name?b(G,ce,Q):N(G,ce,Q),Q):ce instanceof t.Name?(N(G,Q,ce),ce):A(ce,Q);return Re===t.Name&&!(he instanceof t.Name)?W(G,he):he}}e.mergeEvaluated={props:v({mergeNames:(b,N,A)=>b.if((0,t._)`${A} !== true && ${N} !== undefined`,()=>{b.if((0,t._)`${N} === true`,()=>b.assign(A,!0),()=>b.assign(A,(0,t._)`${A} || {}`).code((0,t._)`Object.assign(${A}, ${N})`))}),mergeToName:(b,N,A)=>b.if((0,t._)`${A} !== true`,()=>{N===!0?b.assign(A,!0):(b.assign(A,(0,t._)`${A} || {}`),_(b,A,N))}),mergeValues:(b,N)=>b===!0?!0:{...b,...N},resultToName:R}),items:v({mergeNames:(b,N,A)=>b.if((0,t._)`${A} !== true && ${N} !== undefined`,()=>b.assign(A,(0,t._)`${N} === true ? true : ${A} > ${N} ? ${A} : ${N}`)),mergeToName:(b,N,A)=>b.if((0,t._)`${A} !== true`,()=>b.assign(A,N===!0?!0:(0,t._)`${A} > ${N} ? ${A} : ${N}`)),mergeValues:(b,N)=>b===!0?!0:Math.max(b,N),resultToName:(b,N)=>b.var("items",N)})};function R(b,N){if(N===!0)return b.var("props",!0);const A=b.var("props",(0,t._)`{}`);return N!==void 0&&_(b,A,N),A}e.evaluatedPropsToName=R;function _(b,N,A){Object.keys(A).forEach(W=>b.assign((0,t._)`${N}${(0,t.getProperty)(W)}`,!0))}e.setEvaluated=_;const g={};function O(b,N){return b.scopeValue("func",{ref:N,code:g[N.code]||(g[N.code]=new r._Code(N.code))})}e.useFunc=O;var C;(function(b){b[b.Num=0]="Num",b[b.Str=1]="Str"})(C=e.Type||(e.Type={}));function j(b,N,A){if(b instanceof t.Name){const W=N===C.Num;return A?W?(0,t._)`"[" + ${b} + "]"`:(0,t._)`"['" + ${b} + "']"`:W?(0,t._)`"/" + ${b}`:(0,t._)`"/" + ${b}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return A?(0,t.getProperty)(b).toString():"/"+h(b)}e.getErrorPath=j;function D(b,N,A=b.opts.strictSchema){if(A){if(N=`strict mode: ${N}`,A===!0)throw new Error(N);b.self.logger.warn(N)}}e.checkStrictMode=D})(re);var Ge={};Object.defineProperty(Ge,"__esModule",{value:!0});const we=K,Sc={data:new we.Name("data"),valCxt:new we.Name("valCxt"),instancePath:new we.Name("instancePath"),parentData:new we.Name("parentData"),parentDataProperty:new we.Name("parentDataProperty"),rootData:new we.Name("rootData"),dynamicAnchors:new we.Name("dynamicAnchors"),vErrors:new we.Name("vErrors"),errors:new we.Name("errors"),this:new we.Name("this"),self:new we.Name("self"),scope:new we.Name("scope"),json:new we.Name("json"),jsonPos:new we.Name("jsonPos"),jsonLen:new we.Name("jsonLen"),jsonPart:new we.Name("jsonPart")};Ge.default=Sc;(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=K,r=re,n=Ge;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,O,C){const{it:j}=_,{gen:D,compositeRule:b,allErrors:N}=j,A=h(_,g,O);C??(b||N)?p(D,A):u(j,(0,t._)`[${A}]`)}e.reportError=s;function i(_,g=e.keywordError,O){const{it:C}=_,{gen:j,compositeRule:D,allErrors:b}=C,N=h(_,g,O);p(j,N),D||b||u(C,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 l({gen:_,keyword:g,schemaValue:O,data:C,errsCount:j,it:D}){if(j===void 0)throw new Error("ajv implementation error");const b=_.name("err");_.forRange("i",j,n.default.errors,N=>{_.const(b,(0,t._)`${n.default.vErrors}[${N}]`),_.if((0,t._)`${b}.instancePath === undefined`,()=>_.assign((0,t._)`${b}.instancePath`,(0,t.strConcat)(n.default.instancePath,D.errorPath))),_.assign((0,t._)`${b}.schemaPath`,(0,t.str)`${D.errSchemaPath}/${g}`),D.opts.verbose&&(_.assign((0,t._)`${b}.schema`,O),_.assign((0,t._)`${b}.data`,C))})}e.extendErrors=l;function p(_,g){const O=_.const("err",g);_.if((0,t._)`${n.default.vErrors} === null`,()=>_.assign(n.default.vErrors,(0,t._)`[${O}]`),(0,t._)`${n.default.vErrors}.push(${O})`),_.code((0,t._)`${n.default.errors}++`)}function u(_,g){const{gen:O,validateName:C,schemaEnv:j}=_;j.$async?O.throw((0,t._)`new ${_.ValidationError}(${g})`):(O.assign((0,t._)`${C}.errors`,g),O.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 h(_,g,O){const{createErrors:C}=_.it;return C===!1?(0,t._)`{}`:w(_,g,O)}function w(_,g,O={}){const{gen:C,it:j}=_,D=[T(j,O),v(_,O)];return R(_,g,D),C.object(...D)}function T({errorPath:_},{instancePath:g}){const O=g?(0,t.str)`${_}${(0,r.getErrorPath)(g,r.Type.Str)}`:_;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,O)]}function v({keyword:_,it:{errSchemaPath:g}},{schemaPath:O,parentSchema:C}){let j=C?g:(0,t.str)`${g}/${_}`;return O&&(j=(0,t.str)`${j}${(0,r.getErrorPath)(O,r.Type.Str)}`),[d.schemaPath,j]}function R(_,{params:g,message:O},C){const{keyword:j,data:D,schemaValue:b,it:N}=_,{opts:A,propertyName:W,topSchemaRef:G,schemaPath:ce}=N;C.push([d.keyword,j],[d.params,typeof g=="function"?g(_):g||(0,t._)`{}`]),A.messages&&C.push([d.message,typeof O=="function"?O(_):O]),A.verbose&&C.push([d.schema,b],[d.parentSchema,(0,t._)`${G}${ce}`],[n.default.data,D]),W&&C.push([d.propertyName,W])}})(br);Object.defineProperty(Jt,"__esModule",{value:!0});Jt.boolOrEmptySchema=Jt.topBoolOrEmptySchema=void 0;const Tc=br,Rc=K,Oc=Ge,Cc={message:"boolean schema is false"};function Nc(e){const{gen:t,schema:r,validateName:n}=e;r===!1?To(e,!1):typeof r=="object"&&r.$async===!0?t.return(Oc.default.data):(t.assign((0,Rc._)`${n}.errors`,null),t.return(!0))}Jt.topBoolOrEmptySchema=Nc;function kc(e,t){const{gen:r,schema:n}=e;n===!1?(r.var(t,!1),To(e)):r.var(t,!0)}Jt.boolOrEmptySchema=kc;function To(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,Tc.reportError)(s,Cc,void 0,t)}var Pr={},Pt={};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.getRules=Pt.isJSONType=void 0;const jc=["string","number","integer","boolean","null","object","array"],Ic=new Set(jc);function Ac(e){return typeof e=="string"&&Ic.has(e)}Pt.isJSONType=Ac;function Dc(){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:{}}}Pt.getRules=Dc;var Ze={};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.shouldUseRule=Ze.shouldUseGroup=Ze.schemaHasRulesForType=void 0;function Fc({schema:e,self:t},r){const n=t.RULES.types[r];return n&&n!==!0&&Ro(e,n)}Ze.schemaHasRulesForType=Fc;function Ro(e,t){return t.rules.some(r=>Oo(e,r))}Ze.shouldUseGroup=Ro;function Oo(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))}Ze.shouldUseRule=Oo;(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=Pt,r=Ze,n=br,s=K,i=re;var o;(function(C){C[C.Correct=0]="Correct",C[C.Wrong=1]="Wrong"})(o=e.DataType||(e.DataType={}));function l(C){const j=p(C.type);if(j.includes("null")){if(C.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!j.length&&C.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');C.nullable===!0&&j.push("null")}return j}e.getSchemaTypes=l;function p(C){const j=Array.isArray(C)?C:C?[C]:[];if(j.every(t.isJSONType))return j;throw new Error("type must be JSONType or JSONType[]: "+j.join(","))}e.getJSONTypes=p;function u(C,j){const{gen:D,data:b,opts:N}=C,A=h(j,N.coerceTypes),W=j.length>0&&!(A.length===0&&j.length===1&&(0,r.schemaHasRulesForType)(C,j[0]));if(W){const G=R(j,b,N.strictNumbers,o.Wrong);D.if(G,()=>{A.length?w(C,j,A):g(C)})}return W}e.coerceAndCheckDataType=u;const d=new Set(["string","number","integer","boolean","null"]);function h(C,j){return j?C.filter(D=>d.has(D)||j==="array"&&D==="array"):[]}function w(C,j,D){const{gen:b,data:N,opts:A}=C,W=b.let("dataType",(0,s._)`typeof ${N}`),G=b.let("coerced",(0,s._)`undefined`);A.coerceTypes==="array"&&b.if((0,s._)`${W} == 'object' && Array.isArray(${N}) && ${N}.length == 1`,()=>b.assign(N,(0,s._)`${N}[0]`).assign(W,(0,s._)`typeof ${N}`).if(R(j,N,A.strictNumbers),()=>b.assign(G,N))),b.if((0,s._)`${G} !== undefined`);for(const Q of D)(d.has(Q)||Q==="array"&&A.coerceTypes==="array")&&ce(Q);b.else(),g(C),b.endIf(),b.if((0,s._)`${G} !== undefined`,()=>{b.assign(N,G),T(C,G)});function ce(Q){switch(Q){case"string":b.elseIf((0,s._)`${W} == "number" || ${W} == "boolean"`).assign(G,(0,s._)`"" + ${N}`).elseIf((0,s._)`${N} === null`).assign(G,(0,s._)`""`);return;case"number":b.elseIf((0,s._)`${W} == "boolean" || ${N} === null
|
|
531
|
+
`;this[te].ccall("wasm_set_phpini_entries",null,[_e],[t])}this[te].ccall("php_wasm_init",null,[],[])},rn=new WeakSet,uo=function(){const t="/tmp/headers.json";if(!this.fileExists(t))throw new Error("SAPI Error: Could not find response headers file.");const r=JSON.parse(this.readFileAsText(t)),n={};for(const s of r.headers){if(!s.includes(": "))continue;const i=s.indexOf(": "),o=s.substring(0,i).toLowerCase(),l=s.substring(i+2);o in n||(n[o]=[]),n[o].push(l)}return{headers:n,httpStatusCode:r.status}},nn=new WeakSet,po=function(t){if(this[te].ccall("wasm_set_request_uri",null,[_e],[t]),t.includes("?")){const r=t.substring(t.indexOf("?")+1);this[te].ccall("wasm_set_query_string",null,[_e],[r])}},sn=new WeakSet,fo=function(t,r){this[te].ccall("wasm_set_request_host",null,[_e],[t]);let n;try{n=parseInt(new URL(t).port,10)}catch{}(!n||isNaN(n)||n===80)&&(n=r==="https"?443:80),this[te].ccall("wasm_set_request_port",null,[Dt],[n]),(r==="https"||!r&&n===443)&&this.addServerGlobalEntry("HTTPS","on")},on=new WeakSet,ho=function(t){this[te].ccall("wasm_set_request_method",null,[_e],[t])},an=new WeakSet,mo=function(t){t.cookie&&this[te].ccall("wasm_set_cookies",null,[_e],[t.cookie]),t["content-type"]&&this[te].ccall("wasm_set_content_type",null,[_e],[t["content-type"]]),t["content-length"]&&this[te].ccall("wasm_set_content_length",null,[Dt],[parseInt(t["content-length"],10)]);for(const r in t){let n="HTTP_";["content-type","content-length"].includes(r.toLowerCase())&&(n=""),this.addServerGlobalEntry(`${n}${r.toUpperCase().replace(/-/g,"_")}`,t[r])}},cn=new WeakSet,yo=function(t){this[te].ccall("wasm_set_request_body",null,[_e],[t]),this[te].ccall("wasm_set_content_length",null,[Dt],[new TextEncoder().encode(t).length])},ln=new WeakSet,go=function(t){this[te].ccall("wasm_set_path_translated",null,[_e],[t])},un=new WeakSet,$o=function(){for(const t in H(this,st))this[te].ccall("wasm_add_SERVER_entry",null,[_e,_e],[t,H(this,st)[t]])},dn=new WeakSet,wo=function(t){const{key:r,name:n,type:s,data:i}=t,o=`/tmp/${Math.random().toFixed(20)}`;this.writeFile(o,i);const l=0;this[te].ccall("wasm_add_uploaded_file",null,[_e,_e,_e,_e,Dt,Dt],[r,n,s,o,l,i.byteLength])},pn=new WeakSet,_o=function(t){this[te].ccall("wasm_set_php_code",null,[_e],[t])},fn=new WeakSet,vo=async function(){var i;let t,r;try{t=await new Promise((o,l)=>{var u;r=p=>{const h=new Error("Rethrown");h.cause=p.error,h.betterMessage=p.message,l(h)},(u=H(this,vt))==null||u.addEventListener("error",r);const d=this[te].ccall("wasm_sapi_handle_request",Dt,[],[],{async:!0});return d instanceof Promise?d.then(o,l):o(d)})}catch(o){for(const p in this)typeof this[p]=="function"&&(this[p]=()=>{throw new Error("PHP runtime has crashed – see the earlier error for details.")});this.functionsMaybeMissingFromAsyncify=Ka();const l=o,d="betterMessage"in l?l.betterMessage:l.message,u=new Error(d);throw u.cause=l,u}finally{(i=H(this,vt))==null||i.removeEventListener("error",r),pe(this,st,{})}const{headers:n,httpStatusCode:s}=we(this,rn,uo).call(this);return new bt(s,n,this.readFileAsBuffer("/tmp/stdout"),this.readFileAsText("/tmp/stderr"),t)};Fe([De('Could not create directory "{path}"')],qe.prototype,"mkdir",1);Fe([De('Could not create directory "{path}"')],qe.prototype,"mkdirTree",1);Fe([De('Could not read "{path}"')],qe.prototype,"readFileAsText",1);Fe([De('Could not read "{path}"')],qe.prototype,"readFileAsBuffer",1);Fe([De('Could not write to "{path}"')],qe.prototype,"writeFile",1);Fe([De('Could not unlink "{path}"')],qe.prototype,"unlink",1);Fe([De('Could not move "{path}"')],qe.prototype,"mv",1);Fe([De('Could not remove directory "{path}"')],qe.prototype,"rmdir",1);Fe([De('Could not list files in "{path}"')],qe.prototype,"listFiles",1);Fe([De('Could not stat "{path}"')],qe.prototype,"isDir",1);Fe([De('Could not stat "{path}"')],qe.prototype,"fileExists",1);function bo(e){const t={};for(const r in e)t[r.toLowerCase()]=e[r];return t}const fc=["vfs","literal","wordpress.org/themes","wordpress.org/plugins","url"];function hc(e){return e&&typeof e=="object"&&typeof e.resource=="string"&&fc.includes(e.resource)}class St{static create(t,{semaphore:r,progress:n}){let s;switch(t.resource){case"vfs":s=new mc(t,n);break;case"literal":s=new yc(t,n);break;case"wordpress.org/themes":s=new wc(t,n);break;case"wordpress.org/plugins":s=new _c(t,n);break;case"url":s=new $c(t,n);break;default:throw new Error(`Invalid resource: ${t}`)}return s=new vc(s),r&&(s=new bc(s,r)),s}setPlayground(t){this.playground=t}get isAsync(){return!1}}class mc extends St{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 yc extends St{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 Gn extends St{constructor(t){super(),this.progress=t}async resolve(){var n,s;(n=this.progress)==null||n.setCaption(this.caption);const t=this.getURL();let r=await fetch(t);if(r=await Ha(r,((s=this.progress)==null?void 0:s.loadingListener)??gc),r.status!==200)throw new Error(`Could not download "${t}"`);return new File([await r.blob()],this.name)}get caption(){return`Downloading ${this.name}`}get name(){try{return new URL(this.getURL(),"http://example.com").pathname.split("/").pop()}catch{return this.getURL()}}get isAsync(){return!0}}const gc=()=>{};class $c extends Gn{constructor(t,r){super(r),this.resource=t}getURL(){return this.resource.url}get caption(){return this.resource.caption??super.caption}}class wc extends Gn{constructor(t,r){super(r),this.resource=t}get name(){return hn(this.resource.slug)}getURL(){return`https://downloads.wordpress.org/theme/${Po(this.resource.slug)}`}}class _c extends Gn{constructor(t,r){super(r),this.resource=t}get name(){return hn(this.resource.slug)}getURL(){return`https://downloads.wordpress.org/plugin/${Po(this.resource.slug)}`}}function Po(e){return!e||e.endsWith(".zip")?e:e+".latest-stable.zip"}class Eo extends St{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 vc extends Eo{async resolve(){return this.promise||(this.promise=super.resolve()),this.promise}}class bc extends Eo{constructor(t,r){super(t),this.semaphore=r}async resolve(){return this.isAsync?this.semaphore.run(()=>super.resolve()):super.resolve()}}var Pc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ec(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var In={exports:{}},So={},Ae={},Jt={},br={},K={},wr={};(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(O){if(super(),!e.IDENTIFIER.test(O))throw new Error("CodeGen: name must be a valid identifier");this.str=O}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(O){super(),this._items=typeof O=="string"?[O]:O}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const O=this._items[0];return O===""||O==='""'}get str(){var O;return(O=this._str)!==null&&O!==void 0?O:this._str=this._items.reduce((C,j)=>`${C}${j}`,"")}get names(){var O;return(O=this._names)!==null&&O!==void 0?O:this._names=this._items.reduce((C,j)=>(j instanceof r&&(C[j.str]=(C[j.str]||0)+1),C),{})}}e._Code=n,e.nil=new n("");function s(g,...O){const C=[g[0]];let j=0;for(;j<O.length;)l(C,O[j]),C.push(g[++j]);return new n(C)}e._=s;const i=new n("+");function o(g,...O){const C=[T(g[0])];let j=0;for(;j<O.length;)C.push(i),l(C,O[j]),C.push(i,T(g[++j]));return d(C),new n(C)}e.str=o;function l(g,O){O instanceof n?g.push(...O._items):O instanceof r?g.push(O):g.push(h(O))}e.addCodeArg=l;function d(g){let O=1;for(;O<g.length-1;){if(g[O]===i){const C=u(g[O-1],g[O+1]);if(C!==void 0){g.splice(O-1,3,C);continue}g[O++]="+"}O++}}function u(g,O){if(O==='""')return g;if(g==='""')return O;if(typeof g=="string")return O instanceof r||g[g.length-1]!=='"'?void 0:typeof O!="string"?`${g.slice(0,-1)}${O}"`:O[0]==='"'?g.slice(0,-1)+O.slice(1):void 0;if(typeof O=="string"&&O[0]==='"'&&!(g instanceof r))return`"${g}${O.slice(1)}`}function p(g,O){return O.emptyStr()?g:g.emptyStr()?O:o`${g}${O}`}e.strConcat=p;function h(g){return typeof g=="number"||typeof g=="boolean"||g===null?g:T(Array.isArray(g)?g.join(","):g)}function _(g){return new n(T(g))}e.stringify=_;function T(g){return JSON.stringify(g).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=T;function v(g){return typeof g=="string"&&e.IDENTIFIER.test(g)?new n(`.${g}`):s`[${g}]`}e.getProperty=v;function R(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=R;function w(g){return new n(g.toString())}e.regexpCode=w})(wr);var An={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=wr;class r extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}}var n;(function(d){d[d.Started=0]="Started",d[d.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:u,parent:p}={}){this._names={},this._prefixes=u,this._parent=p}toName(u){return u instanceof t.Name?u:this.name(u)}name(u){return new t.Name(this._newName(u))}_newName(u){const p=this._names[u]||this._nameGroup(u);return`${u}${p.index++}`}_nameGroup(u){var p,h;if(!((h=(p=this._parent)===null||p===void 0?void 0:p._prefixes)===null||h===void 0)&&h.has(u)||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}}e.Scope=s;class i extends t.Name{constructor(u,p){super(p),this.prefix=u}setValue(u,{property:p,itemIndex:h}){this.value=u,this.scopePath=(0,t._)`.${new t.Name(p)}[${h}]`}}e.ValueScopeName=i;const o=(0,t._)`\n`;class l extends s{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts={...u,_n:u.lines?o:t.nil}}get(){return this._scope}name(u){return new i(u,this._newName(u))}value(u,p){var h;if(p.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const _=this.toName(u),{prefix:T}=_,v=(h=p.key)!==null&&h!==void 0?h:p.ref;let R=this._values[T];if(R){const O=R.get(v);if(O)return O}else R=this._values[T]=new Map;R.set(v,_);const w=this._scope[T]||(this._scope[T]=[]),g=w.length;return w[g]=p.ref,_.setValue(p,{property:T,itemIndex:g}),_}getValue(u,p){const h=this._values[u];if(h)return h.get(p)}scopeRefs(u,p=this._values){return this._reduceValues(p,h=>{if(h.scopePath===void 0)throw new Error(`CodeGen: name "${h}" has no value`);return(0,t._)`${u}${h.scopePath}`})}scopeCode(u=this._values,p,h){return this._reduceValues(u,_=>{if(_.value===void 0)throw new Error(`CodeGen: name "${_}" has no value`);return _.value.code},p,h)}_reduceValues(u,p,h={},_){let T=t.nil;for(const v in u){const R=u[v];if(!R)continue;const w=h[v]=h[v]||new Map;R.forEach(g=>{if(w.has(g))return;w.set(g,n.Started);let O=p(g);if(O){const C=this.opts.es5?e.varKinds.var:e.varKinds.const;T=(0,t._)`${T}${C} ${g} = ${O};${this.opts._n}`}else if(O=_==null?void 0:_(g))T=(0,t._)`${T}${O}${this.opts._n}`;else throw new r(g);w.set(g,n.Completed)})}return T}}e.ValueScope=l})(An);(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=wr,r=An;var n=wr;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=An;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,k){super(),this.varKind=a,this.name=m,this.rhs=k}render({es5:a,_n:m}){const k=a?r.varKinds.var:this.varKind,q=this.rhs===void 0?"":` = ${this.rhs}`;return`${k} ${this.name}${q};`+m}optimizeNames(a,m){if(a[this.name.str])return this.rhs&&(this.rhs=he(this.rhs,a,m)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class l extends i{constructor(a,m,k){super(),this.lhs=a,this.rhs=m,this.sideEffects=k}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=he(this.rhs,a,m),this}get names(){const a=this.lhs instanceof t.Name?{}:{...this.lhs.names};return Re(a,this.rhs)}}class d extends l{constructor(a,m,k,q){super(a,k,q),this.op=m}render({_n:a}){return`${this.lhs} ${this.op}= ${this.rhs};`+a}}class u extends i{constructor(a){super(),this.label=a,this.names={}}render({_n:a}){return`${this.label}:`+a}}class p extends i{constructor(a){super(),this.label=a,this.names={}}render({_n:a}){return`break${this.label?` ${this.label}`:""};`+a}}class h 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=he(this.code,a,m),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class T extends i{constructor(a=[]){super(),this.nodes=a}render(a){return this.nodes.reduce((m,k)=>m+k.render(a),"")}optimizeNodes(){const{nodes:a}=this;let m=a.length;for(;m--;){const k=a[m].optimizeNodes();Array.isArray(k)?a.splice(m,1,...k):k?a[m]=k:a.splice(m,1)}return a.length>0?this:void 0}optimizeNames(a,m){const{nodes:k}=this;let q=k.length;for(;q--;){const M=k[q];M.optimizeNames(a,m)||(at(a,M.names),k.splice(q,1))}return k.length>0?this:void 0}get names(){return this.nodes.reduce((a,m)=>Q(a,m.names),{})}}class v extends T{render(a){return"{"+a._n+super.render(a)+"}"+a._n}}class R extends T{}class w extends v{}w.kind="else";class g extends v{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 k=m.optimizeNodes();m=this.else=Array.isArray(k)?new w(k):k}if(m)return a===!1?m instanceof g?m:m.nodes:this.nodes.length?this:new g(ct(a),m instanceof g?[m]:m.nodes);if(!(a===!1||!this.nodes.length))return this}optimizeNames(a,m){var k;if(this.else=(k=this.else)===null||k===void 0?void 0:k.optimizeNames(a,m),!!(super.optimizeNames(a,m)||this.else))return this.condition=he(this.condition,a,m),this}get names(){const a=super.names;return Re(a,this.condition),this.else&&Q(a,this.else.names),a}}g.kind="if";class O extends v{}O.kind="for";class C extends O{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=he(this.iteration,a,m),this}get names(){return Q(super.names,this.iteration.names)}}class j extends O{constructor(a,m,k,q){super(),this.varKind=a,this.name=m,this.from=k,this.to=q}render(a){const m=a.es5?r.varKinds.var:this.varKind,{name:k,from:q,to:M}=this;return`for(${m} ${k}=${q}; ${k}<${M}; ${k}++)`+super.render(a)}get names(){const a=Re(super.names,this.from);return Re(a,this.to)}}class D extends O{constructor(a,m,k,q){super(),this.loop=a,this.varKind=m,this.name=k,this.iterable=q}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=he(this.iterable,a,m),this}get names(){return Q(super.names,this.iterable.names)}}class b extends v{constructor(a,m,k){super(),this.name=a,this.args=m,this.async=k}render(a){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(a)}}b.kind="func";class N extends T{render(a){return"return "+super.render(a)}}N.kind="return";class A extends v{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 k,q;return super.optimizeNames(a,m),(k=this.catch)===null||k===void 0||k.optimizeNames(a,m),(q=this.finally)===null||q===void 0||q.optimizeNames(a,m),this}get names(){const a=super.names;return this.catch&&Q(a,this.catch.names),this.finally&&Q(a,this.finally.names),a}}class W extends v{constructor(a){super(),this.error=a}render(a){return`catch(${this.error})`+super.render(a)}}W.kind="catch";class G extends v{render(a){return"finally"+super.render(a)}}G.kind="finally";class ce{constructor(a,m={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...m,_n:m.lines?`
|
|
532
|
+
`:""},this._extScope=a,this._scope=new r.Scope({parent:a}),this._nodes=[new R]}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 k=this._extScope.value(a,m);return(this._values[k.prefix]||(this._values[k.prefix]=new Set)).add(k),k}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,k,q){const M=this._scope.toName(m);return k!==void 0&&q&&(this._constants[M.str]=k),this._leafNode(new o(a,M,k)),M}const(a,m,k){return this._def(r.varKinds.const,a,m,k)}let(a,m,k){return this._def(r.varKinds.let,a,m,k)}var(a,m,k){return this._def(r.varKinds.var,a,m,k)}assign(a,m,k){return this._leafNode(new l(a,m,k))}add(a,m){return this._leafNode(new d(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[k,q]of a)m.length>1&&m.push(","),m.push(k),(k!==q||this.opts.es5)&&(m.push(":"),(0,t.addCodeArg)(m,q));return m.push("}"),new t._Code(m)}if(a,m,k){if(this._blockNode(new g(a)),m&&k)this.code(m).else().code(k).endIf();else if(m)this.code(m).endIf();else if(k)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 C(a),m)}forRange(a,m,k,q,M=this.opts.es5?r.varKinds.var:r.varKinds.let){const J=this._scope.toName(a);return this._for(new j(M,J,m,k),()=>q(J))}forOf(a,m,k,q=r.varKinds.const){const M=this._scope.toName(a);if(this.opts.es5){const J=m instanceof t.Name?m:this.var("_arr",m);return this.forRange("_i",0,(0,t._)`${J}.length`,Z=>{this.var(M,(0,t._)`${J}[${Z}]`),k(M)})}return this._for(new D("of",q,M,m),()=>k(M))}forIn(a,m,k,q=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(a,(0,t._)`Object.keys(${m})`,k);const M=this._scope.toName(a);return this._for(new D("in",q,M,m),()=>k(M))}endFor(){return this._endBlockNode(O)}label(a){return this._leafNode(new u(a))}break(a){return this._leafNode(new p(a))}return(a){const m=new N;if(this._blockNode(m),this.code(a),m.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(N)}try(a,m,k){if(!m&&!k)throw new Error('CodeGen: "try" without "catch" and "finally"');const q=new A;if(this._blockNode(q),this.code(a),m){const M=this.name("e");this._currNode=q.catch=new W(M),m(M)}return k&&(this._currNode=q.finally=new G,this.code(k)),this._endBlockNode(W,G)}throw(a){return this._leafNode(new h(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 k=this._nodes.length-m;if(k<0||a!==void 0&&k!==a)throw new Error(`CodeGen: wrong number of nodes: ${k} vs ${a} expected`);return this._nodes.length=m,this}func(a,m=t.nil,k,q){return this._blockNode(new b(a,m,k)),q&&this.code(q).endFunc(),this}endFunc(){return this._endBlockNode(b)}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 k=this._currNode;if(k instanceof a||m&&k 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=ce;function Q(P,a){for(const m in a)P[m]=(P[m]||0)+(a[m]||0);return P}function Re(P,a){return a instanceof t._CodeOrName?Q(P,a.names):P}function he(P,a,m){if(P instanceof t.Name)return k(P);if(!q(P))return P;return new t._Code(P._items.reduce((M,J)=>(J instanceof t.Name&&(J=k(J)),J instanceof t._Code?M.push(...J._items):M.push(J),M),[]));function k(M){const J=m[M.str];return J===void 0||a[M.str]!==1?M:(delete a[M.str],J)}function q(M){return M instanceof t._Code&&M._items.some(J=>J instanceof t.Name&&a[J.str]===1&&m[J.str]!==void 0)}}function at(P,a){for(const m in a)P[m]=(P[m]||0)-(a[m]||0)}function ct(P){return typeof P=="boolean"||typeof P=="number"||P===null?!P:(0,t._)`!${I(P)}`}e.not=ct;const Tt=$(e.operators.AND);function Xt(...P){return P.reduce(Tt)}e.and=Xt;const Rt=$(e.operators.OR);function F(...P){return P.reduce(Rt)}e.or=F;function $(P){return(a,m)=>a===t.nil?m:m===t.nil?a:(0,t._)`${I(a)} ${P} ${I(m)}`}function I(P){return P instanceof t.Name?P:(0,t._)`(${P})`}})(K);var re={};(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=K,r=wr;function n(b){const N={};for(const A of b)N[A]=!0;return N}e.toHash=n;function s(b,N){return typeof N=="boolean"?N:Object.keys(N).length===0?!0:(i(b,N),!o(N,b.self.RULES.all))}e.alwaysValidSchema=s;function i(b,N=b.schema){const{opts:A,self:W}=b;if(!A.strictSchema||typeof N=="boolean")return;const G=W.RULES.keywords;for(const ce in N)G[ce]||D(b,`unknown keyword: "${ce}"`)}e.checkUnknownRules=i;function o(b,N){if(typeof b=="boolean")return!b;for(const A in b)if(N[A])return!0;return!1}e.schemaHasRules=o;function l(b,N){if(typeof b=="boolean")return!b;for(const A in b)if(A!=="$ref"&&N.all[A])return!0;return!1}e.schemaHasRulesButRef=l;function d({topSchemaRef:b,schemaPath:N},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._)`${b}${N}${(0,t.getProperty)(W)}`}e.schemaRefOrVal=d;function u(b){return _(decodeURIComponent(b))}e.unescapeFragment=u;function p(b){return encodeURIComponent(h(b))}e.escapeFragment=p;function h(b){return typeof b=="number"?`${b}`:b.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=h;function _(b){return b.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=_;function T(b,N){if(Array.isArray(b))for(const A of b)N(A);else N(b)}e.eachItem=T;function v({mergeNames:b,mergeToName:N,mergeValues:A,resultToName:W}){return(G,ce,Q,Re)=>{const he=Q===void 0?ce:Q instanceof t.Name?(ce instanceof t.Name?b(G,ce,Q):N(G,ce,Q),Q):ce instanceof t.Name?(N(G,Q,ce),ce):A(ce,Q);return Re===t.Name&&!(he instanceof t.Name)?W(G,he):he}}e.mergeEvaluated={props:v({mergeNames:(b,N,A)=>b.if((0,t._)`${A} !== true && ${N} !== undefined`,()=>{b.if((0,t._)`${N} === true`,()=>b.assign(A,!0),()=>b.assign(A,(0,t._)`${A} || {}`).code((0,t._)`Object.assign(${A}, ${N})`))}),mergeToName:(b,N,A)=>b.if((0,t._)`${A} !== true`,()=>{N===!0?b.assign(A,!0):(b.assign(A,(0,t._)`${A} || {}`),w(b,A,N))}),mergeValues:(b,N)=>b===!0?!0:{...b,...N},resultToName:R}),items:v({mergeNames:(b,N,A)=>b.if((0,t._)`${A} !== true && ${N} !== undefined`,()=>b.assign(A,(0,t._)`${N} === true ? true : ${A} > ${N} ? ${A} : ${N}`)),mergeToName:(b,N,A)=>b.if((0,t._)`${A} !== true`,()=>b.assign(A,N===!0?!0:(0,t._)`${A} > ${N} ? ${A} : ${N}`)),mergeValues:(b,N)=>b===!0?!0:Math.max(b,N),resultToName:(b,N)=>b.var("items",N)})};function R(b,N){if(N===!0)return b.var("props",!0);const A=b.var("props",(0,t._)`{}`);return N!==void 0&&w(b,A,N),A}e.evaluatedPropsToName=R;function w(b,N,A){Object.keys(A).forEach(W=>b.assign((0,t._)`${N}${(0,t.getProperty)(W)}`,!0))}e.setEvaluated=w;const g={};function O(b,N){return b.scopeValue("func",{ref:N,code:g[N.code]||(g[N.code]=new r._Code(N.code))})}e.useFunc=O;var C;(function(b){b[b.Num=0]="Num",b[b.Str=1]="Str"})(C=e.Type||(e.Type={}));function j(b,N,A){if(b instanceof t.Name){const W=N===C.Num;return A?W?(0,t._)`"[" + ${b} + "]"`:(0,t._)`"['" + ${b} + "']"`:W?(0,t._)`"/" + ${b}`:(0,t._)`"/" + ${b}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return A?(0,t.getProperty)(b).toString():"/"+h(b)}e.getErrorPath=j;function D(b,N,A=b.opts.strictSchema){if(A){if(N=`strict mode: ${N}`,A===!0)throw new Error(N);b.self.logger.warn(N)}}e.checkStrictMode=D})(re);var Ge={};Object.defineProperty(Ge,"__esModule",{value:!0});const ve=K,Sc={data:new ve.Name("data"),valCxt:new ve.Name("valCxt"),instancePath:new ve.Name("instancePath"),parentData:new ve.Name("parentData"),parentDataProperty:new ve.Name("parentDataProperty"),rootData:new ve.Name("rootData"),dynamicAnchors:new ve.Name("dynamicAnchors"),vErrors:new ve.Name("vErrors"),errors:new ve.Name("errors"),this:new ve.Name("this"),self:new ve.Name("self"),scope:new ve.Name("scope"),json:new ve.Name("json"),jsonPos:new ve.Name("jsonPos"),jsonLen:new ve.Name("jsonLen"),jsonPart:new ve.Name("jsonPart")};Ge.default=Sc;(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=K,r=re,n=Ge;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,O,C){const{it:j}=w,{gen:D,compositeRule:b,allErrors:N}=j,A=h(w,g,O);C??(b||N)?d(D,A):u(j,(0,t._)`[${A}]`)}e.reportError=s;function i(w,g=e.keywordError,O){const{it:C}=w,{gen:j,compositeRule:D,allErrors:b}=C,N=h(w,g,O);d(j,N),D||b||u(C,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 l({gen:w,keyword:g,schemaValue:O,data:C,errsCount:j,it:D}){if(j===void 0)throw new Error("ajv implementation error");const b=w.name("err");w.forRange("i",j,n.default.errors,N=>{w.const(b,(0,t._)`${n.default.vErrors}[${N}]`),w.if((0,t._)`${b}.instancePath === undefined`,()=>w.assign((0,t._)`${b}.instancePath`,(0,t.strConcat)(n.default.instancePath,D.errorPath))),w.assign((0,t._)`${b}.schemaPath`,(0,t.str)`${D.errSchemaPath}/${g}`),D.opts.verbose&&(w.assign((0,t._)`${b}.schema`,O),w.assign((0,t._)`${b}.data`,C))})}e.extendErrors=l;function d(w,g){const O=w.const("err",g);w.if((0,t._)`${n.default.vErrors} === null`,()=>w.assign(n.default.vErrors,(0,t._)`[${O}]`),(0,t._)`${n.default.vErrors}.push(${O})`),w.code((0,t._)`${n.default.errors}++`)}function u(w,g){const{gen:O,validateName:C,schemaEnv:j}=w;j.$async?O.throw((0,t._)`new ${w.ValidationError}(${g})`):(O.assign((0,t._)`${C}.errors`,g),O.return(!1))}const p={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 h(w,g,O){const{createErrors:C}=w.it;return C===!1?(0,t._)`{}`:_(w,g,O)}function _(w,g,O={}){const{gen:C,it:j}=w,D=[T(j,O),v(w,O)];return R(w,g,D),C.object(...D)}function T({errorPath:w},{instancePath:g}){const O=g?(0,t.str)`${w}${(0,r.getErrorPath)(g,r.Type.Str)}`:w;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,O)]}function v({keyword:w,it:{errSchemaPath:g}},{schemaPath:O,parentSchema:C}){let j=C?g:(0,t.str)`${g}/${w}`;return O&&(j=(0,t.str)`${j}${(0,r.getErrorPath)(O,r.Type.Str)}`),[p.schemaPath,j]}function R(w,{params:g,message:O},C){const{keyword:j,data:D,schemaValue:b,it:N}=w,{opts:A,propertyName:W,topSchemaRef:G,schemaPath:ce}=N;C.push([p.keyword,j],[p.params,typeof g=="function"?g(w):g||(0,t._)`{}`]),A.messages&&C.push([p.message,typeof O=="function"?O(w):O]),A.verbose&&C.push([p.schema,b],[p.parentSchema,(0,t._)`${G}${ce}`],[n.default.data,D]),W&&C.push([p.propertyName,W])}})(br);Object.defineProperty(Jt,"__esModule",{value:!0});Jt.boolOrEmptySchema=Jt.topBoolOrEmptySchema=void 0;const Tc=br,Rc=K,Oc=Ge,Cc={message:"boolean schema is false"};function Nc(e){const{gen:t,schema:r,validateName:n}=e;r===!1?To(e,!1):typeof r=="object"&&r.$async===!0?t.return(Oc.default.data):(t.assign((0,Rc._)`${n}.errors`,null),t.return(!0))}Jt.topBoolOrEmptySchema=Nc;function kc(e,t){const{gen:r,schema:n}=e;n===!1?(r.var(t,!1),To(e)):r.var(t,!0)}Jt.boolOrEmptySchema=kc;function To(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,Tc.reportError)(s,Cc,void 0,t)}var Pr={},Pt={};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.getRules=Pt.isJSONType=void 0;const jc=["string","number","integer","boolean","null","object","array"],Ic=new Set(jc);function Ac(e){return typeof e=="string"&&Ic.has(e)}Pt.isJSONType=Ac;function Dc(){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:{}}}Pt.getRules=Dc;var Ze={};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.shouldUseRule=Ze.shouldUseGroup=Ze.schemaHasRulesForType=void 0;function Fc({schema:e,self:t},r){const n=t.RULES.types[r];return n&&n!==!0&&Ro(e,n)}Ze.schemaHasRulesForType=Fc;function Ro(e,t){return t.rules.some(r=>Oo(e,r))}Ze.shouldUseGroup=Ro;function Oo(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))}Ze.shouldUseRule=Oo;(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=Pt,r=Ze,n=br,s=K,i=re;var o;(function(C){C[C.Correct=0]="Correct",C[C.Wrong=1]="Wrong"})(o=e.DataType||(e.DataType={}));function l(C){const j=d(C.type);if(j.includes("null")){if(C.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!j.length&&C.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');C.nullable===!0&&j.push("null")}return j}e.getSchemaTypes=l;function d(C){const j=Array.isArray(C)?C:C?[C]:[];if(j.every(t.isJSONType))return j;throw new Error("type must be JSONType or JSONType[]: "+j.join(","))}e.getJSONTypes=d;function u(C,j){const{gen:D,data:b,opts:N}=C,A=h(j,N.coerceTypes),W=j.length>0&&!(A.length===0&&j.length===1&&(0,r.schemaHasRulesForType)(C,j[0]));if(W){const G=R(j,b,N.strictNumbers,o.Wrong);D.if(G,()=>{A.length?_(C,j,A):g(C)})}return W}e.coerceAndCheckDataType=u;const p=new Set(["string","number","integer","boolean","null"]);function h(C,j){return j?C.filter(D=>p.has(D)||j==="array"&&D==="array"):[]}function _(C,j,D){const{gen:b,data:N,opts:A}=C,W=b.let("dataType",(0,s._)`typeof ${N}`),G=b.let("coerced",(0,s._)`undefined`);A.coerceTypes==="array"&&b.if((0,s._)`${W} == 'object' && Array.isArray(${N}) && ${N}.length == 1`,()=>b.assign(N,(0,s._)`${N}[0]`).assign(W,(0,s._)`typeof ${N}`).if(R(j,N,A.strictNumbers),()=>b.assign(G,N))),b.if((0,s._)`${G} !== undefined`);for(const Q of D)(p.has(Q)||Q==="array"&&A.coerceTypes==="array")&&ce(Q);b.else(),g(C),b.endIf(),b.if((0,s._)`${G} !== undefined`,()=>{b.assign(N,G),T(C,G)});function ce(Q){switch(Q){case"string":b.elseIf((0,s._)`${W} == "number" || ${W} == "boolean"`).assign(G,(0,s._)`"" + ${N}`).elseIf((0,s._)`${N} === null`).assign(G,(0,s._)`""`);return;case"number":b.elseIf((0,s._)`${W} == "boolean" || ${N} === null
|
|
533
533
|
|| (${W} == "string" && ${N} && ${N} == +${N})`).assign(G,(0,s._)`+${N}`);return;case"integer":b.elseIf((0,s._)`${W} === "boolean" || ${N} === null
|
|
534
534
|
|| (${W} === "string" && ${N} && ${N} == +${N} && !(${N} % 1))`).assign(G,(0,s._)`+${N}`);return;case"boolean":b.elseIf((0,s._)`${N} === "false" || ${N} === 0 || ${N} === null`).assign(G,!1).elseIf((0,s._)`${N} === "true" || ${N} === 1`).assign(G,!0);return;case"null":b.elseIf((0,s._)`${N} === "" || ${N} === 0 || ${N} === false`),b.assign(G,null);return;case"array":b.elseIf((0,s._)`${W} === "string" || ${W} === "number"
|
|
535
|
-
|| ${W} === "boolean" || ${N} === null`).assign(G,(0,s._)`[${N}]`)}}}function T({gen:C,parentData:j,parentDataProperty:D},b){C.if((0,s._)`${j} !== undefined`,()=>C.assign((0,s._)`${j}[${D}]`,b))}function v(C,j,D,b=o.Correct){const N=b===o.Correct?s.operators.EQ:s.operators.NEQ;let A;switch(C){case"null":return(0,s._)`${j} ${N} null`;case"array":A=(0,s._)`Array.isArray(${j})`;break;case"object":A=(0,s._)`${j} && typeof ${j} == "object" && !Array.isArray(${j})`;break;case"integer":A=W((0,s._)`!(${j} % 1) && !isNaN(${j})`);break;case"number":A=W();break;default:return(0,s._)`typeof ${j} ${N} ${C}`}return b===o.Correct?A:(0,s.not)(A);function W(G=s.nil){return(0,s.and)((0,s._)`typeof ${j} == "number"`,G,D?(0,s._)`isFinite(${j})`:s.nil)}}e.checkDataType=v;function R(C,j,D,b){if(C.length===1)return v(C[0],j,D,b);let N;const A=(0,i.toHash)(C);if(A.array&&A.object){const W=(0,s._)`typeof ${j} != "object"`;N=A.null?W:(0,s._)`!${j} || ${W}`,delete A.null,delete A.array,delete A.object}else N=s.nil;A.number&&delete A.integer;for(const W in A)N=(0,s.and)(N,v(W,j,D,b));return N}e.checkDataTypes=R;const _={message:({schema:C})=>`must be ${C}`,params:({schema:C,schemaValue:j})=>typeof C=="string"?(0,s._)`{type: ${C}}`:(0,s._)`{type: ${j}}`};function g(C){const j=O(C);(0,n.reportError)(j,_)}e.reportTypeError=g;function O(C){const{gen:j,data:D,schema:b}=C,N=(0,i.schemaRefOrVal)(C,b,"type");return{gen:j,keyword:"type",data:D,schema:b.type,schemaCode:N,schemaValue:N,parentSchema:b,params:{},it:C}}})(Pr);var _n={};Object.defineProperty(_n,"__esModule",{value:!0});_n.assignDefaults=void 0;const Ft=K,qc=re;function Mc(e,t){const{properties:r,items:n}=e.schema;if(t==="object"&&r)for(const s in r)oi(e,s,r[s].default);else t==="array"&&Array.isArray(n)&&n.forEach((s,i)=>oi(e,i,s.default))}_n.assignDefaults=Mc;function oi(e,t,r){const{gen:n,compositeRule:s,data:i,opts:o}=e;if(r===void 0)return;const l=(0,Ft._)`${i}${(0,Ft.getProperty)(t)}`;if(s){(0,qc.checkStrictMode)(e,`default is ignored for: ${l}`);return}let p=(0,Ft._)`${l} === undefined`;o.useDefaults==="empty"&&(p=(0,Ft._)`${p} || ${l} === null || ${l} === ""`),n.if(p,(0,Ft._)`${l} = ${(0,Ft.stringify)(r)}`)}var Ke={},B={};Object.defineProperty(B,"__esModule",{value:!0});B.validateUnion=B.validateArray=B.usePattern=B.callValidateCode=B.schemaProperties=B.allSchemaProperties=B.noPropertyInData=B.propertyInData=B.isOwnProperty=B.hasPropFunc=B.reportMissingProp=B.checkMissingProp=B.checkReportMissingProp=void 0;const ie=K,Jn=re,tt=Ge,Uc=re;function Lc(e,t){const{gen:r,data:n,it:s}=e;r.if(Zn(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:(0,ie._)`${t}`},!0),e.error()})}B.checkReportMissingProp=Lc;function zc({gen:e,data:t,it:{opts:r}},n,s){return(0,ie.or)(...n.map(i=>(0,ie.and)(Zn(e,t,i,r.ownProperties),(0,ie._)`${s} = ${i}`)))}B.checkMissingProp=zc;function Hc(e,t){e.setParams({missingProperty:t},!0),e.error()}B.reportMissingProp=Hc;function Co(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ie._)`Object.prototype.hasOwnProperty`})}B.hasPropFunc=Co;function Yn(e,t,r){return(0,ie._)`${Co(e)}.call(${t}, ${r})`}B.isOwnProperty=Yn;function Vc(e,t,r,n){const s=(0,ie._)`${t}${(0,ie.getProperty)(r)} !== undefined`;return n?(0,ie._)`${s} && ${Yn(e,t,r)}`:s}B.propertyInData=Vc;function Zn(e,t,r,n){const s=(0,ie._)`${t}${(0,ie.getProperty)(r)} === undefined`;return n?(0,ie.or)(s,(0,ie.not)(Yn(e,t,r))):s}B.noPropertyInData=Zn;function No(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}B.allSchemaProperties=No;function Wc(e,t){return No(t).filter(r=>!(0,Jn.alwaysValidSchema)(e,t[r]))}B.schemaProperties=Wc;function xc({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:i},it:o},l,p,u){const d=u?(0,ie._)`${e}, ${t}, ${n}${s}`:t,h=[[tt.default.instancePath,(0,ie.strConcat)(tt.default.instancePath,i)],[tt.default.parentData,o.parentData],[tt.default.parentDataProperty,o.parentDataProperty],[tt.default.rootData,tt.default.rootData]];o.opts.dynamicRef&&h.push([tt.default.dynamicAnchors,tt.default.dynamicAnchors]);const w=(0,ie._)`${d}, ${r.object(...h)}`;return p!==ie.nil?(0,ie._)`${l}.call(${p}, ${w})`:(0,ie._)`${l}(${w})`}B.callValidateCode=xc;const Bc=(0,ie._)`new RegExp`;function Kc({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,ie._)`${s.code==="new RegExp"?Bc:(0,Uc.useFunc)(e,s)}(${r}, ${n})`})}B.usePattern=Kc;function Gc(e){const{gen:t,data:r,keyword:n,it:s}=e,i=t.name("valid");if(s.allErrors){const l=t.let("valid",!0);return o(()=>t.assign(l,!1)),l}return t.var(i,!0),o(()=>t.break()),i;function o(l){const p=t.const("len",(0,ie._)`${r}.length`);t.forRange("i",0,p,u=>{e.subschema({keyword:n,dataProp:u,dataPropType:Jn.Type.Num},i),t.if((0,ie.not)(i),l)})}}B.validateArray=Gc;function Jc(e){const{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(p=>(0,Jn.alwaysValidSchema)(s,p))&&!s.opts.unevaluated)return;const o=t.let("valid",!1),l=t.name("_valid");t.block(()=>r.forEach((p,u)=>{const d=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},l);t.assign(o,(0,ie._)`${o} || ${l}`),e.mergeValidEvaluated(d,l)||t.if((0,ie.not)(o))})),e.result(o,()=>e.reset(),()=>e.error(!0))}B.validateUnion=Jc;Object.defineProperty(Ke,"__esModule",{value:!0});Ke.validateKeywordUsage=Ke.validSchemaType=Ke.funcKeywordCode=Ke.macroKeywordCode=void 0;const be=K,ht=Ge,Yc=B,Zc=br;function Qc(e,t){const{gen:r,keyword:n,schema:s,parentSchema:i,it:o}=e,l=t.macro.call(o.self,s,i,o),p=ko(r,n,l);o.opts.validateSchema!==!1&&o.self.validateSchema(l,!0);const u=r.name("valid");e.subschema({schema:l,schemaPath:be.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:p,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}Ke.macroKeywordCode=Qc;function Xc(e,t){var r;const{gen:n,keyword:s,schema:i,parentSchema:o,$data:l,it:p}=e;tl(p,t);const u=!l&&t.compile?t.compile.call(p.self,i,o,p):t.validate,d=ko(n,s,u),h=n.let("valid");e.block$data(h,w),e.ok((r=t.valid)!==null&&r!==void 0?r:h);function w(){if(t.errors===!1)R(),t.modifying&&ai(e),_(()=>e.error());else{const g=t.async?T():v();t.modifying&&ai(e),_(()=>el(e,g))}}function T(){const g=n.let("ruleErrs",null);return n.try(()=>R((0,be._)`await `),O=>n.assign(h,!1).if((0,be._)`${O} instanceof ${p.ValidationError}`,()=>n.assign(g,(0,be._)`${O}.errors`),()=>n.throw(O))),g}function v(){const g=(0,be._)`${d}.errors`;return n.assign(g,null),R(be.nil),g}function R(g=t.async?(0,be._)`await `:be.nil){const O=p.opts.passContext?ht.default.this:ht.default.self,C=!("compile"in t&&!l||t.schema===!1);n.assign(h,(0,be._)`${g}${(0,Yc.callValidateCode)(e,d,O,C)}`,t.modifying)}function _(g){var O;n.if((0,be.not)((O=t.valid)!==null&&O!==void 0?O:h),g)}}Ke.funcKeywordCode=Xc;function ai(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,be._)`${n.parentData}[${n.parentDataProperty}]`))}function el(e,t){const{gen:r}=e;r.if((0,be._)`Array.isArray(${t})`,()=>{r.assign(ht.default.vErrors,(0,be._)`${ht.default.vErrors} === null ? ${t} : ${ht.default.vErrors}.concat(${t})`).assign(ht.default.errors,(0,be._)`${ht.default.vErrors}.length`),(0,Zc.extendErrors)(e)},()=>e.error())}function tl({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function ko(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,be.stringify)(r)})}function rl(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")}Ke.validSchemaType=rl;function nl({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(l=>!Object.prototype.hasOwnProperty.call(e,l)))throw new Error(`parent schema must have dependencies of ${i}: ${o.join(",")}`);if(s.validateSchema&&!s.validateSchema(e[i])){const p=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(p);else throw new Error(p)}}Ke.validateKeywordUsage=nl;var ot={};Object.defineProperty(ot,"__esModule",{value:!0});ot.extendSubschemaMode=ot.extendSubschemaData=ot.getSubschema=void 0;const Be=K,jo=re;function sl(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 l=e.schema[t];return r===void 0?{schema:l,schemaPath:(0,Be._)`${e.schemaPath}${(0,Be.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:l[r],schemaPath:(0,Be._)`${e.schemaPath}${(0,Be.getProperty)(t)}${(0,Be.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,jo.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')}ot.getSubschema=sl;function il(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:l}=t;if(r!==void 0){const{errorPath:u,dataPathArr:d,opts:h}=t,w=l.let("data",(0,Be._)`${t.data}${(0,Be.getProperty)(r)}`,!0);p(w),e.errorPath=(0,Be.str)`${u}${(0,jo.getErrorPath)(r,n,h.jsPropertySyntax)}`,e.parentDataProperty=(0,Be._)`${r}`,e.dataPathArr=[...d,e.parentDataProperty]}if(s!==void 0){const u=s instanceof Be.Name?s:l.let("data",s,!0);p(u),o!==void 0&&(e.propertyName=o)}i&&(e.dataTypes=i);function p(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}ot.extendSubschemaData=il;function ol(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}ot.extendSubschemaMode=ol;var ge={},Io=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},Ao={exports:{}},it=Ao.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(){};Mr(t,n,s,e,"",e)};it.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};it.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};it.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};it.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Mr(e,t,r,n,s,i,o,l,p,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,s,i,o,l,p,u);for(var d in n){var h=n[d];if(Array.isArray(h)){if(d in it.arrayKeywords)for(var w=0;w<h.length;w++)Mr(e,t,r,h[w],s+"/"+d+"/"+w,i,s,d,n,w)}else if(d in it.propsKeywords){if(h&&typeof h=="object")for(var T in h)Mr(e,t,r,h[T],s+"/"+d+"/"+al(T),i,s,d,n,T)}else(d in it.keywords||e.allKeys&&!(d in it.skipKeywords))&&Mr(e,t,r,h,s+"/"+d,i,s,d,n)}r(n,s,i,o,l,p,u)}}function al(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var cl=Ao.exports;Object.defineProperty(ge,"__esModule",{value:!0});ge.getSchemaRefs=ge.resolveUrl=ge.normalizeId=ge._getFullPath=ge.getFullPath=ge.inlineRef=void 0;const ll=re,ul=Io,dl=cl,pl=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function fl(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Dn(e):t?Do(e)<=t:!1}ge.inlineRef=fl;const hl=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Dn(e){for(const t in e){if(hl.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(Dn)||typeof r=="object"&&Dn(r))return!0}return!1}function Do(e){let t=0;for(const r in e){if(r==="$ref")return 1/0;if(t++,!pl.has(r)&&(typeof e[r]=="object"&&(0,ll.eachItem)(e[r],n=>t+=Do(n)),t===1/0))return 1/0}return t}function Fo(e,t="",r){r!==!1&&(t=zt(t));const n=e.parse(t);return qo(e,n)}ge.getFullPath=Fo;function qo(e,t){return e.serialize(t).split("#")[0]+"#"}ge._getFullPath=qo;const ml=/#\/?$/;function zt(e){return e?e.replace(ml,""):""}ge.normalizeId=zt;function yl(e,t,r){return r=zt(r),e.resolve(t,r)}ge.resolveUrl=yl;const gl=/^[a-z_][-a-z0-9._]*$/i;function $l(e,t){if(typeof e=="boolean")return{};const{schemaId:r,uriResolver:n}=this.opts,s=zt(e[r]||t),i={"":s},o=Fo(n,s,!1),l={},p=new Set;return dl(e,{allKeys:!0},(h,w,T,v)=>{if(v===void 0)return;const R=o+w;let _=i[v];typeof h[r]=="string"&&(_=g.call(this,h[r])),O.call(this,h.$anchor),O.call(this,h.$dynamicAnchor),i[w]=_;function g(C){const j=this.opts.uriResolver.resolve;if(C=zt(_?j(_,C):C),p.has(C))throw d(C);p.add(C);let D=this.refs[C];return typeof D=="string"&&(D=this.refs[D]),typeof D=="object"?u(h,D.schema,C):C!==zt(R)&&(C[0]==="#"?(u(h,l[C],C),l[C]=h):this.refs[C]=R),C}function O(C){if(typeof C=="string"){if(!gl.test(C))throw new Error(`invalid anchor "${C}"`);g.call(this,`#${C}`)}}}),l;function u(h,w,T){if(w!==void 0&&!ul(h,w))throw d(T)}function d(h){return new Error(`reference "${h}" resolves to more than one schema`)}}ge.getSchemaRefs=$l;Object.defineProperty(Ae,"__esModule",{value:!0});Ae.getData=Ae.KeywordCxt=Ae.validateFunctionCode=void 0;const Mo=Jt,ci=Pr,Qn=Ze,Wr=Pr,_l=_n,fr=Ke,Tn=ot,U=K,V=Ge,wl=ge,Qe=re,lr=br;function vl(e){if(zo(e)&&(Ho(e),Lo(e))){El(e);return}Uo(e,()=>(0,Mo.topBoolOrEmptySchema)(e))}Ae.validateFunctionCode=vl;function Uo({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},i){s.code.es5?e.func(t,(0,U._)`${V.default.data}, ${V.default.valCxt}`,n.$async,()=>{e.code((0,U._)`"use strict"; ${li(r,s)}`),Pl(e,s),e.code(i)}):e.func(t,(0,U._)`${V.default.data}, ${bl(s)}`,n.$async,()=>e.code(li(r,s)).code(i))}function bl(e){return(0,U._)`{${V.default.instancePath}="", ${V.default.parentData}, ${V.default.parentDataProperty}, ${V.default.rootData}=${V.default.data}${e.dynamicRef?(0,U._)`, ${V.default.dynamicAnchors}={}`:U.nil}}={}`}function Pl(e,t){e.if(V.default.valCxt,()=>{e.var(V.default.instancePath,(0,U._)`${V.default.valCxt}.${V.default.instancePath}`),e.var(V.default.parentData,(0,U._)`${V.default.valCxt}.${V.default.parentData}`),e.var(V.default.parentDataProperty,(0,U._)`${V.default.valCxt}.${V.default.parentDataProperty}`),e.var(V.default.rootData,(0,U._)`${V.default.valCxt}.${V.default.rootData}`),t.dynamicRef&&e.var(V.default.dynamicAnchors,(0,U._)`${V.default.valCxt}.${V.default.dynamicAnchors}`)},()=>{e.var(V.default.instancePath,(0,U._)`""`),e.var(V.default.parentData,(0,U._)`undefined`),e.var(V.default.parentDataProperty,(0,U._)`undefined`),e.var(V.default.rootData,V.default.data),t.dynamicRef&&e.var(V.default.dynamicAnchors,(0,U._)`{}`)})}function El(e){const{schema:t,opts:r,gen:n}=e;Uo(e,()=>{r.$comment&&t.$comment&&Wo(e),Cl(e),n.let(V.default.vErrors,null),n.let(V.default.errors,0),r.unevaluated&&Sl(e),Vo(e),jl(e)})}function Sl(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,U._)`${r}.evaluated`),t.if((0,U._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,U._)`${e.evaluated}.props`,(0,U._)`undefined`)),t.if((0,U._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,U._)`${e.evaluated}.items`,(0,U._)`undefined`))}function li(e,t){const r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,U._)`/*# sourceURL=${r} */`:U.nil}function Tl(e,t){if(zo(e)&&(Ho(e),Lo(e))){Rl(e,t);return}(0,Mo.boolOrEmptySchema)(e,t)}function Lo({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 zo(e){return typeof e.schema!="boolean"}function Rl(e,t){const{schema:r,gen:n,opts:s}=e;s.$comment&&r.$comment&&Wo(e),Nl(e),kl(e);const i=n.const("_errs",V.default.errors);Vo(e,i),n.var(t,(0,U._)`${i} === ${V.default.errors}`)}function Ho(e){(0,Qe.checkUnknownRules)(e),Ol(e)}function Vo(e,t){if(e.opts.jtd)return ui(e,[],!1,t);const r=(0,ci.getSchemaTypes)(e.schema),n=(0,ci.coerceAndCheckDataType)(e,r);ui(e,r,!n,t)}function Ol(e){const{schema:t,errSchemaPath:r,opts:n,self:s}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,Qe.schemaHasRulesButRef)(t,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function Cl(e){const{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Qe.checkStrictMode)(e,"default is ignored in the schema root")}function Nl(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,wl.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function kl(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function Wo({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:s}){const i=r.$comment;if(s.$comment===!0)e.code((0,U._)`${V.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){const o=(0,U.str)`${n}/$comment`,l=e.scopeValue("root",{ref:t.root});e.code((0,U._)`${V.default.self}.opts.$comment(${i}, ${o}, ${l}.schema)`)}}function jl(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:i}=e;r.$async?t.if((0,U._)`${V.default.errors} === 0`,()=>t.return(V.default.data),()=>t.throw((0,U._)`new ${s}(${V.default.vErrors})`)):(t.assign((0,U._)`${n}.errors`,V.default.vErrors),i.unevaluated&&Il(e),t.return((0,U._)`${V.default.errors} === 0`))}function Il({gen:e,evaluated:t,props:r,items:n}){r instanceof U.Name&&e.assign((0,U._)`${t}.props`,r),n instanceof U.Name&&e.assign((0,U._)`${t}.items`,n)}function ui(e,t,r,n){const{gen:s,schema:i,data:o,allErrors:l,opts:p,self:u}=e,{RULES:d}=u;if(i.$ref&&(p.ignoreKeywordsWithRef||!(0,Qe.schemaHasRulesButRef)(i,d))){s.block(()=>Ko(e,"$ref",d.all.$ref.definition));return}p.jtd||Al(e,t),s.block(()=>{for(const w of d.rules)h(w);h(d.post)});function h(w){(0,Qn.shouldUseGroup)(i,w)&&(w.type?(s.if((0,Wr.checkDataType)(w.type,o,p.strictNumbers)),di(e,w),t.length===1&&t[0]===w.type&&r&&(s.else(),(0,Wr.reportTypeError)(e)),s.endIf()):di(e,w),l||s.if((0,U._)`${V.default.errors} === ${n||0}`))}}function di(e,t){const{gen:r,schema:n,opts:{useDefaults:s}}=e;s&&(0,_l.assignDefaults)(e,t.type),r.block(()=>{for(const i of t.rules)(0,Qn.shouldUseRule)(n,i)&&Ko(e,i.keyword,i.definition,t.type)})}function Al(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(Dl(e,t),e.opts.allowUnionTypes||Fl(e,t),ql(e,e.dataTypes))}function Dl(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{xo(e.dataTypes,r)||Xn(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),Ul(e,t)}}function Fl(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&Xn(e,"use allowUnionTypes to allow union type keyword")}function ql(e,t){const r=e.self.RULES.all;for(const n in r){const s=r[n];if(typeof s=="object"&&(0,Qn.shouldUseRule)(e.schema,s)){const{type:i}=s.definition;i.length&&!i.some(o=>Ml(t,o))&&Xn(e,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function Ml(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function xo(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function Ul(e,t){const r=[];for(const n of e.dataTypes)xo(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function Xn(e,t){const r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,Qe.checkStrictMode)(e,t,e.opts.strictTypes)}class Bo{constructor(t,r,n){if((0,fr.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,Qe.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",Go(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,fr.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,U.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,U.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,U._)`${r} !== undefined && (${(0,U.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?lr.reportExtraError:lr.reportError)(this,this.def.error,r)}$dataError(){(0,lr.reportError)(this,this.def.$dataError||lr.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,lr.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=U.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=U.nil,r=U.nil){if(!this.$data)return;const{gen:n,schemaCode:s,schemaType:i,def:o}=this;n.if((0,U.or)((0,U._)`${s} === undefined`,r)),t!==U.nil&&n.assign(t,!0),(i.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==U.nil&&n.assign(t,!1)),n.else()}invalid$data(){const{gen:t,schemaCode:r,schemaType:n,def:s,it:i}=this;return(0,U.or)(o(),l());function o(){if(n.length){if(!(r instanceof U.Name))throw new Error("ajv implementation error");const p=Array.isArray(n)?n:[n];return(0,U._)`${(0,Wr.checkDataTypes)(p,r,i.opts.strictNumbers,Wr.DataType.Wrong)}`}return U.nil}function l(){if(s.validateSchema){const p=t.scopeValue("validate$data",{ref:s.validateSchema});return(0,U._)`!${p}(${r})`}return U.nil}}subschema(t,r){const n=(0,Tn.getSubschema)(this.it,t);(0,Tn.extendSubschemaData)(n,this.it,t),(0,Tn.extendSubschemaMode)(n,t);const s={...this.it,...n,items:void 0,props:void 0};return Tl(s,r),s}mergeEvaluated(t,r){const{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=Qe.mergeEvaluated.props(s,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=Qe.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,U.Name)),!0}}Ae.KeywordCxt=Bo;function Ko(e,t,r,n){const s=new Bo(e,r,t);"code"in r?r.code(s,n):s.$data&&r.validate?(0,fr.funcKeywordCode)(s,r):"macro"in r?(0,fr.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,fr.funcKeywordCode)(s,r)}const Ll=/^\/(?:[^~]|~0|~1)*$/,zl=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Go(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,i;if(e==="")return V.default.rootData;if(e[0]==="/"){if(!Ll.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);s=e,i=V.default.rootData}else{const u=zl.exec(e);if(!u)throw new Error(`Invalid JSON-pointer: ${e}`);const d=+u[1];if(s=u[2],s==="#"){if(d>=t)throw new Error(p("property/index",d));return n[t-d]}if(d>t)throw new Error(p("data",d));if(i=r[t-d],!s)return i}let o=i;const l=s.split("/");for(const u of l)u&&(i=(0,U._)`${i}${(0,U.getProperty)((0,Qe.unescapeJsonPointer)(u))}`,o=(0,U._)`${o} && ${i}`);return o;function p(u,d){return`Cannot access ${u} ${d} levels up, current level is ${t}`}}Ae.getData=Go;var Er={};Object.defineProperty(Er,"__esModule",{value:!0});class Hl extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}Er.default=Hl;var Sr={};Object.defineProperty(Sr,"__esModule",{value:!0});const Rn=ge;class Vl extends Error{constructor(t,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Rn.resolveUrl)(t,r,n),this.missingSchema=(0,Rn.normalizeId)((0,Rn.getFullPath)(t,this.missingRef))}}Sr.default=Vl;var Se={};Object.defineProperty(Se,"__esModule",{value:!0});Se.resolveSchema=Se.getCompilingSchema=Se.resolveRef=Se.compileSchema=Se.SchemaEnv=void 0;const ke=K,Wl=Er,ft=Ge,Ie=ge,pi=re,xl=Ae;class wn{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,Ie.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={}}}Se.SchemaEnv=wn;function es(e){const t=Jo.call(this,e);if(t)return t;const r=(0,Ie.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 l;e.$async&&(l=o.scopeValue("Error",{ref:Wl.default,code:(0,ke._)`require("ajv/dist/runtime/validation_error").default`}));const p=o.scopeName("validate");e.validateName=p;const u={gen:o,allErrors:this.opts.allErrors,data:ft.default.data,parentData:ft.default.parentData,parentDataProperty:ft.default.parentDataProperty,dataNames:[ft.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:p,ValidationError:l,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,xl.validateFunctionCode)(u),o.optimize(this.opts.code.optimize);const h=o.toString();d=`${o.scopeRefs(ft.default.scope)}return ${h}`,this.opts.code.process&&(d=this.opts.code.process(d,e));const T=new Function(`${ft.default.self}`,`${ft.default.scope}`,d)(this,this.scope.get());if(this.scope.value(p,{ref:T}),T.errors=null,T.schema=e.schema,T.schemaEnv=e,e.$async&&(T.$async=!0),this.opts.code.source===!0&&(T.source={validateName:p,validateCode:h,scopeValues:o._values}),this.opts.unevaluated){const{props:v,items:R}=u;T.evaluated={props:v instanceof ke.Name?void 0:v,items:R instanceof ke.Name?void 0:R,dynamicProps:v instanceof ke.Name,dynamicItems:R instanceof ke.Name},T.source&&(T.source.evaluated=(0,ke.stringify)(T.evaluated))}return e.validate=T,e}catch(h){throw delete e.validate,delete e.validateName,d&&this.logger.error("Error compiling schema, function code:",d),h}finally{this._compilations.delete(e)}}Se.compileSchema=es;function Bl(e,t,r){var n;r=(0,Ie.resolveUrl)(this.opts.uriResolver,t,r);const s=e.refs[r];if(s)return s;let i=Jl.call(this,e,r);if(i===void 0){const o=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:l}=this.opts;o&&(i=new wn({schema:o,schemaId:l,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=Kl.call(this,i)}Se.resolveRef=Bl;function Kl(e){return(0,Ie.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:es.call(this,e)}function Jo(e){for(const t of this._compilations)if(Gl(t,e))return t}Se.getCompilingSchema=Jo;function Gl(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Jl(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||vn.call(this,e,t)}function vn(e,t){const r=this.opts.uriResolver.parse(t),n=(0,Ie._getFullPath)(this.opts.uriResolver,r);let s=(0,Ie.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return On.call(this,r,e);const i=(0,Ie.normalizeId)(n),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){const l=vn.call(this,e,o);return typeof(l==null?void 0:l.schema)!="object"?void 0:On.call(this,r,l)}if(typeof(o==null?void 0:o.schema)=="object"){if(o.validate||es.call(this,o),i===(0,Ie.normalizeId)(t)){const{schema:l}=o,{schemaId:p}=this.opts,u=l[p];return u&&(s=(0,Ie.resolveUrl)(this.opts.uriResolver,s,u)),new wn({schema:l,schemaId:p,root:e,baseId:s})}return On.call(this,r,o)}}Se.resolveSchema=vn;const Yl=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function On(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(const l of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const p=r[(0,pi.unescapeFragment)(l)];if(p===void 0)return;r=p;const u=typeof r=="object"&&r[this.opts.schemaId];!Yl.has(l)&&u&&(t=(0,Ie.resolveUrl)(this.opts.uriResolver,t,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,pi.schemaHasRulesButRef)(r,this.RULES)){const l=(0,Ie.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=vn.call(this,n,l)}const{schemaId:o}=this.opts;if(i=i||new wn({schema:r,schemaId:o,root:n,baseId:t}),i.schema!==i.root.schema)return i}const Zl="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Ql="Meta-schema for $data reference (JSON AnySchema extension proposal)",Xl="object",eu=["$data"],tu={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},ru=!1,nu={$id:Zl,description:Ql,type:Xl,required:eu,properties:tu,additionalProperties:ru};var ts={},Fn={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)})(Pc,function(r){function n(){for(var f=arguments.length,c=Array(f),y=0;y<f;y++)c[y]=arguments[y];if(c.length>1){c[0]=c[0].slice(0,-1);for(var S=c.length-1,E=1;E<S;++E)c[E]=c[E].slice(1,-1);return c[S]=c[S].slice(1),c.join("")}else return c[0]}function s(f){return"(?:"+f+")"}function i(f){return f===void 0?"undefined":f===null?"null":Object.prototype.toString.call(f).split(" ").pop().split("]").shift().toLowerCase()}function o(f){return f.toUpperCase()}function l(f){return f!=null?f instanceof Array?f:typeof f.length!="number"||f.split||f.setInterval||f.call?[f]:Array.prototype.slice.call(f):[]}function p(f,c){var y=f;if(c)for(var S in c)y[S]=c[S];return y}function u(f){var c="[A-Za-z]",y="[0-9]",S=n(y,"[A-Fa-f]"),E=s(s("%[EFef]"+S+"%"+S+S+"%"+S+S)+"|"+s("%[89A-Fa-f]"+S+"%"+S+S)+"|"+s("%"+S+S)),L="[\\:\\/\\?\\#\\[\\]\\@]",z="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",X=n(L,z),se=f?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",ue=f?"[\\uE000-\\uF8FF]":"[]",Y=n(c,y,"[\\-\\.\\_\\~]",se);s(c+n(c,y,"[\\+\\-\\.]")+"*"),s(s(E+"|"+n(Y,z,"[\\:]"))+"*");var ne=s(s("25[0-5]")+"|"+s("2[0-4]"+y)+"|"+s("1"+y+y)+"|"+s("0?[1-9]"+y)+"|0?0?"+y),de=s(ne+"\\."+ne+"\\."+ne+"\\."+ne),x=s(S+"{1,4}"),oe=s(s(x+"\\:"+x)+"|"+de),me=s(s(x+"\\:")+"{6}"+oe),ae=s("\\:\\:"+s(x+"\\:")+"{5}"+oe),Xe=s(s(x)+"?\\:\\:"+s(x+"\\:")+"{4}"+oe),ze=s(s(s(x+"\\:")+"{0,1}"+x)+"?\\:\\:"+s(x+"\\:")+"{3}"+oe),He=s(s(s(x+"\\:")+"{0,2}"+x)+"?\\:\\:"+s(x+"\\:")+"{2}"+oe),At=s(s(s(x+"\\:")+"{0,3}"+x)+"?\\:\\:"+x+"\\:"+oe),dt=s(s(s(x+"\\:")+"{0,4}"+x)+"?\\:\\:"+oe),Ce=s(s(s(x+"\\:")+"{0,5}"+x)+"?\\:\\:"+x),Ve=s(s(s(x+"\\:")+"{0,6}"+x)+"?\\:\\:"),pt=s([me,ae,Xe,ze,He,At,dt,Ce,Ve].join("|")),Je=s(s(Y+"|"+E)+"+");s("[vV]"+S+"+\\."+n(Y,z,"[\\:]")+"+"),s(s(E+"|"+n(Y,z))+"*");var ar=s(E+"|"+n(Y,z,"[\\:\\@]"));return s(s(E+"|"+n(Y,z,"[\\@]"))+"+"),s(s(ar+"|"+n("[\\/\\?]",ue))+"*"),{NOT_SCHEME:new RegExp(n("[^]",c,y,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(n("[^\\%\\:]",Y,z),"g"),NOT_HOST:new RegExp(n("[^\\%\\[\\]\\:]",Y,z),"g"),NOT_PATH:new RegExp(n("[^\\%\\/\\:\\@]",Y,z),"g"),NOT_PATH_NOSCHEME:new RegExp(n("[^\\%\\/\\@]",Y,z),"g"),NOT_QUERY:new RegExp(n("[^\\%]",Y,z,"[\\:\\@\\/\\?]",ue),"g"),NOT_FRAGMENT:new RegExp(n("[^\\%]",Y,z,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(n("[^]",Y,z),"g"),UNRESERVED:new RegExp(Y,"g"),OTHER_CHARS:new RegExp(n("[^\\%]",Y,X),"g"),PCT_ENCODED:new RegExp(E,"g"),IPV4ADDRESS:new RegExp("^("+de+")$"),IPV6ADDRESS:new RegExp("^\\[?("+pt+")"+s(s("\\%25|\\%(?!"+S+"{2})")+"("+Je+")")+"?\\]?$")}}var d=u(!1),h=u(!0),w=function(){function f(c,y){var S=[],E=!0,L=!1,z=void 0;try{for(var X=c[Symbol.iterator](),se;!(E=(se=X.next()).done)&&(S.push(se.value),!(y&&S.length===y));E=!0);}catch(ue){L=!0,z=ue}finally{try{!E&&X.return&&X.return()}finally{if(L)throw z}}return S}return function(c,y){if(Array.isArray(c))return c;if(Symbol.iterator in Object(c))return f(c,y);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),T=function(f){if(Array.isArray(f)){for(var c=0,y=Array(f.length);c<f.length;c++)y[c]=f[c];return y}else return Array.from(f)},v=2147483647,R=36,_=1,g=26,O=38,C=700,j=72,D=128,b="-",N=/^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"},ce=R-_,Q=Math.floor,Re=String.fromCharCode;function he(f){throw new RangeError(G[f])}function at(f,c){for(var y=[],S=f.length;S--;)y[S]=c(f[S]);return y}function ct(f,c){var y=f.split("@"),S="";y.length>1&&(S=y[0]+"@",f=y[1]),f=f.replace(W,".");var E=f.split("."),L=at(E,c).join(".");return S+L}function Tt(f){for(var c=[],y=0,S=f.length;y<S;){var E=f.charCodeAt(y++);if(E>=55296&&E<=56319&&y<S){var L=f.charCodeAt(y++);(L&64512)==56320?c.push(((E&1023)<<10)+(L&1023)+65536):(c.push(E),y--)}else c.push(E)}return c}var Xt=function(c){return String.fromCodePoint.apply(String,T(c))},Rt=function(c){return c-48<10?c-22:c-65<26?c-65:c-97<26?c-97:R},F=function(c,y){return c+22+75*(c<26)-((y!=0)<<5)},$=function(c,y,S){var E=0;for(c=S?Q(c/C):c>>1,c+=Q(c/y);c>ce*g>>1;E+=R)c=Q(c/ce);return Q(E+(ce+1)*c/(c+O))},I=function(c){var y=[],S=c.length,E=0,L=D,z=j,X=c.lastIndexOf(b);X<0&&(X=0);for(var se=0;se<X;++se)c.charCodeAt(se)>=128&&he("not-basic"),y.push(c.charCodeAt(se));for(var ue=X>0?X+1:0;ue<S;){for(var Y=E,ne=1,de=R;;de+=R){ue>=S&&he("invalid-input");var x=Rt(c.charCodeAt(ue++));(x>=R||x>Q((v-E)/ne))&&he("overflow"),E+=x*ne;var oe=de<=z?_:de>=z+g?g:de-z;if(x<oe)break;var me=R-oe;ne>Q(v/me)&&he("overflow"),ne*=me}var ae=y.length+1;z=$(E-Y,ae,Y==0),Q(E/ae)>v-L&&he("overflow"),L+=Q(E/ae),E%=ae,y.splice(E++,0,L)}return String.fromCodePoint.apply(String,y)},P=function(c){var y=[];c=Tt(c);var S=c.length,E=D,L=0,z=j,X=!0,se=!1,ue=void 0;try{for(var Y=c[Symbol.iterator](),ne;!(X=(ne=Y.next()).done);X=!0){var de=ne.value;de<128&&y.push(Re(de))}}catch(cr){se=!0,ue=cr}finally{try{!X&&Y.return&&Y.return()}finally{if(se)throw ue}}var x=y.length,oe=x;for(x&&y.push(b);oe<S;){var me=v,ae=!0,Xe=!1,ze=void 0;try{for(var He=c[Symbol.iterator](),At;!(ae=(At=He.next()).done);ae=!0){var dt=At.value;dt>=E&&dt<me&&(me=dt)}}catch(cr){Xe=!0,ze=cr}finally{try{!ae&&He.return&&He.return()}finally{if(Xe)throw ze}}var Ce=oe+1;me-E>Q((v-L)/Ce)&&he("overflow"),L+=(me-E)*Ce,E=me;var Ve=!0,pt=!1,Je=void 0;try{for(var ar=c[Symbol.iterator](),Vs;!(Ve=(Vs=ar.next()).done);Ve=!0){var Ws=Vs.value;if(Ws<E&&++L>v&&he("overflow"),Ws==E){for(var Or=L,Cr=R;;Cr+=R){var Nr=Cr<=z?_:Cr>=z+g?g:Cr-z;if(Or<Nr)break;var xs=Or-Nr,Bs=R-Nr;y.push(Re(F(Nr+xs%Bs,0))),Or=Q(xs/Bs)}y.push(Re(F(Or,0))),z=$(L,Ce,oe==x),L=0,++oe}}}catch(cr){pt=!0,Je=cr}finally{try{!Ve&&ar.return&&ar.return()}finally{if(pt)throw Je}}++L,++E}return y.join("")},a=function(c){return ct(c,function(y){return N.test(y)?I(y.slice(4).toLowerCase()):y})},m=function(c){return ct(c,function(y){return A.test(y)?"xn--"+P(y):y})},k={version:"2.1.0",ucs2:{decode:Tt,encode:Xt},decode:I,encode:P,toASCII:m,toUnicode:a},q={};function M(f){var c=f.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 J(f){for(var c="",y=0,S=f.length;y<S;){var E=parseInt(f.substr(y+1,2),16);if(E<128)c+=String.fromCharCode(E),y+=3;else if(E>=194&&E<224){if(S-y>=6){var L=parseInt(f.substr(y+4,2),16);c+=String.fromCharCode((E&31)<<6|L&63)}else c+=f.substr(y,6);y+=6}else if(E>=224){if(S-y>=9){var z=parseInt(f.substr(y+4,2),16),X=parseInt(f.substr(y+7,2),16);c+=String.fromCharCode((E&15)<<12|(z&63)<<6|X&63)}else c+=f.substr(y,9);y+=9}else c+=f.substr(y,3),y+=3}return c}function Z(f,c){function y(S){var E=J(S);return E.match(c.UNRESERVED)?E:S}return f.scheme&&(f.scheme=String(f.scheme).replace(c.PCT_ENCODED,y).toLowerCase().replace(c.NOT_SCHEME,"")),f.userinfo!==void 0&&(f.userinfo=String(f.userinfo).replace(c.PCT_ENCODED,y).replace(c.NOT_USERINFO,M).replace(c.PCT_ENCODED,o)),f.host!==void 0&&(f.host=String(f.host).replace(c.PCT_ENCODED,y).toLowerCase().replace(c.NOT_HOST,M).replace(c.PCT_ENCODED,o)),f.path!==void 0&&(f.path=String(f.path).replace(c.PCT_ENCODED,y).replace(f.scheme?c.NOT_PATH:c.NOT_PATH_NOSCHEME,M).replace(c.PCT_ENCODED,o)),f.query!==void 0&&(f.query=String(f.query).replace(c.PCT_ENCODED,y).replace(c.NOT_QUERY,M).replace(c.PCT_ENCODED,o)),f.fragment!==void 0&&(f.fragment=String(f.fragment).replace(c.PCT_ENCODED,y).replace(c.NOT_FRAGMENT,M).replace(c.PCT_ENCODED,o)),f}function le(f){return f.replace(/^0*(.*)/,"$1")||"0"}function Me(f,c){var y=f.match(c.IPV4ADDRESS)||[],S=w(y,2),E=S[1];return E?E.split(".").map(le).join("."):f}function Ot(f,c){var y=f.match(c.IPV6ADDRESS)||[],S=w(y,3),E=S[1],L=S[2];if(E){for(var z=E.toLowerCase().split("::").reverse(),X=w(z,2),se=X[0],ue=X[1],Y=ue?ue.split(":").map(le):[],ne=se.split(":").map(le),de=c.IPV4ADDRESS.test(ne[ne.length-1]),x=de?7:8,oe=ne.length-x,me=Array(x),ae=0;ae<x;++ae)me[ae]=Y[ae]||ne[oe+ae]||"";de&&(me[x-1]=Me(me[x-1],c));var Xe=me.reduce(function(Ce,Ve,pt){if(!Ve||Ve==="0"){var Je=Ce[Ce.length-1];Je&&Je.index+Je.length===pt?Je.length++:Ce.push({index:pt,length:1})}return Ce},[]),ze=Xe.sort(function(Ce,Ve){return Ve.length-Ce.length})[0],He=void 0;if(ze&&ze.length>1){var At=me.slice(0,ze.index),dt=me.slice(ze.index+ze.length);He=At.join(":")+"::"+dt.join(":")}else He=me.join(":");return L&&(He+="%"+L),He}else return f}var er=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,tr="".match(/(){0}/)[1]===void 0;function Te(f){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y={},S=c.iri!==!1?h:d;c.reference==="suffix"&&(f=(c.scheme?c.scheme+":":"")+"//"+f);var E=f.match(er);if(E){tr?(y.scheme=E[1],y.userinfo=E[3],y.host=E[4],y.port=parseInt(E[5],10),y.path=E[6]||"",y.query=E[7],y.fragment=E[8],isNaN(y.port)&&(y.port=E[5])):(y.scheme=E[1]||void 0,y.userinfo=f.indexOf("@")!==-1?E[3]:void 0,y.host=f.indexOf("//")!==-1?E[4]:void 0,y.port=parseInt(E[5],10),y.path=E[6]||"",y.query=f.indexOf("?")!==-1?E[7]:void 0,y.fragment=f.indexOf("#")!==-1?E[8]:void 0,isNaN(y.port)&&(y.port=f.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?E[4]:void 0)),y.host&&(y.host=Ot(Me(y.host,S),S)),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 L=q[(c.scheme||y.scheme||"").toLowerCase()];if(!c.unicodeSupport&&(!L||!L.unicodeSupport)){if(y.host&&(c.domainHost||L&&L.domainHost))try{y.host=k.toASCII(y.host.replace(S.PCT_ENCODED,J).toLowerCase())}catch(z){y.error=y.error||"Host's domain name can not be converted to ASCII via punycode: "+z}Z(y,d)}else Z(y,S);L&&L.parse&&L.parse(y,c)}else y.error=y.error||"URI can not be parsed.";return y}function rr(f,c){var y=c.iri!==!1?h:d,S=[];return f.userinfo!==void 0&&(S.push(f.userinfo),S.push("@")),f.host!==void 0&&S.push(Ot(Me(String(f.host),y),y).replace(y.IPV6ADDRESS,function(E,L,z){return"["+L+(z?"%25"+z:"")+"]"})),(typeof f.port=="number"||typeof f.port=="string")&&(S.push(":"),S.push(String(f.port))),S.length?S.join(""):void 0}var Ct=/^\.\.?\//,Nt=/^\/\.(\/|$)/,kt=/^\/\.\.(\/|$)/,nr=/^\/?(?:.|\n)*?(?=\/|$)/;function Ue(f){for(var c=[];f.length;)if(f.match(Ct))f=f.replace(Ct,"");else if(f.match(Nt))f=f.replace(Nt,"/");else if(f.match(kt))f=f.replace(kt,"/"),c.pop();else if(f==="."||f==="..")f="";else{var y=f.match(nr);if(y){var S=y[0];f=f.slice(S.length),c.push(S)}else throw new Error("Unexpected dot segment condition")}return c.join("")}function Pe(f){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y=c.iri?h:d,S=[],E=q[(c.scheme||f.scheme||"").toLowerCase()];if(E&&E.serialize&&E.serialize(f,c),f.host&&!y.IPV6ADDRESS.test(f.host)){if(c.domainHost||E&&E.domainHost)try{f.host=c.iri?k.toUnicode(f.host):k.toASCII(f.host.replace(y.PCT_ENCODED,J).toLowerCase())}catch(X){f.error=f.error||"Host's domain name can not be converted to "+(c.iri?"Unicode":"ASCII")+" via punycode: "+X}}Z(f,y),c.reference!=="suffix"&&f.scheme&&(S.push(f.scheme),S.push(":"));var L=rr(f,c);if(L!==void 0&&(c.reference!=="suffix"&&S.push("//"),S.push(L),f.path&&f.path.charAt(0)!=="/"&&S.push("/")),f.path!==void 0){var z=f.path;!c.absolutePath&&(!E||!E.absolutePath)&&(z=Ue(z)),L===void 0&&(z=z.replace(/^\/\//,"/%2F")),S.push(z)}return f.query!==void 0&&(S.push("?"),S.push(f.query)),f.fragment!==void 0&&(S.push("#"),S.push(f.fragment)),S.join("")}function jt(f,c){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},S=arguments[3],E={};return S||(f=Te(Pe(f,y),y),c=Te(Pe(c,y),y)),y=y||{},!y.tolerant&&c.scheme?(E.scheme=c.scheme,E.userinfo=c.userinfo,E.host=c.host,E.port=c.port,E.path=Ue(c.path||""),E.query=c.query):(c.userinfo!==void 0||c.host!==void 0||c.port!==void 0?(E.userinfo=c.userinfo,E.host=c.host,E.port=c.port,E.path=Ue(c.path||""),E.query=c.query):(c.path?(c.path.charAt(0)==="/"?E.path=Ue(c.path):((f.userinfo!==void 0||f.host!==void 0||f.port!==void 0)&&!f.path?E.path="/"+c.path:f.path?E.path=f.path.slice(0,f.path.lastIndexOf("/")+1)+c.path:E.path=c.path,E.path=Ue(E.path)),E.query=c.query):(E.path=f.path,c.query!==void 0?E.query=c.query:E.query=f.query),E.userinfo=f.userinfo,E.host=f.host,E.port=f.port),E.scheme=f.scheme),E.fragment=c.fragment,E}function sr(f,c,y){var S=p({scheme:"null"},y);return Pe(jt(Te(f,S),Te(c,S),S,!0),S)}function lt(f,c){return typeof f=="string"?f=Pe(Te(f,c),c):i(f)==="object"&&(f=Te(Pe(f,c),c)),f}function ir(f,c,y){return typeof f=="string"?f=Pe(Te(f,y),y):i(f)==="object"&&(f=Pe(f,y)),typeof c=="string"?c=Pe(Te(c,y),y):i(c)==="object"&&(c=Pe(c,y)),f===c}function Rr(f,c){return f&&f.toString().replace(!c||!c.iri?d.ESCAPE:h.ESCAPE,M)}function Oe(f,c){return f&&f.toString().replace(!c||!c.iri?d.PCT_ENCODED:h.PCT_ENCODED,J)}var ut={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 S=String(c.scheme).toLowerCase()==="https";return(c.port===(S?443:80)||c.port==="")&&(c.port=void 0),c.path||(c.path="/"),c}},Ds={scheme:"https",domainHost:ut.domainHost,parse:ut.parse,serialize:ut.serialize};function Fs(f){return typeof f.secure=="boolean"?f.secure:String(f.scheme).toLowerCase()==="wss"}var or={scheme:"ws",domainHost:!0,parse:function(c,y){var S=c;return S.secure=Fs(S),S.resourceName=(S.path||"/")+(S.query?"?"+S.query:""),S.path=void 0,S.query=void 0,S},serialize:function(c,y){if((c.port===(Fs(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 S=c.resourceName.split("?"),E=w(S,2),L=E[0],z=E[1];c.path=L&&L!=="/"?L:void 0,c.query=z,c.resourceName=void 0}return c.fragment=void 0,c}},qs={scheme:"wss",domainHost:or.domainHost,parse:or.parse,serialize:or.serialize},ga={},Ms="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Le="[0-9A-Fa-f]",$a=s(s("%[EFef]"+Le+"%"+Le+Le+"%"+Le+Le)+"|"+s("%[89A-Fa-f]"+Le+"%"+Le+Le)+"|"+s("%"+Le+Le)),_a="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",wa="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",va=n(wa,'[\\"\\\\]'),ba="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Pa=new RegExp(Ms,"g"),It=new RegExp($a,"g"),Ea=new RegExp(n("[^]",_a,"[\\.]",'[\\"]',va),"g"),Us=new RegExp(n("[^]",Ms,ba),"g"),Sa=Us;function Pn(f){var c=J(f);return c.match(Pa)?c:f}var Ls={scheme:"mailto",parse:function(c,y){var S=c,E=S.to=S.path?S.path.split(","):[];if(S.path=void 0,S.query){for(var L=!1,z={},X=S.query.split("&"),se=0,ue=X.length;se<ue;++se){var Y=X[se].split("=");switch(Y[0]){case"to":for(var ne=Y[1].split(","),de=0,x=ne.length;de<x;++de)E.push(ne[de]);break;case"subject":S.subject=Oe(Y[1],y);break;case"body":S.body=Oe(Y[1],y);break;default:L=!0,z[Oe(Y[0],y)]=Oe(Y[1],y);break}}L&&(S.headers=z)}S.query=void 0;for(var oe=0,me=E.length;oe<me;++oe){var ae=E[oe].split("@");if(ae[0]=Oe(ae[0]),y.unicodeSupport)ae[1]=Oe(ae[1],y).toLowerCase();else try{ae[1]=k.toASCII(Oe(ae[1],y).toLowerCase())}catch(Xe){S.error=S.error||"Email address's domain name can not be converted to ASCII via punycode: "+Xe}E[oe]=ae.join("@")}return S},serialize:function(c,y){var S=c,E=l(c.to);if(E){for(var L=0,z=E.length;L<z;++L){var X=String(E[L]),se=X.lastIndexOf("@"),ue=X.slice(0,se).replace(It,Pn).replace(It,o).replace(Ea,M),Y=X.slice(se+1);try{Y=y.iri?k.toUnicode(Y):k.toASCII(Oe(Y,y).toLowerCase())}catch(oe){S.error=S.error||"Email address's domain name can not be converted to "+(y.iri?"Unicode":"ASCII")+" via punycode: "+oe}E[L]=ue+"@"+Y}S.path=E.join(",")}var ne=c.headers=c.headers||{};c.subject&&(ne.subject=c.subject),c.body&&(ne.body=c.body);var de=[];for(var x in ne)ne[x]!==ga[x]&&de.push(x.replace(It,Pn).replace(It,o).replace(Us,M)+"="+ne[x].replace(It,Pn).replace(It,o).replace(Sa,M));return de.length&&(S.query=de.join("&")),S}},Ta=/^([^\:]+)\:(.*)/,zs={scheme:"urn",parse:function(c,y){var S=c.path&&c.path.match(Ta),E=c;if(S){var L=y.scheme||E.scheme||"urn",z=S[1].toLowerCase(),X=S[2],se=L+":"+(y.nid||z),ue=q[se];E.nid=z,E.nss=X,E.path=void 0,ue&&(E=ue.parse(E,y))}else E.error=E.error||"URN can not be parsed.";return E},serialize:function(c,y){var S=y.scheme||c.scheme||"urn",E=c.nid,L=S+":"+(y.nid||E),z=q[L];z&&(c=z.serialize(c,y));var X=c,se=c.nss;return X.path=(E||y.nid)+":"+se,X}},Ra=/^[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 S=c;return S.uuid=S.nss,S.nss=void 0,!y.tolerant&&(!S.uuid||!S.uuid.match(Ra))&&(S.error=S.error||"UUID is not valid."),S},serialize:function(c,y){var S=c;return S.nss=(c.uuid||"").toLowerCase(),S}};q[ut.scheme]=ut,q[Ds.scheme]=Ds,q[or.scheme]=or,q[qs.scheme]=qs,q[Ls.scheme]=Ls,q[zs.scheme]=zs,q[Hs.scheme]=Hs,r.SCHEMES=q,r.pctEncChar=M,r.pctDecChars=J,r.parse=Te,r.removeDotSegments=Ue,r.serialize=Pe,r.resolveComponents=jt,r.resolve=sr,r.normalize=lt,r.equal=ir,r.escapeComponent=Rr,r.unescapeComponent=Oe,Object.defineProperty(r,"__esModule",{value:!0})})})(Fn,Fn.exports);var su=Fn.exports;Object.defineProperty(ts,"__esModule",{value:!0});const Yo=su;Yo.code='require("ajv/dist/runtime/uri").default';ts.default=Yo;(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=Ae;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=K;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=Er,s=Sr,i=Pt,o=Se,l=K,p=ge,u=Pr,d=re,h=nu,w=ts,T=(F,$)=>new RegExp(F,$);T.code="new RegExp";const v=["removeAdditional","useDefaults","coerceTypes"],R=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.'},O=200;function C(F){var $,I,P,a,m,k,q,M,J,Z,le,Me,Ot,er,tr,Te,rr,Ct,Nt,kt,nr,Ue,Pe,jt,sr;const lt=F.strict,ir=($=F.code)===null||$===void 0?void 0:$.optimize,Rr=ir===!0||ir===void 0?1:ir||0,Oe=(P=(I=F.code)===null||I===void 0?void 0:I.regExp)!==null&&P!==void 0?P:T,ut=(a=F.uriResolver)!==null&&a!==void 0?a:w.default;return{strictSchema:(k=(m=F.strictSchema)!==null&&m!==void 0?m:lt)!==null&&k!==void 0?k:!0,strictNumbers:(M=(q=F.strictNumbers)!==null&&q!==void 0?q:lt)!==null&&M!==void 0?M:!0,strictTypes:(Z=(J=F.strictTypes)!==null&&J!==void 0?J:lt)!==null&&Z!==void 0?Z:"log",strictTuples:(Me=(le=F.strictTuples)!==null&&le!==void 0?le:lt)!==null&&Me!==void 0?Me:"log",strictRequired:(er=(Ot=F.strictRequired)!==null&&Ot!==void 0?Ot:lt)!==null&&er!==void 0?er:!1,code:F.code?{...F.code,optimize:Rr,regExp:Oe}:{optimize:Rr,regExp:Oe},loopRequired:(tr=F.loopRequired)!==null&&tr!==void 0?tr:O,loopEnum:(Te=F.loopEnum)!==null&&Te!==void 0?Te:O,meta:(rr=F.meta)!==null&&rr!==void 0?rr:!0,messages:(Ct=F.messages)!==null&&Ct!==void 0?Ct:!0,inlineRefs:(Nt=F.inlineRefs)!==null&&Nt!==void 0?Nt:!0,schemaId:(kt=F.schemaId)!==null&&kt!==void 0?kt:"$id",addUsedSchema:(nr=F.addUsedSchema)!==null&&nr!==void 0?nr:!0,validateSchema:(Ue=F.validateSchema)!==null&&Ue!==void 0?Ue:!0,validateFormats:(Pe=F.validateFormats)!==null&&Pe!==void 0?Pe:!0,unicodeRegExp:(jt=F.unicodeRegExp)!==null&&jt!==void 0?jt:!0,int32range:(sr=F.int32range)!==null&&sr!==void 0?sr:!0,uriResolver:ut}}class j{constructor($={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...C($)};const{es5:I,lines:P}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:R,es5:I,lines:P}),this.logger=Q($.logger);const a=$.validateFormats;$.validateFormats=!1,this.RULES=(0,i.getRules)(),D.call(this,_,$,"NOT SUPPORTED"),D.call(this,g,$,"DEPRECATED","warn"),this._metaOpts=G.call(this),$.formats&&A.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords&&W.call(this,$.keywords),typeof $.meta=="object"&&this.addMetaSchema($.meta),N.call(this),$.validateFormats=a}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:$,meta:I,schemaId:P}=this.opts;let a=h;P==="id"&&(a={...h},a.id=a.$id,delete a.$id),I&&$&&this.addMetaSchema(a,a[P],!1)}defaultMeta(){const{meta:$,schemaId:I}=this.opts;return this.opts.defaultMeta=typeof $=="object"?$[I]||$:void 0}validate($,I){let P;if(typeof $=="string"){if(P=this.getSchema($),!P)throw new Error(`no schema with key or ref "${$}"`)}else P=this.compile($);const a=P(I);return"$async"in P||(this.errors=P.errors),a}compile($,I){const P=this._addSchema($,I);return P.validate||this._compileSchemaEnv(P)}compileAsync($,I){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:P}=this.opts;return a.call(this,$,I);async function a(Z,le){await m.call(this,Z.$schema);const Me=this._addSchema(Z,le);return Me.validate||k.call(this,Me)}async function m(Z){Z&&!this.getSchema(Z)&&await a.call(this,{$ref:Z},!0)}async function k(Z){try{return this._compileSchemaEnv(Z)}catch(le){if(!(le instanceof s.default))throw le;return q.call(this,le),await M.call(this,le.missingSchema),k.call(this,Z)}}function q({missingSchema:Z,missingRef:le}){if(this.refs[Z])throw new Error(`AnySchema ${Z} is loaded but ${le} cannot be resolved`)}async function M(Z){const le=await J.call(this,Z);this.refs[Z]||await m.call(this,le.$schema),this.refs[Z]||this.addSchema(le,Z,I)}async function J(Z){const le=this._loading[Z];if(le)return le;try{return await(this._loading[Z]=P(Z))}finally{delete this._loading[Z]}}}addSchema($,I,P,a=this.opts.validateSchema){if(Array.isArray($)){for(const k of $)this.addSchema(k,void 0,P,a);return this}let m;if(typeof $=="object"){const{schemaId:k}=this.opts;if(m=$[k],m!==void 0&&typeof m!="string")throw new Error(`schema ${k} must be string`)}return I=(0,p.normalizeId)(I||m),this._checkUnique(I),this.schemas[I]=this._addSchema($,P,I,a,!0),this}addMetaSchema($,I,P=this.opts.validateSchema){return this.addSchema($,I,!0,P),this}validateSchema($,I){if(typeof $=="boolean")return!0;let P;if(P=$.$schema,P!==void 0&&typeof P!="string")throw new Error("$schema must be a string");if(P=P||this.opts.defaultMeta||this.defaultMeta(),!P)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const a=this.validate(P,$);if(!a&&I){const m="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(m);else throw new Error(m)}return a}getSchema($){let I;for(;typeof(I=b.call(this,$))=="string";)$=I;if(I===void 0){const{schemaId:P}=this.opts,a=new o.SchemaEnv({schema:{},schemaId:P});if(I=o.resolveSchema.call(this,a,$),!I)return;this.refs[$]=I}return I.validate||this._compileSchemaEnv(I)}removeSchema($){if($ instanceof RegExp)return this._removeAllSchemas(this.schemas,$),this._removeAllSchemas(this.refs,$),this;switch(typeof $){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const I=b.call(this,$);return typeof I=="object"&&this._cache.delete(I.schema),delete this.schemas[$],delete this.refs[$],this}case"object":{const I=$;this._cache.delete(I);let P=$[this.opts.schemaId];return P&&(P=(0,p.normalizeId)(P),delete this.schemas[P],delete this.refs[P]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary($){for(const I of $)this.addKeyword(I);return this}addKeyword($,I){let P;if(typeof $=="string")P=$,typeof I=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),I.keyword=P);else if(typeof $=="object"&&I===void 0){if(I=$,P=I.keyword,Array.isArray(P)&&!P.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(he.call(this,P,I),!I)return(0,d.eachItem)(P,m=>at.call(this,m)),this;Tt.call(this,I);const a={...I,type:(0,u.getJSONTypes)(I.type),schemaType:(0,u.getJSONTypes)(I.schemaType)};return(0,d.eachItem)(P,a.type.length===0?m=>at.call(this,m,a):m=>a.type.forEach(k=>at.call(this,m,a,k))),this}getKeyword($){const I=this.RULES.all[$];return typeof I=="object"?I.definition:!!I}removeKeyword($){const{RULES:I}=this;delete I.keywords[$],delete I.all[$];for(const P of I.rules){const a=P.rules.findIndex(m=>m.keyword===$);a>=0&&P.rules.splice(a,1)}return this}addFormat($,I){return typeof I=="string"&&(I=new RegExp(I)),this.formats[$]=I,this}errorsText($=this.errors,{separator:I=", ",dataVar:P="data"}={}){return!$||$.length===0?"No errors":$.map(a=>`${P}${a.instancePath} ${a.message}`).reduce((a,m)=>a+I+m)}$dataMetaSchema($,I){const P=this.RULES.all;$=JSON.parse(JSON.stringify($));for(const a of I){const m=a.split("/").slice(1);let k=$;for(const q of m)k=k[q];for(const q in P){const M=P[q];if(typeof M!="object")continue;const{$data:J}=M.definition,Z=k[q];J&&Z&&(k[q]=Rt(Z))}}return $}_removeAllSchemas($,I){for(const P in $){const a=$[P];(!I||I.test(P))&&(typeof a=="string"?delete $[P]:a&&!a.meta&&(this._cache.delete(a.schema),delete $[P]))}}_addSchema($,I,P,a=this.opts.validateSchema,m=this.opts.addUsedSchema){let k;const{schemaId:q}=this.opts;if(typeof $=="object")k=$[q];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof $!="boolean")throw new Error("schema must be object or boolean")}let M=this._cache.get($);if(M!==void 0)return M;P=(0,p.normalizeId)(k||P);const J=p.getSchemaRefs.call(this,$,P);return M=new o.SchemaEnv({schema:$,schemaId:q,meta:I,baseId:P,localRefs:J}),this._cache.set(M.schema,M),m&&!P.startsWith("#")&&(P&&this._checkUnique(P),this.refs[P]=M),a&&this.validateSchema($,!0),M}_checkUnique($){if(this.schemas[$]||this.refs[$])throw new Error(`schema with key or id "${$}" already exists`)}_compileSchemaEnv($){if($.meta?this._compileMetaSchema($):o.compileSchema.call(this,$),!$.validate)throw new Error("ajv implementation error");return $.validate}_compileMetaSchema($){const I=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,$)}finally{this.opts=I}}}e.default=j,j.ValidationError=n.default,j.MissingRefError=s.default;function D(F,$,I,P="error"){for(const a in F){const m=a;m in $&&this.logger[P](`${I}: option ${a}. ${F[m]}`)}}function b(F){return F=(0,p.normalizeId)(F),this.schemas[F]||this.refs[F]}function N(){const F=this.opts.schemas;if(F)if(Array.isArray(F))this.addSchema(F);else for(const $ in F)this.addSchema(F[$],$)}function A(){for(const F in this.opts.formats){const $=this.opts.formats[F];$&&this.addFormat(F,$)}}function W(F){if(Array.isArray(F)){this.addVocabulary(F);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const $ in F){const I=F[$];I.keyword||(I.keyword=$),this.addKeyword(I)}}function G(){const F={...this.opts};for(const $ of v)delete F[$];return F}const ce={log(){},warn(){},error(){}};function Q(F){if(F===!1)return ce;if(F===void 0)return console;if(F.log&&F.warn&&F.error)return F;throw new Error("logger must implement log, warn and error methods")}const Re=/^[a-z_$][a-z0-9_$:-]*$/i;function he(F,$){const{RULES:I}=this;if((0,d.eachItem)(F,P=>{if(I.keywords[P])throw new Error(`Keyword ${P} is already defined`);if(!Re.test(P))throw new Error(`Keyword ${P} has invalid name`)}),!!$&&$.$data&&!("code"in $||"validate"in $))throw new Error('$data keyword must have "code" or "validate" function')}function at(F,$,I){var P;const a=$==null?void 0:$.post;if(I&&a)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:m}=this;let k=a?m.post:m.rules.find(({type:M})=>M===I);if(k||(k={type:I,rules:[]},m.rules.push(k)),m.keywords[F]=!0,!$)return;const q={keyword:F,definition:{...$,type:(0,u.getJSONTypes)($.type),schemaType:(0,u.getJSONTypes)($.schemaType)}};$.before?ct.call(this,k,q,$.before):k.rules.push(q),m.all[F]=q,(P=$.implements)===null||P===void 0||P.forEach(M=>this.addKeyword(M))}function ct(F,$,I){const P=F.rules.findIndex(a=>a.keyword===I);P>=0?F.rules.splice(P,0,$):(F.rules.push($),this.logger.warn(`rule ${I} is not defined`))}function Tt(F){let{metaSchema:$}=F;$!==void 0&&(F.$data&&this.opts.$data&&($=Rt($)),F.validateSchema=this.compile($,!0))}const Xt={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Rt(F){return{anyOf:[F,Xt]}}})(So);var rs={},ns={},ss={};Object.defineProperty(ss,"__esModule",{value:!0});const iu={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};ss.default=iu;var Et={};Object.defineProperty(Et,"__esModule",{value:!0});Et.callRef=Et.getValidate=void 0;const ou=Sr,fi=B,Ee=K,qt=Ge,hi=Se,kr=re,au={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:i,validateName:o,opts:l,self:p}=n,{root:u}=i;if((r==="#"||r==="#/")&&s===u.baseId)return h();const d=hi.resolveRef.call(p,u,s,r);if(d===void 0)throw new ou.default(n.opts.uriResolver,s,r);if(d instanceof hi.SchemaEnv)return w(d);return T(d);function h(){if(i===u)return Ur(e,o,i,i.$async);const v=t.scopeValue("root",{ref:u});return Ur(e,(0,Ee._)`${v}.validate`,u,u.$async)}function w(v){const R=Zo(e,v);Ur(e,R,v,v.$async)}function T(v){const R=t.scopeValue("schema",l.code.source===!0?{ref:v,code:(0,Ee.stringify)(v)}:{ref:v}),_=t.name("valid"),g=e.subschema({schema:v,dataTypes:[],schemaPath:Ee.nil,topSchemaRef:R,errSchemaPath:r},_);e.mergeEvaluated(g),e.ok(_)}}};function Zo(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,Ee._)`${r.scopeValue("wrapper",{ref:t})}.validate`}Et.getValidate=Zo;function Ur(e,t,r,n){const{gen:s,it:i}=e,{allErrors:o,schemaEnv:l,opts:p}=i,u=p.passContext?qt.default.this:Ee.nil;n?d():h();function d(){if(!l.$async)throw new Error("async schema referenced by sync schema");const v=s.let("valid");s.try(()=>{s.code((0,Ee._)`await ${(0,fi.callValidateCode)(e,t,u)}`),T(t),o||s.assign(v,!0)},R=>{s.if((0,Ee._)`!(${R} instanceof ${i.ValidationError})`,()=>s.throw(R)),w(R),o||s.assign(v,!1)}),e.ok(v)}function h(){e.result((0,fi.callValidateCode)(e,t,u),()=>T(t),()=>w(t))}function w(v){const R=(0,Ee._)`${v}.errors`;s.assign(qt.default.vErrors,(0,Ee._)`${qt.default.vErrors} === null ? ${R} : ${qt.default.vErrors}.concat(${R})`),s.assign(qt.default.errors,(0,Ee._)`${qt.default.vErrors}.length`)}function T(v){var R;if(!i.opts.unevaluated)return;const _=(R=r==null?void 0:r.validate)===null||R===void 0?void 0:R.evaluated;if(i.props!==!0)if(_&&!_.dynamicProps)_.props!==void 0&&(i.props=kr.mergeEvaluated.props(s,_.props,i.props));else{const g=s.var("props",(0,Ee._)`${v}.evaluated.props`);i.props=kr.mergeEvaluated.props(s,g,i.props,Ee.Name)}if(i.items!==!0)if(_&&!_.dynamicItems)_.items!==void 0&&(i.items=kr.mergeEvaluated.items(s,_.items,i.items));else{const g=s.var("items",(0,Ee._)`${v}.evaluated.items`);i.items=kr.mergeEvaluated.items(s,g,i.items,Ee.Name)}}}Et.callRef=Ur;Et.default=au;Object.defineProperty(ns,"__esModule",{value:!0});const cu=ss,lu=Et,uu=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",cu.default,lu.default];ns.default=uu;var is={},os={};Object.defineProperty(os,"__esModule",{value:!0});const xr=K,rt=xr.operators,Br={maximum:{okStr:"<=",ok:rt.LTE,fail:rt.GT},minimum:{okStr:">=",ok:rt.GTE,fail:rt.LT},exclusiveMaximum:{okStr:"<",ok:rt.LT,fail:rt.GTE},exclusiveMinimum:{okStr:">",ok:rt.GT,fail:rt.LTE}},du={message:({keyword:e,schemaCode:t})=>(0,xr.str)`must be ${Br[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,xr._)`{comparison: ${Br[e].okStr}, limit: ${t}}`},pu={keyword:Object.keys(Br),type:"number",schemaType:"number",$data:!0,error:du,code(e){const{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,xr._)`${r} ${Br[t].fail} ${n} || isNaN(${r})`)}};os.default=pu;var as={};Object.defineProperty(as,"__esModule",{value:!0});const hr=K,fu={message:({schemaCode:e})=>(0,hr.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,hr._)`{multipleOf: ${e}}`},hu={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:fu,code(e){const{gen:t,data:r,schemaCode:n,it:s}=e,i=s.opts.multipleOfPrecision,o=t.let("res"),l=i?(0,hr._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:(0,hr._)`${o} !== parseInt(${o})`;e.fail$data((0,hr._)`(${n} === 0 || (${o} = ${r}/${n}, ${l}))`)}};as.default=hu;var cs={},ls={};Object.defineProperty(ls,"__esModule",{value:!0});function Qo(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}ls.default=Qo;Qo.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(cs,"__esModule",{value:!0});const mt=K,mu=re,yu=ls,gu={message({keyword:e,schemaCode:t}){const r=e==="maxLength"?"more":"fewer";return(0,mt.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,mt._)`{limit: ${e}}`},$u={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:gu,code(e){const{keyword:t,data:r,schemaCode:n,it:s}=e,i=t==="maxLength"?mt.operators.GT:mt.operators.LT,o=s.opts.unicode===!1?(0,mt._)`${r}.length`:(0,mt._)`${(0,mu.useFunc)(e.gen,yu.default)}(${r})`;e.fail$data((0,mt._)`${o} ${i} ${n}`)}};cs.default=$u;var us={};Object.defineProperty(us,"__esModule",{value:!0});const _u=B,Kr=K,wu={message:({schemaCode:e})=>(0,Kr.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Kr._)`{pattern: ${e}}`},vu={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:wu,code(e){const{data:t,$data:r,schema:n,schemaCode:s,it:i}=e,o=i.opts.unicodeRegExp?"u":"",l=r?(0,Kr._)`(new RegExp(${s}, ${o}))`:(0,_u.usePattern)(e,n);e.fail$data((0,Kr._)`!${l}.test(${t})`)}};us.default=vu;var ds={};Object.defineProperty(ds,"__esModule",{value:!0});const mr=K,bu={message({keyword:e,schemaCode:t}){const r=e==="maxProperties"?"more":"fewer";return(0,mr.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,mr._)`{limit: ${e}}`},Pu={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:bu,code(e){const{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?mr.operators.GT:mr.operators.LT;e.fail$data((0,mr._)`Object.keys(${r}).length ${s} ${n}`)}};ds.default=Pu;var ps={};Object.defineProperty(ps,"__esModule",{value:!0});const ur=B,yr=K,Eu=re,Su={message:({params:{missingProperty:e}})=>(0,yr.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,yr._)`{missingProperty: ${e}}`},Tu={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Su,code(e){const{gen:t,schema:r,schemaCode:n,data:s,$data:i,it:o}=e,{opts:l}=o;if(!i&&r.length===0)return;const p=r.length>=l.loopRequired;if(o.allErrors?u():d(),l.strictRequired){const T=e.parentSchema.properties,{definedProperties:v}=e.it;for(const R of r)if((T==null?void 0:T[R])===void 0&&!v.has(R)){const _=o.schemaEnv.baseId+o.errSchemaPath,g=`required property "${R}" is not defined at "${_}" (strictRequired)`;(0,Eu.checkStrictMode)(o,g,o.opts.strictRequired)}}function u(){if(p||i)e.block$data(yr.nil,h);else for(const T of r)(0,ur.checkReportMissingProp)(e,T)}function d(){const T=t.let("missing");if(p||i){const v=t.let("valid",!0);e.block$data(v,()=>w(T,v)),e.ok(v)}else t.if((0,ur.checkMissingProp)(e,r,T)),(0,ur.reportMissingProp)(e,T),t.else()}function h(){t.forOf("prop",n,T=>{e.setParams({missingProperty:T}),t.if((0,ur.noPropertyInData)(t,s,T,l.ownProperties),()=>e.error())})}function w(T,v){e.setParams({missingProperty:T}),t.forOf(T,n,()=>{t.assign(v,(0,ur.propertyInData)(t,s,T,l.ownProperties)),t.if((0,yr.not)(v),()=>{e.error(),t.break()})},yr.nil)}}};ps.default=Tu;var fs={};Object.defineProperty(fs,"__esModule",{value:!0});const gr=K,Ru={message({keyword:e,schemaCode:t}){const r=e==="maxItems"?"more":"fewer";return(0,gr.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,gr._)`{limit: ${e}}`},Ou={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Ru,code(e){const{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?gr.operators.GT:gr.operators.LT;e.fail$data((0,gr._)`${r}.length ${s} ${n}`)}};fs.default=Ou;var hs={},Tr={};Object.defineProperty(Tr,"__esModule",{value:!0});const Xo=Io;Xo.code='require("ajv/dist/runtime/equal").default';Tr.default=Xo;Object.defineProperty(hs,"__esModule",{value:!0});const Cn=Pr,ye=K,Cu=re,Nu=Tr,ku={message:({params:{i:e,j:t}})=>(0,ye.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,ye._)`{i: ${e}, j: ${t}}`},ju={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:ku,code(e){const{gen:t,data:r,$data:n,schema:s,parentSchema:i,schemaCode:o,it:l}=e;if(!n&&!s)return;const p=t.let("valid"),u=i.items?(0,Cn.getSchemaTypes)(i.items):[];e.block$data(p,d,(0,ye._)`${o} === false`),e.ok(p);function d(){const v=t.let("i",(0,ye._)`${r}.length`),R=t.let("j");e.setParams({i:v,j:R}),t.assign(p,!0),t.if((0,ye._)`${v} > 1`,()=>(h()?w:T)(v,R))}function h(){return u.length>0&&!u.some(v=>v==="object"||v==="array")}function w(v,R){const _=t.name("item"),g=(0,Cn.checkDataTypes)(u,_,l.opts.strictNumbers,Cn.DataType.Wrong),O=t.const("indices",(0,ye._)`{}`);t.for((0,ye._)`;${v}--;`,()=>{t.let(_,(0,ye._)`${r}[${v}]`),t.if(g,(0,ye._)`continue`),u.length>1&&t.if((0,ye._)`typeof ${_} == "string"`,(0,ye._)`${_} += "_"`),t.if((0,ye._)`typeof ${O}[${_}] == "number"`,()=>{t.assign(R,(0,ye._)`${O}[${_}]`),e.error(),t.assign(p,!1).break()}).code((0,ye._)`${O}[${_}] = ${v}`)})}function T(v,R){const _=(0,Cu.useFunc)(t,Nu.default),g=t.name("outer");t.label(g).for((0,ye._)`;${v}--;`,()=>t.for((0,ye._)`${R} = ${v}; ${R}--;`,()=>t.if((0,ye._)`${_}(${r}[${v}], ${r}[${R}])`,()=>{e.error(),t.assign(p,!1).break(g)})))}}};hs.default=ju;var ms={};Object.defineProperty(ms,"__esModule",{value:!0});const qn=K,Iu=re,Au=Tr,Du={message:"must be equal to constant",params:({schemaCode:e})=>(0,qn._)`{allowedValue: ${e}}`},Fu={keyword:"const",$data:!0,error:Du,code(e){const{gen:t,data:r,$data:n,schemaCode:s,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,qn._)`!${(0,Iu.useFunc)(t,Au.default)}(${r}, ${s})`):e.fail((0,qn._)`${i} !== ${r}`)}};ms.default=Fu;var ys={};Object.defineProperty(ys,"__esModule",{value:!0});const pr=K,qu=re,Mu=Tr,Uu={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,pr._)`{allowedValues: ${e}}`},Lu={keyword:"enum",schemaType:"array",$data:!0,error:Uu,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 l=s.length>=o.opts.loopEnum;let p;const u=()=>p??(p=(0,qu.useFunc)(t,Mu.default));let d;if(l||n)d=t.let("valid"),e.block$data(d,h);else{if(!Array.isArray(s))throw new Error("ajv implementation error");const T=t.const("vSchema",i);d=(0,pr.or)(...s.map((v,R)=>w(T,R)))}e.pass(d);function h(){t.assign(d,!1),t.forOf("v",i,T=>t.if((0,pr._)`${u()}(${r}, ${T})`,()=>t.assign(d,!0).break()))}function w(T,v){const R=s[v];return typeof R=="object"&&R!==null?(0,pr._)`${u()}(${r}, ${T}[${v}])`:(0,pr._)`${r} === ${R}`}}};ys.default=Lu;Object.defineProperty(is,"__esModule",{value:!0});const zu=os,Hu=as,Vu=cs,Wu=us,xu=ds,Bu=ps,Ku=fs,Gu=hs,Ju=ms,Yu=ys,Zu=[zu.default,Hu.default,Vu.default,Wu.default,xu.default,Bu.default,Ku.default,Gu.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Ju.default,Yu.default];is.default=Zu;var gs={},Zt={};Object.defineProperty(Zt,"__esModule",{value:!0});Zt.validateAdditionalItems=void 0;const yt=K,Mn=re,Qu={message:({params:{len:e}})=>(0,yt.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,yt._)`{limit: ${e}}`},Xu={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Qu,code(e){const{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,Mn.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}ea(e,n)}};function ea(e,t){const{gen:r,schema:n,data:s,keyword:i,it:o}=e;o.items=!0;const l=r.const("len",(0,yt._)`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,yt._)`${l} <= ${t.length}`);else if(typeof n=="object"&&!(0,Mn.alwaysValidSchema)(o,n)){const u=r.var("valid",(0,yt._)`${l} <= ${t.length}`);r.if((0,yt.not)(u),()=>p(u)),e.ok(u)}function p(u){r.forRange("i",t.length,l,d=>{e.subschema({keyword:i,dataProp:d,dataPropType:Mn.Type.Num},u),o.allErrors||r.if((0,yt.not)(u),()=>r.break())})}}Zt.validateAdditionalItems=ea;Zt.default=Xu;var $s={},Qt={};Object.defineProperty(Qt,"__esModule",{value:!0});Qt.validateTuple=void 0;const mi=K,Lr=re,ed=B,td={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return ta(e,"additionalItems",t);r.items=!0,!(0,Lr.alwaysValidSchema)(r,t)&&e.ok((0,ed.validateArray)(e))}};function ta(e,t,r=e.schema){const{gen:n,parentSchema:s,data:i,keyword:o,it:l}=e;d(s),l.opts.unevaluated&&r.length&&l.items!==!0&&(l.items=Lr.mergeEvaluated.items(n,r.length,l.items));const p=n.name("valid"),u=n.const("len",(0,mi._)`${i}.length`);r.forEach((h,w)=>{(0,Lr.alwaysValidSchema)(l,h)||(n.if((0,mi._)`${u} > ${w}`,()=>e.subschema({keyword:o,schemaProp:w,dataProp:w},p)),e.ok(p))});function d(h){const{opts:w,errSchemaPath:T}=l,v=r.length,R=v===h.minItems&&(v===h.maxItems||h[t]===!1);if(w.strictTuples&&!R){const _=`"${o}" is ${v}-tuple, but minItems or maxItems/${t} are not specified or different at path "${T}"`;(0,Lr.checkStrictMode)(l,_,w.strictTuples)}}}Qt.validateTuple=ta;Qt.default=td;Object.defineProperty($s,"__esModule",{value:!0});const rd=Qt,nd={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,rd.validateTuple)(e,"items")};$s.default=nd;var _s={};Object.defineProperty(_s,"__esModule",{value:!0});const yi=K,sd=re,id=B,od=Zt,ad={message:({params:{len:e}})=>(0,yi.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,yi._)`{limit: ${e}}`},cd={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:ad,code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;n.items=!0,!(0,sd.alwaysValidSchema)(n,t)&&(s?(0,od.validateAdditionalItems)(e,s):e.ok((0,id.validateArray)(e)))}};_s.default=cd;var ws={};Object.defineProperty(ws,"__esModule",{value:!0});const Ne=K,jr=re,ld={message:({params:{min:e,max:t}})=>t===void 0?(0,Ne.str)`must contain at least ${e} valid item(s)`:(0,Ne.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,Ne._)`{minContains: ${e}}`:(0,Ne._)`{minContains: ${e}, maxContains: ${t}}`},ud={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:ld,code(e){const{gen:t,schema:r,parentSchema:n,data:s,it:i}=e;let o,l;const{minContains:p,maxContains:u}=n;i.opts.next?(o=p===void 0?1:p,l=u):o=1;const d=t.const("len",(0,Ne._)`${s}.length`);if(e.setParams({min:o,max:l}),l===void 0&&o===0){(0,jr.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&o>l){(0,jr.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,jr.alwaysValidSchema)(i,r)){let R=(0,Ne._)`${d} >= ${o}`;l!==void 0&&(R=(0,Ne._)`${R} && ${d} <= ${l}`),e.pass(R);return}i.items=!0;const h=t.name("valid");l===void 0&&o===1?T(h,()=>t.if(h,()=>t.break())):o===0?(t.let(h,!0),l!==void 0&&t.if((0,Ne._)`${s}.length > 0`,w)):(t.let(h,!1),w()),e.result(h,()=>e.reset());function w(){const R=t.name("_valid"),_=t.let("count",0);T(R,()=>t.if(R,()=>v(_)))}function T(R,_){t.forRange("i",0,d,g=>{e.subschema({keyword:"contains",dataProp:g,dataPropType:jr.Type.Num,compositeRule:!0},R),_()})}function v(R){t.code((0,Ne._)`${R}++`),l===void 0?t.if((0,Ne._)`${R} >= ${o}`,()=>t.assign(h,!0).break()):(t.if((0,Ne._)`${R} > ${l}`,()=>t.assign(h,!1).break()),o===1?t.assign(h,!0):t.if((0,Ne._)`${R} >= ${o}`,()=>t.assign(h,!0)))}}};ws.default=ud;var ra={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=K,r=re,n=B;e.error={message:({params:{property:p,depsCount:u,deps:d}})=>{const h=u===1?"property":"properties";return(0,t.str)`must have ${h} ${d} when property ${p} is present`},params:({params:{property:p,depsCount:u,deps:d,missingProperty:h}})=>(0,t._)`{property: ${p},
|
|
535
|
+
|| ${W} === "boolean" || ${N} === null`).assign(G,(0,s._)`[${N}]`)}}}function T({gen:C,parentData:j,parentDataProperty:D},b){C.if((0,s._)`${j} !== undefined`,()=>C.assign((0,s._)`${j}[${D}]`,b))}function v(C,j,D,b=o.Correct){const N=b===o.Correct?s.operators.EQ:s.operators.NEQ;let A;switch(C){case"null":return(0,s._)`${j} ${N} null`;case"array":A=(0,s._)`Array.isArray(${j})`;break;case"object":A=(0,s._)`${j} && typeof ${j} == "object" && !Array.isArray(${j})`;break;case"integer":A=W((0,s._)`!(${j} % 1) && !isNaN(${j})`);break;case"number":A=W();break;default:return(0,s._)`typeof ${j} ${N} ${C}`}return b===o.Correct?A:(0,s.not)(A);function W(G=s.nil){return(0,s.and)((0,s._)`typeof ${j} == "number"`,G,D?(0,s._)`isFinite(${j})`:s.nil)}}e.checkDataType=v;function R(C,j,D,b){if(C.length===1)return v(C[0],j,D,b);let N;const A=(0,i.toHash)(C);if(A.array&&A.object){const W=(0,s._)`typeof ${j} != "object"`;N=A.null?W:(0,s._)`!${j} || ${W}`,delete A.null,delete A.array,delete A.object}else N=s.nil;A.number&&delete A.integer;for(const W in A)N=(0,s.and)(N,v(W,j,D,b));return N}e.checkDataTypes=R;const w={message:({schema:C})=>`must be ${C}`,params:({schema:C,schemaValue:j})=>typeof C=="string"?(0,s._)`{type: ${C}}`:(0,s._)`{type: ${j}}`};function g(C){const j=O(C);(0,n.reportError)(j,w)}e.reportTypeError=g;function O(C){const{gen:j,data:D,schema:b}=C,N=(0,i.schemaRefOrVal)(C,b,"type");return{gen:j,keyword:"type",data:D,schema:b.type,schemaCode:N,schemaValue:N,parentSchema:b,params:{},it:C}}})(Pr);var wn={};Object.defineProperty(wn,"__esModule",{value:!0});wn.assignDefaults=void 0;const Ft=K,qc=re;function Mc(e,t){const{properties:r,items:n}=e.schema;if(t==="object"&&r)for(const s in r)oi(e,s,r[s].default);else t==="array"&&Array.isArray(n)&&n.forEach((s,i)=>oi(e,i,s.default))}wn.assignDefaults=Mc;function oi(e,t,r){const{gen:n,compositeRule:s,data:i,opts:o}=e;if(r===void 0)return;const l=(0,Ft._)`${i}${(0,Ft.getProperty)(t)}`;if(s){(0,qc.checkStrictMode)(e,`default is ignored for: ${l}`);return}let d=(0,Ft._)`${l} === undefined`;o.useDefaults==="empty"&&(d=(0,Ft._)`${d} || ${l} === null || ${l} === ""`),n.if(d,(0,Ft._)`${l} = ${(0,Ft.stringify)(r)}`)}var Ke={},B={};Object.defineProperty(B,"__esModule",{value:!0});B.validateUnion=B.validateArray=B.usePattern=B.callValidateCode=B.schemaProperties=B.allSchemaProperties=B.noPropertyInData=B.propertyInData=B.isOwnProperty=B.hasPropFunc=B.reportMissingProp=B.checkMissingProp=B.checkReportMissingProp=void 0;const ie=K,Jn=re,tt=Ge,Uc=re;function Lc(e,t){const{gen:r,data:n,it:s}=e;r.if(Zn(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:(0,ie._)`${t}`},!0),e.error()})}B.checkReportMissingProp=Lc;function zc({gen:e,data:t,it:{opts:r}},n,s){return(0,ie.or)(...n.map(i=>(0,ie.and)(Zn(e,t,i,r.ownProperties),(0,ie._)`${s} = ${i}`)))}B.checkMissingProp=zc;function Hc(e,t){e.setParams({missingProperty:t},!0),e.error()}B.reportMissingProp=Hc;function Co(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ie._)`Object.prototype.hasOwnProperty`})}B.hasPropFunc=Co;function Yn(e,t,r){return(0,ie._)`${Co(e)}.call(${t}, ${r})`}B.isOwnProperty=Yn;function Vc(e,t,r,n){const s=(0,ie._)`${t}${(0,ie.getProperty)(r)} !== undefined`;return n?(0,ie._)`${s} && ${Yn(e,t,r)}`:s}B.propertyInData=Vc;function Zn(e,t,r,n){const s=(0,ie._)`${t}${(0,ie.getProperty)(r)} === undefined`;return n?(0,ie.or)(s,(0,ie.not)(Yn(e,t,r))):s}B.noPropertyInData=Zn;function No(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}B.allSchemaProperties=No;function Wc(e,t){return No(t).filter(r=>!(0,Jn.alwaysValidSchema)(e,t[r]))}B.schemaProperties=Wc;function xc({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:i},it:o},l,d,u){const p=u?(0,ie._)`${e}, ${t}, ${n}${s}`:t,h=[[tt.default.instancePath,(0,ie.strConcat)(tt.default.instancePath,i)],[tt.default.parentData,o.parentData],[tt.default.parentDataProperty,o.parentDataProperty],[tt.default.rootData,tt.default.rootData]];o.opts.dynamicRef&&h.push([tt.default.dynamicAnchors,tt.default.dynamicAnchors]);const _=(0,ie._)`${p}, ${r.object(...h)}`;return d!==ie.nil?(0,ie._)`${l}.call(${d}, ${_})`:(0,ie._)`${l}(${_})`}B.callValidateCode=xc;const Bc=(0,ie._)`new RegExp`;function Kc({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,ie._)`${s.code==="new RegExp"?Bc:(0,Uc.useFunc)(e,s)}(${r}, ${n})`})}B.usePattern=Kc;function Gc(e){const{gen:t,data:r,keyword:n,it:s}=e,i=t.name("valid");if(s.allErrors){const l=t.let("valid",!0);return o(()=>t.assign(l,!1)),l}return t.var(i,!0),o(()=>t.break()),i;function o(l){const d=t.const("len",(0,ie._)`${r}.length`);t.forRange("i",0,d,u=>{e.subschema({keyword:n,dataProp:u,dataPropType:Jn.Type.Num},i),t.if((0,ie.not)(i),l)})}}B.validateArray=Gc;function Jc(e){const{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(d=>(0,Jn.alwaysValidSchema)(s,d))&&!s.opts.unevaluated)return;const o=t.let("valid",!1),l=t.name("_valid");t.block(()=>r.forEach((d,u)=>{const p=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},l);t.assign(o,(0,ie._)`${o} || ${l}`),e.mergeValidEvaluated(p,l)||t.if((0,ie.not)(o))})),e.result(o,()=>e.reset(),()=>e.error(!0))}B.validateUnion=Jc;Object.defineProperty(Ke,"__esModule",{value:!0});Ke.validateKeywordUsage=Ke.validSchemaType=Ke.funcKeywordCode=Ke.macroKeywordCode=void 0;const be=K,ht=Ge,Yc=B,Zc=br;function Qc(e,t){const{gen:r,keyword:n,schema:s,parentSchema:i,it:o}=e,l=t.macro.call(o.self,s,i,o),d=ko(r,n,l);o.opts.validateSchema!==!1&&o.self.validateSchema(l,!0);const u=r.name("valid");e.subschema({schema:l,schemaPath:be.nil,errSchemaPath:`${o.errSchemaPath}/${n}`,topSchemaRef:d,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}Ke.macroKeywordCode=Qc;function Xc(e,t){var r;const{gen:n,keyword:s,schema:i,parentSchema:o,$data:l,it:d}=e;tl(d,t);const u=!l&&t.compile?t.compile.call(d.self,i,o,d):t.validate,p=ko(n,s,u),h=n.let("valid");e.block$data(h,_),e.ok((r=t.valid)!==null&&r!==void 0?r:h);function _(){if(t.errors===!1)R(),t.modifying&&ai(e),w(()=>e.error());else{const g=t.async?T():v();t.modifying&&ai(e),w(()=>el(e,g))}}function T(){const g=n.let("ruleErrs",null);return n.try(()=>R((0,be._)`await `),O=>n.assign(h,!1).if((0,be._)`${O} instanceof ${d.ValidationError}`,()=>n.assign(g,(0,be._)`${O}.errors`),()=>n.throw(O))),g}function v(){const g=(0,be._)`${p}.errors`;return n.assign(g,null),R(be.nil),g}function R(g=t.async?(0,be._)`await `:be.nil){const O=d.opts.passContext?ht.default.this:ht.default.self,C=!("compile"in t&&!l||t.schema===!1);n.assign(h,(0,be._)`${g}${(0,Yc.callValidateCode)(e,p,O,C)}`,t.modifying)}function w(g){var O;n.if((0,be.not)((O=t.valid)!==null&&O!==void 0?O:h),g)}}Ke.funcKeywordCode=Xc;function ai(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,be._)`${n.parentData}[${n.parentDataProperty}]`))}function el(e,t){const{gen:r}=e;r.if((0,be._)`Array.isArray(${t})`,()=>{r.assign(ht.default.vErrors,(0,be._)`${ht.default.vErrors} === null ? ${t} : ${ht.default.vErrors}.concat(${t})`).assign(ht.default.errors,(0,be._)`${ht.default.vErrors}.length`),(0,Zc.extendErrors)(e)},()=>e.error())}function tl({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function ko(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,be.stringify)(r)})}function rl(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")}Ke.validSchemaType=rl;function nl({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(l=>!Object.prototype.hasOwnProperty.call(e,l)))throw new Error(`parent schema must have dependencies of ${i}: ${o.join(",")}`);if(s.validateSchema&&!s.validateSchema(e[i])){const d=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(d);else throw new Error(d)}}Ke.validateKeywordUsage=nl;var ot={};Object.defineProperty(ot,"__esModule",{value:!0});ot.extendSubschemaMode=ot.extendSubschemaData=ot.getSubschema=void 0;const Be=K,jo=re;function sl(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 l=e.schema[t];return r===void 0?{schema:l,schemaPath:(0,Be._)`${e.schemaPath}${(0,Be.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:l[r],schemaPath:(0,Be._)`${e.schemaPath}${(0,Be.getProperty)(t)}${(0,Be.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,jo.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')}ot.getSubschema=sl;function il(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:l}=t;if(r!==void 0){const{errorPath:u,dataPathArr:p,opts:h}=t,_=l.let("data",(0,Be._)`${t.data}${(0,Be.getProperty)(r)}`,!0);d(_),e.errorPath=(0,Be.str)`${u}${(0,jo.getErrorPath)(r,n,h.jsPropertySyntax)}`,e.parentDataProperty=(0,Be._)`${r}`,e.dataPathArr=[...p,e.parentDataProperty]}if(s!==void 0){const u=s instanceof Be.Name?s:l.let("data",s,!0);d(u),o!==void 0&&(e.propertyName=o)}i&&(e.dataTypes=i);function d(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}ot.extendSubschemaData=il;function ol(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}ot.extendSubschemaMode=ol;var $e={},Io=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},Ao={exports:{}},it=Ao.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(){};Mr(t,n,s,e,"",e)};it.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};it.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};it.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};it.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Mr(e,t,r,n,s,i,o,l,d,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,s,i,o,l,d,u);for(var p in n){var h=n[p];if(Array.isArray(h)){if(p in it.arrayKeywords)for(var _=0;_<h.length;_++)Mr(e,t,r,h[_],s+"/"+p+"/"+_,i,s,p,n,_)}else if(p in it.propsKeywords){if(h&&typeof h=="object")for(var T in h)Mr(e,t,r,h[T],s+"/"+p+"/"+al(T),i,s,p,n,T)}else(p in it.keywords||e.allKeys&&!(p in it.skipKeywords))&&Mr(e,t,r,h,s+"/"+p,i,s,p,n)}r(n,s,i,o,l,d,u)}}function al(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var cl=Ao.exports;Object.defineProperty($e,"__esModule",{value:!0});$e.getSchemaRefs=$e.resolveUrl=$e.normalizeId=$e._getFullPath=$e.getFullPath=$e.inlineRef=void 0;const ll=re,ul=Io,dl=cl,pl=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function fl(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Dn(e):t?Do(e)<=t:!1}$e.inlineRef=fl;const hl=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Dn(e){for(const t in e){if(hl.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(Dn)||typeof r=="object"&&Dn(r))return!0}return!1}function Do(e){let t=0;for(const r in e){if(r==="$ref")return 1/0;if(t++,!pl.has(r)&&(typeof e[r]=="object"&&(0,ll.eachItem)(e[r],n=>t+=Do(n)),t===1/0))return 1/0}return t}function Fo(e,t="",r){r!==!1&&(t=zt(t));const n=e.parse(t);return qo(e,n)}$e.getFullPath=Fo;function qo(e,t){return e.serialize(t).split("#")[0]+"#"}$e._getFullPath=qo;const ml=/#\/?$/;function zt(e){return e?e.replace(ml,""):""}$e.normalizeId=zt;function yl(e,t,r){return r=zt(r),e.resolve(t,r)}$e.resolveUrl=yl;const gl=/^[a-z_][-a-z0-9._]*$/i;function $l(e,t){if(typeof e=="boolean")return{};const{schemaId:r,uriResolver:n}=this.opts,s=zt(e[r]||t),i={"":s},o=Fo(n,s,!1),l={},d=new Set;return dl(e,{allKeys:!0},(h,_,T,v)=>{if(v===void 0)return;const R=o+_;let w=i[v];typeof h[r]=="string"&&(w=g.call(this,h[r])),O.call(this,h.$anchor),O.call(this,h.$dynamicAnchor),i[_]=w;function g(C){const j=this.opts.uriResolver.resolve;if(C=zt(w?j(w,C):C),d.has(C))throw p(C);d.add(C);let D=this.refs[C];return typeof D=="string"&&(D=this.refs[D]),typeof D=="object"?u(h,D.schema,C):C!==zt(R)&&(C[0]==="#"?(u(h,l[C],C),l[C]=h):this.refs[C]=R),C}function O(C){if(typeof C=="string"){if(!gl.test(C))throw new Error(`invalid anchor "${C}"`);g.call(this,`#${C}`)}}}),l;function u(h,_,T){if(_!==void 0&&!ul(h,_))throw p(T)}function p(h){return new Error(`reference "${h}" resolves to more than one schema`)}}$e.getSchemaRefs=$l;Object.defineProperty(Ae,"__esModule",{value:!0});Ae.getData=Ae.KeywordCxt=Ae.validateFunctionCode=void 0;const Mo=Jt,ci=Pr,Qn=Ze,Wr=Pr,wl=wn,fr=Ke,Tn=ot,U=K,V=Ge,_l=$e,Qe=re,lr=br;function vl(e){if(zo(e)&&(Ho(e),Lo(e))){El(e);return}Uo(e,()=>(0,Mo.topBoolOrEmptySchema)(e))}Ae.validateFunctionCode=vl;function Uo({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},i){s.code.es5?e.func(t,(0,U._)`${V.default.data}, ${V.default.valCxt}`,n.$async,()=>{e.code((0,U._)`"use strict"; ${li(r,s)}`),Pl(e,s),e.code(i)}):e.func(t,(0,U._)`${V.default.data}, ${bl(s)}`,n.$async,()=>e.code(li(r,s)).code(i))}function bl(e){return(0,U._)`{${V.default.instancePath}="", ${V.default.parentData}, ${V.default.parentDataProperty}, ${V.default.rootData}=${V.default.data}${e.dynamicRef?(0,U._)`, ${V.default.dynamicAnchors}={}`:U.nil}}={}`}function Pl(e,t){e.if(V.default.valCxt,()=>{e.var(V.default.instancePath,(0,U._)`${V.default.valCxt}.${V.default.instancePath}`),e.var(V.default.parentData,(0,U._)`${V.default.valCxt}.${V.default.parentData}`),e.var(V.default.parentDataProperty,(0,U._)`${V.default.valCxt}.${V.default.parentDataProperty}`),e.var(V.default.rootData,(0,U._)`${V.default.valCxt}.${V.default.rootData}`),t.dynamicRef&&e.var(V.default.dynamicAnchors,(0,U._)`${V.default.valCxt}.${V.default.dynamicAnchors}`)},()=>{e.var(V.default.instancePath,(0,U._)`""`),e.var(V.default.parentData,(0,U._)`undefined`),e.var(V.default.parentDataProperty,(0,U._)`undefined`),e.var(V.default.rootData,V.default.data),t.dynamicRef&&e.var(V.default.dynamicAnchors,(0,U._)`{}`)})}function El(e){const{schema:t,opts:r,gen:n}=e;Uo(e,()=>{r.$comment&&t.$comment&&Wo(e),Cl(e),n.let(V.default.vErrors,null),n.let(V.default.errors,0),r.unevaluated&&Sl(e),Vo(e),jl(e)})}function Sl(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,U._)`${r}.evaluated`),t.if((0,U._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,U._)`${e.evaluated}.props`,(0,U._)`undefined`)),t.if((0,U._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,U._)`${e.evaluated}.items`,(0,U._)`undefined`))}function li(e,t){const r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,U._)`/*# sourceURL=${r} */`:U.nil}function Tl(e,t){if(zo(e)&&(Ho(e),Lo(e))){Rl(e,t);return}(0,Mo.boolOrEmptySchema)(e,t)}function Lo({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 zo(e){return typeof e.schema!="boolean"}function Rl(e,t){const{schema:r,gen:n,opts:s}=e;s.$comment&&r.$comment&&Wo(e),Nl(e),kl(e);const i=n.const("_errs",V.default.errors);Vo(e,i),n.var(t,(0,U._)`${i} === ${V.default.errors}`)}function Ho(e){(0,Qe.checkUnknownRules)(e),Ol(e)}function Vo(e,t){if(e.opts.jtd)return ui(e,[],!1,t);const r=(0,ci.getSchemaTypes)(e.schema),n=(0,ci.coerceAndCheckDataType)(e,r);ui(e,r,!n,t)}function Ol(e){const{schema:t,errSchemaPath:r,opts:n,self:s}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,Qe.schemaHasRulesButRef)(t,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function Cl(e){const{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Qe.checkStrictMode)(e,"default is ignored in the schema root")}function Nl(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,_l.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function kl(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function Wo({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:s}){const i=r.$comment;if(s.$comment===!0)e.code((0,U._)`${V.default.self}.logger.log(${i})`);else if(typeof s.$comment=="function"){const o=(0,U.str)`${n}/$comment`,l=e.scopeValue("root",{ref:t.root});e.code((0,U._)`${V.default.self}.opts.$comment(${i}, ${o}, ${l}.schema)`)}}function jl(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:i}=e;r.$async?t.if((0,U._)`${V.default.errors} === 0`,()=>t.return(V.default.data),()=>t.throw((0,U._)`new ${s}(${V.default.vErrors})`)):(t.assign((0,U._)`${n}.errors`,V.default.vErrors),i.unevaluated&&Il(e),t.return((0,U._)`${V.default.errors} === 0`))}function Il({gen:e,evaluated:t,props:r,items:n}){r instanceof U.Name&&e.assign((0,U._)`${t}.props`,r),n instanceof U.Name&&e.assign((0,U._)`${t}.items`,n)}function ui(e,t,r,n){const{gen:s,schema:i,data:o,allErrors:l,opts:d,self:u}=e,{RULES:p}=u;if(i.$ref&&(d.ignoreKeywordsWithRef||!(0,Qe.schemaHasRulesButRef)(i,p))){s.block(()=>Ko(e,"$ref",p.all.$ref.definition));return}d.jtd||Al(e,t),s.block(()=>{for(const _ of p.rules)h(_);h(p.post)});function h(_){(0,Qn.shouldUseGroup)(i,_)&&(_.type?(s.if((0,Wr.checkDataType)(_.type,o,d.strictNumbers)),di(e,_),t.length===1&&t[0]===_.type&&r&&(s.else(),(0,Wr.reportTypeError)(e)),s.endIf()):di(e,_),l||s.if((0,U._)`${V.default.errors} === ${n||0}`))}}function di(e,t){const{gen:r,schema:n,opts:{useDefaults:s}}=e;s&&(0,wl.assignDefaults)(e,t.type),r.block(()=>{for(const i of t.rules)(0,Qn.shouldUseRule)(n,i)&&Ko(e,i.keyword,i.definition,t.type)})}function Al(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(Dl(e,t),e.opts.allowUnionTypes||Fl(e,t),ql(e,e.dataTypes))}function Dl(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{xo(e.dataTypes,r)||Xn(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),Ul(e,t)}}function Fl(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&Xn(e,"use allowUnionTypes to allow union type keyword")}function ql(e,t){const r=e.self.RULES.all;for(const n in r){const s=r[n];if(typeof s=="object"&&(0,Qn.shouldUseRule)(e.schema,s)){const{type:i}=s.definition;i.length&&!i.some(o=>Ml(t,o))&&Xn(e,`missing type "${i.join(",")}" for keyword "${n}"`)}}}function Ml(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function xo(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function Ul(e,t){const r=[];for(const n of e.dataTypes)xo(t,n)?r.push(n):t.includes("integer")&&n==="number"&&r.push("integer");e.dataTypes=r}function Xn(e,t){const r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,Qe.checkStrictMode)(e,t,e.opts.strictTypes)}class Bo{constructor(t,r,n){if((0,fr.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,Qe.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",Go(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,fr.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,U.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,U.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,U._)`${r} !== undefined && (${(0,U.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?lr.reportExtraError:lr.reportError)(this,this.def.error,r)}$dataError(){(0,lr.reportError)(this,this.def.$dataError||lr.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,lr.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=U.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=U.nil,r=U.nil){if(!this.$data)return;const{gen:n,schemaCode:s,schemaType:i,def:o}=this;n.if((0,U.or)((0,U._)`${s} === undefined`,r)),t!==U.nil&&n.assign(t,!0),(i.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==U.nil&&n.assign(t,!1)),n.else()}invalid$data(){const{gen:t,schemaCode:r,schemaType:n,def:s,it:i}=this;return(0,U.or)(o(),l());function o(){if(n.length){if(!(r instanceof U.Name))throw new Error("ajv implementation error");const d=Array.isArray(n)?n:[n];return(0,U._)`${(0,Wr.checkDataTypes)(d,r,i.opts.strictNumbers,Wr.DataType.Wrong)}`}return U.nil}function l(){if(s.validateSchema){const d=t.scopeValue("validate$data",{ref:s.validateSchema});return(0,U._)`!${d}(${r})`}return U.nil}}subschema(t,r){const n=(0,Tn.getSubschema)(this.it,t);(0,Tn.extendSubschemaData)(n,this.it,t),(0,Tn.extendSubschemaMode)(n,t);const s={...this.it,...n,items:void 0,props:void 0};return Tl(s,r),s}mergeEvaluated(t,r){const{it:n,gen:s}=this;n.opts.unevaluated&&(n.props!==!0&&t.props!==void 0&&(n.props=Qe.mergeEvaluated.props(s,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=Qe.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,U.Name)),!0}}Ae.KeywordCxt=Bo;function Ko(e,t,r,n){const s=new Bo(e,r,t);"code"in r?r.code(s,n):s.$data&&r.validate?(0,fr.funcKeywordCode)(s,r):"macro"in r?(0,fr.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,fr.funcKeywordCode)(s,r)}const Ll=/^\/(?:[^~]|~0|~1)*$/,zl=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Go(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,i;if(e==="")return V.default.rootData;if(e[0]==="/"){if(!Ll.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);s=e,i=V.default.rootData}else{const u=zl.exec(e);if(!u)throw new Error(`Invalid JSON-pointer: ${e}`);const p=+u[1];if(s=u[2],s==="#"){if(p>=t)throw new Error(d("property/index",p));return n[t-p]}if(p>t)throw new Error(d("data",p));if(i=r[t-p],!s)return i}let o=i;const l=s.split("/");for(const u of l)u&&(i=(0,U._)`${i}${(0,U.getProperty)((0,Qe.unescapeJsonPointer)(u))}`,o=(0,U._)`${o} && ${i}`);return o;function d(u,p){return`Cannot access ${u} ${p} levels up, current level is ${t}`}}Ae.getData=Go;var Er={};Object.defineProperty(Er,"__esModule",{value:!0});class Hl extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}Er.default=Hl;var Sr={};Object.defineProperty(Sr,"__esModule",{value:!0});const Rn=$e;class Vl extends Error{constructor(t,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Rn.resolveUrl)(t,r,n),this.missingSchema=(0,Rn.normalizeId)((0,Rn.getFullPath)(t,this.missingRef))}}Sr.default=Vl;var Se={};Object.defineProperty(Se,"__esModule",{value:!0});Se.resolveSchema=Se.getCompilingSchema=Se.resolveRef=Se.compileSchema=Se.SchemaEnv=void 0;const ke=K,Wl=Er,ft=Ge,Ie=$e,pi=re,xl=Ae;class _n{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,Ie.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={}}}Se.SchemaEnv=_n;function es(e){const t=Jo.call(this,e);if(t)return t;const r=(0,Ie.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 l;e.$async&&(l=o.scopeValue("Error",{ref:Wl.default,code:(0,ke._)`require("ajv/dist/runtime/validation_error").default`}));const d=o.scopeName("validate");e.validateName=d;const u={gen:o,allErrors:this.opts.allErrors,data:ft.default.data,parentData:ft.default.parentData,parentDataProperty:ft.default.parentDataProperty,dataNames:[ft.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:d,ValidationError:l,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 p;try{this._compilations.add(e),(0,xl.validateFunctionCode)(u),o.optimize(this.opts.code.optimize);const h=o.toString();p=`${o.scopeRefs(ft.default.scope)}return ${h}`,this.opts.code.process&&(p=this.opts.code.process(p,e));const T=new Function(`${ft.default.self}`,`${ft.default.scope}`,p)(this,this.scope.get());if(this.scope.value(d,{ref:T}),T.errors=null,T.schema=e.schema,T.schemaEnv=e,e.$async&&(T.$async=!0),this.opts.code.source===!0&&(T.source={validateName:d,validateCode:h,scopeValues:o._values}),this.opts.unevaluated){const{props:v,items:R}=u;T.evaluated={props:v instanceof ke.Name?void 0:v,items:R instanceof ke.Name?void 0:R,dynamicProps:v instanceof ke.Name,dynamicItems:R instanceof ke.Name},T.source&&(T.source.evaluated=(0,ke.stringify)(T.evaluated))}return e.validate=T,e}catch(h){throw delete e.validate,delete e.validateName,p&&this.logger.error("Error compiling schema, function code:",p),h}finally{this._compilations.delete(e)}}Se.compileSchema=es;function Bl(e,t,r){var n;r=(0,Ie.resolveUrl)(this.opts.uriResolver,t,r);const s=e.refs[r];if(s)return s;let i=Jl.call(this,e,r);if(i===void 0){const o=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:l}=this.opts;o&&(i=new _n({schema:o,schemaId:l,root:e,baseId:t}))}if(i!==void 0)return e.refs[r]=Kl.call(this,i)}Se.resolveRef=Bl;function Kl(e){return(0,Ie.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:es.call(this,e)}function Jo(e){for(const t of this._compilations)if(Gl(t,e))return t}Se.getCompilingSchema=Jo;function Gl(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function Jl(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||vn.call(this,e,t)}function vn(e,t){const r=this.opts.uriResolver.parse(t),n=(0,Ie._getFullPath)(this.opts.uriResolver,r);let s=(0,Ie.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return On.call(this,r,e);const i=(0,Ie.normalizeId)(n),o=this.refs[i]||this.schemas[i];if(typeof o=="string"){const l=vn.call(this,e,o);return typeof(l==null?void 0:l.schema)!="object"?void 0:On.call(this,r,l)}if(typeof(o==null?void 0:o.schema)=="object"){if(o.validate||es.call(this,o),i===(0,Ie.normalizeId)(t)){const{schema:l}=o,{schemaId:d}=this.opts,u=l[d];return u&&(s=(0,Ie.resolveUrl)(this.opts.uriResolver,s,u)),new _n({schema:l,schemaId:d,root:e,baseId:s})}return On.call(this,r,o)}}Se.resolveSchema=vn;const Yl=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function On(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(const l of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const d=r[(0,pi.unescapeFragment)(l)];if(d===void 0)return;r=d;const u=typeof r=="object"&&r[this.opts.schemaId];!Yl.has(l)&&u&&(t=(0,Ie.resolveUrl)(this.opts.uriResolver,t,u))}let i;if(typeof r!="boolean"&&r.$ref&&!(0,pi.schemaHasRulesButRef)(r,this.RULES)){const l=(0,Ie.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=vn.call(this,n,l)}const{schemaId:o}=this.opts;if(i=i||new _n({schema:r,schemaId:o,root:n,baseId:t}),i.schema!==i.root.schema)return i}const Zl="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Ql="Meta-schema for $data reference (JSON AnySchema extension proposal)",Xl="object",eu=["$data"],tu={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},ru=!1,nu={$id:Zl,description:Ql,type:Xl,required:eu,properties:tu,additionalProperties:ru};var ts={},Fn={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)})(Pc,function(r){function n(){for(var f=arguments.length,c=Array(f),y=0;y<f;y++)c[y]=arguments[y];if(c.length>1){c[0]=c[0].slice(0,-1);for(var S=c.length-1,E=1;E<S;++E)c[E]=c[E].slice(1,-1);return c[S]=c[S].slice(1),c.join("")}else return c[0]}function s(f){return"(?:"+f+")"}function i(f){return f===void 0?"undefined":f===null?"null":Object.prototype.toString.call(f).split(" ").pop().split("]").shift().toLowerCase()}function o(f){return f.toUpperCase()}function l(f){return f!=null?f instanceof Array?f:typeof f.length!="number"||f.split||f.setInterval||f.call?[f]:Array.prototype.slice.call(f):[]}function d(f,c){var y=f;if(c)for(var S in c)y[S]=c[S];return y}function u(f){var c="[A-Za-z]",y="[0-9]",S=n(y,"[A-Fa-f]"),E=s(s("%[EFef]"+S+"%"+S+S+"%"+S+S)+"|"+s("%[89A-Fa-f]"+S+"%"+S+S)+"|"+s("%"+S+S)),L="[\\:\\/\\?\\#\\[\\]\\@]",z="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",X=n(L,z),se=f?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",ue=f?"[\\uE000-\\uF8FF]":"[]",Y=n(c,y,"[\\-\\.\\_\\~]",se);s(c+n(c,y,"[\\+\\-\\.]")+"*"),s(s(E+"|"+n(Y,z,"[\\:]"))+"*");var ne=s(s("25[0-5]")+"|"+s("2[0-4]"+y)+"|"+s("1"+y+y)+"|"+s("0?[1-9]"+y)+"|0?0?"+y),de=s(ne+"\\."+ne+"\\."+ne+"\\."+ne),x=s(S+"{1,4}"),oe=s(s(x+"\\:"+x)+"|"+de),me=s(s(x+"\\:")+"{6}"+oe),ae=s("\\:\\:"+s(x+"\\:")+"{5}"+oe),Xe=s(s(x)+"?\\:\\:"+s(x+"\\:")+"{4}"+oe),ze=s(s(s(x+"\\:")+"{0,1}"+x)+"?\\:\\:"+s(x+"\\:")+"{3}"+oe),He=s(s(s(x+"\\:")+"{0,2}"+x)+"?\\:\\:"+s(x+"\\:")+"{2}"+oe),At=s(s(s(x+"\\:")+"{0,3}"+x)+"?\\:\\:"+x+"\\:"+oe),dt=s(s(s(x+"\\:")+"{0,4}"+x)+"?\\:\\:"+oe),Ce=s(s(s(x+"\\:")+"{0,5}"+x)+"?\\:\\:"+x),Ve=s(s(s(x+"\\:")+"{0,6}"+x)+"?\\:\\:"),pt=s([me,ae,Xe,ze,He,At,dt,Ce,Ve].join("|")),Je=s(s(Y+"|"+E)+"+");s("[vV]"+S+"+\\."+n(Y,z,"[\\:]")+"+"),s(s(E+"|"+n(Y,z))+"*");var ar=s(E+"|"+n(Y,z,"[\\:\\@]"));return s(s(E+"|"+n(Y,z,"[\\@]"))+"+"),s(s(ar+"|"+n("[\\/\\?]",ue))+"*"),{NOT_SCHEME:new RegExp(n("[^]",c,y,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(n("[^\\%\\:]",Y,z),"g"),NOT_HOST:new RegExp(n("[^\\%\\[\\]\\:]",Y,z),"g"),NOT_PATH:new RegExp(n("[^\\%\\/\\:\\@]",Y,z),"g"),NOT_PATH_NOSCHEME:new RegExp(n("[^\\%\\/\\@]",Y,z),"g"),NOT_QUERY:new RegExp(n("[^\\%]",Y,z,"[\\:\\@\\/\\?]",ue),"g"),NOT_FRAGMENT:new RegExp(n("[^\\%]",Y,z,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(n("[^]",Y,z),"g"),UNRESERVED:new RegExp(Y,"g"),OTHER_CHARS:new RegExp(n("[^\\%]",Y,X),"g"),PCT_ENCODED:new RegExp(E,"g"),IPV4ADDRESS:new RegExp("^("+de+")$"),IPV6ADDRESS:new RegExp("^\\[?("+pt+")"+s(s("\\%25|\\%(?!"+S+"{2})")+"("+Je+")")+"?\\]?$")}}var p=u(!1),h=u(!0),_=function(){function f(c,y){var S=[],E=!0,L=!1,z=void 0;try{for(var X=c[Symbol.iterator](),se;!(E=(se=X.next()).done)&&(S.push(se.value),!(y&&S.length===y));E=!0);}catch(ue){L=!0,z=ue}finally{try{!E&&X.return&&X.return()}finally{if(L)throw z}}return S}return function(c,y){if(Array.isArray(c))return c;if(Symbol.iterator in Object(c))return f(c,y);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),T=function(f){if(Array.isArray(f)){for(var c=0,y=Array(f.length);c<f.length;c++)y[c]=f[c];return y}else return Array.from(f)},v=2147483647,R=36,w=1,g=26,O=38,C=700,j=72,D=128,b="-",N=/^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"},ce=R-w,Q=Math.floor,Re=String.fromCharCode;function he(f){throw new RangeError(G[f])}function at(f,c){for(var y=[],S=f.length;S--;)y[S]=c(f[S]);return y}function ct(f,c){var y=f.split("@"),S="";y.length>1&&(S=y[0]+"@",f=y[1]),f=f.replace(W,".");var E=f.split("."),L=at(E,c).join(".");return S+L}function Tt(f){for(var c=[],y=0,S=f.length;y<S;){var E=f.charCodeAt(y++);if(E>=55296&&E<=56319&&y<S){var L=f.charCodeAt(y++);(L&64512)==56320?c.push(((E&1023)<<10)+(L&1023)+65536):(c.push(E),y--)}else c.push(E)}return c}var Xt=function(c){return String.fromCodePoint.apply(String,T(c))},Rt=function(c){return c-48<10?c-22:c-65<26?c-65:c-97<26?c-97:R},F=function(c,y){return c+22+75*(c<26)-((y!=0)<<5)},$=function(c,y,S){var E=0;for(c=S?Q(c/C):c>>1,c+=Q(c/y);c>ce*g>>1;E+=R)c=Q(c/ce);return Q(E+(ce+1)*c/(c+O))},I=function(c){var y=[],S=c.length,E=0,L=D,z=j,X=c.lastIndexOf(b);X<0&&(X=0);for(var se=0;se<X;++se)c.charCodeAt(se)>=128&&he("not-basic"),y.push(c.charCodeAt(se));for(var ue=X>0?X+1:0;ue<S;){for(var Y=E,ne=1,de=R;;de+=R){ue>=S&&he("invalid-input");var x=Rt(c.charCodeAt(ue++));(x>=R||x>Q((v-E)/ne))&&he("overflow"),E+=x*ne;var oe=de<=z?w:de>=z+g?g:de-z;if(x<oe)break;var me=R-oe;ne>Q(v/me)&&he("overflow"),ne*=me}var ae=y.length+1;z=$(E-Y,ae,Y==0),Q(E/ae)>v-L&&he("overflow"),L+=Q(E/ae),E%=ae,y.splice(E++,0,L)}return String.fromCodePoint.apply(String,y)},P=function(c){var y=[];c=Tt(c);var S=c.length,E=D,L=0,z=j,X=!0,se=!1,ue=void 0;try{for(var Y=c[Symbol.iterator](),ne;!(X=(ne=Y.next()).done);X=!0){var de=ne.value;de<128&&y.push(Re(de))}}catch(cr){se=!0,ue=cr}finally{try{!X&&Y.return&&Y.return()}finally{if(se)throw ue}}var x=y.length,oe=x;for(x&&y.push(b);oe<S;){var me=v,ae=!0,Xe=!1,ze=void 0;try{for(var He=c[Symbol.iterator](),At;!(ae=(At=He.next()).done);ae=!0){var dt=At.value;dt>=E&&dt<me&&(me=dt)}}catch(cr){Xe=!0,ze=cr}finally{try{!ae&&He.return&&He.return()}finally{if(Xe)throw ze}}var Ce=oe+1;me-E>Q((v-L)/Ce)&&he("overflow"),L+=(me-E)*Ce,E=me;var Ve=!0,pt=!1,Je=void 0;try{for(var ar=c[Symbol.iterator](),Vs;!(Ve=(Vs=ar.next()).done);Ve=!0){var Ws=Vs.value;if(Ws<E&&++L>v&&he("overflow"),Ws==E){for(var Or=L,Cr=R;;Cr+=R){var Nr=Cr<=z?w:Cr>=z+g?g:Cr-z;if(Or<Nr)break;var xs=Or-Nr,Bs=R-Nr;y.push(Re(F(Nr+xs%Bs,0))),Or=Q(xs/Bs)}y.push(Re(F(Or,0))),z=$(L,Ce,oe==x),L=0,++oe}}}catch(cr){pt=!0,Je=cr}finally{try{!Ve&&ar.return&&ar.return()}finally{if(pt)throw Je}}++L,++E}return y.join("")},a=function(c){return ct(c,function(y){return N.test(y)?I(y.slice(4).toLowerCase()):y})},m=function(c){return ct(c,function(y){return A.test(y)?"xn--"+P(y):y})},k={version:"2.1.0",ucs2:{decode:Tt,encode:Xt},decode:I,encode:P,toASCII:m,toUnicode:a},q={};function M(f){var c=f.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 J(f){for(var c="",y=0,S=f.length;y<S;){var E=parseInt(f.substr(y+1,2),16);if(E<128)c+=String.fromCharCode(E),y+=3;else if(E>=194&&E<224){if(S-y>=6){var L=parseInt(f.substr(y+4,2),16);c+=String.fromCharCode((E&31)<<6|L&63)}else c+=f.substr(y,6);y+=6}else if(E>=224){if(S-y>=9){var z=parseInt(f.substr(y+4,2),16),X=parseInt(f.substr(y+7,2),16);c+=String.fromCharCode((E&15)<<12|(z&63)<<6|X&63)}else c+=f.substr(y,9);y+=9}else c+=f.substr(y,3),y+=3}return c}function Z(f,c){function y(S){var E=J(S);return E.match(c.UNRESERVED)?E:S}return f.scheme&&(f.scheme=String(f.scheme).replace(c.PCT_ENCODED,y).toLowerCase().replace(c.NOT_SCHEME,"")),f.userinfo!==void 0&&(f.userinfo=String(f.userinfo).replace(c.PCT_ENCODED,y).replace(c.NOT_USERINFO,M).replace(c.PCT_ENCODED,o)),f.host!==void 0&&(f.host=String(f.host).replace(c.PCT_ENCODED,y).toLowerCase().replace(c.NOT_HOST,M).replace(c.PCT_ENCODED,o)),f.path!==void 0&&(f.path=String(f.path).replace(c.PCT_ENCODED,y).replace(f.scheme?c.NOT_PATH:c.NOT_PATH_NOSCHEME,M).replace(c.PCT_ENCODED,o)),f.query!==void 0&&(f.query=String(f.query).replace(c.PCT_ENCODED,y).replace(c.NOT_QUERY,M).replace(c.PCT_ENCODED,o)),f.fragment!==void 0&&(f.fragment=String(f.fragment).replace(c.PCT_ENCODED,y).replace(c.NOT_FRAGMENT,M).replace(c.PCT_ENCODED,o)),f}function le(f){return f.replace(/^0*(.*)/,"$1")||"0"}function Me(f,c){var y=f.match(c.IPV4ADDRESS)||[],S=_(y,2),E=S[1];return E?E.split(".").map(le).join("."):f}function Ot(f,c){var y=f.match(c.IPV6ADDRESS)||[],S=_(y,3),E=S[1],L=S[2];if(E){for(var z=E.toLowerCase().split("::").reverse(),X=_(z,2),se=X[0],ue=X[1],Y=ue?ue.split(":").map(le):[],ne=se.split(":").map(le),de=c.IPV4ADDRESS.test(ne[ne.length-1]),x=de?7:8,oe=ne.length-x,me=Array(x),ae=0;ae<x;++ae)me[ae]=Y[ae]||ne[oe+ae]||"";de&&(me[x-1]=Me(me[x-1],c));var Xe=me.reduce(function(Ce,Ve,pt){if(!Ve||Ve==="0"){var Je=Ce[Ce.length-1];Je&&Je.index+Je.length===pt?Je.length++:Ce.push({index:pt,length:1})}return Ce},[]),ze=Xe.sort(function(Ce,Ve){return Ve.length-Ce.length})[0],He=void 0;if(ze&&ze.length>1){var At=me.slice(0,ze.index),dt=me.slice(ze.index+ze.length);He=At.join(":")+"::"+dt.join(":")}else He=me.join(":");return L&&(He+="%"+L),He}else return f}var er=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,tr="".match(/(){0}/)[1]===void 0;function Te(f){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y={},S=c.iri!==!1?h:p;c.reference==="suffix"&&(f=(c.scheme?c.scheme+":":"")+"//"+f);var E=f.match(er);if(E){tr?(y.scheme=E[1],y.userinfo=E[3],y.host=E[4],y.port=parseInt(E[5],10),y.path=E[6]||"",y.query=E[7],y.fragment=E[8],isNaN(y.port)&&(y.port=E[5])):(y.scheme=E[1]||void 0,y.userinfo=f.indexOf("@")!==-1?E[3]:void 0,y.host=f.indexOf("//")!==-1?E[4]:void 0,y.port=parseInt(E[5],10),y.path=E[6]||"",y.query=f.indexOf("?")!==-1?E[7]:void 0,y.fragment=f.indexOf("#")!==-1?E[8]:void 0,isNaN(y.port)&&(y.port=f.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?E[4]:void 0)),y.host&&(y.host=Ot(Me(y.host,S),S)),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 L=q[(c.scheme||y.scheme||"").toLowerCase()];if(!c.unicodeSupport&&(!L||!L.unicodeSupport)){if(y.host&&(c.domainHost||L&&L.domainHost))try{y.host=k.toASCII(y.host.replace(S.PCT_ENCODED,J).toLowerCase())}catch(z){y.error=y.error||"Host's domain name can not be converted to ASCII via punycode: "+z}Z(y,p)}else Z(y,S);L&&L.parse&&L.parse(y,c)}else y.error=y.error||"URI can not be parsed.";return y}function rr(f,c){var y=c.iri!==!1?h:p,S=[];return f.userinfo!==void 0&&(S.push(f.userinfo),S.push("@")),f.host!==void 0&&S.push(Ot(Me(String(f.host),y),y).replace(y.IPV6ADDRESS,function(E,L,z){return"["+L+(z?"%25"+z:"")+"]"})),(typeof f.port=="number"||typeof f.port=="string")&&(S.push(":"),S.push(String(f.port))),S.length?S.join(""):void 0}var Ct=/^\.\.?\//,Nt=/^\/\.(\/|$)/,kt=/^\/\.\.(\/|$)/,nr=/^\/?(?:.|\n)*?(?=\/|$)/;function Ue(f){for(var c=[];f.length;)if(f.match(Ct))f=f.replace(Ct,"");else if(f.match(Nt))f=f.replace(Nt,"/");else if(f.match(kt))f=f.replace(kt,"/"),c.pop();else if(f==="."||f==="..")f="";else{var y=f.match(nr);if(y){var S=y[0];f=f.slice(S.length),c.push(S)}else throw new Error("Unexpected dot segment condition")}return c.join("")}function Pe(f){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y=c.iri?h:p,S=[],E=q[(c.scheme||f.scheme||"").toLowerCase()];if(E&&E.serialize&&E.serialize(f,c),f.host&&!y.IPV6ADDRESS.test(f.host)){if(c.domainHost||E&&E.domainHost)try{f.host=c.iri?k.toUnicode(f.host):k.toASCII(f.host.replace(y.PCT_ENCODED,J).toLowerCase())}catch(X){f.error=f.error||"Host's domain name can not be converted to "+(c.iri?"Unicode":"ASCII")+" via punycode: "+X}}Z(f,y),c.reference!=="suffix"&&f.scheme&&(S.push(f.scheme),S.push(":"));var L=rr(f,c);if(L!==void 0&&(c.reference!=="suffix"&&S.push("//"),S.push(L),f.path&&f.path.charAt(0)!=="/"&&S.push("/")),f.path!==void 0){var z=f.path;!c.absolutePath&&(!E||!E.absolutePath)&&(z=Ue(z)),L===void 0&&(z=z.replace(/^\/\//,"/%2F")),S.push(z)}return f.query!==void 0&&(S.push("?"),S.push(f.query)),f.fragment!==void 0&&(S.push("#"),S.push(f.fragment)),S.join("")}function jt(f,c){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},S=arguments[3],E={};return S||(f=Te(Pe(f,y),y),c=Te(Pe(c,y),y)),y=y||{},!y.tolerant&&c.scheme?(E.scheme=c.scheme,E.userinfo=c.userinfo,E.host=c.host,E.port=c.port,E.path=Ue(c.path||""),E.query=c.query):(c.userinfo!==void 0||c.host!==void 0||c.port!==void 0?(E.userinfo=c.userinfo,E.host=c.host,E.port=c.port,E.path=Ue(c.path||""),E.query=c.query):(c.path?(c.path.charAt(0)==="/"?E.path=Ue(c.path):((f.userinfo!==void 0||f.host!==void 0||f.port!==void 0)&&!f.path?E.path="/"+c.path:f.path?E.path=f.path.slice(0,f.path.lastIndexOf("/")+1)+c.path:E.path=c.path,E.path=Ue(E.path)),E.query=c.query):(E.path=f.path,c.query!==void 0?E.query=c.query:E.query=f.query),E.userinfo=f.userinfo,E.host=f.host,E.port=f.port),E.scheme=f.scheme),E.fragment=c.fragment,E}function sr(f,c,y){var S=d({scheme:"null"},y);return Pe(jt(Te(f,S),Te(c,S),S,!0),S)}function lt(f,c){return typeof f=="string"?f=Pe(Te(f,c),c):i(f)==="object"&&(f=Te(Pe(f,c),c)),f}function ir(f,c,y){return typeof f=="string"?f=Pe(Te(f,y),y):i(f)==="object"&&(f=Pe(f,y)),typeof c=="string"?c=Pe(Te(c,y),y):i(c)==="object"&&(c=Pe(c,y)),f===c}function Rr(f,c){return f&&f.toString().replace(!c||!c.iri?p.ESCAPE:h.ESCAPE,M)}function Oe(f,c){return f&&f.toString().replace(!c||!c.iri?p.PCT_ENCODED:h.PCT_ENCODED,J)}var ut={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 S=String(c.scheme).toLowerCase()==="https";return(c.port===(S?443:80)||c.port==="")&&(c.port=void 0),c.path||(c.path="/"),c}},Ds={scheme:"https",domainHost:ut.domainHost,parse:ut.parse,serialize:ut.serialize};function Fs(f){return typeof f.secure=="boolean"?f.secure:String(f.scheme).toLowerCase()==="wss"}var or={scheme:"ws",domainHost:!0,parse:function(c,y){var S=c;return S.secure=Fs(S),S.resourceName=(S.path||"/")+(S.query?"?"+S.query:""),S.path=void 0,S.query=void 0,S},serialize:function(c,y){if((c.port===(Fs(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 S=c.resourceName.split("?"),E=_(S,2),L=E[0],z=E[1];c.path=L&&L!=="/"?L:void 0,c.query=z,c.resourceName=void 0}return c.fragment=void 0,c}},qs={scheme:"wss",domainHost:or.domainHost,parse:or.parse,serialize:or.serialize},ga={},Ms="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Le="[0-9A-Fa-f]",$a=s(s("%[EFef]"+Le+"%"+Le+Le+"%"+Le+Le)+"|"+s("%[89A-Fa-f]"+Le+"%"+Le+Le)+"|"+s("%"+Le+Le)),wa="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",_a="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",va=n(_a,'[\\"\\\\]'),ba="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Pa=new RegExp(Ms,"g"),It=new RegExp($a,"g"),Ea=new RegExp(n("[^]",wa,"[\\.]",'[\\"]',va),"g"),Us=new RegExp(n("[^]",Ms,ba),"g"),Sa=Us;function Pn(f){var c=J(f);return c.match(Pa)?c:f}var Ls={scheme:"mailto",parse:function(c,y){var S=c,E=S.to=S.path?S.path.split(","):[];if(S.path=void 0,S.query){for(var L=!1,z={},X=S.query.split("&"),se=0,ue=X.length;se<ue;++se){var Y=X[se].split("=");switch(Y[0]){case"to":for(var ne=Y[1].split(","),de=0,x=ne.length;de<x;++de)E.push(ne[de]);break;case"subject":S.subject=Oe(Y[1],y);break;case"body":S.body=Oe(Y[1],y);break;default:L=!0,z[Oe(Y[0],y)]=Oe(Y[1],y);break}}L&&(S.headers=z)}S.query=void 0;for(var oe=0,me=E.length;oe<me;++oe){var ae=E[oe].split("@");if(ae[0]=Oe(ae[0]),y.unicodeSupport)ae[1]=Oe(ae[1],y).toLowerCase();else try{ae[1]=k.toASCII(Oe(ae[1],y).toLowerCase())}catch(Xe){S.error=S.error||"Email address's domain name can not be converted to ASCII via punycode: "+Xe}E[oe]=ae.join("@")}return S},serialize:function(c,y){var S=c,E=l(c.to);if(E){for(var L=0,z=E.length;L<z;++L){var X=String(E[L]),se=X.lastIndexOf("@"),ue=X.slice(0,se).replace(It,Pn).replace(It,o).replace(Ea,M),Y=X.slice(se+1);try{Y=y.iri?k.toUnicode(Y):k.toASCII(Oe(Y,y).toLowerCase())}catch(oe){S.error=S.error||"Email address's domain name can not be converted to "+(y.iri?"Unicode":"ASCII")+" via punycode: "+oe}E[L]=ue+"@"+Y}S.path=E.join(",")}var ne=c.headers=c.headers||{};c.subject&&(ne.subject=c.subject),c.body&&(ne.body=c.body);var de=[];for(var x in ne)ne[x]!==ga[x]&&de.push(x.replace(It,Pn).replace(It,o).replace(Us,M)+"="+ne[x].replace(It,Pn).replace(It,o).replace(Sa,M));return de.length&&(S.query=de.join("&")),S}},Ta=/^([^\:]+)\:(.*)/,zs={scheme:"urn",parse:function(c,y){var S=c.path&&c.path.match(Ta),E=c;if(S){var L=y.scheme||E.scheme||"urn",z=S[1].toLowerCase(),X=S[2],se=L+":"+(y.nid||z),ue=q[se];E.nid=z,E.nss=X,E.path=void 0,ue&&(E=ue.parse(E,y))}else E.error=E.error||"URN can not be parsed.";return E},serialize:function(c,y){var S=y.scheme||c.scheme||"urn",E=c.nid,L=S+":"+(y.nid||E),z=q[L];z&&(c=z.serialize(c,y));var X=c,se=c.nss;return X.path=(E||y.nid)+":"+se,X}},Ra=/^[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 S=c;return S.uuid=S.nss,S.nss=void 0,!y.tolerant&&(!S.uuid||!S.uuid.match(Ra))&&(S.error=S.error||"UUID is not valid."),S},serialize:function(c,y){var S=c;return S.nss=(c.uuid||"").toLowerCase(),S}};q[ut.scheme]=ut,q[Ds.scheme]=Ds,q[or.scheme]=or,q[qs.scheme]=qs,q[Ls.scheme]=Ls,q[zs.scheme]=zs,q[Hs.scheme]=Hs,r.SCHEMES=q,r.pctEncChar=M,r.pctDecChars=J,r.parse=Te,r.removeDotSegments=Ue,r.serialize=Pe,r.resolveComponents=jt,r.resolve=sr,r.normalize=lt,r.equal=ir,r.escapeComponent=Rr,r.unescapeComponent=Oe,Object.defineProperty(r,"__esModule",{value:!0})})})(Fn,Fn.exports);var su=Fn.exports;Object.defineProperty(ts,"__esModule",{value:!0});const Yo=su;Yo.code='require("ajv/dist/runtime/uri").default';ts.default=Yo;(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=Ae;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=K;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=Er,s=Sr,i=Pt,o=Se,l=K,d=$e,u=Pr,p=re,h=nu,_=ts,T=(F,$)=>new RegExp(F,$);T.code="new RegExp";const v=["removeAdditional","useDefaults","coerceTypes"],R=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.'},O=200;function C(F){var $,I,P,a,m,k,q,M,J,Z,le,Me,Ot,er,tr,Te,rr,Ct,Nt,kt,nr,Ue,Pe,jt,sr;const lt=F.strict,ir=($=F.code)===null||$===void 0?void 0:$.optimize,Rr=ir===!0||ir===void 0?1:ir||0,Oe=(P=(I=F.code)===null||I===void 0?void 0:I.regExp)!==null&&P!==void 0?P:T,ut=(a=F.uriResolver)!==null&&a!==void 0?a:_.default;return{strictSchema:(k=(m=F.strictSchema)!==null&&m!==void 0?m:lt)!==null&&k!==void 0?k:!0,strictNumbers:(M=(q=F.strictNumbers)!==null&&q!==void 0?q:lt)!==null&&M!==void 0?M:!0,strictTypes:(Z=(J=F.strictTypes)!==null&&J!==void 0?J:lt)!==null&&Z!==void 0?Z:"log",strictTuples:(Me=(le=F.strictTuples)!==null&&le!==void 0?le:lt)!==null&&Me!==void 0?Me:"log",strictRequired:(er=(Ot=F.strictRequired)!==null&&Ot!==void 0?Ot:lt)!==null&&er!==void 0?er:!1,code:F.code?{...F.code,optimize:Rr,regExp:Oe}:{optimize:Rr,regExp:Oe},loopRequired:(tr=F.loopRequired)!==null&&tr!==void 0?tr:O,loopEnum:(Te=F.loopEnum)!==null&&Te!==void 0?Te:O,meta:(rr=F.meta)!==null&&rr!==void 0?rr:!0,messages:(Ct=F.messages)!==null&&Ct!==void 0?Ct:!0,inlineRefs:(Nt=F.inlineRefs)!==null&&Nt!==void 0?Nt:!0,schemaId:(kt=F.schemaId)!==null&&kt!==void 0?kt:"$id",addUsedSchema:(nr=F.addUsedSchema)!==null&&nr!==void 0?nr:!0,validateSchema:(Ue=F.validateSchema)!==null&&Ue!==void 0?Ue:!0,validateFormats:(Pe=F.validateFormats)!==null&&Pe!==void 0?Pe:!0,unicodeRegExp:(jt=F.unicodeRegExp)!==null&&jt!==void 0?jt:!0,int32range:(sr=F.int32range)!==null&&sr!==void 0?sr:!0,uriResolver:ut}}class j{constructor($={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...C($)};const{es5:I,lines:P}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:R,es5:I,lines:P}),this.logger=Q($.logger);const a=$.validateFormats;$.validateFormats=!1,this.RULES=(0,i.getRules)(),D.call(this,w,$,"NOT SUPPORTED"),D.call(this,g,$,"DEPRECATED","warn"),this._metaOpts=G.call(this),$.formats&&A.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords&&W.call(this,$.keywords),typeof $.meta=="object"&&this.addMetaSchema($.meta),N.call(this),$.validateFormats=a}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:$,meta:I,schemaId:P}=this.opts;let a=h;P==="id"&&(a={...h},a.id=a.$id,delete a.$id),I&&$&&this.addMetaSchema(a,a[P],!1)}defaultMeta(){const{meta:$,schemaId:I}=this.opts;return this.opts.defaultMeta=typeof $=="object"?$[I]||$:void 0}validate($,I){let P;if(typeof $=="string"){if(P=this.getSchema($),!P)throw new Error(`no schema with key or ref "${$}"`)}else P=this.compile($);const a=P(I);return"$async"in P||(this.errors=P.errors),a}compile($,I){const P=this._addSchema($,I);return P.validate||this._compileSchemaEnv(P)}compileAsync($,I){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:P}=this.opts;return a.call(this,$,I);async function a(Z,le){await m.call(this,Z.$schema);const Me=this._addSchema(Z,le);return Me.validate||k.call(this,Me)}async function m(Z){Z&&!this.getSchema(Z)&&await a.call(this,{$ref:Z},!0)}async function k(Z){try{return this._compileSchemaEnv(Z)}catch(le){if(!(le instanceof s.default))throw le;return q.call(this,le),await M.call(this,le.missingSchema),k.call(this,Z)}}function q({missingSchema:Z,missingRef:le}){if(this.refs[Z])throw new Error(`AnySchema ${Z} is loaded but ${le} cannot be resolved`)}async function M(Z){const le=await J.call(this,Z);this.refs[Z]||await m.call(this,le.$schema),this.refs[Z]||this.addSchema(le,Z,I)}async function J(Z){const le=this._loading[Z];if(le)return le;try{return await(this._loading[Z]=P(Z))}finally{delete this._loading[Z]}}}addSchema($,I,P,a=this.opts.validateSchema){if(Array.isArray($)){for(const k of $)this.addSchema(k,void 0,P,a);return this}let m;if(typeof $=="object"){const{schemaId:k}=this.opts;if(m=$[k],m!==void 0&&typeof m!="string")throw new Error(`schema ${k} must be string`)}return I=(0,d.normalizeId)(I||m),this._checkUnique(I),this.schemas[I]=this._addSchema($,P,I,a,!0),this}addMetaSchema($,I,P=this.opts.validateSchema){return this.addSchema($,I,!0,P),this}validateSchema($,I){if(typeof $=="boolean")return!0;let P;if(P=$.$schema,P!==void 0&&typeof P!="string")throw new Error("$schema must be a string");if(P=P||this.opts.defaultMeta||this.defaultMeta(),!P)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const a=this.validate(P,$);if(!a&&I){const m="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(m);else throw new Error(m)}return a}getSchema($){let I;for(;typeof(I=b.call(this,$))=="string";)$=I;if(I===void 0){const{schemaId:P}=this.opts,a=new o.SchemaEnv({schema:{},schemaId:P});if(I=o.resolveSchema.call(this,a,$),!I)return;this.refs[$]=I}return I.validate||this._compileSchemaEnv(I)}removeSchema($){if($ instanceof RegExp)return this._removeAllSchemas(this.schemas,$),this._removeAllSchemas(this.refs,$),this;switch(typeof $){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const I=b.call(this,$);return typeof I=="object"&&this._cache.delete(I.schema),delete this.schemas[$],delete this.refs[$],this}case"object":{const I=$;this._cache.delete(I);let P=$[this.opts.schemaId];return P&&(P=(0,d.normalizeId)(P),delete this.schemas[P],delete this.refs[P]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary($){for(const I of $)this.addKeyword(I);return this}addKeyword($,I){let P;if(typeof $=="string")P=$,typeof I=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),I.keyword=P);else if(typeof $=="object"&&I===void 0){if(I=$,P=I.keyword,Array.isArray(P)&&!P.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(he.call(this,P,I),!I)return(0,p.eachItem)(P,m=>at.call(this,m)),this;Tt.call(this,I);const a={...I,type:(0,u.getJSONTypes)(I.type),schemaType:(0,u.getJSONTypes)(I.schemaType)};return(0,p.eachItem)(P,a.type.length===0?m=>at.call(this,m,a):m=>a.type.forEach(k=>at.call(this,m,a,k))),this}getKeyword($){const I=this.RULES.all[$];return typeof I=="object"?I.definition:!!I}removeKeyword($){const{RULES:I}=this;delete I.keywords[$],delete I.all[$];for(const P of I.rules){const a=P.rules.findIndex(m=>m.keyword===$);a>=0&&P.rules.splice(a,1)}return this}addFormat($,I){return typeof I=="string"&&(I=new RegExp(I)),this.formats[$]=I,this}errorsText($=this.errors,{separator:I=", ",dataVar:P="data"}={}){return!$||$.length===0?"No errors":$.map(a=>`${P}${a.instancePath} ${a.message}`).reduce((a,m)=>a+I+m)}$dataMetaSchema($,I){const P=this.RULES.all;$=JSON.parse(JSON.stringify($));for(const a of I){const m=a.split("/").slice(1);let k=$;for(const q of m)k=k[q];for(const q in P){const M=P[q];if(typeof M!="object")continue;const{$data:J}=M.definition,Z=k[q];J&&Z&&(k[q]=Rt(Z))}}return $}_removeAllSchemas($,I){for(const P in $){const a=$[P];(!I||I.test(P))&&(typeof a=="string"?delete $[P]:a&&!a.meta&&(this._cache.delete(a.schema),delete $[P]))}}_addSchema($,I,P,a=this.opts.validateSchema,m=this.opts.addUsedSchema){let k;const{schemaId:q}=this.opts;if(typeof $=="object")k=$[q];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof $!="boolean")throw new Error("schema must be object or boolean")}let M=this._cache.get($);if(M!==void 0)return M;P=(0,d.normalizeId)(k||P);const J=d.getSchemaRefs.call(this,$,P);return M=new o.SchemaEnv({schema:$,schemaId:q,meta:I,baseId:P,localRefs:J}),this._cache.set(M.schema,M),m&&!P.startsWith("#")&&(P&&this._checkUnique(P),this.refs[P]=M),a&&this.validateSchema($,!0),M}_checkUnique($){if(this.schemas[$]||this.refs[$])throw new Error(`schema with key or id "${$}" already exists`)}_compileSchemaEnv($){if($.meta?this._compileMetaSchema($):o.compileSchema.call(this,$),!$.validate)throw new Error("ajv implementation error");return $.validate}_compileMetaSchema($){const I=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,$)}finally{this.opts=I}}}e.default=j,j.ValidationError=n.default,j.MissingRefError=s.default;function D(F,$,I,P="error"){for(const a in F){const m=a;m in $&&this.logger[P](`${I}: option ${a}. ${F[m]}`)}}function b(F){return F=(0,d.normalizeId)(F),this.schemas[F]||this.refs[F]}function N(){const F=this.opts.schemas;if(F)if(Array.isArray(F))this.addSchema(F);else for(const $ in F)this.addSchema(F[$],$)}function A(){for(const F in this.opts.formats){const $=this.opts.formats[F];$&&this.addFormat(F,$)}}function W(F){if(Array.isArray(F)){this.addVocabulary(F);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const $ in F){const I=F[$];I.keyword||(I.keyword=$),this.addKeyword(I)}}function G(){const F={...this.opts};for(const $ of v)delete F[$];return F}const ce={log(){},warn(){},error(){}};function Q(F){if(F===!1)return ce;if(F===void 0)return console;if(F.log&&F.warn&&F.error)return F;throw new Error("logger must implement log, warn and error methods")}const Re=/^[a-z_$][a-z0-9_$:-]*$/i;function he(F,$){const{RULES:I}=this;if((0,p.eachItem)(F,P=>{if(I.keywords[P])throw new Error(`Keyword ${P} is already defined`);if(!Re.test(P))throw new Error(`Keyword ${P} has invalid name`)}),!!$&&$.$data&&!("code"in $||"validate"in $))throw new Error('$data keyword must have "code" or "validate" function')}function at(F,$,I){var P;const a=$==null?void 0:$.post;if(I&&a)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:m}=this;let k=a?m.post:m.rules.find(({type:M})=>M===I);if(k||(k={type:I,rules:[]},m.rules.push(k)),m.keywords[F]=!0,!$)return;const q={keyword:F,definition:{...$,type:(0,u.getJSONTypes)($.type),schemaType:(0,u.getJSONTypes)($.schemaType)}};$.before?ct.call(this,k,q,$.before):k.rules.push(q),m.all[F]=q,(P=$.implements)===null||P===void 0||P.forEach(M=>this.addKeyword(M))}function ct(F,$,I){const P=F.rules.findIndex(a=>a.keyword===I);P>=0?F.rules.splice(P,0,$):(F.rules.push($),this.logger.warn(`rule ${I} is not defined`))}function Tt(F){let{metaSchema:$}=F;$!==void 0&&(F.$data&&this.opts.$data&&($=Rt($)),F.validateSchema=this.compile($,!0))}const Xt={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Rt(F){return{anyOf:[F,Xt]}}})(So);var rs={},ns={},ss={};Object.defineProperty(ss,"__esModule",{value:!0});const iu={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};ss.default=iu;var Et={};Object.defineProperty(Et,"__esModule",{value:!0});Et.callRef=Et.getValidate=void 0;const ou=Sr,fi=B,Ee=K,qt=Ge,hi=Se,kr=re,au={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:i,validateName:o,opts:l,self:d}=n,{root:u}=i;if((r==="#"||r==="#/")&&s===u.baseId)return h();const p=hi.resolveRef.call(d,u,s,r);if(p===void 0)throw new ou.default(n.opts.uriResolver,s,r);if(p instanceof hi.SchemaEnv)return _(p);return T(p);function h(){if(i===u)return Ur(e,o,i,i.$async);const v=t.scopeValue("root",{ref:u});return Ur(e,(0,Ee._)`${v}.validate`,u,u.$async)}function _(v){const R=Zo(e,v);Ur(e,R,v,v.$async)}function T(v){const R=t.scopeValue("schema",l.code.source===!0?{ref:v,code:(0,Ee.stringify)(v)}:{ref:v}),w=t.name("valid"),g=e.subschema({schema:v,dataTypes:[],schemaPath:Ee.nil,topSchemaRef:R,errSchemaPath:r},w);e.mergeEvaluated(g),e.ok(w)}}};function Zo(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,Ee._)`${r.scopeValue("wrapper",{ref:t})}.validate`}Et.getValidate=Zo;function Ur(e,t,r,n){const{gen:s,it:i}=e,{allErrors:o,schemaEnv:l,opts:d}=i,u=d.passContext?qt.default.this:Ee.nil;n?p():h();function p(){if(!l.$async)throw new Error("async schema referenced by sync schema");const v=s.let("valid");s.try(()=>{s.code((0,Ee._)`await ${(0,fi.callValidateCode)(e,t,u)}`),T(t),o||s.assign(v,!0)},R=>{s.if((0,Ee._)`!(${R} instanceof ${i.ValidationError})`,()=>s.throw(R)),_(R),o||s.assign(v,!1)}),e.ok(v)}function h(){e.result((0,fi.callValidateCode)(e,t,u),()=>T(t),()=>_(t))}function _(v){const R=(0,Ee._)`${v}.errors`;s.assign(qt.default.vErrors,(0,Ee._)`${qt.default.vErrors} === null ? ${R} : ${qt.default.vErrors}.concat(${R})`),s.assign(qt.default.errors,(0,Ee._)`${qt.default.vErrors}.length`)}function T(v){var R;if(!i.opts.unevaluated)return;const w=(R=r==null?void 0:r.validate)===null||R===void 0?void 0:R.evaluated;if(i.props!==!0)if(w&&!w.dynamicProps)w.props!==void 0&&(i.props=kr.mergeEvaluated.props(s,w.props,i.props));else{const g=s.var("props",(0,Ee._)`${v}.evaluated.props`);i.props=kr.mergeEvaluated.props(s,g,i.props,Ee.Name)}if(i.items!==!0)if(w&&!w.dynamicItems)w.items!==void 0&&(i.items=kr.mergeEvaluated.items(s,w.items,i.items));else{const g=s.var("items",(0,Ee._)`${v}.evaluated.items`);i.items=kr.mergeEvaluated.items(s,g,i.items,Ee.Name)}}}Et.callRef=Ur;Et.default=au;Object.defineProperty(ns,"__esModule",{value:!0});const cu=ss,lu=Et,uu=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",cu.default,lu.default];ns.default=uu;var is={},os={};Object.defineProperty(os,"__esModule",{value:!0});const xr=K,rt=xr.operators,Br={maximum:{okStr:"<=",ok:rt.LTE,fail:rt.GT},minimum:{okStr:">=",ok:rt.GTE,fail:rt.LT},exclusiveMaximum:{okStr:"<",ok:rt.LT,fail:rt.GTE},exclusiveMinimum:{okStr:">",ok:rt.GT,fail:rt.LTE}},du={message:({keyword:e,schemaCode:t})=>(0,xr.str)`must be ${Br[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,xr._)`{comparison: ${Br[e].okStr}, limit: ${t}}`},pu={keyword:Object.keys(Br),type:"number",schemaType:"number",$data:!0,error:du,code(e){const{keyword:t,data:r,schemaCode:n}=e;e.fail$data((0,xr._)`${r} ${Br[t].fail} ${n} || isNaN(${r})`)}};os.default=pu;var as={};Object.defineProperty(as,"__esModule",{value:!0});const hr=K,fu={message:({schemaCode:e})=>(0,hr.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,hr._)`{multipleOf: ${e}}`},hu={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:fu,code(e){const{gen:t,data:r,schemaCode:n,it:s}=e,i=s.opts.multipleOfPrecision,o=t.let("res"),l=i?(0,hr._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:(0,hr._)`${o} !== parseInt(${o})`;e.fail$data((0,hr._)`(${n} === 0 || (${o} = ${r}/${n}, ${l}))`)}};as.default=hu;var cs={},ls={};Object.defineProperty(ls,"__esModule",{value:!0});function Qo(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}ls.default=Qo;Qo.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(cs,"__esModule",{value:!0});const mt=K,mu=re,yu=ls,gu={message({keyword:e,schemaCode:t}){const r=e==="maxLength"?"more":"fewer";return(0,mt.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,mt._)`{limit: ${e}}`},$u={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:gu,code(e){const{keyword:t,data:r,schemaCode:n,it:s}=e,i=t==="maxLength"?mt.operators.GT:mt.operators.LT,o=s.opts.unicode===!1?(0,mt._)`${r}.length`:(0,mt._)`${(0,mu.useFunc)(e.gen,yu.default)}(${r})`;e.fail$data((0,mt._)`${o} ${i} ${n}`)}};cs.default=$u;var us={};Object.defineProperty(us,"__esModule",{value:!0});const wu=B,Kr=K,_u={message:({schemaCode:e})=>(0,Kr.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,Kr._)`{pattern: ${e}}`},vu={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:_u,code(e){const{data:t,$data:r,schema:n,schemaCode:s,it:i}=e,o=i.opts.unicodeRegExp?"u":"",l=r?(0,Kr._)`(new RegExp(${s}, ${o}))`:(0,wu.usePattern)(e,n);e.fail$data((0,Kr._)`!${l}.test(${t})`)}};us.default=vu;var ds={};Object.defineProperty(ds,"__esModule",{value:!0});const mr=K,bu={message({keyword:e,schemaCode:t}){const r=e==="maxProperties"?"more":"fewer";return(0,mr.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,mr._)`{limit: ${e}}`},Pu={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:bu,code(e){const{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?mr.operators.GT:mr.operators.LT;e.fail$data((0,mr._)`Object.keys(${r}).length ${s} ${n}`)}};ds.default=Pu;var ps={};Object.defineProperty(ps,"__esModule",{value:!0});const ur=B,yr=K,Eu=re,Su={message:({params:{missingProperty:e}})=>(0,yr.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,yr._)`{missingProperty: ${e}}`},Tu={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Su,code(e){const{gen:t,schema:r,schemaCode:n,data:s,$data:i,it:o}=e,{opts:l}=o;if(!i&&r.length===0)return;const d=r.length>=l.loopRequired;if(o.allErrors?u():p(),l.strictRequired){const T=e.parentSchema.properties,{definedProperties:v}=e.it;for(const R of r)if((T==null?void 0:T[R])===void 0&&!v.has(R)){const w=o.schemaEnv.baseId+o.errSchemaPath,g=`required property "${R}" is not defined at "${w}" (strictRequired)`;(0,Eu.checkStrictMode)(o,g,o.opts.strictRequired)}}function u(){if(d||i)e.block$data(yr.nil,h);else for(const T of r)(0,ur.checkReportMissingProp)(e,T)}function p(){const T=t.let("missing");if(d||i){const v=t.let("valid",!0);e.block$data(v,()=>_(T,v)),e.ok(v)}else t.if((0,ur.checkMissingProp)(e,r,T)),(0,ur.reportMissingProp)(e,T),t.else()}function h(){t.forOf("prop",n,T=>{e.setParams({missingProperty:T}),t.if((0,ur.noPropertyInData)(t,s,T,l.ownProperties),()=>e.error())})}function _(T,v){e.setParams({missingProperty:T}),t.forOf(T,n,()=>{t.assign(v,(0,ur.propertyInData)(t,s,T,l.ownProperties)),t.if((0,yr.not)(v),()=>{e.error(),t.break()})},yr.nil)}}};ps.default=Tu;var fs={};Object.defineProperty(fs,"__esModule",{value:!0});const gr=K,Ru={message({keyword:e,schemaCode:t}){const r=e==="maxItems"?"more":"fewer";return(0,gr.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,gr._)`{limit: ${e}}`},Ou={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Ru,code(e){const{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?gr.operators.GT:gr.operators.LT;e.fail$data((0,gr._)`${r}.length ${s} ${n}`)}};fs.default=Ou;var hs={},Tr={};Object.defineProperty(Tr,"__esModule",{value:!0});const Xo=Io;Xo.code='require("ajv/dist/runtime/equal").default';Tr.default=Xo;Object.defineProperty(hs,"__esModule",{value:!0});const Cn=Pr,ge=K,Cu=re,Nu=Tr,ku={message:({params:{i:e,j:t}})=>(0,ge.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,ge._)`{i: ${e}, j: ${t}}`},ju={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:ku,code(e){const{gen:t,data:r,$data:n,schema:s,parentSchema:i,schemaCode:o,it:l}=e;if(!n&&!s)return;const d=t.let("valid"),u=i.items?(0,Cn.getSchemaTypes)(i.items):[];e.block$data(d,p,(0,ge._)`${o} === false`),e.ok(d);function p(){const v=t.let("i",(0,ge._)`${r}.length`),R=t.let("j");e.setParams({i:v,j:R}),t.assign(d,!0),t.if((0,ge._)`${v} > 1`,()=>(h()?_:T)(v,R))}function h(){return u.length>0&&!u.some(v=>v==="object"||v==="array")}function _(v,R){const w=t.name("item"),g=(0,Cn.checkDataTypes)(u,w,l.opts.strictNumbers,Cn.DataType.Wrong),O=t.const("indices",(0,ge._)`{}`);t.for((0,ge._)`;${v}--;`,()=>{t.let(w,(0,ge._)`${r}[${v}]`),t.if(g,(0,ge._)`continue`),u.length>1&&t.if((0,ge._)`typeof ${w} == "string"`,(0,ge._)`${w} += "_"`),t.if((0,ge._)`typeof ${O}[${w}] == "number"`,()=>{t.assign(R,(0,ge._)`${O}[${w}]`),e.error(),t.assign(d,!1).break()}).code((0,ge._)`${O}[${w}] = ${v}`)})}function T(v,R){const w=(0,Cu.useFunc)(t,Nu.default),g=t.name("outer");t.label(g).for((0,ge._)`;${v}--;`,()=>t.for((0,ge._)`${R} = ${v}; ${R}--;`,()=>t.if((0,ge._)`${w}(${r}[${v}], ${r}[${R}])`,()=>{e.error(),t.assign(d,!1).break(g)})))}}};hs.default=ju;var ms={};Object.defineProperty(ms,"__esModule",{value:!0});const qn=K,Iu=re,Au=Tr,Du={message:"must be equal to constant",params:({schemaCode:e})=>(0,qn._)`{allowedValue: ${e}}`},Fu={keyword:"const",$data:!0,error:Du,code(e){const{gen:t,data:r,$data:n,schemaCode:s,schema:i}=e;n||i&&typeof i=="object"?e.fail$data((0,qn._)`!${(0,Iu.useFunc)(t,Au.default)}(${r}, ${s})`):e.fail((0,qn._)`${i} !== ${r}`)}};ms.default=Fu;var ys={};Object.defineProperty(ys,"__esModule",{value:!0});const pr=K,qu=re,Mu=Tr,Uu={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,pr._)`{allowedValues: ${e}}`},Lu={keyword:"enum",schemaType:"array",$data:!0,error:Uu,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 l=s.length>=o.opts.loopEnum;let d;const u=()=>d??(d=(0,qu.useFunc)(t,Mu.default));let p;if(l||n)p=t.let("valid"),e.block$data(p,h);else{if(!Array.isArray(s))throw new Error("ajv implementation error");const T=t.const("vSchema",i);p=(0,pr.or)(...s.map((v,R)=>_(T,R)))}e.pass(p);function h(){t.assign(p,!1),t.forOf("v",i,T=>t.if((0,pr._)`${u()}(${r}, ${T})`,()=>t.assign(p,!0).break()))}function _(T,v){const R=s[v];return typeof R=="object"&&R!==null?(0,pr._)`${u()}(${r}, ${T}[${v}])`:(0,pr._)`${r} === ${R}`}}};ys.default=Lu;Object.defineProperty(is,"__esModule",{value:!0});const zu=os,Hu=as,Vu=cs,Wu=us,xu=ds,Bu=ps,Ku=fs,Gu=hs,Ju=ms,Yu=ys,Zu=[zu.default,Hu.default,Vu.default,Wu.default,xu.default,Bu.default,Ku.default,Gu.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Ju.default,Yu.default];is.default=Zu;var gs={},Zt={};Object.defineProperty(Zt,"__esModule",{value:!0});Zt.validateAdditionalItems=void 0;const yt=K,Mn=re,Qu={message:({params:{len:e}})=>(0,yt.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,yt._)`{limit: ${e}}`},Xu={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Qu,code(e){const{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,Mn.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}ea(e,n)}};function ea(e,t){const{gen:r,schema:n,data:s,keyword:i,it:o}=e;o.items=!0;const l=r.const("len",(0,yt._)`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass((0,yt._)`${l} <= ${t.length}`);else if(typeof n=="object"&&!(0,Mn.alwaysValidSchema)(o,n)){const u=r.var("valid",(0,yt._)`${l} <= ${t.length}`);r.if((0,yt.not)(u),()=>d(u)),e.ok(u)}function d(u){r.forRange("i",t.length,l,p=>{e.subschema({keyword:i,dataProp:p,dataPropType:Mn.Type.Num},u),o.allErrors||r.if((0,yt.not)(u),()=>r.break())})}}Zt.validateAdditionalItems=ea;Zt.default=Xu;var $s={},Qt={};Object.defineProperty(Qt,"__esModule",{value:!0});Qt.validateTuple=void 0;const mi=K,Lr=re,ed=B,td={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return ta(e,"additionalItems",t);r.items=!0,!(0,Lr.alwaysValidSchema)(r,t)&&e.ok((0,ed.validateArray)(e))}};function ta(e,t,r=e.schema){const{gen:n,parentSchema:s,data:i,keyword:o,it:l}=e;p(s),l.opts.unevaluated&&r.length&&l.items!==!0&&(l.items=Lr.mergeEvaluated.items(n,r.length,l.items));const d=n.name("valid"),u=n.const("len",(0,mi._)`${i}.length`);r.forEach((h,_)=>{(0,Lr.alwaysValidSchema)(l,h)||(n.if((0,mi._)`${u} > ${_}`,()=>e.subschema({keyword:o,schemaProp:_,dataProp:_},d)),e.ok(d))});function p(h){const{opts:_,errSchemaPath:T}=l,v=r.length,R=v===h.minItems&&(v===h.maxItems||h[t]===!1);if(_.strictTuples&&!R){const w=`"${o}" is ${v}-tuple, but minItems or maxItems/${t} are not specified or different at path "${T}"`;(0,Lr.checkStrictMode)(l,w,_.strictTuples)}}}Qt.validateTuple=ta;Qt.default=td;Object.defineProperty($s,"__esModule",{value:!0});const rd=Qt,nd={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,rd.validateTuple)(e,"items")};$s.default=nd;var ws={};Object.defineProperty(ws,"__esModule",{value:!0});const yi=K,sd=re,id=B,od=Zt,ad={message:({params:{len:e}})=>(0,yi.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,yi._)`{limit: ${e}}`},cd={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:ad,code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;n.items=!0,!(0,sd.alwaysValidSchema)(n,t)&&(s?(0,od.validateAdditionalItems)(e,s):e.ok((0,id.validateArray)(e)))}};ws.default=cd;var _s={};Object.defineProperty(_s,"__esModule",{value:!0});const Ne=K,jr=re,ld={message:({params:{min:e,max:t}})=>t===void 0?(0,Ne.str)`must contain at least ${e} valid item(s)`:(0,Ne.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,Ne._)`{minContains: ${e}}`:(0,Ne._)`{minContains: ${e}, maxContains: ${t}}`},ud={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:ld,code(e){const{gen:t,schema:r,parentSchema:n,data:s,it:i}=e;let o,l;const{minContains:d,maxContains:u}=n;i.opts.next?(o=d===void 0?1:d,l=u):o=1;const p=t.const("len",(0,Ne._)`${s}.length`);if(e.setParams({min:o,max:l}),l===void 0&&o===0){(0,jr.checkStrictMode)(i,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(l!==void 0&&o>l){(0,jr.checkStrictMode)(i,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,jr.alwaysValidSchema)(i,r)){let R=(0,Ne._)`${p} >= ${o}`;l!==void 0&&(R=(0,Ne._)`${R} && ${p} <= ${l}`),e.pass(R);return}i.items=!0;const h=t.name("valid");l===void 0&&o===1?T(h,()=>t.if(h,()=>t.break())):o===0?(t.let(h,!0),l!==void 0&&t.if((0,Ne._)`${s}.length > 0`,_)):(t.let(h,!1),_()),e.result(h,()=>e.reset());function _(){const R=t.name("_valid"),w=t.let("count",0);T(R,()=>t.if(R,()=>v(w)))}function T(R,w){t.forRange("i",0,p,g=>{e.subschema({keyword:"contains",dataProp:g,dataPropType:jr.Type.Num,compositeRule:!0},R),w()})}function v(R){t.code((0,Ne._)`${R}++`),l===void 0?t.if((0,Ne._)`${R} >= ${o}`,()=>t.assign(h,!0).break()):(t.if((0,Ne._)`${R} > ${l}`,()=>t.assign(h,!1).break()),o===1?t.assign(h,!0):t.if((0,Ne._)`${R} >= ${o}`,()=>t.assign(h,!0)))}}};_s.default=ud;var ra={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=K,r=re,n=B;e.error={message:({params:{property:d,depsCount:u,deps:p}})=>{const h=u===1?"property":"properties";return(0,t.str)`must have ${h} ${p} when property ${d} is present`},params:({params:{property:d,depsCount:u,deps:p,missingProperty:h}})=>(0,t._)`{property: ${d},
|
|
536
536
|
missingProperty: ${h},
|
|
537
537
|
depsCount: ${u},
|
|
538
|
-
deps: ${d}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(p){const[u,d]=i(p);o(p,u),l(p,d)}};function i({schema:p}){const u={},d={};for(const h in p){if(h==="__proto__")continue;const w=Array.isArray(p[h])?u:d;w[h]=p[h]}return[u,d]}function o(p,u=p.schema){const{gen:d,data:h,it:w}=p;if(Object.keys(u).length===0)return;const T=d.let("missing");for(const v in u){const R=u[v];if(R.length===0)continue;const _=(0,n.propertyInData)(d,h,v,w.opts.ownProperties);p.setParams({property:v,depsCount:R.length,deps:R.join(", ")}),w.allErrors?d.if(_,()=>{for(const g of R)(0,n.checkReportMissingProp)(p,g)}):(d.if((0,t._)`${_} && (${(0,n.checkMissingProp)(p,R,T)})`),(0,n.reportMissingProp)(p,T),d.else())}}e.validatePropertyDeps=o;function l(p,u=p.schema){const{gen:d,data:h,keyword:w,it:T}=p,v=d.name("valid");for(const R in u)(0,r.alwaysValidSchema)(T,u[R])||(d.if((0,n.propertyInData)(d,h,R,T.opts.ownProperties),()=>{const _=p.subschema({keyword:w,schemaProp:R},v);p.mergeValidEvaluated(_,v)},()=>d.var(v,!0)),p.ok(v))}e.validateSchemaDeps=l,e.default=s})(ra);var vs={};Object.defineProperty(vs,"__esModule",{value:!0});const na=K,dd=re,pd={message:"property name must be valid",params:({params:e})=>(0,na._)`{propertyName: ${e.propertyName}}`},fd={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:pd,code(e){const{gen:t,schema:r,data:n,it:s}=e;if((0,dd.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,na.not)(i),()=>{e.error(!0),s.allErrors||t.break()})}),e.ok(i)}};vs.default=fd;var bn={};Object.defineProperty(bn,"__esModule",{value:!0});const Ir=B,je=K,hd=Ge,Ar=re,md={message:"must NOT have additional properties",params:({params:e})=>(0,je._)`{additionalProperty: ${e.additionalProperty}}`},yd={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:md,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:l,opts:p}=o;if(o.props=!0,p.removeAdditional!=="all"&&(0,Ar.alwaysValidSchema)(o,r))return;const u=(0,Ir.allSchemaProperties)(n.properties),d=(0,Ir.allSchemaProperties)(n.patternProperties);h(),e.ok((0,je._)`${i} === ${hd.default.errors}`);function h(){t.forIn("key",s,_=>{!u.length&&!d.length?v(_):t.if(w(_),()=>v(_))})}function w(_){let g;if(u.length>8){const O=(0,Ar.schemaRefOrVal)(o,n.properties,"properties");g=(0,Ir.isOwnProperty)(t,O,_)}else u.length?g=(0,je.or)(...u.map(O=>(0,je._)`${_} === ${O}`)):g=je.nil;return d.length&&(g=(0,je.or)(g,...d.map(O=>(0,je._)`${(0,Ir.usePattern)(e,O)}.test(${_})`))),(0,je.not)(g)}function T(_){t.code((0,je._)`delete ${s}[${_}]`)}function v(_){if(p.removeAdditional==="all"||p.removeAdditional&&r===!1){T(_);return}if(r===!1){e.setParams({additionalProperty:_}),e.error(),l||t.break();return}if(typeof r=="object"&&!(0,Ar.alwaysValidSchema)(o,r)){const g=t.name("valid");p.removeAdditional==="failing"?(R(_,g,!1),t.if((0,je.not)(g),()=>{e.reset(),T(_)})):(R(_,g),l||t.if((0,je.not)(g),()=>t.break()))}}function R(_,g,O){const C={keyword:"additionalProperties",dataProp:_,dataPropType:Ar.Type.Str};O===!1&&Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(C,g)}}};bn.default=yd;var bs={};Object.defineProperty(bs,"__esModule",{value:!0});const gd=Ae,gi=B,Nn=re,$i=bn,$d={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&&$i.default.code(new gd.KeywordCxt(i,$i.default,"additionalProperties"));const o=(0,gi.allSchemaProperties)(r);for(const h of o)i.definedProperties.add(h);i.opts.unevaluated&&o.length&&i.props!==!0&&(i.props=Nn.mergeEvaluated.props(t,(0,Nn.toHash)(o),i.props));const l=o.filter(h=>!(0,Nn.alwaysValidSchema)(i,r[h]));if(l.length===0)return;const p=t.name("valid");for(const h of l)u(h)?d(h):(t.if((0,gi.propertyInData)(t,s,h,i.opts.ownProperties)),d(h),i.allErrors||t.else().var(p,!0),t.endIf()),e.it.definedProperties.add(h),e.ok(p);function u(h){return i.opts.useDefaults&&!i.compositeRule&&r[h].default!==void 0}function d(h){e.subschema({keyword:"properties",schemaProp:h,dataProp:h},p)}}};bs.default=$d;var Ps={};Object.defineProperty(Ps,"__esModule",{value:!0});const _i=B,Dr=K,wi=re,vi=re,_d={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:n,parentSchema:s,it:i}=e,{opts:o}=i,l=(0,_i.allSchemaProperties)(r),p=l.filter(R=>(0,wi.alwaysValidSchema)(i,r[R]));if(l.length===0||p.length===l.length&&(!i.opts.unevaluated||i.props===!0))return;const u=o.strictSchema&&!o.allowMatchingProperties&&s.properties,d=t.name("valid");i.props!==!0&&!(i.props instanceof Dr.Name)&&(i.props=(0,vi.evaluatedPropsToName)(t,i.props));const{props:h}=i;w();function w(){for(const R of l)u&&T(R),i.allErrors?v(R):(t.var(d,!0),v(R),t.if(d))}function T(R){for(const _ in u)new RegExp(R).test(_)&&(0,wi.checkStrictMode)(i,`property ${_} matches pattern ${R} (use allowMatchingProperties)`)}function v(R){t.forIn("key",n,_=>{t.if((0,Dr._)`${(0,_i.usePattern)(e,R)}.test(${_})`,()=>{const g=p.includes(R);g||e.subschema({keyword:"patternProperties",schemaProp:R,dataProp:_,dataPropType:vi.Type.Str},d),i.opts.unevaluated&&h!==!0?t.assign((0,Dr._)`${h}[${_}]`,!0):!g&&!i.allErrors&&t.if((0,Dr.not)(d),()=>t.break())})})}}};Ps.default=_d;var Es={};Object.defineProperty(Es,"__esModule",{value:!0});const wd=re,vd={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:n}=e;if((0,wd.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"}};Es.default=vd;var Ss={};Object.defineProperty(Ss,"__esModule",{value:!0});const bd=B,Pd={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:bd.validateUnion,error:{message:"must match a schema in anyOf"}};Ss.default=Pd;var Ts={};Object.defineProperty(Ts,"__esModule",{value:!0});const zr=K,Ed=re,Sd={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,zr._)`{passingSchemas: ${e.passing}}`},Td={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Sd,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),l=t.let("passing",null),p=t.name("_valid");e.setParams({passing:l}),t.block(u),e.result(o,()=>e.reset(),()=>e.error(!0));function u(){i.forEach((d,h)=>{let w;(0,Ed.alwaysValidSchema)(s,d)?t.var(p,!0):w=e.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},p),h>0&&t.if((0,zr._)`${p} && ${o}`).assign(o,!1).assign(l,(0,zr._)`[${l}, ${h}]`).else(),t.if(p,()=>{t.assign(o,!0),t.assign(l,h),w&&e.mergeEvaluated(w,zr.Name)})})}}};Ts.default=Td;var Rs={};Object.defineProperty(Rs,"__esModule",{value:!0});const Rd=re,Od={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,Rd.alwaysValidSchema)(n,i))return;const l=e.subschema({keyword:"allOf",schemaProp:o},s);e.ok(s),e.mergeEvaluated(l)})}};Rs.default=Od;var Os={};Object.defineProperty(Os,"__esModule",{value:!0});const Gr=K,sa=re,Cd={message:({params:e})=>(0,Gr.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Gr._)`{failingKeyword: ${e.ifClause}}`},Nd={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Cd,code(e){const{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,sa.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const s=bi(n,"then"),i=bi(n,"else");if(!s&&!i)return;const o=t.let("valid",!0),l=t.name("_valid");if(p(),e.reset(),s&&i){const d=t.let("ifClause");e.setParams({ifClause:d}),t.if(l,u("then",d),u("else",d))}else s?t.if(l,u("then")):t.if((0,Gr.not)(l),u("else"));e.pass(o,()=>e.error(!0));function p(){const d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);e.mergeEvaluated(d)}function u(d,h){return()=>{const w=e.subschema({keyword:d},l);t.assign(o,l),e.mergeValidEvaluated(w,o),h?t.assign(h,(0,Gr._)`${d}`):e.setParams({ifClause:d})}}}};function bi(e,t){const r=e.schema[t];return r!==void 0&&!(0,sa.alwaysValidSchema)(e,r)}Os.default=Nd;var Cs={};Object.defineProperty(Cs,"__esModule",{value:!0});const kd=re,jd={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,kd.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Cs.default=jd;Object.defineProperty(gs,"__esModule",{value:!0});const Id=Zt,Ad=$s,Dd=Qt,Fd=_s,qd=ws,Md=ra,Ud=vs,Ld=bn,zd=bs,Hd=Ps,Vd=Es,Wd=Ss,xd=Ts,Bd=Rs,Kd=Os,Gd=Cs;function Jd(e=!1){const t=[Vd.default,Wd.default,xd.default,Bd.default,Kd.default,Gd.default,Ud.default,Ld.default,Md.default,zd.default,Hd.default];return e?t.push(Ad.default,Fd.default):t.push(Id.default,Dd.default),t.push(qd.default),t}gs.default=Jd;var Ns={},ks={};Object.defineProperty(ks,"__esModule",{value:!0});const fe=K,Yd={message:({schemaCode:e})=>(0,fe.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,fe._)`{format: ${e}}`},Zd={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Yd,code(e,t){const{gen:r,data:n,$data:s,schema:i,schemaCode:o,it:l}=e,{opts:p,errSchemaPath:u,schemaEnv:d,self:h}=l;if(!p.validateFormats)return;s?w():T();function w(){const v=r.scopeValue("formats",{ref:h.formats,code:p.code.formats}),R=r.const("fDef",(0,fe._)`${v}[${o}]`),_=r.let("fType"),g=r.let("format");r.if((0,fe._)`typeof ${R} == "object" && !(${R} instanceof RegExp)`,()=>r.assign(_,(0,fe._)`${R}.type || "string"`).assign(g,(0,fe._)`${R}.validate`),()=>r.assign(_,(0,fe._)`"string"`).assign(g,R)),e.fail$data((0,fe.or)(O(),C()));function O(){return p.strictSchema===!1?fe.nil:(0,fe._)`${o} && !${g}`}function C(){const j=d.$async?(0,fe._)`(${R}.async ? await ${g}(${n}) : ${g}(${n}))`:(0,fe._)`${g}(${n})`,D=(0,fe._)`(typeof ${g} == "function" ? ${j} : ${g}.test(${n}))`;return(0,fe._)`${g} && ${g} !== true && ${_} === ${t} && !${D}`}}function T(){const v=h.formats[i];if(!v){O();return}if(v===!0)return;const[R,_,g]=C(v);R===t&&e.pass(j());function O(){if(p.strictSchema===!1){h.logger.warn(D());return}throw new Error(D());function D(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function C(D){const b=D instanceof RegExp?(0,fe.regexpCode)(D):p.code.formats?(0,fe._)`${p.code.formats}${(0,fe.getProperty)(i)}`:void 0,N=r.scopeValue("formats",{key:i,ref:D,code:b});return typeof D=="object"&&!(D instanceof RegExp)?[D.type||"string",D.validate,(0,fe._)`${N}.validate`]:["string",D,N]}function j(){if(typeof v=="object"&&!(v instanceof RegExp)&&v.async){if(!d.$async)throw new Error("async format in sync schema");return(0,fe._)`await ${g}(${n})`}return typeof _=="function"?(0,fe._)`${g}(${n})`:(0,fe._)`${g}.test(${n})`}}}};ks.default=Zd;Object.defineProperty(Ns,"__esModule",{value:!0});const Qd=ks,Xd=[Qd.default];Ns.default=Xd;var Yt={};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.contentVocabulary=Yt.metadataVocabulary=void 0;Yt.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Yt.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(rs,"__esModule",{value:!0});const ep=ns,tp=is,rp=gs,np=Ns,Pi=Yt,sp=[ep.default,tp.default,(0,rp.default)(),np.default,Pi.metadataVocabulary,Pi.contentVocabulary];rs.default=sp;var js={},ia={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,function(t){t.Tag="tag",t.Mapping="mapping"}(e.DiscrError||(e.DiscrError={}))})(ia);Object.defineProperty(js,"__esModule",{value:!0});const Mt=K,Un=ia,Ei=Se,ip=re,op={message:({params:{discrError:e,tagName:t}})=>e===Un.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Mt._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},ap={keyword:"discriminator",type:"object",schemaType:"object",error:op,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 l=n.propertyName;if(typeof l!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");const p=t.let("valid",!1),u=t.const("tag",(0,Mt._)`${r}${(0,Mt.getProperty)(l)}`);t.if((0,Mt._)`typeof ${u} == "string"`,()=>d(),()=>e.error(!1,{discrError:Un.DiscrError.Tag,tag:u,tagName:l})),e.ok(p);function d(){const T=w();t.if(!1);for(const v in T)t.elseIf((0,Mt._)`${u} === ${v}`),t.assign(p,h(T[v]));t.else(),e.error(!1,{discrError:Un.DiscrError.Mapping,tag:u,tagName:l}),t.endIf()}function h(T){const v=t.name("valid"),R=e.subschema({keyword:"oneOf",schemaProp:T},v);return e.mergeEvaluated(R,Mt.Name),v}function w(){var T;const v={},R=g(s);let _=!0;for(let j=0;j<o.length;j++){let D=o[j];D!=null&&D.$ref&&!(0,ip.schemaHasRulesButRef)(D,i.self.RULES)&&(D=Ei.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,D==null?void 0:D.$ref),D instanceof Ei.SchemaEnv&&(D=D.schema));const b=(T=D==null?void 0:D.properties)===null||T===void 0?void 0:T[l];if(typeof b!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);_=_&&(R||g(D)),O(b,j)}if(!_)throw new Error(`discriminator: "${l}" must be required`);return v;function g({required:j}){return Array.isArray(j)&&j.includes(l)}function O(j,D){if(j.const)C(j.const,D);else if(j.enum)for(const b of j.enum)C(b,D);else throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`)}function C(j,D){if(typeof j!="string"||j in v)throw new Error(`discriminator: "${l}" values must be unique strings`);v[j]=D}}}};js.default=ap;const cp="http://json-schema.org/draft-07/schema#",lp="http://json-schema.org/draft-07/schema#",up="Core schema meta-schema",dp={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:[]}},pp=["object","boolean"],fp={$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:"#"}},hp={$schema:cp,$id:lp,title:up,definitions:dp,type:pp,properties:fp,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=So,n=rs,s=js,i=hp,o=["/properties"],l="http://json-schema.org/draft-07/schema";class p extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(v=>this.addVocabulary(v)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const v=this.opts.$data?this.$dataMetaSchema(i,o):i;this.addMetaSchema(v,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}e.exports=t=p,Object.defineProperty(t,"__esModule",{value:!0}),t.default=p;var u=Ae;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=K;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 h=Er;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var w=Sr;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return w.default}})})(In,In.exports);var mp=In.exports;const yp=Ec(mp),gp="http://json-schema.org/schema",$p="#/definitions/Blueprint",_p={Blueprint:{type:"object",properties:{landingPage:{type:"string",description:"The URL to navigate to after the blueprint has been run."},description:{type:"string",description:"Optional description. It doesn't do anything but is exposed as a courtesy to developers who may want to document which blueprint file does what."},preferredVersions:{type:"object",properties:{php:{anyOf:[{$ref:"#/definitions/SupportedPHPVersion"},{type:"string",const:"latest"}],description:"The preferred PHP version to use. If not specified, the latest supported version will be used"},wp:{type:"string",description:"The preferred WordPress version to use. If not specified, the latest supported version will be used"}},required:["php","wp"],additionalProperties:!1,description:"The preferred PHP and WordPress versions to use."},features:{type:"object",properties:{networking:{type:"boolean",description:"Should boot with support for network request via wp_safe_remote_get?"}},additionalProperties:!1},constants:{type:"object",additionalProperties:{type:"string"},description:"PHP Constants to define on every request",deprecated:"This experimental option will change without warning.\nUse `steps` instead."},plugins:{type:"array",items:{anyOf:[{type:"string"},{$ref:"#/definitions/FileReference"}]},description:"WordPress plugins to install and activate",deprecated:"This experimental option will change without warning.\nUse `steps` instead."},siteOptions:{type:"object",additionalProperties:{type:"string"},properties:{blogname:{type:"string",description:"The site title"}},description:"WordPress site options to define",deprecated:"This experimental option will change without warning.\nUse `steps` instead."},login:{anyOf:[{type:"boolean"},{type:"object",properties:{username:{type:"string"},password:{type:"string"}},required:["username","password"],additionalProperties:!1}],description:"User to log in as. If true, logs the user in as admin/password."},phpExtensionBundles:{type:"array",items:{$ref:"#/definitions/SupportedPHPExtensionBundle"},description:"The PHP extensions to use."},steps:{type:"array",items:{anyOf:[{$ref:"#/definitions/StepDefinition"},{type:"string"},{not:{}},{type:"boolean",const:!1},{type:"null"}]},description:"The steps to run after every other operation in this Blueprint was executed."},$schema:{type:"string"}},additionalProperties:!1},SupportedPHPVersion:{type:"string",enum:["8.3","8.2","8.1","8.0","7.4","7.3","7.2","7.1","7.0"]},FileReference:{anyOf:[{$ref:"#/definitions/VFSReference"},{$ref:"#/definitions/LiteralReference"},{$ref:"#/definitions/CoreThemeReference"},{$ref:"#/definitions/CorePluginReference"},{$ref:"#/definitions/UrlReference"}]},VFSReference:{type:"object",properties:{resource:{type:"string",const:"vfs",description:"Identifies the file resource as Virtual File System (VFS)"},path:{type:"string",description:"The path to the file in the VFS"}},required:["resource","path"],additionalProperties:!1},LiteralReference:{type:"object",properties:{resource:{type:"string",const:"literal",description:"Identifies the file resource as a literal file"},name:{type:"string",description:"The name of the file"},contents:{anyOf:[{type:"string"},{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}}],description:"The contents of the file"}},required:["resource","name","contents"],additionalProperties:!1},CoreThemeReference:{type:"object",properties:{resource:{type:"string",const:"wordpress.org/themes",description:"Identifies the file resource as a WordPress Core theme"},slug:{type:"string",description:"The slug of the WordPress Core theme"}},required:["resource","slug"],additionalProperties:!1},CorePluginReference:{type:"object",properties:{resource:{type:"string",const:"wordpress.org/plugins",description:"Identifies the file resource as a WordPress Core plugin"},slug:{type:"string",description:"The slug of the WordPress Core plugin"}},required:["resource","slug"],additionalProperties:!1},UrlReference:{type:"object",properties:{resource:{type:"string",const:"url",description:"Identifies the file resource as a URL"},url:{type:"string",description:"The URL of the file"},caption:{type:"string",description:"Optional caption for displaying a progress message"}},required:["resource","url"],additionalProperties:!1},SupportedPHPExtensionBundle:{type:"string",const:"kitchen-sink"},StepDefinition:{type:"object",discriminator:{propertyName:"step"},required:["step"],oneOf:[{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"activatePlugin"},pluginPath:{type:"string",description:"Path to the plugin directory as absolute path (/wordpress/wp-content/plugins/plugin-name); or the plugin entry file relative to the plugins directory (plugin-name/plugin-name.php)."},pluginName:{type:"string",description:"Optional. Plugin name to display in the progress bar."}},required:["pluginPath","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"activateTheme"},themeFolderName:{type:"string",description:"The name of the theme folder inside wp-content/themes/"}},required:["step","themeFolderName"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"applyWordPressPatches"},siteUrl:{type:"string"},wordpressPath:{type:"string"},addPhpInfo:{type:"boolean"},patchSecrets:{type:"boolean"},disableSiteHealth:{type:"boolean"},disableWpNewBlogNotification:{type:"boolean"},makeEditorFrameControlled:{type:"boolean"},prepareForRunningInsideWebBrowser:{type:"boolean"},addFetchNetworkTransport:{type:"boolean"}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"cp"},fromPath:{type:"string",description:"Source path"},toPath:{type:"string",description:"Target path"}},required:["fromPath","step","toPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"defineWpConfigConsts"},consts:{type:"object",additionalProperties:{},description:"The constants to define"},virtualize:{type:"boolean",deprecated:`This option is noop and will be removed in a future version.
|
|
538
|
+
deps: ${p}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(d){const[u,p]=i(d);o(d,u),l(d,p)}};function i({schema:d}){const u={},p={};for(const h in d){if(h==="__proto__")continue;const _=Array.isArray(d[h])?u:p;_[h]=d[h]}return[u,p]}function o(d,u=d.schema){const{gen:p,data:h,it:_}=d;if(Object.keys(u).length===0)return;const T=p.let("missing");for(const v in u){const R=u[v];if(R.length===0)continue;const w=(0,n.propertyInData)(p,h,v,_.opts.ownProperties);d.setParams({property:v,depsCount:R.length,deps:R.join(", ")}),_.allErrors?p.if(w,()=>{for(const g of R)(0,n.checkReportMissingProp)(d,g)}):(p.if((0,t._)`${w} && (${(0,n.checkMissingProp)(d,R,T)})`),(0,n.reportMissingProp)(d,T),p.else())}}e.validatePropertyDeps=o;function l(d,u=d.schema){const{gen:p,data:h,keyword:_,it:T}=d,v=p.name("valid");for(const R in u)(0,r.alwaysValidSchema)(T,u[R])||(p.if((0,n.propertyInData)(p,h,R,T.opts.ownProperties),()=>{const w=d.subschema({keyword:_,schemaProp:R},v);d.mergeValidEvaluated(w,v)},()=>p.var(v,!0)),d.ok(v))}e.validateSchemaDeps=l,e.default=s})(ra);var vs={};Object.defineProperty(vs,"__esModule",{value:!0});const na=K,dd=re,pd={message:"property name must be valid",params:({params:e})=>(0,na._)`{propertyName: ${e.propertyName}}`},fd={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:pd,code(e){const{gen:t,schema:r,data:n,it:s}=e;if((0,dd.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,na.not)(i),()=>{e.error(!0),s.allErrors||t.break()})}),e.ok(i)}};vs.default=fd;var bn={};Object.defineProperty(bn,"__esModule",{value:!0});const Ir=B,je=K,hd=Ge,Ar=re,md={message:"must NOT have additional properties",params:({params:e})=>(0,je._)`{additionalProperty: ${e.additionalProperty}}`},yd={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:md,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:l,opts:d}=o;if(o.props=!0,d.removeAdditional!=="all"&&(0,Ar.alwaysValidSchema)(o,r))return;const u=(0,Ir.allSchemaProperties)(n.properties),p=(0,Ir.allSchemaProperties)(n.patternProperties);h(),e.ok((0,je._)`${i} === ${hd.default.errors}`);function h(){t.forIn("key",s,w=>{!u.length&&!p.length?v(w):t.if(_(w),()=>v(w))})}function _(w){let g;if(u.length>8){const O=(0,Ar.schemaRefOrVal)(o,n.properties,"properties");g=(0,Ir.isOwnProperty)(t,O,w)}else u.length?g=(0,je.or)(...u.map(O=>(0,je._)`${w} === ${O}`)):g=je.nil;return p.length&&(g=(0,je.or)(g,...p.map(O=>(0,je._)`${(0,Ir.usePattern)(e,O)}.test(${w})`))),(0,je.not)(g)}function T(w){t.code((0,je._)`delete ${s}[${w}]`)}function v(w){if(d.removeAdditional==="all"||d.removeAdditional&&r===!1){T(w);return}if(r===!1){e.setParams({additionalProperty:w}),e.error(),l||t.break();return}if(typeof r=="object"&&!(0,Ar.alwaysValidSchema)(o,r)){const g=t.name("valid");d.removeAdditional==="failing"?(R(w,g,!1),t.if((0,je.not)(g),()=>{e.reset(),T(w)})):(R(w,g),l||t.if((0,je.not)(g),()=>t.break()))}}function R(w,g,O){const C={keyword:"additionalProperties",dataProp:w,dataPropType:Ar.Type.Str};O===!1&&Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(C,g)}}};bn.default=yd;var bs={};Object.defineProperty(bs,"__esModule",{value:!0});const gd=Ae,gi=B,Nn=re,$i=bn,$d={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&&$i.default.code(new gd.KeywordCxt(i,$i.default,"additionalProperties"));const o=(0,gi.allSchemaProperties)(r);for(const h of o)i.definedProperties.add(h);i.opts.unevaluated&&o.length&&i.props!==!0&&(i.props=Nn.mergeEvaluated.props(t,(0,Nn.toHash)(o),i.props));const l=o.filter(h=>!(0,Nn.alwaysValidSchema)(i,r[h]));if(l.length===0)return;const d=t.name("valid");for(const h of l)u(h)?p(h):(t.if((0,gi.propertyInData)(t,s,h,i.opts.ownProperties)),p(h),i.allErrors||t.else().var(d,!0),t.endIf()),e.it.definedProperties.add(h),e.ok(d);function u(h){return i.opts.useDefaults&&!i.compositeRule&&r[h].default!==void 0}function p(h){e.subschema({keyword:"properties",schemaProp:h,dataProp:h},d)}}};bs.default=$d;var Ps={};Object.defineProperty(Ps,"__esModule",{value:!0});const wi=B,Dr=K,_i=re,vi=re,wd={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:n,parentSchema:s,it:i}=e,{opts:o}=i,l=(0,wi.allSchemaProperties)(r),d=l.filter(R=>(0,_i.alwaysValidSchema)(i,r[R]));if(l.length===0||d.length===l.length&&(!i.opts.unevaluated||i.props===!0))return;const u=o.strictSchema&&!o.allowMatchingProperties&&s.properties,p=t.name("valid");i.props!==!0&&!(i.props instanceof Dr.Name)&&(i.props=(0,vi.evaluatedPropsToName)(t,i.props));const{props:h}=i;_();function _(){for(const R of l)u&&T(R),i.allErrors?v(R):(t.var(p,!0),v(R),t.if(p))}function T(R){for(const w in u)new RegExp(R).test(w)&&(0,_i.checkStrictMode)(i,`property ${w} matches pattern ${R} (use allowMatchingProperties)`)}function v(R){t.forIn("key",n,w=>{t.if((0,Dr._)`${(0,wi.usePattern)(e,R)}.test(${w})`,()=>{const g=d.includes(R);g||e.subschema({keyword:"patternProperties",schemaProp:R,dataProp:w,dataPropType:vi.Type.Str},p),i.opts.unevaluated&&h!==!0?t.assign((0,Dr._)`${h}[${w}]`,!0):!g&&!i.allErrors&&t.if((0,Dr.not)(p),()=>t.break())})})}}};Ps.default=wd;var Es={};Object.defineProperty(Es,"__esModule",{value:!0});const _d=re,vd={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:n}=e;if((0,_d.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"}};Es.default=vd;var Ss={};Object.defineProperty(Ss,"__esModule",{value:!0});const bd=B,Pd={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:bd.validateUnion,error:{message:"must match a schema in anyOf"}};Ss.default=Pd;var Ts={};Object.defineProperty(Ts,"__esModule",{value:!0});const zr=K,Ed=re,Sd={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,zr._)`{passingSchemas: ${e.passing}}`},Td={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Sd,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),l=t.let("passing",null),d=t.name("_valid");e.setParams({passing:l}),t.block(u),e.result(o,()=>e.reset(),()=>e.error(!0));function u(){i.forEach((p,h)=>{let _;(0,Ed.alwaysValidSchema)(s,p)?t.var(d,!0):_=e.subschema({keyword:"oneOf",schemaProp:h,compositeRule:!0},d),h>0&&t.if((0,zr._)`${d} && ${o}`).assign(o,!1).assign(l,(0,zr._)`[${l}, ${h}]`).else(),t.if(d,()=>{t.assign(o,!0),t.assign(l,h),_&&e.mergeEvaluated(_,zr.Name)})})}}};Ts.default=Td;var Rs={};Object.defineProperty(Rs,"__esModule",{value:!0});const Rd=re,Od={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,Rd.alwaysValidSchema)(n,i))return;const l=e.subschema({keyword:"allOf",schemaProp:o},s);e.ok(s),e.mergeEvaluated(l)})}};Rs.default=Od;var Os={};Object.defineProperty(Os,"__esModule",{value:!0});const Gr=K,sa=re,Cd={message:({params:e})=>(0,Gr.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,Gr._)`{failingKeyword: ${e.ifClause}}`},Nd={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Cd,code(e){const{gen:t,parentSchema:r,it:n}=e;r.then===void 0&&r.else===void 0&&(0,sa.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const s=bi(n,"then"),i=bi(n,"else");if(!s&&!i)return;const o=t.let("valid",!0),l=t.name("_valid");if(d(),e.reset(),s&&i){const p=t.let("ifClause");e.setParams({ifClause:p}),t.if(l,u("then",p),u("else",p))}else s?t.if(l,u("then")):t.if((0,Gr.not)(l),u("else"));e.pass(o,()=>e.error(!0));function d(){const p=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);e.mergeEvaluated(p)}function u(p,h){return()=>{const _=e.subschema({keyword:p},l);t.assign(o,l),e.mergeValidEvaluated(_,o),h?t.assign(h,(0,Gr._)`${p}`):e.setParams({ifClause:p})}}}};function bi(e,t){const r=e.schema[t];return r!==void 0&&!(0,sa.alwaysValidSchema)(e,r)}Os.default=Nd;var Cs={};Object.defineProperty(Cs,"__esModule",{value:!0});const kd=re,jd={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){t.if===void 0&&(0,kd.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Cs.default=jd;Object.defineProperty(gs,"__esModule",{value:!0});const Id=Zt,Ad=$s,Dd=Qt,Fd=ws,qd=_s,Md=ra,Ud=vs,Ld=bn,zd=bs,Hd=Ps,Vd=Es,Wd=Ss,xd=Ts,Bd=Rs,Kd=Os,Gd=Cs;function Jd(e=!1){const t=[Vd.default,Wd.default,xd.default,Bd.default,Kd.default,Gd.default,Ud.default,Ld.default,Md.default,zd.default,Hd.default];return e?t.push(Ad.default,Fd.default):t.push(Id.default,Dd.default),t.push(qd.default),t}gs.default=Jd;var Ns={},ks={};Object.defineProperty(ks,"__esModule",{value:!0});const fe=K,Yd={message:({schemaCode:e})=>(0,fe.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,fe._)`{format: ${e}}`},Zd={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:Yd,code(e,t){const{gen:r,data:n,$data:s,schema:i,schemaCode:o,it:l}=e,{opts:d,errSchemaPath:u,schemaEnv:p,self:h}=l;if(!d.validateFormats)return;s?_():T();function _(){const v=r.scopeValue("formats",{ref:h.formats,code:d.code.formats}),R=r.const("fDef",(0,fe._)`${v}[${o}]`),w=r.let("fType"),g=r.let("format");r.if((0,fe._)`typeof ${R} == "object" && !(${R} instanceof RegExp)`,()=>r.assign(w,(0,fe._)`${R}.type || "string"`).assign(g,(0,fe._)`${R}.validate`),()=>r.assign(w,(0,fe._)`"string"`).assign(g,R)),e.fail$data((0,fe.or)(O(),C()));function O(){return d.strictSchema===!1?fe.nil:(0,fe._)`${o} && !${g}`}function C(){const j=p.$async?(0,fe._)`(${R}.async ? await ${g}(${n}) : ${g}(${n}))`:(0,fe._)`${g}(${n})`,D=(0,fe._)`(typeof ${g} == "function" ? ${j} : ${g}.test(${n}))`;return(0,fe._)`${g} && ${g} !== true && ${w} === ${t} && !${D}`}}function T(){const v=h.formats[i];if(!v){O();return}if(v===!0)return;const[R,w,g]=C(v);R===t&&e.pass(j());function O(){if(d.strictSchema===!1){h.logger.warn(D());return}throw new Error(D());function D(){return`unknown format "${i}" ignored in schema at path "${u}"`}}function C(D){const b=D instanceof RegExp?(0,fe.regexpCode)(D):d.code.formats?(0,fe._)`${d.code.formats}${(0,fe.getProperty)(i)}`:void 0,N=r.scopeValue("formats",{key:i,ref:D,code:b});return typeof D=="object"&&!(D instanceof RegExp)?[D.type||"string",D.validate,(0,fe._)`${N}.validate`]:["string",D,N]}function j(){if(typeof v=="object"&&!(v instanceof RegExp)&&v.async){if(!p.$async)throw new Error("async format in sync schema");return(0,fe._)`await ${g}(${n})`}return typeof w=="function"?(0,fe._)`${g}(${n})`:(0,fe._)`${g}.test(${n})`}}}};ks.default=Zd;Object.defineProperty(Ns,"__esModule",{value:!0});const Qd=ks,Xd=[Qd.default];Ns.default=Xd;var Yt={};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.contentVocabulary=Yt.metadataVocabulary=void 0;Yt.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Yt.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(rs,"__esModule",{value:!0});const ep=ns,tp=is,rp=gs,np=Ns,Pi=Yt,sp=[ep.default,tp.default,(0,rp.default)(),np.default,Pi.metadataVocabulary,Pi.contentVocabulary];rs.default=sp;var js={},ia={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,function(t){t.Tag="tag",t.Mapping="mapping"}(e.DiscrError||(e.DiscrError={}))})(ia);Object.defineProperty(js,"__esModule",{value:!0});const Mt=K,Un=ia,Ei=Se,ip=re,op={message:({params:{discrError:e,tagName:t}})=>e===Un.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,Mt._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},ap={keyword:"discriminator",type:"object",schemaType:"object",error:op,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 l=n.propertyName;if(typeof l!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");const d=t.let("valid",!1),u=t.const("tag",(0,Mt._)`${r}${(0,Mt.getProperty)(l)}`);t.if((0,Mt._)`typeof ${u} == "string"`,()=>p(),()=>e.error(!1,{discrError:Un.DiscrError.Tag,tag:u,tagName:l})),e.ok(d);function p(){const T=_();t.if(!1);for(const v in T)t.elseIf((0,Mt._)`${u} === ${v}`),t.assign(d,h(T[v]));t.else(),e.error(!1,{discrError:Un.DiscrError.Mapping,tag:u,tagName:l}),t.endIf()}function h(T){const v=t.name("valid"),R=e.subschema({keyword:"oneOf",schemaProp:T},v);return e.mergeEvaluated(R,Mt.Name),v}function _(){var T;const v={},R=g(s);let w=!0;for(let j=0;j<o.length;j++){let D=o[j];D!=null&&D.$ref&&!(0,ip.schemaHasRulesButRef)(D,i.self.RULES)&&(D=Ei.resolveRef.call(i.self,i.schemaEnv.root,i.baseId,D==null?void 0:D.$ref),D instanceof Ei.SchemaEnv&&(D=D.schema));const b=(T=D==null?void 0:D.properties)===null||T===void 0?void 0:T[l];if(typeof b!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);w=w&&(R||g(D)),O(b,j)}if(!w)throw new Error(`discriminator: "${l}" must be required`);return v;function g({required:j}){return Array.isArray(j)&&j.includes(l)}function O(j,D){if(j.const)C(j.const,D);else if(j.enum)for(const b of j.enum)C(b,D);else throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`)}function C(j,D){if(typeof j!="string"||j in v)throw new Error(`discriminator: "${l}" values must be unique strings`);v[j]=D}}}};js.default=ap;const cp="http://json-schema.org/draft-07/schema#",lp="http://json-schema.org/draft-07/schema#",up="Core schema meta-schema",dp={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:[]}},pp=["object","boolean"],fp={$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:"#"}},hp={$schema:cp,$id:lp,title:up,definitions:dp,type:pp,properties:fp,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=So,n=rs,s=js,i=hp,o=["/properties"],l="http://json-schema.org/draft-07/schema";class d extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(v=>this.addVocabulary(v)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const v=this.opts.$data?this.$dataMetaSchema(i,o):i;this.addMetaSchema(v,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}e.exports=t=d,Object.defineProperty(t,"__esModule",{value:!0}),t.default=d;var u=Ae;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var p=K;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return p._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return p.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return p.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return p.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return p.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return p.CodeGen}});var h=Er;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var _=Sr;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return _.default}})})(In,In.exports);var mp=In.exports;const yp=Ec(mp),gp="http://json-schema.org/schema",$p="#/definitions/Blueprint",wp={Blueprint:{type:"object",properties:{landingPage:{type:"string",description:"The URL to navigate to after the blueprint has been run."},description:{type:"string",description:"Optional description. It doesn't do anything but is exposed as a courtesy to developers who may want to document which blueprint file does what."},preferredVersions:{type:"object",properties:{php:{anyOf:[{$ref:"#/definitions/SupportedPHPVersion"},{type:"string",const:"latest"}],description:"The preferred PHP version to use. If not specified, the latest supported version will be used"},wp:{type:"string",description:"The preferred WordPress version to use. If not specified, the latest supported version will be used"}},required:["php","wp"],additionalProperties:!1,description:"The preferred PHP and WordPress versions to use."},features:{type:"object",properties:{networking:{type:"boolean",description:"Should boot with support for network request via wp_safe_remote_get?"}},additionalProperties:!1},constants:{type:"object",additionalProperties:{type:"string"},description:"PHP Constants to define on every request",deprecated:"This experimental option will change without warning.\nUse `steps` instead."},plugins:{type:"array",items:{anyOf:[{type:"string"},{$ref:"#/definitions/FileReference"}]},description:"WordPress plugins to install and activate",deprecated:"This experimental option will change without warning.\nUse `steps` instead."},siteOptions:{type:"object",additionalProperties:{type:"string"},properties:{blogname:{type:"string",description:"The site title"}},description:"WordPress site options to define",deprecated:"This experimental option will change without warning.\nUse `steps` instead."},login:{anyOf:[{type:"boolean"},{type:"object",properties:{username:{type:"string"},password:{type:"string"}},required:["username","password"],additionalProperties:!1}],description:"User to log in as. If true, logs the user in as admin/password."},phpExtensionBundles:{type:"array",items:{$ref:"#/definitions/SupportedPHPExtensionBundle"},description:"The PHP extensions to use."},steps:{type:"array",items:{anyOf:[{$ref:"#/definitions/StepDefinition"},{type:"string"},{not:{}},{type:"boolean",const:!1},{type:"null"}]},description:"The steps to run after every other operation in this Blueprint was executed."},$schema:{type:"string"}},additionalProperties:!1},SupportedPHPVersion:{type:"string",enum:["8.3","8.2","8.1","8.0","7.4","7.3","7.2","7.1","7.0"]},FileReference:{anyOf:[{$ref:"#/definitions/VFSReference"},{$ref:"#/definitions/LiteralReference"},{$ref:"#/definitions/CoreThemeReference"},{$ref:"#/definitions/CorePluginReference"},{$ref:"#/definitions/UrlReference"}]},VFSReference:{type:"object",properties:{resource:{type:"string",const:"vfs",description:"Identifies the file resource as Virtual File System (VFS)"},path:{type:"string",description:"The path to the file in the VFS"}},required:["resource","path"],additionalProperties:!1},LiteralReference:{type:"object",properties:{resource:{type:"string",const:"literal",description:"Identifies the file resource as a literal file"},name:{type:"string",description:"The name of the file"},contents:{anyOf:[{type:"string"},{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}}],description:"The contents of the file"}},required:["resource","name","contents"],additionalProperties:!1},CoreThemeReference:{type:"object",properties:{resource:{type:"string",const:"wordpress.org/themes",description:"Identifies the file resource as a WordPress Core theme"},slug:{type:"string",description:"The slug of the WordPress Core theme"}},required:["resource","slug"],additionalProperties:!1},CorePluginReference:{type:"object",properties:{resource:{type:"string",const:"wordpress.org/plugins",description:"Identifies the file resource as a WordPress Core plugin"},slug:{type:"string",description:"The slug of the WordPress Core plugin"}},required:["resource","slug"],additionalProperties:!1},UrlReference:{type:"object",properties:{resource:{type:"string",const:"url",description:"Identifies the file resource as a URL"},url:{type:"string",description:"The URL of the file"},caption:{type:"string",description:"Optional caption for displaying a progress message"}},required:["resource","url"],additionalProperties:!1},SupportedPHPExtensionBundle:{type:"string",const:"kitchen-sink"},StepDefinition:{type:"object",discriminator:{propertyName:"step"},required:["step"],oneOf:[{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"activatePlugin"},pluginPath:{type:"string",description:"Path to the plugin directory as absolute path (/wordpress/wp-content/plugins/plugin-name); or the plugin entry file relative to the plugins directory (plugin-name/plugin-name.php)."},pluginName:{type:"string",description:"Optional. Plugin name to display in the progress bar."}},required:["pluginPath","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"activateTheme"},themeFolderName:{type:"string",description:"The name of the theme folder inside wp-content/themes/"}},required:["step","themeFolderName"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"applyWordPressPatches"},siteUrl:{type:"string"},wordpressPath:{type:"string"},addPhpInfo:{type:"boolean"},patchSecrets:{type:"boolean"},disableSiteHealth:{type:"boolean"},disableWpNewBlogNotification:{type:"boolean"},makeEditorFrameControlled:{type:"boolean"},prepareForRunningInsideWebBrowser:{type:"boolean"},addFetchNetworkTransport:{type:"boolean"}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"cp"},fromPath:{type:"string",description:"Source path"},toPath:{type:"string",description:"Target path"}},required:["fromPath","step","toPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"defineWpConfigConsts"},consts:{type:"object",additionalProperties:{},description:"The constants to define"},virtualize:{type:"boolean",deprecated:`This option is noop and will be removed in a future version.
|
|
539
539
|
This option is only kept in here to avoid breaking Blueprint schema validation
|
|
540
|
-
for existing apps using this option.`}},required:["consts","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"defineSiteUrl"},siteUrl:{type:"string",description:"The URL"}},required:["siteUrl","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"importFile"},file:{$ref:"#/definitions/FileReference",description:"The file to import"}},required:["file","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"importWordPressFiles"},wordPressFilesZip:{$ref:"#/definitions/FileReference",description:"The zip file containing the top-level WordPress files and directories."},pathInZip:{type:"string",description:"The path inside the zip file where the WordPress files are."}},required:["step","wordPressFilesZip"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"installPlugin",description:"The step identifier."},pluginZipFile:{$ref:"#/definitions/FileReference",description:"The plugin zip file to install."},options:{$ref:"#/definitions/InstallPluginOptions",description:"Optional installation options."}},required:["pluginZipFile","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"installTheme",description:"The step identifier."},themeZipFile:{$ref:"#/definitions/FileReference",description:"The theme zip file to install."},options:{type:"object",properties:{activate:{type:"boolean",description:"Whether to activate the theme after installing it."}},additionalProperties:!1,description:"Optional installation options."}},required:["step","themeZipFile"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"login"},username:{type:"string",description:"The user to log in as. Defaults to 'admin'."},password:{type:"string",description:"The password to log in with. Defaults to 'password'."}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"mkdir"},path:{type:"string",description:"The path of the directory you want to create"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"mv"},fromPath:{type:"string",description:"Source path"},toPath:{type:"string",description:"Target path"}},required:["fromPath","step","toPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"request"},request:{$ref:"#/definitions/PHPRequest",description:"Request details (See /wordpress-playground/api/universal/interface/PHPRequest)"}},required:["request","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"rm"},path:{type:"string",description:"The path to remove"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"rmdir"},path:{type:"string",description:"The path to remove"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runPHP",description:"The step identifier."},code:{type:"string",description:"The PHP code to run."}},required:["code","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runPHPWithOptions"},options:{$ref:"#/definitions/PHPRunOptions",description:"Run options (See /wordpress-playground/api/universal/interface/PHPRunOptions)"}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runWpInstallationWizard"},options:{$ref:"#/definitions/WordPressInstallationOptions"}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runSql",description:"The step identifier."},sql:{$ref:"#/definitions/FileReference",description:"The SQL to run. Each non-empty line must contain a valid SQL query."}},required:["sql","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"setPhpIniEntry"},key:{type:"string",description:'Entry name e.g. "display_errors"'},value:{type:"string",description:'Entry value as a string e.g. "1"'}},required:["key","step","value"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"setSiteOptions",description:'The name of the step. Must be "setSiteOptions".'},options:{type:"object",additionalProperties:{},description:"The options to set on the site."}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"unzip"},zipPath:{type:"string",description:"The zip file to extract"},extractToPath:{type:"string",description:"The path to extract the zip file to"}},required:["extractToPath","step","zipPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"updateUserMeta"},meta:{type:"object",additionalProperties:{},description:'An object of user meta values to set, e.g. { "first_name": "John" }'},userId:{type:"number",description:"User ID"}},required:["meta","step","userId"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"writeFile"},path:{type:"string",description:"The path of the file to write to"},data:{anyOf:[{$ref:"#/definitions/FileReference"},{type:"string"},{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}}],description:"The data to write"}},required:["data","path","step"]}]},InstallPluginOptions:{type:"object",properties:{activate:{type:"boolean",description:"Whether to activate the plugin after installing it."}},additionalProperties:!1},PHPRequest:{type:"object",properties:{method:{$ref:"#/definitions/HTTPMethod",description:"Request method. Default: `GET`."},url:{type:"string",description:"Request path or absolute URL."},headers:{$ref:"#/definitions/PHPRequestHeaders",description:"Request headers."},files:{type:"object",additionalProperties:{type:"object",properties:{size:{type:"number"},type:{type:"string"},lastModified:{type:"number"},name:{type:"string"},webkitRelativePath:{type:"string"}},required:["lastModified","name","size","type","webkitRelativePath"],additionalProperties:!1},description:"Uploaded files"},body:{type:"string",description:"Request body without the files."},formData:{type:"object",additionalProperties:{},description:"Form data. If set, the request body will be ignored and the content-type header will be set to `application/x-www-form-urlencoded`."}},required:["url"],additionalProperties:!1},HTTPMethod:{type:"string",enum:["GET","POST","HEAD","OPTIONS","PATCH","PUT","DELETE"]},PHPRequestHeaders:{type:"object",additionalProperties:{type:"string"}},PHPRunOptions:{type:"object",properties:{relativeUri:{type:"string",description:"Request path following the domain:port part."},scriptPath:{type:"string",description:"Path of the .php file to execute."},protocol:{type:"string",description:"Request protocol."},method:{$ref:"#/definitions/HTTPMethod",description:"Request method. Default: `GET`."},headers:{$ref:"#/definitions/PHPRequestHeaders",description:"Request headers."},body:{type:"string",description:"Request body without the files."},fileInfos:{type:"array",items:{$ref:"#/definitions/FileInfo"},description:"Uploaded files."},code:{type:"string",description:"The code snippet to eval instead of a php file."}},additionalProperties:!1},FileInfo:{type:"object",properties:{key:{type:"string"},name:{type:"string"},type:{type:"string"},data:{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}}},required:["key","name","type","data"],additionalProperties:!1},WordPressInstallationOptions:{type:"object",properties:{adminUsername:{type:"string"},adminPassword:{type:"string"}},additionalProperties:!1}},wp={$schema:gp,$ref:$p,definitions:_p};function oa(e,{progress:t=new gn,semaphore:r=new xn({concurrency:3}),onStepCompleted:n=()=>{}}={}){var u,d,h;if(e={...e,steps:(e.steps||[]).filter(Sp)},e.constants&&e.steps.unshift({step:"defineWpConfigConsts",consts:e.constants}),e.siteOptions&&e.steps.unshift({step:"setSiteOptions",options:e.siteOptions}),e.plugins){const w=e.plugins.map(T=>typeof T=="string"?T.startsWith("https://")?{resource:"url",url:T}:{resource:"wordpress.org/plugins",slug:T}:T).map(T=>({step:"installPlugin",pluginZipFile:T}));e.steps.unshift(...w)}e.login&&e.steps.push({step:"login",...e.login===!0?{username:"admin",password:"password"}:e.login});const{valid:s,errors:i}=bp(e);if(!s){const w=new Error(`Invalid blueprint: ${i[0].message} at ${i[0].instancePath}`);throw w.errors=i,w}const o=e.steps||[],l=o.reduce((w,T)=>{var v;return w+(((v=T.progress)==null?void 0:v.weight)||1)},0),p=o.map(w=>Tp(w,{semaphore:r,rootProgressTracker:t,totalProgressWeight:l}));return{versions:{php:Pp((u=e.preferredVersions)==null?void 0:u.php,$n,so),wp:((d=e.preferredVersions)==null?void 0:d.wp)||"latest"},phpExtensions:Ep([],e.phpExtensionBundles||[]),features:{networking:((h=e.features)==null?void 0:h.networking)??!1},run:async w=>{try{for(const{resources:T}of p)for(const v of T)v.setPlayground(w),v.isAsync&&v.resolve();for(const{run:T,step:v}of p){const R=await T(w);n(R,v)}}finally{try{await w.goTo(e.landingPage||"/")}catch{}t.finish()}}}}const vp=new yp({discriminator:!0});let Fr;function bp(e){var s;Fr=vp.compile(wp);const t=Fr(e);if(t)return{valid:t};const r=new Set;for(const i of Fr.errors)i.schemaPath.startsWith("#/properties/steps/items/anyOf")||r.add(i.instancePath);const n=(s=Fr.errors)==null?void 0:s.filter(i=>!(i.schemaPath.startsWith("#/properties/steps/items/anyOf")&&r.has(i.instancePath)));return{valid:t,errors:n}}function Pp(e,t,r){return e&&t.includes(e)?e:r}function Ep(e,t){const r=io.filter(s=>e.includes(s)),n=t.flatMap(s=>s in ri?ri[s]:[]);return Array.from(new Set([...r,...n]))}function Sp(e){return!!(typeof e=="object"&&e)}function Tp(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 h of Object.keys(e)){let w=e[h];hc(w)&&(w=St.create(w,{semaphore:t})),i[h]=w}const o=async h=>{var w;try{return s.fillSlowly(),await La[e.step](h,await Rp(i),{tracker:s,initialCaption:(w=e.progress)==null?void 0:w.caption})}finally{s.finish()}},l=Si(i),p=Si(i).filter(h=>h.isAsync),u=1/(p.length+1);for(const h of p)h.progress=s.stage(u);return{run:o,step:e,resources:l}}function Si(e){const t=[];for(const r in e){const n=e[r];n instanceof St&&t.push(n)}return t}async function Rp(e){const t={};for(const r in e){const n=e[r];n instanceof St?t[r]=await n.resolve():t[r]=n}return t}async function aa(e,t){await e.run(t)}function Op(){}/**
|
|
540
|
+
for existing apps using this option.`}},required:["consts","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"defineSiteUrl"},siteUrl:{type:"string",description:"The URL"}},required:["siteUrl","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"importFile"},file:{$ref:"#/definitions/FileReference",description:"The file to import"}},required:["file","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"importWordPressFiles"},wordPressFilesZip:{$ref:"#/definitions/FileReference",description:"The zip file containing the top-level WordPress files and directories."},pathInZip:{type:"string",description:"The path inside the zip file where the WordPress files are."}},required:["step","wordPressFilesZip"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"installPlugin",description:"The step identifier."},pluginZipFile:{$ref:"#/definitions/FileReference",description:"The plugin zip file to install."},options:{$ref:"#/definitions/InstallPluginOptions",description:"Optional installation options."}},required:["pluginZipFile","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"installTheme",description:"The step identifier."},themeZipFile:{$ref:"#/definitions/FileReference",description:"The theme zip file to install."},options:{type:"object",properties:{activate:{type:"boolean",description:"Whether to activate the theme after installing it."}},additionalProperties:!1,description:"Optional installation options."}},required:["step","themeZipFile"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"login"},username:{type:"string",description:"The user to log in as. Defaults to 'admin'."},password:{type:"string",description:"The password to log in with. Defaults to 'password'."}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"mkdir"},path:{type:"string",description:"The path of the directory you want to create"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"mv"},fromPath:{type:"string",description:"Source path"},toPath:{type:"string",description:"Target path"}},required:["fromPath","step","toPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"request"},request:{$ref:"#/definitions/PHPRequest",description:"Request details (See /wordpress-playground/api/universal/interface/PHPRequest)"}},required:["request","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"rm"},path:{type:"string",description:"The path to remove"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"rmdir"},path:{type:"string",description:"The path to remove"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runPHP",description:"The step identifier."},code:{type:"string",description:"The PHP code to run."}},required:["code","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runPHPWithOptions"},options:{$ref:"#/definitions/PHPRunOptions",description:"Run options (See /wordpress-playground/api/universal/interface/PHPRunOptions)"}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runWpInstallationWizard"},options:{$ref:"#/definitions/WordPressInstallationOptions"}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runSql",description:"The step identifier."},sql:{$ref:"#/definitions/FileReference",description:"The SQL to run. Each non-empty line must contain a valid SQL query."}},required:["sql","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"setPhpIniEntry"},key:{type:"string",description:'Entry name e.g. "display_errors"'},value:{type:"string",description:'Entry value as a string e.g. "1"'}},required:["key","step","value"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"setSiteOptions",description:'The name of the step. Must be "setSiteOptions".'},options:{type:"object",additionalProperties:{},description:"The options to set on the site."}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"unzip"},zipPath:{type:"string",description:"The zip file to extract"},extractToPath:{type:"string",description:"The path to extract the zip file to"}},required:["extractToPath","step","zipPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"updateUserMeta"},meta:{type:"object",additionalProperties:{},description:'An object of user meta values to set, e.g. { "first_name": "John" }'},userId:{type:"number",description:"User ID"}},required:["meta","step","userId"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"writeFile"},path:{type:"string",description:"The path of the file to write to"},data:{anyOf:[{$ref:"#/definitions/FileReference"},{type:"string"},{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}}],description:"The data to write"}},required:["data","path","step"]}]},InstallPluginOptions:{type:"object",properties:{activate:{type:"boolean",description:"Whether to activate the plugin after installing it."}},additionalProperties:!1},PHPRequest:{type:"object",properties:{method:{$ref:"#/definitions/HTTPMethod",description:"Request method. Default: `GET`."},url:{type:"string",description:"Request path or absolute URL."},headers:{$ref:"#/definitions/PHPRequestHeaders",description:"Request headers."},files:{type:"object",additionalProperties:{type:"object",properties:{size:{type:"number"},type:{type:"string"},lastModified:{type:"number"},name:{type:"string"},webkitRelativePath:{type:"string"}},required:["lastModified","name","size","type","webkitRelativePath"],additionalProperties:!1},description:"Uploaded files"},body:{type:"string",description:"Request body without the files."},formData:{type:"object",additionalProperties:{},description:"Form data. If set, the request body will be ignored and the content-type header will be set to `application/x-www-form-urlencoded`."}},required:["url"],additionalProperties:!1},HTTPMethod:{type:"string",enum:["GET","POST","HEAD","OPTIONS","PATCH","PUT","DELETE"]},PHPRequestHeaders:{type:"object",additionalProperties:{type:"string"}},PHPRunOptions:{type:"object",properties:{relativeUri:{type:"string",description:"Request path following the domain:port part."},scriptPath:{type:"string",description:"Path of the .php file to execute."},protocol:{type:"string",description:"Request protocol."},method:{$ref:"#/definitions/HTTPMethod",description:"Request method. Default: `GET`."},headers:{$ref:"#/definitions/PHPRequestHeaders",description:"Request headers."},body:{type:"string",description:"Request body without the files."},fileInfos:{type:"array",items:{$ref:"#/definitions/FileInfo"},description:"Uploaded files."},code:{type:"string",description:"The code snippet to eval instead of a php file."}},additionalProperties:!1},FileInfo:{type:"object",properties:{key:{type:"string"},name:{type:"string"},type:{type:"string"},data:{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}}},required:["key","name","type","data"],additionalProperties:!1},WordPressInstallationOptions:{type:"object",properties:{adminUsername:{type:"string"},adminPassword:{type:"string"}},additionalProperties:!1}},_p={$schema:gp,$ref:$p,definitions:wp};function oa(e,{progress:t=new gn,semaphore:r=new xn({concurrency:3}),onStepCompleted:n=()=>{}}={}){var u,p,h;if(e={...e,steps:(e.steps||[]).filter(Sp)},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(T=>typeof T=="string"?T.startsWith("https://")?{resource:"url",url:T}:{resource:"wordpress.org/plugins",slug:T}:T).map(T=>({step:"installPlugin",pluginZipFile:T}));e.steps.unshift(..._)}e.login&&e.steps.push({step:"login",...e.login===!0?{username:"admin",password:"password"}:e.login});const{valid:s,errors:i}=bp(e);if(!s){const _=new Error(`Invalid blueprint: ${i[0].message} at ${i[0].instancePath}`);throw _.errors=i,_}const o=e.steps||[],l=o.reduce((_,T)=>{var v;return _+(((v=T.progress)==null?void 0:v.weight)||1)},0),d=o.map(_=>Tp(_,{semaphore:r,rootProgressTracker:t,totalProgressWeight:l}));return{versions:{php:Pp((u=e.preferredVersions)==null?void 0:u.php,$n,so),wp:((p=e.preferredVersions)==null?void 0:p.wp)||"latest"},phpExtensions:Ep([],e.phpExtensionBundles||[]),features:{networking:((h=e.features)==null?void 0:h.networking)??!1},run:async _=>{try{for(const{resources:T}of d)for(const v of T)v.setPlayground(_),v.isAsync&&v.resolve();for(const{run:T,step:v}of d){const R=await T(_);n(R,v)}}finally{try{await _.goTo(e.landingPage||"/")}catch{}t.finish()}}}}const vp=new yp({discriminator:!0});let Fr;function bp(e){var s;Fr=vp.compile(_p);const t=Fr(e);if(t)return{valid:t};const r=new Set;for(const i of Fr.errors)i.schemaPath.startsWith("#/properties/steps/items/anyOf")||r.add(i.instancePath);const n=(s=Fr.errors)==null?void 0:s.filter(i=>!(i.schemaPath.startsWith("#/properties/steps/items/anyOf")&&r.has(i.instancePath)));return{valid:t,errors:n}}function Pp(e,t,r){return e&&t.includes(e)?e:r}function Ep(e,t){const r=io.filter(s=>e.includes(s)),n=t.flatMap(s=>s in ri?ri[s]:[]);return Array.from(new Set([...r,...n]))}function Sp(e){return!!(typeof e=="object"&&e)}function Tp(e,{semaphore:t,rootProgressTracker:r,totalProgressWeight:n}){var p;const s=r.stage((((p=e.progress)==null?void 0:p.weight)||1)/n),i={};for(const h of Object.keys(e)){let _=e[h];hc(_)&&(_=St.create(_,{semaphore:t})),i[h]=_}const o=async h=>{var _;try{return s.fillSlowly(),await La[e.step](h,await Rp(i),{tracker:s,initialCaption:(_=e.progress)==null?void 0:_.caption})}finally{s.finish()}},l=Si(i),d=Si(i).filter(h=>h.isAsync),u=1/(d.length+1);for(const h of d)h.progress=s.stage(u);return{run:o,step:e,resources:l}}function Si(e){const t=[];for(const r in e){const n=e[r];n instanceof St&&t.push(n)}return t}async function Rp(e){const t={};for(const r in e){const n=e[r];n instanceof St?t[r]=await n.resolve():t[r]=n}return t}async function aa(e,t){await e.run(t)}function Op(){}/**
|
|
541
541
|
* @license
|
|
542
542
|
* Copyright 2019 Google LLC
|
|
543
543
|
* SPDX-License-Identifier: Apache-2.0
|
|
544
|
-
*/const ca=Symbol("Comlink.proxy"),Cp=Symbol("Comlink.endpoint"),Np=Symbol("Comlink.releaseProxy"),kn=Symbol("Comlink.finalizer"),Hr=Symbol("Comlink.thrown"),la=e=>typeof e=="object"&&e!==null||typeof e=="function",kp={canHandle:e=>la(e)&&e[ca],serialize(e){const{port1:t,port2:r}=new MessageChannel;return Is(e,t),[r,[r]]},deserialize(e){return e.start(),As(e)}},jp={canHandle:e=>la(e)&&Hr 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}},$r=new Map([["proxy",kp],["throw",jp]]);function Ip(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(!Ip(r,s.origin)){console.warn(`Invalid origin '${s.origin}' for comlink proxy`);return}const{id:i,type:o,path:l}=Object.assign({path:[]},s.data),
|
|
544
|
+
*/const ca=Symbol("Comlink.proxy"),Cp=Symbol("Comlink.endpoint"),Np=Symbol("Comlink.releaseProxy"),kn=Symbol("Comlink.finalizer"),Hr=Symbol("Comlink.thrown"),la=e=>typeof e=="object"&&e!==null||typeof e=="function",kp={canHandle:e=>la(e)&&e[ca],serialize(e){const{port1:t,port2:r}=new MessageChannel;return Is(e,t),[r,[r]]},deserialize(e){return e.start(),As(e)}},jp={canHandle:e=>la(e)&&Hr 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}},$r=new Map([["proxy",kp],["throw",jp]]);function Ip(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(!Ip(r,s.origin)){console.warn(`Invalid origin '${s.origin}' for comlink proxy`);return}const{id:i,type:o,path:l}=Object.assign({path:[]},s.data),d=(s.data.argumentList||[]).map(gt);let u;try{const p=l.slice(0,-1).reduce((_,T)=>_[T],e),h=l.reduce((_,T)=>_[T],e);switch(o){case"GET":u=h;break;case"SET":p[l.slice(-1)[0]]=gt(s.data.value),u=!0;break;case"APPLY":u=h.apply(p,d);break;case"CONSTRUCT":{const _=new h(...d);u=fa(_)}break;case"ENDPOINT":{const{port1:_,port2:T}=new MessageChannel;Is(e,T),u=Mp(_,[_])}break;case"RELEASE":u=void 0;break;default:return}}catch(p){u={value:p,[Hr]:0}}Promise.resolve(u).catch(p=>({value:p,[Hr]:0})).then(p=>{const[h,_]=Zr(p);t.postMessage(Object.assign(Object.assign({},h),{id:i}),_),o==="RELEASE"&&(t.removeEventListener("message",n),ua(t),kn in e&&typeof e[kn]=="function"&&e[kn]())}).catch(p=>{const[h,_]=Zr({value:new TypeError("Unserializable return value"),[Hr]:0});t.postMessage(Object.assign(Object.assign({},h),{id:i}),_)})}),t.start&&t.start()}function Ap(e){return e.constructor.name==="MessagePort"}function ua(e){Ap(e)&&e.close()}function As(e,t){return Ln(e,[],t)}function qr(e){if(e)throw new Error("Proxy has been released and is not useable")}function da(e){return Ut(e,{type:"RELEASE"}).then(()=>{ua(e)})}const Jr=new WeakMap,Yr="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(Jr.get(e)||0)-1;Jr.set(e,t),t===0&&da(e)});function Dp(e,t){const r=(Jr.get(t)||0)+1;Jr.set(t,r),Yr&&Yr.register(e,t,e)}function Fp(e){Yr&&Yr.unregister(e)}function Ln(e,t=[],r=function(){}){let n=!1;const s=new Proxy(r,{get(i,o){if(qr(n),o===Np)return()=>{Fp(s),da(e),n=!0};if(o==="then"){if(t.length===0)return{then:()=>s};const l=Ut(e,{type:"GET",path:t.map(d=>d.toString())}).then(gt);return l.then.bind(l)}return Ln(e,[...t,o])},set(i,o,l){qr(n);const[d,u]=Zr(l);return Ut(e,{type:"SET",path:[...t,o].map(p=>p.toString()),value:d},u).then(gt)},apply(i,o,l){qr(n);const d=t[t.length-1];if(d===Cp)return Ut(e,{type:"ENDPOINT"}).then(gt);if(d==="bind")return Ln(e,t.slice(0,-1));const[u,p]=Ti(l);return Ut(e,{type:"APPLY",path:t.map(h=>h.toString()),argumentList:u},p).then(gt)},construct(i,o){qr(n);const[l,d]=Ti(o);return Ut(e,{type:"CONSTRUCT",path:t.map(u=>u.toString()),argumentList:l},d).then(gt)}});return Dp(s,e),s}function qp(e){return Array.prototype.concat.apply([],e)}function Ti(e){const t=e.map(Zr);return[t.map(r=>r[0]),qp(t.map(r=>r[1]))]}const pa=new WeakMap;function Mp(e,t){return pa.set(e,t),e}function fa(e){return Object.assign(e,{[ca]:!0})}function Up(e,t=globalThis,r="*"){return{postMessage:(n,s)=>e.postMessage(n,r,s),addEventListener:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t)}}function Zr(e){for(const[t,r]of $r)if(r.canHandle(e)){const[n,s]=r.serialize(e);return[{type:"HANDLER",name:t,value:n},s]}return[{type:"RAW",value:e},pa.get(e)||[]]}function gt(e){switch(e.type){case"HANDLER":return $r.get(e.name).deserialize(e.value);case"RAW":return e.value}}function Ut(e,t,r){return new Promise(n=>{const s=Lp();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 Lp(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}function ha(e){Hp();const t=e instanceof Worker?e:Up(e),r=As(t),n=ma(r);return new Proxy(n,{get:(s,i)=>i==="isConnected"?async()=>{for(let o=0;o<10;o++)try{await zp(r.isConnected(),200);break}catch{}}:r[i]})}async function zp(e,t){return new Promise((r,n)=>{setTimeout(n,t),e.then(r)})}let Ri=!1;function Hp(){Ri||(Ri=!0,$r.set("EVENT",{canHandle:e=>e instanceof CustomEvent,serialize:e=>[{detail:e.detail},[]],deserialize:e=>e}),$r.set("FUNCTION",{canHandle:e=>typeof e=="function",serialize(e){console.debug("[Comlink][Performance] Proxying a function");const{port1:t,port2:r}=new MessageChannel;return Is(e,t),[r,[r]]},deserialize(e){return e.start(),As(e)}}),$r.set("PHPResponse",{canHandle:e=>typeof e=="object"&&e!==null&&"headers"in e&&"bytes"in e&&"errors"in e&&"exitCode"in e&&"httpStatusCode"in e,serialize(e){return[e.toRawData(),[]]},deserialize(e){return bt.fromRawData(e)}}))}function ma(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]:ma(t[r]);case"undefined":case"number":case"string":return t[r];default:return fa(t[r])}}})}async function ya({iframe:e,blueprint:t,remoteUrl:r,progressTracker:n=new gn,disableProgressBar:s,onBlueprintStepCompleted:i}){if(Wp(r),Vp(e),r=Ci(r,{progressbar:!s}),n.setCaption("Preparing WordPress"),!t)return Oi(e,r,n);const o=oa(t,{progress:n.stage(.5),onStepCompleted:i}),l=await Oi(e,Ci(r,{php:o.versions.php,wp:o.versions.wp,"php-extension":o.phpExtensions,networking:o.features.networking?"yes":"no"}),n);return await aa(o,l),n.finish(),l}function Vp(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 Oi(e,t,r){await new Promise(i=>{e.src=t,e.addEventListener("load",i,!1)});const n=ha(e.contentWindow);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 Wp(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 Ci(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 xp(e,t){if(console.warn("`connectPlayground` is deprecated and will be removed. Use `startPlayground` instead."),t!=null&&t.loadRemote)return ya({iframe:e,remoteUrl:t.loadRemote});const r=ha(e.contentWindow);return await r.isConnected(),r}exports.LatestSupportedPHPVersion=so;exports.SupportedPHPVersions=$n;exports.SupportedPHPVersionsList=Xa;exports.activatePlugin=Hn;exports.activateTheme=Vn;exports.applyWordPressPatches=ji;exports.compileBlueprint=oa;exports.connectPlayground=xp;exports.cp=Li;exports.defineSiteUrl=Wi;exports.defineWpConfigConsts=Lt;exports.exportWXR=Ki;exports.exportWXZ=Gi;exports.importFile=xi;exports.importWordPressFiles=Bi;exports.installPlugin=Yi;exports.installTheme=Zi;exports.login=Qi;exports.mkdir=Hi;exports.mv=zi;exports.phpVar=Gt;exports.phpVars=mn;exports.request=Ui;exports.rm=Wn;exports.rmdir=Vi;exports.runBlueprintSteps=aa;exports.runPHP=Ai;exports.runPHPWithOptions=Di;exports.runSql=qi;exports.runWpInstallationWizard=Xi;exports.setPhpIniEntry=Mi;exports.setPluginProxyURL=Op;exports.setSiteOptions=eo;exports.startPlaygroundWeb=ya;exports.unzip=yn;exports.updateUserMeta=to;exports.wpContentFilesExcludedFromExport=zn;exports.writeFile=Bn;exports.zipWpContent=no;
|