@wp-playground/blueprints 0.6.15 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,13 +1,13 @@
1
- var Nt = (e, t, r) => {
1
+ var It = (e, t, r) => {
2
2
  if (!t.has(e))
3
3
  throw TypeError("Cannot " + r);
4
4
  };
5
- var H = (e, t, r) => (Nt(e, t, "read from private field"), r ? r.call(e) : t.get(e)), Q = (e, t, r) => {
5
+ var H = (e, t, r) => (It(e, t, "read from private field"), r ? r.call(e) : t.get(e)), K = (e, t, r) => {
6
6
  if (t.has(e))
7
7
  throw TypeError("Cannot add the same private member more than once");
8
8
  t instanceof WeakSet ? t.add(e) : t.set(e, r);
9
- }, te = (e, t, r, n) => (Nt(e, t, "write to private field"), n ? n.call(e, r) : t.set(e, r), r);
10
- var ce = (e, t, r) => (Nt(e, t, "access private method"), r);
9
+ }, ie = (e, t, r, n) => (It(e, t, "write to private field"), n ? n.call(e, r) : t.set(e, r), r);
10
+ var ce = (e, t, r) => (It(e, t, "access private method"), r);
11
11
  const currentJsRuntime = function() {
12
12
  var e;
13
13
  return typeof process < "u" && ((e = process.release) == null ? void 0 : e.name) === "node" ? "NODE" : typeof window < "u" ? "WEB" : (
@@ -97,19 +97,40 @@ const wpContentFilesExcludedFromExport = [
97
97
  "themes/twentytwentyfour",
98
98
  "themes/twentytwentyfive",
99
99
  "themes/twentytwentysix"
100
- ];
100
+ ], SleepFinished = Symbol("SleepFinished");
101
+ function sleep(e) {
102
+ return new Promise((t) => {
103
+ setTimeout(() => t(SleepFinished), e);
104
+ });
105
+ }
106
+ class AcquireTimeoutError extends Error {
107
+ constructor() {
108
+ super("Acquiring lock timed out");
109
+ }
110
+ }
101
111
  class Semaphore {
102
- constructor({ concurrency: t }) {
103
- this._running = 0, this.concurrency = t, this.queue = [];
112
+ constructor({ concurrency: t, timeout: r }) {
113
+ this._running = 0, this.concurrency = t, this.timeout = r, this.queue = [];
114
+ }
115
+ get remaining() {
116
+ return this.concurrency - this.running;
104
117
  }
105
118
  get running() {
106
119
  return this._running;
107
120
  }
108
121
  async acquire() {
109
122
  for (; ; )
110
- if (this._running >= this.concurrency)
111
- await new Promise((t) => this.queue.push(t));
112
- else {
123
+ if (this._running >= this.concurrency) {
124
+ const t = new Promise((r) => {
125
+ this.queue.push(r);
126
+ });
127
+ this.timeout !== void 0 ? await Promise.race([t, sleep(this.timeout)]).then(
128
+ (r) => {
129
+ if (r === SleepFinished)
130
+ throw new AcquireTimeoutError();
131
+ }
132
+ ) : await t;
133
+ } else {
113
134
  this._running++;
114
135
  let t = !1;
115
136
  return () => {
@@ -274,7 +295,7 @@ require_once( ${phpVar(s)}. "/wp-load.php" );
274
295
  require_once( ${phpVar(s)}. "/wp-admin/includes/plugin.php" );
275
296
 
276
297
  // Set current user to admin
277
- set_current_user( get_users(array('role' => 'Administrator') )[0] );
298
+ wp_set_current_user( get_users(array('role' => 'Administrator') )[0]->ID );
278
299
 
279
300
  $plugin_path = ${phpVar(t)};
280
301
 
@@ -304,7 +325,7 @@ define( 'WP_ADMIN', true );
304
325
  require_once( ${phpVar(n)}. "/wp-load.php" );
305
326
 
306
327
  // Set current user to admin
307
- set_current_user( get_users(array('role' => 'Administrator') )[0] );
328
+ wp_set_current_user( get_users(array('role' => 'Administrator') )[0]->ID );
308
329
 
309
330
  switch_theme( ${phpVar(t)} );
310
331
  `
@@ -341,8 +362,6 @@ switch_theme( ${phpVar(t)} );
341
362
  `
342
363
  });
343
364
  return await rm(e, { path: n }), o;
344
- }, setPhpIniEntry = async (e, { key: t, value: r }) => {
345
- await e.setPhpIniEntry(t, r);
346
365
  }, request = async (e, { request: t }) => {
347
366
  const r = await e.request(t);
348
367
  if (r.httpStatusCode > 399 || r.httpStatusCode < 200)
@@ -793,7 +812,7 @@ define( 'WP_ADMIN', true );
793
812
  require_once(${phpVar(s)} . "/wp-load.php");
794
813
 
795
814
  // Set current user to admin
796
- set_current_user( get_users(array('role' => 'Administrator') )[0] );
815
+ ( get_users(array('role' => 'Administrator') )[0] );
797
816
 
798
817
  require_once(${phpVar(s)} . "/wp-admin/includes/plugin.php");
799
818
  $plugins_root = ${phpVar(s)} . "/wp-content/plugins";
@@ -858,16 +877,16 @@ echo json_encode($deactivated_plugins);
858
877
  PATH_CURRENT_SITE: r
859
878
  }
860
879
  });
861
- const f = new URL(await e.absoluteUrl), $ = isURLScoped(f) ? "scope:" + getURLScope(f) : null;
880
+ const p = new URL(await e.absoluteUrl), g = isURLScoped(p) ? "scope:" + getURLScope(p) : null;
862
881
  await e.writeFile(
863
882
  joinPaths(s, "/wp-content/sunrise.php"),
864
883
  `<?php
865
884
  if ( !defined( 'BLOG_ID_CURRENT_SITE' ) ) {
866
885
  define( 'BLOG_ID_CURRENT_SITE', 1 );
867
886
  }
868
- $folder = ${phpVar($)};
887
+ $folder = ${phpVar(g)};
869
888
  if ($folder && strpos($_SERVER['REQUEST_URI'],"/$folder") === false) {
870
- $_SERVER['HTTP_HOST'] = ${phpVar(f.hostname)};
889
+ $_SERVER['HTTP_HOST'] = ${phpVar(p.hostname)};
871
890
  $_SERVER['REQUEST_URI'] = "/$folder/" . ltrim($_SERVER['REQUEST_URI'], '/');
872
891
  }
873
892
  `
@@ -1049,14 +1068,14 @@ const tmpPath = "/tmp/file.zip", unzip = async (e, { zipFile: t, zipPath: r, ext
1049
1068
  extractToPath: s
1050
1069
  }), s = joinPaths(s, r);
1051
1070
  const i = joinPaths(s, "wp-content"), o = joinPaths(n, "wp-content");
1052
- for (const f of wpContentFilesExcludedFromExport) {
1053
- const $ = joinPaths(
1071
+ for (const p of wpContentFilesExcludedFromExport) {
1072
+ const g = joinPaths(
1054
1073
  i,
1055
- f
1074
+ p
1056
1075
  );
1057
- await removePath(e, $);
1058
- const O = joinPaths(o, f);
1059
- await e.fileExists(O) && (await e.mkdir(dirname($)), await e.mv(O, $));
1076
+ await removePath(e, g);
1077
+ const O = joinPaths(o, p);
1078
+ await e.fileExists(O) && (await e.mkdir(dirname(g)), await e.mv(O, g));
1060
1079
  }
1061
1080
  const l = joinPaths(
1062
1081
  s,
@@ -1068,10 +1087,10 @@ const tmpPath = "/tmp/file.zip", unzip = async (e, { zipFile: t, zipPath: r, ext
1068
1087
  l
1069
1088
  );
1070
1089
  const d = await e.listFiles(s);
1071
- for (const f of d)
1072
- await removePath(e, joinPaths(n, f)), await e.mv(
1073
- joinPaths(s, f),
1074
- joinPaths(n, f)
1090
+ for (const p of d)
1091
+ await removePath(e, joinPaths(n, p)), await e.mv(
1092
+ joinPaths(s, p),
1093
+ joinPaths(n, p)
1075
1094
  );
1076
1095
  await e.rmdir(s), await defineSiteUrl(e, {
1077
1096
  siteUrl: await e.absoluteUrl
@@ -1113,14 +1132,14 @@ async function installAsset(e, {
1113
1132
  prependPath: !0
1114
1133
  });
1115
1134
  u = u.filter((S) => !S.endsWith("/__MACOSX"));
1116
- const f = u.length === 1 && await e.isDir(u[0]);
1117
- let $, O = "";
1118
- f ? (O = u[0], $ = u[0].split("/").pop()) : (O = d, $ = i);
1119
- const C = `${t}/${$}`;
1135
+ const p = u.length === 1 && await e.isDir(u[0]);
1136
+ let g, O = "";
1137
+ p ? (O = u[0], g = u[0].split("/").pop()) : (O = d, g = i);
1138
+ const C = `${t}/${g}`;
1120
1139
  if (await e.fileExists(C)) {
1121
1140
  if (!await e.isDir(C))
1122
1141
  throw new Error(
1123
- `Cannot install asset ${$} to ${C} because a file with the same name already exists. Note it's a file, not a directory! Is this by mistake?`
1142
+ `Cannot install asset ${g} to ${C} because a file with the same name already exists. Note it's a file, not a directory! Is this by mistake?`
1124
1143
  );
1125
1144
  if (n === "overwrite")
1126
1145
  await e.rmdir(C, {
@@ -1130,16 +1149,16 @@ async function installAsset(e, {
1130
1149
  if (n === "skip")
1131
1150
  return {
1132
1151
  assetFolderPath: C,
1133
- assetFolderName: $
1152
+ assetFolderName: g
1134
1153
  };
1135
1154
  throw new Error(
1136
- `Cannot install asset ${$} to ${t} because it already exists and the ifAlreadyInstalled option was set to ${n}`
1155
+ `Cannot install asset ${g} to ${t} because it already exists and the ifAlreadyInstalled option was set to ${n}`
1137
1156
  );
1138
1157
  }
1139
1158
  }
1140
1159
  return await e.mv(O, C), {
1141
1160
  assetFolderPath: C,
1142
- assetFolderName: $
1161
+ assetFolderName: g
1143
1162
  };
1144
1163
  } finally {
1145
1164
  await e.rmdir(l, {
@@ -1298,7 +1317,6 @@ const allStepHandlers = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
1298
1317
  runPHPWithOptions,
1299
1318
  runSql,
1300
1319
  runWpInstallationWizard,
1301
- setPhpIniEntry,
1302
1320
  setSiteOptions,
1303
1321
  unzip,
1304
1322
  updateUserMeta,
@@ -1731,96 +1749,7 @@ const SupportedPHPVersions = [
1731
1749
  ], SupportedPHPExtensionBundles = {
1732
1750
  "kitchen-sink": SupportedPHPExtensionsList,
1733
1751
  light: []
1734
- };
1735
- var Ae, Ge;
1736
- class PHPBrowser {
1737
- /**
1738
- * @param server - The PHP server to browse.
1739
- * @param config - The browser configuration.
1740
- */
1741
- constructor(t, r = {}) {
1742
- Q(this, Ae, void 0);
1743
- Q(this, Ge, void 0);
1744
- this.requestHandler = t, te(this, Ae, {}), te(this, Ge, {
1745
- handleRedirects: !1,
1746
- maxRedirects: 4,
1747
- ...r
1748
- });
1749
- }
1750
- /**
1751
- * Sends the request to the server.
1752
- *
1753
- * When cookies are present in the response, this method stores
1754
- * them and sends them with any subsequent requests.
1755
- *
1756
- * When a redirection is present in the response, this method
1757
- * follows it by discarding a response and sending a subsequent
1758
- * request.
1759
- *
1760
- * @param request - The request.
1761
- * @param redirects - Internal. The number of redirects handled so far.
1762
- * @returns PHPRequestHandler response.
1763
- */
1764
- async request(t, r = 0) {
1765
- const n = await this.requestHandler.request({
1766
- ...t,
1767
- headers: {
1768
- ...t.headers,
1769
- cookie: this.serializeCookies()
1770
- }
1771
- });
1772
- if (n.headers["set-cookie"] && this.setCookies(n.headers["set-cookie"]), H(this, Ge).handleRedirects && n.headers.location && r < H(this, Ge).maxRedirects) {
1773
- const s = new URL(
1774
- n.headers.location[0],
1775
- this.requestHandler.absoluteUrl
1776
- );
1777
- return this.request(
1778
- {
1779
- url: s.toString(),
1780
- method: "GET",
1781
- headers: {}
1782
- },
1783
- r + 1
1784
- );
1785
- }
1786
- return n;
1787
- }
1788
- /** @inheritDoc */
1789
- pathToInternalUrl(t) {
1790
- return this.requestHandler.pathToInternalUrl(t);
1791
- }
1792
- /** @inheritDoc */
1793
- internalUrlToPath(t) {
1794
- return this.requestHandler.internalUrlToPath(t);
1795
- }
1796
- /** @inheritDoc */
1797
- get absoluteUrl() {
1798
- return this.requestHandler.absoluteUrl;
1799
- }
1800
- /** @inheritDoc */
1801
- get documentRoot() {
1802
- return this.requestHandler.documentRoot;
1803
- }
1804
- setCookies(t) {
1805
- for (const r of t)
1806
- try {
1807
- if (!r.includes("="))
1808
- continue;
1809
- const n = r.indexOf("="), s = r.substring(0, n), i = r.substring(n + 1).split(";")[0];
1810
- H(this, Ae)[s] = i;
1811
- } catch (n) {
1812
- console.error(n);
1813
- }
1814
- }
1815
- serializeCookies() {
1816
- const t = [];
1817
- for (const r in H(this, Ae))
1818
- t.push(`${r}=${H(this, Ae)[r]}`);
1819
- return t.join("; ");
1820
- }
1821
- }
1822
- Ae = new WeakMap(), Ge = new WeakMap();
1823
- const DEFAULT_BASE_URL = "http://example.com";
1752
+ }, DEFAULT_BASE_URL = "http://example.com";
1824
1753
  function toRelativeUrl(e) {
1825
1754
  return e.toString().substring(e.origin.length);
1826
1755
  }
@@ -1858,7 +1787,30 @@ function fileToUint8Array(e) {
1858
1787
  }, r.readAsArrayBuffer(e);
1859
1788
  });
1860
1789
  }
1861
- var Pe, Ke, dt, De, Je, ve, Qe, Fe, mt, xt, _t, Wt, $t, Bt;
1790
+ class HttpCookieStore {
1791
+ constructor() {
1792
+ this.cookies = {};
1793
+ }
1794
+ rememberCookiesFromResponseHeaders(t) {
1795
+ if (t != null && t["set-cookie"])
1796
+ for (const r of t["set-cookie"])
1797
+ try {
1798
+ if (!r.includes("="))
1799
+ continue;
1800
+ const n = r.indexOf("="), s = r.substring(0, n), i = r.substring(n + 1).split(";")[0];
1801
+ this.cookies[s] = i;
1802
+ } catch (n) {
1803
+ console.error(n);
1804
+ }
1805
+ }
1806
+ getCookieRequestHeader() {
1807
+ const t = [];
1808
+ for (const r in this.cookies)
1809
+ t.push(`${r}=${this.cookies[r]}`);
1810
+ return t.join("; ");
1811
+ }
1812
+ }
1813
+ var Pe, We, ct, je, Be, ve, Ge, Ae, Ke, ft, Wt, ht, Bt, mt, Gt;
1862
1814
  class PHPRequestHandler {
1863
1815
  /**
1864
1816
  * @param php - The PHP instance.
@@ -1871,7 +1823,7 @@ class PHPRequestHandler {
1871
1823
  * @param fsPath - Absolute path of the static file to serve.
1872
1824
  * @returns The response.
1873
1825
  */
1874
- Q(this, mt);
1826
+ K(this, ft);
1875
1827
  /**
1876
1828
  * Runs the requested PHP file with all the request and $_SERVER
1877
1829
  * superglobals populated.
@@ -1879,7 +1831,7 @@ class PHPRequestHandler {
1879
1831
  * @param request - The request.
1880
1832
  * @returns The response.
1881
1833
  */
1882
- Q(this, _t);
1834
+ K(this, ht);
1883
1835
  /**
1884
1836
  * Resolve the requested path to the filesystem path of the requested PHP file.
1885
1837
  *
@@ -1889,55 +1841,120 @@ class PHPRequestHandler {
1889
1841
  * @throws {Error} If the requested path doesn't exist.
1890
1842
  * @returns The resolved filesystem path.
1891
1843
  */
1892
- Q(this, $t);
1893
- Q(this, Pe, void 0);
1894
- Q(this, Ke, void 0);
1895
- Q(this, dt, void 0);
1896
- Q(this, De, void 0);
1897
- Q(this, Je, void 0);
1898
- Q(this, ve, void 0);
1899
- Q(this, Qe, void 0);
1900
- Q(this, Fe, void 0);
1901
- te(this, Fe, new Semaphore({ concurrency: 1 }));
1844
+ K(this, mt);
1845
+ K(this, Pe, void 0);
1846
+ K(this, We, void 0);
1847
+ K(this, ct, void 0);
1848
+ K(this, je, void 0);
1849
+ K(this, Be, void 0);
1850
+ K(this, ve, void 0);
1851
+ K(this, Ge, void 0);
1852
+ K(this, Ae, void 0);
1853
+ K(this, Ke, void 0);
1854
+ ie(this, Ae, new Semaphore({ concurrency: 1 }));
1902
1855
  const {
1903
1856
  documentRoot: n = "/www/",
1904
1857
  absoluteUrl: s = typeof location == "object" ? location == null ? void 0 : location.href : "",
1905
1858
  rewriteRules: i = []
1906
1859
  } = r;
1907
- this.php = t, te(this, Pe, n);
1860
+ this.php = t, ie(this, Ke, new HttpCookieStore()), ie(this, Pe, n);
1908
1861
  const o = new URL(s);
1909
- te(this, dt, o.hostname), te(this, De, o.port ? Number(o.port) : o.protocol === "https:" ? 443 : 80), te(this, Ke, (o.protocol || "").replace(":", ""));
1910
- const l = H(this, De) !== 443 && H(this, De) !== 80;
1911
- te(this, Je, [
1912
- H(this, dt),
1913
- l ? `:${H(this, De)}` : ""
1914
- ].join("")), te(this, ve, o.pathname.replace(/\/+$/, "")), te(this, Qe, [
1915
- `${H(this, Ke)}://`,
1916
- H(this, Je),
1862
+ ie(this, ct, o.hostname), ie(this, je, o.port ? Number(o.port) : o.protocol === "https:" ? 443 : 80), ie(this, We, (o.protocol || "").replace(":", ""));
1863
+ const l = H(this, je) !== 443 && H(this, je) !== 80;
1864
+ ie(this, Be, [
1865
+ H(this, ct),
1866
+ l ? `:${H(this, je)}` : ""
1867
+ ].join("")), ie(this, ve, o.pathname.replace(/\/+$/, "")), ie(this, Ge, [
1868
+ `${H(this, We)}://`,
1869
+ H(this, Be),
1917
1870
  H(this, ve)
1918
1871
  ].join("")), this.rewriteRules = i;
1919
1872
  }
1920
- /** @inheritDoc */
1873
+ /**
1874
+ * Converts a path to an absolute URL based at the PHPRequestHandler
1875
+ * root.
1876
+ *
1877
+ * @param path The server path to convert to an absolute URL.
1878
+ * @returns The absolute URL.
1879
+ */
1921
1880
  pathToInternalUrl(t) {
1922
1881
  return `${this.absoluteUrl}${t}`;
1923
1882
  }
1924
- /** @inheritDoc */
1883
+ /**
1884
+ * Converts an absolute URL based at the PHPRequestHandler to a relative path
1885
+ * without the server pathname and scope.
1886
+ *
1887
+ * @param internalUrl An absolute URL based at the PHPRequestHandler root.
1888
+ * @returns The relative path.
1889
+ */
1925
1890
  internalUrlToPath(t) {
1926
1891
  const r = new URL(t);
1927
1892
  return r.pathname.startsWith(H(this, ve)) && (r.pathname = r.pathname.slice(H(this, ve).length)), toRelativeUrl(r);
1928
1893
  }
1929
1894
  get isRequestRunning() {
1930
- return H(this, Fe).running > 0;
1895
+ return H(this, Ae).running > 0;
1931
1896
  }
1932
- /** @inheritDoc */
1897
+ /**
1898
+ * The absolute URL of this PHPRequestHandler instance.
1899
+ */
1933
1900
  get absoluteUrl() {
1934
- return H(this, Qe);
1901
+ return H(this, Ge);
1935
1902
  }
1936
- /** @inheritDoc */
1903
+ /**
1904
+ * The directory in the PHP filesystem where the server will look
1905
+ * for the files to serve. Default: `/var/www`.
1906
+ */
1937
1907
  get documentRoot() {
1938
1908
  return H(this, Pe);
1939
1909
  }
1940
- /** @inheritDoc */
1910
+ /**
1911
+ * Serves the request – either by serving a static file, or by
1912
+ * dispatching it to the PHP runtime.
1913
+ *
1914
+ * The request() method mode behaves like a web server and only works if
1915
+ * the PHP was initialized with a `requestHandler` option (which the online version
1916
+ * of WordPress Playground does by default).
1917
+ *
1918
+ * In the request mode, you pass an object containing the request information
1919
+ * (method, headers, body, etc.) and the path to the PHP file to run:
1920
+ *
1921
+ * ```ts
1922
+ * const php = PHP.load('7.4', {
1923
+ * requestHandler: {
1924
+ * documentRoot: "/www"
1925
+ * }
1926
+ * })
1927
+ * php.writeFile("/www/index.php", `<?php echo file_get_contents("php://input");`);
1928
+ * const result = await php.request({
1929
+ * method: "GET",
1930
+ * headers: {
1931
+ * "Content-Type": "text/plain"
1932
+ * },
1933
+ * body: "Hello world!",
1934
+ * path: "/www/index.php"
1935
+ * });
1936
+ * // result.text === "Hello world!"
1937
+ * ```
1938
+ *
1939
+ * The `request()` method cannot be used in conjunction with `cli()`.
1940
+ *
1941
+ * @example
1942
+ * ```js
1943
+ * const output = await php.request({
1944
+ * method: 'GET',
1945
+ * url: '/index.php',
1946
+ * headers: {
1947
+ * 'X-foo': 'bar',
1948
+ * },
1949
+ * body: {
1950
+ * foo: 'bar',
1951
+ * },
1952
+ * });
1953
+ * console.log(output.stdout); // "Hello world!"
1954
+ * ```
1955
+ *
1956
+ * @param request - PHP Request data.
1957
+ */
1941
1958
  async request(t) {
1942
1959
  const r = t.url.startsWith("http://") || t.url.startsWith("https://"), n = new URL(
1943
1960
  // Remove the hash part of the URL as it's not meant for the server.
@@ -1950,10 +1967,10 @@ class PHPRequestHandler {
1950
1967
  ),
1951
1968
  this.rewriteRules
1952
1969
  ), i = joinPaths(H(this, Pe), s);
1953
- return seemsLikeAPHPRequestHandlerPath(i) ? await ce(this, _t, Wt).call(this, t, n) : ce(this, mt, xt).call(this, i);
1970
+ return seemsLikeAPHPRequestHandlerPath(i) ? await ce(this, ht, Bt).call(this, t, n) : ce(this, ft, Wt).call(this, i);
1954
1971
  }
1955
1972
  }
1956
- Pe = new WeakMap(), Ke = new WeakMap(), dt = new WeakMap(), De = new WeakMap(), Je = new WeakMap(), ve = new WeakMap(), Qe = new WeakMap(), Fe = new WeakMap(), mt = new WeakSet(), xt = function(t) {
1973
+ Pe = new WeakMap(), We = new WeakMap(), ct = new WeakMap(), je = new WeakMap(), Be = new WeakMap(), ve = new WeakMap(), Ge = new WeakMap(), Ae = new WeakMap(), Ke = new WeakMap(), ft = new WeakSet(), Wt = function(t) {
1957
1974
  if (!this.php.fileExists(t))
1958
1975
  return new PHPResponse(
1959
1976
  404,
@@ -1978,9 +1995,9 @@ Pe = new WeakMap(), Ke = new WeakMap(), dt = new WeakMap(), De = new WeakMap(),
1978
1995
  },
1979
1996
  r
1980
1997
  );
1981
- }, _t = new WeakSet(), Wt = async function(t, r) {
1998
+ }, ht = new WeakSet(), Bt = async function(t, r) {
1982
1999
  var s;
1983
- if (H(this, Fe).running > 0 && ((s = t.headers) == null ? void 0 : s["x-request-issuer"]) === "php")
2000
+ if (H(this, Ae).running > 0 && ((s = t.headers) == null ? void 0 : s["x-request-issuer"]) === "php")
1984
2001
  return console.warn(
1985
2002
  "Possible deadlock: Called request() before the previous request() have finished. PHP likely issued an HTTP call to itself. Normally this would lead to infinite waiting as Request 1 holds the lock that the Request 2 is waiting to acquire. That's not useful, so PHPRequestHandler will return error 502 instead."
1986
2003
  ), new PHPResponse(
@@ -1988,26 +2005,23 @@ Pe = new WeakMap(), Ke = new WeakMap(), dt = new WeakMap(), De = new WeakMap(),
1988
2005
  {},
1989
2006
  new TextEncoder().encode("502 Bad Gateway")
1990
2007
  );
1991
- const n = await H(this, Fe).acquire();
2008
+ const n = await H(this, Ae).acquire();
1992
2009
  try {
1993
- this.php.addServerGlobalEntry("REMOTE_ADDR", "127.0.0.1"), this.php.addServerGlobalEntry("DOCUMENT_ROOT", H(this, Pe)), this.php.addServerGlobalEntry(
1994
- "HTTPS",
1995
- H(this, Qe).startsWith("https://") ? "on" : ""
1996
- );
1997
2010
  let i = "GET";
1998
2011
  const o = {
1999
- host: H(this, Je),
2000
- ...normalizeHeaders(t.headers || {})
2012
+ host: H(this, Be),
2013
+ ...normalizeHeaders(t.headers || {}),
2014
+ cookie: H(this, Ke).getCookieRequestHeader()
2001
2015
  };
2002
2016
  let l = t.body;
2003
2017
  if (typeof l == "object" && !(l instanceof Uint8Array)) {
2004
2018
  i = "POST";
2005
- const { bytes: u, contentType: f } = await encodeAsMultipart(l);
2006
- l = u, o["content-type"] = f;
2019
+ const { bytes: u, contentType: p } = await encodeAsMultipart(l);
2020
+ l = u, o["content-type"] = p;
2007
2021
  }
2008
2022
  let d;
2009
2023
  try {
2010
- d = ce(this, $t, Bt).call(this, decodeURIComponent(r.pathname));
2024
+ d = ce(this, mt, Gt).call(this, decodeURIComponent(r.pathname));
2011
2025
  } catch {
2012
2026
  return new PHPResponse(
2013
2027
  404,
@@ -2015,21 +2029,36 @@ Pe = new WeakMap(), Ke = new WeakMap(), dt = new WeakMap(), De = new WeakMap(),
2015
2029
  new TextEncoder().encode("404 File not found")
2016
2030
  );
2017
2031
  }
2018
- return await this.php.run({
2019
- relativeUri: ensurePathPrefix(
2020
- toRelativeUrl(r),
2021
- H(this, ve)
2022
- ),
2023
- protocol: H(this, Ke),
2024
- method: t.method || i,
2025
- body: l,
2026
- scriptPath: d,
2027
- headers: o
2028
- });
2032
+ try {
2033
+ const u = await this.php.run({
2034
+ relativeUri: ensurePathPrefix(
2035
+ toRelativeUrl(r),
2036
+ H(this, ve)
2037
+ ),
2038
+ protocol: H(this, We),
2039
+ method: t.method || i,
2040
+ $_SERVER: {
2041
+ REMOTE_ADDR: "127.0.0.1",
2042
+ DOCUMENT_ROOT: H(this, Pe),
2043
+ HTTPS: H(this, Ge).startsWith("https://") ? "on" : ""
2044
+ },
2045
+ body: l,
2046
+ scriptPath: d,
2047
+ headers: o
2048
+ });
2049
+ return H(this, Ke).rememberCookiesFromResponseHeaders(
2050
+ u.headers
2051
+ ), u;
2052
+ } catch (u) {
2053
+ const p = u;
2054
+ if (p != null && p.response)
2055
+ return p.response;
2056
+ throw u;
2057
+ }
2029
2058
  } finally {
2030
2059
  n();
2031
2060
  }
2032
- }, $t = new WeakSet(), Bt = function(t) {
2061
+ }, mt = new WeakSet(), Gt = function(t) {
2033
2062
  let r = removePathPrefix(t, H(this, ve));
2034
2063
  r = applyRewriteRules(r, this.rewriteRules), r.includes(".php") ? r = r.split(".php")[0] + ".php" : this.php.isDir(`${H(this, Pe)}${r}`) ? (r.endsWith("/") || (r = `${r}/`), r = `${r}index.php`) : r = "/index.php";
2035
2064
  const n = `${H(this, Pe)}${r}`;
@@ -2073,6 +2102,38 @@ function inferMimeType(e) {
2073
2102
  case "txt":
2074
2103
  case "md":
2075
2104
  return "text/plain";
2105
+ case "pdf":
2106
+ return "application/pdf";
2107
+ case "webp":
2108
+ return "image/webp";
2109
+ case "mp3":
2110
+ return "audio/mpeg";
2111
+ case "mp4":
2112
+ return "video/mp4";
2113
+ case "csv":
2114
+ return "text/csv";
2115
+ case "xls":
2116
+ return "application/vnd.ms-excel";
2117
+ case "xlsx":
2118
+ return "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
2119
+ case "doc":
2120
+ return "application/msword";
2121
+ case "docx":
2122
+ return "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
2123
+ case "ppt":
2124
+ return "application/vnd.ms-powerpoint";
2125
+ case "pptx":
2126
+ return "application/vnd.openxmlformats-officedocument.presentationml.presentation";
2127
+ case "zip":
2128
+ return "application/zip";
2129
+ case "rar":
2130
+ return "application/x-rar-compressed";
2131
+ case "tar":
2132
+ return "application/x-tar";
2133
+ case "gz":
2134
+ return "application/gzip";
2135
+ case "7z":
2136
+ return "application/x-7z-compressed";
2076
2137
  default:
2077
2138
  return "application-octet-stream";
2078
2139
  }
@@ -2185,8 +2246,8 @@ function rethrowFileSystemError(e = "") {
2185
2246
  } catch (l) {
2186
2247
  const d = typeof l == "object" ? l == null ? void 0 : l.errno : null;
2187
2248
  if (d in FileErrorCodes) {
2188
- const u = FileErrorCodes[d], f = typeof o[0] == "string" ? o[0] : null, $ = f !== null ? e.replaceAll("{path}", f) : e;
2189
- throw new Error(`${$}: ${u}`, {
2249
+ const u = FileErrorCodes[d], p = typeof o[0] == "string" ? o[0] : null, g = p !== null ? e.replaceAll("{path}", p) : e;
2250
+ throw new Error(`${g}: ${u}`, {
2190
2251
  cause: l
2191
2252
  });
2192
2253
  }
@@ -2209,7 +2270,12 @@ var __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyD
2209
2270
  return n && s && __defProp(t, r, s), s;
2210
2271
  };
2211
2272
  const STRING = "string", NUMBER = "number", __private__dont__use = Symbol("__private__dont__use");
2212
- var Me, Ze, Ye, be, Re, Te, Ee, Xe, gt, Gt, yt, Kt, vt, Jt, wt, Qt, Pt, Zt, bt, Yt, Et, Xt, St, er, Rt, tr, Tt, rr, kt, nr, Ct, sr;
2273
+ class PHPExecutionFailureError extends Error {
2274
+ constructor(t, r, n) {
2275
+ super(t), this.response = r, this.source = n;
2276
+ }
2277
+ }
2278
+ var De, Je, Qe, be, Re, Ee, Ye, _t, Kt, gt, Jt, $t, Qt, yt, Yt, vt, Zt, wt, Xt, Pt, er, bt, tr, Et, rr, St, nr, Rt, sr, Tt, ir, kt, or, Ct, ar, Ot, cr;
2213
2279
  class BasePHP {
2214
2280
  /**
2215
2281
  * Initializes a PHP runtime.
@@ -2219,29 +2285,38 @@ class BasePHP {
2219
2285
  * @param serverOptions - Optional. Options for the PHPRequestHandler. If undefined, no request handler will be initialized.
2220
2286
  */
2221
2287
  constructor(e, t) {
2222
- Q(this, gt);
2223
- Q(this, yt);
2224
- Q(this, vt);
2225
- Q(this, wt);
2226
- Q(this, Pt);
2227
- Q(this, bt);
2228
- Q(this, Et);
2229
- Q(this, St);
2230
- Q(this, Rt);
2231
- Q(this, Tt);
2232
- Q(this, kt);
2233
- Q(this, Ct);
2234
- Q(this, Me, void 0);
2235
- Q(this, Ze, void 0);
2236
- Q(this, Ye, void 0);
2237
- Q(this, be, void 0);
2238
- Q(this, Re, void 0);
2239
- Q(this, Te, void 0);
2240
- Q(this, Ee, void 0);
2241
- Q(this, Xe, void 0);
2242
- te(this, Me, []), te(this, be, !1), te(this, Re, null), te(this, Te, {}), te(this, Ee, /* @__PURE__ */ new Map()), te(this, Xe, []), this.semaphore = new Semaphore({ concurrency: 1 }), e !== void 0 && this.initializeRuntime(e), t && (this.requestHandler = new PHPBrowser(
2243
- new PHPRequestHandler(this, t)
2244
- ));
2288
+ /**
2289
+ * Prepares the $_SERVER entries for the PHP runtime.
2290
+ *
2291
+ * @param defaults Default entries to include in $_SERVER.
2292
+ * @param headers HTTP headers to include in $_SERVER (as HTTP_ prefixed entries).
2293
+ * @param port HTTP port, used to determine infer $_SERVER['HTTPS'] value if none
2294
+ * was provided.
2295
+ * @returns Computed $_SERVER entries.
2296
+ */
2297
+ K(this, _t);
2298
+ K(this, gt);
2299
+ K(this, $t);
2300
+ K(this, yt);
2301
+ K(this, vt);
2302
+ K(this, wt);
2303
+ K(this, Pt);
2304
+ K(this, bt);
2305
+ K(this, Et);
2306
+ K(this, St);
2307
+ K(this, Rt);
2308
+ K(this, Tt);
2309
+ K(this, kt);
2310
+ K(this, Ct);
2311
+ K(this, Ot);
2312
+ K(this, De, void 0);
2313
+ K(this, Je, void 0);
2314
+ K(this, Qe, void 0);
2315
+ K(this, be, void 0);
2316
+ K(this, Re, void 0);
2317
+ K(this, Ee, void 0);
2318
+ K(this, Ye, void 0);
2319
+ ie(this, De, []), ie(this, be, !1), ie(this, Re, null), ie(this, Ee, /* @__PURE__ */ new Map()), ie(this, Ye, []), this.semaphore = new Semaphore({ concurrency: 1 }), e !== void 0 && this.initializeRuntime(e), t && (this.requestHandler = new PHPRequestHandler(this, t));
2245
2320
  }
2246
2321
  addEventListener(e, t) {
2247
2322
  H(this, Ee).has(e) || H(this, Ee).set(e, /* @__PURE__ */ new Set()), H(this, Ee).get(e).add(t);
@@ -2258,7 +2333,7 @@ class BasePHP {
2258
2333
  }
2259
2334
  /** @inheritDoc */
2260
2335
  async onMessage(e) {
2261
- H(this, Xe).push(e);
2336
+ H(this, Ye).push(e);
2262
2337
  }
2263
2338
  /** @inheritDoc */
2264
2339
  async setSpawnHandler(handler) {
@@ -2266,21 +2341,19 @@ class BasePHP {
2266
2341
  }
2267
2342
  /** @inheritDoc */
2268
2343
  get absoluteUrl() {
2269
- return this.requestHandler.requestHandler.absoluteUrl;
2344
+ return this.requestHandler.absoluteUrl;
2270
2345
  }
2271
2346
  /** @inheritDoc */
2272
2347
  get documentRoot() {
2273
- return this.requestHandler.requestHandler.documentRoot;
2348
+ return this.requestHandler.documentRoot;
2274
2349
  }
2275
2350
  /** @inheritDoc */
2276
2351
  pathToInternalUrl(e) {
2277
- return this.requestHandler.requestHandler.pathToInternalUrl(e);
2352
+ return this.requestHandler.pathToInternalUrl(e);
2278
2353
  }
2279
2354
  /** @inheritDoc */
2280
2355
  internalUrlToPath(e) {
2281
- return this.requestHandler.requestHandler.internalUrlToPath(
2282
- e
2283
- );
2356
+ return this.requestHandler.internalUrlToPath(e);
2284
2357
  }
2285
2358
  initializeRuntime(e) {
2286
2359
  if (this[__private__dont__use])
@@ -2289,13 +2362,13 @@ class BasePHP {
2289
2362
  if (!t)
2290
2363
  throw new Error("Invalid PHP runtime id.");
2291
2364
  this[__private__dont__use] = t, t.onMessage = async (r) => {
2292
- for (const n of H(this, Xe)) {
2365
+ for (const n of H(this, Ye)) {
2293
2366
  const s = await n(r);
2294
2367
  if (s)
2295
2368
  return s;
2296
2369
  }
2297
2370
  return "";
2298
- }, te(this, Re, improveWASMErrorReporting(t)), this.dispatchEvent({
2371
+ }, ie(this, Re, improveWASMErrorReporting(t)), this.dispatchEvent({
2299
2372
  type: "runtime.initialized"
2300
2373
  });
2301
2374
  }
@@ -2310,13 +2383,13 @@ class BasePHP {
2310
2383
  throw new Error(
2311
2384
  "Could not set SAPI name. This can only be done before the PHP WASM module is initialized.Did you already dispatch any requests?"
2312
2385
  );
2313
- te(this, Ye, e);
2386
+ ie(this, Qe, e);
2314
2387
  }
2315
2388
  /** @inheritDoc */
2316
2389
  setPhpIniPath(e) {
2317
2390
  if (H(this, be))
2318
2391
  throw new Error("Cannot set PHP ini path after calling run().");
2319
- te(this, Ze, e), this[__private__dont__use].ccall(
2392
+ ie(this, Je, e), this[__private__dont__use].ccall(
2320
2393
  "wasm_set_phpini_path",
2321
2394
  null,
2322
2395
  ["string"],
@@ -2327,42 +2400,47 @@ class BasePHP {
2327
2400
  setPhpIniEntry(e, t) {
2328
2401
  if (H(this, be))
2329
2402
  throw new Error("Cannot set PHP ini entries after calling run().");
2330
- H(this, Me).push([e, t]);
2403
+ H(this, De).push([e, t]);
2331
2404
  }
2332
2405
  /** @inheritDoc */
2333
2406
  chdir(e) {
2334
2407
  this[__private__dont__use].FS.chdir(e);
2335
2408
  }
2336
2409
  /** @inheritDoc */
2337
- async request(e, t) {
2410
+ async request(e) {
2338
2411
  if (!this.requestHandler)
2339
2412
  throw new Error("No request handler available.");
2340
- return this.requestHandler.request(e, t);
2413
+ return this.requestHandler.request(e);
2341
2414
  }
2342
2415
  /** @inheritDoc */
2343
2416
  async run(e) {
2344
2417
  const t = await this.semaphore.acquire();
2345
2418
  let r;
2346
2419
  try {
2347
- if (H(this, be) || (ce(this, gt, Gt).call(this), te(this, be, !0)), e.scriptPath && !this.fileExists(e.scriptPath))
2420
+ if (H(this, be) || (ce(this, gt, Jt).call(this), ie(this, be, !0)), e.scriptPath && !this.fileExists(e.scriptPath))
2348
2421
  throw new Error(
2349
2422
  `The script path "${e.scriptPath}" does not exist.`
2350
2423
  );
2351
- ce(this, St, er).call(this, e.scriptPath || ""), ce(this, vt, Jt).call(this, e.relativeUri || ""), ce(this, Pt, Zt).call(this, e.method || "GET");
2352
- const n = normalizeHeaders(e.headers || {}), s = n.host || "example.com:443";
2353
- ce(this, wt, Qt).call(this, s, e.protocol || "http"), ce(this, bt, Yt).call(this, n), e.body && (r = ce(this, Et, Xt).call(this, e.body)), typeof e.code == "string" && ce(this, kt, nr).call(this, " ?>" + e.code), ce(this, Rt, tr).call(this);
2354
- const i = e.env || {};
2355
- for (const l in i)
2356
- ce(this, Tt, rr).call(this, l, i[l]);
2357
- const o = await ce(this, Ct, sr).call(this);
2358
- if (o.exitCode !== 0) {
2359
- console.warn("PHP.run() output was:", o.text);
2360
- const l = new Error(
2361
- `PHP.run() failed with exit code ${o.exitCode} and the following output: ` + o.errors
2424
+ ce(this, Rt, sr).call(this, e.scriptPath || ""), ce(this, yt, Yt).call(this, e.relativeUri || ""), ce(this, bt, tr).call(this, e.method || "GET");
2425
+ const n = normalizeHeaders(e.headers || {}), s = n.host || "example.com:443", i = ce(this, Pt, er).call(this, s, e.protocol || "http");
2426
+ ce(this, vt, Zt).call(this, s), ce(this, wt, Xt).call(this, i), ce(this, Et, rr).call(this, n), e.body && (r = ce(this, St, nr).call(this, e.body)), typeof e.code == "string" && ce(this, Ct, ar).call(this, " ?>" + e.code);
2427
+ const o = ce(this, _t, Kt).call(this, e.$_SERVER, n, i);
2428
+ for (const u in o)
2429
+ ce(this, Tt, ir).call(this, u, o[u]);
2430
+ const l = e.env || {};
2431
+ for (const u in l)
2432
+ ce(this, kt, or).call(this, u, l[u]);
2433
+ const d = await ce(this, Ot, cr).call(this);
2434
+ if (d.exitCode !== 0) {
2435
+ console.warn("PHP.run() output was:", d.text);
2436
+ const u = new PHPExecutionFailureError(
2437
+ `PHP.run() failed with exit code ${d.exitCode} and the following output: ` + d.errors,
2438
+ d,
2439
+ "request"
2362
2440
  );
2363
- throw l.response = o, l.source = "request", console.error(l), l;
2441
+ throw console.error(u), u;
2364
2442
  }
2365
- return o;
2443
+ return d;
2366
2444
  } catch (n) {
2367
2445
  throw this.dispatchEvent({
2368
2446
  type: "request.error",
@@ -2380,9 +2458,6 @@ class BasePHP {
2380
2458
  }
2381
2459
  }
2382
2460
  }
2383
- addServerGlobalEntry(e, t) {
2384
- H(this, Te)[e] = t;
2385
- }
2386
2461
  defineConstant(e, t) {
2387
2462
  let r = {};
2388
2463
  try {
@@ -2470,17 +2545,18 @@ class BasePHP {
2470
2545
  * interrupting the operations of this PHP instance.
2471
2546
  *
2472
2547
  * @param runtime
2548
+ * @param cwd. Internal, the VFS path to recreate in the new runtime.
2549
+ * This arg is temporary and will be removed once BasePHP
2550
+ * is fully decoupled from the request handler and
2551
+ * accepts a constructor-level cwd argument.
2473
2552
  */
2474
- hotSwapPHPRuntime(e) {
2475
- const t = this[__private__dont__use].FS;
2553
+ hotSwapPHPRuntime(e, t) {
2554
+ const r = this[__private__dont__use].FS;
2476
2555
  try {
2477
2556
  this.exit();
2478
2557
  } catch {
2479
2558
  }
2480
- if (this.initializeRuntime(e), H(this, Ze) && this.setPhpIniPath(H(this, Ze)), H(this, Ye) && this.setSapiName(H(this, Ye)), this.requestHandler) {
2481
- const r = this.documentRoot;
2482
- copyFS(t, this[__private__dont__use].FS, r);
2483
- }
2559
+ this.initializeRuntime(e), H(this, Je) && this.setPhpIniPath(H(this, Je)), H(this, Qe) && this.setSapiName(H(this, Qe)), t && copyFS(r, this[__private__dont__use].FS, t);
2484
2560
  }
2485
2561
  exit(e = 0) {
2486
2562
  this.dispatchEvent({
@@ -2490,10 +2566,20 @@ class BasePHP {
2490
2566
  this[__private__dont__use]._exit(e);
2491
2567
  } catch {
2492
2568
  }
2493
- te(this, be, !1), te(this, Re, null), delete this[__private__dont__use].onMessage, delete this[__private__dont__use];
2569
+ ie(this, be, !1), ie(this, Re, null), delete this[__private__dont__use].onMessage, delete this[__private__dont__use];
2494
2570
  }
2495
2571
  }
2496
- Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(), Re = new WeakMap(), Te = new WeakMap(), Ee = new WeakMap(), Xe = new WeakMap(), gt = new WeakSet(), Gt = function() {
2572
+ De = new WeakMap(), Je = new WeakMap(), Qe = new WeakMap(), be = new WeakMap(), Re = new WeakMap(), Ee = new WeakMap(), Ye = new WeakMap(), _t = new WeakSet(), Kt = function(e, t, r) {
2573
+ const n = {
2574
+ ...e || {}
2575
+ };
2576
+ n.HTTPS = n.HTTPS || r === 443 ? "on" : "off";
2577
+ for (const s in t) {
2578
+ let i = "HTTP_";
2579
+ ["content-type", "content-length"].includes(s.toLowerCase()) && (i = ""), n[`${i}${s.toUpperCase().replace(/-/g, "_")}`] = t[s];
2580
+ }
2581
+ return n;
2582
+ }, gt = new WeakSet(), Jt = function() {
2497
2583
  if (this.setPhpIniEntry("auto_prepend_file", "/internal/consts.php"), this.fileExists("/internal/consts.php") || this.writeFile(
2498
2584
  "/internal/consts.php",
2499
2585
  `<?php
@@ -2505,8 +2591,8 @@ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
2505
2591
  }
2506
2592
  }
2507
2593
  }`
2508
- ), H(this, Me).length > 0) {
2509
- const e = H(this, Me).map(([t, r]) => `${t}=${r}`).join(`
2594
+ ), H(this, De).length > 0) {
2595
+ const e = H(this, De).map(([t, r]) => `${t}=${r}`).join(`
2510
2596
  `) + `
2511
2597
 
2512
2598
  `;
@@ -2518,7 +2604,7 @@ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
2518
2604
  );
2519
2605
  }
2520
2606
  this[__private__dont__use].ccall("php_wasm_init", null, [], []);
2521
- }, yt = new WeakSet(), Kt = function() {
2607
+ }, $t = new WeakSet(), Qt = function() {
2522
2608
  const e = "/internal/headers.json";
2523
2609
  if (!this.fileExists(e))
2524
2610
  throw new Error(
@@ -2535,7 +2621,7 @@ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
2535
2621
  headers: r,
2536
2622
  httpStatusCode: t.status
2537
2623
  };
2538
- }, vt = new WeakSet(), Jt = function(e) {
2624
+ }, yt = new WeakSet(), Yt = function(e) {
2539
2625
  if (this[__private__dont__use].ccall(
2540
2626
  "wasm_set_request_uri",
2541
2627
  null,
@@ -2550,32 +2636,35 @@ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
2550
2636
  [t]
2551
2637
  );
2552
2638
  }
2553
- }, wt = new WeakSet(), Qt = function(e, t) {
2639
+ }, vt = new WeakSet(), Zt = function(e) {
2554
2640
  this[__private__dont__use].ccall(
2555
2641
  "wasm_set_request_host",
2556
2642
  null,
2557
2643
  [STRING],
2558
2644
  [e]
2559
2645
  );
2646
+ }, wt = new WeakSet(), Xt = function(e) {
2647
+ this[__private__dont__use].ccall(
2648
+ "wasm_set_request_port",
2649
+ null,
2650
+ [NUMBER],
2651
+ [e]
2652
+ );
2653
+ }, Pt = new WeakSet(), er = function(e, t) {
2560
2654
  let r;
2561
2655
  try {
2562
2656
  r = parseInt(new URL(e).port, 10);
2563
2657
  } catch {
2564
2658
  }
2565
- (!r || isNaN(r) || r === 80) && (r = t === "https" ? 443 : 80), this[__private__dont__use].ccall(
2566
- "wasm_set_request_port",
2567
- null,
2568
- [NUMBER],
2569
- [r]
2570
- ), (t === "https" || !t && r === 443) && this.addServerGlobalEntry("HTTPS", "on");
2571
- }, Pt = new WeakSet(), Zt = function(e) {
2659
+ return (!r || isNaN(r) || r === 80) && (r = t === "https" ? 443 : 80), r;
2660
+ }, bt = new WeakSet(), tr = function(e) {
2572
2661
  this[__private__dont__use].ccall(
2573
2662
  "wasm_set_request_method",
2574
2663
  null,
2575
2664
  [STRING],
2576
2665
  [e]
2577
2666
  );
2578
- }, bt = new WeakSet(), Yt = function(e) {
2667
+ }, Et = new WeakSet(), rr = function(e) {
2579
2668
  e.cookie && this[__private__dont__use].ccall(
2580
2669
  "wasm_set_cookies",
2581
2670
  null,
@@ -2592,14 +2681,7 @@ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
2592
2681
  [NUMBER],
2593
2682
  [parseInt(e["content-length"], 10)]
2594
2683
  );
2595
- for (const t in e) {
2596
- let r = "HTTP_";
2597
- ["content-type", "content-length"].includes(t.toLowerCase()) && (r = ""), this.addServerGlobalEntry(
2598
- `${r}${t.toUpperCase().replace(/-/g, "_")}`,
2599
- e[t]
2600
- );
2601
- }
2602
- }, Et = new WeakSet(), Xt = function(e) {
2684
+ }, St = new WeakSet(), nr = function(e) {
2603
2685
  let t, r;
2604
2686
  typeof e == "string" ? (console.warn(
2605
2687
  "Passing a string as the request body is deprecated. Please use a Uint8Array instead. See https://github.com/WordPress/wordpress-playground/issues/997 for more details"
@@ -2622,36 +2704,35 @@ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
2622
2704
  [NUMBER],
2623
2705
  [r]
2624
2706
  ), n;
2625
- }, St = new WeakSet(), er = function(e) {
2707
+ }, Rt = new WeakSet(), sr = function(e) {
2626
2708
  this[__private__dont__use].ccall(
2627
2709
  "wasm_set_path_translated",
2628
2710
  null,
2629
2711
  [STRING],
2630
2712
  [e]
2631
2713
  );
2632
- }, Rt = new WeakSet(), tr = function() {
2633
- for (const e in H(this, Te))
2634
- this[__private__dont__use].ccall(
2635
- "wasm_add_SERVER_entry",
2636
- null,
2637
- [STRING, STRING],
2638
- [e, H(this, Te)[e]]
2639
- );
2640
- }, Tt = new WeakSet(), rr = function(e, t) {
2714
+ }, Tt = new WeakSet(), ir = function(e, t) {
2715
+ this[__private__dont__use].ccall(
2716
+ "wasm_add_SERVER_entry",
2717
+ null,
2718
+ [STRING, STRING],
2719
+ [e, t]
2720
+ );
2721
+ }, kt = new WeakSet(), or = function(e, t) {
2641
2722
  this[__private__dont__use].ccall(
2642
2723
  "wasm_add_ENV_entry",
2643
2724
  null,
2644
2725
  [STRING, STRING],
2645
2726
  [e, t]
2646
2727
  );
2647
- }, kt = new WeakSet(), nr = function(e) {
2728
+ }, Ct = new WeakSet(), ar = function(e) {
2648
2729
  this[__private__dont__use].ccall(
2649
2730
  "wasm_set_php_code",
2650
2731
  null,
2651
2732
  [STRING],
2652
2733
  [e]
2653
2734
  );
2654
- }, Ct = new WeakSet(), sr = async function() {
2735
+ }, Ot = new WeakSet(), cr = async function() {
2655
2736
  var s;
2656
2737
  let e, t;
2657
2738
  try {
@@ -2659,8 +2740,8 @@ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
2659
2740
  var d;
2660
2741
  t = (u) => {
2661
2742
  console.error(u), console.error(u.error);
2662
- const f = new Error("Rethrown");
2663
- f.cause = u.error, f.betterMessage = u.message, o(f);
2743
+ const p = new Error("Rethrown");
2744
+ p.cause = u.error, p.betterMessage = u.message, o(p);
2664
2745
  }, (d = H(this, Re)) == null || d.addEventListener(
2665
2746
  "error",
2666
2747
  t
@@ -2685,11 +2766,11 @@ Me = new WeakMap(), Ze = new WeakMap(), Ye = new WeakMap(), be = new WeakMap(),
2685
2766
  const o = i, l = "betterMessage" in o ? o.betterMessage : o.message, d = new Error(l);
2686
2767
  throw d.cause = o, console.error(d), d;
2687
2768
  } finally {
2688
- (s = H(this, Re)) == null || s.removeEventListener("error", t), te(this, Te, {});
2769
+ (s = H(this, Re)) == null || s.removeEventListener("error", t);
2689
2770
  }
2690
- const { headers: r, httpStatusCode: n } = ce(this, yt, Kt).call(this);
2771
+ const { headers: r, httpStatusCode: n } = ce(this, $t, Qt).call(this);
2691
2772
  return new PHPResponse(
2692
- n,
2773
+ e === 0 ? n : 500,
2693
2774
  r,
2694
2775
  this.readFileAsBuffer("/internal/stdout"),
2695
2776
  this.readFileAsText("/internal/stderr"),
@@ -2851,16 +2932,52 @@ class FetchResource extends Resource {
2851
2932
  }
2852
2933
  /** @inheritDoc */
2853
2934
  async resolve() {
2854
- var n, s;
2855
- (n = this.progress) == null || n.setCaption(this.caption);
2935
+ var r, n;
2936
+ (r = this.progress) == null || r.setCaption(this.caption);
2856
2937
  const t = this.getURL();
2857
- let r = await fetch(t);
2858
- if (r = await cloneResponseMonitorProgress(
2859
- r,
2860
- ((s = this.progress) == null ? void 0 : s.loadingListener) ?? noop
2861
- ), r.status !== 200)
2862
- throw new Error(`Could not download "${t}"`);
2863
- return new File([await r.blob()], this.name);
2938
+ try {
2939
+ let s = await fetch(t);
2940
+ if (!s.ok)
2941
+ throw new Error(`Could not download "${t}"`);
2942
+ if (s = await cloneResponseMonitorProgress(
2943
+ s,
2944
+ ((n = this.progress) == null ? void 0 : n.loadingListener) ?? noop
2945
+ ), s.status !== 200)
2946
+ throw new Error(`Could not download "${t}"`);
2947
+ return new File([await s.blob()], this.name);
2948
+ } catch (s) {
2949
+ throw new Error(
2950
+ `Could not download "${t}".
2951
+ Check if the URL is correct and the server is reachable.
2952
+ If the url is reachable, the server might be blocking the request.
2953
+ Check the console and network for more information.
2954
+
2955
+ ## Does the console shows an error about "No 'Access-Control-Allow-Origin' header"?
2956
+
2957
+ This means the server where your file is hosted does not allow requests from other sites
2958
+ (cross-origin requests, or CORS). You will need to move it to another server that allows
2959
+ cross-origin file downloads. You can learn more about CORS at
2960
+ https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS.
2961
+
2962
+ If you're loading a file from https://github.com/, there's an easy fix – you can load it from
2963
+ raw.githubusercontent.com instead. Here's how to do that:
2964
+
2965
+ 1. Start with the original GitHub URL for the file. For example:
2966
+ '''
2967
+ https://github.com/username/repository/blob/branch/filename
2968
+ '''
2969
+ 2. Replace 'github.com' with 'raw.githubusercontent.com'.
2970
+ 3. Remove the '/blob/' part of the URL.
2971
+
2972
+ The resulting URL should look like this:
2973
+ '''
2974
+ https://raw.githubusercontent.com/username/repository/branch/filename
2975
+ '''
2976
+
2977
+ Error:
2978
+ ${s}`
2979
+ );
2980
+ }
2864
2981
  }
2865
2982
  /**
2866
2983
  * Gets the caption for the progress tracker.
@@ -2984,10 +3101,10 @@ var ajv$1 = { exports: {} }, core$2 = {}, validate = {}, boolSchema = {}, errors
2984
3101
  }
2985
3102
  e._CodeOrName = t, e.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
2986
3103
  class r extends t {
2987
- constructor(g) {
2988
- if (super(), !e.IDENTIFIER.test(g))
3104
+ constructor($) {
3105
+ if (super(), !e.IDENTIFIER.test($))
2989
3106
  throw new Error("CodeGen: name must be a valid identifier");
2990
- this.str = g;
3107
+ this.str = $;
2991
3108
  }
2992
3109
  toString() {
2993
3110
  return this.str;
@@ -3001,8 +3118,8 @@ var ajv$1 = { exports: {} }, core$2 = {}, validate = {}, boolSchema = {}, errors
3001
3118
  }
3002
3119
  e.Name = r;
3003
3120
  class n extends t {
3004
- constructor(g) {
3005
- super(), this._items = typeof g == "string" ? [g] : g;
3121
+ constructor($) {
3122
+ super(), this._items = typeof $ == "string" ? [$] : $;
3006
3123
  }
3007
3124
  toString() {
3008
3125
  return this.str;
@@ -3010,69 +3127,69 @@ var ajv$1 = { exports: {} }, core$2 = {}, validate = {}, boolSchema = {}, errors
3010
3127
  emptyStr() {
3011
3128
  if (this._items.length > 1)
3012
3129
  return !1;
3013
- const g = this._items[0];
3014
- return g === "" || g === '""';
3130
+ const $ = this._items[0];
3131
+ return $ === "" || $ === '""';
3015
3132
  }
3016
3133
  get str() {
3017
- var g;
3018
- return (g = this._str) !== null && g !== void 0 ? g : this._str = this._items.reduce((P, I) => `${P}${I}`, "");
3134
+ var $;
3135
+ return ($ = this._str) !== null && $ !== void 0 ? $ : this._str = this._items.reduce((P, I) => `${P}${I}`, "");
3019
3136
  }
3020
3137
  get names() {
3021
- var g;
3022
- return (g = this._names) !== null && g !== void 0 ? g : this._names = this._items.reduce((P, I) => (I instanceof r && (P[I.str] = (P[I.str] || 0) + 1), P), {});
3138
+ var $;
3139
+ return ($ = this._names) !== null && $ !== void 0 ? $ : this._names = this._items.reduce((P, I) => (I instanceof r && (P[I.str] = (P[I.str] || 0) + 1), P), {});
3023
3140
  }
3024
3141
  }
3025
3142
  e._Code = n, e.nil = new n("");
3026
- function s(_, ...g) {
3143
+ function s(_, ...$) {
3027
3144
  const P = [_[0]];
3028
3145
  let I = 0;
3029
- for (; I < g.length; )
3030
- l(P, g[I]), P.push(_[++I]);
3146
+ for (; I < $.length; )
3147
+ l(P, $[I]), P.push(_[++I]);
3031
3148
  return new n(P);
3032
3149
  }
3033
3150
  e._ = s;
3034
3151
  const i = new n("+");
3035
- function o(_, ...g) {
3152
+ function o(_, ...$) {
3036
3153
  const P = [C(_[0])];
3037
3154
  let I = 0;
3038
- for (; I < g.length; )
3039
- P.push(i), l(P, g[I]), P.push(i, C(_[++I]));
3155
+ for (; I < $.length; )
3156
+ P.push(i), l(P, $[I]), P.push(i, C(_[++I]));
3040
3157
  return d(P), new n(P);
3041
3158
  }
3042
3159
  e.str = o;
3043
- function l(_, g) {
3044
- g instanceof n ? _.push(...g._items) : g instanceof r ? _.push(g) : _.push($(g));
3160
+ function l(_, $) {
3161
+ $ instanceof n ? _.push(...$._items) : $ instanceof r ? _.push($) : _.push(g($));
3045
3162
  }
3046
3163
  e.addCodeArg = l;
3047
3164
  function d(_) {
3048
- let g = 1;
3049
- for (; g < _.length - 1; ) {
3050
- if (_[g] === i) {
3051
- const P = u(_[g - 1], _[g + 1]);
3165
+ let $ = 1;
3166
+ for (; $ < _.length - 1; ) {
3167
+ if (_[$] === i) {
3168
+ const P = u(_[$ - 1], _[$ + 1]);
3052
3169
  if (P !== void 0) {
3053
- _.splice(g - 1, 3, P);
3170
+ _.splice($ - 1, 3, P);
3054
3171
  continue;
3055
3172
  }
3056
- _[g++] = "+";
3173
+ _[$++] = "+";
3057
3174
  }
3058
- g++;
3175
+ $++;
3059
3176
  }
3060
3177
  }
3061
- function u(_, g) {
3062
- if (g === '""')
3178
+ function u(_, $) {
3179
+ if ($ === '""')
3063
3180
  return _;
3064
3181
  if (_ === '""')
3065
- return g;
3182
+ return $;
3066
3183
  if (typeof _ == "string")
3067
- return g instanceof r || _[_.length - 1] !== '"' ? void 0 : typeof g != "string" ? `${_.slice(0, -1)}${g}"` : g[0] === '"' ? _.slice(0, -1) + g.slice(1) : void 0;
3068
- if (typeof g == "string" && g[0] === '"' && !(_ instanceof r))
3069
- return `"${_}${g.slice(1)}`;
3184
+ return $ instanceof r || _[_.length - 1] !== '"' ? void 0 : typeof $ != "string" ? `${_.slice(0, -1)}${$}"` : $[0] === '"' ? _.slice(0, -1) + $.slice(1) : void 0;
3185
+ if (typeof $ == "string" && $[0] === '"' && !(_ instanceof r))
3186
+ return `"${_}${$.slice(1)}`;
3070
3187
  }
3071
- function f(_, g) {
3072
- return g.emptyStr() ? _ : _.emptyStr() ? g : o`${_}${g}`;
3188
+ function p(_, $) {
3189
+ return $.emptyStr() ? _ : _.emptyStr() ? $ : o`${_}${$}`;
3073
3190
  }
3074
- e.strConcat = f;
3075
- function $(_) {
3191
+ e.strConcat = p;
3192
+ function g(_) {
3076
3193
  return typeof _ == "number" || typeof _ == "boolean" || _ === null ? _ : C(Array.isArray(_) ? _.join(",") : _);
3077
3194
  }
3078
3195
  function O(_) {
@@ -3116,8 +3233,8 @@ var scope = {};
3116
3233
  var: new t.Name("var")
3117
3234
  };
3118
3235
  class s {
3119
- constructor({ prefixes: u, parent: f } = {}) {
3120
- this._names = {}, this._prefixes = u, this._parent = f;
3236
+ constructor({ prefixes: u, parent: p } = {}) {
3237
+ this._names = {}, this._prefixes = u, this._parent = p;
3121
3238
  }
3122
3239
  toName(u) {
3123
3240
  return u instanceof t.Name ? u : this.name(u);
@@ -3126,23 +3243,23 @@ var scope = {};
3126
3243
  return new t.Name(this._newName(u));
3127
3244
  }
3128
3245
  _newName(u) {
3129
- const f = this._names[u] || this._nameGroup(u);
3130
- return `${u}${f.index++}`;
3246
+ const p = this._names[u] || this._nameGroup(u);
3247
+ return `${u}${p.index++}`;
3131
3248
  }
3132
3249
  _nameGroup(u) {
3133
- var f, $;
3134
- if (!(($ = (f = this._parent) === null || f === void 0 ? void 0 : f._prefixes) === null || $ === void 0) && $.has(u) || this._prefixes && !this._prefixes.has(u))
3250
+ var p, g;
3251
+ if (!((g = (p = this._parent) === null || p === void 0 ? void 0 : p._prefixes) === null || g === void 0) && g.has(u) || this._prefixes && !this._prefixes.has(u))
3135
3252
  throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);
3136
3253
  return this._names[u] = { prefix: u, index: 0 };
3137
3254
  }
3138
3255
  }
3139
3256
  e.Scope = s;
3140
3257
  class i extends t.Name {
3141
- constructor(u, f) {
3142
- super(f), this.prefix = u;
3258
+ constructor(u, p) {
3259
+ super(p), this.prefix = u;
3143
3260
  }
3144
- setValue(u, { property: f, itemIndex: $ }) {
3145
- this.value = u, this.scopePath = (0, t._)`.${new t.Name(f)}[${$}]`;
3261
+ setValue(u, { property: p, itemIndex: g }) {
3262
+ this.value = u, this.scopePath = (0, t._)`.${new t.Name(p)}[${g}]`;
3146
3263
  }
3147
3264
  }
3148
3265
  e.ValueScopeName = i;
@@ -3157,58 +3274,58 @@ var scope = {};
3157
3274
  name(u) {
3158
3275
  return new i(u, this._newName(u));
3159
3276
  }
3160
- value(u, f) {
3161
- var $;
3162
- if (f.ref === void 0)
3277
+ value(u, p) {
3278
+ var g;
3279
+ if (p.ref === void 0)
3163
3280
  throw new Error("CodeGen: ref must be passed in value");
3164
- const O = this.toName(u), { prefix: C } = O, S = ($ = f.key) !== null && $ !== void 0 ? $ : f.ref;
3281
+ const O = this.toName(u), { prefix: C } = O, S = (g = p.key) !== null && g !== void 0 ? g : p.ref;
3165
3282
  let T = this._values[C];
3166
3283
  if (T) {
3167
- const g = T.get(S);
3168
- if (g)
3169
- return g;
3284
+ const $ = T.get(S);
3285
+ if ($)
3286
+ return $;
3170
3287
  } else
3171
3288
  T = this._values[C] = /* @__PURE__ */ new Map();
3172
3289
  T.set(S, O);
3173
3290
  const y = this._scope[C] || (this._scope[C] = []), _ = y.length;
3174
- return y[_] = f.ref, O.setValue(f, { property: C, itemIndex: _ }), O;
3175
- }
3176
- getValue(u, f) {
3177
- const $ = this._values[u];
3178
- if ($)
3179
- return $.get(f);
3180
- }
3181
- scopeRefs(u, f = this._values) {
3182
- return this._reduceValues(f, ($) => {
3183
- if ($.scopePath === void 0)
3184
- throw new Error(`CodeGen: name "${$}" has no value`);
3185
- return (0, t._)`${u}${$.scopePath}`;
3291
+ return y[_] = p.ref, O.setValue(p, { property: C, itemIndex: _ }), O;
3292
+ }
3293
+ getValue(u, p) {
3294
+ const g = this._values[u];
3295
+ if (g)
3296
+ return g.get(p);
3297
+ }
3298
+ scopeRefs(u, p = this._values) {
3299
+ return this._reduceValues(p, (g) => {
3300
+ if (g.scopePath === void 0)
3301
+ throw new Error(`CodeGen: name "${g}" has no value`);
3302
+ return (0, t._)`${u}${g.scopePath}`;
3186
3303
  });
3187
3304
  }
3188
- scopeCode(u = this._values, f, $) {
3305
+ scopeCode(u = this._values, p, g) {
3189
3306
  return this._reduceValues(u, (O) => {
3190
3307
  if (O.value === void 0)
3191
3308
  throw new Error(`CodeGen: name "${O}" has no value`);
3192
3309
  return O.value.code;
3193
- }, f, $);
3310
+ }, p, g);
3194
3311
  }
3195
- _reduceValues(u, f, $ = {}, O) {
3312
+ _reduceValues(u, p, g = {}, O) {
3196
3313
  let C = t.nil;
3197
3314
  for (const S in u) {
3198
3315
  const T = u[S];
3199
3316
  if (!T)
3200
3317
  continue;
3201
- const y = $[S] = $[S] || /* @__PURE__ */ new Map();
3318
+ const y = g[S] = g[S] || /* @__PURE__ */ new Map();
3202
3319
  T.forEach((_) => {
3203
3320
  if (y.has(_))
3204
3321
  return;
3205
3322
  y.set(_, n.Started);
3206
- let g = f(_);
3207
- if (g) {
3323
+ let $ = p(_);
3324
+ if ($) {
3208
3325
  const P = this.opts.es5 ? e.varKinds.var : e.varKinds.const;
3209
- C = (0, t._)`${C}${P} ${_} = ${g};${this.opts._n}`;
3210
- } else if (g = O == null ? void 0 : O(_))
3211
- C = (0, t._)`${C}${g}${this.opts._n}`;
3326
+ C = (0, t._)`${C}${P} ${_} = ${$};${this.opts._n}`;
3327
+ } else if ($ = O == null ? void 0 : O(_))
3328
+ C = (0, t._)`${C}${$}${this.opts._n}`;
3212
3329
  else
3213
3330
  throw new r(_);
3214
3331
  y.set(_, n.Completed);
@@ -3317,7 +3434,7 @@ var scope = {};
3317
3434
  return `${this.label}:` + a;
3318
3435
  }
3319
3436
  }
3320
- class f extends i {
3437
+ class p extends i {
3321
3438
  constructor(a) {
3322
3439
  super(), this.label = a, this.names = {};
3323
3440
  }
@@ -3325,7 +3442,7 @@ var scope = {};
3325
3442
  return `break${this.label ? ` ${this.label}` : ""};` + a;
3326
3443
  }
3327
3444
  }
3328
- class $ extends i {
3445
+ class g extends i {
3329
3446
  constructor(a) {
3330
3447
  super(), this.error = a;
3331
3448
  }
@@ -3374,12 +3491,12 @@ var scope = {};
3374
3491
  let M = N.length;
3375
3492
  for (; M--; ) {
3376
3493
  const q = N[M];
3377
- q.optimizeNames(a, h) || (ke(a, q.names), N.splice(M, 1));
3494
+ q.optimizeNames(a, h) || (Te(a, q.names), N.splice(M, 1));
3378
3495
  }
3379
3496
  return N.length > 0 ? this : void 0;
3380
3497
  }
3381
3498
  get names() {
3382
- return this.nodes.reduce((a, h) => K(a, h.names), {});
3499
+ return this.nodes.reduce((a, h) => J(a, h.names), {});
3383
3500
  }
3384
3501
  }
3385
3502
  class S extends C {
@@ -3411,7 +3528,7 @@ var scope = {};
3411
3528
  h = this.else = Array.isArray(N) ? new y(N) : N;
3412
3529
  }
3413
3530
  if (h)
3414
- return a === !1 ? h instanceof _ ? h : h.nodes : this.nodes.length ? this : new _(Ce(a), h instanceof _ ? [h] : h.nodes);
3531
+ return a === !1 ? h instanceof _ ? h : h.nodes : this.nodes.length ? this : new _(ke(a), h instanceof _ ? [h] : h.nodes);
3415
3532
  if (!(a === !1 || !this.nodes.length))
3416
3533
  return this;
3417
3534
  }
@@ -3422,14 +3539,14 @@ var scope = {};
3422
3539
  }
3423
3540
  get names() {
3424
3541
  const a = super.names;
3425
- return ue(a, this.condition), this.else && K(a, this.else.names), a;
3542
+ return ue(a, this.condition), this.else && J(a, this.else.names), a;
3426
3543
  }
3427
3544
  }
3428
3545
  _.kind = "if";
3429
- class g extends S {
3546
+ class $ extends S {
3430
3547
  }
3431
- g.kind = "for";
3432
- class P extends g {
3548
+ $.kind = "for";
3549
+ class P extends $ {
3433
3550
  constructor(a) {
3434
3551
  super(), this.iteration = a;
3435
3552
  }
@@ -3441,10 +3558,10 @@ var scope = {};
3441
3558
  return this.iteration = oe(this.iteration, a, h), this;
3442
3559
  }
3443
3560
  get names() {
3444
- return K(super.names, this.iteration.names);
3561
+ return J(super.names, this.iteration.names);
3445
3562
  }
3446
3563
  }
3447
- class I extends g {
3564
+ class I extends $ {
3448
3565
  constructor(a, h, N, M) {
3449
3566
  super(), this.varKind = a, this.name = h, this.from = N, this.to = M;
3450
3567
  }
@@ -3457,7 +3574,7 @@ var scope = {};
3457
3574
  return ue(a, this.to);
3458
3575
  }
3459
3576
  }
3460
- class D extends g {
3577
+ class D extends $ {
3461
3578
  constructor(a, h, N, M) {
3462
3579
  super(), this.loop = a, this.varKind = h, this.name = N, this.iterable = M;
3463
3580
  }
@@ -3469,7 +3586,7 @@ var scope = {};
3469
3586
  return this.iterable = oe(this.iterable, a, h), this;
3470
3587
  }
3471
3588
  get names() {
3472
- return K(super.names, this.iterable.names);
3589
+ return J(super.names, this.iterable.names);
3473
3590
  }
3474
3591
  }
3475
3592
  class w extends S {
@@ -3502,7 +3619,7 @@ var scope = {};
3502
3619
  }
3503
3620
  get names() {
3504
3621
  const a = super.names;
3505
- return this.catch && K(a, this.catch.names), this.finally && K(a, this.finally.names), a;
3622
+ return this.catch && J(a, this.catch.names), this.finally && J(a, this.finally.names), a;
3506
3623
  }
3507
3624
  }
3508
3625
  class V extends S {
@@ -3520,7 +3637,7 @@ var scope = {};
3520
3637
  }
3521
3638
  }
3522
3639
  x.kind = "finally";
3523
- class re {
3640
+ class te {
3524
3641
  constructor(a, h = {}) {
3525
3642
  this._values = {}, this._blockStarts = [], this._constants = {}, this.opts = { ...h, _n: h.lines ? `
3526
3643
  ` : "" }, this._extScope = a, this._scope = new r.Scope({ parent: a }), this._nodes = [new T()];
@@ -3642,7 +3759,7 @@ var scope = {};
3642
3759
  }
3643
3760
  // end `for` loop
3644
3761
  endFor() {
3645
- return this._endBlockNode(g);
3762
+ return this._endBlockNode($);
3646
3763
  }
3647
3764
  // `label` statement
3648
3765
  label(a) {
@@ -3650,7 +3767,7 @@ var scope = {};
3650
3767
  }
3651
3768
  // `break` statement
3652
3769
  break(a) {
3653
- return this._leafNode(new f(a));
3770
+ return this._leafNode(new p(a));
3654
3771
  }
3655
3772
  // `return` statement
3656
3773
  return(a) {
@@ -3672,7 +3789,7 @@ var scope = {};
3672
3789
  }
3673
3790
  // `throw` statement
3674
3791
  throw(a) {
3675
- return this._leafNode(new $(a));
3792
+ return this._leafNode(new g(a));
3676
3793
  }
3677
3794
  // start self-balancing block
3678
3795
  block(a, h) {
@@ -3730,14 +3847,14 @@ var scope = {};
3730
3847
  h[h.length - 1] = a;
3731
3848
  }
3732
3849
  }
3733
- e.CodeGen = re;
3734
- function K(b, a) {
3850
+ e.CodeGen = te;
3851
+ function J(b, a) {
3735
3852
  for (const h in a)
3736
3853
  b[h] = (b[h] || 0) + (a[h] || 0);
3737
3854
  return b;
3738
3855
  }
3739
3856
  function ue(b, a) {
3740
- return a instanceof t._CodeOrName ? K(b, a.names) : b;
3857
+ return a instanceof t._CodeOrName ? J(b, a.names) : b;
3741
3858
  }
3742
3859
  function oe(b, a, h) {
3743
3860
  if (b instanceof t.Name)
@@ -3753,22 +3870,22 @@ var scope = {};
3753
3870
  return q instanceof t._Code && q._items.some((W) => W instanceof t.Name && a[W.str] === 1 && h[W.str] !== void 0);
3754
3871
  }
3755
3872
  }
3756
- function ke(b, a) {
3873
+ function Te(b, a) {
3757
3874
  for (const h in a)
3758
3875
  b[h] = (b[h] || 0) - (a[h] || 0);
3759
3876
  }
3760
- function Ce(b) {
3877
+ function ke(b) {
3761
3878
  return typeof b == "boolean" || typeof b == "number" || b === null ? !b : (0, t._)`!${j(b)}`;
3762
3879
  }
3763
- e.not = Ce;
3764
- const qe = v(e.operators.AND);
3765
- function et(...b) {
3766
- return b.reduce(qe);
3880
+ e.not = ke;
3881
+ const Fe = v(e.operators.AND);
3882
+ function Ze(...b) {
3883
+ return b.reduce(Fe);
3767
3884
  }
3768
- e.and = et;
3769
- const Ue = v(e.operators.OR);
3885
+ e.and = Ze;
3886
+ const Me = v(e.operators.OR);
3770
3887
  function F(...b) {
3771
- return b.reduce(Ue);
3888
+ return b.reduce(Me);
3772
3889
  }
3773
3890
  e.or = F;
3774
3891
  function v(b) {
@@ -3798,8 +3915,8 @@ var util = {};
3798
3915
  if (!A.strictSchema || typeof k == "boolean")
3799
3916
  return;
3800
3917
  const x = V.RULES.keywords;
3801
- for (const re in k)
3802
- x[re] || D(w, `unknown keyword: "${re}"`);
3918
+ for (const te in k)
3919
+ x[te] || D(w, `unknown keyword: "${te}"`);
3803
3920
  }
3804
3921
  e.checkUnknownRules = i;
3805
3922
  function o(w, k) {
@@ -3834,14 +3951,14 @@ var util = {};
3834
3951
  return O(decodeURIComponent(w));
3835
3952
  }
3836
3953
  e.unescapeFragment = u;
3837
- function f(w) {
3838
- return encodeURIComponent($(w));
3954
+ function p(w) {
3955
+ return encodeURIComponent(g(w));
3839
3956
  }
3840
- e.escapeFragment = f;
3841
- function $(w) {
3957
+ e.escapeFragment = p;
3958
+ function g(w) {
3842
3959
  return typeof w == "number" ? `${w}` : w.replace(/~/g, "~0").replace(/\//g, "~1");
3843
3960
  }
3844
- e.escapeJsonPointer = $;
3961
+ e.escapeJsonPointer = g;
3845
3962
  function O(w) {
3846
3963
  return w.replace(/~1/g, "/").replace(/~0/g, "~");
3847
3964
  }
@@ -3855,8 +3972,8 @@ var util = {};
3855
3972
  }
3856
3973
  e.eachItem = C;
3857
3974
  function S({ mergeNames: w, mergeToName: k, mergeValues: A, resultToName: V }) {
3858
- return (x, re, K, ue) => {
3859
- const oe = K === void 0 ? re : K instanceof t.Name ? (re instanceof t.Name ? w(x, re, K) : k(x, re, K), K) : re instanceof t.Name ? (k(x, K, re), re) : A(re, K);
3975
+ return (x, te, J, ue) => {
3976
+ const oe = J === void 0 ? te : J instanceof t.Name ? (te instanceof t.Name ? w(x, te, J) : k(x, te, J), J) : te instanceof t.Name ? (k(x, J, te), te) : A(te, J);
3860
3977
  return ue === t.Name && !(oe instanceof t.Name) ? V(x, oe) : oe;
3861
3978
  };
3862
3979
  }
@@ -3890,13 +4007,13 @@ var util = {};
3890
4007
  }
3891
4008
  e.setEvaluated = y;
3892
4009
  const _ = {};
3893
- function g(w, k) {
4010
+ function $(w, k) {
3894
4011
  return w.scopeValue("func", {
3895
4012
  ref: k,
3896
4013
  code: _[k.code] || (_[k.code] = new r._Code(k.code))
3897
4014
  });
3898
4015
  }
3899
- e.useFunc = g;
4016
+ e.useFunc = $;
3900
4017
  var P;
3901
4018
  (function(w) {
3902
4019
  w[w.Num = 0] = "Num", w[w.Str = 1] = "Str";
@@ -3906,7 +4023,7 @@ var util = {};
3906
4023
  const V = k === P.Num;
3907
4024
  return A ? V ? (0, t._)`"[" + ${w} + "]"` : (0, t._)`"['" + ${w} + "']"` : V ? (0, t._)`"/" + ${w}` : (0, t._)`"/" + ${w}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
3908
4025
  }
3909
- return A ? (0, t.getProperty)(w).toString() : "/" + $(w);
4026
+ return A ? (0, t.getProperty)(w).toString() : "/" + g(w);
3910
4027
  }
3911
4028
  e.getErrorPath = I;
3912
4029
  function D(w, k, A = w.opts.strictSchema) {
@@ -3952,13 +4069,13 @@ names$1.default = names;
3952
4069
  }, e.keyword$DataError = {
3953
4070
  message: ({ keyword: y, schemaType: _ }) => _ ? (0, t.str)`"${y}" keyword must be ${_} ($data)` : (0, t.str)`"${y}" keyword is invalid ($data)`
3954
4071
  };
3955
- function s(y, _ = e.keywordError, g, P) {
3956
- const { it: I } = y, { gen: D, compositeRule: w, allErrors: k } = I, A = $(y, _, g);
4072
+ function s(y, _ = e.keywordError, $, P) {
4073
+ const { it: I } = y, { gen: D, compositeRule: w, allErrors: k } = I, A = g(y, _, $);
3957
4074
  P ?? (w || k) ? d(D, A) : u(I, (0, t._)`[${A}]`);
3958
4075
  }
3959
4076
  e.reportError = s;
3960
- function i(y, _ = e.keywordError, g) {
3961
- const { it: P } = y, { gen: I, compositeRule: D, allErrors: w } = P, k = $(y, _, g);
4077
+ function i(y, _ = e.keywordError, $) {
4078
+ const { it: P } = y, { gen: I, compositeRule: D, allErrors: w } = P, k = g(y, _, $);
3962
4079
  d(I, k), D || w || u(P, n.default.vErrors);
3963
4080
  }
3964
4081
  e.reportExtraError = i;
@@ -3966,24 +4083,24 @@ names$1.default = names;
3966
4083
  y.assign(n.default.errors, _), y.if((0, t._)`${n.default.vErrors} !== null`, () => y.if(_, () => y.assign((0, t._)`${n.default.vErrors}.length`, _), () => y.assign(n.default.vErrors, null)));
3967
4084
  }
3968
4085
  e.resetErrorsCount = o;
3969
- function l({ gen: y, keyword: _, schemaValue: g, data: P, errsCount: I, it: D }) {
4086
+ function l({ gen: y, keyword: _, schemaValue: $, data: P, errsCount: I, it: D }) {
3970
4087
  if (I === void 0)
3971
4088
  throw new Error("ajv implementation error");
3972
4089
  const w = y.name("err");
3973
4090
  y.forRange("i", I, n.default.errors, (k) => {
3974
- y.const(w, (0, t._)`${n.default.vErrors}[${k}]`), y.if((0, t._)`${w}.instancePath === undefined`, () => y.assign((0, t._)`${w}.instancePath`, (0, t.strConcat)(n.default.instancePath, D.errorPath))), y.assign((0, t._)`${w}.schemaPath`, (0, t.str)`${D.errSchemaPath}/${_}`), D.opts.verbose && (y.assign((0, t._)`${w}.schema`, g), y.assign((0, t._)`${w}.data`, P));
4091
+ y.const(w, (0, t._)`${n.default.vErrors}[${k}]`), y.if((0, t._)`${w}.instancePath === undefined`, () => y.assign((0, t._)`${w}.instancePath`, (0, t.strConcat)(n.default.instancePath, D.errorPath))), y.assign((0, t._)`${w}.schemaPath`, (0, t.str)`${D.errSchemaPath}/${_}`), D.opts.verbose && (y.assign((0, t._)`${w}.schema`, $), y.assign((0, t._)`${w}.data`, P));
3975
4092
  });
3976
4093
  }
3977
4094
  e.extendErrors = l;
3978
4095
  function d(y, _) {
3979
- const g = y.const("err", _);
3980
- y.if((0, t._)`${n.default.vErrors} === null`, () => y.assign(n.default.vErrors, (0, t._)`[${g}]`), (0, t._)`${n.default.vErrors}.push(${g})`), y.code((0, t._)`${n.default.errors}++`);
4096
+ const $ = y.const("err", _);
4097
+ y.if((0, t._)`${n.default.vErrors} === null`, () => y.assign(n.default.vErrors, (0, t._)`[${$}]`), (0, t._)`${n.default.vErrors}.push(${$})`), y.code((0, t._)`${n.default.errors}++`);
3981
4098
  }
3982
4099
  function u(y, _) {
3983
- const { gen: g, validateName: P, schemaEnv: I } = y;
3984
- I.$async ? g.throw((0, t._)`new ${y.ValidationError}(${_})`) : (g.assign((0, t._)`${P}.errors`, _), g.return(!1));
4100
+ const { gen: $, validateName: P, schemaEnv: I } = y;
4101
+ I.$async ? $.throw((0, t._)`new ${y.ValidationError}(${_})`) : ($.assign((0, t._)`${P}.errors`, _), $.return(!1));
3985
4102
  }
3986
- const f = {
4103
+ const p = {
3987
4104
  keyword: new t.Name("keyword"),
3988
4105
  schemaPath: new t.Name("schemaPath"),
3989
4106
  params: new t.Name("params"),
@@ -3992,28 +4109,28 @@ names$1.default = names;
3992
4109
  schema: new t.Name("schema"),
3993
4110
  parentSchema: new t.Name("parentSchema")
3994
4111
  };
3995
- function $(y, _, g) {
4112
+ function g(y, _, $) {
3996
4113
  const { createErrors: P } = y.it;
3997
- return P === !1 ? (0, t._)`{}` : O(y, _, g);
4114
+ return P === !1 ? (0, t._)`{}` : O(y, _, $);
3998
4115
  }
3999
- function O(y, _, g = {}) {
4116
+ function O(y, _, $ = {}) {
4000
4117
  const { gen: P, it: I } = y, D = [
4001
- C(I, g),
4002
- S(y, g)
4118
+ C(I, $),
4119
+ S(y, $)
4003
4120
  ];
4004
4121
  return T(y, _, D), P.object(...D);
4005
4122
  }
4006
4123
  function C({ errorPath: y }, { instancePath: _ }) {
4007
- const g = _ ? (0, t.str)`${y}${(0, r.getErrorPath)(_, r.Type.Str)}` : y;
4008
- return [n.default.instancePath, (0, t.strConcat)(n.default.instancePath, g)];
4124
+ const $ = _ ? (0, t.str)`${y}${(0, r.getErrorPath)(_, r.Type.Str)}` : y;
4125
+ return [n.default.instancePath, (0, t.strConcat)(n.default.instancePath, $)];
4009
4126
  }
4010
- function S({ keyword: y, it: { errSchemaPath: _ } }, { schemaPath: g, parentSchema: P }) {
4127
+ function S({ keyword: y, it: { errSchemaPath: _ } }, { schemaPath: $, parentSchema: P }) {
4011
4128
  let I = P ? _ : (0, t.str)`${_}/${y}`;
4012
- return g && (I = (0, t.str)`${I}${(0, r.getErrorPath)(g, r.Type.Str)}`), [f.schemaPath, I];
4129
+ return $ && (I = (0, t.str)`${I}${(0, r.getErrorPath)($, r.Type.Str)}`), [p.schemaPath, I];
4013
4130
  }
4014
- function T(y, { params: _, message: g }, P) {
4015
- const { keyword: I, data: D, schemaValue: w, it: k } = y, { opts: A, propertyName: V, topSchemaRef: x, schemaPath: re } = k;
4016
- P.push([f.keyword, I], [f.params, typeof _ == "function" ? _(y) : _ || (0, t._)`{}`]), A.messages && P.push([f.message, typeof g == "function" ? g(y) : g]), A.verbose && P.push([f.schema, w], [f.parentSchema, (0, t._)`${x}${re}`], [n.default.data, D]), V && P.push([f.propertyName, V]);
4131
+ function T(y, { params: _, message: $ }, P) {
4132
+ const { keyword: I, data: D, schemaValue: w, it: k } = y, { opts: A, propertyName: V, topSchemaRef: x, schemaPath: te } = k;
4133
+ P.push([p.keyword, I], [p.params, typeof _ == "function" ? _(y) : _ || (0, t._)`{}`]), A.messages && P.push([p.message, typeof $ == "function" ? $(y) : $]), A.verbose && P.push([p.schema, w], [p.parentSchema, (0, t._)`${x}${te}`], [n.default.data, D]), V && P.push([p.propertyName, V]);
4017
4134
  }
4018
4135
  })(errors);
4019
4136
  Object.defineProperty(boolSchema, "__esModule", { value: !0 });
@@ -4113,7 +4230,7 @@ applicability.shouldUseRule = shouldUseRule;
4113
4230
  }
4114
4231
  e.getJSONTypes = d;
4115
4232
  function u(P, I) {
4116
- const { gen: D, data: w, opts: k } = P, A = $(I, k.coerceTypes), V = I.length > 0 && !(A.length === 0 && I.length === 1 && (0, r.schemaHasRulesForType)(P, I[0]));
4233
+ const { gen: D, data: w, opts: k } = P, A = g(I, k.coerceTypes), V = I.length > 0 && !(A.length === 0 && I.length === 1 && (0, r.schemaHasRulesForType)(P, I[0]));
4117
4234
  if (V) {
4118
4235
  const x = T(I, w, k.strictNumbers, o.Wrong);
4119
4236
  D.if(x, () => {
@@ -4123,20 +4240,20 @@ applicability.shouldUseRule = shouldUseRule;
4123
4240
  return V;
4124
4241
  }
4125
4242
  e.coerceAndCheckDataType = u;
4126
- const f = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]);
4127
- function $(P, I) {
4128
- return I ? P.filter((D) => f.has(D) || I === "array" && D === "array") : [];
4243
+ const p = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]);
4244
+ function g(P, I) {
4245
+ return I ? P.filter((D) => p.has(D) || I === "array" && D === "array") : [];
4129
4246
  }
4130
4247
  function O(P, I, D) {
4131
4248
  const { gen: w, data: k, opts: A } = P, V = w.let("dataType", (0, s._)`typeof ${k}`), x = w.let("coerced", (0, s._)`undefined`);
4132
4249
  A.coerceTypes === "array" && w.if((0, s._)`${V} == 'object' && Array.isArray(${k}) && ${k}.length == 1`, () => w.assign(k, (0, s._)`${k}[0]`).assign(V, (0, s._)`typeof ${k}`).if(T(I, k, A.strictNumbers), () => w.assign(x, k))), w.if((0, s._)`${x} !== undefined`);
4133
- for (const K of D)
4134
- (f.has(K) || K === "array" && A.coerceTypes === "array") && re(K);
4250
+ for (const J of D)
4251
+ (p.has(J) || J === "array" && A.coerceTypes === "array") && te(J);
4135
4252
  w.else(), _(P), w.endIf(), w.if((0, s._)`${x} !== undefined`, () => {
4136
4253
  w.assign(k, x), C(P, x);
4137
4254
  });
4138
- function re(K) {
4139
- switch (K) {
4255
+ function te(J) {
4256
+ switch (J) {
4140
4257
  case "string":
4141
4258
  w.elseIf((0, s._)`${V} == "number" || ${V} == "boolean"`).assign(x, (0, s._)`"" + ${k}`).elseIf((0, s._)`${k} === null`).assign(x, (0, s._)`""`);
4142
4259
  return;
@@ -4211,11 +4328,11 @@ applicability.shouldUseRule = shouldUseRule;
4211
4328
  params: ({ schema: P, schemaValue: I }) => typeof P == "string" ? (0, s._)`{type: ${P}}` : (0, s._)`{type: ${I}}`
4212
4329
  };
4213
4330
  function _(P) {
4214
- const I = g(P);
4331
+ const I = $(P);
4215
4332
  (0, n.reportError)(I, y);
4216
4333
  }
4217
4334
  e.reportTypeError = _;
4218
- function g(P) {
4335
+ function $(P) {
4219
4336
  const { gen: I, data: D, schema: w } = P, k = (0, i.schemaRefOrVal)(P, w, "type");
4220
4337
  return {
4221
4338
  gen: I,
@@ -4305,14 +4422,14 @@ function schemaProperties(e, t) {
4305
4422
  }
4306
4423
  code.schemaProperties = schemaProperties;
4307
4424
  function callValidateCode({ schemaCode: e, data: t, it: { gen: r, topSchemaRef: n, schemaPath: s, errorPath: i }, it: o }, l, d, u) {
4308
- const f = u ? (0, codegen_1$q._)`${e}, ${t}, ${n}${s}` : t, $ = [
4425
+ const p = u ? (0, codegen_1$q._)`${e}, ${t}, ${n}${s}` : t, g = [
4309
4426
  [names_1$5.default.instancePath, (0, codegen_1$q.strConcat)(names_1$5.default.instancePath, i)],
4310
4427
  [names_1$5.default.parentData, o.parentData],
4311
4428
  [names_1$5.default.parentDataProperty, o.parentDataProperty],
4312
4429
  [names_1$5.default.rootData, names_1$5.default.rootData]
4313
4430
  ];
4314
- o.opts.dynamicRef && $.push([names_1$5.default.dynamicAnchors, names_1$5.default.dynamicAnchors]);
4315
- const O = (0, codegen_1$q._)`${f}, ${r.object(...$)}`;
4431
+ o.opts.dynamicRef && g.push([names_1$5.default.dynamicAnchors, names_1$5.default.dynamicAnchors]);
4432
+ const O = (0, codegen_1$q._)`${p}, ${r.object(...g)}`;
4316
4433
  return d !== codegen_1$q.nil ? (0, codegen_1$q._)`${l}.call(${d}, ${O})` : (0, codegen_1$q._)`${l}(${O})`;
4317
4434
  }
4318
4435
  code.callValidateCode = callValidateCode;
@@ -4353,12 +4470,12 @@ function validateUnion(e) {
4353
4470
  return;
4354
4471
  const o = t.let("valid", !1), l = t.name("_valid");
4355
4472
  t.block(() => r.forEach((d, u) => {
4356
- const f = e.subschema({
4473
+ const p = e.subschema({
4357
4474
  keyword: n,
4358
4475
  schemaProp: u,
4359
4476
  compositeRule: !0
4360
4477
  }, l);
4361
- t.assign(o, (0, codegen_1$q._)`${o} || ${l}`), e.mergeValidEvaluated(f, l) || t.if((0, codegen_1$q.not)(o));
4478
+ t.assign(o, (0, codegen_1$q._)`${o} || ${l}`), e.mergeValidEvaluated(p, l) || t.if((0, codegen_1$q.not)(o));
4362
4479
  })), e.result(o, () => e.reset(), () => e.error(!0));
4363
4480
  }
4364
4481
  code.validateUnion = validateUnion;
@@ -4382,8 +4499,8 @@ function funcKeywordCode(e, t) {
4382
4499
  var r;
4383
4500
  const { gen: n, keyword: s, schema: i, parentSchema: o, $data: l, it: d } = e;
4384
4501
  checkAsyncKeyword(d, t);
4385
- const u = !l && t.compile ? t.compile.call(d.self, i, o, d) : t.validate, f = useKeyword(n, s, u), $ = n.let("valid");
4386
- e.block$data($, O), e.ok((r = t.valid) !== null && r !== void 0 ? r : $);
4502
+ const u = !l && t.compile ? t.compile.call(d.self, i, o, d) : t.validate, p = useKeyword(n, s, u), g = n.let("valid");
4503
+ e.block$data(g, O), e.ok((r = t.valid) !== null && r !== void 0 ? r : g);
4387
4504
  function O() {
4388
4505
  if (t.errors === !1)
4389
4506
  T(), t.modifying && modifyData(e), y(() => e.error());
@@ -4394,19 +4511,19 @@ function funcKeywordCode(e, t) {
4394
4511
  }
4395
4512
  function C() {
4396
4513
  const _ = n.let("ruleErrs", null);
4397
- return n.try(() => T((0, codegen_1$p._)`await `), (g) => n.assign($, !1).if((0, codegen_1$p._)`${g} instanceof ${d.ValidationError}`, () => n.assign(_, (0, codegen_1$p._)`${g}.errors`), () => n.throw(g))), _;
4514
+ return n.try(() => T((0, codegen_1$p._)`await `), ($) => n.assign(g, !1).if((0, codegen_1$p._)`${$} instanceof ${d.ValidationError}`, () => n.assign(_, (0, codegen_1$p._)`${$}.errors`), () => n.throw($))), _;
4398
4515
  }
4399
4516
  function S() {
4400
- const _ = (0, codegen_1$p._)`${f}.errors`;
4517
+ const _ = (0, codegen_1$p._)`${p}.errors`;
4401
4518
  return n.assign(_, null), T(codegen_1$p.nil), _;
4402
4519
  }
4403
4520
  function T(_ = t.async ? (0, codegen_1$p._)`await ` : codegen_1$p.nil) {
4404
- const g = d.opts.passContext ? names_1$4.default.this : names_1$4.default.self, P = !("compile" in t && !l || t.schema === !1);
4405
- n.assign($, (0, codegen_1$p._)`${_}${(0, code_1$9.callValidateCode)(e, f, g, P)}`, t.modifying);
4521
+ const $ = d.opts.passContext ? names_1$4.default.this : names_1$4.default.self, P = !("compile" in t && !l || t.schema === !1);
4522
+ n.assign(g, (0, codegen_1$p._)`${_}${(0, code_1$9.callValidateCode)(e, p, $, P)}`, t.modifying);
4406
4523
  }
4407
4524
  function y(_) {
4408
- var g;
4409
- n.if((0, codegen_1$p.not)((g = t.valid) !== null && g !== void 0 ? g : $), _);
4525
+ var $;
4526
+ n.if((0, codegen_1$p.not)(($ = t.valid) !== null && $ !== void 0 ? $ : g), _);
4410
4527
  }
4411
4528
  }
4412
4529
  keyword.funcKeywordCode = funcKeywordCode;
@@ -4485,8 +4602,8 @@ function extendSubschemaData(e, t, { dataProp: r, dataPropType: n, data: s, data
4485
4602
  throw new Error('both "data" and "dataProp" passed, only one allowed');
4486
4603
  const { gen: l } = t;
4487
4604
  if (r !== void 0) {
4488
- const { errorPath: u, dataPathArr: f, opts: $ } = t, O = l.let("data", (0, codegen_1$o._)`${t.data}${(0, codegen_1$o.getProperty)(r)}`, !0);
4489
- d(O), e.errorPath = (0, codegen_1$o.str)`${u}${(0, util_1$n.getErrorPath)(r, n, $.jsPropertySyntax)}`, e.parentDataProperty = (0, codegen_1$o._)`${r}`, e.dataPathArr = [...f, e.parentDataProperty];
4605
+ const { errorPath: u, dataPathArr: p, opts: g } = t, O = l.let("data", (0, codegen_1$o._)`${t.data}${(0, codegen_1$o.getProperty)(r)}`, !0);
4606
+ d(O), e.errorPath = (0, codegen_1$o.str)`${u}${(0, util_1$n.getErrorPath)(r, n, g.jsPropertySyntax)}`, e.parentDataProperty = (0, codegen_1$o._)`${r}`, e.dataPathArr = [...p, e.parentDataProperty];
4490
4607
  }
4491
4608
  if (s !== void 0) {
4492
4609
  const u = s instanceof codegen_1$o.Name ? s : l.let("data", s, !0);
@@ -4590,18 +4707,18 @@ traverse$1.skipKeywords = {
4590
4707
  function _traverse(e, t, r, n, s, i, o, l, d, u) {
4591
4708
  if (n && typeof n == "object" && !Array.isArray(n)) {
4592
4709
  t(n, s, i, o, l, d, u);
4593
- for (var f in n) {
4594
- var $ = n[f];
4595
- if (Array.isArray($)) {
4596
- if (f in traverse$1.arrayKeywords)
4597
- for (var O = 0; O < $.length; O++)
4598
- _traverse(e, t, r, $[O], s + "/" + f + "/" + O, i, s, f, n, O);
4599
- } else if (f in traverse$1.propsKeywords) {
4600
- if ($ && typeof $ == "object")
4601
- for (var C in $)
4602
- _traverse(e, t, r, $[C], s + "/" + f + "/" + escapeJsonPtr(C), i, s, f, n, C);
4710
+ for (var p in n) {
4711
+ var g = n[p];
4712
+ if (Array.isArray(g)) {
4713
+ if (p in traverse$1.arrayKeywords)
4714
+ for (var O = 0; O < g.length; O++)
4715
+ _traverse(e, t, r, g[O], s + "/" + p + "/" + O, i, s, p, n, O);
4716
+ } else if (p in traverse$1.propsKeywords) {
4717
+ if (g && typeof g == "object")
4718
+ for (var C in g)
4719
+ _traverse(e, t, r, g[C], s + "/" + p + "/" + escapeJsonPtr(C), i, s, p, n, C);
4603
4720
  } else
4604
- (f in traverse$1.keywords || e.allKeys && !(f in traverse$1.skipKeywords)) && _traverse(e, t, r, $, s + "/" + f, i, s, f, n);
4721
+ (p in traverse$1.keywords || e.allKeys && !(p in traverse$1.skipKeywords)) && _traverse(e, t, r, g, s + "/" + p, i, s, p, n);
4605
4722
  }
4606
4723
  r(n, s, i, o, l, d, u);
4607
4724
  }
@@ -4685,21 +4802,21 @@ function getSchemaRefs(e, t) {
4685
4802
  if (typeof e == "boolean")
4686
4803
  return {};
4687
4804
  const { schemaId: r, uriResolver: n } = this.opts, s = normalizeId(e[r] || t), i = { "": s }, o = getFullPath(n, s, !1), l = {}, d = /* @__PURE__ */ new Set();
4688
- return traverse(e, { allKeys: !0 }, ($, O, C, S) => {
4805
+ return traverse(e, { allKeys: !0 }, (g, O, C, S) => {
4689
4806
  if (S === void 0)
4690
4807
  return;
4691
4808
  const T = o + O;
4692
4809
  let y = i[S];
4693
- typeof $[r] == "string" && (y = _.call(this, $[r])), g.call(this, $.$anchor), g.call(this, $.$dynamicAnchor), i[O] = y;
4810
+ typeof g[r] == "string" && (y = _.call(this, g[r])), $.call(this, g.$anchor), $.call(this, g.$dynamicAnchor), i[O] = y;
4694
4811
  function _(P) {
4695
4812
  const I = this.opts.uriResolver.resolve;
4696
4813
  if (P = normalizeId(y ? I(y, P) : P), d.has(P))
4697
- throw f(P);
4814
+ throw p(P);
4698
4815
  d.add(P);
4699
4816
  let D = this.refs[P];
4700
- return typeof D == "string" && (D = this.refs[D]), typeof D == "object" ? u($, D.schema, P) : P !== normalizeId(T) && (P[0] === "#" ? (u($, l[P], P), l[P] = $) : this.refs[P] = T), P;
4817
+ return typeof D == "string" && (D = this.refs[D]), typeof D == "object" ? u(g, D.schema, P) : P !== normalizeId(T) && (P[0] === "#" ? (u(g, l[P], P), l[P] = g) : this.refs[P] = T), P;
4701
4818
  }
4702
- function g(P) {
4819
+ function $(P) {
4703
4820
  if (typeof P == "string") {
4704
4821
  if (!ANCHOR.test(P))
4705
4822
  throw new Error(`invalid anchor "${P}"`);
@@ -4707,12 +4824,12 @@ function getSchemaRefs(e, t) {
4707
4824
  }
4708
4825
  }
4709
4826
  }), l;
4710
- function u($, O, C) {
4711
- if (O !== void 0 && !equal$2($, O))
4712
- throw f(C);
4827
+ function u(g, O, C) {
4828
+ if (O !== void 0 && !equal$2(g, O))
4829
+ throw p(C);
4713
4830
  }
4714
- function f($) {
4715
- return new Error(`reference "${$}" resolves to more than one schema`);
4831
+ function p(g) {
4832
+ return new Error(`reference "${g}" resolves to more than one schema`);
4716
4833
  }
4717
4834
  }
4718
4835
  resolve$1.getSchemaRefs = getSchemaRefs;
@@ -4822,17 +4939,17 @@ function assignEvaluated({ gen: e, evaluated: t, props: r, items: n }) {
4822
4939
  r instanceof codegen_1$n.Name && e.assign((0, codegen_1$n._)`${t}.props`, r), n instanceof codegen_1$n.Name && e.assign((0, codegen_1$n._)`${t}.items`, n);
4823
4940
  }
4824
4941
  function schemaKeywords(e, t, r, n) {
4825
- const { gen: s, schema: i, data: o, allErrors: l, opts: d, self: u } = e, { RULES: f } = u;
4826
- if (i.$ref && (d.ignoreKeywordsWithRef || !(0, util_1$l.schemaHasRulesButRef)(i, f))) {
4827
- s.block(() => keywordCode(e, "$ref", f.all.$ref.definition));
4942
+ const { gen: s, schema: i, data: o, allErrors: l, opts: d, self: u } = e, { RULES: p } = u;
4943
+ if (i.$ref && (d.ignoreKeywordsWithRef || !(0, util_1$l.schemaHasRulesButRef)(i, p))) {
4944
+ s.block(() => keywordCode(e, "$ref", p.all.$ref.definition));
4828
4945
  return;
4829
4946
  }
4830
4947
  d.jtd || checkStrictTypes(e, t), s.block(() => {
4831
- for (const O of f.rules)
4832
- $(O);
4833
- $(f.post);
4948
+ for (const O of p.rules)
4949
+ g(O);
4950
+ g(p.post);
4834
4951
  });
4835
- function $(O) {
4952
+ function g(O) {
4836
4953
  (0, applicability_1.shouldUseGroup)(i, O) && (O.type ? (s.if((0, dataType_2.checkDataType)(O.type, o, d.strictNumbers)), iterateKeywords(e, O), t.length === 1 && t[0] === O.type && r && (s.else(), (0, dataType_2.reportTypeError)(e)), s.endIf()) : iterateKeywords(e, O), l || s.if((0, codegen_1$n._)`${names_1$3.default.errors} === ${n || 0}`));
4837
4954
  }
4838
4955
  }
@@ -5005,15 +5122,15 @@ function getData(e, { dataLevel: t, dataNames: r, dataPathArr: n }) {
5005
5122
  const u = RELATIVE_JSON_POINTER.exec(e);
5006
5123
  if (!u)
5007
5124
  throw new Error(`Invalid JSON-pointer: ${e}`);
5008
- const f = +u[1];
5125
+ const p = +u[1];
5009
5126
  if (s = u[2], s === "#") {
5010
- if (f >= t)
5011
- throw new Error(d("property/index", f));
5012
- return n[t - f];
5127
+ if (p >= t)
5128
+ throw new Error(d("property/index", p));
5129
+ return n[t - p];
5013
5130
  }
5014
- if (f > t)
5015
- throw new Error(d("data", f));
5016
- if (i = r[t - f], !s)
5131
+ if (p > t)
5132
+ throw new Error(d("data", p));
5133
+ if (i = r[t - p], !s)
5017
5134
  return i;
5018
5135
  }
5019
5136
  let o = i;
@@ -5021,8 +5138,8 @@ function getData(e, { dataLevel: t, dataNames: r, dataPathArr: n }) {
5021
5138
  for (const u of l)
5022
5139
  u && (i = (0, codegen_1$n._)`${i}${(0, codegen_1$n.getProperty)((0, util_1$l.unescapeJsonPointer)(u))}`, o = (0, codegen_1$n._)`${o} && ${i}`);
5023
5140
  return o;
5024
- function d(u, f) {
5025
- return `Cannot access ${u} ${f} levels up, current level is ${t}`;
5141
+ function d(u, p) {
5142
+ return `Cannot access ${u} ${p} levels up, current level is ${t}`;
5026
5143
  }
5027
5144
  }
5028
5145
  validate.getData = getData;
@@ -5092,13 +5209,13 @@ function compileSchema(e) {
5092
5209
  opts: this.opts,
5093
5210
  self: this
5094
5211
  };
5095
- let f;
5212
+ let p;
5096
5213
  try {
5097
5214
  this._compilations.add(e), (0, validate_1$1.validateFunctionCode)(u), o.optimize(this.opts.code.optimize);
5098
- const $ = o.toString();
5099
- f = `${o.scopeRefs(names_1$2.default.scope)}return ${$}`, this.opts.code.process && (f = this.opts.code.process(f, e));
5100
- const C = new Function(`${names_1$2.default.self}`, `${names_1$2.default.scope}`, f)(this, this.scope.get());
5101
- if (this.scope.value(d, { ref: C }), C.errors = null, C.schema = e.schema, C.schemaEnv = e, e.$async && (C.$async = !0), this.opts.code.source === !0 && (C.source = { validateName: d, validateCode: $, scopeValues: o._values }), this.opts.unevaluated) {
5215
+ const g = o.toString();
5216
+ p = `${o.scopeRefs(names_1$2.default.scope)}return ${g}`, this.opts.code.process && (p = this.opts.code.process(p, e));
5217
+ const C = new Function(`${names_1$2.default.self}`, `${names_1$2.default.scope}`, p)(this, this.scope.get());
5218
+ if (this.scope.value(d, { ref: C }), C.errors = null, C.schema = e.schema, C.schemaEnv = e, e.$async && (C.$async = !0), this.opts.code.source === !0 && (C.source = { validateName: d, validateCode: g, scopeValues: o._values }), this.opts.unevaluated) {
5102
5219
  const { props: S, items: T } = u;
5103
5220
  C.evaluated = {
5104
5221
  props: S instanceof codegen_1$m.Name ? void 0 : S,
@@ -5108,8 +5225,8 @@ function compileSchema(e) {
5108
5225
  }, C.source && (C.source.evaluated = (0, codegen_1$m.stringify)(C.evaluated));
5109
5226
  }
5110
5227
  return e.validate = C, e;
5111
- } catch ($) {
5112
- throw delete e.validate, delete e.validateName, f && this.logger.error("Error compiling schema, function code:", f), $;
5228
+ } catch (g) {
5229
+ throw delete e.validate, delete e.validateName, p && this.logger.error("Error compiling schema, function code:", p), g;
5113
5230
  } finally {
5114
5231
  this._compilations.delete(e);
5115
5232
  }
@@ -5226,7 +5343,7 @@ var uri$1 = {}, uri_all = { exports: {} };
5226
5343
  n(t);
5227
5344
  })(commonjsGlobal, function(r) {
5228
5345
  function n() {
5229
- for (var p = arguments.length, c = Array(p), m = 0; m < p; m++)
5346
+ for (var f = arguments.length, c = Array(f), m = 0; m < f; m++)
5230
5347
  c[m] = arguments[m];
5231
5348
  if (c.length > 1) {
5232
5349
  c[0] = c[0].slice(0, -1);
@@ -5236,59 +5353,59 @@ var uri$1 = {}, uri_all = { exports: {} };
5236
5353
  } else
5237
5354
  return c[0];
5238
5355
  }
5239
- function s(p) {
5240
- return "(?:" + p + ")";
5356
+ function s(f) {
5357
+ return "(?:" + f + ")";
5241
5358
  }
5242
- function i(p) {
5243
- return p === void 0 ? "undefined" : p === null ? "null" : Object.prototype.toString.call(p).split(" ").pop().split("]").shift().toLowerCase();
5359
+ function i(f) {
5360
+ return f === void 0 ? "undefined" : f === null ? "null" : Object.prototype.toString.call(f).split(" ").pop().split("]").shift().toLowerCase();
5244
5361
  }
5245
- function o(p) {
5246
- return p.toUpperCase();
5362
+ function o(f) {
5363
+ return f.toUpperCase();
5247
5364
  }
5248
- function l(p) {
5249
- return p != null ? p instanceof Array ? p : typeof p.length != "number" || p.split || p.setInterval || p.call ? [p] : Array.prototype.slice.call(p) : [];
5365
+ function l(f) {
5366
+ return f != null ? f instanceof Array ? f : typeof f.length != "number" || f.split || f.setInterval || f.call ? [f] : Array.prototype.slice.call(f) : [];
5250
5367
  }
5251
- function d(p, c) {
5252
- var m = p;
5368
+ function d(f, c) {
5369
+ var m = f;
5253
5370
  if (c)
5254
5371
  for (var R in c)
5255
5372
  m[R] = c[R];
5256
5373
  return m;
5257
5374
  }
5258
- function u(p) {
5259
- var c = "[A-Za-z]", m = "[0-9]", R = n(m, "[A-Fa-f]"), E = s(s("%[EFef]" + R + "%" + R + R + "%" + R + R) + "|" + s("%[89A-Fa-f]" + R + "%" + R + R) + "|" + s("%" + R + R)), U = "[\\:\\/\\?\\#\\[\\]\\@]", L = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", J = n(U, L), Y = p ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", se = p ? "[\\uE000-\\uF8FF]" : "[]", B = n(c, m, "[\\-\\.\\_\\~]", Y);
5375
+ function u(f) {
5376
+ var c = "[A-Za-z]", m = "[0-9]", R = n(m, "[A-Fa-f]"), E = s(s("%[EFef]" + R + "%" + R + R + "%" + R + R) + "|" + s("%[89A-Fa-f]" + R + "%" + R + R) + "|" + s("%" + R + R)), U = "[\\:\\/\\?\\#\\[\\]\\@]", L = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", Q = n(U, L), Z = f ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", ne = f ? "[\\uE000-\\uF8FF]" : "[]", B = n(c, m, "[\\-\\.\\_\\~]", Z);
5260
5377
  s(c + n(c, m, "[\\+\\-\\.]") + "*"), s(s(E + "|" + n(B, L, "[\\:]")) + "*");
5261
- var Z = s(s("25[0-5]") + "|" + s("2[0-4]" + m) + "|" + s("1" + m + m) + "|" + s("0?[1-9]" + m) + "|0?0?" + m), ie = s(Z + "\\." + Z + "\\." + Z + "\\." + Z), z = s(R + "{1,4}"), X = s(s(z + "\\:" + z) + "|" + ie), ae = s(s(z + "\\:") + "{6}" + X), ee = s("\\:\\:" + s(z + "\\:") + "{5}" + X), Se = s(s(z) + "?\\:\\:" + s(z + "\\:") + "{4}" + X), $e = s(s(s(z + "\\:") + "{0,1}" + z) + "?\\:\\:" + s(z + "\\:") + "{3}" + X), ge = s(s(s(z + "\\:") + "{0,2}" + z) + "?\\:\\:" + s(z + "\\:") + "{2}" + X), Be = s(s(s(z + "\\:") + "{0,3}" + z) + "?\\:\\:" + z + "\\:" + X), Ie = s(s(s(z + "\\:") + "{0,4}" + z) + "?\\:\\:" + X), fe = s(s(s(z + "\\:") + "{0,5}" + z) + "?\\:\\:" + z), ye = s(s(s(z + "\\:") + "{0,6}" + z) + "?\\:\\:"), je = s([ae, ee, Se, $e, ge, Be, Ie, fe, ye].join("|")), we = s(s(B + "|" + E) + "+");
5378
+ var Y = s(s("25[0-5]") + "|" + s("2[0-4]" + m) + "|" + s("1" + m + m) + "|" + s("0?[1-9]" + m) + "|0?0?" + m), se = s(Y + "\\." + Y + "\\." + Y + "\\." + Y), z = s(R + "{1,4}"), X = s(s(z + "\\:" + z) + "|" + se), ae = s(s(z + "\\:") + "{6}" + X), ee = s("\\:\\:" + s(z + "\\:") + "{5}" + X), Se = s(s(z) + "?\\:\\:" + s(z + "\\:") + "{4}" + X), ge = s(s(s(z + "\\:") + "{0,1}" + z) + "?\\:\\:" + s(z + "\\:") + "{3}" + X), $e = s(s(s(z + "\\:") + "{0,2}" + z) + "?\\:\\:" + s(z + "\\:") + "{2}" + X), xe = s(s(s(z + "\\:") + "{0,3}" + z) + "?\\:\\:" + z + "\\:" + X), Ne = s(s(s(z + "\\:") + "{0,4}" + z) + "?\\:\\:" + X), fe = s(s(s(z + "\\:") + "{0,5}" + z) + "?\\:\\:" + z), ye = s(s(s(z + "\\:") + "{0,6}" + z) + "?\\:\\:"), Ie = s([ae, ee, Se, ge, $e, xe, Ne, fe, ye].join("|")), we = s(s(B + "|" + E) + "+");
5262
5379
  s("[vV]" + R + "+\\." + n(B, L, "[\\:]") + "+"), s(s(E + "|" + n(B, L)) + "*");
5263
- var ct = s(E + "|" + n(B, L, "[\\:\\@]"));
5264
- return s(s(E + "|" + n(B, L, "[\\@]")) + "+"), s(s(ct + "|" + n("[\\/\\?]", se)) + "*"), {
5380
+ var ot = s(E + "|" + n(B, L, "[\\:\\@]"));
5381
+ return s(s(E + "|" + n(B, L, "[\\@]")) + "+"), s(s(ot + "|" + n("[\\/\\?]", ne)) + "*"), {
5265
5382
  NOT_SCHEME: new RegExp(n("[^]", c, m, "[\\+\\-\\.]"), "g"),
5266
5383
  NOT_USERINFO: new RegExp(n("[^\\%\\:]", B, L), "g"),
5267
5384
  NOT_HOST: new RegExp(n("[^\\%\\[\\]\\:]", B, L), "g"),
5268
5385
  NOT_PATH: new RegExp(n("[^\\%\\/\\:\\@]", B, L), "g"),
5269
5386
  NOT_PATH_NOSCHEME: new RegExp(n("[^\\%\\/\\@]", B, L), "g"),
5270
- NOT_QUERY: new RegExp(n("[^\\%]", B, L, "[\\:\\@\\/\\?]", se), "g"),
5387
+ NOT_QUERY: new RegExp(n("[^\\%]", B, L, "[\\:\\@\\/\\?]", ne), "g"),
5271
5388
  NOT_FRAGMENT: new RegExp(n("[^\\%]", B, L, "[\\:\\@\\/\\?]"), "g"),
5272
5389
  ESCAPE: new RegExp(n("[^]", B, L), "g"),
5273
5390
  UNRESERVED: new RegExp(B, "g"),
5274
- OTHER_CHARS: new RegExp(n("[^\\%]", B, J), "g"),
5391
+ OTHER_CHARS: new RegExp(n("[^\\%]", B, Q), "g"),
5275
5392
  PCT_ENCODED: new RegExp(E, "g"),
5276
- IPV4ADDRESS: new RegExp("^(" + ie + ")$"),
5277
- IPV6ADDRESS: new RegExp("^\\[?(" + je + ")" + s(s("\\%25|\\%(?!" + R + "{2})") + "(" + we + ")") + "?\\]?$")
5393
+ IPV4ADDRESS: new RegExp("^(" + se + ")$"),
5394
+ IPV6ADDRESS: new RegExp("^\\[?(" + Ie + ")" + s(s("\\%25|\\%(?!" + R + "{2})") + "(" + we + ")") + "?\\]?$")
5278
5395
  //RFC 6874, with relaxed parsing rules
5279
5396
  };
5280
5397
  }
5281
- var f = u(!1), $ = u(!0), O = function() {
5282
- function p(c, m) {
5398
+ var p = u(!1), g = u(!0), O = function() {
5399
+ function f(c, m) {
5283
5400
  var R = [], E = !0, U = !1, L = void 0;
5284
5401
  try {
5285
- for (var J = c[Symbol.iterator](), Y; !(E = (Y = J.next()).done) && (R.push(Y.value), !(m && R.length === m)); E = !0)
5402
+ for (var Q = c[Symbol.iterator](), Z; !(E = (Z = Q.next()).done) && (R.push(Z.value), !(m && R.length === m)); E = !0)
5286
5403
  ;
5287
- } catch (se) {
5288
- U = !0, L = se;
5404
+ } catch (ne) {
5405
+ U = !0, L = ne;
5289
5406
  } finally {
5290
5407
  try {
5291
- !E && J.return && J.return();
5408
+ !E && Q.return && Q.return();
5292
5409
  } finally {
5293
5410
  if (U)
5294
5411
  throw L;
@@ -5300,153 +5417,153 @@ var uri$1 = {}, uri_all = { exports: {} };
5300
5417
  if (Array.isArray(c))
5301
5418
  return c;
5302
5419
  if (Symbol.iterator in Object(c))
5303
- return p(c, m);
5420
+ return f(c, m);
5304
5421
  throw new TypeError("Invalid attempt to destructure non-iterable instance");
5305
5422
  };
5306
- }(), C = function(p) {
5307
- if (Array.isArray(p)) {
5308
- for (var c = 0, m = Array(p.length); c < p.length; c++)
5309
- m[c] = p[c];
5423
+ }(), C = function(f) {
5424
+ if (Array.isArray(f)) {
5425
+ for (var c = 0, m = Array(f.length); c < f.length; c++)
5426
+ m[c] = f[c];
5310
5427
  return m;
5311
5428
  } else
5312
- return Array.from(p);
5313
- }, S = 2147483647, T = 36, y = 1, _ = 26, g = 38, P = 700, I = 72, D = 128, w = "-", k = /^xn--/, A = /[^\0-\x7E]/, V = /[\x2E\u3002\uFF0E\uFF61]/g, x = {
5429
+ return Array.from(f);
5430
+ }, S = 2147483647, T = 36, y = 1, _ = 26, $ = 38, P = 700, I = 72, D = 128, w = "-", k = /^xn--/, A = /[^\0-\x7E]/, V = /[\x2E\u3002\uFF0E\uFF61]/g, x = {
5314
5431
  overflow: "Overflow: input needs wider integers to process",
5315
5432
  "not-basic": "Illegal input >= 0x80 (not a basic code point)",
5316
5433
  "invalid-input": "Invalid input"
5317
- }, re = T - y, K = Math.floor, ue = String.fromCharCode;
5318
- function oe(p) {
5319
- throw new RangeError(x[p]);
5434
+ }, te = T - y, J = Math.floor, ue = String.fromCharCode;
5435
+ function oe(f) {
5436
+ throw new RangeError(x[f]);
5320
5437
  }
5321
- function ke(p, c) {
5322
- for (var m = [], R = p.length; R--; )
5323
- m[R] = c(p[R]);
5438
+ function Te(f, c) {
5439
+ for (var m = [], R = f.length; R--; )
5440
+ m[R] = c(f[R]);
5324
5441
  return m;
5325
5442
  }
5326
- function Ce(p, c) {
5327
- var m = p.split("@"), R = "";
5328
- m.length > 1 && (R = m[0] + "@", p = m[1]), p = p.replace(V, ".");
5329
- var E = p.split("."), U = ke(E, c).join(".");
5443
+ function ke(f, c) {
5444
+ var m = f.split("@"), R = "";
5445
+ m.length > 1 && (R = m[0] + "@", f = m[1]), f = f.replace(V, ".");
5446
+ var E = f.split("."), U = Te(E, c).join(".");
5330
5447
  return R + U;
5331
5448
  }
5332
- function qe(p) {
5333
- for (var c = [], m = 0, R = p.length; m < R; ) {
5334
- var E = p.charCodeAt(m++);
5449
+ function Fe(f) {
5450
+ for (var c = [], m = 0, R = f.length; m < R; ) {
5451
+ var E = f.charCodeAt(m++);
5335
5452
  if (E >= 55296 && E <= 56319 && m < R) {
5336
- var U = p.charCodeAt(m++);
5453
+ var U = f.charCodeAt(m++);
5337
5454
  (U & 64512) == 56320 ? c.push(((E & 1023) << 10) + (U & 1023) + 65536) : (c.push(E), m--);
5338
5455
  } else
5339
5456
  c.push(E);
5340
5457
  }
5341
5458
  return c;
5342
5459
  }
5343
- var et = function(c) {
5460
+ var Ze = function(c) {
5344
5461
  return String.fromCodePoint.apply(String, C(c));
5345
- }, Ue = function(c) {
5462
+ }, Me = function(c) {
5346
5463
  return c - 48 < 10 ? c - 22 : c - 65 < 26 ? c - 65 : c - 97 < 26 ? c - 97 : T;
5347
5464
  }, F = function(c, m) {
5348
5465
  return c + 22 + 75 * (c < 26) - ((m != 0) << 5);
5349
5466
  }, v = function(c, m, R) {
5350
5467
  var E = 0;
5351
5468
  for (
5352
- c = R ? K(c / P) : c >> 1, c += K(c / m);
5469
+ c = R ? J(c / P) : c >> 1, c += J(c / m);
5353
5470
  /* no initialization */
5354
- c > re * _ >> 1;
5471
+ c > te * _ >> 1;
5355
5472
  E += T
5356
5473
  )
5357
- c = K(c / re);
5358
- return K(E + (re + 1) * c / (c + g));
5474
+ c = J(c / te);
5475
+ return J(E + (te + 1) * c / (c + $));
5359
5476
  }, j = function(c) {
5360
- var m = [], R = c.length, E = 0, U = D, L = I, J = c.lastIndexOf(w);
5361
- J < 0 && (J = 0);
5362
- for (var Y = 0; Y < J; ++Y)
5363
- c.charCodeAt(Y) >= 128 && oe("not-basic"), m.push(c.charCodeAt(Y));
5364
- for (var se = J > 0 ? J + 1 : 0; se < R; ) {
5477
+ var m = [], R = c.length, E = 0, U = D, L = I, Q = c.lastIndexOf(w);
5478
+ Q < 0 && (Q = 0);
5479
+ for (var Z = 0; Z < Q; ++Z)
5480
+ c.charCodeAt(Z) >= 128 && oe("not-basic"), m.push(c.charCodeAt(Z));
5481
+ for (var ne = Q > 0 ? Q + 1 : 0; ne < R; ) {
5365
5482
  for (
5366
- var B = E, Z = 1, ie = T;
5483
+ var B = E, Y = 1, se = T;
5367
5484
  ;
5368
5485
  /* no condition */
5369
- ie += T
5486
+ se += T
5370
5487
  ) {
5371
- se >= R && oe("invalid-input");
5372
- var z = Ue(c.charCodeAt(se++));
5373
- (z >= T || z > K((S - E) / Z)) && oe("overflow"), E += z * Z;
5374
- var X = ie <= L ? y : ie >= L + _ ? _ : ie - L;
5488
+ ne >= R && oe("invalid-input");
5489
+ var z = Me(c.charCodeAt(ne++));
5490
+ (z >= T || z > J((S - E) / Y)) && oe("overflow"), E += z * Y;
5491
+ var X = se <= L ? y : se >= L + _ ? _ : se - L;
5375
5492
  if (z < X)
5376
5493
  break;
5377
5494
  var ae = T - X;
5378
- Z > K(S / ae) && oe("overflow"), Z *= ae;
5495
+ Y > J(S / ae) && oe("overflow"), Y *= ae;
5379
5496
  }
5380
5497
  var ee = m.length + 1;
5381
- L = v(E - B, ee, B == 0), K(E / ee) > S - U && oe("overflow"), U += K(E / ee), E %= ee, m.splice(E++, 0, U);
5498
+ L = v(E - B, ee, B == 0), J(E / ee) > S - U && oe("overflow"), U += J(E / ee), E %= ee, m.splice(E++, 0, U);
5382
5499
  }
5383
5500
  return String.fromCodePoint.apply(String, m);
5384
5501
  }, b = function(c) {
5385
5502
  var m = [];
5386
- c = qe(c);
5387
- var R = c.length, E = D, U = 0, L = I, J = !0, Y = !1, se = void 0;
5503
+ c = Fe(c);
5504
+ var R = c.length, E = D, U = 0, L = I, Q = !0, Z = !1, ne = void 0;
5388
5505
  try {
5389
- for (var B = c[Symbol.iterator](), Z; !(J = (Z = B.next()).done); J = !0) {
5390
- var ie = Z.value;
5391
- ie < 128 && m.push(ue(ie));
5506
+ for (var B = c[Symbol.iterator](), Y; !(Q = (Y = B.next()).done); Q = !0) {
5507
+ var se = Y.value;
5508
+ se < 128 && m.push(ue(se));
5392
5509
  }
5393
- } catch (lt) {
5394
- Y = !0, se = lt;
5510
+ } catch (at) {
5511
+ Z = !0, ne = at;
5395
5512
  } finally {
5396
5513
  try {
5397
- !J && B.return && B.return();
5514
+ !Q && B.return && B.return();
5398
5515
  } finally {
5399
- if (Y)
5400
- throw se;
5516
+ if (Z)
5517
+ throw ne;
5401
5518
  }
5402
5519
  }
5403
5520
  var z = m.length, X = z;
5404
5521
  for (z && m.push(w); X < R; ) {
5405
- var ae = S, ee = !0, Se = !1, $e = void 0;
5522
+ var ae = S, ee = !0, Se = !1, ge = void 0;
5406
5523
  try {
5407
- for (var ge = c[Symbol.iterator](), Be; !(ee = (Be = ge.next()).done); ee = !0) {
5408
- var Ie = Be.value;
5409
- Ie >= E && Ie < ae && (ae = Ie);
5524
+ for (var $e = c[Symbol.iterator](), xe; !(ee = (xe = $e.next()).done); ee = !0) {
5525
+ var Ne = xe.value;
5526
+ Ne >= E && Ne < ae && (ae = Ne);
5410
5527
  }
5411
- } catch (lt) {
5412
- Se = !0, $e = lt;
5528
+ } catch (at) {
5529
+ Se = !0, ge = at;
5413
5530
  } finally {
5414
5531
  try {
5415
- !ee && ge.return && ge.return();
5532
+ !ee && $e.return && $e.return();
5416
5533
  } finally {
5417
5534
  if (Se)
5418
- throw $e;
5535
+ throw ge;
5419
5536
  }
5420
5537
  }
5421
5538
  var fe = X + 1;
5422
- ae - E > K((S - U) / fe) && oe("overflow"), U += (ae - E) * fe, E = ae;
5423
- var ye = !0, je = !1, we = void 0;
5539
+ ae - E > J((S - U) / fe) && oe("overflow"), U += (ae - E) * fe, E = ae;
5540
+ var ye = !0, Ie = !1, we = void 0;
5424
5541
  try {
5425
- for (var ct = c[Symbol.iterator](), Lt; !(ye = (Lt = ct.next()).done); ye = !0) {
5426
- var Ht = Lt.value;
5427
- if (Ht < E && ++U > S && oe("overflow"), Ht == E) {
5542
+ for (var ot = c[Symbol.iterator](), Ht; !(ye = (Ht = ot.next()).done); ye = !0) {
5543
+ var Vt = Ht.value;
5544
+ if (Vt < E && ++U > S && oe("overflow"), Vt == E) {
5428
5545
  for (
5429
- var pt = U, ft = T;
5546
+ var dt = U, ut = T;
5430
5547
  ;
5431
5548
  /* no condition */
5432
- ft += T
5549
+ ut += T
5433
5550
  ) {
5434
- var ht = ft <= L ? y : ft >= L + _ ? _ : ft - L;
5435
- if (pt < ht)
5551
+ var pt = ut <= L ? y : ut >= L + _ ? _ : ut - L;
5552
+ if (dt < pt)
5436
5553
  break;
5437
- var Vt = pt - ht, zt = T - ht;
5438
- m.push(ue(F(ht + Vt % zt, 0))), pt = K(Vt / zt);
5554
+ var zt = dt - pt, xt = T - pt;
5555
+ m.push(ue(F(pt + zt % xt, 0))), dt = J(zt / xt);
5439
5556
  }
5440
- m.push(ue(F(pt, 0))), L = v(U, fe, X == z), U = 0, ++X;
5557
+ m.push(ue(F(dt, 0))), L = v(U, fe, X == z), U = 0, ++X;
5441
5558
  }
5442
5559
  }
5443
- } catch (lt) {
5444
- je = !0, we = lt;
5560
+ } catch (at) {
5561
+ Ie = !0, we = at;
5445
5562
  } finally {
5446
5563
  try {
5447
- !ye && ct.return && ct.return();
5564
+ !ye && ot.return && ot.return();
5448
5565
  } finally {
5449
- if (je)
5566
+ if (Ie)
5450
5567
  throw we;
5451
5568
  }
5452
5569
  }
@@ -5454,11 +5571,11 @@ var uri$1 = {}, uri_all = { exports: {} };
5454
5571
  }
5455
5572
  return m.join("");
5456
5573
  }, a = function(c) {
5457
- return Ce(c, function(m) {
5574
+ return ke(c, function(m) {
5458
5575
  return k.test(m) ? j(m.slice(4).toLowerCase()) : m;
5459
5576
  });
5460
5577
  }, h = function(c) {
5461
- return Ce(c, function(m) {
5578
+ return ke(c, function(m) {
5462
5579
  return A.test(m) ? "xn--" + b(m) : m;
5463
5580
  });
5464
5581
  }, N = {
@@ -5476,87 +5593,87 @@ var uri$1 = {}, uri_all = { exports: {} };
5476
5593
  * @type Object
5477
5594
  */
5478
5595
  ucs2: {
5479
- decode: qe,
5480
- encode: et
5596
+ decode: Fe,
5597
+ encode: Ze
5481
5598
  },
5482
5599
  decode: j,
5483
5600
  encode: b,
5484
5601
  toASCII: h,
5485
5602
  toUnicode: a
5486
5603
  }, M = {};
5487
- function q(p) {
5488
- var c = p.charCodeAt(0), m = void 0;
5604
+ function q(f) {
5605
+ var c = f.charCodeAt(0), m = void 0;
5489
5606
  return c < 16 ? m = "%0" + c.toString(16).toUpperCase() : c < 128 ? m = "%" + c.toString(16).toUpperCase() : c < 2048 ? m = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase() : m = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase(), m;
5490
5607
  }
5491
- function W(p) {
5492
- for (var c = "", m = 0, R = p.length; m < R; ) {
5493
- var E = parseInt(p.substr(m + 1, 2), 16);
5608
+ function W(f) {
5609
+ for (var c = "", m = 0, R = f.length; m < R; ) {
5610
+ var E = parseInt(f.substr(m + 1, 2), 16);
5494
5611
  if (E < 128)
5495
5612
  c += String.fromCharCode(E), m += 3;
5496
5613
  else if (E >= 194 && E < 224) {
5497
5614
  if (R - m >= 6) {
5498
- var U = parseInt(p.substr(m + 4, 2), 16);
5615
+ var U = parseInt(f.substr(m + 4, 2), 16);
5499
5616
  c += String.fromCharCode((E & 31) << 6 | U & 63);
5500
5617
  } else
5501
- c += p.substr(m, 6);
5618
+ c += f.substr(m, 6);
5502
5619
  m += 6;
5503
5620
  } else if (E >= 224) {
5504
5621
  if (R - m >= 9) {
5505
- var L = parseInt(p.substr(m + 4, 2), 16), J = parseInt(p.substr(m + 7, 2), 16);
5506
- c += String.fromCharCode((E & 15) << 12 | (L & 63) << 6 | J & 63);
5622
+ var L = parseInt(f.substr(m + 4, 2), 16), Q = parseInt(f.substr(m + 7, 2), 16);
5623
+ c += String.fromCharCode((E & 15) << 12 | (L & 63) << 6 | Q & 63);
5507
5624
  } else
5508
- c += p.substr(m, 9);
5625
+ c += f.substr(m, 9);
5509
5626
  m += 9;
5510
5627
  } else
5511
- c += p.substr(m, 3), m += 3;
5628
+ c += f.substr(m, 3), m += 3;
5512
5629
  }
5513
5630
  return c;
5514
5631
  }
5515
- function G(p, c) {
5632
+ function G(f, c) {
5516
5633
  function m(R) {
5517
5634
  var E = W(R);
5518
5635
  return E.match(c.UNRESERVED) ? E : R;
5519
5636
  }
5520
- return p.scheme && (p.scheme = String(p.scheme).replace(c.PCT_ENCODED, m).toLowerCase().replace(c.NOT_SCHEME, "")), p.userinfo !== void 0 && (p.userinfo = String(p.userinfo).replace(c.PCT_ENCODED, m).replace(c.NOT_USERINFO, q).replace(c.PCT_ENCODED, o)), p.host !== void 0 && (p.host = String(p.host).replace(c.PCT_ENCODED, m).toLowerCase().replace(c.NOT_HOST, q).replace(c.PCT_ENCODED, o)), p.path !== void 0 && (p.path = String(p.path).replace(c.PCT_ENCODED, m).replace(p.scheme ? c.NOT_PATH : c.NOT_PATH_NOSCHEME, q).replace(c.PCT_ENCODED, o)), p.query !== void 0 && (p.query = String(p.query).replace(c.PCT_ENCODED, m).replace(c.NOT_QUERY, q).replace(c.PCT_ENCODED, o)), p.fragment !== void 0 && (p.fragment = String(p.fragment).replace(c.PCT_ENCODED, m).replace(c.NOT_FRAGMENT, q).replace(c.PCT_ENCODED, o)), p;
5637
+ return f.scheme && (f.scheme = String(f.scheme).replace(c.PCT_ENCODED, m).toLowerCase().replace(c.NOT_SCHEME, "")), f.userinfo !== void 0 && (f.userinfo = String(f.userinfo).replace(c.PCT_ENCODED, m).replace(c.NOT_USERINFO, q).replace(c.PCT_ENCODED, o)), f.host !== void 0 && (f.host = String(f.host).replace(c.PCT_ENCODED, m).toLowerCase().replace(c.NOT_HOST, q).replace(c.PCT_ENCODED, o)), f.path !== void 0 && (f.path = String(f.path).replace(c.PCT_ENCODED, m).replace(f.scheme ? c.NOT_PATH : c.NOT_PATH_NOSCHEME, q).replace(c.PCT_ENCODED, o)), f.query !== void 0 && (f.query = String(f.query).replace(c.PCT_ENCODED, m).replace(c.NOT_QUERY, q).replace(c.PCT_ENCODED, o)), f.fragment !== void 0 && (f.fragment = String(f.fragment).replace(c.PCT_ENCODED, m).replace(c.NOT_FRAGMENT, q).replace(c.PCT_ENCODED, o)), f;
5521
5638
  }
5522
- function ne(p) {
5523
- return p.replace(/^0*(.*)/, "$1") || "0";
5639
+ function re(f) {
5640
+ return f.replace(/^0*(.*)/, "$1") || "0";
5524
5641
  }
5525
- function he(p, c) {
5526
- var m = p.match(c.IPV4ADDRESS) || [], R = O(m, 2), E = R[1];
5527
- return E ? E.split(".").map(ne).join(".") : p;
5642
+ function he(f, c) {
5643
+ var m = f.match(c.IPV4ADDRESS) || [], R = O(m, 2), E = R[1];
5644
+ return E ? E.split(".").map(re).join(".") : f;
5528
5645
  }
5529
- function Le(p, c) {
5530
- var m = p.match(c.IPV6ADDRESS) || [], R = O(m, 3), E = R[1], U = R[2];
5646
+ function qe(f, c) {
5647
+ var m = f.match(c.IPV6ADDRESS) || [], R = O(m, 3), E = R[1], U = R[2];
5531
5648
  if (E) {
5532
- for (var L = E.toLowerCase().split("::").reverse(), J = O(L, 2), Y = J[0], se = J[1], B = se ? se.split(":").map(ne) : [], Z = Y.split(":").map(ne), ie = c.IPV4ADDRESS.test(Z[Z.length - 1]), z = ie ? 7 : 8, X = Z.length - z, ae = Array(z), ee = 0; ee < z; ++ee)
5533
- ae[ee] = B[ee] || Z[X + ee] || "";
5534
- ie && (ae[z - 1] = he(ae[z - 1], c));
5535
- var Se = ae.reduce(function(fe, ye, je) {
5649
+ for (var L = E.toLowerCase().split("::").reverse(), Q = O(L, 2), Z = Q[0], ne = Q[1], B = ne ? ne.split(":").map(re) : [], Y = Z.split(":").map(re), se = c.IPV4ADDRESS.test(Y[Y.length - 1]), z = se ? 7 : 8, X = Y.length - z, ae = Array(z), ee = 0; ee < z; ++ee)
5650
+ ae[ee] = B[ee] || Y[X + ee] || "";
5651
+ se && (ae[z - 1] = he(ae[z - 1], c));
5652
+ var Se = ae.reduce(function(fe, ye, Ie) {
5536
5653
  if (!ye || ye === "0") {
5537
5654
  var we = fe[fe.length - 1];
5538
- we && we.index + we.length === je ? we.length++ : fe.push({ index: je, length: 1 });
5655
+ we && we.index + we.length === Ie ? we.length++ : fe.push({ index: Ie, length: 1 });
5539
5656
  }
5540
5657
  return fe;
5541
- }, []), $e = Se.sort(function(fe, ye) {
5658
+ }, []), ge = Se.sort(function(fe, ye) {
5542
5659
  return ye.length - fe.length;
5543
- })[0], ge = void 0;
5544
- if ($e && $e.length > 1) {
5545
- var Be = ae.slice(0, $e.index), Ie = ae.slice($e.index + $e.length);
5546
- ge = Be.join(":") + "::" + Ie.join(":");
5660
+ })[0], $e = void 0;
5661
+ if (ge && ge.length > 1) {
5662
+ var xe = ae.slice(0, ge.index), Ne = ae.slice(ge.index + ge.length);
5663
+ $e = xe.join(":") + "::" + Ne.join(":");
5547
5664
  } else
5548
- ge = ae.join(":");
5549
- return U && (ge += "%" + U), ge;
5665
+ $e = ae.join(":");
5666
+ return U && ($e += "%" + U), $e;
5550
5667
  } else
5551
- return p;
5668
+ return f;
5552
5669
  }
5553
- var tt = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i, rt = "".match(/(){0}/)[1] === void 0;
5554
- function de(p) {
5555
- var c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = {}, R = c.iri !== !1 ? $ : f;
5556
- c.reference === "suffix" && (p = (c.scheme ? c.scheme + ":" : "") + "//" + p);
5557
- var E = p.match(tt);
5670
+ var Xe = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i, et = "".match(/(){0}/)[1] === void 0;
5671
+ function de(f) {
5672
+ var c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = {}, R = c.iri !== !1 ? g : p;
5673
+ c.reference === "suffix" && (f = (c.scheme ? c.scheme + ":" : "") + "//" + f);
5674
+ var E = f.match(Xe);
5558
5675
  if (E) {
5559
- rt ? (m.scheme = E[1], m.userinfo = E[3], m.host = E[4], m.port = parseInt(E[5], 10), m.path = E[6] || "", m.query = E[7], m.fragment = E[8], isNaN(m.port) && (m.port = E[5])) : (m.scheme = E[1] || void 0, m.userinfo = p.indexOf("@") !== -1 ? E[3] : void 0, m.host = p.indexOf("//") !== -1 ? E[4] : void 0, m.port = parseInt(E[5], 10), m.path = E[6] || "", m.query = p.indexOf("?") !== -1 ? E[7] : void 0, m.fragment = p.indexOf("#") !== -1 ? E[8] : void 0, isNaN(m.port) && (m.port = p.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? E[4] : void 0)), m.host && (m.host = Le(he(m.host, R), R)), m.scheme === void 0 && m.userinfo === void 0 && m.host === void 0 && m.port === void 0 && !m.path && m.query === void 0 ? m.reference = "same-document" : m.scheme === void 0 ? m.reference = "relative" : m.fragment === void 0 ? m.reference = "absolute" : m.reference = "uri", c.reference && c.reference !== "suffix" && c.reference !== m.reference && (m.error = m.error || "URI is not a " + c.reference + " reference.");
5676
+ et ? (m.scheme = E[1], m.userinfo = E[3], m.host = E[4], m.port = parseInt(E[5], 10), m.path = E[6] || "", m.query = E[7], m.fragment = E[8], isNaN(m.port) && (m.port = E[5])) : (m.scheme = E[1] || void 0, m.userinfo = f.indexOf("@") !== -1 ? E[3] : void 0, m.host = f.indexOf("//") !== -1 ? E[4] : void 0, m.port = parseInt(E[5], 10), m.path = E[6] || "", m.query = f.indexOf("?") !== -1 ? E[7] : void 0, m.fragment = f.indexOf("#") !== -1 ? E[8] : void 0, isNaN(m.port) && (m.port = f.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? E[4] : void 0)), m.host && (m.host = qe(he(m.host, R), R)), m.scheme === void 0 && m.userinfo === void 0 && m.host === void 0 && m.port === void 0 && !m.path && m.query === void 0 ? m.reference = "same-document" : m.scheme === void 0 ? m.reference = "relative" : m.fragment === void 0 ? m.reference = "absolute" : m.reference = "uri", c.reference && c.reference !== "suffix" && c.reference !== m.reference && (m.error = m.error || "URI is not a " + c.reference + " reference.");
5560
5677
  var U = M[(c.scheme || m.scheme || "").toLowerCase()];
5561
5678
  if (!c.unicodeSupport && (!U || !U.unicodeSupport)) {
5562
5679
  if (m.host && (c.domainHost || U && U.domainHost))
@@ -5565,7 +5682,7 @@ var uri$1 = {}, uri_all = { exports: {} };
5565
5682
  } catch (L) {
5566
5683
  m.error = m.error || "Host's domain name can not be converted to ASCII via punycode: " + L;
5567
5684
  }
5568
- G(m, f);
5685
+ G(m, p);
5569
5686
  } else
5570
5687
  G(m, R);
5571
5688
  U && U.parse && U.parse(m, c);
@@ -5573,72 +5690,72 @@ var uri$1 = {}, uri_all = { exports: {} };
5573
5690
  m.error = m.error || "URI can not be parsed.";
5574
5691
  return m;
5575
5692
  }
5576
- function nt(p, c) {
5577
- var m = c.iri !== !1 ? $ : f, R = [];
5578
- return p.userinfo !== void 0 && (R.push(p.userinfo), R.push("@")), p.host !== void 0 && R.push(Le(he(String(p.host), m), m).replace(m.IPV6ADDRESS, function(E, U, L) {
5693
+ function tt(f, c) {
5694
+ var m = c.iri !== !1 ? g : p, R = [];
5695
+ return f.userinfo !== void 0 && (R.push(f.userinfo), R.push("@")), f.host !== void 0 && R.push(qe(he(String(f.host), m), m).replace(m.IPV6ADDRESS, function(E, U, L) {
5579
5696
  return "[" + U + (L ? "%25" + L : "") + "]";
5580
- })), (typeof p.port == "number" || typeof p.port == "string") && (R.push(":"), R.push(String(p.port))), R.length ? R.join("") : void 0;
5581
- }
5582
- var He = /^\.\.?\//, Ve = /^\/\.(\/|$)/, ze = /^\/\.\.(\/|$)/, st = /^\/?(?:.|\n)*?(?=\/|$)/;
5583
- function me(p) {
5584
- for (var c = []; p.length; )
5585
- if (p.match(He))
5586
- p = p.replace(He, "");
5587
- else if (p.match(Ve))
5588
- p = p.replace(Ve, "/");
5589
- else if (p.match(ze))
5590
- p = p.replace(ze, "/"), c.pop();
5591
- else if (p === "." || p === "..")
5592
- p = "";
5697
+ })), (typeof f.port == "number" || typeof f.port == "string") && (R.push(":"), R.push(String(f.port))), R.length ? R.join("") : void 0;
5698
+ }
5699
+ var Ue = /^\.\.?\//, Le = /^\/\.(\/|$)/, He = /^\/\.\.(\/|$)/, rt = /^\/?(?:.|\n)*?(?=\/|$)/;
5700
+ function me(f) {
5701
+ for (var c = []; f.length; )
5702
+ if (f.match(Ue))
5703
+ f = f.replace(Ue, "");
5704
+ else if (f.match(Le))
5705
+ f = f.replace(Le, "/");
5706
+ else if (f.match(He))
5707
+ f = f.replace(He, "/"), c.pop();
5708
+ else if (f === "." || f === "..")
5709
+ f = "";
5593
5710
  else {
5594
- var m = p.match(st);
5711
+ var m = f.match(rt);
5595
5712
  if (m) {
5596
5713
  var R = m[0];
5597
- p = p.slice(R.length), c.push(R);
5714
+ f = f.slice(R.length), c.push(R);
5598
5715
  } else
5599
5716
  throw new Error("Unexpected dot segment condition");
5600
5717
  }
5601
5718
  return c.join("");
5602
5719
  }
5603
- function le(p) {
5604
- var c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = c.iri ? $ : f, R = [], E = M[(c.scheme || p.scheme || "").toLowerCase()];
5605
- if (E && E.serialize && E.serialize(p, c), p.host && !m.IPV6ADDRESS.test(p.host)) {
5720
+ function le(f) {
5721
+ var c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = c.iri ? g : p, R = [], E = M[(c.scheme || f.scheme || "").toLowerCase()];
5722
+ if (E && E.serialize && E.serialize(f, c), f.host && !m.IPV6ADDRESS.test(f.host)) {
5606
5723
  if (c.domainHost || E && E.domainHost)
5607
5724
  try {
5608
- p.host = c.iri ? N.toUnicode(p.host) : N.toASCII(p.host.replace(m.PCT_ENCODED, W).toLowerCase());
5609
- } catch (J) {
5610
- p.error = p.error || "Host's domain name can not be converted to " + (c.iri ? "Unicode" : "ASCII") + " via punycode: " + J;
5725
+ f.host = c.iri ? N.toUnicode(f.host) : N.toASCII(f.host.replace(m.PCT_ENCODED, W).toLowerCase());
5726
+ } catch (Q) {
5727
+ f.error = f.error || "Host's domain name can not be converted to " + (c.iri ? "Unicode" : "ASCII") + " via punycode: " + Q;
5611
5728
  }
5612
5729
  }
5613
- G(p, m), c.reference !== "suffix" && p.scheme && (R.push(p.scheme), R.push(":"));
5614
- var U = nt(p, c);
5615
- if (U !== void 0 && (c.reference !== "suffix" && R.push("//"), R.push(U), p.path && p.path.charAt(0) !== "/" && R.push("/")), p.path !== void 0) {
5616
- var L = p.path;
5730
+ G(f, m), c.reference !== "suffix" && f.scheme && (R.push(f.scheme), R.push(":"));
5731
+ var U = tt(f, c);
5732
+ if (U !== void 0 && (c.reference !== "suffix" && R.push("//"), R.push(U), f.path && f.path.charAt(0) !== "/" && R.push("/")), f.path !== void 0) {
5733
+ var L = f.path;
5617
5734
  !c.absolutePath && (!E || !E.absolutePath) && (L = me(L)), U === void 0 && (L = L.replace(/^\/\//, "/%2F")), R.push(L);
5618
5735
  }
5619
- return p.query !== void 0 && (R.push("?"), R.push(p.query)), p.fragment !== void 0 && (R.push("#"), R.push(p.fragment)), R.join("");
5736
+ return f.query !== void 0 && (R.push("?"), R.push(f.query)), f.fragment !== void 0 && (R.push("#"), R.push(f.fragment)), R.join("");
5620
5737
  }
5621
- function xe(p, c) {
5738
+ function Ve(f, c) {
5622
5739
  var m = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, R = arguments[3], E = {};
5623
- return R || (p = de(le(p, m), m), c = de(le(c, m), m)), m = m || {}, !m.tolerant && c.scheme ? (E.scheme = c.scheme, E.userinfo = c.userinfo, E.host = c.host, E.port = c.port, E.path = me(c.path || ""), E.query = c.query) : (c.userinfo !== void 0 || c.host !== void 0 || c.port !== void 0 ? (E.userinfo = c.userinfo, E.host = c.host, E.port = c.port, E.path = me(c.path || ""), E.query = c.query) : (c.path ? (c.path.charAt(0) === "/" ? E.path = me(c.path) : ((p.userinfo !== void 0 || p.host !== void 0 || p.port !== void 0) && !p.path ? E.path = "/" + c.path : p.path ? E.path = p.path.slice(0, p.path.lastIndexOf("/") + 1) + c.path : E.path = c.path, E.path = me(E.path)), E.query = c.query) : (E.path = p.path, c.query !== void 0 ? E.query = c.query : E.query = p.query), E.userinfo = p.userinfo, E.host = p.host, E.port = p.port), E.scheme = p.scheme), E.fragment = c.fragment, E;
5740
+ return R || (f = de(le(f, m), m), c = de(le(c, m), m)), m = m || {}, !m.tolerant && c.scheme ? (E.scheme = c.scheme, E.userinfo = c.userinfo, E.host = c.host, E.port = c.port, E.path = me(c.path || ""), E.query = c.query) : (c.userinfo !== void 0 || c.host !== void 0 || c.port !== void 0 ? (E.userinfo = c.userinfo, E.host = c.host, E.port = c.port, E.path = me(c.path || ""), E.query = c.query) : (c.path ? (c.path.charAt(0) === "/" ? E.path = me(c.path) : ((f.userinfo !== void 0 || f.host !== void 0 || f.port !== void 0) && !f.path ? E.path = "/" + c.path : f.path ? E.path = f.path.slice(0, f.path.lastIndexOf("/") + 1) + c.path : E.path = c.path, E.path = me(E.path)), E.query = c.query) : (E.path = f.path, c.query !== void 0 ? E.query = c.query : E.query = f.query), E.userinfo = f.userinfo, E.host = f.host, E.port = f.port), E.scheme = f.scheme), E.fragment = c.fragment, E;
5624
5741
  }
5625
- function it(p, c, m) {
5742
+ function nt(f, c, m) {
5626
5743
  var R = d({ scheme: "null" }, m);
5627
- return le(xe(de(p, R), de(c, R), R, !0), R);
5744
+ return le(Ve(de(f, R), de(c, R), R, !0), R);
5628
5745
  }
5629
- function Oe(p, c) {
5630
- return typeof p == "string" ? p = le(de(p, c), c) : i(p) === "object" && (p = de(le(p, c), c)), p;
5746
+ function Ce(f, c) {
5747
+ return typeof f == "string" ? f = le(de(f, c), c) : i(f) === "object" && (f = de(le(f, c), c)), f;
5631
5748
  }
5632
- function ot(p, c, m) {
5633
- return typeof p == "string" ? p = le(de(p, m), m) : i(p) === "object" && (p = le(p, m)), typeof c == "string" ? c = le(de(c, m), m) : i(c) === "object" && (c = le(c, m)), p === c;
5749
+ function st(f, c, m) {
5750
+ return typeof f == "string" ? f = le(de(f, m), m) : i(f) === "object" && (f = le(f, m)), typeof c == "string" ? c = le(de(c, m), m) : i(c) === "object" && (c = le(c, m)), f === c;
5634
5751
  }
5635
- function ut(p, c) {
5636
- return p && p.toString().replace(!c || !c.iri ? f.ESCAPE : $.ESCAPE, q);
5752
+ function lt(f, c) {
5753
+ return f && f.toString().replace(!c || !c.iri ? p.ESCAPE : g.ESCAPE, q);
5637
5754
  }
5638
- function pe(p, c) {
5639
- return p && p.toString().replace(!c || !c.iri ? f.PCT_ENCODED : $.PCT_ENCODED, W);
5755
+ function pe(f, c) {
5756
+ return f && f.toString().replace(!c || !c.iri ? p.PCT_ENCODED : g.PCT_ENCODED, W);
5640
5757
  }
5641
- var Ne = {
5758
+ var Oe = {
5642
5759
  scheme: "http",
5643
5760
  domainHost: !0,
5644
5761
  parse: function(c, m) {
@@ -5648,50 +5765,50 @@ var uri$1 = {}, uri_all = { exports: {} };
5648
5765
  var R = String(c.scheme).toLowerCase() === "https";
5649
5766
  return (c.port === (R ? 443 : 80) || c.port === "") && (c.port = void 0), c.path || (c.path = "/"), c;
5650
5767
  }
5651
- }, It = {
5768
+ }, jt = {
5652
5769
  scheme: "https",
5653
- domainHost: Ne.domainHost,
5654
- parse: Ne.parse,
5655
- serialize: Ne.serialize
5770
+ domainHost: Oe.domainHost,
5771
+ parse: Oe.parse,
5772
+ serialize: Oe.serialize
5656
5773
  };
5657
- function jt(p) {
5658
- return typeof p.secure == "boolean" ? p.secure : String(p.scheme).toLowerCase() === "wss";
5774
+ function At(f) {
5775
+ return typeof f.secure == "boolean" ? f.secure : String(f.scheme).toLowerCase() === "wss";
5659
5776
  }
5660
- var at = {
5777
+ var it = {
5661
5778
  scheme: "ws",
5662
5779
  domainHost: !0,
5663
5780
  parse: function(c, m) {
5664
5781
  var R = c;
5665
- return R.secure = jt(R), R.resourceName = (R.path || "/") + (R.query ? "?" + R.query : ""), R.path = void 0, R.query = void 0, R;
5782
+ return R.secure = At(R), R.resourceName = (R.path || "/") + (R.query ? "?" + R.query : ""), R.path = void 0, R.query = void 0, R;
5666
5783
  },
5667
5784
  serialize: function(c, m) {
5668
- if ((c.port === (jt(c) ? 443 : 80) || c.port === "") && (c.port = void 0), typeof c.secure == "boolean" && (c.scheme = c.secure ? "wss" : "ws", c.secure = void 0), c.resourceName) {
5785
+ if ((c.port === (At(c) ? 443 : 80) || c.port === "") && (c.port = void 0), typeof c.secure == "boolean" && (c.scheme = c.secure ? "wss" : "ws", c.secure = void 0), c.resourceName) {
5669
5786
  var R = c.resourceName.split("?"), E = O(R, 2), U = E[0], L = E[1];
5670
5787
  c.path = U && U !== "/" ? U : void 0, c.query = L, c.resourceName = void 0;
5671
5788
  }
5672
5789
  return c.fragment = void 0, c;
5673
5790
  }
5674
- }, At = {
5791
+ }, Dt = {
5675
5792
  scheme: "wss",
5676
- domainHost: at.domainHost,
5677
- parse: at.parse,
5678
- serialize: at.serialize
5679
- }, ir = {}, Dt = "[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]", _e = "[0-9A-Fa-f]", or = s(s("%[EFef]" + _e + "%" + _e + _e + "%" + _e + _e) + "|" + s("%[89A-Fa-f]" + _e + "%" + _e + _e) + "|" + s("%" + _e + _e)), ar = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]", cr = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]", lr = n(cr, '[\\"\\\\]'), dr = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]", ur = new RegExp(Dt, "g"), We = new RegExp(or, "g"), pr = new RegExp(n("[^]", ar, "[\\.]", '[\\"]', lr), "g"), Ft = new RegExp(n("[^]", Dt, dr), "g"), fr = Ft;
5680
- function Ot(p) {
5681
- var c = W(p);
5682
- return c.match(ur) ? c : p;
5683
- }
5684
- var Mt = {
5793
+ domainHost: it.domainHost,
5794
+ parse: it.parse,
5795
+ serialize: it.serialize
5796
+ }, lr = {}, Ft = "[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]", _e = "[0-9A-Fa-f]", dr = s(s("%[EFef]" + _e + "%" + _e + _e + "%" + _e + _e) + "|" + s("%[89A-Fa-f]" + _e + "%" + _e + _e) + "|" + s("%" + _e + _e)), ur = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]", pr = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]", fr = n(pr, '[\\"\\\\]'), hr = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]", mr = new RegExp(Ft, "g"), ze = new RegExp(dr, "g"), _r = new RegExp(n("[^]", ur, "[\\.]", '[\\"]', fr), "g"), Mt = new RegExp(n("[^]", Ft, hr), "g"), gr = Mt;
5797
+ function Nt(f) {
5798
+ var c = W(f);
5799
+ return c.match(mr) ? c : f;
5800
+ }
5801
+ var qt = {
5685
5802
  scheme: "mailto",
5686
5803
  parse: function(c, m) {
5687
5804
  var R = c, E = R.to = R.path ? R.path.split(",") : [];
5688
5805
  if (R.path = void 0, R.query) {
5689
- for (var U = !1, L = {}, J = R.query.split("&"), Y = 0, se = J.length; Y < se; ++Y) {
5690
- var B = J[Y].split("=");
5806
+ for (var U = !1, L = {}, Q = R.query.split("&"), Z = 0, ne = Q.length; Z < ne; ++Z) {
5807
+ var B = Q[Z].split("=");
5691
5808
  switch (B[0]) {
5692
5809
  case "to":
5693
- for (var Z = B[1].split(","), ie = 0, z = Z.length; ie < z; ++ie)
5694
- E.push(Z[ie]);
5810
+ for (var Y = B[1].split(","), se = 0, z = Y.length; se < z; ++se)
5811
+ E.push(Y[se]);
5695
5812
  break;
5696
5813
  case "subject":
5697
5814
  R.subject = pe(B[1], m);
@@ -5725,30 +5842,30 @@ var uri$1 = {}, uri_all = { exports: {} };
5725
5842
  var R = c, E = l(c.to);
5726
5843
  if (E) {
5727
5844
  for (var U = 0, L = E.length; U < L; ++U) {
5728
- var J = String(E[U]), Y = J.lastIndexOf("@"), se = J.slice(0, Y).replace(We, Ot).replace(We, o).replace(pr, q), B = J.slice(Y + 1);
5845
+ var Q = String(E[U]), Z = Q.lastIndexOf("@"), ne = Q.slice(0, Z).replace(ze, Nt).replace(ze, o).replace(_r, q), B = Q.slice(Z + 1);
5729
5846
  try {
5730
5847
  B = m.iri ? N.toUnicode(B) : N.toASCII(pe(B, m).toLowerCase());
5731
5848
  } catch (X) {
5732
5849
  R.error = R.error || "Email address's domain name can not be converted to " + (m.iri ? "Unicode" : "ASCII") + " via punycode: " + X;
5733
5850
  }
5734
- E[U] = se + "@" + B;
5851
+ E[U] = ne + "@" + B;
5735
5852
  }
5736
5853
  R.path = E.join(",");
5737
5854
  }
5738
- var Z = c.headers = c.headers || {};
5739
- c.subject && (Z.subject = c.subject), c.body && (Z.body = c.body);
5740
- var ie = [];
5741
- for (var z in Z)
5742
- Z[z] !== ir[z] && ie.push(z.replace(We, Ot).replace(We, o).replace(Ft, q) + "=" + Z[z].replace(We, Ot).replace(We, o).replace(fr, q));
5743
- return ie.length && (R.query = ie.join("&")), R;
5855
+ var Y = c.headers = c.headers || {};
5856
+ c.subject && (Y.subject = c.subject), c.body && (Y.body = c.body);
5857
+ var se = [];
5858
+ for (var z in Y)
5859
+ Y[z] !== lr[z] && se.push(z.replace(ze, Nt).replace(ze, o).replace(Mt, q) + "=" + Y[z].replace(ze, Nt).replace(ze, o).replace(gr, q));
5860
+ return se.length && (R.query = se.join("&")), R;
5744
5861
  }
5745
- }, hr = /^([^\:]+)\:(.*)/, qt = {
5862
+ }, $r = /^([^\:]+)\:(.*)/, Ut = {
5746
5863
  scheme: "urn",
5747
5864
  parse: function(c, m) {
5748
- var R = c.path && c.path.match(hr), E = c;
5865
+ var R = c.path && c.path.match($r), E = c;
5749
5866
  if (R) {
5750
- var U = m.scheme || E.scheme || "urn", L = R[1].toLowerCase(), J = R[2], Y = U + ":" + (m.nid || L), se = M[Y];
5751
- E.nid = L, E.nss = J, E.path = void 0, se && (E = se.parse(E, m));
5867
+ var U = m.scheme || E.scheme || "urn", L = R[1].toLowerCase(), Q = R[2], Z = U + ":" + (m.nid || L), ne = M[Z];
5868
+ E.nid = L, E.nss = Q, E.path = void 0, ne && (E = ne.parse(E, m));
5752
5869
  } else
5753
5870
  E.error = E.error || "URN can not be parsed.";
5754
5871
  return E;
@@ -5756,21 +5873,21 @@ var uri$1 = {}, uri_all = { exports: {} };
5756
5873
  serialize: function(c, m) {
5757
5874
  var R = m.scheme || c.scheme || "urn", E = c.nid, U = R + ":" + (m.nid || E), L = M[U];
5758
5875
  L && (c = L.serialize(c, m));
5759
- var J = c, Y = c.nss;
5760
- return J.path = (E || m.nid) + ":" + Y, J;
5876
+ var Q = c, Z = c.nss;
5877
+ return Q.path = (E || m.nid) + ":" + Z, Q;
5761
5878
  }
5762
- }, mr = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/, Ut = {
5879
+ }, yr = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/, Lt = {
5763
5880
  scheme: "urn:uuid",
5764
5881
  parse: function(c, m) {
5765
5882
  var R = c;
5766
- return R.uuid = R.nss, R.nss = void 0, !m.tolerant && (!R.uuid || !R.uuid.match(mr)) && (R.error = R.error || "UUID is not valid."), R;
5883
+ return R.uuid = R.nss, R.nss = void 0, !m.tolerant && (!R.uuid || !R.uuid.match(yr)) && (R.error = R.error || "UUID is not valid."), R;
5767
5884
  },
5768
5885
  serialize: function(c, m) {
5769
5886
  var R = c;
5770
5887
  return R.nss = (c.uuid || "").toLowerCase(), R;
5771
5888
  }
5772
5889
  };
5773
- M[Ne.scheme] = Ne, M[It.scheme] = It, M[at.scheme] = at, M[At.scheme] = At, M[Mt.scheme] = Mt, M[qt.scheme] = qt, M[Ut.scheme] = Ut, r.SCHEMES = M, r.pctEncChar = q, r.pctDecChars = W, r.parse = de, r.removeDotSegments = me, r.serialize = le, r.resolveComponents = xe, r.resolve = it, r.normalize = Oe, r.equal = ot, r.escapeComponent = ut, r.unescapeComponent = pe, Object.defineProperty(r, "__esModule", { value: !0 });
5890
+ M[Oe.scheme] = Oe, M[jt.scheme] = jt, M[it.scheme] = it, M[Dt.scheme] = Dt, M[qt.scheme] = qt, M[Ut.scheme] = Ut, M[Lt.scheme] = Lt, r.SCHEMES = M, r.pctEncChar = q, r.pctDecChars = W, r.parse = de, r.removeDotSegments = me, r.serialize = le, r.resolveComponents = Ve, r.resolve = nt, r.normalize = Ce, r.equal = st, r.escapeComponent = lt, r.unescapeComponent = pe, Object.defineProperty(r, "__esModule", { value: !0 });
5774
5891
  });
5775
5892
  })(uri_all, uri_all.exports);
5776
5893
  var uri_allExports = uri_all.exports;
@@ -5798,7 +5915,7 @@ uri$1.default = uri;
5798
5915
  } }), Object.defineProperty(e, "CodeGen", { enumerable: !0, get: function() {
5799
5916
  return r.CodeGen;
5800
5917
  } });
5801
- const n = validation_error, s = ref_error, i = rules, o = compile, l = codegen, d = resolve$1, u = dataType, f = util, $ = require$$9, O = uri$1, C = (F, v) => new RegExp(F, v);
5918
+ const n = validation_error, s = ref_error, i = rules, o = compile, l = codegen, d = resolve$1, u = dataType, p = util, g = require$$9, O = uri$1, C = (F, v) => new RegExp(F, v);
5802
5919
  C.code = "new RegExp";
5803
5920
  const S = ["removeAdditional", "useDefaults", "coerceTypes"], T = /* @__PURE__ */ new Set([
5804
5921
  "validate",
@@ -5834,36 +5951,36 @@ uri$1.default = uri;
5834
5951
  ignoreKeywordsWithRef: "",
5835
5952
  jsPropertySyntax: "",
5836
5953
  unicode: '"minLength"/"maxLength" account for unicode characters by default.'
5837
- }, g = 200;
5954
+ }, $ = 200;
5838
5955
  function P(F) {
5839
- var v, j, b, a, h, N, M, q, W, G, ne, he, Le, tt, rt, de, nt, He, Ve, ze, st, me, le, xe, it;
5840
- const Oe = F.strict, ot = (v = F.code) === null || v === void 0 ? void 0 : v.optimize, ut = ot === !0 || ot === void 0 ? 1 : ot || 0, pe = (b = (j = F.code) === null || j === void 0 ? void 0 : j.regExp) !== null && b !== void 0 ? b : C, Ne = (a = F.uriResolver) !== null && a !== void 0 ? a : O.default;
5956
+ var v, j, b, a, h, N, M, q, W, G, re, he, qe, Xe, et, de, tt, Ue, Le, He, rt, me, le, Ve, nt;
5957
+ const Ce = F.strict, st = (v = F.code) === null || v === void 0 ? void 0 : v.optimize, lt = st === !0 || st === void 0 ? 1 : st || 0, pe = (b = (j = F.code) === null || j === void 0 ? void 0 : j.regExp) !== null && b !== void 0 ? b : C, Oe = (a = F.uriResolver) !== null && a !== void 0 ? a : O.default;
5841
5958
  return {
5842
- strictSchema: (N = (h = F.strictSchema) !== null && h !== void 0 ? h : Oe) !== null && N !== void 0 ? N : !0,
5843
- strictNumbers: (q = (M = F.strictNumbers) !== null && M !== void 0 ? M : Oe) !== null && q !== void 0 ? q : !0,
5844
- strictTypes: (G = (W = F.strictTypes) !== null && W !== void 0 ? W : Oe) !== null && G !== void 0 ? G : "log",
5845
- strictTuples: (he = (ne = F.strictTuples) !== null && ne !== void 0 ? ne : Oe) !== null && he !== void 0 ? he : "log",
5846
- strictRequired: (tt = (Le = F.strictRequired) !== null && Le !== void 0 ? Le : Oe) !== null && tt !== void 0 ? tt : !1,
5847
- code: F.code ? { ...F.code, optimize: ut, regExp: pe } : { optimize: ut, regExp: pe },
5848
- loopRequired: (rt = F.loopRequired) !== null && rt !== void 0 ? rt : g,
5849
- loopEnum: (de = F.loopEnum) !== null && de !== void 0 ? de : g,
5850
- meta: (nt = F.meta) !== null && nt !== void 0 ? nt : !0,
5851
- messages: (He = F.messages) !== null && He !== void 0 ? He : !0,
5852
- inlineRefs: (Ve = F.inlineRefs) !== null && Ve !== void 0 ? Ve : !0,
5853
- schemaId: (ze = F.schemaId) !== null && ze !== void 0 ? ze : "$id",
5854
- addUsedSchema: (st = F.addUsedSchema) !== null && st !== void 0 ? st : !0,
5959
+ strictSchema: (N = (h = F.strictSchema) !== null && h !== void 0 ? h : Ce) !== null && N !== void 0 ? N : !0,
5960
+ strictNumbers: (q = (M = F.strictNumbers) !== null && M !== void 0 ? M : Ce) !== null && q !== void 0 ? q : !0,
5961
+ strictTypes: (G = (W = F.strictTypes) !== null && W !== void 0 ? W : Ce) !== null && G !== void 0 ? G : "log",
5962
+ strictTuples: (he = (re = F.strictTuples) !== null && re !== void 0 ? re : Ce) !== null && he !== void 0 ? he : "log",
5963
+ strictRequired: (Xe = (qe = F.strictRequired) !== null && qe !== void 0 ? qe : Ce) !== null && Xe !== void 0 ? Xe : !1,
5964
+ code: F.code ? { ...F.code, optimize: lt, regExp: pe } : { optimize: lt, regExp: pe },
5965
+ loopRequired: (et = F.loopRequired) !== null && et !== void 0 ? et : $,
5966
+ loopEnum: (de = F.loopEnum) !== null && de !== void 0 ? de : $,
5967
+ meta: (tt = F.meta) !== null && tt !== void 0 ? tt : !0,
5968
+ messages: (Ue = F.messages) !== null && Ue !== void 0 ? Ue : !0,
5969
+ inlineRefs: (Le = F.inlineRefs) !== null && Le !== void 0 ? Le : !0,
5970
+ schemaId: (He = F.schemaId) !== null && He !== void 0 ? He : "$id",
5971
+ addUsedSchema: (rt = F.addUsedSchema) !== null && rt !== void 0 ? rt : !0,
5855
5972
  validateSchema: (me = F.validateSchema) !== null && me !== void 0 ? me : !0,
5856
5973
  validateFormats: (le = F.validateFormats) !== null && le !== void 0 ? le : !0,
5857
- unicodeRegExp: (xe = F.unicodeRegExp) !== null && xe !== void 0 ? xe : !0,
5858
- int32range: (it = F.int32range) !== null && it !== void 0 ? it : !0,
5859
- uriResolver: Ne
5974
+ unicodeRegExp: (Ve = F.unicodeRegExp) !== null && Ve !== void 0 ? Ve : !0,
5975
+ int32range: (nt = F.int32range) !== null && nt !== void 0 ? nt : !0,
5976
+ uriResolver: Oe
5860
5977
  };
5861
5978
  }
5862
5979
  class I {
5863
5980
  constructor(v = {}) {
5864
5981
  this.schemas = {}, this.refs = {}, this.formats = {}, this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), v = this.opts = { ...v, ...P(v) };
5865
5982
  const { es5: j, lines: b } = this.opts.code;
5866
- this.scope = new l.ValueScope({ scope: {}, prefixes: T, es5: j, lines: b }), this.logger = K(v.logger);
5983
+ this.scope = new l.ValueScope({ scope: {}, prefixes: T, es5: j, lines: b }), this.logger = J(v.logger);
5867
5984
  const a = v.validateFormats;
5868
5985
  v.validateFormats = !1, this.RULES = (0, i.getRules)(), D.call(this, y, v, "NOT SUPPORTED"), D.call(this, _, v, "DEPRECATED", "warn"), this._metaOpts = x.call(this), v.formats && A.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), v.keywords && V.call(this, v.keywords), typeof v.meta == "object" && this.addMetaSchema(v.meta), k.call(this), v.validateFormats = a;
5869
5986
  }
@@ -5872,8 +5989,8 @@ uri$1.default = uri;
5872
5989
  }
5873
5990
  _addDefaultMetaSchema() {
5874
5991
  const { $data: v, meta: j, schemaId: b } = this.opts;
5875
- let a = $;
5876
- b === "id" && (a = { ...$ }, a.id = a.$id, delete a.$id), j && v && this.addMetaSchema(a, a[b], !1);
5992
+ let a = g;
5993
+ b === "id" && (a = { ...g }, a.id = a.$id, delete a.$id), j && v && this.addMetaSchema(a, a[b], !1);
5877
5994
  }
5878
5995
  defaultMeta() {
5879
5996
  const { meta: v, schemaId: j } = this.opts;
@@ -5898,9 +6015,9 @@ uri$1.default = uri;
5898
6015
  throw new Error("options.loadSchema should be a function");
5899
6016
  const { loadSchema: b } = this.opts;
5900
6017
  return a.call(this, v, j);
5901
- async function a(G, ne) {
6018
+ async function a(G, re) {
5902
6019
  await h.call(this, G.$schema);
5903
- const he = this._addSchema(G, ne);
6020
+ const he = this._addSchema(G, re);
5904
6021
  return he.validate || N.call(this, he);
5905
6022
  }
5906
6023
  async function h(G) {
@@ -5909,24 +6026,24 @@ uri$1.default = uri;
5909
6026
  async function N(G) {
5910
6027
  try {
5911
6028
  return this._compileSchemaEnv(G);
5912
- } catch (ne) {
5913
- if (!(ne instanceof s.default))
5914
- throw ne;
5915
- return M.call(this, ne), await q.call(this, ne.missingSchema), N.call(this, G);
6029
+ } catch (re) {
6030
+ if (!(re instanceof s.default))
6031
+ throw re;
6032
+ return M.call(this, re), await q.call(this, re.missingSchema), N.call(this, G);
5916
6033
  }
5917
6034
  }
5918
- function M({ missingSchema: G, missingRef: ne }) {
6035
+ function M({ missingSchema: G, missingRef: re }) {
5919
6036
  if (this.refs[G])
5920
- throw new Error(`AnySchema ${G} is loaded but ${ne} cannot be resolved`);
6037
+ throw new Error(`AnySchema ${G} is loaded but ${re} cannot be resolved`);
5921
6038
  }
5922
6039
  async function q(G) {
5923
- const ne = await W.call(this, G);
5924
- this.refs[G] || await h.call(this, ne.$schema), this.refs[G] || this.addSchema(ne, G, j);
6040
+ const re = await W.call(this, G);
6041
+ this.refs[G] || await h.call(this, re.$schema), this.refs[G] || this.addSchema(re, G, j);
5925
6042
  }
5926
6043
  async function W(G) {
5927
- const ne = this._loading[G];
5928
- if (ne)
5929
- return ne;
6044
+ const re = this._loading[G];
6045
+ if (re)
6046
+ return re;
5930
6047
  try {
5931
6048
  return await (this._loading[G] = b(G));
5932
6049
  } finally {
@@ -6027,14 +6144,14 @@ uri$1.default = uri;
6027
6144
  } else
6028
6145
  throw new Error("invalid addKeywords parameters");
6029
6146
  if (oe.call(this, b, j), !j)
6030
- return (0, f.eachItem)(b, (h) => ke.call(this, h)), this;
6031
- qe.call(this, j);
6147
+ return (0, p.eachItem)(b, (h) => Te.call(this, h)), this;
6148
+ Fe.call(this, j);
6032
6149
  const a = {
6033
6150
  ...j,
6034
6151
  type: (0, u.getJSONTypes)(j.type),
6035
6152
  schemaType: (0, u.getJSONTypes)(j.schemaType)
6036
6153
  };
6037
- return (0, f.eachItem)(b, a.type.length === 0 ? (h) => ke.call(this, h, a) : (h) => a.type.forEach((N) => ke.call(this, h, a, N))), this;
6154
+ return (0, p.eachItem)(b, a.type.length === 0 ? (h) => Te.call(this, h, a) : (h) => a.type.forEach((N) => Te.call(this, h, a, N))), this;
6038
6155
  }
6039
6156
  getKeyword(v) {
6040
6157
  const j = this.RULES.all[v];
@@ -6070,7 +6187,7 @@ uri$1.default = uri;
6070
6187
  if (typeof q != "object")
6071
6188
  continue;
6072
6189
  const { $data: W } = q.definition, G = N[M];
6073
- W && G && (N[M] = Ue(G));
6190
+ W && G && (N[M] = Me(G));
6074
6191
  }
6075
6192
  }
6076
6193
  return v;
@@ -6160,13 +6277,13 @@ uri$1.default = uri;
6160
6277
  delete F[v];
6161
6278
  return F;
6162
6279
  }
6163
- const re = { log() {
6280
+ const te = { log() {
6164
6281
  }, warn() {
6165
6282
  }, error() {
6166
6283
  } };
6167
- function K(F) {
6284
+ function J(F) {
6168
6285
  if (F === !1)
6169
- return re;
6286
+ return te;
6170
6287
  if (F === void 0)
6171
6288
  return console;
6172
6289
  if (F.log && F.warn && F.error)
@@ -6176,7 +6293,7 @@ uri$1.default = uri;
6176
6293
  const ue = /^[a-z_$][a-z0-9_$:-]*$/i;
6177
6294
  function oe(F, v) {
6178
6295
  const { RULES: j } = this;
6179
- if ((0, f.eachItem)(F, (b) => {
6296
+ if ((0, p.eachItem)(F, (b) => {
6180
6297
  if (j.keywords[b])
6181
6298
  throw new Error(`Keyword ${b} is already defined`);
6182
6299
  if (!ue.test(b))
@@ -6184,7 +6301,7 @@ uri$1.default = uri;
6184
6301
  }), !!v && v.$data && !("code" in v || "validate" in v))
6185
6302
  throw new Error('$data keyword must have "code" or "validate" function');
6186
6303
  }
6187
- function ke(F, v, j) {
6304
+ function Te(F, v, j) {
6188
6305
  var b;
6189
6306
  const a = v == null ? void 0 : v.post;
6190
6307
  if (j && a)
@@ -6201,21 +6318,21 @@ uri$1.default = uri;
6201
6318
  schemaType: (0, u.getJSONTypes)(v.schemaType)
6202
6319
  }
6203
6320
  };
6204
- v.before ? Ce.call(this, N, M, v.before) : N.rules.push(M), h.all[F] = M, (b = v.implements) === null || b === void 0 || b.forEach((q) => this.addKeyword(q));
6321
+ v.before ? ke.call(this, N, M, v.before) : N.rules.push(M), h.all[F] = M, (b = v.implements) === null || b === void 0 || b.forEach((q) => this.addKeyword(q));
6205
6322
  }
6206
- function Ce(F, v, j) {
6323
+ function ke(F, v, j) {
6207
6324
  const b = F.rules.findIndex((a) => a.keyword === j);
6208
6325
  b >= 0 ? F.rules.splice(b, 0, v) : (F.rules.push(v), this.logger.warn(`rule ${j} is not defined`));
6209
6326
  }
6210
- function qe(F) {
6327
+ function Fe(F) {
6211
6328
  let { metaSchema: v } = F;
6212
- v !== void 0 && (F.$data && this.opts.$data && (v = Ue(v)), F.validateSchema = this.compile(v, !0));
6329
+ v !== void 0 && (F.$data && this.opts.$data && (v = Me(v)), F.validateSchema = this.compile(v, !0));
6213
6330
  }
6214
- const et = {
6331
+ const Ze = {
6215
6332
  $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"
6216
6333
  };
6217
- function Ue(F) {
6218
- return { anyOf: [F, et] };
6334
+ function Me(F) {
6335
+ return { anyOf: [F, Ze] };
6219
6336
  }
6220
6337
  })(core$2);
6221
6338
  var draft7 = {}, core$1 = {}, id = {};
@@ -6236,14 +6353,14 @@ const ref_error_1 = ref_error, code_1$8 = code, codegen_1$l = codegen, names_1$1
6236
6353
  code(e) {
6237
6354
  const { gen: t, schema: r, it: n } = e, { baseId: s, schemaEnv: i, validateName: o, opts: l, self: d } = n, { root: u } = i;
6238
6355
  if ((r === "#" || r === "#/") && s === u.baseId)
6239
- return $();
6240
- const f = compile_1$1.resolveRef.call(d, u, s, r);
6241
- if (f === void 0)
6356
+ return g();
6357
+ const p = compile_1$1.resolveRef.call(d, u, s, r);
6358
+ if (p === void 0)
6242
6359
  throw new ref_error_1.default(n.opts.uriResolver, s, r);
6243
- if (f instanceof compile_1$1.SchemaEnv)
6244
- return O(f);
6245
- return C(f);
6246
- function $() {
6360
+ if (p instanceof compile_1$1.SchemaEnv)
6361
+ return O(p);
6362
+ return C(p);
6363
+ function g() {
6247
6364
  if (i === u)
6248
6365
  return callRef(e, o, i, i.$async);
6249
6366
  const S = t.scopeValue("root", { ref: u });
@@ -6272,8 +6389,8 @@ function getValidate(e, t) {
6272
6389
  ref.getValidate = getValidate;
6273
6390
  function callRef(e, t, r, n) {
6274
6391
  const { gen: s, it: i } = e, { allErrors: o, schemaEnv: l, opts: d } = i, u = d.passContext ? names_1$1.default.this : codegen_1$l.nil;
6275
- n ? f() : $();
6276
- function f() {
6392
+ n ? p() : g();
6393
+ function p() {
6277
6394
  if (!l.$async)
6278
6395
  throw new Error("async schema referenced by sync schema");
6279
6396
  const S = s.let("valid");
@@ -6283,7 +6400,7 @@ function callRef(e, t, r, n) {
6283
6400
  s.if((0, codegen_1$l._)`!(${T} instanceof ${i.ValidationError})`, () => s.throw(T)), O(T), o || s.assign(S, !1);
6284
6401
  }), e.ok(S);
6285
6402
  }
6286
- function $() {
6403
+ function g() {
6287
6404
  e.result((0, code_1$8.callValidateCode)(e, t, u), () => C(t), () => O(t));
6288
6405
  }
6289
6406
  function O(S) {
@@ -6447,7 +6564,7 @@ const code_1$6 = code, codegen_1$f = codegen, util_1$h = util, error$d = {
6447
6564
  if (!i && r.length === 0)
6448
6565
  return;
6449
6566
  const d = r.length >= l.loopRequired;
6450
- if (o.allErrors ? u() : f(), l.strictRequired) {
6567
+ if (o.allErrors ? u() : p(), l.strictRequired) {
6451
6568
  const C = e.parentSchema.properties, { definedProperties: S } = e.it;
6452
6569
  for (const T of r)
6453
6570
  if ((C == null ? void 0 : C[T]) === void 0 && !S.has(T)) {
@@ -6457,12 +6574,12 @@ const code_1$6 = code, codegen_1$f = codegen, util_1$h = util, error$d = {
6457
6574
  }
6458
6575
  function u() {
6459
6576
  if (d || i)
6460
- e.block$data(codegen_1$f.nil, $);
6577
+ e.block$data(codegen_1$f.nil, g);
6461
6578
  else
6462
6579
  for (const C of r)
6463
6580
  (0, code_1$6.checkReportMissingProp)(e, C);
6464
6581
  }
6465
- function f() {
6582
+ function p() {
6466
6583
  const C = t.let("missing");
6467
6584
  if (d || i) {
6468
6585
  const S = t.let("valid", !0);
@@ -6470,7 +6587,7 @@ const code_1$6 = code, codegen_1$f = codegen, util_1$h = util, error$d = {
6470
6587
  } else
6471
6588
  t.if((0, code_1$6.checkMissingProp)(e, r, C)), (0, code_1$6.reportMissingProp)(e, C), t.else();
6472
6589
  }
6473
- function $() {
6590
+ function g() {
6474
6591
  t.forOf("prop", n, (C) => {
6475
6592
  e.setParams({ missingProperty: C }), t.if((0, code_1$6.noPropertyInData)(t, s, C, l.ownProperties), () => e.error());
6476
6593
  });
@@ -6525,20 +6642,20 @@ const dataType_1 = dataType, codegen_1$d = codegen, util_1$g = util, equal_1$2 =
6525
6642
  if (!n && !s)
6526
6643
  return;
6527
6644
  const d = t.let("valid"), u = i.items ? (0, dataType_1.getSchemaTypes)(i.items) : [];
6528
- e.block$data(d, f, (0, codegen_1$d._)`${o} === false`), e.ok(d);
6529
- function f() {
6645
+ e.block$data(d, p, (0, codegen_1$d._)`${o} === false`), e.ok(d);
6646
+ function p() {
6530
6647
  const S = t.let("i", (0, codegen_1$d._)`${r}.length`), T = t.let("j");
6531
- e.setParams({ i: S, j: T }), t.assign(d, !0), t.if((0, codegen_1$d._)`${S} > 1`, () => ($() ? O : C)(S, T));
6648
+ e.setParams({ i: S, j: T }), t.assign(d, !0), t.if((0, codegen_1$d._)`${S} > 1`, () => (g() ? O : C)(S, T));
6532
6649
  }
6533
- function $() {
6650
+ function g() {
6534
6651
  return u.length > 0 && !u.some((S) => S === "object" || S === "array");
6535
6652
  }
6536
6653
  function O(S, T) {
6537
- const y = t.name("item"), _ = (0, dataType_1.checkDataTypes)(u, y, l.opts.strictNumbers, dataType_1.DataType.Wrong), g = t.const("indices", (0, codegen_1$d._)`{}`);
6654
+ const y = t.name("item"), _ = (0, dataType_1.checkDataTypes)(u, y, l.opts.strictNumbers, dataType_1.DataType.Wrong), $ = t.const("indices", (0, codegen_1$d._)`{}`);
6538
6655
  t.for((0, codegen_1$d._)`;${S}--;`, () => {
6539
- t.let(y, (0, codegen_1$d._)`${r}[${S}]`), t.if(_, (0, codegen_1$d._)`continue`), u.length > 1 && t.if((0, codegen_1$d._)`typeof ${y} == "string"`, (0, codegen_1$d._)`${y} += "_"`), t.if((0, codegen_1$d._)`typeof ${g}[${y}] == "number"`, () => {
6540
- t.assign(T, (0, codegen_1$d._)`${g}[${y}]`), e.error(), t.assign(d, !1).break();
6541
- }).code((0, codegen_1$d._)`${g}[${y}] = ${S}`);
6656
+ t.let(y, (0, codegen_1$d._)`${r}[${S}]`), t.if(_, (0, codegen_1$d._)`continue`), u.length > 1 && t.if((0, codegen_1$d._)`typeof ${y} == "string"`, (0, codegen_1$d._)`${y} += "_"`), t.if((0, codegen_1$d._)`typeof ${$}[${y}] == "number"`, () => {
6657
+ t.assign(T, (0, codegen_1$d._)`${$}[${y}]`), e.error(), t.assign(d, !1).break();
6658
+ }).code((0, codegen_1$d._)`${$}[${y}] = ${S}`);
6542
6659
  });
6543
6660
  }
6544
6661
  function C(S, T) {
@@ -6582,18 +6699,18 @@ const codegen_1$b = codegen, util_1$e = util, equal_1 = equal$1, error$9 = {
6582
6699
  const l = s.length >= o.opts.loopEnum;
6583
6700
  let d;
6584
6701
  const u = () => d ?? (d = (0, util_1$e.useFunc)(t, equal_1.default));
6585
- let f;
6702
+ let p;
6586
6703
  if (l || n)
6587
- f = t.let("valid"), e.block$data(f, $);
6704
+ p = t.let("valid"), e.block$data(p, g);
6588
6705
  else {
6589
6706
  if (!Array.isArray(s))
6590
6707
  throw new Error("ajv implementation error");
6591
6708
  const C = t.const("vSchema", i);
6592
- f = (0, codegen_1$b.or)(...s.map((S, T) => O(C, T)));
6709
+ p = (0, codegen_1$b.or)(...s.map((S, T) => O(C, T)));
6593
6710
  }
6594
- e.pass(f);
6595
- function $() {
6596
- t.assign(f, !1), t.forOf("v", i, (C) => t.if((0, codegen_1$b._)`${u()}(${r}, ${C})`, () => t.assign(f, !0).break()));
6711
+ e.pass(p);
6712
+ function g() {
6713
+ t.assign(p, !1), t.forOf("v", i, (C) => t.if((0, codegen_1$b._)`${u()}(${r}, ${C})`, () => t.assign(p, !0).break()));
6597
6714
  }
6598
6715
  function O(C, S) {
6599
6716
  const T = s[S];
@@ -6655,8 +6772,8 @@ function validateAdditionalItems(e, t) {
6655
6772
  r.if((0, codegen_1$a.not)(u), () => d(u)), e.ok(u);
6656
6773
  }
6657
6774
  function d(u) {
6658
- r.forRange("i", t.length, l, (f) => {
6659
- e.subschema({ keyword: i, dataProp: f, dataPropType: util_1$d.Type.Num }, u), o.allErrors || r.if((0, codegen_1$a.not)(u), () => r.break());
6775
+ r.forRange("i", t.length, l, (p) => {
6776
+ e.subschema({ keyword: i, dataProp: p, dataPropType: util_1$d.Type.Num }, u), o.allErrors || r.if((0, codegen_1$a.not)(u), () => r.break());
6660
6777
  });
6661
6778
  }
6662
6779
  }
@@ -6679,17 +6796,17 @@ const codegen_1$9 = codegen, util_1$c = util, code_1$5 = code, def$f = {
6679
6796
  };
6680
6797
  function validateTuple(e, t, r = e.schema) {
6681
6798
  const { gen: n, parentSchema: s, data: i, keyword: o, it: l } = e;
6682
- f(s), l.opts.unevaluated && r.length && l.items !== !0 && (l.items = util_1$c.mergeEvaluated.items(n, r.length, l.items));
6799
+ p(s), l.opts.unevaluated && r.length && l.items !== !0 && (l.items = util_1$c.mergeEvaluated.items(n, r.length, l.items));
6683
6800
  const d = n.name("valid"), u = n.const("len", (0, codegen_1$9._)`${i}.length`);
6684
- r.forEach(($, O) => {
6685
- (0, util_1$c.alwaysValidSchema)(l, $) || (n.if((0, codegen_1$9._)`${u} > ${O}`, () => e.subschema({
6801
+ r.forEach((g, O) => {
6802
+ (0, util_1$c.alwaysValidSchema)(l, g) || (n.if((0, codegen_1$9._)`${u} > ${O}`, () => e.subschema({
6686
6803
  keyword: o,
6687
6804
  schemaProp: O,
6688
6805
  dataProp: O
6689
6806
  }, d)), e.ok(d));
6690
6807
  });
6691
- function f($) {
6692
- const { opts: O, errSchemaPath: C } = l, S = r.length, T = S === $.minItems && (S === $.maxItems || $[t] === !1);
6808
+ function p(g) {
6809
+ const { opts: O, errSchemaPath: C } = l, S = r.length, T = S === g.minItems && (S === g.maxItems || g[t] === !1);
6693
6810
  if (O.strictTuples && !T) {
6694
6811
  const y = `"${o}" is ${S}-tuple, but minItems or maxItems/${t} are not specified or different at path "${C}"`;
6695
6812
  (0, util_1$c.checkStrictMode)(l, y, O.strictTuples);
@@ -6741,7 +6858,7 @@ const codegen_1$7 = codegen, util_1$a = util, error$6 = {
6741
6858
  let o, l;
6742
6859
  const { minContains: d, maxContains: u } = n;
6743
6860
  i.opts.next ? (o = d === void 0 ? 1 : d, l = u) : o = 1;
6744
- const f = t.const("len", (0, codegen_1$7._)`${s}.length`);
6861
+ const p = t.const("len", (0, codegen_1$7._)`${s}.length`);
6745
6862
  if (e.setParams({ min: o, max: l }), l === void 0 && o === 0) {
6746
6863
  (0, util_1$a.checkStrictMode)(i, '"minContains" == 0 without "maxContains": "contains" keyword ignored');
6747
6864
  return;
@@ -6751,19 +6868,19 @@ const codegen_1$7 = codegen, util_1$a = util, error$6 = {
6751
6868
  return;
6752
6869
  }
6753
6870
  if ((0, util_1$a.alwaysValidSchema)(i, r)) {
6754
- let T = (0, codegen_1$7._)`${f} >= ${o}`;
6755
- l !== void 0 && (T = (0, codegen_1$7._)`${T} && ${f} <= ${l}`), e.pass(T);
6871
+ let T = (0, codegen_1$7._)`${p} >= ${o}`;
6872
+ l !== void 0 && (T = (0, codegen_1$7._)`${T} && ${p} <= ${l}`), e.pass(T);
6756
6873
  return;
6757
6874
  }
6758
6875
  i.items = !0;
6759
- const $ = t.name("valid");
6760
- l === void 0 && o === 1 ? C($, () => t.if($, () => t.break())) : o === 0 ? (t.let($, !0), l !== void 0 && t.if((0, codegen_1$7._)`${s}.length > 0`, O)) : (t.let($, !1), O()), e.result($, () => e.reset());
6876
+ const g = t.name("valid");
6877
+ l === void 0 && o === 1 ? C(g, () => t.if(g, () => t.break())) : o === 0 ? (t.let(g, !0), l !== void 0 && t.if((0, codegen_1$7._)`${s}.length > 0`, O)) : (t.let(g, !1), O()), e.result(g, () => e.reset());
6761
6878
  function O() {
6762
6879
  const T = t.name("_valid"), y = t.let("count", 0);
6763
6880
  C(T, () => t.if(T, () => S(y)));
6764
6881
  }
6765
6882
  function C(T, y) {
6766
- t.forRange("i", 0, f, (_) => {
6883
+ t.forRange("i", 0, p, (_) => {
6767
6884
  e.subschema({
6768
6885
  keyword: "contains",
6769
6886
  dataProp: _,
@@ -6773,7 +6890,7 @@ const codegen_1$7 = codegen, util_1$a = util, error$6 = {
6773
6890
  });
6774
6891
  }
6775
6892
  function S(T) {
6776
- t.code((0, codegen_1$7._)`${T}++`), l === void 0 ? t.if((0, codegen_1$7._)`${T} >= ${o}`, () => t.assign($, !0).break()) : (t.if((0, codegen_1$7._)`${T} > ${l}`, () => t.assign($, !1).break()), o === 1 ? t.assign($, !0) : t.if((0, codegen_1$7._)`${T} >= ${o}`, () => t.assign($, !0)));
6893
+ t.code((0, codegen_1$7._)`${T}++`), l === void 0 ? t.if((0, codegen_1$7._)`${T} >= ${o}`, () => t.assign(g, !0).break()) : (t.if((0, codegen_1$7._)`${T} > ${l}`, () => t.assign(g, !1).break()), o === 1 ? t.assign(g, !0) : t.if((0, codegen_1$7._)`${T} >= ${o}`, () => t.assign(g, !0)));
6777
6894
  }
6778
6895
  }
6779
6896
  };
@@ -6783,14 +6900,14 @@ var dependencies = {};
6783
6900
  Object.defineProperty(e, "__esModule", { value: !0 }), e.validateSchemaDeps = e.validatePropertyDeps = e.error = void 0;
6784
6901
  const t = codegen, r = util, n = code;
6785
6902
  e.error = {
6786
- message: ({ params: { property: d, depsCount: u, deps: f } }) => {
6787
- const $ = u === 1 ? "property" : "properties";
6788
- return (0, t.str)`must have ${$} ${f} when property ${d} is present`;
6903
+ message: ({ params: { property: d, depsCount: u, deps: p } }) => {
6904
+ const g = u === 1 ? "property" : "properties";
6905
+ return (0, t.str)`must have ${g} ${p} when property ${d} is present`;
6789
6906
  },
6790
- params: ({ params: { property: d, depsCount: u, deps: f, missingProperty: $ } }) => (0, t._)`{property: ${d},
6791
- missingProperty: ${$},
6907
+ params: ({ params: { property: d, depsCount: u, deps: p, missingProperty: g } }) => (0, t._)`{property: ${d},
6908
+ missingProperty: ${g},
6792
6909
  depsCount: ${u},
6793
- deps: ${f}}`
6910
+ deps: ${p}}`
6794
6911
  // TODO change to reference
6795
6912
  };
6796
6913
  const s = {
@@ -6799,51 +6916,51 @@ var dependencies = {};
6799
6916
  schemaType: "object",
6800
6917
  error: e.error,
6801
6918
  code(d) {
6802
- const [u, f] = i(d);
6803
- o(d, u), l(d, f);
6919
+ const [u, p] = i(d);
6920
+ o(d, u), l(d, p);
6804
6921
  }
6805
6922
  };
6806
6923
  function i({ schema: d }) {
6807
- const u = {}, f = {};
6808
- for (const $ in d) {
6809
- if ($ === "__proto__")
6924
+ const u = {}, p = {};
6925
+ for (const g in d) {
6926
+ if (g === "__proto__")
6810
6927
  continue;
6811
- const O = Array.isArray(d[$]) ? u : f;
6812
- O[$] = d[$];
6928
+ const O = Array.isArray(d[g]) ? u : p;
6929
+ O[g] = d[g];
6813
6930
  }
6814
- return [u, f];
6931
+ return [u, p];
6815
6932
  }
6816
6933
  function o(d, u = d.schema) {
6817
- const { gen: f, data: $, it: O } = d;
6934
+ const { gen: p, data: g, it: O } = d;
6818
6935
  if (Object.keys(u).length === 0)
6819
6936
  return;
6820
- const C = f.let("missing");
6937
+ const C = p.let("missing");
6821
6938
  for (const S in u) {
6822
6939
  const T = u[S];
6823
6940
  if (T.length === 0)
6824
6941
  continue;
6825
- const y = (0, n.propertyInData)(f, $, S, O.opts.ownProperties);
6942
+ const y = (0, n.propertyInData)(p, g, S, O.opts.ownProperties);
6826
6943
  d.setParams({
6827
6944
  property: S,
6828
6945
  depsCount: T.length,
6829
6946
  deps: T.join(", ")
6830
- }), O.allErrors ? f.if(y, () => {
6947
+ }), O.allErrors ? p.if(y, () => {
6831
6948
  for (const _ of T)
6832
6949
  (0, n.checkReportMissingProp)(d, _);
6833
- }) : (f.if((0, t._)`${y} && (${(0, n.checkMissingProp)(d, T, C)})`), (0, n.reportMissingProp)(d, C), f.else());
6950
+ }) : (p.if((0, t._)`${y} && (${(0, n.checkMissingProp)(d, T, C)})`), (0, n.reportMissingProp)(d, C), p.else());
6834
6951
  }
6835
6952
  }
6836
6953
  e.validatePropertyDeps = o;
6837
6954
  function l(d, u = d.schema) {
6838
- const { gen: f, data: $, keyword: O, it: C } = d, S = f.name("valid");
6955
+ const { gen: p, data: g, keyword: O, it: C } = d, S = p.name("valid");
6839
6956
  for (const T in u)
6840
- (0, r.alwaysValidSchema)(C, u[T]) || (f.if(
6841
- (0, n.propertyInData)(f, $, T, C.opts.ownProperties),
6957
+ (0, r.alwaysValidSchema)(C, u[T]) || (p.if(
6958
+ (0, n.propertyInData)(p, g, T, C.opts.ownProperties),
6842
6959
  () => {
6843
6960
  const y = d.subschema({ keyword: O, schemaProp: T }, S);
6844
6961
  d.mergeValidEvaluated(y, S);
6845
6962
  },
6846
- () => f.var(S, !0)
6963
+ () => p.var(S, !0)
6847
6964
  // TODO var
6848
6965
  ), d.ok(S));
6849
6966
  }
@@ -6897,21 +7014,21 @@ const code_1$3 = code, codegen_1$5 = codegen, names_1 = names$1, util_1$8 = util
6897
7014
  const { allErrors: l, opts: d } = o;
6898
7015
  if (o.props = !0, d.removeAdditional !== "all" && (0, util_1$8.alwaysValidSchema)(o, r))
6899
7016
  return;
6900
- const u = (0, code_1$3.allSchemaProperties)(n.properties), f = (0, code_1$3.allSchemaProperties)(n.patternProperties);
6901
- $(), e.ok((0, codegen_1$5._)`${i} === ${names_1.default.errors}`);
6902
- function $() {
7017
+ const u = (0, code_1$3.allSchemaProperties)(n.properties), p = (0, code_1$3.allSchemaProperties)(n.patternProperties);
7018
+ g(), e.ok((0, codegen_1$5._)`${i} === ${names_1.default.errors}`);
7019
+ function g() {
6903
7020
  t.forIn("key", s, (y) => {
6904
- !u.length && !f.length ? S(y) : t.if(O(y), () => S(y));
7021
+ !u.length && !p.length ? S(y) : t.if(O(y), () => S(y));
6905
7022
  });
6906
7023
  }
6907
7024
  function O(y) {
6908
7025
  let _;
6909
7026
  if (u.length > 8) {
6910
- const g = (0, util_1$8.schemaRefOrVal)(o, n.properties, "properties");
6911
- _ = (0, code_1$3.isOwnProperty)(t, g, y);
7027
+ const $ = (0, util_1$8.schemaRefOrVal)(o, n.properties, "properties");
7028
+ _ = (0, code_1$3.isOwnProperty)(t, $, y);
6912
7029
  } else
6913
- u.length ? _ = (0, codegen_1$5.or)(...u.map((g) => (0, codegen_1$5._)`${y} === ${g}`)) : _ = codegen_1$5.nil;
6914
- return f.length && (_ = (0, codegen_1$5.or)(_, ...f.map((g) => (0, codegen_1$5._)`${(0, code_1$3.usePattern)(e, g)}.test(${y})`))), (0, codegen_1$5.not)(_);
7030
+ u.length ? _ = (0, codegen_1$5.or)(...u.map(($) => (0, codegen_1$5._)`${y} === ${$}`)) : _ = codegen_1$5.nil;
7031
+ return p.length && (_ = (0, codegen_1$5.or)(_, ...p.map(($) => (0, codegen_1$5._)`${(0, code_1$3.usePattern)(e, $)}.test(${y})`))), (0, codegen_1$5.not)(_);
6915
7032
  }
6916
7033
  function C(y) {
6917
7034
  t.code((0, codegen_1$5._)`delete ${s}[${y}]`);
@@ -6932,13 +7049,13 @@ const code_1$3 = code, codegen_1$5 = codegen, names_1 = names$1, util_1$8 = util
6932
7049
  })) : (T(y, _), l || t.if((0, codegen_1$5.not)(_), () => t.break()));
6933
7050
  }
6934
7051
  }
6935
- function T(y, _, g) {
7052
+ function T(y, _, $) {
6936
7053
  const P = {
6937
7054
  keyword: "additionalProperties",
6938
7055
  dataProp: y,
6939
7056
  dataPropType: util_1$8.Type.Str
6940
7057
  };
6941
- g === !1 && Object.assign(P, {
7058
+ $ === !1 && Object.assign(P, {
6942
7059
  compositeRule: !0,
6943
7060
  createErrors: !1,
6944
7061
  allErrors: !1
@@ -6957,23 +7074,23 @@ const validate_1 = validate, code_1$2 = code, util_1$7 = util, additionalPropert
6957
7074
  const { gen: t, schema: r, parentSchema: n, data: s, it: i } = e;
6958
7075
  i.opts.removeAdditional === "all" && n.additionalProperties === void 0 && additionalProperties_1$1.default.code(new validate_1.KeywordCxt(i, additionalProperties_1$1.default, "additionalProperties"));
6959
7076
  const o = (0, code_1$2.allSchemaProperties)(r);
6960
- for (const $ of o)
6961
- i.definedProperties.add($);
7077
+ for (const g of o)
7078
+ i.definedProperties.add(g);
6962
7079
  i.opts.unevaluated && o.length && i.props !== !0 && (i.props = util_1$7.mergeEvaluated.props(t, (0, util_1$7.toHash)(o), i.props));
6963
- const l = o.filter(($) => !(0, util_1$7.alwaysValidSchema)(i, r[$]));
7080
+ const l = o.filter((g) => !(0, util_1$7.alwaysValidSchema)(i, r[g]));
6964
7081
  if (l.length === 0)
6965
7082
  return;
6966
7083
  const d = t.name("valid");
6967
- for (const $ of l)
6968
- u($) ? f($) : (t.if((0, code_1$2.propertyInData)(t, s, $, i.opts.ownProperties)), f($), i.allErrors || t.else().var(d, !0), t.endIf()), e.it.definedProperties.add($), e.ok(d);
6969
- function u($) {
6970
- return i.opts.useDefaults && !i.compositeRule && r[$].default !== void 0;
7084
+ for (const g of l)
7085
+ u(g) ? p(g) : (t.if((0, code_1$2.propertyInData)(t, s, g, i.opts.ownProperties)), p(g), i.allErrors || t.else().var(d, !0), t.endIf()), e.it.definedProperties.add(g), e.ok(d);
7086
+ function u(g) {
7087
+ return i.opts.useDefaults && !i.compositeRule && r[g].default !== void 0;
6971
7088
  }
6972
- function f($) {
7089
+ function p(g) {
6973
7090
  e.subschema({
6974
7091
  keyword: "properties",
6975
- schemaProp: $,
6976
- dataProp: $
7092
+ schemaProp: g,
7093
+ dataProp: g
6977
7094
  }, d);
6978
7095
  }
6979
7096
  }
@@ -6989,13 +7106,13 @@ const code_1$1 = code, codegen_1$4 = codegen, util_1$6 = util, util_2 = util, de
6989
7106
  const { gen: t, schema: r, data: n, parentSchema: s, it: i } = e, { opts: o } = i, l = (0, code_1$1.allSchemaProperties)(r), d = l.filter((T) => (0, util_1$6.alwaysValidSchema)(i, r[T]));
6990
7107
  if (l.length === 0 || d.length === l.length && (!i.opts.unevaluated || i.props === !0))
6991
7108
  return;
6992
- const u = o.strictSchema && !o.allowMatchingProperties && s.properties, f = t.name("valid");
7109
+ const u = o.strictSchema && !o.allowMatchingProperties && s.properties, p = t.name("valid");
6993
7110
  i.props !== !0 && !(i.props instanceof codegen_1$4.Name) && (i.props = (0, util_2.evaluatedPropsToName)(t, i.props));
6994
- const { props: $ } = i;
7111
+ const { props: g } = i;
6995
7112
  O();
6996
7113
  function O() {
6997
7114
  for (const T of l)
6998
- u && C(T), i.allErrors ? S(T) : (t.var(f, !0), S(T), t.if(f));
7115
+ u && C(T), i.allErrors ? S(T) : (t.var(p, !0), S(T), t.if(p));
6999
7116
  }
7000
7117
  function C(T) {
7001
7118
  for (const y in u)
@@ -7010,7 +7127,7 @@ const code_1$1 = code, codegen_1$4 = codegen, util_1$6 = util, util_2 = util, de
7010
7127
  schemaProp: T,
7011
7128
  dataProp: y,
7012
7129
  dataPropType: util_2.Type.Str
7013
- }, f), i.opts.unevaluated && $ !== !0 ? t.assign((0, codegen_1$4._)`${$}[${y}]`, !0) : !_ && !i.allErrors && t.if((0, codegen_1$4.not)(f), () => t.break());
7130
+ }, p), i.opts.unevaluated && g !== !0 ? t.assign((0, codegen_1$4._)`${g}[${y}]`, !0) : !_ && !i.allErrors && t.if((0, codegen_1$4.not)(p), () => t.break());
7014
7131
  });
7015
7132
  });
7016
7133
  }
@@ -7069,14 +7186,14 @@ const codegen_1$3 = codegen, util_1$4 = util, error$3 = {
7069
7186
  const i = r, o = t.let("valid", !1), l = t.let("passing", null), d = t.name("_valid");
7070
7187
  e.setParams({ passing: l }), t.block(u), e.result(o, () => e.reset(), () => e.error(!0));
7071
7188
  function u() {
7072
- i.forEach((f, $) => {
7189
+ i.forEach((p, g) => {
7073
7190
  let O;
7074
- (0, util_1$4.alwaysValidSchema)(s, f) ? t.var(d, !0) : O = e.subschema({
7191
+ (0, util_1$4.alwaysValidSchema)(s, p) ? t.var(d, !0) : O = e.subschema({
7075
7192
  keyword: "oneOf",
7076
- schemaProp: $,
7193
+ schemaProp: g,
7077
7194
  compositeRule: !0
7078
- }, d), $ > 0 && t.if((0, codegen_1$3._)`${d} && ${o}`).assign(o, !1).assign(l, (0, codegen_1$3._)`[${l}, ${$}]`).else(), t.if(d, () => {
7079
- t.assign(o, !0), t.assign(l, $), O && e.mergeEvaluated(O, codegen_1$3.Name);
7195
+ }, d), g > 0 && t.if((0, codegen_1$3._)`${d} && ${o}`).assign(o, !1).assign(l, (0, codegen_1$3._)`[${l}, ${g}]`).else(), t.if(d, () => {
7196
+ t.assign(o, !0), t.assign(l, g), O && e.mergeEvaluated(O, codegen_1$3.Name);
7080
7197
  });
7081
7198
  });
7082
7199
  }
@@ -7120,24 +7237,24 @@ const codegen_1$2 = codegen, util_1$2 = util, error$2 = {
7120
7237
  return;
7121
7238
  const o = t.let("valid", !0), l = t.name("_valid");
7122
7239
  if (d(), e.reset(), s && i) {
7123
- const f = t.let("ifClause");
7124
- e.setParams({ ifClause: f }), t.if(l, u("then", f), u("else", f));
7240
+ const p = t.let("ifClause");
7241
+ e.setParams({ ifClause: p }), t.if(l, u("then", p), u("else", p));
7125
7242
  } else
7126
7243
  s ? t.if(l, u("then")) : t.if((0, codegen_1$2.not)(l), u("else"));
7127
7244
  e.pass(o, () => e.error(!0));
7128
7245
  function d() {
7129
- const f = e.subschema({
7246
+ const p = e.subschema({
7130
7247
  keyword: "if",
7131
7248
  compositeRule: !0,
7132
7249
  createErrors: !1,
7133
7250
  allErrors: !1
7134
7251
  }, l);
7135
- e.mergeEvaluated(f);
7252
+ e.mergeEvaluated(p);
7136
7253
  }
7137
- function u(f, $) {
7254
+ function u(p, g) {
7138
7255
  return () => {
7139
- const O = e.subschema({ keyword: f }, l);
7140
- t.assign(o, l), e.mergeValidEvaluated(O, o), $ ? t.assign($, (0, codegen_1$2._)`${f}`) : e.setParams({ ifClause: f });
7256
+ const O = e.subschema({ keyword: p }, l);
7257
+ t.assign(o, l), e.mergeValidEvaluated(O, o), g ? t.assign(g, (0, codegen_1$2._)`${p}`) : e.setParams({ ifClause: p });
7141
7258
  };
7142
7259
  }
7143
7260
  }
@@ -7190,37 +7307,37 @@ const codegen_1$1 = codegen, error$1 = {
7190
7307
  $data: !0,
7191
7308
  error: error$1,
7192
7309
  code(e, t) {
7193
- const { gen: r, data: n, $data: s, schema: i, schemaCode: o, it: l } = e, { opts: d, errSchemaPath: u, schemaEnv: f, self: $ } = l;
7310
+ const { gen: r, data: n, $data: s, schema: i, schemaCode: o, it: l } = e, { opts: d, errSchemaPath: u, schemaEnv: p, self: g } = l;
7194
7311
  if (!d.validateFormats)
7195
7312
  return;
7196
7313
  s ? O() : C();
7197
7314
  function O() {
7198
7315
  const S = r.scopeValue("formats", {
7199
- ref: $.formats,
7316
+ ref: g.formats,
7200
7317
  code: d.code.formats
7201
7318
  }), T = r.const("fDef", (0, codegen_1$1._)`${S}[${o}]`), y = r.let("fType"), _ = r.let("format");
7202
- r.if((0, codegen_1$1._)`typeof ${T} == "object" && !(${T} instanceof RegExp)`, () => r.assign(y, (0, codegen_1$1._)`${T}.type || "string"`).assign(_, (0, codegen_1$1._)`${T}.validate`), () => r.assign(y, (0, codegen_1$1._)`"string"`).assign(_, T)), e.fail$data((0, codegen_1$1.or)(g(), P()));
7203
- function g() {
7319
+ r.if((0, codegen_1$1._)`typeof ${T} == "object" && !(${T} instanceof RegExp)`, () => r.assign(y, (0, codegen_1$1._)`${T}.type || "string"`).assign(_, (0, codegen_1$1._)`${T}.validate`), () => r.assign(y, (0, codegen_1$1._)`"string"`).assign(_, T)), e.fail$data((0, codegen_1$1.or)($(), P()));
7320
+ function $() {
7204
7321
  return d.strictSchema === !1 ? codegen_1$1.nil : (0, codegen_1$1._)`${o} && !${_}`;
7205
7322
  }
7206
7323
  function P() {
7207
- const I = f.$async ? (0, codegen_1$1._)`(${T}.async ? await ${_}(${n}) : ${_}(${n}))` : (0, codegen_1$1._)`${_}(${n})`, D = (0, codegen_1$1._)`(typeof ${_} == "function" ? ${I} : ${_}.test(${n}))`;
7324
+ const I = p.$async ? (0, codegen_1$1._)`(${T}.async ? await ${_}(${n}) : ${_}(${n}))` : (0, codegen_1$1._)`${_}(${n})`, D = (0, codegen_1$1._)`(typeof ${_} == "function" ? ${I} : ${_}.test(${n}))`;
7208
7325
  return (0, codegen_1$1._)`${_} && ${_} !== true && ${y} === ${t} && !${D}`;
7209
7326
  }
7210
7327
  }
7211
7328
  function C() {
7212
- const S = $.formats[i];
7329
+ const S = g.formats[i];
7213
7330
  if (!S) {
7214
- g();
7331
+ $();
7215
7332
  return;
7216
7333
  }
7217
7334
  if (S === !0)
7218
7335
  return;
7219
7336
  const [T, y, _] = P(S);
7220
7337
  T === t && e.pass(I());
7221
- function g() {
7338
+ function $() {
7222
7339
  if (d.strictSchema === !1) {
7223
- $.logger.warn(D());
7340
+ g.logger.warn(D());
7224
7341
  return;
7225
7342
  }
7226
7343
  throw new Error(D());
@@ -7234,7 +7351,7 @@ const codegen_1$1 = codegen, error$1 = {
7234
7351
  }
7235
7352
  function I() {
7236
7353
  if (typeof S == "object" && !(S instanceof RegExp) && S.async) {
7237
- if (!f.$async)
7354
+ if (!p.$async)
7238
7355
  throw new Error("async format in sync schema");
7239
7356
  return (0, codegen_1$1._)`await ${_}(${n})`;
7240
7357
  }
@@ -7301,15 +7418,15 @@ const codegen_1 = codegen, types_1 = types, compile_1 = compile, util_1 = util,
7301
7418
  if (!o)
7302
7419
  throw new Error("discriminator: requires oneOf keyword");
7303
7420
  const d = t.let("valid", !1), u = t.const("tag", (0, codegen_1._)`${r}${(0, codegen_1.getProperty)(l)}`);
7304
- t.if((0, codegen_1._)`typeof ${u} == "string"`, () => f(), () => e.error(!1, { discrError: types_1.DiscrError.Tag, tag: u, tagName: l })), e.ok(d);
7305
- function f() {
7421
+ t.if((0, codegen_1._)`typeof ${u} == "string"`, () => p(), () => e.error(!1, { discrError: types_1.DiscrError.Tag, tag: u, tagName: l })), e.ok(d);
7422
+ function p() {
7306
7423
  const C = O();
7307
7424
  t.if(!1);
7308
7425
  for (const S in C)
7309
- t.elseIf((0, codegen_1._)`${u} === ${S}`), t.assign(d, $(C[S]));
7426
+ t.elseIf((0, codegen_1._)`${u} === ${S}`), t.assign(d, g(C[S]));
7310
7427
  t.else(), e.error(!1, { discrError: types_1.DiscrError.Mapping, tag: u, tagName: l }), t.endIf();
7311
7428
  }
7312
- function $(C) {
7429
+ function g(C) {
7313
7430
  const S = t.name("valid"), T = e.subschema({ keyword: "oneOf", schemaProp: C }, S);
7314
7431
  return e.mergeEvaluated(T, codegen_1.Name), S;
7315
7432
  }
@@ -7323,7 +7440,7 @@ const codegen_1 = codegen, types_1 = types, compile_1 = compile, util_1 = util,
7323
7440
  const w = (C = D == null ? void 0 : D.properties) === null || C === void 0 ? void 0 : C[l];
7324
7441
  if (typeof w != "object")
7325
7442
  throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);
7326
- y = y && (T || _(D)), g(w, I);
7443
+ y = y && (T || _(D)), $(w, I);
7327
7444
  }
7328
7445
  if (!y)
7329
7446
  throw new Error(`discriminator: "${l}" must be required`);
@@ -7331,7 +7448,7 @@ const codegen_1 = codegen, types_1 = types, compile_1 = compile, util_1 = util,
7331
7448
  function _({ required: I }) {
7332
7449
  return Array.isArray(I) && I.includes(l);
7333
7450
  }
7334
- function g(I, D) {
7451
+ function $(I, D) {
7335
7452
  if (I.const)
7336
7453
  P(I.const, D);
7337
7454
  else if (I.enum)
@@ -7612,23 +7729,23 @@ const $schema$1 = "http://json-schema.org/draft-07/schema#", $id = "http://json-
7612
7729
  Object.defineProperty(t, "KeywordCxt", { enumerable: !0, get: function() {
7613
7730
  return u.KeywordCxt;
7614
7731
  } });
7615
- var f = codegen;
7732
+ var p = codegen;
7616
7733
  Object.defineProperty(t, "_", { enumerable: !0, get: function() {
7617
- return f._;
7734
+ return p._;
7618
7735
  } }), Object.defineProperty(t, "str", { enumerable: !0, get: function() {
7619
- return f.str;
7736
+ return p.str;
7620
7737
  } }), Object.defineProperty(t, "stringify", { enumerable: !0, get: function() {
7621
- return f.stringify;
7738
+ return p.stringify;
7622
7739
  } }), Object.defineProperty(t, "nil", { enumerable: !0, get: function() {
7623
- return f.nil;
7740
+ return p.nil;
7624
7741
  } }), Object.defineProperty(t, "Name", { enumerable: !0, get: function() {
7625
- return f.Name;
7742
+ return p.Name;
7626
7743
  } }), Object.defineProperty(t, "CodeGen", { enumerable: !0, get: function() {
7627
- return f.CodeGen;
7744
+ return p.CodeGen;
7628
7745
  } });
7629
- var $ = validation_error;
7746
+ var g = validation_error;
7630
7747
  Object.defineProperty(t, "ValidationError", { enumerable: !0, get: function() {
7631
- return $.default;
7748
+ return g.default;
7632
7749
  } });
7633
7750
  var O = ref_error;
7634
7751
  Object.defineProperty(t, "MissingRefError", { enumerable: !0, get: function() {
@@ -9234,13 +9351,13 @@ function compileBlueprint(e, {
9234
9351
  onStepCompleted: n = () => {
9235
9352
  }
9236
9353
  } = {}) {
9237
- var $, O, C, S, T, y, _;
9354
+ var g, O, C, S, T, y, _;
9238
9355
  e = {
9239
9356
  ...e,
9240
- steps: (e.steps || []).filter(isStepDefinition)
9357
+ steps: (e.steps || []).filter(isStepDefinition).filter(isStepStillSupported)
9241
9358
  };
9242
- for (const g of e.steps)
9243
- typeof g == "object" && g.step === "importFile" && (g.step = "importWxr", console.warn(
9359
+ for (const $ of e.steps)
9360
+ typeof $ == "object" && $.step === "importFile" && ($.step = "importWxr", console.warn(
9244
9361
  'The "importFile" step is deprecated. Use "importWxr" instead.'
9245
9362
  ));
9246
9363
  if (e.constants && e.steps.unshift({
@@ -9250,7 +9367,7 @@ function compileBlueprint(e, {
9250
9367
  step: "setSiteOptions",
9251
9368
  options: e.siteOptions
9252
9369
  }), e.plugins) {
9253
- const g = e.plugins.map((P) => typeof P == "string" ? P.startsWith("https://") ? {
9370
+ const $ = e.plugins.map((P) => typeof P == "string" ? P.startsWith("https://") ? {
9254
9371
  resource: "url",
9255
9372
  url: P
9256
9373
  } : {
@@ -9260,17 +9377,17 @@ function compileBlueprint(e, {
9260
9377
  step: "installPlugin",
9261
9378
  pluginZipFile: P
9262
9379
  }));
9263
- e.steps.unshift(...g);
9380
+ e.steps.unshift(...$);
9264
9381
  }
9265
9382
  e.login && e.steps.push({
9266
9383
  step: "login",
9267
9384
  ...e.login === !0 ? { username: "admin", password: "password" } : e.login
9268
9385
  }), e.phpExtensionBundles || (e.phpExtensionBundles = []), e.phpExtensionBundles || (e.phpExtensionBundles = []), e.phpExtensionBundles.length === 0 && e.phpExtensionBundles.push("kitchen-sink");
9269
- const s = ($ = e.steps) == null ? void 0 : $.findIndex(
9270
- (g) => typeof g == "object" && (g == null ? void 0 : g.step) === "wp-cli"
9386
+ const s = (g = e.steps) == null ? void 0 : g.findIndex(
9387
+ ($) => typeof $ == "object" && ($ == null ? void 0 : $.step) === "wp-cli"
9271
9388
  );
9272
9389
  s !== void 0 && s > -1 && (e.phpExtensionBundles.includes("light") && (e.phpExtensionBundles = e.phpExtensionBundles.filter(
9273
- (g) => g !== "light"
9390
+ ($) => $ !== "light"
9274
9391
  ), console.warn(
9275
9392
  "The wpCli step used in your Blueprint requires the iconv and mbstring PHP extensions. However, you did not specify the kitchen-sink extension bundle. Playground will override your choice and load the kitchen-sink PHP extensions bundle to prevent the WP-CLI step from failing. "
9276
9393
  )), (O = e.steps) == null || O.splice(s, 0, {
@@ -9292,10 +9409,10 @@ function compileBlueprint(e, {
9292
9409
  path: "/tmp/wp-cli.phar"
9293
9410
  }));
9294
9411
  const i = (C = e.steps) == null ? void 0 : C.findIndex(
9295
- (g) => typeof g == "object" && (g == null ? void 0 : g.step) === "importWxr"
9412
+ ($) => typeof $ == "object" && ($ == null ? void 0 : $.step) === "importWxr"
9296
9413
  );
9297
9414
  i !== void 0 && i > -1 && (e.phpExtensionBundles.includes("light") && (e.phpExtensionBundles = e.phpExtensionBundles.filter(
9298
- (g) => g !== "light"
9415
+ ($) => $ !== "light"
9299
9416
  ), console.warn(
9300
9417
  "The importWxr step used in your Blueprint requires the iconv and mbstring PHP extensions. However, you did not specify the kitchen-sink extension bundle. Playground will override your choice and load the kitchen-sink PHP extensions bundle to prevent the WP-CLI step from failing. "
9301
9418
  )), (S = e.steps) == null || S.splice(i, 0, {
@@ -9308,19 +9425,19 @@ function compileBlueprint(e, {
9308
9425
  }));
9309
9426
  const { valid: o, errors: l } = validateBlueprint(e);
9310
9427
  if (!o) {
9311
- const g = new Error(
9428
+ const $ = new Error(
9312
9429
  `Invalid blueprint: ${l[0].message} at ${l[0].instancePath}`
9313
9430
  );
9314
- throw g.errors = l, g;
9431
+ throw $.errors = l, $;
9315
9432
  }
9316
9433
  const d = e.steps || [], u = d.reduce(
9317
- (g, P) => {
9434
+ ($, P) => {
9318
9435
  var I;
9319
- return g + (((I = P.progress) == null ? void 0 : I.weight) || 1);
9436
+ return $ + (((I = P.progress) == null ? void 0 : I.weight) || 1);
9320
9437
  },
9321
9438
  0
9322
- ), f = d.map(
9323
- (g) => compileStep(g, {
9439
+ ), p = d.map(
9440
+ ($) => compileStep($, {
9324
9441
  semaphore: r,
9325
9442
  rootProgressTracker: t,
9326
9443
  totalProgressWeight: u
@@ -9343,14 +9460,14 @@ function compileBlueprint(e, {
9343
9460
  // Disable networking by default
9344
9461
  networking: ((_ = e.features) == null ? void 0 : _.networking) ?? !1
9345
9462
  },
9346
- run: async (g) => {
9463
+ run: async ($) => {
9347
9464
  try {
9348
- for (const { resources: P } of f)
9465
+ for (const { resources: P } of p)
9349
9466
  for (const I of P)
9350
- I.setPlayground(g), I.isAsync && I.resolve();
9351
- for (const [P, { run: I, step: D }] of Object.entries(f))
9467
+ I.setPlayground($), I.isAsync && I.resolve();
9468
+ for (const [P, { run: I, step: D }] of Object.entries(p))
9352
9469
  try {
9353
- const w = await I(g);
9470
+ const w = await I($);
9354
9471
  n(w, D);
9355
9472
  } catch (w) {
9356
9473
  throw console.error(w), new Error(
@@ -9362,7 +9479,7 @@ function compileBlueprint(e, {
9362
9479
  }
9363
9480
  } finally {
9364
9481
  try {
9365
- await g.goTo(
9482
+ await $.goTo(
9366
9483
  e.landingPage || "/"
9367
9484
  );
9368
9485
  } catch {
@@ -9405,26 +9522,31 @@ function compilePHPExtensions(e, t) {
9405
9522
  function isStepDefinition(e) {
9406
9523
  return !!(typeof e == "object" && e);
9407
9524
  }
9525
+ function isStepStillSupported(e) {
9526
+ return e.step === "setPhpIniEntry" ? (console.warn(
9527
+ 'The "setPhpIniEntry" Blueprint is no longer supported and you can remove it from your Blueprint.'
9528
+ ), !1) : !0;
9529
+ }
9408
9530
  function compileStep(e, {
9409
9531
  semaphore: t,
9410
9532
  rootProgressTracker: r,
9411
9533
  totalProgressWeight: n
9412
9534
  }) {
9413
- var f;
9535
+ var p;
9414
9536
  const s = r.stage(
9415
- (((f = e.progress) == null ? void 0 : f.weight) || 1) / n
9537
+ (((p = e.progress) == null ? void 0 : p.weight) || 1) / n
9416
9538
  ), i = {};
9417
- for (const $ of Object.keys(e)) {
9418
- let O = e[$];
9539
+ for (const g of Object.keys(e)) {
9540
+ let O = e[g];
9419
9541
  isFileReference(O) && (O = Resource.create(O, {
9420
9542
  semaphore: t
9421
- })), i[$] = O;
9543
+ })), i[g] = O;
9422
9544
  }
9423
- const o = async ($) => {
9545
+ const o = async (g) => {
9424
9546
  var O;
9425
9547
  try {
9426
9548
  return s.fillSlowly(), await keyedStepHandlers[e.step](
9427
- $,
9549
+ g,
9428
9550
  await resolveArguments(i),
9429
9551
  {
9430
9552
  tracker: s,
@@ -9435,10 +9557,10 @@ function compileStep(e, {
9435
9557
  s.finish();
9436
9558
  }
9437
9559
  }, l = getResources(i), d = getResources(i).filter(
9438
- ($) => $.isAsync
9560
+ (g) => g.isAsync
9439
9561
  ), u = 1 / (d.length + 1);
9440
- for (const $ of d)
9441
- $.progress = s.stage(u);
9562
+ for (const g of d)
9563
+ g.progress = s.stage(u);
9442
9564
  return { run: o, step: e, resources: l };
9443
9565
  }
9444
9566
  function getResources(e) {
@@ -9486,7 +9608,6 @@ export {
9486
9608
  runPHPWithOptions,
9487
9609
  runSql,
9488
9610
  runWpInstallationWizard,
9489
- setPhpIniEntry,
9490
9611
  setPluginProxyURL,
9491
9612
  setSiteOptions,
9492
9613
  unzip,