@wp-playground/blueprints 3.1.44 → 3.1.46
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/blueprint-schema-validator.d.ts +4 -1
- package/blueprint-schema-validator.js +2322 -1831
- package/blueprint-schema.json +3067 -1
- package/blueprint-v2-schema-validator.d.ts +5 -0
- package/blueprint-v2-schema-validator.js +37821 -0
- package/index.cjs +974 -151
- package/index.cjs.map +1 -1
- package/index.d.ts +7 -4
- package/index.js +7203 -5120
- package/index.js.map +1 -1
- package/lib/compile.d.ts +5 -2
- package/lib/invalid-blueprint-error.d.ts +5 -0
- package/lib/reflection.d.ts +1 -1
- package/lib/resolve-runtime-configuration.d.ts +13 -1
- package/lib/steps/import-wxr.d.ts +20 -0
- package/lib/steps/reset-data.d.ts +9 -2
- package/lib/v1/compile.d.ts +2 -4
- package/lib/v2/blueprint-v2-declaration.d.ts +0 -10
- package/lib/v2/compile.d.ts +23 -2
- package/lib/v2/resolve-runtime-configuration.d.ts +20 -0
- package/lib/v2/validate-blueprint-v2.d.ts +17 -0
- package/lib/v2/wep-1-blueprint-v2-schema/appendix-A-blueprint-v2-schema.d.ts +91 -17
- package/lib/v2/wep-1-blueprint-v2-schema/appendix-B-data-sources.d.ts +54 -15
- package/lib/validate-blueprint-declaration.d.ts +6 -0
- package/package.json +11 -11
- package/schema-readme.md +6 -5
- package/tests/v2/schema-conformance-fixtures.d.ts +2033 -0
- package/validate-blueprint-v2-C3rgpKFU.js +17393 -0
- package/validate-blueprint-v2-C3rgpKFU.js.map +1 -0
- package/validate-blueprint-v2-CGFpDXlD.cjs +201 -0
- package/validate-blueprint-v2-CGFpDXlD.cjs.map +1 -0
- package/validate-blueprint-v2-CJ8Xbxyz.cjs +201 -0
- package/validate-blueprint-v2-CJ8Xbxyz.cjs.map +1 -0
- package/validate-blueprint-v2-IqJfvfcL.js +17393 -0
- package/validate-blueprint-v2-IqJfvfcL.js.map +1 -0
- package/blueprints-Gs5fAvvo.cjs +0 -2
- package/blueprints-Gs5fAvvo.cjs.map +0 -1
- package/blueprints-pMn3V9MZ.js +0 -5
- package/blueprints-pMn3V9MZ.js.map +0 -1
- package/lib/v2/get-v2-runner.d.ts +0 -1
- package/lib/v2/run-blueprint-v2.d.ts +0 -36
package/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const zr=require("@php-wasm/progress"),N=require("@php-wasm/util"),ke=require("@php-wasm/universal"),ve=require("@wp-playground/storage"),Ps=require("@php-wasm/web-service-worker"),Wr=require("@php-wasm/stream-compression"),oe=require("@php-wasm/logger"),Or=require("@wp-playground/wordpress"),Ge=require("@wp-playground/common");function Ot(e){return e&&"read"in e&&typeof e.read=="function"}async function kt(e){if(typeof e=="string"){let n;try{n=JSON.parse(e)}catch{throw new Error("Raw JSON input must be valid JSON.")}if(!n||typeof n!="object"||Array.isArray(n))throw new Error("Raw JSON input must contain a Blueprint declaration object.");return n}if(!Ot(e))return e;const o=await(await e.read("blueprint.json")).text();return JSON.parse(o)}class Qe{static async create(t){const o=await kt(t),n=Ot(t)?t:void 0;return Qe.createFromDeclaration(o,n)}static createFromDeclaration(t,o=void 0){return new Qe(t,o,t.version||1)}constructor(t,o,n){this.declaration=t,this.bundle=o,this.version=n}getVersion(){return this.version}getDeclaration(){return this.declaration}isBundle(){return this.bundle!==void 0}getBundle(){return this.bundle}getBlueprint(){return this.getBundle()||this.getDeclaration()}}function Rr(e){const t=e.split(".").shift().replace(/-/g," ");return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}const $s=`Blueprint resource of type "bundled" requires a filesystem.
|
|
2
2
|
|
|
3
3
|
This Blueprint refers to files that should be bundled with it (like images, plugins, or themes), but the filesystem needed to access these files is not available. This usually happens when:
|
|
4
4
|
|
|
@@ -10,12 +10,12 @@ To fix this:
|
|
|
10
10
|
• If you're using a blueprint.zip file, ensure it contains all the files referenced in the Blueprint
|
|
11
11
|
• Check that the "resource": "bundled" references in your Blueprint match actual files in your bundle
|
|
12
12
|
|
|
13
|
-
Learn more about Blueprint resources: https://wordpress.github.io/wordpress-playground/blueprints/data-format#resources`;class
|
|
13
|
+
Learn more about Blueprint resources: https://wordpress.github.io/wordpress-playground/blueprints/data-format#resources`;class Et extends Error{constructor(t=$s){super(t),this.name="BlueprintFilesystemRequiredError"}}class Pr extends Error{constructor(t,o,n){super(t,n),this.name="ResourceDownloadError",this.url=o}}const Os=["vfs","literal","wordpress.org/themes","wordpress.org/plugins","url","git:directory","bundled","zip"];function ks(e){return e&&typeof e=="object"&&typeof e.resource=="string"&&Os.includes(e.resource)}function Es(e){try{return new URL(e).hostname==="github-proxy.com"}catch{return!1}}function Ts(e){let t;try{t=new URL(e)}catch{return null}if(t.hostname!=="github-proxy.com")return null;const o=t.pathname.slice(1);if(o.startsWith("https://github.com/")||o.startsWith("http://github.com/"))return{resource:"url",url:o};const n=t.searchParams,l=n.get("repo");if(!l)return null;const s=n.get("release"),r=n.get("asset");if(s&&r){const T=s==="latest"?"releases/latest/download":`releases/download/${s}`;return{resource:"url",url:`https://github.com/${l}/${T}/${r}`}}let u,f;const h=n.get("pr"),y=n.get("commit"),m=n.get("branch");h?u=`refs/pull/${h}/head`:y?(u=y,f="commit"):s?(u=s,f="tag"):u=m||"HEAD";const k=n.get("directory");return{resource:"zip",inner:{resource:"git:directory",url:`https://github.com/${l}`,ref:u,...f&&{refType:f},...k&&{path:k}}}}class me{get progress(){return this._progress}set progress(t){this._progress=t}setPlayground(t){this.playground=t}get isAsync(){return!1}static create(t,{semaphore:o,progress:n,corsProxy:l,streamBundledFile:s,gitAdditionalHeadersCallback:r}){if(t.resource==="url"&&Es(t.url)){const f=Ts(t.url);f&&(console.warn(`[Blueprints] github-proxy.com is deprecated and will stop working soon. The URL "${t.url}" has been automatically converted to a ${f.resource} resource. Please update your Blueprint to use native resource types. See: https://wordpress.github.io/wordpress-playground/blueprints/steps/resources`),t=f)}let u;switch(t.resource){case"vfs":u=new Rs(t,n);break;case"literal":u=new Ss(t,n);break;case"wordpress.org/themes":u=new Fs(t,n);break;case"wordpress.org/plugins":u=new Cs(t,n);break;case"url":u=new qs(t,n,{corsProxy:l});break;case"git:directory":u=new Ns(t,n,{corsProxy:l,additionalHeaders:r});break;case"literal:directory":u=new xs(t,n);break;case"bundled":if(!s)throw new Et;u=new Bs(t,s,n);break;case"zip":{const f=me.create(t.inner,{semaphore:o,progress:n,corsProxy:l,streamBundledFile:s,gitAdditionalHeadersCallback:r});u=new Ws(t,f,n);break}default:throw new Error(`Unknown resource type: ${t.resource}`)}return o&&(u=new Us(u,o)),new Is(u)}}class Tt extends me{constructor(t){super(),this.resource=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}setPlayground(t){this.resource.setPlayground(t)}}class Rs extends me{constructor(t,o){super(),this.resource=t,this._progress=o}async resolve(){var o;const t=await this.playground.readFileAsBuffer(this.resource.path);return(o=this.progress)==null||o.set(100),new File([t],this.name)}get name(){return this.resource.path.split("/").pop()||""}}class Ss extends me{constructor(t,o){super(),this.resource=t,this._progress=o}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 Hr extends me{constructor(t,o){super(),this._progress=t,this.corsProxy=o}async resolve(){var o,n,l;(o=this.progress)==null||o.setCaption(this.caption);const t=this.getURL();try{let s=await Ps.fetchWithCorsProxy(t,void 0,this.corsProxy,await((n=this.playground)==null?void 0:n.absoluteUrl));if(!s.ok)throw new Pr(`Could not download "${t}"`,t);if(s=await zr.cloneResponseMonitorProgress(s,((l=this.progress)==null?void 0:l.loadingListener)??As),s.status!==200)throw new Pr(`Could not download "${t}"`,t);const r=this.name||js(s.headers.get("content-disposition")||"")||encodeURIComponent(t);return new File([await s.arrayBuffer()],r)}catch(s){throw new Pr(`Could not download "${t}".
|
|
14
14
|
|
|
15
15
|
Confirm that the URL is correct, the server is reachable, and the file is actually served at that URL. Original error:
|
|
16
|
-
${s}`,t,{cause:s})}}get caption(){return`Downloading ${this.name}`}get name(){try{return new URL(this.getURL(),"http://example.com").pathname.split("/").pop()}catch{return this.getURL()}}get isAsync(){return!0}}function
|
|
16
|
+
${s}`,t,{cause:s})}}get caption(){return`Downloading ${this.name}`}get name(){try{return new URL(this.getURL(),"http://example.com").pathname.split("/").pop()}catch{return this.getURL()}}get isAsync(){return!0}}function js(e){if(!e)return null;const t=e.match(/filename\*?=([^;]+)/i);if(!t)return null;let o=t[1].trim();if((o.startsWith('"')&&o.endsWith('"')||o.startsWith("'")&&o.endsWith("'"))&&(o=o.slice(1,-1)),t[0].includes("filename*")){const n=o.match(/^[^']*'[^']*'(.+)$/);if(n)try{o=decodeURIComponent(n[1])}catch{}}return o}const As=()=>{};class qs extends Hr{constructor(t,o,n){if(super(o,n==null?void 0:n.corsProxy),this.resource=t,this.options=n,this.resource.url.startsWith("https://github.com/")){const l=this.resource.url.match(/^https:\/\/github\.com\/(?<owner>[^/]+)\/(?<repo>[^/]+)\/(?:blob|raw)\/(?<branch>[^/]+)\/(?<path>.+[^/])$/);l!=null&&l.groups&&(this.resource={...this.resource,url:`https://raw.githubusercontent.com/${l.groups.owner}/${l.groups.repo}/${l.groups.branch}/${l.groups.path}`})}}getURL(){return this.resource.url}get caption(){return this.resource.caption??super.caption}}class Ns extends me{constructor(t,o,n){super(),this.reference=t,this._progress=o,this.options=n}async resolve(){var n,l,s;const t=((l=(n=this.options)==null?void 0:n.additionalHeaders)==null?void 0:l.call(n,this.reference.url))??{},o=(s=this.options)!=null&&s.corsProxy?`${this.options.corsProxy}${this.reference.url}`:this.reference.url;try{const r=await ve.resolveCommitHash(o,{value:this.reference.ref,type:this.reference.refType??"infer"},t),u=await ve.listGitFiles(o,r,t),f=(this.reference.path??"").replace(/^\/+/,""),h=ve.listDescendantFiles(u,f),y=await ve.sparseCheckout(o,r,h,{withObjects:this.reference[".git"],additionalHeaders:t});let m=y.files;return m=Ls(m,k=>k.substring(f.length).replace(/^\/+/,"")),this.reference[".git"]&&(m={...await ve.createDotGitDirectory({repoUrl:this.reference.url,commitHash:r,ref:this.reference.ref,refType:this.reference.refType,objects:y.objects??[],fileOids:y.fileOids??{},pathPrefix:f}),...m}),{name:this.filename,files:m}}catch(r){throw r instanceof ve.GitAuthenticationError?new ve.GitAuthenticationError(this.reference.url,r.status):r}}get filename(){return this.name.replaceAll(/[^a-zA-Z0-9-.]/g,"-").replaceAll(/-+/g,"-").replace(/^[^a-zA-Z0-9]+|[^a-zA-Z0-9]+$/g,"")||N.randomFilename()}get name(){var t;return[this.reference.url,this.reference.ref?`(${this.reference.ref})`:"",(t=this.reference.path)!=null&&t.replace(/^\/+/,"")?`at ${this.reference.path}`:""].filter(o=>o.length>0).join(" ")}}function Ls(e,t){return Object.fromEntries(Object.entries(e).map(([o,n])=>[t(o),n]))}class xs extends me{constructor(t,o){super(),this.reference=t,this._progress=o}async resolve(){return this.reference}get name(){return this.reference.name}}class Fs extends Hr{constructor(t,o){super(o),this.resource=t}get name(){return Rr(this.resource.slug)}getURL(){return`https://downloads.wordpress.org/theme/${Rt(this.resource.slug)}`}}class Cs extends Hr{constructor(t,o){super(o),this.resource=t}get name(){return Rr(this.resource.slug)}getURL(){return`https://downloads.wordpress.org/plugin/${Rt(this.resource.slug)}`}}function Rt(e){return!e||e.endsWith(".zip")?e:e+".latest-stable.zip"}class Is extends Tt{async resolve(){return this.promise||(this.promise=this.resource.resolve()),this.promise}}class Us extends Tt{constructor(t,o){super(t),this.semaphore=o}async resolve(){return this.isAsync?this.semaphore.run(()=>this.resource.resolve()):this.resource.resolve()}}class Bs extends me{constructor(t,o,n){if(!o)throw new Error(`You are trying to run a Blueprint that refers to a bundled file ("blueprint" resource type), but you did not provide the rest of the bundle. This Blueprint won't work as a standalone JSON file. You'll need to load the entire bundle, e.g. a blueprint.zip file. Alternatively, you may try loading it directly from a URL or a local directory and Playground will try (with your permission) to source the missing files from paths relative to the blueprint file.`);super(),this.resource=t,this.streamBundledFile=o,this._progress=n}async resolve(){var t,o,n;(t=this.progress)==null||t.set(0);try{const l=await this.streamBundledFile(this.resource.path),s=l.filesize;if(!s)return(o=this.progress)==null||o.set(100),l;const r=zr.cloneStreamMonitorProgress(l.stream(),s,u=>{var f;(f=this.progress)==null||f.set(u.detail.loaded/u.detail.total*100)});return new Wr.StreamedFile(r,this.name,{filesize:s})}catch(l){throw(n=this.progress)==null||n.set(100),new Error(`Failed to read file from blueprint. This Blueprint refers to a resource of type "bundled" with path "${this.resource.path}" that was not available. Please ensure that the entire bundle, such as a blueprint.zip file, is loaded. If you are trying to load the Blueprint directly from a URL or a local directory, make sure that all the necessary files are accessible and located relative to the blueprint file.
|
|
17
17
|
|
|
18
|
-
Error details: ${l instanceof Error?l.message:String(l)}`,{cause:l})}}get name(){return this.resource.path.split("/").pop()||""}get isAsync(){return!0}}class
|
|
18
|
+
Error details: ${l instanceof Error?l.message:String(l)}`,{cause:l})}}get name(){return this.resource.path.split("/").pop()||""}get isAsync(){return!0}}class Ws extends me{constructor(t,o,n){super(),this.reference=t,this.innerResource=o,this._progress=n}async resolve(){var s,r;(s=this.progress)==null||s.setCaption(`Creating ZIP: ${this.name}`);const t=await this.innerResource.resolve();let o;t instanceof File?o=[t]:o=Ds(t.files,t.name);const n=Wr.encodeZip(o),l=await Wr.collectFile(this.name,n);return(r=this.progress)==null||r.set(100),l}get name(){if(this.reference.name)return this.reference.name;const t=this.innerResource.name;return t.endsWith(".zip")?t:`${t}.zip`}get isAsync(){return!0}}function Ds(e,t){const o=[];function n(l,s){for(const[r,u]of Object.entries(l)){const f=s?`${s}/${r}`:r;u instanceof Uint8Array?o.push(new File([u],`${t}/${f}`)):typeof u=="string"?o.push(new File([new TextEncoder().encode(u)],`${t}/${f}`)):n(u,f)}}return n(e,""),o}const Yr=async(e,{pluginPath:t,pluginName:o},n)=>{n==null||n.tracker.setCaption(`Activating ${o||t}`);const l=await e.documentRoot,s=N.joinPaths("/tmp",`playground-activate-plugin-${N.randomString(20,"")}.log`);let r="";const f=await e.run({code:`<?php
|
|
19
19
|
define( 'WP_ADMIN', true );
|
|
20
20
|
require_once( getenv('DOCROOT') . "/wp-load.php" );
|
|
21
21
|
require_once( getenv('DOCROOT') . "/wp-admin/includes/plugin.php" );
|
|
@@ -51,7 +51,7 @@ Error details: ${l instanceof Error?l.message:String(l)}`,{cause:l})}}get name()
|
|
|
51
51
|
} else if ( false === $response ) {
|
|
52
52
|
die( "The activatePlugin step wasn't able to find the plugin $plugin_path." );
|
|
53
53
|
}
|
|
54
|
-
`,env:{PLUGIN_PATH:t,DOCROOT:l,ACTIVATION_LOG:s}})
|
|
54
|
+
`,env:{PLUGIN_PATH:t,DOCROOT:l,ACTIVATION_LOG:s}}).finally(async()=>{try{await e.fileExists(s)&&(r=(await e.readFileAsText(s)).trim(),await e.unlink(s))}catch(O){if(!Vs(O))throw O}});f.text&&oe.logger.warn(`Plugin ${t} activation printed the following bytes: ${f.text}`);const y=((await e.run({code:`<?php
|
|
55
55
|
ob_start();
|
|
56
56
|
require_once( getenv( 'DOCROOT' ) . "/wp-load.php" );
|
|
57
57
|
|
|
@@ -84,18 +84,18 @@ Error details: ${l instanceof Error?l.message:String(l)}`,{cause:l})}}get name()
|
|
|
84
84
|
}
|
|
85
85
|
die('{"success": false}');
|
|
86
86
|
});
|
|
87
|
-
`,env:{DOCROOT:l,PLUGIN_PATH:t}})).text??"").trim();if(
|
|
88
|
-
${
|
|
87
|
+
`,env:{DOCROOT:l,PLUGIN_PATH:t}})).text??"").trim();if(y.endsWith('{"success": true}'))return;y!=='{"success": false}'&&oe.logger.debug(y);const m=[],k=(f.text??"").trim();throw k&&m.push(`WordPress said: ${k}`),r&&m.push(`PHP error log:
|
|
88
|
+
${r}`),m.push(`Response headers: ${JSON.stringify(f.headers,null,2)}`),m.push("If you need more context, check the Playground console (browser DevTools) or the CLI output where this Blueprint was run."),new Error(`Plugin ${t} could not be activated.
|
|
89
89
|
|
|
90
|
-
${
|
|
90
|
+
${m.join(`
|
|
91
91
|
|
|
92
|
-
`)}`)},
|
|
92
|
+
`)}`)},Ms=44;function Vs(e){const t=e;return t.code==="ENOENT"||t.errno===Ms}const Jr=async(e,{themeFolderName:t},o)=>{o==null||o.tracker.setCaption(`Activating ${t}`);const n=await e.documentRoot,l=`${n}/wp-content/themes/${t}`;if(!await e.fileExists(l))throw new Error(`
|
|
93
93
|
Couldn't activate theme ${t}.
|
|
94
94
|
Theme not found at the provided theme path: ${l}.
|
|
95
95
|
Check the theme path to ensure it's correct.
|
|
96
96
|
If the theme is not installed, you can install it using the installTheme step.
|
|
97
97
|
More info can be found in the Blueprint documentation: https://wordpress.github.io/wordpress-playground/blueprints/steps/#ActivateThemeStep
|
|
98
|
-
`);const s=await
|
|
98
|
+
`);const s=await e.run({code:`<?php
|
|
99
99
|
define( 'WP_ADMIN', true );
|
|
100
100
|
require_once( getenv('docroot') . "/wp-load.php" );
|
|
101
101
|
|
|
@@ -108,7 +108,7 @@ ${y.join(`
|
|
|
108
108
|
throw new Exception( 'Theme ' . getenv('themeFolderName') . ' could not be activated.' );
|
|
109
109
|
}
|
|
110
110
|
die('Theme activated successfully');
|
|
111
|
-
`,env:{docroot:
|
|
111
|
+
`,env:{docroot:n,themeFolderName:t}});if(s.text!=="Theme activated successfully")throw oe.logger.debug(s),new Error(`Theme ${t} could not be activated - WordPress exited with exit code ${s.exitCode}. Inspect the "debug" logs in the console for more details. Output headers: ${JSON.stringify(s.headers,null,2)}`)},St=async(e,{code:t})=>{let o=typeof t=="string"?t:t.content;return(o.includes('"wordpress/wp-load.php"')||o.includes("'wordpress/wp-load.php'"))&&(oe.logger.error(`
|
|
112
112
|
It looks like you're trying to load WordPress using a relative path 'wordpress/wp-load.php'.
|
|
113
113
|
|
|
114
114
|
Playground recently changed the working directory from '/' to '/wordpress' to better mimic
|
|
@@ -122,7 +122,7 @@ Instead of: require_once 'wordpress/wp-load.php';
|
|
|
122
122
|
Use: require_once '/wordpress/wp-load.php';
|
|
123
123
|
|
|
124
124
|
This will ensure your code works reliably regardless of the current working directory.
|
|
125
|
-
`.trim()),
|
|
125
|
+
`.trim()),o=o.replace("'wordpress/wp-load.php'","'/wordpress/wp-load.php'"),o=o.replace('"wordpress/wp-load.php"','"/wordpress/wp-load.php"')),await e.run({code:o})},jt=async(e,{options:t})=>await e.run(t),kr=async(e,{path:t})=>{t.startsWith("/")||(oe.logger.error(`
|
|
126
126
|
The rm() step in your Blueprint refers to a relative path.
|
|
127
127
|
|
|
128
128
|
Playground recently changed the working directory from '/' to '/wordpress' to better mimic
|
|
@@ -136,7 +136,7 @@ Instead of: rm({ path: 'wordpress/wp-load.php' });
|
|
|
136
136
|
Use: rm({ path: '/wordpress/wp-load.php' });
|
|
137
137
|
|
|
138
138
|
This will ensure your code works reliably regardless of the current working directory.
|
|
139
|
-
`.trim()),t=`/${t}`),await
|
|
139
|
+
`.trim()),t=`/${t}`),await e.unlink(t)},zs=`<?php
|
|
140
140
|
|
|
141
141
|
/**
|
|
142
142
|
* Naively splits an SQL string into a sequence of queries. It
|
|
@@ -299,12 +299,12 @@ class WP_MySQL_Naive_Query_Stream {
|
|
|
299
299
|
return $this->state;
|
|
300
300
|
}
|
|
301
301
|
|
|
302
|
-
}`,
|
|
302
|
+
}`,At=async(e,{sql:t},o)=>{o==null||o.tracker.setCaption("Executing SQL Queries");const n=`/tmp/${N.randomFilename()}.sql`,l=`/tmp/${N.randomFilename()}.php`;await e.writeFile(n,new Uint8Array(await t.arrayBuffer())),await e.writeFile(l,new TextEncoder().encode(zs));const s=await e.documentRoot,r=N.phpVars({docroot:s,sqlFilename:n,streamClassFilename:l}),u=await e.run({code:`<?php
|
|
303
303
|
define('WP_SQLITE_AST_DRIVER', true);
|
|
304
|
-
require_once ${
|
|
304
|
+
require_once ${r.docroot} . '/wp-load.php';
|
|
305
305
|
|
|
306
306
|
// Load WP_MySQL_Naive_Query_Stream from the bundled file
|
|
307
|
-
require_once ${
|
|
307
|
+
require_once ${r.streamClassFilename};
|
|
308
308
|
|
|
309
309
|
global $wpdb;
|
|
310
310
|
|
|
@@ -313,7 +313,7 @@ class WP_MySQL_Naive_Query_Stream {
|
|
|
313
313
|
$stream = new WP_MySQL_Naive_Query_Stream();
|
|
314
314
|
|
|
315
315
|
// Open the SQL file for streaming
|
|
316
|
-
$handle = fopen(${
|
|
316
|
+
$handle = fopen(${r.sqlFilename}, 'r');
|
|
317
317
|
if (!$handle) {
|
|
318
318
|
throw new Exception('Failed to open SQL file');
|
|
319
319
|
}
|
|
@@ -343,9 +343,9 @@ class WP_MySQL_Naive_Query_Stream {
|
|
|
343
343
|
$query = $stream->get_query();
|
|
344
344
|
$wpdb->query($query);
|
|
345
345
|
}
|
|
346
|
-
`});return await
|
|
347
|
-
include ${
|
|
348
|
-
$site_options = ${
|
|
346
|
+
`});return await kr(e,{path:n}),await kr(e,{path:l}),u},qt=async(e,{request:t})=>{oe.logger.warn('Deprecated: The Blueprint step "request" is deprecated and will be removed in a future release.');const o=await e.request(t);if(o.httpStatusCode>399||o.httpStatusCode<200)throw oe.logger.warn("WordPress response was",{response:o}),new Error(`Request failed with status ${o.httpStatusCode}`);return o},Sr=async(e,{consts:t,method:o="define-before-run"})=>{switch(o){case"define-before-run":await Hs(e,t);break;case"rewrite-wp-config":{const n=await e.documentRoot,l=N.joinPaths(n,"/wp-config.php");await Or.defineWpConfigConstants(e,l,t);break}default:throw new Error(`Invalid method: ${o}`)}};async function Hs(e,t){for(const o in t)await e.defineConstant(o,t[o])}const Zr=async(e,{options:t})=>{const o=await e.documentRoot;await e.run({code:`<?php
|
|
347
|
+
include ${N.phpVar(o)} . '/wp-load.php';
|
|
348
|
+
$site_options = ${N.phpVar(t)};
|
|
349
349
|
$flush_rewrite_rules = (
|
|
350
350
|
is_array($site_options) &&
|
|
351
351
|
array_key_exists('permalink_structure', $site_options)
|
|
@@ -360,19 +360,19 @@ class WP_MySQL_Naive_Query_Stream {
|
|
|
360
360
|
flush_rewrite_rules(false);
|
|
361
361
|
}
|
|
362
362
|
echo "Success";
|
|
363
|
-
`})},
|
|
364
|
-
include ${
|
|
365
|
-
$meta = ${
|
|
363
|
+
`})},Nt=async(e,{meta:t,userId:o})=>{const n=await e.documentRoot;await e.run({code:`<?php
|
|
364
|
+
include ${N.phpVar(n)} . '/wp-load.php';
|
|
365
|
+
$meta = ${N.phpVar(t)};
|
|
366
366
|
foreach($meta as $name => $value) {
|
|
367
|
-
update_user_meta(${
|
|
367
|
+
update_user_meta(${N.phpVar(o)}, $name, $value);
|
|
368
368
|
}
|
|
369
|
-
`})},
|
|
369
|
+
`})},Gr="/tmp/wp-cli.phar",Ys={resource:"url",url:"https://playground.wordpress.net/wp-cli.phar"},Lt=async(e,t=Gr)=>{if(!await e.fileExists(t))throw new Error(`wp-cli.phar not found at ${t}.
|
|
370
370
|
You can enable wp-cli support by adding "wp-cli" to the list of extra libraries in your blueprint as follows:
|
|
371
371
|
{
|
|
372
372
|
"extraLibraries": [ "wp-cli" ]
|
|
373
373
|
}
|
|
374
374
|
Read more about it in the documentation.
|
|
375
|
-
https://wordpress.github.io/wordpress-playground/blueprints/data-format#extra-libraries`)},
|
|
375
|
+
https://wordpress.github.io/wordpress-playground/blueprints/data-format#extra-libraries`)},Qr=async(e,{command:t,wpCliPath:o=Gr})=>{await Lt(e,o);let n;if(typeof t=="string"?(t=t.trim(),n=Js(t)):n=t,n.shift()!=="wp")throw new Error('The first argument must be "wp".');let s=!1;const r=n.map(h=>h.startsWith("wordpress/")?(s=!0,`/${h}`):h);s&&oe.logger.error(`
|
|
376
376
|
The wp-cli step in your Blueprint refers to a relative path.
|
|
377
377
|
|
|
378
378
|
Playground recently changed the working directory from '/' to '/wordpress' to better mimic
|
|
@@ -397,7 +397,7 @@ Use:
|
|
|
397
397
|
}
|
|
398
398
|
|
|
399
399
|
This will ensure your code works reliably regardless of the current working directory.
|
|
400
|
-
`.trim());const
|
|
400
|
+
`.trim());const u=await e.documentRoot;await e.writeFile("/tmp/stdout",""),await e.writeFile("/tmp/stderr",""),await e.writeFile(N.joinPaths(u,"run-cli.php"),`<?php
|
|
401
401
|
// Set up the environment to emulate a shell script
|
|
402
402
|
// call.
|
|
403
403
|
|
|
@@ -409,8 +409,8 @@ This will ensure your code works reliably regardless of the current working dire
|
|
|
409
409
|
// Set the argv global.
|
|
410
410
|
$GLOBALS['argv'] = array_merge([
|
|
411
411
|
"/tmp/wp-cli.phar",
|
|
412
|
-
"--path=${
|
|
413
|
-
], ${
|
|
412
|
+
"--path=${u}"
|
|
413
|
+
], ${N.phpVar(r)});
|
|
414
414
|
|
|
415
415
|
// Provide stdin, stdout, stderr streams outside of
|
|
416
416
|
// the CLI SAPI.
|
|
@@ -418,10 +418,10 @@ This will ensure your code works reliably regardless of the current working dire
|
|
|
418
418
|
define('STDOUT', fopen('php://stdout', 'wb'));
|
|
419
419
|
define('STDERR', fopen('php://stderr', 'wb'));
|
|
420
420
|
|
|
421
|
-
require( ${
|
|
422
|
-
`);const
|
|
423
|
-
$_SERVER['HTTP_HOST'] = ${
|
|
424
|
-
`)),await
|
|
421
|
+
require( ${N.phpVar(o)} );
|
|
422
|
+
`);const f=await e.run({scriptPath:N.joinPaths(u,"run-cli.php")});if(f.exitCode!==0)throw new Error(f.errors);return f};function Js(e){let n=0,l="";const s=[];let r="";for(let u=0;u<e.length;u++){const f=e[u];n===0?f==='"'||f==="'"?(n=1,l=f):f.match(/\s/)?(r&&s.push(r),r=""):r+=f:n===1&&(f==="\\"?(u++,r+=e[u]):f===l?(n=0,l=""):r+=f)}return r&&s.push(r),s}const xt=async(e,{wpCliPath:t})=>{await Lt(e,t),await Sr(e,{consts:{WP_ALLOW_MULTISITE:1}});const o=new URL(await e.absoluteUrl);if(o.port!==""){let h=`The current host is ${o.host}, but WordPress multisites do not support custom ports.`;throw o.hostname==="localhost"&&(h+=" For development, you can set up a playground.test domain using the instructions at https://wordpress.github.io/wordpress-playground/contributing/code."),new Error(h)}const n=o.pathname.replace(/\/$/,"")+"/",l=`${o.protocol}//${o.hostname}${n}`;await Zr(e,{options:{siteurl:l,home:l}}),await Qr(e,{command:`wp core multisite-convert --base="${n}"`});const r=`${await e.documentRoot}/wp-config.php`,u=await e.readFileAsText(r);let f=u;u.includes("$_SERVER['HTTP_HOST']")||(f=u.replace(/^<\?php\s*/i,`<?php
|
|
423
|
+
$_SERVER['HTTP_HOST'] = ${N.phpVar(o.hostname)};
|
|
424
|
+
`)),await e.writeFile(r,f)},Ft=async(e,{fromPath:t,toPath:o})=>{(!t.startsWith("/")||!o.startsWith("/"))&&oe.logger.error(`
|
|
425
425
|
The cp() step in your Blueprint refers to a relative path.
|
|
426
426
|
|
|
427
427
|
Playground recently changed the working directory from '/' to '/wordpress' to better mimic
|
|
@@ -435,7 +435,7 @@ Instead of: cp({ fromPath: 'wordpress/wp-load.php', toPath: 'wordpress/wp-load.
|
|
|
435
435
|
Use: cp({ fromPath: '/wordpress/wp-load.php', toPath: '/wordpress/wp-load.php' });
|
|
436
436
|
|
|
437
437
|
This will ensure your code works reliably regardless of the current working directory.
|
|
438
|
-
`.trim()),t.startsWith("/")||(t=`/${t}`),
|
|
438
|
+
`.trim()),t.startsWith("/")||(t=`/${t}`),o.startsWith("/")||(o=`/${o}`),await e.writeFile(o,await e.readFileAsBuffer(t))},Ct=async(e,{fromPath:t,toPath:o})=>{(!t.startsWith("/")||!o.startsWith("/"))&&oe.logger.error(`
|
|
439
439
|
The mv() step in your Blueprint refers to a relative path.
|
|
440
440
|
|
|
441
441
|
Playground recently changed the working directory from '/' to '/wordpress' to better mimic
|
|
@@ -449,7 +449,7 @@ Instead of: mv({ fromPath: 'wordpress/wp-load.php', toPath: 'wordpress/wp-load.
|
|
|
449
449
|
Use: mv({ fromPath: '/wordpress/wp-load.php', toPath: '/wordpress/wp-load.php' });
|
|
450
450
|
|
|
451
451
|
This will ensure your code works reliably regardless of the current working directory.
|
|
452
|
-
`.trim()),t.startsWith("/")||(t=`/${t}`),
|
|
452
|
+
`.trim()),t.startsWith("/")||(t=`/${t}`),o.startsWith("/")||(o=`/${o}`),await e.mv(t,o)},It=async(e,{path:t})=>{t.startsWith("/")||oe.logger.error(`
|
|
453
453
|
The mkdir() step in your Blueprint refers to a relative path.
|
|
454
454
|
|
|
455
455
|
Playground recently changed the working directory from '/' to '/wordpress' to better mimic
|
|
@@ -463,7 +463,7 @@ Instead of: mkdir({ path: 'wordpress/my-new-folder' });
|
|
|
463
463
|
Use: mkdir({ path: '/wordpress/my-new-folder' });
|
|
464
464
|
|
|
465
465
|
This will ensure your code works reliably regardless of the current working directory.
|
|
466
|
-
`.trim()),await
|
|
466
|
+
`.trim()),await e.mkdir(t)},Ut=async(e,{path:t})=>{t.startsWith("/")||(oe.logger.error(`
|
|
467
467
|
The rmdir() step in your Blueprint refers to a relative path.
|
|
468
468
|
|
|
469
469
|
Playground recently changed the working directory from '/' to '/wordpress' to better mimic
|
|
@@ -477,7 +477,7 @@ Instead of: rmdir({ path: 'wordpress/wp-load.php' });
|
|
|
477
477
|
Use: rmdir({ path: '/wordpress/wp-load.php' });
|
|
478
478
|
|
|
479
479
|
This will ensure your code works reliably regardless of the current working directory.
|
|
480
|
-
`.trim()),t=`/${t}`),await
|
|
480
|
+
`.trim()),t=`/${t}`),await e.rmdir(t)},jr=async(e,{path:t,data:o})=>{o instanceof File&&(o=new Uint8Array(await o.arrayBuffer())),t.startsWith("/")||(oe.logger.error(`
|
|
481
481
|
The writeFile() step in your Blueprint refers to a relative path.
|
|
482
482
|
|
|
483
483
|
Playground recently changed the working directory from '/' to '/wordpress' to better mimic
|
|
@@ -491,7 +491,7 @@ Instead of: writeFile({ path: 'wordpress/wp-load.php', data: '<?php echo "Hello
|
|
|
491
491
|
Use: writeFile({ path: '/wordpress/wp-load.php', data: '<?php echo "Hello World!"; ?>' });
|
|
492
492
|
|
|
493
493
|
This will ensure your code works reliably regardless of the current working directory.
|
|
494
|
-
`.trim()),t=`/${t}`),t.startsWith("/wordpress/wp-content/mu-plugins")&&!await
|
|
494
|
+
`.trim()),t=`/${t}`),t.startsWith("/wordpress/wp-content/mu-plugins")&&!await e.fileExists("/wordpress/wp-content/mu-plugins")&&await e.mkdir("/wordpress/wp-content/mu-plugins"),await e.writeFile(t,o)},Bt=async(e,{writeToPath:t,filesTree:o})=>{t.startsWith("/")||(oe.logger.error(`
|
|
495
495
|
The writeFiles() step in your Blueprint refers to a relative path.
|
|
496
496
|
|
|
497
497
|
Playground recently changed the working directory from '/' to '/wordpress' to better mimic
|
|
@@ -505,7 +505,7 @@ Instead of: writeFiles({ writeToPath: 'wordpress/wp-content/plugins/my-plugin',
|
|
|
505
505
|
Use: writeFiles({ writeToPath: '/wordpress/wp-content/plugins/my-plugin', filesTree: { name: 'style.css': 'a { color: red; }' });
|
|
506
506
|
|
|
507
507
|
This will ensure your code works reliably regardless of the current working directory.
|
|
508
|
-
`.trim()),t=`/${t}`),await
|
|
508
|
+
`.trim()),t=`/${t}`),await ke.writeFiles(e,t,o.files)},Xr=async(e,{siteUrl:t})=>{await Sr(e,{consts:{WP_HOME:t,WP_SITEURL:t}})},Wt=async(e,{file:t,fetchAttachments:o=!0,rewriteUrls:n=!0,urlMapping:l={},importComments:s=!0,defaultAuthorUsername:r="admin",authorsMode:u="default-author",authorsMap:f={},importUsers:h=!1},y)=>{const m=r.trim()||"admin";await Zs(e,t,y,{fetchAttachments:o,rewriteUrls:n,urlMapping:l,importComments:s,fallbackAuthorUsername:m,authorsMode:u,authorsMap:f,importUsers:h})};async function Zs(e,t,o,n){var l;(l=o==null?void 0:o.tracker)==null||l.setCaption("Importing content"),await jr(e,{path:"/tmp/import.wxr",data:t}),await e.run({$_SERVER:{HTTPS:(await e.absoluteUrl).startsWith("https://")?"on":""},code:`<?php
|
|
509
509
|
define('WP_LOAD_IMPORTERS', true);
|
|
510
510
|
require 'wp-load.php';
|
|
511
511
|
require 'wp-admin/includes/admin.php';
|
|
@@ -535,9 +535,37 @@ This will ensure your code works reliably regardless of the current working dire
|
|
|
535
535
|
|
|
536
536
|
$wp_import = new WP_Import();
|
|
537
537
|
$import_data = $wp_import->parse( getenv('IMPORT_FILE') );
|
|
538
|
+
$authors_map = json_decode(getenv('AUTHORS_MAP') ?: '{}', true);
|
|
539
|
+
if (!is_array($authors_map)) {
|
|
540
|
+
throw new Exception('Invalid WXR authors map payload.');
|
|
541
|
+
}
|
|
538
542
|
|
|
539
543
|
// Prepare the data to be used in process_author_mapping();
|
|
540
544
|
$wp_import->get_authors_from_import( $import_data );
|
|
545
|
+
$author_mapping_form = blueprint_prepare_wxr_author_mapping(
|
|
546
|
+
$wp_import->authors,
|
|
547
|
+
getenv('AUTHORS_MODE') ?: 'default-author',
|
|
548
|
+
$authors_map,
|
|
549
|
+
getenv('IMPORT_USERS') === 'true',
|
|
550
|
+
(int) $fallback_author->ID
|
|
551
|
+
);
|
|
552
|
+
|
|
553
|
+
$url_mapping_payload = getenv('URL_MAPPING') ?: '{}';
|
|
554
|
+
$url_mapping = json_decode($url_mapping_payload, true);
|
|
555
|
+
if (!is_array($url_mapping)) {
|
|
556
|
+
throw new Exception(
|
|
557
|
+
sprintf(
|
|
558
|
+
'Invalid WXR URL mapping payload (%d bytes): %s.',
|
|
559
|
+
strlen($url_mapping_payload),
|
|
560
|
+
json_last_error_msg()
|
|
561
|
+
)
|
|
562
|
+
);
|
|
563
|
+
}
|
|
564
|
+
if (!empty($url_mapping) && getenv('REWRITE_URLS') === 'true') {
|
|
565
|
+
add_filter('wp_import_post_data_raw', function($post) use ($url_mapping) {
|
|
566
|
+
return blueprint_apply_wxr_url_mapping($post, $url_mapping);
|
|
567
|
+
});
|
|
568
|
+
}
|
|
541
569
|
|
|
542
570
|
if (getenv('IMPORT_COMMENTS') === 'false') {
|
|
543
571
|
add_filter('wp_import_post_comments', '__return_empty_array');
|
|
@@ -555,8 +583,9 @@ This will ensure your code works reliably regardless of the current working dire
|
|
|
555
583
|
'step' => 2,
|
|
556
584
|
);
|
|
557
585
|
$_POST = array(
|
|
558
|
-
'imported_authors' =>
|
|
559
|
-
'user_map' =>
|
|
586
|
+
'imported_authors' => $author_mapping_form['imported_authors'],
|
|
587
|
+
'user_map' => $author_mapping_form['user_map'],
|
|
588
|
+
'user_new' => $author_mapping_form['user_new'],
|
|
560
589
|
'fetch_attachments' => $wp_import->fetch_attachments,
|
|
561
590
|
);
|
|
562
591
|
|
|
@@ -564,7 +593,95 @@ This will ensure your code works reliably regardless of the current working dire
|
|
|
564
593
|
$wp_import->import( getenv('IMPORT_FILE'), [
|
|
565
594
|
'rewrite_urls' => getenv('REWRITE_URLS') === 'true',
|
|
566
595
|
] );
|
|
567
|
-
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* Builds the importer form payload for WXR author assignment.
|
|
599
|
+
*/
|
|
600
|
+
function blueprint_prepare_wxr_author_mapping(
|
|
601
|
+
array $authors,
|
|
602
|
+
string $authors_mode,
|
|
603
|
+
array $authors_map,
|
|
604
|
+
bool $import_users,
|
|
605
|
+
int $fallback_author_id
|
|
606
|
+
): array {
|
|
607
|
+
$imported_authors = array();
|
|
608
|
+
$user_map = array();
|
|
609
|
+
$user_new = array();
|
|
610
|
+
|
|
611
|
+
foreach ($authors as $index => $author) {
|
|
612
|
+
$remote_username = $author['author_login'] ?? '';
|
|
613
|
+
if (!is_string($remote_username) || $remote_username === '') {
|
|
614
|
+
continue;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
$imported_authors[$index] = $remote_username;
|
|
618
|
+
if (array_key_exists($remote_username, $authors_map)) {
|
|
619
|
+
$user_map[$index] = blueprint_wxr_author_id_for_username(
|
|
620
|
+
$authors_map[$remote_username],
|
|
621
|
+
$remote_username
|
|
622
|
+
);
|
|
623
|
+
continue;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
if ($authors_mode === 'map') {
|
|
627
|
+
throw new Exception(
|
|
628
|
+
sprintf('Missing local user mapping for WXR author "%s".', $remote_username)
|
|
629
|
+
);
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
if ($authors_mode === 'create' && $import_users) {
|
|
633
|
+
$user_new[$index] = $remote_username;
|
|
634
|
+
continue;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
$user_map[$index] = $fallback_author_id;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
return array(
|
|
641
|
+
'imported_authors' => $imported_authors,
|
|
642
|
+
'user_map' => $user_map,
|
|
643
|
+
'user_new' => $user_new,
|
|
644
|
+
);
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* Finds the local user ID for an explicit WXR author map entry.
|
|
649
|
+
*/
|
|
650
|
+
function blueprint_wxr_author_id_for_username(string $local_username, string $remote_username): int {
|
|
651
|
+
if ($local_username === '') {
|
|
652
|
+
throw new Exception(
|
|
653
|
+
sprintf('Invalid local user mapping for WXR author "%s".', $remote_username)
|
|
654
|
+
);
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
$local_user = get_user_by('login', $local_username);
|
|
658
|
+
if (!$local_user) {
|
|
659
|
+
throw new Exception(
|
|
660
|
+
sprintf(
|
|
661
|
+
'Could not find local user "%s" mapped from WXR author "%s".',
|
|
662
|
+
$local_username,
|
|
663
|
+
$remote_username
|
|
664
|
+
)
|
|
665
|
+
);
|
|
666
|
+
}
|
|
667
|
+
return (int) $local_user->ID;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* Applies explicit Blueprint URL replacements to parsed WXR data.
|
|
672
|
+
*/
|
|
673
|
+
function blueprint_apply_wxr_url_mapping($value, array $url_mapping) {
|
|
674
|
+
if (is_string($value)) {
|
|
675
|
+
return strtr($value, $url_mapping);
|
|
676
|
+
}
|
|
677
|
+
if (is_array($value)) {
|
|
678
|
+
foreach ($value as $key => $item) {
|
|
679
|
+
$value[$key] = blueprint_apply_wxr_url_mapping($item, $url_mapping);
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
return $value;
|
|
683
|
+
}
|
|
684
|
+
`,env:{IMPORT_FILE:"/tmp/import.wxr",FETCH_ATTACHMENTS:n.fetchAttachments?"true":"false",REWRITE_URLS:n.rewriteUrls?"true":"false",URL_MAPPING:JSON.stringify(n.urlMapping),IMPORT_COMMENTS:n.importComments?"true":"false",FALLBACK_AUTHOR_USERNAME:n.fallbackAuthorUsername,AUTHORS_MODE:n.authorsMode,AUTHORS_MAP:JSON.stringify(n.authorsMap),IMPORT_USERS:n.importUsers?"true":"false"}})}const Kr=async(e,{themeSlug:t=""},o)=>{var l;(l=o==null?void 0:o.tracker)==null||l.setCaption("Importing theme starter content");const n=await e.documentRoot;await e.run({code:`<?php
|
|
568
685
|
|
|
569
686
|
/**
|
|
570
687
|
* Ensure that the customizer loads as an admin user.
|
|
@@ -587,7 +704,7 @@ This will ensure your code works reliably regardless of the current working dire
|
|
|
587
704
|
* See _wp_customize_include()
|
|
588
705
|
*/
|
|
589
706
|
$_REQUEST['wp_customize'] = 'on';
|
|
590
|
-
$_REQUEST['customize_theme'] = ${
|
|
707
|
+
$_REQUEST['customize_theme'] = ${N.phpVar(t)} ?: get_stylesheet();
|
|
591
708
|
|
|
592
709
|
/*
|
|
593
710
|
* Claim this is a ajax request saving settings, to avoid the preview filters being applied.
|
|
@@ -599,7 +716,7 @@ This will ensure your code works reliably regardless of the current working dire
|
|
|
599
716
|
}
|
|
600
717
|
playground_add_filter( 'plugins_loaded', 'importThemeStarterContent_plugins_loaded', 0 );
|
|
601
718
|
|
|
602
|
-
require ${
|
|
719
|
+
require ${N.phpVar(n)} . '/wp-load.php';
|
|
603
720
|
|
|
604
721
|
// Return early if there's no starter content.
|
|
605
722
|
if ( ! get_theme_starter_content() ) {
|
|
@@ -611,10 +728,10 @@ This will ensure your code works reliably regardless of the current working dire
|
|
|
611
728
|
|
|
612
729
|
// Publish the changeset, which publishes the starter content.
|
|
613
730
|
wp_publish_post( $wp_customize->changeset_post_id() );
|
|
614
|
-
`})},
|
|
731
|
+
`})},Ar=async(e,{zipFile:t,zipPath:o,extractToPath:n})=>{if(o)oe.logger.warn('The "zipPath" option of the unzip() Blueprint step is deprecated and will be removed. Use "zipFile" instead.');else if(!t)throw new Error("Either zipPath or zipFile must be provided");await Ge.unzipFile(e,t||o,n)},et=["db.php","plugins/akismet","plugins/hello.php","plugins/wordpress-importer","mu-plugins/sqlite-database-integration","mu-plugins/playground-includes","mu-plugins/0-playground.php","mu-plugins/0-sqlite.php","themes/twentytwenty","themes/twentytwentyone","themes/twentytwentytwo","themes/twentytwentythree","themes/twentytwentyfour","themes/twentytwentyfive","themes/twentytwentysix"],Dt=async(e,{wordPressFilesZip:t,pathInZip:o=""})=>{const n=await e.documentRoot,l=N.joinPaths("/tmp","import");await e.mkdir(l),await Ar(e,{zipFile:t,extractToPath:l});let s=N.joinPaths(l,o);s=await Ks(e,s)||s;const r=N.joinPaths(s,"playground-export.json");let u=null;if(await e.fileExists(r))try{const T=await e.readFileAsText(r);u=JSON.parse(T).siteUrl,await e.unlink(r)}catch{}const f=N.joinPaths(s,"wp-content"),h=N.joinPaths(n,"wp-content");for(const T of et){const _=N.joinPaths(f,T);await yt(e,_);const U=N.joinPaths(h,T);await e.fileExists(U)&&(await e.mkdir(N.dirname(_)),await e.mv(U,_))}const y=N.joinPaths(s,"wp-content","database");await e.fileExists(y)||await e.mv(N.joinPaths(n,"wp-content","database"),y);const m=await e.listFiles(s);for(const T of m)await yt(e,N.joinPaths(n,T)),await e.mv(N.joinPaths(s,T),N.joinPaths(n,T));await e.rmdir(l,{recursive:!0}),await Or.ensureWpConfig(e,n);const k=await e.absoluteUrl;u||(u=await Qs(e,n)),await Xr(e,{siteUrl:k});const O=N.phpVar(N.joinPaths(n,"wp-admin","upgrade.php"));await e.run({code:`<?php
|
|
615
732
|
$_GET['step'] = 'upgrade_db';
|
|
616
|
-
require ${
|
|
617
|
-
`}),
|
|
733
|
+
require ${O};
|
|
734
|
+
`}),u&&u!==k&&await Gs(e,n,u,k)};function dt(e){const t=e.match(/\/scope:[^/]+\/?/);return t?t[0].replace(/\/?$/,"/"):null}async function Gs(e,t,o,n){const l=dt(o),s=dt(n);!l||!s||l!==s&&await e.run({code:`<?php
|
|
618
735
|
require_once getenv('DOCUMENT_ROOT') . '/wp-load.php';
|
|
619
736
|
global $wpdb;
|
|
620
737
|
|
|
@@ -668,12 +785,12 @@ This will ensure your code works reliably regardless of the current working dire
|
|
|
668
785
|
"UPDATE {$wpdb->comments} SET comment_author_url = REPLACE(comment_author_url, %s, %s) WHERE comment_author_url LIKE %s",
|
|
669
786
|
$old_scope, $new_scope, '%' . $wpdb->esc_like($old_scope) . '%'
|
|
670
787
|
));
|
|
671
|
-
`,env:{DOCUMENT_ROOT:t,OLD_SCOPE:l,NEW_SCOPE:s}})}async function
|
|
672
|
-
require_once ${
|
|
788
|
+
`,env:{DOCUMENT_ROOT:t,OLD_SCOPE:l,NEW_SCOPE:s}})}async function Qs(e,t){const o=N.phpVars({documentRoot:t});return(await e.run({code:`<?php
|
|
789
|
+
require_once ${o.documentRoot} . '/wp-load.php';
|
|
673
790
|
global $wpdb;
|
|
674
791
|
$row = $wpdb->get_row("SELECT option_value FROM {$wpdb->options} WHERE option_name = 'siteurl'");
|
|
675
792
|
echo $row ? $row->option_value : '';
|
|
676
|
-
`})).text.trim()||null}async function
|
|
793
|
+
`})).text.trim()||null}const Xs=["wp-content","wp-admin","wp-includes","wp-config.php","wp-config-sample.php"];async function Ks(e,t){if(await mt(e,t))return t;const o=await e.listFiles(t);if(o.length!==1)return null;const n=N.joinPaths(t,o[0]);return await e.isDir(n)&&await mt(e,n)?n:null}async function mt(e,t){for(const o of Xs)if(await e.fileExists(N.joinPaths(t,o)))return!0;return!1}async function yt(e,t){await e.fileExists(t)&&(await e.isDir(t)?await e.rmdir(t):await e.unlink(t))}async function Mt(e){const t=await e.request({url:"/wp-admin/export.php?download=true&content=all"});return new File([t.bytes],"export.xml")}async function Vt(e,{targetPath:t,zipFile:o,ifAlreadyInstalled:n="overwrite",targetFolderName:l=""}){const r=o.name.replace(/\.zip$/,""),u=N.joinPaths(await e.documentRoot,"wp-content"),f=N.joinPaths(u,N.randomFilename()),h=N.joinPaths(f,"assets",r);await e.fileExists(h)&&await e.rmdir(f,{recursive:!0}),await e.mkdir(f);try{await Ar(e,{zipFile:o,extractToPath:h});let y=await e.listFiles(h,{prependPath:!0});y=y.filter(_=>!_.endsWith("/__MACOSX"));const m=y.length===1&&await e.isDir(y[0]);let k,O="";m?(O=y[0],k=y[0].split("/").pop()):(O=h,k=r),l&&l.length&&(k=l);const T=`${t}/${k}`;if(await e.fileExists(T)){if(!await e.isDir(T))throw new Error(`Cannot install asset ${k} to ${T} because a file with the same name already exists. Note it's a file, not a directory! Is this by mistake?`);if(n==="overwrite")await e.rmdir(T,{recursive:!0});else{if(n==="skip")return{assetFolderPath:T,assetFolderName:k};throw new Error(`Cannot install asset ${k} to ${t} because it already exists and the ifAlreadyInstalled option was set to ${n}`)}}return await e.mv(O,T),{assetFolderPath:T,assetFolderName:k}}finally{await e.rmdir(f,{recursive:!0})}}const Dr="PLAYGROUND_ACTIVATION_OPTIONS:",zt=async(e,{pluginData:t,pluginZipFile:o,ifAlreadyInstalled:n,options:l={}},s)=>{o&&(t=o,oe.logger.warn('The "pluginZipFile" option is deprecated. Use "pluginData" instead.'));let r="",u="";const f=()=>l.humanReadableName||u,h=async y=>{if(y.name.toLowerCase().endsWith(".zip"))return!0;const m=new Uint8Array(await y.arrayBuffer(),0,4);return m[0]===80&&m[1]===75&&m[2]===3&&m[3]===4};try{const y=N.joinPaths(await e.documentRoot,"wp-content","plugins"),m="targetFolderName"in l?l.targetFolderName:"";if(t instanceof File)if(await h(t)){const O=t.name.split("/").pop()||"plugin.zip";u=Rr(O),s==null||s.tracker.setCaption(`Installing the ${f()} plugin`);const T=await Vt(e,{ifAlreadyInstalled:n,zipFile:t,targetPath:`${await e.documentRoot}/wp-content/plugins`,targetFolderName:m});r=T.assetFolderPath,u=T.assetFolderName}else if(t.name.endsWith(".php")){const O=N.joinPaths(y,t.name);await jr(e,{path:O,data:t}),r=O,u=t.name}else throw new Error("pluginData looks like a file but does not look like a .zip or .php file.");else if(t){u=t.name,s==null||s.tracker.setCaption(`Installing the ${f()} plugin`);const O=N.joinPaths(y,m||t.name);await ke.writeFiles(e,O,t.files,{rmRoot:!0}),r=O}if("activate"in l?l.activate:!0){let O;l.activationOptions!==void 0&&(O=await ei(e,r,l.activationOptions));try{await Yr(e,{pluginPath:r,pluginName:f()},s)}finally{O&&await ri(e,O)}}}catch(y){if(l.onError==="skip-plugin"){const m=f()||"unknown plugin";oe.logger.warn(`Skipping plugin installation for ${m} after failure: ${y instanceof Error?y.message:String(y)}`);return}throw y}};async function ei(e,t,o){const n=await e.documentRoot,l=await e.run({code:`<?php
|
|
677
794
|
ob_start();
|
|
678
795
|
define('WP_ADMIN', true);
|
|
679
796
|
require_once getenv('DOCROOT') . "/wp-load.php";
|
|
@@ -721,28 +838,81 @@ ob_end_clean();
|
|
|
721
838
|
// Prefix the JSON payload so JS can find it even if plugin bootstrap
|
|
722
839
|
// code prints notices or other output during this request.
|
|
723
840
|
echo $payload_prefix . json_encode(array('optionName' => $option_name));
|
|
724
|
-
`,env:{DOCROOT:
|
|
841
|
+
`,env:{DOCROOT:n,PLUGIN_PATH:t,ACTIVATION_OPTIONS_JSON:JSON.stringify(o),ACTIVATION_OPTIONS_PAYLOAD_PREFIX:Dr}}),s=ti(l.text);if(s!=null&&s.error)throw new Error(String(s.error));if(!(s!=null&&s.optionName)||typeof s.optionName!="string")throw new Error("Could not determine plugin activation options name.");return s.optionName}async function ri(e,t){await e.run({code:`<?php
|
|
725
842
|
require_once getenv('DOCROOT') . "/wp-load.php";
|
|
726
843
|
delete_option(getenv('OPTION_NAME'));
|
|
727
|
-
`,env:{DOCROOT:await
|
|
844
|
+
`,env:{DOCROOT:await e.documentRoot,OPTION_NAME:t}})}function ti(e){const t=e||"",o=t.lastIndexOf(Dr);if(o===-1)return;const n=t.slice(o+Dr.length).trimStart().split(/\r?\n/,1)[0].trim();if(n)try{return JSON.parse(n)}catch{throw new Error("Could not parse plugin activation options payload.")}}const Ht=async(e,{themeData:t,themeZipFile:o,ifAlreadyInstalled:n,options:l={}},s)=>{o&&(t=o,oe.logger.warn('The "themeZipFile" option is deprecated. Use "themeData" instead.'));const r=l.onError??"throw";let u="";const f=()=>l.humanReadableName||u;try{const h="targetFolderName"in l?l.targetFolderName:"";let y="";if(t instanceof File){const O=t.name.split("/").pop()||"theme.zip";u=Rr(O),s==null||s.tracker.setCaption(`Installing the ${f()} theme`),y=(await Vt(e,{ifAlreadyInstalled:n,zipFile:t,targetPath:`${await e.documentRoot}/wp-content/themes`,targetFolderName:h})).assetFolderName}else{if(u=t.name,y=h||u,!y||N.basename(y)!==y)throw new Error("Theme folder name must be a single directory name.");s==null||s.tracker.setCaption(`Installing the ${f()} theme`);const O=N.joinPaths(await e.documentRoot,"wp-content","themes",y);let T=!0;if(await e.fileExists(O)){if(!await e.isDir(O))throw new Error(`Cannot install theme ${y} to ${O} because a file with the same name already exists. Note it's a file, not a directory! Is this by mistake?`);if((n??"overwrite")==="skip")T=!1;else if(n==="error")throw new Error(`Cannot install theme ${y} to ${O} because it already exists and the ifAlreadyInstalled option was set to ${n}`)}T&&await ke.writeFiles(e,O,t.files,{rmRoot:!0})}("activate"in l?l.activate:!0)&&await Jr(e,{themeFolderName:y},s),("importStarterContent"in l?l.importStarterContent:!1)&&await Kr(e,{themeSlug:y},s)}catch(h){if(r==="skip-theme"){const y=f()||"unknown theme";oe.logger.warn(`Skipping theme installation for ${y} after failure: ${h instanceof Error?h.message:String(h)}`);return}throw h}},Yt=async(e,{username:t="admin"}={},o)=>{o==null||o.tracker.setCaption((o==null?void 0:o.initialCaption)||"Logging in"),e.defineConstant("PLAYGROUND_AUTO_LOGIN_AS_USER",t)},Jt=async(e,t,o)=>{var h;(h=o==null?void 0:o.tracker)==null||h.setCaption("Resetting WordPress data");const n=await e.documentRoot,l=new Set(t.contentTypes??[]),s=t.contentTypes===void 0,r=[l.has("posts")?"post":void 0,l.has("pages")?"page":void 0].filter(y=>y!==void 0),u=s||l.has("posts"),f=l.has("comments");await e.run({env:{DOCROOT:n,PLAYGROUND_RESET_ALL_POST_TYPES:s?"1":"0",PLAYGROUND_RESET_POST_TYPES:JSON.stringify(r),PLAYGROUND_RESET_POSTS:u?"1":"0",PLAYGROUND_RESET_COMMENTS:s||f?"1":"0"},code:`<?php
|
|
728
845
|
require getenv('DOCROOT') . '/wp-load.php';
|
|
729
846
|
|
|
730
|
-
$
|
|
731
|
-
$
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
847
|
+
$remove_all_post_types = getenv('PLAYGROUND_RESET_ALL_POST_TYPES') === '1';
|
|
848
|
+
$post_types = json_decode(getenv('PLAYGROUND_RESET_POST_TYPES'), true);
|
|
849
|
+
if (!is_array($post_types)) {
|
|
850
|
+
throw new RuntimeException('Invalid post types passed to resetData.');
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
if ($remove_all_post_types) {
|
|
854
|
+
$post_ids = $wpdb->get_col(
|
|
855
|
+
"SELECT ID FROM {$wpdb->posts} ORDER BY ID DESC"
|
|
856
|
+
);
|
|
857
|
+
} elseif (count($post_types) > 0) {
|
|
858
|
+
$placeholders = implode(', ', array_fill(0, count($post_types), '%s'));
|
|
859
|
+
$post_ids = $wpdb->get_col($wpdb->prepare(
|
|
860
|
+
"SELECT ID FROM {$wpdb->posts} " .
|
|
861
|
+
"WHERE post_type IN ($placeholders) ORDER BY ID DESC",
|
|
862
|
+
...$post_types
|
|
863
|
+
));
|
|
864
|
+
} else {
|
|
865
|
+
$post_ids = [];
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
foreach ($post_ids as $post_id) {
|
|
869
|
+
wp_delete_post((int) $post_id, true);
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
// WordPress refreshes this cache before deleting the post row, so removing
|
|
873
|
+
// the last published post leaves the cache set to true.
|
|
874
|
+
if (getenv('PLAYGROUND_RESET_POSTS') === '1') {
|
|
875
|
+
delete_option('wp_calendar_block_has_published_posts');
|
|
876
|
+
}
|
|
735
877
|
|
|
736
|
-
$
|
|
737
|
-
$
|
|
878
|
+
$remove_comments = getenv('PLAYGROUND_RESET_COMMENTS') === '1';
|
|
879
|
+
if ($remove_comments) {
|
|
880
|
+
$comment_ids = $wpdb->get_col(
|
|
881
|
+
"SELECT comment_ID FROM {$wpdb->comments}"
|
|
882
|
+
);
|
|
883
|
+
foreach ($comment_ids as $comment_id) {
|
|
884
|
+
wp_delete_comment((int) $comment_id, true);
|
|
885
|
+
}
|
|
886
|
+
}
|
|
738
887
|
|
|
739
|
-
$
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
'
|
|
745
|
-
|
|
888
|
+
$reset_sequence_if_empty = static function($table_name) use ($wpdb) {
|
|
889
|
+
$count = $wpdb->get_var("SELECT COUNT(*) FROM {$table_name}");
|
|
890
|
+
if ((int) $count !== 0) {
|
|
891
|
+
return;
|
|
892
|
+
}
|
|
893
|
+
if (isset($GLOBALS['@pdo'])) {
|
|
894
|
+
$statement = $GLOBALS['@pdo']->prepare(
|
|
895
|
+
'DELETE FROM SQLITE_SEQUENCE WHERE NAME = :table_name'
|
|
896
|
+
);
|
|
897
|
+
$statement->execute([':table_name' => $table_name]);
|
|
898
|
+
return;
|
|
899
|
+
}
|
|
900
|
+
$wpdb->query("ALTER TABLE {$table_name} AUTO_INCREMENT = 1");
|
|
901
|
+
};
|
|
902
|
+
|
|
903
|
+
if ($remove_all_post_types || count($post_types) > 0) {
|
|
904
|
+
$reset_sequence_if_empty($wpdb->posts);
|
|
905
|
+
$reset_sequence_if_empty($wpdb->postmeta);
|
|
906
|
+
}
|
|
907
|
+
if ($remove_comments || $remove_all_post_types || count($post_types) > 0) {
|
|
908
|
+
$reset_sequence_if_empty($wpdb->comments);
|
|
909
|
+
$reset_sequence_if_empty($wpdb->commentmeta);
|
|
910
|
+
}
|
|
911
|
+
`})},Zt=async(e,{options:t})=>{await e.request({url:"/wp-admin/install.php?step=2",method:"POST",body:{language:"en",prefix:"wp_",weblog_title:"My WordPress Website",user_name:t.adminPassword||"admin",admin_password:t.adminPassword||"password",admin_password2:t.adminPassword||"password",Submit:"Install WordPress",pw_weak:"1",admin_email:"admin@localhost.com"}})},Gt=async(e,{selfContained:t=!1}={})=>{const o="/tmp/wordpress-playground.zip",n="/tmp/playground-export.json",l=await e.documentRoot,s=N.joinPaths(l,"wp-content"),r=await e.absoluteUrl;await e.writeFile(n,new TextEncoder().encode(JSON.stringify({siteUrl:r})));let u=et;t&&(u=u.filter(m=>!m.startsWith("themes/twenty")).filter(m=>m!=="mu-plugins/sqlite-database-integration"));const f={[n]:"playground-export.json"};t&&(f[N.joinPaths(l,"wp-config.php")]="wp-config.php");const h=N.phpVars({zipPath:o,wpContentPath:s,documentRoot:l,exceptPaths:u.map(m=>N.joinPaths(l,"wp-content",m)),additionalPaths:f});await ii(e,`zipDir(${h.wpContentPath}, ${h.zipPath}, array(
|
|
912
|
+
'exclude_paths' => ${h.exceptPaths},
|
|
913
|
+
'zip_root' => ${h.documentRoot},
|
|
914
|
+
'additional_paths' => ${h.additionalPaths}
|
|
915
|
+
));`);const y=await e.readFileAsBuffer(o);return e.unlink(o),e.unlink(n),y},si=`<?php
|
|
746
916
|
|
|
747
917
|
function zipDir($root, $output, $options = array())
|
|
748
918
|
{
|
|
@@ -802,15 +972,15 @@ function join_paths()
|
|
|
802
972
|
|
|
803
973
|
return preg_replace('#/+#', '/', join('/', $paths));
|
|
804
974
|
}
|
|
805
|
-
`;async function
|
|
806
|
-
require_once ${
|
|
807
|
-
update_option('WPLANG', ${
|
|
808
|
-
`});const l=(await
|
|
809
|
-
require '${
|
|
975
|
+
`;async function ii(e,t){return await e.run({code:si+t})}const oi=async(e,t)=>{const l=(await(await fetch(`https://api.wordpress.org/translations/core/1.0/?version=${e}`)).json()).translations.find(s=>s.language.toLowerCase()===t.toLowerCase());if(!l)throw new Error(`Failed to get ${t} translation package for WordPress ${e}.`);return l.package},Qt=async(e,{language:t},o)=>{o==null||o.tracker.setCaption((o==null?void 0:o.initialCaption)||"Translating");const n=await e.documentRoot;await e.defineConstant("WPLANG",t),await e.run({code:`<?php
|
|
976
|
+
require_once ${N.phpVar(n)} . '/wp-load.php';
|
|
977
|
+
update_option('WPLANG', ${N.phpVar(t)});
|
|
978
|
+
`});const l=(await e.run({code:`<?php
|
|
979
|
+
require '${n}/wp-includes/version.php';
|
|
810
980
|
echo $wp_version;
|
|
811
|
-
`})).text,s=[{url:await
|
|
812
|
-
require_once('${
|
|
813
|
-
require_once('${
|
|
981
|
+
`})).text,s=[{url:await oi(l,t),type:"core"}],u=(await e.run({code:`<?php
|
|
982
|
+
require_once('${n}/wp-load.php');
|
|
983
|
+
require_once('${n}/wp-admin/includes/plugin.php');
|
|
814
984
|
echo json_encode(
|
|
815
985
|
array_values(
|
|
816
986
|
array_map(
|
|
@@ -828,9 +998,9 @@ function join_paths()
|
|
|
828
998
|
)
|
|
829
999
|
)
|
|
830
1000
|
)
|
|
831
|
-
);`})).json;for(const{slug:
|
|
832
|
-
require_once('${
|
|
833
|
-
require_once('${
|
|
1001
|
+
);`})).json;for(const{slug:k,version:O}of u)s.push({url:`https://downloads.wordpress.org/translation/plugin/${k}/${O}/${t}.zip`,type:"plugin"});const h=(await e.run({code:`<?php
|
|
1002
|
+
require_once('${n}/wp-load.php');
|
|
1003
|
+
require_once('${n}/wp-admin/includes/theme.php');
|
|
834
1004
|
echo json_encode(
|
|
835
1005
|
array_values(
|
|
836
1006
|
array_map(
|
|
@@ -843,107 +1013,760 @@ function join_paths()
|
|
|
843
1013
|
wp_get_themes()
|
|
844
1014
|
)
|
|
845
1015
|
)
|
|
846
|
-
);`})).json;for(const{slug:
|
|
1016
|
+
);`})).json;for(const{slug:k,version:O}of h)s.push({url:`https://downloads.wordpress.org/translation/theme/${k}/${O}/${t}.zip`,type:"theme"});await e.isDir(`${n}/wp-content/languages/plugins`)||await e.mkdir(`${n}/wp-content/languages/plugins`),await e.isDir(`${n}/wp-content/languages/themes`)||await e.mkdir(`${n}/wp-content/languages/themes`);const y=new N.Semaphore({concurrency:5}),m=s.map(({url:k,type:O})=>y.run(async()=>{try{const T=await fetch(k);if(!T.ok)throw new Error(`Failed to download translations for ${O}: ${T.statusText}`);let _=`${n}/wp-content/languages`;O==="plugin"?_+="/plugins":O==="theme"&&(_+="/themes"),await Ge.unzipFile(e,new File([await T.arrayBuffer()],`${t}-${O}.zip`),_)}catch(T){if(O==="core")throw new Error(`Failed to download translations for WordPress. Please check if the language code ${t} is correct. You can find all available languages and translations on https://translate.wordpress.org/.`);oe.logger.warn(`Error downloading translations for ${O}: ${T}`)}}));await Promise.all(m)},ni=Object.freeze(Object.defineProperty({__proto__:null,activatePlugin:Yr,activateTheme:Jr,cp:Ft,defineSiteUrl:Xr,defineWpConfigConsts:Sr,enableMultisite:xt,exportWXR:Mt,importThemeStarterContent:Kr,importWordPressFiles:Dt,importWxr:Wt,installPlugin:zt,installTheme:Ht,login:Yt,mkdir:It,mv:Ct,request:qt,resetData:Jt,rm:kr,rmdir:Ut,runPHP:St,runPHPWithOptions:jt,runSql:At,runWpInstallationWizard:Zt,setSiteLanguage:Qt,setSiteOptions:Zr,unzip:Ar,updateUserMeta:Nt,wpCLI:Qr,writeFile:jr,writeFiles:Bt,zipWpContent:Gt},Symbol.toStringTag,{value:"Module"})),ai={properties:{landingPage:{type:"string",description:"The URL to navigate to after the blueprint has been run."},description:{type:"string",description:"Optional description. It doesn't do anything but is exposed as a courtesy to developers who may want to document which blueprint file does what.",deprecated:"Use meta.description instead."},meta:{type:"object",properties:{title:{type:"string",description:"A clear and concise name for your Blueprint."},description:{type:"string",description:"A brief explanation of what your Blueprint offers."},author:{type:"string",description:"A GitHub username of the author of this Blueprint."},categories:{type:"array",items:{type:"string"},description:"Relevant categories to help users find your Blueprint in the future Blueprints section on WordPress.org."}},required:["title","author"],additionalProperties:!1,description:"Optional metadata. Used by the Blueprints gallery at https://github.com/WordPress/blueprints"},preferredVersions:{type:"object",properties:{php:{anyOf:[{$ref:"#/definitions/BlueprintPHPVersion"},{type:"string",const:"latest"}],description:`The preferred PHP version to use. If not specified, the latest supported version will be used.
|
|
847
1017
|
|
|
848
|
-
Note: PHP 7.2 and 7.3 are deprecated and will be automatically upgraded to 7.4.`},wp:{anyOf:[{type:"string"},{type:"string",const:"latest"},{type:"boolean",const:!1}],description:"The preferred WordPress version to use, or `false` to boot a PHP-only Playground without downloading or installing WordPress. If not specified, the latest supported version will be used.\n\nWhen set to `false`, WordPress-specific Blueprint fields (`plugins`, `siteOptions`, `login`, and WordPress-only steps) are rejected at compile time."}},required:["php","wp"],additionalProperties:!1,description:"The preferred PHP and WordPress versions to use."},features:{type:"object",properties:{intl:{type:"boolean",description:"Should boot with support for Intl dynamic extension"},networking:{type:"boolean",description:"Should boot with support for network request via wp_safe_remote_get?"}},additionalProperties:!1},extraLibraries:{type:"array",items:{$ref:"#/definitions/ExtraLibrary"},description:"Extra libraries to preload into the Playground instance."},constants:{$ref:"#/definitions/PHPConstants",description:"PHP Constants to define on every request"},plugins:{type:"array",items:{anyOf:[{type:"string"},{$ref:"#/definitions/FileReference"}]},description:"WordPress plugins to install and activate"},siteOptions:{type:"object",additionalProperties:{type:"string"},properties:{blogname:{type:"string",description:"The site title"}},description:"WordPress site options to define"},login:{anyOf:[{type:"boolean"},{type:"object",properties:{username:{type:"string"},password:{type:"string"}},required:["username","password"],additionalProperties:!1}],description:"User to log in as. If true, logs the user in as admin/password."},phpExtensionBundles:{deprecated:"No longer used. Feel free to remove it from your Blueprint."},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"}}},Ts={additionalProperties:{type:["string","boolean","number"]}},_t=Object.prototype.hasOwnProperty,$s={enum:["8.5","8.4","8.3","8.2","8.1","8.0","7.4"]},js={enum:["5.2"]};function Ve(r,{instancePath:t="",parentData:n,parentDataProperty:p,rootData:l=r}={}){let s=null,e=0;const f=e;let d=!1;const g=e;if(typeof r!="string"){const h={instancePath:t,schemaPath:"#/definitions/PHPNextVersion/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[h]:s.push(h),e++}if(r!=="next"){const h={instancePath:t,schemaPath:"#/definitions/PHPNextVersion/const",keyword:"const",params:{allowedValue:"next"},message:"must be equal to constant"};s===null?s=[h]:s.push(h),e++}var y=g===e;if(d=d||y,!d){const h=e;if(typeof r!="string"){const k={instancePath:t,schemaPath:"#/definitions/SupportedPHPVersion/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[k]:s.push(k),e++}if(!(r==="8.5"||r==="8.4"||r==="8.3"||r==="8.2"||r==="8.1"||r==="8.0"||r==="7.4")){const k={instancePath:t,schemaPath:"#/definitions/SupportedPHPVersion/enum",keyword:"enum",params:{allowedValues:$s.enum},message:"must be equal to one of the allowed values"};s===null?s=[k]:s.push(k),e++}var y=h===e;if(d=d||y,!d){const k=e;if(typeof r!="string"){const b={instancePath:t,schemaPath:"#/definitions/LegacyPHPVersion/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[b]:s.push(b),e++}if(r!=="5.2"){const b={instancePath:t,schemaPath:"#/definitions/LegacyPHPVersion/enum",keyword:"enum",params:{allowedValues:js.enum},message:"must be equal to one of the allowed values"};s===null?s=[b]:s.push(b),e++}var y=k===e;d=d||y}}if(d)e=f,s!==null&&(f?s.length=f:s=null);else{const h={instancePath:t,schemaPath:"#/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[h]:s.push(h),e++,Ve.errors=s,!1}return Ve.errors=s,e===0}function Be(r,{instancePath:t="",parentData:n,parentDataProperty:p,rootData:l=r}={}){let s=null,e=0;const f=e;let d=!1;const g=e;Ve(r,{instancePath:t,parentData:n,parentDataProperty:p,rootData:l})||(s=s===null?Ve.errors:s.concat(Ve.errors),e=s.length);var y=g===e;if(d=d||y,!d){const h=e;if(typeof r!="string"){const k={instancePath:t,schemaPath:"#/anyOf/1/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[k]:s.push(k),e++}if(r!=="7.2"){const k={instancePath:t,schemaPath:"#/anyOf/1/const",keyword:"const",params:{allowedValue:"7.2"},message:"must be equal to constant"};s===null?s=[k]:s.push(k),e++}var y=h===e;if(d=d||y,!d){const k=e;if(typeof r!="string"){const b={instancePath:t,schemaPath:"#/anyOf/2/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[b]:s.push(b),e++}if(r!=="7.3"){const b={instancePath:t,schemaPath:"#/anyOf/2/const",keyword:"const",params:{allowedValue:"7.3"},message:"must be equal to constant"};s===null?s=[b]:s.push(b),e++}var y=k===e;d=d||y}}if(d)e=f,s!==null&&(f?s.length=f:s=null);else{const h={instancePath:t,schemaPath:"#/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[h]:s.push(h),e++,Be.errors=s,!1}return Be.errors=s,e===0}const Pr={validate:ee},As={enum:["branch","tag","commit","refname"]};function de(r,{instancePath:t="",parentData:n,parentDataProperty:p,rootData:l=r}={}){let s=null,e=0;if(r&&typeof r=="object"&&!Array.isArray(r)){let d;if(r.resource===void 0&&(d="resource")||r.url===void 0&&(d="url")||r.ref===void 0&&(d="ref"))return de.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;for(const g in r)if(!(g==="resource"||g==="url"||g==="ref"||g==="refType"||g==="path"||g===".git"))return de.errors=[{instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:g},message:"must NOT have additional properties"}],!1;{if(r.resource!==void 0){let g=r.resource;const y=e;if(typeof g!="string")return de.errors=[{instancePath:t+"/resource",schemaPath:"#/properties/resource/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(g!=="git:directory")return de.errors=[{instancePath:t+"/resource",schemaPath:"#/properties/resource/const",keyword:"const",params:{allowedValue:"git:directory"},message:"must be equal to constant"}],!1;var f=y===e}else var f=!0;if(f){if(r.url!==void 0){const g=e;if(typeof r.url!="string")return de.errors=[{instancePath:t+"/url",schemaPath:"#/properties/url/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var f=g===e}else var f=!0;if(f){if(r.ref!==void 0){const g=e;if(typeof r.ref!="string")return de.errors=[{instancePath:t+"/ref",schemaPath:"#/properties/ref/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var f=g===e}else var f=!0;if(f){if(r.refType!==void 0){let g=r.refType;const y=e;if(typeof g!="string")return de.errors=[{instancePath:t+"/refType",schemaPath:"#/definitions/GitDirectoryRefType/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(!(g==="branch"||g==="tag"||g==="commit"||g==="refname"))return de.errors=[{instancePath:t+"/refType",schemaPath:"#/definitions/GitDirectoryRefType/enum",keyword:"enum",params:{allowedValues:As.enum},message:"must be equal to one of the allowed values"}],!1;var f=y===e}else var f=!0;if(f){if(r.path!==void 0){const g=e;if(typeof r.path!="string")return de.errors=[{instancePath:t+"/path",schemaPath:"#/properties/path/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var f=g===e}else var f=!0;if(f)if(r[".git"]!==void 0){const g=e;if(typeof r[".git"]!="boolean")return de.errors=[{instancePath:t+"/.git",schemaPath:"#/properties/.git/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var f=g===e}else var f=!0}}}}}}else return de.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return de.errors=s,e===0}const qs={additionalProperties:{anyOf:[{$ref:"#/definitions/FileTree"},{type:["object","string"]}]}},_r={validate:Ie};function Ie(r,{instancePath:t="",parentData:n,parentDataProperty:p,rootData:l=r}={}){let s=null,e=0;if(e===0)if(r&&typeof r=="object"&&!Array.isArray(r))for(const g in r){let y=r[g];const h=e,E=e;let k=!1;const T=e;_r.validate(y,{instancePath:t+"/"+g.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:r,parentDataProperty:g,rootData:l})||(s=s===null?_r.validate.errors:s.concat(_r.validate.errors),e=s.length);var f=T===e;if(k=k||f,!k){const b=e;if(!(y&&typeof y=="object"&&!Array.isArray(y))&&typeof y!="string"){const X={instancePath:t+"/"+g.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/additionalProperties/anyOf/1/type",keyword:"type",params:{type:qs.additionalProperties.anyOf[1].type},message:"must be object,string"};s===null?s=[X]:s.push(X),e++}var f=b===e;k=k||f}if(k)e=E,s!==null&&(E?s.length=E:s=null);else{const b={instancePath:t+"/"+g.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/additionalProperties/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[b]:s.push(b),e++,Ie.errors=s,!1}var d=h===e;if(!d)break}else return Ie.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return Ie.errors=s,e===0}function je(r,{instancePath:t="",parentData:n,parentDataProperty:p,rootData:l=r}={}){let s=null,e=0;if(e===0)if(r&&typeof r=="object"&&!Array.isArray(r)){let d;if(r.files===void 0&&(d="files")||r.name===void 0&&(d="name")||r.resource===void 0&&(d="resource"))return je.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const g=e;for(const y in r)if(!(y==="resource"||y==="files"||y==="name"))return je.errors=[{instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:y},message:"must NOT have additional properties"}],!1;if(g===e){if(r.resource!==void 0){let y=r.resource;const h=e;if(typeof y!="string")return je.errors=[{instancePath:t+"/resource",schemaPath:"#/properties/resource/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(y!=="literal:directory")return je.errors=[{instancePath:t+"/resource",schemaPath:"#/properties/resource/const",keyword:"const",params:{allowedValue:"literal:directory"},message:"must be equal to constant"}],!1;var f=h===e}else var f=!0;if(f){if(r.files!==void 0){const y=e;Ie(r.files,{instancePath:t+"/files",parentData:r,parentDataProperty:"files",rootData:l})||(s=s===null?Ie.errors:s.concat(Ie.errors),e=s.length);var f=y===e}else var f=!0;if(f)if(r.name!==void 0){const y=e;if(typeof r.name!="string")return je.errors=[{instancePath:t+"/name",schemaPath:"#/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var f=y===e}else var f=!0}}}}else return je.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return je.errors=s,e===0}function ce(r,{instancePath:t="",parentData:n,parentDataProperty:p,rootData:l=r}={}){let s=null,e=0;const f=e;let d=!1;const g=e;de(r,{instancePath:t,parentData:n,parentDataProperty:p,rootData:l})||(s=s===null?de.errors:s.concat(de.errors),e=s.length);var y=g===e;if(d=d||y,!d){const h=e;je(r,{instancePath:t,parentData:n,parentDataProperty:p,rootData:l})||(s=s===null?je.errors:s.concat(je.errors),e=s.length);var y=h===e;d=d||y}if(d)e=f,s!==null&&(f?s.length=f:s=null);else{const h={instancePath:t,schemaPath:"#/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[h]:s.push(h),e++,ce.errors=s,!1}return ce.errors=s,e===0}function ve(r,{instancePath:t="",parentData:n,parentDataProperty:p,rootData:l=r}={}){let s=null,e=0;if(e===0)if(r&&typeof r=="object"&&!Array.isArray(r)){let g;if(r.resource===void 0&&(g="resource")||r.inner===void 0&&(g="inner"))return ve.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:g},message:"must have required property '"+g+"'"}],!1;{const y=e;for(const h in r)if(!(h==="resource"||h==="inner"||h==="name"))return ve.errors=[{instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:h},message:"must NOT have additional properties"}],!1;if(y===e){if(r.resource!==void 0){let h=r.resource;const E=e;if(typeof h!="string")return ve.errors=[{instancePath:t+"/resource",schemaPath:"#/properties/resource/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(h!=="zip")return ve.errors=[{instancePath:t+"/resource",schemaPath:"#/properties/resource/const",keyword:"const",params:{allowedValue:"zip"},message:"must be equal to constant"}],!1;var f=E===e}else var f=!0;if(f){if(r.inner!==void 0){let h=r.inner;const E=e,k=e;let T=!1;const b=e;Pr.validate(h,{instancePath:t+"/inner",parentData:r,parentDataProperty:"inner",rootData:l})||(s=s===null?Pr.validate.errors:s.concat(Pr.validate.errors),e=s.length);var d=b===e;if(T=T||d,!T){const X=e;ce(h,{instancePath:t+"/inner",parentData:r,parentDataProperty:"inner",rootData:l})||(s=s===null?ce.errors:s.concat(ce.errors),e=s.length);var d=X===e;T=T||d}if(T)e=k,s!==null&&(k?s.length=k:s=null);else{const X={instancePath:t+"/inner",schemaPath:"#/properties/inner/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[X]:s.push(X),e++,ve.errors=s,!1}var f=E===e}else var f=!0;if(f)if(r.name!==void 0){const h=e;if(typeof r.name!="string")return ve.errors=[{instancePath:t+"/name",schemaPath:"#/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var f=h===e}else var f=!0}}}}else return ve.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return ve.errors=s,e===0}function ee(r,{instancePath:t="",parentData:n,parentDataProperty:p,rootData:l=r}={}){let s=null,e=0;const f=e;let d=!1;const g=e;if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let Z;if(r.resource===void 0&&(Z="resource")||r.path===void 0&&(Z="path")){const Q={instancePath:t,schemaPath:"#/definitions/VFSReference/required",keyword:"required",params:{missingProperty:Z},message:"must have required property '"+Z+"'"};s===null?s=[Q]:s.push(Q),e++}else{const Q=e;for(const G in r)if(!(G==="resource"||G==="path")){const v={instancePath:t,schemaPath:"#/definitions/VFSReference/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:G},message:"must NOT have additional properties"};s===null?s=[v]:s.push(v),e++;break}if(Q===e){if(r.resource!==void 0){let G=r.resource;const v=e;if(typeof G!="string"){const j={instancePath:t+"/resource",schemaPath:"#/definitions/VFSReference/properties/resource/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[j]:s.push(j),e++}if(G!=="vfs"){const j={instancePath:t+"/resource",schemaPath:"#/definitions/VFSReference/properties/resource/const",keyword:"const",params:{allowedValue:"vfs"},message:"must be equal to constant"};s===null?s=[j]:s.push(j),e++}var h=v===e}else var h=!0;if(h)if(r.path!==void 0){const G=e;if(typeof r.path!="string"){const j={instancePath:t+"/path",schemaPath:"#/definitions/VFSReference/properties/path/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[j]:s.push(j),e++}var h=G===e}else var h=!0}}}else{const Z={instancePath:t,schemaPath:"#/definitions/VFSReference/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[Z]:s.push(Z),e++}var E=g===e;if(d=d||E,!d){const Z=e;if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let v;if(r.resource===void 0&&(v="resource")||r.name===void 0&&(v="name")||r.contents===void 0&&(v="contents")){const j={instancePath:t,schemaPath:"#/definitions/LiteralReference/required",keyword:"required",params:{missingProperty:v},message:"must have required property '"+v+"'"};s===null?s=[j]:s.push(j),e++}else{const j=e;for(const P in r)if(!(P==="resource"||P==="name"||P==="contents")){const $={instancePath:t,schemaPath:"#/definitions/LiteralReference/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:P},message:"must NOT have additional properties"};s===null?s=[$]:s.push($),e++;break}if(j===e){if(r.resource!==void 0){let P=r.resource;const $=e;if(typeof P!="string"){const _={instancePath:t+"/resource",schemaPath:"#/definitions/LiteralReference/properties/resource/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[_]:s.push(_),e++}if(P!=="literal"){const _={instancePath:t+"/resource",schemaPath:"#/definitions/LiteralReference/properties/resource/const",keyword:"const",params:{allowedValue:"literal"},message:"must be equal to constant"};s===null?s=[_]:s.push(_),e++}var k=$===e}else var k=!0;if(k){if(r.name!==void 0){const P=e;if(typeof r.name!="string"){const _={instancePath:t+"/name",schemaPath:"#/definitions/LiteralReference/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[_]:s.push(_),e++}var k=P===e}else var k=!0;if(k)if(r.contents!==void 0){let P=r.contents;const $=e,_=e;let m=!1;const w=e;if(typeof P!="string"){const O={instancePath:t+"/contents",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[O]:s.push(O),e++}var T=w===e;if(m=m||T,!m){const O=e;if(e===O)if(P&&typeof P=="object"&&!Array.isArray(P)){let F;if(P.BYTES_PER_ELEMENT===void 0&&(F="BYTES_PER_ELEMENT")||P.buffer===void 0&&(F="buffer")||P.byteLength===void 0&&(F="byteLength")||P.byteOffset===void 0&&(F="byteOffset")||P.length===void 0&&(F="length")){const L={instancePath:t+"/contents",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/required",keyword:"required",params:{missingProperty:F},message:"must have required property '"+F+"'"};s===null?s=[L]:s.push(L),e++}else{const L=e;for(const x in P)if(!(x==="BYTES_PER_ELEMENT"||x==="buffer"||x==="byteLength"||x==="byteOffset"||x==="length")){let N=P[x];const te=e;if(!(typeof N=="number"&&isFinite(N))){const S={instancePath:t+"/contents/"+x.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/additionalProperties/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[S]:s.push(S),e++}var b=te===e;if(!b)break}if(L===e){if(P.BYTES_PER_ELEMENT!==void 0){let x=P.BYTES_PER_ELEMENT;const N=e;if(!(typeof x=="number"&&isFinite(x))){const te={instancePath:t+"/contents/BYTES_PER_ELEMENT",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/properties/BYTES_PER_ELEMENT/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[te]:s.push(te),e++}var M=N===e}else var M=!0;if(M){if(P.buffer!==void 0){let x=P.buffer;const N=e;if(e===N)if(x&&typeof x=="object"&&!Array.isArray(x)){let S;if(x.byteLength===void 0&&(S="byteLength")){const z={instancePath:t+"/contents/buffer",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/properties/buffer/required",keyword:"required",params:{missingProperty:S},message:"must have required property '"+S+"'"};s===null?s=[z]:s.push(z),e++}else{const z=e;for(const J in x)if(J!=="byteLength"){const W={instancePath:t+"/contents/buffer",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/properties/buffer/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:J},message:"must NOT have additional properties"};s===null?s=[W]:s.push(W),e++;break}if(z===e&&x.byteLength!==void 0){let J=x.byteLength;if(!(typeof J=="number"&&isFinite(J))){const W={instancePath:t+"/contents/buffer/byteLength",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/properties/buffer/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[W]:s.push(W),e++}}}}else{const S={instancePath:t+"/contents/buffer",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/properties/buffer/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[S]:s.push(S),e++}var M=N===e}else var M=!0;if(M){if(P.byteLength!==void 0){let x=P.byteLength;const N=e;if(!(typeof x=="number"&&isFinite(x))){const S={instancePath:t+"/contents/byteLength",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[S]:s.push(S),e++}var M=N===e}else var M=!0;if(M){if(P.byteOffset!==void 0){let x=P.byteOffset;const N=e;if(!(typeof x=="number"&&isFinite(x))){const S={instancePath:t+"/contents/byteOffset",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/properties/byteOffset/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[S]:s.push(S),e++}var M=N===e}else var M=!0;if(M)if(P.length!==void 0){let x=P.length;const N=e;if(!(typeof x=="number"&&isFinite(x))){const S={instancePath:t+"/contents/length",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/properties/length/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[S]:s.push(S),e++}var M=N===e}else var M=!0}}}}}}else{const F={instancePath:t+"/contents",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[F]:s.push(F),e++}var T=O===e;m=m||T}if(m)e=_,s!==null&&(_?s.length=_:s=null);else{const O={instancePath:t+"/contents",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};s===null?s=[O]:s.push(O),e++}var k=$===e}else var k=!0}}}}else{const v={instancePath:t,schemaPath:"#/definitions/LiteralReference/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[v]:s.push(v),e++}var E=Z===e;if(d=d||E,!d){const v=e;if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let $;if(r.resource===void 0&&($="resource")||r.slug===void 0&&($="slug")){const _={instancePath:t,schemaPath:"#/definitions/CoreThemeReference/required",keyword:"required",params:{missingProperty:$},message:"must have required property '"+$+"'"};s===null?s=[_]:s.push(_),e++}else{const _=e;for(const m in r)if(!(m==="resource"||m==="slug")){const w={instancePath:t,schemaPath:"#/definitions/CoreThemeReference/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:m},message:"must NOT have additional properties"};s===null?s=[w]:s.push(w),e++;break}if(_===e){if(r.resource!==void 0){let m=r.resource;const w=e;if(typeof m!="string"){const U={instancePath:t+"/resource",schemaPath:"#/definitions/CoreThemeReference/properties/resource/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[U]:s.push(U),e++}if(m!=="wordpress.org/themes"){const U={instancePath:t+"/resource",schemaPath:"#/definitions/CoreThemeReference/properties/resource/const",keyword:"const",params:{allowedValue:"wordpress.org/themes"},message:"must be equal to constant"};s===null?s=[U]:s.push(U),e++}var X=w===e}else var X=!0;if(X)if(r.slug!==void 0){const m=e;if(typeof r.slug!="string"){const U={instancePath:t+"/slug",schemaPath:"#/definitions/CoreThemeReference/properties/slug/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[U]:s.push(U),e++}var X=m===e}else var X=!0}}}else{const $={instancePath:t,schemaPath:"#/definitions/CoreThemeReference/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[$]:s.push($),e++}var E=v===e;if(d=d||E,!d){const $=e;if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let w;if(r.resource===void 0&&(w="resource")||r.slug===void 0&&(w="slug")){const U={instancePath:t,schemaPath:"#/definitions/CorePluginReference/required",keyword:"required",params:{missingProperty:w},message:"must have required property '"+w+"'"};s===null?s=[U]:s.push(U),e++}else{const U=e;for(const O in r)if(!(O==="resource"||O==="slug")){const D={instancePath:t,schemaPath:"#/definitions/CorePluginReference/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:O},message:"must NOT have additional properties"};s===null?s=[D]:s.push(D),e++;break}if(U===e){if(r.resource!==void 0){let O=r.resource;const D=e;if(typeof O!="string"){const F={instancePath:t+"/resource",schemaPath:"#/definitions/CorePluginReference/properties/resource/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[F]:s.push(F),e++}if(O!=="wordpress.org/plugins"){const F={instancePath:t+"/resource",schemaPath:"#/definitions/CorePluginReference/properties/resource/const",keyword:"const",params:{allowedValue:"wordpress.org/plugins"},message:"must be equal to constant"};s===null?s=[F]:s.push(F),e++}var re=D===e}else var re=!0;if(re)if(r.slug!==void 0){const O=e;if(typeof r.slug!="string"){const F={instancePath:t+"/slug",schemaPath:"#/definitions/CorePluginReference/properties/slug/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[F]:s.push(F),e++}var re=O===e}else var re=!0}}}else{const w={instancePath:t,schemaPath:"#/definitions/CorePluginReference/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[w]:s.push(w),e++}var E=$===e;if(d=d||E,!d){const w=e;if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let D;if(r.resource===void 0&&(D="resource")||r.url===void 0&&(D="url")){const F={instancePath:t,schemaPath:"#/definitions/UrlReference/required",keyword:"required",params:{missingProperty:D},message:"must have required property '"+D+"'"};s===null?s=[F]:s.push(F),e++}else{const F=e;for(const L in r)if(!(L==="resource"||L==="url"||L==="caption")){const x={instancePath:t,schemaPath:"#/definitions/UrlReference/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:L},message:"must NOT have additional properties"};s===null?s=[x]:s.push(x),e++;break}if(F===e){if(r.resource!==void 0){let L=r.resource;const x=e;if(typeof L!="string"){const N={instancePath:t+"/resource",schemaPath:"#/definitions/UrlReference/properties/resource/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[N]:s.push(N),e++}if(L!=="url"){const N={instancePath:t+"/resource",schemaPath:"#/definitions/UrlReference/properties/resource/const",keyword:"const",params:{allowedValue:"url"},message:"must be equal to constant"};s===null?s=[N]:s.push(N),e++}var q=x===e}else var q=!0;if(q){if(r.url!==void 0){const L=e;if(typeof r.url!="string"){const N={instancePath:t+"/url",schemaPath:"#/definitions/UrlReference/properties/url/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[N]:s.push(N),e++}var q=L===e}else var q=!0;if(q)if(r.caption!==void 0){const L=e;if(typeof r.caption!="string"){const N={instancePath:t+"/caption",schemaPath:"#/definitions/UrlReference/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[N]:s.push(N),e++}var q=L===e}else var q=!0}}}}else{const D={instancePath:t,schemaPath:"#/definitions/UrlReference/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[D]:s.push(D),e++}var E=w===e;if(d=d||E,!d){const D=e;if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let x;if(r.resource===void 0&&(x="resource")||r.path===void 0&&(x="path")){const N={instancePath:t,schemaPath:"#/definitions/BundledReference/required",keyword:"required",params:{missingProperty:x},message:"must have required property '"+x+"'"};s===null?s=[N]:s.push(N),e++}else{const N=e;for(const te in r)if(!(te==="resource"||te==="path")){const S={instancePath:t,schemaPath:"#/definitions/BundledReference/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:te},message:"must NOT have additional properties"};s===null?s=[S]:s.push(S),e++;break}if(N===e){if(r.resource!==void 0){let te=r.resource;const S=e;if(typeof te!="string"){const z={instancePath:t+"/resource",schemaPath:"#/definitions/BundledReference/properties/resource/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[z]:s.push(z),e++}if(te!=="bundled"){const z={instancePath:t+"/resource",schemaPath:"#/definitions/BundledReference/properties/resource/const",keyword:"const",params:{allowedValue:"bundled"},message:"must be equal to constant"};s===null?s=[z]:s.push(z),e++}var B=S===e}else var B=!0;if(B)if(r.path!==void 0){const te=e;if(typeof r.path!="string"){const z={instancePath:t+"/path",schemaPath:"#/definitions/BundledReference/properties/path/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[z]:s.push(z),e++}var B=te===e}else var B=!0}}}else{const x={instancePath:t,schemaPath:"#/definitions/BundledReference/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[x]:s.push(x),e++}var E=D===e;if(d=d||E,!d){const x=e;ve(r,{instancePath:t,parentData:n,parentDataProperty:p,rootData:l})||(s=s===null?ve.errors:s.concat(ve.errors),e=s.length);var E=x===e;d=d||E}}}}}}if(d)e=f,s!==null&&(f?s.length=f:s=null);else{const Z={instancePath:t,schemaPath:"#/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[Z]:s.push(Z),e++,ee.errors=s,!1}return ee.errors=s,e===0}const lr={oneOf:[{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"activatePlugin"},pluginPath:{type:"string",description:"Path to the plugin directory as absolute path (/wordpress/wp-content/plugins/plugin-name); or the plugin entry file relative to the plugins directory (plugin-name/plugin-name.php)."},pluginName:{type:"string",description:"Optional. Plugin name to display in the progress bar."}},required:["pluginPath","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"activateTheme"},themeFolderName:{type:"string",description:"The name of the theme folder inside wp-content/themes/"}},required:["step","themeFolderName"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"cp"},fromPath:{type:"string",description:"Source path"},toPath:{type:"string",description:"Target path"}},required:["fromPath","step","toPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"defineWpConfigConsts"},consts:{type:"object",additionalProperties:{},description:"The constants to define"},method:{type:"string",enum:["rewrite-wp-config","define-before-run"],description:`The method of defining the constants in wp-config.php. Possible values are:
|
|
1018
|
+
Note: PHP 7.2 and 7.3 are deprecated and will be automatically upgraded to 7.4.`},wp:{anyOf:[{type:"string"},{type:"string",const:"latest"},{type:"boolean",const:!1}],description:"The preferred WordPress version to use, or `false` to boot a PHP-only Playground without downloading or installing WordPress. If not specified, the latest supported version will be used.\n\nWhen set to `false`, WordPress-specific Blueprint fields (`plugins`, `siteOptions`, `login`, and WordPress-only steps) are rejected at compile time."}},required:["php","wp"],additionalProperties:!1,description:"The preferred PHP and WordPress versions to use."},features:{type:"object",properties:{intl:{type:"boolean",description:"Should boot with support for Intl dynamic extension"},networking:{type:"boolean",description:"Should boot with support for network request via wp_safe_remote_get?"}},additionalProperties:!1},extraLibraries:{type:"array",items:{$ref:"#/definitions/ExtraLibrary"},description:"Extra libraries to preload into the Playground instance."},constants:{$ref:"#/definitions/PHPConstants",description:"PHP Constants to define on every request"},plugins:{type:"array",items:{anyOf:[{type:"string"},{$ref:"#/definitions/FileReference"}]},description:"WordPress plugins to install and activate"},siteOptions:{type:"object",additionalProperties:{type:"string"},properties:{blogname:{type:"string",description:"The site title"}},description:"WordPress site options to define"},login:{anyOf:[{type:"boolean"},{type:"object",properties:{username:{type:"string"},password:{type:"string"}},required:["username","password"],additionalProperties:!1}],description:"User to log in as. If true, logs the user in as admin/password."},phpExtensionBundles:{deprecated:"No longer used. Feel free to remove it from your Blueprint."},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"}}},pi={additionalProperties:{type:["string","boolean","number"]}},rt=Object.prototype.hasOwnProperty,li={enum:["8.5","8.4","8.3","8.2","8.1","8.0","7.4"]},ui={enum:["5.2"]};function Je(e,{instancePath:t="",parentData:o,parentDataProperty:n,rootData:l=e}={}){let s=null,r=0;const u=r;let f=!1;const h=r;if(typeof e!="string"){const m={instancePath:t,schemaPath:"#/definitions/PHPNextVersion/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[m]:s.push(m),r++}if(e!=="next"){const m={instancePath:t,schemaPath:"#/definitions/PHPNextVersion/const",keyword:"const",params:{allowedValue:"next"},message:"must be equal to constant"};s===null?s=[m]:s.push(m),r++}var y=h===r;if(f=f||y,!f){const m=r;if(typeof e!="string"){const O={instancePath:t,schemaPath:"#/definitions/SupportedPHPVersion/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[O]:s.push(O),r++}if(!(e==="8.5"||e==="8.4"||e==="8.3"||e==="8.2"||e==="8.1"||e==="8.0"||e==="7.4")){const O={instancePath:t,schemaPath:"#/definitions/SupportedPHPVersion/enum",keyword:"enum",params:{allowedValues:li.enum},message:"must be equal to one of the allowed values"};s===null?s=[O]:s.push(O),r++}var y=m===r;if(f=f||y,!f){const O=r;if(typeof e!="string"){const _={instancePath:t,schemaPath:"#/definitions/LegacyPHPVersion/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[_]:s.push(_),r++}if(e!=="5.2"){const _={instancePath:t,schemaPath:"#/definitions/LegacyPHPVersion/enum",keyword:"enum",params:{allowedValues:ui.enum},message:"must be equal to one of the allowed values"};s===null?s=[_]:s.push(_),r++}var y=O===r;f=f||y}}if(f)r=u,s!==null&&(u?s.length=u:s=null);else{const m={instancePath:t,schemaPath:"#/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[m]:s.push(m),r++,Je.errors=s,!1}return Je.errors=s,r===0}function Ze(e,{instancePath:t="",parentData:o,parentDataProperty:n,rootData:l=e}={}){let s=null,r=0;const u=r;let f=!1;const h=r;Je(e,{instancePath:t,parentData:o,parentDataProperty:n,rootData:l})||(s=s===null?Je.errors:s.concat(Je.errors),r=s.length);var y=h===r;if(f=f||y,!f){const m=r;if(typeof e!="string"){const O={instancePath:t,schemaPath:"#/anyOf/1/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[O]:s.push(O),r++}if(e!=="7.2"){const O={instancePath:t,schemaPath:"#/anyOf/1/const",keyword:"const",params:{allowedValue:"7.2"},message:"must be equal to constant"};s===null?s=[O]:s.push(O),r++}var y=m===r;if(f=f||y,!f){const O=r;if(typeof e!="string"){const _={instancePath:t,schemaPath:"#/anyOf/2/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[_]:s.push(_),r++}if(e!=="7.3"){const _={instancePath:t,schemaPath:"#/anyOf/2/const",keyword:"const",params:{allowedValue:"7.3"},message:"must be equal to constant"};s===null?s=[_]:s.push(_),r++}var y=O===r;f=f||y}}if(f)r=u,s!==null&&(u?s.length=u:s=null);else{const m={instancePath:t,schemaPath:"#/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[m]:s.push(m),r++,Ze.errors=s,!1}return Ze.errors=s,r===0}const Cr={validate:K},fi={enum:["branch","tag","commit","refname"]};function ce(e,{instancePath:t="",parentData:o,parentDataProperty:n,rootData:l=e}={}){let s=null,r=0;if(e&&typeof e=="object"&&!Array.isArray(e)){let f;if(e.resource===void 0&&(f="resource")||e.url===void 0&&(f="url")||e.ref===void 0&&(f="ref"))return ce.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:f},message:"must have required property '"+f+"'"}],!1;for(const h in e)if(!(h==="resource"||h==="url"||h==="ref"||h==="refType"||h==="path"||h===".git"))return ce.errors=[{instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:h},message:"must NOT have additional properties"}],!1;{if(e.resource!==void 0){let h=e.resource;const y=r;if(typeof h!="string")return ce.errors=[{instancePath:t+"/resource",schemaPath:"#/properties/resource/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(h!=="git:directory")return ce.errors=[{instancePath:t+"/resource",schemaPath:"#/properties/resource/const",keyword:"const",params:{allowedValue:"git:directory"},message:"must be equal to constant"}],!1;var u=y===r}else var u=!0;if(u){if(e.url!==void 0){const h=r;if(typeof e.url!="string")return ce.errors=[{instancePath:t+"/url",schemaPath:"#/properties/url/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var u=h===r}else var u=!0;if(u){if(e.ref!==void 0){const h=r;if(typeof e.ref!="string")return ce.errors=[{instancePath:t+"/ref",schemaPath:"#/properties/ref/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var u=h===r}else var u=!0;if(u){if(e.refType!==void 0){let h=e.refType;const y=r;if(typeof h!="string")return ce.errors=[{instancePath:t+"/refType",schemaPath:"#/definitions/GitDirectoryRefType/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(!(h==="branch"||h==="tag"||h==="commit"||h==="refname"))return ce.errors=[{instancePath:t+"/refType",schemaPath:"#/definitions/GitDirectoryRefType/enum",keyword:"enum",params:{allowedValues:fi.enum},message:"must be equal to one of the allowed values"}],!1;var u=y===r}else var u=!0;if(u){if(e.path!==void 0){const h=r;if(typeof e.path!="string")return ce.errors=[{instancePath:t+"/path",schemaPath:"#/properties/path/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var u=h===r}else var u=!0;if(u)if(e[".git"]!==void 0){const h=r;if(typeof e[".git"]!="boolean")return ce.errors=[{instancePath:t+"/.git",schemaPath:"#/properties/.git/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var u=h===r}else var u=!0}}}}}}else return ce.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return ce.errors=s,r===0}const ci={additionalProperties:{anyOf:[{$ref:"#/definitions/FileTree"},{type:["object","string"]}]}},Ir={validate:Ve};function Ve(e,{instancePath:t="",parentData:o,parentDataProperty:n,rootData:l=e}={}){let s=null,r=0;if(r===0)if(e&&typeof e=="object"&&!Array.isArray(e))for(const h in e){let y=e[h];const m=r,k=r;let O=!1;const T=r;Ir.validate(y,{instancePath:t+"/"+h.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:e,parentDataProperty:h,rootData:l})||(s=s===null?Ir.validate.errors:s.concat(Ir.validate.errors),r=s.length);var u=T===r;if(O=O||u,!O){const _=r;if(!(y&&typeof y=="object"&&!Array.isArray(y))&&typeof y!="string"){const J={instancePath:t+"/"+h.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/additionalProperties/anyOf/1/type",keyword:"type",params:{type:ci.additionalProperties.anyOf[1].type},message:"must be object,string"};s===null?s=[J]:s.push(J),r++}var u=_===r;O=O||u}if(O)r=k,s!==null&&(k?s.length=k:s=null);else{const _={instancePath:t+"/"+h.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/additionalProperties/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[_]:s.push(_),r++,Ve.errors=s,!1}var f=m===r;if(!f)break}else return Ve.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return Ve.errors=s,r===0}function Ae(e,{instancePath:t="",parentData:o,parentDataProperty:n,rootData:l=e}={}){let s=null,r=0;if(r===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let f;if(e.files===void 0&&(f="files")||e.name===void 0&&(f="name")||e.resource===void 0&&(f="resource"))return Ae.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:f},message:"must have required property '"+f+"'"}],!1;{const h=r;for(const y in e)if(!(y==="resource"||y==="files"||y==="name"))return Ae.errors=[{instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:y},message:"must NOT have additional properties"}],!1;if(h===r){if(e.resource!==void 0){let y=e.resource;const m=r;if(typeof y!="string")return Ae.errors=[{instancePath:t+"/resource",schemaPath:"#/properties/resource/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(y!=="literal:directory")return Ae.errors=[{instancePath:t+"/resource",schemaPath:"#/properties/resource/const",keyword:"const",params:{allowedValue:"literal:directory"},message:"must be equal to constant"}],!1;var u=m===r}else var u=!0;if(u){if(e.files!==void 0){const y=r;Ve(e.files,{instancePath:t+"/files",parentData:e,parentDataProperty:"files",rootData:l})||(s=s===null?Ve.errors:s.concat(Ve.errors),r=s.length);var u=y===r}else var u=!0;if(u)if(e.name!==void 0){const y=r;if(typeof e.name!="string")return Ae.errors=[{instancePath:t+"/name",schemaPath:"#/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var u=y===r}else var u=!0}}}}else return Ae.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return Ae.errors=s,r===0}function de(e,{instancePath:t="",parentData:o,parentDataProperty:n,rootData:l=e}={}){let s=null,r=0;const u=r;let f=!1;const h=r;ce(e,{instancePath:t,parentData:o,parentDataProperty:n,rootData:l})||(s=s===null?ce.errors:s.concat(ce.errors),r=s.length);var y=h===r;if(f=f||y,!f){const m=r;Ae(e,{instancePath:t,parentData:o,parentDataProperty:n,rootData:l})||(s=s===null?Ae.errors:s.concat(Ae.errors),r=s.length);var y=m===r;f=f||y}if(f)r=u,s!==null&&(u?s.length=u:s=null);else{const m={instancePath:t,schemaPath:"#/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[m]:s.push(m),r++,de.errors=s,!1}return de.errors=s,r===0}function $e(e,{instancePath:t="",parentData:o,parentDataProperty:n,rootData:l=e}={}){let s=null,r=0;if(r===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let h;if(e.resource===void 0&&(h="resource")||e.inner===void 0&&(h="inner"))return $e.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:h},message:"must have required property '"+h+"'"}],!1;{const y=r;for(const m in e)if(!(m==="resource"||m==="inner"||m==="name"))return $e.errors=[{instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:m},message:"must NOT have additional properties"}],!1;if(y===r){if(e.resource!==void 0){let m=e.resource;const k=r;if(typeof m!="string")return $e.errors=[{instancePath:t+"/resource",schemaPath:"#/properties/resource/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(m!=="zip")return $e.errors=[{instancePath:t+"/resource",schemaPath:"#/properties/resource/const",keyword:"const",params:{allowedValue:"zip"},message:"must be equal to constant"}],!1;var u=k===r}else var u=!0;if(u){if(e.inner!==void 0){let m=e.inner;const k=r,O=r;let T=!1;const _=r;Cr.validate(m,{instancePath:t+"/inner",parentData:e,parentDataProperty:"inner",rootData:l})||(s=s===null?Cr.validate.errors:s.concat(Cr.validate.errors),r=s.length);var f=_===r;if(T=T||f,!T){const J=r;de(m,{instancePath:t+"/inner",parentData:e,parentDataProperty:"inner",rootData:l})||(s=s===null?de.errors:s.concat(de.errors),r=s.length);var f=J===r;T=T||f}if(T)r=O,s!==null&&(O?s.length=O:s=null);else{const J={instancePath:t+"/inner",schemaPath:"#/properties/inner/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[J]:s.push(J),r++,$e.errors=s,!1}var u=k===r}else var u=!0;if(u)if(e.name!==void 0){const m=r;if(typeof e.name!="string")return $e.errors=[{instancePath:t+"/name",schemaPath:"#/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var u=m===r}else var u=!0}}}}else return $e.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return $e.errors=s,r===0}function K(e,{instancePath:t="",parentData:o,parentDataProperty:n,rootData:l=e}={}){let s=null,r=0;const u=r;let f=!1;const h=r;if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let Z;if(e.resource===void 0&&(Z="resource")||e.path===void 0&&(Z="path")){const te={instancePath:t,schemaPath:"#/definitions/VFSReference/required",keyword:"required",params:{missingProperty:Z},message:"must have required property '"+Z+"'"};s===null?s=[te]:s.push(te),r++}else{const te=r;for(const G in e)if(!(G==="resource"||G==="path")){const b={instancePath:t,schemaPath:"#/definitions/VFSReference/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:G},message:"must NOT have additional properties"};s===null?s=[b]:s.push(b),r++;break}if(te===r){if(e.resource!==void 0){let G=e.resource;const b=r;if(typeof G!="string"){const R={instancePath:t+"/resource",schemaPath:"#/definitions/VFSReference/properties/resource/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[R]:s.push(R),r++}if(G!=="vfs"){const R={instancePath:t+"/resource",schemaPath:"#/definitions/VFSReference/properties/resource/const",keyword:"const",params:{allowedValue:"vfs"},message:"must be equal to constant"};s===null?s=[R]:s.push(R),r++}var m=b===r}else var m=!0;if(m)if(e.path!==void 0){const G=r;if(typeof e.path!="string"){const R={instancePath:t+"/path",schemaPath:"#/definitions/VFSReference/properties/path/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[R]:s.push(R),r++}var m=G===r}else var m=!0}}}else{const Z={instancePath:t,schemaPath:"#/definitions/VFSReference/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[Z]:s.push(Z),r++}var k=h===r;if(f=f||k,!f){const Z=r;if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let b;if(e.resource===void 0&&(b="resource")||e.name===void 0&&(b="name")||e.contents===void 0&&(b="contents")){const R={instancePath:t,schemaPath:"#/definitions/LiteralReference/required",keyword:"required",params:{missingProperty:b},message:"must have required property '"+b+"'"};s===null?s=[R]:s.push(R),r++}else{const R=r;for(const P in e)if(!(P==="resource"||P==="name"||P==="contents")){const E={instancePath:t,schemaPath:"#/definitions/LiteralReference/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:P},message:"must NOT have additional properties"};s===null?s=[E]:s.push(E),r++;break}if(R===r){if(e.resource!==void 0){let P=e.resource;const E=r;if(typeof P!="string"){const v={instancePath:t+"/resource",schemaPath:"#/definitions/LiteralReference/properties/resource/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[v]:s.push(v),r++}if(P!=="literal"){const v={instancePath:t+"/resource",schemaPath:"#/definitions/LiteralReference/properties/resource/const",keyword:"const",params:{allowedValue:"literal"},message:"must be equal to constant"};s===null?s=[v]:s.push(v),r++}var O=E===r}else var O=!0;if(O){if(e.name!==void 0){const P=r;if(typeof e.name!="string"){const v={instancePath:t+"/name",schemaPath:"#/definitions/LiteralReference/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[v]:s.push(v),r++}var O=P===r}else var O=!0;if(O)if(e.contents!==void 0){let P=e.contents;const E=r,v=r;let g=!1;const w=r;if(typeof P!="string"){const $={instancePath:t+"/contents",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[$]:s.push($),r++}var T=w===r;if(g=g||T,!g){const $=r;if(r===$)if(P&&typeof P=="object"&&!Array.isArray(P)){let x;if(P.BYTES_PER_ELEMENT===void 0&&(x="BYTES_PER_ELEMENT")||P.buffer===void 0&&(x="buffer")||P.byteLength===void 0&&(x="byteLength")||P.byteOffset===void 0&&(x="byteOffset")||P.length===void 0&&(x="length")){const L={instancePath:t+"/contents",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/required",keyword:"required",params:{missingProperty:x},message:"must have required property '"+x+"'"};s===null?s=[L]:s.push(L),r++}else{const L=r;for(const F in P)if(!(F==="BYTES_PER_ELEMENT"||F==="buffer"||F==="byteLength"||F==="byteOffset"||F==="length")){let C=P[F];const se=r;if(!(typeof C=="number"&&isFinite(C))){const q={instancePath:t+"/contents/"+F.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/additionalProperties/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[q]:s.push(q),r++}var _=se===r;if(!_)break}if(L===r){if(P.BYTES_PER_ELEMENT!==void 0){let F=P.BYTES_PER_ELEMENT;const C=r;if(!(typeof F=="number"&&isFinite(F))){const se={instancePath:t+"/contents/BYTES_PER_ELEMENT",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/properties/BYTES_PER_ELEMENT/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[se]:s.push(se),r++}var U=C===r}else var U=!0;if(U){if(P.buffer!==void 0){let F=P.buffer;const C=r;if(r===C)if(F&&typeof F=="object"&&!Array.isArray(F)){let q;if(F.byteLength===void 0&&(q="byteLength")){const z={instancePath:t+"/contents/buffer",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/properties/buffer/required",keyword:"required",params:{missingProperty:q},message:"must have required property '"+q+"'"};s===null?s=[z]:s.push(z),r++}else{const z=r;for(const Q in F)if(Q!=="byteLength"){const V={instancePath:t+"/contents/buffer",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/properties/buffer/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:Q},message:"must NOT have additional properties"};s===null?s=[V]:s.push(V),r++;break}if(z===r&&F.byteLength!==void 0){let Q=F.byteLength;if(!(typeof Q=="number"&&isFinite(Q))){const V={instancePath:t+"/contents/buffer/byteLength",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/properties/buffer/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[V]:s.push(V),r++}}}}else{const q={instancePath:t+"/contents/buffer",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/properties/buffer/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[q]:s.push(q),r++}var U=C===r}else var U=!0;if(U){if(P.byteLength!==void 0){let F=P.byteLength;const C=r;if(!(typeof F=="number"&&isFinite(F))){const q={instancePath:t+"/contents/byteLength",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[q]:s.push(q),r++}var U=C===r}else var U=!0;if(U){if(P.byteOffset!==void 0){let F=P.byteOffset;const C=r;if(!(typeof F=="number"&&isFinite(F))){const q={instancePath:t+"/contents/byteOffset",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/properties/byteOffset/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[q]:s.push(q),r++}var U=C===r}else var U=!0;if(U)if(P.length!==void 0){let F=P.length;const C=r;if(!(typeof F=="number"&&isFinite(F))){const q={instancePath:t+"/contents/length",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/properties/length/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[q]:s.push(q),r++}var U=C===r}else var U=!0}}}}}}else{const x={instancePath:t+"/contents",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[x]:s.push(x),r++}var T=$===r;g=g||T}if(g)r=v,s!==null&&(v?s.length=v:s=null);else{const $={instancePath:t+"/contents",schemaPath:"#/definitions/LiteralReference/properties/contents/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};s===null?s=[$]:s.push($),r++}var O=E===r}else var O=!0}}}}else{const b={instancePath:t,schemaPath:"#/definitions/LiteralReference/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[b]:s.push(b),r++}var k=Z===r;if(f=f||k,!f){const b=r;if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let E;if(e.resource===void 0&&(E="resource")||e.slug===void 0&&(E="slug")){const v={instancePath:t,schemaPath:"#/definitions/CoreThemeReference/required",keyword:"required",params:{missingProperty:E},message:"must have required property '"+E+"'"};s===null?s=[v]:s.push(v),r++}else{const v=r;for(const g in e)if(!(g==="resource"||g==="slug")){const w={instancePath:t,schemaPath:"#/definitions/CoreThemeReference/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:g},message:"must NOT have additional properties"};s===null?s=[w]:s.push(w),r++;break}if(v===r){if(e.resource!==void 0){let g=e.resource;const w=r;if(typeof g!="string"){const M={instancePath:t+"/resource",schemaPath:"#/definitions/CoreThemeReference/properties/resource/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[M]:s.push(M),r++}if(g!=="wordpress.org/themes"){const M={instancePath:t+"/resource",schemaPath:"#/definitions/CoreThemeReference/properties/resource/const",keyword:"const",params:{allowedValue:"wordpress.org/themes"},message:"must be equal to constant"};s===null?s=[M]:s.push(M),r++}var J=w===r}else var J=!0;if(J)if(e.slug!==void 0){const g=r;if(typeof e.slug!="string"){const M={instancePath:t+"/slug",schemaPath:"#/definitions/CoreThemeReference/properties/slug/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[M]:s.push(M),r++}var J=g===r}else var J=!0}}}else{const E={instancePath:t,schemaPath:"#/definitions/CoreThemeReference/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[E]:s.push(E),r++}var k=b===r;if(f=f||k,!f){const E=r;if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let w;if(e.resource===void 0&&(w="resource")||e.slug===void 0&&(w="slug")){const M={instancePath:t,schemaPath:"#/definitions/CorePluginReference/required",keyword:"required",params:{missingProperty:w},message:"must have required property '"+w+"'"};s===null?s=[M]:s.push(M),r++}else{const M=r;for(const $ in e)if(!($==="resource"||$==="slug")){const D={instancePath:t,schemaPath:"#/definitions/CorePluginReference/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:$},message:"must NOT have additional properties"};s===null?s=[D]:s.push(D),r++;break}if(M===r){if(e.resource!==void 0){let $=e.resource;const D=r;if(typeof $!="string"){const x={instancePath:t+"/resource",schemaPath:"#/definitions/CorePluginReference/properties/resource/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[x]:s.push(x),r++}if($!=="wordpress.org/plugins"){const x={instancePath:t+"/resource",schemaPath:"#/definitions/CorePluginReference/properties/resource/const",keyword:"const",params:{allowedValue:"wordpress.org/plugins"},message:"must be equal to constant"};s===null?s=[x]:s.push(x),r++}var ee=D===r}else var ee=!0;if(ee)if(e.slug!==void 0){const $=r;if(typeof e.slug!="string"){const x={instancePath:t+"/slug",schemaPath:"#/definitions/CorePluginReference/properties/slug/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[x]:s.push(x),r++}var ee=$===r}else var ee=!0}}}else{const w={instancePath:t,schemaPath:"#/definitions/CorePluginReference/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[w]:s.push(w),r++}var k=E===r;if(f=f||k,!f){const w=r;if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let D;if(e.resource===void 0&&(D="resource")||e.url===void 0&&(D="url")){const x={instancePath:t,schemaPath:"#/definitions/UrlReference/required",keyword:"required",params:{missingProperty:D},message:"must have required property '"+D+"'"};s===null?s=[x]:s.push(x),r++}else{const x=r;for(const L in e)if(!(L==="resource"||L==="url"||L==="caption")){const F={instancePath:t,schemaPath:"#/definitions/UrlReference/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:L},message:"must NOT have additional properties"};s===null?s=[F]:s.push(F),r++;break}if(x===r){if(e.resource!==void 0){let L=e.resource;const F=r;if(typeof L!="string"){const C={instancePath:t+"/resource",schemaPath:"#/definitions/UrlReference/properties/resource/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[C]:s.push(C),r++}if(L!=="url"){const C={instancePath:t+"/resource",schemaPath:"#/definitions/UrlReference/properties/resource/const",keyword:"const",params:{allowedValue:"url"},message:"must be equal to constant"};s===null?s=[C]:s.push(C),r++}var A=F===r}else var A=!0;if(A){if(e.url!==void 0){const L=r;if(typeof e.url!="string"){const C={instancePath:t+"/url",schemaPath:"#/definitions/UrlReference/properties/url/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[C]:s.push(C),r++}var A=L===r}else var A=!0;if(A)if(e.caption!==void 0){const L=r;if(typeof e.caption!="string"){const C={instancePath:t+"/caption",schemaPath:"#/definitions/UrlReference/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[C]:s.push(C),r++}var A=L===r}else var A=!0}}}}else{const D={instancePath:t,schemaPath:"#/definitions/UrlReference/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[D]:s.push(D),r++}var k=w===r;if(f=f||k,!f){const D=r;if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let F;if(e.resource===void 0&&(F="resource")||e.path===void 0&&(F="path")){const C={instancePath:t,schemaPath:"#/definitions/BundledReference/required",keyword:"required",params:{missingProperty:F},message:"must have required property '"+F+"'"};s===null?s=[C]:s.push(C),r++}else{const C=r;for(const se in e)if(!(se==="resource"||se==="path")){const q={instancePath:t,schemaPath:"#/definitions/BundledReference/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:se},message:"must NOT have additional properties"};s===null?s=[q]:s.push(q),r++;break}if(C===r){if(e.resource!==void 0){let se=e.resource;const q=r;if(typeof se!="string"){const z={instancePath:t+"/resource",schemaPath:"#/definitions/BundledReference/properties/resource/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[z]:s.push(z),r++}if(se!=="bundled"){const z={instancePath:t+"/resource",schemaPath:"#/definitions/BundledReference/properties/resource/const",keyword:"const",params:{allowedValue:"bundled"},message:"must be equal to constant"};s===null?s=[z]:s.push(z),r++}var B=q===r}else var B=!0;if(B)if(e.path!==void 0){const se=r;if(typeof e.path!="string"){const z={instancePath:t+"/path",schemaPath:"#/definitions/BundledReference/properties/path/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[z]:s.push(z),r++}var B=se===r}else var B=!0}}}else{const F={instancePath:t,schemaPath:"#/definitions/BundledReference/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[F]:s.push(F),r++}var k=D===r;if(f=f||k,!f){const F=r;$e(e,{instancePath:t,parentData:o,parentDataProperty:n,rootData:l})||(s=s===null?$e.errors:s.concat($e.errors),r=s.length);var k=F===r;f=f||k}}}}}}if(f)r=u,s!==null&&(u?s.length=u:s=null);else{const Z={instancePath:t,schemaPath:"#/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[Z]:s.push(Z),r++,K.errors=s,!1}return K.errors=s,r===0}const Me={oneOf:[{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"activatePlugin"},pluginPath:{type:"string",description:"Path to the plugin directory as absolute path (/wordpress/wp-content/plugins/plugin-name); or the plugin entry file relative to the plugins directory (plugin-name/plugin-name.php)."},pluginName:{type:"string",description:"Optional. Plugin name to display in the progress bar."}},required:["pluginPath","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"activateTheme"},themeFolderName:{type:"string",description:"The name of the theme folder inside wp-content/themes/"}},required:["step","themeFolderName"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"cp"},fromPath:{type:"string",description:"Source path"},toPath:{type:"string",description:"Target path"}},required:["fromPath","step","toPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"defineWpConfigConsts"},consts:{type:"object",additionalProperties:{},description:"The constants to define"},method:{type:"string",enum:["rewrite-wp-config","define-before-run"],description:`The method of defining the constants in wp-config.php. Possible values are:
|
|
849
1019
|
|
|
850
1020
|
- rewrite-wp-config: Default. Rewrites the wp-config.php file to explicitly call define() with the requested name and value. This method alters the file on the disk, but it doesn't conflict with existing define() calls in wp-config.php.
|
|
851
1021
|
|
|
852
1022
|
- define-before-run: Defines the constant before running the requested script. It doesn't alter any files on the disk, but constants defined this way may conflict with existing define() calls in wp-config.php.`},virtualize:{type:"boolean",deprecated:`This option is noop and will be removed in a future version.
|
|
853
1023
|
This option is only kept in here to avoid breaking Blueprint schema validation
|
|
854
|
-
for existing apps using this option.`}},required:["consts","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"defineSiteUrl"},siteUrl:{type:"string",description:"The URL"}},required:["siteUrl","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"enableMultisite"},wpCliPath:{type:"string",description:"wp-cli.phar path"}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"importWxr"},file:{$ref:"#/definitions/FileReference",description:"The file to import"},fetchAttachments:{type:"boolean",description:"Whether to fetch and import attachment files referenced by the WXR file.",default:!0},rewriteUrls:{type:"boolean",description:"Whether to rewrite imported URLs to the current site URL.",default:!0},importComments:{type:"boolean",description:"Whether to import comments from the WXR file.",default:!0},defaultAuthorUsername:{type:"string",description:"The fallback local user for imported authors that cannot be mapped.",default:"admin"},importer:{type:"string",enum:["data-liberation","default"],description:"The importer to use. Possible values:\n\n- `default`: The importer from https://github.com/humanmade/WordPress-Importer\n- `data-liberation`: The experimental Data Liberation WXR importer developed at https://github.com/WordPress/wordpress-playground/issues/1894\n\nThis option is deprecated. The syntax will not be removed, but once the Data Liberation importer matures, it will become the only supported importer and the `importer` option will be ignored.",deprecated:!0}},required:["file","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"importThemeStarterContent",description:"The step identifier."},themeSlug:{type:"string",description:"The name of the theme to import content from."}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"importWordPressFiles"},wordPressFilesZip:{$ref:"#/definitions/FileReference",description:"The zip file containing the top-level WordPress files and directories."},pathInZip:{type:"string",description:"The path inside the zip file where the WordPress files are."}},required:["step","wordPressFilesZip"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},ifAlreadyInstalled:{type:"string",enum:["overwrite","skip","error"],description:"What to do if the asset already exists."},step:{type:"string",const:"installPlugin",description:"The step identifier."},pluginData:{anyOf:[{$ref:"#/definitions/FileReference"},{$ref:"#/definitions/DirectoryReference"}],description:"The plugin files to install. It can be a plugin zip file, a single PHP file, or a directory containing all the plugin files at its root."},pluginZipFile:{$ref:"#/definitions/FileReference",deprecated:". Use 'pluginData' instead."},options:{$ref:"#/definitions/InstallPluginOptions",description:"Optional installation options."}},required:["pluginData","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},ifAlreadyInstalled:{type:"string",enum:["overwrite","skip","error"],description:"What to do if the asset already exists."},step:{type:"string",const:"installTheme",description:"The step identifier."},themeData:{anyOf:[{$ref:"#/definitions/FileReference"},{$ref:"#/definitions/DirectoryReference"}],description:"The theme files to install. It can be either a theme zip file, or a directory containing all the theme files at its root."},themeZipFile:{$ref:"#/definitions/FileReference",deprecated:". Use 'themeData' instead."},options:{$ref:"#/definitions/InstallThemeOptions",description:"Optional installation options."}},required:["step","themeData"]},{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",deprecated:`The password field is deprecated and will be removed in a future version.
|
|
855
|
-
Only the username field is required for user authentication.`}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"mkdir"},path:{type:"string",description:"The path of the directory you want to create"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"mv"},fromPath:{type:"string",description:"Source path"},toPath:{type:"string",description:"Target path"}},required:["fromPath","step","toPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"resetData"}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"request"},request:{$ref:"#/definitions/PHPRequest",description:"Request details (See /wordpress-playground/api/universal/interface/PHPRequest)"}},required:["request","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"rm"},path:{type:"string",description:"The path to remove"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"rmdir"},path:{type:"string",description:"The path to remove"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runPHP",description:"The step identifier."},code:{anyOf:[{type:"string"},{type:"object",properties:{filename:{type:"string",description:"This property is ignored during Blueprint v1 execution but exists so the same runPHP step structure can be used for Blueprints v1 and v2."},content:{type:"string"}},required:["filename","content"],additionalProperties:!1}],description:"The PHP code to run."}},required:["code","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runPHPWithOptions"},options:{$ref:"#/definitions/PHPRunOptions",description:"Run options (See /wordpress-playground/api/universal/interface/PHPRunOptions/))"}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runWpInstallationWizard"},options:{$ref:"#/definitions/WordPressInstallationOptions"}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runSql",description:"The step identifier."},sql:{$ref:"#/definitions/FileReference",description:"The SQL to run. Each non-empty line must contain a valid SQL query."}},required:["sql","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"setSiteOptions",description:'The name of the step. Must be "setSiteOptions".'},options:{type:"object",additionalProperties:{},description:"The options to set on the site."}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"unzip"},zipFile:{$ref:"#/definitions/FileReference",description:"The zip file to extract"},zipPath:{type:"string",description:"The path of the zip file to extract",deprecated:"Use zipFile instead."},extractToPath:{type:"string",description:"The path to extract the zip file to"}},required:["extractToPath","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"updateUserMeta"},meta:{type:"object",additionalProperties:{},description:'An object of user meta values to set, e.g. { "first_name": "John" }'},userId:{type:"number",description:"User ID"}},required:["meta","step","userId"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"writeFile"},path:{type:"string",description:"The path of the file to write to"},data:{anyOf:[{$ref:"#/definitions/FileReference"},{type:"string"},{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}}],description:"The data to write"}},required:["data","path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"writeFiles"},writeToPath:{type:"string",description:"The path of the file to write to"},filesTree:{$ref:"#/definitions/DirectoryReference",description:"The 'filesTree' defines the directory structure, supporting 'literal:directory' or 'git:directory' types. The 'name' represents the root directory, while 'files' is an object where keys are file paths, and values contain either file content as a string or nested objects for subdirectories."}},required:["filesTree","step","writeToPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"wp-cli",description:"The step identifier."},command:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:"The WP CLI command to run."},wpCliPath:{type:"string",description:"wp-cli.phar path"}},required:["command","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"setSiteLanguage"},language:{type:"string",description:"The language to set, e.g. 'en_US'"}},required:["language","step"]}]},Ss={properties:{onError:{enum:["skip-plugin","throw"]}}},Rs={properties:{onError:{enum:["skip-theme","throw"]}}},Ot={enum:["GET","POST","HEAD","OPTIONS","PATCH","PUT","DELETE"]};function ge(r,{instancePath:t="",parentData:n,parentDataProperty:p,rootData:l=r}={}){let s=null,e=0;if(e===0)if(r&&typeof r=="object"&&!Array.isArray(r)){let X;if(r.url===void 0&&(X="url"))return ge.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:X},message:"must have required property '"+X+"'"}],!1;{const re=e;for(const q in r)if(!(q==="method"||q==="url"||q==="headers"||q==="body"))return ge.errors=[{instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:q},message:"must NOT have additional properties"}],!1;if(re===e){if(r.method!==void 0){let q=r.method;const B=e;if(typeof q!="string")return ge.errors=[{instancePath:t+"/method",schemaPath:"#/definitions/HTTPMethod/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(!(q==="GET"||q==="POST"||q==="HEAD"||q==="OPTIONS"||q==="PATCH"||q==="PUT"||q==="DELETE"))return ge.errors=[{instancePath:t+"/method",schemaPath:"#/definitions/HTTPMethod/enum",keyword:"enum",params:{allowedValues:Ot.enum},message:"must be equal to one of the allowed values"}],!1;var f=B===e}else var f=!0;if(f){if(r.url!==void 0){const q=e;if(typeof r.url!="string")return ge.errors=[{instancePath:t+"/url",schemaPath:"#/properties/url/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var f=q===e}else var f=!0;if(f){if(r.headers!==void 0){let q=r.headers;const B=e;if(e===e)if(q&&typeof q=="object"&&!Array.isArray(q))for(const G in q){const v=e;if(typeof q[G]!="string")return ge.errors=[{instancePath:t+"/headers/"+G.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/definitions/PHPRequestHeaders/additionalProperties/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var d=v===e;if(!d)break}else return ge.errors=[{instancePath:t+"/headers",schemaPath:"#/definitions/PHPRequestHeaders/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var f=B===e}else var f=!0;if(f)if(r.body!==void 0){let q=r.body;const B=e,Z=e;let Q=!1;const G=e;if(typeof q!="string"){const j={instancePath:t+"/body",schemaPath:"#/properties/body/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[j]:s.push(j),e++}var g=G===e;if(Q=Q||g,!Q){const j=e;if(e===j)if(q&&typeof q=="object"&&!Array.isArray(q)){let $;if(q.BYTES_PER_ELEMENT===void 0&&($="BYTES_PER_ELEMENT")||q.buffer===void 0&&($="buffer")||q.byteLength===void 0&&($="byteLength")||q.byteOffset===void 0&&($="byteOffset")||q.length===void 0&&($="length")){const _={instancePath:t+"/body",schemaPath:"#/properties/body/anyOf/1/required",keyword:"required",params:{missingProperty:$},message:"must have required property '"+$+"'"};s===null?s=[_]:s.push(_),e++}else{const _=e;for(const m in q)if(!(m==="BYTES_PER_ELEMENT"||m==="buffer"||m==="byteLength"||m==="byteOffset"||m==="length")){let w=q[m];const U=e;if(!(typeof w=="number"&&isFinite(w))){const O={instancePath:t+"/body/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/1/additionalProperties/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[O]:s.push(O),e++}var y=U===e;if(!y)break}if(_===e){if(q.BYTES_PER_ELEMENT!==void 0){let m=q.BYTES_PER_ELEMENT;const w=e;if(!(typeof m=="number"&&isFinite(m))){const U={instancePath:t+"/body/BYTES_PER_ELEMENT",schemaPath:"#/properties/body/anyOf/1/properties/BYTES_PER_ELEMENT/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[U]:s.push(U),e++}var h=w===e}else var h=!0;if(h){if(q.buffer!==void 0){let m=q.buffer;const w=e;if(e===w)if(m&&typeof m=="object"&&!Array.isArray(m)){let O;if(m.byteLength===void 0&&(O="byteLength")){const D={instancePath:t+"/body/buffer",schemaPath:"#/properties/body/anyOf/1/properties/buffer/required",keyword:"required",params:{missingProperty:O},message:"must have required property '"+O+"'"};s===null?s=[D]:s.push(D),e++}else{const D=e;for(const F in m)if(F!=="byteLength"){const L={instancePath:t+"/body/buffer",schemaPath:"#/properties/body/anyOf/1/properties/buffer/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:F},message:"must NOT have additional properties"};s===null?s=[L]:s.push(L),e++;break}if(D===e&&m.byteLength!==void 0){let F=m.byteLength;if(!(typeof F=="number"&&isFinite(F))){const L={instancePath:t+"/body/buffer/byteLength",schemaPath:"#/properties/body/anyOf/1/properties/buffer/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[L]:s.push(L),e++}}}}else{const O={instancePath:t+"/body/buffer",schemaPath:"#/properties/body/anyOf/1/properties/buffer/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[O]:s.push(O),e++}var h=w===e}else var h=!0;if(h){if(q.byteLength!==void 0){let m=q.byteLength;const w=e;if(!(typeof m=="number"&&isFinite(m))){const O={instancePath:t+"/body/byteLength",schemaPath:"#/properties/body/anyOf/1/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[O]:s.push(O),e++}var h=w===e}else var h=!0;if(h){if(q.byteOffset!==void 0){let m=q.byteOffset;const w=e;if(!(typeof m=="number"&&isFinite(m))){const O={instancePath:t+"/body/byteOffset",schemaPath:"#/properties/body/anyOf/1/properties/byteOffset/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[O]:s.push(O),e++}var h=w===e}else var h=!0;if(h)if(q.length!==void 0){let m=q.length;const w=e;if(!(typeof m=="number"&&isFinite(m))){const O={instancePath:t+"/body/length",schemaPath:"#/properties/body/anyOf/1/properties/length/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[O]:s.push(O),e++}var h=w===e}else var h=!0}}}}}}else{const $={instancePath:t+"/body",schemaPath:"#/properties/body/anyOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[$]:s.push($),e++}var g=j===e;if(Q=Q||g,!Q){const $=e;if(e===$)if(q&&typeof q=="object"&&!Array.isArray(q))for(const m in q){let w=q[m];const U=e,O=e;let D=!1;const F=e;if(typeof w!="string"){const L={instancePath:t+"/body/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[L]:s.push(L),e++}var E=F===e;if(D=D||E,!D){const L=e;if(e===L)if(w&&typeof w=="object"&&!Array.isArray(w)){let N;if(w.BYTES_PER_ELEMENT===void 0&&(N="BYTES_PER_ELEMENT")||w.buffer===void 0&&(N="buffer")||w.byteLength===void 0&&(N="byteLength")||w.byteOffset===void 0&&(N="byteOffset")||w.length===void 0&&(N="length")){const te={instancePath:t+"/body/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/required",keyword:"required",params:{missingProperty:N},message:"must have required property '"+N+"'"};s===null?s=[te]:s.push(te),e++}else{const te=e;for(const S in w)if(!(S==="BYTES_PER_ELEMENT"||S==="buffer"||S==="byteLength"||S==="byteOffset"||S==="length")){let z=w[S];const J=e;if(!(typeof z=="number"&&isFinite(z))){const W={instancePath:t+"/body/"+m.replace(/~/g,"~0").replace(/\//g,"~1")+"/"+S.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/additionalProperties/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[W]:s.push(W),e++}var k=J===e;if(!k)break}if(te===e){if(w.BYTES_PER_ELEMENT!==void 0){let S=w.BYTES_PER_ELEMENT;const z=e;if(!(typeof S=="number"&&isFinite(S))){const J={instancePath:t+"/body/"+m.replace(/~/g,"~0").replace(/\//g,"~1")+"/BYTES_PER_ELEMENT",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/properties/BYTES_PER_ELEMENT/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[J]:s.push(J),e++}var T=z===e}else var T=!0;if(T){if(w.buffer!==void 0){let S=w.buffer;const z=e;if(e===z)if(S&&typeof S=="object"&&!Array.isArray(S)){let W;if(S.byteLength===void 0&&(W="byteLength")){const ne={instancePath:t+"/body/"+m.replace(/~/g,"~0").replace(/\//g,"~1")+"/buffer",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/properties/buffer/required",keyword:"required",params:{missingProperty:W},message:"must have required property '"+W+"'"};s===null?s=[ne]:s.push(ne),e++}else{const ne=e;for(const pe in S)if(pe!=="byteLength"){const _e={instancePath:t+"/body/"+m.replace(/~/g,"~0").replace(/\//g,"~1")+"/buffer",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/properties/buffer/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:pe},message:"must NOT have additional properties"};s===null?s=[_e]:s.push(_e),e++;break}if(ne===e&&S.byteLength!==void 0){let pe=S.byteLength;if(!(typeof pe=="number"&&isFinite(pe))){const _e={instancePath:t+"/body/"+m.replace(/~/g,"~0").replace(/\//g,"~1")+"/buffer/byteLength",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/properties/buffer/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[_e]:s.push(_e),e++}}}}else{const W={instancePath:t+"/body/"+m.replace(/~/g,"~0").replace(/\//g,"~1")+"/buffer",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/properties/buffer/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[W]:s.push(W),e++}var T=z===e}else var T=!0;if(T){if(w.byteLength!==void 0){let S=w.byteLength;const z=e;if(!(typeof S=="number"&&isFinite(S))){const W={instancePath:t+"/body/"+m.replace(/~/g,"~0").replace(/\//g,"~1")+"/byteLength",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[W]:s.push(W),e++}var T=z===e}else var T=!0;if(T){if(w.byteOffset!==void 0){let S=w.byteOffset;const z=e;if(!(typeof S=="number"&&isFinite(S))){const W={instancePath:t+"/body/"+m.replace(/~/g,"~0").replace(/\//g,"~1")+"/byteOffset",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/properties/byteOffset/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[W]:s.push(W),e++}var T=z===e}else var T=!0;if(T)if(w.length!==void 0){let S=w.length;const z=e;if(!(typeof S=="number"&&isFinite(S))){const W={instancePath:t+"/body/"+m.replace(/~/g,"~0").replace(/\//g,"~1")+"/length",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/properties/length/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[W]:s.push(W),e++}var T=z===e}else var T=!0}}}}}}else{const N={instancePath:t+"/body/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[N]:s.push(N),e++}var E=L===e;if(D=D||E,!D){const N=e;if(e===N)if(w&&typeof w=="object"&&!Array.isArray(w)){let S;if(w.lastModified===void 0&&(S="lastModified")||w.name===void 0&&(S="name")||w.size===void 0&&(S="size")||w.type===void 0&&(S="type")||w.webkitRelativePath===void 0&&(S="webkitRelativePath")){const z={instancePath:t+"/body/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/2/required",keyword:"required",params:{missingProperty:S},message:"must have required property '"+S+"'"};s===null?s=[z]:s.push(z),e++}else{const z=e;for(const J in w)if(!(J==="size"||J==="type"||J==="lastModified"||J==="name"||J==="webkitRelativePath")){const W={instancePath:t+"/body/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/2/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:J},message:"must NOT have additional properties"};s===null?s=[W]:s.push(W),e++;break}if(z===e){if(w.size!==void 0){let J=w.size;const W=e;if(!(typeof J=="number"&&isFinite(J))){const ne={instancePath:t+"/body/"+m.replace(/~/g,"~0").replace(/\//g,"~1")+"/size",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/2/properties/size/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[ne]:s.push(ne),e++}var b=W===e}else var b=!0;if(b){if(w.type!==void 0){const J=e;if(typeof w.type!="string"){const ne={instancePath:t+"/body/"+m.replace(/~/g,"~0").replace(/\//g,"~1")+"/type",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/2/properties/type/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[ne]:s.push(ne),e++}var b=J===e}else var b=!0;if(b){if(w.lastModified!==void 0){let J=w.lastModified;const W=e;if(!(typeof J=="number"&&isFinite(J))){const pe={instancePath:t+"/body/"+m.replace(/~/g,"~0").replace(/\//g,"~1")+"/lastModified",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/2/properties/lastModified/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[pe]:s.push(pe),e++}var b=W===e}else var b=!0;if(b){if(w.name!==void 0){const J=e;if(typeof w.name!="string"){const ne={instancePath:t+"/body/"+m.replace(/~/g,"~0").replace(/\//g,"~1")+"/name",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/2/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[ne]:s.push(ne),e++}var b=J===e}else var b=!0;if(b)if(w.webkitRelativePath!==void 0){const J=e;if(typeof w.webkitRelativePath!="string"){const ne={instancePath:t+"/body/"+m.replace(/~/g,"~0").replace(/\//g,"~1")+"/webkitRelativePath",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/2/properties/webkitRelativePath/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[ne]:s.push(ne),e++}var b=J===e}else var b=!0}}}}}}else{const S={instancePath:t+"/body/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/2/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[S]:s.push(S),e++}var E=N===e;D=D||E}}if(D)e=O,s!==null&&(O?s.length=O:s=null);else{const L={instancePath:t+"/body/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};s===null?s=[L]:s.push(L),e++}var M=U===e;if(!M)break}else{const m={instancePath:t+"/body",schemaPath:"#/properties/body/anyOf/2/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[m]:s.push(m),e++}var g=$===e;Q=Q||g}}if(Q)e=Z,s!==null&&(Z?s.length=Z:s=null);else{const j={instancePath:t+"/body",schemaPath:"#/properties/body/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[j]:s.push(j),e++,ge.errors=s,!1}var f=B===e}else var f=!0}}}}}else return ge.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return ge.errors=s,e===0}const Ls={properties:{relativeUri:{type:"string",description:"Request path following the domain:port part – after any URL rewriting rules (e.g. apache .htaccess) have been applied."},scriptPath:{type:"string",description:"Path of the .php file to execute."},protocol:{type:"string",description:"Request protocol."},method:{$ref:"#/definitions/HTTPMethod",description:"Request method. Default: `GET`."},headers:{$ref:"#/definitions/PHPRequestHeaders",description:"Request headers."},body:{anyOf:[{type:"string"},{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}}],description:"Request body."},env:{type:"object",additionalProperties:{type:"string"},description:"Environment variables to set for this run."},$_SERVER:{type:"object",additionalProperties:{type:"string"},description:"$_SERVER entries to set for this run."},code:{type:"string",description:"The code snippet to eval instead of a php file."}}};function le(r,{instancePath:t="",parentData:n,parentDataProperty:p,rootData:l=r}={}){let s=null,e=0;if(e===0)if(r&&typeof r=="object"&&!Array.isArray(r)){const T=e;for(const b in r)if(!_t.call(Ls.properties,b))return le.errors=[{instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:b},message:"must NOT have additional properties"}],!1;if(T===e){if(r.relativeUri!==void 0){const b=e;if(typeof r.relativeUri!="string")return le.errors=[{instancePath:t+"/relativeUri",schemaPath:"#/properties/relativeUri/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var f=b===e}else var f=!0;if(f){if(r.scriptPath!==void 0){const b=e;if(typeof r.scriptPath!="string")return le.errors=[{instancePath:t+"/scriptPath",schemaPath:"#/properties/scriptPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var f=b===e}else var f=!0;if(f){if(r.protocol!==void 0){const b=e;if(typeof r.protocol!="string")return le.errors=[{instancePath:t+"/protocol",schemaPath:"#/properties/protocol/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var f=b===e}else var f=!0;if(f){if(r.method!==void 0){let b=r.method;const M=e;if(typeof b!="string")return le.errors=[{instancePath:t+"/method",schemaPath:"#/definitions/HTTPMethod/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(!(b==="GET"||b==="POST"||b==="HEAD"||b==="OPTIONS"||b==="PATCH"||b==="PUT"||b==="DELETE"))return le.errors=[{instancePath:t+"/method",schemaPath:"#/definitions/HTTPMethod/enum",keyword:"enum",params:{allowedValues:Ot.enum},message:"must be equal to one of the allowed values"}],!1;var f=M===e}else var f=!0;if(f){if(r.headers!==void 0){let b=r.headers;const M=e;if(e===e)if(b&&typeof b=="object"&&!Array.isArray(b))for(const q in b){const B=e;if(typeof b[q]!="string")return le.errors=[{instancePath:t+"/headers/"+q.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/definitions/PHPRequestHeaders/additionalProperties/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var d=B===e;if(!d)break}else return le.errors=[{instancePath:t+"/headers",schemaPath:"#/definitions/PHPRequestHeaders/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var f=M===e}else var f=!0;if(f){if(r.body!==void 0){let b=r.body;const M=e,X=e;let re=!1;const q=e;if(typeof b!="string"){const Z={instancePath:t+"/body",schemaPath:"#/properties/body/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[Z]:s.push(Z),e++}var g=q===e;if(re=re||g,!re){const Z=e;if(e===Z)if(b&&typeof b=="object"&&!Array.isArray(b)){let G;if(b.BYTES_PER_ELEMENT===void 0&&(G="BYTES_PER_ELEMENT")||b.buffer===void 0&&(G="buffer")||b.byteLength===void 0&&(G="byteLength")||b.byteOffset===void 0&&(G="byteOffset")||b.length===void 0&&(G="length")){const v={instancePath:t+"/body",schemaPath:"#/properties/body/anyOf/1/required",keyword:"required",params:{missingProperty:G},message:"must have required property '"+G+"'"};s===null?s=[v]:s.push(v),e++}else{const v=e;for(const j in b)if(!(j==="BYTES_PER_ELEMENT"||j==="buffer"||j==="byteLength"||j==="byteOffset"||j==="length")){let P=b[j];const $=e;if(!(typeof P=="number"&&isFinite(P))){const _={instancePath:t+"/body/"+j.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/1/additionalProperties/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[_]:s.push(_),e++}var y=$===e;if(!y)break}if(v===e){if(b.BYTES_PER_ELEMENT!==void 0){let j=b.BYTES_PER_ELEMENT;const P=e;if(!(typeof j=="number"&&isFinite(j))){const $={instancePath:t+"/body/BYTES_PER_ELEMENT",schemaPath:"#/properties/body/anyOf/1/properties/BYTES_PER_ELEMENT/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[$]:s.push($),e++}var h=P===e}else var h=!0;if(h){if(b.buffer!==void 0){let j=b.buffer;const P=e;if(e===P)if(j&&typeof j=="object"&&!Array.isArray(j)){let _;if(j.byteLength===void 0&&(_="byteLength")){const m={instancePath:t+"/body/buffer",schemaPath:"#/properties/body/anyOf/1/properties/buffer/required",keyword:"required",params:{missingProperty:_},message:"must have required property '"+_+"'"};s===null?s=[m]:s.push(m),e++}else{const m=e;for(const w in j)if(w!=="byteLength"){const U={instancePath:t+"/body/buffer",schemaPath:"#/properties/body/anyOf/1/properties/buffer/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:w},message:"must NOT have additional properties"};s===null?s=[U]:s.push(U),e++;break}if(m===e&&j.byteLength!==void 0){let w=j.byteLength;if(!(typeof w=="number"&&isFinite(w))){const U={instancePath:t+"/body/buffer/byteLength",schemaPath:"#/properties/body/anyOf/1/properties/buffer/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[U]:s.push(U),e++}}}}else{const _={instancePath:t+"/body/buffer",schemaPath:"#/properties/body/anyOf/1/properties/buffer/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[_]:s.push(_),e++}var h=P===e}else var h=!0;if(h){if(b.byteLength!==void 0){let j=b.byteLength;const P=e;if(!(typeof j=="number"&&isFinite(j))){const _={instancePath:t+"/body/byteLength",schemaPath:"#/properties/body/anyOf/1/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[_]:s.push(_),e++}var h=P===e}else var h=!0;if(h){if(b.byteOffset!==void 0){let j=b.byteOffset;const P=e;if(!(typeof j=="number"&&isFinite(j))){const _={instancePath:t+"/body/byteOffset",schemaPath:"#/properties/body/anyOf/1/properties/byteOffset/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[_]:s.push(_),e++}var h=P===e}else var h=!0;if(h)if(b.length!==void 0){let j=b.length;const P=e;if(!(typeof j=="number"&&isFinite(j))){const _={instancePath:t+"/body/length",schemaPath:"#/properties/body/anyOf/1/properties/length/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[_]:s.push(_),e++}var h=P===e}else var h=!0}}}}}}else{const G={instancePath:t+"/body",schemaPath:"#/properties/body/anyOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[G]:s.push(G),e++}var g=Z===e;re=re||g}if(re)e=X,s!==null&&(X?s.length=X:s=null);else{const Z={instancePath:t+"/body",schemaPath:"#/properties/body/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[Z]:s.push(Z),e++,le.errors=s,!1}var f=M===e}else var f=!0;if(f){if(r.env!==void 0){let b=r.env;const M=e;if(e===M)if(b&&typeof b=="object"&&!Array.isArray(b))for(const re in b){const q=e;if(typeof b[re]!="string")return le.errors=[{instancePath:t+"/env/"+re.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/env/additionalProperties/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var E=q===e;if(!E)break}else return le.errors=[{instancePath:t+"/env",schemaPath:"#/properties/env/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var f=M===e}else var f=!0;if(f){if(r.$_SERVER!==void 0){let b=r.$_SERVER;const M=e;if(e===M)if(b&&typeof b=="object"&&!Array.isArray(b))for(const re in b){const q=e;if(typeof b[re]!="string")return le.errors=[{instancePath:t+"/$_SERVER/"+re.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/%24_SERVER/additionalProperties/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var k=q===e;if(!k)break}else return le.errors=[{instancePath:t+"/$_SERVER",schemaPath:"#/properties/%24_SERVER/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var f=M===e}else var f=!0;if(f)if(r.code!==void 0){const b=e;if(typeof r.code!="string")return le.errors=[{instancePath:t+"/code",schemaPath:"#/properties/code/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var f=b===e}else var f=!0}}}}}}}}}else return le.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return le.errors=s,e===0}function o(r,{instancePath:t="",parentData:n,parentDataProperty:p,rootData:l=r}={}){let s=null,e=0;if(e===0)if(r&&typeof r=="object"&&!Array.isArray(r)){let vr;if(r.step===void 0&&(vr="step"))return o.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:vr},message:"must have required property '"+vr+"'"}],!1;{const se=r.step;if(typeof se=="string")if(se==="activatePlugin"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.pluginPath===void 0&&(c="pluginPath")||r.step===void 0&&(c="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="step"||i==="pluginPath"||i==="pluginName"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/0/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/0/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var f=R===e}else var f=!0;if(f)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/0/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var f=a===e}else var f=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/0/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var d=u===e}else var d=!0;if(d){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/0/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="activatePlugin")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/0/properties/step/const",keyword:"const",params:{allowedValue:"activatePlugin"},message:"must be equal to constant"}],!1;var d=u===e}else var d=!0;if(d){if(r.pluginPath!==void 0){const i=e;if(typeof r.pluginPath!="string")return o.errors=[{instancePath:t+"/pluginPath",schemaPath:"#/oneOf/0/properties/pluginPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var d=i===e}else var d=!0;if(d)if(r.pluginName!==void 0){const i=e;if(typeof r.pluginName!="string")return o.errors=[{instancePath:t+"/pluginName",schemaPath:"#/oneOf/0/properties/pluginName/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var d=i===e}else var d=!0}}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/0/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="activateTheme"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.step===void 0&&(c="step")||r.themeFolderName===void 0&&(c="themeFolderName"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="step"||i==="themeFolderName"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/1/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/1/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var g=R===e}else var g=!0;if(g)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/1/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var g=a===e}else var g=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/1/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var y=u===e}else var y=!0;if(y){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/1/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="activateTheme")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/1/properties/step/const",keyword:"const",params:{allowedValue:"activateTheme"},message:"must be equal to constant"}],!1;var y=u===e}else var y=!0;if(y)if(r.themeFolderName!==void 0){const i=e;if(typeof r.themeFolderName!="string")return o.errors=[{instancePath:t+"/themeFolderName",schemaPath:"#/oneOf/1/properties/themeFolderName/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var y=i===e}else var y=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="cp"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.fromPath===void 0&&(c="fromPath")||r.step===void 0&&(c="step")||r.toPath===void 0&&(c="toPath"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/2/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="step"||i==="fromPath"||i==="toPath"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/2/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/2/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/2/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var h=R===e}else var h=!0;if(h)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/2/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var h=a===e}else var h=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/2/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var E=u===e}else var E=!0;if(E){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/2/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="cp")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/2/properties/step/const",keyword:"const",params:{allowedValue:"cp"},message:"must be equal to constant"}],!1;var E=u===e}else var E=!0;if(E){if(r.fromPath!==void 0){const i=e;if(typeof r.fromPath!="string")return o.errors=[{instancePath:t+"/fromPath",schemaPath:"#/oneOf/2/properties/fromPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var E=i===e}else var E=!0;if(E)if(r.toPath!==void 0){const i=e;if(typeof r.toPath!="string")return o.errors=[{instancePath:t+"/toPath",schemaPath:"#/oneOf/2/properties/toPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var E=i===e}else var E=!0}}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/2/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="defineWpConfigConsts"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.consts===void 0&&(c="consts")||r.step===void 0&&(c="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/3/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="step"||i==="consts"||i==="method"||i==="virtualize"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/3/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/3/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/3/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var k=R===e}else var k=!0;if(k)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/3/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var k=a===e}else var k=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/3/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var T=u===e}else var T=!0;if(T){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/3/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="defineWpConfigConsts")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/3/properties/step/const",keyword:"const",params:{allowedValue:"defineWpConfigConsts"},message:"must be equal to constant"}],!1;var T=u===e}else var T=!0;if(T){if(r.consts!==void 0){let i=r.consts;const u=e;if(e===u&&!(i&&typeof i=="object"&&!Array.isArray(i)))return o.errors=[{instancePath:t+"/consts",schemaPath:"#/oneOf/3/properties/consts/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var T=u===e}else var T=!0;if(T){if(r.method!==void 0){let i=r.method;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/method",schemaPath:"#/oneOf/3/properties/method/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(!(i==="rewrite-wp-config"||i==="define-before-run"))return o.errors=[{instancePath:t+"/method",schemaPath:"#/oneOf/3/properties/method/enum",keyword:"enum",params:{allowedValues:lr.oneOf[3].properties.method.enum},message:"must be equal to one of the allowed values"}],!1;var T=u===e}else var T=!0;if(T)if(r.virtualize!==void 0){const i=e;if(typeof r.virtualize!="boolean")return o.errors=[{instancePath:t+"/virtualize",schemaPath:"#/oneOf/3/properties/virtualize/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var T=i===e}else var T=!0}}}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/3/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="defineSiteUrl"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.siteUrl===void 0&&(c="siteUrl")||r.step===void 0&&(c="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/4/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="step"||i==="siteUrl"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/4/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/4/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/4/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var b=R===e}else var b=!0;if(b)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/4/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var b=a===e}else var b=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/4/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var M=u===e}else var M=!0;if(M){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/4/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="defineSiteUrl")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/4/properties/step/const",keyword:"const",params:{allowedValue:"defineSiteUrl"},message:"must be equal to constant"}],!1;var M=u===e}else var M=!0;if(M)if(r.siteUrl!==void 0){const i=e;if(typeof r.siteUrl!="string")return o.errors=[{instancePath:t+"/siteUrl",schemaPath:"#/oneOf/4/properties/siteUrl/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var M=i===e}else var M=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/4/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="enableMultisite"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.step===void 0&&(c="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/5/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="step"||i==="wpCliPath"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/5/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/5/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/5/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var X=R===e}else var X=!0;if(X)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/5/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var X=a===e}else var X=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/5/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var re=u===e}else var re=!0;if(re){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/5/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="enableMultisite")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/5/properties/step/const",keyword:"const",params:{allowedValue:"enableMultisite"},message:"must be equal to constant"}],!1;var re=u===e}else var re=!0;if(re)if(r.wpCliPath!==void 0){const i=e;if(typeof r.wpCliPath!="string")return o.errors=[{instancePath:t+"/wpCliPath",schemaPath:"#/oneOf/5/properties/wpCliPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var re=i===e}else var re=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/5/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="importWxr"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.file===void 0&&(c="file")||r.step===void 0&&(c="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/6/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="step"||i==="file"||i==="fetchAttachments"||i==="rewriteUrls"||i==="importComments"||i==="defaultAuthorUsername"||i==="importer"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/6/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/6/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/6/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var q=R===e}else var q=!0;if(q)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/6/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var q=a===e}else var q=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/6/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var B=u===e}else var B=!0;if(B){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/6/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="importWxr")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/6/properties/step/const",keyword:"const",params:{allowedValue:"importWxr"},message:"must be equal to constant"}],!1;var B=u===e}else var B=!0;if(B){if(r.file!==void 0){const i=e;ee(r.file,{instancePath:t+"/file",parentData:r,parentDataProperty:"file",rootData:l})||(s=s===null?ee.errors:s.concat(ee.errors),e=s.length);var B=i===e}else var B=!0;if(B){if(r.fetchAttachments!==void 0){const i=e;if(typeof r.fetchAttachments!="boolean")return o.errors=[{instancePath:t+"/fetchAttachments",schemaPath:"#/oneOf/6/properties/fetchAttachments/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var B=i===e}else var B=!0;if(B){if(r.rewriteUrls!==void 0){const i=e;if(typeof r.rewriteUrls!="boolean")return o.errors=[{instancePath:t+"/rewriteUrls",schemaPath:"#/oneOf/6/properties/rewriteUrls/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var B=i===e}else var B=!0;if(B){if(r.importComments!==void 0){const i=e;if(typeof r.importComments!="boolean")return o.errors=[{instancePath:t+"/importComments",schemaPath:"#/oneOf/6/properties/importComments/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var B=i===e}else var B=!0;if(B){if(r.defaultAuthorUsername!==void 0){const i=e;if(typeof r.defaultAuthorUsername!="string")return o.errors=[{instancePath:t+"/defaultAuthorUsername",schemaPath:"#/oneOf/6/properties/defaultAuthorUsername/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var B=i===e}else var B=!0;if(B)if(r.importer!==void 0){let i=r.importer;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/importer",schemaPath:"#/oneOf/6/properties/importer/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(!(i==="data-liberation"||i==="default"))return o.errors=[{instancePath:t+"/importer",schemaPath:"#/oneOf/6/properties/importer/enum",keyword:"enum",params:{allowedValues:lr.oneOf[6].properties.importer.enum},message:"must be equal to one of the allowed values"}],!1;var B=u===e}else var B=!0}}}}}}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/6/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="importThemeStarterContent"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.step===void 0&&(c="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/7/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="step"||i==="themeSlug"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/7/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/7/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/7/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var Z=R===e}else var Z=!0;if(Z)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/7/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Z=a===e}else var Z=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/7/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var Q=u===e}else var Q=!0;if(Q){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/7/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="importThemeStarterContent")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/7/properties/step/const",keyword:"const",params:{allowedValue:"importThemeStarterContent"},message:"must be equal to constant"}],!1;var Q=u===e}else var Q=!0;if(Q)if(r.themeSlug!==void 0){const i=e;if(typeof r.themeSlug!="string")return o.errors=[{instancePath:t+"/themeSlug",schemaPath:"#/oneOf/7/properties/themeSlug/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Q=i===e}else var Q=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/7/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="importWordPressFiles"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.step===void 0&&(c="step")||r.wordPressFilesZip===void 0&&(c="wordPressFilesZip"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/8/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="step"||i==="wordPressFilesZip"||i==="pathInZip"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/8/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/8/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/8/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var G=R===e}else var G=!0;if(G)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/8/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var G=a===e}else var G=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/8/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var v=u===e}else var v=!0;if(v){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/8/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="importWordPressFiles")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/8/properties/step/const",keyword:"const",params:{allowedValue:"importWordPressFiles"},message:"must be equal to constant"}],!1;var v=u===e}else var v=!0;if(v){if(r.wordPressFilesZip!==void 0){const i=e;ee(r.wordPressFilesZip,{instancePath:t+"/wordPressFilesZip",parentData:r,parentDataProperty:"wordPressFilesZip",rootData:l})||(s=s===null?ee.errors:s.concat(ee.errors),e=s.length);var v=i===e}else var v=!0;if(v)if(r.pathInZip!==void 0){const i=e;if(typeof r.pathInZip!="string")return o.errors=[{instancePath:t+"/pathInZip",schemaPath:"#/oneOf/8/properties/pathInZip/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var v=i===e}else var v=!0}}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/8/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="installPlugin"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.pluginData===void 0&&(c="pluginData")||r.step===void 0&&(c="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/9/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="ifAlreadyInstalled"||i==="step"||i==="pluginData"||i==="pluginZipFile"||i==="options"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/9/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/9/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/9/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var j=R===e}else var j=!0;if(j)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/9/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var j=a===e}else var j=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/9/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var P=u===e}else var P=!0;if(P){if(r.ifAlreadyInstalled!==void 0){let i=r.ifAlreadyInstalled;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/ifAlreadyInstalled",schemaPath:"#/oneOf/9/properties/ifAlreadyInstalled/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(!(i==="overwrite"||i==="skip"||i==="error"))return o.errors=[{instancePath:t+"/ifAlreadyInstalled",schemaPath:"#/oneOf/9/properties/ifAlreadyInstalled/enum",keyword:"enum",params:{allowedValues:lr.oneOf[9].properties.ifAlreadyInstalled.enum},message:"must be equal to one of the allowed values"}],!1;var P=u===e}else var P=!0;if(P){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/9/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="installPlugin")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/9/properties/step/const",keyword:"const",params:{allowedValue:"installPlugin"},message:"must be equal to constant"}],!1;var P=u===e}else var P=!0;if(P){if(r.pluginData!==void 0){let i=r.pluginData;const u=e,A=e;let a=!1;const R=e;ee(i,{instancePath:t+"/pluginData",parentData:r,parentDataProperty:"pluginData",rootData:l})||(s=s===null?ee.errors:s.concat(ee.errors),e=s.length);var $=R===e;if(a=a||$,!a){const H=e;ce(i,{instancePath:t+"/pluginData",parentData:r,parentDataProperty:"pluginData",rootData:l})||(s=s===null?ce.errors:s.concat(ce.errors),e=s.length);var $=H===e;a=a||$}if(a)e=A,s!==null&&(A?s.length=A:s=null);else{const H={instancePath:t+"/pluginData",schemaPath:"#/oneOf/9/properties/pluginData/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[H]:s.push(H),e++,o.errors=s,!1}var P=u===e}else var P=!0;if(P){if(r.pluginZipFile!==void 0){const i=e;ee(r.pluginZipFile,{instancePath:t+"/pluginZipFile",parentData:r,parentDataProperty:"pluginZipFile",rootData:l})||(s=s===null?ee.errors:s.concat(ee.errors),e=s.length);var P=i===e}else var P=!0;if(P)if(r.options!==void 0){let i=r.options;const u=e;if(e===e)if(i&&typeof i=="object"&&!Array.isArray(i)){const R=e;for(const V in i)if(!(V==="activate"||V==="activationOptions"||V==="onError"||V==="targetFolderName"||V==="humanReadableName"))return o.errors=[{instancePath:t+"/options",schemaPath:"#/definitions/InstallPluginOptions/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:V},message:"must NOT have additional properties"}],!1;if(R===e){if(i.activate!==void 0){const V=e;if(typeof i.activate!="boolean")return o.errors=[{instancePath:t+"/options/activate",schemaPath:"#/definitions/InstallPluginOptions/properties/activate/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var _=V===e}else var _=!0;if(_){if(i.activationOptions!==void 0){let V=i.activationOptions;const H=e;if(e===H&&!(V&&typeof V=="object"&&!Array.isArray(V)))return o.errors=[{instancePath:t+"/options/activationOptions",schemaPath:"#/definitions/InstallPluginOptions/properties/activationOptions/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var _=H===e}else var _=!0;if(_){if(i.onError!==void 0){let V=i.onError;const H=e;if(typeof V!="string")return o.errors=[{instancePath:t+"/options/onError",schemaPath:"#/definitions/InstallPluginOptions/properties/onError/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(!(V==="skip-plugin"||V==="throw"))return o.errors=[{instancePath:t+"/options/onError",schemaPath:"#/definitions/InstallPluginOptions/properties/onError/enum",keyword:"enum",params:{allowedValues:Ss.properties.onError.enum},message:"must be equal to one of the allowed values"}],!1;var _=H===e}else var _=!0;if(_){if(i.targetFolderName!==void 0){const V=e;if(typeof i.targetFolderName!="string")return o.errors=[{instancePath:t+"/options/targetFolderName",schemaPath:"#/definitions/InstallPluginOptions/properties/targetFolderName/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var _=V===e}else var _=!0;if(_)if(i.humanReadableName!==void 0){const V=e;if(typeof i.humanReadableName!="string")return o.errors=[{instancePath:t+"/options/humanReadableName",schemaPath:"#/definitions/InstallPluginOptions/properties/humanReadableName/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var _=V===e}else var _=!0}}}}}else return o.errors=[{instancePath:t+"/options",schemaPath:"#/definitions/InstallPluginOptions/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var P=u===e}else var P=!0}}}}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/9/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="installTheme"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.step===void 0&&(c="step")||r.themeData===void 0&&(c="themeData"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/10/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="ifAlreadyInstalled"||i==="step"||i==="themeData"||i==="themeZipFile"||i==="options"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/10/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/10/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/10/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var m=R===e}else var m=!0;if(m)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/10/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var m=a===e}else var m=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/10/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var w=u===e}else var w=!0;if(w){if(r.ifAlreadyInstalled!==void 0){let i=r.ifAlreadyInstalled;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/ifAlreadyInstalled",schemaPath:"#/oneOf/10/properties/ifAlreadyInstalled/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(!(i==="overwrite"||i==="skip"||i==="error"))return o.errors=[{instancePath:t+"/ifAlreadyInstalled",schemaPath:"#/oneOf/10/properties/ifAlreadyInstalled/enum",keyword:"enum",params:{allowedValues:lr.oneOf[10].properties.ifAlreadyInstalled.enum},message:"must be equal to one of the allowed values"}],!1;var w=u===e}else var w=!0;if(w){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/10/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="installTheme")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/10/properties/step/const",keyword:"const",params:{allowedValue:"installTheme"},message:"must be equal to constant"}],!1;var w=u===e}else var w=!0;if(w){if(r.themeData!==void 0){let i=r.themeData;const u=e,A=e;let a=!1;const R=e;ee(i,{instancePath:t+"/themeData",parentData:r,parentDataProperty:"themeData",rootData:l})||(s=s===null?ee.errors:s.concat(ee.errors),e=s.length);var U=R===e;if(a=a||U,!a){const H=e;ce(i,{instancePath:t+"/themeData",parentData:r,parentDataProperty:"themeData",rootData:l})||(s=s===null?ce.errors:s.concat(ce.errors),e=s.length);var U=H===e;a=a||U}if(a)e=A,s!==null&&(A?s.length=A:s=null);else{const H={instancePath:t+"/themeData",schemaPath:"#/oneOf/10/properties/themeData/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[H]:s.push(H),e++,o.errors=s,!1}var w=u===e}else var w=!0;if(w){if(r.themeZipFile!==void 0){const i=e;ee(r.themeZipFile,{instancePath:t+"/themeZipFile",parentData:r,parentDataProperty:"themeZipFile",rootData:l})||(s=s===null?ee.errors:s.concat(ee.errors),e=s.length);var w=i===e}else var w=!0;if(w)if(r.options!==void 0){let i=r.options;const u=e;if(e===e)if(i&&typeof i=="object"&&!Array.isArray(i)){const R=e;for(const V in i)if(!(V==="activate"||V==="importStarterContent"||V==="onError"||V==="targetFolderName"||V==="humanReadableName"))return o.errors=[{instancePath:t+"/options",schemaPath:"#/definitions/InstallThemeOptions/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:V},message:"must NOT have additional properties"}],!1;if(R===e){if(i.activate!==void 0){const V=e;if(typeof i.activate!="boolean")return o.errors=[{instancePath:t+"/options/activate",schemaPath:"#/definitions/InstallThemeOptions/properties/activate/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var O=V===e}else var O=!0;if(O){if(i.importStarterContent!==void 0){const V=e;if(typeof i.importStarterContent!="boolean")return o.errors=[{instancePath:t+"/options/importStarterContent",schemaPath:"#/definitions/InstallThemeOptions/properties/importStarterContent/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var O=V===e}else var O=!0;if(O){if(i.onError!==void 0){let V=i.onError;const H=e;if(typeof V!="string")return o.errors=[{instancePath:t+"/options/onError",schemaPath:"#/definitions/InstallThemeOptions/properties/onError/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(!(V==="skip-theme"||V==="throw"))return o.errors=[{instancePath:t+"/options/onError",schemaPath:"#/definitions/InstallThemeOptions/properties/onError/enum",keyword:"enum",params:{allowedValues:Rs.properties.onError.enum},message:"must be equal to one of the allowed values"}],!1;var O=H===e}else var O=!0;if(O){if(i.targetFolderName!==void 0){const V=e;if(typeof i.targetFolderName!="string")return o.errors=[{instancePath:t+"/options/targetFolderName",schemaPath:"#/definitions/InstallThemeOptions/properties/targetFolderName/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var O=V===e}else var O=!0;if(O)if(i.humanReadableName!==void 0){const V=e;if(typeof i.humanReadableName!="string")return o.errors=[{instancePath:t+"/options/humanReadableName",schemaPath:"#/definitions/InstallThemeOptions/properties/humanReadableName/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var O=V===e}else var O=!0}}}}}else return o.errors=[{instancePath:t+"/options",schemaPath:"#/definitions/InstallThemeOptions/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var w=u===e}else var w=!0}}}}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/10/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="login"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.step===void 0&&(c="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/11/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="step"||i==="username"||i==="password"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/11/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/11/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/11/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var D=R===e}else var D=!0;if(D)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/11/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var D=a===e}else var D=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/11/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var F=u===e}else var F=!0;if(F){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/11/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="login")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/11/properties/step/const",keyword:"const",params:{allowedValue:"login"},message:"must be equal to constant"}],!1;var F=u===e}else var F=!0;if(F){if(r.username!==void 0){const i=e;if(typeof r.username!="string")return o.errors=[{instancePath:t+"/username",schemaPath:"#/oneOf/11/properties/username/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var F=i===e}else var F=!0;if(F)if(r.password!==void 0){const i=e;if(typeof r.password!="string")return o.errors=[{instancePath:t+"/password",schemaPath:"#/oneOf/11/properties/password/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var F=i===e}else var F=!0}}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/11/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="mkdir"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.path===void 0&&(c="path")||r.step===void 0&&(c="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/12/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="step"||i==="path"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/12/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/12/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/12/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var L=R===e}else var L=!0;if(L)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/12/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var L=a===e}else var L=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/12/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var x=u===e}else var x=!0;if(x){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/12/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="mkdir")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/12/properties/step/const",keyword:"const",params:{allowedValue:"mkdir"},message:"must be equal to constant"}],!1;var x=u===e}else var x=!0;if(x)if(r.path!==void 0){const i=e;if(typeof r.path!="string")return o.errors=[{instancePath:t+"/path",schemaPath:"#/oneOf/12/properties/path/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var x=i===e}else var x=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/12/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="mv"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.fromPath===void 0&&(c="fromPath")||r.step===void 0&&(c="step")||r.toPath===void 0&&(c="toPath"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/13/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="step"||i==="fromPath"||i==="toPath"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/13/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/13/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/13/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var N=R===e}else var N=!0;if(N)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/13/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var N=a===e}else var N=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/13/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var te=u===e}else var te=!0;if(te){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/13/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="mv")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/13/properties/step/const",keyword:"const",params:{allowedValue:"mv"},message:"must be equal to constant"}],!1;var te=u===e}else var te=!0;if(te){if(r.fromPath!==void 0){const i=e;if(typeof r.fromPath!="string")return o.errors=[{instancePath:t+"/fromPath",schemaPath:"#/oneOf/13/properties/fromPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var te=i===e}else var te=!0;if(te)if(r.toPath!==void 0){const i=e;if(typeof r.toPath!="string")return o.errors=[{instancePath:t+"/toPath",schemaPath:"#/oneOf/13/properties/toPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var te=i===e}else var te=!0}}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/13/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="resetData"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.step===void 0&&(c="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/14/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/14/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/14/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/14/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var S=R===e}else var S=!0;if(S)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/14/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var S=a===e}else var S=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/14/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var z=u===e}else var z=!0;if(z)if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/14/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="resetData")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/14/properties/step/const",keyword:"const",params:{allowedValue:"resetData"},message:"must be equal to constant"}],!1;var z=u===e}else var z=!0}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/14/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="request"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.request===void 0&&(c="request")||r.step===void 0&&(c="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/15/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="step"||i==="request"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/15/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/15/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/15/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var J=R===e}else var J=!0;if(J)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/15/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var J=a===e}else var J=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/15/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var W=u===e}else var W=!0;if(W){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/15/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="request")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/15/properties/step/const",keyword:"const",params:{allowedValue:"request"},message:"must be equal to constant"}],!1;var W=u===e}else var W=!0;if(W)if(r.request!==void 0){const i=e;ge(r.request,{instancePath:t+"/request",parentData:r,parentDataProperty:"request",rootData:l})||(s=s===null?ge.errors:s.concat(ge.errors),e=s.length);var W=i===e}else var W=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/15/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="rm"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.path===void 0&&(c="path")||r.step===void 0&&(c="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/16/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="step"||i==="path"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/16/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/16/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/16/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var ne=R===e}else var ne=!0;if(ne)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/16/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var ne=a===e}else var ne=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/16/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var pe=u===e}else var pe=!0;if(pe){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/16/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="rm")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/16/properties/step/const",keyword:"const",params:{allowedValue:"rm"},message:"must be equal to constant"}],!1;var pe=u===e}else var pe=!0;if(pe)if(r.path!==void 0){const i=e;if(typeof r.path!="string")return o.errors=[{instancePath:t+"/path",schemaPath:"#/oneOf/16/properties/path/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var pe=i===e}else var pe=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/16/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="rmdir"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.path===void 0&&(c="path")||r.step===void 0&&(c="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/17/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="step"||i==="path"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/17/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/17/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/17/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var _e=R===e}else var _e=!0;if(_e)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/17/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var _e=a===e}else var _e=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/17/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var qe=u===e}else var qe=!0;if(qe){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/17/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="rmdir")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/17/properties/step/const",keyword:"const",params:{allowedValue:"rmdir"},message:"must be equal to constant"}],!1;var qe=u===e}else var qe=!0;if(qe)if(r.path!==void 0){const i=e;if(typeof r.path!="string")return o.errors=[{instancePath:t+"/path",schemaPath:"#/oneOf/17/properties/path/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var qe=i===e}else var qe=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/17/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="runPHP"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.code===void 0&&(c="code")||r.step===void 0&&(c="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/18/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="step"||i==="code"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/18/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/18/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/18/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var Ze=R===e}else var Ze=!0;if(Ze)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/18/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Ze=a===e}else var Ze=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/18/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var Se=u===e}else var Se=!0;if(Se){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/18/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="runPHP")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/18/properties/step/const",keyword:"const",params:{allowedValue:"runPHP"},message:"must be equal to constant"}],!1;var Se=u===e}else var Se=!0;if(Se)if(r.code!==void 0){let i=r.code;const u=e,A=e;let a=!1;const R=e;if(typeof i!="string"){const H={instancePath:t+"/code",schemaPath:"#/oneOf/18/properties/code/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[H]:s.push(H),e++}var wr=R===e;if(a=a||wr,!a){const H=e;if(e===H)if(i&&typeof i=="object"&&!Array.isArray(i)){let fe;if(i.filename===void 0&&(fe="filename")||i.content===void 0&&(fe="content")){const Ae={instancePath:t+"/code",schemaPath:"#/oneOf/18/properties/code/anyOf/1/required",keyword:"required",params:{missingProperty:fe},message:"must have required property '"+fe+"'"};s===null?s=[Ae]:s.push(Ae),e++}else{const Ae=e;for(const ae in i)if(!(ae==="filename"||ae==="content")){const $e={instancePath:t+"/code",schemaPath:"#/oneOf/18/properties/code/anyOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:ae},message:"must NOT have additional properties"};s===null?s=[$e]:s.push($e),e++;break}if(Ae===e){if(i.filename!==void 0){const ae=e;if(typeof i.filename!="string"){const $e={instancePath:t+"/code/filename",schemaPath:"#/oneOf/18/properties/code/anyOf/1/properties/filename/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[$e]:s.push($e),e++}var Qe=ae===e}else var Qe=!0;if(Qe)if(i.content!==void 0){const ae=e;if(typeof i.content!="string"){const K={instancePath:t+"/code/content",schemaPath:"#/oneOf/18/properties/code/anyOf/1/properties/content/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[K]:s.push(K),e++}var Qe=ae===e}else var Qe=!0}}}else{const fe={instancePath:t+"/code",schemaPath:"#/oneOf/18/properties/code/anyOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[fe]:s.push(fe),e++}var wr=H===e;a=a||wr}if(a)e=A,s!==null&&(A?s.length=A:s=null);else{const H={instancePath:t+"/code",schemaPath:"#/oneOf/18/properties/code/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[H]:s.push(H),e++,o.errors=s,!1}var Se=u===e}else var Se=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/18/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="runPHPWithOptions"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.options===void 0&&(c="options")||r.step===void 0&&(c="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/19/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="step"||i==="options"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/19/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/19/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/19/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var Ge=R===e}else var Ge=!0;if(Ge)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/19/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Ge=a===e}else var Ge=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/19/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var Re=u===e}else var Re=!0;if(Re){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/19/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="runPHPWithOptions")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/19/properties/step/const",keyword:"const",params:{allowedValue:"runPHPWithOptions"},message:"must be equal to constant"}],!1;var Re=u===e}else var Re=!0;if(Re)if(r.options!==void 0){const i=e;le(r.options,{instancePath:t+"/options",parentData:r,parentDataProperty:"options",rootData:l})||(s=s===null?le.errors:s.concat(le.errors),e=s.length);var Re=i===e}else var Re=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/19/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="runWpInstallationWizard"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.options===void 0&&(c="options")||r.step===void 0&&(c="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/20/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="step"||i==="options"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/20/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/20/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/20/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var Je=R===e}else var Je=!0;if(Je)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/20/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Je=a===e}else var Je=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/20/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var Le=u===e}else var Le=!0;if(Le){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/20/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="runWpInstallationWizard")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/20/properties/step/const",keyword:"const",params:{allowedValue:"runWpInstallationWizard"},message:"must be equal to constant"}],!1;var Le=u===e}else var Le=!0;if(Le)if(r.options!==void 0){let i=r.options;const u=e;if(e===e)if(i&&typeof i=="object"&&!Array.isArray(i)){const R=e;for(const V in i)if(!(V==="adminUsername"||V==="adminPassword"))return o.errors=[{instancePath:t+"/options",schemaPath:"#/definitions/WordPressInstallationOptions/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:V},message:"must NOT have additional properties"}],!1;if(R===e){if(i.adminUsername!==void 0){const V=e;if(typeof i.adminUsername!="string")return o.errors=[{instancePath:t+"/options/adminUsername",schemaPath:"#/definitions/WordPressInstallationOptions/properties/adminUsername/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Xe=V===e}else var Xe=!0;if(Xe)if(i.adminPassword!==void 0){const V=e;if(typeof i.adminPassword!="string")return o.errors=[{instancePath:t+"/options/adminPassword",schemaPath:"#/definitions/WordPressInstallationOptions/properties/adminPassword/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Xe=V===e}else var Xe=!0}}else return o.errors=[{instancePath:t+"/options",schemaPath:"#/definitions/WordPressInstallationOptions/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var Le=u===e}else var Le=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/20/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="runSql"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.sql===void 0&&(c="sql")||r.step===void 0&&(c="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/21/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="step"||i==="sql"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/21/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/21/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/21/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var Ke=R===e}else var Ke=!0;if(Ke)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/21/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Ke=a===e}else var Ke=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/21/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var Ne=u===e}else var Ne=!0;if(Ne){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/21/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="runSql")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/21/properties/step/const",keyword:"const",params:{allowedValue:"runSql"},message:"must be equal to constant"}],!1;var Ne=u===e}else var Ne=!0;if(Ne)if(r.sql!==void 0){const i=e;ee(r.sql,{instancePath:t+"/sql",parentData:r,parentDataProperty:"sql",rootData:l})||(s=s===null?ee.errors:s.concat(ee.errors),e=s.length);var Ne=i===e}else var Ne=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/21/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="setSiteOptions"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.options===void 0&&(c="options")||r.step===void 0&&(c="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/22/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="step"||i==="options"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/22/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/22/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/22/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var er=R===e}else var er=!0;if(er)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/22/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var er=a===e}else var er=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/22/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var Fe=u===e}else var Fe=!0;if(Fe){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/22/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="setSiteOptions")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/22/properties/step/const",keyword:"const",params:{allowedValue:"setSiteOptions"},message:"must be equal to constant"}],!1;var Fe=u===e}else var Fe=!0;if(Fe)if(r.options!==void 0){let i=r.options;const u=e;if(e===u&&!(i&&typeof i=="object"&&!Array.isArray(i)))return o.errors=[{instancePath:t+"/options",schemaPath:"#/oneOf/22/properties/options/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var Fe=u===e}else var Fe=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/22/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="unzip"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.extractToPath===void 0&&(c="extractToPath")||r.step===void 0&&(c="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/23/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="step"||i==="zipFile"||i==="zipPath"||i==="extractToPath"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/23/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/23/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/23/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var rr=R===e}else var rr=!0;if(rr)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/23/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var rr=a===e}else var rr=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/23/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var me=u===e}else var me=!0;if(me){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/23/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="unzip")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/23/properties/step/const",keyword:"const",params:{allowedValue:"unzip"},message:"must be equal to constant"}],!1;var me=u===e}else var me=!0;if(me){if(r.zipFile!==void 0){const i=e;ee(r.zipFile,{instancePath:t+"/zipFile",parentData:r,parentDataProperty:"zipFile",rootData:l})||(s=s===null?ee.errors:s.concat(ee.errors),e=s.length);var me=i===e}else var me=!0;if(me){if(r.zipPath!==void 0){const i=e;if(typeof r.zipPath!="string")return o.errors=[{instancePath:t+"/zipPath",schemaPath:"#/oneOf/23/properties/zipPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var me=i===e}else var me=!0;if(me)if(r.extractToPath!==void 0){const i=e;if(typeof r.extractToPath!="string")return o.errors=[{instancePath:t+"/extractToPath",schemaPath:"#/oneOf/23/properties/extractToPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var me=i===e}else var me=!0}}}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/23/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="updateUserMeta"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.meta===void 0&&(c="meta")||r.step===void 0&&(c="step")||r.userId===void 0&&(c="userId"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/24/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="step"||i==="meta"||i==="userId"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/24/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/24/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/24/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var tr=R===e}else var tr=!0;if(tr)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/24/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var tr=a===e}else var tr=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/24/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var Oe=u===e}else var Oe=!0;if(Oe){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/24/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="updateUserMeta")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/24/properties/step/const",keyword:"const",params:{allowedValue:"updateUserMeta"},message:"must be equal to constant"}],!1;var Oe=u===e}else var Oe=!0;if(Oe){if(r.meta!==void 0){let i=r.meta;const u=e;if(e===u&&!(i&&typeof i=="object"&&!Array.isArray(i)))return o.errors=[{instancePath:t+"/meta",schemaPath:"#/oneOf/24/properties/meta/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var Oe=u===e}else var Oe=!0;if(Oe)if(r.userId!==void 0){let i=r.userId;const u=e;if(!(typeof i=="number"&&isFinite(i)))return o.errors=[{instancePath:t+"/userId",schemaPath:"#/oneOf/24/properties/userId/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var Oe=u===e}else var Oe=!0}}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/24/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="writeFile"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.data===void 0&&(c="data")||r.path===void 0&&(c="path")||r.step===void 0&&(c="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/25/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="step"||i==="path"||i==="data"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/25/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/25/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/25/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var sr=R===e}else var sr=!0;if(sr)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/25/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var sr=a===e}else var sr=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/25/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var ke=u===e}else var ke=!0;if(ke){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/25/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="writeFile")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/25/properties/step/const",keyword:"const",params:{allowedValue:"writeFile"},message:"must be equal to constant"}],!1;var ke=u===e}else var ke=!0;if(ke){if(r.path!==void 0){const i=e;if(typeof r.path!="string")return o.errors=[{instancePath:t+"/path",schemaPath:"#/oneOf/25/properties/path/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var ke=i===e}else var ke=!0;if(ke)if(r.data!==void 0){let i=r.data;const u=e,A=e;let a=!1;const R=e;ee(i,{instancePath:t+"/data",parentData:r,parentDataProperty:"data",rootData:l})||(s=s===null?ee.errors:s.concat(ee.errors),e=s.length);var De=R===e;if(a=a||De,!a){const H=e;if(typeof i!="string"){const fe={instancePath:t+"/data",schemaPath:"#/oneOf/25/properties/data/anyOf/1/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[fe]:s.push(fe),e++}var De=H===e;if(a=a||De,!a){const fe=e;if(e===fe)if(i&&typeof i=="object"&&!Array.isArray(i)){let ae;if(i.BYTES_PER_ELEMENT===void 0&&(ae="BYTES_PER_ELEMENT")||i.buffer===void 0&&(ae="buffer")||i.byteLength===void 0&&(ae="byteLength")||i.byteOffset===void 0&&(ae="byteOffset")||i.length===void 0&&(ae="length")){const $e={instancePath:t+"/data",schemaPath:"#/oneOf/25/properties/data/anyOf/2/required",keyword:"required",params:{missingProperty:ae},message:"must have required property '"+ae+"'"};s===null?s=[$e]:s.push($e),e++}else{const $e=e;for(const K in i)if(!(K==="BYTES_PER_ELEMENT"||K==="buffer"||K==="byteLength"||K==="byteOffset"||K==="length")){let he=i[K];const ar=e;if(!(typeof he=="number"&&isFinite(he))){const ue={instancePath:t+"/data/"+K.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/oneOf/25/properties/data/anyOf/2/additionalProperties/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[ue]:s.push(ue),e++}var Bt=ar===e;if(!Bt)break}if($e===e){if(i.BYTES_PER_ELEMENT!==void 0){let K=i.BYTES_PER_ELEMENT;const he=e;if(!(typeof K=="number"&&isFinite(K))){const ar={instancePath:t+"/data/BYTES_PER_ELEMENT",schemaPath:"#/oneOf/25/properties/data/anyOf/2/properties/BYTES_PER_ELEMENT/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[ar]:s.push(ar),e++}var ye=he===e}else var ye=!0;if(ye){if(i.buffer!==void 0){let K=i.buffer;const he=e;if(e===he)if(K&&typeof K=="object"&&!Array.isArray(K)){let ue;if(K.byteLength===void 0&&(ue="byteLength")){const pr={instancePath:t+"/data/buffer",schemaPath:"#/oneOf/25/properties/data/anyOf/2/properties/buffer/required",keyword:"required",params:{missingProperty:ue},message:"must have required property '"+ue+"'"};s===null?s=[pr]:s.push(pr),e++}else{const pr=e;for(const Ue in K)if(Ue!=="byteLength"){const We={instancePath:t+"/data/buffer",schemaPath:"#/oneOf/25/properties/data/anyOf/2/properties/buffer/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:Ue},message:"must NOT have additional properties"};s===null?s=[We]:s.push(We),e++;break}if(pr===e&&K.byteLength!==void 0){let Ue=K.byteLength;if(!(typeof Ue=="number"&&isFinite(Ue))){const We={instancePath:t+"/data/buffer/byteLength",schemaPath:"#/oneOf/25/properties/data/anyOf/2/properties/buffer/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[We]:s.push(We),e++}}}}else{const ue={instancePath:t+"/data/buffer",schemaPath:"#/oneOf/25/properties/data/anyOf/2/properties/buffer/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[ue]:s.push(ue),e++}var ye=he===e}else var ye=!0;if(ye){if(i.byteLength!==void 0){let K=i.byteLength;const he=e;if(!(typeof K=="number"&&isFinite(K))){const ue={instancePath:t+"/data/byteLength",schemaPath:"#/oneOf/25/properties/data/anyOf/2/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[ue]:s.push(ue),e++}var ye=he===e}else var ye=!0;if(ye){if(i.byteOffset!==void 0){let K=i.byteOffset;const he=e;if(!(typeof K=="number"&&isFinite(K))){const ue={instancePath:t+"/data/byteOffset",schemaPath:"#/oneOf/25/properties/data/anyOf/2/properties/byteOffset/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[ue]:s.push(ue),e++}var ye=he===e}else var ye=!0;if(ye)if(i.length!==void 0){let K=i.length;const he=e;if(!(typeof K=="number"&&isFinite(K))){const ue={instancePath:t+"/data/length",schemaPath:"#/oneOf/25/properties/data/anyOf/2/properties/length/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[ue]:s.push(ue),e++}var ye=he===e}else var ye=!0}}}}}}else{const ae={instancePath:t+"/data",schemaPath:"#/oneOf/25/properties/data/anyOf/2/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[ae]:s.push(ae),e++}var De=fe===e;a=a||De}}if(a)e=A,s!==null&&(A?s.length=A:s=null);else{const H={instancePath:t+"/data",schemaPath:"#/oneOf/25/properties/data/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[H]:s.push(H),e++,o.errors=s,!1}var ke=u===e}else var ke=!0}}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/25/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="writeFiles"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.filesTree===void 0&&(c="filesTree")||r.step===void 0&&(c="step")||r.writeToPath===void 0&&(c="writeToPath"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/26/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="step"||i==="writeToPath"||i==="filesTree"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/26/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/26/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/26/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var ir=R===e}else var ir=!0;if(ir)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/26/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var ir=a===e}else var ir=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/26/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var Ee=u===e}else var Ee=!0;if(Ee){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/26/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="writeFiles")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/26/properties/step/const",keyword:"const",params:{allowedValue:"writeFiles"},message:"must be equal to constant"}],!1;var Ee=u===e}else var Ee=!0;if(Ee){if(r.writeToPath!==void 0){const i=e;if(typeof r.writeToPath!="string")return o.errors=[{instancePath:t+"/writeToPath",schemaPath:"#/oneOf/26/properties/writeToPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Ee=i===e}else var Ee=!0;if(Ee)if(r.filesTree!==void 0){const i=e;ce(r.filesTree,{instancePath:t+"/filesTree",parentData:r,parentDataProperty:"filesTree",rootData:l})||(s=s===null?ce.errors:s.concat(ce.errors),e=s.length);var Ee=i===e}else var Ee=!0}}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/26/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="wp-cli"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.command===void 0&&(c="command")||r.step===void 0&&(c="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/27/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="step"||i==="command"||i==="wpCliPath"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/27/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/27/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/27/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var or=R===e}else var or=!0;if(or)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/27/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var or=a===e}else var or=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/27/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var Te=u===e}else var Te=!0;if(Te){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/27/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="wp-cli")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/27/properties/step/const",keyword:"const",params:{allowedValue:"wp-cli"},message:"must be equal to constant"}],!1;var Te=u===e}else var Te=!0;if(Te){if(r.command!==void 0){let i=r.command;const u=e,A=e;let a=!1;const R=e;if(typeof i!="string"){const H={instancePath:t+"/command",schemaPath:"#/oneOf/27/properties/command/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[H]:s.push(H),e++}var br=R===e;if(a=a||br,!a){const H=e;if(e===H)if(Array.isArray(i)){var xr=!0;const fe=i.length;for(let Ae=0;Ae<fe;Ae++){const ae=e;if(typeof i[Ae]!="string"){const K={instancePath:t+"/command/"+Ae,schemaPath:"#/oneOf/27/properties/command/anyOf/1/items/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[K]:s.push(K),e++}var xr=ae===e;if(!xr)break}}else{const fe={instancePath:t+"/command",schemaPath:"#/oneOf/27/properties/command/anyOf/1/type",keyword:"type",params:{type:"array"},message:"must be array"};s===null?s=[fe]:s.push(fe),e++}var br=H===e;a=a||br}if(a)e=A,s!==null&&(A?s.length=A:s=null);else{const H={instancePath:t+"/command",schemaPath:"#/oneOf/27/properties/command/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[H]:s.push(H),e++,o.errors=s,!1}var Te=u===e}else var Te=!0;if(Te)if(r.wpCliPath!==void 0){const i=e;if(typeof r.wpCliPath!="string")return o.errors=[{instancePath:t+"/wpCliPath",schemaPath:"#/oneOf/27/properties/wpCliPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Te=i===e}else var Te=!0}}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/27/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(se==="setSiteLanguage"){if(e===e)if(r&&typeof r=="object"&&!Array.isArray(r)){let c;if(r.language===void 0&&(c="language")||r.step===void 0&&(c="step"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/28/required",keyword:"required",params:{missingProperty:c},message:"must have required property '"+c+"'"}],!1;{const I=e;for(const i in r)if(!(i==="progress"||i==="step"||i==="language"))return o.errors=[{instancePath:t,schemaPath:"#/oneOf/28/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===e){if(r.progress!==void 0){let i=r.progress;const u=e;if(e===u)if(i&&typeof i=="object"&&!Array.isArray(i)){const A=e;for(const a in i)if(!(a==="weight"||a==="caption"))return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/28/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:a},message:"must NOT have additional properties"}],!1;if(A===e){if(i.weight!==void 0){let a=i.weight;const R=e;if(!(typeof a=="number"&&isFinite(a)))return o.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/28/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var nr=R===e}else var nr=!0;if(nr)if(i.caption!==void 0){const a=e;if(typeof i.caption!="string")return o.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/28/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var nr=a===e}else var nr=!0}}else return o.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/28/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var xe=u===e}else var xe=!0;if(xe){if(r.step!==void 0){let i=r.step;const u=e;if(typeof i!="string")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/28/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="setSiteLanguage")return o.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/28/properties/step/const",keyword:"const",params:{allowedValue:"setSiteLanguage"},message:"must be equal to constant"}],!1;var xe=u===e}else var xe=!0;if(xe)if(r.language!==void 0){const i=e;if(typeof r.language!="string")return o.errors=[{instancePath:t+"/language",schemaPath:"#/oneOf/28/properties/language/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var xe=i===e}else var xe=!0}}}}else return o.errors=[{instancePath:t,schemaPath:"#/oneOf/28/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else return o.errors=[{instancePath:t,schemaPath:"#/discriminator",keyword:"discriminator",params:{error:"mapping",tag:"step",tagValue:se},message:'value of tag "step" must be in oneOf'}],!1;else return o.errors=[{instancePath:t,schemaPath:"#/discriminator",keyword:"discriminator",params:{error:"tag",tag:"step",tagValue:se},message:'tag "step" must be string'}],!1}}else return o.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return o.errors=s,e===0}function Y(r,{instancePath:t="",parentData:n,parentDataProperty:p,rootData:l=r}={}){let s=null,e=0;if(e===0)if(r&&typeof r=="object"&&!Array.isArray(r)){const G=e;for(const v in r)if(!_t.call(Es.properties,v))return Y.errors=[{instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:v},message:"must NOT have additional properties"}],!1;if(G===e){if(r.landingPage!==void 0){const v=e;if(typeof r.landingPage!="string")return Y.errors=[{instancePath:t+"/landingPage",schemaPath:"#/properties/landingPage/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var f=v===e}else var f=!0;if(f){if(r.description!==void 0){const v=e;if(typeof r.description!="string")return Y.errors=[{instancePath:t+"/description",schemaPath:"#/properties/description/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var f=v===e}else var f=!0;if(f){if(r.meta!==void 0){let v=r.meta;const j=e;if(e===j)if(v&&typeof v=="object"&&!Array.isArray(v)){let $;if(v.title===void 0&&($="title")||v.author===void 0&&($="author"))return Y.errors=[{instancePath:t+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty:$},message:"must have required property '"+$+"'"}],!1;{const _=e;for(const m in v)if(!(m==="title"||m==="description"||m==="author"||m==="categories"))return Y.errors=[{instancePath:t+"/meta",schemaPath:"#/properties/meta/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:m},message:"must NOT have additional properties"}],!1;if(_===e){if(v.title!==void 0){const m=e;if(typeof v.title!="string")return Y.errors=[{instancePath:t+"/meta/title",schemaPath:"#/properties/meta/properties/title/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var d=m===e}else var d=!0;if(d){if(v.description!==void 0){const m=e;if(typeof v.description!="string")return Y.errors=[{instancePath:t+"/meta/description",schemaPath:"#/properties/meta/properties/description/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var d=m===e}else var d=!0;if(d){if(v.author!==void 0){const m=e;if(typeof v.author!="string")return Y.errors=[{instancePath:t+"/meta/author",schemaPath:"#/properties/meta/properties/author/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var d=m===e}else var d=!0;if(d)if(v.categories!==void 0){let m=v.categories;const w=e;if(e===w)if(Array.isArray(m)){var g=!0;const O=m.length;for(let D=0;D<O;D++){const F=e;if(typeof m[D]!="string")return Y.errors=[{instancePath:t+"/meta/categories/"+D,schemaPath:"#/properties/meta/properties/categories/items/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var g=F===e;if(!g)break}}else return Y.errors=[{instancePath:t+"/meta/categories",schemaPath:"#/properties/meta/properties/categories/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;var d=w===e}else var d=!0}}}}}else return Y.errors=[{instancePath:t+"/meta",schemaPath:"#/properties/meta/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var f=j===e}else var f=!0;if(f){if(r.preferredVersions!==void 0){let v=r.preferredVersions;const j=e;if(e===j)if(v&&typeof v=="object"&&!Array.isArray(v)){let $;if(v.php===void 0&&($="php")||v.wp===void 0&&($="wp"))return Y.errors=[{instancePath:t+"/preferredVersions",schemaPath:"#/properties/preferredVersions/required",keyword:"required",params:{missingProperty:$},message:"must have required property '"+$+"'"}],!1;{const _=e;for(const m in v)if(!(m==="php"||m==="wp"))return Y.errors=[{instancePath:t+"/preferredVersions",schemaPath:"#/properties/preferredVersions/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:m},message:"must NOT have additional properties"}],!1;if(_===e){if(v.php!==void 0){let m=v.php;const w=e,U=e;let O=!1;const D=e;Be(m,{instancePath:t+"/preferredVersions/php",parentData:v,parentDataProperty:"php",rootData:l})||(s=s===null?Be.errors:s.concat(Be.errors),e=s.length);var y=D===e;if(O=O||y,!O){const F=e;if(typeof m!="string"){const x={instancePath:t+"/preferredVersions/php",schemaPath:"#/properties/preferredVersions/properties/php/anyOf/1/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[x]:s.push(x),e++}if(m!=="latest"){const x={instancePath:t+"/preferredVersions/php",schemaPath:"#/properties/preferredVersions/properties/php/anyOf/1/const",keyword:"const",params:{allowedValue:"latest"},message:"must be equal to constant"};s===null?s=[x]:s.push(x),e++}var y=F===e;O=O||y}if(O)e=U,s!==null&&(U?s.length=U:s=null);else{const F={instancePath:t+"/preferredVersions/php",schemaPath:"#/properties/preferredVersions/properties/php/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[F]:s.push(F),e++,Y.errors=s,!1}var h=w===e}else var h=!0;if(h)if(v.wp!==void 0){let m=v.wp;const w=e,U=e;let O=!1;const D=e;if(typeof m!="string"){const L={instancePath:t+"/preferredVersions/wp",schemaPath:"#/properties/preferredVersions/properties/wp/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[L]:s.push(L),e++}var E=D===e;if(O=O||E,!O){const L=e;if(typeof m!="string"){const N={instancePath:t+"/preferredVersions/wp",schemaPath:"#/properties/preferredVersions/properties/wp/anyOf/1/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[N]:s.push(N),e++}if(m!=="latest"){const N={instancePath:t+"/preferredVersions/wp",schemaPath:"#/properties/preferredVersions/properties/wp/anyOf/1/const",keyword:"const",params:{allowedValue:"latest"},message:"must be equal to constant"};s===null?s=[N]:s.push(N),e++}var E=L===e;if(O=O||E,!O){const N=e;if(typeof m!="boolean"){const S={instancePath:t+"/preferredVersions/wp",schemaPath:"#/properties/preferredVersions/properties/wp/anyOf/2/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};s===null?s=[S]:s.push(S),e++}if(m!==!1){const S={instancePath:t+"/preferredVersions/wp",schemaPath:"#/properties/preferredVersions/properties/wp/anyOf/2/const",keyword:"const",params:{allowedValue:!1},message:"must be equal to constant"};s===null?s=[S]:s.push(S),e++}var E=N===e;O=O||E}}if(O)e=U,s!==null&&(U?s.length=U:s=null);else{const L={instancePath:t+"/preferredVersions/wp",schemaPath:"#/properties/preferredVersions/properties/wp/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[L]:s.push(L),e++,Y.errors=s,!1}var h=w===e}else var h=!0}}}else return Y.errors=[{instancePath:t+"/preferredVersions",schemaPath:"#/properties/preferredVersions/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var f=j===e}else var f=!0;if(f){if(r.features!==void 0){let v=r.features;const j=e;if(e===j)if(v&&typeof v=="object"&&!Array.isArray(v)){const $=e;for(const _ in v)if(!(_==="intl"||_==="networking"))return Y.errors=[{instancePath:t+"/features",schemaPath:"#/properties/features/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:_},message:"must NOT have additional properties"}],!1;if($===e){if(v.intl!==void 0){const _=e;if(typeof v.intl!="boolean")return Y.errors=[{instancePath:t+"/features/intl",schemaPath:"#/properties/features/properties/intl/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var k=_===e}else var k=!0;if(k)if(v.networking!==void 0){const _=e;if(typeof v.networking!="boolean")return Y.errors=[{instancePath:t+"/features/networking",schemaPath:"#/properties/features/properties/networking/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var k=_===e}else var k=!0}}else return Y.errors=[{instancePath:t+"/features",schemaPath:"#/properties/features/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var f=j===e}else var f=!0;if(f){if(r.extraLibraries!==void 0){let v=r.extraLibraries;const j=e;if(e===j)if(Array.isArray(v)){var T=!0;const $=v.length;for(let _=0;_<$;_++){let m=v[_];const w=e;if(typeof m!="string")return Y.errors=[{instancePath:t+"/extraLibraries/"+_,schemaPath:"#/definitions/ExtraLibrary/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(m!=="wp-cli")return Y.errors=[{instancePath:t+"/extraLibraries/"+_,schemaPath:"#/definitions/ExtraLibrary/const",keyword:"const",params:{allowedValue:"wp-cli"},message:"must be equal to constant"}],!1;var T=w===e;if(!T)break}}else return Y.errors=[{instancePath:t+"/extraLibraries",schemaPath:"#/properties/extraLibraries/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;var f=j===e}else var f=!0;if(f){if(r.constants!==void 0){let v=r.constants;const j=e;if(e===e)if(v&&typeof v=="object"&&!Array.isArray(v))for(const _ in v){let m=v[_];const w=e;if(typeof m!="string"&&typeof m!="boolean"&&!(typeof m=="number"&&isFinite(m)))return Y.errors=[{instancePath:t+"/constants/"+_.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/definitions/PHPConstants/additionalProperties/type",keyword:"type",params:{type:Ts.additionalProperties.type},message:"must be string,boolean,number"}],!1;var b=w===e;if(!b)break}else return Y.errors=[{instancePath:t+"/constants",schemaPath:"#/definitions/PHPConstants/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var f=j===e}else var f=!0;if(f){if(r.plugins!==void 0){let v=r.plugins;const j=e;if(e===j)if(Array.isArray(v)){var M=!0;const $=v.length;for(let _=0;_<$;_++){let m=v[_];const w=e,U=e;let O=!1;const D=e;if(typeof m!="string"){const L={instancePath:t+"/plugins/"+_,schemaPath:"#/properties/plugins/items/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[L]:s.push(L),e++}var X=D===e;if(O=O||X,!O){const L=e;ee(m,{instancePath:t+"/plugins/"+_,parentData:v,parentDataProperty:_,rootData:l})||(s=s===null?ee.errors:s.concat(ee.errors),e=s.length);var X=L===e;O=O||X}if(O)e=U,s!==null&&(U?s.length=U:s=null);else{const L={instancePath:t+"/plugins/"+_,schemaPath:"#/properties/plugins/items/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[L]:s.push(L),e++,Y.errors=s,!1}var M=w===e;if(!M)break}}else return Y.errors=[{instancePath:t+"/plugins",schemaPath:"#/properties/plugins/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;var f=j===e}else var f=!0;if(f){if(r.siteOptions!==void 0){let v=r.siteOptions;const j=e;if(e===j)if(v&&typeof v=="object"&&!Array.isArray(v)){const $=e;for(const _ in v)if(_!=="blogname"){const m=e;if(typeof v[_]!="string")return Y.errors=[{instancePath:t+"/siteOptions/"+_.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/siteOptions/additionalProperties/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var re=m===e;if(!re)break}if($===e&&v.blogname!==void 0&&typeof v.blogname!="string")return Y.errors=[{instancePath:t+"/siteOptions/blogname",schemaPath:"#/properties/siteOptions/properties/blogname/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1}else return Y.errors=[{instancePath:t+"/siteOptions",schemaPath:"#/properties/siteOptions/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var f=j===e}else var f=!0;if(f){if(r.login!==void 0){let v=r.login;const j=e,P=e;let $=!1;const _=e;if(typeof v!="boolean"){const w={instancePath:t+"/login",schemaPath:"#/properties/login/anyOf/0/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};s===null?s=[w]:s.push(w),e++}var q=_===e;if($=$||q,!$){const w=e;if(e===w)if(v&&typeof v=="object"&&!Array.isArray(v)){let O;if(v.username===void 0&&(O="username")||v.password===void 0&&(O="password")){const D={instancePath:t+"/login",schemaPath:"#/properties/login/anyOf/1/required",keyword:"required",params:{missingProperty:O},message:"must have required property '"+O+"'"};s===null?s=[D]:s.push(D),e++}else{const D=e;for(const F in v)if(!(F==="username"||F==="password")){const L={instancePath:t+"/login",schemaPath:"#/properties/login/anyOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:F},message:"must NOT have additional properties"};s===null?s=[L]:s.push(L),e++;break}if(D===e){if(v.username!==void 0){const F=e;if(typeof v.username!="string"){const L={instancePath:t+"/login/username",schemaPath:"#/properties/login/anyOf/1/properties/username/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[L]:s.push(L),e++}var B=F===e}else var B=!0;if(B)if(v.password!==void 0){const F=e;if(typeof v.password!="string"){const x={instancePath:t+"/login/password",schemaPath:"#/properties/login/anyOf/1/properties/password/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[x]:s.push(x),e++}var B=F===e}else var B=!0}}}else{const O={instancePath:t+"/login",schemaPath:"#/properties/login/anyOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[O]:s.push(O),e++}var q=w===e;$=$||q}if($)e=P,s!==null&&(P?s.length=P:s=null);else{const w={instancePath:t+"/login",schemaPath:"#/properties/login/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[w]:s.push(w),e++,Y.errors=s,!1}var f=j===e}else var f=!0;if(f){if(r.steps!==void 0){let v=r.steps;const j=e;if(e===j)if(Array.isArray(v)){var Z=!0;const $=v.length;for(let _=0;_<$;_++){let m=v[_];const w=e,U=e;let O=!1;const D=e;o(m,{instancePath:t+"/steps/"+_,parentData:v,parentDataProperty:_,rootData:l})||(s=s===null?o.errors:s.concat(o.errors),e=s.length);var Q=D===e;if(O=O||Q,!O){const L=e;if(typeof m!="string"){const N={instancePath:t+"/steps/"+_,schemaPath:"#/properties/steps/items/anyOf/1/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[N]:s.push(N),e++}var Q=L===e;if(O=O||Q,!O){const N=e,te={instancePath:t+"/steps/"+_,schemaPath:"#/properties/steps/items/anyOf/2/not",keyword:"not",params:{},message:"must NOT be valid"};s===null?s=[te]:s.push(te),e++;var Q=N===e;if(O=O||Q,!O){const z=e;if(typeof m!="boolean"){const W={instancePath:t+"/steps/"+_,schemaPath:"#/properties/steps/items/anyOf/3/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};s===null?s=[W]:s.push(W),e++}if(m!==!1){const W={instancePath:t+"/steps/"+_,schemaPath:"#/properties/steps/items/anyOf/3/const",keyword:"const",params:{allowedValue:!1},message:"must be equal to constant"};s===null?s=[W]:s.push(W),e++}var Q=z===e;if(O=O||Q,!O){const W=e;if(m!==null){const pe={instancePath:t+"/steps/"+_,schemaPath:"#/properties/steps/items/anyOf/4/type",keyword:"type",params:{type:"null"},message:"must be null"};s===null?s=[pe]:s.push(pe),e++}var Q=W===e;O=O||Q}}}}if(O)e=U,s!==null&&(U?s.length=U:s=null);else{const L={instancePath:t+"/steps/"+_,schemaPath:"#/properties/steps/items/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[L]:s.push(L),e++,Y.errors=s,!1}var Z=w===e;if(!Z)break}}else return Y.errors=[{instancePath:t+"/steps",schemaPath:"#/properties/steps/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;var f=j===e}else var f=!0;if(f)if(r.$schema!==void 0){const v=e;if(typeof r.$schema!="string")return Y.errors=[{instancePath:t+"/$schema",schemaPath:"#/properties/%24schema/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var f=v===e}else var f=!0}}}}}}}}}}}}else return Y.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return Y.errors=s,e===0}function ur(r,{instancePath:t="",parentData:n,parentDataProperty:p,rootData:l=r}={}){let s=null,e=0;return Y(r,{instancePath:t,parentData:n,parentDataProperty:p,rootData:l})||(s=s===null?Y.errors:s.concat(Y.errors),e=s.length),ur.errors=s,e===0}function kt(r){const t=r.trim().replace(/\/+$/,"");return/^https:\/\/.+\.git$/.test(t)||/^https:\/\/github\.com\/[^/]+\/[^/]+$/.test(t)?!0:/^https:\/\/gitlab\.com\/[^/]+\/[^/]+(\/[^/]+)*$/.test(t)}const{wpCLI:Ns,...Dr}=ks,Fs={...Dr,"wp-cli":Ns,importFile:Dr.importWxr};class Fr extends Error{constructor(t,n){super(t),this.name="InvalidBlueprintError",this.validationErrors=n}}class Et extends Error{constructor(t){const{stepNumber:n,step:p,cause:l}=t,s=l instanceof Error?l:new Error(String(l)),e=`Error when executing the blueprint step #${n}`,f=s.message?`${e}: ${s.message}`:e;super(f,{cause:s}),this.name="BlueprintStepExecutionError",this.stepNumber=n,this.step=p,this.messages=(s.message||"").split(`
|
|
856
|
-
`).map(
|
|
1024
|
+
for existing apps using this option.`}},required:["consts","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"defineSiteUrl"},siteUrl:{type:"string",description:"The URL"}},required:["siteUrl","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"enableMultisite"},wpCliPath:{type:"string",description:"wp-cli.phar path"}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"importWxr"},file:{$ref:"#/definitions/FileReference",description:"The file to import"},fetchAttachments:{type:"boolean",description:"Whether to fetch and import attachment files referenced by the WXR file.",default:!0},rewriteUrls:{type:"boolean",description:"Whether to rewrite imported URLs to the current site URL.",default:!0},urlMapping:{type:"object",additionalProperties:{type:"string"},description:"Explicit URL replacements to apply when URL rewriting is enabled."},importComments:{type:"boolean",description:"Whether to import comments from the WXR file.",default:!0},defaultAuthorUsername:{type:"string",description:"The fallback local user for imported authors that cannot be mapped.",default:"admin"},authorsMode:{type:"string",enum:["create","default-author","map"],description:"How to assign imported WXR authors to local WordPress users.",default:"default-author"},authorsMap:{type:"object",additionalProperties:{type:"string"},description:"Remote WXR author usernames keyed to existing local usernames."},importUsers:{type:"boolean",description:"Whether to create local users for imported WXR authors.",default:!1},importer:{type:"string",enum:["data-liberation","default"],description:"The importer to use. Possible values:\n\n- `default`: The importer from https://github.com/humanmade/WordPress-Importer\n- `data-liberation`: The experimental Data Liberation WXR importer developed at https://github.com/WordPress/wordpress-playground/issues/1894\n\nThis option is deprecated. The syntax will not be removed, but once the Data Liberation importer matures, it will become the only supported importer and the `importer` option will be ignored.",deprecated:!0}},required:["file","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"importThemeStarterContent",description:"The step identifier."},themeSlug:{type:"string",description:"The name of the theme to import content from."}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"importWordPressFiles"},wordPressFilesZip:{$ref:"#/definitions/FileReference",description:"The zip file containing the top-level WordPress files and directories."},pathInZip:{type:"string",description:"The path inside the zip file where the WordPress files are."}},required:["step","wordPressFilesZip"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},ifAlreadyInstalled:{type:"string",enum:["overwrite","skip","error"],description:"What to do if the asset already exists."},step:{type:"string",const:"installPlugin",description:"The step identifier."},pluginData:{anyOf:[{$ref:"#/definitions/FileReference"},{$ref:"#/definitions/DirectoryReference"}],description:"The plugin files to install. It can be a plugin zip file, a single PHP file, or a directory containing all the plugin files at its root."},pluginZipFile:{$ref:"#/definitions/FileReference",deprecated:". Use 'pluginData' instead."},options:{$ref:"#/definitions/InstallPluginOptions",description:"Optional installation options."}},required:["pluginData","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},ifAlreadyInstalled:{type:"string",enum:["overwrite","skip","error"],description:"What to do if the asset already exists."},step:{type:"string",const:"installTheme",description:"The step identifier."},themeData:{anyOf:[{$ref:"#/definitions/FileReference"},{$ref:"#/definitions/DirectoryReference"}],description:"The theme files to install. It can be either a theme zip file, or a directory containing all the theme files at its root."},themeZipFile:{$ref:"#/definitions/FileReference",deprecated:". Use 'themeData' instead."},options:{$ref:"#/definitions/InstallThemeOptions",description:"Optional installation options."}},required:["step","themeData"]},{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",deprecated:`The password field is deprecated and will be removed in a future version.
|
|
1025
|
+
Only the username field is required for user authentication.`}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"mkdir"},path:{type:"string",description:"The path of the directory you want to create"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"mv"},fromPath:{type:"string",description:"Source path"},toPath:{type:"string",description:"Target path"}},required:["fromPath","step","toPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"resetData"},contentTypes:{type:"array",items:{type:"string",enum:["posts","pages","comments"]},description:"Content types to remove. When omitted, all posts, pages, custom post types, and comments are removed."}},required:["step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"request"},request:{$ref:"#/definitions/PHPRequest",description:"Request details (See /wordpress-playground/api/universal/interface/PHPRequest)"}},required:["request","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"rm"},path:{type:"string",description:"The path to remove"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"rmdir"},path:{type:"string",description:"The path to remove"}},required:["path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runPHP",description:"The step identifier."},code:{anyOf:[{type:"string"},{type:"object",properties:{filename:{type:"string",description:"This property is ignored during Blueprint v1 execution but exists so the same runPHP step structure can be used for Blueprints v1 and v2."},content:{type:"string"}},required:["filename","content"],additionalProperties:!1}],description:"The PHP code to run."}},required:["code","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runPHPWithOptions"},options:{$ref:"#/definitions/PHPRunOptions",description:"Run options (See /wordpress-playground/api/universal/interface/PHPRunOptions/))"}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runWpInstallationWizard"},options:{$ref:"#/definitions/WordPressInstallationOptions"}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"runSql",description:"The step identifier."},sql:{$ref:"#/definitions/FileReference",description:"The SQL to run. Each non-empty line must contain a valid SQL query."}},required:["sql","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"setSiteOptions",description:'The name of the step. Must be "setSiteOptions".'},options:{type:"object",additionalProperties:{},description:"The options to set on the site."}},required:["options","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"unzip"},zipFile:{$ref:"#/definitions/FileReference",description:"The zip file to extract"},zipPath:{type:"string",description:"The path of the zip file to extract",deprecated:"Use zipFile instead."},extractToPath:{type:"string",description:"The path to extract the zip file to"}},required:["extractToPath","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"updateUserMeta"},meta:{type:"object",additionalProperties:{},description:'An object of user meta values to set, e.g. { "first_name": "John" }'},userId:{type:"number",description:"User ID"}},required:["meta","step","userId"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"writeFile"},path:{type:"string",description:"The path of the file to write to"},data:{anyOf:[{$ref:"#/definitions/FileReference"},{type:"string"},{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}}],description:"The data to write"}},required:["data","path","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"writeFiles"},writeToPath:{type:"string",description:"The path of the file to write to"},filesTree:{$ref:"#/definitions/DirectoryReference",description:"The 'filesTree' defines the directory structure, supporting 'literal:directory' or 'git:directory' types. The 'name' represents the root directory, while 'files' is an object where keys are file paths, and values contain either file content as a string or nested objects for subdirectories."}},required:["filesTree","step","writeToPath"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"wp-cli",description:"The step identifier."},command:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}],description:"The WP CLI command to run."},wpCliPath:{type:"string",description:"wp-cli.phar path"}},required:["command","step"]},{type:"object",additionalProperties:!1,properties:{progress:{type:"object",properties:{weight:{type:"number"},caption:{type:"string"}},additionalProperties:!1},step:{type:"string",const:"setSiteLanguage"},language:{type:"string",description:"The language to set, e.g. 'en_US'"}},required:["language","step"]}]},di={properties:{onError:{enum:["skip-plugin","throw"]}}},mi={properties:{onError:{enum:["skip-theme","throw"]}}},Xt={enum:["GET","POST","HEAD","OPTIONS","PATCH","PUT","DELETE"]};function we(e,{instancePath:t="",parentData:o,parentDataProperty:n,rootData:l=e}={}){let s=null,r=0;if(r===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let J;if(e.url===void 0&&(J="url"))return we.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:J},message:"must have required property '"+J+"'"}],!1;{const ee=r;for(const A in e)if(!(A==="method"||A==="url"||A==="headers"||A==="body"))return we.errors=[{instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:A},message:"must NOT have additional properties"}],!1;if(ee===r){if(e.method!==void 0){let A=e.method;const B=r;if(typeof A!="string")return we.errors=[{instancePath:t+"/method",schemaPath:"#/definitions/HTTPMethod/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(!(A==="GET"||A==="POST"||A==="HEAD"||A==="OPTIONS"||A==="PATCH"||A==="PUT"||A==="DELETE"))return we.errors=[{instancePath:t+"/method",schemaPath:"#/definitions/HTTPMethod/enum",keyword:"enum",params:{allowedValues:Xt.enum},message:"must be equal to one of the allowed values"}],!1;var u=B===r}else var u=!0;if(u){if(e.url!==void 0){const A=r;if(typeof e.url!="string")return we.errors=[{instancePath:t+"/url",schemaPath:"#/properties/url/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var u=A===r}else var u=!0;if(u){if(e.headers!==void 0){let A=e.headers;const B=r;if(r===r)if(A&&typeof A=="object"&&!Array.isArray(A))for(const G in A){const b=r;if(typeof A[G]!="string")return we.errors=[{instancePath:t+"/headers/"+G.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/definitions/PHPRequestHeaders/additionalProperties/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var f=b===r;if(!f)break}else return we.errors=[{instancePath:t+"/headers",schemaPath:"#/definitions/PHPRequestHeaders/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var u=B===r}else var u=!0;if(u)if(e.body!==void 0){let A=e.body;const B=r,Z=r;let te=!1;const G=r;if(typeof A!="string"){const R={instancePath:t+"/body",schemaPath:"#/properties/body/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[R]:s.push(R),r++}var h=G===r;if(te=te||h,!te){const R=r;if(r===R)if(A&&typeof A=="object"&&!Array.isArray(A)){let E;if(A.BYTES_PER_ELEMENT===void 0&&(E="BYTES_PER_ELEMENT")||A.buffer===void 0&&(E="buffer")||A.byteLength===void 0&&(E="byteLength")||A.byteOffset===void 0&&(E="byteOffset")||A.length===void 0&&(E="length")){const v={instancePath:t+"/body",schemaPath:"#/properties/body/anyOf/1/required",keyword:"required",params:{missingProperty:E},message:"must have required property '"+E+"'"};s===null?s=[v]:s.push(v),r++}else{const v=r;for(const g in A)if(!(g==="BYTES_PER_ELEMENT"||g==="buffer"||g==="byteLength"||g==="byteOffset"||g==="length")){let w=A[g];const M=r;if(!(typeof w=="number"&&isFinite(w))){const $={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/1/additionalProperties/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[$]:s.push($),r++}var y=M===r;if(!y)break}if(v===r){if(A.BYTES_PER_ELEMENT!==void 0){let g=A.BYTES_PER_ELEMENT;const w=r;if(!(typeof g=="number"&&isFinite(g))){const M={instancePath:t+"/body/BYTES_PER_ELEMENT",schemaPath:"#/properties/body/anyOf/1/properties/BYTES_PER_ELEMENT/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[M]:s.push(M),r++}var m=w===r}else var m=!0;if(m){if(A.buffer!==void 0){let g=A.buffer;const w=r;if(r===w)if(g&&typeof g=="object"&&!Array.isArray(g)){let $;if(g.byteLength===void 0&&($="byteLength")){const D={instancePath:t+"/body/buffer",schemaPath:"#/properties/body/anyOf/1/properties/buffer/required",keyword:"required",params:{missingProperty:$},message:"must have required property '"+$+"'"};s===null?s=[D]:s.push(D),r++}else{const D=r;for(const x in g)if(x!=="byteLength"){const L={instancePath:t+"/body/buffer",schemaPath:"#/properties/body/anyOf/1/properties/buffer/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:x},message:"must NOT have additional properties"};s===null?s=[L]:s.push(L),r++;break}if(D===r&&g.byteLength!==void 0){let x=g.byteLength;if(!(typeof x=="number"&&isFinite(x))){const L={instancePath:t+"/body/buffer/byteLength",schemaPath:"#/properties/body/anyOf/1/properties/buffer/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[L]:s.push(L),r++}}}}else{const $={instancePath:t+"/body/buffer",schemaPath:"#/properties/body/anyOf/1/properties/buffer/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[$]:s.push($),r++}var m=w===r}else var m=!0;if(m){if(A.byteLength!==void 0){let g=A.byteLength;const w=r;if(!(typeof g=="number"&&isFinite(g))){const $={instancePath:t+"/body/byteLength",schemaPath:"#/properties/body/anyOf/1/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[$]:s.push($),r++}var m=w===r}else var m=!0;if(m){if(A.byteOffset!==void 0){let g=A.byteOffset;const w=r;if(!(typeof g=="number"&&isFinite(g))){const $={instancePath:t+"/body/byteOffset",schemaPath:"#/properties/body/anyOf/1/properties/byteOffset/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[$]:s.push($),r++}var m=w===r}else var m=!0;if(m)if(A.length!==void 0){let g=A.length;const w=r;if(!(typeof g=="number"&&isFinite(g))){const $={instancePath:t+"/body/length",schemaPath:"#/properties/body/anyOf/1/properties/length/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[$]:s.push($),r++}var m=w===r}else var m=!0}}}}}}else{const E={instancePath:t+"/body",schemaPath:"#/properties/body/anyOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[E]:s.push(E),r++}var h=R===r;if(te=te||h,!te){const E=r;if(r===E)if(A&&typeof A=="object"&&!Array.isArray(A))for(const g in A){let w=A[g];const M=r,$=r;let D=!1;const x=r;if(typeof w!="string"){const L={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[L]:s.push(L),r++}var k=x===r;if(D=D||k,!D){const L=r;if(r===L)if(w&&typeof w=="object"&&!Array.isArray(w)){let C;if(w.BYTES_PER_ELEMENT===void 0&&(C="BYTES_PER_ELEMENT")||w.buffer===void 0&&(C="buffer")||w.byteLength===void 0&&(C="byteLength")||w.byteOffset===void 0&&(C="byteOffset")||w.length===void 0&&(C="length")){const se={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/required",keyword:"required",params:{missingProperty:C},message:"must have required property '"+C+"'"};s===null?s=[se]:s.push(se),r++}else{const se=r;for(const q in w)if(!(q==="BYTES_PER_ELEMENT"||q==="buffer"||q==="byteLength"||q==="byteOffset"||q==="length")){let z=w[q];const Q=r;if(!(typeof z=="number"&&isFinite(z))){const V={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/"+q.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/additionalProperties/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[V]:s.push(V),r++}var O=Q===r;if(!O)break}if(se===r){if(w.BYTES_PER_ELEMENT!==void 0){let q=w.BYTES_PER_ELEMENT;const z=r;if(!(typeof q=="number"&&isFinite(q))){const Q={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/BYTES_PER_ELEMENT",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/properties/BYTES_PER_ELEMENT/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[Q]:s.push(Q),r++}var T=z===r}else var T=!0;if(T){if(w.buffer!==void 0){let q=w.buffer;const z=r;if(r===z)if(q&&typeof q=="object"&&!Array.isArray(q)){let V;if(q.byteLength===void 0&&(V="byteLength")){const ae={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/buffer",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/properties/buffer/required",keyword:"required",params:{missingProperty:V},message:"must have required property '"+V+"'"};s===null?s=[ae]:s.push(ae),r++}else{const ae=r;for(const fe in q)if(fe!=="byteLength"){const ye={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/buffer",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/properties/buffer/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:fe},message:"must NOT have additional properties"};s===null?s=[ye]:s.push(ye),r++;break}if(ae===r&&q.byteLength!==void 0){let fe=q.byteLength;if(!(typeof fe=="number"&&isFinite(fe))){const ye={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/buffer/byteLength",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/properties/buffer/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[ye]:s.push(ye),r++}}}}else{const V={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/buffer",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/properties/buffer/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[V]:s.push(V),r++}var T=z===r}else var T=!0;if(T){if(w.byteLength!==void 0){let q=w.byteLength;const z=r;if(!(typeof q=="number"&&isFinite(q))){const V={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/byteLength",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[V]:s.push(V),r++}var T=z===r}else var T=!0;if(T){if(w.byteOffset!==void 0){let q=w.byteOffset;const z=r;if(!(typeof q=="number"&&isFinite(q))){const V={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/byteOffset",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/properties/byteOffset/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[V]:s.push(V),r++}var T=z===r}else var T=!0;if(T)if(w.length!==void 0){let q=w.length;const z=r;if(!(typeof q=="number"&&isFinite(q))){const V={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/length",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/properties/length/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[V]:s.push(V),r++}var T=z===r}else var T=!0}}}}}}else{const C={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[C]:s.push(C),r++}var k=L===r;if(D=D||k,!D){const C=r;if(r===C)if(w&&typeof w=="object"&&!Array.isArray(w)){let q;if(w.lastModified===void 0&&(q="lastModified")||w.name===void 0&&(q="name")||w.size===void 0&&(q="size")||w.type===void 0&&(q="type")||w.webkitRelativePath===void 0&&(q="webkitRelativePath")){const z={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/2/required",keyword:"required",params:{missingProperty:q},message:"must have required property '"+q+"'"};s===null?s=[z]:s.push(z),r++}else{const z=r;for(const Q in w)if(!(Q==="size"||Q==="type"||Q==="lastModified"||Q==="name"||Q==="webkitRelativePath")){const V={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/2/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:Q},message:"must NOT have additional properties"};s===null?s=[V]:s.push(V),r++;break}if(z===r){if(w.size!==void 0){let Q=w.size;const V=r;if(!(typeof Q=="number"&&isFinite(Q))){const ae={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/size",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/2/properties/size/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[ae]:s.push(ae),r++}var _=V===r}else var _=!0;if(_){if(w.type!==void 0){const Q=r;if(typeof w.type!="string"){const ae={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/type",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/2/properties/type/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[ae]:s.push(ae),r++}var _=Q===r}else var _=!0;if(_){if(w.lastModified!==void 0){let Q=w.lastModified;const V=r;if(!(typeof Q=="number"&&isFinite(Q))){const fe={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/lastModified",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/2/properties/lastModified/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[fe]:s.push(fe),r++}var _=V===r}else var _=!0;if(_){if(w.name!==void 0){const Q=r;if(typeof w.name!="string"){const ae={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/name",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/2/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[ae]:s.push(ae),r++}var _=Q===r}else var _=!0;if(_)if(w.webkitRelativePath!==void 0){const Q=r;if(typeof w.webkitRelativePath!="string"){const ae={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1")+"/webkitRelativePath",schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/2/properties/webkitRelativePath/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[ae]:s.push(ae),r++}var _=Q===r}else var _=!0}}}}}}else{const q={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf/2/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[q]:s.push(q),r++}var k=C===r;D=D||k}}if(D)r=$,s!==null&&($?s.length=$:s=null);else{const L={instancePath:t+"/body/"+g.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/2/additionalProperties/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};s===null?s=[L]:s.push(L),r++}var U=M===r;if(!U)break}else{const g={instancePath:t+"/body",schemaPath:"#/properties/body/anyOf/2/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[g]:s.push(g),r++}var h=E===r;te=te||h}}if(te)r=Z,s!==null&&(Z?s.length=Z:s=null);else{const R={instancePath:t+"/body",schemaPath:"#/properties/body/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[R]:s.push(R),r++,we.errors=s,!1}var u=B===r}else var u=!0}}}}}else return we.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return we.errors=s,r===0}const yi={properties:{relativeUri:{type:"string",description:"Request path following the domain:port part – after any URL rewriting rules (e.g. apache .htaccess) have been applied."},scriptPath:{type:"string",description:"Path of the .php file to execute."},protocol:{type:"string",description:"Request protocol."},method:{$ref:"#/definitions/HTTPMethod",description:"Request method. Default: `GET`."},headers:{$ref:"#/definitions/PHPRequestHeaders",description:"Request headers."},body:{anyOf:[{type:"string"},{type:"object",properties:{BYTES_PER_ELEMENT:{type:"number"},buffer:{type:"object",properties:{byteLength:{type:"number"}},required:["byteLength"],additionalProperties:!1},byteLength:{type:"number"},byteOffset:{type:"number"},length:{type:"number"}},required:["BYTES_PER_ELEMENT","buffer","byteLength","byteOffset","length"],additionalProperties:{type:"number"}}],description:"Request body."},env:{type:"object",additionalProperties:{type:"string"},description:"Environment variables to set for this run."},$_SERVER:{type:"object",additionalProperties:{type:"string"},description:"$_SERVER entries to set for this run."},code:{type:"string",description:"The code snippet to eval instead of a php file."}}};function pe(e,{instancePath:t="",parentData:o,parentDataProperty:n,rootData:l=e}={}){let s=null,r=0;if(r===0)if(e&&typeof e=="object"&&!Array.isArray(e)){const T=r;for(const _ in e)if(!rt.call(yi.properties,_))return pe.errors=[{instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:_},message:"must NOT have additional properties"}],!1;if(T===r){if(e.relativeUri!==void 0){const _=r;if(typeof e.relativeUri!="string")return pe.errors=[{instancePath:t+"/relativeUri",schemaPath:"#/properties/relativeUri/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var u=_===r}else var u=!0;if(u){if(e.scriptPath!==void 0){const _=r;if(typeof e.scriptPath!="string")return pe.errors=[{instancePath:t+"/scriptPath",schemaPath:"#/properties/scriptPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var u=_===r}else var u=!0;if(u){if(e.protocol!==void 0){const _=r;if(typeof e.protocol!="string")return pe.errors=[{instancePath:t+"/protocol",schemaPath:"#/properties/protocol/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var u=_===r}else var u=!0;if(u){if(e.method!==void 0){let _=e.method;const U=r;if(typeof _!="string")return pe.errors=[{instancePath:t+"/method",schemaPath:"#/definitions/HTTPMethod/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(!(_==="GET"||_==="POST"||_==="HEAD"||_==="OPTIONS"||_==="PATCH"||_==="PUT"||_==="DELETE"))return pe.errors=[{instancePath:t+"/method",schemaPath:"#/definitions/HTTPMethod/enum",keyword:"enum",params:{allowedValues:Xt.enum},message:"must be equal to one of the allowed values"}],!1;var u=U===r}else var u=!0;if(u){if(e.headers!==void 0){let _=e.headers;const U=r;if(r===r)if(_&&typeof _=="object"&&!Array.isArray(_))for(const A in _){const B=r;if(typeof _[A]!="string")return pe.errors=[{instancePath:t+"/headers/"+A.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/definitions/PHPRequestHeaders/additionalProperties/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var f=B===r;if(!f)break}else return pe.errors=[{instancePath:t+"/headers",schemaPath:"#/definitions/PHPRequestHeaders/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var u=U===r}else var u=!0;if(u){if(e.body!==void 0){let _=e.body;const U=r,J=r;let ee=!1;const A=r;if(typeof _!="string"){const Z={instancePath:t+"/body",schemaPath:"#/properties/body/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[Z]:s.push(Z),r++}var h=A===r;if(ee=ee||h,!ee){const Z=r;if(r===Z)if(_&&typeof _=="object"&&!Array.isArray(_)){let G;if(_.BYTES_PER_ELEMENT===void 0&&(G="BYTES_PER_ELEMENT")||_.buffer===void 0&&(G="buffer")||_.byteLength===void 0&&(G="byteLength")||_.byteOffset===void 0&&(G="byteOffset")||_.length===void 0&&(G="length")){const b={instancePath:t+"/body",schemaPath:"#/properties/body/anyOf/1/required",keyword:"required",params:{missingProperty:G},message:"must have required property '"+G+"'"};s===null?s=[b]:s.push(b),r++}else{const b=r;for(const R in _)if(!(R==="BYTES_PER_ELEMENT"||R==="buffer"||R==="byteLength"||R==="byteOffset"||R==="length")){let P=_[R];const E=r;if(!(typeof P=="number"&&isFinite(P))){const v={instancePath:t+"/body/"+R.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/body/anyOf/1/additionalProperties/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[v]:s.push(v),r++}var y=E===r;if(!y)break}if(b===r){if(_.BYTES_PER_ELEMENT!==void 0){let R=_.BYTES_PER_ELEMENT;const P=r;if(!(typeof R=="number"&&isFinite(R))){const E={instancePath:t+"/body/BYTES_PER_ELEMENT",schemaPath:"#/properties/body/anyOf/1/properties/BYTES_PER_ELEMENT/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[E]:s.push(E),r++}var m=P===r}else var m=!0;if(m){if(_.buffer!==void 0){let R=_.buffer;const P=r;if(r===P)if(R&&typeof R=="object"&&!Array.isArray(R)){let v;if(R.byteLength===void 0&&(v="byteLength")){const g={instancePath:t+"/body/buffer",schemaPath:"#/properties/body/anyOf/1/properties/buffer/required",keyword:"required",params:{missingProperty:v},message:"must have required property '"+v+"'"};s===null?s=[g]:s.push(g),r++}else{const g=r;for(const w in R)if(w!=="byteLength"){const M={instancePath:t+"/body/buffer",schemaPath:"#/properties/body/anyOf/1/properties/buffer/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:w},message:"must NOT have additional properties"};s===null?s=[M]:s.push(M),r++;break}if(g===r&&R.byteLength!==void 0){let w=R.byteLength;if(!(typeof w=="number"&&isFinite(w))){const M={instancePath:t+"/body/buffer/byteLength",schemaPath:"#/properties/body/anyOf/1/properties/buffer/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[M]:s.push(M),r++}}}}else{const v={instancePath:t+"/body/buffer",schemaPath:"#/properties/body/anyOf/1/properties/buffer/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[v]:s.push(v),r++}var m=P===r}else var m=!0;if(m){if(_.byteLength!==void 0){let R=_.byteLength;const P=r;if(!(typeof R=="number"&&isFinite(R))){const v={instancePath:t+"/body/byteLength",schemaPath:"#/properties/body/anyOf/1/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[v]:s.push(v),r++}var m=P===r}else var m=!0;if(m){if(_.byteOffset!==void 0){let R=_.byteOffset;const P=r;if(!(typeof R=="number"&&isFinite(R))){const v={instancePath:t+"/body/byteOffset",schemaPath:"#/properties/body/anyOf/1/properties/byteOffset/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[v]:s.push(v),r++}var m=P===r}else var m=!0;if(m)if(_.length!==void 0){let R=_.length;const P=r;if(!(typeof R=="number"&&isFinite(R))){const v={instancePath:t+"/body/length",schemaPath:"#/properties/body/anyOf/1/properties/length/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[v]:s.push(v),r++}var m=P===r}else var m=!0}}}}}}else{const G={instancePath:t+"/body",schemaPath:"#/properties/body/anyOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[G]:s.push(G),r++}var h=Z===r;ee=ee||h}if(ee)r=J,s!==null&&(J?s.length=J:s=null);else{const Z={instancePath:t+"/body",schemaPath:"#/properties/body/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[Z]:s.push(Z),r++,pe.errors=s,!1}var u=U===r}else var u=!0;if(u){if(e.env!==void 0){let _=e.env;const U=r;if(r===U)if(_&&typeof _=="object"&&!Array.isArray(_))for(const ee in _){const A=r;if(typeof _[ee]!="string")return pe.errors=[{instancePath:t+"/env/"+ee.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/env/additionalProperties/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var k=A===r;if(!k)break}else return pe.errors=[{instancePath:t+"/env",schemaPath:"#/properties/env/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var u=U===r}else var u=!0;if(u){if(e.$_SERVER!==void 0){let _=e.$_SERVER;const U=r;if(r===U)if(_&&typeof _=="object"&&!Array.isArray(_))for(const ee in _){const A=r;if(typeof _[ee]!="string")return pe.errors=[{instancePath:t+"/$_SERVER/"+ee.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/%24_SERVER/additionalProperties/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var O=A===r;if(!O)break}else return pe.errors=[{instancePath:t+"/$_SERVER",schemaPath:"#/properties/%24_SERVER/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var u=U===r}else var u=!0;if(u)if(e.code!==void 0){const _=r;if(typeof e.code!="string")return pe.errors=[{instancePath:t+"/code",schemaPath:"#/properties/code/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var u=_===r}else var u=!0}}}}}}}}}else return pe.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return pe.errors=s,r===0}function a(e,{instancePath:t="",parentData:o,parentDataProperty:n,rootData:l=e}={}){let s=null,r=0;if(r===0)if(e&&typeof e=="object"&&!Array.isArray(e)){let Fr;if(e.step===void 0&&(Fr="step"))return a.errors=[{instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:Fr},message:"must have required property '"+Fr+"'"}],!1;{const re=e.step;if(typeof re=="string")if(re==="activatePlugin"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.pluginPath===void 0&&(d="pluginPath")||e.step===void 0&&(d="step"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/0/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="step"||i==="pluginPath"||i==="pluginName"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/0/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/0/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var u=S===r}else var u=!0;if(u)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/0/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var u=p===r}else var u=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/0/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var f=c===r}else var f=!0;if(f){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/0/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="activatePlugin")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/0/properties/step/const",keyword:"const",params:{allowedValue:"activatePlugin"},message:"must be equal to constant"}],!1;var f=c===r}else var f=!0;if(f){if(e.pluginPath!==void 0){const i=r;if(typeof e.pluginPath!="string")return a.errors=[{instancePath:t+"/pluginPath",schemaPath:"#/oneOf/0/properties/pluginPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var f=i===r}else var f=!0;if(f)if(e.pluginName!==void 0){const i=r;if(typeof e.pluginName!="string")return a.errors=[{instancePath:t+"/pluginName",schemaPath:"#/oneOf/0/properties/pluginName/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var f=i===r}else var f=!0}}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/0/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="activateTheme"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.step===void 0&&(d="step")||e.themeFolderName===void 0&&(d="themeFolderName"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/1/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="step"||i==="themeFolderName"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/1/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/1/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var h=S===r}else var h=!0;if(h)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/1/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var h=p===r}else var h=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/1/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var y=c===r}else var y=!0;if(y){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/1/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="activateTheme")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/1/properties/step/const",keyword:"const",params:{allowedValue:"activateTheme"},message:"must be equal to constant"}],!1;var y=c===r}else var y=!0;if(y)if(e.themeFolderName!==void 0){const i=r;if(typeof e.themeFolderName!="string")return a.errors=[{instancePath:t+"/themeFolderName",schemaPath:"#/oneOf/1/properties/themeFolderName/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var y=i===r}else var y=!0}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="cp"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.fromPath===void 0&&(d="fromPath")||e.step===void 0&&(d="step")||e.toPath===void 0&&(d="toPath"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/2/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="step"||i==="fromPath"||i==="toPath"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/2/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/2/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/2/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var m=S===r}else var m=!0;if(m)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/2/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var m=p===r}else var m=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/2/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var k=c===r}else var k=!0;if(k){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/2/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="cp")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/2/properties/step/const",keyword:"const",params:{allowedValue:"cp"},message:"must be equal to constant"}],!1;var k=c===r}else var k=!0;if(k){if(e.fromPath!==void 0){const i=r;if(typeof e.fromPath!="string")return a.errors=[{instancePath:t+"/fromPath",schemaPath:"#/oneOf/2/properties/fromPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var k=i===r}else var k=!0;if(k)if(e.toPath!==void 0){const i=r;if(typeof e.toPath!="string")return a.errors=[{instancePath:t+"/toPath",schemaPath:"#/oneOf/2/properties/toPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var k=i===r}else var k=!0}}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/2/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="defineWpConfigConsts"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.consts===void 0&&(d="consts")||e.step===void 0&&(d="step"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/3/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="step"||i==="consts"||i==="method"||i==="virtualize"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/3/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/3/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/3/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var O=S===r}else var O=!0;if(O)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/3/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var O=p===r}else var O=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/3/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var T=c===r}else var T=!0;if(T){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/3/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="defineWpConfigConsts")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/3/properties/step/const",keyword:"const",params:{allowedValue:"defineWpConfigConsts"},message:"must be equal to constant"}],!1;var T=c===r}else var T=!0;if(T){if(e.consts!==void 0){let i=e.consts;const c=r;if(r===c&&!(i&&typeof i=="object"&&!Array.isArray(i)))return a.errors=[{instancePath:t+"/consts",schemaPath:"#/oneOf/3/properties/consts/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var T=c===r}else var T=!0;if(T){if(e.method!==void 0){let i=e.method;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/method",schemaPath:"#/oneOf/3/properties/method/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(!(i==="rewrite-wp-config"||i==="define-before-run"))return a.errors=[{instancePath:t+"/method",schemaPath:"#/oneOf/3/properties/method/enum",keyword:"enum",params:{allowedValues:Me.oneOf[3].properties.method.enum},message:"must be equal to one of the allowed values"}],!1;var T=c===r}else var T=!0;if(T)if(e.virtualize!==void 0){const i=r;if(typeof e.virtualize!="boolean")return a.errors=[{instancePath:t+"/virtualize",schemaPath:"#/oneOf/3/properties/virtualize/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var T=i===r}else var T=!0}}}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/3/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="defineSiteUrl"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.siteUrl===void 0&&(d="siteUrl")||e.step===void 0&&(d="step"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/4/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="step"||i==="siteUrl"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/4/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/4/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/4/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var _=S===r}else var _=!0;if(_)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/4/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var _=p===r}else var _=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/4/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var U=c===r}else var U=!0;if(U){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/4/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="defineSiteUrl")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/4/properties/step/const",keyword:"const",params:{allowedValue:"defineSiteUrl"},message:"must be equal to constant"}],!1;var U=c===r}else var U=!0;if(U)if(e.siteUrl!==void 0){const i=r;if(typeof e.siteUrl!="string")return a.errors=[{instancePath:t+"/siteUrl",schemaPath:"#/oneOf/4/properties/siteUrl/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var U=i===r}else var U=!0}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/4/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="enableMultisite"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.step===void 0&&(d="step"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/5/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="step"||i==="wpCliPath"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/5/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/5/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/5/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var J=S===r}else var J=!0;if(J)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/5/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var J=p===r}else var J=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/5/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var ee=c===r}else var ee=!0;if(ee){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/5/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="enableMultisite")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/5/properties/step/const",keyword:"const",params:{allowedValue:"enableMultisite"},message:"must be equal to constant"}],!1;var ee=c===r}else var ee=!0;if(ee)if(e.wpCliPath!==void 0){const i=r;if(typeof e.wpCliPath!="string")return a.errors=[{instancePath:t+"/wpCliPath",schemaPath:"#/oneOf/5/properties/wpCliPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var ee=i===r}else var ee=!0}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/5/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="importWxr"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.file===void 0&&(d="file")||e.step===void 0&&(d="step"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/6/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!rt.call(Me.oneOf[6].properties,i))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/6/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/6/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/6/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var A=S===r}else var A=!0;if(A)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/6/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var A=p===r}else var A=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/6/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var B=c===r}else var B=!0;if(B){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/6/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="importWxr")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/6/properties/step/const",keyword:"const",params:{allowedValue:"importWxr"},message:"must be equal to constant"}],!1;var B=c===r}else var B=!0;if(B){if(e.file!==void 0){const i=r;K(e.file,{instancePath:t+"/file",parentData:e,parentDataProperty:"file",rootData:l})||(s=s===null?K.errors:s.concat(K.errors),r=s.length);var B=i===r}else var B=!0;if(B){if(e.fetchAttachments!==void 0){const i=r;if(typeof e.fetchAttachments!="boolean")return a.errors=[{instancePath:t+"/fetchAttachments",schemaPath:"#/oneOf/6/properties/fetchAttachments/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var B=i===r}else var B=!0;if(B){if(e.rewriteUrls!==void 0){const i=r;if(typeof e.rewriteUrls!="boolean")return a.errors=[{instancePath:t+"/rewriteUrls",schemaPath:"#/oneOf/6/properties/rewriteUrls/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var B=i===r}else var B=!0;if(B){if(e.urlMapping!==void 0){let i=e.urlMapping;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i))for(const p in i){const S=r;if(typeof i[p]!="string")return a.errors=[{instancePath:t+"/urlMapping/"+p.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/oneOf/6/properties/urlMapping/additionalProperties/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Z=S===r;if(!Z)break}else return a.errors=[{instancePath:t+"/urlMapping",schemaPath:"#/oneOf/6/properties/urlMapping/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var B=c===r}else var B=!0;if(B){if(e.importComments!==void 0){const i=r;if(typeof e.importComments!="boolean")return a.errors=[{instancePath:t+"/importComments",schemaPath:"#/oneOf/6/properties/importComments/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var B=i===r}else var B=!0;if(B){if(e.defaultAuthorUsername!==void 0){const i=r;if(typeof e.defaultAuthorUsername!="string")return a.errors=[{instancePath:t+"/defaultAuthorUsername",schemaPath:"#/oneOf/6/properties/defaultAuthorUsername/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var B=i===r}else var B=!0;if(B){if(e.authorsMode!==void 0){let i=e.authorsMode;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/authorsMode",schemaPath:"#/oneOf/6/properties/authorsMode/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(!(i==="create"||i==="default-author"||i==="map"))return a.errors=[{instancePath:t+"/authorsMode",schemaPath:"#/oneOf/6/properties/authorsMode/enum",keyword:"enum",params:{allowedValues:Me.oneOf[6].properties.authorsMode.enum},message:"must be equal to one of the allowed values"}],!1;var B=c===r}else var B=!0;if(B){if(e.authorsMap!==void 0){let i=e.authorsMap;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i))for(const p in i){const S=r;if(typeof i[p]!="string")return a.errors=[{instancePath:t+"/authorsMap/"+p.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/oneOf/6/properties/authorsMap/additionalProperties/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var te=S===r;if(!te)break}else return a.errors=[{instancePath:t+"/authorsMap",schemaPath:"#/oneOf/6/properties/authorsMap/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var B=c===r}else var B=!0;if(B){if(e.importUsers!==void 0){const i=r;if(typeof e.importUsers!="boolean")return a.errors=[{instancePath:t+"/importUsers",schemaPath:"#/oneOf/6/properties/importUsers/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var B=i===r}else var B=!0;if(B)if(e.importer!==void 0){let i=e.importer;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/importer",schemaPath:"#/oneOf/6/properties/importer/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(!(i==="data-liberation"||i==="default"))return a.errors=[{instancePath:t+"/importer",schemaPath:"#/oneOf/6/properties/importer/enum",keyword:"enum",params:{allowedValues:Me.oneOf[6].properties.importer.enum},message:"must be equal to one of the allowed values"}],!1;var B=c===r}else var B=!0}}}}}}}}}}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/6/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="importThemeStarterContent"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.step===void 0&&(d="step"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/7/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="step"||i==="themeSlug"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/7/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/7/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/7/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var G=S===r}else var G=!0;if(G)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/7/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var G=p===r}else var G=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/7/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var b=c===r}else var b=!0;if(b){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/7/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="importThemeStarterContent")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/7/properties/step/const",keyword:"const",params:{allowedValue:"importThemeStarterContent"},message:"must be equal to constant"}],!1;var b=c===r}else var b=!0;if(b)if(e.themeSlug!==void 0){const i=r;if(typeof e.themeSlug!="string")return a.errors=[{instancePath:t+"/themeSlug",schemaPath:"#/oneOf/7/properties/themeSlug/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var b=i===r}else var b=!0}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/7/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="importWordPressFiles"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.step===void 0&&(d="step")||e.wordPressFilesZip===void 0&&(d="wordPressFilesZip"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/8/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="step"||i==="wordPressFilesZip"||i==="pathInZip"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/8/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/8/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/8/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var R=S===r}else var R=!0;if(R)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/8/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var R=p===r}else var R=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/8/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var P=c===r}else var P=!0;if(P){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/8/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="importWordPressFiles")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/8/properties/step/const",keyword:"const",params:{allowedValue:"importWordPressFiles"},message:"must be equal to constant"}],!1;var P=c===r}else var P=!0;if(P){if(e.wordPressFilesZip!==void 0){const i=r;K(e.wordPressFilesZip,{instancePath:t+"/wordPressFilesZip",parentData:e,parentDataProperty:"wordPressFilesZip",rootData:l})||(s=s===null?K.errors:s.concat(K.errors),r=s.length);var P=i===r}else var P=!0;if(P)if(e.pathInZip!==void 0){const i=r;if(typeof e.pathInZip!="string")return a.errors=[{instancePath:t+"/pathInZip",schemaPath:"#/oneOf/8/properties/pathInZip/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var P=i===r}else var P=!0}}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/8/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="installPlugin"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.pluginData===void 0&&(d="pluginData")||e.step===void 0&&(d="step"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/9/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="ifAlreadyInstalled"||i==="step"||i==="pluginData"||i==="pluginZipFile"||i==="options"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/9/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/9/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/9/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var E=S===r}else var E=!0;if(E)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/9/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var E=p===r}else var E=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/9/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var v=c===r}else var v=!0;if(v){if(e.ifAlreadyInstalled!==void 0){let i=e.ifAlreadyInstalled;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/ifAlreadyInstalled",schemaPath:"#/oneOf/9/properties/ifAlreadyInstalled/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(!(i==="overwrite"||i==="skip"||i==="error"))return a.errors=[{instancePath:t+"/ifAlreadyInstalled",schemaPath:"#/oneOf/9/properties/ifAlreadyInstalled/enum",keyword:"enum",params:{allowedValues:Me.oneOf[9].properties.ifAlreadyInstalled.enum},message:"must be equal to one of the allowed values"}],!1;var v=c===r}else var v=!0;if(v){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/9/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="installPlugin")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/9/properties/step/const",keyword:"const",params:{allowedValue:"installPlugin"},message:"must be equal to constant"}],!1;var v=c===r}else var v=!0;if(v){if(e.pluginData!==void 0){let i=e.pluginData;const c=r,j=r;let p=!1;const S=r;K(i,{instancePath:t+"/pluginData",parentData:e,parentDataProperty:"pluginData",rootData:l})||(s=s===null?K.errors:s.concat(K.errors),r=s.length);var g=S===r;if(p=p||g,!p){const H=r;de(i,{instancePath:t+"/pluginData",parentData:e,parentDataProperty:"pluginData",rootData:l})||(s=s===null?de.errors:s.concat(de.errors),r=s.length);var g=H===r;p=p||g}if(p)r=j,s!==null&&(j?s.length=j:s=null);else{const H={instancePath:t+"/pluginData",schemaPath:"#/oneOf/9/properties/pluginData/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[H]:s.push(H),r++,a.errors=s,!1}var v=c===r}else var v=!0;if(v){if(e.pluginZipFile!==void 0){const i=r;K(e.pluginZipFile,{instancePath:t+"/pluginZipFile",parentData:e,parentDataProperty:"pluginZipFile",rootData:l})||(s=s===null?K.errors:s.concat(K.errors),r=s.length);var v=i===r}else var v=!0;if(v)if(e.options!==void 0){let i=e.options;const c=r;if(r===r)if(i&&typeof i=="object"&&!Array.isArray(i)){const S=r;for(const W in i)if(!(W==="activate"||W==="activationOptions"||W==="onError"||W==="targetFolderName"||W==="humanReadableName"))return a.errors=[{instancePath:t+"/options",schemaPath:"#/definitions/InstallPluginOptions/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:W},message:"must NOT have additional properties"}],!1;if(S===r){if(i.activate!==void 0){const W=r;if(typeof i.activate!="boolean")return a.errors=[{instancePath:t+"/options/activate",schemaPath:"#/definitions/InstallPluginOptions/properties/activate/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var w=W===r}else var w=!0;if(w){if(i.activationOptions!==void 0){let W=i.activationOptions;const H=r;if(r===H&&!(W&&typeof W=="object"&&!Array.isArray(W)))return a.errors=[{instancePath:t+"/options/activationOptions",schemaPath:"#/definitions/InstallPluginOptions/properties/activationOptions/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var w=H===r}else var w=!0;if(w){if(i.onError!==void 0){let W=i.onError;const H=r;if(typeof W!="string")return a.errors=[{instancePath:t+"/options/onError",schemaPath:"#/definitions/InstallPluginOptions/properties/onError/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(!(W==="skip-plugin"||W==="throw"))return a.errors=[{instancePath:t+"/options/onError",schemaPath:"#/definitions/InstallPluginOptions/properties/onError/enum",keyword:"enum",params:{allowedValues:di.properties.onError.enum},message:"must be equal to one of the allowed values"}],!1;var w=H===r}else var w=!0;if(w){if(i.targetFolderName!==void 0){const W=r;if(typeof i.targetFolderName!="string")return a.errors=[{instancePath:t+"/options/targetFolderName",schemaPath:"#/definitions/InstallPluginOptions/properties/targetFolderName/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var w=W===r}else var w=!0;if(w)if(i.humanReadableName!==void 0){const W=r;if(typeof i.humanReadableName!="string")return a.errors=[{instancePath:t+"/options/humanReadableName",schemaPath:"#/definitions/InstallPluginOptions/properties/humanReadableName/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var w=W===r}else var w=!0}}}}}else return a.errors=[{instancePath:t+"/options",schemaPath:"#/definitions/InstallPluginOptions/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var v=c===r}else var v=!0}}}}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/9/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="installTheme"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.step===void 0&&(d="step")||e.themeData===void 0&&(d="themeData"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/10/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="ifAlreadyInstalled"||i==="step"||i==="themeData"||i==="themeZipFile"||i==="options"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/10/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/10/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/10/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var M=S===r}else var M=!0;if(M)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/10/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var M=p===r}else var M=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/10/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var $=c===r}else var $=!0;if($){if(e.ifAlreadyInstalled!==void 0){let i=e.ifAlreadyInstalled;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/ifAlreadyInstalled",schemaPath:"#/oneOf/10/properties/ifAlreadyInstalled/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(!(i==="overwrite"||i==="skip"||i==="error"))return a.errors=[{instancePath:t+"/ifAlreadyInstalled",schemaPath:"#/oneOf/10/properties/ifAlreadyInstalled/enum",keyword:"enum",params:{allowedValues:Me.oneOf[10].properties.ifAlreadyInstalled.enum},message:"must be equal to one of the allowed values"}],!1;var $=c===r}else var $=!0;if($){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/10/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="installTheme")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/10/properties/step/const",keyword:"const",params:{allowedValue:"installTheme"},message:"must be equal to constant"}],!1;var $=c===r}else var $=!0;if($){if(e.themeData!==void 0){let i=e.themeData;const c=r,j=r;let p=!1;const S=r;K(i,{instancePath:t+"/themeData",parentData:e,parentDataProperty:"themeData",rootData:l})||(s=s===null?K.errors:s.concat(K.errors),r=s.length);var D=S===r;if(p=p||D,!p){const H=r;de(i,{instancePath:t+"/themeData",parentData:e,parentDataProperty:"themeData",rootData:l})||(s=s===null?de.errors:s.concat(de.errors),r=s.length);var D=H===r;p=p||D}if(p)r=j,s!==null&&(j?s.length=j:s=null);else{const H={instancePath:t+"/themeData",schemaPath:"#/oneOf/10/properties/themeData/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[H]:s.push(H),r++,a.errors=s,!1}var $=c===r}else var $=!0;if($){if(e.themeZipFile!==void 0){const i=r;K(e.themeZipFile,{instancePath:t+"/themeZipFile",parentData:e,parentDataProperty:"themeZipFile",rootData:l})||(s=s===null?K.errors:s.concat(K.errors),r=s.length);var $=i===r}else var $=!0;if($)if(e.options!==void 0){let i=e.options;const c=r;if(r===r)if(i&&typeof i=="object"&&!Array.isArray(i)){const S=r;for(const W in i)if(!(W==="activate"||W==="importStarterContent"||W==="onError"||W==="targetFolderName"||W==="humanReadableName"))return a.errors=[{instancePath:t+"/options",schemaPath:"#/definitions/InstallThemeOptions/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:W},message:"must NOT have additional properties"}],!1;if(S===r){if(i.activate!==void 0){const W=r;if(typeof i.activate!="boolean")return a.errors=[{instancePath:t+"/options/activate",schemaPath:"#/definitions/InstallThemeOptions/properties/activate/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var x=W===r}else var x=!0;if(x){if(i.importStarterContent!==void 0){const W=r;if(typeof i.importStarterContent!="boolean")return a.errors=[{instancePath:t+"/options/importStarterContent",schemaPath:"#/definitions/InstallThemeOptions/properties/importStarterContent/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var x=W===r}else var x=!0;if(x){if(i.onError!==void 0){let W=i.onError;const H=r;if(typeof W!="string")return a.errors=[{instancePath:t+"/options/onError",schemaPath:"#/definitions/InstallThemeOptions/properties/onError/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(!(W==="skip-theme"||W==="throw"))return a.errors=[{instancePath:t+"/options/onError",schemaPath:"#/definitions/InstallThemeOptions/properties/onError/enum",keyword:"enum",params:{allowedValues:mi.properties.onError.enum},message:"must be equal to one of the allowed values"}],!1;var x=H===r}else var x=!0;if(x){if(i.targetFolderName!==void 0){const W=r;if(typeof i.targetFolderName!="string")return a.errors=[{instancePath:t+"/options/targetFolderName",schemaPath:"#/definitions/InstallThemeOptions/properties/targetFolderName/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var x=W===r}else var x=!0;if(x)if(i.humanReadableName!==void 0){const W=r;if(typeof i.humanReadableName!="string")return a.errors=[{instancePath:t+"/options/humanReadableName",schemaPath:"#/definitions/InstallThemeOptions/properties/humanReadableName/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var x=W===r}else var x=!0}}}}}else return a.errors=[{instancePath:t+"/options",schemaPath:"#/definitions/InstallThemeOptions/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var $=c===r}else var $=!0}}}}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/10/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="login"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.step===void 0&&(d="step"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/11/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="step"||i==="username"||i==="password"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/11/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/11/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/11/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var L=S===r}else var L=!0;if(L)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/11/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var L=p===r}else var L=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/11/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var F=c===r}else var F=!0;if(F){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/11/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="login")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/11/properties/step/const",keyword:"const",params:{allowedValue:"login"},message:"must be equal to constant"}],!1;var F=c===r}else var F=!0;if(F){if(e.username!==void 0){const i=r;if(typeof e.username!="string")return a.errors=[{instancePath:t+"/username",schemaPath:"#/oneOf/11/properties/username/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var F=i===r}else var F=!0;if(F)if(e.password!==void 0){const i=r;if(typeof e.password!="string")return a.errors=[{instancePath:t+"/password",schemaPath:"#/oneOf/11/properties/password/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var F=i===r}else var F=!0}}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/11/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="mkdir"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.path===void 0&&(d="path")||e.step===void 0&&(d="step"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/12/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="step"||i==="path"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/12/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/12/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/12/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var C=S===r}else var C=!0;if(C)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/12/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var C=p===r}else var C=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/12/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var se=c===r}else var se=!0;if(se){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/12/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="mkdir")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/12/properties/step/const",keyword:"const",params:{allowedValue:"mkdir"},message:"must be equal to constant"}],!1;var se=c===r}else var se=!0;if(se)if(e.path!==void 0){const i=r;if(typeof e.path!="string")return a.errors=[{instancePath:t+"/path",schemaPath:"#/oneOf/12/properties/path/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var se=i===r}else var se=!0}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/12/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="mv"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.fromPath===void 0&&(d="fromPath")||e.step===void 0&&(d="step")||e.toPath===void 0&&(d="toPath"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/13/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="step"||i==="fromPath"||i==="toPath"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/13/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/13/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/13/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var q=S===r}else var q=!0;if(q)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/13/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var q=p===r}else var q=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/13/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var z=c===r}else var z=!0;if(z){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/13/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="mv")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/13/properties/step/const",keyword:"const",params:{allowedValue:"mv"},message:"must be equal to constant"}],!1;var z=c===r}else var z=!0;if(z){if(e.fromPath!==void 0){const i=r;if(typeof e.fromPath!="string")return a.errors=[{instancePath:t+"/fromPath",schemaPath:"#/oneOf/13/properties/fromPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var z=i===r}else var z=!0;if(z)if(e.toPath!==void 0){const i=r;if(typeof e.toPath!="string")return a.errors=[{instancePath:t+"/toPath",schemaPath:"#/oneOf/13/properties/toPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var z=i===r}else var z=!0}}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/13/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="resetData"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.step===void 0&&(d="step"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/14/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="step"||i==="contentTypes"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/14/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/14/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/14/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var Q=S===r}else var Q=!0;if(Q)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/14/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Q=p===r}else var Q=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/14/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var V=c===r}else var V=!0;if(V){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/14/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="resetData")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/14/properties/step/const",keyword:"const",params:{allowedValue:"resetData"},message:"must be equal to constant"}],!1;var V=c===r}else var V=!0;if(V)if(e.contentTypes!==void 0){let i=e.contentTypes;const c=r;if(r===c)if(Array.isArray(i)){var ae=!0;const p=i.length;for(let S=0;S<p;S++){let W=i[S];const H=r;if(typeof W!="string")return a.errors=[{instancePath:t+"/contentTypes/"+S,schemaPath:"#/oneOf/14/properties/contentTypes/items/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(!(W==="posts"||W==="pages"||W==="comments"))return a.errors=[{instancePath:t+"/contentTypes/"+S,schemaPath:"#/oneOf/14/properties/contentTypes/items/enum",keyword:"enum",params:{allowedValues:Me.oneOf[14].properties.contentTypes.items.enum},message:"must be equal to one of the allowed values"}],!1;var ae=H===r;if(!ae)break}}else return a.errors=[{instancePath:t+"/contentTypes",schemaPath:"#/oneOf/14/properties/contentTypes/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;var V=c===r}else var V=!0}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/14/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="request"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.request===void 0&&(d="request")||e.step===void 0&&(d="step"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/15/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="step"||i==="request"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/15/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/15/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/15/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var fe=S===r}else var fe=!0;if(fe)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/15/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var fe=p===r}else var fe=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/15/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var ye=c===r}else var ye=!0;if(ye){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/15/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="request")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/15/properties/step/const",keyword:"const",params:{allowedValue:"request"},message:"must be equal to constant"}],!1;var ye=c===r}else var ye=!0;if(ye)if(e.request!==void 0){const i=r;we(e.request,{instancePath:t+"/request",parentData:e,parentDataProperty:"request",rootData:l})||(s=s===null?we.errors:s.concat(we.errors),r=s.length);var ye=i===r}else var ye=!0}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/15/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="rm"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.path===void 0&&(d="path")||e.step===void 0&&(d="step"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/16/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="step"||i==="path"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/16/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/16/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/16/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var or=S===r}else var or=!0;if(or)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/16/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var or=p===r}else var or=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/16/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var xe=c===r}else var xe=!0;if(xe){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/16/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="rm")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/16/properties/step/const",keyword:"const",params:{allowedValue:"rm"},message:"must be equal to constant"}],!1;var xe=c===r}else var xe=!0;if(xe)if(e.path!==void 0){const i=r;if(typeof e.path!="string")return a.errors=[{instancePath:t+"/path",schemaPath:"#/oneOf/16/properties/path/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var xe=i===r}else var xe=!0}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/16/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="rmdir"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.path===void 0&&(d="path")||e.step===void 0&&(d="step"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/17/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="step"||i==="path"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/17/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/17/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/17/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var nr=S===r}else var nr=!0;if(nr)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/17/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var nr=p===r}else var nr=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/17/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var Fe=c===r}else var Fe=!0;if(Fe){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/17/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="rmdir")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/17/properties/step/const",keyword:"const",params:{allowedValue:"rmdir"},message:"must be equal to constant"}],!1;var Fe=c===r}else var Fe=!0;if(Fe)if(e.path!==void 0){const i=r;if(typeof e.path!="string")return a.errors=[{instancePath:t+"/path",schemaPath:"#/oneOf/17/properties/path/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Fe=i===r}else var Fe=!0}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/17/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="runPHP"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.code===void 0&&(d="code")||e.step===void 0&&(d="step"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/18/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="step"||i==="code"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/18/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/18/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/18/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var ar=S===r}else var ar=!0;if(ar)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/18/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var ar=p===r}else var ar=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/18/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var Ce=c===r}else var Ce=!0;if(Ce){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/18/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="runPHP")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/18/properties/step/const",keyword:"const",params:{allowedValue:"runPHP"},message:"must be equal to constant"}],!1;var Ce=c===r}else var Ce=!0;if(Ce)if(e.code!==void 0){let i=e.code;const c=r,j=r;let p=!1;const S=r;if(typeof i!="string"){const H={instancePath:t+"/code",schemaPath:"#/oneOf/18/properties/code/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[H]:s.push(H),r++}var Lr=S===r;if(p=p||Lr,!p){const H=r;if(r===H)if(i&&typeof i=="object"&&!Array.isArray(i)){let le;if(i.filename===void 0&&(le="filename")||i.content===void 0&&(le="content")){const qe={instancePath:t+"/code",schemaPath:"#/oneOf/18/properties/code/anyOf/1/required",keyword:"required",params:{missingProperty:le},message:"must have required property '"+le+"'"};s===null?s=[qe]:s.push(qe),r++}else{const qe=r;for(const ne in i)if(!(ne==="filename"||ne==="content")){const je={instancePath:t+"/code",schemaPath:"#/oneOf/18/properties/code/anyOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:ne},message:"must NOT have additional properties"};s===null?s=[je]:s.push(je),r++;break}if(qe===r){if(i.filename!==void 0){const ne=r;if(typeof i.filename!="string"){const je={instancePath:t+"/code/filename",schemaPath:"#/oneOf/18/properties/code/anyOf/1/properties/filename/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[je]:s.push(je),r++}var pr=ne===r}else var pr=!0;if(pr)if(i.content!==void 0){const ne=r;if(typeof i.content!="string"){const X={instancePath:t+"/code/content",schemaPath:"#/oneOf/18/properties/code/anyOf/1/properties/content/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[X]:s.push(X),r++}var pr=ne===r}else var pr=!0}}}else{const le={instancePath:t+"/code",schemaPath:"#/oneOf/18/properties/code/anyOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[le]:s.push(le),r++}var Lr=H===r;p=p||Lr}if(p)r=j,s!==null&&(j?s.length=j:s=null);else{const H={instancePath:t+"/code",schemaPath:"#/oneOf/18/properties/code/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[H]:s.push(H),r++,a.errors=s,!1}var Ce=c===r}else var Ce=!0}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/18/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="runPHPWithOptions"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.options===void 0&&(d="options")||e.step===void 0&&(d="step"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/19/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="step"||i==="options"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/19/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/19/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/19/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var lr=S===r}else var lr=!0;if(lr)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/19/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var lr=p===r}else var lr=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/19/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var Ie=c===r}else var Ie=!0;if(Ie){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/19/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="runPHPWithOptions")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/19/properties/step/const",keyword:"const",params:{allowedValue:"runPHPWithOptions"},message:"must be equal to constant"}],!1;var Ie=c===r}else var Ie=!0;if(Ie)if(e.options!==void 0){const i=r;pe(e.options,{instancePath:t+"/options",parentData:e,parentDataProperty:"options",rootData:l})||(s=s===null?pe.errors:s.concat(pe.errors),r=s.length);var Ie=i===r}else var Ie=!0}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/19/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="runWpInstallationWizard"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.options===void 0&&(d="options")||e.step===void 0&&(d="step"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/20/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="step"||i==="options"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/20/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/20/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/20/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var ur=S===r}else var ur=!0;if(ur)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/20/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var ur=p===r}else var ur=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/20/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var Ue=c===r}else var Ue=!0;if(Ue){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/20/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="runWpInstallationWizard")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/20/properties/step/const",keyword:"const",params:{allowedValue:"runWpInstallationWizard"},message:"must be equal to constant"}],!1;var Ue=c===r}else var Ue=!0;if(Ue)if(e.options!==void 0){let i=e.options;const c=r;if(r===r)if(i&&typeof i=="object"&&!Array.isArray(i)){const S=r;for(const W in i)if(!(W==="adminUsername"||W==="adminPassword"))return a.errors=[{instancePath:t+"/options",schemaPath:"#/definitions/WordPressInstallationOptions/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:W},message:"must NOT have additional properties"}],!1;if(S===r){if(i.adminUsername!==void 0){const W=r;if(typeof i.adminUsername!="string")return a.errors=[{instancePath:t+"/options/adminUsername",schemaPath:"#/definitions/WordPressInstallationOptions/properties/adminUsername/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var fr=W===r}else var fr=!0;if(fr)if(i.adminPassword!==void 0){const W=r;if(typeof i.adminPassword!="string")return a.errors=[{instancePath:t+"/options/adminPassword",schemaPath:"#/definitions/WordPressInstallationOptions/properties/adminPassword/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var fr=W===r}else var fr=!0}}else return a.errors=[{instancePath:t+"/options",schemaPath:"#/definitions/WordPressInstallationOptions/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var Ue=c===r}else var Ue=!0}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/20/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="runSql"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.sql===void 0&&(d="sql")||e.step===void 0&&(d="step"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/21/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="step"||i==="sql"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/21/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/21/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/21/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var cr=S===r}else var cr=!0;if(cr)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/21/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var cr=p===r}else var cr=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/21/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var Be=c===r}else var Be=!0;if(Be){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/21/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="runSql")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/21/properties/step/const",keyword:"const",params:{allowedValue:"runSql"},message:"must be equal to constant"}],!1;var Be=c===r}else var Be=!0;if(Be)if(e.sql!==void 0){const i=r;K(e.sql,{instancePath:t+"/sql",parentData:e,parentDataProperty:"sql",rootData:l})||(s=s===null?K.errors:s.concat(K.errors),r=s.length);var Be=i===r}else var Be=!0}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/21/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="setSiteOptions"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.options===void 0&&(d="options")||e.step===void 0&&(d="step"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/22/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="step"||i==="options"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/22/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/22/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/22/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var dr=S===r}else var dr=!0;if(dr)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/22/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var dr=p===r}else var dr=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/22/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var We=c===r}else var We=!0;if(We){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/22/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="setSiteOptions")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/22/properties/step/const",keyword:"const",params:{allowedValue:"setSiteOptions"},message:"must be equal to constant"}],!1;var We=c===r}else var We=!0;if(We)if(e.options!==void 0){let i=e.options;const c=r;if(r===c&&!(i&&typeof i=="object"&&!Array.isArray(i)))return a.errors=[{instancePath:t+"/options",schemaPath:"#/oneOf/22/properties/options/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var We=c===r}else var We=!0}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/22/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="unzip"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.extractToPath===void 0&&(d="extractToPath")||e.step===void 0&&(d="step"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/23/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="step"||i==="zipFile"||i==="zipPath"||i==="extractToPath"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/23/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/23/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/23/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var mr=S===r}else var mr=!0;if(mr)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/23/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var mr=p===r}else var mr=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/23/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var he=c===r}else var he=!0;if(he){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/23/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="unzip")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/23/properties/step/const",keyword:"const",params:{allowedValue:"unzip"},message:"must be equal to constant"}],!1;var he=c===r}else var he=!0;if(he){if(e.zipFile!==void 0){const i=r;K(e.zipFile,{instancePath:t+"/zipFile",parentData:e,parentDataProperty:"zipFile",rootData:l})||(s=s===null?K.errors:s.concat(K.errors),r=s.length);var he=i===r}else var he=!0;if(he){if(e.zipPath!==void 0){const i=r;if(typeof e.zipPath!="string")return a.errors=[{instancePath:t+"/zipPath",schemaPath:"#/oneOf/23/properties/zipPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var he=i===r}else var he=!0;if(he)if(e.extractToPath!==void 0){const i=r;if(typeof e.extractToPath!="string")return a.errors=[{instancePath:t+"/extractToPath",schemaPath:"#/oneOf/23/properties/extractToPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var he=i===r}else var he=!0}}}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/23/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="updateUserMeta"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.meta===void 0&&(d="meta")||e.step===void 0&&(d="step")||e.userId===void 0&&(d="userId"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/24/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="step"||i==="meta"||i==="userId"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/24/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/24/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/24/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var yr=S===r}else var yr=!0;if(yr)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/24/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var yr=p===r}else var yr=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/24/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var Ee=c===r}else var Ee=!0;if(Ee){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/24/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="updateUserMeta")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/24/properties/step/const",keyword:"const",params:{allowedValue:"updateUserMeta"},message:"must be equal to constant"}],!1;var Ee=c===r}else var Ee=!0;if(Ee){if(e.meta!==void 0){let i=e.meta;const c=r;if(r===c&&!(i&&typeof i=="object"&&!Array.isArray(i)))return a.errors=[{instancePath:t+"/meta",schemaPath:"#/oneOf/24/properties/meta/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var Ee=c===r}else var Ee=!0;if(Ee)if(e.userId!==void 0){let i=e.userId;const c=r;if(!(typeof i=="number"&&isFinite(i)))return a.errors=[{instancePath:t+"/userId",schemaPath:"#/oneOf/24/properties/userId/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var Ee=c===r}else var Ee=!0}}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/24/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="writeFile"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.data===void 0&&(d="data")||e.path===void 0&&(d="path")||e.step===void 0&&(d="step"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/25/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="step"||i==="path"||i==="data"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/25/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/25/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/25/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var hr=S===r}else var hr=!0;if(hr)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/25/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var hr=p===r}else var hr=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/25/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var Te=c===r}else var Te=!0;if(Te){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/25/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="writeFile")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/25/properties/step/const",keyword:"const",params:{allowedValue:"writeFile"},message:"must be equal to constant"}],!1;var Te=c===r}else var Te=!0;if(Te){if(e.path!==void 0){const i=r;if(typeof e.path!="string")return a.errors=[{instancePath:t+"/path",schemaPath:"#/oneOf/25/properties/path/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Te=i===r}else var Te=!0;if(Te)if(e.data!==void 0){let i=e.data;const c=r,j=r;let p=!1;const S=r;K(i,{instancePath:t+"/data",parentData:e,parentDataProperty:"data",rootData:l})||(s=s===null?K.errors:s.concat(K.errors),r=s.length);var ze=S===r;if(p=p||ze,!p){const H=r;if(typeof i!="string"){const le={instancePath:t+"/data",schemaPath:"#/oneOf/25/properties/data/anyOf/1/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[le]:s.push(le),r++}var ze=H===r;if(p=p||ze,!p){const le=r;if(r===le)if(i&&typeof i=="object"&&!Array.isArray(i)){let ne;if(i.BYTES_PER_ELEMENT===void 0&&(ne="BYTES_PER_ELEMENT")||i.buffer===void 0&&(ne="buffer")||i.byteLength===void 0&&(ne="byteLength")||i.byteOffset===void 0&&(ne="byteOffset")||i.length===void 0&&(ne="length")){const je={instancePath:t+"/data",schemaPath:"#/oneOf/25/properties/data/anyOf/2/required",keyword:"required",params:{missingProperty:ne},message:"must have required property '"+ne+"'"};s===null?s=[je]:s.push(je),r++}else{const je=r;for(const X in i)if(!(X==="BYTES_PER_ELEMENT"||X==="buffer"||X==="byteLength"||X==="byteOffset"||X==="length")){let _e=i[X];const br=r;if(!(typeof _e=="number"&&isFinite(_e))){const ue={instancePath:t+"/data/"+X.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/oneOf/25/properties/data/anyOf/2/additionalProperties/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[ue]:s.push(ue),r++}var vs=br===r;if(!vs)break}if(je===r){if(i.BYTES_PER_ELEMENT!==void 0){let X=i.BYTES_PER_ELEMENT;const _e=r;if(!(typeof X=="number"&&isFinite(X))){const br={instancePath:t+"/data/BYTES_PER_ELEMENT",schemaPath:"#/oneOf/25/properties/data/anyOf/2/properties/BYTES_PER_ELEMENT/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[br]:s.push(br),r++}var ge=_e===r}else var ge=!0;if(ge){if(i.buffer!==void 0){let X=i.buffer;const _e=r;if(r===_e)if(X&&typeof X=="object"&&!Array.isArray(X)){let ue;if(X.byteLength===void 0&&(ue="byteLength")){const vr={instancePath:t+"/data/buffer",schemaPath:"#/oneOf/25/properties/data/anyOf/2/properties/buffer/required",keyword:"required",params:{missingProperty:ue},message:"must have required property '"+ue+"'"};s===null?s=[vr]:s.push(vr),r++}else{const vr=r;for(const He in X)if(He!=="byteLength"){const Ye={instancePath:t+"/data/buffer",schemaPath:"#/oneOf/25/properties/data/anyOf/2/properties/buffer/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:He},message:"must NOT have additional properties"};s===null?s=[Ye]:s.push(Ye),r++;break}if(vr===r&&X.byteLength!==void 0){let He=X.byteLength;if(!(typeof He=="number"&&isFinite(He))){const Ye={instancePath:t+"/data/buffer/byteLength",schemaPath:"#/oneOf/25/properties/data/anyOf/2/properties/buffer/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[Ye]:s.push(Ye),r++}}}}else{const ue={instancePath:t+"/data/buffer",schemaPath:"#/oneOf/25/properties/data/anyOf/2/properties/buffer/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[ue]:s.push(ue),r++}var ge=_e===r}else var ge=!0;if(ge){if(i.byteLength!==void 0){let X=i.byteLength;const _e=r;if(!(typeof X=="number"&&isFinite(X))){const ue={instancePath:t+"/data/byteLength",schemaPath:"#/oneOf/25/properties/data/anyOf/2/properties/byteLength/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[ue]:s.push(ue),r++}var ge=_e===r}else var ge=!0;if(ge){if(i.byteOffset!==void 0){let X=i.byteOffset;const _e=r;if(!(typeof X=="number"&&isFinite(X))){const ue={instancePath:t+"/data/byteOffset",schemaPath:"#/oneOf/25/properties/data/anyOf/2/properties/byteOffset/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[ue]:s.push(ue),r++}var ge=_e===r}else var ge=!0;if(ge)if(i.length!==void 0){let X=i.length;const _e=r;if(!(typeof X=="number"&&isFinite(X))){const ue={instancePath:t+"/data/length",schemaPath:"#/oneOf/25/properties/data/anyOf/2/properties/length/type",keyword:"type",params:{type:"number"},message:"must be number"};s===null?s=[ue]:s.push(ue),r++}var ge=_e===r}else var ge=!0}}}}}}else{const ne={instancePath:t+"/data",schemaPath:"#/oneOf/25/properties/data/anyOf/2/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[ne]:s.push(ne),r++}var ze=le===r;p=p||ze}}if(p)r=j,s!==null&&(j?s.length=j:s=null);else{const H={instancePath:t+"/data",schemaPath:"#/oneOf/25/properties/data/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[H]:s.push(H),r++,a.errors=s,!1}var Te=c===r}else var Te=!0}}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/25/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="writeFiles"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.filesTree===void 0&&(d="filesTree")||e.step===void 0&&(d="step")||e.writeToPath===void 0&&(d="writeToPath"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/26/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="step"||i==="writeToPath"||i==="filesTree"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/26/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/26/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/26/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var gr=S===r}else var gr=!0;if(gr)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/26/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var gr=p===r}else var gr=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/26/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var Re=c===r}else var Re=!0;if(Re){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/26/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="writeFiles")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/26/properties/step/const",keyword:"const",params:{allowedValue:"writeFiles"},message:"must be equal to constant"}],!1;var Re=c===r}else var Re=!0;if(Re){if(e.writeToPath!==void 0){const i=r;if(typeof e.writeToPath!="string")return a.errors=[{instancePath:t+"/writeToPath",schemaPath:"#/oneOf/26/properties/writeToPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Re=i===r}else var Re=!0;if(Re)if(e.filesTree!==void 0){const i=r;de(e.filesTree,{instancePath:t+"/filesTree",parentData:e,parentDataProperty:"filesTree",rootData:l})||(s=s===null?de.errors:s.concat(de.errors),r=s.length);var Re=i===r}else var Re=!0}}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/26/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="wp-cli"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.command===void 0&&(d="command")||e.step===void 0&&(d="step"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/27/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="step"||i==="command"||i==="wpCliPath"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/27/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/27/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/27/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var _r=S===r}else var _r=!0;if(_r)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/27/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var _r=p===r}else var _r=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/27/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var Se=c===r}else var Se=!0;if(Se){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/27/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="wp-cli")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/27/properties/step/const",keyword:"const",params:{allowedValue:"wp-cli"},message:"must be equal to constant"}],!1;var Se=c===r}else var Se=!0;if(Se){if(e.command!==void 0){let i=e.command;const c=r,j=r;let p=!1;const S=r;if(typeof i!="string"){const H={instancePath:t+"/command",schemaPath:"#/oneOf/27/properties/command/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[H]:s.push(H),r++}var xr=S===r;if(p=p||xr,!p){const H=r;if(r===H)if(Array.isArray(i)){var ct=!0;const le=i.length;for(let qe=0;qe<le;qe++){const ne=r;if(typeof i[qe]!="string"){const X={instancePath:t+"/command/"+qe,schemaPath:"#/oneOf/27/properties/command/anyOf/1/items/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[X]:s.push(X),r++}var ct=ne===r;if(!ct)break}}else{const le={instancePath:t+"/command",schemaPath:"#/oneOf/27/properties/command/anyOf/1/type",keyword:"type",params:{type:"array"},message:"must be array"};s===null?s=[le]:s.push(le),r++}var xr=H===r;p=p||xr}if(p)r=j,s!==null&&(j?s.length=j:s=null);else{const H={instancePath:t+"/command",schemaPath:"#/oneOf/27/properties/command/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[H]:s.push(H),r++,a.errors=s,!1}var Se=c===r}else var Se=!0;if(Se)if(e.wpCliPath!==void 0){const i=r;if(typeof e.wpCliPath!="string")return a.errors=[{instancePath:t+"/wpCliPath",schemaPath:"#/oneOf/27/properties/wpCliPath/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var Se=i===r}else var Se=!0}}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/27/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else if(re==="setSiteLanguage"){if(r===r)if(e&&typeof e=="object"&&!Array.isArray(e)){let d;if(e.language===void 0&&(d="language")||e.step===void 0&&(d="step"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/28/required",keyword:"required",params:{missingProperty:d},message:"must have required property '"+d+"'"}],!1;{const I=r;for(const i in e)if(!(i==="progress"||i==="step"||i==="language"))return a.errors=[{instancePath:t,schemaPath:"#/oneOf/28/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:i},message:"must NOT have additional properties"}],!1;if(I===r){if(e.progress!==void 0){let i=e.progress;const c=r;if(r===c)if(i&&typeof i=="object"&&!Array.isArray(i)){const j=r;for(const p in i)if(!(p==="weight"||p==="caption"))return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/28/properties/progress/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:p},message:"must NOT have additional properties"}],!1;if(j===r){if(i.weight!==void 0){let p=i.weight;const S=r;if(!(typeof p=="number"&&isFinite(p)))return a.errors=[{instancePath:t+"/progress/weight",schemaPath:"#/oneOf/28/properties/progress/properties/weight/type",keyword:"type",params:{type:"number"},message:"must be number"}],!1;var wr=S===r}else var wr=!0;if(wr)if(i.caption!==void 0){const p=r;if(typeof i.caption!="string")return a.errors=[{instancePath:t+"/progress/caption",schemaPath:"#/oneOf/28/properties/progress/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var wr=p===r}else var wr=!0}}else return a.errors=[{instancePath:t+"/progress",schemaPath:"#/oneOf/28/properties/progress/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var De=c===r}else var De=!0;if(De){if(e.step!==void 0){let i=e.step;const c=r;if(typeof i!="string")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/28/properties/step/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(i!=="setSiteLanguage")return a.errors=[{instancePath:t+"/step",schemaPath:"#/oneOf/28/properties/step/const",keyword:"const",params:{allowedValue:"setSiteLanguage"},message:"must be equal to constant"}],!1;var De=c===r}else var De=!0;if(De)if(e.language!==void 0){const i=r;if(typeof e.language!="string")return a.errors=[{instancePath:t+"/language",schemaPath:"#/oneOf/28/properties/language/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var De=i===r}else var De=!0}}}}else return a.errors=[{instancePath:t,schemaPath:"#/oneOf/28/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1}else return a.errors=[{instancePath:t,schemaPath:"#/discriminator",keyword:"discriminator",params:{error:"mapping",tag:"step",tagValue:re},message:'value of tag "step" must be in oneOf'}],!1;else return a.errors=[{instancePath:t,schemaPath:"#/discriminator",keyword:"discriminator",params:{error:"tag",tag:"step",tagValue:re},message:'tag "step" must be string'}],!1}}else return a.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return a.errors=s,r===0}function Y(e,{instancePath:t="",parentData:o,parentDataProperty:n,rootData:l=e}={}){let s=null,r=0;if(r===0)if(e&&typeof e=="object"&&!Array.isArray(e)){const G=r;for(const b in e)if(!rt.call(ai.properties,b))return Y.errors=[{instancePath:t,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:b},message:"must NOT have additional properties"}],!1;if(G===r){if(e.landingPage!==void 0){const b=r;if(typeof e.landingPage!="string")return Y.errors=[{instancePath:t+"/landingPage",schemaPath:"#/properties/landingPage/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var u=b===r}else var u=!0;if(u){if(e.description!==void 0){const b=r;if(typeof e.description!="string")return Y.errors=[{instancePath:t+"/description",schemaPath:"#/properties/description/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var u=b===r}else var u=!0;if(u){if(e.meta!==void 0){let b=e.meta;const R=r;if(r===R)if(b&&typeof b=="object"&&!Array.isArray(b)){let E;if(b.title===void 0&&(E="title")||b.author===void 0&&(E="author"))return Y.errors=[{instancePath:t+"/meta",schemaPath:"#/properties/meta/required",keyword:"required",params:{missingProperty:E},message:"must have required property '"+E+"'"}],!1;{const v=r;for(const g in b)if(!(g==="title"||g==="description"||g==="author"||g==="categories"))return Y.errors=[{instancePath:t+"/meta",schemaPath:"#/properties/meta/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:g},message:"must NOT have additional properties"}],!1;if(v===r){if(b.title!==void 0){const g=r;if(typeof b.title!="string")return Y.errors=[{instancePath:t+"/meta/title",schemaPath:"#/properties/meta/properties/title/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var f=g===r}else var f=!0;if(f){if(b.description!==void 0){const g=r;if(typeof b.description!="string")return Y.errors=[{instancePath:t+"/meta/description",schemaPath:"#/properties/meta/properties/description/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var f=g===r}else var f=!0;if(f){if(b.author!==void 0){const g=r;if(typeof b.author!="string")return Y.errors=[{instancePath:t+"/meta/author",schemaPath:"#/properties/meta/properties/author/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var f=g===r}else var f=!0;if(f)if(b.categories!==void 0){let g=b.categories;const w=r;if(r===w)if(Array.isArray(g)){var h=!0;const $=g.length;for(let D=0;D<$;D++){const x=r;if(typeof g[D]!="string")return Y.errors=[{instancePath:t+"/meta/categories/"+D,schemaPath:"#/properties/meta/properties/categories/items/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var h=x===r;if(!h)break}}else return Y.errors=[{instancePath:t+"/meta/categories",schemaPath:"#/properties/meta/properties/categories/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;var f=w===r}else var f=!0}}}}}else return Y.errors=[{instancePath:t+"/meta",schemaPath:"#/properties/meta/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var u=R===r}else var u=!0;if(u){if(e.preferredVersions!==void 0){let b=e.preferredVersions;const R=r;if(r===R)if(b&&typeof b=="object"&&!Array.isArray(b)){let E;if(b.php===void 0&&(E="php")||b.wp===void 0&&(E="wp"))return Y.errors=[{instancePath:t+"/preferredVersions",schemaPath:"#/properties/preferredVersions/required",keyword:"required",params:{missingProperty:E},message:"must have required property '"+E+"'"}],!1;{const v=r;for(const g in b)if(!(g==="php"||g==="wp"))return Y.errors=[{instancePath:t+"/preferredVersions",schemaPath:"#/properties/preferredVersions/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:g},message:"must NOT have additional properties"}],!1;if(v===r){if(b.php!==void 0){let g=b.php;const w=r,M=r;let $=!1;const D=r;Ze(g,{instancePath:t+"/preferredVersions/php",parentData:b,parentDataProperty:"php",rootData:l})||(s=s===null?Ze.errors:s.concat(Ze.errors),r=s.length);var y=D===r;if($=$||y,!$){const x=r;if(typeof g!="string"){const F={instancePath:t+"/preferredVersions/php",schemaPath:"#/properties/preferredVersions/properties/php/anyOf/1/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[F]:s.push(F),r++}if(g!=="latest"){const F={instancePath:t+"/preferredVersions/php",schemaPath:"#/properties/preferredVersions/properties/php/anyOf/1/const",keyword:"const",params:{allowedValue:"latest"},message:"must be equal to constant"};s===null?s=[F]:s.push(F),r++}var y=x===r;$=$||y}if($)r=M,s!==null&&(M?s.length=M:s=null);else{const x={instancePath:t+"/preferredVersions/php",schemaPath:"#/properties/preferredVersions/properties/php/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[x]:s.push(x),r++,Y.errors=s,!1}var m=w===r}else var m=!0;if(m)if(b.wp!==void 0){let g=b.wp;const w=r,M=r;let $=!1;const D=r;if(typeof g!="string"){const L={instancePath:t+"/preferredVersions/wp",schemaPath:"#/properties/preferredVersions/properties/wp/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[L]:s.push(L),r++}var k=D===r;if($=$||k,!$){const L=r;if(typeof g!="string"){const C={instancePath:t+"/preferredVersions/wp",schemaPath:"#/properties/preferredVersions/properties/wp/anyOf/1/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[C]:s.push(C),r++}if(g!=="latest"){const C={instancePath:t+"/preferredVersions/wp",schemaPath:"#/properties/preferredVersions/properties/wp/anyOf/1/const",keyword:"const",params:{allowedValue:"latest"},message:"must be equal to constant"};s===null?s=[C]:s.push(C),r++}var k=L===r;if($=$||k,!$){const C=r;if(typeof g!="boolean"){const q={instancePath:t+"/preferredVersions/wp",schemaPath:"#/properties/preferredVersions/properties/wp/anyOf/2/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};s===null?s=[q]:s.push(q),r++}if(g!==!1){const q={instancePath:t+"/preferredVersions/wp",schemaPath:"#/properties/preferredVersions/properties/wp/anyOf/2/const",keyword:"const",params:{allowedValue:!1},message:"must be equal to constant"};s===null?s=[q]:s.push(q),r++}var k=C===r;$=$||k}}if($)r=M,s!==null&&(M?s.length=M:s=null);else{const L={instancePath:t+"/preferredVersions/wp",schemaPath:"#/properties/preferredVersions/properties/wp/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[L]:s.push(L),r++,Y.errors=s,!1}var m=w===r}else var m=!0}}}else return Y.errors=[{instancePath:t+"/preferredVersions",schemaPath:"#/properties/preferredVersions/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var u=R===r}else var u=!0;if(u){if(e.features!==void 0){let b=e.features;const R=r;if(r===R)if(b&&typeof b=="object"&&!Array.isArray(b)){const E=r;for(const v in b)if(!(v==="intl"||v==="networking"))return Y.errors=[{instancePath:t+"/features",schemaPath:"#/properties/features/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:v},message:"must NOT have additional properties"}],!1;if(E===r){if(b.intl!==void 0){const v=r;if(typeof b.intl!="boolean")return Y.errors=[{instancePath:t+"/features/intl",schemaPath:"#/properties/features/properties/intl/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var O=v===r}else var O=!0;if(O)if(b.networking!==void 0){const v=r;if(typeof b.networking!="boolean")return Y.errors=[{instancePath:t+"/features/networking",schemaPath:"#/properties/features/properties/networking/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"}],!1;var O=v===r}else var O=!0}}else return Y.errors=[{instancePath:t+"/features",schemaPath:"#/properties/features/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var u=R===r}else var u=!0;if(u){if(e.extraLibraries!==void 0){let b=e.extraLibraries;const R=r;if(r===R)if(Array.isArray(b)){var T=!0;const E=b.length;for(let v=0;v<E;v++){let g=b[v];const w=r;if(typeof g!="string")return Y.errors=[{instancePath:t+"/extraLibraries/"+v,schemaPath:"#/definitions/ExtraLibrary/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;if(g!=="wp-cli")return Y.errors=[{instancePath:t+"/extraLibraries/"+v,schemaPath:"#/definitions/ExtraLibrary/const",keyword:"const",params:{allowedValue:"wp-cli"},message:"must be equal to constant"}],!1;var T=w===r;if(!T)break}}else return Y.errors=[{instancePath:t+"/extraLibraries",schemaPath:"#/properties/extraLibraries/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;var u=R===r}else var u=!0;if(u){if(e.constants!==void 0){let b=e.constants;const R=r;if(r===r)if(b&&typeof b=="object"&&!Array.isArray(b))for(const v in b){let g=b[v];const w=r;if(typeof g!="string"&&typeof g!="boolean"&&!(typeof g=="number"&&isFinite(g)))return Y.errors=[{instancePath:t+"/constants/"+v.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/definitions/PHPConstants/additionalProperties/type",keyword:"type",params:{type:pi.additionalProperties.type},message:"must be string,boolean,number"}],!1;var _=w===r;if(!_)break}else return Y.errors=[{instancePath:t+"/constants",schemaPath:"#/definitions/PHPConstants/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var u=R===r}else var u=!0;if(u){if(e.plugins!==void 0){let b=e.plugins;const R=r;if(r===R)if(Array.isArray(b)){var U=!0;const E=b.length;for(let v=0;v<E;v++){let g=b[v];const w=r,M=r;let $=!1;const D=r;if(typeof g!="string"){const L={instancePath:t+"/plugins/"+v,schemaPath:"#/properties/plugins/items/anyOf/0/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[L]:s.push(L),r++}var J=D===r;if($=$||J,!$){const L=r;K(g,{instancePath:t+"/plugins/"+v,parentData:b,parentDataProperty:v,rootData:l})||(s=s===null?K.errors:s.concat(K.errors),r=s.length);var J=L===r;$=$||J}if($)r=M,s!==null&&(M?s.length=M:s=null);else{const L={instancePath:t+"/plugins/"+v,schemaPath:"#/properties/plugins/items/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[L]:s.push(L),r++,Y.errors=s,!1}var U=w===r;if(!U)break}}else return Y.errors=[{instancePath:t+"/plugins",schemaPath:"#/properties/plugins/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;var u=R===r}else var u=!0;if(u){if(e.siteOptions!==void 0){let b=e.siteOptions;const R=r;if(r===R)if(b&&typeof b=="object"&&!Array.isArray(b)){const E=r;for(const v in b)if(v!=="blogname"){const g=r;if(typeof b[v]!="string")return Y.errors=[{instancePath:t+"/siteOptions/"+v.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/siteOptions/additionalProperties/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var ee=g===r;if(!ee)break}if(E===r&&b.blogname!==void 0&&typeof b.blogname!="string")return Y.errors=[{instancePath:t+"/siteOptions/blogname",schemaPath:"#/properties/siteOptions/properties/blogname/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1}else return Y.errors=[{instancePath:t+"/siteOptions",schemaPath:"#/properties/siteOptions/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;var u=R===r}else var u=!0;if(u){if(e.login!==void 0){let b=e.login;const R=r,P=r;let E=!1;const v=r;if(typeof b!="boolean"){const w={instancePath:t+"/login",schemaPath:"#/properties/login/anyOf/0/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};s===null?s=[w]:s.push(w),r++}var A=v===r;if(E=E||A,!E){const w=r;if(r===w)if(b&&typeof b=="object"&&!Array.isArray(b)){let $;if(b.username===void 0&&($="username")||b.password===void 0&&($="password")){const D={instancePath:t+"/login",schemaPath:"#/properties/login/anyOf/1/required",keyword:"required",params:{missingProperty:$},message:"must have required property '"+$+"'"};s===null?s=[D]:s.push(D),r++}else{const D=r;for(const x in b)if(!(x==="username"||x==="password")){const L={instancePath:t+"/login",schemaPath:"#/properties/login/anyOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:x},message:"must NOT have additional properties"};s===null?s=[L]:s.push(L),r++;break}if(D===r){if(b.username!==void 0){const x=r;if(typeof b.username!="string"){const L={instancePath:t+"/login/username",schemaPath:"#/properties/login/anyOf/1/properties/username/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[L]:s.push(L),r++}var B=x===r}else var B=!0;if(B)if(b.password!==void 0){const x=r;if(typeof b.password!="string"){const F={instancePath:t+"/login/password",schemaPath:"#/properties/login/anyOf/1/properties/password/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[F]:s.push(F),r++}var B=x===r}else var B=!0}}}else{const $={instancePath:t+"/login",schemaPath:"#/properties/login/anyOf/1/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[$]:s.push($),r++}var A=w===r;E=E||A}if(E)r=P,s!==null&&(P?s.length=P:s=null);else{const w={instancePath:t+"/login",schemaPath:"#/properties/login/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[w]:s.push(w),r++,Y.errors=s,!1}var u=R===r}else var u=!0;if(u){if(e.steps!==void 0){let b=e.steps;const R=r;if(r===R)if(Array.isArray(b)){var Z=!0;const E=b.length;for(let v=0;v<E;v++){let g=b[v];const w=r,M=r;let $=!1;const D=r;a(g,{instancePath:t+"/steps/"+v,parentData:b,parentDataProperty:v,rootData:l})||(s=s===null?a.errors:s.concat(a.errors),r=s.length);var te=D===r;if($=$||te,!$){const L=r;if(typeof g!="string"){const C={instancePath:t+"/steps/"+v,schemaPath:"#/properties/steps/items/anyOf/1/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[C]:s.push(C),r++}var te=L===r;if($=$||te,!$){const C=r,se={instancePath:t+"/steps/"+v,schemaPath:"#/properties/steps/items/anyOf/2/not",keyword:"not",params:{},message:"must NOT be valid"};s===null?s=[se]:s.push(se),r++;var te=C===r;if($=$||te,!$){const z=r;if(typeof g!="boolean"){const V={instancePath:t+"/steps/"+v,schemaPath:"#/properties/steps/items/anyOf/3/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};s===null?s=[V]:s.push(V),r++}if(g!==!1){const V={instancePath:t+"/steps/"+v,schemaPath:"#/properties/steps/items/anyOf/3/const",keyword:"const",params:{allowedValue:!1},message:"must be equal to constant"};s===null?s=[V]:s.push(V),r++}var te=z===r;if($=$||te,!$){const V=r;if(g!==null){const fe={instancePath:t+"/steps/"+v,schemaPath:"#/properties/steps/items/anyOf/4/type",keyword:"type",params:{type:"null"},message:"must be null"};s===null?s=[fe]:s.push(fe),r++}var te=V===r;$=$||te}}}}if($)r=M,s!==null&&(M?s.length=M:s=null);else{const L={instancePath:t+"/steps/"+v,schemaPath:"#/properties/steps/items/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};return s===null?s=[L]:s.push(L),r++,Y.errors=s,!1}var Z=w===r;if(!Z)break}}else return Y.errors=[{instancePath:t+"/steps",schemaPath:"#/properties/steps/type",keyword:"type",params:{type:"array"},message:"must be array"}],!1;var u=R===r}else var u=!0;if(u)if(e.$schema!==void 0){const b=r;if(typeof e.$schema!="string")return Y.errors=[{instancePath:t+"/$schema",schemaPath:"#/properties/%24schema/type",keyword:"type",params:{type:"string"},message:"must be string"}],!1;var u=b===r}else var u=!0}}}}}}}}}}}}else return Y.errors=[{instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"}],!1;return Y.errors=s,r===0}function $r(e,{instancePath:t="",parentData:o,parentDataProperty:n,rootData:l=e}={}){let s=null,r=0;return Y(e,{instancePath:t,parentData:o,parentDataProperty:n,rootData:l})||(s=s===null?Y.errors:s.concat(Y.errors),r=s.length),$r.errors=s,r===0}function Kt(e){const t=e.trim().replace(/\/+$/,"");return/^https:\/\/.+\.git$/.test(t)||/^https:\/\/github\.com\/[^/]+\/[^/]+$/.test(t)?!0:/^https:\/\/gitlab\.com\/[^/]+\/[^/]+(\/[^/]+)*$/.test(t)}class tt extends Error{constructor(t,o){super(t),this.name="InvalidBlueprintError",this.validationErrors=o}}const{wpCLI:hi,...ht}=ni,gi={...ht,"wp-cli":hi,importFile:ht.importWxr};class es extends Error{constructor(t){const{stepNumber:o,step:n,cause:l}=t,s=l instanceof Error?l:new Error(String(l)),r=`Error when executing the blueprint step #${o}`,u=s.message?`${r}: ${s.message}`:r;super(u,{cause:s}),this.name="BlueprintStepExecutionError",this.stepNumber=o,this.step=n,this.messages=(s.message||"").split(`
|
|
1026
|
+
`).map(f=>f.trim()).filter(Boolean)}}async function Ke(e,t={}){const o={...t};let n;return er(e)?(n=await rs(e),o.streamBundledFile=function(...l){return e.read(...l)}):n=e,_i(n,o)}function er(e){return e&&"read"in e&&typeof e.read=="function"}async function rs(e){if(!er(e))return e;const o=await(await e.read("blueprint.json")).text();return JSON.parse(o)}function _i(e,{progress:t=new zr.ProgressTracker,semaphore:o=new N.Semaphore({concurrency:3}),onStepCompleted:n=()=>{},onBlueprintValidated:l=()=>{},corsProxy:s,streamBundledFile:r,gitAdditionalHeadersCallback:u,additionalSteps:f}={}){var _,U,J,ee,A,B,Z,te,G,b,R;e=structuredClone(e),e={...e,steps:(e.steps||[]).filter(ts).filter(vi)},e.steps=[...e.steps||[],...f||[]],((_=e.preferredVersions)==null?void 0:_.wp)===!1&&ki(e);for(const P of e.steps)!P||typeof P!="object"||(P.step==="importFile"?(P.step="importWxr",oe.logger.warn('The "importFile" step is deprecated. Use "importWxr" instead.')):(P==null?void 0:P.step)==="installPlugin"&&"pluginZipFile"in P?(P.pluginData=P.pluginZipFile,oe.logger.warn('The "pluginZipFile" option of the "installPlugin" step is deprecated. Use "pluginData" instead.')):(P==null?void 0:P.step)==="installTheme"&&"themeZipFile"in P&&(P.themeData=P.themeZipFile,oe.logger.warn('The "themeZipFile" option of the "installTheme" step is deprecated. Use "themeData" instead.')));if(e.constants&&e.steps.unshift({step:"defineWpConfigConsts",consts:e.constants}),e.siteOptions&&e.steps.unshift({step:"setSiteOptions",options:e.siteOptions}),e.plugins){const P=e.plugins.map(E=>typeof E=="string"?Kt(E)?{resource:"zip",inner:{resource:"git:directory",url:E.trim().replace(/\/+$/,""),ref:"HEAD"}}:E.startsWith("https://")?{resource:"url",url:E}:{resource:"wordpress.org/plugins",slug:E}:E).map(E=>({step:"installPlugin",pluginData:E}));e.steps.unshift(...P)}e.login&&e.steps.unshift({step:"login",...e.login===!0?{username:"admin"}:e.login});const h=((U=e.steps)==null?void 0:U.findIndex(P=>typeof P=="object"&&(P==null?void 0:P.step)&&["wp-cli","enableMultisite"].includes(P.step)))??-1;if((J=e==null?void 0:e.extraLibraries)!=null&&J.includes("wp-cli")||h!==-1){const P={step:"writeFile",data:Ys,path:Gr};h===-1?(ee=e.steps)==null||ee.push(P):(A=e.steps)==null||A.splice(h,0,P)}const y=(B=e.steps)==null?void 0:B.findIndex(P=>typeof P=="object"&&(P==null?void 0:P.step)==="importWxr");y!==void 0&&y>-1&&((Z=e.steps)==null||Z.splice(y,0,{step:"installPlugin",pluginData:{resource:"wordpress.org/plugins",slug:"wordpress-importer"}}));const m=st(e);if(!m.valid){const{errors:P}=m,E=wi(e,P);throw new tt(`Invalid Blueprint: The Blueprint does not conform to the schema.
|
|
857
1027
|
|
|
858
1028
|
Found ${P.length} validation error(s):
|
|
859
1029
|
|
|
860
|
-
${
|
|
861
|
-
|
|
862
|
-
Please review your Blueprint and fix these issues. Learn more about the Blueprint format: https://wordpress.github.io/wordpress-playground/blueprints/data-format`,P)}l(
|
|
863
|
-
"${
|
|
864
|
-
${"^".repeat(
|
|
865
|
-
Value: ${y.length>200?y.substring(0,200)+"...":y}`}}catch{}return`${
|
|
866
|
-
|
|
867
|
-
`)}function $t(r){var l;const t=ur(r);if(t)return{valid:t};const n=new Set;for(const s of ur.errors)s.schemaPath.startsWith("#/properties/steps/items/anyOf")||n.add(s.instancePath);return{valid:!1,errors:((l=ur.errors)==null?void 0:l.filter(s=>!(s.schemaPath.startsWith("#/properties/steps/items/anyOf")&&n.has(s.instancePath))))??[]}}function Is(r,t,n){return(r==="7.2"||r==="7.3")&&(oe.logger.warn(`PHP ${r} is no longer supported. Automatically upgrading to PHP 7.4.`),r="7.4"),r&&t.includes(r)?r:n}function jt(r){return!!(typeof r=="object"&&r)}function Ds(r){return["setPhpIniEntry","request"].includes(r.step)?(oe.logger.warn(`The "${r.step}" Blueprint is no longer supported and you can remove it from your Blueprint.`),!1):!0}function Us(r,{semaphore:t,rootProgressTracker:n,totalProgressWeight:p,corsProxy:l,streamBundledFile:s,gitAdditionalHeadersCallback:e}){var k;const f=n.stage((((k=r.progress)==null?void 0:k.weight)||1)/p),d={};for(const T of Object.keys(r)){let b=r[T];Yt(b)&&(b=we.create(b,{semaphore:t,corsProxy:l,streamBundledFile:s,gitAdditionalHeadersCallback:e})),d[T]=b}const g=async T=>{var b;try{return f.fillSlowly(),await Fs[r.step](T,await Ws(d),{tracker:f,initialCaption:(b=r.progress)==null?void 0:b.caption})}finally{f.finish()}},y=Ur(d),h=Ur(d).filter(T=>T.isAsync),E=1/(h.length+1);for(const T of h)T.progress=f.stage(E);return{run:g,step:r,resources:y}}function Ur(r){const t=[];for(const n in r){const p=r[n];p instanceof we&&t.push(p)}return t}async function Ws(r){const t={};for(const n in r){const p=r[n];p instanceof we?t[n]=await p.resolve():t[n]=p}return t}async function At(r,t){await r.run(t)}const Vs=new Set(["installPlugin","installTheme","activatePlugin","activateTheme","login","setSiteOptions","updateUserMeta","importWxr","importFile","importWordPressFiles","enableMultisite","wp-cli","resetData"]);function Bs(r){var p,l;const t=[];(p=r.plugins)!=null&&p.length&&t.push("plugins"),r.siteOptions&&t.push("siteOptions"),r.login&&t.push("login"),(l=r.extraLibraries)!=null&&l.includes("wp-cli")&&t.push("extraLibraries includes 'wp-cli'");const n=(r.steps||[]).filter(s=>!!s&&typeof s=="object"&&"step"in s).map(s=>s.step).filter(s=>Vs.has(s));if(n.length&&t.push(`steps: ${[...new Set(n)].join(", ")}`),t.length)throw new Fr(`Blueprint has \`preferredVersions.wp: false\` but uses WordPress-only features: ${t.join("; ")}. Remove these or drop \`preferredVersions.wp: false\`.`,[])}async function qt(){const r=(await Promise.resolve().then(()=>require("./blueprints-Gs5fAvvo.cjs"))).default;return new File([r],"blueprints.phar",{type:"application/zip"})}function Ms(r){if(typeof r=="object"&&"type"in r&&["inline-file","file-reference"].includes(r.type))return r;if(!r)return{type:"inline-file",contents:"{}"};if(typeof r!="string")return{type:"inline-file",contents:JSON.stringify(r)};try{return JSON.parse(r),{type:"inline-file",contents:r}}catch{return{type:"file-reference",reference:r}}}async function zs(r){var y,h;const t=r.cliArgs||[];for(const E of t)if(E.startsWith("--site-path="))throw new Error("The --site-path CLI argument must not be provided. In Playground, it is always set to /wordpress.");t.push("--site-path=/wordpress"),t.find(E=>E.startsWith("--db-engine="))||t.push("--db-engine=sqlite");const p=r.php,l=(r==null?void 0:r.onMessage)||(()=>{}),s=await qt();p.writeFile("/tmp/blueprints.phar",new Uint8Array(await s.arrayBuffer()));const e=Ms(r.blueprint);let f="";switch(e.type){case"inline-file":p.writeFile("/tmp/blueprint.json",e.contents),f="/tmp/blueprint.json";break;case"file-reference":f=e.reference;break}const d=await p.onMessage(async E=>{try{const k=typeof E=="string"?JSON.parse(E):E;if(!k)return;await new Promise(T=>setTimeout(T,0)),k.type.startsWith("blueprint.")&&await l(k)}catch(k){oe.logger.warn("Failed to parse message as JSON:",E,k)}});await(p==null?void 0:p.writeFile("/tmp/run-blueprints.php",`<?php
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
}
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
1030
|
+
${E}
|
|
1031
|
+
|
|
1032
|
+
Please review your Blueprint and fix these issues. Learn more about the Blueprint format: https://wordpress.github.io/wordpress-playground/blueprints/data-format`,P)}l(e);const k=e.steps||[],O=k.reduce((P,E)=>{var v;return P+(((v=E.progress)==null?void 0:v.weight)||1)},0),T=k.map(P=>Pi(P,{semaphore:o,rootProgressTracker:t,totalProgressWeight:O,corsProxy:s,streamBundledFile:r,gitAdditionalHeadersCallback:u}));return{versions:{php:bi((te=e.preferredVersions)==null?void 0:te.php,ke.AllPHPVersions,ke.LatestSupportedPHPVersion),wp:((G=e.preferredVersions)==null?void 0:G.wp)||"latest"},features:{intl:((b=e.features)==null?void 0:b.intl)??!1,networking:((R=e.features)==null?void 0:R.networking)??!0},extraLibraries:e.extraLibraries||[],run:async P=>{try{for(const{resources:E}of T)for(const v of E)v.setPlayground(P),v.isAsync&&v.resolve().catch(()=>{});for(const[E,{run:v,step:g}]of Object.entries(T))try{const w=await v(P);n(w,g)}catch(w){const M=Number(E)+1;throw new es({stepNumber:M,step:g,cause:w})}}finally{try{const E=await P.pathToInternalUrl(e.landingPage||"/");await P.goTo("/index.php?playground-redirection-handler&next="+encodeURIComponent(E))}catch{}t.finish()}}}}function wi(e,t){return t.map((o,n)=>{var u;const l=o.instancePath||"/";let s=o.message||"validation failed",r="";if(s.includes("must NOT have additional properties")){const f=(u=o.params)==null?void 0:u.additionalProperty;if(f){s=`has unexpected property "${f}"`;try{const h=l.split("/").filter(Boolean);let y=e;for(const m of h)y&&typeof y=="object"&&(y=y[m]);if(y&&typeof y=="object"){const m=y[f],k=JSON.stringify(m);r=`
|
|
1033
|
+
"${f}": ${k}
|
|
1034
|
+
${"^".repeat(f.length+2)} This property is not recognized`}}catch{}}}else try{const f=l.split("/").filter(Boolean);let h=e;for(const y of f)h&&typeof h=="object"&&(h=h[y]);if(h!==void 0){const y=JSON.stringify(h,null,2);r=`
|
|
1035
|
+
Value: ${y.length>200?y.substring(0,200)+"...":y}`}}catch{}return`${n+1}. At path "${l}": ${s}${r}`}).join(`
|
|
1036
|
+
|
|
1037
|
+
`)}function st(e){var l;const t=$r(e);if(t)return{valid:t};const o=new Set;for(const s of $r.errors)s.schemaPath.startsWith("#/properties/steps/items/anyOf")||o.add(s.instancePath);return{valid:!1,errors:((l=$r.errors)==null?void 0:l.filter(s=>!(s.schemaPath.startsWith("#/properties/steps/items/anyOf")&&o.has(s.instancePath))))??[]}}function bi(e,t,o){return(e==="7.2"||e==="7.3")&&(oe.logger.warn(`PHP ${e} is no longer supported. Automatically upgrading to PHP 7.4.`),e="7.4"),e&&t.includes(e)?e:o}function ts(e){return!!(typeof e=="object"&&e)}function vi(e){return["setPhpIniEntry","request"].includes(e.step)?(oe.logger.warn(`The "${e.step}" Blueprint is no longer supported and you can remove it from your Blueprint.`),!1):!0}function Pi(e,{semaphore:t,rootProgressTracker:o,totalProgressWeight:n,corsProxy:l,streamBundledFile:s,gitAdditionalHeadersCallback:r}){var O,T;const u=o.stage((((O=e.progress)==null?void 0:O.weight)||1)/n,(T=e.progress)==null?void 0:T.caption),f={};for(const _ of Object.keys(e)){let U=e[_];ks(U)&&(U=me.create(U,{semaphore:t,corsProxy:l,streamBundledFile:s,gitAdditionalHeadersCallback:r})),f[_]=U}const h=async _=>{var U,J;try{return(U=e.progress)!=null&&U.caption&&u.setCaption(e.progress.caption),u.fillSlowly(),await gi[e.step](_,await $i(f),{tracker:u,initialCaption:(J=e.progress)==null?void 0:J.caption})}finally{u.finish()}},y=gt(f),m=gt(f).filter(_=>_.isAsync),k=1/(m.length+1);for(const _ of m)_.progress=u.stage(k);return{run:h,step:e,resources:y}}function gt(e){const t=[];for(const o in e){const n=e[o];n instanceof me&&t.push(n)}return t}async function $i(e){const t={};for(const o in e){const n=e[o];n instanceof me?t[o]=await n.resolve():t[o]=n}return t}async function ss(e,t){await e.run(t)}const Oi=new Set(["installPlugin","installTheme","activatePlugin","activateTheme","login","setSiteOptions","updateUserMeta","importWxr","importFile","importWordPressFiles","enableMultisite","wp-cli","resetData"]);function ki(e){var n,l;const t=[];(n=e.plugins)!=null&&n.length&&t.push("plugins"),e.siteOptions&&t.push("siteOptions"),e.login&&t.push("login"),(l=e.extraLibraries)!=null&&l.includes("wp-cli")&&t.push("extraLibraries includes 'wp-cli'");const o=(e.steps||[]).filter(s=>!!s&&typeof s=="object"&&"step"in s).map(s=>s.step).filter(s=>Oi.has(s));if(o.length&&t.push(`steps: ${[...new Set(o)].join(", ")}`),t.length)throw new tt(`Blueprint has \`preferredVersions.wp: false\` but uses WordPress-only features: ${t.join("; ")}. Remove these or drop \`preferredVersions.wp: false\`.`,[])}async function Ei(e){if(Ti(e)){const{validateBlueprintV2Declaration:t}=await Promise.resolve().then(()=>require("./validate-blueprint-v2-CGFpDXlD.cjs"));return t(e)}return st(e)}function Ti(e){return typeof e=="object"&&e!==null&&"version"in e&&e.version===2}const Ri=["latest","beta","trunk","nightly","none"],is="custom",Si=/^\d+\.\d+(?:\.\d+)?(?:-(?:beta|rc)\d+)?$/i,ji=ke.AllPHPVersions.filter(e=>e!=="next");async function os(e,t="create-new-site",o){var r,u;if(!qi(e))throw new Error("Expected a Blueprint v2 declaration.");const{assertValidBlueprintV2Declaration:n}=await Promise.resolve().then(()=>require("./validate-blueprint-v2-CGFpDXlD.cjs"));n(e),o==null||o(e);const l=(r=e.applicationOptions)==null?void 0:r["wordpress-playground"],s=await Fi(e,t==="create-new-site");return{phpVersion:Ni(e),wpVersion:s,intl:((u=l==null?void 0:l.loadPhpExtensions)==null?void 0:u.includes("intl"))??!1,networking:(l==null?void 0:l.networkAccess)??!1,constants:e.constants??{},extraLibraries:[]}}async function Ai(e,t){const o=e.wordpressVersion;ns(o)&&(it(o),!Xe(t,o)&&Mi(t,o))}function qi(e){return e.version===2}function Ni(e){const t=e.phpVersion;if(typeof t=="string")return _t(t);const o=Li(t);if(o){const l=_t(o);if(t&&typeof t=="object"&&Mr(l,t))return l;throw new Error(`Blueprint v2 recommended PHP version "${o}" does not satisfy constraints ${JSON.stringify(t)}.`)}const n=xi(t);if(n)return n;if(t&&typeof t=="object")throw new Error(`Unsatisfiable Blueprint v2 PHP version constraints ${JSON.stringify(t)}. Supported versions: ${ke.AllPHPVersions.join(", ")}.`);return Ge.RecommendedPHPVersion}function _t(e){if(e==="latest")return ke.LatestSupportedPHPVersion;if(ke.AllPHPVersions.includes(e))return e;throw new Error(`Unsupported Blueprint v2 PHP version "${e}". Supported versions: ${ke.AllPHPVersions.join(", ")}.`)}function Li(e){if(!(!e||typeof e!="object")&&"recommended"in e)return typeof e.recommended=="string"?e.recommended:void 0}function xi(e){if(!(!e||typeof e!="object"))return Mr(Ge.RecommendedPHPVersion,e)?Ge.RecommendedPHPVersion:ji.find(t=>Mr(t,e))}function Mr(e,t){if(e==="next")return!1;const o=wt(t==null?void 0:t.min);if(o&&bt(e,o)<0)return!1;const n=wt(t==null?void 0:t.max);return!(n&&bt(e,n)>0)}function wt(e){return e==="latest"?ke.LatestSupportedPHPVersion:e}function bt(e,t){const o=vt(e),n=vt(t);for(let l=0;l<3;l++){const s=o[l]-n[l];if(s!==0)return s}return 0}function vt(e){const[t=0,o=0,n=0]=e.split(".").map(l=>Number(l));return[t,o,n]}async function Fi(e,t){const o=e.wordpressVersion;if(typeof o=="string")return Ci(o);if(ns(o)){if(!t)return it(o),"latest";const n=await Ii(o);if(n)return n;throw new Error(`Unsatisfiable Blueprint v2 WordPress version constraints ${JSON.stringify(o)}. No available WordPress release satisfies the declared bounds.`)}return o&&typeof o=="object"?is:"latest"}function Ci(e){if(zi(e))return e;if(Hi(e))return is;if(Ri.includes(e)||Si.test(e))return e;throw new Error(`Unsupported Blueprint v2 WordPress version "${e}". Use latest, beta, trunk, nightly, or a version like 6.8, 6.8.1, 6.8-beta1, 6.8-rc1; or use none to boot PHP without WordPress.`)}function ns(e){return!e||typeof e!="object"?!1:"min"in e}async function Ii(e){it(e);const t=e.preferred,o=await Ui(e);if(t&&t!=="latest"){const n=o.filter(s=>Wi(s,t));if(n.length===0)throw new Error(`Blueprint v2 preferred WordPress version "${t}" is not available.`);const l=n.find(s=>Xe(s,e));if(l)return l;throw new Error(`Blueprint v2 preferred WordPress version "${t}" does not satisfy constraints ${JSON.stringify(e)}.`)}return o.find(n=>Xe(n,e))}function it(e){Vi(e),Br("wordpressVersion.min",e.min),e.max&&Br("wordpressVersion.max",e.max);const t=e.preferred;if(t&&t!=="latest"&&(Br("wordpressVersion.preferred",t),!Di(t,e)))throw new Error(`Blueprint v2 preferred WordPress version "${t}" does not satisfy constraints ${JSON.stringify(e)}.`);if(!Xe(e.min,e))throw new Error(`Unsatisfiable Blueprint v2 WordPress version constraints ${JSON.stringify(e)}. The minimum version exceeds the maximum version.`)}async function Ui(e){const t=(await Or.getWordPressStableVersions()).map(Bi);if(e&&[e.min,e.max,e.preferred].some(o=>{var n;return o&&((n=Pe(o))==null?void 0:n.suffix)!==void 0})){const o=await Or.resolveWordPressRelease("beta");t.push(o.version)}return Array.from(new Set(t)).filter(as).sort((o,n)=>Er(n,o))}function Bi(e){return/^\d+\.\d+$/.test(e)?`${e}.0`:e}function Wi(e,t){const o=Pe(e),n=Pe(t);return!o||!n?!1:!n.patchSpecified&&!n.suffix?!o.suffix&&o.parts[0]===n.parts[0]&&o.parts[1]===n.parts[1]:Er(e,t)===0}function Di(e,t){const o=Pe(e);if(!o)return!1;if(o.patchSpecified||o.suffix)return Xe(e,t);const n=Pe(t.min),l=o.parts.slice(0,2),s=n.parts.slice(0,2);if(Pt(l,s)<0)return!1;if(!t.max)return!0;const r=Pe(t.max),u=r.parts.slice(0,2),f=Pt(l,u);return f<0||f===0&&!r.suffix}function Pt(e,t){for(let o=0;o<2;o++){const n=e[o]-t[o];if(n!==0)return n}return 0}function Mi(e,t){throw new Error(`Installed WordPress version "${e}" does not satisfy Blueprint v2 wordpressVersion ${JSON.stringify(t)}.`)}function Vi(e){Ur("wordpressVersion.min",e.min),e.max!==void 0&&Ur("wordpressVersion.max",e.max),e.preferred!==void 0&&Ur("wordpressVersion.preferred",e.preferred)}function Ur(e,t){if(typeof t!="string")throw new Error(`Unsupported Blueprint v2 WordPress version constraint ${e} ${JSON.stringify(t)}. Use a version like 6.8, 6.8.1, 6.8-beta1, or 6.8-rc1.`)}function Br(e,t){if(!as(t))throw new Error(`Unsupported Blueprint v2 WordPress version constraint ${e} "${t}". Use a version like 6.8, 6.8.1, 6.8-beta1, or 6.8-rc1.`)}function Xe(e,t){const o=Pe(e),n=Pe(t.min);if(!o||!n||Er(e,t.min)<0)return!1;if(!t.max)return!0;const l=Pe(t.max);return l?!l.patchSpecified&&!l.suffix&&o.parts[0]===l.parts[0]&&o.parts[1]===l.parts[1]?!0:Er(e,t.max)<=0:!1}function Er(e,t){const o=Pe(e),n=Pe(t);if(!o||!n)throw new Error(`Cannot compare WordPress versions "${e}" and "${t}".`);for(let l=0;l<o.parts.length;l++){const s=o.parts[l]-n.parts[l];if(s!==0)return s}return 0}function as(e){return Pe(e)!==null}function Pe(e){const t=e.match(/^(\d+)\.(\d+)(?:\.(\d+))?(?:-(beta|rc)(\d+))?$/i);if(!t)return null;const[,o,n,l,s,r="0"]=t,u=s==null?void 0:s.toLowerCase(),f=u?u==="beta"?0:1:2;return{parts:[Number(o),Number(n),Number(l??"0"),f,Number(r)],patchSpecified:l!==void 0,suffix:u}}function zi(e){return e.startsWith("http://")||e.startsWith("https://")}function Hi(e){return e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}class be extends Error{constructor(t,o="This Blueprint v2 feature is not supported by the TypeScript runner yet."){super(`${t}: ${o}`),this.name="UnsupportedBlueprintV2FeatureError",this.featurePath=t}}const ot=["posts","pages","comments"];async function ps(e,t={}){const o=await os(e,t.siteMode,t.onBlueprintValidated),n=ls(e,t.siteMode),{steps:l,unsupportedPlan:s}=Xi(n),r=Ji(e,o,l);return{runtime:o,applicationOptions:e.applicationOptions,plan:n,steps:l,unsupportedPlan:s,run:async u=>{if(s.length>0)throw new be("executionPlan",Zi(s));await(await Ke(r,{progress:t.progress,streamBundledFile:t.streamBundledFile})).run(u)}}}async function Yi(e,t={}){const{assertValidBlueprintV2Declaration:o}=await Promise.resolve().then(()=>require("./validate-blueprint-v2-CGFpDXlD.cjs"));o(e);const n=So(e.wordpressVersion);if(!n)return;const l=at(n,"wordpress");return await me.create(pt(l)?{resource:"zip",inner:l,name:"wordpress.zip"}:l,t).resolve()}function Ji(e,t,o){var l;const n=(l=e.applicationOptions)==null?void 0:l["wordpress-playground"];return{preferredVersions:{php:t.phpVersion,wp:e.wordpressVersion==="none"?!1:t.wpVersion},features:{intl:t.intl,networking:t.networking},extraLibraries:t.extraLibraries,landingPage:n==null?void 0:n.landingPage,login:n==null?void 0:n.login,steps:o}}function Zi(e){return`Blueprint v2 execution plan contains unsupported items: ${e.map(o=>`${Qi(o)} (${Gi(o)})`).join(", ")}.`}function Gi(e){return e.type==="runStep"?e.step.step:e.type}function Qi(e){return"sourcePath"in e?e.sourcePath:`/${e.type}`}function ls(e,t="create-new-site"){var l,s;const o=[],n=e.contentBaseline;if(t==="create-new-site"&&n!==void 0){const r=us(n);ot.some(u=>!r.includes(u))&&o.push({type:"applyContentBaseline",contentBaseline:n,sourcePath:"/contentBaseline"})}t==="create-new-site"&&e.usersBaseline==="empty"&&o.push({type:"applyUsersBaseline",sourcePath:"/usersBaseline"}),e.constants&&Object.keys(e.constants).length>0&&o.push({type:"defineWpConfigConsts",consts:e.constants}),e.siteOptions&&Object.keys(e.siteOptions).length>0&&o.push({type:"setSiteOptions",options:e.siteOptions});for(const[r,u]of(e.muPlugins??[]).entries())o.push({type:"installMuPlugin",muPlugin:u,sourcePath:`/muPlugins/${r}`});for(const[r,u]of(e.themes??[]).entries())o.push({type:"installTheme",theme:u,active:!1,sourcePath:`/themes/${r}`});e.activeTheme!==void 0&&o.push({type:"installTheme",theme:e.activeTheme,active:!0,sourcePath:"/activeTheme"});for(const[r,u]of(e.plugins??[]).entries())o.push({type:"installPlugin",plugin:u,sourcePath:`/plugins/${r}`});e.fonts&&Object.keys(e.fonts).length>0&&o.push({type:"installFonts",fonts:e.fonts});for(const[r,u]of(e.media??[]).entries())o.push({type:"importMedia",media:u,sourcePath:`/media/${r}`});e.siteLanguage&&o.push({type:"setSiteLanguage",language:e.siteLanguage}),(l=e.roles)!=null&&l.length&&o.push({type:"defineRoles",roles:e.roles}),(s=e.users)!=null&&s.length&&o.push({type:"defineUsers",users:e.users}),e.postTypes&&Object.keys(e.postTypes).length>0&&o.push({type:"definePostTypes",postTypes:e.postTypes});for(const[r,u]of(e.content??[]).entries())o.push({type:"importContent",content:u,sourcePath:`/content/${r}`});for(const[r,u]of(e.additionalStepsAfterExecution??[]).entries())o.push({type:"runStep",step:u,sourcePath:`/additionalStepsAfterExecution/${r}`});return o}function Xi(e){const t=[],o=[],n={nextTempFileIndex:0};for(const l of e){const s=so(l,n);s?t.push(...Ki(s,l)):o.push(l)}return{steps:t,unsupportedPlan:o}}function Ki(e,t){if(e.length===0)return e;const o=eo(t),n=1/e.length;return e.map(l=>{var s,r;return{...l,progress:{...l.progress,caption:((s=l.progress)==null?void 0:s.caption)??o,weight:((r=l.progress)==null?void 0:r.weight)??n}}})}function eo(e){switch(e.type){case"applyContentBaseline":return"Removing initial content";case"applyUsersBaseline":return"Removing initial users";case"defineWpConfigConsts":return"Defining constants";case"setSiteOptions":return"Setting site options";case"installMuPlugin":return"Installing must-use plugin";case"installTheme":return e.active?"Installing active theme":"Installing theme";case"installPlugin":return"Installing plugin";case"installFonts":return"Installing fonts";case"importMedia":return"Importing media";case"setSiteLanguage":return"Setting site language";case"defineRoles":return"Creating roles";case"defineUsers":return"Creating users";case"definePostTypes":return"Registering post types";case"importContent":return ro(e.content);case"runStep":return to(e.step)}return nt(e)}function nt(e){throw new Error(`Unexpected Blueprint v2 progress item: ${e}`)}function ro(e){switch(e.type){case"mysql-dump":return"Importing SQL content";case"posts":return"Importing posts";case"wxr":return"Importing WXR content"}return nt(e)}function to(e){switch(e.step){case"activatePlugin":return"Activating plugin";case"activateTheme":return"Activating theme";case"cp":return"Copying files";case"defineConstants":return"Defining constants";case"enableMultisite":return"Enabling multisite";case"importContent":return"Importing content";case"importMedia":return"Importing media";case"importThemeStarterContent":return"Importing theme starter content";case"installPlugin":return"Installing plugin";case"installTheme":return"Installing theme";case"mkdir":return"Creating directory";case"mv":return"Moving files";case"rm":return"Removing file";case"rmdir":return"Removing directory";case"resetData":return"Resetting WordPress data";case"runPHP":return"Running PHP";case"runSQL":return"Executing SQL queries";case"setSiteLanguage":return"Setting site language";case"setSiteOptions":return"Setting site options";case"unzip":return"Extracting ZIP file";case"wp-cli":return"Running WP-CLI";case"writeFiles":return"Writing files"}return nt(e)}function so(e,t){switch(e.type){case"applyContentBaseline":return[{step:"resetData",contentTypes:io(e.contentBaseline)}];case"applyUsersBaseline":return oo();case"defineWpConfigConsts":return[{step:"defineWpConfigConsts",consts:e.consts}];case"setSiteOptions":return[{step:"setSiteOptions",options:e.options}];case"installTheme":return[ms(e.theme,e.active)];case"installPlugin":return[ds(e.plugin)];case"installMuPlugin":return fo(e.muPlugin,e.sourcePath);case"installFonts":return go(e.fonts,t);case"importMedia":return cs([e.media],e.sourcePath,t);case"defineRoles":return[yo(e.roles)];case"defineUsers":return[ho(e.users)];case"definePostTypes":return mo(e.postTypes);case"importContent":return fs(e.content,e.sourcePath,t);case"setSiteLanguage":return[{step:"setSiteLanguage",language:e.language}];case"runStep":return ao(e.step,e.sourcePath,t);default:return}}function io(e){const t=us(e);return ot.filter(o=>!t.includes(o))}function us(e){return e==="keep-all"?ot:e==="empty"?[]:ut(e)}function oo(){return[{step:"runPHP",code:`<?php
|
|
1038
|
+
require '/wordpress/wp-load.php';
|
|
1039
|
+
require_once ABSPATH . 'wp-admin/includes/user.php';
|
|
1040
|
+
|
|
1041
|
+
$user_ids = get_users(['fields' => 'ID']);
|
|
1042
|
+
foreach ($user_ids as $user_id) {
|
|
1043
|
+
wp_delete_user((int) $user_id);
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
$reset_sequence_if_empty = static function($table_name) use ($wpdb) {
|
|
1047
|
+
$count = $wpdb->get_var("SELECT COUNT(*) FROM {$table_name}");
|
|
1048
|
+
if ((int) $count !== 0) {
|
|
1049
|
+
return;
|
|
1050
|
+
}
|
|
1051
|
+
if (isset($GLOBALS['@pdo'])) {
|
|
1052
|
+
$statement = $GLOBALS['@pdo']->prepare(
|
|
1053
|
+
'DELETE FROM SQLITE_SEQUENCE WHERE NAME = :table_name'
|
|
1054
|
+
);
|
|
1055
|
+
$statement->execute([':table_name' => $table_name]);
|
|
1056
|
+
return;
|
|
1057
|
+
}
|
|
1058
|
+
$wpdb->query("ALTER TABLE {$table_name} AUTO_INCREMENT = 1");
|
|
1059
|
+
};
|
|
1060
|
+
|
|
1061
|
+
$reset_sequence_if_empty($wpdb->users);
|
|
1062
|
+
$reset_sequence_if_empty($wpdb->usermeta);
|
|
1063
|
+
`}]}function fs(e,t,o){switch(e.type){case"mysql-dump":return ut(e.source).map((n,l)=>({step:"runSql",sql:Ne(n,`${t}.source[${l}]`)}));case"wxr":return no(e,t);case"posts":return co(e,t,o);default:return}}function no(e,t){const o=e.authorsMode??(e.importUsers?"create":"default-author"),n=e.importUsers??o==="create";return ut(e.source).map((l,s)=>{const r={step:"importWxr",file:Ne(l,`${t}.source[${s}]`),fetchAttachments:e.staticAssets!=="hotlink",rewriteUrls:e.urlsMode!=="preserve",importComments:e.importComments??!1,authorsMode:o,importUsers:n};return e.urlsMap!==void 0&&(r.urlMapping=e.urlsMap),e.authorsMap!==void 0&&(r.authorsMap=e.authorsMap),e.defaultAuthorUsername!==void 0&&(r.defaultAuthorUsername=e.defaultAuthorUsername),r})}function ao(e,t,o){switch(e.step){case"activatePlugin":return[{step:"activatePlugin",pluginPath:e.pluginPath,pluginName:e.humanReadableName}];case"activateTheme":return[{step:"activateTheme",themeFolderName:e.themeDirectoryName}];case"cp":return[{step:"cp",fromPath:Oe(e.fromPath),toPath:Oe(e.toPath)}];case"defineConstants":return[{step:"defineWpConfigConsts",consts:e.constants}];case"enableMultisite":return[{step:"enableMultisite"}];case"importContent":return po(e,o);case"importMedia":return uo(e,t,o);case"importThemeStarterContent":return[{step:"importThemeStarterContent",themeSlug:e.themeSlug}];case"installPlugin":return[ds(e)];case"installTheme":return[ms(e,e.active??!0)];case"mkdir":return[{step:"mkdir",path:Oe(e.path)}];case"mv":return[{step:"mv",fromPath:Oe(e.fromPath),toPath:Oe(e.toPath)}];case"rm":return[{step:"rm",path:Oe(e.path)}];case"rmdir":return[{step:"rmdir",path:Oe(e.path)}];case"resetData":return[{step:"resetData",contentTypes:e.contentTypes}];case"runPHP":return lo(e,t,o);case"runSQL":return[{step:"runSql",sql:Ne(e.source,"runSQL.source")}];case"setSiteLanguage":return[{step:"setSiteLanguage",language:e.language}];case"setSiteOptions":return[{step:"setSiteOptions",options:e.options}];case"wp-cli":return[{step:"wp-cli",command:e.command,wpCliPath:e.wpCliPath}];case"unzip":return[{step:"unzip",zipFile:Ne(e.zipFile,"unzip.zipFile"),extractToPath:Oe(e.extractToPath)}];case"writeFiles":return _o(e);default:return}}function po(e,t){const o=[];for(const[n,l]of e.content.entries()){const s=fs(l,`importContent.content[${n}]`,t);if(!s)return;o.push(...s)}return o}function lo(e,t,o){if(Le(e.code))return e.env?[{step:"runPHPWithOptions",options:{code:e.code.content,env:e.env}}]:[{step:"runPHP",code:e.code}];const n=qr(o,"blueprint-run-php","php");return[{step:"writeFile",path:n,data:Ne(e.code,`${t}/code`)},{step:"runPHPWithOptions",options:{code:`<?php require ${JSON.stringify(n)};`,env:e.env||{}}}]}function uo(e,t,o){return cs(e.media,`${t}/media`,o)}function fo(e,t){const o=jo(e,t),n=hs(e,t);return pt(n)?[{step:"writeFiles",writeToPath:o,filesTree:n}]:[{step:"writeFile",path:o,data:n}]}function co(e,t,o){const n=[],l=[],s=[],r=Array.isArray(e.source),u=r?e.source:[e.source];for(const[f,h]of u.entries()){const y=r?`${t}.source[${f}]`:`${t}.source`;if(gs(h)){const m=qr(o,"blueprint-post-content");n.push({step:"writeFile",path:m,data:Ne(h,y)}),s.push({path:m,post_title:"Untitled Post",post_type:"post"});continue}l.push({...h})}return l.length===0&&s.length===0||n.push({step:"runPHPWithOptions",options:{code:Oo,env:{BLUEPRINT_POSTS:JSON.stringify(l),BLUEPRINT_POST_FILES:JSON.stringify(s),BLUEPRINT_URLS_MODE:e.urlsMode||"rewrite",BLUEPRINT_URLS_MAP:JSON.stringify(e.urlsMap||{})}}}),n}function cs(e,t,o){const n=[],l=[];for(const[s,r]of e.entries()){const u=r&&typeof r=="object"&&"source"in r?r:{source:r},f=`${t}[${s}]`,h=lt(u.source,f),y=qr(o,"blueprint-media");n.push({step:"writeFile",path:y,data:Ne(u.source,f)});const m={path:y,filename:h};for(const k of["title","description","alt","caption"])u[k]!==void 0&&(m[k]=u[k]);l.push(m)}return l.length===0||n.push({step:"runPHPWithOptions",options:{code:ko,env:{BLUEPRINT_MEDIA:JSON.stringify(l)}}}),n}function mo(e){return Object.entries(e).flatMap(([t,o],n)=>{const l=`blueprint-post-type-${n}`,s=`/wordpress/wp-content/mu-plugins/${l}.php`;if(typeof o=="string"){const u=`/wordpress/wp-content/mu-plugins/${l}.json`;return[{step:"writeFile",path:u,data:Ne(o,`postTypes.${JSON.stringify(t)}`)},{step:"writeFile",path:s,data:{resource:"literal",name:`${l}.php`,contents:vo(t,u)}}]}const r={...o};return r.label===void 0&&(r.label=Tr(t)),[{step:"writeFile",path:s,data:{resource:"literal",name:`${l}.php`,contents:bo(t,r)}}]})}function yo(e){return{step:"runPHPWithOptions",options:{code:Po,env:{BLUEPRINT_ROLES:JSON.stringify(e)}}}}function ho(e){return{step:"runPHPWithOptions",options:{code:$o,env:{BLUEPRINT_USERS:JSON.stringify(e)}}}}function go(e,t){const o=[],n=[],l={};let s=0;for(const[r,u]of Object.entries(e)){const f=`fonts.${JSON.stringify(r)}`;if(gs(u)){const y=Vr(u,`${f}.source`,r,o,l,s++,t),m=Tr(r);n.push({slug:r,name:m,font_families:[{font_family_settings:{name:m,slug:r,fontFamily:m,fontFace:[{fontFamily:m,src:y}]}}]});continue}const h=$t(u);h.slug=r,h.name=h.name||Tr(r),h.font_families=(h.font_families||[]).map((y,m)=>{const k=$t(y),O={...k.font_family_settings||{}};return Array.isArray(O.fontFace)&&(O.fontFace=O.fontFace.map((T,_)=>{const U={...T};return U.src=wo(U.src,`${f}.font_families[${m}].font_family_settings.fontFace[${_}].src`,O.slug||r,o,l,()=>s++,t),U})),k.font_family_settings=O,k}),n.push(h)}return n.length===0||o.push({step:"runPHPWithOptions",options:{code:Eo,env:{BLUEPRINT_FONT_COLLECTIONS:JSON.stringify(n),BLUEPRINT_FONT_FILES:JSON.stringify(l)}}}),o}function _o(e){const t=[];for(const[o,n]of Object.entries(e.files)){const l=Oe(o),s=hs(n,`writeFiles.files[${JSON.stringify(o)}]`);pt(s)?t.push({step:"writeFiles",writeToPath:l,filesTree:s}):t.push({step:"writeFile",path:l,data:s})}return t}function wo(e,t,o,n,l,s,r){return Array.isArray(e)?e.map((u,f)=>Vr(u,`${t}[${f}]`,o,n,l,s(),r)):Vr(e,t,o,n,l,s(),r)}function Vr(e,t,o,n,l,s,r){const u=lt(e,t);if(!/\.(woff2|woff|ttf|otf)$/i.test(u))throw new be(t,"Blueprint v2 font sources must reference .woff2, .woff, .ttf, or .otf files.");const f=`font-${s}`,h=qr(r,"blueprint-font");return n.push({step:"writeFile",path:h,data:Ne(e,t)}),l[`blueprint-font-file:${f}`]={path:h,filename:u},`blueprint-font-file:${f}`}function bo(e,t){return`<?php
|
|
1064
|
+
add_action('init', function () {
|
|
1065
|
+
register_post_type(${JSON.stringify(e)}, json_decode(${JSON.stringify(JSON.stringify(t))}, true));
|
|
1066
|
+
}, 0);
|
|
1067
|
+
`}function vo(e,t){return`<?php
|
|
1068
|
+
add_action('init', function () {
|
|
1069
|
+
$args = json_decode(file_get_contents(__DIR__ . '/${N.basename(t)}'), true);
|
|
1070
|
+
if (!is_array($args)) {
|
|
1071
|
+
$args = array();
|
|
1072
|
+
}
|
|
1073
|
+
if (!isset($args['label'])) {
|
|
1074
|
+
$args['label'] = ${JSON.stringify(Tr(e))};
|
|
1075
|
+
}
|
|
1076
|
+
register_post_type(${JSON.stringify(e)}, $args);
|
|
1077
|
+
}, 0);
|
|
1078
|
+
`}const Po=`<?php
|
|
1079
|
+
require '/wordpress/wp-load.php';
|
|
1080
|
+
|
|
1081
|
+
$roles = json_decode(getenv('BLUEPRINT_ROLES') ?: '[]', true);
|
|
1082
|
+
if (!is_array($roles)) {
|
|
1083
|
+
throw new Exception('Invalid Blueprint roles payload.');
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
foreach ($roles as $role) {
|
|
1087
|
+
if (empty($role['name']) || !is_string($role['name'])) {
|
|
1088
|
+
continue;
|
|
1089
|
+
}
|
|
1090
|
+
$role_name = $role['name'];
|
|
1091
|
+
$display_name = $role['display_name'] ?? ucfirst($role_name);
|
|
1092
|
+
$capabilities = $role['capabilities'] ?? array();
|
|
1093
|
+
if (!get_role($role_name)) {
|
|
1094
|
+
add_role($role_name, $display_name, array('read' => true));
|
|
1095
|
+
}
|
|
1096
|
+
$role_object = get_role($role_name);
|
|
1097
|
+
if (!$role_object) {
|
|
1098
|
+
throw new Exception('Could not create Blueprint role: ' . $role_name);
|
|
1099
|
+
}
|
|
1100
|
+
foreach ($capabilities as $capability => $grant) {
|
|
1101
|
+
if (filter_var($grant, FILTER_VALIDATE_BOOLEAN)) {
|
|
1102
|
+
$role_object->add_cap($capability);
|
|
1103
|
+
} else {
|
|
1104
|
+
$role_object->remove_cap($capability);
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
`,$o=`<?php
|
|
1109
|
+
require '/wordpress/wp-load.php';
|
|
1110
|
+
|
|
1111
|
+
$users = json_decode(getenv('BLUEPRINT_USERS') ?: '[]', true);
|
|
1112
|
+
if (!is_array($users)) {
|
|
1113
|
+
throw new Exception('Invalid Blueprint users payload.');
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
foreach ($users as $user) {
|
|
1117
|
+
if (empty($user['username']) || !is_string($user['username'])) {
|
|
1118
|
+
continue;
|
|
1119
|
+
}
|
|
1120
|
+
$username = $user['username'];
|
|
1121
|
+
$existing = get_user_by('login', $username);
|
|
1122
|
+
if ($existing) {
|
|
1123
|
+
$user_id = $existing->ID;
|
|
1124
|
+
} else {
|
|
1125
|
+
$email = $user['email'] ?? $username . '@example.com';
|
|
1126
|
+
$password = $user['password'] ?? wp_generate_password(24, true, true);
|
|
1127
|
+
$user_id = wp_create_user($username, $password, $email);
|
|
1128
|
+
if (is_wp_error($user_id)) {
|
|
1129
|
+
throw new Exception($user_id->get_error_message());
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
$user_object = new WP_User($user_id);
|
|
1133
|
+
if (!empty($user['role']) && is_string($user['role'])) {
|
|
1134
|
+
$user_object->set_role($user['role']);
|
|
1135
|
+
}
|
|
1136
|
+
foreach (($user['meta'] ?? array()) as $meta_key => $meta_value) {
|
|
1137
|
+
update_user_meta($user_id, $meta_key, $meta_value);
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
`,Oo=`<?php
|
|
1141
|
+
require '/wordpress/wp-load.php';
|
|
1142
|
+
|
|
1143
|
+
$posts = json_decode(getenv('BLUEPRINT_POSTS') ?: '[]', true);
|
|
1144
|
+
$post_files = json_decode(getenv('BLUEPRINT_POST_FILES') ?: '[]', true);
|
|
1145
|
+
$urls_mode = getenv('BLUEPRINT_URLS_MODE') ?: 'rewrite';
|
|
1146
|
+
$urls_map = json_decode(getenv('BLUEPRINT_URLS_MAP') ?: '{}', true);
|
|
1147
|
+
|
|
1148
|
+
if (!is_array($posts) || !is_array($post_files) || !is_array($urls_map)) {
|
|
1149
|
+
throw new Exception('Invalid Blueprint posts payload.');
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
$blueprint_temp_files = array();
|
|
1153
|
+
foreach ($post_files as $file) {
|
|
1154
|
+
if (is_array($file) && !empty($file['path']) && is_string($file['path'])) {
|
|
1155
|
+
$blueprint_temp_files[] = $file['path'];
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
try {
|
|
1160
|
+
foreach ($post_files as $file) {
|
|
1161
|
+
$source_path = $file['path'] ?? '';
|
|
1162
|
+
if (!$source_path || !is_readable($source_path)) {
|
|
1163
|
+
throw new Exception('Post content source is not readable: ' . $source_path);
|
|
1164
|
+
}
|
|
1165
|
+
$posts[] = array(
|
|
1166
|
+
'post_title' => $file['post_title'] ?? 'Untitled Post',
|
|
1167
|
+
'post_content' => file_get_contents($source_path),
|
|
1168
|
+
'post_status' => 'publish',
|
|
1169
|
+
'post_type' => $file['post_type'] ?? 'post',
|
|
1170
|
+
);
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
$default_author = blueprint_default_post_author();
|
|
1174
|
+
wp_set_current_user($default_author);
|
|
1175
|
+
|
|
1176
|
+
foreach ($posts as $post) {
|
|
1177
|
+
if (!is_array($post)) {
|
|
1178
|
+
throw new Exception('Each Blueprint post must be an object.');
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
$post = blueprint_prepare_post($post, $default_author, $urls_mode, $urls_map);
|
|
1182
|
+
$post_tags = $post['post_tags'] ?? null;
|
|
1183
|
+
$page_template = $post['page_template'] ?? null;
|
|
1184
|
+
$tax_input = $post['tax_input'] ?? null;
|
|
1185
|
+
unset($post['post_tags'], $post['page_template'], $post['tax_input']);
|
|
1186
|
+
|
|
1187
|
+
$post_id = wp_insert_post(wp_slash($post), true);
|
|
1188
|
+
if (is_wp_error($post_id)) {
|
|
1189
|
+
throw new Exception($post_id->get_error_message());
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
if (is_array($post_tags)) {
|
|
1193
|
+
blueprint_set_terms($post_id, 'post_tag', $post_tags);
|
|
1194
|
+
}
|
|
1195
|
+
if (is_array($tax_input)) {
|
|
1196
|
+
foreach ($tax_input as $taxonomy => $terms) {
|
|
1197
|
+
if (taxonomy_exists($taxonomy) && is_array($terms)) {
|
|
1198
|
+
blueprint_set_terms($post_id, $taxonomy, $terms);
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
if ($page_template && ($post['post_type'] ?? 'post') === 'page') {
|
|
1203
|
+
update_post_meta($post_id, '_wp_page_template', $page_template);
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
} finally {
|
|
1207
|
+
blueprint_cleanup_post_temp_files($blueprint_temp_files);
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
/**
|
|
1211
|
+
* Builds the wp_insert_post() payload for one Blueprint post.
|
|
1212
|
+
*/
|
|
1213
|
+
function blueprint_prepare_post(array $post, int $default_author, string $urls_mode, array $urls_map): array {
|
|
1214
|
+
if (!isset($post['post_author'])) {
|
|
1215
|
+
$post['post_author'] = $default_author;
|
|
1216
|
+
} else {
|
|
1217
|
+
$post['post_author'] = (int) $post['post_author'];
|
|
1218
|
+
if ($post['post_author'] <= 0 || !get_userdata($post['post_author'])) {
|
|
1219
|
+
$post['post_author'] = $default_author;
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
if (isset($post['post_parent_name']) && !isset($post['post_parent'])) {
|
|
1224
|
+
$post['post_parent'] = blueprint_find_parent_post_id(
|
|
1225
|
+
$post['post_parent_name'],
|
|
1226
|
+
$post['post_type'] ?? 'page'
|
|
1227
|
+
);
|
|
1228
|
+
}
|
|
1229
|
+
unset($post['post_parent_name']);
|
|
1230
|
+
|
|
1231
|
+
if (isset($post['post_category']) && is_array($post['post_category'])) {
|
|
1232
|
+
$post['post_category'] = blueprint_ensure_terms('category', $post['post_category']);
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
foreach (array('post_content', 'post_excerpt', 'guid') as $field) {
|
|
1236
|
+
if (isset($post[$field]) && is_string($post[$field])) {
|
|
1237
|
+
$post[$field] = blueprint_rewrite_urls($post[$field], $urls_mode, $urls_map);
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
if (isset($post['meta_input']) && is_array($post['meta_input'])) {
|
|
1241
|
+
$post['meta_input'] = blueprint_rewrite_urls($post['meta_input'], $urls_mode, $urls_map);
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
return $post;
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
/**
|
|
1248
|
+
* Returns the author used when imported post data omits one.
|
|
1249
|
+
*/
|
|
1250
|
+
function blueprint_default_post_author(): int {
|
|
1251
|
+
$admins = get_users(array(
|
|
1252
|
+
'role' => 'administrator',
|
|
1253
|
+
'number' => 1,
|
|
1254
|
+
'orderby' => 'ID',
|
|
1255
|
+
'order' => 'ASC',
|
|
1256
|
+
'fields' => 'ID',
|
|
1257
|
+
));
|
|
1258
|
+
if (!empty($admins)) {
|
|
1259
|
+
return (int) $admins[0];
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
$users = get_users(array(
|
|
1263
|
+
'number' => 1,
|
|
1264
|
+
'orderby' => 'ID',
|
|
1265
|
+
'order' => 'ASC',
|
|
1266
|
+
'fields' => 'ID',
|
|
1267
|
+
));
|
|
1268
|
+
if (!empty($users)) {
|
|
1269
|
+
return (int) $users[0];
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
$existing = get_user_by('login', 'blueprint-author');
|
|
1273
|
+
if ($existing) {
|
|
1274
|
+
return (int) $existing->ID;
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
$user_id = wp_create_user(
|
|
1278
|
+
'blueprint-author',
|
|
1279
|
+
wp_generate_password(24, true, true),
|
|
1280
|
+
'blueprint-author@example.com'
|
|
1281
|
+
);
|
|
1282
|
+
if (is_wp_error($user_id)) {
|
|
1283
|
+
throw new Exception($user_id->get_error_message());
|
|
1284
|
+
}
|
|
1285
|
+
return (int) $user_id;
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
/**
|
|
1289
|
+
* Resolves a parent post by title for hierarchical post declarations.
|
|
1290
|
+
*/
|
|
1291
|
+
function blueprint_find_parent_post_id(string $name, string $post_type): int {
|
|
1292
|
+
$parent = get_page_by_path(sanitize_title($name), OBJECT, $post_type);
|
|
1293
|
+
if (!$parent) {
|
|
1294
|
+
$parent = get_page_by_title($name, OBJECT, $post_type);
|
|
1295
|
+
}
|
|
1296
|
+
if (!$parent) {
|
|
1297
|
+
throw new Exception('Could not resolve post_parent_name: ' . $name);
|
|
1298
|
+
}
|
|
1299
|
+
return (int) $parent->ID;
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
/**
|
|
1303
|
+
* Ensures and assigns taxonomy terms for one imported post.
|
|
1304
|
+
*/
|
|
1305
|
+
function blueprint_set_terms(int $post_id, string $taxonomy, array $terms): void {
|
|
1306
|
+
$term_ids = blueprint_ensure_terms($taxonomy, $terms);
|
|
1307
|
+
if (!empty($term_ids)) {
|
|
1308
|
+
$result = wp_set_object_terms($post_id, $term_ids, $taxonomy, false);
|
|
1309
|
+
if (is_wp_error($result)) {
|
|
1310
|
+
throw new Exception($result->get_error_message());
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
/**
|
|
1316
|
+
* Creates missing terms and returns IDs ready for wp_set_post_terms().
|
|
1317
|
+
*/
|
|
1318
|
+
function blueprint_ensure_terms(string $taxonomy, array $terms): array {
|
|
1319
|
+
$term_ids = array();
|
|
1320
|
+
foreach ($terms as $term_name) {
|
|
1321
|
+
if (!is_string($term_name) || $term_name === '') {
|
|
1322
|
+
continue;
|
|
1323
|
+
}
|
|
1324
|
+
$term = get_term_by('slug', sanitize_title($term_name), $taxonomy);
|
|
1325
|
+
if (!$term) {
|
|
1326
|
+
$term = get_term_by('name', $term_name, $taxonomy);
|
|
1327
|
+
}
|
|
1328
|
+
if (!$term) {
|
|
1329
|
+
$created = wp_insert_term($term_name, $taxonomy, array(
|
|
1330
|
+
'slug' => sanitize_title($term_name),
|
|
1331
|
+
));
|
|
1332
|
+
if (is_wp_error($created)) {
|
|
1333
|
+
throw new Exception($created->get_error_message());
|
|
1334
|
+
}
|
|
1335
|
+
$term_ids[] = (int) $created['term_id'];
|
|
1336
|
+
continue;
|
|
1337
|
+
}
|
|
1338
|
+
$term_ids[] = (int) $term->term_id;
|
|
1339
|
+
}
|
|
1340
|
+
return $term_ids;
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
/**
|
|
1344
|
+
* Applies the requested URL-preservation or URL-rewrite policy recursively.
|
|
1345
|
+
*/
|
|
1346
|
+
function blueprint_rewrite_urls($value, string $urls_mode, array $urls_map) {
|
|
1347
|
+
if ($urls_mode === 'preserve' || empty($urls_map)) {
|
|
1348
|
+
return $value;
|
|
1349
|
+
}
|
|
1350
|
+
if (is_string($value)) {
|
|
1351
|
+
return strtr($value, $urls_map);
|
|
1352
|
+
}
|
|
1353
|
+
if (is_array($value)) {
|
|
1354
|
+
foreach ($value as $key => $item) {
|
|
1355
|
+
$value[$key] = blueprint_rewrite_urls($item, $urls_mode, $urls_map);
|
|
1356
|
+
}
|
|
1357
|
+
return $value;
|
|
1358
|
+
}
|
|
1359
|
+
return $value;
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
/**
|
|
1363
|
+
* Removes temporary files used while importing file-backed posts.
|
|
1364
|
+
*/
|
|
1365
|
+
function blueprint_cleanup_post_temp_files(array $paths): void {
|
|
1366
|
+
foreach (array_unique($paths) as $path) {
|
|
1367
|
+
if (is_string($path) && file_exists($path)) {
|
|
1368
|
+
@unlink($path);
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
`,ko=`<?php
|
|
1373
|
+
require '/wordpress/wp-load.php';
|
|
1374
|
+
require_once ABSPATH . 'wp-admin/includes/image.php';
|
|
1375
|
+
require_once ABSPATH . 'wp-admin/includes/file.php';
|
|
1376
|
+
|
|
1377
|
+
$media_items = json_decode(getenv('BLUEPRINT_MEDIA') ?: '[]', true);
|
|
1378
|
+
if (!is_array($media_items)) {
|
|
1379
|
+
throw new Exception('Invalid Blueprint media payload.');
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
$blueprint_temp_files = array();
|
|
1383
|
+
foreach ($media_items as $item) {
|
|
1384
|
+
if (is_array($item) && !empty($item['path']) && is_string($item['path'])) {
|
|
1385
|
+
$blueprint_temp_files[] = $item['path'];
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
try {
|
|
1390
|
+
foreach ($media_items as $item) {
|
|
1391
|
+
$source_path = $item['path'] ?? '';
|
|
1392
|
+
if (!$source_path || !is_readable($source_path)) {
|
|
1393
|
+
throw new Exception('Media source is not readable: ' . $source_path);
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
$uploads = wp_upload_dir();
|
|
1397
|
+
if (!empty($uploads['error'])) {
|
|
1398
|
+
throw new Exception($uploads['error']);
|
|
1399
|
+
}
|
|
1400
|
+
if (!wp_mkdir_p($uploads['path'])) {
|
|
1401
|
+
throw new Exception('Could not create uploads directory: ' . $uploads['path']);
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
$filename = basename($item['filename'] ?? $source_path);
|
|
1405
|
+
if (!is_string($filename) || basename($filename) !== $filename || sanitize_file_name($filename) !== $filename) {
|
|
1406
|
+
throw new Exception('Invalid Blueprint media filename: must already be a valid filename.');
|
|
1407
|
+
}
|
|
1408
|
+
$filename = wp_unique_filename($uploads['path'], $filename);
|
|
1409
|
+
$target_path = trailingslashit($uploads['path']) . $filename;
|
|
1410
|
+
if (!copy($source_path, $target_path)) {
|
|
1411
|
+
throw new Exception('Could not copy media file to uploads directory.');
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
$filetype = wp_check_filetype($filename, null);
|
|
1415
|
+
$attachment = array(
|
|
1416
|
+
'guid' => trailingslashit($uploads['url']) . $filename,
|
|
1417
|
+
'post_mime_type' => $filetype['type'] ?: 'application/octet-stream',
|
|
1418
|
+
'post_title' => $item['title'] ?? preg_replace('/\\.[^.]+$/', '', $filename),
|
|
1419
|
+
'post_content' => $item['description'] ?? '',
|
|
1420
|
+
'post_excerpt' => $item['caption'] ?? '',
|
|
1421
|
+
'post_status' => 'inherit',
|
|
891
1422
|
);
|
|
1423
|
+
|
|
1424
|
+
$attachment_id = wp_insert_attachment($attachment, $target_path, 0, true);
|
|
1425
|
+
if (is_wp_error($attachment_id)) {
|
|
1426
|
+
throw new Exception($attachment_id->get_error_message());
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
$metadata = wp_generate_attachment_metadata($attachment_id, $target_path);
|
|
1430
|
+
if (!is_wp_error($metadata) && !empty($metadata)) {
|
|
1431
|
+
wp_update_attachment_metadata($attachment_id, $metadata);
|
|
1432
|
+
}
|
|
1433
|
+
if (array_key_exists('alt', $item)) {
|
|
1434
|
+
update_post_meta($attachment_id, '_wp_attachment_image_alt', $item['alt']);
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
} finally {
|
|
1438
|
+
blueprint_cleanup_media_temp_files($blueprint_temp_files);
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
/**
|
|
1442
|
+
* Removes temporary files used while importing media attachments.
|
|
1443
|
+
*/
|
|
1444
|
+
function blueprint_cleanup_media_temp_files(array $paths): void {
|
|
1445
|
+
foreach (array_unique($paths) as $path) {
|
|
1446
|
+
if (is_string($path) && file_exists($path)) {
|
|
1447
|
+
@unlink($path);
|
|
1448
|
+
}
|
|
892
1449
|
}
|
|
1450
|
+
}
|
|
1451
|
+
`,Eo=`<?php
|
|
1452
|
+
require '/wordpress/wp-load.php';
|
|
1453
|
+
|
|
1454
|
+
$collections = json_decode(getenv('BLUEPRINT_FONT_COLLECTIONS') ?: '[]', true);
|
|
1455
|
+
$files = json_decode(getenv('BLUEPRINT_FONT_FILES') ?: '{}', true);
|
|
893
1456
|
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
1457
|
+
if (!is_array($collections) || !is_array($files)) {
|
|
1458
|
+
throw new Exception('Invalid Blueprint fonts payload.');
|
|
1459
|
+
}
|
|
1460
|
+
if (!function_exists('wp_get_font_dir') || !post_type_exists('wp_font_family') || !post_type_exists('wp_font_face')) {
|
|
1461
|
+
throw new Exception('Blueprint fonts require WordPress 6.5 or newer.');
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
/**
|
|
1465
|
+
* Requires a Blueprint slug field to already be a WordPress slug.
|
|
1466
|
+
*/
|
|
1467
|
+
function blueprint_require_valid_slug(string $slug, string $field): string {
|
|
1468
|
+
if ($slug === '' || sanitize_title($slug) !== $slug) {
|
|
1469
|
+
throw new Exception('Invalid Blueprint ' . $field . ': must already be a valid slug.');
|
|
897
1470
|
}
|
|
898
|
-
return $
|
|
1471
|
+
return $slug;
|
|
899
1472
|
}
|
|
900
1473
|
|
|
901
|
-
|
|
902
|
-
|
|
1474
|
+
$blueprint_temp_files = blueprint_font_temp_files($files);
|
|
1475
|
+
try {
|
|
1476
|
+
$font_dir = wp_get_font_dir();
|
|
1477
|
+
if (!empty($font_dir['error'])) {
|
|
1478
|
+
throw new Exception($font_dir['error']);
|
|
1479
|
+
}
|
|
1480
|
+
if (!wp_mkdir_p($font_dir['basedir'])) {
|
|
1481
|
+
throw new Exception('Could not create font directory: ' . $font_dir['basedir']);
|
|
1482
|
+
}
|
|
903
1483
|
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
'caption' => $caption
|
|
909
|
-
]);
|
|
1484
|
+
$registered_collections = array();
|
|
1485
|
+
foreach ($collections as $collection) {
|
|
1486
|
+
if (!is_array($collection) || empty($collection['slug']) || !is_string($collection['slug'])) {
|
|
1487
|
+
throw new Exception('Each Blueprint font collection must have a slug.');
|
|
910
1488
|
}
|
|
911
1489
|
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
1490
|
+
$slug = blueprint_require_valid_slug($collection['slug'], 'font collection slug');
|
|
1491
|
+
$families = isset($collection['font_families']) && is_array($collection['font_families'])
|
|
1492
|
+
? $collection['font_families']
|
|
1493
|
+
: array();
|
|
1494
|
+
|
|
1495
|
+
foreach ($families as $family_index => $family) {
|
|
1496
|
+
if (!is_array($family) || !isset($family['font_family_settings']) || !is_array($family['font_family_settings'])) {
|
|
1497
|
+
throw new Exception('Each Blueprint font family must include font_family_settings.');
|
|
1498
|
+
}
|
|
917
1499
|
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
1500
|
+
$settings = $family['font_family_settings'];
|
|
1501
|
+
$family_id = blueprint_upsert_font_family($settings);
|
|
1502
|
+
if (!empty($settings['fontFace']) && is_array($settings['fontFace'])) {
|
|
1503
|
+
foreach ($settings['fontFace'] as $face_index => $face) {
|
|
1504
|
+
if (!is_array($face)) {
|
|
1505
|
+
throw new Exception('Each Blueprint fontFace entry must be an object.');
|
|
1506
|
+
}
|
|
1507
|
+
$prepared_face = blueprint_prepare_font_face($face, $files, $font_dir);
|
|
1508
|
+
blueprint_upsert_font_face($family_id, $prepared_face['settings'], $prepared_face['files']);
|
|
1509
|
+
$settings['fontFace'][$face_index] = $prepared_face['settings'];
|
|
1510
|
+
}
|
|
926
1511
|
}
|
|
1512
|
+
$families[$family_index]['font_family_settings'] = $settings;
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
$collection_args = array(
|
|
1516
|
+
'name' => $collection['name'] ?? blueprint_default_display_name_from_slug($slug),
|
|
1517
|
+
'font_families' => $families,
|
|
1518
|
+
);
|
|
1519
|
+
$categories = blueprint_collect_font_categories($families);
|
|
1520
|
+
if (!empty($categories)) {
|
|
1521
|
+
$collection_args['categories'] = $categories;
|
|
1522
|
+
}
|
|
1523
|
+
$registered_collections[$slug] = $collection_args;
|
|
1524
|
+
blueprint_register_font_collection($slug, $collection_args);
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
blueprint_write_font_collections_mu_plugin($registered_collections);
|
|
1528
|
+
} finally {
|
|
1529
|
+
blueprint_cleanup_font_temp_files($blueprint_temp_files);
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
/**
|
|
1533
|
+
* Creates or updates a WordPress font-family post for a font collection.
|
|
1534
|
+
*/
|
|
1535
|
+
function blueprint_upsert_font_family(array $settings): int {
|
|
1536
|
+
foreach (array('name', 'slug', 'fontFamily') as $field) {
|
|
1537
|
+
if (empty($settings[$field]) || !is_string($settings[$field])) {
|
|
1538
|
+
throw new Exception('Font family setting "' . $field . '" is required.');
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
$slug = blueprint_require_valid_slug($settings['slug'], 'font family slug');
|
|
1543
|
+
$post_content = $settings;
|
|
1544
|
+
unset($post_content['name'], $post_content['slug']);
|
|
1545
|
+
|
|
1546
|
+
$existing = get_posts(array(
|
|
1547
|
+
'post_type' => 'wp_font_family',
|
|
1548
|
+
'name' => $slug,
|
|
1549
|
+
'post_status' => 'any',
|
|
1550
|
+
'numberposts' => 1,
|
|
1551
|
+
));
|
|
1552
|
+
$post = array(
|
|
1553
|
+
'post_type' => 'wp_font_family',
|
|
1554
|
+
'post_status' => 'publish',
|
|
1555
|
+
'post_title' => $settings['name'],
|
|
1556
|
+
'post_name' => $slug,
|
|
1557
|
+
'post_content' => wp_json_encode($post_content),
|
|
1558
|
+
);
|
|
1559
|
+
if (!empty($existing)) {
|
|
1560
|
+
$post['ID'] = $existing[0]->ID;
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
$post_id = wp_insert_post(wp_slash($post), true);
|
|
1564
|
+
if (is_wp_error($post_id)) {
|
|
1565
|
+
throw new Exception($post_id->get_error_message());
|
|
1566
|
+
}
|
|
1567
|
+
return (int) $post_id;
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
/**
|
|
1571
|
+
* Converts Blueprint font-face settings into WordPress font-library fields.
|
|
1572
|
+
*/
|
|
1573
|
+
function blueprint_prepare_font_face(array $settings, array $files, array $font_dir): array {
|
|
1574
|
+
if (empty($settings['fontFamily']) || empty($settings['src'])) {
|
|
1575
|
+
throw new Exception('Font face settings require fontFamily and src.');
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
$srcs = is_array($settings['src']) ? $settings['src'] : array($settings['src']);
|
|
1579
|
+
$processed_srcs = array();
|
|
1580
|
+
$file_meta = array();
|
|
927
1581
|
|
|
928
|
-
|
|
1582
|
+
foreach ($srcs as $src) {
|
|
1583
|
+
if (is_string($src) && isset($files[$src])) {
|
|
1584
|
+
$copied = blueprint_copy_font_file($files[$src], $font_dir);
|
|
1585
|
+
$processed_srcs[] = $copied['url'];
|
|
1586
|
+
$file_meta[] = $copied['relative'];
|
|
1587
|
+
continue;
|
|
929
1588
|
}
|
|
1589
|
+
$processed_srcs[] = $src;
|
|
1590
|
+
}
|
|
930
1591
|
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
1592
|
+
$settings['src'] = count($processed_srcs) === 1 ? $processed_srcs[0] : $processed_srcs;
|
|
1593
|
+
return array(
|
|
1594
|
+
'settings' => $settings,
|
|
1595
|
+
'files' => $file_meta,
|
|
1596
|
+
);
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
/**
|
|
1600
|
+
* Copies one materialized font binary into the WordPress uploads directory.
|
|
1601
|
+
*/
|
|
1602
|
+
function blueprint_copy_font_file(array $file, array $font_dir): array {
|
|
1603
|
+
$source_path = $file['path'] ?? '';
|
|
1604
|
+
if (!$source_path || !is_readable($source_path)) {
|
|
1605
|
+
throw new Exception('Font source is not readable: ' . $source_path);
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1608
|
+
$filename = $file['filename'] ?? basename($source_path);
|
|
1609
|
+
if (!is_string($filename) || basename($filename) !== $filename || sanitize_file_name($filename) !== $filename) {
|
|
1610
|
+
throw new Exception('Invalid Blueprint font filename: must already be a valid filename.');
|
|
1611
|
+
}
|
|
1612
|
+
if (!preg_match('/\\.(woff2|woff|ttf|otf)$/i', $filename)) {
|
|
1613
|
+
throw new Exception('Unsupported font file extension: ' . $filename);
|
|
1614
|
+
}
|
|
1615
|
+
|
|
1616
|
+
$unique_filename = wp_unique_filename($font_dir['basedir'], $filename);
|
|
1617
|
+
$target_path = trailingslashit($font_dir['basedir']) . $unique_filename;
|
|
1618
|
+
if (!copy($source_path, $target_path)) {
|
|
1619
|
+
throw new Exception('Could not copy font file to fonts directory.');
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
return array(
|
|
1623
|
+
'url' => trailingslashit($font_dir['baseurl']) . $unique_filename,
|
|
1624
|
+
'relative' => $unique_filename,
|
|
1625
|
+
);
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1628
|
+
/**
|
|
1629
|
+
* Creates or updates a font-face post belonging to a font family.
|
|
1630
|
+
*/
|
|
1631
|
+
function blueprint_upsert_font_face(int $family_id, array $settings, array $file_meta): int {
|
|
1632
|
+
$title = blueprint_font_face_slug($settings);
|
|
1633
|
+
$existing = get_posts(array(
|
|
1634
|
+
'post_type' => 'wp_font_face',
|
|
1635
|
+
'post_parent' => $family_id,
|
|
1636
|
+
'title' => $title,
|
|
1637
|
+
'post_status' => 'any',
|
|
1638
|
+
'numberposts' => 1,
|
|
1639
|
+
));
|
|
1640
|
+
|
|
1641
|
+
$post = array(
|
|
1642
|
+
'post_type' => 'wp_font_face',
|
|
1643
|
+
'post_parent' => $family_id,
|
|
1644
|
+
'post_status' => 'publish',
|
|
1645
|
+
'post_title' => $title,
|
|
1646
|
+
'post_name' => sanitize_title($title),
|
|
1647
|
+
'post_content' => wp_json_encode($settings),
|
|
1648
|
+
);
|
|
1649
|
+
if (!empty($existing)) {
|
|
1650
|
+
$post['ID'] = $existing[0]->ID;
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
$post_id = wp_insert_post(wp_slash($post), true);
|
|
1654
|
+
if (is_wp_error($post_id)) {
|
|
1655
|
+
throw new Exception($post_id->get_error_message());
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1658
|
+
delete_post_meta($post_id, '_wp_font_face_file');
|
|
1659
|
+
foreach ($file_meta as $relative_path) {
|
|
1660
|
+
add_post_meta($post_id, '_wp_font_face_file', $relative_path);
|
|
1661
|
+
}
|
|
1662
|
+
return (int) $post_id;
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
/**
|
|
1666
|
+
* Builds the stable slug used to find an existing font-face post.
|
|
1667
|
+
*/
|
|
1668
|
+
function blueprint_font_face_slug(array $settings): string {
|
|
1669
|
+
if (class_exists('WP_Font_Utils') && method_exists('WP_Font_Utils', 'get_font_face_slug')) {
|
|
1670
|
+
return WP_Font_Utils::get_font_face_slug($settings);
|
|
1671
|
+
}
|
|
1672
|
+
$parts = array($settings['fontFamily'] ?? 'font');
|
|
1673
|
+
foreach (array('fontStyle', 'fontWeight', 'fontStretch') as $field) {
|
|
1674
|
+
if (!empty($settings[$field])) {
|
|
1675
|
+
$parts[] = (string) $settings[$field];
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
return implode('-', $parts);
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
/**
|
|
1682
|
+
* Collects category slugs declared by all families in a collection.
|
|
1683
|
+
*/
|
|
1684
|
+
function blueprint_collect_font_categories(array $families): array {
|
|
1685
|
+
$categories = array();
|
|
1686
|
+
foreach ($families as $family) {
|
|
1687
|
+
foreach (($family['categories'] ?? array()) as $category) {
|
|
1688
|
+
if (!is_string($category) || $category === '') {
|
|
1689
|
+
continue;
|
|
1690
|
+
}
|
|
1691
|
+
$slug = blueprint_require_valid_slug($category, 'font category slug');
|
|
1692
|
+
$categories[$slug] = array(
|
|
1693
|
+
'name' => blueprint_default_display_name_from_slug($slug),
|
|
1694
|
+
'slug' => $slug,
|
|
1695
|
+
);
|
|
936
1696
|
}
|
|
1697
|
+
}
|
|
1698
|
+
return array_values($categories);
|
|
1699
|
+
}
|
|
1700
|
+
|
|
1701
|
+
/**
|
|
1702
|
+
* Registers collection metadata after font posts have been imported.
|
|
1703
|
+
*/
|
|
1704
|
+
function blueprint_register_font_collection(string $slug, array $collection_args): void {
|
|
1705
|
+
if (!function_exists('wp_register_font_collection') || !class_exists('WP_Font_Library')) {
|
|
1706
|
+
return;
|
|
1707
|
+
}
|
|
1708
|
+
$library = WP_Font_Library::get_instance();
|
|
1709
|
+
if ($library->get_font_collection($slug) && function_exists('wp_unregister_font_collection')) {
|
|
1710
|
+
wp_unregister_font_collection($slug);
|
|
1711
|
+
}
|
|
1712
|
+
$result = wp_register_font_collection($slug, $collection_args);
|
|
1713
|
+
if (is_wp_error($result)) {
|
|
1714
|
+
throw new Exception($result->get_error_message());
|
|
1715
|
+
}
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
/**
|
|
1719
|
+
* Persists imported font collections so they are registered on every boot.
|
|
1720
|
+
*/
|
|
1721
|
+
function blueprint_write_font_collections_mu_plugin(array $collections): void {
|
|
1722
|
+
if (empty($collections)) {
|
|
1723
|
+
return;
|
|
1724
|
+
}
|
|
1725
|
+
$dir = WP_CONTENT_DIR . '/mu-plugins';
|
|
1726
|
+
if (!wp_mkdir_p($dir)) {
|
|
1727
|
+
throw new Exception('Could not create mu-plugins directory for font collections.');
|
|
1728
|
+
}
|
|
1729
|
+
$code = "<?php\\nadd_action('init', function () {\\n" .
|
|
1730
|
+
"\\tif (!function_exists('wp_register_font_collection') || !class_exists('WP_Font_Library')) {\\n\\t\\treturn;\\n\\t}\\n" .
|
|
1731
|
+
"\\t\\$collections = " . var_export($collections, true) . ";\\n" .
|
|
1732
|
+
"\\t\\$library = WP_Font_Library::get_instance();\\n" .
|
|
1733
|
+
"\\tforeach (\\$collections as \\$slug => \\$args) {\\n" .
|
|
1734
|
+
"\\t\\tif (\\$library->get_font_collection(\\$slug) && function_exists('wp_unregister_font_collection')) {\\n\\t\\t\\twp_unregister_font_collection(\\$slug);\\n\\t\\t}\\n" .
|
|
1735
|
+
"\\t\\twp_register_font_collection(\\$slug, \\$args);\\n" .
|
|
1736
|
+
"\\t}\\n" .
|
|
1737
|
+
"}, 0);\\n";
|
|
1738
|
+
file_put_contents($dir . '/blueprint-font-collections.php', $code);
|
|
1739
|
+
}
|
|
1740
|
+
|
|
1741
|
+
/**
|
|
1742
|
+
* Converts a slug into the fallback label used by generated font settings.
|
|
1743
|
+
*/
|
|
1744
|
+
function blueprint_default_display_name_from_slug(string $slug): string {
|
|
1745
|
+
return ucwords(str_replace(array('-', '_'), ' ', $slug));
|
|
1746
|
+
}
|
|
937
1747
|
|
|
938
|
-
|
|
1748
|
+
/**
|
|
1749
|
+
* Extracts temp paths from the materialized font-file map for cleanup.
|
|
1750
|
+
*/
|
|
1751
|
+
function blueprint_font_temp_files(array $files): array {
|
|
1752
|
+
$paths = array();
|
|
1753
|
+
foreach ($files as $file) {
|
|
1754
|
+
if (is_array($file) && !empty($file['path']) && is_string($file['path'])) {
|
|
1755
|
+
$paths[] = $file['path'];
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
return $paths;
|
|
1759
|
+
}
|
|
939
1760
|
|
|
940
|
-
|
|
941
|
-
|
|
1761
|
+
/**
|
|
1762
|
+
* Removes temporary files used while importing fonts.
|
|
1763
|
+
*/
|
|
1764
|
+
function blueprint_cleanup_font_temp_files(array $paths): void {
|
|
1765
|
+
foreach (array_unique($paths) as $path) {
|
|
1766
|
+
if (is_string($path) && file_exists($path)) {
|
|
1767
|
+
@unlink($path);
|
|
942
1768
|
}
|
|
943
1769
|
}
|
|
944
|
-
return new PlaygroundProgressReporter();
|
|
945
1770
|
}
|
|
946
|
-
|
|
947
|
-
require( "/tmp/blueprints.phar" );
|
|
948
|
-
`));const g=await p.cli(["/internal/shared/bin/php","/tmp/run-blueprints.php","exec",f,...t]);return g.finished.finally(d),g}class St extends Error{constructor(t,n,p){super(t,p),this.name="BlueprintFetchError",this.url=n}}async function Hs(r,t={}){let n;try{const l=await(t.fetch||fetch)(r,{credentials:"omit"});if(!l.ok)throw new Error(`Failed to fetch blueprint from ${r}`);n=await l.arrayBuffer()}catch(p){throw new St(`Blueprint file could not be resolved from ${r}: ${p instanceof Error?p.message:String(p)}`,r,{cause:p})}try{const p=new TextDecoder().decode(n);return JSON.parse(p),new be.OverlayFilesystem([new be.InMemoryFilesystem({"blueprint.json":p}),new be.FetchFilesystem({baseUrl:r,corsProxy:t.corsProxy})])}catch(p){if(await Qs(n))return Zs(n);throw new Error(`Blueprint file at ${r} is neither a valid JSON nor a ZIP file.`,{cause:p})}}function Ys(r){const t=r.map(p=>C.normalizePath(p));if(t.some(p=>C.basename(p)==="blueprint.json"&&C.dirname(p)===""))return"blueprint.json";const n=new Set;for(const p of t){const l=p.split("/")[0];l&&l!==C.basename(p)&&l!=="__MACOSX"&&n.add(l)}if(n.size>1)throw new Error("ZIP contains multiple top-level directories. Bundle ZIPs must contain blueprint.json at the root or inside a single top-level directory.");if(n.size===1){const l=`${[...n][0]}/blueprint.json`;if(t.includes(l))return l}throw new Error("ZIP does not contain a blueprint.json. Place blueprint.json at the ZIP root or inside a single top-level directory.")}async function Zs(r){const t=be.ZipFilesystem.fromArrayBuffer(r),n=await t.getAllFilePaths(),p=Ys(n),l=C.dirname(p);return l===""?t:new be.ChrootFilesystem(l,t)}async function Qs(r){if(r.byteLength<4)return!1;const t=new Uint8Array(r,0,4);return t[0]===80&&t[1]===75&&t[2]===3&&t[3]===4}const Gs=["latest","beta","trunk","nightly"],Js=/^\d+\.\d+(?:\.\d+)?(?:-(?:beta|rc)\d+)?$/i,Xs=Pe.AllPHPVersions.filter(r=>r!=="next");async function Rt(r){var n;const t=await ze.create(r);if(t.getVersion()===1){const p=await He(r);return{wpVersion:p.versions.wp,phpVersion:p.versions.php,intl:p.features.intl,networking:p.features.networking,extraLibraries:p.extraLibraries,constants:{}}}else{const p=t.getDeclaration();if(!Ks(p))throw new Error("Expected a Blueprint v2 declaration.");const l=(n=p.applicationOptions)==null?void 0:n["wordpress-playground"];return{phpVersion:ei(p),wpVersion:si(p),intl:!1,networking:(l==null?void 0:l.networkAccess)??!0,constants:p.constants??{},extraLibraries:[]}}}function Ks(r){return r.version===2}function ei(r){const t=r.phpVersion;if(typeof t=="string")return Wr(t);const n=ri(t);if(n)return Wr(n);const p=ti(t);if(p)return p;if(t&&typeof t=="object")throw new Error(`Unsatisfiable Blueprint v2 PHP version constraints ${JSON.stringify(t)}. Supported versions: ${Pe.AllPHPVersions.join(", ")}.`);return Me.RecommendedPHPVersion}function Wr(r){if(r==="latest")return Pe.LatestSupportedPHPVersion;if(Pe.AllPHPVersions.includes(r))return r;throw new Error(`Unsupported Blueprint v2 PHP version "${r}". Supported versions: ${Pe.AllPHPVersions.join(", ")}.`)}function ri(r){if(!(!r||typeof r!="object")&&"recommended"in r)return typeof r.recommended=="string"?r.recommended:void 0}function ti(r){if(!(!r||typeof r!="object"))return Vr(Me.RecommendedPHPVersion,r)?Me.RecommendedPHPVersion:Xs.find(t=>Vr(t,r))}function Vr(r,t){if(r==="next")return!1;const n=Br(t==null?void 0:t.min);if(n&&Mr(r,n)<0)return!1;const p=Br(t==null?void 0:t.max);return!(p&&Mr(r,p)>0)}function Br(r){return r==="latest"?Pe.LatestSupportedPHPVersion:r}function Mr(r,t){const n=zr(r),p=zr(t);for(let l=0;l<3;l++){const s=n[l]-p[l];if(s!==0)return s}return 0}function zr(r){const[t=0,n=0,p=0]=r.split(".").map(l=>Number(l));return[t,n,p]}function si(r){const t=r.wordpressVersion;if(typeof t=="string")return Hr(t);const n=ii(t);return n?Hr(n):"latest"}function Hr(r){if(Gs.includes(r)||Js.test(r))return r;throw new Error(`Unsupported Blueprint v2 WordPress version "${r}". Use latest, beta, trunk, nightly, or a version like 6.8, 6.8.1, or 6.8-rc1.`)}function ii(r){if(!(!r||typeof r!="object")&&"min"in r&&"preferred"in r)return typeof r.preferred=="string"?r.preferred:void 0}class cr extends Error{constructor(t,n="This Blueprint v2 feature is not supported by the TypeScript runner yet."){super(`${t}: ${n}`),this.name="UnsupportedBlueprintV2FeatureError",this.featurePath=t}}async function oi(r,t={}){const n=await Rt(r),p=pi(r),{steps:l,unsupportedPlan:s}=li(p),e=ni(r,n,l);return{runtime:n,applicationOptions:r.applicationOptions,plan:p,steps:l,unsupportedPlan:s,run:async f=>{if(s.length>0)throw new cr("executionPlan",ai(s));await(await He(e,t)).run(f)}}}function ni(r,t,n){var l;const p=(l=r.applicationOptions)==null?void 0:l["wordpress-playground"];return{preferredVersions:{php:t.phpVersion,wp:t.wpVersion},features:{intl:t.intl,networking:t.networking},extraLibraries:t.extraLibraries,landingPage:p==null?void 0:p.landingPage,login:p==null?void 0:p.login,steps:n}}function ai(r){return`Blueprint v2 execution plan contains unsupported items: ${Array.from(new Set(r.map(n=>n.type))).join(", ")}.`}function pi(r){var n,p;const t=[];r.constants&&Object.keys(r.constants).length>0&&t.push({type:"defineWpConfigConsts",consts:r.constants}),r.siteOptions&&Object.keys(r.siteOptions).length>0&&t.push({type:"setSiteOptions",options:r.siteOptions});for(const[l,s]of(r.muPlugins??[]).entries())t.push({type:"installMuPlugin",muPlugin:s,sourcePath:`/muPlugins/${l}`});for(const[l,s]of(r.themes??[]).entries())t.push({type:"installTheme",theme:s,active:!1,sourcePath:`/themes/${l}`});r.activeTheme!==void 0&&t.push({type:"installTheme",theme:r.activeTheme,active:!0,sourcePath:"/activeTheme"});for(const[l,s]of(r.plugins??[]).entries())t.push({type:"installPlugin",plugin:s,sourcePath:`/plugins/${l}`});r.fonts&&Object.keys(r.fonts).length>0&&t.push({type:"installFonts",fonts:r.fonts});for(const[l,s]of(r.media??[]).entries())t.push({type:"importMedia",media:s,sourcePath:`/media/${l}`});r.siteLanguage&&t.push({type:"setSiteLanguage",language:r.siteLanguage}),(n=r.roles)!=null&&n.length&&t.push({type:"defineRoles",roles:r.roles}),(p=r.users)!=null&&p.length&&t.push({type:"defineUsers",users:r.users}),r.postTypes&&Object.keys(r.postTypes).length>0&&t.push({type:"definePostTypes",postTypes:r.postTypes});for(const[l,s]of(r.content??[]).entries())t.push({type:"importContent",content:s,sourcePath:`/content/${l}`});for(const[l,s]of(r.additionalStepsAfterExecution??[]).entries())t.push({type:"runStep",step:s,sourcePath:`/additionalStepsAfterExecution/${l}`});return t}function li(r){const t=[],n=[];for(const p of r){const l=fi(p);l?t.push(...l):n.push(p)}return{steps:t,unsupportedPlan:n}}function fi(r){switch(r.type){case"defineWpConfigConsts":return[{step:"defineWpConfigConsts",consts:r.consts}];case"setSiteOptions":return[{step:"setSiteOptions",options:r.options}];case"installTheme":return[Nt(r.theme,r.active)];case"installPlugin":return[Lt(r.plugin)];case"setSiteLanguage":return[{step:"setSiteLanguage",language:r.language}];case"runStep":return ui(r.step);default:return}}function ui(r){switch(r.step){case"activatePlugin":return[{step:"activatePlugin",pluginPath:r.pluginPath,pluginName:r.humanReadableName}];case"activateTheme":return[{step:"activateTheme",themeFolderName:r.themeDirectoryName}];case"cp":return[{step:"cp",fromPath:Ce(r.fromPath),toPath:Ce(r.toPath)}];case"defineConstants":return[{step:"defineWpConfigConsts",consts:r.constants}];case"importThemeStarterContent":return[{step:"importThemeStarterContent",themeSlug:r.themeSlug}];case"installPlugin":return[Lt(r)];case"installTheme":return[Nt(r,r.active??!0)];case"mkdir":return[{step:"mkdir",path:Ce(r.path)}];case"mv":return[{step:"mv",fromPath:Ce(r.fromPath),toPath:Ce(r.toPath)}];case"rm":return[{step:"rm",path:Ce(r.path)}];case"rmdir":return[{step:"rmdir",path:Ce(r.path)}];case"setSiteLanguage":return[{step:"setSiteLanguage",language:r.language}];case"setSiteOptions":return[{step:"setSiteOptions",options:r.options}];case"wp-cli":return[{step:"wp-cli",command:r.command,wpCliPath:r.wpCliPath}];default:return}}function Lt(r){const t=Ft(r),n={step:"installPlugin",pluginData:xt(t.source,"plugin"),options:di(t)};return t.ifAlreadyInstalled&&(n.ifAlreadyInstalled=t.ifAlreadyInstalled),n}function di(r){const t={activate:r.active??!0};return r.activationOptions&&(t.activationOptions=r.activationOptions),(r.onError==="skip-plugin"||r.onError==="throw")&&(t.onError=r.onError),r.targetDirectoryName&&(t.targetFolderName=r.targetDirectoryName),r.humanReadableName&&(t.humanReadableName=r.humanReadableName),t}function Nt(r,t){const n=Ft(r),p={step:"installTheme",themeData:xt(n.source,"theme"),options:ci(n,t)};return n.ifAlreadyInstalled&&(p.ifAlreadyInstalled=n.ifAlreadyInstalled),p}function ci(r,t){const n={activate:t,importStarterContent:r.importStarterContent??!1};return r.targetDirectoryName&&(n.targetFolderName=r.targetDirectoryName),(r.onError==="skip-theme"||r.onError==="throw")&&(n.onError=r.onError),r.humanReadableName&&(n.humanReadableName=r.humanReadableName),n}function Ft(r){return r&&typeof r=="object"&&"source"in r&&!Dt(r)&&!Ut(r)&&!Wt(r)?r:{source:r}}function xt(r,t){if(typeof r=="string")return kt(r)?{resource:"zip",inner:{resource:"git:directory",url:r.trim().replace(/\/+$/,""),ref:"HEAD"}}:mi(r)?{resource:"url",url:r}:yi(r)?{resource:"bundled",path:Ct(r)}:hi(r,t==="plugin"?"plugins":"themes");if(Dt(r))return{resource:"literal",name:r.filename,contents:r.content};if(Ut(r))return{resource:"literal:directory",name:r.directoryName,files:Vt(r.files)};if(Wt(r))return{resource:"git:directory",url:r.gitRepository,ref:r.ref||"HEAD",path:r.pathInRepository||r.path||""};throw new cr(t,"Unsupported Blueprint v2 data reference.")}function Ce(r){if(typeof r!="string"||r.trim()==="")throw new cr("path","Invalid Blueprint v2 path: must not be empty.");if(It(r))throw new cr("path",`Invalid Blueprint v2 path "${r}": must not contain parent directory segments.`);return r.startsWith("site:")?C.joinPaths("/wordpress",r.slice(5)):r==="/wordpress"||r.startsWith("/wordpress/")?r:C.joinPaths("/wordpress",r)}function mi(r){try{const t=new URL(r);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}function yi(r){return(r.startsWith("./")||r.startsWith("/"))&&!It(Ct(r))}function Ct(r){return r.replace(/^\.?\//,"")}function It(r){return(r.startsWith("site:")?r.slice(5):r).replace(/\\/g,"/").split("/").includes("..")}function hi(r,t){const[n,p]=r.split("@");return p&&p!=="latest"?{resource:"url",url:`https://downloads.wordpress.org/${t==="plugins"?"plugin":"theme"}/${n}.${p}.zip`}:{resource:t==="plugins"?"wordpress.org/plugins":"wordpress.org/themes",slug:n}}function Dt(r){return r&&typeof r=="object"&&typeof r.filename=="string"&&typeof r.content=="string"}function Ut(r){return r&&typeof r=="object"&&typeof r.directoryName=="string"&&r.files&&typeof r.files=="object"}function Wt(r){return r&&typeof r=="object"&&typeof r.gitRepository=="string"}function Vt(r){const t={};for(const[n,p]of Object.entries(r)){const l=typeof p=="string"?p:Vt(p.files);Object.defineProperty(t,n,{value:l,enumerable:!0,configurable:!0,writable:!0})}return t}async function gi(r,t={}){const n=await Qr(r);return vi(n)?wi(r,n):bi(r,n,t)}async function wi(r,t){const n=await oi(t,Ye(r)?{streamBundledFile:(...p)=>r.read(...p)}:{});return{version:2,declaration:t,compiled:n,run:n.run}}async function bi(r,t,n){const p=Ye(r)?r:t,l=await He(p,{...n,onBlueprintValidated:n.onBlueprintValidated});return{version:1,declaration:t,compiled:l,run:l.run}}function vi(r){return r.version===2}function Pi(){}exports.BlueprintFetchError=St;exports.BlueprintFilesystemRequiredError=Gr;exports.BlueprintReflection=ze;exports.BlueprintStepExecutionError=Et;exports.InvalidBlueprintError=Fr;exports.ResourceDownloadError=fr;exports.activatePlugin=$r;exports.activateTheme=jr;exports.compileBlueprint=He;exports.compileBlueprintForExecution=gi;exports.compileBlueprintV1=He;exports.cp=nt;exports.defineSiteUrl=Rr;exports.defineWpConfigConsts=yr;exports.enableMultisite=ot;exports.exportWXR=ct;exports.getBlueprintDeclaration=Tt;exports.getV2Runner=qt;exports.importThemeStarterContent=Lr;exports.importWordPressFiles=dt;exports.importWxr=ut;exports.installPlugin=yt;exports.installTheme=ht;exports.isBlueprintBundle=Ye;exports.isStepDefinition=jt;exports.login=gt;exports.mkdir=pt;exports.mv=at;exports.request=tt;exports.resetData=wt;exports.resolveRemoteBlueprint=Hs;exports.resolveRuntimeConfiguration=Rt;exports.rm=dr;exports.rmdir=lt;exports.runBlueprintSteps=At;exports.runBlueprintV1Steps=At;exports.runBlueprintV2=zs;exports.runPHP=Kr;exports.runPHPWithOptions=et;exports.runSql=rt;exports.runWpInstallationWizard=bt;exports.setPluginProxyURL=Pi;exports.setSiteLanguage=Pt;exports.setSiteOptions=Ar;exports.unzip=gr;exports.updateUserMeta=st;exports.validateBlueprint=$t;exports.wpCLI=Sr;exports.wpContentFilesExcludedFromExport=Nr;exports.writeFile=hr;exports.writeFiles=ft;exports.zipWpContent=vt;
|
|
1771
|
+
`;function ds(e){const t=ys(e),o={step:"installPlugin",pluginData:at(t.source,"plugin"),options:To(t)};return t.ifAlreadyInstalled&&(o.ifAlreadyInstalled=t.ifAlreadyInstalled),o}function To(e){const t={activate:e.active??!0};return e.activationOptions&&(t.activationOptions=e.activationOptions),(e.onError==="skip-plugin"||e.onError==="throw")&&(t.onError=e.onError),e.targetDirectoryName&&(t.targetFolderName=e.targetDirectoryName),e.humanReadableName&&(t.humanReadableName=e.humanReadableName),t}function ms(e,t){const o=ys(e),n={step:"installTheme",themeData:at(o.source,"theme"),options:Ro(o,t)};return o.ifAlreadyInstalled&&(n.ifAlreadyInstalled=o.ifAlreadyInstalled),n}function Ro(e,t){const o={activate:t,importStarterContent:e.importStarterContent??!1};return e.targetDirectoryName&&(o.targetFolderName=e.targetDirectoryName),(e.onError==="skip-theme"||e.onError==="throw")&&(o.onError=e.onError),e.humanReadableName&&(o.humanReadableName=e.humanReadableName),o}function ys(e){return e&&typeof e=="object"&&"source"in e&&!Le(e)&&!sr(e)&&!ir(e)?e:{source:e}}function So(e){if(typeof e=="string"&&rr(e)||Le(e)||sr(e)||ir(e))return e}function at(e,t){if(typeof e=="string"){if(Kt(e))return{resource:"zip",inner:{resource:"git:directory",url:e.trim().replace(/\/+$/,""),ref:"HEAD"}};if(Nr(e))return{resource:"url",url:e};if(rr(e))return{resource:"bundled",path:tr(e)};if(t==="wordpress")throw new be("wordpressVersion","Unsupported Blueprint v2 WordPress data reference.");return qo(e,t==="plugin"?"plugins":"themes")}if(Le(e))return{resource:"literal",name:e.filename,contents:e.content};if(sr(e))return{resource:"literal:directory",name:e.directoryName,files:ft(e.files)};if(ir(e))return{resource:"git:directory",url:e.gitRepository,ref:e.ref||"HEAD",path:e.pathInRepository||e.path||""};throw new be(t,"Unsupported Blueprint v2 data reference.")}function Ne(e,t){if(typeof e=="string"){if(Nr(e))return{resource:"url",url:e};if(_s(e))return{resource:"vfs",path:Oe(e,t)};if(rr(e))return{resource:"bundled",path:tr(e)};throw new be(t,"Blueprint v2 file references must be URLs, execution-context paths, or target-site paths.")}if(Le(e))return{resource:"literal",name:e.filename,contents:e.content};throw new be(t,"Unsupported Blueprint v2 file reference.")}function hs(e,t){if(typeof e=="string"){if(Nr(e))return{resource:"url",url:e};if(rr(e))return{resource:"bundled",path:tr(e)};throw new be(t,"Blueprint v2 writable data references must be URLs or execution-context paths.")}if(Le(e))return{resource:"literal",name:e.filename,contents:e.content};if(sr(e))return{resource:"literal:directory",name:e.directoryName,files:ft(e.files)};if(ir(e))return{resource:"git:directory",url:e.gitRepository,ref:e.ref||"HEAD",path:e.pathInRepository||e.path||""};throw new be(t,"Unsupported Blueprint v2 writable data reference.")}function pt(e){return e.resource==="literal:directory"||e.resource==="git:directory"}function jo(e,t){const o="/wordpress/wp-content/mu-plugins";if(Le(e))return N.joinPaths(o,e.filename);if(sr(e))return N.joinPaths(o,e.directoryName);if(ir(e))return N.joinPaths(o,Ao(e,t));if(typeof e=="string")return N.joinPaths(o,lt(e,t));throw new be(t,"Unsupported Blueprint v2 mu-plugin data reference.")}function gs(e){return typeof e=="string"||Le(e)}function qr(e,t,o){const n=o?`.${o}`:"";return`/tmp/${t}-${e.nextTempFileIndex++}${n}`}function lt(e,t){if(typeof e=="string"){if(Nr(e))return N.basename(new URL(e).pathname);if(rr(e))return N.basename(tr(e));if(_s(e))return N.basename(Oe(e,t))}if(Le(e))return e.filename;throw new be(t,"Blueprint v2 file references must be URLs, execution-context paths, target-site paths, or inline files.")}function Ao(e,t){const o=e.pathInRepository||e.path;if(o){if(ws(o))throw new be(`${t}.pathInRepository`,"Blueprint v2 git paths must not contain parent directory segments.");return N.basename(o)}return N.basename(new URL(e.gitRepository).pathname)}function Tr(e){return e.replace(/[-_]+/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function $t(e){return JSON.parse(JSON.stringify(e))}function ut(e){return Array.isArray(e)?e:[e]}function Oe(e,t="path"){if(typeof e!="string"||e.trim()==="")throw new be(t,"Invalid Blueprint v2 path: must not be empty.");const o=e.startsWith("site:"),n=o?e.slice(5):e;if(!o&&n==="/wordpress")return"/wordpress";const l=!o&&n.startsWith("/wordpress/")?n:N.joinPaths("/wordpress",n),s=N.resolvePathUnder(l,"/wordpress");if(!s)throw new be(t,`Invalid Blueprint v2 path "${e}": must stay within the target WordPress root.`);return s}function Nr(e){try{const t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}function _s(e){return e.startsWith("site:")}function rr(e){return(e.startsWith("./")||e.startsWith("/"))&&!ws(tr(e))}function tr(e){return e.replace(/^\.?\//,"")}function ws(e){return(e.startsWith("site:")?e.slice(5):e).replace(/\\/g,"/").split("/").includes("..")}function qo(e,t){const{slug:o,version:n}=No(e);return n&&n!=="latest"?{resource:"url",url:`https://downloads.wordpress.org/${t==="plugins"?"plugin":"theme"}/${o}.${n}.zip`}:{resource:t==="plugins"?"wordpress.org/plugins":"wordpress.org/themes",slug:o}}function No(e){const t=e.lastIndexOf("@");if(t===-1)return{slug:e};const o=e.slice(t+1);return Lo(o)?{slug:e.slice(0,t),version:o}:{slug:e}}function Lo(e){return e==="latest"||/^\d+\.\d+(?:\.\d+)?$/.test(e)}function Le(e){return e&&typeof e=="object"&&typeof e.filename=="string"&&typeof e.content=="string"}function sr(e){return e&&typeof e=="object"&&typeof e.directoryName=="string"&&e.files&&typeof e.files=="object"}function ir(e){return e&&typeof e=="object"&&typeof e.gitRepository=="string"}function ft(e){const t={};for(const[o,n]of Object.entries(e)){const l=typeof n=="string"?n:ft(n.files);Object.defineProperty(t,o,{value:l,enumerable:!0,configurable:!0,writable:!0})}return t}class bs extends Error{constructor(t,o,n){super(t,n),this.name="BlueprintFetchError",this.url=o}}async function xo(e,t={}){let o;try{const l=await(t.fetch||fetch)(e,{credentials:"omit"});if(!l.ok)throw new Error(`Failed to fetch blueprint from ${e}`);o=await l.arrayBuffer()}catch(n){throw new bs(`Blueprint file could not be resolved from ${e}: ${n instanceof Error?n.message:String(n)}`,e,{cause:n})}try{const n=new TextDecoder().decode(o);return JSON.parse(n),new ve.OverlayFilesystem([new ve.InMemoryFilesystem({"blueprint.json":n}),new ve.FetchFilesystem({baseUrl:e,corsProxy:t.corsProxy})])}catch(n){if(await Io(o))return Co(o);throw new Error(`Blueprint file at ${e} is neither a valid JSON nor a ZIP file.`,{cause:n})}}function Fo(e){const t=e.map(n=>N.normalizePath(n));if(t.some(n=>N.basename(n)==="blueprint.json"&&N.dirname(n)===""))return"blueprint.json";const o=new Set;for(const n of t){const l=n.split("/")[0];l&&l!==N.basename(n)&&l!=="__MACOSX"&&o.add(l)}if(o.size>1)throw new Error("ZIP contains multiple top-level directories. Bundle ZIPs must contain blueprint.json at the root or inside a single top-level directory.");if(o.size===1){const l=`${[...o][0]}/blueprint.json`;if(t.includes(l))return l}throw new Error("ZIP does not contain a blueprint.json. Place blueprint.json at the ZIP root or inside a single top-level directory.")}async function Co(e){const t=ve.ZipFilesystem.fromArrayBuffer(e),o=await t.getAllFilePaths(),n=Fo(o),l=N.dirname(n);return l===""?t:new ve.ChrootFilesystem(l,t)}async function Io(e){if(e.byteLength<4)return!1;const t=new Uint8Array(e,0,4);return t[0]===80&&t[1]===75&&t[2]===3&&t[3]===4}async function Uo(e,t={}){const o=await Qe.create(e);if(o.getVersion()===1){const n=await Ke(e);return{wpVersion:n.versions.wp,phpVersion:n.versions.php,intl:n.features.intl,networking:n.features.networking,extraLibraries:n.extraLibraries,constants:{}}}return os(o.getDeclaration(),t.siteMode)}async function Bo(e,t={}){const o=typeof e=="string",n=await kt(e);if(Mo(n))return Wo(o?n:e,n,t);if(o)throw new Error("Raw JSON input is only supported for Blueprint v2 declarations.");return Do(e,n,t)}async function Wo(e,t,o){const n=await ps(t,{progress:o.progress,streamBundledFile:er(e)?(...l)=>e.read(...l):void 0,siteMode:o.siteMode,onBlueprintValidated:o.onBlueprintValidated});return{version:2,declaration:t,compiled:n,run:n.run}}async function Do(e,t,o){const n=er(e)?e:t,l=await Ke(n,{...o,onBlueprintValidated:o.onBlueprintValidated});return{version:1,declaration:t,compiled:l,run:l.run}}function Mo(e){return e.version===2}function Vo(){}exports.BlueprintFetchError=bs;exports.BlueprintFilesystemRequiredError=Et;exports.BlueprintReflection=Qe;exports.BlueprintStepExecutionError=es;exports.InvalidBlueprintError=tt;exports.ResourceDownloadError=Pr;exports.activatePlugin=Yr;exports.activateTheme=Jr;exports.assertBlueprintV2WordPressVersionCompatibility=Ai;exports.compileBlueprint=Ke;exports.compileBlueprintForExecution=Bo;exports.compileBlueprintV1=Ke;exports.compileBlueprintV2=ps;exports.cp=Ft;exports.createBlueprintV2ExecutionPlan=ls;exports.defineSiteUrl=Xr;exports.defineWpConfigConsts=Sr;exports.enableMultisite=xt;exports.exportWXR=Mt;exports.getBlueprintDeclaration=rs;exports.importThemeStarterContent=Kr;exports.importWordPressFiles=Dt;exports.importWxr=Wt;exports.installPlugin=zt;exports.installTheme=Ht;exports.isBlueprintBundle=er;exports.isStepDefinition=ts;exports.login=Yt;exports.mkdir=It;exports.mv=Ct;exports.request=qt;exports.resetData=Jt;exports.resolveBlueprintV2WordPressSource=Yi;exports.resolveRemoteBlueprint=xo;exports.resolveRuntimeConfiguration=Uo;exports.rm=kr;exports.rmdir=Ut;exports.runBlueprintSteps=ss;exports.runBlueprintV1Steps=ss;exports.runPHP=St;exports.runPHPWithOptions=jt;exports.runSql=At;exports.runWpInstallationWizard=Zt;exports.setPluginProxyURL=Vo;exports.setSiteLanguage=Qt;exports.setSiteOptions=Zr;exports.unzip=Ar;exports.updateUserMeta=Nt;exports.validateBlueprint=st;exports.validateBlueprintDeclaration=Ei;exports.wpCLI=Qr;exports.wpContentFilesExcludedFromExport=et;exports.writeFile=jr;exports.writeFiles=Bt;exports.zipWpContent=Gt;
|
|
949
1772
|
//# sourceMappingURL=index.cjs.map
|