@fkn/lib 0.9.4 → 0.9.7
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 +1 -1
- package/{api-BFqrrvzI.d.ts → api-9O1SM4CR.d.ts} +155 -77
- package/{api-Bhz3iB9m.js → api-BU8zNmQI.js} +54 -17
- package/{api-C75xqLFy.cjs → api-C9Mh5v0z.cjs} +1 -1
- package/cloud/dgram.cjs +1 -1
- package/cloud/dgram.js +1 -1
- package/cloud/fetch.cjs +1 -0
- package/cloud/fetch.d.ts +2 -0
- package/cloud/fetch.js +2 -0
- package/cloud/fs.cjs +1 -1
- package/cloud/fs.js +1 -1
- package/cloud/net.cjs +1 -1
- package/cloud/net.d.ts +1 -1
- package/cloud/net.js +1 -1
- package/cloud-DZzkfeQi.cjs +1 -0
- package/cloud-OAvwgd_r.js +283 -0
- package/{cloud-CAOIpDIH.d.ts → cloud-wrRNWHAn.d.ts} +4 -9
- package/cloud.cjs +1 -1
- package/cloud.d.ts +3 -2
- package/cloud.js +4 -4
- package/{dgram-D4JF_XW7.js → dgram-DNbgOMoK.js} +1 -1
- package/{dgram-C2LmoO0A.cjs → dgram-ocGNUMpo.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 +1 -1
- package/extension-B0qU5XuR.d.ts +16 -0
- package/extension-DQZmGSuX.js +78 -0
- package/extension-DmKxv-br.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.js +1 -1
- package/{fs-Bghx-1Hy.js → fs-BYMGoFir.js} +2 -2
- package/{fs-BXcz3BjJ.cjs → fs-D-pDr8fW.cjs} +1 -1
- package/fs.cjs +1 -1
- package/fs.js +1 -1
- package/http.cjs +1 -1
- package/http.d.ts +2 -1
- package/http.js +1 -1
- package/{index-pr5vLVVT.d.ts → index-DQfP-Uhy.d.ts} +29 -22
- package/index.cjs +1 -1
- package/index.d.ts +6 -6
- package/index.js +29 -28
- package/{proxy-Bhk4X3xo.js → lib-BcEnB4iV.js} +353 -644
- package/lib-CQqdCndr.cjs +31 -0
- package/{net-MbSFrO35.d.ts → net-BDjZxAEZ.d.ts} +1 -3
- package/{net-BgQYnATG.js → net-Bi82weSE.js} +1 -1
- package/{net-zOx2OVGc.cjs → net-uN5eXX3L.cjs} +1 -1
- package/net.cjs +1 -1
- package/net.d.ts +1 -1
- package/net.js +1 -1
- package/package.json +7 -2
- package/{packages-CErlrrLB.d.ts → packages-CSZGUtem.d.ts} +20 -7
- package/packages.cjs +1 -1
- package/packages.d.ts +1 -1
- package/packages.js +1 -1
- package/proxy-CMtPeuvd.js +43 -0
- package/proxy-DbcJMUcm.cjs +1 -0
- package/proxy-pCTWR0E6.d.ts +8 -0
- package/{storage-D01O3zky.js → storage-BVWaXq8X.js} +1 -1
- package/{storage-a3OhXFv2.cjs → storage-DG1Ac1FK.cjs} +1 -1
- package/cloud-BeHgCa_z.js +0 -129
- package/cloud-Cd6TzZXd.cjs +0 -1
- package/extension-C46Rp-qr.js +0 -73
- package/extension-CkPvwol3.cjs +0 -1
- package/extension-D7SSKewV.d.ts +0 -16
- package/proxy-BEz2K6e4.cjs +0 -53
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
+
import { I as t, a as n, s as r } from "./lib-BcEnB4iV.js";
|
|
3
|
+
import { r as i, t as a } from "./api-BU8zNmQI.js";
|
|
4
|
+
import { t as o } from "./proxy-CMtPeuvd.js";
|
|
5
|
+
import { t as s } from "./dns.js";
|
|
6
|
+
import { t as c } from "./cloud/fs.js";
|
|
7
|
+
import { s as l } from "./net-Bi82weSE.js";
|
|
8
|
+
import { i as u } from "./dgram-DNbgOMoK.js";
|
|
9
|
+
import { t as d } from "./http.js";
|
|
10
|
+
import { expose as f } from "osra";
|
|
11
|
+
//#region node_modules/@adobe/css-tools/dist/esm/adobe-css-tools.mjs
|
|
12
|
+
var p;
|
|
13
|
+
(function(e) {
|
|
14
|
+
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";
|
|
15
|
+
})(p ||= {});
|
|
16
|
+
var m = (e, t, n) => {
|
|
17
|
+
let r = n, i = 1e4;
|
|
18
|
+
do {
|
|
19
|
+
let n = t.map((t) => e.indexOf(t, r));
|
|
20
|
+
n.push(e.indexOf("\\", r));
|
|
21
|
+
let a = n.filter((e) => e !== -1);
|
|
22
|
+
if (a.length === 0) return -1;
|
|
23
|
+
let o = Math.min(...a);
|
|
24
|
+
if (e[o] !== "\\") return o;
|
|
25
|
+
r = o + 2, i--;
|
|
26
|
+
} while (i > 0);
|
|
27
|
+
throw Error("Too many escaping");
|
|
28
|
+
}, h = (e, t, n) => {
|
|
29
|
+
let r = n, i = 1e4;
|
|
30
|
+
do {
|
|
31
|
+
let n = t.map((t) => e.indexOf(t, r));
|
|
32
|
+
n.push(e.indexOf("(", r)), n.push(e.indexOf("\"", r)), n.push(e.indexOf("'", r)), n.push(e.indexOf("\\", r));
|
|
33
|
+
let a = n.filter((e) => e !== -1);
|
|
34
|
+
if (a.length === 0) return -1;
|
|
35
|
+
let o = Math.min(...a);
|
|
36
|
+
switch (e[o]) {
|
|
37
|
+
case "\\":
|
|
38
|
+
r = o + 2;
|
|
39
|
+
break;
|
|
40
|
+
case "(":
|
|
41
|
+
{
|
|
42
|
+
let t = h(e, [")"], o + 1);
|
|
43
|
+
if (t === -1) return -1;
|
|
44
|
+
r = t + 1;
|
|
45
|
+
}
|
|
46
|
+
break;
|
|
47
|
+
case "\"":
|
|
48
|
+
{
|
|
49
|
+
let t = m(e, ["\""], o + 1);
|
|
50
|
+
if (t === -1) return -1;
|
|
51
|
+
r = t + 1;
|
|
52
|
+
}
|
|
53
|
+
break;
|
|
54
|
+
case "'":
|
|
55
|
+
{
|
|
56
|
+
let t = m(e, ["'"], o + 1);
|
|
57
|
+
if (t === -1) return -1;
|
|
58
|
+
r = t + 1;
|
|
59
|
+
}
|
|
60
|
+
break;
|
|
61
|
+
default: return o;
|
|
62
|
+
}
|
|
63
|
+
i--;
|
|
64
|
+
} while (i > 0);
|
|
65
|
+
throw Error("Too many escaping");
|
|
66
|
+
};
|
|
67
|
+
function g(e, t) {
|
|
68
|
+
let n = e && typeof e.type == "string", r = n ? e : t;
|
|
69
|
+
for (let t in e) {
|
|
70
|
+
let n = e[t];
|
|
71
|
+
Array.isArray(n) ? n.forEach((e) => {
|
|
72
|
+
g(e, r);
|
|
73
|
+
}) : n && typeof n == "object" && g(n, r);
|
|
74
|
+
}
|
|
75
|
+
return n && Object.defineProperty(e, "parent", {
|
|
76
|
+
configurable: !0,
|
|
77
|
+
writable: !0,
|
|
78
|
+
enumerable: !1,
|
|
79
|
+
value: t || null
|
|
80
|
+
}), e;
|
|
81
|
+
}
|
|
82
|
+
var _ = "LocatorUnsupportedError", v = "LocatorDeniedError", y = (e) => typeof e == "object" && e ? e.name : void 0, b = (e, t = "", n) => Object.assign(Error(e), {
|
|
83
|
+
name: _,
|
|
84
|
+
operation: t,
|
|
85
|
+
backend: n
|
|
86
|
+
}), x = (e, t) => b(`Locator operation not supported${t ? ` on the ${t} backend` : ""}: ${e}`, e, t), S = (e) => y(e) === _, ee = (e) => y(e) === v, te = (e) => ee(e) || S(e), ne = /(?:^|[^\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"), C = (e) => !ne.test(re(e.value)), w = /* @__PURE__ */ new Set([
|
|
87
|
+
p.import,
|
|
88
|
+
p.fontFace,
|
|
89
|
+
p.namespace,
|
|
90
|
+
p.charset,
|
|
91
|
+
p.document,
|
|
92
|
+
p.comment
|
|
93
|
+
]), T = (e) => {
|
|
94
|
+
if (w.has(e.type)) return null;
|
|
95
|
+
if (e.type === p.declaration) return C(e) ? e : null;
|
|
96
|
+
let t = e, n = { ...t };
|
|
97
|
+
for (let e of [
|
|
98
|
+
"declarations",
|
|
99
|
+
"rules",
|
|
100
|
+
"keyframes"
|
|
101
|
+
]) {
|
|
102
|
+
let r = t[e];
|
|
103
|
+
Array.isArray(r) && (n[e] = E(r));
|
|
104
|
+
}
|
|
105
|
+
return n;
|
|
106
|
+
}, E = (e) => e.map((e) => T(e)).filter((e) => e !== null), D = 3e4, O = 50, k = (e) => {
|
|
107
|
+
let t = e[e.length - 1];
|
|
108
|
+
return typeof t == "object" && t ? t : void 0;
|
|
109
|
+
}, A = (e) => {
|
|
110
|
+
let t = k(e)?.timeout;
|
|
111
|
+
return typeof t == "number" ? t : D;
|
|
112
|
+
}, j = ({ executor: e, parts: t }) => ({ highlight: (n) => e.highlight(t, n).then(() => {}, () => {}) }), M = async (e) => {
|
|
113
|
+
let t = {
|
|
114
|
+
parts: e.parts,
|
|
115
|
+
operation: e.operation,
|
|
116
|
+
args: e.args,
|
|
117
|
+
phase: "ensure"
|
|
118
|
+
};
|
|
119
|
+
await e.gate?.(t, j(e));
|
|
120
|
+
}, N = async (e) => {
|
|
121
|
+
let { executor: t, gate: n, parts: r, operation: i, args: a } = e;
|
|
122
|
+
n && await n({
|
|
123
|
+
parts: r,
|
|
124
|
+
operation: i,
|
|
125
|
+
args: a,
|
|
126
|
+
phase: "execute"
|
|
127
|
+
}, j(e));
|
|
128
|
+
let o = A(a), s = Date.now() + o, c = /* @__PURE__ */ Error(`Locator timeout (${o}ms): ${i}`), { promise: l, reject: u } = Promise.withResolvers();
|
|
129
|
+
l.catch(() => {});
|
|
130
|
+
let d = setTimeout(() => u(c), o), f = c;
|
|
131
|
+
try {
|
|
132
|
+
for (; Date.now() < s;) try {
|
|
133
|
+
return await Promise.race([t.execute(r, i, a), l]);
|
|
134
|
+
} catch (e) {
|
|
135
|
+
if (e === c) break;
|
|
136
|
+
if (te(e)) throw e;
|
|
137
|
+
f = e;
|
|
138
|
+
let t = s - Date.now();
|
|
139
|
+
if (t <= 0) break;
|
|
140
|
+
await new Promise((e) => setTimeout(e, Math.min(O, t)));
|
|
141
|
+
}
|
|
142
|
+
} finally {
|
|
143
|
+
clearTimeout(d);
|
|
144
|
+
}
|
|
145
|
+
throw f;
|
|
146
|
+
}, P = (e, t, n, r) => {
|
|
147
|
+
let i = {};
|
|
148
|
+
for (let [a, o] of Object.entries(t[n].selectors)) i[a] = (...i) => P(e, t, o.to, [...r, {
|
|
149
|
+
kind: n,
|
|
150
|
+
name: a,
|
|
151
|
+
args: i
|
|
152
|
+
}]);
|
|
153
|
+
for (let a of Object.keys(t[n].operations)) i[a] = (...t) => N({
|
|
154
|
+
...e,
|
|
155
|
+
parts: r,
|
|
156
|
+
operation: a,
|
|
157
|
+
args: t
|
|
158
|
+
});
|
|
159
|
+
return i.ensure = (t, n = {}) => M({
|
|
160
|
+
...e,
|
|
161
|
+
parts: r,
|
|
162
|
+
operation: t,
|
|
163
|
+
args: [n]
|
|
164
|
+
}), i;
|
|
165
|
+
}, F = (e) => e, I = "autoplay; fullscreen; encrypted-media; picture-in-picture; clipboard-read; clipboard-write", L = 2e4, R = 65e3, ie = 3e4, z = 5e3, B = /* @__PURE__ */ new Set(), V = () => "https://fkn.app", H = (e) => !e || e === "about:blank", U = (e) => e ? "" : `incognito-${crypto.randomUUID()}`, W = ({ target: e, session: t }) => {
|
|
166
|
+
let n = new URL("/attach-frame", V());
|
|
167
|
+
return e && n.searchParams.set("url", e), t && n.searchParams.set("session", t), n.href;
|
|
168
|
+
}, G = (e, t, n) => {
|
|
169
|
+
let r, i = new Promise((e, i) => {
|
|
170
|
+
r = setTimeout(() => i(Error(n)), t);
|
|
171
|
+
});
|
|
172
|
+
return Promise.race([e, i]).finally(() => clearTimeout(r));
|
|
173
|
+
}, K = (e, t) => {
|
|
174
|
+
let n = () => {
|
|
175
|
+
a(), t();
|
|
176
|
+
}, r = e.parentNode, i = new MutationObserver(() => {
|
|
177
|
+
(!e.isConnected || e.parentNode !== r) && (a(), t());
|
|
178
|
+
}), a = () => {
|
|
179
|
+
window.removeEventListener("pagehide", n), i.disconnect();
|
|
180
|
+
};
|
|
181
|
+
window.addEventListener("pagehide", n, { once: !0 }), r && i.observe(r, { childList: !0 }), e.isConnected || (a(), t());
|
|
182
|
+
}, q = () => Object.assign(/* @__PURE__ */ Error("cloud.attachFrame: the attached iframe left the document or was reloaded; attach a fresh iframe"), { name: _ }), J = (e, t) => {
|
|
183
|
+
let n = [...e.split(";"), ...t.split(";")].map((e) => e.trim()).filter(Boolean);
|
|
184
|
+
return [...new Set(n)].join("; ");
|
|
185
|
+
}, Y = [
|
|
186
|
+
300,
|
|
187
|
+
1200,
|
|
188
|
+
4e3
|
|
189
|
+
], X = (e) => {
|
|
190
|
+
let t = () => {
|
|
191
|
+
if (!e.isConnected) return;
|
|
192
|
+
let t = e.style.height, n = e.getBoundingClientRect();
|
|
193
|
+
n.height && (e.style.height = `${n.height - 1}px`, setTimeout(() => {
|
|
194
|
+
e.style.height = t;
|
|
195
|
+
}, 50));
|
|
196
|
+
};
|
|
197
|
+
t();
|
|
198
|
+
for (let e of Y) setTimeout(t, e);
|
|
199
|
+
}, ae = (e) => {
|
|
200
|
+
let t = e.getAttribute("sandbox");
|
|
201
|
+
if (t === null) return;
|
|
202
|
+
let n = new Set(t.toLowerCase().split(/\s+/).filter(Boolean)), r = ["allow-scripts", "allow-same-origin"].filter((e) => !n.has(e));
|
|
203
|
+
if (r.length) throw Error(`cloud.attachFrame: the iframe's sandbox attribute must include ${r.join(" and ")} for the render proxy to load`);
|
|
204
|
+
}, Z = async ({ iframe: e, domains: i = [], syncCookies: a = !0, lockdown: o = !1 }) => {
|
|
205
|
+
if (typeof window > "u") throw Error("cloud.attachFrame needs a window realm");
|
|
206
|
+
if (o) throw Error("cloud.attachFrame does not support lockdown; use the extension backend for a sealed frame");
|
|
207
|
+
if (!e.isConnected) throw Error("cloud.attachFrame: the iframe must be connected to the document before attaching");
|
|
208
|
+
ae(e);
|
|
209
|
+
let s = e.getAttribute("src") ?? "", c = (() => {
|
|
210
|
+
if (H(s)) return null;
|
|
211
|
+
try {
|
|
212
|
+
return new URL(e.src || s, location.href);
|
|
213
|
+
} catch {
|
|
214
|
+
throw Error(`cloud.attachFrame: the iframe src is not a valid URL: ${s}`);
|
|
215
|
+
}
|
|
216
|
+
})();
|
|
217
|
+
if (c) {
|
|
218
|
+
let e = new URL("/attach-frame", V());
|
|
219
|
+
if (c.origin === e.origin && c.pathname === e.pathname) throw Error("cloud.attachFrame: this iframe is already attached; navigate with the Frame returned by that attach or use a fresh iframe");
|
|
220
|
+
}
|
|
221
|
+
let l = c?.href ?? "";
|
|
222
|
+
l && r(l);
|
|
223
|
+
let u = l, d = U(a), p = new AbortController(), m = e.referrerPolicy, h = e.allow;
|
|
224
|
+
if (e.referrerPolicy = "origin", e.allow = J(I, e.allow), e.src = W({
|
|
225
|
+
target: l,
|
|
226
|
+
session: d
|
|
227
|
+
}), !e.contentWindow) throw Error("cloud.attachFrame: the iframe window is not available");
|
|
228
|
+
try {
|
|
229
|
+
let r = await G(f({}, {
|
|
230
|
+
key: "fkn-attach-frame",
|
|
231
|
+
origin: V(),
|
|
232
|
+
transport: {
|
|
233
|
+
receive: window,
|
|
234
|
+
emit: e.contentWindow
|
|
235
|
+
},
|
|
236
|
+
unregisterSignal: p.signal,
|
|
237
|
+
revivableModules: F(t)
|
|
238
|
+
}), L, "cloud.attachFrame: timed out connecting to the render proxy page");
|
|
239
|
+
await G(r.ready(), R, "cloud.attachFrame: the render proxy never became ready"), l && X(e), K(e, () => p.abort());
|
|
240
|
+
let i = e.contentWindow, a = () => {
|
|
241
|
+
if (!(!p.signal.aborted && e.isConnected && e.contentWindow === i)) throw p.abort(), q();
|
|
242
|
+
};
|
|
243
|
+
return n({
|
|
244
|
+
executor: {
|
|
245
|
+
execute: (e, t, n) => B.has(t) ? Promise.reject(x(t, "cloud")) : (a(), r.executeLocator(e, t, n)),
|
|
246
|
+
highlight: async () => {}
|
|
247
|
+
},
|
|
248
|
+
goto: async (t, n = {}) => {
|
|
249
|
+
let i = new URL(t, location.href).href;
|
|
250
|
+
a();
|
|
251
|
+
let { timeoutMs: o } = n;
|
|
252
|
+
await G(r.goto(i, n), (o ?? ie) + z, "cloud.attachFrame: the render proxy did not answer goto; the frame may have been detached or its page reloaded"), u = i, X(e);
|
|
253
|
+
},
|
|
254
|
+
url: () => u
|
|
255
|
+
});
|
|
256
|
+
} catch (t) {
|
|
257
|
+
throw p.abort(), e.referrerPolicy = m, e.allow = h, e.src = l || "about:blank", t;
|
|
258
|
+
}
|
|
259
|
+
}, oe = () => typeof window < "u" && !0, Q = async () => {
|
|
260
|
+
let e = await a.then((e) => e.cloud.quota());
|
|
261
|
+
return {
|
|
262
|
+
premium: e.premium,
|
|
263
|
+
overQuota: e.overQuota,
|
|
264
|
+
throttled: e.overQuota && !e.premium,
|
|
265
|
+
usedBytes: e.usedBytes,
|
|
266
|
+
limitBytes: e.limitBytes,
|
|
267
|
+
remainingBytes: e.remaining,
|
|
268
|
+
bytesPerSecond: e.bytesPerSecond,
|
|
269
|
+
bitsPerSecond: e.bytesPerSecond * 8
|
|
270
|
+
};
|
|
271
|
+
}, se = /* @__PURE__ */ e({
|
|
272
|
+
attachFrame: () => Z,
|
|
273
|
+
available: () => $,
|
|
274
|
+
dgram: () => u,
|
|
275
|
+
dns: () => s,
|
|
276
|
+
fetch: () => o,
|
|
277
|
+
fs: () => c,
|
|
278
|
+
http: () => d,
|
|
279
|
+
net: () => l,
|
|
280
|
+
quota: () => Q
|
|
281
|
+
}), $ = () => i;
|
|
282
|
+
//#endregion
|
|
283
|
+
export { oe as a, Z as i, se as n, Q as r, $ as t };
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { d as Frame, u as AttachFrameOptions } from "./index-
|
|
1
|
+
import { t as cloudFetch } from "./proxy-pCTWR0E6.js";
|
|
2
|
+
import { d as Frame, u as AttachFrameOptions } from "./index-DQfP-Uhy.js";
|
|
3
3
|
import { t as dns_d_exports } from "./dns.js";
|
|
4
4
|
import { n as fs_d_exports } from "./fs-DTmSCXwa.js";
|
|
5
|
-
import { s as net_d_exports } from "./net-
|
|
5
|
+
import { s as net_d_exports } from "./net-BDjZxAEZ.js";
|
|
6
6
|
import { t as dgram_d_exports } from "./dgram.js";
|
|
7
7
|
import { t as http_d_exports } from "./http.js";
|
|
8
8
|
|
|
9
|
-
//#region src/lib/proxy.d.ts
|
|
10
|
-
type ProxyFetch = Resolvers['cloud']['fetch'];
|
|
11
|
-
type FetchParameters = Parameters<ProxyFetch>;
|
|
12
|
-
declare const cloudFetch: (input: FetchParameters[0], init?: FetchParameters[1]) => Promise<Response>;
|
|
13
|
-
//#endregion
|
|
14
9
|
//#region src/lib/cloud/frame.d.ts
|
|
15
10
|
declare const attachFrame: ({
|
|
16
11
|
iframe,
|
|
@@ -38,4 +33,4 @@ declare namespace cloud_d_exports {
|
|
|
38
33
|
}
|
|
39
34
|
declare const available: () => boolean;
|
|
40
35
|
//#endregion
|
|
41
|
-
export { attachFrame as a, quota as i, cloud_d_exports as n,
|
|
36
|
+
export { attachFrame as a, quota as i, cloud_d_exports as n, QuotaStatus as r, available as t };
|
package/cloud.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./proxy-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./proxy-DbcJMUcm.cjs"),t=require("./cloud-DZzkfeQi.cjs"),n=require("./dns.cjs"),r=require("./cloud/fs.cjs"),i=require("./net-uN5eXX3L.cjs"),a=require("./dgram-ocGNUMpo.cjs"),o=require("./http.cjs");exports.attachFrame=t.i,exports.available=t.t,Object.defineProperty(exports,"dgram",{enumerable:!0,get:function(){return a.i}}),Object.defineProperty(exports,"dns",{enumerable:!0,get:function(){return n.t}}),exports.fetch=e.t,Object.defineProperty(exports,"fs",{enumerable:!0,get:function(){return r.t}}),Object.defineProperty(exports,"http",{enumerable:!0,get:function(){return o.t}}),Object.defineProperty(exports,"net",{enumerable:!0,get:function(){return i.s}}),exports.quota=t.r;
|
package/cloud.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as cloudFetch } from "./proxy-pCTWR0E6.js";
|
|
2
|
+
import { a as attachFrame, i as quota, r as QuotaStatus, t as available } from "./cloud-wrRNWHAn.js";
|
|
2
3
|
import { t as dns_d_exports } from "./dns.js";
|
|
3
4
|
import { n as fs_d_exports } from "./fs-DTmSCXwa.js";
|
|
4
|
-
import { s as net_d_exports } from "./net-
|
|
5
|
+
import { s as net_d_exports } from "./net-BDjZxAEZ.js";
|
|
5
6
|
import { t as dgram_d_exports } from "./dgram.js";
|
|
6
7
|
import { t as http_d_exports } from "./http.js";
|
|
7
8
|
export { type QuotaStatus, attachFrame, available, dgram_d_exports as dgram, dns_d_exports as dns, cloudFetch as fetch, fs_d_exports as fs, http_d_exports as http, net_d_exports as net, quota };
|
package/cloud.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as e } from "./proxy-
|
|
2
|
-
import { i as t, r as n, t as r } from "./cloud-
|
|
1
|
+
import { t as e } from "./proxy-CMtPeuvd.js";
|
|
2
|
+
import { i as t, r as n, t as r } from "./cloud-OAvwgd_r.js";
|
|
3
3
|
import { t as i } from "./dns.js";
|
|
4
4
|
import { t as a } from "./cloud/fs.js";
|
|
5
|
-
import { s as o } from "./net-
|
|
6
|
-
import { i as s } from "./dgram-
|
|
5
|
+
import { s as o } from "./net-Bi82weSE.js";
|
|
6
|
+
import { i as s } from "./dgram-DNbgOMoK.js";
|
|
7
7
|
import { t as c } from "./http.js";
|
|
8
8
|
export { t as attachFrame, r as available, s as dgram, i as dns, e as fetch, a as fs, c as http, o as net, n as quota };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { t } from "./api-
|
|
2
|
+
import { t } from "./api-BU8zNmQI.js";
|
|
3
3
|
import { l as n, n as r, o as i, s as a } from "./utils-DVlbuXmW.js";
|
|
4
4
|
import { Buffer as o } from "buffer";
|
|
5
5
|
import { EventEmitter as s } from "events";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-C9Mh5v0z.cjs"),n=require("./utils-QfNXtEhb.cjs");let r=require("buffer"),i=require("events"),a=require("ip-address");var o=e.t({Socket:()=>s,createSocket:()=>p,default:()=>m}),s=class extends i.EventEmitter{_type;_localAddress;_remoteAddress;_connectedLocally;_connectGeneration=0;_destroyed=!1;_webVPNUdpSocketPromise;_dataPort;_socketId;_sendQueue=[];_sendQueueBytes=0;_sendFlushScheduled=!1;_peerTailCache=new Map;constructor(e){if(super(e),!e)throw Error(`Missing options`);this._type=e.type}_lastRecvBufferSize=0;_lastSendBufferSize=0;_lastTtl=64;_lastMulticastTtl=1;_lastMulticastLoopback=!0;_setUdpOption(e){if(!this._webVPNUdpSocketPromise){this.emit(`error`,Error(`Cannot set socket option before bind`));return}this._webVPNUdpSocketPromise.then(async t=>{if(t)try{await t.setOption(e)}catch(e){this.emit(`error`,e)}})}_dataPortAcks=!1;_dataPortConsumedBytes=0;_dataPortAckedBytes=0;_ackDataPortBatch(e){if(!this._dataPortAcks||!this._dataPort||(this._dataPortConsumedBytes+=e,this._dataPortAckedBytes!==0&&this._dataPortConsumedBytes-this._dataPortAckedBytes<524288))return;this._dataPortAckedBytes=this._dataPortConsumedBytes;let t={type:n.n,consumedBytes:this._dataPortConsumedBytes};this._dataPort.postMessage(t)}_onTransportClosed(e){this._destroyed||(this._destroyed=!0,this._dataPort?.close(),this._dataPort=void 0,this.listenerCount(`error`)>0&&this.emit(`error`,Error(e||`WebVPN session closed`)),this.emit(`close`))}_onDataPortBatch(e){let t=new DataView(e),n=!1,i,a=0;for(;a+4<=e.byteLength;){let o=t.getUint32(a);a+=4;let s=a+o;if(s>e.byteLength)break;let c=a+4,l=t.getUint8(c);c+=1;let u,f,p;if(l===2){if(!this._remoteAddress){a=s;continue}u=this._remoteAddress.address,f=this._remoteAddress.family,p=this._remoteAddress.port}else{let n=new Uint8Array(e,c,l===0?4:16);l===0?(f=`IPv4`,u=`${n[0]}.${n[1]}.${n[2]}.${n[3]}`):(f=`IPv6`,u=d(n)),c+=n.byteLength,p=t.getUint16(c),c+=2}let m=t.getUint32(c);c+=4;try{this.emit(`message`,r.Buffer.from(e.slice(c,c+m)),{address:u,family:f,port:p,size:m})}catch(e){n||(n=!0,i=e)}a=s}if(n)throw i}_peerTail(e,t){if(e===void 0||t===void 0)return c;let n=`${e}|${t}`,r=this._peerTailCache.get(n);if(r)return r;let i=a.Address4.isValid(e)?u(e):f(e),o=new Uint8Array(1+i.byteLength+2);return o[0]=i.byteLength===4?0:1,o.set(i,1),new DataView(o.buffer).setUint16(1+i.byteLength,t),this._peerTailCache.size>=4096&&this._peerTailCache.clear(),this._peerTailCache.set(n,o),o}_portSend(e,t,n){let r=this._peerTail(t,n),i=new Uint8Array(8+r.byteLength+4+e.byteLength),a=new DataView(i.buffer);a.setUint32(0,i.byteLength-4),a.setUint32(4,this._socketId),i.set(r,8),a.setUint32(8+r.byteLength,e.byteLength),i.set(e,12+r.byteLength),this._sendQueue.push(i),this._sendQueueBytes+=i.byteLength,!this._sendFlushScheduled&&(this._sendFlushScheduled=!0,queueMicrotask(()=>{this._sendFlushScheduled=!1;let e=this._sendQueue,t=this._sendQueueBytes;if(this._sendQueue=[],this._sendQueueBytes=0,!e.length||!this._dataPort)return;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.byteLength;this._dataPort.postMessage(n.buffer,[n.buffer])}))}addMembership(e,t){if(a.Address4.isValid(e)){let n=u(e),r=t&&a.Address4.isValid(t)?u(t):new Uint8Array([0,0,0,0]);this._setUdpOption({type:5,group:n,interface:r})}else if(a.Address6.isValid(e)){let t=f(e);this._setUdpOption({type:7,group:t,ifIndex:0})}else this.emit(`error`,Error(`Invalid multicast address: ${e}`))}address(){if(!this._localAddress)throw Error(`EBADF`);return this._localAddress}bind(...e){let i=n.o(...e),a=this._type===`udp6`?`::`:`0.0.0.0`;return this._webVPNUdpSocketPromise=t.t.then(e=>e.cloud.webvpn.udpSocket({type:this._type,address:i.address??a,port:i.port,dataPort:!0})).then(e=>{if(e.dataPort)this._socketId=e.socketId,this._dataPort=e.dataPort,this._dataPortAcks=e.dataPortAcks===!0,this._dataPort.onmessage=e=>{try{this._onDataPortBatch(e.data)}finally{this._ackDataPortBatch(e.data.byteLength)}};else{let t=e.dataReadableStream.getReader();(async()=>{for(;;){let{value:e,done:n}=await t.read();if(n)return;this.emit(`message`,r.Buffer.from(e.data),{address:e.address,family:e.family,port:e.port,size:e.size})}})().catch(e=>this._onTransportClosed(e instanceof Error?e.message:void 0))}return e.closed?.then(e=>this._onTransportClosed(e?.reason)).catch(()=>{}),this._localAddress={address:e.localAddress,family:e.localFamily,port:e.localPort},e}).catch(e=>{this.emit(`error`,e)}),this._webVPNUdpSocketPromise.then(e=>{e&&this.emit(`listening`)}),i.callback&&this._webVPNUdpSocketPromise.then(e=>{e&&i.callback.call(this)}),this}close(e){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);return this._webVPNUdpSocketPromise.then(async t=>{if(!t)throw Error(`Socket not bound`);let n=this._destroyed;this._destroyed=!0,this._dataPort?.close(),this._dataPort=void 0;try{await t.close()}finally{try{e&&e()}finally{n||this.emit(`close`)}}}).catch(()=>{}),this}connect(...e){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);this._webVPNUdpSocketPromise.then(async t=>{if(!t)throw Error(`Socket not bound`);let n=e[0],r=this._type===`udp6`?`::1`:`127.0.0.1`,i=typeof e[1]==`string`?e[1]:r,a=typeof e.at(-1)==`function`?e.at(-1):void 0,o=await t.connect({remotePort:n,remoteAddress:i});this._connectedLocally=o?.local===!0,this._remoteAddress=o?.address?{address:o.address,family:o.family,port:o.port}:{address:i,family:this._type===`udp6`?`IPv6`:`IPv4`,port:n},this._connectGeneration+=1,a&&a()}).catch(e=>{this.emit(`error`,e)})}disconnect(){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);if(!this._remoteAddress)throw Error(`ERR_SOCKET_DGRAM_NOT_CONNECTED`);let e=this._remoteAddress,t=this._connectedLocally,n=this._connectGeneration;this._remoteAddress=void 0,this._connectedLocally=void 0,this._webVPNUdpSocketPromise.then(e=>e?.disconnect?.()).catch(r=>{this._connectGeneration===n&&(this._remoteAddress=e,this._connectedLocally=t),this.emit(`error`,r)})}dropMembership(e,t){if(a.Address4.isValid(e)){let n=u(e),r=t&&a.Address4.isValid(t)?u(t):new Uint8Array([0,0,0,0]);this._setUdpOption({type:6,group:n,interface:r})}else if(a.Address6.isValid(e)){let t=f(e);this._setUdpOption({type:8,group:t,ifIndex:0})}else this.emit(`error`,Error(`Invalid multicast address: ${e}`))}getRecvBufferSize(){return this._lastRecvBufferSize}getSendBufferSize(){return this._lastSendBufferSize}getSendQueueSize(){return 0}getSendQueueCount(){return 0}ref(){return this}remoteAddress(){if(!this._remoteAddress)throw Error(`ERR_SOCKET_DGRAM_NOT_CONNECTED`);return{address:this._remoteAddress.address,family:this._remoteAddress.family,port:this._remoteAddress.port}}send(...e){this._webVPNUdpSocketPromise||this.bind();let t=n.s(...e),r=l(t.message),i=r;if(t.hasRange){let{offset:e,length:n}=t;if(!Number.isInteger(e)||e<0||e>r.byteLength)throw Object.assign(RangeError(`"offset" is outside of buffer bounds`),{code:`ERR_BUFFER_OUT_OF_BOUNDS`});if(!Number.isInteger(n)||n<0||n>r.byteLength-e)throw Object.assign(RangeError(`"length" is outside of buffer bounds`),{code:`ERR_BUFFER_OUT_OF_BOUNDS`});i=r.subarray(e,e+n)}let o=this._type===`udp6`?`::1`:`127.0.0.1`;if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);this._webVPNUdpSocketPromise.then(e=>{if(!e)throw Error(`Socket not bound`);let n=t.callback,r=t.address??o,s=this._remoteAddress!==void 0&&t.address===void 0;if(this._dataPort&&(s||a.Address4.isValid(r)||a.Address6.isValid(r))){this._portSend(i,s?void 0:r,s?void 0:t.port),n?.call(this,null,i.byteLength);return}e.send({port:t.port,address:r,message:i.byteOffset===0&&i.byteLength===i.buffer.byteLength?i.buffer:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)}).then(()=>n?.call(this,null,i.byteLength),e=>n?n.call(this,e,0):this.emit(`error`,e))})}setBroadcast(e){this._setUdpOption({type:0,value:e})}setMulticastInterface(e){}setMulticastLoopback(e){return this._setUdpOption({type:3,value:e}),this._setUdpOption({type:4,value:e}),this._lastMulticastLoopback=e,e}setMulticastTTL(e){return this._setUdpOption({type:2,value:e}),this._lastMulticastTtl=e,e}setRecvBufferSize(e){this._setUdpOption({type:10,value:e}),this._lastRecvBufferSize=e}setSendBufferSize(e){this._setUdpOption({type:9,value:e}),this._lastSendBufferSize=e}setTTL(e){return this._setUdpOption({type:1,value:e}),this._lastTtl=e,e}unref(){return this}addSourceSpecificMembership(e,t,n){}dropSourceSpecificMembership(e,t,n){}async[Symbol.asyncDispose](){await new Promise(e=>{this.close(e)})}},c=new Uint8Array([2]),l=e=>{if(typeof e==`string`)return n.l.encode(e);if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(Array.isArray(e)){let t=e.map(l),n=new Uint8Array(t.reduce((e,t)=>e+t.byteLength,0)),r=0;for(let e of t)n.set(e,r),r+=e.byteLength;return n}return new Uint8Array(e)},u=e=>{let t=e.split(`.`).map(e=>parseInt(e,10));if(t.length!==4||t.some(e=>Number.isNaN(e)||e<0||e>255))throw Error(`Invalid IPv4 address: ${e}`);return new Uint8Array(t)},d=e=>{let t=[];for(let n=0;n<16;n+=2)t.push(e[n]<<8|e[n+1]);let n=-1,r=1;for(let e=0;e<8;){if(t[e]!==0){e++;continue}let i=e;for(;i<8&&t[i]===0;)i++;i-e>r&&(n=e,r=i-e),e=i}return n===-1?t.map(e=>e.toString(16)).join(`:`):`${t.slice(0,n).map(e=>e.toString(16)).join(`:`)}::${t.slice(n+r).map(e=>e.toString(16)).join(`:`)}`},f=e=>{let t=new a.Address6(e).getBitsBase16(0,128).match(/.{2}/g);if(!t||t.length!==16)throw Error(`Invalid IPv6 address: ${e}`);return new Uint8Array(t.map(e=>parseInt(e,16)))},p=(e,t)=>{let n=new s(typeof e==`string`?{type:e}:e);return t&&n.on(`message`,t),n},m={Socket:s,createSocket:p};Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return s}});
|
package/dgram.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./dgram-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./dgram-ocGNUMpo.cjs");exports.Socket=e.t,exports.createSocket=e.n,exports.default=e.r;
|
package/dgram.d.ts
CHANGED
package/dgram.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "./dgram-
|
|
1
|
+
import { n as e, r as t, t as n } from "./dgram-DNbgOMoK.js";
|
|
2
2
|
export { n as Socket, e as createSocket, t as default };
|
package/dns.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-C9Mh5v0z.cjs");var n=e.t({lookup:()=>r}),r=(e,n)=>t.t.then(t=>t.cloud.dns.lookup(e,n));exports.lookup=r,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
|
package/dns.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { t } from "./api-
|
|
2
|
+
import { t } from "./api-BU8zNmQI.js";
|
|
3
3
|
//#region src/lib/dns.ts
|
|
4
4
|
var n = /* @__PURE__ */ e({ lookup: () => r }), r = (e, n) => t.then((t) => t.cloud.dns.lookup(e, n));
|
|
5
5
|
//#endregion
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { $ as fetch$1, A as LOCATOR_DENIED, B as SelectorPart, C as RemoteVideoElement, D as isType, E as createVideoElementHandle, F as isTerminalError, G as setRequestHeaderRule, H as RequestHeaderRule, I as Executor, J as cookies, K as CookieDetails, L as Gate, M as LOCATOR_UNSUPPORTED, N as isLocatorDenied, O as revive, P as isLocatorUnsupported, Q as assertFetchableUrl, R as GateTools, S as BoxedVideoElement, T as box, U as modifyRequestHeadersPermission, V as HeaderOperation, W as removeRequestHeaderRule, X as FetchInit, Y as readCookiePermission, Z as ProxyFetchRequest, _ as gotoPermission, a as PermissionGrant, at as FORGEABLE_HEADERS, b as isBlockedFrameUrl, c as ATTACH_FRAME_EVENT_KEY, ct as hasForgedCookie, d as Frame, et as fetchCredentialedPermission, f as FrameBackend, g as createFrame, h as attachFramePermission, i as waitForExtensionExposure, it as isLocalNetworkUrl, j as LOCATOR_ERROR, k as type, l as attachFrame, m as Locator, n as isExtensionExposed, nt as fetchPermission, o as PermissionRequest, ot as assertForgeableHeaders, p as GotoOptions, q as SiteCookie, r as setMissingExtensionHandler, rt as isBlockedFetchUrl, s as permissions, st as assertOneCookieIdentity, t as extension, tt as fetchLocalPermission, u as AttachFrameOptions, v as assertAttachableFrameUrl, w as VideoElementState, x as handleRevivableModules, y as assertLockdownApplicable, z as OperationRequest } from "./index-DQfP-Uhy.js";
|
|
2
|
+
|
|
3
|
+
//#region src/lib/extension-prompt.d.ts
|
|
4
|
+
declare const promptInstall: (reason?: string) => Promise<boolean>;
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/lib/auto.d.ts
|
|
7
|
+
declare const isExtensionAvailable: () => boolean;
|
|
8
|
+
declare const fetch: (input: RequestInfo | URL, init?: RequestInit & {
|
|
9
|
+
reason?: string;
|
|
10
|
+
render?: boolean;
|
|
11
|
+
}) => Promise<Response>;
|
|
12
|
+
declare namespace extension_d_exports {
|
|
13
|
+
export { ATTACH_FRAME_EVENT_KEY, AttachFrameOptions, BoxedVideoElement, CookieDetails, Executor, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, Gate, GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_UNSUPPORTED, Locator, OperationRequest, PermissionGrant, PermissionRequest, ProxyFetchRequest, RemoteVideoElement, RequestHeaderRule, SelectorPart, SiteCookie, VideoElementState, assertAttachableFrameUrl, assertFetchableUrl, assertForgeableHeaders, assertLockdownApplicable, assertOneCookieIdentity, attachFrame, attachFramePermission, isExtensionAvailable as available, box, cookies, createFrame, createVideoElementHandle, extension as events, extension, fetch$1 as fetch, fetchCredentialedPermission, fetchLocalPermission, fetchPermission, gotoPermission, handleRevivableModules, hasForgedCookie, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorUnsupported, isTerminalError, isType, modifyRequestHeadersPermission, permissions, promptInstall, readCookiePermission, removeRequestHeaderRule, revive, setMissingExtensionHandler, setRequestHeaderRule, type, waitForExtensionExposure };
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { promptInstall as i, fetch as n, isExtensionAvailable as r, extension_d_exports as t };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
+
import { A as t, B as n, C as r, D as i, E as a, F as o, I as s, L as c, M as l, N as u, O as d, P as f, R as p, S as m, T as h, V as g, _, a as v, b as y, c as b, d as x, f as S, g as C, h as w, i as T, j as E, k as D, l as O, m as k, n as A, o as j, p as M, r as N, s as P, t as F, u as I, v as L, w as R, x as z, y as B, z as V } from "./lib-BcEnB4iV.js";
|
|
3
|
+
import { t as H } from "./api-BU8zNmQI.js";
|
|
4
|
+
import { n as U, t as W } from "./proxy-CMtPeuvd.js";
|
|
5
|
+
import { available as G, fetch as K } from "./desktop.js";
|
|
6
|
+
//#region src/lib/extension-prompt.ts
|
|
7
|
+
var q = async (e) => {
|
|
8
|
+
if (typeof window > "u") return !1;
|
|
9
|
+
if (u()) return !0;
|
|
10
|
+
let t = await H, n = null, r = new Promise((e) => {
|
|
11
|
+
n = () => {
|
|
12
|
+
u() && e(!0);
|
|
13
|
+
}, l.addEventListener("statuschange", n);
|
|
14
|
+
}), i = t.installPrompt.show(e).then(() => !1), a = await Promise.race([r, i]);
|
|
15
|
+
return n && l.removeEventListener("statuschange", n), await t.installPrompt.hide().catch(() => {}), a;
|
|
16
|
+
}, J = null;
|
|
17
|
+
f(() => (J ||= q().then(() => void 0).finally(() => {
|
|
18
|
+
J = null;
|
|
19
|
+
}), J));
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/lib/auto.ts
|
|
22
|
+
var Y = () => typeof document < "u" && u(), X = async (e, t) => {
|
|
23
|
+
if (U(e), t?.credentials === "include") {
|
|
24
|
+
if (typeof document > "u") throw Error("fetch with credentials needs the FKN extension, which only exists in window realms");
|
|
25
|
+
return m(e, t);
|
|
26
|
+
}
|
|
27
|
+
return Y() ? m(e, {
|
|
28
|
+
...t,
|
|
29
|
+
credentials: "omit"
|
|
30
|
+
}) : G() ? K(e, t) : W(e, t);
|
|
31
|
+
}, Z = /* @__PURE__ */ e({
|
|
32
|
+
ATTACH_FRAME_EVENT_KEY: () => A,
|
|
33
|
+
FORGEABLE_HEADERS: () => d,
|
|
34
|
+
LOCATOR_DENIED: () => w,
|
|
35
|
+
LOCATOR_ERROR: () => I,
|
|
36
|
+
LOCATOR_UNSUPPORTED: () => k,
|
|
37
|
+
assertAttachableFrameUrl: () => P,
|
|
38
|
+
assertFetchableUrl: () => z,
|
|
39
|
+
assertForgeableHeaders: () => D,
|
|
40
|
+
assertLockdownApplicable: () => b,
|
|
41
|
+
assertOneCookieIdentity: () => t,
|
|
42
|
+
attachFrame: () => N,
|
|
43
|
+
attachFramePermission: () => T,
|
|
44
|
+
available: () => Y,
|
|
45
|
+
box: () => c,
|
|
46
|
+
cookies: () => B,
|
|
47
|
+
createFrame: () => v,
|
|
48
|
+
createVideoElementHandle: () => p,
|
|
49
|
+
events: () => l,
|
|
50
|
+
extension: () => l,
|
|
51
|
+
fetch: () => m,
|
|
52
|
+
fetchCredentialedPermission: () => r,
|
|
53
|
+
fetchLocalPermission: () => R,
|
|
54
|
+
fetchPermission: () => h,
|
|
55
|
+
gotoPermission: () => j,
|
|
56
|
+
handleRevivableModules: () => s,
|
|
57
|
+
hasForgedCookie: () => E,
|
|
58
|
+
isBlockedFetchUrl: () => a,
|
|
59
|
+
isBlockedFrameUrl: () => O,
|
|
60
|
+
isExtensionExposed: () => u,
|
|
61
|
+
isLocalNetworkUrl: () => i,
|
|
62
|
+
isLocatorDenied: () => x,
|
|
63
|
+
isLocatorUnsupported: () => M,
|
|
64
|
+
isTerminalError: () => S,
|
|
65
|
+
isType: () => V,
|
|
66
|
+
modifyRequestHeadersPermission: () => C,
|
|
67
|
+
permissions: () => F,
|
|
68
|
+
promptInstall: () => q,
|
|
69
|
+
readCookiePermission: () => y,
|
|
70
|
+
removeRequestHeaderRule: () => _,
|
|
71
|
+
revive: () => n,
|
|
72
|
+
setMissingExtensionHandler: () => f,
|
|
73
|
+
setRequestHeaderRule: () => L,
|
|
74
|
+
type: () => g,
|
|
75
|
+
waitForExtensionExposure: () => o
|
|
76
|
+
});
|
|
77
|
+
//#endregion
|
|
78
|
+
export { q as i, X as n, Y as r, Z as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-CQqdCndr.cjs"),n=require("./api-C9Mh5v0z.cjs"),r=require("./proxy-DbcJMUcm.cjs"),i=require("./desktop.cjs");var a=async e=>{if(typeof window>`u`)return!1;if(t.N())return!0;let r=await n.t,i=null,a=new Promise(e=>{i=()=>{t.N()&&e(!0)},t.M.addEventListener(`statuschange`,i)}),o=r.installPrompt.show(e).then(()=>!1),s=await Promise.race([a,o]);return i&&t.M.removeEventListener(`statuschange`,i),await r.installPrompt.hide().catch(()=>{}),s},o=null;t.P(()=>(o||=a().then(()=>void 0).finally(()=>{o=null}),o));var s=()=>typeof document<`u`&&t.N(),c=async(e,n)=>{if(r.n(e),n?.credentials===`include`){if(typeof document>`u`)throw Error(`fetch with credentials needs the FKN extension, which only exists in window realms`);return t.S(e,n)}return s()?t.S(e,{...n,credentials:`omit`}):i.available()?i.fetch(e,n):r.t(e,n)},l=e.t({ATTACH_FRAME_EVENT_KEY:()=>t.n,FORGEABLE_HEADERS:()=>t.O,LOCATOR_DENIED:()=>t.h,LOCATOR_ERROR:()=>t.u,LOCATOR_UNSUPPORTED:()=>t.m,assertAttachableFrameUrl:()=>t.s,assertFetchableUrl:()=>t.x,assertForgeableHeaders:()=>t.k,assertLockdownApplicable:()=>t.c,assertOneCookieIdentity:()=>t.A,attachFrame:()=>t.r,attachFramePermission:()=>t.i,available:()=>s,box:()=>t.L,cookies:()=>t.y,createFrame:()=>t.a,createVideoElementHandle:()=>t.R,events:()=>t.M,extension:()=>t.M,fetch:()=>t.S,fetchCredentialedPermission:()=>t.C,fetchLocalPermission:()=>t.w,fetchPermission:()=>t.T,gotoPermission:()=>t.o,handleRevivableModules:()=>t.I,hasForgedCookie:()=>t.j,isBlockedFetchUrl:()=>t.E,isBlockedFrameUrl:()=>t.l,isExtensionExposed:()=>t.N,isLocalNetworkUrl:()=>t.D,isLocatorDenied:()=>t.d,isLocatorUnsupported:()=>t.p,isTerminalError:()=>t.f,isType:()=>t.z,modifyRequestHeadersPermission:()=>t.g,permissions:()=>t.t,promptInstall:()=>a,readCookiePermission:()=>t.b,removeRequestHeaderRule:()=>t._,revive:()=>t.B,setMissingExtensionHandler:()=>t.P,setRequestHeaderRule:()=>t.v,type:()=>t.V,waitForExtensionExposure:()=>t.F});Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
|
package/extension.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lib-CQqdCndr.cjs"),t=require("./extension-DmKxv-br.cjs");exports.ATTACH_FRAME_EVENT_KEY=e.n,exports.FORGEABLE_HEADERS=e.O,exports.LOCATOR_DENIED=e.h,exports.LOCATOR_ERROR=e.u,exports.LOCATOR_UNSUPPORTED=e.m,exports.assertAttachableFrameUrl=e.s,exports.assertFetchableUrl=e.x,exports.assertForgeableHeaders=e.k,exports.assertLockdownApplicable=e.c,exports.assertOneCookieIdentity=e.A,exports.attachFrame=e.r,exports.attachFramePermission=e.i,exports.available=t.r,exports.box=e.L,exports.cookies=e.y,exports.createFrame=e.a,exports.createVideoElementHandle=e.R,exports.events=e.M,exports.extension=e.M,exports.fetch=e.S,exports.fetchCredentialedPermission=e.C,exports.fetchLocalPermission=e.w,exports.fetchPermission=e.T,exports.gotoPermission=e.o,exports.handleRevivableModules=e.I,exports.hasForgedCookie=e.j,exports.isBlockedFetchUrl=e.E,exports.isBlockedFrameUrl=e.l,exports.isExtensionExposed=e.N,exports.isLocalNetworkUrl=e.D,exports.isLocatorDenied=e.d,exports.isLocatorUnsupported=e.p,exports.isTerminalError=e.f,exports.isType=e.z,exports.modifyRequestHeadersPermission=e.g,exports.permissions=e.t,exports.promptInstall=t.i,exports.readCookiePermission=e.b,exports.removeRequestHeaderRule=e._,exports.revive=e.B,exports.setMissingExtensionHandler=e.P,exports.setRequestHeaderRule=e.v,exports.type=e.V,exports.waitForExtensionExposure=e.F;
|
package/extension.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as fetch, A as LOCATOR_DENIED, B as SelectorPart, C as RemoteVideoElement, D as isType, E as createVideoElementHandle, F as isTerminalError, G as setRequestHeaderRule, H as RequestHeaderRule, I as Executor, J as cookies, K as CookieDetails, L as Gate, M as LOCATOR_UNSUPPORTED, N as isLocatorDenied, O as revive, P as isLocatorUnsupported, Q as assertFetchableUrl, R as GateTools, S as BoxedVideoElement, T as box, U as modifyRequestHeadersPermission, V as HeaderOperation, W as removeRequestHeaderRule, X as FetchInit, Y as readCookiePermission, Z as ProxyFetchRequest, _ as gotoPermission, a as PermissionGrant, b as isBlockedFrameUrl, c as ATTACH_FRAME_EVENT_KEY, d as Frame, et as fetchCredentialedPermission, f as FrameBackend, g as createFrame, h as attachFramePermission, i as waitForExtensionExposure, it as isLocalNetworkUrl, j as LOCATOR_ERROR, k as type, l as attachFrame, m as Locator, n as isExtensionExposed, nt as fetchPermission, o as PermissionRequest, p as GotoOptions, q as SiteCookie, r as setMissingExtensionHandler, rt as isBlockedFetchUrl, s as permissions, t as extension, tt as fetchLocalPermission, u as AttachFrameOptions, v as assertAttachableFrameUrl, w as VideoElementState, x as handleRevivableModules, y as assertLockdownApplicable, z as OperationRequest } from "./index-
|
|
2
|
-
import { i as promptInstall, r as isExtensionAvailable } from "./extension-
|
|
3
|
-
export { ATTACH_FRAME_EVENT_KEY, AttachFrameOptions, BoxedVideoElement, CookieDetails, type Executor, FetchInit, Frame, FrameBackend, type Gate, type GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_UNSUPPORTED, Locator, type OperationRequest, PermissionGrant, PermissionRequest, ProxyFetchRequest, RemoteVideoElement, RequestHeaderRule, type SelectorPart, SiteCookie, VideoElementState, assertAttachableFrameUrl, assertFetchableUrl, assertLockdownApplicable, attachFrame, attachFramePermission, isExtensionAvailable as available, box, cookies, createFrame, createVideoElementHandle, extension as events, extension, fetch, fetchCredentialedPermission, fetchLocalPermission, fetchPermission, gotoPermission, handleRevivableModules, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorUnsupported, isTerminalError, isType, modifyRequestHeadersPermission, permissions, promptInstall, readCookiePermission, removeRequestHeaderRule, revive, setMissingExtensionHandler, setRequestHeaderRule, type, waitForExtensionExposure };
|
|
1
|
+
import { $ as fetch, A as LOCATOR_DENIED, B as SelectorPart, C as RemoteVideoElement, D as isType, E as createVideoElementHandle, F as isTerminalError, G as setRequestHeaderRule, H as RequestHeaderRule, I as Executor, J as cookies, K as CookieDetails, L as Gate, M as LOCATOR_UNSUPPORTED, N as isLocatorDenied, O as revive, P as isLocatorUnsupported, Q as assertFetchableUrl, R as GateTools, S as BoxedVideoElement, T as box, U as modifyRequestHeadersPermission, V as HeaderOperation, W as removeRequestHeaderRule, X as FetchInit, Y as readCookiePermission, Z as ProxyFetchRequest, _ as gotoPermission, a as PermissionGrant, at as FORGEABLE_HEADERS, b as isBlockedFrameUrl, c as ATTACH_FRAME_EVENT_KEY, ct as hasForgedCookie, d as Frame, et as fetchCredentialedPermission, f as FrameBackend, g as createFrame, h as attachFramePermission, i as waitForExtensionExposure, it as isLocalNetworkUrl, j as LOCATOR_ERROR, k as type, l as attachFrame, m as Locator, n as isExtensionExposed, nt as fetchPermission, o as PermissionRequest, ot as assertForgeableHeaders, p as GotoOptions, q as SiteCookie, r as setMissingExtensionHandler, rt as isBlockedFetchUrl, s as permissions, st as assertOneCookieIdentity, t as extension, tt as fetchLocalPermission, u as AttachFrameOptions, v as assertAttachableFrameUrl, w as VideoElementState, x as handleRevivableModules, y as assertLockdownApplicable, z as OperationRequest } from "./index-DQfP-Uhy.js";
|
|
2
|
+
import { i as promptInstall, r as isExtensionAvailable } from "./extension-B0qU5XuR.js";
|
|
3
|
+
export { ATTACH_FRAME_EVENT_KEY, AttachFrameOptions, BoxedVideoElement, CookieDetails, type Executor, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, type Gate, type GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_UNSUPPORTED, Locator, type OperationRequest, PermissionGrant, PermissionRequest, ProxyFetchRequest, RemoteVideoElement, RequestHeaderRule, type SelectorPart, SiteCookie, VideoElementState, assertAttachableFrameUrl, assertFetchableUrl, assertForgeableHeaders, assertLockdownApplicable, assertOneCookieIdentity, attachFrame, attachFramePermission, isExtensionAvailable as available, box, cookies, createFrame, createVideoElementHandle, extension as events, extension, fetch, fetchCredentialedPermission, fetchLocalPermission, fetchPermission, gotoPermission, handleRevivableModules, hasForgedCookie, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorUnsupported, isTerminalError, isType, modifyRequestHeadersPermission, permissions, promptInstall, readCookiePermission, removeRequestHeaderRule, revive, setMissingExtensionHandler, setRequestHeaderRule, type, waitForExtensionExposure };
|
package/extension.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as e, B as t, C as n, D as r, E as i, F as a, I as o, L as s, M as c, N as l, O as u, P as d, R as f, S as p, T as m,
|
|
2
|
-
import { i as
|
|
3
|
-
export {
|
|
1
|
+
import { A as e, B as t, C as n, D as r, E as i, F as a, I as o, L as s, M as c, N as l, O as u, P as d, R as f, S as p, T as m, V as h, _ as g, a as _, b as v, c as y, d as b, f as x, g as S, h as C, i as w, j as T, k as E, l as D, m as O, n as k, o as A, p as j, r as M, s as N, t as P, u as F, v as I, w as L, x as R, y as z, z as B } from "./lib-BcEnB4iV.js";
|
|
2
|
+
import { i as V, r as H } from "./extension-DQZmGSuX.js";
|
|
3
|
+
export { k as ATTACH_FRAME_EVENT_KEY, u as FORGEABLE_HEADERS, C as LOCATOR_DENIED, F as LOCATOR_ERROR, O as LOCATOR_UNSUPPORTED, N as assertAttachableFrameUrl, R as assertFetchableUrl, E as assertForgeableHeaders, y as assertLockdownApplicable, e as assertOneCookieIdentity, M as attachFrame, w as attachFramePermission, H as available, s as box, z as cookies, _ as createFrame, f as createVideoElementHandle, c as events, c as extension, p as fetch, n as fetchCredentialedPermission, L as fetchLocalPermission, m as fetchPermission, A as gotoPermission, o as handleRevivableModules, T as hasForgedCookie, i as isBlockedFetchUrl, D as isBlockedFrameUrl, l as isExtensionExposed, r as isLocalNetworkUrl, b as isLocatorDenied, j as isLocatorUnsupported, x as isTerminalError, B as isType, S as modifyRequestHeadersPermission, P as permissions, V as promptInstall, v as readCookiePermission, g as removeRequestHeaderRule, t as revive, d as setMissingExtensionHandler, I as setRequestHeaderRule, h as type, a as waitForExtensionExposure };
|
package/fs/promises.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../fs-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../fs-D-pDr8fW.cjs");var{readFile:t,writeFile:n,appendFile:r,unlink:i,rename:a,readdir:o,mkdir:s,rm:c,rmdir:l,stat:u,lstat:d,access:f}=e.v,p=e.v;exports.access=f,exports.appendFile=r,exports.default=p,exports.lstat=d,exports.mkdir=s,exports.readFile=t,exports.readdir=o,exports.rename=a,exports.rm=c,exports.rmdir=l,exports.stat=u,exports.unlink=i,exports.writeFile=n;
|
package/fs/promises.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as e } from "../fs-
|
|
1
|
+
import { v as e } from "../fs-BYMGoFir.js";
|
|
2
2
|
//#region src/lib/fs/promises.ts
|
|
3
3
|
var { readFile: t, writeFile: n, appendFile: r, unlink: i, rename: a, readdir: o, mkdir: s, rm: c, rmdir: l, stat: u, lstat: d, access: f } = e, p = e;
|
|
4
4
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
2
|
import { t } from "./node-fs-DKfokOlh.js";
|
|
3
|
-
import { i as n, n as r, o as i, s as a, u as o } from "./storage-
|
|
3
|
+
import { i as n, n as r, o as i, s as a, u as o } from "./storage-BVWaXq8X.js";
|
|
4
4
|
import { a as s, i as c, n as l, o as u, t as d } from "./opfs-BibrNGF0.js";
|
|
5
5
|
//#region src/lib/fs/hybrid.ts
|
|
6
6
|
var f = /* @__PURE__ */ e({
|
|
@@ -41,7 +41,7 @@ var f = /* @__PURE__ */ e({
|
|
|
41
41
|
}, E = (e) => {
|
|
42
42
|
let t = T();
|
|
43
43
|
e in t && (delete t[e], x(g, t));
|
|
44
|
-
}, D = () => Object.keys(S()), O = () => Object.keys(T()), k = () => v, A = null, re = null, j = () => re ??= import("./api-
|
|
44
|
+
}, D = () => Object.keys(S()), O = () => Object.keys(T()), k = () => v, A = null, re = null, j = () => re ??= import("./api-BU8zNmQI.js").then((e) => e.n).then((e) => e.apiPromise), ie = async () => {
|
|
45
45
|
me();
|
|
46
46
|
let e = await m(), [t, r] = await Promise.all([p().then((e) => e ? l() : []).catch(() => []), e ? n().then((e) => ({
|
|
47
47
|
ok: !0,
|