@delta-comic/model 0.0.1 → 0.0.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/dist/index.js CHANGED
@@ -1,65 +1,65 @@
1
- import { useGlobalVar } from "@delta-comic/utils";
2
- import { computed, isRef, markRaw, nextTick, ref, shallowReactive, shallowRef, toValue, watch } from "vue";
1
+ import { useGlobalVar as e } from "@delta-comic/utils";
2
+ import { computed as t, isRef as n, markRaw as r, nextTick as i, ref as a, shallowReactive as o, shallowRef as s, toValue as c, watch as l } from "vue";
3
3
  import "axios";
4
- var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty, __commonJSMin = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), __exportAll = (e, t) => {
4
+ var u = Object.create, d = Object.defineProperty, f = Object.getOwnPropertyDescriptor, p = Object.getOwnPropertyNames, m = Object.getPrototypeOf, h = Object.prototype.hasOwnProperty, g = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), _ = (e, t) => {
5
5
  let n = {};
6
- for (var r in e) __defProp(n, r, {
6
+ for (var r in e) d(n, r, {
7
7
  get: e[r],
8
8
  enumerable: !0
9
9
  });
10
- return t || __defProp(n, Symbol.toStringTag, { value: "Module" }), n;
11
- }, __copyProps = (e, t, n, r) => {
12
- if (t && typeof t == "object" || typeof t == "function") for (var i = __getOwnPropNames(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !__hasOwnProp.call(e, s) && s !== n && __defProp(e, s, {
10
+ return t || d(n, Symbol.toStringTag, { value: "Module" }), n;
11
+ }, v = (e, t, n, r) => {
12
+ if (t && typeof t == "object" || typeof t == "function") for (var i = p(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !h.call(e, s) && s !== n && d(e, s, {
13
13
  get: ((e) => t[e]).bind(null, s),
14
- enumerable: !(r = __getOwnPropDesc(t, s)) || r.enumerable
14
+ enumerable: !(r = f(t, s)) || r.enumerable
15
15
  });
16
16
  return e;
17
- }, __toESM = (e, t, n) => (n = e == null ? {} : __create(__getProtoOf(e)), __copyProps(t || !e || !e.__esModule ? __defProp(n, "default", {
17
+ }, y = (e, t, n) => (n = e == null ? {} : u(m(e)), v(t || !e || !e.__esModule ? d(n, "default", {
18
18
  value: e,
19
19
  enumerable: !0
20
20
  }) : n, e));
21
- function isTypedArray$1(e) {
21
+ function b(e) {
22
22
  return ArrayBuffer.isView(e) && !(e instanceof DataView);
23
23
  }
24
- function getTag(e) {
24
+ function x(e) {
25
25
  return e == null ? e === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(e);
26
26
  }
27
- function isError(e) {
27
+ function S(e) {
28
28
  return e instanceof Error;
29
29
  }
30
- function isLength(e) {
30
+ function C(e) {
31
31
  return Number.isSafeInteger(e) && e >= 0;
32
32
  }
33
- function isString$1(e) {
33
+ function w(e) {
34
34
  return typeof e == "string";
35
35
  }
36
- function isArrayLike(e) {
37
- return e != null && typeof e != "function" && isLength(e.length);
36
+ function T(e) {
37
+ return e != null && typeof e != "function" && C(e.length);
38
38
  }
39
- function isArguments(e) {
40
- return typeof e == "object" && !!e && getTag(e) === "[object Arguments]";
39
+ function E(e) {
40
+ return typeof e == "object" && !!e && x(e) === "[object Arguments]";
41
41
  }
42
- function isString(e) {
42
+ function D(e) {
43
43
  return typeof e == "string" || e instanceof String;
44
44
  }
45
- function isPrototype(e) {
45
+ function O(e) {
46
46
  let t = e?.constructor;
47
47
  return e === (typeof t == "function" ? t.prototype : Object.prototype);
48
48
  }
49
- function isTypedArray(e) {
50
- return isTypedArray$1(e);
49
+ function ee(e) {
50
+ return b(e);
51
51
  }
52
- function isEmpty(e) {
52
+ function k(e) {
53
53
  if (e == null) return !0;
54
- if (isArrayLike(e)) return typeof e.splice != "function" && typeof e != "string" && (typeof Buffer > "u" || !Buffer.isBuffer(e)) && !isTypedArray(e) && !isArguments(e) ? !1 : e.length === 0;
54
+ if (T(e)) return typeof e.splice != "function" && typeof e != "string" && (typeof Buffer > "u" || !Buffer.isBuffer(e)) && !ee(e) && !E(e) ? !1 : e.length === 0;
55
55
  if (typeof e == "object") {
56
56
  if (e instanceof Map || e instanceof Set) return e.size === 0;
57
57
  let t = Object.keys(e);
58
- return isPrototype(e) ? t.filter((e) => e !== "constructor").length === 0 : t.length === 0;
58
+ return O(e) ? t.filter((e) => e !== "constructor").length === 0 : t.length === 0;
59
59
  }
60
60
  return !0;
61
61
  }
62
- function mitt_default$1(e) {
62
+ function A(e) {
63
63
  return {
64
64
  all: e ||= /* @__PURE__ */ new Map(),
65
65
  on: function(t, n) {
@@ -80,18 +80,24 @@ function mitt_default$1(e) {
80
80
  }
81
81
  };
82
82
  }
83
- var PromiseContent = class t {
83
+ /**
84
+ * 扩展内容的`Promise`,可视为普通`Promise`使用
85
+ */
86
+ var j = class t {
84
87
  [Symbol.toStringTag] = "PromiseContent";
85
88
  static _this;
86
89
  static {
87
- this._this = useGlobalVar(this, "data/PromiseContent");
90
+ this._this = e(this, "data/PromiseContent");
88
91
  }
89
92
  static isPromiseContent(e) {
90
93
  return e instanceof this._this;
91
94
  }
92
95
  static fromPromise(e, t = (e) => e) {
93
- return markRaw(new this._this(e, t));
96
+ return r(new this._this(e, t));
94
97
  }
98
+ /**
99
+ * 使用`PromiseContent.fromPromise`或`PromiseContent.fromAsyncFunction`代替`new PromiseContent`
100
+ */
95
101
  constructor(e, t = (e) => e) {
96
102
  this.promise = e, this.processor = t, this.loadPromise(e);
97
103
  }
@@ -99,13 +105,13 @@ var PromiseContent = class t {
99
105
  this.data.value = void 0, this.isLoading.value = !0, this.isError.value = !1, this.errorCause.value = void 0, this.isEmpty.value = !0;
100
106
  try {
101
107
  let t = await e;
102
- this.data.value = this.processor(t), this.isLoading.value = !1, this.isError.value = !1, this.isEmpty.value = isEmpty(t), this.emitter.emit("success", this.data.value);
108
+ this.data.value = this.processor(t), this.isLoading.value = !1, this.isError.value = !1, this.isEmpty.value = k(t), this.emitter.emit("success", this.data.value);
103
109
  } catch (e) {
104
- this.data.value = void 0, this.isError.value = !0, this.errorCause.value = isError(e) ? e : Error(String(e)), console.error("Non-throw Error [PromiseContent]", e), this.emitter.emit("error", e);
110
+ this.data.value = void 0, this.isError.value = !0, this.errorCause.value = S(e) ? e : Error(String(e)), console.error("Non-throw Error [PromiseContent]", e), this.emitter.emit("error", e);
105
111
  }
106
112
  this.emitter.emit("finial", void 0);
107
113
  }
108
- emitter = mitt_default$1();
114
+ emitter = A();
109
115
  onError(e) {
110
116
  return this.emitter.on("error", e), () => this.emitter.off("error", e);
111
117
  }
@@ -115,6 +121,9 @@ var PromiseContent = class t {
115
121
  onFinal(e) {
116
122
  return this.emitter.on("finial", e), () => this.emitter.off("finial", e);
117
123
  }
124
+ /**
125
+ * 对`this.data.value`做出处理,多次调用仅最后一次生效
126
+ */
118
127
  setProcessor(e) {
119
128
  return t.fromPromise(this.promise, e);
120
129
  }
@@ -127,11 +136,11 @@ var PromiseContent = class t {
127
136
  finally(e) {
128
137
  return this.promise.finally(e);
129
138
  }
130
- data = shallowRef();
131
- isLoading = shallowRef(!0);
132
- isError = shallowRef(!1);
133
- errorCause = shallowRef();
134
- isEmpty = shallowRef(!0);
139
+ data = s();
140
+ isLoading = s(!0);
141
+ isError = s(!1);
142
+ errorCause = s();
143
+ isEmpty = s(!0);
135
144
  static fromAsyncFunction(e) {
136
145
  return (...t) => this.fromPromise(e(...t));
137
146
  }
@@ -154,16 +163,16 @@ var PromiseContent = class t {
154
163
  }
155
164
  };
156
165
  }
157
- }, SourcedValue = class {
166
+ }, M = class {
158
167
  toJSON(e) {
159
- return isString$1(e) ? this.parse(e) : e;
168
+ return w(e) ? this.parse(e) : e;
160
169
  }
161
170
  parse(e) {
162
171
  let t = e.split(this.separator);
163
172
  return [t[0], t.slice(1).join(this.separator)];
164
173
  }
165
174
  toString(e) {
166
- return isString$1(e) ? e : this.stringify(e);
175
+ return w(e) ? e : this.stringify(e);
167
176
  }
168
177
  stringify(e) {
169
178
  return e.join(this.separator);
@@ -171,14 +180,14 @@ var PromiseContent = class t {
171
180
  constructor(e = ":") {
172
181
  this.separator = e;
173
182
  }
174
- }, SourcedKeyMap = class extends SourcedValue {
183
+ }, N = class extends M {
175
184
  static create(e = ":") {
176
- return shallowReactive(new this(e));
185
+ return o(new this(e));
177
186
  }
178
187
  constructor(e = ":") {
179
188
  super(e);
180
189
  }
181
- store = shallowReactive(/* @__PURE__ */ new Map());
190
+ store = o(/* @__PURE__ */ new Map());
182
191
  get size() {
183
192
  return this.store.size;
184
193
  }
@@ -216,7 +225,7 @@ var PromiseContent = class t {
216
225
  return this.entries();
217
226
  }
218
227
  };
219
- function mitt_default(e) {
228
+ function P(e) {
220
229
  return {
221
230
  all: e ||= /* @__PURE__ */ new Map(),
222
231
  on: function(t, n) {
@@ -237,9 +246,9 @@ function mitt_default(e) {
237
246
  }
238
247
  };
239
248
  }
240
- var SmartAbortController = class {
249
+ var F = class {
241
250
  _controller = new AbortController();
242
- mitt = mitt_default();
251
+ mitt = P();
243
252
  get signal() {
244
253
  return this._controller.signal;
245
254
  }
@@ -257,36 +266,36 @@ var SmartAbortController = class {
257
266
  }
258
267
  };
259
268
  Error, typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
260
- function promiseTimeout(e, t = !1, n = "Timeout") {
269
+ function I(e, t = !1, n = "Timeout") {
261
270
  return new Promise((r, i) => {
262
271
  t ? setTimeout(() => i(n), e) : setTimeout(r, e);
263
272
  });
264
273
  }
265
- function createUntil(e, t = !1) {
274
+ function L(e, t = !1) {
266
275
  function r(n, { flush: r = "sync", deep: a = !1, timeout: o, throwOnTimeout: s } = {}) {
267
276
  let u = null, d = [new Promise((o) => {
268
- u = watch(e, (e) => {
269
- n(e) !== t && (u ? u() : nextTick(() => u?.()), o(e));
277
+ u = l(e, (e) => {
278
+ n(e) !== t && (u ? u() : i(() => u?.()), o(e));
270
279
  }, {
271
280
  flush: r,
272
281
  deep: a,
273
282
  immediate: !0
274
283
  });
275
284
  })];
276
- return o != null && d.push(promiseTimeout(o, s).then(() => toValue(e)).finally(() => u?.())), Promise.race(d);
285
+ return o != null && d.push(I(o, s).then(() => c(e)).finally(() => u?.())), Promise.race(d);
277
286
  }
278
287
  function a(a, o) {
279
- if (!isRef(a)) return r((e) => e === a, o);
288
+ if (!n(a)) return r((e) => e === a, o);
280
289
  let { flush: s = "sync", deep: u = !1, timeout: d, throwOnTimeout: f } = o ?? {}, p = null, m = [new Promise((n) => {
281
- p = watch([e, a], ([e, r]) => {
282
- t !== (e === r) && (p ? p() : nextTick(() => p?.()), n(e));
290
+ p = l([e, a], ([e, r]) => {
291
+ t !== (e === r) && (p ? p() : i(() => p?.()), n(e));
283
292
  }, {
284
293
  flush: s,
285
294
  deep: u,
286
295
  immediate: !0
287
296
  });
288
297
  })];
289
- return d != null && m.push(promiseTimeout(d, f).then(() => toValue(e)).finally(() => (p?.(), toValue(e)))), Promise.race(m);
298
+ return d != null && m.push(I(d, f).then(() => c(e)).finally(() => (p?.(), c(e)))), Promise.race(m);
290
299
  }
291
300
  function o(e) {
292
301
  return r((e) => !!e, e);
@@ -303,7 +312,7 @@ function createUntil(e, t = !1) {
303
312
  function f(e, t) {
304
313
  return r((t) => {
305
314
  let n = Array.from(t);
306
- return n.includes(e) || n.includes(toValue(e));
315
+ return n.includes(e) || n.includes(c(e));
307
316
  }, t);
308
317
  }
309
318
  function p(e) {
@@ -313,13 +322,13 @@ function createUntil(e, t = !1) {
313
322
  let n = -1;
314
323
  return r(() => (n += 1, n >= e), t);
315
324
  }
316
- return Array.isArray(toValue(e)) ? {
325
+ return Array.isArray(c(e)) ? {
317
326
  toMatch: r,
318
327
  toContains: f,
319
328
  changed: p,
320
329
  changedTimes: m,
321
330
  get not() {
322
- return createUntil(e, !t);
331
+ return L(e, !t);
323
332
  }
324
333
  } : {
325
334
  toMatch: r,
@@ -331,36 +340,40 @@ function createUntil(e, t = !1) {
331
340
  changed: p,
332
341
  changedTimes: m,
333
342
  get not() {
334
- return createUntil(e, !t);
343
+ return L(e, !t);
335
344
  }
336
345
  };
337
346
  }
338
- function until(e) {
339
- return createUntil(e);
347
+ function R(e) {
348
+ return L(e);
340
349
  }
341
- var generatorMap = /* @__PURE__ */ new Map(), Stream = class {
350
+ var z = /* @__PURE__ */ new Map(), B = class {
351
+ /**
352
+ * 使用`Stream.create`代替`new Stream`
353
+ */
342
354
  constructor(e) {
343
- this.generator = e(this.abortController.signal, this), generatorMap.set(this, e);
355
+ this.generator = e(this.abortController.signal, this), z.set(this, e);
344
356
  }
345
357
  static _this;
346
358
  static {
347
- this._this = useGlobalVar(this, "data/Stream");
359
+ this._this = e(this, "data/Stream");
348
360
  }
349
361
  static isStream(e) {
350
362
  return e instanceof this._this;
351
363
  }
352
364
  static create(e) {
353
- return markRaw(new this._this(e));
365
+ return r(new this._this(e));
354
366
  }
355
- abortController = new SmartAbortController();
367
+ abortController = new F();
356
368
  generator;
357
369
  _setupData = [];
370
+ /** 初始存在的数据(置顶) */
358
371
  setupData(e) {
359
372
  return this._setupData.push(...e), this.data.value.unshift(...e), this;
360
373
  }
361
374
  async next(e = !1) {
362
375
  try {
363
- if (e || (await until(this.isRequesting).toBe(!1), this.isRequesting.value = !0), this._isDone) return e || (this.isRequesting.value = !1), {
376
+ if (e || (await R(this.isRequesting).toBe(!1), this.isRequesting.value = !0), this._isDone) return e || (this.isRequesting.value = !1), {
364
377
  done: !0,
365
378
  value: void 0
366
379
  };
@@ -389,81 +402,112 @@ var generatorMap = /* @__PURE__ */ new Map(), Stream = class {
389
402
  done: !0
390
403
  };
391
404
  }
405
+ /** 重置 */
392
406
  reset() {
393
- this.generator = generatorMap.get(this)(this.abortController.signal, this), this.total.value = NaN, this.page.value = 0, this.pageSize.value = NaN, this.data.value = this._setupData, this.isDone.value = !1, this.isRequesting.value = !1, this.error.value = void 0;
407
+ this.generator = z.get(this)(this.abortController.signal, this), this.total.value = NaN, this.page.value = 0, this.pageSize.value = NaN, this.data.value = this._setupData, this.isDone.value = !1, this.isRequesting.value = !1, this.error.value = void 0;
394
408
  }
409
+ /** 重试 */
395
410
  async retry() {
396
411
  return this.page.value--, this.next();
397
412
  }
413
+ /** 一次性全部加载 */
398
414
  async nextToDone() {
399
415
  isNaN(this._pages) && await this.next(!0);
400
416
  let e = [];
401
417
  for (let t = this._page + 1; t <= this._pages; t++) e.push(this.next(!0));
402
418
  return await Promise.all(e), this._data;
403
419
  }
420
+ /** 停止正在进行的请求 */
404
421
  stop() {
405
422
  this.abortController.abort(), this.isRequesting.value = !1;
406
423
  }
407
424
  [Symbol.asyncIterator]() {
408
425
  return this;
409
426
  }
410
- error = shallowRef();
411
- data = ref([]);
427
+ /** 错误(如果有) */
428
+ error = s();
429
+ /** 数据 */
430
+ data = a([]);
431
+ /** 数据 */
412
432
  get _data() {
413
433
  return this.data.value;
414
434
  }
415
- page = shallowRef(0);
435
+ /** 当前页 */
436
+ page = s(0);
437
+ /** 当前页 */
416
438
  get _page() {
417
439
  return this.page.value;
418
440
  }
419
- pages = shallowRef(NaN);
441
+ /** 总页数 */
442
+ pages = s(NaN);
443
+ /** 总页数 */
420
444
  get _pages() {
421
445
  return this.pages.value;
422
446
  }
423
- total = shallowRef(NaN);
447
+ /** 总条目数 */
448
+ total = s(NaN);
449
+ /** 总条目数 */
424
450
  get _total() {
425
451
  return this.total.value;
426
452
  }
427
- pageSize = shallowRef(NaN);
453
+ /** 单页条目数 */
454
+ pageSize = s(NaN);
455
+ /** 单页条目数 */
428
456
  get _pageSize() {
429
457
  return this.pageSize.value;
430
458
  }
431
- length = computed(() => this.data.value.length);
459
+ /** 数据当前总数 */
460
+ length = t(() => this.data.value.length);
461
+ /** 数据当前总数 */
432
462
  get _length() {
433
463
  return this.data.value.length;
434
464
  }
435
- isRequesting = shallowRef(!1);
465
+ /** 是否正在网络请求 */
466
+ isRequesting = s(!1);
467
+ /** 是否正在网络请求 */
436
468
  get _isRequesting() {
437
469
  return this.isRequesting.value;
438
470
  }
439
- isDone = shallowRef(!1);
471
+ /** 是否全部获取完成 */
472
+ isDone = s(!1);
473
+ /** 是否全部获取完成 */
440
474
  get _isDone() {
441
475
  return this.isDone.value;
442
476
  }
443
- isNoData = computed(() => this.isDone.value && this.isEmpty.value);
477
+ /** 是否无结果 */
478
+ isNoData = t(() => this.isDone.value && this.isEmpty.value);
479
+ /** 是否无结果 */
444
480
  get _isNoData() {
445
481
  return this.isNoData.value;
446
482
  }
447
- isEmpty = computed(() => this.length.value === 0);
483
+ /** 是否当前为空 */
484
+ isEmpty = t(() => this.length.value === 0);
485
+ /** 是否当前为空 */
448
486
  get _isEmpty() {
449
487
  return this.isEmpty.value;
450
488
  }
451
489
  };
452
- const callbackToPromise = (e) => {
490
+ const V = (e) => {
453
491
  let { resolve: t, promise: n } = Promise.withResolvers();
454
492
  return e(t), n;
455
493
  };
456
- var Struct = class e {
494
+ /**
495
+ * 可以结构化的数据,调用`toJSON`获取纯粹的json(没有get/set或method)
496
+ */
497
+ var H = class e {
457
498
  toJSON() {
458
499
  return JSON.parse(JSON.stringify(this.$$raw));
459
500
  }
501
+ /**
502
+ * @param $$raw 一个纯粹json对象,不可以是高级对象
503
+ */
460
504
  constructor(e) {
461
505
  this.$$raw = e;
462
506
  }
463
507
  static toRaw(t) {
464
508
  return t instanceof e ? t.toJSON() : t;
465
509
  }
466
- }, require_dayjs_min = /* @__PURE__ */ __commonJSMin(((e, t) => {
510
+ }, U = /* @__PURE__ */ g(((e, t) => {
467
511
  (function(n, r) {
468
512
  typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs = r();
469
513
  })(e, (function() {
@@ -757,15 +801,15 @@ var Struct = class e {
757
801
  return w(1e3 * e);
758
802
  }, w.en = b[y], w.Ls = b, w.p = {}, w;
759
803
  }));
760
- })), comment_exports = /* @__PURE__ */ __exportAll({ Comment: () => Comment }), import_dayjs_min = /* @__PURE__ */ __toESM(require_dayjs_min(), 1), Comment = class extends Struct {
761
- static commentRow = SourcedKeyMap.create();
804
+ })), W = /* @__PURE__ */ _({ Comment: () => K }), G = /* @__PURE__ */ y(U(), 1), K = class extends H {
805
+ static commentRow = N.create();
762
806
  constructor(e) {
763
807
  super(e), this.content = e.content, this.time = e.time, this.id = e.id, this.childrenCount = e.childrenCount, this.likeCount = e.likeCount, this.isLiked = e.isLiked, this.reported = e.reported, this.$$plugin = e.$$plugin, this.$$meta = e.$$meta, this.isTop = e.isTop;
764
808
  }
765
809
  content;
766
810
  time;
767
811
  get $time() {
768
- return (0, import_dayjs_min.default)(this.time);
812
+ return (0, G.default)(this.time);
769
813
  }
770
814
  id;
771
815
  childrenCount;
@@ -775,7 +819,7 @@ var Struct = class e {
775
819
  reported;
776
820
  $$plugin;
777
821
  $$meta;
778
- }, ep_exports = /* @__PURE__ */ __exportAll({ Ep: () => Ep }), Ep = class extends Struct {
822
+ }, q = /* @__PURE__ */ _({ Ep: () => J }), J = class extends H {
779
823
  name;
780
824
  index;
781
825
  $$plugin;
@@ -783,10 +827,10 @@ var Struct = class e {
783
827
  constructor(e) {
784
828
  super(e), this.name = e.name, this.index = e.index, this.$$plugin = e.$$plugin, this.$$meta = e.$$meta;
785
829
  }
786
- }, resource_exports = /* @__PURE__ */ __exportAll({ Resource: () => Resource }), Resource = class t extends Struct {
787
- static processInstances = useGlobalVar(SourcedKeyMap.create(), "uni/resource/processInstances");
788
- static fork = useGlobalVar(SourcedKeyMap.create(), "uni/resource/fork");
789
- static precedenceFork = useGlobalVar(SourcedKeyMap.create(), "uni/resource/precedenceFork");
830
+ }, Y = /* @__PURE__ */ _({ Resource: () => X }), X = class t extends H {
831
+ static processInstances = e(N.create(), "uni/resource/processInstances");
832
+ static fork = e(N.create(), "uni/resource/fork");
833
+ static precedenceFork = e(N.create(), "uni/resource/precedenceFork");
790
834
  static is(e) {
791
835
  return e instanceof this;
792
836
  }
@@ -794,7 +838,7 @@ var Struct = class e {
794
838
  return new this(e);
795
839
  }
796
840
  constructor(e) {
797
- super(e), this.$$plugin = e.$$plugin, this.$$meta = e.$$meta, this.pathname = e.pathname, this.type = e.type, this.processSteps = (e.processSteps ?? []).map((e) => isString(e) ? {
841
+ super(e), this.$$plugin = e.$$plugin, this.$$meta = e.$$meta, this.pathname = e.pathname, this.type = e.type, this.processSteps = (e.processSteps ?? []).map((e) => D(e) ? {
798
842
  referenceName: e,
799
843
  ignoreExit: !1
800
844
  } : e);
@@ -817,7 +861,7 @@ var Struct = class e {
817
861
  }
818
862
  return URL.canParse(e) ? e : `${this.getThisFork()}/${e}`;
819
863
  }
820
- omittedForks = shallowReactive(/* @__PURE__ */ new Set());
864
+ omittedForks = o(/* @__PURE__ */ new Set());
821
865
  getThisFork() {
822
866
  let e = new Set(t.fork.get([this.$$plugin, this.type])?.urls ?? []);
823
867
  if (this.omittedForks.size == 0) var n = t.precedenceFork.get([this.$$plugin, this.type]);
@@ -831,7 +875,7 @@ var Struct = class e {
831
875
  let n = e.difference(this.omittedForks).size != 0;
832
876
  return n && this.omittedForks.clear(), n;
833
877
  }
834
- }, image_exports = /* @__PURE__ */ __exportAll({ Image: () => Image }), Image = class extends Resource {
878
+ }, Z = /* @__PURE__ */ _({ Image: () => Q }), Q = class extends X {
835
879
  static is(e) {
836
880
  return e instanceof this;
837
881
  }
@@ -856,21 +900,21 @@ var Struct = class e {
856
900
  set aspect(e) {
857
901
  this.$$meta ??= {}, this.$$meta.width = e.width, this.$$meta.height = e.height;
858
902
  }
859
- }, item_exports = /* @__PURE__ */ __exportAll({ Item: () => Item }), Item = class extends Struct {
860
- static itemTranslator = SourcedKeyMap.create();
903
+ }, te = /* @__PURE__ */ _({ Item: () => ne }), ne = class extends H {
904
+ static itemTranslator = N.create();
861
905
  static create(e) {
862
906
  let t = this.itemTranslator.get(e.contentType);
863
- if (!t) throw Error(`can not found itemTranslator contentType:"${ContentPage.contentPage.toString(e.contentType)}"`);
907
+ if (!t) throw Error(`can not found itemTranslator contentType:"${$.contentPage.toString(e.contentType)}"`);
864
908
  return t(e);
865
909
  }
866
- static authorIcon = SourcedKeyMap.create();
867
- static itemCard = useGlobalVar(SourcedKeyMap.create(), "uni/item/itemCard");
910
+ static authorIcon = N.create();
911
+ static itemCard = e(N.create(), "uni/item/itemCard");
868
912
  static is(e) {
869
913
  return e instanceof this;
870
914
  }
871
915
  cover;
872
916
  get $cover() {
873
- return Image.create(this.cover);
917
+ return Q.create(this.cover);
874
918
  }
875
919
  title;
876
920
  id;
@@ -883,7 +927,7 @@ var Struct = class e {
883
927
  description;
884
928
  updateTime;
885
929
  get $updateTime() {
886
- return (0, import_dayjs_min.default)(this.updateTime);
930
+ return (0, G.default)(this.updateTime);
887
931
  }
888
932
  contentType;
889
933
  length;
@@ -893,10 +937,10 @@ var Struct = class e {
893
937
  thisEp;
894
938
  customIsSafe;
895
939
  get $thisEp() {
896
- return new Ep(this.thisEp);
940
+ return new J(this.thisEp);
897
941
  }
898
942
  constructor(e) {
899
- super(e), this.$$plugin = e.$$plugin, this.$$meta = e.$$meta, this.thisEp = e.thisEp, this.updateTime = e.updateTime, this.cover = e.cover, this.title = e.title, this.id = e.id, this.categories = e.categories, this.author = e.author, this.viewNumber = e.viewNumber, this.likeNumber = e.likeNumber, this.commentNumber = e.commentNumber, this.isLiked = e.isLiked, this.customIsAI = e.customIsAI, this.contentType = ContentPage.contentPage.toJSON(e.contentType), this.length = e.length, this.epLength = e.epLength, this.description = e.description, this.commentSendable = e.commentSendable, this.customIsSafe = e.customIsSafe;
943
+ super(e), this.$$plugin = e.$$plugin, this.$$meta = e.$$meta, this.thisEp = e.thisEp, this.updateTime = e.updateTime, this.cover = e.cover, this.title = e.title, this.id = e.id, this.categories = e.categories, this.author = e.author, this.viewNumber = e.viewNumber, this.likeNumber = e.likeNumber, this.commentNumber = e.commentNumber, this.isLiked = e.isLiked, this.customIsAI = e.customIsAI, this.contentType = $.contentPage.toJSON(e.contentType), this.length = e.length, this.epLength = e.epLength, this.description = e.description, this.commentSendable = e.commentSendable, this.customIsSafe = e.customIsSafe;
900
944
  }
901
945
  commentSendable;
902
946
  customIsAI;
@@ -904,46 +948,38 @@ var Struct = class e {
904
948
  let e = (e) => /(^|[\((\[\s【])ai[】\))\]\s]?/gi.test(e);
905
949
  return this.customIsAI || e(this.title) || this.author.some((t) => e(`${t.label}\u1145${t.description}`));
906
950
  }
907
- }, content_exports = /* @__PURE__ */ __exportAll({
908
- ContentImagePage: () => ContentImagePage,
909
- ContentPage: () => ContentPage,
910
- ContentVideoPage: () => ContentVideoPage
911
- }), ContentPage = class {
912
- static viewLayout = useGlobalVar(SourcedKeyMap.create(), "uni/contentPage/viewLayout");
913
- static contentPage = useGlobalVar(SourcedKeyMap.create(), "uni/contentPage/contentPage");
951
+ }, re = /* @__PURE__ */ _({ ContentPage: () => $ }), $ = class {
952
+ static viewLayout = e(N.create(), "uni/contentPage/viewLayout");
953
+ static contentPage = e(N.create(), "uni/contentPage/contentPage");
914
954
  constructor(e, t, n) {
915
955
  this.id = t, this.ep = n, this.preload.value = e;
916
956
  }
917
- pid = PromiseContent.withResolvers();
918
- preload = shallowRef(void 0);
919
- detail = PromiseContent.withResolvers();
920
- union = computed(() => this.detail.content.data.value ?? this.preload.value);
921
- recommends = PromiseContent.withResolvers();
922
- eps = PromiseContent.withResolvers();
923
- }, ContentImagePage = class extends ContentPage {
924
- images = PromiseContent.withResolvers();
925
- }, ContentVideoPage = class extends ContentPage {
926
- videos = PromiseContent.withResolvers();
927
- }, download_exports = /* @__PURE__ */ __exportAll({ Downloader: () => Downloader }), Downloader = class {}, user_exports = /* @__PURE__ */ __exportAll({ User: () => User }), User = class {
928
- static userBase = shallowReactive(/* @__PURE__ */ new Map());
929
- static userEditorBase = shallowReactive(/* @__PURE__ */ new Map());
957
+ pid = j.withResolvers();
958
+ preload = s(void 0);
959
+ detail = j.withResolvers();
960
+ union = t(() => this.detail.content.data.value ?? this.preload.value);
961
+ recommends = j.withResolvers();
962
+ eps = j.withResolvers();
963
+ }, ie = /* @__PURE__ */ _({ Downloader: () => ae }), ae = class {}, oe = /* @__PURE__ */ _({ User: () => se }), se = class {
964
+ static userBase = o(/* @__PURE__ */ new Map());
965
+ static userEditorBase = o(/* @__PURE__ */ new Map());
930
966
  constructor(e) {
931
- e.avatar && (this.avatar = Image.create(e.avatar)), this.name = e.name, this.id = e.id, this.$$plugin = e.$$plugin;
967
+ e.avatar && (this.avatar = Q.create(e.avatar)), this.name = e.name, this.id = e.id, this.$$plugin = e.$$plugin;
932
968
  }
933
969
  avatar;
934
970
  name;
935
971
  id;
936
972
  $$plugin;
937
- }, model_exports = /* @__PURE__ */ __exportAll({
938
- comment: () => comment_exports,
939
- content: () => content_exports,
940
- download: () => download_exports,
941
- ep: () => ep_exports,
942
- image: () => image_exports,
943
- item: () => item_exports,
944
- resource: () => resource_exports,
945
- user: () => user_exports
973
+ }, ce = /* @__PURE__ */ _({
974
+ comment: () => W,
975
+ content: () => re,
976
+ download: () => ie,
977
+ ep: () => q,
978
+ image: () => Z,
979
+ item: () => te,
980
+ resource: () => Y,
981
+ user: () => oe
946
982
  });
947
- export { PromiseContent, SourcedKeyMap, SourcedValue, Stream, Struct, callbackToPromise, model_exports as uni };
983
+ export { j as PromiseContent, N as SourcedKeyMap, M as SourcedValue, B as Stream, H as Struct, V as callbackToPromise, ce as uni };
948
984
 
949
985
  //# sourceMappingURL=index.js.map