@fkn/lib 0.9.42 → 0.9.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/{api-SwxtiYVU.d.ts → api-CFkZVr53.d.ts} +61 -30
  2. package/api.d.ts +2 -2
  3. package/attach-policy.d.ts +11 -15
  4. package/cloud/dns.d.ts +1 -1
  5. package/cloud/fetch.d.ts +1 -1
  6. package/cloud/fs/promises.d.ts +1 -1
  7. package/cloud/fs.d.ts +3 -3
  8. package/cloud/net.d.ts +1 -1
  9. package/cloud-Bx64HSkQ.cjs +1 -0
  10. package/cloud-D-vDUzzx.js +552 -0
  11. package/{cloud-DUH-v10C.d.ts → cloud-DyOQPyUB.d.ts} +4 -4
  12. package/cloud.cjs +1 -1
  13. package/cloud.d.ts +4 -4
  14. package/cloud.js +1 -1
  15. package/{contract-CCxPKIC7.d.ts → contract-6Xfd_qel.d.ts} +173 -22
  16. package/contract.d.ts +4 -4
  17. package/dgram.d.ts +7 -14
  18. package/dns.d.ts +1 -1
  19. package/{extension-yhwDSIiD.d.ts → extension-BlEtNAYc.d.ts} +36 -37
  20. package/extension-CzZn0bY2.js +94 -0
  21. package/extension-DvFf7uoG.cjs +1 -0
  22. package/extension.cjs +1 -1
  23. package/extension.d.ts +3 -3
  24. package/extension.js +3 -3
  25. package/fs/promises.d.ts +1 -1
  26. package/{fs-D0MMRnHC.d.ts → fs-KA1Mgisv.d.ts} +2 -2
  27. package/fs.d.ts +3 -3
  28. package/http.d.ts +1 -1
  29. package/{index-BtFiGoVQ.d.ts → index-BOInGaEl.d.ts} +103 -62
  30. package/{index-D2lvaQDs.d.ts → index-DKr9L2RI.d.ts} +6 -11
  31. package/index.cjs +1 -1
  32. package/index.d.ts +36 -39
  33. package/index.js +55 -55
  34. package/{lib-DppqX10G.js → lib-C3UwxjVs.js} +560 -474
  35. package/lib-fqQfEPk6.cjs +53 -0
  36. package/messages-d7pvCXPn.d.ts +34 -0
  37. package/messages.d.ts +1 -1
  38. package/{net-DcLF-6E-.d.ts → net-CmMZgV2a.d.ts} +3 -19
  39. package/net.d.ts +1 -1
  40. package/package.json +1 -1
  41. package/packages.d.ts +1 -1
  42. package/{proxy-CE46SkyA.d.ts → proxy-dOOmiMl4.d.ts} +2 -2
  43. package/rooms.cjs +1 -1
  44. package/rooms.d.ts +94 -15
  45. package/rooms.js +118 -90
  46. package/{storage-BVr2Rb-d.d.ts → storage-BLBsmkmp.d.ts} +14 -28
  47. package/{wire-Gbo-D74t.d.ts → wire-BwA4JjZH.d.ts} +6 -12
  48. package/wire.d.ts +1 -1
  49. package/cloud-868OlBKn.cjs +0 -1
  50. package/cloud-f3j4s8yZ.js +0 -545
  51. package/extension-BOBuYwZc.js +0 -92
  52. package/extension-hoUs5yJ7.cjs +0 -1
  53. package/lib-CfdmsLoI.cjs +0 -53
  54. package/messages-CRcziTuC.d.ts +0 -46
@@ -1,8 +1,8 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
2
  import { _ as t, a as n, d as r, f as i, g as a, h as o, i as s, n as c, o as l, p as u, r as d, s as f, t as p, u as m, v as h, y as g } from "./hosts-t7CKGTRz.js";
3
- import { BoxBase as _, createTypedEventTarget as v, expose as y, recursiveBox as ee, recursiveRevive as te } from "osra";
3
+ import { BoxBase as _, createTypedEventTarget as v, expose as ee, recursiveBox as te, recursiveRevive as ne } from "osra";
4
4
  //#region ../web-extension/lib/lib/revivables/event-proxy.js
5
- var ne = (e, t) => {
5
+ var re = (e, t) => {
6
6
  let n = new EventTarget(), r = /* @__PURE__ */ new Map(), i = EventTarget.prototype.addEventListener.bind(n), a = EventTarget.prototype.removeEventListener.bind(n);
7
7
  return Object.defineProperty(n, "addEventListener", {
8
8
  configurable: !0,
@@ -31,12 +31,12 @@ var ne = (e, t) => {
31
31
  o && (e.removeEventListener(t, o), r.delete(t));
32
32
  }
33
33
  }), n;
34
- }, b = (e) => typeof e == "boolean" ? +!!e : +!!e?.capture, x = (e) => {
34
+ }, ie = (e) => typeof e == "boolean" ? +!!e : +!!e?.capture, y = (e) => {
35
35
  let t = /* @__PURE__ */ new WeakMap();
36
36
  return {
37
37
  addEventListener: (n, r, i) => {
38
38
  if (r === null) return;
39
- let a = `${n}|${b(i)}`, o = t.get(r);
39
+ let a = `${n}|${ie(i)}`, o = t.get(r);
40
40
  if (o || (o = /* @__PURE__ */ new Map(), t.set(r, o)), o.has(a)) return;
41
41
  let s = typeof i == "object" && !!i && !!i.once, c = (t) => {
42
42
  s && o.delete(a);
@@ -47,18 +47,18 @@ var ne = (e, t) => {
47
47
  },
48
48
  removeEventListener: (n, r, i) => {
49
49
  if (r === null) return;
50
- let a = `${n}|${b(i)}`, o = t.get(r), s = o?.get(a);
50
+ let a = `${n}|${ie(i)}`, o = t.get(r), s = o?.get(a);
51
51
  s && (e.remoteEvents.removeEventListener(n, s, i), o.delete(a));
52
52
  },
53
53
  dispatchEvent: (t) => e.remoteEvents.dispatchEvent(t)
54
54
  };
55
- }, S = /* @__PURE__ */ e({
56
- box: () => ve,
57
- createVideoElementHandle: () => w,
58
- isType: () => _e,
59
- revive: () => ye,
60
- type: () => C
61
- }), C = "videoElement", re = [
55
+ }, b = /* @__PURE__ */ e({
56
+ box: () => ye,
57
+ createVideoElementHandle: () => C,
58
+ isType: () => ve,
59
+ revive: () => be,
60
+ type: () => x
61
+ }), x = "videoElement", ae = [
62
62
  "currentTime",
63
63
  "volume",
64
64
  "muted",
@@ -69,22 +69,22 @@ var ne = (e, t) => {
69
69
  "preload",
70
70
  "poster",
71
71
  "disableRemotePlayback"
72
- ], ie = [
72
+ ], oe = [
73
73
  "duration",
74
74
  "paused",
75
75
  "ended",
76
76
  "seeking",
77
77
  "readyState",
78
78
  "currentSrc"
79
- ], ae = ["buffered", "seekable"], oe = Symbol.for("fkn.remoteVideoElement"), se = Symbol.for("fkn.remoteVideoElement.state"), ce = Symbol.for("fkn.remoteVideoElement.controller"), le = (e) => e ? Array.from({ length: e.length }, (t, n) => [e.start(n), e.end(n)]) : [], ue = (e) => {
79
+ ], se = ["buffered", "seekable"], ce = Symbol.for("fkn.remoteVideoElement"), le = Symbol.for("fkn.remoteVideoElement.state"), ue = Symbol.for("fkn.remoteVideoElement.controller"), de = (e) => e ? Array.from({ length: e.length }, (t, n) => [e.start(n), e.end(n)]) : [], S = (e) => {
80
80
  let t = {};
81
- for (let n of [...re, ...ie]) t[n] = e[n];
82
- for (let n of ae) t[n] = le(e[n]);
81
+ for (let n of [...ae, ...oe]) t[n] = e[n];
82
+ for (let n of se) t[n] = de(e[n]);
83
83
  return t.error = e.error ? {
84
84
  code: e.error.code,
85
85
  message: e.error.message
86
86
  } : null, t;
87
- }, de = (e) => {
87
+ }, fe = (e) => {
88
88
  let t = (t) => {
89
89
  if (!Number.isInteger(t) || t < 0 || t >= e.length) throw new DOMException("Index or size is negative or greater than the allowed amount", "IndexSizeError");
90
90
  };
@@ -99,17 +99,17 @@ var ne = (e, t) => {
99
99
  return t(n), e[n][1];
100
100
  }
101
101
  };
102
- }, fe = (e) => e ? {
102
+ }, pe = (e) => e ? {
103
103
  code: e.code,
104
104
  message: e.message,
105
105
  MEDIA_ERR_ABORTED: 1,
106
106
  MEDIA_ERR_NETWORK: 2,
107
107
  MEDIA_ERR_DECODE: 3,
108
108
  MEDIA_ERR_SRC_NOT_SUPPORTED: 4
109
- } : null, pe = (e) => ne(e, (e, t) => ({
109
+ } : null, me = (e) => re(e, (e, t) => ({
110
110
  originalDetail: e instanceof CustomEvent ? e.detail : null,
111
- snapshot: ue(t)
112
- })), me = async (e, t) => {
111
+ snapshot: S(t)
112
+ })), he = async (e, t) => {
113
113
  switch (t) {
114
114
  case "play": return await e.play(), null;
115
115
  case "pause": return e.pause(), null;
@@ -124,19 +124,19 @@ var ne = (e, t) => {
124
124
  }
125
125
  default: throw Error(`videoElement: unknown method "${t}"`);
126
126
  }
127
- }, he = (e) => ({
128
- call: async (t) => me(e, t),
127
+ }, ge = (e) => ({
128
+ call: async (t) => he(e, t),
129
129
  set: async (t, n) => {
130
130
  try {
131
131
  e[t] = n;
132
132
  } catch {}
133
- return ue(e);
133
+ return S(e);
134
134
  },
135
- events: pe(e)
136
- }), ge = (e, t) => {
135
+ events: me(e)
136
+ }), _e = (e, t) => {
137
137
  let n = new EventTarget();
138
- Object.defineProperty(n, oe, { value: !0 }), Object.defineProperty(n, se, { value: e }), Object.defineProperty(n, ce, { value: t });
139
- let r = x({
138
+ Object.defineProperty(n, ce, { value: !0 }), Object.defineProperty(n, le, { value: e }), Object.defineProperty(n, ue, { value: t });
139
+ let r = y({
140
140
  target: n,
141
141
  remoteEvents: t.events,
142
142
  unenrich: (t, n) => {
@@ -171,7 +171,7 @@ var ne = (e, t) => {
171
171
  configurable: !0,
172
172
  enumerable: !0,
173
173
  get() {
174
- return fe(e.error);
174
+ return pe(e.error);
175
175
  }
176
176
  },
177
177
  play: {
@@ -207,7 +207,7 @@ var ne = (e, t) => {
207
207
  value: 4
208
208
  }
209
209
  };
210
- for (let n of re) i[n] = {
210
+ for (let n of ae) i[n] = {
211
211
  configurable: !0,
212
212
  enumerable: !0,
213
213
  get() {
@@ -219,43 +219,43 @@ var ne = (e, t) => {
219
219
  }, () => {});
220
220
  }
221
221
  };
222
- for (let t of ie) i[t] = {
222
+ for (let t of oe) i[t] = {
223
223
  configurable: !0,
224
224
  enumerable: !0,
225
225
  get() {
226
226
  return e[t];
227
227
  }
228
228
  };
229
- for (let t of ae) i[t] = {
229
+ for (let t of se) i[t] = {
230
230
  configurable: !0,
231
231
  enumerable: !0,
232
232
  get() {
233
- return de(e[t]);
233
+ return fe(e[t]);
234
234
  }
235
235
  };
236
236
  return Object.defineProperties(n, i), n;
237
- }, w = (e) => ge(ue(e), he(e)), _e = (e) => typeof e == "object" && !!e && e[oe] === !0, ve = (e, t) => {
237
+ }, C = (e) => _e(S(e), ge(e)), ve = (e) => typeof e == "object" && !!e && e[ce] === !0, ye = (e, t) => {
238
238
  let n = e;
239
239
  return {
240
240
  ..._,
241
- type: C,
242
- initialState: n[se],
243
- controller: ee(n[ce], t)
241
+ type: x,
242
+ initialState: n[le],
243
+ controller: te(n[ue], t)
244
244
  };
245
- }, ye = (e, t) => {
246
- let n = te(e.controller, t);
247
- return ge({ ...e.initialState }, n);
248
- }, be = (e) => [S, ...e], xe = 3, Se = 0, Ce = "fknExtension", we = "fknExtensionAbi", Te = "fknExtensionOps", Ee = [
245
+ }, be = (e, t) => {
246
+ let n = ne(e.controller, t);
247
+ return _e({ ...e.initialState }, n);
248
+ }, xe = (e) => [b, ...e], Se = 4, Ce = 0, we = "fknExtension", Te = "fknExtensionAbi", Ee = "fknExtensionOps", De = [
249
249
  "data-fkn-extension",
250
250
  "data-fkn-extension-abi",
251
251
  "data-fkn-extension-ops"
252
- ], De = (e) => {
252
+ ], Oe = (e) => {
253
253
  if (e === void 0) return 0;
254
254
  let t = Number(e);
255
255
  return Number.isInteger(t) && t >= 0 ? t : 0;
256
- }, Oe = (e) => e === void 0 ? null : e.split(",").map((e) => e.trim()).filter(Boolean), ke = (e, t = 0) => {
256
+ }, ke = (e) => e === void 0 ? null : e.split(",").map((e) => e.trim()).filter(Boolean), Ae = (e, t = 0) => {
257
257
  if (e.fknExtension !== "true") return { status: "absent" };
258
- let n = De(e[we]), r = Oe(e[Te]);
258
+ let n = Oe(e[Te]), r = ke(e[Ee]);
259
259
  return n < t ? {
260
260
  status: "outdated",
261
261
  abi: n,
@@ -266,42 +266,42 @@ var ne = (e, t) => {
266
266
  abi: n,
267
267
  operations: r
268
268
  };
269
- }, Ae = (e, t) => e.status === "ok" ? e.operations === null || e.operations.includes(t) : !1, je = (e, t) => e.status === "ok" && e.operations !== null && e.operations.includes(t), T = class extends Error {
269
+ }, je = (e, t) => e.status === "ok" ? e.operations === null || e.operations.includes(t) : !1, Me = (e, t) => e.status === "ok" && e.operations !== null && e.operations.includes(t), w = class extends Error {
270
270
  abi;
271
271
  required;
272
272
  name = "ExtensionOutdatedError";
273
273
  constructor(e, t) {
274
274
  super(`The FKN WebExtension is installed but too old for this page: it speaks ABI ${e} and this page needs at least ${t}. Updating the extension fixes this.`), this.abi = e, this.required = t;
275
275
  }
276
- }, E = class extends Error {
276
+ }, T = class extends Error {
277
277
  operation;
278
278
  abi;
279
279
  name = "ExtensionOperationUnsupportedError";
280
280
  constructor(e, t, n) {
281
281
  super(n ?? `The FKN WebExtension does not support "${e}" (ABI ${t}). Updating the extension may add it.`), this.operation = e, this.abi = t;
282
282
  }
283
- }, Me = "FKN_WEB_EXTENSION_MAIN_WORLD_CONTENT_SCRIPT_ENABLED_EVENT_KEY", Ne = Ce, Pe = v();
284
- typeof document < "u" && document.addEventListener(Me, () => {
285
- Pe.dispatchEvent(new CustomEvent("statuschange", { detail: { enabled: Fe() } }));
283
+ }, Ne = "FKN_WEB_EXTENSION_MAIN_WORLD_CONTENT_SCRIPT_ENABLED_EVENT_KEY", Pe = we, Fe = v();
284
+ typeof document < "u" && document.addEventListener(Ne, () => {
285
+ Fe.dispatchEvent(new CustomEvent("statuschange", { detail: { enabled: Ie() } }));
286
286
  });
287
- var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne] === "true", D = () => typeof document > "u" ? { status: "absent" } : ke(document.documentElement.dataset), O = null, Ie = (e) => {
288
- O = e;
289
- }, Le = 150, k = (e = 1e3) => new Promise((t, n) => {
290
- let r = () => D().status === "ok";
287
+ var Ie = () => typeof document > "u" ? !1 : document.documentElement.dataset[Pe] === "true", E = () => typeof document > "u" ? { status: "absent" } : Ae(document.documentElement.dataset), Le = null, Re = (e) => {
288
+ Le = e;
289
+ }, ze = 150, D = (e = 1e3) => new Promise((t, n) => {
290
+ let r = () => E().status === "ok";
291
291
  if (r()) return t();
292
292
  let i, a = (e) => {
293
293
  clearTimeout(i), c.disconnect(), document.removeEventListener("readystatechange", l), e();
294
294
  }, o = () => a(async () => {
295
- let e = D();
296
- if (e.status === "outdated") return n(new T(e.abi, e.required));
297
- if (O) {
298
- if (await O().catch(() => {}), r()) return t();
299
- let e = D();
300
- if (e.status === "outdated") return n(new T(e.abi, e.required));
295
+ let e = E();
296
+ if (e.status === "outdated") return n(new w(e.abi, e.required));
297
+ if (Le) {
298
+ if (await Le().catch(() => {}), r()) return t();
299
+ let e = E();
300
+ if (e.status === "outdated") return n(new w(e.abi, e.required));
301
301
  }
302
302
  n(/* @__PURE__ */ Error("The FKN WebExtension is not installed, enabled or not exposed on this page."));
303
303
  }), s = () => {
304
- clearTimeout(i), i = setTimeout(() => r() ? a(t) : o(), Le);
304
+ clearTimeout(i), i = setTimeout(() => r() ? a(t) : o(), ze);
305
305
  }, c = new MutationObserver(() => {
306
306
  r() && a(t);
307
307
  }), l = () => {
@@ -309,39 +309,39 @@ var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne]
309
309
  };
310
310
  if (i = setTimeout(o, e), c.observe(document.documentElement, {
311
311
  attributes: !0,
312
- attributeFilter: [...Ee]
312
+ attributeFilter: [...De]
313
313
  }), document.addEventListener("readystatechange", l), document.readyState === "complete") return s();
314
314
  r() && a(t);
315
- }), Re, A = new Proxy({}, { get: (e, t) => async (...e) => {
316
- await k(), Re ??= y({}, {
315
+ }), Be, O = new Proxy({}, { get: (e, t) => async (...e) => {
316
+ await D(), Be ??= ee({}, {
317
317
  transport: window,
318
- revivableModules: be
318
+ revivableModules: xe
319
319
  });
320
- let n = (await Re)[t];
320
+ let n = (await Be)[t];
321
321
  return n(...e);
322
- } }), ze = [
322
+ } }), Ve = [
323
323
  "origin",
324
324
  "referer",
325
325
  "cookie"
326
- ], Be = (e, t) => (e ?? []).some(([e, n]) => e.trim().toLowerCase() === t && n !== ""), Ve = (e) => Be(e, "cookie"), He = (e, t) => {
327
- if (t === "include" && Ve(e)) throw Error("fetch: a forged Cookie header and credentials:'include' are different identities - send one or the other");
328
- }, Ue = (e) => {
329
- let t = [...new Set((e ?? []).map(([e]) => e.trim().toLowerCase()).filter((e) => !ze.includes(e)))];
326
+ ], He = (e, t) => (e ?? []).some(([e, n]) => e.trim().toLowerCase() === t && n !== ""), Ue = (e) => He(e, "cookie"), We = (e, t) => {
327
+ if (t === "include" && Ue(e)) throw Error("fetch: a forged Cookie header and credentials:'include' are different identities - send one or the other");
328
+ }, Ge = (e) => {
329
+ let t = [...new Set((e ?? []).map(([e]) => e.trim().toLowerCase()).filter((e) => !Ve.includes(e)))];
330
330
  if (t.length) throw Error(`fetch: refusing to forge request header(s): ${t.join(", ")}`);
331
- }, We = [
331
+ }, Ke = [
332
332
  "fkn.app",
333
333
  "fkn.dev",
334
334
  "sdbx.app"
335
- ], Ge = (e) => e.replace(/\.+$/, ""), Ke = (e) => {
336
- let t = Ge(e);
337
- return We.some((e) => t === e || t.endsWith(`.${e}`));
338
- }, qe = {
335
+ ], qe = (e) => e.replace(/\.+$/, ""), Je = (e) => {
336
+ let t = qe(e);
337
+ return Ke.some((e) => t === e || t.endsWith(`.${e}`));
338
+ }, Ye = {
339
339
  scope: "network.fetch",
340
340
  category: "network",
341
341
  severity: 0,
342
342
  title: "Fetch data from other sites",
343
343
  description: "Lets the app download public data from other websites directly, past the usual cross-origin limits."
344
- }, Je = {
344
+ }, Xe = {
345
345
  scope: "network.fetchCredentialed",
346
346
  category: "network",
347
347
  severity: 3,
@@ -349,7 +349,7 @@ var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne]
349
349
  unsafe: !0,
350
350
  title: "Fetch from other sites, signed in as you",
351
351
  description: "Lets the app fetch other sites using your logged-in session cookies, so it can read data only you should see."
352
- }, Ye = {
352
+ }, Ze = {
353
353
  scope: "network.fetchLocal",
354
354
  category: "network",
355
355
  severity: 3,
@@ -357,12 +357,12 @@ var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne]
357
357
  unsafe: !0,
358
358
  title: "Access devices on your local network",
359
359
  description: "Lets the app reach devices and services on your home or work network, which websites normally cannot touch."
360
- }, Xe = (e) => {
360
+ }, Qe = (e) => {
361
361
  let t = e.match(/^(\d+)\.(\d+)\.\d+\.\d+$/);
362
362
  if (!t) return !1;
363
363
  let [n, r] = [Number(t[1]), Number(t[2])];
364
364
  return n === 10 || n === 127 || n === 0 || n === 169 && r === 254 || n === 172 && r >= 16 && r <= 31 || n === 192 && r === 168;
365
- }, Ze = (e) => {
365
+ }, $e = (e) => {
366
366
  let t;
367
367
  try {
368
368
  t = new URL(e);
@@ -370,40 +370,40 @@ var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne]
370
370
  return !1;
371
371
  }
372
372
  let n = t.hostname.replace(/^\[|\]$/g, "").toLowerCase().replace(/\.$/, "");
373
- return n === "localhost" || n.endsWith(".localhost") || n.endsWith(".local") || n.endsWith(".internal") || n.endsWith(".home.arpa") ? !0 : n.includes(":") ? n === "::" || n === "::1" || n.startsWith("fc") || n.startsWith("fd") || /^fe[89ab]/.test(n) || n.startsWith("::ffff:") : Xe(n);
374
- }, Qe = (e) => {
373
+ return n === "localhost" || n.endsWith(".localhost") || n.endsWith(".local") || n.endsWith(".internal") || n.endsWith(".home.arpa") ? !0 : n.includes(":") ? n === "::" || n === "::1" || n.startsWith("fc") || n.startsWith("fd") || /^fe[89ab]/.test(n) || n.startsWith("::ffff:") : Qe(n);
374
+ }, et = (e) => {
375
375
  let t;
376
376
  try {
377
377
  t = new URL(e);
378
378
  } catch {
379
379
  return !1;
380
380
  }
381
- return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || Ke(t.hostname);
382
- }, $e = (e) => {
383
- if (Qe(e)) throw Error("fetch: refusing to target the extension's own pages or FKN platform domains");
384
- }, et = (e) => {
381
+ return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || Je(t.hostname);
382
+ }, tt = (e) => {
383
+ if (et(e)) throw Error("fetch: refusing to target the extension's own pages or FKN platform domains");
384
+ }, nt = (e) => {
385
385
  if (!e?.headers) return;
386
- let t = new Headers(e.headers), n = ze.map((e) => {
386
+ let t = new Headers(e.headers), n = Ve.map((e) => {
387
387
  let n = t.get(e);
388
388
  return n === null || n === "" ? void 0 : [e, n];
389
389
  }).filter((e) => e !== void 0);
390
390
  return n.length ? n : void 0;
391
- }, tt = async (e, t) => {
391
+ }, rt = async (e, t) => {
392
392
  let n = new Request(e, t);
393
- $e(n.url);
393
+ tt(n.url);
394
394
  let r = n.body ? await n.arrayBuffer() : null;
395
- return A.proxyFetch({
395
+ return O.proxyFetch({
396
396
  url: n.url,
397
397
  method: n.method,
398
398
  headers: [...n.headers],
399
399
  body: r,
400
400
  credentials: t?.credentials === "include" ? "include" : "omit",
401
401
  redirect: n.redirect,
402
- unsafeHeaders: et(t),
402
+ unsafeHeaders: nt(t),
403
403
  reason: t?.reason,
404
404
  signal: t?.signal ?? void 0
405
405
  });
406
- }, nt = {
406
+ }, it = {
407
407
  scope: "network.readCookie",
408
408
  category: "network",
409
409
  severity: 3,
@@ -411,7 +411,7 @@ var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne]
411
411
  unsafe: !0,
412
412
  title: "Read a site’s cookie",
413
413
  description: "Lets the app read a named cookie from another site, which can include the login token only that site should see."
414
- }, rt = { get: (e) => A.getCookie(e) }, it = {
414
+ }, at = { get: (e) => O.getCookie(e) }, ot = {
415
415
  scope: "network.modifyRequestHeaders",
416
416
  category: "network",
417
417
  severity: 2,
@@ -419,7 +419,7 @@ var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne]
419
419
  unsafe: !0,
420
420
  title: "Rewrite request headers to other sites",
421
421
  description: "Lets the app set or remove headers (like Origin and Referer) on this page’s own requests to the listed sites."
422
- }, at = (e) => A.setRequestHeaderRule(e), ot = (e) => A.removeRequestHeaderRule({ ruleId: e }), st = class extends Error {
422
+ }, st = (e) => O.setRequestHeaderRule(e), ct = (e) => O.removeRequestHeaderRule({ ruleId: e }), lt = class extends Error {
423
423
  reason;
424
424
  filename;
425
425
  line;
@@ -428,18 +428,18 @@ var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne]
428
428
  constructor(e, t, n, r, i) {
429
429
  super(`${e}:${n}:${r}: ${t}`), this.reason = t, this.filename = e, this.line = n, this.column = r, this.source = i;
430
430
  }
431
- }, ct = class {
431
+ }, ut = class {
432
432
  start;
433
433
  end;
434
434
  source;
435
435
  constructor(e, t, n) {
436
436
  this.start = e, this.end = t, this.source = n;
437
437
  }
438
- }, j;
438
+ }, k;
439
439
  (function(e) {
440
440
  e.stylesheet = "stylesheet", e.rule = "rule", e.declaration = "declaration", e.comment = "comment", e.atRule = "at-rule", e.container = "container", e.charset = "charset", e.counterStyle = "counter-style", e.document = "document", e.customMedia = "custom-media", e.fontFace = "font-face", e.fontFeatureValues = "font-feature-values", e.host = "host", e.import = "import", e.keyframes = "keyframes", e.keyframe = "keyframe", e.layer = "layer", e.media = "media", e.namespace = "namespace", e.page = "page", e.pageMarginBox = "page-margin-box", e.positionTry = "position-try", e.property = "property", e.scope = "scope", e.startingStyle = "starting-style", e.supports = "supports", e.viewTransition = "view-transition";
441
- })(j ||= {});
442
- var lt = (e, t, n) => {
441
+ })(k ||= {});
442
+ var dt = (e, t, n) => {
443
443
  let r = n, i = 1e4;
444
444
  do {
445
445
  let n = t.map((t) => e.indexOf(t, r));
@@ -451,7 +451,7 @@ var lt = (e, t, n) => {
451
451
  r = o + 2, i--;
452
452
  } while (i > 0);
453
453
  throw Error("Too many escaping");
454
- }, M = (e, t, n) => {
454
+ }, A = (e, t, n) => {
455
455
  let r = n, i = 1e4;
456
456
  do {
457
457
  let n = t.map((t) => e.indexOf(t, r));
@@ -465,21 +465,21 @@ var lt = (e, t, n) => {
465
465
  break;
466
466
  case "(":
467
467
  {
468
- let t = M(e, [")"], o + 1);
468
+ let t = A(e, [")"], o + 1);
469
469
  if (t === -1) return -1;
470
470
  r = t + 1;
471
471
  }
472
472
  break;
473
473
  case "\"":
474
474
  {
475
- let t = lt(e, ["\""], o + 1);
475
+ let t = dt(e, ["\""], o + 1);
476
476
  if (t === -1) return -1;
477
477
  r = t + 1;
478
478
  }
479
479
  break;
480
480
  case "'":
481
481
  {
482
- let t = lt(e, ["'"], o + 1);
482
+ let t = dt(e, ["'"], o + 1);
483
483
  if (t === -1) return -1;
484
484
  r = t + 1;
485
485
  }
@@ -489,17 +489,17 @@ var lt = (e, t, n) => {
489
489
  i--;
490
490
  } while (i > 0);
491
491
  throw Error("Too many escaping");
492
- }, N = /\/\*[^]*?(?:\*\/|$)/g;
493
- function P(e) {
492
+ }, j = /\/\*[^]*?(?:\*\/|$)/g;
493
+ function M(e) {
494
494
  return e ? e.trim() : "";
495
495
  }
496
- function F(e, t) {
496
+ function N(e, t) {
497
497
  let n = e && typeof e.type == "string", r = n ? e : t;
498
498
  for (let t in e) {
499
499
  let n = e[t];
500
500
  Array.isArray(n) ? n.forEach((e) => {
501
- F(e, r);
502
- }) : n && typeof n == "object" && F(n, r);
501
+ N(e, r);
502
+ }) : n && typeof n == "object" && N(n, r);
503
503
  }
504
504
  return n && Object.defineProperty(e, "parent", {
505
505
  configurable: !0,
@@ -508,7 +508,7 @@ function F(e, t) {
508
508
  value: t || null
509
509
  }), e;
510
510
  }
511
- var ut = class {
511
+ var ft = class {
512
512
  level = 0;
513
513
  indentation = " ";
514
514
  compress = !1;
@@ -523,33 +523,33 @@ var ut = class {
523
523
  }
524
524
  visit(e) {
525
525
  switch (e.type) {
526
- case j.stylesheet: return this.stylesheet(e);
527
- case j.rule: return this.rule(e);
528
- case j.declaration: return this.declaration(e);
529
- case j.comment: return this.comment(e);
530
- case j.container: return this.container(e);
531
- case j.charset: return this.charset(e);
532
- case j.counterStyle: return this.counterStyle(e);
533
- case j.document: return this.document(e);
534
- case j.customMedia: return this.customMedia(e);
535
- case j.fontFace: return this.fontFace(e);
536
- case j.fontFeatureValues: return this.fontFeatureValues(e);
537
- case j.host: return this.host(e);
538
- case j.import: return this.import(e);
539
- case j.keyframes: return this.keyframes(e);
540
- case j.keyframe: return this.keyframe(e);
541
- case j.layer: return this.layer(e);
542
- case j.media: return this.media(e);
543
- case j.namespace: return this.namespace(e);
544
- case j.page: return this.page(e);
545
- case j.pageMarginBox: return this.pageMarginBox(e);
546
- case j.positionTry: return this.positionTry(e);
547
- case j.property: return this.property(e);
548
- case j.scope: return this.scope(e);
549
- case j.startingStyle: return this.startingStyle(e);
550
- case j.supports: return this.supports(e);
551
- case j.viewTransition: return this.viewTransition(e);
552
- case j.atRule: return this.genericAtRule(e);
526
+ case k.stylesheet: return this.stylesheet(e);
527
+ case k.rule: return this.rule(e);
528
+ case k.declaration: return this.declaration(e);
529
+ case k.comment: return this.comment(e);
530
+ case k.container: return this.container(e);
531
+ case k.charset: return this.charset(e);
532
+ case k.counterStyle: return this.counterStyle(e);
533
+ case k.document: return this.document(e);
534
+ case k.customMedia: return this.customMedia(e);
535
+ case k.fontFace: return this.fontFace(e);
536
+ case k.fontFeatureValues: return this.fontFeatureValues(e);
537
+ case k.host: return this.host(e);
538
+ case k.import: return this.import(e);
539
+ case k.keyframes: return this.keyframes(e);
540
+ case k.keyframe: return this.keyframe(e);
541
+ case k.layer: return this.layer(e);
542
+ case k.media: return this.media(e);
543
+ case k.namespace: return this.namespace(e);
544
+ case k.page: return this.page(e);
545
+ case k.pageMarginBox: return this.pageMarginBox(e);
546
+ case k.positionTry: return this.positionTry(e);
547
+ case k.property: return this.property(e);
548
+ case k.scope: return this.scope(e);
549
+ case k.startingStyle: return this.startingStyle(e);
550
+ case k.supports: return this.supports(e);
551
+ case k.viewTransition: return this.viewTransition(e);
552
+ case k.atRule: return this.genericAtRule(e);
553
553
  }
554
554
  }
555
555
  mapVisit(e, t) {
@@ -645,7 +645,7 @@ var ut = class {
645
645
  let t = e.prelude ? ` ${e.prelude}` : "";
646
646
  if (this.compress) return this.emit(`@${e.name}${t}`, e.position) + (e.rules ? this.emit("{") + this.mapVisit(e.rules) + this.emit("}") : ";");
647
647
  if (!e.rules) return this.emit(`${this.indent()}@${e.name}${t};`, e.position);
648
- let n = e.rules.some((e) => e.type !== j.declaration && e.type !== j.comment), r = n ? "\n\n" : "\n";
648
+ let n = e.rules.some((e) => e.type !== k.declaration && e.type !== k.comment), r = n ? "\n\n" : "\n";
649
649
  return this.emit(`${this.indent()}@${e.name}${t}`, e.position) + this.emit(n ? ` {\n${this.indent(1)}` : " {\n") + this.emit(n ? "" : this.indent(1)) + this.mapVisit(e.rules, r) + this.emit(n ? `\n${this.indent(-1)}${this.indent()}}` : `${this.indent(-1)}\n${this.indent()}}`);
650
650
  }
651
651
  rule(e) {
@@ -658,7 +658,7 @@ var ut = class {
658
658
  declaration(e) {
659
659
  return this.compress ? this.emit(`${e.property}:${e.value}`, e.position) + this.emit(";") : e.property === "grid-template-areas" ? this.emit(this.indent()) + this.emit(e.property + ": " + e.value.split("\n").join("\n".padEnd(22) + this.indent()), e.position) + this.emit(";") : this.emit(this.indent()) + this.emit(`${e.property}: ${e.value}`, e.position) + this.emit(";");
660
660
  }
661
- }, dt = (e, t) => {
661
+ }, pt = (e, t) => {
662
662
  t ||= {};
663
663
  let n = 1, r = 1;
664
664
  function i() {
@@ -666,14 +666,14 @@ var ut = class {
666
666
  line: n,
667
667
  column: r
668
668
  };
669
- return (i) => (i.position = new ct(e, {
669
+ return (i) => (i.position = new ut(e, {
670
670
  line: n,
671
671
  column: r
672
672
  }, t?.source || ""), u(), i);
673
673
  }
674
674
  let a = [];
675
675
  function o(i) {
676
- let o = new st(t?.source || "", i, n, r, e);
676
+ let o = new lt(t?.source || "", i, n, r, e);
677
677
  if (!t?.silent) throw o;
678
678
  a.push(o);
679
679
  }
@@ -709,36 +709,36 @@ var ut = class {
709
709
  if (e.charAt(0) !== "/" || e.charAt(1) !== "*") return;
710
710
  let n = /^\/\*[^]*?\*\//.exec(e);
711
711
  return n ? (l(n), t({
712
- type: j.comment,
712
+ type: k.comment,
713
713
  comment: n[0].slice(2, -2)
714
714
  })) : o("End of comment missing");
715
715
  }
716
716
  function p() {
717
- let t = M(e, ["{"]);
717
+ let t = A(e, ["{"]);
718
718
  if (t === -1 || t === 0) return;
719
719
  let n = e.substring(0, t);
720
720
  return l([n]), ((e, t) => {
721
721
  let n = [], r = 0;
722
722
  for (; r < e.length;) {
723
- let i = M(e, t, r);
723
+ let i = A(e, t, r);
724
724
  if (i === -1) return n.push(e.substring(r)), n;
725
725
  n.push(e.substring(r, i)), r = i + 1;
726
726
  }
727
727
  return n;
728
- })(P(n).replace(N, ""), [","]).map((e) => P(e));
728
+ })(M(n).replace(j, ""), [","]).map((e) => M(e));
729
729
  }
730
730
  function m() {
731
731
  let t = i(), n = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/.exec(e);
732
732
  if (!n) return;
733
733
  l(n);
734
- let r = P(n[0]), a = /^:\s*/.exec(e);
734
+ let r = M(n[0]), a = /^:\s*/.exec(e);
735
735
  if (!a) return o("property missing ':'");
736
736
  l(a);
737
- let s = "", c = M(e, [";", "}"]);
738
- c !== -1 && (s = e.substring(0, c), l([s]), s = P(s).replace(N, ""));
737
+ let s = "", c = A(e, [";", "}"]);
738
+ c !== -1 && (s = e.substring(0, c), l([s]), s = M(s).replace(j, ""));
739
739
  let u = t({
740
- type: j.declaration,
741
- property: r.replace(N, ""),
740
+ type: k.declaration,
741
+ property: r.replace(j, ""),
742
742
  value: s
743
743
  }), d = /^[;\s]*/.exec(e);
744
744
  return d && l(d), u;
@@ -757,9 +757,9 @@ var ut = class {
757
757
  return c() ? n : o("missing '}'");
758
758
  }
759
759
  function g() {
760
- let t = M(e, ["{"]);
760
+ let t = A(e, ["{"]);
761
761
  if (t === -1) return !1;
762
- let n = M(e, [";"]), r = M(e, ["}"]);
762
+ let n = A(e, [";"]), r = A(e, ["}"]);
763
763
  return !(n !== -1 && n < t) && !(r !== -1 && r < t);
764
764
  }
765
765
  function _() {
@@ -767,14 +767,14 @@ var ut = class {
767
767
  if (!s()) return o("missing '{'");
768
768
  for (d(n); e.length && e.charAt(0) !== "}";) {
769
769
  if (e.charAt(0) === "@") {
770
- let e = S();
770
+ let e = b();
771
771
  if (e) {
772
772
  n.push(e), d(n);
773
773
  continue;
774
774
  }
775
775
  }
776
776
  if (g()) {
777
- let e = C();
777
+ let e = x();
778
778
  if (e) {
779
779
  n.push(e), d(n);
780
780
  continue;
@@ -799,14 +799,14 @@ var ut = class {
799
799
  let n = [];
800
800
  for (u(), d(n); e.length && e.charAt(0) !== "}";) {
801
801
  if (e.charAt(0) === "@") {
802
- let e = S();
802
+ let e = b();
803
803
  if (e) {
804
804
  n.push(e), d(n);
805
805
  continue;
806
806
  }
807
807
  }
808
808
  if (g()) {
809
- let e = C();
809
+ let e = x();
810
810
  if (e) {
811
811
  n.push(e), d(n);
812
812
  continue;
@@ -827,7 +827,7 @@ var ut = class {
827
827
  }
828
828
  return n;
829
829
  }
830
- function y() {
830
+ function ee() {
831
831
  let t = [], n = i(), r = /^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);
832
832
  for (; r;) {
833
833
  let n = l(r);
@@ -836,12 +836,12 @@ var ut = class {
836
836
  i && l(i), r = /^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);
837
837
  }
838
838
  if (t.length) return n({
839
- type: j.keyframe,
839
+ type: k.keyframe,
840
840
  values: t,
841
841
  declarations: h() || []
842
842
  });
843
843
  }
844
- let ee = RegExp(`^@(${[
844
+ let te = RegExp(`^@(${[
845
845
  "top-left-corner",
846
846
  "top-left",
847
847
  "top-center",
@@ -858,8 +858,8 @@ var ut = class {
858
858
  "right-top",
859
859
  "right-middle",
860
860
  "right-bottom"
861
- ].join("|")})(?![\\w-])\\s*`), te = x("import"), ne = x("charset"), b = x("namespace");
862
- function x(t) {
861
+ ].join("|")})(?![\\w-])\\s*`), ne = y("import"), re = y("charset"), ie = y("namespace");
862
+ function y(t) {
863
863
  let n = RegExp("^@" + t + "\\s*((?::?[^;'\"]|\"(?:\\\\\"|[^\"])*?\"|'(?:\\\\'|[^'])*?')+)(?:;|$)");
864
864
  return () => {
865
865
  let r = i(), a = n.exec(e);
@@ -868,7 +868,7 @@ var ut = class {
868
868
  return s[t] = o[1].trim(), r(s);
869
869
  };
870
870
  }
871
- function S() {
871
+ function b() {
872
872
  if (e[0] === "@") return function() {
873
873
  let t = i(), n = /^@([-\w]+)?keyframes\s*/.exec(e);
874
874
  if (!n) return;
@@ -876,10 +876,10 @@ var ut = class {
876
876
  if (!a) return o("@keyframes missing name");
877
877
  let u = l(a)[1];
878
878
  if (!s()) return o("@keyframes missing '{'");
879
- let f = d(), p = y();
880
- for (; p;) f.push(p), f = f.concat(d()), p = y();
879
+ let f = d(), p = ee();
880
+ for (; p;) f.push(p), f = f.concat(d()), p = ee();
881
881
  return c() ? t({
882
- type: j.keyframes,
882
+ type: k.keyframes,
883
883
  name: u,
884
884
  vendor: r,
885
885
  keyframes: f
@@ -887,11 +887,11 @@ var ut = class {
887
887
  }() || function() {
888
888
  let t = i(), n = /^@media *([^{]+)/.exec(e);
889
889
  if (!n) return;
890
- let r = P(l(n)[1]);
890
+ let r = M(l(n)[1]);
891
891
  if (!s()) return o("@media missing '{'");
892
892
  let a = v();
893
893
  return c() ? t({
894
- type: j.media,
894
+ type: k.media,
895
895
  media: r,
896
896
  rules: a
897
897
  }) : o("@media missing '}'");
@@ -900,29 +900,29 @@ var ut = class {
900
900
  if (!n) return;
901
901
  let r = l(n);
902
902
  return t({
903
- type: j.customMedia,
904
- name: P(r[1]),
905
- media: P(r[2])
903
+ type: k.customMedia,
904
+ name: M(r[1]),
905
+ media: M(r[2])
906
906
  });
907
907
  }() || function() {
908
908
  let t = i(), n = /^@supports *([^{]+)/.exec(e);
909
909
  if (!n) return;
910
- let r = P(l(n)[1]);
910
+ let r = M(l(n)[1]);
911
911
  if (!s()) return o("@supports missing '{'");
912
912
  let a = v();
913
913
  return c() ? t({
914
- type: j.supports,
914
+ type: k.supports,
915
915
  supports: r,
916
916
  rules: a
917
917
  }) : o("@supports missing '}'");
918
- }() || te() || ne() || b() || function() {
918
+ }() || ne() || re() || ie() || function() {
919
919
  let t = i(), n = /^@([-\w]+)?document *([^{]+)/.exec(e);
920
920
  if (!n) return;
921
- let r = l(n), a = P(r[1]), u = P(r[2]);
921
+ let r = l(n), a = M(r[1]), u = M(r[2]);
922
922
  if (!s()) return o("@document missing '{'");
923
923
  let d = v();
924
924
  return c() ? t({
925
- type: j.document,
925
+ type: k.document,
926
926
  document: u,
927
927
  vendor: a,
928
928
  rules: d
@@ -936,7 +936,7 @@ var ut = class {
936
936
  let a = [];
937
937
  for (d(a); e.length && e.charAt(0) !== "}";) {
938
938
  if (e.charAt(0) === "@") {
939
- let e = S();
939
+ let e = b();
940
940
  if (e) {
941
941
  a.push(e), d(a);
942
942
  continue;
@@ -947,7 +947,7 @@ var ut = class {
947
947
  a.push(t), d(a);
948
948
  }
949
949
  return c() ? t({
950
- type: j.page,
950
+ type: k.page,
951
951
  selectors: r,
952
952
  declarations: a
953
953
  }) : o("@page missing '}'");
@@ -957,7 +957,7 @@ var ut = class {
957
957
  if (l(n), !s()) return o("@host missing '{'");
958
958
  let r = v();
959
959
  return c() ? t({
960
- type: j.host,
960
+ type: k.host,
961
961
  rules: r
962
962
  }) : o("@host missing '}'");
963
963
  }() || function() {
@@ -967,28 +967,28 @@ var ut = class {
967
967
  let r = d(), a = m();
968
968
  for (; a;) r.push(a), r = r.concat(d()), a = m();
969
969
  return c() ? t({
970
- type: j.fontFace,
970
+ type: k.fontFace,
971
971
  declarations: r
972
972
  }) : o("@font-face missing '}'");
973
973
  }() || function() {
974
974
  let t = i(), n = /^@font-feature-values\s+([^{]+)/.exec(e);
975
975
  if (!n) return;
976
- let r = P(l(n)[1]);
976
+ let r = M(l(n)[1]);
977
977
  if (!s()) return o("@font-feature-values missing '{'");
978
978
  let a = v();
979
979
  return c() ? t({
980
- type: j.fontFeatureValues,
980
+ type: k.fontFeatureValues,
981
981
  fontFamily: r,
982
982
  rules: a
983
983
  }) : o("@font-feature-values missing '}'");
984
984
  }() || function() {
985
985
  let t = i(), n = /^@container *([^{]+)/.exec(e);
986
986
  if (!n) return;
987
- let r = P(l(n)[1]);
987
+ let r = M(l(n)[1]);
988
988
  if (!s()) return o("@container missing '{'");
989
989
  let a = v();
990
990
  return c() ? t({
991
- type: j.container,
991
+ type: k.container,
992
992
  container: r,
993
993
  rules: a
994
994
  }) : o("@container missing '}'");
@@ -998,23 +998,23 @@ var ut = class {
998
998
  if (l(n), !s()) return o("@starting-style missing '{'");
999
999
  let r = v();
1000
1000
  return c() ? t({
1001
- type: j.startingStyle,
1001
+ type: k.startingStyle,
1002
1002
  rules: r
1003
1003
  }) : o("@starting-style missing '}'");
1004
1004
  }() || function() {
1005
1005
  let t = i(), n = /^@layer *([^{;@]+)/.exec(e);
1006
1006
  if (!n) return;
1007
- let r = P(l(n)[1]);
1007
+ let r = M(l(n)[1]);
1008
1008
  if (!s()) {
1009
1009
  let n = /^[;\s]*/.exec(e);
1010
1010
  return n && l(n), t({
1011
- type: j.layer,
1011
+ type: k.layer,
1012
1012
  layer: r
1013
1013
  });
1014
1014
  }
1015
1015
  let a = v();
1016
1016
  return c() ? t({
1017
- type: j.layer,
1017
+ type: k.layer,
1018
1018
  layer: r,
1019
1019
  rules: a
1020
1020
  }) : o("@layer missing '}'");
@@ -1026,7 +1026,7 @@ var ut = class {
1026
1026
  let a = d(), u = m();
1027
1027
  for (; u;) a.push(u), a = a.concat(d()), u = m();
1028
1028
  return c() ? t({
1029
- type: j.property,
1029
+ type: k.property,
1030
1030
  name: r,
1031
1031
  declarations: a
1032
1032
  }) : o("@property missing '}'");
@@ -1038,18 +1038,18 @@ var ut = class {
1038
1038
  let a = d(), u = m();
1039
1039
  for (; u;) a.push(u), a = a.concat(d()), u = m();
1040
1040
  return c() ? t({
1041
- type: j.counterStyle,
1041
+ type: k.counterStyle,
1042
1042
  name: r,
1043
1043
  declarations: a
1044
1044
  }) : o("@counter-style missing '}'");
1045
1045
  }() || function() {
1046
1046
  let t = i(), n = /^@scope\s*([^{]*)/.exec(e);
1047
1047
  if (!n) return;
1048
- let r = P(l(n)[1]);
1048
+ let r = M(l(n)[1]);
1049
1049
  if (!s()) return o("@scope missing '{'");
1050
1050
  let a = v();
1051
1051
  return c() ? t({
1052
- type: j.scope,
1052
+ type: k.scope,
1053
1053
  scope: r,
1054
1054
  rules: a
1055
1055
  }) : o("@scope missing '}'");
@@ -1060,7 +1060,7 @@ var ut = class {
1060
1060
  let r = d(), a = m();
1061
1061
  for (; a;) r.push(a), r = r.concat(d()), a = m();
1062
1062
  return c() ? t({
1063
- type: j.viewTransition,
1063
+ type: k.viewTransition,
1064
1064
  declarations: r
1065
1065
  }) : o("@view-transition missing '}'");
1066
1066
  }() || function() {
@@ -1071,30 +1071,30 @@ var ut = class {
1071
1071
  let a = d(), u = m();
1072
1072
  for (; u;) a.push(u), a = a.concat(d()), u = m();
1073
1073
  return c() ? t({
1074
- type: j.positionTry,
1074
+ type: k.positionTry,
1075
1075
  name: r,
1076
1076
  declarations: a
1077
1077
  }) : o("@position-try missing '}'");
1078
1078
  }() || function() {
1079
- let t = i(), n = ee.exec(e);
1079
+ let t = i(), n = te.exec(e);
1080
1080
  if (!n) return;
1081
1081
  let r = l(n)[1];
1082
1082
  if (!s()) return o(`@${r} missing '{'`);
1083
1083
  let a = d(), u = m();
1084
1084
  for (; u;) a.push(u), a = a.concat(d()), u = m();
1085
1085
  return c() ? t({
1086
- type: j.pageMarginBox,
1086
+ type: k.pageMarginBox,
1087
1087
  name: r,
1088
1088
  declarations: a
1089
1089
  }) : o(`@${r} missing '}'`);
1090
1090
  }() || function() {
1091
1091
  let t = i(), n = /^@([-\w]+)\s*/.exec(e);
1092
1092
  if (!n) return;
1093
- let r = l(n)[1], a = "", u = M(e, ["{", ";"]);
1094
- if (u !== -1 && u > 0 && (a = P(e.substring(0, u)), l([e.substring(0, u)])), s()) {
1093
+ let r = l(n)[1], a = "", u = A(e, ["{", ";"]);
1094
+ if (u !== -1 && u > 0 && (a = M(e.substring(0, u)), l([e.substring(0, u)])), s()) {
1095
1095
  let e = v();
1096
1096
  return c() ? t({
1097
- type: j.atRule,
1097
+ type: k.atRule,
1098
1098
  name: r,
1099
1099
  prelude: a,
1100
1100
  rules: e
@@ -1102,21 +1102,21 @@ var ut = class {
1102
1102
  }
1103
1103
  let d = /^[;\s]*/.exec(e);
1104
1104
  return d && l(d), t({
1105
- type: j.atRule,
1105
+ type: k.atRule,
1106
1106
  name: r,
1107
1107
  prelude: a
1108
1108
  });
1109
1109
  }();
1110
1110
  }
1111
- function C() {
1111
+ function x() {
1112
1112
  let e = i(), t = p();
1113
1113
  return t ? (d(), e({
1114
- type: j.rule,
1114
+ type: k.rule,
1115
1115
  selectors: t,
1116
1116
  declarations: _() || []
1117
1117
  })) : o("selector missing");
1118
1118
  }
1119
- return F(function() {
1119
+ return N(function() {
1120
1120
  let n = function() {
1121
1121
  let n, r = [];
1122
1122
  for (u(), d(r); e.length;) {
@@ -1127,7 +1127,7 @@ var ut = class {
1127
1127
  }
1128
1128
  break;
1129
1129
  }
1130
- if (n = S() || C(), !n) {
1130
+ if (n = b() || x(), !n) {
1131
1131
  if (t?.silent) {
1132
1132
  l([e.charAt(0)]), u(), d(r);
1133
1133
  continue;
@@ -1139,7 +1139,7 @@ var ut = class {
1139
1139
  return r;
1140
1140
  }();
1141
1141
  return {
1142
- type: j.stylesheet,
1142
+ type: k.stylesheet,
1143
1143
  stylesheet: {
1144
1144
  source: t?.source,
1145
1145
  rules: n,
@@ -1147,36 +1147,36 @@ var ut = class {
1147
1147
  }
1148
1148
  };
1149
1149
  }());
1150
- }, ft = (e, t) => new ut(t || {}).compile(e), pt = Object.defineProperty, mt = (e, t) => {
1150
+ }, mt = (e, t) => new ft(t || {}).compile(e), ht = Object.defineProperty, gt = (e, t) => {
1151
1151
  let n = {};
1152
- for (var r in e) pt(n, r, {
1152
+ for (var r in e) ht(n, r, {
1153
1153
  get: e[r],
1154
1154
  enumerable: !0
1155
1155
  });
1156
- return t || pt(n, Symbol.toStringTag, { value: "Module" }), n;
1157
- }, ht = "LocatorError", I = "LocatorUnsupportedError", L = "LocatorDeniedError", R = "LocatorInvalidError", gt = (e) => typeof e == "object" && e ? e.name : void 0, z = (e) => Object.assign(Error(e), { name: ht }), _t = (e, t = "", n) => Object.assign(Error(e), {
1158
- name: I,
1156
+ return t || ht(n, Symbol.toStringTag, { value: "Module" }), n;
1157
+ }, _t = "LocatorError", P = "LocatorUnsupportedError", F = "LocatorDeniedError", I = "LocatorInvalidError", L = (e) => typeof e == "object" && e ? e.name : void 0, R = (e) => Object.assign(Error(e), { name: _t }), z = (e, t = "", n) => Object.assign(Error(e), {
1158
+ name: P,
1159
1159
  operation: t,
1160
1160
  backend: n
1161
- }), vt = (e, t) => _t(`Locator operation not supported${t ? ` on the ${t} backend` : ""}: ${e}`, e, t), B = (e, t) => Object.assign(Error(e), {
1162
- name: L,
1161
+ }), vt = (e, t) => z(`Locator operation not supported${t ? ` on the ${t} backend` : ""}: ${e}`, e, t), B = (e, t) => Object.assign(Error(e), {
1162
+ name: F,
1163
1163
  operation: t
1164
1164
  }), yt = (e, t) => Object.assign(Error(e), {
1165
- name: R,
1165
+ name: I,
1166
1166
  operation: t
1167
1167
  }), V = class extends Error {
1168
1168
  name = "TimeoutError";
1169
1169
  constructor(e, t) {
1170
1170
  super(e, t?.cause === void 0 ? void 0 : { cause: t.cause });
1171
1171
  }
1172
- }, bt = (e) => gt(e) === I, xt = (e) => gt(e) === L, H = (e) => gt(e) === R, St = (e) => xt(e) || bt(e) || H(e), U = (e) => {
1172
+ }, bt = (e) => L(e) === P, xt = (e) => L(e) === F, H = (e) => L(e) === I, St = (e) => xt(e) || bt(e) || H(e), U = (e) => {
1173
1173
  let t = (e.ownerDocument ?? e).defaultView;
1174
- if (!t) throw z("the resolved element belongs to a document with no window");
1174
+ if (!t) throw R("the resolved element belongs to a document with no window");
1175
1175
  return t;
1176
1176
  }, Ct = (e, t) => {
1177
1177
  let n = e?.[t];
1178
1178
  return typeof n == "function" ? n : null;
1179
- }, W = (e, t) => {
1179
+ }, wt = (e, t) => {
1180
1180
  if (typeof e != "object" || !e) return null;
1181
1181
  let n = (() => {
1182
1182
  try {
@@ -1188,25 +1188,25 @@ var ut = class {
1188
1188
  if (n && e instanceof n) return n;
1189
1189
  let r = Ct(globalThis, t);
1190
1190
  return r && e instanceof r ? r : null;
1191
- }, G = (e, t) => W(e, t) !== null, K = (e) => {
1192
- if (e.length === 0) throw z("No elements found");
1193
- if (e.length > 1) throw z(`Strict mode violation: locator resolved to ${e.length} elements`);
1191
+ }, W = (e, t) => wt(e, t) !== null, G = (e) => {
1192
+ if (e.length === 0) throw R("No elements found");
1193
+ if (e.length > 1) throw R(`Strict mode violation: locator resolved to ${e.length} elements`);
1194
1194
  return e[0];
1195
- }, wt = (e, t) => {
1196
- if (!G(e, t)) throw z(`Strict mode violation: expected ${t}, got <${e.tagName.toLowerCase()}>`);
1195
+ }, Tt = (e, t) => {
1196
+ if (!W(e, t)) throw R(`Strict mode violation: expected ${t}, got <${e.tagName.toLowerCase()}>`);
1197
1197
  return e;
1198
- }, Tt = (e) => e.tagName.toLowerCase(), Et = /* @__PURE__ */ new Set(), Dt = (e) => {
1199
- Et.add(e);
1200
- }, Ot = /(?:^|[^\w-])(?:url|image|image-set|cross-fade|paint|element|expression)\s*\(/i, kt = (e) => e.replace(/\\([0-9a-fA-F]{1,6})\s?/g, (e, t) => String.fromCodePoint(Number.parseInt(t, 16))).replace(/\\(.)/g, "$1"), At = (e) => !Ot.test(kt(e.value)), jt = /* @__PURE__ */ new Set([
1201
- j.import,
1202
- j.fontFace,
1203
- j.namespace,
1204
- j.charset,
1205
- j.document,
1206
- j.comment
1207
- ]), Mt = (e) => {
1208
- if (jt.has(e.type)) return null;
1209
- if (e.type === j.declaration) return At(e) ? e : null;
1198
+ }, Et = (e) => e.tagName.toLowerCase(), Dt = /* @__PURE__ */ new Set(), Ot = (e) => {
1199
+ Dt.add(e);
1200
+ }, kt = /(?:^|[^\w-])(?:url|image|image-set|cross-fade|paint|element|expression)\s*\(/i, At = (e) => e.replace(/\\([0-9a-fA-F]{1,6})\s?/g, (e, t) => String.fromCodePoint(Number.parseInt(t, 16))).replace(/\\(.)/g, "$1"), jt = (e) => !kt.test(At(e.value)), Mt = /* @__PURE__ */ new Set([
1201
+ k.import,
1202
+ k.fontFace,
1203
+ k.namespace,
1204
+ k.charset,
1205
+ k.document,
1206
+ k.comment
1207
+ ]), Nt = (e) => {
1208
+ if (Mt.has(e.type)) return null;
1209
+ if (e.type === k.declaration) return jt(e) ? e : null;
1210
1210
  let t = e, n = { ...t };
1211
1211
  for (let e of [
1212
1212
  "declarations",
@@ -1214,18 +1214,18 @@ var ut = class {
1214
1214
  "keyframes"
1215
1215
  ]) {
1216
1216
  let r = t[e];
1217
- Array.isArray(r) && (n[e] = Nt(r));
1217
+ Array.isArray(r) && (n[e] = Pt(r));
1218
1218
  }
1219
1219
  return n;
1220
- }, Nt = (e) => e.map((e) => Mt(e)).filter((e) => e !== null), Pt = (e) => {
1220
+ }, Pt = (e) => e.map((e) => Nt(e)).filter((e) => e !== null), Ft = (e) => {
1221
1221
  let t;
1222
1222
  try {
1223
- t = dt(e, { silent: !0 });
1223
+ t = pt(e, { silent: !0 });
1224
1224
  } catch {
1225
1225
  return "";
1226
1226
  }
1227
- return t.stylesheet.rules = Nt(t.stylesheet.rules), ft(t);
1228
- }, Ft = (e, t) => {
1227
+ return t.stylesheet.rules = Pt(t.stylesheet.rules), mt(t);
1228
+ }, It = (e, t) => {
1229
1229
  let n = () => {
1230
1230
  t.parentNode || (e.head ?? e.documentElement).appendChild(t);
1231
1231
  };
@@ -1242,21 +1242,21 @@ var ut = class {
1242
1242
  });
1243
1243
  let i = () => r.disconnect(), a = e.defaultView;
1244
1244
  a ? a.addEventListener("load", i, { once: !0 }) : setTimeout(i, 3e4);
1245
- }, It = { resolve: (e, t) => {
1245
+ }, Lt = { resolve: (e, t) => {
1246
1246
  let n = e.document.createElement("style");
1247
- n.textContent = t.noSanitize ? t.content : Pt(t.content);
1247
+ n.textContent = t.noSanitize ? t.content : Ft(t.content);
1248
1248
  try {
1249
- Ft(e.document, n);
1249
+ It(e.document, n);
1250
1250
  } catch (e) {
1251
1251
  console.error(e);
1252
1252
  }
1253
- Dt(n);
1254
- } }, Lt = (e) => {
1253
+ Ot(n);
1254
+ } }, Rt = (e) => {
1255
1255
  let t = [];
1256
1256
  return e.forEach((e, n) => {
1257
1257
  t.push([n, e]);
1258
1258
  }), t;
1259
- }, q = {
1259
+ }, K = {
1260
1260
  kind: "frame",
1261
1261
  ensureArgs: (e) => [void 0, e],
1262
1262
  resolve: async (e, t, n = {}) => {
@@ -1281,31 +1281,31 @@ var ut = class {
1281
1281
  url: a.url,
1282
1282
  redirected: a.redirected,
1283
1283
  type: a.type,
1284
- headers: Lt(a.headers),
1284
+ headers: Rt(a.headers),
1285
1285
  body: await a.arrayBuffer()
1286
1286
  };
1287
1287
  }
1288
- }, J = /* @__PURE__ */ mt({
1289
- click: () => zt,
1290
- count: () => qt,
1291
- exists: () => Jt,
1292
- fill: () => Ut,
1293
- getAttribute: () => Gt,
1294
- hover: () => Bt,
1295
- isVisible: () => Kt,
1296
- textContent: () => Wt
1297
- }), Rt = (e, t) => {
1288
+ }, q = /* @__PURE__ */ gt({
1289
+ click: () => Bt,
1290
+ count: () => Jt,
1291
+ exists: () => Yt,
1292
+ fill: () => Wt,
1293
+ getAttribute: () => Kt,
1294
+ hover: () => Vt,
1295
+ isVisible: () => qt,
1296
+ textContent: () => Gt
1297
+ }), zt = (e, t) => {
1298
1298
  let n = e.getBoundingClientRect();
1299
1299
  return {
1300
1300
  clientX: n.left + n.width * (t?.x ?? .5),
1301
1301
  clientY: n.top + n.height * (t?.y ?? .5)
1302
1302
  };
1303
- }, zt = { resolve: (e, t = {}) => {
1304
- let n = K(e.elements), r = U(n), i = {
1303
+ }, Bt = { resolve: (e, t = {}) => {
1304
+ let n = G(e.elements), r = U(n), i = {
1305
1305
  bubbles: !0,
1306
1306
  cancelable: !0,
1307
1307
  composed: !0,
1308
- ...Rt(n, t.position),
1308
+ ...zt(n, t.position),
1309
1309
  button: 0
1310
1310
  }, a = {
1311
1311
  ...i,
@@ -1329,12 +1329,12 @@ var ut = class {
1329
1329
  ...i,
1330
1330
  buttons: 0
1331
1331
  }));
1332
- } }, Bt = { resolve: (e, t = {}) => {
1333
- let n = K(e.elements), r = U(n), i = {
1332
+ } }, Vt = { resolve: (e, t = {}) => {
1333
+ let n = G(e.elements), r = U(n), i = {
1334
1334
  bubbles: !0,
1335
1335
  cancelable: !0,
1336
1336
  composed: !0,
1337
- ...Rt(n, t.position)
1337
+ ...zt(n, t.position)
1338
1338
  }, a = {
1339
1339
  ...i,
1340
1340
  pointerType: "mouse",
@@ -1348,11 +1348,11 @@ var ut = class {
1348
1348
  ...i,
1349
1349
  bubbles: !1
1350
1350
  })), n.dispatchEvent(new r.MouseEvent("mouseover", i)), n.dispatchEvent(new r.PointerEvent("pointermove", a)), n.dispatchEvent(new r.MouseEvent("mousemove", i));
1351
- } }, Vt = (e, t) => {
1351
+ } }, Ht = (e, t) => {
1352
1352
  e._valueTracker?.setValue("");
1353
- let n = (W(e, "HTMLTextAreaElement") ?? W(e, "HTMLInputElement"))?.prototype, r = n && Object.getOwnPropertyDescriptor(n, "value")?.set;
1353
+ let n = (wt(e, "HTMLTextAreaElement") ?? wt(e, "HTMLInputElement"))?.prototype, r = n && Object.getOwnPropertyDescriptor(n, "value")?.set;
1354
1354
  r ? r.call(e, t) : e.value = t;
1355
- }, Ht = (e, t) => {
1355
+ }, Ut = (e, t) => {
1356
1356
  if (e.type !== "range") return null;
1357
1357
  let n = Number(e.min || 0), r = Number(e.max || 100);
1358
1358
  if (!Number.isFinite(n) || !Number.isFinite(r) || r <= n) return null;
@@ -1389,61 +1389,61 @@ var ut = class {
1389
1389
  buttons: 0
1390
1390
  }
1391
1391
  };
1392
- }, Ut = { resolve: (e, t, n = {}) => {
1393
- let r = K(e.elements), i = U(r), a = G(r, "HTMLInputElement");
1394
- if (a || G(r, "HTMLTextAreaElement")) {
1395
- let e = r, n = a ? Ht(e, t) : null;
1396
- n && (r.dispatchEvent(new i.PointerEvent("pointerdown", n.pointerDown)), r.dispatchEvent(new i.MouseEvent("mousedown", n.mouseDown))), Vt(e, t), r.dispatchEvent(new i.Event("input", { bubbles: !0 })), n && (r.dispatchEvent(new i.PointerEvent("pointerup", n.pointerUp)), r.dispatchEvent(new i.MouseEvent("mouseup", n.mouseUp))), r.dispatchEvent(new i.Event("change", { bubbles: !0 }));
1392
+ }, Wt = { resolve: (e, t, n = {}) => {
1393
+ let r = G(e.elements), i = U(r), a = W(r, "HTMLInputElement");
1394
+ if (a || W(r, "HTMLTextAreaElement")) {
1395
+ let e = r, n = a ? Ut(e, t) : null;
1396
+ n && (r.dispatchEvent(new i.PointerEvent("pointerdown", n.pointerDown)), r.dispatchEvent(new i.MouseEvent("mousedown", n.mouseDown))), Ht(e, t), r.dispatchEvent(new i.Event("input", { bubbles: !0 })), n && (r.dispatchEvent(new i.PointerEvent("pointerup", n.pointerUp)), r.dispatchEvent(new i.MouseEvent("mouseup", n.mouseUp))), r.dispatchEvent(new i.Event("change", { bubbles: !0 }));
1397
1397
  return;
1398
1398
  }
1399
- if (G(r, "HTMLElement") && r.isContentEditable) {
1399
+ if (W(r, "HTMLElement") && r.isContentEditable) {
1400
1400
  r.textContent = t, r.dispatchEvent(new i.Event("input", { bubbles: !0 }));
1401
1401
  return;
1402
1402
  }
1403
- throw Error(`fill: element <${Tt(r)}> is not fillable`);
1404
- } }, Wt = { resolve: (e, t = {}) => K(e.elements).textContent }, Gt = { resolve: (e, t, n = {}) => K(e.elements).getAttribute(t) }, Kt = { resolve: (e, t = {}) => {
1405
- let n = K(e.elements);
1406
- if (!G(n, "HTMLElement")) return !0;
1403
+ throw Error(`fill: element <${Et(r)}> is not fillable`);
1404
+ } }, Gt = { resolve: (e, t = {}) => G(e.elements).textContent }, Kt = { resolve: (e, t, n = {}) => G(e.elements).getAttribute(t) }, qt = { resolve: (e, t = {}) => {
1405
+ let n = G(e.elements);
1406
+ if (!W(n, "HTMLElement")) return !0;
1407
1407
  let r = U(n).getComputedStyle(n);
1408
1408
  if (r?.display === "none" || r?.visibility === "hidden") return !1;
1409
1409
  let i = n.getBoundingClientRect();
1410
1410
  return i.width > 0 && i.height > 0;
1411
- } }, qt = { resolve: (e, t = {}) => e.elements.length }, Jt = { resolve: (e, t = {}) => e.elements.length > 0 }, Y = (e, t) => e.elements.flatMap((e) => [...e.querySelectorAll(t)]), X = (e) => e.replaceAll("\"", "\\\""), Yt = {
1411
+ } }, Jt = { resolve: (e, t = {}) => e.elements.length }, Yt = { resolve: (e, t = {}) => e.elements.length > 0 }, J = (e, t) => e.elements.flatMap((e) => [...e.querySelectorAll(t)]), Xt = (e) => e.replaceAll("\"", "\\\""), Zt = {
1412
1412
  to: "element",
1413
1413
  css: !0,
1414
- resolve: (e, t) => Y(e, t),
1414
+ resolve: (e, t) => J(e, t),
1415
1415
  render: (e) => ({
1416
1416
  fragment: typeof e == "string" ? e : "?",
1417
1417
  separator: "descend"
1418
1418
  })
1419
- }, Xt = {
1419
+ }, Qt = {
1420
1420
  to: "frame",
1421
1421
  css: !0,
1422
1422
  barrier: "down",
1423
- resolve: (e, t) => Y(e, t),
1423
+ resolve: (e, t) => J(e, t),
1424
1424
  render: (e) => ({
1425
1425
  fragment: typeof e == "string" ? e : "?",
1426
1426
  separator: "down"
1427
1427
  })
1428
- }, Zt = {
1428
+ }, $t = {
1429
1429
  element: {
1430
1430
  selectors: {
1431
- locator: Yt,
1432
- frameLocator: Xt,
1431
+ locator: Zt,
1432
+ frameLocator: Qt,
1433
1433
  getByRole: {
1434
1434
  to: "element",
1435
- resolve: (e, t) => Y(e, `[role="${CSS.escape(t)}"]`),
1436
- render: (e) => ({ fragment: typeof e == "string" ? `[role="${X(e)}"]` : "[role]" })
1435
+ resolve: (e, t) => J(e, `[role="${CSS.escape(t)}"]`),
1436
+ render: (e) => ({ fragment: typeof e == "string" ? `[role="${Xt(e)}"]` : "[role]" })
1437
1437
  },
1438
1438
  getByText: {
1439
1439
  to: "element",
1440
1440
  resolve: (e, t) => e.elements.flatMap((e) => [e, ...e.querySelectorAll("*")]).filter((e) => e.textContent?.includes(t)),
1441
- render: (e) => ({ fragment: typeof e == "string" ? `:has-text("${X(e)}")` : ":has-text(...)" })
1441
+ render: (e) => ({ fragment: typeof e == "string" ? `:has-text("${Xt(e)}")` : ":has-text(...)" })
1442
1442
  },
1443
1443
  getByTestId: {
1444
1444
  to: "element",
1445
- resolve: (e, t) => Y(e, `[data-testid="${CSS.escape(t)}"]`),
1446
- render: (e) => ({ fragment: typeof e == "string" ? `[data-testid="${X(e)}"]` : "[data-testid]" })
1445
+ resolve: (e, t) => J(e, `[data-testid="${CSS.escape(t)}"]`),
1446
+ render: (e) => ({ fragment: typeof e == "string" ? `[data-testid="${Xt(e)}"]` : "[data-testid]" })
1447
1447
  },
1448
1448
  first: {
1449
1449
  to: "element",
@@ -1460,20 +1460,20 @@ var ut = class {
1460
1460
  }
1461
1461
  },
1462
1462
  operations: {
1463
- click: zt,
1464
- fill: Ut,
1465
- hover: Bt,
1466
- textContent: Wt,
1467
- getAttribute: Gt,
1468
- isVisible: Kt,
1469
- count: qt,
1470
- exists: Jt
1463
+ click: Bt,
1464
+ fill: Wt,
1465
+ hover: Vt,
1466
+ textContent: Gt,
1467
+ getAttribute: Kt,
1468
+ isVisible: qt,
1469
+ count: Jt,
1470
+ exists: Yt
1471
1471
  }
1472
1472
  },
1473
1473
  frame: {
1474
1474
  selectors: {
1475
- locator: Yt,
1476
- frameLocator: Xt,
1475
+ locator: Zt,
1476
+ frameLocator: Qt,
1477
1477
  owner: {
1478
1478
  to: "frame",
1479
1479
  barrier: "up",
@@ -1487,11 +1487,11 @@ var ut = class {
1487
1487
  }
1488
1488
  },
1489
1489
  operations: {
1490
- addStyleTag: It,
1491
- fetch: q
1490
+ addStyleTag: Lt,
1491
+ fetch: K
1492
1492
  }
1493
1493
  }
1494
- }, Qt = (e, t = Zt) => ({
1494
+ }, en = (e, t = $t) => ({
1495
1495
  element: {
1496
1496
  selectors: {
1497
1497
  ...t.element.selectors,
@@ -1512,31 +1512,31 @@ var ut = class {
1512
1512
  ...e.frame?.operations
1513
1513
  }
1514
1514
  }
1515
- }), $t = 3e4, en = 50, tn = (e) => {
1515
+ }), tn = 3e4, nn = 50, rn = (e) => {
1516
1516
  let t = e[e.length - 1];
1517
1517
  return typeof t == "object" && t ? t : void 0;
1518
- }, nn = (e) => {
1519
- let t = tn(e)?.timeout;
1520
- return typeof t == "number" ? t : $t;
1521
- }, rn = ({ executor: e, parts: t }) => ({ highlight: (n) => e.highlight(t, n).then(() => {}, () => {}) }), an = async (e) => {
1518
+ }, an = (e) => {
1519
+ let t = rn(e)?.timeout;
1520
+ return typeof t == "number" ? t : tn;
1521
+ }, on = ({ executor: e, parts: t }) => ({ highlight: (n) => e.highlight(t, n).then(() => {}, () => {}) }), sn = async (e) => {
1522
1522
  let t = {
1523
1523
  parts: e.parts,
1524
1524
  operation: e.operation,
1525
1525
  args: e.args,
1526
1526
  phase: "ensure"
1527
1527
  };
1528
- await e.gate?.(t, rn(e));
1529
- }, on = (e, t) => {
1528
+ await e.gate?.(t, on(e));
1529
+ }, cn = (e, t) => {
1530
1530
  if (t !== void 0 && typeof t == "number" && !(Number.isFinite(t) && t > 0)) throw TypeError(`${e}: timeout must be a positive number of milliseconds, not ${t}; every call ends at its deadline, so 0 does not turn it off`);
1531
- }, sn = (e) => typeof e == "object" && e && typeof e.message == "string" ? e.message : String(e), cn = async (e) => {
1531
+ }, ln = (e) => typeof e == "object" && e && typeof e.message == "string" ? e.message : String(e), un = async (e) => {
1532
1532
  let { executor: t, gate: n, parts: r, operation: i, args: a } = e;
1533
- on(i, tn(a)?.timeout), n && await n({
1533
+ cn(i, rn(a)?.timeout), n && await n({
1534
1534
  parts: r,
1535
1535
  operation: i,
1536
1536
  args: a,
1537
1537
  phase: "execute"
1538
- }, rn(e));
1539
- let o = nn(a), s = Date.now() + o, c = /* @__PURE__ */ Error(`Locator timeout (${o}ms): ${i}`), { promise: l, reject: u } = Promise.withResolvers();
1538
+ }, on(e));
1539
+ let o = an(a), s = Date.now() + o, c = /* @__PURE__ */ Error(`Locator timeout (${o}ms): ${i}`), { promise: l, reject: u } = Promise.withResolvers();
1540
1540
  l.catch(() => {});
1541
1541
  let d = setTimeout(() => u(c), o), f = c;
1542
1542
  try {
@@ -1548,43 +1548,43 @@ var ut = class {
1548
1548
  f = e;
1549
1549
  let t = s - Date.now();
1550
1550
  if (t <= 0) break;
1551
- await new Promise((e) => setTimeout(e, Math.min(en, t)));
1551
+ await new Promise((e) => setTimeout(e, Math.min(nn, t)));
1552
1552
  }
1553
1553
  } finally {
1554
1554
  clearTimeout(d);
1555
1555
  }
1556
- throw f === c ? new V(c.message) : new V(sn(f), { cause: f });
1557
- }, ln = (e, t, n, r, i) => {
1556
+ throw f === c ? new V(c.message) : new V(ln(f), { cause: f });
1557
+ }, dn = (e, t, n, r, i) => {
1558
1558
  let a = {};
1559
- for (let [o, s] of Object.entries(t[r].selectors)) a[o] = (...a) => ln(e, t, n, s.to, [...i, {
1559
+ for (let [o, s] of Object.entries(t[r].selectors)) a[o] = (...a) => dn(e, t, n, s.to, [...i, {
1560
1560
  kind: r,
1561
1561
  name: o,
1562
1562
  args: a
1563
1563
  }]);
1564
- for (let [n, o] of Object.entries(t[r].operations)) a[n] = async (...t) => cn({
1564
+ for (let [n, o] of Object.entries(t[r].operations)) a[n] = async (...t) => un({
1565
1565
  ...e,
1566
1566
  parts: i,
1567
1567
  operation: n,
1568
1568
  args: o.send ? o.send(...t) : t
1569
1569
  });
1570
- for (let [o, { to: s, rewrite: c }] of Object.entries(n[r] ?? {})) a[o] = (...r) => ln(e, t, n, s, c(i, ...r));
1570
+ for (let [o, { to: s, rewrite: c }] of Object.entries(n[r] ?? {})) a[o] = (...r) => dn(e, t, n, s, c(i, ...r));
1571
1571
  return a.ensure = (n, a = {}) => {
1572
1572
  let o = t[r].operations[n]?.ensureArgs;
1573
- return an({
1573
+ return sn({
1574
1574
  ...e,
1575
1575
  parts: i,
1576
1576
  operation: n,
1577
1577
  args: o?.(a) ?? [a]
1578
1578
  });
1579
1579
  }, a;
1580
- }, un = (e) => ln(e, e.modules ?? Zt, e.rewrites ?? {}, "frame", []), dn = () => {
1581
- let e = D();
1580
+ }, fn = (e) => dn(e, e.modules ?? $t, e.rewrites ?? {}, "frame", []), pn = () => {
1581
+ let e = E();
1582
1582
  return e.status === "ok" && e.abi >= 2;
1583
- }, fn = async () => {
1584
- await k();
1585
- let e = D();
1586
- if (e.status === "ok" && e.abi < 2) throw new T(e.abi, 2);
1587
- }, pn = (e) => `Read the text, links and details ${e} shows.`, mn = (e) => `Inject unfiltered styles or code into ${e}. This can pass page details along to other sites.`, hn = [
1583
+ }, mn = async () => {
1584
+ await D();
1585
+ let e = E();
1586
+ if (e.status === "ok" && e.abi < 2) throw new w(e.abi, 2);
1587
+ }, hn = (e) => `Read the text, links and details ${e} shows.`, gn = (e) => `Inject unfiltered styles or code into ${e}. This can pass page details along to other sites.`, _n = [
1588
1588
  {
1589
1589
  id: "interaction",
1590
1590
  heading: "Interaction",
@@ -1599,9 +1599,9 @@ var ut = class {
1599
1599
  heading: "Site data",
1600
1600
  summary: "Can read the website's data",
1601
1601
  title: (e) => `Read data from ${e}`,
1602
- description: pn,
1602
+ description: hn,
1603
1603
  cloudTitle: (e) => `Read what's on ${e}`,
1604
- cloudDescription: pn
1604
+ cloudDescription: hn
1605
1605
  },
1606
1606
  {
1607
1607
  id: "network",
@@ -1617,11 +1617,11 @@ var ut = class {
1617
1617
  heading: "Evaluation",
1618
1618
  summary: "Can execute arbitrary code on the website",
1619
1619
  title: (e) => `Run code on ${e}`,
1620
- description: mn,
1620
+ description: gn,
1621
1621
  cloudTitle: (e) => `Run its own code on ${e}`,
1622
- cloudDescription: mn
1622
+ cloudDescription: gn
1623
1623
  }
1624
- ], gn = (e) => (t) => {
1624
+ ], vn = (e) => (t) => {
1625
1625
  if (typeof t != "object" || !t) return t === void 0 ? [] : [t];
1626
1626
  if (t.position !== void 0) throw TypeError(`${e}: position is Playwright's offset in pixels, which no backend serves yet; pass relativePosition, a 0..1 fraction of the box`);
1627
1627
  let { relativePosition: n, ...r } = t;
@@ -1629,30 +1629,30 @@ var ut = class {
1629
1629
  ...r,
1630
1630
  position: n
1631
1631
  }];
1632
- }, _n = Qt({
1632
+ }, yn = en({
1633
1633
  element: { operations: {
1634
1634
  click: {
1635
- resolve: (e, t = {}) => J.click.resolve(e, t),
1636
- send: gn("click")
1635
+ resolve: (e, t = {}) => q.click.resolve(e, t),
1636
+ send: vn("click")
1637
1637
  },
1638
1638
  hover: {
1639
- resolve: (e, t = {}) => J.hover.resolve(e, t),
1640
- send: gn("hover")
1639
+ resolve: (e, t = {}) => q.hover.resolve(e, t),
1640
+ send: vn("hover")
1641
1641
  },
1642
- fill: { resolve: (e, t, n = {}) => J.fill.resolve(e, t, n) },
1643
- textContent: { resolve: (e, t = {}) => J.textContent.resolve(e) },
1644
- getAttribute: { resolve: (e, t, n = {}) => J.getAttribute.resolve(e, t) },
1645
- isVisible: { resolve: (e, t = {}) => J.isVisible.resolve(e) },
1646
- count: { resolve: (e, t = {}) => J.count.resolve(e) },
1647
- exists: { resolve: (e, t = {}) => J.exists.resolve(e) },
1648
- videoElement: { resolve: (e, t = {}) => w(wt(K(e.elements), "HTMLVideoElement")) }
1642
+ fill: { resolve: (e, t, n = {}) => q.fill.resolve(e, t, n) },
1643
+ textContent: { resolve: (e, t = {}) => q.textContent.resolve(e) },
1644
+ getAttribute: { resolve: (e, t, n = {}) => q.getAttribute.resolve(e, t) },
1645
+ isVisible: { resolve: (e, t = {}) => q.isVisible.resolve(e) },
1646
+ count: { resolve: (e, t = {}) => q.count.resolve(e) },
1647
+ exists: { resolve: (e, t = {}) => q.exists.resolve(e) },
1648
+ videoElement: { resolve: (e, t = {}) => C(Tt(G(e.elements), "HTMLVideoElement")) }
1649
1649
  } },
1650
1650
  frame: { operations: {
1651
- addStyleTag: { resolve: (e, t) => It.resolve(e, t) },
1651
+ addStyleTag: { resolve: (e, t) => Lt.resolve(e, t) },
1652
1652
  fetch: {
1653
- resolve: (e, t, n = {}) => q.resolve(e, t, n),
1654
- kind: q.kind,
1655
- ensureArgs: q.ensureArgs
1653
+ resolve: (e, t, n = {}) => K.resolve(e, t, n),
1654
+ kind: K.kind,
1655
+ ensureArgs: K.ensureArgs
1656
1656
  },
1657
1657
  evaluate: {
1658
1658
  kind: "frame",
@@ -1662,7 +1662,7 @@ var ut = class {
1662
1662
  }
1663
1663
  }
1664
1664
  } }
1665
- }), vn = (e) => e[e.length - 1], yn = {
1665
+ }), bn = (e) => e[e.length - 1], xn = {
1666
1666
  element: {
1667
1667
  last: {
1668
1668
  to: "element",
@@ -1675,7 +1675,7 @@ var ut = class {
1675
1675
  contentFrame: {
1676
1676
  to: "frame",
1677
1677
  rewrite: (e) => {
1678
- let t = vn(e);
1678
+ let t = bn(e);
1679
1679
  if (t?.name !== "locator") throw TypeError("locator.contentFrame: only a locator that ends in locator(selector) can enter its frame; use frameLocator(selector)");
1680
1680
  return [...e.slice(0, -1), {
1681
1681
  ...t,
@@ -1688,7 +1688,7 @@ var ut = class {
1688
1688
  owner: {
1689
1689
  to: "element",
1690
1690
  rewrite: (e) => {
1691
- let t = vn(e);
1691
+ let t = bn(e);
1692
1692
  if (t?.name !== "frameLocator") throw TypeError("frameLocator.owner: this frame was not entered through frameLocator(selector)");
1693
1693
  return [...e.slice(0, -1), {
1694
1694
  ...t,
@@ -1705,7 +1705,7 @@ var ut = class {
1705
1705
  }]
1706
1706
  }
1707
1707
  }
1708
- }, bn = (e) => {
1708
+ }, Sn = (e) => {
1709
1709
  if (!e || e === "about:blank") return !1;
1710
1710
  let t;
1711
1711
  try {
@@ -1713,46 +1713,46 @@ var ut = class {
1713
1713
  } catch {
1714
1714
  return !1;
1715
1715
  }
1716
- return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || t.protocol !== "about:" && Ke(t.hostname);
1717
- }, Z = (e) => {
1718
- if (bn(e)) throw Error("attachFrame: refusing to target the extension's own pages or an FKN platform origin");
1719
- }, xn = ({ src: e, domains: t, lockdown: n }) => {
1716
+ return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || t.protocol !== "about:" && Je(t.hostname);
1717
+ }, Y = (e) => {
1718
+ if (Sn(e)) throw Error("attachFrame: refusing to target the extension's own pages or an FKN platform origin");
1719
+ }, Cn = ({ src: e, domains: t, lockdown: n }) => {
1720
1720
  if (n && !t.length && e && e !== "about:blank") throw Error("attachFrame: lockdown needs domains when the frame already has a src; pass domains or load it via goto");
1721
- }, Sn = {
1721
+ }, wn = {
1722
1722
  scope: "embed.iframe",
1723
1723
  category: "interaction",
1724
1724
  severity: 0,
1725
1725
  title: "Load another website inside this app",
1726
1726
  description: "Lets the app embed external pages directly inside its own view."
1727
- }, Cn = {
1727
+ }, Tn = {
1728
1728
  scope: "embed.open",
1729
1729
  category: "interaction",
1730
1730
  severity: 0,
1731
1731
  title: "Open a website inside this app",
1732
1732
  description: "Lets the app navigate to another site without leaving its window."
1733
- }, wn = ["load", "commit"], Tn = (e) => {
1733
+ }, En = ["load", "commit"], Dn = (e) => {
1734
1734
  if ("timeoutMs" in e) throw TypeError("frame.goto: pass timeout, in milliseconds; timeoutMs is not an option");
1735
1735
  let { waitUntil: t, timeout: n } = e;
1736
- if (t !== void 0 && !wn.includes(t)) throw TypeError(`frame.goto: waitUntil must be 'load' or 'commit', not ${JSON.stringify(t)}`);
1736
+ if (t !== void 0 && !En.includes(t)) throw TypeError(`frame.goto: waitUntil must be 'load' or 'commit', not ${JSON.stringify(t)}`);
1737
1737
  if (n !== void 0 && typeof n != "number") throw TypeError("frame.goto: timeout must be a number of milliseconds");
1738
- on("frame.goto", n);
1739
- }, En = class extends Error {
1738
+ cn("frame.goto", n);
1739
+ }, On = class extends Error {
1740
1740
  name = "FrameWindowBlockedError";
1741
1741
  constructor() {
1742
1742
  super("attachFrame: the browser did not open the window. Call attachFrame directly in a click or key handler, and allow popups for this page");
1743
1743
  }
1744
- }, Dn = /* @__PURE__ */ new Set([
1744
+ }, kn = /* @__PURE__ */ new Set([
1745
1745
  "jar-unreachable",
1746
1746
  "bad-url",
1747
1747
  "opaque-opener"
1748
- ]), On = class extends Error {
1748
+ ]), An = class extends Error {
1749
1749
  name = "FrameWindowRefusedError";
1750
1750
  reason;
1751
1751
  constructor(e) {
1752
- let t = Dn.has(e) ? e : "unknown";
1752
+ let t = kn.has(e) ? e : "unknown";
1753
1753
  super(t === "opaque-opener" ? "attachFrame: this page has an opaque origin, which a window can never answer, so no window was opened" : `attachFrame: the window refused to attach (${t}), and loaded nothing`), this.reason = t;
1754
1754
  }
1755
- }, kn = ["message", "document"], An = (e) => {
1755
+ }, jn = ["message", "document"], Mn = (e) => {
1756
1756
  if (e === "*") return "*";
1757
1757
  let t = () => /* @__PURE__ */ TypeError(`frame.postMessage: targetOrigin must be '*' or an origin, not ${JSON.stringify(e)}`);
1758
1758
  if (typeof e != "string") throw t();
@@ -1764,48 +1764,48 @@ var ut = class {
1764
1764
  }
1765
1765
  if (n === "null") throw t();
1766
1766
  return n;
1767
- }, jn = (e, t) => {
1767
+ }, Nn = (e, t) => {
1768
1768
  let n = typeof e == "object" && !!e;
1769
1769
  if (n && t !== void 0) throw TypeError("frame.postMessage: pass transfer inside the options object, not after it");
1770
1770
  let r = n ? e.targetOrigin ?? "*" : e ?? "*", i = n ? e.transfer : t;
1771
1771
  if (i !== void 0 && !Array.isArray(i)) throw TypeError("frame.postMessage: transfer must be an array");
1772
1772
  return {
1773
- targetOrigin: An(r),
1773
+ targetOrigin: Mn(r),
1774
1774
  transfer: i === void 0 ? [] : [...i]
1775
1775
  };
1776
- }, Mn = [
1776
+ }, Pn = [
1777
1777
  "url",
1778
1778
  "path",
1779
1779
  "type"
1780
- ], Nn = ["content", "sourceUrl"], Pn = /[\n\r\u2028\u2029]/, Fn = (e) => {
1780
+ ], Fn = ["content", "sourceUrl"], In = /[\n\r\u2028\u2029]/, Ln = (e) => {
1781
1781
  if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError("frame.addScriptTag: options must be an object { content }");
1782
- let t = Object.keys(e), n = t.find((e) => Mn.includes(e));
1782
+ let t = Object.keys(e), n = t.find((e) => Pn.includes(e));
1783
1783
  if (n !== void 0) throw TypeError(`frame.addScriptTag: "${n}" is not served; it runs content as a classic inline script`);
1784
- let r = t.find((e) => !Nn.includes(e));
1784
+ let r = t.find((e) => !Fn.includes(e));
1785
1785
  if (r !== void 0) throw TypeError(`frame.addScriptTag: unknown option "${r}"`);
1786
1786
  let { content: i, sourceUrl: a } = e;
1787
1787
  if (typeof i != "string") throw TypeError("frame.addScriptTag: content must be a string");
1788
- if (a !== void 0 && (typeof a != "string" || a === "" || Pn.test(a))) throw TypeError("frame.addScriptTag: sourceUrl must be a non-empty string with no line break");
1788
+ if (a !== void 0 && (typeof a != "string" || a === "" || In.test(a))) throw TypeError("frame.addScriptTag: sourceUrl must be a non-empty string with no line break");
1789
1789
  return a === void 0 ? { content: i } : {
1790
1790
  content: i,
1791
1791
  sourceUrl: a
1792
1792
  };
1793
- }, In = [
1793
+ }, Rn = [
1794
1794
  "name",
1795
1795
  "domain",
1796
1796
  "path"
1797
- ], Ln = (e) => e instanceof RegExp || Object.prototype.toString.call(e) === "[object RegExp]", Rn = (e) => {
1797
+ ], zn = (e) => e instanceof RegExp || Object.prototype.toString.call(e) === "[object RegExp]", Bn = (e) => {
1798
1798
  if (e === void 0) return {};
1799
1799
  if (Object.prototype.toString.call(e) !== "[object Object]") throw TypeError("frame.clearCookies: options must be an object");
1800
- let t = e, n = Object.keys(t).find((e) => !In.includes(e));
1800
+ let t = e, n = Object.keys(t).find((e) => !Rn.includes(e));
1801
1801
  if (n !== void 0) throw TypeError(`frame.clearCookies: unknown option "${n}"`);
1802
- let r = In.flatMap((e) => {
1802
+ let r = Rn.flatMap((e) => {
1803
1803
  let n = t[e];
1804
1804
  return n === void 0 ? [] : [{
1805
1805
  key: e,
1806
1806
  value: n
1807
1807
  }];
1808
- }), i = r.find(({ value: e }) => Ln(e));
1808
+ }), i = r.find(({ value: e }) => zn(e));
1809
1809
  if (i !== void 0) throw TypeError(`frame.clearCookies: ${i.key} is a RegExp, and clearCookies takes strings for name, domain and path for now`);
1810
1810
  let a = r.find(({ value: e }) => typeof e != "string");
1811
1811
  if (a !== void 0) throw TypeError(`frame.clearCookies: ${a.key} must be a string`);
@@ -1814,15 +1814,15 @@ var ut = class {
1814
1814
  let s = {};
1815
1815
  for (let { key: e, value: t } of r) s[e] = { equals: t };
1816
1816
  return s;
1817
- }, zn = (e) => {
1817
+ }, Vn = (e) => {
1818
1818
  typeof globalThis.reportError == "function" ? globalThis.reportError(e) : console.error(e);
1819
- }, Bn = (e) => {
1820
- let { owner: t, ...n } = un({
1819
+ }, Hn = (e) => {
1820
+ let { owner: t, ...n } = fn({
1821
1821
  executor: e.executor,
1822
- modules: _n,
1823
- rewrites: yn,
1822
+ modules: yn,
1823
+ rewrites: xn,
1824
1824
  gate: e.gate
1825
- }), r = async (t, n = {}) => (Z(t), Tn(n), e.goto(t, n)), i = () => e.url(), a = async (t) => {
1825
+ }), r = async (t, n = {}) => (Y(t), Dn(n), e.goto(t, n)), i = () => e.url(), a = async (t) => {
1826
1826
  let n = e.requestPermissions;
1827
1827
  if (!n) throw Error("frame.requestPermissions: this backend cannot ask for permission categories");
1828
1828
  return n(t);
@@ -1833,18 +1833,18 @@ var ut = class {
1833
1833
  if (typeof i != "string") throw TypeError("frame.evaluate: pass a function or a source string");
1834
1834
  return r(i, structuredClone(n));
1835
1835
  }, s = async (t) => {
1836
- let { content: n, ...r } = Fn(t), i = e.addScriptTag;
1836
+ let { content: n, ...r } = Ln(t), i = e.addScriptTag;
1837
1837
  if (!i) throw Error("frame.addScriptTag: this backend cannot run scripts in the attached frame");
1838
1838
  await i(n, r);
1839
1839
  }, c = async (t) => {
1840
- let n = Rn(t), r = e.clearCookies;
1840
+ let n = Bn(t), r = e.clearCookies;
1841
1841
  if (!r) throw Error("frame.clearCookies: this backend cannot clear cookies");
1842
1842
  await r(n);
1843
1843
  }, l = ((t, n, r) => {
1844
1844
  try {
1845
1845
  let i = e.postMessage;
1846
1846
  if (!i) throw Error("frame.postMessage: this backend cannot message the attached frame");
1847
- let a = jn(n, r);
1847
+ let a = Nn(n, r);
1848
1848
  return i(t, a.targetOrigin, a.transfer);
1849
1849
  } catch (e) {
1850
1850
  return Promise.reject(e);
@@ -1853,7 +1853,7 @@ var ut = class {
1853
1853
  message: /* @__PURE__ */ new Set(),
1854
1854
  document: /* @__PURE__ */ new Set()
1855
1855
  }, d = null, f = (e, t) => {
1856
- if (!kn.includes(e)) throw TypeError(`frame.${t}: the event type must be ${kn.map((e) => `'${e}'`).join(" or ")}, not ${JSON.stringify(e)}`);
1856
+ if (!jn.includes(e)) throw TypeError(`frame.${t}: the event type must be ${jn.map((e) => `'${e}'`).join(" or ")}, not ${JSON.stringify(e)}`);
1857
1857
  return u[e];
1858
1858
  }, p = (e) => {
1859
1859
  let t = e.type === "message" ? Object.freeze({
@@ -1869,7 +1869,7 @@ var ut = class {
1869
1869
  for (let n of [...u[e.type]]) try {
1870
1870
  n(t);
1871
1871
  } catch (e) {
1872
- zn(e);
1872
+ Vn(e);
1873
1873
  }
1874
1874
  }, m = (e, t) => {
1875
1875
  if (f(e, "off").delete(t), d !== null && !u.message.size && !u.document.size) {
@@ -1902,7 +1902,7 @@ var ut = class {
1902
1902
  off: m
1903
1903
  };
1904
1904
  return _;
1905
- }, Vn = [
1905
+ }, Un = [
1906
1906
  h,
1907
1907
  t,
1908
1908
  g,
@@ -1916,43 +1916,43 @@ var ut = class {
1916
1916
  l,
1917
1917
  f,
1918
1918
  u,
1919
- Sn,
1920
- Cn,
1919
+ wn,
1920
+ Tn,
1921
1921
  m,
1922
1922
  r,
1923
- qe,
1924
- Je,
1925
1923
  Ye,
1926
- nt,
1927
- it
1928
- ], Hn = hn.map((e) => e.id), Un = {
1924
+ Xe,
1925
+ Ze,
1926
+ it,
1927
+ ot
1928
+ ], Wn = _n.map((e) => e.id), Gn = {
1929
1929
  interaction: "act.click",
1930
1930
  storage: "read.text",
1931
1931
  network: "network.fetchCredentialed",
1932
1932
  evaluation: "media.appearU"
1933
- }, Wn = (e) => e === 0 ? "auto" : e === 4 ? "critical" : "bundled", Gn = Vn, Q = /* @__PURE__ */ new Map(), Kn = {};
1933
+ }, Kn = (e) => e === 0 ? "auto" : e === 4 ? "critical" : "bundled", qn = Un, X = /* @__PURE__ */ new Map(), Jn = {};
1934
1934
  (() => {
1935
- Q = new Map(Gn.map((e) => [e.scope, e])), Kn = Object.fromEntries(Q), Gn.filter((e) => e.severity === 4).map((e) => e.scope);
1936
- let e = (e) => Gn.filter((t) => t.category === e && Wn(t.severity) === "bundled");
1937
- Object.fromEntries(Hn.map((t) => [t, Math.max(0, ...e(t).map((e) => e.severity))])), Object.fromEntries(Hn.map((t) => [t, e(t).some((e) => e.unsafe === !0)]));
1935
+ X = new Map(qn.map((e) => [e.scope, e])), Jn = Object.fromEntries(X), qn.filter((e) => e.severity === 4).map((e) => e.scope);
1936
+ let e = (e) => qn.filter((t) => t.category === e && Kn(t.severity) === "bundled");
1937
+ Object.fromEntries(Wn.map((t) => [t, Math.max(0, ...e(t).map((e) => e.severity))])), Object.fromEntries(Wn.map((t) => [t, e(t).some((e) => e.unsafe === !0)]));
1938
1938
  })();
1939
- var qn = (e) => Q.get(e)?.category, Jn = (e) => {
1940
- let t = Q.get(e);
1941
- return t && Wn(t.severity);
1942
- }, Yn = (e) => {
1943
- let t = Q.get(e);
1944
- if (t) return Wn(t.severity) === "critical" ? t.scope : t.category;
1945
- }, Xn = (e) => Un[e], Zn = ({ category: e, key: t }) => {
1946
- let n = t ?? (e && Xn(e));
1947
- return n !== void 0 && qn(n) !== void 0 ? n : void 0;
1948
- }, Qn = (e, t) => {
1949
- for (let { category: n, key: r } of t) if (Zn({
1939
+ var Yn = (e) => X.get(e)?.category, Xn = (e) => {
1940
+ let t = X.get(e);
1941
+ return t && Kn(t.severity);
1942
+ }, Zn = (e) => {
1943
+ let t = X.get(e);
1944
+ if (t) return Kn(t.severity) === "critical" ? t.scope : t.category;
1945
+ }, Qn = (e) => Gn[e], $n = ({ category: e, key: t }) => {
1946
+ let n = t ?? (e && Qn(e));
1947
+ return n !== void 0 && Yn(n) !== void 0 ? n : void 0;
1948
+ }, er = (e, t) => {
1949
+ for (let { category: n, key: r } of t) if ($n({
1950
1950
  category: n,
1951
1951
  key: r
1952
1952
  }) === void 0) throw TypeError(r === void 0 ? n === void 0 ? `${e}: name a category or a permission key` : `${e}: unknown permission category "${n}"` : `${e}: unknown permission key "${r}"`);
1953
- }, $n = (e, t = {}) => {
1953
+ }, tr = (e, t = {}) => {
1954
1954
  let n = [], r = e.map((e) => {
1955
- let r = Zn(e), i = [];
1955
+ let r = $n(e), i = [];
1956
1956
  if (r !== void 0) for (let a of e.hosts) i.push(n.length), n.push({
1957
1957
  ...t,
1958
1958
  key: r,
@@ -1962,8 +1962,8 @@ var qn = (e) => Q.get(e)?.category, Jn = (e) => {
1962
1962
  reason: e.reason
1963
1963
  });
1964
1964
  return {
1965
- key: r !== void 0 && Jn(r) === "critical" ? r : void 0,
1966
- category: r === void 0 ? e.category ?? "interaction" : Kn[r].category,
1965
+ key: r !== void 0 && Xn(r) === "critical" ? r : void 0,
1966
+ category: r === void 0 ? e.category ?? "interaction" : Jn[r].category,
1967
1967
  hosts: e.hosts,
1968
1968
  indexes: i
1969
1969
  };
@@ -1977,31 +1977,31 @@ var qn = (e) => Q.get(e)?.category, Jn = (e) => {
1977
1977
  allow: i.length > 0 && i.every((t) => e[t]?.allow === !0)
1978
1978
  }))
1979
1979
  };
1980
- }, er = (e) => typeof e == "object" && !!e, tr = typeof chrome < "u" && !!chrome.runtime?.id, nr = (e) => er(e) && e.FKN_WEB_EXTENSION_FRAME_ANNOUNCE_KEY === !0 && typeof e.frameId == "string" && typeof e.document == "string", rr = /* @__PURE__ */ new WeakMap(), ir = /* @__PURE__ */ new WeakMap(), ar = /* @__PURE__ */ new WeakMap(), or = /* @__PURE__ */ new Set();
1981
- typeof window < "u" && tr && window.addEventListener("message", (e) => {
1982
- if (!nr(e.data)) return;
1980
+ }, nr = (e) => typeof e == "object" && !!e, rr = typeof chrome < "u" && !!chrome.runtime?.id, ir = (e) => nr(e) && e.FKN_WEB_EXTENSION_FRAME_ANNOUNCE_KEY === !0 && typeof e.frameId == "string" && typeof e.document == "string", ar = /* @__PURE__ */ new WeakMap(), or = /* @__PURE__ */ new WeakMap(), sr = /* @__PURE__ */ new WeakMap(), cr = /* @__PURE__ */ new Set();
1981
+ typeof window < "u" && rr && window.addEventListener("message", (e) => {
1982
+ if (!ir(e.data)) return;
1983
1983
  e.stopImmediatePropagation();
1984
1984
  let t = e.source;
1985
1985
  if (!t || typeof t != "object") return;
1986
- let n = t, r = rr.get(n), i = e.data.frameId, a = e.data.document;
1987
- if (rr.set(n, i), ir.set(n, a), r) for (let e of or) e(r);
1988
- let o = ar.get(n);
1986
+ let n = t, r = ar.get(n), i = e.data.frameId, a = e.data.document;
1987
+ if (ar.set(n, i), or.set(n, a), r) for (let e of cr) e(r);
1988
+ let o = sr.get(n);
1989
1989
  if (o) {
1990
1990
  for (let e of [...o]) (e.notDocument === void 0 || e.notDocument !== a) && (o.delete(e), e.resolve(i));
1991
- o.size || ar.delete(n);
1991
+ o.size || sr.delete(n);
1992
1992
  }
1993
1993
  }, { capture: !0 });
1994
1994
  //#endregion
1995
1995
  //#region ../web-extension/lib/lib/evaluate-deadline.js
1996
- var sr = 3e4, cr = `frame.evaluate: the code did not settle within ${sr}ms`, lr = () => new V(cr), ur = (e) => H(e) && e.message === cr ? lr() : e, dr = [
1996
+ var lr = 3e4, ur = `frame.evaluate: the code did not settle within ${lr}ms`, dr = () => new V(ur), fr = (e) => H(e) && e.message === ur ? dr() : e, pr = [
1997
1997
  /^frame load timed out after \d+ms for /,
1998
1998
  /^frame goto: documentstart timed out$/,
1999
1999
  /^navigation to .+ did not commit a document within \d+ms$/s
2000
- ], fr = (e) => {
2000
+ ], mr = (e) => {
2001
2001
  if (e instanceof V) return e;
2002
2002
  let t = typeof e?.message == "string" ? e.message : "";
2003
- return dr.some((e) => e.test(t)) ? new V(t) : e;
2004
- }, pr = (e) => {
2003
+ return pr.some((e) => e.test(t)) ? new V(t) : e;
2004
+ }, hr = (e) => {
2005
2005
  let t = e;
2006
2006
  if (t.window === void 0) return "iframe";
2007
2007
  if (t.iframe !== void 0) throw TypeError("attachFrame: pass either iframe or window, not both");
@@ -2009,11 +2009,11 @@ var sr = 3e4, cr = `frame.evaluate: the code did not settle within ${sr}ms`, lr
2009
2009
  if (t.blank !== void 0) throw TypeError("attachFrame: blank does not apply to a window");
2010
2010
  if (typeof t.window != "object" || t.window === null) throw TypeError("attachFrame: window must be an object");
2011
2011
  return "window";
2012
- }, mr = (e, t, n) => {
2012
+ }, gr = (e, t, n) => {
2013
2013
  if (e === void 0) return t;
2014
2014
  if (typeof e != "number" || !Number.isFinite(e) || e <= 0) throw TypeError(`attachFrame: window.${n} must be a positive number of CSS pixels`);
2015
2015
  return Math.round(e);
2016
- }, hr = ({ url: e, width: t, height: n }) => {
2016
+ }, _r = ({ url: e, width: t, height: n }) => {
2017
2017
  let r = (() => {
2018
2018
  if (e === void 0 || e === "" || e === "about:blank") return "";
2019
2019
  if (typeof e != "string") throw TypeError("attachFrame: window.url must be a string");
@@ -2027,98 +2027,184 @@ var sr = 3e4, cr = `frame.evaluate: the code did not settle within ${sr}ms`, lr
2027
2027
  if (t.protocol !== "http:" && t.protocol !== "https:") throw TypeError("attachFrame: window.url must be an http or https address");
2028
2028
  return t.href;
2029
2029
  })();
2030
- return r && Z(r), {
2030
+ return r && Y(r), {
2031
2031
  url: r,
2032
- width: mr(t, 500, "width"),
2033
- height: mr(n, 700, "height")
2032
+ width: gr(t, 500, "width"),
2033
+ height: gr(n, 700, "height")
2034
+ };
2035
+ }, vr = "attachFrame: storageState seeds a fresh jar, so it needs cookies: 'ephemeral'", yr = 1e11, br = [
2036
+ "name",
2037
+ "value",
2038
+ "domain",
2039
+ "path",
2040
+ "expires",
2041
+ "httpOnly",
2042
+ "secure",
2043
+ "sameSite"
2044
+ ], xr = [
2045
+ "Strict",
2046
+ "Lax",
2047
+ "None"
2048
+ ], Sr = /[;\x00-\x1f\x7f]/, Z = (e, t) => /* @__PURE__ */ TypeError(`attachFrame: storageState${e} ${t}`), Q = (e) => Object.prototype.toString.call(e) === "[object Object]", Cr = (e) => {
2049
+ let t = e.startsWith(".") ? e.slice(1) : e;
2050
+ if (t === "") return null;
2051
+ try {
2052
+ return new URL(`http://${t}/`).hostname === t.toLowerCase() ? t.toLowerCase() : null;
2053
+ } catch {
2054
+ return null;
2055
+ }
2056
+ }, wr = (e, t) => {
2057
+ if (!Q(e)) throw Z(t, "must be an object");
2058
+ let n = Object.keys(e).find((e) => !br.includes(e));
2059
+ if (n !== void 0) throw Z(`${t}.${n}`, "is not a cookie field");
2060
+ let { name: r, value: i, domain: a, path: o, expires: s, httpOnly: c, secure: l, sameSite: u } = e;
2061
+ if (typeof r != "string" || r === "" || r.includes("=") || Sr.test(r)) throw Z(`${t}.name`, "must be a non-empty string with no \"=\", \";\" or control character");
2062
+ if (typeof i != "string" || Sr.test(i)) throw Z(`${t}.value`, "must be a string with no \";\" or control character");
2063
+ if (typeof a != "string" || Cr(a) === null) throw Z(`${t}.domain`, "must be a host: \".youtube.com\" for a cookie its subdomains also receive, \"www.youtube.com\" for a host-only one");
2064
+ if (o !== void 0 && (typeof o != "string" || !o.startsWith("/") || Sr.test(o))) throw Z(`${t}.path`, "must be a string starting with \"/\"");
2065
+ if (s !== void 0 && (typeof s != "number" || !Number.isFinite(s) || s <= 0 && s !== -1)) throw Z(`${t}.expires`, "must be -1 for a session cookie, or milliseconds since the epoch");
2066
+ if (c !== void 0 && typeof c != "boolean") throw Z(`${t}.httpOnly`, "must be a boolean");
2067
+ if (l !== void 0 && typeof l != "boolean") throw Z(`${t}.secure`, "must be a boolean");
2068
+ if (u !== void 0 && !xr.includes(u)) throw Z(`${t}.sameSite`, `must be 'Strict', 'Lax' or 'None', not ${JSON.stringify(u)}`);
2069
+ let d = r.toLowerCase();
2070
+ if (u === "None" && l !== !0) throw Z(t, "is SameSite=None, which needs secure: true");
2071
+ if (d.startsWith("__secure-") && l !== !0) throw Z(t, "is a __Secure- cookie, which needs secure: true");
2072
+ if (d.startsWith("__host-") && (l !== !0 || a.startsWith(".") || (o ?? "/") !== "/")) throw Z(t, "is a __Host- cookie, which needs secure: true, a host-only domain and path \"/\"");
2073
+ let f = {
2074
+ name: r,
2075
+ value: i,
2076
+ domain: a
2034
2077
  };
2035
- }, gr = [
2078
+ return o !== void 0 && (f.path = o), s !== void 0 && (f.expires = s), c !== void 0 && (f.httpOnly = c), l !== void 0 && (f.secure = l), u !== void 0 && (f.sameSite = u), f;
2079
+ }, Tr = (e, t) => {
2080
+ if (!Q(e)) throw Z(t, "must be an object { origin, localStorage }");
2081
+ let n = Object.keys(e).find((e) => e !== "origin" && e !== "localStorage");
2082
+ if (n !== void 0) throw Z(`${t}.${n}`, "is not an origin field");
2083
+ let { origin: r, localStorage: i } = e, a = (() => {
2084
+ try {
2085
+ return typeof r == "string" ? new URL(r) : null;
2086
+ } catch {
2087
+ return null;
2088
+ }
2089
+ })();
2090
+ if (a === null || a.protocol !== "http:" && a.protocol !== "https:" || a.origin !== r) throw Z(`${t}.origin`, `must be an absolute http or https origin, not ${JSON.stringify(r)}`);
2091
+ if (!Array.isArray(i)) throw Z(`${t}.localStorage`, "must be an array");
2092
+ return {
2093
+ origin: r,
2094
+ localStorage: i.map((e, n) => {
2095
+ let { name: r, value: i } = Q(e) && Object.keys(e).every((e) => e === "name" || e === "value") ? e : {};
2096
+ if (typeof r != "string" || typeof i != "string") throw Z(`${t}.localStorage[${n}]`, "must be { name, value } strings");
2097
+ return {
2098
+ name: r,
2099
+ value: i
2100
+ };
2101
+ })
2102
+ };
2103
+ }, Er = (e) => {
2104
+ if (!Q(e)) throw Z("", "must be an object { cookies?, origins? }");
2105
+ let t = Object.keys(e).find((e) => e !== "cookies" && e !== "origins");
2106
+ if (t !== void 0) throw Z(`.${t}`, "is not a storageState key; it takes cookies and origins");
2107
+ let { cookies: n = [], origins: r = [] } = e;
2108
+ if (!Array.isArray(n)) throw Z(".cookies", "must be an array");
2109
+ if (!Array.isArray(r)) throw Z(".origins", "must be an array");
2110
+ let i = n.map((e, t) => wr(e, `.cookies[${t}]`)), a = r.map((e, t) => Tr(e, `.origins[${t}]`));
2111
+ return i.forEach(({ expires: e }, t) => {
2112
+ if (e !== void 0 && e > 0 && e < yr) throw Z(`.cookies[${t}].expires`, `is milliseconds since the epoch, and ${e} reads as a date before 1974; a Playwright storageState gives seconds, so multiply it by 1000`);
2113
+ }), {
2114
+ cookies: i,
2115
+ origins: a
2116
+ };
2117
+ }, Dr = [
2036
2118
  "persistent",
2037
2119
  "ephemeral",
2038
2120
  "native"
2039
- ], _r = "attachFrame: syncCookies was replaced by cookies. true is cookies: 'persistent', or 'native' for the person's own browser cookies on the extension; false is cookies: 'ephemeral'", vr = (e) => {
2040
- if ("syncCookies" in e) throw TypeError(_r);
2121
+ ], Or = "attachFrame: syncCookies was replaced by cookies. true is cookies: 'persistent', or 'native' for the person's own browser cookies on the extension; false is cookies: 'ephemeral'", kr = (e) => {
2122
+ if ("syncCookies" in e) throw TypeError(Or);
2041
2123
  let { cookies: t = "persistent" } = e;
2042
- if (!gr.includes(t)) throw TypeError(`attachFrame: cookies must be 'persistent', 'ephemeral' or 'native', not ${JSON.stringify(t)}`);
2043
- if ("storageState" in e) throw TypeError("attachFrame: storageState is not available yet");
2044
- let n = pr(e);
2045
- if (n === "iframe" && e.lockdown && t !== "native") throw TypeError("attachFrame: lockdown runs on the extension, which serves only cookies: 'native'");
2046
- return {
2047
- kind: n,
2124
+ if (!Dr.includes(t)) throw TypeError(`attachFrame: cookies must be 'persistent', 'ephemeral' or 'native', not ${JSON.stringify(t)}`);
2125
+ if (e.storageState !== void 0 && t !== "ephemeral") throw TypeError(vr);
2126
+ let n = e.storageState === void 0 ? void 0 : Er(e.storageState), r = hr(e);
2127
+ if (r === "iframe" && e.lockdown && t !== "native") throw TypeError("attachFrame: lockdown runs on the extension, which serves only cookies: 'native'");
2128
+ return n === void 0 ? {
2129
+ kind: r,
2048
2130
  cookies: t
2131
+ } : {
2132
+ kind: r,
2133
+ cookies: t,
2134
+ storageState: n
2049
2135
  };
2050
- }, yr = (e) => {
2136
+ }, Ar = (e) => {
2051
2137
  try {
2052
2138
  return new URL(e).hostname;
2053
2139
  } catch {
2054
2140
  return "";
2055
2141
  }
2056
- }, br = "FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY", xr = !1, Sr = () => {
2057
- xr || (xr = !0, console.warn("[fkn-frame] the installed FKN WebExtension is too old to ask for permission categories upfront, so each capability will be asked for as it is first used. Updating the extension fixes this."));
2058
- }, Cr = "frame: this frame no longer holds the document the app attached it to", wr = "frame.postMessage: '*' is not served on the extension yet, since this extension does not report the frame's origin; pass the page's origin as targetOrigin", Tr = () => {
2059
- let e = D();
2142
+ }, jr = "FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY", Mr = !1, Nr = () => {
2143
+ Mr || (Mr = !0, console.warn("[fkn-frame] the installed FKN WebExtension is too old to ask for permission categories upfront, so each capability will be asked for as it is first used. Updating the extension fixes this."));
2144
+ }, Pr = "frame: this frame no longer holds the document the app attached it to", Fr = "frame.postMessage: '*' is not served on the extension yet, since this extension does not report the frame's origin; pass the page's origin as targetOrigin", Ir = () => {
2145
+ let e = E();
2060
2146
  if (e.status === "ok" && e.abi >= 1) return;
2061
2147
  let t = e.status === "absent" ? 0 : e.abi;
2062
- throw new E("lockdown", t, `attachFrame: the installed FKN WebExtension (ABI ${t}) may predate lockdown, and one that does attaches the frame with its CSP removed rather than locked down. Updating the extension fixes this.`);
2063
- }, Er = (e) => {
2148
+ throw new T("lockdown", t, `attachFrame: the installed FKN WebExtension (ABI ${t}) may predate lockdown, and one that does attaches the frame with its CSP removed rather than locked down. Updating the extension fixes this.`);
2149
+ }, Lr = (e) => {
2064
2150
  try {
2065
2151
  return new URL(e, location.href).hostname;
2066
2152
  } catch {
2067
2153
  return "";
2068
2154
  }
2069
2155
  }, $ = () => {
2070
- let e = D();
2156
+ let e = E();
2071
2157
  return e.status === "absent" ? 0 : e.abi;
2072
- }, Dr = "attachFrame: a blank page is served by the cloud render proxy only; call cloud.attachFrame", Or = "frame.addScriptTag: an extension frame does not run scripts through mirage yet; attach with cloud.attachFrame", kr = "frame.clearCookies: an extension frame runs on the browser's own cookies (cookies: 'native'), which FKN does not clear; attach with cookies: 'persistent' to clear the app's jar", Ar = async ({ iframe: e, domains: t = [], lockdown: n = !1, permissions: r, blank: i }) => {
2073
- if (i !== void 0) throw new E("blank", $(), Dr);
2158
+ }, Rr = "attachFrame: a blank page is served by the cloud render proxy only; call cloud.attachFrame", zr = "frame.addScriptTag: an extension frame does not run scripts through mirage yet; attach with cloud.attachFrame", Br = "frame.clearCookies: an extension frame runs on the browser's own cookies (cookies: 'native'), which FKN does not clear; attach with cookies: 'persistent' to clear the app's jar", Vr = async ({ iframe: e, domains: t = [], lockdown: n = !1, permissions: r, blank: i }) => {
2159
+ if (i !== void 0) throw new T("blank", $(), Rr);
2074
2160
  let a = crypto.randomUUID();
2075
- if (Z(e.src), xn({
2161
+ if (Y(e.src), Cn({
2076
2162
  src: e.src,
2077
2163
  domains: t,
2078
2164
  lockdown: n
2079
- }), await k(), n && Tr(), !e.isConnected) throw Error("attachFrame: the iframe must be connected to the document before attaching");
2080
- e.dispatchEvent(new CustomEvent(br, { detail: a }));
2081
- let { executeLocator: o, highlightLocator: s, ensureLocatorPermission: c, requestCategories: l, evaluateFrame: u, goto: d } = await A.attachFrame({
2165
+ }), await D(), n && Ir(), !e.isConnected) throw Error("attachFrame: the iframe must be connected to the document before attaching");
2166
+ e.dispatchEvent(new CustomEvent(jr, { detail: a }));
2167
+ let { executeLocator: o, highlightLocator: s, ensureLocatorPermission: c, requestCategories: l, evaluateFrame: u, goto: d } = await O.attachFrame({
2082
2168
  marker: a,
2083
2169
  domains: t,
2084
2170
  syncCookies: !0,
2085
2171
  lockdown: n
2086
- }), f = new Set(p([...t, Er(e.src)], { ipv6: !0 })), m = (e) => f.has(p([yr(e)], { ipv6: !0 })[0] ?? ""), h = Bn({
2172
+ }), f = new Set(p([...t, Lr(e.src)], { ipv6: !0 })), m = (e) => f.has(p([Ar(e)], { ipv6: !0 })[0] ?? ""), h = Hn({
2087
2173
  backend: "extension",
2088
2174
  executor: {
2089
2175
  execute: o,
2090
2176
  highlight: s
2091
2177
  },
2092
2178
  gate: (e) => c(e.parts, e.operation, e.args),
2093
- requestPermissions: async (e) => (Qn("frame.requestPermissions", e), await fn(), l(e)),
2179
+ requestPermissions: async (e) => (er("frame.requestPermissions", e), await mn(), l(e)),
2094
2180
  evaluate: async (e, t) => {
2095
- if (!je(D(), "evaluate")) {
2096
- let e = D();
2097
- throw new E("evaluate", e.status === "ok" ? e.abi : 0);
2181
+ if (!Me(E(), "evaluate")) {
2182
+ let e = E();
2183
+ throw new T("evaluate", e.status === "ok" ? e.abi : 0);
2098
2184
  }
2099
2185
  return u({
2100
2186
  source: e,
2101
2187
  arg: t
2102
2188
  }).catch((e) => {
2103
- throw ur(e);
2189
+ throw fr(e);
2104
2190
  });
2105
2191
  },
2106
2192
  addScriptTag: async () => {
2107
- throw new E("addScriptTag", $(), Or);
2193
+ throw new T("addScriptTag", $(), zr);
2108
2194
  },
2109
2195
  clearCookies: async () => {
2110
- throw new E("clearCookies", $(), kr);
2196
+ throw new T("clearCookies", $(), Br);
2111
2197
  },
2112
2198
  postMessage: (t, n, r) => {
2113
- if (n === "*") throw _t(wr, "postMessage", "extension");
2114
- if (!m(n)) throw B(Cr, "postMessage");
2199
+ if (n === "*") throw z(Fr, "postMessage", "extension");
2200
+ if (!m(n)) throw B(Pr, "postMessage");
2115
2201
  let i = e.contentWindow;
2116
2202
  if (i === null) throw B("frame: navigate the frame before postMessage", "postMessage");
2117
2203
  return i.postMessage(t, n, r), Promise.resolve();
2118
2204
  },
2119
2205
  listen: (t) => {
2120
2206
  let n = (n) => {
2121
- n.source !== null && n.source === e.contentWindow && !nr(n.data) && m(n.origin) && t({
2207
+ n.source !== null && n.source === e.contentWindow && !ir(n.data) && m(n.origin) && t({
2122
2208
  type: "message",
2123
2209
  data: n.data,
2124
2210
  origin: n.origin,
@@ -2133,26 +2219,26 @@ var sr = 3e4, cr = `frame.evaluate: the code did not settle within ${sr}ms`, lr
2133
2219
  };
2134
2220
  },
2135
2221
  goto: (e, { waitUntil: t, timeout: n, ...r } = {}) => {
2136
- for (let t of p([Er(e)], { ipv6: !0 })) f.add(t);
2222
+ for (let t of p([Lr(e)], { ipv6: !0 })) f.add(t);
2137
2223
  return d({
2138
2224
  url: e,
2139
2225
  ...r,
2140
2226
  ...t === void 0 ? {} : { waitUntil: t === "commit" ? "documentstart" : t },
2141
2227
  ...n === void 0 ? {} : { timeoutMs: n }
2142
2228
  }).catch((e) => {
2143
- throw fr(e);
2229
+ throw mr(e);
2144
2230
  });
2145
2231
  },
2146
2232
  url: () => e.src
2147
2233
  });
2148
- return r?.length && (dn() ? await h.requestPermissions(r) : Sr()), h;
2149
- }, jr = "attachFrame: a window on cookies: 'native' is not served yet; a window runs on the cloud render proxy, which has no browser cookies", Mr = (e) => `attachFrame: cookies: '${e}' runs on the cloud render proxy; call cloud.attachFrame or the top-level attachFrame`, Nr = async (e) => {
2150
- throw hr(e.window), new E("attachWindow", $(), jr);
2151
- }, Pr = (async (e) => {
2152
- let { kind: t, cookies: n } = vr(e);
2153
- if (n !== "native") throw new E("cookies", $(), Mr(n));
2154
- return t === "window" ? Nr(e) : Ar(e);
2155
- }), Fr = "permissions.request: pass hosts, the sites the grant applies to", Ir = { request: async (e) => {
2234
+ return r?.length && (pn() ? await h.requestPermissions(r) : Nr()), h;
2235
+ }, Hr = "attachFrame: a window on cookies: 'native' is not served yet; a window runs on the cloud render proxy, which has no browser cookies", Ur = (e) => `attachFrame: cookies: '${e}' runs on the cloud render proxy; call cloud.attachFrame or the top-level attachFrame`, Wr = async (e) => {
2236
+ throw _r(e.window), new T("attachWindow", $(), Hr);
2237
+ }, Gr = (async (e) => {
2238
+ let { kind: t, cookies: n } = kr(e);
2239
+ if (n !== "native") throw new T("cookies", $(), Ur(n));
2240
+ return t === "window" ? Wr(e) : Vr(e);
2241
+ }), Kr = "permissions.request: pass hosts, the sites the grant applies to", qr = { request: async (e) => {
2156
2242
  let t = e.map((e) => {
2157
2243
  let { category: t, key: n, scope: r, reason: i, hosts: a } = e;
2158
2244
  if (!("hosts" in e) && !("category" in e)) return { legacy: {
@@ -2161,7 +2247,7 @@ var sr = 3e4, cr = `frame.evaluate: the code did not settle within ${sr}ms`, lr
2161
2247
  reason: i
2162
2248
  } };
2163
2249
  let o = p(a ?? [], { ipv6: !0 });
2164
- if (!o.length) throw TypeError(Fr);
2250
+ if (!o.length) throw TypeError(Kr);
2165
2251
  return { ask: {
2166
2252
  category: t,
2167
2253
  key: n,
@@ -2169,9 +2255,9 @@ var sr = 3e4, cr = `frame.evaluate: the code did not settle within ${sr}ms`, lr
2169
2255
  hosts: o
2170
2256
  } };
2171
2257
  }), n = t.flatMap((e) => "ask" in e ? [e.ask] : []);
2172
- Qn("permissions.request", n), n.length && await fn();
2173
- let { items: r, answer: i } = $n(n), a = t.flatMap((e) => "legacy" in e ? [e.legacy] : []), o = [...r, ...a], s = o.length ? await A.requestPermissions(o) : [], c = i(s.slice(0, r.length)), l = s.slice(r.length), u = 0, d = 0;
2258
+ er("permissions.request", n), n.length && await mn();
2259
+ let { items: r, answer: i } = tr(n), a = t.flatMap((e) => "legacy" in e ? [e.legacy] : []), o = [...r, ...a], s = o.length ? await O.requestPermissions(o) : [], c = i(s.slice(0, r.length)), l = s.slice(r.length), u = 0, d = 0;
2174
2260
  return t.map((e) => "ask" in e ? c[u++] : l[d++]);
2175
- } }, Lr = "PermissionDeniedError", Rr = (e) => e instanceof Error ? e.name === Lr : er(e) && e.name === "PermissionDeniedError";
2261
+ } }, Jr = "PermissionDeniedError", Yr = (e) => e instanceof Error ? e.name === Jr : nr(e) && e.name === "PermissionDeniedError";
2176
2262
  //#endregion
2177
- export { Fe as $, H as A, nt as B, hn as C, B as D, bt as E, R as F, qe as G, tt as H, it as I, ze as J, Qe as K, ot as L, St as M, ht as N, L as O, xt as P, Pe as Q, at as R, bn as S, I as T, Je as U, $e as V, Ye as W, He as X, Ue as Y, Ve as Z, Sn as _, Pr as a, T as at, Z as b, fr as c, be as ct, Qn as d, _e as dt, D as et, qn as f, ye as ft, On as g, En as h, br as i, E as it, _t as j, vt as k, sr as l, ve as lt, Jn as m, Rr as n, k as nt, vr as o, Se as ot, Yn as p, C as pt, Ze as q, Ir as r, xe as rt, hr as s, Ae as st, Lr as t, Ie as tt, lr as u, w as ut, Bn as v, V as w, xn as x, Cn as y, rt as z };
2263
+ export { Fe as $, vt as A, at as B, Sn as C, bt as D, P as E, xt as F, Ze as G, tt as H, I, $e as J, Ye as K, ot as L, z as M, St as N, B as O, _t as P, Ue as Q, ct as R, Cn as S, V as T, rt as U, it as V, Xe as W, Ge as X, Ve as Y, We as Z, An as _, Gr as a, T as at, Tn as b, mr as c, je as ct, nr as d, C as dt, Ie as et, er as f, ve as ft, On as g, Xn as h, jr as i, Se as it, H as j, F as k, lr as l, xe as lt, Zn as m, x as mt, Yr as n, Re as nt, kr as o, w as ot, Yn as p, be as pt, et as q, qr as r, D as rt, _r as s, Ce as st, Jr as t, E as tt, dr as u, ye as ut, wn as v, _n as w, Y as x, Hn as y, st as z };