@triflare/fx 2.3.0-alpha.2 → 2.3.0-alpha.4

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.
@@ -0,0 +1,167 @@
1
+ /**
2
+ * Triflare Marketplace sources.
3
+ *
4
+ * `fx vendor add marketplace:@handle/extension@ref` resolves the requested
5
+ * version or dist-tag to a pinned download URL before anything is written.
6
+ * `fx.yml` keeps that URL, and `fx.lock` records the resolved version and
7
+ * digest, so reinstalls and builds never query the registry.
8
+ */
9
+ import { VendorError, fetchVendorSource, sha256 } from "./vendor.js";
10
+
11
+ export const DEFAULT_MARKETPLACE_API = "https://marketplace.sdisk.us/api/v1";
12
+
13
+ const SOURCE_PATTERN =
14
+ /^marketplace:@([a-z0-9](?:[a-z0-9-]{0,38}[a-z0-9])?)\/([a-z0-9]{1,64})(?:@([A-Za-z0-9._+-]+))?$/;
15
+
16
+ /** @param {unknown} source */
17
+ export function isMarketplaceSource(source) {
18
+ return /^marketplace:/i.test(String(source));
19
+ }
20
+
21
+ /**
22
+ * Parse `marketplace:@handle/extension@ref`.
23
+ *
24
+ * @param {string} source
25
+ * @returns {{namespace: string, id: string, ref: string, package: string}}
26
+ */
27
+ export function parseMarketplaceSource(source) {
28
+ const match = SOURCE_PATTERN.exec(String(source).trim());
29
+ if (!match)
30
+ throw new VendorError(
31
+ `Invalid marketplace source ${JSON.stringify(String(source))}. ` +
32
+ "Use marketplace:@handle/extension@optionalVersionOrDistTag.",
33
+ );
34
+ const [, namespace, id, ref] = match;
35
+ return {
36
+ namespace,
37
+ id,
38
+ ref: ref ?? "latest",
39
+ package: `@${namespace}/${id}`,
40
+ };
41
+ }
42
+
43
+ /** The API root, with `FX_MARKETPLACE_API` available for self-hosted instances. */
44
+ export function marketplaceApiBase(apiBase) {
45
+ return String(
46
+ apiBase || process.env.FX_MARKETPLACE_API || DEFAULT_MARKETPLACE_API,
47
+ ).replace(/\/+$/, "");
48
+ }
49
+
50
+ /** Fetch and parse a JSON response, turning failures into VendorError. */
51
+ async function fetchJson(url, fetchImpl, label) {
52
+ const fetchFn = fetchImpl || globalThis.fetch;
53
+ if (typeof fetchFn !== "function")
54
+ throw new VendorError("global fetch is unavailable");
55
+ let response;
56
+ try {
57
+ response = await fetchFn(url, { headers: { accept: "application/json" } });
58
+ } catch (error) {
59
+ throw new VendorError(
60
+ `Could not reach Triflare Marketplace for ${label}: ${error.message}`,
61
+ { cause: error },
62
+ );
63
+ }
64
+ if (!response.ok) {
65
+ const status = `${response.status} ${response.statusText ?? ""}`.trim();
66
+ const problem =
67
+ response.status === 404
68
+ ? `could not find ${label}`
69
+ : `request for ${label} failed`;
70
+ throw new VendorError(`Triflare Marketplace ${problem}: HTTP ${status}`);
71
+ }
72
+ try {
73
+ return await response.json();
74
+ } catch (error) {
75
+ throw new VendorError(
76
+ `Triflare Marketplace returned invalid JSON for ${label}`,
77
+ { cause: error },
78
+ );
79
+ }
80
+ }
81
+
82
+ /**
83
+ * Resolve a marketplace source to its compiled bytes.
84
+ *
85
+ * The version endpoint accepts a SemVer string, a dist-tag, or `latest`.
86
+ * The downloaded file must match the SHA-256 the registry reports.
87
+ *
88
+ * @param {object} options
89
+ * @param {string} options.source
90
+ * @param {typeof fetch} [options.fetchImpl]
91
+ * @param {string} [options.apiBase]
92
+ */
93
+ export async function resolveMarketplaceExtension({
94
+ source,
95
+ fetchImpl,
96
+ apiBase,
97
+ }) {
98
+ const parsed = parseMarketplaceSource(source);
99
+ const base = marketplaceApiBase(apiBase);
100
+ const label =
101
+ parsed.ref === "latest"
102
+ ? parsed.package
103
+ : `${parsed.package}@${parsed.ref}`;
104
+ const versionUrl = `${base}/@${parsed.namespace}/${parsed.id}/versions/${encodeURIComponent(
105
+ parsed.ref,
106
+ )}`;
107
+ const info = await fetchJson(versionUrl, fetchImpl, label);
108
+ if (!info || typeof info !== "object" || Array.isArray(info))
109
+ throw new VendorError(
110
+ `Triflare Marketplace returned no version for ${label}`,
111
+ );
112
+
113
+ const version = info.version;
114
+ if (typeof version !== "string" || version === "")
115
+ throw new VendorError(
116
+ `Triflare Marketplace returned no version for ${label}`,
117
+ );
118
+ const status = info.status ?? "published";
119
+ if (status !== "published" && status !== "deprecated")
120
+ throw new VendorError(
121
+ `${parsed.package}@${version} is ${status} on Triflare Marketplace; ` +
122
+ "only published versions can be vendored.",
123
+ );
124
+
125
+ const downloadUrl = info.dist?.downloadUrl;
126
+ if (typeof downloadUrl !== "string" || downloadUrl === "")
127
+ throw new VendorError(
128
+ `${parsed.package}@${version} has no compiled download on Triflare Marketplace; ` +
129
+ "this extension cannot be vendored.",
130
+ );
131
+ const digest = String(info.dist?.digest ?? "")
132
+ .replace(/^sha256:/i, "")
133
+ .toLowerCase();
134
+ if (!/^[0-9a-f]{64}$/.test(digest))
135
+ throw new VendorError(
136
+ `${parsed.package}@${version} has no SHA-256 digest on Triflare Marketplace; ` +
137
+ "refusing to vendor an unverifiable download.",
138
+ );
139
+
140
+ const downloaded = await fetchVendorSource(downloadUrl, { fetchImpl });
141
+ const actual = sha256(downloaded.buffer);
142
+ if (actual !== digest)
143
+ throw new VendorError(
144
+ `${parsed.package}@${version} did not match the SHA-256 reported by ` +
145
+ `Triflare Marketplace (expected ${digest.slice(0, 12)}…, found ${actual.slice(
146
+ 0,
147
+ 12,
148
+ )}…).`,
149
+ );
150
+
151
+ return {
152
+ ...parsed,
153
+ version,
154
+ status,
155
+ downloadUrl,
156
+ buffer: downloaded.buffer,
157
+ digest: `sha256:${digest}`,
158
+ sha256: actual,
159
+ etag: downloaded.etag,
160
+ lastModified: downloaded.lastModified,
161
+ marketplace: {
162
+ package: parsed.package,
163
+ version,
164
+ ref: parsed.ref,
165
+ },
166
+ };
167
+ }
package/src/vendor.js CHANGED
@@ -116,6 +116,19 @@ function looksLikeLockEntry(value) {
116
116
  );
117
117
  }
118
118
 
119
+ /** Normalize marketplace provenance recorded in the lock. */
120
+ function normalizeMarketplaceLock(value) {
121
+ if (!value || typeof value !== "object" || Array.isArray(value)) return null;
122
+ const name = value.package ?? value.spec;
123
+ if (typeof name !== "string" || typeof value.version !== "string")
124
+ return null;
125
+ return {
126
+ package: name,
127
+ version: value.version,
128
+ ref: typeof value.ref === "string" ? value.ref : "latest",
129
+ };
130
+ }
131
+
119
132
  /** Normalize legacy lock-entry spellings into the current shape. */
120
133
  function normalizeLockEntry(name, raw) {
121
134
  const file = raw.file ?? raw.vendored ?? raw.vendorFile ?? raw.vendor_path;
@@ -137,6 +150,7 @@ function normalizeLockEntry(name, raw) {
137
150
  volatile: raw.volatile != null ? Boolean(raw.volatile) : undefined,
138
151
  etag: raw.etag ?? null,
139
152
  lastModified: raw.lastModified ?? raw.last_modified ?? null,
153
+ marketplace: normalizeMarketplaceLock(raw.marketplace),
140
154
  };
141
155
  }
142
156
 
@@ -205,6 +219,8 @@ export function writeLock(configDir, lock) {
205
219
  };
206
220
  if (entry.etag) clean.etag = entry.etag;
207
221
  if (entry.lastModified) clean.lastModified = entry.lastModified;
222
+ const marketplace = normalizeMarketplaceLock(entry.marketplace);
223
+ if (marketplace) clean.marketplace = marketplace;
208
224
  out.extensions[name] = clean;
209
225
  }
210
226
  writeFileAtomic(file, `${JSON.stringify(out, null, 2)}\n`);
@@ -482,7 +498,7 @@ function writeVendorFile(
482
498
  function lockEntryForInstall(name, entry, file, buffer, extra = {}) {
483
499
  return {
484
500
  name,
485
- source: entry.source,
501
+ source: extra.source ?? entry.source,
486
502
  file: posix(file),
487
503
  sha256: sha256(buffer),
488
504
  fetched: new Date().toISOString(),
@@ -491,6 +507,7 @@ function lockEntryForInstall(name, entry, file, buffer, extra = {}) {
491
507
  volatile: Boolean(entry.volatile),
492
508
  etag: extra.etag ?? null,
493
509
  lastModified: extra.lastModified ?? null,
510
+ marketplace: normalizeMarketplaceLock(extra.marketplace),
494
511
  };
495
512
  }
496
513
 
@@ -507,6 +524,8 @@ function lockEntryForInstall(name, entry, file, buffer, extra = {}) {
507
524
  * @param {typeof fetch} [options.fetchImpl]
508
525
  * @param {boolean} [options.unsandboxed]
509
526
  * @param {boolean} [options.volatile]
527
+ * @param {{buffer: Buffer, etag?: string|null, lastModified?: string|null}} [options.prefetched]
528
+ * @param {{package: string, version: string, ref: string}} [options.marketplace]
510
529
  * @returns {Promise<{entry: object, lockEntry: object, file: string}>}
511
530
  */
512
531
  export async function installVendorEntry({
@@ -519,6 +538,8 @@ export async function installVendorEntry({
519
538
  fetchImpl,
520
539
  unsandboxed,
521
540
  volatile,
541
+ prefetched,
542
+ marketplace,
522
543
  }) {
523
544
  const dir = vendorDir
524
545
  ? path.resolve(configDir, vendorDir)
@@ -533,13 +554,21 @@ export async function installVendorEntry({
533
554
  volatile == null ? entry.volatile || undefined : Boolean(volatile);
534
555
 
535
556
  let buffer;
536
- let extra = {};
537
- if (entry.remote) {
557
+ let extra;
558
+ if (prefetched) {
559
+ buffer = prefetched.buffer;
560
+ extra = {
561
+ etag: prefetched.etag,
562
+ lastModified: prefetched.lastModified,
563
+ marketplace,
564
+ };
565
+ } else if (entry.remote) {
538
566
  const read = await readEntrySource(entry, configDir, fetchImpl);
539
567
  buffer = read.buffer;
540
- extra = read.extra;
568
+ extra = { ...read.extra, marketplace };
541
569
  } else {
542
570
  buffer = readLocalSource(entry, configDir).buffer;
571
+ extra = { marketplace };
543
572
  }
544
573
  const stored = storedContent(entry, buffer);
545
574
 
@@ -616,6 +645,7 @@ export async function installVendor({ configDir, config, fetchImpl } = {}) {
616
645
  entry,
617
646
  file,
618
647
  stored,
648
+ { marketplace: previous?.marketplace },
619
649
  );
620
650
  results.push({
621
651
  name: entry.name,
@@ -653,6 +683,7 @@ export async function installVendor({ configDir, config, fetchImpl } = {}) {
653
683
  entry,
654
684
  file,
655
685
  buffer,
686
+ { marketplace: previous?.marketplace },
656
687
  );
657
688
  }
658
689
  results.push({ name: entry.name, file, status: "verified" });
@@ -682,7 +713,7 @@ export async function installVendor({ configDir, config, fetchImpl } = {}) {
682
713
  entry,
683
714
  file,
684
715
  read.buffer,
685
- read.extra,
716
+ { ...read.extra, marketplace: previous?.marketplace },
686
717
  );
687
718
  results.push({ name: entry.name, file, status: "fetched" });
688
719
  }
@@ -702,13 +733,19 @@ export async function installVendor({ configDir, config, fetchImpl } = {}) {
702
733
  /**
703
734
  * Re-fetch remote entries (or re-copy local ones) and update the lock.
704
735
  * Returns the changed entries and a textual diff for each.
736
+ *
737
+ * `resolveEntry` may return a freshly resolved source for an entry (used by
738
+ * `vendor update` to re-resolve Marketplace dist-tags). When its download URL
739
+ * differs from `fx.yml`, the config is updated too.
705
740
  */
706
741
  export async function updateVendor({
742
+ configPath,
707
743
  configDir,
708
744
  config,
709
745
  name,
710
746
  fetchImpl,
711
747
  write = true,
748
+ resolveEntry,
712
749
  } = {}) {
713
750
  const entries = config?.vendor || [];
714
751
  const dirName = config?.vendorDir || DEFAULT_VENDOR_DIR;
@@ -734,9 +771,23 @@ export async function updateVendor({
734
771
  const existed = fs.existsSync(absolute);
735
772
  const before = existed ? fs.readFileSync(absolute) : Buffer.alloc(0);
736
773
 
774
+ const resolved =
775
+ typeof resolveEntry === "function"
776
+ ? await resolveEntry(entry, lockEntry)
777
+ : null;
737
778
  let after;
738
779
  let extra = {};
739
- if (entry.local || entry.data) {
780
+ let source = entry.source;
781
+ let marketplace =
782
+ entry.source === lockEntry?.source
783
+ ? (lockEntry?.marketplace ?? null)
784
+ : null;
785
+ if (resolved) {
786
+ after = resolved.buffer;
787
+ extra = { etag: resolved.etag, lastModified: resolved.lastModified };
788
+ source = resolved.downloadUrl;
789
+ marketplace = resolved.marketplace;
790
+ } else if (entry.local || entry.data) {
740
791
  after = storedContent(entry, readLocalSource(entry, configDir).buffer);
741
792
  } else {
742
793
  const read = await readEntrySource(entry, configDir, fetchImpl);
@@ -745,12 +796,19 @@ export async function updateVendor({
745
796
  }
746
797
 
747
798
  const different = !after.equals(before);
748
- const sourceChanged = lockEntry?.source !== entry.source;
799
+ const versionChanged =
800
+ (marketplace?.version ?? null) !==
801
+ (lockEntry?.marketplace?.version ?? null);
802
+ const sourceChanged =
803
+ lockEntry?.source !== source || entry.source !== source || versionChanged;
749
804
  results.push({
750
805
  name: entry.name,
751
806
  file,
752
807
  changed: different,
753
808
  sourceChanged,
809
+ versionChanged,
810
+ version: marketplace?.version ?? null,
811
+ previousVersion: lockEntry?.marketplace?.version ?? null,
754
812
  diff: different
755
813
  ? formatDiff(before.toString("utf8"), after.toString("utf8"), file)
756
814
  : "",
@@ -765,6 +823,8 @@ export async function updateVendor({
765
823
  before,
766
824
  after,
767
825
  extra,
826
+ source,
827
+ marketplace,
768
828
  different,
769
829
  lockEntry,
770
830
  });
@@ -772,6 +832,9 @@ export async function updateVendor({
772
832
 
773
833
  if (write && pending.length > 0) {
774
834
  const backups = new Map();
835
+ const configBefore = configPath
836
+ ? fs.readFileSync(configPath, "utf8")
837
+ : null;
775
838
  try {
776
839
  for (const item of pending) {
777
840
  if (!item.different) continue;
@@ -783,13 +846,29 @@ export async function updateVendor({
783
846
  allowOverwrite: Boolean(item.lockEntry),
784
847
  });
785
848
  }
849
+ const configChanges = pending.filter(
850
+ (item) => item.source !== item.entry.source,
851
+ );
852
+ if (configChanges.length > 0 && !configPath)
853
+ throw new VendorError(
854
+ `Cannot update ${configChanges[0].entry.name}: no config file was provided`,
855
+ );
856
+ for (const item of configChanges)
857
+ addVendorEntry(configPath, item.entry.name, item.source, {
858
+ unsandboxed: item.entry.unsandboxed,
859
+ volatile: item.entry.volatile,
860
+ });
786
861
  for (const item of pending)
787
862
  lock.extensions[item.entry.name] = lockEntryForInstall(
788
863
  item.entry.name,
789
864
  item.entry,
790
865
  item.file,
791
866
  item.after,
792
- item.extra,
867
+ {
868
+ ...item.extra,
869
+ source: item.source,
870
+ marketplace: item.marketplace,
871
+ },
793
872
  );
794
873
  writeLock(configDir, lock);
795
874
  } catch (error) {
@@ -797,11 +876,12 @@ export async function updateVendor({
797
876
  if (backup.existed) fs.writeFileSync(absolute, backup.buffer);
798
877
  else fs.rmSync(absolute, { force: true });
799
878
  }
879
+ if (configBefore != null) fs.writeFileSync(configPath, configBefore);
800
880
  throw error;
801
881
  }
802
882
  }
803
883
 
804
- return { entries: results, warnings, changed, lock };
884
+ return { entries: results, warnings, changed, updated: pending.length, lock };
805
885
  }
806
886
 
807
887
  /**
@@ -894,8 +974,16 @@ export function verifyVendor({ configDir, config } = {}) {
894
974
  /**
895
975
  * Compare upstream sources with `fx.lock` without writing anything.
896
976
  * ETag/Last-Modified are sent when the lock has them.
977
+ *
978
+ * `resolveEntry` may return a freshly resolved source (used by
979
+ * `vendor outdated` to compare Marketplace dist-tags).
897
980
  */
898
- export async function outdatedVendor({ configDir, config, fetchImpl } = {}) {
981
+ export async function outdatedVendor({
982
+ configDir,
983
+ config,
984
+ fetchImpl,
985
+ resolveEntry,
986
+ } = {}) {
899
987
  const entries = config?.vendor || [];
900
988
  const dirName = config?.vendorDir || DEFAULT_VENDOR_DIR;
901
989
  const vendorDir = path.resolve(configDir, dirName);
@@ -929,6 +1017,29 @@ export async function outdatedVendor({ configDir, config, fetchImpl } = {}) {
929
1017
  }
930
1018
 
931
1019
  try {
1020
+ const resolved =
1021
+ typeof resolveEntry === "function"
1022
+ ? await resolveEntry(entry, lockEntry)
1023
+ : null;
1024
+ if (resolved) {
1025
+ const sameVersion =
1026
+ lockEntry?.marketplace?.version === resolved.marketplace?.version;
1027
+ results.push({
1028
+ name: entry.name,
1029
+ file,
1030
+ status:
1031
+ sameVersion &&
1032
+ entry.source === lockEntry?.source &&
1033
+ lockEntry?.source === resolved.downloadUrl &&
1034
+ lockEntry?.sha256 === resolved.sha256
1035
+ ? "current"
1036
+ : "outdated",
1037
+ version: resolved.marketplace?.version ?? resolved.version ?? null,
1038
+ previousVersion: lockEntry?.marketplace?.version ?? null,
1039
+ });
1040
+ continue;
1041
+ }
1042
+
932
1043
  const sameSource = lockEntry?.source === entry.source;
933
1044
  const fetched = await fetchVendorSource(entry.source, {
934
1045
  fetchImpl,
@@ -1051,6 +1162,7 @@ export async function loadVendorExtensions({
1051
1162
  entry,
1052
1163
  file,
1053
1164
  stored,
1165
+ { marketplace: lockEntry?.marketplace },
1054
1166
  );
1055
1167
  lockChanged.value = true;
1056
1168
  }
@@ -1081,6 +1193,7 @@ export async function loadVendorExtensions({
1081
1193
  entry,
1082
1194
  file,
1083
1195
  buffer,
1196
+ { marketplace: lockEntry?.marketplace },
1084
1197
  );
1085
1198
  lockChanged.value = true;
1086
1199
  }
@@ -1108,7 +1221,7 @@ export async function loadVendorExtensions({
1108
1221
  entry,
1109
1222
  file,
1110
1223
  buffer,
1111
- read.extra,
1224
+ { ...read.extra, marketplace: lockEntry?.marketplace },
1112
1225
  );
1113
1226
  lockChanged.value = true;
1114
1227
  }
@@ -2,5 +2,5 @@
2
2
  "name": "@penguinmod/packager",
3
3
  "version": "1.9.2",
4
4
  "commit": "53f868b85ec21d2edab9ce00fd2d709da93da6d6",
5
- "builtAt": "2026-11-26T19:16:44.275Z"
5
+ "builtAt": "2026-11-27T23:49:27.480Z"
6
6
  }
@@ -3,5 +3,5 @@
3
3
  "version": "0.2.0",
4
4
  "commit": "3822f284c8cda2c3a0a5c6dd928221dd9ff2cee1",
5
5
  "inputHash": "bb8f99fcce9f4ecdc563f11df5a0510dcc94c25d256c6931c7f1f113e0a1998b",
6
- "builtAt": "2026-11-26T19:17:49.724Z"
6
+ "builtAt": "2026-11-27T23:50:19.486Z"
7
7
  }
@@ -1 +1 @@
1
- exports.ids=[0],exports.modules={402:function(e,t,r){function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,s,a,i,o=[],c=!0,d=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(o.push(n.value),o.length!==t);c=!0);}catch(e){d=!0,s=e}finally{try{if(!c&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(d)throw s}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}const a=r(9),i=r(403),o="'none'",c={accelerometer:o,"ambient-light-sensor":o,battery:o,camera:o,"display-capture":o,"document-domain":o,"encrypted-media":o,fullscreen:o,geolocation:o,gyroscope:o,magnetometer:o,microphone:o,midi:o,payment:o,"picture-in-picture":o,"publickey-credentials-get":o,"speaker-selection":o,usb:o,vibrate:o,vr:o,"screen-wake-lock":o,"web-share":o,"interest-cohort":o};e.exports=class{constructor(){this.id=a(),this.isRemote=!0,this.ready=!1,this.queuedMessages=[],this.iframe=document.createElement("iframe"),this.iframe.className="tw-custom-extension-frame",this.iframe.dataset.id=this.id,this.iframe.style.display="none",this.iframe.setAttribute("aria-hidden","true"),this.iframe.sandbox="allow-scripts",this.iframe.allow=Object.entries(c).map(e=>{let t=n(e,2),r=t[0],s=t[1];return"".concat(r," ").concat(s)}).join("; "),document.body.appendChild(this.iframe),window.addEventListener("message",this._onWindowMessage.bind(this));const e=new Blob(["<!DOCTYPE html><body><script>window.__WRAPPED_IFRAME_ID__=".concat(JSON.stringify(this.id),";").concat(i,"<\/script></body>")],{type:"text/html; charset=utf-8"});this.iframe.src=URL.createObjectURL(e)}_onWindowMessage(e){if(e.data&&e.data.vmIframeId===this.id){if(e.data.ready){this.ready=!0;for(const e of this.queuedMessages){const t=e.data,r=e.transfer;this.postMessage(t,r)}this.queuedMessages.length=0}e.data.message&&this.onmessage({data:e.data.message})}}onmessage(){}postMessage(e,t){this.ready?t?this.iframe.contentWindow.postMessage(e,"*",t):this.iframe.contentWindow.postMessage(e,"*"):this.queuedMessages.push({data:e,transfer:t})}}},403:function(e,t){throw new Error("Not supported in non-web environment")}};
1
+ exports.ids=[0],exports.modules={402:function(e,t,r){function n(e,t){return function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(Array.isArray(e)&&(null==r||r===("undefined"!=typeof Symbol&&[][Symbol.iterator])||r===[]["@@iterator"]))return e;if(null!=r){var n,s,a,i,o=[],c=!0,d=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(o.push(n.value),o.length!==t);c=!0);}catch(e){d=!0,s=e}finally{try{if(!c&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(d)throw s}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}const a=r(9),i=r(403),o="'none'",c={accelerometer:o,"ambient-light-sensor":o,battery:o,camera:o,"display-capture":o,"document-domain":o,"encrypted-media":o,fullscreen:o,geolocation:o,gyroscope:o,magnetometer:o,microphone:o,midi:o,payment:o,"picture-in-picture":o,"publickey-credentials-get":o,"speaker-selection":o,usb:o,vibrate:o,vr:o,"screen-wake-lock":o,"web-share":o,"interest-cohort":o};e.exports=class{constructor(){this.id=a(),this.isRemote=!0,this.ready=!1,this.queuedMessages=[],this.iframe=document.createElement("iframe"),this.iframe.className="tw-custom-extension-frame",this.iframe.dataset.id=this.id,this.iframe.style.display="none",this.iframe.setAttribute("aria-hidden","true"),this.iframe.sandbox="allow-scripts",this.iframe.allow=Object.entries(c).map(e=>{let t=n(e,2),r=t[0],s=t[1];return"".concat(r," ").concat(s)}).join("; "),document.body.appendChild(this.iframe),window.addEventListener("message",this._onWindowMessage.bind(this));const e=new Blob(["<!DOCTYPE html><body><script>window.__WRAPPED_IFRAME_ID__=".concat(JSON.stringify(this.id),";").concat(i,"<\/script></body>")],{type:"text/html; charset=utf-8"});this.iframe.src=URL.createObjectURL(e)}_onWindowMessage(e){if(e.data&&e.data.vmIframeId===this.id){if(e.data.ready){this.ready=!0;for(const e of this.queuedMessages){const t=e.data,r=e.transfer;this.postMessage(t,r)}this.queuedMessages.length=0}e.data.message&&this.onmessage({data:e.data.message})}}onmessage(){}postMessage(e,t){this.ready?t?this.iframe.contentWindow.postMessage(e,"*",t):this.iframe.contentWindow.postMessage(e,"*"):this.queuedMessages.push({data:e,transfer:t})}}},403:function(e,t){throw new Error("Not supported in non-web environment")}};
@@ -0,0 +1 @@
1
+ !function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=13)}([function(e,t,n){function r(){}n(27).mixin(r),r.prototype.write=function(e,t,n){this.emit("item",e,t,n)},r.prototype.end=function(){this.emit("end"),this.removeAllListeners()},r.prototype.pipe=function(e){var t=this;function n(){e.write.apply(e,Array.prototype.slice.call(arguments))}function r(){!e._isStdio&&e.end()}return t.emit("unpipe",e),e.emit("pipe",t),t.on("item",n),t.on("end",r),t.when("unpipe",(function(i){var a=i===e||void 0===i;return a&&(t.removeListener("item",n),t.removeListener("end",r),e.emit("unpipe")),a})),e},r.prototype.unpipe=function(e){return this.emit("unpipe",e),this},r.prototype.format=function(e){throw new Error(["Warning: .format() is deprecated in Minilog v2! Use .pipe() instead. For example:","var Minilog = require('minilog');","Minilog"," .pipe(Minilog.backends.console.formatClean)"," .pipe(Minilog.backends.console);"].join("\n"))},r.mixin=function(e){var t,n=r.prototype;for(t in n)n.hasOwnProperty(t)&&(e.prototype[t]=n[t])},e.exports=r},function(e,t){var n={bold:["",""],italic:["",""],underline:["",""],inverse:["",""],white:["",""],grey:["",""],black:["",""],blue:["",""],cyan:["",""],green:["",""],magenta:["",""],red:["",""],yellow:["",""]};t.levelMap={debug:1,info:2,warn:3,error:4},t.style=function(e,t){return n[t][0]+e+n[t][1]}},function(e,t,n){const r=n(26);r.enable(),e.exports=r("vm")},function(e,t){e.exports={ANGLE:"angle",BOOLEAN:"Boolean",COLOR:"color",NUMBER:"number",STRING:"string",MATRIX:"matrix",NOTE:"note",IMAGE:"image",POLYGON:"polygon",CUSTOM:"custom",COSTUME:"costume",SOUND:"sound",VARIABLE:"variable",LIST:"list",BROADCAST:"broadcast",SEPERATOR:"seperator"}},function(e,t){e.exports={BOOLEAN:"Boolean",BUTTON:"button",LABEL:"label",COMMAND:"command",CONDITIONAL:"conditional",EVENT:"event",HAT:"hat",LOOP:"loop",REPORTER:"reporter",XML:"xml"}},function(e,t){class n{static get RGB_BLACK(){return{r:0,g:0,b:0}}static get RGB_WHITE(){return{r:255,g:255,b:255}}static decimalToHex(e){e<0&&(e+=16777216);let t=Math.round(Number(e)).toString(16);return t="#".concat("000000".substr(0,6-t.length)).concat(t),t}static decimalToRgb(e){const t=e>>24&255;return{r:e>>16&255,g:e>>8&255,b:255&e,a:t>0?t:255}}static hexToRgb(e){e.startsWith("#")&&(e=e.substring(1)),8===e.length&&(e=e.slice(0,6));const t=parseInt(e,16);if(isNaN(t))return null;if(6===e.length)return{r:t>>16&255,g:t>>8&255,b:255&t};if(3===e.length){const e=t>>8&15,n=t>>4&15,r=15&t;return{r:e<<4|e,g:n<<4|n,b:r<<4|r}}return null}static rgbToHex(e){return n.decimalToHex(n.rgbToDecimal(e))}static rgbToDecimal(e){return(e.r<<16)+(e.g<<8)+e.b}static hexToDecimal(e){return n.rgbToDecimal(n.hexToRgb(e))}static hsvToRgb(e){let t=e.h%360;t<0&&(t+=360);const n=Math.max(0,Math.min(e.s,1)),r=Math.max(0,Math.min(e.v,1)),i=Math.floor(t/60),a=t/60-i,o=r*(1-n),s=r*(1-n*a),c=r*(1-n*(1-a));let l,u,f;switch(i){default:case 0:l=r,u=c,f=o;break;case 1:l=s,u=r,f=o;break;case 2:l=o,u=r,f=c;break;case 3:l=o,u=s,f=r;break;case 4:l=c,u=o,f=r;break;case 5:l=r,u=o,f=s}return{r:Math.floor(255*l),g:Math.floor(255*u),b:Math.floor(255*f)}}static rgbToHsv(e){const t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(Math.min(t,n),r),a=Math.max(Math.max(t,n),r);let o=0,s=0;if(i!==a){o=60*((t===i?3:n===i?5:1)-(t===i?n-r:n===i?r-t:t-n)/(a-i))%360,s=(a-i)/a}return{h:o,s:s,v:a}}static mixRgb(e,t,n){if(n<=0)return e;if(n>=1)return t;const r=1-n;return{r:r*e.r+n*t.r,g:r*e.g+n*t.g,b:r*e.b+n*t.b}}}e.exports=n},function(e,t,n){var r=n(0),i=n(28),a=new r,o=Array.prototype.slice;(t=e.exports=function(e){var n=function(){return a.write(e,void 0,o.call(arguments)),n};return n.debug=function(){return a.write(e,"debug",o.call(arguments)),n},n.info=function(){return a.write(e,"info",o.call(arguments)),n},n.warn=function(){return a.write(e,"warn",o.call(arguments)),n},n.error=function(){return a.write(e,"error",o.call(arguments)),n},n.log=n.debug,n.suggest=t.suggest,n.format=a.format,n}).defaultBackend=t.defaultFormatter=null,t.pipe=function(e){return a.pipe(e)},t.end=t.unpipe=t.disable=function(e){return a.unpipe(e)},t.Transform=r,t.Filter=i,t.suggest=new i,t.enable=function(){return t.defaultFormatter?a.pipe(t.suggest).pipe(t.defaultFormatter).pipe(t.defaultBackend):a.pipe(t.suggest).pipe(t.defaultBackend)}},function(e,t){e.exports=require("util")},function(e,t){var n={black:"#000",red:"#c23621",green:"#25bc26",yellow:"#bbbb00",blue:"#492ee1",magenta:"#d338d3",cyan:"#33bbc8",gray:"#808080",purple:"#708"};e.exports=function(e,t){return t?"color: #fff; background: "+n[e]+";":"color: "+n[e]+";"}},function(e,t){e.exports={isWorker:!0,centralDispatchService:self}},function(e,t){var n="long",r="short",i="numeric";e.exports={number:{decimal:{style:"decimal"},integer:{style:"decimal",maximumFractionDigits:0},currency:{style:"currency",currency:"USD"},percent:{style:"percent"},default:{style:"decimal"}},date:{short:{month:i,day:i,year:"2-digit"},medium:{month:r,day:i,year:i},long:{month:n,day:i,year:i},full:{month:n,day:i,year:i,weekday:n},default:{month:r,day:i,year:i}},time:{short:{hour:i,minute:i},medium:{hour:i,minute:i,second:i},long:{hour:i,minute:i,second:i,timeZoneName:r},full:{hour:i,minute:i,second:i,timeZoneName:r},default:{hour:i,minute:i,second:i}},duration:{default:{hours:{minimumIntegerDigits:1,maximumFractionDigits:0},minutes:{minimumIntegerDigits:2,maximumFractionDigits:0},seconds:{minimumIntegerDigits:2,maximumFractionDigits:3}}},parseNumberPattern:function(e){if(e){var t={},n=e.match(/\b[A-Z]{3}\b/i),r=e.replace(/[^¤]/g,"").length;if(!r&&n&&(r=1),r?(t.style="currency",t.currencyDisplay=1===r?"symbol":2===r?"code":"name",t.currency=n?n[0].toUpperCase():"USD"):e.indexOf("%")>=0&&(t.style="percent"),!/[@#0]/.test(e))return t.style?t:void 0;if(t.useGrouping=e.indexOf(",")>=0,/E\+?[@#0]+/i.test(e)||e.indexOf("@")>=0){var i=e.replace(/E\+?[@#0]+|[^@#0]/gi,"");t.minimumSignificantDigits=Math.min(Math.max(i.replace(/[^@0]/g,"").length,1),21),t.maximumSignificantDigits=Math.min(Math.max(i.length,1),21)}else{for(var a=e.replace(/[^#0.]/g,"").split("."),o=a[0],s=o.length-1;"0"===o[s];)--s;t.minimumIntegerDigits=Math.min(Math.max(o.length-1-s,1),21);var c=a[1]||"";for(s=0;"0"===c[s];)++s;for(t.minimumFractionDigits=Math.min(Math.max(s,0),20);"#"===c[s];)++s;t.maximumFractionDigits=Math.min(Math.max(s,0),20)}return t}},parseDatePattern:function(e){if(e){for(var t={},a=0;a<e.length;){for(var o=e[a],s=1;e[++a]===o;)++s;switch(o){case"G":t.era=5===s?"narrow":4===s?n:r;break;case"y":case"Y":t.year=2===s?"2-digit":i;break;case"M":case"L":s=Math.min(Math.max(s-1,0),4),t.month=[i,"2-digit",r,n,"narrow"][s];break;case"E":case"e":case"c":t.weekday=5===s?"narrow":4===s?n:r;break;case"d":case"D":t.day=2===s?"2-digit":i;break;case"h":case"K":t.hour12=!0,t.hour=2===s?"2-digit":i;break;case"H":case"k":t.hour12=!1,t.hour=2===s?"2-digit":i;break;case"m":t.minute=2===s?"2-digit":i;break;case"s":case"S":t.second=2===s?"2-digit":i;break;case"z":case"Z":case"v":case"V":t.timeZoneName=1===s?r:n}}return Object.keys(t).length?t:void 0}}}},function(e,t){e.exports=function(e,t){if("string"==typeof e&&t[e])return e;for(var n=[].concat(e||[]),r=0,i=n.length;r<i;++r)for(var a=n[r].split("-");a.length;){var o=a.join("-");if(t[o])return o;a.pop()}}},function(e,t,n){"use strict";var r="one",i="two",a="few",o="many",s="other",c=[function(e){return 1===+e?r:s},function(e){var t=+e;return 0<=t&&t<=1?r:s},function(e){return 0===Math.floor(Math.abs(+e))||1===+e?r:s},function(e){var t=+e;return 0===t?"zero":1===t?r:2===t?i:3<=t%100&&t%100<=10?a:11<=t%100&&t%100<=99?o:s},function(e){var t=Math.floor(Math.abs(+e)),n=(e+".").split(".")[1].length;return 1===t&&0===n?r:s},function(e){var t=+e;return t%10==1&&t%100!=11?r:2<=t%10&&t%10<=4&&(t%100<12||14<t%100)?a:t%10==0||5<=t%10&&t%10<=9||11<=t%100&&t%100<=14?o:s},function(e){var t=+e;return t%10==1&&t%100!=11&&t%100!=71&&t%100!=91?r:t%10==2&&t%100!=12&&t%100!=72&&t%100!=92?i:(3<=t%10&&t%10<=4||t%10==9)&&(t%100<10||19<t%100)&&(t%100<70||79<t%100)&&(t%100<90||99<t%100)?a:0!==t&&t%1e6==0?o:s},function(e){var t=Math.floor(Math.abs(+e)),n=(e+".").split(".")[1].length,i=+(e+".").split(".")[1];return 0===n&&t%10==1&&t%100!=11||i%10==1&&i%100!=11?r:0===n&&2<=t%10&&t%10<=4&&(t%100<12||14<t%100)||2<=i%10&&i%10<=4&&(i%100<12||14<i%100)?a:s},function(e){var t=Math.floor(Math.abs(+e)),n=(e+".").split(".")[1].length;return 1===t&&0===n?r:2<=t&&t<=4&&0===n?a:0!==n?o:s},function(e){var t=+e;return 0===t?"zero":1===t?r:2===t?i:3===t?a:6===t?o:s},function(e){var t=Math.floor(Math.abs(+e)),n=+(""+e).replace(/^[^.]*.?|0+$/g,"");return 1===+e||0!==n&&(0===t||1===t)?r:s},function(e){var t=Math.floor(Math.abs(+e)),n=(e+".").split(".")[1].length,o=+(e+".").split(".")[1];return 0===n&&t%100==1||o%100==1?r:0===n&&t%100==2||o%100==2?i:0===n&&3<=t%100&&t%100<=4||3<=o%100&&o%100<=4?a:s},function(e){var t=Math.floor(Math.abs(+e));return 0===t||1===t?r:s},function(e){var t=Math.floor(Math.abs(+e)),n=(e+".").split(".")[1].length,i=+(e+".").split(".")[1];return 0===n&&(1===t||2===t||3===t)||0===n&&t%10!=4&&t%10!=6&&t%10!=9||0!==n&&i%10!=4&&i%10!=6&&i%10!=9?r:s},function(e){var t=+e;return 1===t?r:2===t?i:3<=t&&t<=6?a:7<=t&&t<=10?o:s},function(e){var t=+e;return 1===t||11===t?r:2===t||12===t?i:3<=t&&t<=10||13<=t&&t<=19?a:s},function(e){var t=Math.floor(Math.abs(+e)),n=(e+".").split(".")[1].length;return 0===n&&t%10==1?r:0===n&&t%10==2?i:0!==n||t%100!=0&&t%100!=20&&t%100!=40&&t%100!=60&&t%100!=80?0!==n?o:s:a},function(e){var t=Math.floor(Math.abs(+e)),n=(e+".").split(".")[1].length,a=+e;return 1===t&&0===n?r:2===t&&0===n?i:0===n&&(a<0||10<a)&&a%10==0?o:s},function(e){var t=Math.floor(Math.abs(+e)),n=+(""+e).replace(/^[^.]*.?|0+$/g,"");return 0===n&&t%10==1&&t%100!=11||0!==n?r:s},function(e){var t=+e;return 1===t?r:2===t?i:s},function(e){var t=+e;return 0===t?"zero":1===t?r:s},function(e){var t=Math.floor(Math.abs(+e)),n=+e;return 0===n?"zero":0!==t&&1!==t||0===n?s:r},function(e){var t=+(e+".").split(".")[1],n=+e;return n%10==1&&(n%100<11||19<n%100)?r:2<=n%10&&n%10<=9&&(n%100<11||19<n%100)?a:0!==t?o:s},function(e){var t=(e+".").split(".")[1].length,n=+(e+".").split(".")[1],i=+e;return i%10==0||11<=i%100&&i%100<=19||2===t&&11<=n%100&&n%100<=19?"zero":i%10==1&&i%100!=11||2===t&&n%10==1&&n%100!=11||2!==t&&n%10==1?r:s},function(e){var t=Math.floor(Math.abs(+e)),n=(e+".").split(".")[1].length,i=+(e+".").split(".")[1];return 0===n&&t%10==1&&t%100!=11||i%10==1&&i%100!=11?r:s},function(e){var t=Math.floor(Math.abs(+e)),n=(e+".").split(".")[1].length,i=+e;return 1===t&&0===n?r:0!==n||0===i||1!==i&&1<=i%100&&i%100<=19?a:s},function(e){var t=+e;return 1===t?r:0===t||2<=t%100&&t%100<=10?a:11<=t%100&&t%100<=19?o:s},function(e){var t=Math.floor(Math.abs(+e)),n=(e+".").split(".")[1].length;return 1===t&&0===n?r:0===n&&2<=t%10&&t%10<=4&&(t%100<12||14<t%100)?a:0===n&&1!==t&&0<=t%10&&t%10<=1||0===n&&5<=t%10&&t%10<=9||0===n&&12<=t%100&&t%100<=14?o:s},function(e){var t=Math.floor(Math.abs(+e));return 0<=t&&t<=1?r:s},function(e){var t=Math.floor(Math.abs(+e)),n=(e+".").split(".")[1].length;return 0===n&&t%10==1&&t%100!=11?r:0===n&&2<=t%10&&t%10<=4&&(t%100<12||14<t%100)?a:0===n&&t%10==0||0===n&&5<=t%10&&t%10<=9||0===n&&11<=t%100&&t%100<=14?o:s},function(e){var t=+e;return 0===Math.floor(Math.abs(+e))||1===t?r:2<=t&&t<=10?a:s},function(e){var t=Math.floor(Math.abs(+e)),n=+(e+".").split(".")[1],i=+e;return 0===i||1===i||0===t&&1===n?r:s},function(e){var t=Math.floor(Math.abs(+e)),n=(e+".").split(".")[1].length;return 0===n&&t%100==1?r:0===n&&t%100==2?i:0===n&&3<=t%100&&t%100<=4||0!==n?a:s},function(e){var t=+e;return 0<=t&&t<=1||11<=t&&t<=99?r:s},function(e){var t=+e;return 1===t||5===t||7===t||8===t||9===t||10===t?r:2===t||3===t?i:4===t?a:6===t?o:s},function(e){var t=Math.floor(Math.abs(+e));return t%10==1||t%10==2||t%10==5||t%10==7||t%10==8||t%100==20||t%100==50||t%100==70||t%100==80?r:t%10==3||t%10==4||t%1e3==100||t%1e3==200||t%1e3==300||t%1e3==400||t%1e3==500||t%1e3==600||t%1e3==700||t%1e3==800||t%1e3==900?a:0===t||t%10==6||t%100==40||t%100==60||t%100==90?o:s},function(e){var t=+e;return t%10!=2&&t%10!=3||t%100==12||t%100==13?s:a},function(e){var t=+e;return 1===t||3===t?r:2===t?i:4===t?a:s},function(e){var t=+e;return 0===t||7===t||8===t||9===t?"zero":1===t?r:2===t?i:3===t||4===t?a:5===t||6===t?o:s},function(e){var t=+e;return t%10==1&&t%100!=11?r:t%10==2&&t%100!=12?i:t%10==3&&t%100!=13?a:s},function(e){var t=+e;return 1===t||11===t?r:2===t||12===t?i:3===t||13===t?a:s},function(e){var t=+e;return 1===t?r:2===t||3===t?i:4===t?a:6===t?o:s},function(e){var t=+e;return 1===t||5===t?r:s},function(e){var t=+e;return 11===t||8===t||80===t||800===t?o:s},function(e){var t=Math.floor(Math.abs(+e));return 1===t?r:0===t||2<=t%100&&t%100<=20||t%100==40||t%100==60||t%100==80?o:s},function(e){var t=+e;return t%10==6||t%10==9||t%10==0&&0!==t?o:s},function(e){var t=Math.floor(Math.abs(+e));return t%10==1&&t%100!=11?r:t%10==2&&t%100!=12?i:t%10!=7&&t%10!=8||t%100==17||t%100==18?s:o},function(e){var t=+e;return 1===t?r:2===t||3===t?i:4===t?a:s},function(e){var t=+e;return 1<=t&&t<=4?r:s},function(e){var t=+e;return 1===t||5===t||7<=t&&t<=9?r:2===t||3===t?i:4===t?a:6===t?o:s},function(e){var t=+e;return 1===t?r:t%10==4&&t%100!=14?o:s},function(e){var t=+e;return t%10!=1&&t%10!=2||t%100==11||t%100==12?s:r},function(e){var t=+e;return t%10==6||t%10==9||10===t?a:s},function(e){var t=+e;return t%10==3&&t%100!=13?a:s}];e.exports={af:{cardinal:c[0]},ak:{cardinal:c[1]},am:{cardinal:c[2]},ar:{cardinal:c[3]},ars:{cardinal:c[3]},as:{cardinal:c[2],ordinal:c[34]},asa:{cardinal:c[0]},ast:{cardinal:c[4]},az:{cardinal:c[0],ordinal:c[35]},be:{cardinal:c[5],ordinal:c[36]},bem:{cardinal:c[0]},bez:{cardinal:c[0]},bg:{cardinal:c[0]},bh:{cardinal:c[1]},bn:{cardinal:c[2],ordinal:c[34]},br:{cardinal:c[6]},brx:{cardinal:c[0]},bs:{cardinal:c[7]},ca:{cardinal:c[4],ordinal:c[37]},ce:{cardinal:c[0]},cgg:{cardinal:c[0]},chr:{cardinal:c[0]},ckb:{cardinal:c[0]},cs:{cardinal:c[8]},cy:{cardinal:c[9],ordinal:c[38]},da:{cardinal:c[10]},de:{cardinal:c[4]},dsb:{cardinal:c[11]},dv:{cardinal:c[0]},ee:{cardinal:c[0]},el:{cardinal:c[0]},en:{cardinal:c[4],ordinal:c[39]},eo:{cardinal:c[0]},es:{cardinal:c[0]},et:{cardinal:c[4]},eu:{cardinal:c[0]},fa:{cardinal:c[2]},ff:{cardinal:c[12]},fi:{cardinal:c[4]},fil:{cardinal:c[13],ordinal:c[0]},fo:{cardinal:c[0]},fr:{cardinal:c[12],ordinal:c[0]},fur:{cardinal:c[0]},fy:{cardinal:c[4]},ga:{cardinal:c[14],ordinal:c[0]},gd:{cardinal:c[15],ordinal:c[40]},gl:{cardinal:c[4]},gsw:{cardinal:c[0]},gu:{cardinal:c[2],ordinal:c[41]},guw:{cardinal:c[1]},gv:{cardinal:c[16]},ha:{cardinal:c[0]},haw:{cardinal:c[0]},he:{cardinal:c[17]},hi:{cardinal:c[2],ordinal:c[41]},hr:{cardinal:c[7]},hsb:{cardinal:c[11]},hu:{cardinal:c[0],ordinal:c[42]},hy:{cardinal:c[12],ordinal:c[0]},ia:{cardinal:c[4]},io:{cardinal:c[4]},is:{cardinal:c[18]},it:{cardinal:c[4],ordinal:c[43]},iu:{cardinal:c[19]},iw:{cardinal:c[17]},jgo:{cardinal:c[0]},ji:{cardinal:c[4]},jmc:{cardinal:c[0]},ka:{cardinal:c[0],ordinal:c[44]},kab:{cardinal:c[12]},kaj:{cardinal:c[0]},kcg:{cardinal:c[0]},kk:{cardinal:c[0],ordinal:c[45]},kkj:{cardinal:c[0]},kl:{cardinal:c[0]},kn:{cardinal:c[2]},ks:{cardinal:c[0]},ksb:{cardinal:c[0]},ksh:{cardinal:c[20]},ku:{cardinal:c[0]},kw:{cardinal:c[19]},ky:{cardinal:c[0]},lag:{cardinal:c[21]},lb:{cardinal:c[0]},lg:{cardinal:c[0]},ln:{cardinal:c[1]},lt:{cardinal:c[22]},lv:{cardinal:c[23]},mas:{cardinal:c[0]},mg:{cardinal:c[1]},mgo:{cardinal:c[0]},mk:{cardinal:c[24],ordinal:c[46]},ml:{cardinal:c[0]},mn:{cardinal:c[0]},mo:{cardinal:c[25],ordinal:c[0]},mr:{cardinal:c[2],ordinal:c[47]},mt:{cardinal:c[26]},nah:{cardinal:c[0]},naq:{cardinal:c[19]},nb:{cardinal:c[0]},nd:{cardinal:c[0]},ne:{cardinal:c[0],ordinal:c[48]},nl:{cardinal:c[4]},nn:{cardinal:c[0]},nnh:{cardinal:c[0]},no:{cardinal:c[0]},nr:{cardinal:c[0]},nso:{cardinal:c[1]},ny:{cardinal:c[0]},nyn:{cardinal:c[0]},om:{cardinal:c[0]},or:{cardinal:c[0],ordinal:c[49]},os:{cardinal:c[0]},pa:{cardinal:c[1]},pap:{cardinal:c[0]},pl:{cardinal:c[27]},prg:{cardinal:c[23]},ps:{cardinal:c[0]},pt:{cardinal:c[28]},"pt-PT":{cardinal:c[4]},rm:{cardinal:c[0]},ro:{cardinal:c[25],ordinal:c[0]},rof:{cardinal:c[0]},ru:{cardinal:c[29]},rwk:{cardinal:c[0]},saq:{cardinal:c[0]},sc:{cardinal:c[4],ordinal:c[43]},scn:{cardinal:c[4],ordinal:c[43]},sd:{cardinal:c[0]},sdh:{cardinal:c[0]},se:{cardinal:c[19]},seh:{cardinal:c[0]},sh:{cardinal:c[7]},shi:{cardinal:c[30]},si:{cardinal:c[31]},sk:{cardinal:c[8]},sl:{cardinal:c[32]},sma:{cardinal:c[19]},smi:{cardinal:c[19]},smj:{cardinal:c[19]},smn:{cardinal:c[19]},sms:{cardinal:c[19]},sn:{cardinal:c[0]},so:{cardinal:c[0]},sq:{cardinal:c[0],ordinal:c[50]},sr:{cardinal:c[7]},ss:{cardinal:c[0]},ssy:{cardinal:c[0]},st:{cardinal:c[0]},sv:{cardinal:c[4],ordinal:c[51]},sw:{cardinal:c[4]},syr:{cardinal:c[0]},ta:{cardinal:c[0]},te:{cardinal:c[0]},teo:{cardinal:c[0]},ti:{cardinal:c[1]},tig:{cardinal:c[0]},tk:{cardinal:c[0],ordinal:c[52]},tl:{cardinal:c[13],ordinal:c[0]},tn:{cardinal:c[0]},tr:{cardinal:c[0]},ts:{cardinal:c[0]},tzm:{cardinal:c[33]},ug:{cardinal:c[0]},uk:{cardinal:c[29],ordinal:c[53]},ur:{cardinal:c[4]},uz:{cardinal:c[0]},ve:{cardinal:c[0]},vo:{cardinal:c[0]},vun:{cardinal:c[0]},wa:{cardinal:c[1]},wae:{cardinal:c[0]},xh:{cardinal:c[0]},xog:{cardinal:c[0]},yi:{cardinal:c[4]},zu:{cardinal:c[2]},lo:{ordinal:c[0]},ms:{ordinal:c[0]},vi:{ordinal:c[0]}}},function(e,t,n){function r(e,t){return function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(Array.isArray(e)&&(null==n||n===("undefined"!=typeof Symbol&&[][Symbol.iterator])||n===[]["@@iterator"]))return e;if(null!=n){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const a=n(14),o=n(22),s=n(24),c=n(2),l=n(9).isWorker,u=n(43)(null);global.Scratch=global.Scratch||{},Object.assign(global.Scratch,a,{canFetch:()=>Promise.resolve(!0),fetch:function(e){function t(t,n){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((e,t)=>fetch(e,t)),canOpenWindow:()=>Promise.resolve(!1),openWindow:()=>Promise.reject(new Error("Scratch.openWindow not supported in sandboxed extensions")),canRedirect:()=>Promise.resolve(!1),redirect:()=>Promise.reject(new Error("Scratch.redirect not supported in sandboxed extensions")),canRecordAudio:()=>Promise.resolve(!1),canRecordVideo:()=>Promise.resolve(!1),canReadClipboard:()=>Promise.resolve(!1),canNotify:()=>Promise.resolve(!1),canGeolocate:()=>Promise.resolve(!1),canEmbed:()=>Promise.resolve(!1),canUnsandbox:()=>Promise.resolve(!1),canScreenshotCamera:()=>Promise.resolve(!1),canDownload:()=>Promise.resolve(!1),download:()=>Promise.reject(new Error("Scratch.download not supported in sandboxed extensions")),translate:u});const f=new class{constructor(){this.nextExtensionId=0,this.initialRegistrations=[],this.firstRegistrationPromise=new Promise(e=>{this.firstRegistrationCallback=e}),s.waitForConnection.then(()=>{s.call("extensions","allocateWorker").then(async e=>{const t=r(e,2),n=t[0],i=t[1];this.workerId=n;try{await(e=>{if(!l)return new Promise((t,n)=>{const r=document.createElement("script");r.onload=()=>t(),r.onerror=()=>{n(new Error("Error in sandboxed script: ".concat(e,". Check the console for more information.")))},r.src=e,document.body.appendChild(r)});importScripts(e)})(i),await this.firstRegistrationPromise;const e=this.initialRegistrations;this.initialRegistrations=null,Promise.all(e).then(()=>s.call("extensions","onWorkerInit",n))}catch(e){c.error(e),s.call("extensions","onWorkerInit",n,"".concat(e))}})}),this.extensions=[]}register(e){const t=this.nextExtensionId++;this.extensions.push(e);const n="extension.".concat(this.workerId,".").concat(t),r=s.setService(n,e).then(()=>s.call("extensions","registerExtensionService",n));return this.initialRegistrations&&(this.firstRegistrationCallback(),this.initialRegistrations.push(r)),r}};global.Scratch.extensions={register:f.register.bind(f)},global.ScratchExtensions=o(global.Scratch)},function(e,t,n){const r={ArgumentType:n(3),ArgumentAlignment:n(15),BlockType:n(4),BlockShape:n(16),NotchShape:n(17),TargetType:n(18),Cast:n(19),Clone:n(20),Color:n(5),external:n(21)};e.exports=r},function(e,t){e.exports={DEFAULT:null,LEFT:"LEFT",CENTER:"CENTRE",RIGHT:"RIGHT"}},function(e,t){e.exports={HEXAGONAL:1,ROUND:2,SQUARE:3,LEAF:4,PLUS:5,OCTAGONAL:6,BUMPED:7,INDENTED:8,SCRAPPED:9,ARROW:10,TICKET:11}},function(e,t){e.exports={SWITCH:"switchCase",HEXAGON:"hexagon",ROUND:"round",SQUARE:"square",LEAF:"leaf",PLUS:"plus",OCTAGONAL:"octagonal",BUMPED:"bumped",INDENTED:"indented",SCRAPPED:"scrapped",ARROW:"arrow",TICKET:"ticket",JIGSAW:"jigsaw",INVERTED:"inverted",PINCER:"pincer"}},function(e,t){e.exports={SPRITE:"sprite",STAGE:"stage"}},function(e,t,n){const r=n(5),i=e=>{if("string"!=typeof e)return!1;for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(48===n||9===n)return!1}return!0};class a{static toNumber(e){if("number"==typeof e)return Number.isNaN(e)?0:e;const t=Number(e);return Number.isNaN(t)?0:t}static toBoolean(e){return"boolean"==typeof e?e:"string"==typeof e?""!==e&&"0"!==e&&"false"!==e.toLowerCase():Boolean(e)}static toString(e){return String(e)}static toRgbColorList(e){const t=a.toRgbColorObject(e);return[t.r,t.g,t.b]}static toRgbColorObject(e){let t;return"object"==typeof e&&(e+=""),"string"==typeof e&&"#"===e.substring(0,1)?(t=r.hexToRgb(e),t||(t={r:0,g:0,b:0,a:255})):t=r.decimalToRgb(a.toNumber(e)),t}static isWhiteSpace(e){return null===e||"string"==typeof e&&0===e.trim().length}static compare(e,t){let n=Number(e),r=Number(t);if(0===n&&i(e)?n=NaN:0===r&&i(t)&&(r=NaN),isNaN(n)||isNaN(r)){const n=String(e).toLowerCase(),r=String(t).toLowerCase();return n<r?-1:n>r?1:0}return n===1/0&&r===1/0||n===-1/0&&r===-1/0?0:n-r}static isInt(e){return"number"==typeof e?!!isNaN(e)||e===Math.floor(e):"boolean"==typeof e||"string"==typeof e&&e.indexOf(".")<0}static get LIST_INVALID(){return"INVALID"}static get LIST_ALL(){return"ALL"}static toListIndex(e,t,n){if("number"!=typeof e){if("all"===e)return n?a.LIST_ALL:a.LIST_INVALID;if("last"===e)return t>0?t:a.LIST_INVALID;if("random"===e||"any"===e)return t>0?1+Math.floor(Math.random()*t):a.LIST_INVALID}return(e=Math.floor(a.toNumber(e)))<1||e>t?a.LIST_INVALID:e}}e.exports=a},function(e,t){e.exports=class{static simple(e){return JSON.parse(JSON.stringify(e))}}},function(e,t){const n=e=>{if(!(e.startsWith("http:")||e.startsWith("https:")||e.startsWith("data:")||e.startsWith("blob:")))throw new Error("Unsupported URL: ".concat(e))},r={importModule:e=>(n(e),import(e)),fetch:async e=>{n(e);const t=await fetch(e);if(!t.ok)throw new Error("HTTP ".concat(t.status," fetching ").concat(e));return t},dataURL:async e=>{const t=await r.fetch(e),n=await t.blob();return new Promise((e,t)=>{const r=new FileReader;r.onload=()=>e(r.result),r.onerror=()=>t(r.error),r.readAsDataURL(n)})},blob:async e=>(await r.fetch(e)).blob(),evalAndReturn:async(e,t)=>{const n=await r.fetch(e),i=await n.text(),a="".concat(i,"\nreturn ").concat(t,";");return new Function(a)()}};e.exports=r},function(e,t,n){const r=n(3),i=n(4),a=n(23),o=a.argumentIndexToId,s=a.generateExtensionId,c=e=>{if(""===e||" "===e||"w"===e)return{type:i.COMMAND,async:"w"===e};if("r"===e||"R"===e)return{type:i.REPORTER,async:"R"===e};if("b"===e)return{type:i.BOOLEAN,async:!1};if("h"===e)return{type:i.HAT,async:!1};throw new Error("Unknown ScratchX block type: ".concat(e))},l=(e,t)=>{const n={},i="string"==typeof(a=t)||"number"==typeof a||"boolean"==typeof a;var a;if(i&&(n.defaultValue=t),"s"===e)n.type=r.STRING,i||(n.defaultValue="");else if("n"===e)n.type=r.NUMBER,i||(n.defaultValue=0);else{if("m"!==e[0])throw new Error("Unknown ScratchX argument type: ".concat(e));{n.type=r.STRING;const t=e.split(/\.|:/)[1];n.menu=t}}return n},u=(e,t,n)=>r=>{const i=[];for(let e=0;e<t;e++)i.push(r[o(e)]);return n?new Promise(t=>{e(...i,t)}):e(...i)},f=new Map;e.exports=e=>({register:(t,n,r)=>{const i=((e,t,n)=>{const r={id:s(e),name:t.displayName||e,blocks:[],color1:"#4a4a5e",color2:"#31323f",color3:"#191a21"},i={getInfo:()=>r,_getStatus:n._getStatus};t.url&&(r.docsURI=t.url);for(const e of t.blocks){if(1===e.length){r.blocks.push("---");continue}const t=e[0],a=e[1],s=e[2],f=e.slice(3);let d="";const p=[],h=a.split(/%([\w.:]+)/g);for(let e=0;e<h.length;e++){const t=h[e];if(e%2==1){l(t);const n=Math.floor(e/2).toString(),r=f[n],i=o(n);p[i]=l(t,r),d+="[".concat(i,"]")}else d+=t}const m=c(t),g={opcode:s,blockType:m.type,text:d,arguments:p};r.blocks.push(g);const y=n[s],b=p.length;i[s]=u(y,b,m.async)}const a=t.menus;if(a){const e={};for(const t of Object.keys(a)||{}){const n={items:a[t]};e[t]=n}r.menus=e}return i})(t,n,r);f.set(t,i),e.extensions.register(i)},getStatus:e=>{const t=f.get(e);return t?t._getStatus():{status:0,msg:"does not exist"}}})},function(e,t){e.exports={generateExtensionId:e=>{const t=e.replace(/[^a-z0-9]/gi,"").toLowerCase();return"sbx".concat(t)},argumentIndexToId:e=>e.toString()}},function(e,t,n){const r=n(25),i=n(2),a=n(9).centralDispatchService;e.exports=new class extends r{constructor(){super(),this._connectionPromise=new Promise(e=>{this._onConnect=e}),this.services={},this._onMessage=this._onMessage.bind(this,a),"undefined"!=typeof self&&(self.onmessage=this._onMessage)}get waitForConnection(){return this._connectionPromise}setService(e,t){return this.services.hasOwnProperty(e)&&i.warn("Worker dispatch replacing existing service provider for ".concat(e)),this.services[e]=t,this.waitForConnection.then(()=>this._remoteCall(a,"dispatch","setService",e))}_getServiceProvider(e){const t=this.services[e];return{provider:t||a,isRemote:!t}}_onDispatchMessage(e,t){let n;switch(t.method){case"handshake":n=this._onConnect();break;case"terminate":setTimeout(()=>self.close(),0),n=Promise.resolve();break;default:i.error("Worker dispatch received message for unknown method: ".concat(t.method))}return n}}},function(e,t,n){function r(e,t){return function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(Array.isArray(e)&&(null==n||n===("undefined"!=typeof Symbol&&[][Symbol.iterator])||n===[]["@@iterator"]))return e;if(null!=n){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const a=n(2);e.exports=class{constructor(){this.callbacks=[],this.nextResponseId=0}call(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return this.transferCall(e,t,null,...r)}transferCall(e,t,n){try{const o=this._getServiceProvider(e),s=o.provider,c=o.isRemote;if(s){for(var r=arguments.length,i=new Array(r>3?r-3:0),a=3;a<r;a++)i[a-3]=arguments[a];if(c)return this._remoteTransferCall(s,e,t,n,...i);const o=s[t].apply(s,i);return Promise.resolve(o)}return Promise.reject(new Error("Service not found: ".concat(e)))}catch(e){return Promise.reject(e)}}_isRemoteService(e){var t,n;return null!==(t=null===(n=this._getServiceProvider(e))||void 0===n?void 0:n.isRemote)&&void 0!==t&&t}_remoteCall(e,t,n){for(var r=arguments.length,i=new Array(r>3?r-3:0),a=3;a<r;a++)i[a-3]=arguments[a];return this._remoteTransferCall(e,t,n,null,...i)}_remoteTransferCall(e,t,n,r){for(var i=arguments.length,a=new Array(i>4?i-4:0),o=4;o<i;o++)a[o-4]=arguments[o];return new Promise((i,o)=>{const s=this._storeCallbacks(i,o);a.length>0&&"function"==typeof a[a.length-1].func&&(a.pop(),a.pop()),r?e.postMessage({service:t,method:n,responseId:s,args:a},r):e.postMessage({service:t,method:n,responseId:s,args:a})})}_storeCallbacks(e,t){const n=this.nextResponseId++;return this.callbacks[n]=[e,t],n}_deliverResponse(e,t){try{const n=r(this.callbacks[e],2),i=n[0],a=n[1];delete this.callbacks[e],t.error?a(t.error):i(t.result)}catch(e){a.error("Dispatch callback failed: ".concat(e))}}_onMessage(e,t){const n=t.data;let r;n.args=n.args||[],n.service?r="dispatch"===n.service?this._onDispatchMessage(e,n):this.call(n.service,n.method,...n.args):void 0===n.responseId?a.error("Dispatch caught malformed message from a worker: ".concat(JSON.stringify(t))):this._deliverResponse(n.responseId,n),r&&(void 0===n.responseId?a.error("Dispatch message missing required response ID: ".concat(JSON.stringify(t))):r.then(t=>e.postMessage({responseId:n.responseId,result:t}),t=>e.postMessage({responseId:n.responseId,error:"".concat(t)})))}_getServiceProvider(e){throw new Error("Could not get provider for ".concat(e,": _getServiceProvider not implemented"))}_onDispatchMessage(e,t){throw new Error("Unimplemented dispatch message handler cannot handle ".concat(t.method," method"))}}},function(e,t,n){e.exports=n(6);var r=n(29);"undefined"!=typeof window&&window.process&&"renderer"===window.process.type&&(r=n(37).minilog),e.exports.Stringifier=n(40);var i=e.exports.pipe;e.exports.pipe=function(t){return t instanceof n(41)?i.call(e.exports,new e.exports.Stringifier).pipe(t):i.call(e.exports,t)},e.exports.defaultBackend=r,e.exports.defaultFormatter=r.formatMinilog,e.exports.backends={redis:n(42),nodeConsole:r,console:r}},function(e,t){function n(){this._events={}}n.prototype={on:function(e,t){this._events||(this._events={});var n=this._events;return(n[e]||(n[e]=[])).push(t),this},removeListener:function(e,t){var n,r=this._events[e]||[];for(n=r.length-1;n>=0&&r[n];n--)r[n]!==t&&r[n].cb!==t||r.splice(n,1)},removeAllListeners:function(e){e?this._events[e]&&(this._events[e]=[]):this._events={}},listeners:function(e){return this._events&&this._events[e]||[]},emit:function(e){this._events||(this._events={});var t,n=Array.prototype.slice.call(arguments,1),r=this._events[e]||[];for(t=r.length-1;t>=0&&r[t];t--)r[t].apply(this,n);return this},when:function(e,t){return this.once(e,t,!0)},once:function(e,t,n){if(!t)return this;function r(){n||this.removeListener(e,r),t.apply(this,arguments)&&n&&this.removeListener(e,r)}return r.cb=t,this.on(e,r),this}},n.mixin=function(e){var t,r=n.prototype;for(t in r)r.hasOwnProperty(t)&&(e.prototype[t]=r[t])},e.exports=n},function(e,t,n){var r=n(0),i={debug:1,info:2,warn:3,error:4};function a(){this.enabled=!0,this.defaultResult=!0,this.clear()}function o(e,t){return e.n.test?e.n.test(t):e.n==t}r.mixin(a),a.prototype.allow=function(e,t){return this._white.push({n:e,l:i[t]}),this},a.prototype.deny=function(e,t){return this._black.push({n:e,l:i[t]}),this},a.prototype.clear=function(){return this._white=[],this._black=[],this},a.prototype.test=function(e,t){var n,r=Math.max(this._white.length,this._black.length);for(n=0;n<r;n++){if(this._white[n]&&o(this._white[n],e)&&i[t]>=this._white[n].l)return!0;if(this._black[n]&&o(this._black[n],e)&&i[t]<=this._black[n].l)return!1}return this.defaultResult},a.prototype.write=function(e,t,n){if(!this.enabled||this.test(e,t))return this.emit("item",e,t,n)},e.exports=a},function(e,t,n){function r(){}n(0).mixin(r),r.prototype.write=function(){console.log.apply(console,arguments)};var i=new r;n(1).levelMap;i.filterEnv=function(){return console.error("Minilog.backends.console.filterEnv is deprecated in Minilog v2."),n(6)},i.formatters=["formatClean","formatColor","formatNpm","formatLearnboost","formatMinilog","formatWithStack","formatTime"],i.formatClean=new(n(30)),i.formatColor=new(n(31)),i.formatNpm=new(n(32)),i.formatLearnboost=new(n(33)),i.formatMinilog=new(n(34)),i.formatWithStack=new(n(35)),i.formatTime=new(n(36)),e.exports=i},function(e,t,n){function r(){}n(0).mixin(r),r.prototype.write=function(e,t,n){this.emit("item",(e?e+" ":"")+(t?t+" ":"")+n.join(" "))},e.exports=r},function(e,t,n){var r=n(0),i=n(1).style;function a(){}r.mixin(a),a.prototype.write=function(e,t,n){var r;this.emit("item",(e?e+" ":"")+(t?i("- "+((4==(r=t.toUpperCase()).toString().length?" "+r:r)+" -"),{debug:"magenta",info:"cyan",warn:"yellow",error:"red"}[t])+" ":"")+n.join(" "))},e.exports=a},function(e,t,n){function r(){}n(0).mixin(r),r.prototype.write=function(e,t,n){var r={debug:"debug ",info:"info ",warn:"WARN ",error:"ERR! "};this.emit("item",(e?""+e+" ":"")+(t&&r[t]?r[t]:"")+n.join(" "))},e.exports=r},function(e,t,n){var r=n(0),i=n(1).style;function a(){}r.mixin(a),a.prototype.write=function(e,t,n){this.emit("item",(e?i(e+" ","grey"):"")+(t?i(t,{debug:"grey",info:"cyan",warn:"yellow",error:"red"}[t])+" ":"")+n.join(" "))},e.exports=a},function(e,t,n){var r=n(0),i=n(1).style,a=n(7);function o(){}r.mixin(o),o.prototype.write=function(e,t,n){this.emit("item",(e?i(e+" ","grey"):"")+(t?i(t,{debug:"blue",info:"cyan",warn:"yellow",error:"red"}[t])+" ":"")+n.map((function(e){return"string"==typeof e?e:a.inspect(e,null,3,!0)})).join(" "))},e.exports=o},function(e,t,n){var r=n(0),i=n(1).style;function a(){}function o(e){return e}r.mixin(a);var s={string:o,number:o,default:JSON.stringify.bind(JSON)};a.prototype.write=function(e,t,n){var r,o=function(){var e=Error.prepareStackTrace;Error.prepareStackTrace=function(e,t){return t};var t=new Error;Error.captureStackTrace(t,arguments.callee);var n=t.stack;return Error.prepareStackTrace=e,n}()[5],c=a.fullPath?o.getFileName():o.getFileName().replace(/^.*\/(.+)$/,"/$1");this.emit("item",(e?e+" ":"")+(t?i(4==(r=t).toString().length?" "+r:r,{debug:"magenta",info:"cyan",warn:"yellow",error:"red"}[t])+" ":"")+i(c+":"+o.getLineNumber(),"grey")+" "+function(e){return e.map((function(e){return(s[typeof e]||s.default)(e)}))}(n).join(" "))},a.fullPath=!0,e.exports=a},function(e,t,n){var r=n(0),i=n(1).style,a=n(7);function o(){}r.mixin(o),o.prototype.write=function(e,t,n){var r;this.emit("item",i(("0"+(r=new Date).getDate()).slice(-2)+"-"+("0"+(r.getMonth()+1)).slice(-2)+"-"+r.getFullYear()+" "+("0"+r.getHours()).slice(-2)+":"+("0"+r.getMinutes()).slice(-2)+":"+("0"+r.getSeconds()).slice(-2)+"."+("00"+r.getMilliseconds()).slice(-3)+" ","grey")+(e?i(e+" ","grey"):"")+(t?i(t,{debug:"blue",info:"cyan",warn:"yellow",error:"red"}[t])+" ":"")+n.map((function(e){return"string"==typeof e?e:a.inspect(e,null,3,!0)})).join(" "))},e.exports=o},function(e,t,n){var r=n(0),i=/\n+$/,a=new r;a.write=function(e,t,n){var r=n.length-1;if("undefined"!=typeof console&&console.log){if(console.log.apply)return console.log.apply(console,[e,t].concat(n));if(JSON&&JSON.stringify){n[r]&&"string"==typeof n[r]&&(n[r]=n[r].replace(i,""));try{for(r=0;r<n.length;r++)n[r]=JSON.stringify(n[r])}catch(e){}console.log(n.join(" "))}}},a.formatters=["color","minilog"],a.color=n(38),a.minilog=n(39),e.exports=a},function(e,t,n){var r=n(0),i=n(8),a={debug:["cyan"],info:["purple"],warn:["yellow",!0],error:["red",!0]},o=new r;o.write=function(e,t,n){console.log;console[t]&&console[t].apply&&console[t].apply(console,["%c"+e+" %c"+t,i("gray"),i.apply(i,a[t])].concat(n))},o.pipe=function(){},e.exports=o},function(e,t,n){var r=n(0),i=n(8),a={debug:["gray"],info:["purple"],warn:["yellow",!0],error:["red",!0]},o=new r;o.write=function(e,t,n){var r=console.log;"debug"!=t&&console[t]&&(r=console[t]);var o=0;if("info"!=t){for(;o<n.length&&"string"==typeof n[o];o++);r.apply(console,["%c"+e+" "+n.slice(0,o).join(" "),i.apply(i,a[t])].concat(n.slice(o)))}else r.apply(console,["%c"+e,i.apply(i,a[t])].concat(n))},o.pipe=function(){},e.exports=o},function(e,t,n){function r(){}n(0).mixin(r),r.prototype.write=function(e,t,n){var r=[];e&&r.push(e),t&&r.push(t),r=r.concat(n);for(var i=0;i<r.length;i++)if(r[i]&&"object"==typeof r[i])if(r[i].constructor&&r[i].constructor.isBuffer)r[i]=r[i].toString();else try{r[i]=JSON.stringify(r[i])}catch(e){}else r[i]=r[i];this.emit("item",r.join(" ")+"\n")},e.exports=r},function(e,t){e.exports=require("stream")},function(e,t){function n(e){this.client=e.client,this.key=e.key}n.prototype.write=function(e){this.client.rpush(this.key,e)},n.prototype.end=function(){},n.prototype.clear=function(e){this.client.del(this.key,e)},e.exports=n},function(e,t,n){const r=n(44);e.exports=e=>{const t=r.namespace(),n=(e,n)=>{if(e&&"object"==typeof e);else{if("string"!=typeof e)throw new Error("unsupported data type in translate()");e={default:e}}return t(e,n)},i=e=>"_".concat(e),a=()=>e?e.getLocale():"undefined"!=typeof navigator?navigator.language:"en";let o={};return n.setup=e=>{e&&(o=e),t.setup({locale:a(),missingTranslation:"ignore",generateId:i,translations:o})},Object.defineProperty(n,"language",{configurable:!0,enumerable:!0,get:()=>a()}),n.setup({}),e&&e.on("LOCALE_CHANGED",()=>{n.setup(null)}),n}},function(e,t,n){"use strict";var r=n(45),i=n(46),a=n(12),o=n(11),s=n(10);function c(e,t){return Object.keys(t).forEach((function(n){e[n]=t[n]})),e}e.exports=function e(){var t=c({},s),n="en",l={},u=function(e){return e},f=null,d="warning",p={};function h(e,t,a){var o="string"==typeof e?e:e.default,s=y(o,"object"==typeof e&&e.id||u(o),a||n);return(s.format||(s.format=i(r(s.message),a||n,p)))(t)}h.rich=function(e,t,a){var o="string"==typeof e?e:e.default,s=y(o,"object"==typeof e&&e.id||u(o),a||n);return(s.toParts||(s.toParts=i.toParts(r(s.message,{tagsType:m}),a||n,p)))(t)};var m="<>";function g(e,t){var n=e[2];return function(e,t){var r="object"==typeof n?function(e,t){return Object.keys(e).reduce((function(n,r){return n[r]=e[r](t),n}),{})}(n,t):n;return"function"==typeof e?e(r):e}}function y(e,t,n){var r=o(n,l)||"en",i=l[r]||(l[r]={}),a=i[t];if("string"==typeof a&&(a=i[t]={message:a}),!a){var s='Translation for "'+t+'" in "'+r+'" is missing';if("warning"===d)"undefined"!=typeof console&&console.warn(s);else if("ignore"!==d)throw new Error(s);var c="function"==typeof f?f(e,t,r)||e:f||e;a=i[t]={message:c}}return a}function b(e,t,r,i,s){"object"==typeof r&&"object"!=typeof i&&(s=i,i=r,r=0);var c=o(s||n,a),l=c&&a[c][e]||v;return i["="+ +t]||i[l(t-r)]||i.other}function v(){return"other"}return p[m]=g,h.setup=function(e){return(e=e||{}).locale&&(n=e.locale),"translations"in e&&(l=e.translations||{}),e.generateId&&(u=e.generateId),"missingReplacement"in e&&(f=e.missingReplacement),e.missingTranslation&&(d=e.missingTranslation),e.formats&&(e.formats.number&&c(t.number,e.formats.number),e.formats.date&&c(t.date,e.formats.date),e.formats.time&&c(t.time,e.formats.time)),e.types&&((p=e.types)[m]=g),{locale:n,translations:l,generateId:u,missingReplacement:f,missingTranslation:d,formats:t,types:p}},h.number=function(e,r,i){var a=r&&t.number[r]||t.parseNumberPattern(r)||t.number.default;return new Intl.NumberFormat(i||n,a).format(e)},h.date=function(e,r,i){var a=r&&t.date[r]||t.parseDatePattern(r)||t.date.default;return new Intl.DateTimeFormat(i||n,a).format(e)},h.time=function(e,r,i){var a=r&&t.time[r]||t.parseDatePattern(r)||t.time.default;return new Intl.DateTimeFormat(i||n,a).format(e)},h.select=function(e,t){return t[e]||t.other},h.custom=function(e,t,n,r){return e[1]in p?p[e[1]](e,t)(n,r):n},h.plural=b.bind(null,"cardinal"),h.selectordinal=b.bind(null,"ordinal"),h.namespace=e,h}()},function(e,t,n){"use strict";var r=["number","date","time","ordinal","duration","spellout"],i=["plural","select","selectordinal"];function a(e,t){var n=e.pattern,r=n.length,i=[],a=e.index,s=o(e,t);for(s&&i.push(s),s&&e.tokens&&e.tokens.push(["text",n.slice(a,e.index)]);e.index<r;){if("}"===n[e.index]){if(!t)throw h(e);break}if(t&&e.tagsType&&"</"===n.slice(e.index,e.index+"</".length))break;i.push(l(e)),a=e.index,(s=o(e,t))&&i.push(s),s&&e.tokens&&e.tokens.push(["text",n.slice(a,e.index)])}return i}function o(e,t){for(var n=e.pattern,r=n.length,i="plural"===t||"selectordinal"===t,a=!!e.tagsType,o="{style}"===t,c="";e.index<r;){var l=n[e.index];if("{"===l||"}"===l||i&&"#"===l||a&&"<"===l||o&&s(l.charCodeAt(0)))break;if("'"===l)if("'"===(l=n[++e.index]))c+=l,++e.index;else if("{"===l||"}"===l||i&&"#"===l||a&&"<"===l||o)for(c+=l;++e.index<r;)if("'"===(l=n[e.index])&&"'"===n[e.index+1])c+="'",++e.index;else{if("'"===l){++e.index;break}c+=l}else c+="'";else c+=l,++e.index}return c}function s(e){return e>=9&&e<=13||32===e||133===e||160===e||6158===e||e>=8192&&e<=8205||8232===e||8233===e||8239===e||8287===e||8288===e||12288===e||65279===e}function c(e){for(var t=e.pattern,n=t.length,r=e.index;e.index<n&&s(t.charCodeAt(e.index));)++e.index;r<e.index&&e.tokens&&e.tokens.push(["space",e.pattern.slice(r,e.index)])}function l(e){var t=e.pattern;if("#"===t[e.index])return e.tokens&&e.tokens.push(["syntax","#"]),++e.index,["#"];var n=function(e){var t=e.tagsType;if(!t||"<"!==e.pattern[e.index])return;if("</"===e.pattern.slice(e.index,e.index+"</".length))throw h(e,null,"closing tag without matching opening tag");e.tokens&&e.tokens.push(["syntax","<"]);++e.index;var n=u(e,!0);if(!n)throw h(e,"placeholder id");e.tokens&&e.tokens.push(["id",n]);if(c(e),"/>"===e.pattern.slice(e.index,e.index+"/>".length))return e.tokens&&e.tokens.push(["syntax","/>"]),e.index+="/>".length,[n,t];if(">"!==e.pattern[e.index])throw h(e,">");e.tokens&&e.tokens.push(["syntax",">"]);++e.index;var r=a(e,t),i=e.index;if("</"!==e.pattern.slice(e.index,e.index+"</".length))throw h(e,"</"+n+">");e.tokens&&e.tokens.push(["syntax","</"]);e.index+="</".length;var o=u(e,!0);o&&e.tokens&&e.tokens.push(["id",o]);if(n!==o)throw e.index=i,h(e,"</"+n+">","</"+o+">");if(c(e),">"!==e.pattern[e.index])throw h(e,">");e.tokens&&e.tokens.push(["syntax",">"]);return++e.index,[n,t,{children:r}]}(e);if(n)return n;if("{"!==t[e.index])throw h(e,"{");e.tokens&&e.tokens.push(["syntax","{"]),++e.index,c(e);var i=u(e);if(!i)throw h(e,"placeholder id");e.tokens&&e.tokens.push(["id",i]),c(e);var o=t[e.index];if("}"===o)return e.tokens&&e.tokens.push(["syntax","}"]),++e.index,[i];if(","!==o)throw h(e,", or }");e.tokens&&e.tokens.push(["syntax",","]),++e.index,c(e);var s,l=u(e);if(!l)throw h(e,"placeholder type");if(e.tokens&&e.tokens.push(["type",l]),c(e),"}"===(o=t[e.index])){if(e.tokens&&e.tokens.push(["syntax","}"]),"plural"===l||"selectordinal"===l||"select"===l)throw h(e,l+" sub-messages");return++e.index,[i,l]}if(","!==o)throw h(e,", or }");if(e.tokens&&e.tokens.push(["syntax",","]),++e.index,c(e),"plural"===l||"selectordinal"===l){var p=function(e){var t=e.pattern,n=t.length,r=0;if("offset:"===t.slice(e.index,e.index+"offset:".length)){e.tokens&&e.tokens.push(["offset","offset"],["syntax",":"]),e.index+="offset:".length,c(e);for(var i=e.index;e.index<n&&((a=t.charCodeAt(e.index))>=48&&a<=57);)++e.index;if(i===e.index)throw h(e,"offset number");e.tokens&&e.tokens.push(["number",t.slice(i,e.index)]),r=+t.slice(i,e.index)}var a;return r}(e);c(e),s=[i,l,p,d(e,l)]}else if("select"===l)s=[i,l,d(e,l)];else if(r.indexOf(l)>=0)s=[i,l,f(e)];else{var m=e.index,g=f(e);c(e),"{"===t[e.index]&&(e.index=m,g=d(e,l)),s=[i,l,g]}if(c(e),"}"!==t[e.index])throw h(e,"}");return e.tokens&&e.tokens.push(["syntax","}"]),++e.index,s}function u(e,t){for(var n=e.pattern,r=n.length,i="";e.index<r;){var a=n[e.index];if("{"===a||"}"===a||","===a||"#"===a||"'"===a||s(a.charCodeAt(0))||t&&("<"===a||">"===a||"/"===a))break;i+=a,++e.index}return i}function f(e){var t=e.index,n=o(e,"{style}");if(!n)throw h(e,"placeholder style name");return e.tokens&&e.tokens.push(["style",e.pattern.slice(t,e.index)]),n}function d(e,t){for(var n=e.pattern,r=n.length,a={};e.index<r&&"}"!==n[e.index];){var o=u(e);if(!o)throw h(e,"sub-message selector");e.tokens&&e.tokens.push(["selector",o]),c(e),a[o]=p(e,t),c(e)}if(!a.other&&i.indexOf(t)>=0)throw h(e,null,null,'"other" sub-message must be specified in '+t);return a}function p(e,t){if("{"!==e.pattern[e.index])throw h(e,"{ to start sub-message");e.tokens&&e.tokens.push(["syntax","{"]),++e.index;var n=a(e,t);if("}"!==e.pattern[e.index])throw h(e,"} to end sub-message");return e.tokens&&e.tokens.push(["syntax","}"]),++e.index,n}function h(e,t,n,r){var i=e.pattern,a=i.slice(0,e.index).split(/\r?\n/),o=e.index,s=a.length,c=a.slice(-1)[0].length;return n=n||(e.index>=i.length?"end of message pattern":u(e)||i[e.index]),r||(r=function(e,t){return e?"Expected "+e+" but found "+t:"Unexpected "+t+" found"}(t,n)),new m(r+=" in "+i.replace(/\r?\n/g,"\n"),t,n,o,s,c)}function m(e,t,n,r,i,a){Error.call(this,e),this.name="SyntaxError",this.message=e,this.expected=t,this.found=n,this.offset=r,this.line=i,this.column=a}t=e.exports=function(e,t){return a({pattern:String(e),index:0,tagsType:t&&t.tagsType||null,tokens:t&&t.tokens||null},"")},m.prototype=Object.create(Error.prototype),t.SyntaxError=m},function(e,t,n){"use strict";var r=n(10),i=n(11),a=n(12);function o(e,t,n,r,i){var a=e.map((function(e){return function(e,t,n,r,i){if("string"==typeof e){var a=e;return function(){return a}}var c,l=e[0],u=e[1];if(t&&"#"===e[0]){l=t[0];var f=t[2],p=(r.number||d.number)([l,"number"],n);return function(e){return p(s(l,e)-f,e)}}"plural"===u||"selectordinal"===u?(c={},Object.keys(e[3]).forEach((function(t){c[t]=o(e[3][t],e,n,r,i)})),e=[e[0],e[1],e[2],c]):e[2]&&"object"==typeof e[2]&&(c={},Object.keys(e[2]).forEach((function(t){c[t]=o(e[2][t],e,n,r,i)})),e=[e[0],e[1],c]);var h=u&&(r[u]||d[u]);if(h){var m=h(e,n);return function(e){return m(s(l,e),e)}}return i?function(e){return String(s(l,e))}:function(e){return s(l,e)}}(e,t,n,r,i)}));return i?1===a.length?a[0]:function(e){for(var t="",n=0;n<a.length;++n)t+=a[n](e);return t}:function(e){return a.reduce((function(t,n){return t.concat(n(e))}),[])}}function s(e,t){if(t&&e in t)return t[e];for(var n=e.split("."),r=t,i=0,a=n.length;r&&i<a;++i)r=r[n[i]];return r}function c(e,t){var n=e[2],i=r.number[n]||r.parseNumberPattern(n)||r.number.default;return new Intl.NumberFormat(t,i).format}function l(e,t){var n=e[1],i=e[2],a=r[n][i]||r.parseDatePattern(i)||r[n].default;return new Intl.DateTimeFormat(t,a).format}function u(e,t){var n,r="selectordinal"===e[1]?"ordinal":"cardinal",o=e[2],s=e[3];if(Intl.PluralRules&&Intl.PluralRules.supportedLocalesOf(t).length>0)n=new Intl.PluralRules(t,{type:r});else{var c=i(t,a),l=c&&a[c][r]||f;n={select:l}}return function(e,t){return(s["="+ +e]||s[n.select(e-o)]||s.other)(t)}}function f(){return"other"}(t=e.exports=function(e,t,n){return o(e,null,t||"en",n||{},!0)}).toParts=function(e,t,n){return o(e,null,t||"en",n||{},!1)};var d={number:c,ordinal:c,spellout:c,duration:function(e,t){var n=e[2],i=r.duration[n]||r.duration.default,a=new Intl.NumberFormat(t,i.seconds).format,o=new Intl.NumberFormat(t,i.minutes).format,s=new Intl.NumberFormat(t,i.hours).format,c=/^fi$|^fi-|^da/.test(String(t))?".":":";return function(e,t){if(e=+e,!isFinite(e))return a(e);var n=~~(e/60/60),r=~~(e/60%60),i=(n?s(Math.abs(n))+c:"")+o(Math.abs(r))+c+a(Math.abs(e%60));return e<0?s(-1).replace(s(1),i):i}},date:l,time:l,plural:u,selectordinal:u,select:function(e,t){var n=e[2];return function(e,t){return(n[e]||n.other)(t)}}};t.types=d}]);