@fkn/lib 0.9.34 → 0.9.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/account.cjs +1 -1
- package/account.d.ts +6 -6
- package/account.js +3 -3
- package/{api-Bgsg9t9D.d.ts → api-CaFuvyyV.d.ts} +1 -1
- package/{api-BdTgLphT.js → api-CtiKFcK3.js} +2 -2
- package/{api-MW-Lm0u8.cjs → api-Djf-XdZ4.cjs} +2 -2
- package/api.cjs +1 -1
- package/api.d.ts +2 -2
- package/api.js +1 -1
- package/attach-policy.cjs +1 -1
- package/attach-policy.d.ts +5 -5
- package/attach-policy.js +1 -1
- package/cloud/dns.d.ts +1 -1
- package/cloud/fetch.cjs +1 -1
- package/cloud/fetch.d.ts +1 -1
- package/cloud/fetch.js +1 -1
- package/cloud/fs/promises.d.ts +3 -4
- package/cloud/fs.cjs +1 -1
- package/cloud/fs.d.ts +2 -2
- package/cloud/fs.js +2 -2
- package/cloud/net.d.ts +1 -1
- package/cloud-CDRoRstb.js +428 -0
- package/{cloud-C40YCPuv.d.ts → cloud-Cqdq7Ujd.d.ts} +9 -5
- package/cloud-DG_-Rt-L.cjs +1 -0
- package/cloud.cjs +1 -1
- package/cloud.d.ts +4 -4
- package/cloud.js +2 -2
- package/{contract-Gd543I6m.d.ts → contract-BIHGp6cz.d.ts} +127 -2
- package/contract.cjs +1 -0
- package/contract.d.ts +2 -2
- package/contract.js +28 -0
- package/desktop.d.ts +7 -7
- package/dgram.cjs +1 -1
- package/dgram.d.ts +5 -5
- package/dgram.js +1 -1
- package/dns.cjs +1 -1
- package/dns.d.ts +3 -3
- package/dns.js +1 -1
- package/{extension-Bm-PwsD6.d.ts → extension-C9BRlqEY.d.ts} +17 -14
- package/extension-DisWHU7m.cjs +1 -0
- package/extension-jDvl0U_P.js +89 -0
- package/extension.cjs +1 -1
- package/extension.d.ts +3 -3
- package/extension.js +3 -3
- package/fs/promises.cjs +1 -1
- package/fs/promises.d.ts +3 -3
- package/fs/promises.js +1 -1
- package/{fs-CYcErwc4.d.ts → fs--NhtUyYa.d.ts} +1 -1
- package/{fs-O2bp9J0x.js → fs-BvNZePtN.js} +4 -4
- package/{fs-Bv3aFjqA.cjs → fs-D8RCGFNc.cjs} +1 -1
- package/fs.cjs +1 -1
- package/fs.d.ts +2 -2
- package/fs.js +1 -1
- package/{hosts-C4-8lWwz.js → hosts-77UAJbm1.js} +28 -18
- package/hosts-COiOMjp-.cjs +1 -0
- package/http.d.ts +20 -20
- package/{index-DIK21kfh.d.ts → index-BWJSnpRB.d.ts} +166 -10
- package/{index-Cg6y_FTi.d.ts → index-kuPqkS_-.d.ts} +26 -3
- package/index.cjs +1 -1
- package/index.d.ts +29 -11
- package/index.js +51 -45
- package/lib-DCPdYk-N.cjs +53 -0
- package/{lib-C3f3XmGZ.js → lib-hd9k5xOX.js} +436 -362
- package/{net-BBtYFEzu.d.ts → net-BWFTx3k_.d.ts} +2 -2
- package/net.cjs +1 -1
- package/net.d.ts +1 -1
- package/net.js +1 -1
- package/node-fs-BNTPsX5c.cjs +1 -0
- package/{node-fs-C9ECR_9H.js → node-fs-BZy9bzKd.js} +2 -2
- package/opfs/promises.d.ts +2 -2
- package/opfs.cjs +1 -1
- package/opfs.d.ts +2 -2
- package/opfs.js +1 -1
- package/package.json +1 -1
- package/packages.cjs +1 -1
- package/packages.d.ts +27 -27
- package/packages.js +1 -1
- package/{proxy-_m6Sqcr6.cjs → proxy-CYcaW5ew.cjs} +1 -1
- package/{proxy-fXckOcRn.js → proxy-DDwY3AVG.js} +1 -1
- package/{proxy-XeHtHIdZ.d.ts → proxy-DaljzPSa.d.ts} +2 -2
- package/react.d.ts +3 -3
- package/rooms.cjs +1 -1
- package/rooms.d.ts +8 -8
- package/rooms.js +1 -1
- package/{storage-C6Cd4J5E.js → storage-BbcnDCnc.js} +1 -1
- package/{storage-WZEvw3KN.d.ts → storage-ZrY4Y4L5.d.ts} +21 -2
- package/{storage-D2eBifiu.cjs → storage-dSi2dUKx.cjs} +1 -1
- package/cloud-DBNeXS9R.js +0 -272
- package/cloud-DHuqVKrl.cjs +0 -1
- package/extension-DALH11b4.js +0 -87
- package/extension-lR-cSs2P.cjs +0 -1
- package/hosts-DD4rDeQH.cjs +0 -1
- package/lib-WiHTYaNP.cjs +0 -53
- package/node-fs-DZPGCYWg.cjs +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { _ as t, a as n, d as r,
|
|
3
|
-
import { BoxBase as
|
|
2
|
+
import { _ as t, a as n, d as r, f as i, g as a, h as o, i as s, m as c, n as l, o as u, r as d, s as f, t as p, u as m, v as ee } from "./hosts-77UAJbm1.js";
|
|
3
|
+
import { BoxBase as h, createTypedEventTarget as te, expose as g, recursiveBox as _, recursiveRevive as ne } from "osra";
|
|
4
4
|
//#region ../web-extension/lib/lib/revivables/event-proxy.js
|
|
5
|
-
var
|
|
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,7 +31,7 @@ var ne = (e, t) => {
|
|
|
31
31
|
o && (e.removeEventListener(t, o), r.delete(t));
|
|
32
32
|
}
|
|
33
33
|
}), n;
|
|
34
|
-
}, v = (e) => typeof e == "boolean" ? +!!e : +!!e?.capture,
|
|
34
|
+
}, v = (e) => typeof e == "boolean" ? +!!e : +!!e?.capture, ie = (e) => {
|
|
35
35
|
let t = /* @__PURE__ */ new WeakMap();
|
|
36
36
|
return {
|
|
37
37
|
addEventListener: (n, r, i) => {
|
|
@@ -52,13 +52,13 @@ var ne = (e, t) => {
|
|
|
52
52
|
},
|
|
53
53
|
dispatchEvent: (t) => e.remoteEvents.dispatchEvent(t)
|
|
54
54
|
};
|
|
55
|
-
},
|
|
56
|
-
box: () =>
|
|
55
|
+
}, y = /* @__PURE__ */ e({
|
|
56
|
+
box: () => ve,
|
|
57
57
|
createVideoElementHandle: () => C,
|
|
58
|
-
isType: () =>
|
|
59
|
-
revive: () =>
|
|
60
|
-
type: () =>
|
|
61
|
-
}),
|
|
58
|
+
isType: () => _e,
|
|
59
|
+
revive: () => ye,
|
|
60
|
+
type: () => b
|
|
61
|
+
}), b = "videoElement", x = [
|
|
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
|
-
],
|
|
72
|
+
], ae = [
|
|
73
73
|
"duration",
|
|
74
74
|
"paused",
|
|
75
75
|
"ended",
|
|
76
76
|
"seeking",
|
|
77
77
|
"readyState",
|
|
78
78
|
"currentSrc"
|
|
79
|
-
],
|
|
79
|
+
], oe = ["buffered", "seekable"], se = Symbol.for("fkn.remoteVideoElement"), ce = Symbol.for("fkn.remoteVideoElement.state"), le = Symbol.for("fkn.remoteVideoElement.controller"), ue = (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 [...
|
|
82
|
-
for (let n of
|
|
81
|
+
for (let n of [...x, ...ae]) t[n] = e[n];
|
|
82
|
+
for (let n of oe) t[n] = ue(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
|
-
},
|
|
87
|
+
}, de = (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
|
-
},
|
|
102
|
+
}, fe = (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,
|
|
109
|
+
} : null, pe = (e) => re(e, (e, t) => ({
|
|
110
110
|
originalDetail: e instanceof CustomEvent ? e.detail : null,
|
|
111
111
|
snapshot: S(t)
|
|
112
|
-
})),
|
|
112
|
+
})), me = 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
|
-
},
|
|
128
|
-
call: async (t) =>
|
|
127
|
+
}, he = (e) => ({
|
|
128
|
+
call: async (t) => me(e, t),
|
|
129
129
|
set: async (t, n) => {
|
|
130
130
|
try {
|
|
131
131
|
e[t] = n;
|
|
132
132
|
} catch {}
|
|
133
133
|
return S(e);
|
|
134
134
|
},
|
|
135
|
-
events:
|
|
136
|
-
}),
|
|
135
|
+
events: pe(e)
|
|
136
|
+
}), ge = (e, t) => {
|
|
137
137
|
let n = new EventTarget();
|
|
138
|
-
Object.defineProperty(n,
|
|
139
|
-
let r =
|
|
138
|
+
Object.defineProperty(n, se, { value: !0 }), Object.defineProperty(n, ce, { value: e }), Object.defineProperty(n, le, { value: t });
|
|
139
|
+
let r = ie({
|
|
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
|
|
174
|
+
return fe(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
|
|
210
|
+
for (let n of x) 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
|
|
222
|
+
for (let t of ae) 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
|
|
229
|
+
for (let t of oe) i[t] = {
|
|
230
230
|
configurable: !0,
|
|
231
231
|
enumerable: !0,
|
|
232
232
|
get() {
|
|
233
|
-
return
|
|
233
|
+
return de(e[t]);
|
|
234
234
|
}
|
|
235
235
|
};
|
|
236
236
|
return Object.defineProperties(n, i), n;
|
|
237
|
-
}, C = (e) =>
|
|
237
|
+
}, C = (e) => ge(S(e), he(e)), _e = (e) => typeof e == "object" && !!e && e[se] === !0, ve = (e, t) => {
|
|
238
238
|
let n = e;
|
|
239
239
|
return {
|
|
240
|
-
...
|
|
241
|
-
type:
|
|
242
|
-
initialState: n[
|
|
243
|
-
controller:
|
|
240
|
+
...h,
|
|
241
|
+
type: b,
|
|
242
|
+
initialState: n[ce],
|
|
243
|
+
controller: _(n[le], t)
|
|
244
244
|
};
|
|
245
|
-
},
|
|
246
|
-
let n =
|
|
247
|
-
return
|
|
248
|
-
},
|
|
245
|
+
}, ye = (e, t) => {
|
|
246
|
+
let n = ne(e.controller, t);
|
|
247
|
+
return ge({ ...e.initialState }, n);
|
|
248
|
+
}, be = (e) => [y, ...e], xe = 3, Se = 0, Ce = "fknExtension", we = "fknExtensionAbi", Te = "fknExtensionOps", Ee = [
|
|
249
249
|
"data-fkn-extension",
|
|
250
250
|
"data-fkn-extension-abi",
|
|
251
251
|
"data-fkn-extension-ops"
|
|
252
|
-
],
|
|
252
|
+
], De = (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
|
-
},
|
|
256
|
+
}, Oe = (e) => e === void 0 ? null : e.split(",").map((e) => e.trim()).filter(Boolean), ke = (e, t = 0) => {
|
|
257
257
|
if (e.fknExtension !== "true") return { status: "absent" };
|
|
258
|
-
let n =
|
|
258
|
+
let n = De(e[we]), r = Oe(e[Te]);
|
|
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
|
-
},
|
|
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), 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
|
-
},
|
|
276
|
+
}, T = class extends Error {
|
|
277
277
|
operation;
|
|
278
278
|
abi;
|
|
279
279
|
name = "ExtensionOperationUnsupportedError";
|
|
280
|
-
constructor(e, t) {
|
|
281
|
-
super(`The FKN WebExtension does not support "${e}" (ABI ${t}). Updating the extension may add it.`), this.operation = e, this.abi = t;
|
|
280
|
+
constructor(e, t, n) {
|
|
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
|
-
},
|
|
284
|
-
typeof document < "u" && document.addEventListener(
|
|
285
|
-
|
|
283
|
+
}, Me = "FKN_WEB_EXTENSION_MAIN_WORLD_CONTENT_SCRIPT_ENABLED_EVENT_KEY", Ne = Ce, Pe = te();
|
|
284
|
+
typeof document < "u" && document.addEventListener(Me, () => {
|
|
285
|
+
Pe.dispatchEvent(new CustomEvent("statuschange", { detail: { enabled: Fe() } }));
|
|
286
286
|
});
|
|
287
|
-
var
|
|
288
|
-
|
|
289
|
-
},
|
|
290
|
-
let r = () =>
|
|
287
|
+
var Fe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Ne] === "true", E = () => typeof document > "u" ? { status: "absent" } : ke(document.documentElement.dataset), D = null, Ie = (e) => {
|
|
288
|
+
D = e;
|
|
289
|
+
}, Le = 150, O = (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 =
|
|
295
|
+
let e = E();
|
|
296
296
|
if (e.status === "outdated") return n(new w(e.abi, e.required));
|
|
297
|
-
if (
|
|
298
|
-
if (await
|
|
299
|
-
let e =
|
|
297
|
+
if (D) {
|
|
298
|
+
if (await D().catch(() => {}), r()) return t();
|
|
299
|
+
let e = E();
|
|
300
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(),
|
|
304
|
+
clearTimeout(i), i = setTimeout(() => r() ? a(t) : o(), Le);
|
|
305
305
|
}, c = new MutationObserver(() => {
|
|
306
306
|
r() && a(t);
|
|
307
307
|
}), l = () => {
|
|
@@ -309,39 +309,39 @@ var Pe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Me]
|
|
|
309
309
|
};
|
|
310
310
|
if (i = setTimeout(o, e), c.observe(document.documentElement, {
|
|
311
311
|
attributes: !0,
|
|
312
|
-
attributeFilter: [...
|
|
312
|
+
attributeFilter: [...Ee]
|
|
313
313
|
}), document.addEventListener("readystatechange", l), document.readyState === "complete") return s();
|
|
314
314
|
r() && a(t);
|
|
315
|
-
}),
|
|
316
|
-
await
|
|
315
|
+
}), Re, k = new Proxy({}, { get: (e, t) => async (...e) => {
|
|
316
|
+
await O(), Re ??= g({}, {
|
|
317
317
|
transport: window,
|
|
318
|
-
revivableModules:
|
|
318
|
+
revivableModules: be
|
|
319
319
|
});
|
|
320
|
-
let n = (await
|
|
320
|
+
let n = (await Re)[t];
|
|
321
321
|
return n(...e);
|
|
322
|
-
} }),
|
|
322
|
+
} }), A = [
|
|
323
323
|
"origin",
|
|
324
324
|
"referer",
|
|
325
325
|
"cookie"
|
|
326
|
-
],
|
|
327
|
-
if (t === "include" &&
|
|
328
|
-
},
|
|
329
|
-
let t = [...new Set((e ?? []).map(([e]) => e.trim().toLowerCase()).filter((e) => !
|
|
326
|
+
], ze = (e, t) => (e ?? []).some(([e, n]) => e.trim().toLowerCase() === t && n !== ""), Be = (e) => ze(e, "cookie"), Ve = (e, t) => {
|
|
327
|
+
if (t === "include" && Be(e)) throw Error("fetch: a forged Cookie header and credentials:'include' are different identities - send one or the other");
|
|
328
|
+
}, He = (e) => {
|
|
329
|
+
let t = [...new Set((e ?? []).map(([e]) => e.trim().toLowerCase()).filter((e) => !A.includes(e)))];
|
|
330
330
|
if (t.length) throw Error(`fetch: refusing to forge request header(s): ${t.join(", ")}`);
|
|
331
|
-
},
|
|
331
|
+
}, Ue = [
|
|
332
332
|
"fkn.app",
|
|
333
333
|
"fkn.dev",
|
|
334
334
|
"sdbx.app"
|
|
335
|
-
],
|
|
336
|
-
let t =
|
|
337
|
-
return
|
|
338
|
-
},
|
|
335
|
+
], We = (e) => e.replace(/\.+$/, ""), Ge = (e) => {
|
|
336
|
+
let t = We(e);
|
|
337
|
+
return Ue.some((e) => t === e || t.endsWith(`.${e}`));
|
|
338
|
+
}, Ke = {
|
|
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
|
-
},
|
|
344
|
+
}, qe = {
|
|
345
345
|
scope: "network.fetchCredentialed",
|
|
346
346
|
category: "network",
|
|
347
347
|
severity: 3,
|
|
@@ -349,7 +349,7 @@ var Pe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Me]
|
|
|
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
|
-
},
|
|
352
|
+
}, Je = {
|
|
353
353
|
scope: "network.fetchLocal",
|
|
354
354
|
category: "network",
|
|
355
355
|
severity: 3,
|
|
@@ -357,12 +357,12 @@ var Pe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Me]
|
|
|
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
|
-
},
|
|
360
|
+
}, Ye = (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
|
-
},
|
|
365
|
+
}, Xe = (e) => {
|
|
366
366
|
let t;
|
|
367
367
|
try {
|
|
368
368
|
t = new URL(e);
|
|
@@ -370,40 +370,40 @@ var Pe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Me]
|
|
|
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:") :
|
|
374
|
-
},
|
|
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:") : Ye(n);
|
|
374
|
+
}, Ze = (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:" ||
|
|
382
|
-
},
|
|
383
|
-
if (
|
|
384
|
-
},
|
|
381
|
+
return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || Ge(t.hostname);
|
|
382
|
+
}, Qe = (e) => {
|
|
383
|
+
if (Ze(e)) throw Error("fetch: refusing to target the extension's own pages or FKN platform domains");
|
|
384
|
+
}, $e = (e) => {
|
|
385
385
|
if (!e?.headers) return;
|
|
386
|
-
let t = new Headers(e.headers), n =
|
|
386
|
+
let t = new Headers(e.headers), n = A.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
|
-
},
|
|
391
|
+
}, et = async (e, t) => {
|
|
392
392
|
let n = new Request(e, t);
|
|
393
|
-
|
|
393
|
+
Qe(n.url);
|
|
394
394
|
let r = n.body ? await n.arrayBuffer() : null;
|
|
395
|
-
return
|
|
395
|
+
return k.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:
|
|
402
|
+
unsafeHeaders: $e(t),
|
|
403
403
|
reason: t?.reason,
|
|
404
404
|
signal: t?.signal ?? void 0
|
|
405
405
|
});
|
|
406
|
-
},
|
|
406
|
+
}, tt = {
|
|
407
407
|
scope: "network.readCookie",
|
|
408
408
|
category: "network",
|
|
409
409
|
severity: 3,
|
|
@@ -411,7 +411,7 @@ var Pe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Me]
|
|
|
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
|
-
},
|
|
414
|
+
}, nt = { get: (e) => k.getCookie(e) }, rt = {
|
|
415
415
|
scope: "network.modifyRequestHeaders",
|
|
416
416
|
category: "network",
|
|
417
417
|
severity: 2,
|
|
@@ -419,31 +419,31 @@ var Pe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Me]
|
|
|
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
|
-
},
|
|
423
|
-
let e =
|
|
422
|
+
}, it = (e) => k.setRequestHeaderRule(e), at = (e) => k.removeRequestHeaderRule({ ruleId: e }), ot = () => {
|
|
423
|
+
let e = E();
|
|
424
424
|
return e.status === "ok" && e.abi >= 2;
|
|
425
|
-
},
|
|
426
|
-
await
|
|
427
|
-
let e =
|
|
425
|
+
}, st = async () => {
|
|
426
|
+
await O();
|
|
427
|
+
let e = E();
|
|
428
428
|
if (e.status === "ok" && e.abi < 2) throw new w(e.abi, 2);
|
|
429
|
-
},
|
|
429
|
+
}, ct = (e) => `Read the text, links and details ${e} shows.`, lt = (e) => `Inject unfiltered styles or code into ${e}. This can pass page details along to other sites.`, ut = [
|
|
430
430
|
{
|
|
431
431
|
id: "interaction",
|
|
432
432
|
heading: "Interaction",
|
|
433
433
|
summary: "Allow the app to interact with the website (clicks, type in text, etc.)",
|
|
434
434
|
title: (e) => `Interact with ${e}`,
|
|
435
435
|
description: (e, t) => t ? `Click, type and hover on ${e} for you. If you are signed in there, this happens as you.` : `Click, type and hover on ${e} for you, in a signed-out view.`,
|
|
436
|
-
cloudTitle: (e) => `
|
|
437
|
-
cloudDescription: (e) => `
|
|
436
|
+
cloudTitle: (e) => `Click and type on ${e}`,
|
|
437
|
+
cloudDescription: (e) => `Clicks, types and scrolls on ${e} for you.`
|
|
438
438
|
},
|
|
439
439
|
{
|
|
440
440
|
id: "storage",
|
|
441
441
|
heading: "Site data",
|
|
442
442
|
summary: "Can read the website's data",
|
|
443
443
|
title: (e) => `Read data from ${e}`,
|
|
444
|
-
description:
|
|
445
|
-
cloudTitle: (e) => `Read
|
|
446
|
-
cloudDescription:
|
|
444
|
+
description: ct,
|
|
445
|
+
cloudTitle: (e) => `Read what's on ${e}`,
|
|
446
|
+
cloudDescription: ct
|
|
447
447
|
},
|
|
448
448
|
{
|
|
449
449
|
id: "network",
|
|
@@ -451,19 +451,19 @@ var Pe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Me]
|
|
|
451
451
|
summary: "Make requests on behalf of the website (using your cookies, etc.)",
|
|
452
452
|
title: (e) => `Make requests to ${e} as you`,
|
|
453
453
|
description: (e) => `Load pages and data from ${e} and send changes there with your signed-in session.`,
|
|
454
|
-
cloudTitle: (e) => `
|
|
455
|
-
cloudDescription: (e) => `
|
|
454
|
+
cloudTitle: (e) => `Load and send data on ${e}`,
|
|
455
|
+
cloudDescription: (e) => `Loads pages and data from ${e} and sends changes there.`
|
|
456
456
|
},
|
|
457
457
|
{
|
|
458
458
|
id: "evaluation",
|
|
459
459
|
heading: "Evaluation",
|
|
460
460
|
summary: "Can execute arbitrary code on the website",
|
|
461
461
|
title: (e) => `Run code on ${e}`,
|
|
462
|
-
description:
|
|
463
|
-
cloudTitle: (e) => `Run code on ${e}`,
|
|
464
|
-
cloudDescription:
|
|
462
|
+
description: lt,
|
|
463
|
+
cloudTitle: (e) => `Run its own code on ${e}`,
|
|
464
|
+
cloudDescription: lt
|
|
465
465
|
}
|
|
466
|
-
],
|
|
466
|
+
], dt = class extends Error {
|
|
467
467
|
reason;
|
|
468
468
|
filename;
|
|
469
469
|
line;
|
|
@@ -472,18 +472,18 @@ var Pe = () => typeof document > "u" ? !1 : document.documentElement.dataset[Me]
|
|
|
472
472
|
constructor(e, t, n, r, i) {
|
|
473
473
|
super(`${e}:${n}:${r}: ${t}`), this.reason = t, this.filename = e, this.line = n, this.column = r, this.source = i;
|
|
474
474
|
}
|
|
475
|
-
},
|
|
475
|
+
}, ft = class {
|
|
476
476
|
start;
|
|
477
477
|
end;
|
|
478
478
|
source;
|
|
479
479
|
constructor(e, t, n) {
|
|
480
480
|
this.start = e, this.end = t, this.source = n;
|
|
481
481
|
}
|
|
482
|
-
},
|
|
482
|
+
}, j;
|
|
483
483
|
(function(e) {
|
|
484
484
|
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";
|
|
485
|
-
})(
|
|
486
|
-
var
|
|
485
|
+
})(j ||= {});
|
|
486
|
+
var pt = (e, t, n) => {
|
|
487
487
|
let r = n, i = 1e4;
|
|
488
488
|
do {
|
|
489
489
|
let n = t.map((t) => e.indexOf(t, r));
|
|
@@ -495,7 +495,7 @@ var ut = (e, t, n) => {
|
|
|
495
495
|
r = o + 2, i--;
|
|
496
496
|
} while (i > 0);
|
|
497
497
|
throw Error("Too many escaping");
|
|
498
|
-
},
|
|
498
|
+
}, M = (e, t, n) => {
|
|
499
499
|
let r = n, i = 1e4;
|
|
500
500
|
do {
|
|
501
501
|
let n = t.map((t) => e.indexOf(t, r));
|
|
@@ -509,21 +509,21 @@ var ut = (e, t, n) => {
|
|
|
509
509
|
break;
|
|
510
510
|
case "(":
|
|
511
511
|
{
|
|
512
|
-
let t =
|
|
512
|
+
let t = M(e, [")"], o + 1);
|
|
513
513
|
if (t === -1) return -1;
|
|
514
514
|
r = t + 1;
|
|
515
515
|
}
|
|
516
516
|
break;
|
|
517
517
|
case "\"":
|
|
518
518
|
{
|
|
519
|
-
let t =
|
|
519
|
+
let t = pt(e, ["\""], o + 1);
|
|
520
520
|
if (t === -1) return -1;
|
|
521
521
|
r = t + 1;
|
|
522
522
|
}
|
|
523
523
|
break;
|
|
524
524
|
case "'":
|
|
525
525
|
{
|
|
526
|
-
let t =
|
|
526
|
+
let t = pt(e, ["'"], o + 1);
|
|
527
527
|
if (t === -1) return -1;
|
|
528
528
|
r = t + 1;
|
|
529
529
|
}
|
|
@@ -533,17 +533,17 @@ var ut = (e, t, n) => {
|
|
|
533
533
|
i--;
|
|
534
534
|
} while (i > 0);
|
|
535
535
|
throw Error("Too many escaping");
|
|
536
|
-
},
|
|
537
|
-
function
|
|
536
|
+
}, N = /\/\*[^]*?(?:\*\/|$)/g;
|
|
537
|
+
function P(e) {
|
|
538
538
|
return e ? e.trim() : "";
|
|
539
539
|
}
|
|
540
|
-
function
|
|
540
|
+
function F(e, t) {
|
|
541
541
|
let n = e && typeof e.type == "string", r = n ? e : t;
|
|
542
542
|
for (let t in e) {
|
|
543
543
|
let n = e[t];
|
|
544
544
|
Array.isArray(n) ? n.forEach((e) => {
|
|
545
|
-
|
|
546
|
-
}) : n && typeof n == "object" &&
|
|
545
|
+
F(e, r);
|
|
546
|
+
}) : n && typeof n == "object" && F(n, r);
|
|
547
547
|
}
|
|
548
548
|
return n && Object.defineProperty(e, "parent", {
|
|
549
549
|
configurable: !0,
|
|
@@ -552,7 +552,7 @@ function I(e, t) {
|
|
|
552
552
|
value: t || null
|
|
553
553
|
}), e;
|
|
554
554
|
}
|
|
555
|
-
var
|
|
555
|
+
var mt = class {
|
|
556
556
|
level = 0;
|
|
557
557
|
indentation = " ";
|
|
558
558
|
compress = !1;
|
|
@@ -567,33 +567,33 @@ var dt = class {
|
|
|
567
567
|
}
|
|
568
568
|
visit(e) {
|
|
569
569
|
switch (e.type) {
|
|
570
|
-
case
|
|
571
|
-
case
|
|
572
|
-
case
|
|
573
|
-
case
|
|
574
|
-
case
|
|
575
|
-
case
|
|
576
|
-
case
|
|
577
|
-
case
|
|
578
|
-
case
|
|
579
|
-
case
|
|
580
|
-
case
|
|
581
|
-
case
|
|
582
|
-
case
|
|
583
|
-
case
|
|
584
|
-
case
|
|
585
|
-
case
|
|
586
|
-
case
|
|
587
|
-
case
|
|
588
|
-
case
|
|
589
|
-
case
|
|
590
|
-
case
|
|
591
|
-
case
|
|
592
|
-
case
|
|
593
|
-
case
|
|
594
|
-
case
|
|
595
|
-
case
|
|
596
|
-
case
|
|
570
|
+
case j.stylesheet: return this.stylesheet(e);
|
|
571
|
+
case j.rule: return this.rule(e);
|
|
572
|
+
case j.declaration: return this.declaration(e);
|
|
573
|
+
case j.comment: return this.comment(e);
|
|
574
|
+
case j.container: return this.container(e);
|
|
575
|
+
case j.charset: return this.charset(e);
|
|
576
|
+
case j.counterStyle: return this.counterStyle(e);
|
|
577
|
+
case j.document: return this.document(e);
|
|
578
|
+
case j.customMedia: return this.customMedia(e);
|
|
579
|
+
case j.fontFace: return this.fontFace(e);
|
|
580
|
+
case j.fontFeatureValues: return this.fontFeatureValues(e);
|
|
581
|
+
case j.host: return this.host(e);
|
|
582
|
+
case j.import: return this.import(e);
|
|
583
|
+
case j.keyframes: return this.keyframes(e);
|
|
584
|
+
case j.keyframe: return this.keyframe(e);
|
|
585
|
+
case j.layer: return this.layer(e);
|
|
586
|
+
case j.media: return this.media(e);
|
|
587
|
+
case j.namespace: return this.namespace(e);
|
|
588
|
+
case j.page: return this.page(e);
|
|
589
|
+
case j.pageMarginBox: return this.pageMarginBox(e);
|
|
590
|
+
case j.positionTry: return this.positionTry(e);
|
|
591
|
+
case j.property: return this.property(e);
|
|
592
|
+
case j.scope: return this.scope(e);
|
|
593
|
+
case j.startingStyle: return this.startingStyle(e);
|
|
594
|
+
case j.supports: return this.supports(e);
|
|
595
|
+
case j.viewTransition: return this.viewTransition(e);
|
|
596
|
+
case j.atRule: return this.genericAtRule(e);
|
|
597
597
|
}
|
|
598
598
|
}
|
|
599
599
|
mapVisit(e, t) {
|
|
@@ -689,7 +689,7 @@ var dt = class {
|
|
|
689
689
|
let t = e.prelude ? ` ${e.prelude}` : "";
|
|
690
690
|
if (this.compress) return this.emit(`@${e.name}${t}`, e.position) + (e.rules ? this.emit("{") + this.mapVisit(e.rules) + this.emit("}") : ";");
|
|
691
691
|
if (!e.rules) return this.emit(`${this.indent()}@${e.name}${t};`, e.position);
|
|
692
|
-
let n = e.rules.some((e) => e.type !==
|
|
692
|
+
let n = e.rules.some((e) => e.type !== j.declaration && e.type !== j.comment), r = n ? "\n\n" : "\n";
|
|
693
693
|
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()}}`);
|
|
694
694
|
}
|
|
695
695
|
rule(e) {
|
|
@@ -702,7 +702,7 @@ var dt = class {
|
|
|
702
702
|
declaration(e) {
|
|
703
703
|
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(";");
|
|
704
704
|
}
|
|
705
|
-
},
|
|
705
|
+
}, ht = (e, t) => {
|
|
706
706
|
t ||= {};
|
|
707
707
|
let n = 1, r = 1;
|
|
708
708
|
function i() {
|
|
@@ -710,14 +710,14 @@ var dt = class {
|
|
|
710
710
|
line: n,
|
|
711
711
|
column: r
|
|
712
712
|
};
|
|
713
|
-
return (i) => (i.position = new
|
|
713
|
+
return (i) => (i.position = new ft(e, {
|
|
714
714
|
line: n,
|
|
715
715
|
column: r
|
|
716
716
|
}, t?.source || ""), u(), i);
|
|
717
717
|
}
|
|
718
718
|
let a = [];
|
|
719
719
|
function o(i) {
|
|
720
|
-
let o = new
|
|
720
|
+
let o = new dt(t?.source || "", i, n, r, e);
|
|
721
721
|
if (!t?.silent) throw o;
|
|
722
722
|
a.push(o);
|
|
723
723
|
}
|
|
@@ -753,36 +753,36 @@ var dt = class {
|
|
|
753
753
|
if (e.charAt(0) !== "/" || e.charAt(1) !== "*") return;
|
|
754
754
|
let n = /^\/\*[^]*?\*\//.exec(e);
|
|
755
755
|
return n ? (l(n), t({
|
|
756
|
-
type:
|
|
756
|
+
type: j.comment,
|
|
757
757
|
comment: n[0].slice(2, -2)
|
|
758
758
|
})) : o("End of comment missing");
|
|
759
759
|
}
|
|
760
760
|
function p() {
|
|
761
|
-
let t =
|
|
761
|
+
let t = M(e, ["{"]);
|
|
762
762
|
if (t === -1 || t === 0) return;
|
|
763
763
|
let n = e.substring(0, t);
|
|
764
764
|
return l([n]), ((e, t) => {
|
|
765
765
|
let n = [], r = 0;
|
|
766
766
|
for (; r < e.length;) {
|
|
767
|
-
let i =
|
|
767
|
+
let i = M(e, t, r);
|
|
768
768
|
if (i === -1) return n.push(e.substring(r)), n;
|
|
769
769
|
n.push(e.substring(r, i)), r = i + 1;
|
|
770
770
|
}
|
|
771
771
|
return n;
|
|
772
|
-
})(
|
|
772
|
+
})(P(n).replace(N, ""), [","]).map((e) => P(e));
|
|
773
773
|
}
|
|
774
774
|
function m() {
|
|
775
775
|
let t = i(), n = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/.exec(e);
|
|
776
776
|
if (!n) return;
|
|
777
777
|
l(n);
|
|
778
|
-
let r =
|
|
778
|
+
let r = P(n[0]), a = /^:\s*/.exec(e);
|
|
779
779
|
if (!a) return o("property missing ':'");
|
|
780
780
|
l(a);
|
|
781
|
-
let s = "", c =
|
|
782
|
-
c !== -1 && (s = e.substring(0, c), l([s]), s =
|
|
781
|
+
let s = "", c = M(e, [";", "}"]);
|
|
782
|
+
c !== -1 && (s = e.substring(0, c), l([s]), s = P(s).replace(N, ""));
|
|
783
783
|
let u = t({
|
|
784
|
-
type:
|
|
785
|
-
property: r.replace(
|
|
784
|
+
type: j.declaration,
|
|
785
|
+
property: r.replace(N, ""),
|
|
786
786
|
value: s
|
|
787
787
|
}), d = /^[;\s]*/.exec(e);
|
|
788
788
|
return d && l(d), u;
|
|
@@ -801,9 +801,9 @@ var dt = class {
|
|
|
801
801
|
return c() ? n : o("missing '}'");
|
|
802
802
|
}
|
|
803
803
|
function h() {
|
|
804
|
-
let t =
|
|
804
|
+
let t = M(e, ["{"]);
|
|
805
805
|
if (t === -1) return !1;
|
|
806
|
-
let n =
|
|
806
|
+
let n = M(e, [";"]), r = M(e, ["}"]);
|
|
807
807
|
return !(n !== -1 && n < t) && !(r !== -1 && r < t);
|
|
808
808
|
}
|
|
809
809
|
function te() {
|
|
@@ -880,7 +880,7 @@ var dt = class {
|
|
|
880
880
|
i && l(i), r = /^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);
|
|
881
881
|
}
|
|
882
882
|
if (t.length) return n({
|
|
883
|
-
type:
|
|
883
|
+
type: j.keyframe,
|
|
884
884
|
values: t,
|
|
885
885
|
declarations: ee() || []
|
|
886
886
|
});
|
|
@@ -902,7 +902,7 @@ var dt = class {
|
|
|
902
902
|
"right-top",
|
|
903
903
|
"right-middle",
|
|
904
904
|
"right-bottom"
|
|
905
|
-
].join("|")})(?![\\w-])\\s*`),
|
|
905
|
+
].join("|")})(?![\\w-])\\s*`), re = y("import"), v = y("charset"), ie = y("namespace");
|
|
906
906
|
function y(t) {
|
|
907
907
|
let n = RegExp("^@" + t + "\\s*((?::?[^;'\"]|\"(?:\\\\\"|[^\"])*?\"|'(?:\\\\'|[^'])*?')+)(?:;|$)");
|
|
908
908
|
return () => {
|
|
@@ -923,7 +923,7 @@ var dt = class {
|
|
|
923
923
|
let f = d(), p = _();
|
|
924
924
|
for (; p;) f.push(p), f = f.concat(d()), p = _();
|
|
925
925
|
return c() ? t({
|
|
926
|
-
type:
|
|
926
|
+
type: j.keyframes,
|
|
927
927
|
name: u,
|
|
928
928
|
vendor: r,
|
|
929
929
|
keyframes: f
|
|
@@ -931,11 +931,11 @@ var dt = class {
|
|
|
931
931
|
}() || function() {
|
|
932
932
|
let t = i(), n = /^@media *([^{]+)/.exec(e);
|
|
933
933
|
if (!n) return;
|
|
934
|
-
let r =
|
|
934
|
+
let r = P(l(n)[1]);
|
|
935
935
|
if (!s()) return o("@media missing '{'");
|
|
936
936
|
let a = g();
|
|
937
937
|
return c() ? t({
|
|
938
|
-
type:
|
|
938
|
+
type: j.media,
|
|
939
939
|
media: r,
|
|
940
940
|
rules: a
|
|
941
941
|
}) : o("@media missing '}'");
|
|
@@ -944,29 +944,29 @@ var dt = class {
|
|
|
944
944
|
if (!n) return;
|
|
945
945
|
let r = l(n);
|
|
946
946
|
return t({
|
|
947
|
-
type:
|
|
948
|
-
name:
|
|
949
|
-
media:
|
|
947
|
+
type: j.customMedia,
|
|
948
|
+
name: P(r[1]),
|
|
949
|
+
media: P(r[2])
|
|
950
950
|
});
|
|
951
951
|
}() || function() {
|
|
952
952
|
let t = i(), n = /^@supports *([^{]+)/.exec(e);
|
|
953
953
|
if (!n) return;
|
|
954
|
-
let r =
|
|
954
|
+
let r = P(l(n)[1]);
|
|
955
955
|
if (!s()) return o("@supports missing '{'");
|
|
956
956
|
let a = g();
|
|
957
957
|
return c() ? t({
|
|
958
|
-
type:
|
|
958
|
+
type: j.supports,
|
|
959
959
|
supports: r,
|
|
960
960
|
rules: a
|
|
961
961
|
}) : o("@supports missing '}'");
|
|
962
|
-
}() ||
|
|
962
|
+
}() || re() || v() || ie() || function() {
|
|
963
963
|
let t = i(), n = /^@([-\w]+)?document *([^{]+)/.exec(e);
|
|
964
964
|
if (!n) return;
|
|
965
|
-
let r = l(n), a =
|
|
965
|
+
let r = l(n), a = P(r[1]), u = P(r[2]);
|
|
966
966
|
if (!s()) return o("@document missing '{'");
|
|
967
967
|
let d = g();
|
|
968
968
|
return c() ? t({
|
|
969
|
-
type:
|
|
969
|
+
type: j.document,
|
|
970
970
|
document: u,
|
|
971
971
|
vendor: a,
|
|
972
972
|
rules: d
|
|
@@ -991,7 +991,7 @@ var dt = class {
|
|
|
991
991
|
a.push(t), d(a);
|
|
992
992
|
}
|
|
993
993
|
return c() ? t({
|
|
994
|
-
type:
|
|
994
|
+
type: j.page,
|
|
995
995
|
selectors: r,
|
|
996
996
|
declarations: a
|
|
997
997
|
}) : o("@page missing '}'");
|
|
@@ -1001,7 +1001,7 @@ var dt = class {
|
|
|
1001
1001
|
if (l(n), !s()) return o("@host missing '{'");
|
|
1002
1002
|
let r = g();
|
|
1003
1003
|
return c() ? t({
|
|
1004
|
-
type:
|
|
1004
|
+
type: j.host,
|
|
1005
1005
|
rules: r
|
|
1006
1006
|
}) : o("@host missing '}'");
|
|
1007
1007
|
}() || function() {
|
|
@@ -1011,28 +1011,28 @@ var dt = class {
|
|
|
1011
1011
|
let r = d(), a = m();
|
|
1012
1012
|
for (; a;) r.push(a), r = r.concat(d()), a = m();
|
|
1013
1013
|
return c() ? t({
|
|
1014
|
-
type:
|
|
1014
|
+
type: j.fontFace,
|
|
1015
1015
|
declarations: r
|
|
1016
1016
|
}) : o("@font-face missing '}'");
|
|
1017
1017
|
}() || function() {
|
|
1018
1018
|
let t = i(), n = /^@font-feature-values\s+([^{]+)/.exec(e);
|
|
1019
1019
|
if (!n) return;
|
|
1020
|
-
let r =
|
|
1020
|
+
let r = P(l(n)[1]);
|
|
1021
1021
|
if (!s()) return o("@font-feature-values missing '{'");
|
|
1022
1022
|
let a = g();
|
|
1023
1023
|
return c() ? t({
|
|
1024
|
-
type:
|
|
1024
|
+
type: j.fontFeatureValues,
|
|
1025
1025
|
fontFamily: r,
|
|
1026
1026
|
rules: a
|
|
1027
1027
|
}) : o("@font-feature-values missing '}'");
|
|
1028
1028
|
}() || function() {
|
|
1029
1029
|
let t = i(), n = /^@container *([^{]+)/.exec(e);
|
|
1030
1030
|
if (!n) return;
|
|
1031
|
-
let r =
|
|
1031
|
+
let r = P(l(n)[1]);
|
|
1032
1032
|
if (!s()) return o("@container missing '{'");
|
|
1033
1033
|
let a = g();
|
|
1034
1034
|
return c() ? t({
|
|
1035
|
-
type:
|
|
1035
|
+
type: j.container,
|
|
1036
1036
|
container: r,
|
|
1037
1037
|
rules: a
|
|
1038
1038
|
}) : o("@container missing '}'");
|
|
@@ -1042,23 +1042,23 @@ var dt = class {
|
|
|
1042
1042
|
if (l(n), !s()) return o("@starting-style missing '{'");
|
|
1043
1043
|
let r = g();
|
|
1044
1044
|
return c() ? t({
|
|
1045
|
-
type:
|
|
1045
|
+
type: j.startingStyle,
|
|
1046
1046
|
rules: r
|
|
1047
1047
|
}) : o("@starting-style missing '}'");
|
|
1048
1048
|
}() || function() {
|
|
1049
1049
|
let t = i(), n = /^@layer *([^{;@]+)/.exec(e);
|
|
1050
1050
|
if (!n) return;
|
|
1051
|
-
let r =
|
|
1051
|
+
let r = P(l(n)[1]);
|
|
1052
1052
|
if (!s()) {
|
|
1053
1053
|
let n = /^[;\s]*/.exec(e);
|
|
1054
1054
|
return n && l(n), t({
|
|
1055
|
-
type:
|
|
1055
|
+
type: j.layer,
|
|
1056
1056
|
layer: r
|
|
1057
1057
|
});
|
|
1058
1058
|
}
|
|
1059
1059
|
let a = g();
|
|
1060
1060
|
return c() ? t({
|
|
1061
|
-
type:
|
|
1061
|
+
type: j.layer,
|
|
1062
1062
|
layer: r,
|
|
1063
1063
|
rules: a
|
|
1064
1064
|
}) : o("@layer missing '}'");
|
|
@@ -1070,7 +1070,7 @@ var dt = class {
|
|
|
1070
1070
|
let a = d(), u = m();
|
|
1071
1071
|
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
1072
1072
|
return c() ? t({
|
|
1073
|
-
type:
|
|
1073
|
+
type: j.property,
|
|
1074
1074
|
name: r,
|
|
1075
1075
|
declarations: a
|
|
1076
1076
|
}) : o("@property missing '}'");
|
|
@@ -1082,18 +1082,18 @@ var dt = class {
|
|
|
1082
1082
|
let a = d(), u = m();
|
|
1083
1083
|
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
1084
1084
|
return c() ? t({
|
|
1085
|
-
type:
|
|
1085
|
+
type: j.counterStyle,
|
|
1086
1086
|
name: r,
|
|
1087
1087
|
declarations: a
|
|
1088
1088
|
}) : o("@counter-style missing '}'");
|
|
1089
1089
|
}() || function() {
|
|
1090
1090
|
let t = i(), n = /^@scope\s*([^{]*)/.exec(e);
|
|
1091
1091
|
if (!n) return;
|
|
1092
|
-
let r =
|
|
1092
|
+
let r = P(l(n)[1]);
|
|
1093
1093
|
if (!s()) return o("@scope missing '{'");
|
|
1094
1094
|
let a = g();
|
|
1095
1095
|
return c() ? t({
|
|
1096
|
-
type:
|
|
1096
|
+
type: j.scope,
|
|
1097
1097
|
scope: r,
|
|
1098
1098
|
rules: a
|
|
1099
1099
|
}) : o("@scope missing '}'");
|
|
@@ -1104,7 +1104,7 @@ var dt = class {
|
|
|
1104
1104
|
let r = d(), a = m();
|
|
1105
1105
|
for (; a;) r.push(a), r = r.concat(d()), a = m();
|
|
1106
1106
|
return c() ? t({
|
|
1107
|
-
type:
|
|
1107
|
+
type: j.viewTransition,
|
|
1108
1108
|
declarations: r
|
|
1109
1109
|
}) : o("@view-transition missing '}'");
|
|
1110
1110
|
}() || function() {
|
|
@@ -1115,7 +1115,7 @@ var dt = class {
|
|
|
1115
1115
|
let a = d(), u = m();
|
|
1116
1116
|
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
1117
1117
|
return c() ? t({
|
|
1118
|
-
type:
|
|
1118
|
+
type: j.positionTry,
|
|
1119
1119
|
name: r,
|
|
1120
1120
|
declarations: a
|
|
1121
1121
|
}) : o("@position-try missing '}'");
|
|
@@ -1127,18 +1127,18 @@ var dt = class {
|
|
|
1127
1127
|
let a = d(), u = m();
|
|
1128
1128
|
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
1129
1129
|
return c() ? t({
|
|
1130
|
-
type:
|
|
1130
|
+
type: j.pageMarginBox,
|
|
1131
1131
|
name: r,
|
|
1132
1132
|
declarations: a
|
|
1133
1133
|
}) : o(`@${r} missing '}'`);
|
|
1134
1134
|
}() || function() {
|
|
1135
1135
|
let t = i(), n = /^@([-\w]+)\s*/.exec(e);
|
|
1136
1136
|
if (!n) return;
|
|
1137
|
-
let r = l(n)[1], a = "", u =
|
|
1138
|
-
if (u !== -1 && u > 0 && (a =
|
|
1137
|
+
let r = l(n)[1], a = "", u = M(e, ["{", ";"]);
|
|
1138
|
+
if (u !== -1 && u > 0 && (a = P(e.substring(0, u)), l([e.substring(0, u)])), s()) {
|
|
1139
1139
|
let e = g();
|
|
1140
1140
|
return c() ? t({
|
|
1141
|
-
type:
|
|
1141
|
+
type: j.atRule,
|
|
1142
1142
|
name: r,
|
|
1143
1143
|
prelude: a,
|
|
1144
1144
|
rules: e
|
|
@@ -1146,7 +1146,7 @@ var dt = class {
|
|
|
1146
1146
|
}
|
|
1147
1147
|
let d = /^[;\s]*/.exec(e);
|
|
1148
1148
|
return d && l(d), t({
|
|
1149
|
-
type:
|
|
1149
|
+
type: j.atRule,
|
|
1150
1150
|
name: r,
|
|
1151
1151
|
prelude: a
|
|
1152
1152
|
});
|
|
@@ -1155,12 +1155,12 @@ var dt = class {
|
|
|
1155
1155
|
function x() {
|
|
1156
1156
|
let e = i(), t = p();
|
|
1157
1157
|
return t ? (d(), e({
|
|
1158
|
-
type:
|
|
1158
|
+
type: j.rule,
|
|
1159
1159
|
selectors: t,
|
|
1160
1160
|
declarations: te() || []
|
|
1161
1161
|
})) : o("selector missing");
|
|
1162
1162
|
}
|
|
1163
|
-
return
|
|
1163
|
+
return F(function() {
|
|
1164
1164
|
let n = function() {
|
|
1165
1165
|
let n, r = [];
|
|
1166
1166
|
for (u(), d(r); e.length;) {
|
|
@@ -1183,7 +1183,7 @@ var dt = class {
|
|
|
1183
1183
|
return r;
|
|
1184
1184
|
}();
|
|
1185
1185
|
return {
|
|
1186
|
-
type:
|
|
1186
|
+
type: j.stylesheet,
|
|
1187
1187
|
stylesheet: {
|
|
1188
1188
|
source: t?.source,
|
|
1189
1189
|
rules: n,
|
|
@@ -1191,61 +1191,61 @@ var dt = class {
|
|
|
1191
1191
|
}
|
|
1192
1192
|
};
|
|
1193
1193
|
}());
|
|
1194
|
-
},
|
|
1194
|
+
}, gt = (e, t) => new mt(t || {}).compile(e), _t = Object.defineProperty, vt = (e, t) => {
|
|
1195
1195
|
let n = {};
|
|
1196
|
-
for (var r in e)
|
|
1196
|
+
for (var r in e) _t(n, r, {
|
|
1197
1197
|
get: e[r],
|
|
1198
1198
|
enumerable: !0
|
|
1199
1199
|
});
|
|
1200
|
-
return t ||
|
|
1201
|
-
},
|
|
1202
|
-
name:
|
|
1200
|
+
return t || _t(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
1201
|
+
}, yt = "LocatorError", I = "LocatorUnsupportedError", L = "LocatorDeniedError", bt = "LocatorInvalidError", R = (e) => typeof e == "object" && e ? e.name : void 0, z = (e) => Object.assign(Error(e), { name: yt }), xt = (e, t = "", n) => Object.assign(Error(e), {
|
|
1202
|
+
name: I,
|
|
1203
1203
|
operation: t,
|
|
1204
1204
|
backend: n
|
|
1205
|
-
}),
|
|
1206
|
-
name:
|
|
1205
|
+
}), B = (e, t) => xt(`Locator operation not supported${t ? ` on the ${t} backend` : ""}: ${e}`, e, t), St = (e, t) => Object.assign(Error(e), {
|
|
1206
|
+
name: L,
|
|
1207
1207
|
operation: t
|
|
1208
|
-
}),
|
|
1209
|
-
name:
|
|
1208
|
+
}), V = (e, t) => Object.assign(Error(e), {
|
|
1209
|
+
name: bt,
|
|
1210
1210
|
operation: t
|
|
1211
|
-
}),
|
|
1211
|
+
}), Ct = (e) => R(e) === I, wt = (e) => R(e) === L, Tt = (e) => R(e) === bt, Et = (e) => wt(e) || Ct(e) || Tt(e), H = (e) => {
|
|
1212
1212
|
let t = (e.ownerDocument ?? e).defaultView;
|
|
1213
|
-
if (!t) throw
|
|
1213
|
+
if (!t) throw z("the resolved element belongs to a document with no window");
|
|
1214
1214
|
return t;
|
|
1215
|
-
},
|
|
1215
|
+
}, Dt = (e, t) => {
|
|
1216
1216
|
let n = e?.[t];
|
|
1217
1217
|
return typeof n == "function" ? n : null;
|
|
1218
1218
|
}, U = (e, t) => {
|
|
1219
1219
|
if (typeof e != "object" || !e) return null;
|
|
1220
1220
|
let n = (() => {
|
|
1221
1221
|
try {
|
|
1222
|
-
return H(
|
|
1222
|
+
return Dt(H(e), t);
|
|
1223
1223
|
} catch {
|
|
1224
1224
|
return null;
|
|
1225
1225
|
}
|
|
1226
1226
|
})();
|
|
1227
1227
|
if (n && e instanceof n) return n;
|
|
1228
|
-
let r =
|
|
1228
|
+
let r = Dt(globalThis, t);
|
|
1229
1229
|
return r && e instanceof r ? r : null;
|
|
1230
1230
|
}, W = (e, t) => U(e, t) !== null, G = (e) => {
|
|
1231
|
-
if (e.length === 0) throw
|
|
1232
|
-
if (e.length > 1) throw
|
|
1231
|
+
if (e.length === 0) throw z("No elements found");
|
|
1232
|
+
if (e.length > 1) throw z(`Strict mode violation: locator resolved to ${e.length} elements`);
|
|
1233
1233
|
return e[0];
|
|
1234
|
-
},
|
|
1235
|
-
if (!W(e, t)) throw
|
|
1234
|
+
}, Ot = (e, t) => {
|
|
1235
|
+
if (!W(e, t)) throw z(`Strict mode violation: expected ${t}, got <${e.tagName.toLowerCase()}>`);
|
|
1236
1236
|
return e;
|
|
1237
|
-
},
|
|
1238
|
-
|
|
1239
|
-
},
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
]),
|
|
1247
|
-
if (
|
|
1248
|
-
if (e.type ===
|
|
1237
|
+
}, kt = (e) => e.tagName.toLowerCase(), At = /* @__PURE__ */ new Set(), jt = (e) => {
|
|
1238
|
+
At.add(e);
|
|
1239
|
+
}, Mt = /(?:^|[^\w-])(?:url|image|image-set|cross-fade|paint|element|expression)\s*\(/i, Nt = (e) => e.replace(/\\([0-9a-fA-F]{1,6})\s?/g, (e, t) => String.fromCodePoint(Number.parseInt(t, 16))).replace(/\\(.)/g, "$1"), Pt = (e) => !Mt.test(Nt(e.value)), Ft = /* @__PURE__ */ new Set([
|
|
1240
|
+
j.import,
|
|
1241
|
+
j.fontFace,
|
|
1242
|
+
j.namespace,
|
|
1243
|
+
j.charset,
|
|
1244
|
+
j.document,
|
|
1245
|
+
j.comment
|
|
1246
|
+
]), It = (e) => {
|
|
1247
|
+
if (Ft.has(e.type)) return null;
|
|
1248
|
+
if (e.type === j.declaration) return Pt(e) ? e : null;
|
|
1249
1249
|
let t = e, n = { ...t };
|
|
1250
1250
|
for (let e of [
|
|
1251
1251
|
"declarations",
|
|
@@ -1253,18 +1253,18 @@ var dt = class {
|
|
|
1253
1253
|
"keyframes"
|
|
1254
1254
|
]) {
|
|
1255
1255
|
let r = t[e];
|
|
1256
|
-
Array.isArray(r) && (n[e] =
|
|
1256
|
+
Array.isArray(r) && (n[e] = Lt(r));
|
|
1257
1257
|
}
|
|
1258
1258
|
return n;
|
|
1259
|
-
},
|
|
1259
|
+
}, Lt = (e) => e.map((e) => It(e)).filter((e) => e !== null), Rt = (e) => {
|
|
1260
1260
|
let t;
|
|
1261
1261
|
try {
|
|
1262
|
-
t =
|
|
1262
|
+
t = ht(e, { silent: !0 });
|
|
1263
1263
|
} catch {
|
|
1264
1264
|
return "";
|
|
1265
1265
|
}
|
|
1266
|
-
return t.stylesheet.rules =
|
|
1267
|
-
},
|
|
1266
|
+
return t.stylesheet.rules = Lt(t.stylesheet.rules), gt(t);
|
|
1267
|
+
}, zt = (e, t) => {
|
|
1268
1268
|
let n = () => {
|
|
1269
1269
|
t.parentNode || (e.head ?? e.documentElement).appendChild(t);
|
|
1270
1270
|
};
|
|
@@ -1281,16 +1281,16 @@ var dt = class {
|
|
|
1281
1281
|
});
|
|
1282
1282
|
let i = () => r.disconnect(), a = e.defaultView;
|
|
1283
1283
|
a ? a.addEventListener("load", i, { once: !0 }) : setTimeout(i, 3e4);
|
|
1284
|
-
},
|
|
1284
|
+
}, Bt = { resolve: (e, t) => {
|
|
1285
1285
|
let n = e.document.createElement("style");
|
|
1286
|
-
n.textContent = t.noSanitize ? t.content :
|
|
1286
|
+
n.textContent = t.noSanitize ? t.content : Rt(t.content);
|
|
1287
1287
|
try {
|
|
1288
|
-
|
|
1288
|
+
zt(e.document, n);
|
|
1289
1289
|
} catch (e) {
|
|
1290
1290
|
console.error(e);
|
|
1291
1291
|
}
|
|
1292
|
-
|
|
1293
|
-
} },
|
|
1292
|
+
jt(n);
|
|
1293
|
+
} }, Vt = (e) => {
|
|
1294
1294
|
let t = [];
|
|
1295
1295
|
return e.forEach((e, n) => {
|
|
1296
1296
|
t.push([n, e]);
|
|
@@ -1299,12 +1299,12 @@ var dt = class {
|
|
|
1299
1299
|
kind: "frame",
|
|
1300
1300
|
ensureArgs: (e) => [void 0, e],
|
|
1301
1301
|
resolve: async (e, t, n = {}) => {
|
|
1302
|
-
if (typeof t != "string") throw
|
|
1303
|
-
let r =
|
|
1302
|
+
if (typeof t != "string") throw V("fetch: url must be a string", "fetch");
|
|
1303
|
+
let r = H(e.document), i;
|
|
1304
1304
|
try {
|
|
1305
1305
|
i = new r.URL(t, e.document.baseURI).href;
|
|
1306
1306
|
} catch {
|
|
1307
|
-
throw
|
|
1307
|
+
throw V(`fetch: not a valid url: ${t}`, "fetch");
|
|
1308
1308
|
}
|
|
1309
1309
|
let a = await r.fetch(i, {
|
|
1310
1310
|
method: n.method ?? "GET",
|
|
@@ -1320,31 +1320,31 @@ var dt = class {
|
|
|
1320
1320
|
url: a.url,
|
|
1321
1321
|
redirected: a.redirected,
|
|
1322
1322
|
type: a.type,
|
|
1323
|
-
headers:
|
|
1323
|
+
headers: Vt(a.headers),
|
|
1324
1324
|
body: await a.arrayBuffer()
|
|
1325
1325
|
};
|
|
1326
1326
|
}
|
|
1327
|
-
}, q = /* @__PURE__ */
|
|
1328
|
-
click: () =>
|
|
1329
|
-
count: () =>
|
|
1330
|
-
exists: () =>
|
|
1331
|
-
fill: () =>
|
|
1332
|
-
getAttribute: () =>
|
|
1333
|
-
hover: () =>
|
|
1334
|
-
isVisible: () =>
|
|
1335
|
-
textContent: () =>
|
|
1336
|
-
}),
|
|
1327
|
+
}, q = /* @__PURE__ */ vt({
|
|
1328
|
+
click: () => Ut,
|
|
1329
|
+
count: () => Zt,
|
|
1330
|
+
exists: () => Qt,
|
|
1331
|
+
fill: () => qt,
|
|
1332
|
+
getAttribute: () => Yt,
|
|
1333
|
+
hover: () => Wt,
|
|
1334
|
+
isVisible: () => Xt,
|
|
1335
|
+
textContent: () => Jt
|
|
1336
|
+
}), Ht = (e, t) => {
|
|
1337
1337
|
let n = e.getBoundingClientRect();
|
|
1338
1338
|
return {
|
|
1339
1339
|
clientX: n.left + n.width * (t?.x ?? .5),
|
|
1340
1340
|
clientY: n.top + n.height * (t?.y ?? .5)
|
|
1341
1341
|
};
|
|
1342
|
-
},
|
|
1343
|
-
let n = G(e.elements), r =
|
|
1342
|
+
}, Ut = { resolve: (e, t = {}) => {
|
|
1343
|
+
let n = G(e.elements), r = H(n), i = {
|
|
1344
1344
|
bubbles: !0,
|
|
1345
1345
|
cancelable: !0,
|
|
1346
1346
|
composed: !0,
|
|
1347
|
-
...
|
|
1347
|
+
...Ht(n, t.position),
|
|
1348
1348
|
button: 0
|
|
1349
1349
|
}, a = {
|
|
1350
1350
|
...i,
|
|
@@ -1368,12 +1368,12 @@ var dt = class {
|
|
|
1368
1368
|
...i,
|
|
1369
1369
|
buttons: 0
|
|
1370
1370
|
}));
|
|
1371
|
-
} },
|
|
1372
|
-
let n = G(e.elements), r =
|
|
1371
|
+
} }, Wt = { resolve: (e, t = {}) => {
|
|
1372
|
+
let n = G(e.elements), r = H(n), i = {
|
|
1373
1373
|
bubbles: !0,
|
|
1374
1374
|
cancelable: !0,
|
|
1375
1375
|
composed: !0,
|
|
1376
|
-
...
|
|
1376
|
+
...Ht(n, t.position)
|
|
1377
1377
|
}, a = {
|
|
1378
1378
|
...i,
|
|
1379
1379
|
pointerType: "mouse",
|
|
@@ -1387,11 +1387,11 @@ var dt = class {
|
|
|
1387
1387
|
...i,
|
|
1388
1388
|
bubbles: !1
|
|
1389
1389
|
})), n.dispatchEvent(new r.MouseEvent("mouseover", i)), n.dispatchEvent(new r.PointerEvent("pointermove", a)), n.dispatchEvent(new r.MouseEvent("mousemove", i));
|
|
1390
|
-
} },
|
|
1390
|
+
} }, Gt = (e, t) => {
|
|
1391
1391
|
e._valueTracker?.setValue("");
|
|
1392
1392
|
let n = (U(e, "HTMLTextAreaElement") ?? U(e, "HTMLInputElement"))?.prototype, r = n && Object.getOwnPropertyDescriptor(n, "value")?.set;
|
|
1393
1393
|
r ? r.call(e, t) : e.value = t;
|
|
1394
|
-
},
|
|
1394
|
+
}, Kt = (e, t) => {
|
|
1395
1395
|
if (e.type !== "range") return null;
|
|
1396
1396
|
let n = Number(e.min || 0), r = Number(e.max || 100);
|
|
1397
1397
|
if (!Number.isFinite(n) || !Number.isFinite(r) || r <= n) return null;
|
|
@@ -1428,26 +1428,26 @@ var dt = class {
|
|
|
1428
1428
|
buttons: 0
|
|
1429
1429
|
}
|
|
1430
1430
|
};
|
|
1431
|
-
},
|
|
1432
|
-
let r = G(e.elements), i =
|
|
1431
|
+
}, qt = { resolve: (e, t, n = {}) => {
|
|
1432
|
+
let r = G(e.elements), i = H(r), a = W(r, "HTMLInputElement");
|
|
1433
1433
|
if (a || W(r, "HTMLTextAreaElement")) {
|
|
1434
|
-
let e = r, n = a ?
|
|
1435
|
-
n && (r.dispatchEvent(new i.PointerEvent("pointerdown", n.pointerDown)), r.dispatchEvent(new i.MouseEvent("mousedown", n.mouseDown))),
|
|
1434
|
+
let e = r, n = a ? Kt(e, t) : null;
|
|
1435
|
+
n && (r.dispatchEvent(new i.PointerEvent("pointerdown", n.pointerDown)), r.dispatchEvent(new i.MouseEvent("mousedown", n.mouseDown))), Gt(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 }));
|
|
1436
1436
|
return;
|
|
1437
1437
|
}
|
|
1438
1438
|
if (W(r, "HTMLElement") && r.isContentEditable) {
|
|
1439
1439
|
r.textContent = t, r.dispatchEvent(new i.Event("input", { bubbles: !0 }));
|
|
1440
1440
|
return;
|
|
1441
1441
|
}
|
|
1442
|
-
throw Error(`fill: element <${
|
|
1443
|
-
} },
|
|
1442
|
+
throw Error(`fill: element <${kt(r)}> is not fillable`);
|
|
1443
|
+
} }, Jt = { resolve: (e, t = {}) => G(e.elements).textContent }, Yt = { resolve: (e, t, n = {}) => G(e.elements).getAttribute(t) }, Xt = { resolve: (e, t = {}) => {
|
|
1444
1444
|
let n = G(e.elements);
|
|
1445
1445
|
if (!W(n, "HTMLElement")) return !0;
|
|
1446
|
-
let r =
|
|
1446
|
+
let r = H(n).getComputedStyle(n);
|
|
1447
1447
|
if (r?.display === "none" || r?.visibility === "hidden") return !1;
|
|
1448
1448
|
let i = n.getBoundingClientRect();
|
|
1449
1449
|
return i.width > 0 && i.height > 0;
|
|
1450
|
-
} },
|
|
1450
|
+
} }, Zt = { resolve: (e, t = {}) => e.elements.length }, Qt = { resolve: (e, t = {}) => e.elements.length > 0 }, J = (e, t) => e.elements.flatMap((e) => [...e.querySelectorAll(t)]), Y = (e) => e.replaceAll("\"", "\\\""), $t = {
|
|
1451
1451
|
to: "element",
|
|
1452
1452
|
css: !0,
|
|
1453
1453
|
resolve: (e, t) => J(e, t),
|
|
@@ -1455,7 +1455,7 @@ var dt = class {
|
|
|
1455
1455
|
fragment: typeof e == "string" ? e : "?",
|
|
1456
1456
|
separator: "descend"
|
|
1457
1457
|
})
|
|
1458
|
-
},
|
|
1458
|
+
}, en = {
|
|
1459
1459
|
to: "frame",
|
|
1460
1460
|
css: !0,
|
|
1461
1461
|
barrier: "down",
|
|
@@ -1464,11 +1464,11 @@ var dt = class {
|
|
|
1464
1464
|
fragment: typeof e == "string" ? e : "?",
|
|
1465
1465
|
separator: "down"
|
|
1466
1466
|
})
|
|
1467
|
-
},
|
|
1467
|
+
}, tn = {
|
|
1468
1468
|
element: {
|
|
1469
1469
|
selectors: {
|
|
1470
|
-
locator:
|
|
1471
|
-
frameLocator:
|
|
1470
|
+
locator: $t,
|
|
1471
|
+
frameLocator: en,
|
|
1472
1472
|
getByRole: {
|
|
1473
1473
|
to: "element",
|
|
1474
1474
|
resolve: (e, t) => J(e, `[role="${CSS.escape(t)}"]`),
|
|
@@ -1499,20 +1499,20 @@ var dt = class {
|
|
|
1499
1499
|
}
|
|
1500
1500
|
},
|
|
1501
1501
|
operations: {
|
|
1502
|
-
click:
|
|
1503
|
-
fill:
|
|
1504
|
-
hover:
|
|
1505
|
-
textContent:
|
|
1506
|
-
getAttribute:
|
|
1507
|
-
isVisible:
|
|
1508
|
-
count:
|
|
1509
|
-
exists:
|
|
1502
|
+
click: Ut,
|
|
1503
|
+
fill: qt,
|
|
1504
|
+
hover: Wt,
|
|
1505
|
+
textContent: Jt,
|
|
1506
|
+
getAttribute: Yt,
|
|
1507
|
+
isVisible: Xt,
|
|
1508
|
+
count: Zt,
|
|
1509
|
+
exists: Qt
|
|
1510
1510
|
}
|
|
1511
1511
|
},
|
|
1512
1512
|
frame: {
|
|
1513
1513
|
selectors: {
|
|
1514
|
-
locator:
|
|
1515
|
-
frameLocator:
|
|
1514
|
+
locator: $t,
|
|
1515
|
+
frameLocator: en,
|
|
1516
1516
|
owner: {
|
|
1517
1517
|
to: "frame",
|
|
1518
1518
|
barrier: "up",
|
|
@@ -1526,11 +1526,11 @@ var dt = class {
|
|
|
1526
1526
|
}
|
|
1527
1527
|
},
|
|
1528
1528
|
operations: {
|
|
1529
|
-
addStyleTag:
|
|
1529
|
+
addStyleTag: Bt,
|
|
1530
1530
|
fetch: K
|
|
1531
1531
|
}
|
|
1532
1532
|
}
|
|
1533
|
-
},
|
|
1533
|
+
}, nn = (e, t = tn) => ({
|
|
1534
1534
|
element: {
|
|
1535
1535
|
selectors: {
|
|
1536
1536
|
...t.element.selectors,
|
|
@@ -1551,29 +1551,29 @@ var dt = class {
|
|
|
1551
1551
|
...e.frame?.operations
|
|
1552
1552
|
}
|
|
1553
1553
|
}
|
|
1554
|
-
}),
|
|
1554
|
+
}), rn = 3e4, an = 50, on = (e) => {
|
|
1555
1555
|
let t = e[e.length - 1];
|
|
1556
1556
|
return typeof t == "object" && t ? t : void 0;
|
|
1557
|
-
},
|
|
1558
|
-
let t =
|
|
1559
|
-
return typeof t == "number" ? t :
|
|
1560
|
-
},
|
|
1557
|
+
}, sn = (e) => {
|
|
1558
|
+
let t = on(e)?.timeout;
|
|
1559
|
+
return typeof t == "number" ? t : rn;
|
|
1560
|
+
}, cn = ({ executor: e, parts: t }) => ({ highlight: (n) => e.highlight(t, n).then(() => {}, () => {}) }), ln = async (e) => {
|
|
1561
1561
|
let t = {
|
|
1562
1562
|
parts: e.parts,
|
|
1563
1563
|
operation: e.operation,
|
|
1564
1564
|
args: e.args,
|
|
1565
1565
|
phase: "ensure"
|
|
1566
1566
|
};
|
|
1567
|
-
await e.gate?.(t,
|
|
1568
|
-
},
|
|
1567
|
+
await e.gate?.(t, cn(e));
|
|
1568
|
+
}, un = async (e) => {
|
|
1569
1569
|
let { executor: t, gate: n, parts: r, operation: i, args: a } = e;
|
|
1570
1570
|
n && await n({
|
|
1571
1571
|
parts: r,
|
|
1572
1572
|
operation: i,
|
|
1573
1573
|
args: a,
|
|
1574
1574
|
phase: "execute"
|
|
1575
|
-
},
|
|
1576
|
-
let o =
|
|
1575
|
+
}, cn(e));
|
|
1576
|
+
let o = sn(a), s = Date.now() + o, c = /* @__PURE__ */ Error(`Locator timeout (${o}ms): ${i}`), { promise: l, reject: u } = Promise.withResolvers();
|
|
1577
1577
|
l.catch(() => {});
|
|
1578
1578
|
let d = setTimeout(() => u(c), o), f = c;
|
|
1579
1579
|
try {
|
|
@@ -1581,24 +1581,24 @@ var dt = class {
|
|
|
1581
1581
|
return await Promise.race([t.execute(r, i, a), l]);
|
|
1582
1582
|
} catch (e) {
|
|
1583
1583
|
if (e === c) break;
|
|
1584
|
-
if (
|
|
1584
|
+
if (Et(e)) throw e;
|
|
1585
1585
|
f = e;
|
|
1586
1586
|
let t = s - Date.now();
|
|
1587
1587
|
if (t <= 0) break;
|
|
1588
|
-
await new Promise((e) => setTimeout(e, Math.min(
|
|
1588
|
+
await new Promise((e) => setTimeout(e, Math.min(an, t)));
|
|
1589
1589
|
}
|
|
1590
1590
|
} finally {
|
|
1591
1591
|
clearTimeout(d);
|
|
1592
1592
|
}
|
|
1593
1593
|
throw f;
|
|
1594
|
-
},
|
|
1594
|
+
}, dn = (e, t, n, r) => {
|
|
1595
1595
|
let i = {};
|
|
1596
|
-
for (let [a, o] of Object.entries(t[n].selectors)) i[a] = (...i) =>
|
|
1596
|
+
for (let [a, o] of Object.entries(t[n].selectors)) i[a] = (...i) => dn(e, t, o.to, [...r, {
|
|
1597
1597
|
kind: n,
|
|
1598
1598
|
name: a,
|
|
1599
1599
|
args: i
|
|
1600
1600
|
}]);
|
|
1601
|
-
for (let a of Object.keys(t[n].operations)) i[a] = (...t) =>
|
|
1601
|
+
for (let a of Object.keys(t[n].operations)) i[a] = (...t) => un({
|
|
1602
1602
|
...e,
|
|
1603
1603
|
parts: r,
|
|
1604
1604
|
operation: a,
|
|
@@ -1606,14 +1606,14 @@ var dt = class {
|
|
|
1606
1606
|
});
|
|
1607
1607
|
return i.ensure = (i, a = {}) => {
|
|
1608
1608
|
let o = t[n].operations[i]?.ensureArgs;
|
|
1609
|
-
return
|
|
1609
|
+
return ln({
|
|
1610
1610
|
...e,
|
|
1611
1611
|
parts: r,
|
|
1612
1612
|
operation: i,
|
|
1613
1613
|
args: o?.(a) ?? [a]
|
|
1614
1614
|
});
|
|
1615
1615
|
}, i;
|
|
1616
|
-
},
|
|
1616
|
+
}, fn = (e) => dn(e, e.modules ?? tn, "frame", []), pn = nn({
|
|
1617
1617
|
element: { operations: {
|
|
1618
1618
|
click: { resolve: (e, t = {}) => q.click.resolve(e, t) },
|
|
1619
1619
|
hover: { resolve: (e, t = {}) => q.hover.resolve(e, t) },
|
|
@@ -1623,17 +1623,23 @@ var dt = class {
|
|
|
1623
1623
|
isVisible: { resolve: (e, t = {}) => q.isVisible.resolve(e) },
|
|
1624
1624
|
count: { resolve: (e, t = {}) => q.count.resolve(e) },
|
|
1625
1625
|
exists: { resolve: (e, t = {}) => q.exists.resolve(e) },
|
|
1626
|
-
videoElement: { resolve: (e, t = {}) => C(
|
|
1626
|
+
videoElement: { resolve: (e, t = {}) => C(Ot(G(e.elements), "HTMLVideoElement")) }
|
|
1627
1627
|
} },
|
|
1628
1628
|
frame: { operations: {
|
|
1629
|
-
addStyleTag: { resolve: (e, t) =>
|
|
1629
|
+
addStyleTag: { resolve: (e, t) => Bt.resolve(e, t) },
|
|
1630
1630
|
fetch: {
|
|
1631
1631
|
resolve: (e, t, n = {}) => K.resolve(e, t, n),
|
|
1632
1632
|
kind: K.kind,
|
|
1633
1633
|
ensureArgs: K.ensureArgs
|
|
1634
|
+
},
|
|
1635
|
+
evaluate: {
|
|
1636
|
+
kind: "frame",
|
|
1637
|
+
resolve: (e, t, n) => {
|
|
1638
|
+
throw B("evaluate", "this realm");
|
|
1639
|
+
}
|
|
1634
1640
|
}
|
|
1635
1641
|
} }
|
|
1636
|
-
}),
|
|
1642
|
+
}), mn = (e) => {
|
|
1637
1643
|
if (!e || e === "about:blank") return !1;
|
|
1638
1644
|
let t;
|
|
1639
1645
|
try {
|
|
@@ -1641,88 +1647,112 @@ var dt = class {
|
|
|
1641
1647
|
} catch {
|
|
1642
1648
|
return !1;
|
|
1643
1649
|
}
|
|
1644
|
-
return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || t.protocol !== "about:" &&
|
|
1650
|
+
return t.protocol === "chrome-extension:" || t.protocol === "moz-extension:" || t.protocol !== "about:" && Ge(t.hostname);
|
|
1645
1651
|
}, X = (e) => {
|
|
1646
|
-
if (
|
|
1647
|
-
},
|
|
1648
|
-
if (
|
|
1649
|
-
},
|
|
1652
|
+
if (mn(e)) throw Error("attachFrame: refusing to target the extension's own pages or an FKN platform origin");
|
|
1653
|
+
}, hn = ({ src: e, domains: t, lockdown: n }) => {
|
|
1654
|
+
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");
|
|
1655
|
+
}, gn = {
|
|
1650
1656
|
scope: "embed.iframe",
|
|
1651
1657
|
category: "interaction",
|
|
1652
1658
|
severity: 0,
|
|
1653
1659
|
title: "Load another website inside this app",
|
|
1654
1660
|
description: "Lets the app embed external pages directly inside its own view."
|
|
1655
|
-
},
|
|
1661
|
+
}, _n = {
|
|
1656
1662
|
scope: "embed.open",
|
|
1657
1663
|
category: "interaction",
|
|
1658
1664
|
severity: 0,
|
|
1659
1665
|
title: "Open a website inside this app",
|
|
1660
1666
|
description: "Lets the app navigate to another site without leaving its window."
|
|
1661
|
-
},
|
|
1662
|
-
|
|
1667
|
+
}, vn = class extends Error {
|
|
1668
|
+
name = "FrameWindowBlockedError";
|
|
1669
|
+
constructor() {
|
|
1670
|
+
super("attachFrame: the browser did not open the window. Call attachFrame directly in a click or key handler, and allow popups for this page");
|
|
1671
|
+
}
|
|
1672
|
+
}, yn = /* @__PURE__ */ new Set([
|
|
1673
|
+
"jar-unreachable",
|
|
1674
|
+
"bad-url",
|
|
1675
|
+
"opaque-opener"
|
|
1676
|
+
]), bn = class extends Error {
|
|
1677
|
+
name = "FrameWindowRefusedError";
|
|
1678
|
+
reason;
|
|
1679
|
+
constructor(e) {
|
|
1680
|
+
let t = yn.has(e) ? e : "unknown";
|
|
1681
|
+
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;
|
|
1682
|
+
}
|
|
1683
|
+
}, xn = (e) => {
|
|
1684
|
+
let t = fn({
|
|
1663
1685
|
executor: e.executor,
|
|
1664
|
-
modules:
|
|
1686
|
+
modules: pn,
|
|
1665
1687
|
gate: e.gate
|
|
1666
1688
|
}), n = (t, n = {}) => (X(t), e.goto(t, n)), r = () => e.url(), i = async (t) => {
|
|
1667
1689
|
let n = e.request;
|
|
1668
1690
|
if (!n) throw Error("frame.request: this backend cannot ask for permission categories");
|
|
1669
1691
|
return n(t);
|
|
1692
|
+
}, a = async (t, n) => {
|
|
1693
|
+
let r = e.evaluate;
|
|
1694
|
+
if (!r) throw Error("frame.evaluate: this backend cannot run code in the attached frame");
|
|
1695
|
+
let i = typeof t == "function" ? t.toString() : t;
|
|
1696
|
+
if (typeof i != "string") throw TypeError("frame.evaluate: pass a function or a source string");
|
|
1697
|
+
return r(i, n);
|
|
1670
1698
|
};
|
|
1671
1699
|
return {
|
|
1672
1700
|
...t,
|
|
1673
1701
|
goto: n,
|
|
1674
1702
|
url: r,
|
|
1675
|
-
request: i
|
|
1703
|
+
request: i,
|
|
1704
|
+
evaluate: a
|
|
1676
1705
|
};
|
|
1677
|
-
},
|
|
1678
|
-
i,
|
|
1679
|
-
a,
|
|
1706
|
+
}, Sn = [
|
|
1680
1707
|
t,
|
|
1681
|
-
|
|
1708
|
+
a,
|
|
1709
|
+
ee,
|
|
1682
1710
|
c,
|
|
1683
|
-
l,
|
|
1684
1711
|
o,
|
|
1685
|
-
|
|
1686
|
-
|
|
1712
|
+
l,
|
|
1713
|
+
s,
|
|
1714
|
+
d,
|
|
1715
|
+
i,
|
|
1687
1716
|
n,
|
|
1688
1717
|
u,
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1718
|
+
f,
|
|
1719
|
+
gn,
|
|
1720
|
+
_n,
|
|
1692
1721
|
m,
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1722
|
+
r,
|
|
1723
|
+
Ke,
|
|
1724
|
+
qe,
|
|
1725
|
+
Je,
|
|
1726
|
+
tt,
|
|
1727
|
+
rt
|
|
1728
|
+
], Cn = ut.map((e) => e.id), wn = {
|
|
1699
1729
|
interaction: "act.click",
|
|
1700
1730
|
storage: "read.text",
|
|
1701
1731
|
network: "network.fetchCredentialed",
|
|
1702
1732
|
evaluation: "media.appearU"
|
|
1703
|
-
}, Z = (e) => e === 0 ? "auto" : e === 4 ? "critical" : "bundled", Q =
|
|
1733
|
+
}, Z = (e) => e === 0 ? "auto" : e === 4 ? "critical" : "bundled", Q = Sn, $ = /* @__PURE__ */ new Map(), Tn = {};
|
|
1704
1734
|
(() => {
|
|
1705
|
-
$ = new Map(Q.map((e) => [e.scope, e])),
|
|
1735
|
+
$ = new Map(Q.map((e) => [e.scope, e])), Tn = Object.fromEntries($), Q.filter((e) => e.severity === 4).map((e) => e.scope);
|
|
1706
1736
|
let e = (e) => Q.filter((t) => t.category === e && Z(t.severity) === "bundled");
|
|
1707
|
-
Object.fromEntries(
|
|
1737
|
+
Object.fromEntries(Cn.map((t) => [t, Math.max(0, ...e(t).map((e) => e.severity))])), Object.fromEntries(Cn.map((t) => [t, e(t).some((e) => e.unsafe === !0)]));
|
|
1708
1738
|
})();
|
|
1709
|
-
var
|
|
1739
|
+
var En = (e) => $.get(e)?.category, Dn = (e) => {
|
|
1710
1740
|
let t = $.get(e);
|
|
1711
1741
|
return t && Z(t.severity);
|
|
1712
|
-
},
|
|
1742
|
+
}, On = (e) => {
|
|
1713
1743
|
let t = $.get(e);
|
|
1714
1744
|
if (t) return Z(t.severity) === "critical" ? t.scope : t.category;
|
|
1715
|
-
},
|
|
1716
|
-
let n = t ?? (e &&
|
|
1717
|
-
return n !== void 0 &&
|
|
1718
|
-
},
|
|
1719
|
-
for (let { category: n, key: r } of t) if (
|
|
1745
|
+
}, kn = (e) => wn[e], An = ({ category: e, key: t }) => {
|
|
1746
|
+
let n = t ?? (e && kn(e));
|
|
1747
|
+
return n !== void 0 && En(n) !== void 0 ? n : void 0;
|
|
1748
|
+
}, jn = (e, t) => {
|
|
1749
|
+
for (let { category: n, key: r } of t) if (An({
|
|
1720
1750
|
category: n,
|
|
1721
1751
|
key: r
|
|
1722
1752
|
}) === 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}"`);
|
|
1723
|
-
},
|
|
1753
|
+
}, Mn = (e, t = {}) => {
|
|
1724
1754
|
let n = [], r = e.map((e) => {
|
|
1725
|
-
let r =
|
|
1755
|
+
let r = An(e), i = [];
|
|
1726
1756
|
if (r !== void 0) for (let a of e.hosts) i.push(n.length), n.push({
|
|
1727
1757
|
...t,
|
|
1728
1758
|
key: r,
|
|
@@ -1732,8 +1762,8 @@ var xn = (e) => $.get(e)?.category, Sn = (e) => {
|
|
|
1732
1762
|
reason: e.reason
|
|
1733
1763
|
});
|
|
1734
1764
|
return {
|
|
1735
|
-
key: r !== void 0 &&
|
|
1736
|
-
category: e.category ?? (r === void 0 ? "interaction" :
|
|
1765
|
+
key: r !== void 0 && Dn(r) === "critical" ? r : void 0,
|
|
1766
|
+
category: e.category ?? (r === void 0 ? "interaction" : Tn[r].category),
|
|
1737
1767
|
hosts: e.hosts,
|
|
1738
1768
|
indexes: i
|
|
1739
1769
|
};
|
|
@@ -1747,36 +1777,80 @@ var xn = (e) => $.get(e)?.category, Sn = (e) => {
|
|
|
1747
1777
|
allow: i.length > 0 && i.every((t) => e[t]?.allow === !0)
|
|
1748
1778
|
}))
|
|
1749
1779
|
};
|
|
1750
|
-
},
|
|
1751
|
-
|
|
1752
|
-
|
|
1780
|
+
}, Nn = (e) => {
|
|
1781
|
+
let t = e;
|
|
1782
|
+
if (t.window === void 0) return "iframe";
|
|
1783
|
+
if (t.iframe !== void 0) throw TypeError("attachFrame: pass either iframe or window, not both");
|
|
1784
|
+
if (t.lockdown) throw TypeError("attachFrame: lockdown applies to an iframe, never to a window");
|
|
1785
|
+
if (typeof t.window != "object" || t.window === null) throw TypeError("attachFrame: window must be an object");
|
|
1786
|
+
return "window";
|
|
1787
|
+
}, Pn = (e, t, n) => {
|
|
1788
|
+
if (e === void 0) return t;
|
|
1789
|
+
if (typeof e != "number" || !Number.isFinite(e) || e <= 0) throw TypeError(`attachFrame: window.${n} must be a positive number of CSS pixels`);
|
|
1790
|
+
return Math.round(e);
|
|
1791
|
+
}, Fn = ({ url: e, width: t, height: n }) => {
|
|
1792
|
+
let r = (() => {
|
|
1793
|
+
if (e === void 0 || e === "" || e === "about:blank") return "";
|
|
1794
|
+
if (typeof e != "string") throw TypeError("attachFrame: window.url must be a string");
|
|
1795
|
+
let t = (() => {
|
|
1796
|
+
try {
|
|
1797
|
+
return new URL(e, location.href);
|
|
1798
|
+
} catch {
|
|
1799
|
+
throw TypeError(`attachFrame: window.url is not a valid URL: ${e}`);
|
|
1800
|
+
}
|
|
1801
|
+
})();
|
|
1802
|
+
if (t.protocol !== "http:" && t.protocol !== "https:") throw TypeError("attachFrame: window.url must be an http or https address");
|
|
1803
|
+
return t.href;
|
|
1804
|
+
})();
|
|
1805
|
+
return r && X(r), {
|
|
1806
|
+
url: r,
|
|
1807
|
+
width: Pn(t, 500, "width"),
|
|
1808
|
+
height: Pn(n, 700, "height")
|
|
1809
|
+
};
|
|
1810
|
+
}, In = "FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY", Ln = !1, Rn = () => {
|
|
1811
|
+
Ln || (Ln = !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."));
|
|
1812
|
+
}, zn = async ({ iframe: e, domains: t = [], syncCookies: n = !0, lockdown: r = !1, permissions: i }) => {
|
|
1753
1813
|
let a = crypto.randomUUID();
|
|
1754
|
-
if (X(e.src),
|
|
1814
|
+
if (X(e.src), hn({
|
|
1755
1815
|
src: e.src,
|
|
1756
1816
|
domains: t,
|
|
1757
1817
|
lockdown: r
|
|
1758
|
-
}), await
|
|
1759
|
-
e.dispatchEvent(new CustomEvent(
|
|
1760
|
-
let { executeLocator: o, highlightLocator: s, ensureLocatorPermission: c, requestCategories: l,
|
|
1818
|
+
}), await O(), !e.isConnected) throw Error("attachFrame: the iframe must be connected to the document before attaching");
|
|
1819
|
+
e.dispatchEvent(new CustomEvent(In, { detail: a }));
|
|
1820
|
+
let { executeLocator: o, highlightLocator: s, ensureLocatorPermission: c, requestCategories: l, evaluateFrame: u, goto: d } = await k.attachFrame({
|
|
1761
1821
|
marker: a,
|
|
1762
1822
|
domains: t,
|
|
1763
1823
|
syncCookies: n,
|
|
1764
1824
|
lockdown: r
|
|
1765
|
-
}),
|
|
1825
|
+
}), f = xn({
|
|
1766
1826
|
executor: {
|
|
1767
1827
|
execute: o,
|
|
1768
1828
|
highlight: s
|
|
1769
1829
|
},
|
|
1770
1830
|
gate: (e) => c(e.parts, e.operation, e.args),
|
|
1771
|
-
request: async (e) => (
|
|
1772
|
-
|
|
1831
|
+
request: async (e) => (jn("frame.request", e), await st(), l(e)),
|
|
1832
|
+
evaluate: async (e, t) => {
|
|
1833
|
+
if (!je(E(), "evaluate")) {
|
|
1834
|
+
let e = E();
|
|
1835
|
+
throw new T("evaluate", e.status === "ok" ? e.abi : 0);
|
|
1836
|
+
}
|
|
1837
|
+
return u({
|
|
1838
|
+
source: e,
|
|
1839
|
+
arg: t
|
|
1840
|
+
});
|
|
1841
|
+
},
|
|
1842
|
+
goto: (e, t = {}) => d({
|
|
1773
1843
|
url: e,
|
|
1774
1844
|
...t
|
|
1775
1845
|
}),
|
|
1776
1846
|
url: () => e.src
|
|
1777
1847
|
});
|
|
1778
|
-
return i?.length && (
|
|
1779
|
-
},
|
|
1848
|
+
return i?.length && (ot() ? await f.request(i) : Rn()), f;
|
|
1849
|
+
}, Bn = "attachFrame: window mode is served by the cloud backend for now, whatever extension is installed. Use cloud.attachFrame({ window })", Vn = async (e) => {
|
|
1850
|
+
if (Fn(e.window), e.syncCookies === !1) throw TypeError("attachFrame: syncCookies false does not apply to an extension window, which is the site's own first-party tab");
|
|
1851
|
+
let t = E();
|
|
1852
|
+
throw new T("attachWindow", t.status === "absent" ? 0 : t.abi, Bn);
|
|
1853
|
+
}, Hn = (async (e) => Nn(e) === "window" ? Vn(e) : zn(e)), Un = "permissions.request: pass hosts, the sites the grant applies to", Wn = { request: async (e) => {
|
|
1780
1854
|
let t = e.map((e) => {
|
|
1781
1855
|
let { category: t, key: n, scope: r, reason: i, hosts: a } = e;
|
|
1782
1856
|
if (!("hosts" in e) && !("category" in e)) return { legacy: {
|
|
@@ -1785,7 +1859,7 @@ var xn = (e) => $.get(e)?.category, Sn = (e) => {
|
|
|
1785
1859
|
reason: i
|
|
1786
1860
|
} };
|
|
1787
1861
|
let o = p(a ?? [], { ipv6: !0 });
|
|
1788
|
-
if (!o.length) throw TypeError(
|
|
1862
|
+
if (!o.length) throw TypeError(Un);
|
|
1789
1863
|
return { ask: {
|
|
1790
1864
|
category: t,
|
|
1791
1865
|
key: n,
|
|
@@ -1793,9 +1867,9 @@ var xn = (e) => $.get(e)?.category, Sn = (e) => {
|
|
|
1793
1867
|
hosts: o
|
|
1794
1868
|
} };
|
|
1795
1869
|
}), n = t.flatMap((e) => "ask" in e ? [e.ask] : []);
|
|
1796
|
-
|
|
1797
|
-
let { items: r, answer: i } =
|
|
1870
|
+
jn("permissions.request", n), n.length && await st();
|
|
1871
|
+
let { items: r, answer: i } = Mn(n), a = t.flatMap((e) => "legacy" in e ? [e.legacy] : []), o = [...r, ...a], s = o.length ? await k.requestPermissions(o) : [], c = i(s.slice(0, r.length)), l = s.slice(r.length), u = 0, d = 0;
|
|
1798
1872
|
return t.map((e) => "ask" in e ? c[u++] : l[d++]);
|
|
1799
|
-
} },
|
|
1873
|
+
} }, Gn = (e) => typeof e == "object" && !!e, Kn = "PermissionDeniedError", qn = (e) => e instanceof Error ? e.name === Kn : Gn(e) && e.name === "PermissionDeniedError";
|
|
1800
1874
|
//#endregion
|
|
1801
|
-
export {
|
|
1875
|
+
export { Se as $, at as A, Xe as B, V as C, yt as D, Et as E, et as F, Pe as G, He as H, qe as I, Ie as J, Fe as K, Je as L, nt as M, tt as N, ut as O, Qe as P, w as Q, Ke as R, Ct as S, St as T, Ve as U, A as V, Be as W, xe as X, O as Y, T as Z, hn as _, Hn as a, ye as at, I as b, En as c, vn as d, Ae as et, bn as f, X as g, _n as h, In as i, _e as it, it as j, rt as k, On as l, xn as m, qn as n, ve as nt, Nn as o, b as ot, gn as p, E as q, Wn as r, C as rt, Fn as s, Kn as t, be as tt, Dn as u, mn as v, L as w, B as x, wt as y, Ze as z };
|