@fkn/lib 0.9.1 → 0.9.3
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.js +2 -2
- package/{api-CLpsJzJy.d.ts → api-BFqrrvzI.d.ts} +7 -0
- package/{api-CAZo3BT0.js → api-CtmJlpfo.js} +1 -1
- package/{api-BwrS6P0x.cjs → api-UzF-KbxK.cjs} +1 -1
- package/cloud/dgram.cjs +1 -1
- package/cloud/dgram.js +1 -1
- package/cloud/fs.cjs +1 -1
- package/cloud/fs.js +2 -2
- package/cloud/net.cjs +1 -1
- package/cloud/net.d.ts +1 -1
- package/cloud/net.js +1 -1
- package/{cloud-BcpPsNs3.cjs → cloud-B_Q0iiCr.cjs} +1 -1
- package/{cloud-7C3sOMF_.d.ts → cloud-CAOIpDIH.d.ts} +3 -3
- package/{cloud-DArHoBaw.js → cloud-CnddU57R.js} +20 -18
- package/cloud.cjs +1 -1
- package/cloud.d.ts +2 -2
- package/cloud.js +4 -4
- package/desktop.cjs +1 -1
- package/desktop.js +1 -1
- package/{dgram-C1yYxLEI.js → dgram-Bq_i0wX0.js} +2 -2
- package/{dgram-pCNllfov.cjs → dgram-C6ADuKcR.cjs} +1 -1
- package/dgram.cjs +1 -1
- package/dgram.d.ts +1 -1
- package/dgram.js +1 -1
- package/dns.cjs +1 -1
- package/dns.js +2 -2
- package/extension-D7SSKewV.d.ts +16 -0
- package/extension-H9AUHZdt.js +73 -0
- package/extension-QRMx3Qhh.cjs +1 -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 +1 -1
- package/fs/promises.js +1 -1
- package/fs-DU9rph4j.js +315 -0
- package/fs-V_Sx6o9N.cjs +1 -0
- package/fs.cjs +1 -1
- package/fs.d.ts +2 -2
- package/fs.js +2 -2
- package/http.cjs +1 -1
- package/http.d.ts +1 -1
- package/http.js +2 -2
- package/{index-Bt2VAVEC.d.ts → index-BIZeEsNu.d.ts} +5 -2
- package/{index-BJztAQIP.d.ts → index-pr5vLVVT.d.ts} +499 -406
- package/index.cjs +1 -1
- package/index.d.ts +6 -6
- package/index.js +28 -28
- package/{net--o3_puH-.d.ts → net-MbSFrO35.d.ts} +1 -1
- package/{net-BOyLJ3mh.cjs → net-eFlsYreG.cjs} +1 -1
- package/{net-VAkfxAvn.js → net-kkSsmaSz.js} +2 -2
- package/net.cjs +1 -1
- package/net.d.ts +1 -1
- package/net.js +1 -1
- package/{opfs-7_GmzQ93.js → opfs-BibrNGF0.js} +1 -1
- package/{opfs-uClkgnb5.cjs → opfs-CXMESVLc.cjs} +1 -1
- package/opfs.cjs +1 -1
- package/opfs.js +2 -2
- package/package.json +1 -1
- package/packages.cjs +1 -1
- package/packages.js +2 -2
- package/{proxy-B3rliZN8.js → proxy-8bvtaeNn.js} +505 -603
- package/proxy-D2cxusWD.cjs +53 -0
- package/rolldown-runtime-BIInC43l.cjs +1 -0
- package/{rolldown-runtime-DF993M8W.js → rolldown-runtime-Dy4uBu1J.js} +2 -2
- package/{storage-InqJHrkf.js → storage-YL0pIVoy.js} +2 -2
- package/{storage-C1BT8jwJ.cjs → storage-fSj65-d5.cjs} +1 -1
- package/background-DMESyLZ6.cjs +0 -1
- package/background-DxYR_JMs.js +0 -1028
- package/extension-3pxUYwrA.d.ts +0 -16
- package/extension-CjJNj5Yl.cjs +0 -1
- package/extension-Qs02HPzR.js +0 -67
- package/fs-B8Rc1zRI.cjs +0 -1
- package/fs-CvCcDnzN.js +0 -260
- package/proxy-g2yknq7C.cjs +0 -53
- package/rolldown-runtime-Doa5O59j.cjs +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "./api-
|
|
1
|
+
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
+
import { t } from "./api-CtmJlpfo.js";
|
|
3
3
|
import { BoxBase as n, createTypedEventTarget as r, expose as i, recursiveBox as a, recursiveRevive as o } from "osra";
|
|
4
4
|
//#region node_modules/@mfkn/web-extension/lib/lib/revivables/event-proxy.js
|
|
5
5
|
var s = (e, t) => {
|
|
@@ -53,10 +53,10 @@ var s = (e, t) => {
|
|
|
53
53
|
dispatchEvent: (t) => e.remoteEvents.dispatchEvent(t)
|
|
54
54
|
};
|
|
55
55
|
}, u = /* @__PURE__ */ e({
|
|
56
|
-
box: () =>
|
|
57
|
-
createVideoElementHandle: () =>
|
|
58
|
-
isType: () =>
|
|
59
|
-
revive: () =>
|
|
56
|
+
box: () => w,
|
|
57
|
+
createVideoElementHandle: () => S,
|
|
58
|
+
isType: () => C,
|
|
59
|
+
revive: () => T,
|
|
60
60
|
type: () => d
|
|
61
61
|
}), d = "videoElement", f = [
|
|
62
62
|
"currentTime",
|
|
@@ -109,7 +109,7 @@ var s = (e, t) => {
|
|
|
109
109
|
} : null, ne = (e) => s(e, (e, t) => ({
|
|
110
110
|
originalDetail: e instanceof CustomEvent ? e.detail : null,
|
|
111
111
|
snapshot: y(t)
|
|
112
|
-
})),
|
|
112
|
+
})), re = 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,8 +124,8 @@ var s = (e, t) => {
|
|
|
124
124
|
}
|
|
125
125
|
default: throw Error(`videoElement: unknown method "${t}"`);
|
|
126
126
|
}
|
|
127
|
-
},
|
|
128
|
-
call: async (t) =>
|
|
127
|
+
}, b = (e) => ({
|
|
128
|
+
call: async (t) => re(e, t),
|
|
129
129
|
set: async (t, n) => {
|
|
130
130
|
try {
|
|
131
131
|
e[t] = n;
|
|
@@ -133,7 +133,7 @@ var s = (e, t) => {
|
|
|
133
133
|
return y(e);
|
|
134
134
|
},
|
|
135
135
|
events: ne(e)
|
|
136
|
-
}),
|
|
136
|
+
}), x = (e, t) => {
|
|
137
137
|
let n = new EventTarget();
|
|
138
138
|
Object.defineProperty(n, h, { value: !0 }), Object.defineProperty(n, g, { value: e }), Object.defineProperty(n, _, { value: t });
|
|
139
139
|
let r = l({
|
|
@@ -234,7 +234,7 @@ var s = (e, t) => {
|
|
|
234
234
|
}
|
|
235
235
|
};
|
|
236
236
|
return Object.defineProperties(n, i), n;
|
|
237
|
-
},
|
|
237
|
+
}, S = (e) => x(y(e), b(e)), C = (e) => typeof e == "object" && !!e && e[h] === !0, w = (e, t) => {
|
|
238
238
|
let r = e;
|
|
239
239
|
return {
|
|
240
240
|
...n,
|
|
@@ -242,67 +242,67 @@ var s = (e, t) => {
|
|
|
242
242
|
initialState: r[g],
|
|
243
243
|
controller: a(r[_], t)
|
|
244
244
|
};
|
|
245
|
-
},
|
|
245
|
+
}, T = (e, t) => {
|
|
246
246
|
let n = o(e.controller, t);
|
|
247
|
-
return
|
|
248
|
-
},
|
|
249
|
-
typeof document < "u" && document.addEventListener(
|
|
250
|
-
|
|
247
|
+
return x({ ...e.initialState }, n);
|
|
248
|
+
}, E = (e) => [u, ...e], ie = "FKN_WEB_EXTENSION_MAIN_WORLD_CONTENT_SCRIPT_ENABLED_EVENT_KEY", ae = "fknExtension", D = r();
|
|
249
|
+
typeof document < "u" && document.addEventListener(ie, () => {
|
|
250
|
+
D.dispatchEvent(new CustomEvent("statuschange", { detail: { enabled: O() } }));
|
|
251
251
|
});
|
|
252
|
-
var
|
|
253
|
-
|
|
254
|
-
},
|
|
255
|
-
if (
|
|
252
|
+
var O = () => typeof document > "u" ? !1 : document.documentElement.dataset[ae] === "true", k = null, oe = (e) => {
|
|
253
|
+
k = e;
|
|
254
|
+
}, se = 150, A = (e = 1e3) => new Promise((t, n) => {
|
|
255
|
+
if (O()) return t();
|
|
256
256
|
let r, i = (e) => {
|
|
257
257
|
clearTimeout(r), s.disconnect(), document.removeEventListener("readystatechange", c), e();
|
|
258
258
|
}, a = () => i(async () => {
|
|
259
|
-
if (
|
|
259
|
+
if (k && (await k().catch(() => {}), O())) return t();
|
|
260
260
|
n(/* @__PURE__ */ Error("The FKN WebExtension is not installed, enabled or not exposed on this page."));
|
|
261
261
|
}), o = () => {
|
|
262
|
-
clearTimeout(r), r = setTimeout(() =>
|
|
262
|
+
clearTimeout(r), r = setTimeout(() => O() ? i(t) : a(), se);
|
|
263
263
|
}, s = new MutationObserver(() => {
|
|
264
|
-
|
|
264
|
+
O() && i(t);
|
|
265
265
|
}), c = () => {
|
|
266
|
-
document.readyState === "complete" && !
|
|
266
|
+
document.readyState === "complete" && !O() && o();
|
|
267
267
|
};
|
|
268
268
|
if (r = setTimeout(a, e), s.observe(document.documentElement, {
|
|
269
269
|
attributes: !0,
|
|
270
270
|
attributeFilter: ["data-fkn-extension"]
|
|
271
271
|
}), document.addEventListener("readystatechange", c), document.readyState === "complete") return o();
|
|
272
|
-
|
|
273
|
-
}),
|
|
274
|
-
await
|
|
272
|
+
O() && i(t);
|
|
273
|
+
}), ce, j = new Proxy({}, { get: (e, t) => async (...e) => {
|
|
274
|
+
await A(), ce ??= i({}, {
|
|
275
275
|
transport: window,
|
|
276
|
-
revivableModules:
|
|
276
|
+
revivableModules: E
|
|
277
277
|
});
|
|
278
|
-
let n = (await
|
|
278
|
+
let n = (await ce)[t];
|
|
279
279
|
return n(...e);
|
|
280
|
-
} }),
|
|
280
|
+
} }), le = {
|
|
281
281
|
scope: "network.fetch",
|
|
282
282
|
category: "network",
|
|
283
283
|
severity: 0,
|
|
284
284
|
title: "Fetch data from other sites",
|
|
285
285
|
description: "Lets the app download public data from other websites directly, past the usual cross-origin limits."
|
|
286
|
-
},
|
|
286
|
+
}, ue = {
|
|
287
287
|
scope: "network.fetchCredentialed",
|
|
288
288
|
category: "network",
|
|
289
289
|
severity: 3,
|
|
290
290
|
unsafe: !0,
|
|
291
291
|
title: "Fetch from other sites, signed in as you",
|
|
292
292
|
description: "Lets the app fetch other sites using your logged-in session cookies, so it can read data only you should see."
|
|
293
|
-
},
|
|
293
|
+
}, de = {
|
|
294
294
|
scope: "network.fetchLocal",
|
|
295
295
|
category: "network",
|
|
296
296
|
severity: 3,
|
|
297
297
|
unsafe: !0,
|
|
298
298
|
title: "Access devices on your local network",
|
|
299
299
|
description: "Lets the app reach devices and services on your home or work network, which websites normally cannot touch."
|
|
300
|
-
},
|
|
300
|
+
}, fe = (e) => {
|
|
301
301
|
let t = e.match(/^(\d+)\.(\d+)\.\d+\.\d+$/);
|
|
302
302
|
if (!t) return !1;
|
|
303
303
|
let [n, r] = [Number(t[1]), Number(t[2])];
|
|
304
304
|
return n === 10 || n === 127 || n === 0 || n === 169 && r === 254 || n === 172 && r >= 16 && r <= 31 || n === 192 && r === 168;
|
|
305
|
-
},
|
|
305
|
+
}, pe = (e) => {
|
|
306
306
|
let t;
|
|
307
307
|
try {
|
|
308
308
|
t = new URL(e);
|
|
@@ -310,8 +310,8 @@ var k = () => typeof document > "u" ? !1 : document.documentElement.dataset[ie]
|
|
|
310
310
|
return !1;
|
|
311
311
|
}
|
|
312
312
|
let n = t.hostname.replace(/^\[|\]$/g, "").toLowerCase().replace(/\.$/, "");
|
|
313
|
-
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:") :
|
|
314
|
-
},
|
|
313
|
+
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:") : fe(n);
|
|
314
|
+
}, me = ["fkn.app", "fkn.dev"], M = (e) => {
|
|
315
315
|
let t;
|
|
316
316
|
try {
|
|
317
317
|
t = new URL(e);
|
|
@@ -320,130 +320,46 @@ var k = () => typeof document > "u" ? !1 : document.documentElement.dataset[ie]
|
|
|
320
320
|
}
|
|
321
321
|
if (t.protocol === "chrome-extension:" || t.protocol === "moz-extension:") return !0;
|
|
322
322
|
let n = t.hostname;
|
|
323
|
-
return
|
|
324
|
-
},
|
|
325
|
-
if (
|
|
326
|
-
},
|
|
323
|
+
return me.some((e) => n === e || n.endsWith(`.${e}`));
|
|
324
|
+
}, N = (e) => {
|
|
325
|
+
if (M(e)) throw Error("fetch: refusing to target the extension's own pages or FKN platform domains");
|
|
326
|
+
}, he = ["origin", "referer"], ge = (e) => {
|
|
327
327
|
if (!e?.headers) return;
|
|
328
|
-
let t = new Headers(e.headers), n =
|
|
328
|
+
let t = new Headers(e.headers), n = he.map((e) => {
|
|
329
329
|
let n = t.get(e);
|
|
330
330
|
return n === null ? void 0 : [e, n];
|
|
331
331
|
}).filter((e) => e !== void 0);
|
|
332
332
|
return n.length ? n : void 0;
|
|
333
|
-
},
|
|
333
|
+
}, _e = async (e, t) => {
|
|
334
334
|
let n = new Request(e, t);
|
|
335
|
-
|
|
335
|
+
N(n.url);
|
|
336
336
|
let r = n.body ? await n.arrayBuffer() : null;
|
|
337
|
-
return
|
|
337
|
+
return j.proxyFetch({
|
|
338
338
|
url: n.url,
|
|
339
339
|
method: n.method,
|
|
340
340
|
headers: [...n.headers],
|
|
341
341
|
body: r,
|
|
342
342
|
credentials: t?.credentials === "include" ? "include" : "omit",
|
|
343
343
|
redirect: n.redirect,
|
|
344
|
-
unsafeHeaders:
|
|
344
|
+
unsafeHeaders: ge(t),
|
|
345
345
|
reason: t?.reason,
|
|
346
346
|
signal: t?.signal ?? void 0
|
|
347
347
|
});
|
|
348
|
-
},
|
|
348
|
+
}, ve = {
|
|
349
349
|
scope: "network.readCookie",
|
|
350
350
|
category: "network",
|
|
351
351
|
severity: 3,
|
|
352
352
|
unsafe: !0,
|
|
353
353
|
title: "Read a site’s cookie",
|
|
354
354
|
description: "Lets the app read a named cookie from another site, which can include the login token only that site should see."
|
|
355
|
-
},
|
|
355
|
+
}, ye = { get: (e) => j.getCookie(e) }, be = {
|
|
356
356
|
scope: "network.modifyRequestHeaders",
|
|
357
357
|
category: "network",
|
|
358
358
|
severity: 2,
|
|
359
359
|
unsafe: !0,
|
|
360
360
|
title: "Rewrite request headers to other sites",
|
|
361
361
|
description: "Lets the app set or remove headers (like Origin and Referer) on this page’s own requests to the listed sites."
|
|
362
|
-
},
|
|
363
|
-
name: I,
|
|
364
|
-
operation: e,
|
|
365
|
-
backend: t
|
|
366
|
-
}), Te = (e) => e instanceof Error ? e.name === I : typeof e == "object" && !!e && e.name === "LocatorUnsupportedError", Ee = 3e4, De = 50, Oe = (e) => {
|
|
367
|
-
let t = e[e.length - 1];
|
|
368
|
-
return typeof t == "object" && t ? t : void 0;
|
|
369
|
-
}, ke = (e) => {
|
|
370
|
-
let t = Oe(e)?.timeout;
|
|
371
|
-
return typeof t == "number" ? t : Ee;
|
|
372
|
-
}, Ae = async (e, t, n, r, i) => {
|
|
373
|
-
i && await i(t, n, r);
|
|
374
|
-
let a = e, o = ke(r), s = Date.now() + o, c = /* @__PURE__ */ Error(`Locator timeout (${o}ms): ${n}`), { promise: l, reject: u } = Promise.withResolvers(), d = setTimeout(() => u(c), o), f = c;
|
|
375
|
-
try {
|
|
376
|
-
for (; Date.now() < s;) try {
|
|
377
|
-
return await Promise.race([a(t, n, r), l]);
|
|
378
|
-
} catch (e) {
|
|
379
|
-
if (e === c) break;
|
|
380
|
-
if (Ce(e) || Te(e)) throw e;
|
|
381
|
-
f = e;
|
|
382
|
-
let t = s - Date.now();
|
|
383
|
-
if (t <= 0) break;
|
|
384
|
-
await new Promise((e) => setTimeout(e, Math.min(De, t)));
|
|
385
|
-
}
|
|
386
|
-
} finally {
|
|
387
|
-
clearTimeout(d);
|
|
388
|
-
}
|
|
389
|
-
throw f;
|
|
390
|
-
}, L = /* @__PURE__ */ e({
|
|
391
|
-
render: () => Ne,
|
|
392
|
-
resolve: () => Me,
|
|
393
|
-
type: () => je
|
|
394
|
-
}), je = "locator", Me = (e, t) => e.elements.flatMap((e) => [...e.querySelectorAll(t)]), Ne = (e) => ({
|
|
395
|
-
fragment: typeof e == "string" ? e : "?",
|
|
396
|
-
separator: "descend"
|
|
397
|
-
}), Pe = "FKN_WEB_EXTENSION_FRAME_ANNOUNCE_REQUEST_KEY", Fe = typeof chrome < "u" && !!chrome.runtime?.id, Ie = (e) => F(e) && e.FKN_WEB_EXTENSION_FRAME_ANNOUNCE_KEY === !0 && typeof e.frameId == "string", R = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new Set(), Le = (e) => (B.add(e), () => B.delete(e));
|
|
398
|
-
typeof window < "u" && Fe && window.addEventListener("message", (e) => {
|
|
399
|
-
if (!Ie(e.data)) return;
|
|
400
|
-
e.stopImmediatePropagation();
|
|
401
|
-
let t = e.source;
|
|
402
|
-
if (!t || typeof t != "object") return;
|
|
403
|
-
let n = t, r = R.get(n), i = e.data.frameId;
|
|
404
|
-
if (R.set(n, i), r) for (let e of B) e(r);
|
|
405
|
-
let a = z.get(n);
|
|
406
|
-
if (a) {
|
|
407
|
-
z.delete(n);
|
|
408
|
-
for (let e of a) e(i);
|
|
409
|
-
}
|
|
410
|
-
}, { capture: !0 });
|
|
411
|
-
var Re = (e) => {
|
|
412
|
-
let t = e.contentWindow;
|
|
413
|
-
if (!t) return Promise.reject(/* @__PURE__ */ Error("frameLocator: <iframe> has no contentWindow"));
|
|
414
|
-
let n = R.get(t);
|
|
415
|
-
return n ? Promise.resolve(n) : new Promise((e) => {
|
|
416
|
-
let n = z.get(t) ?? [];
|
|
417
|
-
n.push(e), z.set(t, n), t.postMessage({ [Pe]: !0 }, "*");
|
|
418
|
-
});
|
|
419
|
-
}, V = /* @__PURE__ */ e({
|
|
420
|
-
render: () => He,
|
|
421
|
-
resolve: () => Be,
|
|
422
|
-
resolvePeer: () => Ve,
|
|
423
|
-
type: () => ze
|
|
424
|
-
}), ze = "frameLocator", Be = (e, t) => e.elements.flatMap((e) => [...e.querySelectorAll(t)]).filter((e) => e instanceof HTMLIFrameElement), Ve = async ({ parts: e, selfIndex: t, resolveLocal: n }) => {
|
|
425
|
-
let r = n(e.slice(0, t + 1))[0];
|
|
426
|
-
if (!r) throw Error("frameLocator: no <iframe> matched");
|
|
427
|
-
if (!(r instanceof HTMLIFrameElement)) throw Error(`frameLocator: expected <iframe>, got <${r.tagName.toLowerCase()}>`);
|
|
428
|
-
return Re(r);
|
|
429
|
-
}, He = (e) => ({
|
|
430
|
-
fragment: typeof e == "string" ? e : "?",
|
|
431
|
-
separator: "frame-down"
|
|
432
|
-
}), Ue = /* @__PURE__ */ e({
|
|
433
|
-
render: () => qe,
|
|
434
|
-
resolve: () => Ge,
|
|
435
|
-
resolvePeer: () => Ke,
|
|
436
|
-
type: () => We
|
|
437
|
-
}), We = "owner", Ge = (e) => {
|
|
438
|
-
throw Error("owner: must be processed by the executor as an upward pivot");
|
|
439
|
-
}, Ke = async () => {
|
|
440
|
-
let { backgroundResolvers: e } = await import("./background-DxYR_JMs.js"), t = await (await e).getParentFrameId();
|
|
441
|
-
if (!t) throw Error("owner: already at top frame");
|
|
442
|
-
return t;
|
|
443
|
-
}, qe = () => ({
|
|
444
|
-
fragment: "",
|
|
445
|
-
separator: "frame-up"
|
|
446
|
-
}), Je = class extends Error {
|
|
362
|
+
}, xe = (e) => j.setRequestHeaderRule(e), Se = (e) => j.removeRequestHeaderRule({ ruleId: e }), Ce = class extends Error {
|
|
447
363
|
reason;
|
|
448
364
|
filename;
|
|
449
365
|
line;
|
|
@@ -452,18 +368,18 @@ var Re = (e) => {
|
|
|
452
368
|
constructor(e, t, n, r, i) {
|
|
453
369
|
super(`${e}:${n}:${r}: ${t}`), this.reason = t, this.filename = e, this.line = n, this.column = r, this.source = i;
|
|
454
370
|
}
|
|
455
|
-
},
|
|
371
|
+
}, we = class {
|
|
456
372
|
start;
|
|
457
373
|
end;
|
|
458
374
|
source;
|
|
459
375
|
constructor(e, t, n) {
|
|
460
376
|
this.start = e, this.end = t, this.source = n;
|
|
461
377
|
}
|
|
462
|
-
},
|
|
378
|
+
}, P;
|
|
463
379
|
(function(e) {
|
|
464
380
|
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";
|
|
465
|
-
})(
|
|
466
|
-
var
|
|
381
|
+
})(P ||= {});
|
|
382
|
+
var F = (e, t, n) => {
|
|
467
383
|
let r = n, i = 1e4;
|
|
468
384
|
do {
|
|
469
385
|
let n = t.map((t) => e.indexOf(t, r));
|
|
@@ -475,7 +391,7 @@ var U = (e, t, n) => {
|
|
|
475
391
|
r = o + 2, i--;
|
|
476
392
|
} while (i > 0);
|
|
477
393
|
throw Error("Too many escaping");
|
|
478
|
-
},
|
|
394
|
+
}, I = (e, t, n) => {
|
|
479
395
|
let r = n, i = 1e4;
|
|
480
396
|
do {
|
|
481
397
|
let n = t.map((t) => e.indexOf(t, r));
|
|
@@ -489,21 +405,21 @@ var U = (e, t, n) => {
|
|
|
489
405
|
break;
|
|
490
406
|
case "(":
|
|
491
407
|
{
|
|
492
|
-
let t =
|
|
408
|
+
let t = I(e, [")"], o + 1);
|
|
493
409
|
if (t === -1) return -1;
|
|
494
410
|
r = t + 1;
|
|
495
411
|
}
|
|
496
412
|
break;
|
|
497
413
|
case "\"":
|
|
498
414
|
{
|
|
499
|
-
let t =
|
|
415
|
+
let t = F(e, ["\""], o + 1);
|
|
500
416
|
if (t === -1) return -1;
|
|
501
417
|
r = t + 1;
|
|
502
418
|
}
|
|
503
419
|
break;
|
|
504
420
|
case "'":
|
|
505
421
|
{
|
|
506
|
-
let t =
|
|
422
|
+
let t = F(e, ["'"], o + 1);
|
|
507
423
|
if (t === -1) return -1;
|
|
508
424
|
r = t + 1;
|
|
509
425
|
}
|
|
@@ -513,17 +429,17 @@ var U = (e, t, n) => {
|
|
|
513
429
|
i--;
|
|
514
430
|
} while (i > 0);
|
|
515
431
|
throw Error("Too many escaping");
|
|
516
|
-
},
|
|
517
|
-
function
|
|
432
|
+
}, L = /\/\*[^]*?(?:\*\/|$)/g;
|
|
433
|
+
function R(e) {
|
|
518
434
|
return e ? e.trim() : "";
|
|
519
435
|
}
|
|
520
|
-
function
|
|
436
|
+
function z(e, t) {
|
|
521
437
|
let n = e && typeof e.type == "string", r = n ? e : t;
|
|
522
438
|
for (let t in e) {
|
|
523
439
|
let n = e[t];
|
|
524
440
|
Array.isArray(n) ? n.forEach((e) => {
|
|
525
|
-
|
|
526
|
-
}) : n && typeof n == "object" &&
|
|
441
|
+
z(e, r);
|
|
442
|
+
}) : n && typeof n == "object" && z(n, r);
|
|
527
443
|
}
|
|
528
444
|
return n && Object.defineProperty(e, "parent", {
|
|
529
445
|
configurable: !0,
|
|
@@ -532,7 +448,7 @@ function q(e, t) {
|
|
|
532
448
|
value: t || null
|
|
533
449
|
}), e;
|
|
534
450
|
}
|
|
535
|
-
var
|
|
451
|
+
var Te = class {
|
|
536
452
|
level = 0;
|
|
537
453
|
indentation = " ";
|
|
538
454
|
compress = !1;
|
|
@@ -547,33 +463,33 @@ var Xe = class {
|
|
|
547
463
|
}
|
|
548
464
|
visit(e) {
|
|
549
465
|
switch (e.type) {
|
|
550
|
-
case
|
|
551
|
-
case
|
|
552
|
-
case
|
|
553
|
-
case
|
|
554
|
-
case
|
|
555
|
-
case
|
|
556
|
-
case
|
|
557
|
-
case
|
|
558
|
-
case
|
|
559
|
-
case
|
|
560
|
-
case
|
|
561
|
-
case
|
|
562
|
-
case
|
|
563
|
-
case
|
|
564
|
-
case
|
|
565
|
-
case
|
|
566
|
-
case
|
|
567
|
-
case
|
|
568
|
-
case
|
|
569
|
-
case
|
|
570
|
-
case
|
|
571
|
-
case
|
|
572
|
-
case
|
|
573
|
-
case
|
|
574
|
-
case
|
|
575
|
-
case
|
|
576
|
-
case
|
|
466
|
+
case P.stylesheet: return this.stylesheet(e);
|
|
467
|
+
case P.rule: return this.rule(e);
|
|
468
|
+
case P.declaration: return this.declaration(e);
|
|
469
|
+
case P.comment: return this.comment(e);
|
|
470
|
+
case P.container: return this.container(e);
|
|
471
|
+
case P.charset: return this.charset(e);
|
|
472
|
+
case P.counterStyle: return this.counterStyle(e);
|
|
473
|
+
case P.document: return this.document(e);
|
|
474
|
+
case P.customMedia: return this.customMedia(e);
|
|
475
|
+
case P.fontFace: return this.fontFace(e);
|
|
476
|
+
case P.fontFeatureValues: return this.fontFeatureValues(e);
|
|
477
|
+
case P.host: return this.host(e);
|
|
478
|
+
case P.import: return this.import(e);
|
|
479
|
+
case P.keyframes: return this.keyframes(e);
|
|
480
|
+
case P.keyframe: return this.keyframe(e);
|
|
481
|
+
case P.layer: return this.layer(e);
|
|
482
|
+
case P.media: return this.media(e);
|
|
483
|
+
case P.namespace: return this.namespace(e);
|
|
484
|
+
case P.page: return this.page(e);
|
|
485
|
+
case P.pageMarginBox: return this.pageMarginBox(e);
|
|
486
|
+
case P.positionTry: return this.positionTry(e);
|
|
487
|
+
case P.property: return this.property(e);
|
|
488
|
+
case P.scope: return this.scope(e);
|
|
489
|
+
case P.startingStyle: return this.startingStyle(e);
|
|
490
|
+
case P.supports: return this.supports(e);
|
|
491
|
+
case P.viewTransition: return this.viewTransition(e);
|
|
492
|
+
case P.atRule: return this.genericAtRule(e);
|
|
577
493
|
}
|
|
578
494
|
}
|
|
579
495
|
mapVisit(e, t) {
|
|
@@ -669,7 +585,7 @@ var Xe = class {
|
|
|
669
585
|
let t = e.prelude ? ` ${e.prelude}` : "";
|
|
670
586
|
if (this.compress) return this.emit(`@${e.name}${t}`, e.position) + (e.rules ? this.emit("{") + this.mapVisit(e.rules) + this.emit("}") : ";");
|
|
671
587
|
if (!e.rules) return this.emit(`${this.indent()}@${e.name}${t};`, e.position);
|
|
672
|
-
let n = e.rules.some((e) => e.type !==
|
|
588
|
+
let n = e.rules.some((e) => e.type !== P.declaration && e.type !== P.comment), r = n ? "\n\n" : "\n";
|
|
673
589
|
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()}}`);
|
|
674
590
|
}
|
|
675
591
|
rule(e) {
|
|
@@ -682,7 +598,7 @@ var Xe = class {
|
|
|
682
598
|
declaration(e) {
|
|
683
599
|
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(";");
|
|
684
600
|
}
|
|
685
|
-
},
|
|
601
|
+
}, Ee = (e, t) => {
|
|
686
602
|
t ||= {};
|
|
687
603
|
let n = 1, r = 1;
|
|
688
604
|
function i() {
|
|
@@ -690,14 +606,14 @@ var Xe = class {
|
|
|
690
606
|
line: n,
|
|
691
607
|
column: r
|
|
692
608
|
};
|
|
693
|
-
return (i) => (i.position = new
|
|
609
|
+
return (i) => (i.position = new we(e, {
|
|
694
610
|
line: n,
|
|
695
611
|
column: r
|
|
696
612
|
}, t?.source || ""), u(), i);
|
|
697
613
|
}
|
|
698
614
|
let a = [];
|
|
699
615
|
function o(i) {
|
|
700
|
-
let o = new
|
|
616
|
+
let o = new Ce(t?.source || "", i, n, r, e);
|
|
701
617
|
if (!t?.silent) throw o;
|
|
702
618
|
a.push(o);
|
|
703
619
|
}
|
|
@@ -733,36 +649,36 @@ var Xe = class {
|
|
|
733
649
|
if (e.charAt(0) !== "/" || e.charAt(1) !== "*") return;
|
|
734
650
|
let n = /^\/\*[^]*?\*\//.exec(e);
|
|
735
651
|
return n ? (l(n), t({
|
|
736
|
-
type:
|
|
652
|
+
type: P.comment,
|
|
737
653
|
comment: n[0].slice(2, -2)
|
|
738
654
|
})) : o("End of comment missing");
|
|
739
655
|
}
|
|
740
656
|
function p() {
|
|
741
|
-
let t =
|
|
657
|
+
let t = I(e, ["{"]);
|
|
742
658
|
if (t === -1 || t === 0) return;
|
|
743
659
|
let n = e.substring(0, t);
|
|
744
660
|
return l([n]), ((e, t) => {
|
|
745
661
|
let n = [], r = 0;
|
|
746
662
|
for (; r < e.length;) {
|
|
747
|
-
let i =
|
|
663
|
+
let i = I(e, t, r);
|
|
748
664
|
if (i === -1) return n.push(e.substring(r)), n;
|
|
749
665
|
n.push(e.substring(r, i)), r = i + 1;
|
|
750
666
|
}
|
|
751
667
|
return n;
|
|
752
|
-
})(
|
|
668
|
+
})(R(n).replace(L, ""), [","]).map((e) => R(e));
|
|
753
669
|
}
|
|
754
670
|
function m() {
|
|
755
671
|
let t = i(), n = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/.exec(e);
|
|
756
672
|
if (!n) return;
|
|
757
673
|
l(n);
|
|
758
|
-
let r =
|
|
674
|
+
let r = R(n[0]), a = /^:\s*/.exec(e);
|
|
759
675
|
if (!a) return o("property missing ':'");
|
|
760
676
|
l(a);
|
|
761
|
-
let s = "", c =
|
|
762
|
-
c !== -1 && (s = e.substring(0, c), l([s]), s =
|
|
677
|
+
let s = "", c = I(e, [";", "}"]);
|
|
678
|
+
c !== -1 && (s = e.substring(0, c), l([s]), s = R(s).replace(L, ""));
|
|
763
679
|
let u = t({
|
|
764
|
-
type:
|
|
765
|
-
property: r.replace(
|
|
680
|
+
type: P.declaration,
|
|
681
|
+
property: r.replace(L, ""),
|
|
766
682
|
value: s
|
|
767
683
|
}), d = /^[;\s]*/.exec(e);
|
|
768
684
|
return d && l(d), u;
|
|
@@ -781,9 +697,9 @@ var Xe = class {
|
|
|
781
697
|
return c() ? n : o("missing '}'");
|
|
782
698
|
}
|
|
783
699
|
function g() {
|
|
784
|
-
let t =
|
|
700
|
+
let t = I(e, ["{"]);
|
|
785
701
|
if (t === -1) return !1;
|
|
786
|
-
let n =
|
|
702
|
+
let n = I(e, [";"]), r = I(e, ["}"]);
|
|
787
703
|
return !(n !== -1 && n < t) && !(r !== -1 && r < t);
|
|
788
704
|
}
|
|
789
705
|
function _() {
|
|
@@ -791,14 +707,14 @@ var Xe = class {
|
|
|
791
707
|
if (!s()) return o("missing '{'");
|
|
792
708
|
for (d(n); e.length && e.charAt(0) !== "}";) {
|
|
793
709
|
if (e.charAt(0) === "@") {
|
|
794
|
-
let e =
|
|
710
|
+
let e = x();
|
|
795
711
|
if (e) {
|
|
796
712
|
n.push(e), d(n);
|
|
797
713
|
continue;
|
|
798
714
|
}
|
|
799
715
|
}
|
|
800
716
|
if (g()) {
|
|
801
|
-
let e =
|
|
717
|
+
let e = S();
|
|
802
718
|
if (e) {
|
|
803
719
|
n.push(e), d(n);
|
|
804
720
|
continue;
|
|
@@ -823,14 +739,14 @@ var Xe = class {
|
|
|
823
739
|
let n = [];
|
|
824
740
|
for (u(), d(n); e.length && e.charAt(0) !== "}";) {
|
|
825
741
|
if (e.charAt(0) === "@") {
|
|
826
|
-
let e =
|
|
742
|
+
let e = x();
|
|
827
743
|
if (e) {
|
|
828
744
|
n.push(e), d(n);
|
|
829
745
|
continue;
|
|
830
746
|
}
|
|
831
747
|
}
|
|
832
748
|
if (g()) {
|
|
833
|
-
let e =
|
|
749
|
+
let e = S();
|
|
834
750
|
if (e) {
|
|
835
751
|
n.push(e), d(n);
|
|
836
752
|
continue;
|
|
@@ -860,7 +776,7 @@ var Xe = class {
|
|
|
860
776
|
i && l(i), r = /^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/.exec(e);
|
|
861
777
|
}
|
|
862
778
|
if (t.length) return n({
|
|
863
|
-
type:
|
|
779
|
+
type: P.keyframe,
|
|
864
780
|
values: t,
|
|
865
781
|
declarations: h() || []
|
|
866
782
|
});
|
|
@@ -882,8 +798,8 @@ var Xe = class {
|
|
|
882
798
|
"right-top",
|
|
883
799
|
"right-middle",
|
|
884
800
|
"right-bottom"
|
|
885
|
-
].join("|")})(?![\\w-])\\s*`), te =
|
|
886
|
-
function
|
|
801
|
+
].join("|")})(?![\\w-])\\s*`), te = b("import"), ne = b("charset"), re = b("namespace");
|
|
802
|
+
function b(t) {
|
|
887
803
|
let n = RegExp("^@" + t + "\\s*((?::?[^;'\"]|\"(?:\\\\\"|[^\"])*?\"|'(?:\\\\'|[^'])*?')+)(?:;|$)");
|
|
888
804
|
return () => {
|
|
889
805
|
let r = i(), a = n.exec(e);
|
|
@@ -892,7 +808,7 @@ var Xe = class {
|
|
|
892
808
|
return s[t] = o[1].trim(), r(s);
|
|
893
809
|
};
|
|
894
810
|
}
|
|
895
|
-
function
|
|
811
|
+
function x() {
|
|
896
812
|
if (e[0] === "@") return function() {
|
|
897
813
|
let t = i(), n = /^@([-\w]+)?keyframes\s*/.exec(e);
|
|
898
814
|
if (!n) return;
|
|
@@ -903,7 +819,7 @@ var Xe = class {
|
|
|
903
819
|
let f = d(), p = y();
|
|
904
820
|
for (; p;) f.push(p), f = f.concat(d()), p = y();
|
|
905
821
|
return c() ? t({
|
|
906
|
-
type:
|
|
822
|
+
type: P.keyframes,
|
|
907
823
|
name: u,
|
|
908
824
|
vendor: r,
|
|
909
825
|
keyframes: f
|
|
@@ -911,11 +827,11 @@ var Xe = class {
|
|
|
911
827
|
}() || function() {
|
|
912
828
|
let t = i(), n = /^@media *([^{]+)/.exec(e);
|
|
913
829
|
if (!n) return;
|
|
914
|
-
let r =
|
|
830
|
+
let r = R(l(n)[1]);
|
|
915
831
|
if (!s()) return o("@media missing '{'");
|
|
916
832
|
let a = v();
|
|
917
833
|
return c() ? t({
|
|
918
|
-
type:
|
|
834
|
+
type: P.media,
|
|
919
835
|
media: r,
|
|
920
836
|
rules: a
|
|
921
837
|
}) : o("@media missing '}'");
|
|
@@ -924,29 +840,29 @@ var Xe = class {
|
|
|
924
840
|
if (!n) return;
|
|
925
841
|
let r = l(n);
|
|
926
842
|
return t({
|
|
927
|
-
type:
|
|
928
|
-
name:
|
|
929
|
-
media:
|
|
843
|
+
type: P.customMedia,
|
|
844
|
+
name: R(r[1]),
|
|
845
|
+
media: R(r[2])
|
|
930
846
|
});
|
|
931
847
|
}() || function() {
|
|
932
848
|
let t = i(), n = /^@supports *([^{]+)/.exec(e);
|
|
933
849
|
if (!n) return;
|
|
934
|
-
let r =
|
|
850
|
+
let r = R(l(n)[1]);
|
|
935
851
|
if (!s()) return o("@supports missing '{'");
|
|
936
852
|
let a = v();
|
|
937
853
|
return c() ? t({
|
|
938
|
-
type:
|
|
854
|
+
type: P.supports,
|
|
939
855
|
supports: r,
|
|
940
856
|
rules: a
|
|
941
857
|
}) : o("@supports missing '}'");
|
|
942
|
-
}() || te() || ne() ||
|
|
858
|
+
}() || te() || ne() || re() || function() {
|
|
943
859
|
let t = i(), n = /^@([-\w]+)?document *([^{]+)/.exec(e);
|
|
944
860
|
if (!n) return;
|
|
945
|
-
let r = l(n), a =
|
|
861
|
+
let r = l(n), a = R(r[1]), u = R(r[2]);
|
|
946
862
|
if (!s()) return o("@document missing '{'");
|
|
947
863
|
let d = v();
|
|
948
864
|
return c() ? t({
|
|
949
|
-
type:
|
|
865
|
+
type: P.document,
|
|
950
866
|
document: u,
|
|
951
867
|
vendor: a,
|
|
952
868
|
rules: d
|
|
@@ -960,7 +876,7 @@ var Xe = class {
|
|
|
960
876
|
let a = [];
|
|
961
877
|
for (d(a); e.length && e.charAt(0) !== "}";) {
|
|
962
878
|
if (e.charAt(0) === "@") {
|
|
963
|
-
let e =
|
|
879
|
+
let e = x();
|
|
964
880
|
if (e) {
|
|
965
881
|
a.push(e), d(a);
|
|
966
882
|
continue;
|
|
@@ -971,7 +887,7 @@ var Xe = class {
|
|
|
971
887
|
a.push(t), d(a);
|
|
972
888
|
}
|
|
973
889
|
return c() ? t({
|
|
974
|
-
type:
|
|
890
|
+
type: P.page,
|
|
975
891
|
selectors: r,
|
|
976
892
|
declarations: a
|
|
977
893
|
}) : o("@page missing '}'");
|
|
@@ -981,7 +897,7 @@ var Xe = class {
|
|
|
981
897
|
if (l(n), !s()) return o("@host missing '{'");
|
|
982
898
|
let r = v();
|
|
983
899
|
return c() ? t({
|
|
984
|
-
type:
|
|
900
|
+
type: P.host,
|
|
985
901
|
rules: r
|
|
986
902
|
}) : o("@host missing '}'");
|
|
987
903
|
}() || function() {
|
|
@@ -991,28 +907,28 @@ var Xe = class {
|
|
|
991
907
|
let r = d(), a = m();
|
|
992
908
|
for (; a;) r.push(a), r = r.concat(d()), a = m();
|
|
993
909
|
return c() ? t({
|
|
994
|
-
type:
|
|
910
|
+
type: P.fontFace,
|
|
995
911
|
declarations: r
|
|
996
912
|
}) : o("@font-face missing '}'");
|
|
997
913
|
}() || function() {
|
|
998
914
|
let t = i(), n = /^@font-feature-values\s+([^{]+)/.exec(e);
|
|
999
915
|
if (!n) return;
|
|
1000
|
-
let r =
|
|
916
|
+
let r = R(l(n)[1]);
|
|
1001
917
|
if (!s()) return o("@font-feature-values missing '{'");
|
|
1002
918
|
let a = v();
|
|
1003
919
|
return c() ? t({
|
|
1004
|
-
type:
|
|
920
|
+
type: P.fontFeatureValues,
|
|
1005
921
|
fontFamily: r,
|
|
1006
922
|
rules: a
|
|
1007
923
|
}) : o("@font-feature-values missing '}'");
|
|
1008
924
|
}() || function() {
|
|
1009
925
|
let t = i(), n = /^@container *([^{]+)/.exec(e);
|
|
1010
926
|
if (!n) return;
|
|
1011
|
-
let r =
|
|
927
|
+
let r = R(l(n)[1]);
|
|
1012
928
|
if (!s()) return o("@container missing '{'");
|
|
1013
929
|
let a = v();
|
|
1014
930
|
return c() ? t({
|
|
1015
|
-
type:
|
|
931
|
+
type: P.container,
|
|
1016
932
|
container: r,
|
|
1017
933
|
rules: a
|
|
1018
934
|
}) : o("@container missing '}'");
|
|
@@ -1022,23 +938,23 @@ var Xe = class {
|
|
|
1022
938
|
if (l(n), !s()) return o("@starting-style missing '{'");
|
|
1023
939
|
let r = v();
|
|
1024
940
|
return c() ? t({
|
|
1025
|
-
type:
|
|
941
|
+
type: P.startingStyle,
|
|
1026
942
|
rules: r
|
|
1027
943
|
}) : o("@starting-style missing '}'");
|
|
1028
944
|
}() || function() {
|
|
1029
945
|
let t = i(), n = /^@layer *([^{;@]+)/.exec(e);
|
|
1030
946
|
if (!n) return;
|
|
1031
|
-
let r =
|
|
947
|
+
let r = R(l(n)[1]);
|
|
1032
948
|
if (!s()) {
|
|
1033
949
|
let n = /^[;\s]*/.exec(e);
|
|
1034
950
|
return n && l(n), t({
|
|
1035
|
-
type:
|
|
951
|
+
type: P.layer,
|
|
1036
952
|
layer: r
|
|
1037
953
|
});
|
|
1038
954
|
}
|
|
1039
955
|
let a = v();
|
|
1040
956
|
return c() ? t({
|
|
1041
|
-
type:
|
|
957
|
+
type: P.layer,
|
|
1042
958
|
layer: r,
|
|
1043
959
|
rules: a
|
|
1044
960
|
}) : o("@layer missing '}'");
|
|
@@ -1050,7 +966,7 @@ var Xe = class {
|
|
|
1050
966
|
let a = d(), u = m();
|
|
1051
967
|
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
1052
968
|
return c() ? t({
|
|
1053
|
-
type:
|
|
969
|
+
type: P.property,
|
|
1054
970
|
name: r,
|
|
1055
971
|
declarations: a
|
|
1056
972
|
}) : o("@property missing '}'");
|
|
@@ -1062,18 +978,18 @@ var Xe = class {
|
|
|
1062
978
|
let a = d(), u = m();
|
|
1063
979
|
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
1064
980
|
return c() ? t({
|
|
1065
|
-
type:
|
|
981
|
+
type: P.counterStyle,
|
|
1066
982
|
name: r,
|
|
1067
983
|
declarations: a
|
|
1068
984
|
}) : o("@counter-style missing '}'");
|
|
1069
985
|
}() || function() {
|
|
1070
986
|
let t = i(), n = /^@scope\s*([^{]*)/.exec(e);
|
|
1071
987
|
if (!n) return;
|
|
1072
|
-
let r =
|
|
988
|
+
let r = R(l(n)[1]);
|
|
1073
989
|
if (!s()) return o("@scope missing '{'");
|
|
1074
990
|
let a = v();
|
|
1075
991
|
return c() ? t({
|
|
1076
|
-
type:
|
|
992
|
+
type: P.scope,
|
|
1077
993
|
scope: r,
|
|
1078
994
|
rules: a
|
|
1079
995
|
}) : o("@scope missing '}'");
|
|
@@ -1084,7 +1000,7 @@ var Xe = class {
|
|
|
1084
1000
|
let r = d(), a = m();
|
|
1085
1001
|
for (; a;) r.push(a), r = r.concat(d()), a = m();
|
|
1086
1002
|
return c() ? t({
|
|
1087
|
-
type:
|
|
1003
|
+
type: P.viewTransition,
|
|
1088
1004
|
declarations: r
|
|
1089
1005
|
}) : o("@view-transition missing '}'");
|
|
1090
1006
|
}() || function() {
|
|
@@ -1095,7 +1011,7 @@ var Xe = class {
|
|
|
1095
1011
|
let a = d(), u = m();
|
|
1096
1012
|
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
1097
1013
|
return c() ? t({
|
|
1098
|
-
type:
|
|
1014
|
+
type: P.positionTry,
|
|
1099
1015
|
name: r,
|
|
1100
1016
|
declarations: a
|
|
1101
1017
|
}) : o("@position-try missing '}'");
|
|
@@ -1107,18 +1023,18 @@ var Xe = class {
|
|
|
1107
1023
|
let a = d(), u = m();
|
|
1108
1024
|
for (; u;) a.push(u), a = a.concat(d()), u = m();
|
|
1109
1025
|
return c() ? t({
|
|
1110
|
-
type:
|
|
1026
|
+
type: P.pageMarginBox,
|
|
1111
1027
|
name: r,
|
|
1112
1028
|
declarations: a
|
|
1113
1029
|
}) : o(`@${r} missing '}'`);
|
|
1114
1030
|
}() || function() {
|
|
1115
1031
|
let t = i(), n = /^@([-\w]+)\s*/.exec(e);
|
|
1116
1032
|
if (!n) return;
|
|
1117
|
-
let r = l(n)[1], a = "", u =
|
|
1118
|
-
if (u !== -1 && u > 0 && (a =
|
|
1033
|
+
let r = l(n)[1], a = "", u = I(e, ["{", ";"]);
|
|
1034
|
+
if (u !== -1 && u > 0 && (a = R(e.substring(0, u)), l([e.substring(0, u)])), s()) {
|
|
1119
1035
|
let e = v();
|
|
1120
1036
|
return c() ? t({
|
|
1121
|
-
type:
|
|
1037
|
+
type: P.atRule,
|
|
1122
1038
|
name: r,
|
|
1123
1039
|
prelude: a,
|
|
1124
1040
|
rules: e
|
|
@@ -1126,21 +1042,21 @@ var Xe = class {
|
|
|
1126
1042
|
}
|
|
1127
1043
|
let d = /^[;\s]*/.exec(e);
|
|
1128
1044
|
return d && l(d), t({
|
|
1129
|
-
type:
|
|
1045
|
+
type: P.atRule,
|
|
1130
1046
|
name: r,
|
|
1131
1047
|
prelude: a
|
|
1132
1048
|
});
|
|
1133
1049
|
}();
|
|
1134
1050
|
}
|
|
1135
|
-
function
|
|
1051
|
+
function S() {
|
|
1136
1052
|
let e = i(), t = p();
|
|
1137
1053
|
return t ? (d(), e({
|
|
1138
|
-
type:
|
|
1054
|
+
type: P.rule,
|
|
1139
1055
|
selectors: t,
|
|
1140
1056
|
declarations: _() || []
|
|
1141
1057
|
})) : o("selector missing");
|
|
1142
1058
|
}
|
|
1143
|
-
return
|
|
1059
|
+
return z(function() {
|
|
1144
1060
|
let n = function() {
|
|
1145
1061
|
let n, r = [];
|
|
1146
1062
|
for (u(), d(r); e.length;) {
|
|
@@ -1151,7 +1067,7 @@ var Xe = class {
|
|
|
1151
1067
|
}
|
|
1152
1068
|
break;
|
|
1153
1069
|
}
|
|
1154
|
-
if (n =
|
|
1070
|
+
if (n = x() || S(), !n) {
|
|
1155
1071
|
if (t?.silent) {
|
|
1156
1072
|
l([e.charAt(0)]), u(), d(r);
|
|
1157
1073
|
continue;
|
|
@@ -1163,7 +1079,7 @@ var Xe = class {
|
|
|
1163
1079
|
return r;
|
|
1164
1080
|
}();
|
|
1165
1081
|
return {
|
|
1166
|
-
type:
|
|
1082
|
+
type: P.stylesheet,
|
|
1167
1083
|
stylesheet: {
|
|
1168
1084
|
source: t?.source,
|
|
1169
1085
|
rules: n,
|
|
@@ -1171,219 +1087,151 @@ var Xe = class {
|
|
|
1171
1087
|
}
|
|
1172
1088
|
};
|
|
1173
1089
|
}());
|
|
1174
|
-
},
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
}), et = "addStyleTag", tt = {
|
|
1182
|
-
scope: "media.appear",
|
|
1183
|
-
category: "media",
|
|
1184
|
-
severity: 0,
|
|
1185
|
-
title: "Change page appearance",
|
|
1186
|
-
description: "Lets the app restyle parts of the page (safely filtered)."
|
|
1187
|
-
}, nt = {
|
|
1188
|
-
scope: "media.appearU",
|
|
1189
|
-
category: "media",
|
|
1190
|
-
severity: 2,
|
|
1191
|
-
unsafe: !0,
|
|
1192
|
-
title: "Change page appearance (unsafe)",
|
|
1193
|
-
description: "Lets the app restyle the page WITHOUT safety filtering. Could be used to leak data over the network."
|
|
1194
|
-
}, rt = (e) => e?.noSanitize ? nt : tt, it = /(?:^|[^\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"), ot = (e) => !it.test(at(e.value)), J = (e) => {
|
|
1195
|
-
let t = [];
|
|
1196
|
-
for (let n of e) switch (n.type) {
|
|
1197
|
-
case H.import:
|
|
1198
|
-
case H.fontFace:
|
|
1199
|
-
case H.namespace:
|
|
1200
|
-
case H.charset:
|
|
1201
|
-
case H.document:
|
|
1202
|
-
case H.comment: continue;
|
|
1203
|
-
case H.rule:
|
|
1204
|
-
case H.page:
|
|
1205
|
-
t.push({
|
|
1206
|
-
...n,
|
|
1207
|
-
declarations: n.declarations.filter((e) => e.type !== H.declaration || ot(e))
|
|
1208
|
-
});
|
|
1209
|
-
continue;
|
|
1210
|
-
case H.media:
|
|
1211
|
-
case H.supports:
|
|
1212
|
-
case H.container:
|
|
1213
|
-
case H.host:
|
|
1214
|
-
case H.startingStyle:
|
|
1215
|
-
t.push({
|
|
1216
|
-
...n,
|
|
1217
|
-
rules: J(n.rules)
|
|
1218
|
-
});
|
|
1219
|
-
continue;
|
|
1220
|
-
case H.layer:
|
|
1221
|
-
t.push({
|
|
1222
|
-
...n,
|
|
1223
|
-
rules: n.rules ? J(n.rules) : void 0
|
|
1224
|
-
});
|
|
1225
|
-
continue;
|
|
1226
|
-
case H.keyframes:
|
|
1227
|
-
t.push({
|
|
1228
|
-
...n,
|
|
1229
|
-
keyframes: n.keyframes.map((e) => e.type === H.keyframe ? {
|
|
1230
|
-
...e,
|
|
1231
|
-
declarations: e.declarations.filter((e) => e.type !== H.declaration || ot(e))
|
|
1232
|
-
} : e)
|
|
1233
|
-
});
|
|
1234
|
-
continue;
|
|
1235
|
-
default: continue;
|
|
1236
|
-
}
|
|
1090
|
+
}, De = (e, t) => new Te(t || {}).compile(e), B = "LocatorError", V = "LocatorUnsupportedError", H = "LocatorDeniedError", U = (e) => typeof e == "object" && e ? e.name : void 0, W = (e) => Object.assign(Error(e), { name: B }), Oe = (e, t = "", n) => Object.assign(Error(e), {
|
|
1091
|
+
name: V,
|
|
1092
|
+
operation: t,
|
|
1093
|
+
backend: n
|
|
1094
|
+
}), ke = (e, t) => Oe(`Locator operation not supported${t ? ` on the ${t} backend` : ""}: ${e}`, e, t), Ae = (e) => U(e) === V, G = (e) => U(e) === H, je = (e) => G(e) || Ae(e), K = (e) => {
|
|
1095
|
+
let t = (e.ownerDocument ?? e).defaultView;
|
|
1096
|
+
if (!t) throw W("the resolved element belongs to a document with no window");
|
|
1237
1097
|
return t;
|
|
1238
|
-
},
|
|
1098
|
+
}, Me = (e, t) => {
|
|
1099
|
+
let n = e?.[t];
|
|
1100
|
+
return typeof n == "function" ? n : null;
|
|
1101
|
+
}, q = (e, t) => {
|
|
1102
|
+
if (typeof e != "object" || !e) return null;
|
|
1103
|
+
let n = (() => {
|
|
1104
|
+
try {
|
|
1105
|
+
return Me(K(e), t);
|
|
1106
|
+
} catch {
|
|
1107
|
+
return null;
|
|
1108
|
+
}
|
|
1109
|
+
})();
|
|
1110
|
+
if (n && e instanceof n) return n;
|
|
1111
|
+
let r = Me(globalThis, t);
|
|
1112
|
+
return r && e instanceof r ? r : null;
|
|
1113
|
+
}, J = (e, t) => q(e, t) !== null, Y = (e) => {
|
|
1114
|
+
if (e.length === 0) throw W("No elements found");
|
|
1115
|
+
if (e.length > 1) throw W(`Strict mode violation: locator resolved to ${e.length} elements`);
|
|
1116
|
+
return e[0];
|
|
1117
|
+
}, Ne = (e, t) => {
|
|
1118
|
+
if (!J(e, t)) throw W(`Strict mode violation: expected ${t}, got <${e.tagName.toLowerCase()}>`);
|
|
1119
|
+
return e;
|
|
1120
|
+
}, Pe = (e) => e.tagName.toLowerCase(), Fe = /* @__PURE__ */ new Set(), Ie = (e) => {
|
|
1121
|
+
Fe.add(e);
|
|
1122
|
+
}, Le = /(?:^|[^\w-])(?:url|image|image-set|cross-fade|paint|element|expression)\s*\(/i, Re = (e) => e.replace(/\\([0-9a-fA-F]{1,6})\s?/g, (e, t) => String.fromCodePoint(Number.parseInt(t, 16))).replace(/\\(.)/g, "$1"), ze = (e) => !Le.test(Re(e.value)), Be = /* @__PURE__ */ new Set([
|
|
1123
|
+
P.import,
|
|
1124
|
+
P.fontFace,
|
|
1125
|
+
P.namespace,
|
|
1126
|
+
P.charset,
|
|
1127
|
+
P.document,
|
|
1128
|
+
P.comment
|
|
1129
|
+
]), Ve = (e) => {
|
|
1130
|
+
if (Be.has(e.type)) return null;
|
|
1131
|
+
if (e.type === P.declaration) return ze(e) ? e : null;
|
|
1132
|
+
let t = e, n = { ...t };
|
|
1133
|
+
for (let e of [
|
|
1134
|
+
"declarations",
|
|
1135
|
+
"rules",
|
|
1136
|
+
"keyframes"
|
|
1137
|
+
]) {
|
|
1138
|
+
let r = t[e];
|
|
1139
|
+
Array.isArray(r) && (n[e] = He(r));
|
|
1140
|
+
}
|
|
1141
|
+
return n;
|
|
1142
|
+
}, He = (e) => e.map((e) => Ve(e)).filter((e) => e !== null), Ue = (e) => {
|
|
1239
1143
|
let t;
|
|
1240
1144
|
try {
|
|
1241
|
-
t =
|
|
1145
|
+
t = Ee(e, { silent: !0 });
|
|
1242
1146
|
} catch {
|
|
1243
1147
|
return "";
|
|
1244
1148
|
}
|
|
1245
|
-
return t.stylesheet.rules =
|
|
1246
|
-
},
|
|
1247
|
-
let
|
|
1248
|
-
|
|
1149
|
+
return t.stylesheet.rules = He(t.stylesheet.rules), De(t);
|
|
1150
|
+
}, We = (e, t) => {
|
|
1151
|
+
let n = () => {
|
|
1152
|
+
t.parentNode || (e.head ?? e.documentElement).appendChild(t);
|
|
1249
1153
|
};
|
|
1250
|
-
|
|
1251
|
-
let
|
|
1252
|
-
for (let r of
|
|
1253
|
-
|
|
1154
|
+
if (n(), e.readyState === "complete") return;
|
|
1155
|
+
let r = new MutationObserver((e) => {
|
|
1156
|
+
for (let r of e) for (let e of r.removedNodes) if (e === t || e.contains?.(t)) {
|
|
1157
|
+
n();
|
|
1254
1158
|
return;
|
|
1255
1159
|
}
|
|
1256
1160
|
});
|
|
1257
|
-
|
|
1161
|
+
r.observe(e.documentElement, {
|
|
1258
1162
|
childList: !0,
|
|
1259
1163
|
subtree: !0
|
|
1260
|
-
})
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
n.textContent = t.noSanitize ? t.content : st(t.content);
|
|
1164
|
+
});
|
|
1165
|
+
let i = () => r.disconnect(), a = e.defaultView;
|
|
1166
|
+
a ? a.addEventListener("load", i, { once: !0 }) : setTimeout(i, 3e4);
|
|
1167
|
+
}, Ge = { resolve: (e, t) => {
|
|
1168
|
+
let n = e.document.createElement("style");
|
|
1169
|
+
n.textContent = t.noSanitize ? t.content : Ue(t.content);
|
|
1267
1170
|
try {
|
|
1268
|
-
|
|
1171
|
+
We(e.document, n);
|
|
1269
1172
|
} catch (e) {
|
|
1270
1173
|
console.error(e);
|
|
1271
1174
|
}
|
|
1272
|
-
|
|
1273
|
-
},
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
type: Y,
|
|
1282
|
-
selectorModules: pt,
|
|
1283
|
-
operationModules: mt
|
|
1284
|
-
}, gt = _t({
|
|
1285
|
-
ownType: Y,
|
|
1286
|
-
selectorModules: pt,
|
|
1287
|
-
operationModules: mt
|
|
1288
|
-
});
|
|
1289
|
-
//#endregion
|
|
1290
|
-
//#region node_modules/@mfkn/web-extension/lib/content-script/resolvers/locators/factory.js
|
|
1291
|
-
function _t(e) {
|
|
1292
|
-
return (t, n, r = []) => ({
|
|
1293
|
-
...Object.fromEntries(e.selectorModules.map((i) => [i.type, (...a) => {
|
|
1294
|
-
let o = [...r, {
|
|
1295
|
-
locatorType: e.ownType,
|
|
1296
|
-
type: i.type,
|
|
1297
|
-
args: a
|
|
1298
|
-
}];
|
|
1299
|
-
return (i.nextLocatorType ?? e.ownType) === "locator" ? En(t, n, o) : gt(t, n, o);
|
|
1300
|
-
}])),
|
|
1301
|
-
...Object.fromEntries(e.operationModules.map(({ type: e }) => [e, (...i) => Ae(t, r, e, i, n)])),
|
|
1302
|
-
ensure: (e, t = {}) => n ? n(r, e, [t]) : Promise.resolve()
|
|
1303
|
-
});
|
|
1304
|
-
}
|
|
1305
|
-
//#endregion
|
|
1306
|
-
//#region node_modules/@mfkn/web-extension/lib/content-script/resolvers/locators/selectors/get-by-role.js
|
|
1307
|
-
var vt = /* @__PURE__ */ e({
|
|
1308
|
-
render: () => xt,
|
|
1309
|
-
resolve: () => bt,
|
|
1310
|
-
type: () => yt
|
|
1311
|
-
}), yt = "getByRole", bt = (e, t) => e.elements.flatMap((e) => [...e.querySelectorAll(`[role="${CSS.escape(t)}"]`)]), xt = (e) => ({ fragment: typeof e == "string" ? `[role="${e.replaceAll("\"", "\\\"")}"]` : "[role]" }), St = /* @__PURE__ */ e({
|
|
1312
|
-
render: () => Tt,
|
|
1313
|
-
resolve: () => wt,
|
|
1314
|
-
type: () => Ct
|
|
1315
|
-
}), Ct = "getByText", wt = (e, t) => e.elements.flatMap((e) => [e, ...e.querySelectorAll("*")]).filter((e) => e.textContent?.includes(t)), Tt = (e) => ({ fragment: typeof e == "string" ? `:has-text("${e.replaceAll("\"", "\\\"")}")` : ":has-text(...)" }), Et = /* @__PURE__ */ e({
|
|
1316
|
-
render: () => kt,
|
|
1317
|
-
resolve: () => Ot,
|
|
1318
|
-
type: () => Dt
|
|
1319
|
-
}), Dt = "getByTestId", Ot = (e, t) => e.elements.flatMap((e) => [...e.querySelectorAll(`[data-testid="${CSS.escape(t)}"]`)]), kt = (e) => ({ fragment: typeof e == "string" ? `[data-testid="${e.replaceAll("\"", "\\\"")}"]` : "[data-testid]" }), At = /* @__PURE__ */ e({
|
|
1320
|
-
render: () => Nt,
|
|
1321
|
-
resolve: () => Mt,
|
|
1322
|
-
type: () => jt
|
|
1323
|
-
}), jt = "first", Mt = (e) => e.elements.slice(0, 1), Nt = () => ({ fragment: ":first" }), Pt = /* @__PURE__ */ e({
|
|
1324
|
-
render: () => It,
|
|
1325
|
-
resolve: () => Ft,
|
|
1326
|
-
type: () => "nth"
|
|
1327
|
-
}), Ft = (e, t) => {
|
|
1328
|
-
let n = e.elements.at(t);
|
|
1329
|
-
return n ? [n] : [];
|
|
1330
|
-
}, It = (e) => ({ fragment: typeof e == "number" ? `:nth(${e})` : ":nth(?)" }), Lt = (e) => {
|
|
1331
|
-
let t = Error(e);
|
|
1332
|
-
return t.name = "LocatorError", t;
|
|
1333
|
-
}, X = (e) => {
|
|
1334
|
-
if (e.length === 0) throw Lt("No elements found");
|
|
1335
|
-
if (e.length > 1) throw Lt(`Strict mode violation: locator resolved to ${e.length} elements`);
|
|
1336
|
-
return e[0];
|
|
1337
|
-
}, Rt = /* @__PURE__ */ e({
|
|
1338
|
-
permission: () => Bt,
|
|
1339
|
-
resolve: () => Vt,
|
|
1340
|
-
type: () => zt
|
|
1341
|
-
}), zt = "click", Bt = {
|
|
1342
|
-
scope: "act.click",
|
|
1343
|
-
category: "act",
|
|
1344
|
-
severity: 3,
|
|
1345
|
-
title: "Click on the page",
|
|
1346
|
-
description: "Lets the app press buttons or links for you."
|
|
1347
|
-
}, Vt = (e, t = {}) => {
|
|
1348
|
-
let n = X(e.elements), r = n.getBoundingClientRect(), i = t.position?.x ?? .5, a = t.position?.y ?? .5, o = {
|
|
1175
|
+
Ie(n);
|
|
1176
|
+
} }, Ke = (e, t) => {
|
|
1177
|
+
let n = e.getBoundingClientRect();
|
|
1178
|
+
return {
|
|
1179
|
+
clientX: n.left + n.width * (t?.x ?? .5),
|
|
1180
|
+
clientY: n.top + n.height * (t?.y ?? .5)
|
|
1181
|
+
};
|
|
1182
|
+
}, qe = { resolve: (e, t = {}) => {
|
|
1183
|
+
let n = Y(e.elements), r = K(n), i = {
|
|
1349
1184
|
bubbles: !0,
|
|
1350
1185
|
cancelable: !0,
|
|
1351
1186
|
composed: !0,
|
|
1352
|
-
|
|
1353
|
-
clientY: r.top + r.height * a,
|
|
1187
|
+
...Ke(n, t.position),
|
|
1354
1188
|
button: 0
|
|
1355
|
-
},
|
|
1356
|
-
...
|
|
1357
|
-
buttons: 1,
|
|
1189
|
+
}, a = {
|
|
1190
|
+
...i,
|
|
1358
1191
|
pointerType: "mouse",
|
|
1359
1192
|
pointerId: 1,
|
|
1360
1193
|
isPrimary: !0
|
|
1361
|
-
}
|
|
1362
|
-
|
|
1194
|
+
};
|
|
1195
|
+
n.dispatchEvent(new r.PointerEvent("pointerdown", {
|
|
1196
|
+
...a,
|
|
1197
|
+
buttons: 1
|
|
1198
|
+
})), n.dispatchEvent(new r.MouseEvent("mousedown", {
|
|
1199
|
+
...i,
|
|
1363
1200
|
buttons: 1
|
|
1364
|
-
},
|
|
1365
|
-
...
|
|
1201
|
+
})), n.dispatchEvent(new r.PointerEvent("pointerup", {
|
|
1202
|
+
...a,
|
|
1366
1203
|
buttons: 0
|
|
1367
|
-
}
|
|
1368
|
-
|
|
1369
|
-
...s,
|
|
1204
|
+
})), n.dispatchEvent(new r.MouseEvent("mouseup", {
|
|
1205
|
+
...i,
|
|
1370
1206
|
buttons: 0
|
|
1371
|
-
})), n.dispatchEvent(new
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1207
|
+
})), n.dispatchEvent(new r.MouseEvent("click", {
|
|
1208
|
+
...i,
|
|
1209
|
+
buttons: 0
|
|
1210
|
+
}));
|
|
1211
|
+
} }, Je = { resolve: (e, t = {}) => {
|
|
1212
|
+
let n = Y(e.elements), r = K(n), i = {
|
|
1213
|
+
bubbles: !0,
|
|
1214
|
+
cancelable: !0,
|
|
1215
|
+
composed: !0,
|
|
1216
|
+
...Ke(n, t.position)
|
|
1217
|
+
}, a = {
|
|
1218
|
+
...i,
|
|
1219
|
+
pointerType: "mouse",
|
|
1220
|
+
pointerId: 1,
|
|
1221
|
+
isPrimary: !0
|
|
1222
|
+
};
|
|
1223
|
+
n.dispatchEvent(new r.PointerEvent("pointerover", a)), n.dispatchEvent(new r.PointerEvent("pointerenter", {
|
|
1224
|
+
...a,
|
|
1225
|
+
bubbles: !1
|
|
1226
|
+
})), n.dispatchEvent(new r.MouseEvent("mouseenter", {
|
|
1227
|
+
...i,
|
|
1228
|
+
bubbles: !1
|
|
1229
|
+
})), n.dispatchEvent(new r.MouseEvent("mouseover", i)), n.dispatchEvent(new r.PointerEvent("pointermove", a)), n.dispatchEvent(new r.MouseEvent("mousemove", i));
|
|
1230
|
+
} }, Ye = (e, t) => {
|
|
1383
1231
|
e._valueTracker?.setValue("");
|
|
1384
|
-
let n = e
|
|
1232
|
+
let n = (q(e, "HTMLTextAreaElement") ?? q(e, "HTMLInputElement"))?.prototype, r = n && Object.getOwnPropertyDescriptor(n, "value")?.set;
|
|
1385
1233
|
r ? r.call(e, t) : e.value = t;
|
|
1386
|
-
},
|
|
1234
|
+
}, Xe = (e, t) => {
|
|
1387
1235
|
if (e.type !== "range") return null;
|
|
1388
1236
|
let n = Number(e.min || 0), r = Number(e.max || 100);
|
|
1389
1237
|
if (!Number.isFinite(n) || !Number.isFinite(r) || r <= n) return null;
|
|
@@ -1396,21 +1244,20 @@ var vt = /* @__PURE__ */ e({
|
|
|
1396
1244
|
clientX: o.left + o.width * a,
|
|
1397
1245
|
clientY: o.top + o.height / 2,
|
|
1398
1246
|
button: 0
|
|
1247
|
+
}, c = {
|
|
1248
|
+
...s,
|
|
1249
|
+
pointerType: "mouse",
|
|
1250
|
+
pointerId: 1,
|
|
1251
|
+
isPrimary: !0
|
|
1399
1252
|
};
|
|
1400
1253
|
return {
|
|
1401
1254
|
pointerDown: {
|
|
1402
|
-
...
|
|
1403
|
-
buttons: 1
|
|
1404
|
-
pointerType: "mouse",
|
|
1405
|
-
pointerId: 1,
|
|
1406
|
-
isPrimary: !0
|
|
1255
|
+
...c,
|
|
1256
|
+
buttons: 1
|
|
1407
1257
|
},
|
|
1408
1258
|
pointerUp: {
|
|
1409
|
-
...
|
|
1410
|
-
buttons: 0
|
|
1411
|
-
pointerType: "mouse",
|
|
1412
|
-
pointerId: 1,
|
|
1413
|
-
isPrimary: !0
|
|
1259
|
+
...c,
|
|
1260
|
+
buttons: 0
|
|
1414
1261
|
},
|
|
1415
1262
|
mouseDown: {
|
|
1416
1263
|
...s,
|
|
@@ -1421,161 +1268,209 @@ var vt = /* @__PURE__ */ e({
|
|
|
1421
1268
|
buttons: 0
|
|
1422
1269
|
}
|
|
1423
1270
|
};
|
|
1424
|
-
},
|
|
1425
|
-
let r =
|
|
1426
|
-
if (
|
|
1427
|
-
let e = r
|
|
1428
|
-
|
|
1429
|
-
r.dispatchEvent(new PointerEvent("pointerdown", e.pointerDown)), r.dispatchEvent(new MouseEvent("mousedown", e.mouseDown)), Gt(r, t), r.dispatchEvent(new Event("input", { bubbles: !0 })), r.dispatchEvent(new PointerEvent("pointerup", e.pointerUp)), r.dispatchEvent(new MouseEvent("mouseup", e.mouseUp)), r.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
1430
|
-
return;
|
|
1431
|
-
}
|
|
1432
|
-
Gt(r, t), r.dispatchEvent(new Event("input", { bubbles: !0 })), r.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
1271
|
+
}, Ze = { resolve: (e, t, n = {}) => {
|
|
1272
|
+
let r = Y(e.elements), i = K(r), a = J(r, "HTMLInputElement");
|
|
1273
|
+
if (a || J(r, "HTMLTextAreaElement")) {
|
|
1274
|
+
let e = r, n = a ? Xe(e, t) : null;
|
|
1275
|
+
n && (r.dispatchEvent(new i.PointerEvent("pointerdown", n.pointerDown)), r.dispatchEvent(new i.MouseEvent("mousedown", n.mouseDown))), Ye(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 }));
|
|
1433
1276
|
return;
|
|
1434
1277
|
}
|
|
1435
|
-
if (r
|
|
1436
|
-
r.textContent = t, r.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
1278
|
+
if (J(r, "HTMLElement") && r.isContentEditable) {
|
|
1279
|
+
r.textContent = t, r.dispatchEvent(new i.Event("input", { bubbles: !0 }));
|
|
1437
1280
|
return;
|
|
1438
1281
|
}
|
|
1439
|
-
throw Error(`fill: element <${r
|
|
1440
|
-
},
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
}), Yt = "hover", Xt = {
|
|
1445
|
-
scope: "act.hover",
|
|
1446
|
-
category: "act",
|
|
1447
|
-
severity: 1,
|
|
1448
|
-
title: "Hover over the page",
|
|
1449
|
-
description: "Lets the app point at things to reveal menus or tooltips."
|
|
1450
|
-
}, Zt = (e, t = {}) => {
|
|
1451
|
-
let n = X(e.elements), r = n.getBoundingClientRect(), i = {
|
|
1452
|
-
bubbles: !0,
|
|
1453
|
-
cancelable: !0,
|
|
1454
|
-
composed: !0,
|
|
1455
|
-
clientX: r.left + r.width * (t.position?.x ?? .5),
|
|
1456
|
-
clientY: r.top + r.height * (t.position?.y ?? .5)
|
|
1457
|
-
}, a = {
|
|
1458
|
-
...i,
|
|
1459
|
-
pointerType: "mouse",
|
|
1460
|
-
pointerId: 1,
|
|
1461
|
-
isPrimary: !0
|
|
1462
|
-
};
|
|
1463
|
-
n.dispatchEvent(new PointerEvent("pointerover", a)), n.dispatchEvent(new PointerEvent("pointerenter", {
|
|
1464
|
-
...a,
|
|
1465
|
-
bubbles: !1
|
|
1466
|
-
})), n.dispatchEvent(new MouseEvent("mouseenter", {
|
|
1467
|
-
...i,
|
|
1468
|
-
bubbles: !1
|
|
1469
|
-
})), n.dispatchEvent(new MouseEvent("mouseover", i)), n.dispatchEvent(new PointerEvent("pointermove", a)), n.dispatchEvent(new MouseEvent("mousemove", i));
|
|
1470
|
-
}, Qt = /* @__PURE__ */ e({
|
|
1471
|
-
permission: () => en,
|
|
1472
|
-
resolve: () => tn,
|
|
1473
|
-
type: () => $t
|
|
1474
|
-
}), $t = "textContent", en = {
|
|
1475
|
-
scope: "read.text",
|
|
1476
|
-
category: "read",
|
|
1477
|
-
severity: 1,
|
|
1478
|
-
title: "Read text from the page",
|
|
1479
|
-
description: "Lets the app see the text shown on this page."
|
|
1480
|
-
}, tn = (e, t = {}) => X(e.elements).textContent, nn = /* @__PURE__ */ e({
|
|
1481
|
-
permission: () => an,
|
|
1482
|
-
resolve: () => on,
|
|
1483
|
-
type: () => rn
|
|
1484
|
-
}), rn = "isVisible", an = {
|
|
1485
|
-
scope: "read.visible",
|
|
1486
|
-
category: "read",
|
|
1487
|
-
severity: 0,
|
|
1488
|
-
title: "See what’s visible on the page",
|
|
1489
|
-
description: "Lets the app check which elements are currently on screen."
|
|
1490
|
-
}, on = (e, t = {}) => {
|
|
1491
|
-
let n = X(e.elements);
|
|
1492
|
-
if (!(n instanceof HTMLElement)) return !0;
|
|
1493
|
-
let r = n.ownerDocument.defaultView?.getComputedStyle(n);
|
|
1282
|
+
throw Error(`fill: element <${Pe(r)}> is not fillable`);
|
|
1283
|
+
} }, Qe = { resolve: (e, t = {}) => Y(e.elements).textContent }, $e = { resolve: (e, t, n = {}) => Y(e.elements).getAttribute(t) }, et = { resolve: (e, t = {}) => {
|
|
1284
|
+
let n = Y(e.elements);
|
|
1285
|
+
if (!J(n, "HTMLElement")) return !0;
|
|
1286
|
+
let r = K(n).getComputedStyle(n);
|
|
1494
1287
|
if (r?.display === "none" || r?.visibility === "hidden") return !1;
|
|
1495
1288
|
let i = n.getBoundingClientRect();
|
|
1496
1289
|
return i.width > 0 && i.height > 0;
|
|
1497
|
-
},
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
},
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
resolve: () =>
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1290
|
+
} }, tt = { resolve: (e, t = {}) => e.elements.length }, nt = { resolve: (e, t = {}) => e.elements.length > 0 }, X = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1291
|
+
__proto__: null,
|
|
1292
|
+
click: qe,
|
|
1293
|
+
count: tt,
|
|
1294
|
+
exists: nt,
|
|
1295
|
+
fill: Ze,
|
|
1296
|
+
getAttribute: $e,
|
|
1297
|
+
hover: Je,
|
|
1298
|
+
isVisible: et,
|
|
1299
|
+
textContent: Qe
|
|
1300
|
+
}, Symbol.toStringTag, { value: "Module" })), Z = (e, t) => e.elements.flatMap((e) => [...e.querySelectorAll(t)]), Q = (e) => e.replaceAll("\"", "\\\""), rt = {
|
|
1301
|
+
to: "element",
|
|
1302
|
+
css: !0,
|
|
1303
|
+
resolve: (e, t) => Z(e, t),
|
|
1304
|
+
render: (e) => ({
|
|
1305
|
+
fragment: typeof e == "string" ? e : "?",
|
|
1306
|
+
separator: "descend"
|
|
1307
|
+
})
|
|
1308
|
+
}, it = {
|
|
1309
|
+
to: "frame",
|
|
1310
|
+
css: !0,
|
|
1311
|
+
barrier: "down",
|
|
1312
|
+
resolve: (e, t) => Z(e, t),
|
|
1313
|
+
render: (e) => ({
|
|
1314
|
+
fragment: typeof e == "string" ? e : "?",
|
|
1315
|
+
separator: "down"
|
|
1316
|
+
})
|
|
1317
|
+
}, at = {
|
|
1318
|
+
element: {
|
|
1319
|
+
selectors: {
|
|
1320
|
+
locator: rt,
|
|
1321
|
+
frameLocator: it,
|
|
1322
|
+
getByRole: {
|
|
1323
|
+
to: "element",
|
|
1324
|
+
resolve: (e, t) => Z(e, `[role="${CSS.escape(t)}"]`),
|
|
1325
|
+
render: (e) => ({ fragment: typeof e == "string" ? `[role="${Q(e)}"]` : "[role]" })
|
|
1326
|
+
},
|
|
1327
|
+
getByText: {
|
|
1328
|
+
to: "element",
|
|
1329
|
+
resolve: (e, t) => e.elements.flatMap((e) => [e, ...e.querySelectorAll("*")]).filter((e) => e.textContent?.includes(t)),
|
|
1330
|
+
render: (e) => ({ fragment: typeof e == "string" ? `:has-text("${Q(e)}")` : ":has-text(...)" })
|
|
1331
|
+
},
|
|
1332
|
+
getByTestId: {
|
|
1333
|
+
to: "element",
|
|
1334
|
+
resolve: (e, t) => Z(e, `[data-testid="${CSS.escape(t)}"]`),
|
|
1335
|
+
render: (e) => ({ fragment: typeof e == "string" ? `[data-testid="${Q(e)}"]` : "[data-testid]" })
|
|
1336
|
+
},
|
|
1337
|
+
first: {
|
|
1338
|
+
to: "element",
|
|
1339
|
+
resolve: (e) => e.elements.slice(0, 1),
|
|
1340
|
+
render: () => ({ fragment: ":first" })
|
|
1341
|
+
},
|
|
1342
|
+
nth: {
|
|
1343
|
+
to: "element",
|
|
1344
|
+
resolve: (e, t) => {
|
|
1345
|
+
let n = e.elements.at(t);
|
|
1346
|
+
return n ? [n] : [];
|
|
1347
|
+
},
|
|
1348
|
+
render: (e) => ({ fragment: typeof e == "number" ? `:nth(${e})` : ":nth(?)" })
|
|
1349
|
+
}
|
|
1350
|
+
},
|
|
1351
|
+
operations: {
|
|
1352
|
+
click: qe,
|
|
1353
|
+
fill: Ze,
|
|
1354
|
+
hover: Je,
|
|
1355
|
+
textContent: Qe,
|
|
1356
|
+
getAttribute: $e,
|
|
1357
|
+
isVisible: et,
|
|
1358
|
+
count: tt,
|
|
1359
|
+
exists: nt
|
|
1360
|
+
}
|
|
1546
1361
|
},
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
}
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
}
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1362
|
+
frame: {
|
|
1363
|
+
selectors: {
|
|
1364
|
+
locator: rt,
|
|
1365
|
+
frameLocator: it,
|
|
1366
|
+
owner: {
|
|
1367
|
+
to: "frame",
|
|
1368
|
+
barrier: "up",
|
|
1369
|
+
resolve: (e) => {
|
|
1370
|
+
throw Error("owner: must be processed by the executor as an upward pivot");
|
|
1371
|
+
},
|
|
1372
|
+
render: () => ({
|
|
1373
|
+
fragment: "",
|
|
1374
|
+
separator: "up"
|
|
1375
|
+
})
|
|
1376
|
+
}
|
|
1377
|
+
},
|
|
1378
|
+
operations: { addStyleTag: Ge }
|
|
1379
|
+
}
|
|
1380
|
+
}, ot = (e, t = at) => ({
|
|
1381
|
+
element: {
|
|
1382
|
+
selectors: {
|
|
1383
|
+
...t.element.selectors,
|
|
1384
|
+
...e.element?.selectors
|
|
1385
|
+
},
|
|
1386
|
+
operations: {
|
|
1387
|
+
...t.element.operations,
|
|
1388
|
+
...e.element?.operations
|
|
1389
|
+
}
|
|
1390
|
+
},
|
|
1391
|
+
frame: {
|
|
1392
|
+
selectors: {
|
|
1393
|
+
...t.frame.selectors,
|
|
1394
|
+
...e.frame?.selectors
|
|
1395
|
+
},
|
|
1396
|
+
operations: {
|
|
1397
|
+
...t.frame.operations,
|
|
1398
|
+
...e.frame?.operations
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
}), st = 3e4, ct = 50, lt = (e) => {
|
|
1402
|
+
let t = e[e.length - 1];
|
|
1403
|
+
return typeof t == "object" && t ? t : void 0;
|
|
1404
|
+
}, ut = (e) => {
|
|
1405
|
+
let t = lt(e)?.timeout;
|
|
1406
|
+
return typeof t == "number" ? t : st;
|
|
1407
|
+
}, dt = ({ executor: e, parts: t }) => ({ highlight: (n) => e.highlight(t, n).then(() => {}, () => {}) }), ft = async (e) => {
|
|
1408
|
+
let t = {
|
|
1409
|
+
parts: e.parts,
|
|
1410
|
+
operation: e.operation,
|
|
1411
|
+
args: e.args,
|
|
1412
|
+
phase: "ensure"
|
|
1413
|
+
};
|
|
1414
|
+
await e.gate?.(t, dt(e));
|
|
1415
|
+
}, pt = async (e) => {
|
|
1416
|
+
let { executor: t, gate: n, parts: r, operation: i, args: a } = e;
|
|
1417
|
+
n && await n({
|
|
1418
|
+
parts: r,
|
|
1419
|
+
operation: i,
|
|
1420
|
+
args: a,
|
|
1421
|
+
phase: "execute"
|
|
1422
|
+
}, dt(e));
|
|
1423
|
+
let o = ut(a), s = Date.now() + o, c = /* @__PURE__ */ Error(`Locator timeout (${o}ms): ${i}`), { promise: l, reject: u } = Promise.withResolvers();
|
|
1424
|
+
l.catch(() => {});
|
|
1425
|
+
let d = setTimeout(() => u(c), o), f = c;
|
|
1426
|
+
try {
|
|
1427
|
+
for (; Date.now() < s;) try {
|
|
1428
|
+
return await Promise.race([t.execute(r, i, a), l]);
|
|
1429
|
+
} catch (e) {
|
|
1430
|
+
if (e === c) break;
|
|
1431
|
+
if (je(e)) throw e;
|
|
1432
|
+
f = e;
|
|
1433
|
+
let t = s - Date.now();
|
|
1434
|
+
if (t <= 0) break;
|
|
1435
|
+
await new Promise((e) => setTimeout(e, Math.min(ct, t)));
|
|
1436
|
+
}
|
|
1437
|
+
} finally {
|
|
1438
|
+
clearTimeout(d);
|
|
1439
|
+
}
|
|
1440
|
+
throw f;
|
|
1441
|
+
}, mt = (e, t, n, r) => {
|
|
1442
|
+
let i = {};
|
|
1443
|
+
for (let [a, o] of Object.entries(t[n].selectors)) i[a] = (...i) => mt(e, t, o.to, [...r, {
|
|
1444
|
+
kind: n,
|
|
1445
|
+
name: a,
|
|
1446
|
+
args: i
|
|
1447
|
+
}]);
|
|
1448
|
+
for (let a of Object.keys(t[n].operations)) i[a] = (...t) => pt({
|
|
1449
|
+
...e,
|
|
1450
|
+
parts: r,
|
|
1451
|
+
operation: a,
|
|
1452
|
+
args: t
|
|
1453
|
+
});
|
|
1454
|
+
return i.ensure = (t, n = {}) => ft({
|
|
1455
|
+
...e,
|
|
1456
|
+
parts: r,
|
|
1457
|
+
operation: t,
|
|
1458
|
+
args: [n]
|
|
1459
|
+
}), i;
|
|
1460
|
+
}, ht = (e) => mt(e, e.modules ?? at, "frame", []), gt = ot({
|
|
1461
|
+
element: { operations: {
|
|
1462
|
+
click: { resolve: (e, t = {}) => X.click.resolve(e, t) },
|
|
1463
|
+
hover: { resolve: (e, t = {}) => X.hover.resolve(e, t) },
|
|
1464
|
+
fill: { resolve: (e, t, n = {}) => X.fill.resolve(e, t, n) },
|
|
1465
|
+
textContent: { resolve: (e, t = {}) => X.textContent.resolve(e) },
|
|
1466
|
+
getAttribute: { resolve: (e, t, n = {}) => X.getAttribute.resolve(e, t) },
|
|
1467
|
+
isVisible: { resolve: (e, t = {}) => X.isVisible.resolve(e) },
|
|
1468
|
+
count: { resolve: (e, t = {}) => X.count.resolve(e) },
|
|
1469
|
+
exists: { resolve: (e, t = {}) => X.exists.resolve(e) },
|
|
1470
|
+
videoElement: { resolve: (e, t = {}) => S(Ne(Y(e.elements), "HTMLVideoElement")) }
|
|
1471
|
+
} },
|
|
1472
|
+
frame: { operations: { addStyleTag: { resolve: (e, t) => Ge.resolve(e, t) } } }
|
|
1473
|
+
}), _t = (e) => {
|
|
1579
1474
|
if (!e || e === "about:blank") return !1;
|
|
1580
1475
|
let t;
|
|
1581
1476
|
try {
|
|
@@ -1587,57 +1482,64 @@ var Dn = (e) => {
|
|
|
1587
1482
|
if (t.protocol === "about:") return !1;
|
|
1588
1483
|
let n = t.hostname, r = (e) => n === e || n.endsWith(`.${e}`);
|
|
1589
1484
|
return r("fkn.app") || r("fkn.dev") || r("sdbx.app");
|
|
1590
|
-
},
|
|
1591
|
-
if (
|
|
1592
|
-
},
|
|
1485
|
+
}, $ = (e) => {
|
|
1486
|
+
if (_t(e)) throw Error("attachFrame: refusing to target the extension's own pages or an FKN platform origin");
|
|
1487
|
+
}, vt = ({ src: e, domains: t, lockdown: n }) => {
|
|
1593
1488
|
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");
|
|
1594
|
-
},
|
|
1489
|
+
}, yt = {
|
|
1595
1490
|
scope: "embed.iframe",
|
|
1596
1491
|
category: "embed",
|
|
1597
1492
|
severity: 0,
|
|
1598
1493
|
title: "Load another website inside this app",
|
|
1599
1494
|
description: "Lets the app embed external pages directly inside its own view."
|
|
1600
|
-
},
|
|
1495
|
+
}, bt = {
|
|
1601
1496
|
scope: "embed.open",
|
|
1602
1497
|
category: "embed",
|
|
1603
1498
|
severity: 0,
|
|
1604
1499
|
title: "Open a website inside this app",
|
|
1605
1500
|
description: "Lets the app navigate to another site without leaving its window."
|
|
1606
|
-
},
|
|
1607
|
-
let t =
|
|
1501
|
+
}, xt = (e) => {
|
|
1502
|
+
let t = ht({
|
|
1503
|
+
executor: e.executor,
|
|
1504
|
+
modules: gt,
|
|
1505
|
+
gate: e.gate
|
|
1506
|
+
}), n = (t, n = {}) => ($(t), e.goto(t, n)), r = () => e.url();
|
|
1608
1507
|
return {
|
|
1609
1508
|
...t,
|
|
1610
1509
|
goto: n,
|
|
1611
1510
|
url: r
|
|
1612
1511
|
};
|
|
1613
|
-
},
|
|
1512
|
+
}, St = "FKN_WEB_EXTENSION_ATTACH_FRAME_EVENT_KEY", Ct = async ({ iframe: e, domains: t = [], syncCookies: n = !0, lockdown: r = !1 }) => {
|
|
1614
1513
|
let i = crypto.randomUUID();
|
|
1615
|
-
if (
|
|
1514
|
+
if ($(e.src), vt({
|
|
1616
1515
|
src: e.src,
|
|
1617
1516
|
domains: t,
|
|
1618
1517
|
lockdown: r
|
|
1619
|
-
}), await
|
|
1620
|
-
e.dispatchEvent(new CustomEvent(
|
|
1621
|
-
let { executeLocator: a,
|
|
1518
|
+
}), await A(), !e.isConnected) throw Error("attachFrame: the iframe must be connected to the document before attaching");
|
|
1519
|
+
e.dispatchEvent(new CustomEvent(St, { detail: i }));
|
|
1520
|
+
let { executeLocator: a, highlightLocator: o, ensureLocatorPermission: s, goto: c } = await j.attachFrame({
|
|
1622
1521
|
marker: i,
|
|
1623
1522
|
domains: t,
|
|
1624
1523
|
syncCookies: n,
|
|
1625
1524
|
lockdown: r
|
|
1626
1525
|
});
|
|
1627
|
-
return
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1526
|
+
return xt({
|
|
1527
|
+
executor: {
|
|
1528
|
+
execute: a,
|
|
1529
|
+
highlight: o
|
|
1530
|
+
},
|
|
1531
|
+
gate: (e) => s(e.parts, e.operation, e.args),
|
|
1532
|
+
goto: (e, t = {}) => c({
|
|
1631
1533
|
url: e,
|
|
1632
1534
|
...t
|
|
1633
1535
|
}),
|
|
1634
1536
|
url: () => e.src
|
|
1635
1537
|
});
|
|
1636
|
-
},
|
|
1538
|
+
}, wt = { request: (e) => j.requestPermissions(e.map((e) => ({
|
|
1637
1539
|
key: e.key,
|
|
1638
1540
|
scope: e.scope ?? "",
|
|
1639
1541
|
reason: e.reason
|
|
1640
|
-
}))) },
|
|
1542
|
+
}))) }, Tt = ["fkn.app", "fkn.dev"], Et = (e) => {
|
|
1641
1543
|
let t = typeof e == "string" ? e : e instanceof URL ? e.href : e.url, n;
|
|
1642
1544
|
try {
|
|
1643
1545
|
n = new URL(t);
|
|
@@ -1645,24 +1547,24 @@ var Dn = (e) => {
|
|
|
1645
1547
|
return;
|
|
1646
1548
|
}
|
|
1647
1549
|
let r = n.hostname;
|
|
1648
|
-
if (
|
|
1649
|
-
},
|
|
1550
|
+
if (Tt.some((e) => r === e || r.endsWith(`.${e}`))) throw Error(`fetch refuses FKN platform domains (${r})`);
|
|
1551
|
+
}, Dt = async (e) => {
|
|
1650
1552
|
if (e != null) return typeof e == "string" || e instanceof ArrayBuffer || ArrayBuffer.isView(e) ? e : new Request("https://body.invalid/", {
|
|
1651
1553
|
method: "POST",
|
|
1652
1554
|
body: e,
|
|
1653
1555
|
duplex: "half"
|
|
1654
1556
|
}).arrayBuffer();
|
|
1655
|
-
},
|
|
1557
|
+
}, Ot = async (e) => {
|
|
1656
1558
|
if (e.method === "GET" || e.method === "HEAD") return;
|
|
1657
1559
|
let t = await e.clone().arrayBuffer();
|
|
1658
1560
|
return t.byteLength ? t : void 0;
|
|
1659
|
-
},
|
|
1660
|
-
if (
|
|
1561
|
+
}, kt = async (e, n) => {
|
|
1562
|
+
if (Et(e), typeof e == "object" && e && !(e instanceof URL) && typeof e.url == "string") {
|
|
1661
1563
|
let r = e, i = {};
|
|
1662
1564
|
r.headers.forEach((e, t) => {
|
|
1663
1565
|
i[t] = e;
|
|
1664
1566
|
});
|
|
1665
|
-
let a = await
|
|
1567
|
+
let a = await Dt(n?.body === void 0 ? await Ot(r) : n.body);
|
|
1666
1568
|
return t.then((e) => e.cloud.fetch(r.url, {
|
|
1667
1569
|
...n,
|
|
1668
1570
|
method: n?.method ?? r.method,
|
|
@@ -1670,11 +1572,11 @@ var Dn = (e) => {
|
|
|
1670
1572
|
body: a
|
|
1671
1573
|
}));
|
|
1672
1574
|
}
|
|
1673
|
-
let r = e instanceof URL ? e.href : e, i = await
|
|
1575
|
+
let r = e instanceof URL ? e.href : e, i = await Dt(n?.body);
|
|
1674
1576
|
return t.then((e) => e.cloud.fetch(r, n?.body === void 0 ? n : {
|
|
1675
1577
|
...n,
|
|
1676
1578
|
body: i
|
|
1677
1579
|
}));
|
|
1678
1580
|
};
|
|
1679
1581
|
//#endregion
|
|
1680
|
-
export {
|
|
1582
|
+
export { pe as A, d as B, ve as C, de as D, ue as E, E as F, w as I, S as L, O as M, oe as N, le as O, A as P, C as R, ye as S, _e as T, V as _, Ct as a, Se as b, bt as c, _t as d, B as f, Ae as g, je as h, St as i, D as j, M as k, $ as l, ke as m, Et as n, yt as o, G as p, wt as r, xt as s, kt as t, vt as u, H as v, N as w, xe as x, be as y, T as z };
|