@banou/ripple 0.0.4 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +141 -3
  2. package/_headers +14 -0
  3. package/api-Jq4OSTp1-B4uxQLLk.js +338 -0
  4. package/app.webmanifest +50 -0
  5. package/assets/empty-BvRk9kiK.js +0 -0
  6. package/assets/libtorrent-DS_9Yo8M.js +6 -0
  7. package/assets/sintel.torrent +0 -0
  8. package/assets/worker-SJZDGuG-.js +23 -0
  9. package/build-DEOZ3A7n.js +1846 -0
  10. package/index.js +44658 -0
  11. package/jassub/default.woff2 +0 -0
  12. package/jassub/fonts.js +1 -0
  13. package/jassub/jassub-assets.js +0 -0
  14. package/jassub/jassub-worker-modern.wasm +0 -0
  15. package/jassub/jassub-worker.js +1 -0
  16. package/jassub/jassub-worker.wasm +0 -0
  17. package/jassub/worker.js +148 -0
  18. package/libav-jspi.wasm +0 -0
  19. package/libav-worker.js +4824 -0
  20. package/libav.wasm +0 -0
  21. package/package.json +14 -81
  22. package/remote-BLaEXLm6.js +209 -0
  23. package/sw.js +192 -0
  24. package/build/app.webmanifest +0 -65
  25. package/build/assets/index-be95001c.js +0 -211
  26. package/build/assets/index-d5b720ec.js +0 -109
  27. package/build/assets/io-worker-bde41815.js +0 -17681
  28. package/build/index-3576f032.js +0 -14881
  29. package/build/index-65b2197a.js +0 -116
  30. package/build/index-9a320571.js +0 -107
  31. package/build/index.js +0 -33826
  32. package/build/io-worker-190cc8d7.js +0 -2862
  33. package/build/jassub-worker-modern.wasm +0 -0
  34. package/build/jassub-worker.js +0 -15
  35. package/build/libav-worker.js +0 -1565
  36. package/build/libav.wasm +0 -0
  37. package/build/shared-worker.js +0 -13
  38. package/build/worker.js +0 -38
  39. /package/{build/assets → assets}/logo.png +0 -0
  40. /package/{build/assets → assets}/logo.svg +0 -0
  41. /package/{build/index.html → index.html} +0 -0
@@ -1,116 +0,0 @@
1
- var O = "osra-message", g = (e) => !!(globalThis.SharedArrayBuffer && e instanceof globalThis.SharedArrayBuffer), l = (e) => globalThis.ArrayBuffer && e instanceof globalThis.ArrayBuffer || globalThis.MessagePort && e instanceof globalThis.MessagePort || globalThis.ReadableStream && e instanceof globalThis.ReadableStream || globalThis.WritableStream && e instanceof globalThis.WritableStream || globalThis.TransformStream && e instanceof globalThis.TransformStream ? !0 : !!(globalThis.ImageBitmap && e instanceof globalThis.ImageBitmap), h = (e) => {
2
- const r = [], t = (s) => g(s) ? void 0 : l(s) ? r.push(s) : Array.isArray(s) ? s.map(t) : s && typeof s == "object" ? Object.values(s).map(t) : void 0;
3
- return t(e), r;
4
- }, p = "__proxyFunctionPort__", S = (e) => {
5
- const { port1: r, port2: t } = new MessageChannel();
6
- return r.addEventListener("message", async (s) => {
7
- try {
8
- const n = await e(...s.data), a = i(n), o = h(a);
9
- r.postMessage({ result: a }, { transfer: o });
10
- } catch (n) {
11
- r.postMessage({ error: n });
12
- }
13
- }), r.start(), t;
14
- }, i = (e) => g(e) || l(e) ? e : typeof e == "function" ? { [p]: S(e) } : Array.isArray(e) ? e.map(i) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([r, t]) => [
15
- r,
16
- i(t)
17
- ])) : e, M = (e) => (...r) => new Promise((t, s) => {
18
- const n = i(r), a = h(n);
19
- e.addEventListener("message", (o) => {
20
- o.data.error ? s(o.data.error) : t(y(o.data.result));
21
- }), e.start(), e.postMessage(n, { transfer: a });
22
- }), y = (e) => g(e) || l(e) ? e : e && typeof e == "object" && e[p] ? M(e[p]) : Array.isArray(e) ? e.map(i) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([r, t]) => [
23
- r,
24
- y(t)
25
- ])) : e, T = (e, { key: r = O } = { key: O }) => (t, s) => new Promise((n, a) => {
26
- const { port1: o, port2: d } = new MessageChannel();
27
- o.addEventListener("message", ({ data: b }) => {
28
- if (b.error)
29
- a(b.error);
30
- else {
31
- const _ = y(b.result);
32
- n(_);
33
- }
34
- o.close(), d.close();
35
- }, { once: !0 }), o.start();
36
- const E = i(s), x = h(E);
37
- e.postMessage({
38
- source: r,
39
- type: t,
40
- data: E,
41
- port: d
42
- }, {
43
- targetOrigin: "*",
44
- transfer: [d, ...x ?? []]
45
- });
46
- });
47
- let R, f;
48
- const k = () => (f = new Promise((e, r) => {
49
- R = e;
50
- }), f), C = k(), A = async (e) => {
51
- e === C && k(), R(await e);
52
- }, F = "https://fkn.app", I = globalThis.window === void 0, c = globalThis.document?.createElement("iframe");
53
- c && (c.src = `${F}/sandbox-api`, c.style.display = "none", document.body.appendChild(c));
54
- const m = c, P = m?.contentWindow, B = (e) => A(e), j = () => f, L = async () => T(await j(), { key: "fkn-sandbox-api" })("API_PORT", {});
55
- if (I) {
56
- let e = !1;
57
- f.then(() => {
58
- e = !0;
59
- }), setTimeout(() => {
60
- e || console.warn("@fkn/lib's api target has not resolved after 250ms while in a worker, make sure to call `setApiTarget(messagePort)`");
61
- }, 250);
62
- } else {
63
- if (!m)
64
- throw new Error("Missing appended iframe");
65
- m.addEventListener("load", () => {
66
- const e = setInterval(
67
- () => T(P, { key: "fkn-sandbox" })("APP_READY", {}).then(() => {
68
- A(P), clearInterval(e);
69
- }),
70
- 10
71
- );
72
- });
73
- }
74
- const w = (e, r) => j().then(
75
- (t) => T(t, { key: "fkn-sandbox-api" })(e, r)
76
- ), Y = async (e, r) => {
77
- const t = e, s = r, { body: n, ...a } = await w("SERVER_PROXY_FETCH", { input: t, init: s });
78
- return new Response(
79
- n,
80
- {
81
- ...a,
82
- headers: {
83
- ...a.headers,
84
- ...a.headers && {
85
- setCookie: a.headers["set-cookie"]
86
- }
87
- }
88
- }
89
- );
90
- }, N = async ({ magnet: e, path: r, offset: t, end: s }) => {
91
- const { body: n, ...a } = await w("TORRENT", { magnet: e, path: r, offset: t, end: s });
92
- return new Response(
93
- n,
94
- {
95
- ...a,
96
- headers: Object.fromEntries(a.headers)
97
- }
98
- );
99
- }, u = async ({ magnet: e }) => {
100
- const { body: r, ...t } = await w("TORRENT_FILE", { magnet: e });
101
- return new Response(
102
- r,
103
- {
104
- ...t,
105
- headers: Object.fromEntries(t.headers)
106
- }
107
- );
108
- };
109
- export {
110
- Y as E,
111
- N as P,
112
- B as b,
113
- L as k,
114
- u,
115
- j as w
116
- };
@@ -1,107 +0,0 @@
1
- const m = "osra-message", h = (e) => !!(globalThis.SharedArrayBuffer && e instanceof globalThis.SharedArrayBuffer), u = (e) => globalThis.ArrayBuffer && e instanceof globalThis.ArrayBuffer || globalThis.MessagePort && e instanceof globalThis.MessagePort || globalThis.ReadableStream && e instanceof globalThis.ReadableStream || globalThis.WritableStream && e instanceof globalThis.WritableStream || globalThis.TransformStream && e instanceof globalThis.TransformStream ? !0 : !!(globalThis.ImageBitmap && e instanceof globalThis.ImageBitmap), g = (e) => {
2
- const r = [], s = (a) => h(a) ? void 0 : u(a) ? r.push(a) : Array.isArray(a) ? a.map(s) : a && typeof a == "object" ? Object.values(a).map(s) : void 0;
3
- return s(e), r;
4
- }, b = "__proxyFunctionPort__", j = (e) => {
5
- const { port1: r, port2: s } = new MessageChannel();
6
- return r.addEventListener("message", async (a) => {
7
- try {
8
- const i = await e(...a.data), o = p(i), n = g(o);
9
- r.postMessage({ result: o }, { transfer: n });
10
- } catch (i) {
11
- r.postMessage({ error: i });
12
- }
13
- }), r.start(), s;
14
- }, p = (e) => h(e) || u(e) ? e : typeof e == "function" ? { [b]: j(e) } : Array.isArray(e) ? e.map(p) : e && typeof e == "object" ? Object.fromEntries(
15
- Object.entries(e).map(([r, s]) => [
16
- r,
17
- p(s)
18
- ])
19
- ) : e, w = (e) => (...r) => new Promise((s, a) => {
20
- const i = p(r), o = g(i), n = (t) => {
21
- t.data.error ? a(t.data.error) : s(d(t.data.result)), e.removeEventListener("message", n);
22
- };
23
- e.addEventListener("message", n), e.start(), e.postMessage(i, { transfer: o });
24
- }), d = (e) => h(e) || u(e) ? e : e && typeof e == "object" && e[b] ? w(e[b]) : Array.isArray(e) ? e.map(p) : e && typeof e == "object" ? Object.fromEntries(
25
- Object.entries(e).map(([r, s]) => [
26
- r,
27
- d(s)
28
- ])
29
- ) : e, O = ({
30
- target: e,
31
- resolvers: r,
32
- filter: s,
33
- map: a,
34
- key: i = m,
35
- proxyTarget: o
36
- }) => {
37
- const n = (t) => {
38
- if (!t.data || typeof t.data != "object" || t.data?.source !== i || s && !s(t))
39
- return;
40
- if (o) {
41
- const { type: M, data: T, port: v } = t.data, A = g(T);
42
- o.postMessage(
43
- {
44
- source: i,
45
- type: M,
46
- data: T,
47
- port: v
48
- },
49
- {
50
- targetOrigin: "*",
51
- transfer: [v, ...A ?? []]
52
- }
53
- );
54
- return;
55
- }
56
- const { type: l, data: y, port: c } = t.data, f = r[l];
57
- if (!f)
58
- throw new Error(`Osra received a message of type "${String(l)}" but no resolver was found for type.`);
59
- a ? f(...a(y, { event: t, type: l, port: c })) : f(y, { event: t, type: l, port: c });
60
- };
61
- return e.addEventListener("message", n), {
62
- listener: n,
63
- resolvers: r
64
- };
65
- }, S = (e, { key: r = m } = { key: m }) => (s, a) => new Promise((i, o) => {
66
- const { port1: n, port2: t } = new MessageChannel();
67
- n.addEventListener(
68
- "message",
69
- ({ data: c }) => {
70
- if (c.error)
71
- o(c.error);
72
- else {
73
- const f = d(c.result);
74
- i(f);
75
- }
76
- n.close(), t.close();
77
- },
78
- { once: !0 }
79
- ), n.start();
80
- const l = p(a), y = g(l);
81
- e.postMessage(
82
- {
83
- source: r,
84
- type: s,
85
- data: l,
86
- port: t
87
- },
88
- {
89
- targetOrigin: "*",
90
- transfer: [t, ...y ?? []]
91
- }
92
- );
93
- }), E = (e) => async (r, s) => {
94
- const { port: a } = s, i = d(r);
95
- try {
96
- const o = await e(i, s), n = p(o), t = g(n);
97
- return a.postMessage({ result: n }, { transfer: t }), a.close(), o;
98
- } catch (o) {
99
- throw a.postMessage({ error: o }), a.close(), o;
100
- }
101
- };
102
- export {
103
- O as C,
104
- E as D,
105
- S as R,
106
- g as b
107
- };