@delta-comic/plugin 0.3.5 → 1.3.1

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/LICENSE CHANGED
@@ -658,4 +658,4 @@ specific requirements.
658
658
  You should also get your employer (if you work as a programmer) or school,
659
659
  if any, to sign a "copyright disclaimer" for the program, if necessary.
660
660
  For more information on this, and how to apply and follow the GNU AGPL, see
661
- <https://www.gnu.org/licenses/>.
661
+ <https://www.gnu.org/licenses/>.
@@ -0,0 +1,2 @@
1
+ import { n as e, t } from "./core-wAb1OuYe.js";
2
+ export { t as $initCore, e as coreName };
@@ -0,0 +1,521 @@
1
+ import { PluginArchiveDB as e, useNativeStore as t } from "@delta-comic/db";
2
+ import { useGlobalVar as n } from "@delta-comic/utils";
3
+ import { computed as r, createVNode as i, getCurrentInstance as a, getCurrentScope as o, hasInjectionContext as s, inject as c, onMounted as l, reactive as u, shallowReactive as d, shallowRef as f, toValue as p, unref as m, watch as h, watchEffect as g } from "vue";
4
+ import { defineStore as _ } from "pinia";
5
+ import { uni as v } from "@delta-comic/model";
6
+ import { SharedFunction as y } from "@delta-comic/core";
7
+ //#region \0rolldown/runtime.js
8
+ var b = Object.defineProperty, x = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), S = (e, t) => {
9
+ let n = {};
10
+ for (var r in e) b(n, r, {
11
+ get: e[r],
12
+ enumerable: !0
13
+ });
14
+ return t || b(n, Symbol.toStringTag, { value: "Module" }), n;
15
+ }, ee = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
16
+ if (typeof require < "u") return require.apply(this, arguments);
17
+ throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
18
+ });
19
+ //#endregion
20
+ //#region ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/predicate/isLength.mjs
21
+ function te(e) {
22
+ return Number.isSafeInteger(e) && e >= 0;
23
+ }
24
+ //#endregion
25
+ //#region ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/predicate/isString.mjs
26
+ function C(e) {
27
+ return typeof e == "string";
28
+ }
29
+ //#endregion
30
+ //#region ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/predicate/isUndefined.mjs
31
+ function w(e) {
32
+ return e === void 0;
33
+ }
34
+ //#endregion
35
+ //#region ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/compat/predicate/isArrayLike.mjs
36
+ function T(e) {
37
+ return e != null && typeof e != "function" && te(e.length);
38
+ }
39
+ //#endregion
40
+ //#region ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/compat/object/fromPairs.mjs
41
+ function ne(e) {
42
+ if (!T(e)) return {};
43
+ let t = {};
44
+ for (let n = 0; n < e.length; n++) {
45
+ let [r, i] = e[n];
46
+ t[r] = i;
47
+ }
48
+ return t;
49
+ }
50
+ //#endregion
51
+ //#region ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/compat/predicate/isFunction.mjs
52
+ function E(e) {
53
+ return typeof e == "function";
54
+ }
55
+ //#endregion
56
+ //#region ../../node_modules/.pnpm/mitt@3.0.1/node_modules/mitt/dist/mitt.mjs
57
+ function D(e) {
58
+ return {
59
+ all: e ||= /* @__PURE__ */ new Map(),
60
+ on: function(t, n) {
61
+ var r = e.get(t);
62
+ r ? r.push(n) : e.set(t, [n]);
63
+ },
64
+ off: function(t, n) {
65
+ var r = e.get(t);
66
+ r && (n ? r.splice(r.indexOf(n) >>> 0, 1) : e.set(t, []));
67
+ },
68
+ emit: function(t, n) {
69
+ var r = e.get(t);
70
+ r && r.slice().map(function(e) {
71
+ e(n);
72
+ }), (r = e.get("*")) && r.slice().map(function(e) {
73
+ e(t, n);
74
+ });
75
+ }
76
+ };
77
+ }
78
+ //#endregion
79
+ //#region lib/plugin/index.ts
80
+ var O = D(), k = async (e) => {
81
+ if (E(e)) var t = e(window.$$safe$$);
82
+ else var t = e;
83
+ return console.log("[definePlugin] new plugin defining...", t), O.emit("definedPlugin", t), t;
84
+ }, A = (e) => ({
85
+ name: {
86
+ display: e["name:display"],
87
+ id: e["name:id"]
88
+ },
89
+ author: e.author ?? "",
90
+ description: e.description,
91
+ require: (e.require ? C(e.require) ? [e.require] : e.require : []).map((e) => {
92
+ let [t, ...n] = e.split(":");
93
+ if (t.startsWith("dc|")) return {
94
+ id: t.replace(/^dc\|/, ""),
95
+ download: n.join(":")
96
+ };
97
+ }).filter((e) => !w(e)),
98
+ version: {
99
+ plugin: e.version.split("/")[0],
100
+ supportCore: (() => {
101
+ let t = e.version.split("/")[1];
102
+ return e.version.split("/")[2] ? t.replaceAll(">=", "^") : t;
103
+ })()
104
+ }
105
+ }), j = /* @__PURE__ */ new WeakMap(), M = (...e) => {
106
+ let t = e[0], n = a()?.proxy ?? o();
107
+ if (n == null && !s()) throw Error("injectLocal must be called in setup");
108
+ return n && j.has(n) && t in j.get(n) ? j.get(n)[t] : c(...e);
109
+ }, N = typeof window < "u" && typeof document < "u";
110
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
111
+ var re = Object.prototype.toString, ie = (e) => re.call(e) === "[object Object]";
112
+ function P(e) {
113
+ return e.endsWith("rem") ? Number.parseFloat(e) * 16 : Number.parseFloat(e);
114
+ }
115
+ function F(e) {
116
+ return Array.isArray(e) ? e : [e];
117
+ }
118
+ function I(e, t, n) {
119
+ return h(e, t, {
120
+ ...n,
121
+ immediate: !0
122
+ });
123
+ }
124
+ //#endregion
125
+ //#region ../../node_modules/.pnpm/@vueuse+core@14.2.1_vue@3.5.30_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.js
126
+ var L = N ? window : void 0;
127
+ N && window.document, N && window.navigator, N && window.location;
128
+ function R(e) {
129
+ let t = p(e);
130
+ return t?.$el ?? t;
131
+ }
132
+ function z(...e) {
133
+ let t = (e, t, n, r) => (e.addEventListener(t, n, r), () => e.removeEventListener(t, n, r)), n = r(() => {
134
+ let t = F(p(e[0])).filter((e) => e != null);
135
+ return t.every((e) => typeof e != "string") ? t : void 0;
136
+ });
137
+ return I(() => [
138
+ n.value?.map((e) => R(e)) ?? [L].filter((e) => e != null),
139
+ F(p(n.value ? e[1] : e[0])),
140
+ F(m(n.value ? e[2] : e[1])),
141
+ p(n.value ? e[3] : e[2])
142
+ ], ([e, n, r, i], a, o) => {
143
+ if (!e?.length || !n?.length || !r?.length) return;
144
+ let s = ie(i) ? { ...i } : i, c = e.flatMap((e) => n.flatMap((n) => r.map((r) => t(e, n, r, s))));
145
+ o(() => {
146
+ c.forEach((e) => e());
147
+ });
148
+ }, { flush: "post" });
149
+ }
150
+ function B() {
151
+ let e = f(!1), t = a();
152
+ return t && l(() => {
153
+ e.value = !0;
154
+ }, t), e;
155
+ }
156
+ /* @__NO_SIDE_EFFECTS__ */
157
+ function V(e) {
158
+ let t = B();
159
+ return r(() => (t.value, !!e()));
160
+ }
161
+ var H = Symbol("vueuse-ssr-width");
162
+ /* @__NO_SIDE_EFFECTS__ */
163
+ function U() {
164
+ let e = s() ? M(H, null) : null;
165
+ return typeof e == "number" ? e : void 0;
166
+ }
167
+ function W(e, t = {}) {
168
+ let { window: n = L, ssrWidth: i = /* @__PURE__ */ U() } = t, a = /* @__PURE__ */ V(() => n && "matchMedia" in n && typeof n.matchMedia == "function"), o = f(typeof i == "number"), s = f(), c = f(!1);
169
+ return g(() => {
170
+ if (o.value) {
171
+ o.value = !a.value, c.value = p(e).split(",").some((e) => {
172
+ let t = e.includes("not all"), n = e.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), r = e.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), a = !!(n || r);
173
+ return n && a && (a = i >= P(n[1])), r && a && (a = i <= P(r[1])), t ? !a : a;
174
+ });
175
+ return;
176
+ }
177
+ a.value && (s.value = n.matchMedia(p(e)), c.value = s.value.matches);
178
+ }), z(s, "change", (e) => {
179
+ c.value = e.matches;
180
+ }, { passive: !0 }), r(() => c.value);
181
+ }
182
+ function G(e) {
183
+ return W("(prefers-color-scheme: dark)", e);
184
+ }
185
+ //#endregion
186
+ //#region lib/config.ts
187
+ var K = class {
188
+ constructor(e, t, n) {
189
+ this.pluginName = e, this.config = t, this.configName = n, this.key = Symbol.for(`config:${e}`);
190
+ }
191
+ key;
192
+ }, q = n(new K("core", {
193
+ recordHistory: {
194
+ type: "switch",
195
+ defaultValue: !0,
196
+ info: "记录历史记录"
197
+ },
198
+ showAIProject: {
199
+ type: "switch",
200
+ defaultValue: !0,
201
+ info: "展示AI作品"
202
+ },
203
+ darkMode: {
204
+ type: "radio",
205
+ defaultValue: "system",
206
+ info: "暗色模式配置",
207
+ comp: "select",
208
+ selects: [
209
+ {
210
+ label: "浅色",
211
+ value: "light"
212
+ },
213
+ {
214
+ label: "暗色",
215
+ value: "dark"
216
+ },
217
+ {
218
+ label: "跟随系统",
219
+ value: "system"
220
+ }
221
+ ]
222
+ },
223
+ easilyTitle: {
224
+ type: "switch",
225
+ defaultValue: !1,
226
+ info: "简化标题(实验)"
227
+ },
228
+ githubToken: {
229
+ type: "string",
230
+ defaultValue: "",
231
+ info: "github的token",
232
+ placeholder: "仅用于解除api访问限制"
233
+ }
234
+ }, "核心"), "core/plugin/config"), J = _("config", (e) => {
235
+ let n = d(/* @__PURE__ */ new Map()), i = e.action((e) => {
236
+ let t = n.get(e.key);
237
+ if (!t) throw Error(`not found config by plugin "${e.pluginName}"`);
238
+ return t.value;
239
+ }, "load"), a = G(), o = r(() => {
240
+ if (!s(q)) return a.value;
241
+ switch (i(q).value.darkMode) {
242
+ case "light": return !1;
243
+ case "dark": return !0;
244
+ case "system": return a.value;
245
+ default: return !1;
246
+ }
247
+ }), s = e.action((e) => n.has(e.key), "isExistConfig");
248
+ return {
249
+ isDark: o,
250
+ form: n,
251
+ $load: i,
252
+ $isExistConfig: s,
253
+ $resignerConfig: e.action((e) => {
254
+ let n = J(), r = t(e.pluginName, "config", ne(Object.entries(e.config).map(([e, t]) => [e, t.defaultValue])));
255
+ n.form.set(e.key, {
256
+ form: e.config,
257
+ value: r
258
+ });
259
+ }, "resignerConfig")
260
+ };
261
+ }), Y = (e) => Symbol.for(`expose:${e}`), ae = (e) => X.get(e), X = /* @__PURE__ */ new Map(), Z = n(_("plugin", (t) => {
262
+ let n = d(/* @__PURE__ */ new Map()), i = u({}), { data: a } = e.useQuery((e) => e.select(["pluginName", "displayName"]).execute().then((e) => Object.fromEntries(e.map((e) => [e.pluginName, e.displayName])))), o = r(() => Array.from(n.values()).filter((e) => e.search?.methods).map((e) => [e.name, Object.entries(e.search?.methods ?? {})]));
263
+ return {
264
+ $getPluginDisplayName: t.action((e) => a.value[e] || e, "getPluginDisplayName"),
265
+ plugins: n,
266
+ allSearchSource: o,
267
+ pluginSteps: i
268
+ };
269
+ }), "core/plugin/store"), oe = /* @__PURE__ */ x(((e, t) => {
270
+ var n = (function() {
271
+ var e = String.fromCharCode, t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$", r = {};
272
+ function i(e, t) {
273
+ if (!r[e]) {
274
+ r[e] = {};
275
+ for (var n = 0; n < e.length; n++) r[e][e.charAt(n)] = n;
276
+ }
277
+ return r[e][t];
278
+ }
279
+ var a = {
280
+ compressToBase64: function(e) {
281
+ if (e == null) return "";
282
+ var n = a._compress(e, 6, function(e) {
283
+ return t.charAt(e);
284
+ });
285
+ switch (n.length % 4) {
286
+ default:
287
+ case 0: return n;
288
+ case 1: return n + "===";
289
+ case 2: return n + "==";
290
+ case 3: return n + "=";
291
+ }
292
+ },
293
+ decompressFromBase64: function(e) {
294
+ return e == null ? "" : e == "" ? null : a._decompress(e.length, 32, function(n) {
295
+ return i(t, e.charAt(n));
296
+ });
297
+ },
298
+ compressToUTF16: function(t) {
299
+ return t == null ? "" : a._compress(t, 15, function(t) {
300
+ return e(t + 32);
301
+ }) + " ";
302
+ },
303
+ decompressFromUTF16: function(e) {
304
+ return e == null ? "" : e == "" ? null : a._decompress(e.length, 16384, function(t) {
305
+ return e.charCodeAt(t) - 32;
306
+ });
307
+ },
308
+ compressToUint8Array: function(e) {
309
+ for (var t = a.compress(e), n = new Uint8Array(t.length * 2), r = 0, i = t.length; r < i; r++) {
310
+ var o = t.charCodeAt(r);
311
+ n[r * 2] = o >>> 8, n[r * 2 + 1] = o % 256;
312
+ }
313
+ return n;
314
+ },
315
+ decompressFromUint8Array: function(t) {
316
+ if (t == null) return a.decompress(t);
317
+ for (var n = Array(t.length / 2), r = 0, i = n.length; r < i; r++) n[r] = t[r * 2] * 256 + t[r * 2 + 1];
318
+ var o = [];
319
+ return n.forEach(function(t) {
320
+ o.push(e(t));
321
+ }), a.decompress(o.join(""));
322
+ },
323
+ compressToEncodedURIComponent: function(e) {
324
+ return e == null ? "" : a._compress(e, 6, function(e) {
325
+ return n.charAt(e);
326
+ });
327
+ },
328
+ decompressFromEncodedURIComponent: function(e) {
329
+ return e == null ? "" : e == "" ? null : (e = e.replace(/ /g, "+"), a._decompress(e.length, 32, function(t) {
330
+ return i(n, e.charAt(t));
331
+ }));
332
+ },
333
+ compress: function(t) {
334
+ return a._compress(t, 16, function(t) {
335
+ return e(t);
336
+ });
337
+ },
338
+ _compress: function(e, t, n) {
339
+ if (e == null) return "";
340
+ var r, i, a = {}, o = {}, s = "", c = "", l = "", u = 2, d = 3, f = 2, p = [], m = 0, h = 0, g;
341
+ for (g = 0; g < e.length; g += 1) if (s = e.charAt(g), Object.prototype.hasOwnProperty.call(a, s) || (a[s] = d++, o[s] = !0), c = l + s, Object.prototype.hasOwnProperty.call(a, c)) l = c;
342
+ else {
343
+ if (Object.prototype.hasOwnProperty.call(o, l)) {
344
+ if (l.charCodeAt(0) < 256) {
345
+ for (r = 0; r < f; r++) m <<= 1, h == t - 1 ? (h = 0, p.push(n(m)), m = 0) : h++;
346
+ for (i = l.charCodeAt(0), r = 0; r < 8; r++) m = m << 1 | i & 1, h == t - 1 ? (h = 0, p.push(n(m)), m = 0) : h++, i >>= 1;
347
+ } else {
348
+ for (i = 1, r = 0; r < f; r++) m = m << 1 | i, h == t - 1 ? (h = 0, p.push(n(m)), m = 0) : h++, i = 0;
349
+ for (i = l.charCodeAt(0), r = 0; r < 16; r++) m = m << 1 | i & 1, h == t - 1 ? (h = 0, p.push(n(m)), m = 0) : h++, i >>= 1;
350
+ }
351
+ u--, u == 0 && (u = 2 ** f, f++), delete o[l];
352
+ } else for (i = a[l], r = 0; r < f; r++) m = m << 1 | i & 1, h == t - 1 ? (h = 0, p.push(n(m)), m = 0) : h++, i >>= 1;
353
+ u--, u == 0 && (u = 2 ** f, f++), a[c] = d++, l = String(s);
354
+ }
355
+ if (l !== "") {
356
+ if (Object.prototype.hasOwnProperty.call(o, l)) {
357
+ if (l.charCodeAt(0) < 256) {
358
+ for (r = 0; r < f; r++) m <<= 1, h == t - 1 ? (h = 0, p.push(n(m)), m = 0) : h++;
359
+ for (i = l.charCodeAt(0), r = 0; r < 8; r++) m = m << 1 | i & 1, h == t - 1 ? (h = 0, p.push(n(m)), m = 0) : h++, i >>= 1;
360
+ } else {
361
+ for (i = 1, r = 0; r < f; r++) m = m << 1 | i, h == t - 1 ? (h = 0, p.push(n(m)), m = 0) : h++, i = 0;
362
+ for (i = l.charCodeAt(0), r = 0; r < 16; r++) m = m << 1 | i & 1, h == t - 1 ? (h = 0, p.push(n(m)), m = 0) : h++, i >>= 1;
363
+ }
364
+ u--, u == 0 && (u = 2 ** f, f++), delete o[l];
365
+ } else for (i = a[l], r = 0; r < f; r++) m = m << 1 | i & 1, h == t - 1 ? (h = 0, p.push(n(m)), m = 0) : h++, i >>= 1;
366
+ u--, u == 0 && (u = 2 ** f, f++);
367
+ }
368
+ for (i = 2, r = 0; r < f; r++) m = m << 1 | i & 1, h == t - 1 ? (h = 0, p.push(n(m)), m = 0) : h++, i >>= 1;
369
+ for (;;) if (m <<= 1, h == t - 1) {
370
+ p.push(n(m));
371
+ break;
372
+ } else h++;
373
+ return p.join("");
374
+ },
375
+ decompress: function(e) {
376
+ return e == null ? "" : e == "" ? null : a._decompress(e.length, 32768, function(t) {
377
+ return e.charCodeAt(t);
378
+ });
379
+ },
380
+ _decompress: function(t, n, r) {
381
+ var i = [], a = 4, o = 4, s = 3, c = "", l = [], u, d, f, p, m, h, g, _ = {
382
+ val: r(0),
383
+ position: n,
384
+ index: 1
385
+ };
386
+ for (u = 0; u < 3; u += 1) i[u] = u;
387
+ for (f = 0, m = 2 ** 2, h = 1; h != m;) p = _.val & _.position, _.position >>= 1, _.position == 0 && (_.position = n, _.val = r(_.index++)), f |= (p > 0 ? 1 : 0) * h, h <<= 1;
388
+ switch (f) {
389
+ case 0:
390
+ for (f = 0, m = 2 ** 8, h = 1; h != m;) p = _.val & _.position, _.position >>= 1, _.position == 0 && (_.position = n, _.val = r(_.index++)), f |= (p > 0 ? 1 : 0) * h, h <<= 1;
391
+ g = e(f);
392
+ break;
393
+ case 1:
394
+ for (f = 0, m = 2 ** 16, h = 1; h != m;) p = _.val & _.position, _.position >>= 1, _.position == 0 && (_.position = n, _.val = r(_.index++)), f |= (p > 0 ? 1 : 0) * h, h <<= 1;
395
+ g = e(f);
396
+ break;
397
+ case 2: return "";
398
+ }
399
+ for (i[3] = g, d = g, l.push(g);;) {
400
+ if (_.index > t) return "";
401
+ for (f = 0, m = 2 ** s, h = 1; h != m;) p = _.val & _.position, _.position >>= 1, _.position == 0 && (_.position = n, _.val = r(_.index++)), f |= (p > 0 ? 1 : 0) * h, h <<= 1;
402
+ switch (g = f) {
403
+ case 0:
404
+ for (f = 0, m = 2 ** 8, h = 1; h != m;) p = _.val & _.position, _.position >>= 1, _.position == 0 && (_.position = n, _.val = r(_.index++)), f |= (p > 0 ? 1 : 0) * h, h <<= 1;
405
+ i[o++] = e(f), g = o - 1, a--;
406
+ break;
407
+ case 1:
408
+ for (f = 0, m = 2 ** 16, h = 1; h != m;) p = _.val & _.position, _.position >>= 1, _.position == 0 && (_.position = n, _.val = r(_.index++)), f |= (p > 0 ? 1 : 0) * h, h <<= 1;
409
+ i[o++] = e(f), g = o - 1, a--;
410
+ break;
411
+ case 2: return l.join("");
412
+ }
413
+ if (a == 0 && (a = 2 ** s, s++), i[g]) c = i[g];
414
+ else if (g === o) c = d + d.charAt(0);
415
+ else return null;
416
+ l.push(c), i[o++] = d + c.charAt(0), a--, d = c, a == 0 && (a = 2 ** s, s++);
417
+ }
418
+ }
419
+ };
420
+ return a;
421
+ })();
422
+ typeof define == "function" && define.amd ? define(function() {
423
+ return n;
424
+ }) : t !== void 0 && t != null ? t.exports = n : typeof angular < "u" && angular != null && angular.module("LZString", []).factory("LZString", function() {
425
+ return n;
426
+ });
427
+ })), se = () => i("svg", {
428
+ xmlns: "http://www.w3.org/2000/svg",
429
+ xmlnsXlink: "http://www.w3.org/1999/xlink",
430
+ viewBox: "0 0 24 24"
431
+ }, [
432
+ i("path", {
433
+ d: "M5 5c-.55 0-1 .45-1 1v15c0 1.1.9 2 2 2h9c.55 0 1-.45 1-1s-.45-1-1-1H6V6c0-.55-.45-1-1-1z",
434
+ fill: "currentColor"
435
+ }, null),
436
+ i("path", {
437
+ d: "M18 1h-8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 14h-8V5h8v10z",
438
+ fill: "currentColor"
439
+ }, null),
440
+ i("path", {
441
+ d: "M12.5 10.25h2v.54c0 .45.54.67.85.35l1.29-1.29c.2-.2.2-.51 0-.71l-1.29-1.29a.5.5 0 0 0-.85.35v.54H12c-.55 0-1 .45-1 1v1.5c0 .41.34.75.75.75s.75-.34.75-.75v-.99z",
442
+ fill: "currentColor"
443
+ }, null)
444
+ ]), ce = () => i("svg", {
445
+ xmlns: "http://www.w3.org/2000/svg",
446
+ xmlnsXlink: "http://www.w3.org/1999/xlink",
447
+ viewBox: "0 0 1024 1024"
448
+ }, [i("path", {
449
+ d: "M938 458.8l-29.6-312.6c-1.5-16.2-14.4-29-30.6-30.6L565.2 86h-.4c-3.2 0-5.7 1-7.6 2.9L88.9 557.2a9.96 9.96 0 0 0 0 14.1l363.8 363.8c1.9 1.9 4.4 2.9 7.1 2.9s5.2-1 7.1-2.9l468.3-468.3c2-2.1 3-5 2.8-8zM459.7 834.7L189.3 564.3L589 164.6L836 188l23.4 247l-399.7 399.7zM680 256c-48.5 0-88 39.5-88 88s39.5 88 88 88s88-39.5 88-88s-39.5-88-88-88zm0 120c-17.7 0-32-14.3-32-32s14.3-32 32-32s32 14.3 32 32s-14.3 32-32 32z",
450
+ fill: "currentColor"
451
+ }, null)]), Q = oe(), le = () => k({
452
+ name: $,
453
+ config: [q],
454
+ share: {
455
+ initiative: [{
456
+ filter: (e) => !!e.preload,
457
+ icon: ce,
458
+ key: "token",
459
+ name: "复制口令",
460
+ async call(e) {
461
+ let t = e.preload?.toJSON();
462
+ if (!t) throw Error("Not found preload in content. Maybe not fetch detail?");
463
+ let n = (0, Q.compressToEncodedURIComponent)(JSON.stringify({
464
+ item: {
465
+ contentType: v.content.ContentPage.contentPages.key.toString(t.contentType),
466
+ ep: t.thisEp.id,
467
+ name: t.title
468
+ },
469
+ plugin: e.plugin,
470
+ id: e.id
471
+ }));
472
+ await y.call("pushShareToken", `[${t.title}](复制这条口令,打开Delta Comic)${n}`);
473
+ }
474
+ }, {
475
+ filter: (e) => !!e.preload,
476
+ icon: se,
477
+ key: "native",
478
+ name: "原生分享",
479
+ async call(e) {
480
+ let t = e.preload?.toJSON();
481
+ if (!t) throw Error("Not found preload in content. Maybe not fetch detail?");
482
+ let n = (0, Q.compressToEncodedURIComponent)(JSON.stringify({
483
+ item: {
484
+ contentType: v.content.ContentPage.contentPages.key.toString(t.contentType),
485
+ ep: t.thisEp.id,
486
+ name: t.title
487
+ },
488
+ plugin: e.plugin,
489
+ id: e.id
490
+ })), r = `[${t.title}](复制这条口令,打开Delta Comic)${n}`;
491
+ await navigator.share({
492
+ title: "Delta Comic内容分享",
493
+ text: r
494
+ });
495
+ }
496
+ }],
497
+ tokenListen: [{
498
+ key: "token",
499
+ name: "默认口令",
500
+ patten(e) {
501
+ return /^\[.+\]\(复制这条口令,打开Delta Comic\).+/.test(e);
502
+ },
503
+ show(e) {
504
+ let t = Z(), n = JSON.parse((0, Q.decompressFromEncodedURIComponent)(e.replace(/^\[.+\]/, "").replaceAll("(复制这条口令,打开Delta Comic)", "")));
505
+ return {
506
+ title: "口令",
507
+ detail: `发现分享的内容: ${n.item.name},需要的插件: ${t.$getPluginDisplayName(n.plugin)}`,
508
+ onNegative() {},
509
+ onPositive() {
510
+ return y.call("routeToContent", v.content.ContentPage.contentPages.key.toJSON(n.item.contentType), n.id, n.item.ep);
511
+ }
512
+ };
513
+ }
514
+ }]
515
+ }
516
+ }), $ = "core";
517
+ n(Y($), "core/plugin/coreFlag");
518
+ //#endregion
519
+ export { ee as _, X as a, q as c, k as d, O as f, S as g, x as h, Y as i, J as l, C as m, $ as n, ae as o, T as p, Z as r, K as s, le as t, A as u };
520
+
521
+ //# sourceMappingURL=core-wAb1OuYe.js.map