@forward-widget/danmu-universe 0.0.16 → 0.1.0

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 (2) hide show
  1. package/dist/danmu-universe.js +422 -208
  2. package/package.json +1 -1
@@ -514,7 +514,7 @@ var __webpack_modules__ = {
514
514
  e = this.words = e || [], t != n ? this.sigBytes = n : this.sigBytes = 4 * e.length;
515
515
  },
516
516
  toString: function(e) {
517
- return (e || d).stringify(this);
517
+ return (e || f).stringify(this);
518
518
  },
519
519
  concat: function(e) {
520
520
  var t = this.words, n = e.words, r = this.sigBytes, i = e.sigBytes;
@@ -537,7 +537,7 @@ var __webpack_modules__ = {
537
537
  for(var t = [], n = 0; n < e; n += 4)t.push(i());
538
538
  return new l.init(t, e);
539
539
  }
540
- }), c = s.enc = {}, d = c.Hex = {
540
+ }), c = s.enc = {}, f = c.Hex = {
541
541
  stringify: function(e) {
542
542
  for(var t = e.words, n = e.sigBytes, r = [], i = 0; i < n; i++){
543
543
  var o = t[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;
@@ -549,7 +549,7 @@ var __webpack_modules__ = {
549
549
  for(var t = e.length, n = [], r = 0; r < t; r += 2)n[r >>> 3] |= parseInt(e.substr(r, 2), 16) << 24 - r % 8 * 4;
550
550
  return new l.init(n, t / 2);
551
551
  }
552
- }, p = c.Latin1 = {
552
+ }, d = c.Latin1 = {
553
553
  stringify: function(e) {
554
554
  for(var t = e.words, n = e.sigBytes, r = [], i = 0; i < n; i++){
555
555
  var o = t[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;
@@ -561,28 +561,28 @@ var __webpack_modules__ = {
561
561
  for(var t = e.length, n = [], r = 0; r < t; r++)n[r >>> 2] |= (0xff & e.charCodeAt(r)) << 24 - r % 4 * 8;
562
562
  return new l.init(n, t);
563
563
  }
564
- }, f = c.Utf8 = {
564
+ }, p = c.Utf8 = {
565
565
  stringify: function(e) {
566
566
  try {
567
- return decodeURIComponent(escape(p.stringify(e)));
567
+ return decodeURIComponent(escape(d.stringify(e)));
568
568
  } catch (e) {
569
569
  throw Error('Malformed UTF-8 data');
570
570
  }
571
571
  },
572
572
  parse: function(e) {
573
- return p.parse(unescape(encodeURIComponent(e)));
573
+ return d.parse(unescape(encodeURIComponent(e)));
574
574
  }
575
575
  }, h = a.BufferedBlockAlgorithm = u.extend({
576
576
  reset: function() {
577
577
  this._data = new l.init(), this._nDataBytes = 0;
578
578
  },
579
579
  _append: function(e) {
580
- 'string' == typeof e && (e = f.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes;
580
+ 'string' == typeof e && (e = p.parse(e)), this._data.concat(e), this._nDataBytes += e.sigBytes;
581
581
  },
582
582
  _process: function(t) {
583
583
  var n, r = this._data, i = r.words, o = r.sigBytes, s = this.blockSize, a = o / (4 * s), u = (a = t ? e.ceil(a) : e.max((0 | a) - this._minBufferSize, 0)) * s, c = e.min(4 * u, o);
584
584
  if (u) {
585
- for(var d = 0; d < u; d += s)this._doProcessBlock(i, d);
585
+ for(var f = 0; f < u; f += s)this._doProcessBlock(i, f);
586
586
  n = i.splice(0, u), r.sigBytes -= c;
587
587
  }
588
588
  return new l.init(n, c);
@@ -695,8 +695,8 @@ var __webpack_modules__ = {
695
695
  var r = t + n, i = e[r];
696
696
  e[r] = (i << 8 | i >>> 24) & 0x00ff00ff | (i << 24 | i >>> 8) & 0xff00ff00;
697
697
  }
698
- var o = this._hash.words, s = e[t + 0], u = e[t + 1], f = e[t + 2], h = e[t + 3], m = e[t + 4], g = e[t + 5], v = e[t + 6], y = e[t + 7], b = e[t + 8], _ = e[t + 9], w = e[t + 10], k = e[t + 11], x = e[t + 12], S = e[t + 13], E = e[t + 14], z = e[t + 15], O = o[0], I = o[1], $ = o[2], P = o[3];
699
- O = l(O, I, $, P, s, 7, a[0]), P = l(P, O, I, $, u, 12, a[1]), $ = l($, P, O, I, f, 17, a[2]), I = l(I, $, P, O, h, 22, a[3]), O = l(O, I, $, P, m, 7, a[4]), P = l(P, O, I, $, g, 12, a[5]), $ = l($, P, O, I, v, 17, a[6]), I = l(I, $, P, O, y, 22, a[7]), O = l(O, I, $, P, b, 7, a[8]), P = l(P, O, I, $, _, 12, a[9]), $ = l($, P, O, I, w, 17, a[10]), I = l(I, $, P, O, k, 22, a[11]), O = l(O, I, $, P, x, 7, a[12]), P = l(P, O, I, $, S, 12, a[13]), $ = l($, P, O, I, E, 17, a[14]), I = l(I, $, P, O, z, 22, a[15]), O = c(O, I, $, P, u, 5, a[16]), P = c(P, O, I, $, v, 9, a[17]), $ = c($, P, O, I, k, 14, a[18]), I = c(I, $, P, O, s, 20, a[19]), O = c(O, I, $, P, g, 5, a[20]), P = c(P, O, I, $, w, 9, a[21]), $ = c($, P, O, I, z, 14, a[22]), I = c(I, $, P, O, m, 20, a[23]), O = c(O, I, $, P, _, 5, a[24]), P = c(P, O, I, $, E, 9, a[25]), $ = c($, P, O, I, h, 14, a[26]), I = c(I, $, P, O, b, 20, a[27]), O = c(O, I, $, P, S, 5, a[28]), P = c(P, O, I, $, f, 9, a[29]), $ = c($, P, O, I, y, 14, a[30]), I = c(I, $, P, O, x, 20, a[31]), O = d(O, I, $, P, g, 4, a[32]), P = d(P, O, I, $, b, 11, a[33]), $ = d($, P, O, I, k, 16, a[34]), I = d(I, $, P, O, E, 23, a[35]), O = d(O, I, $, P, u, 4, a[36]), P = d(P, O, I, $, m, 11, a[37]), $ = d($, P, O, I, y, 16, a[38]), I = d(I, $, P, O, w, 23, a[39]), O = d(O, I, $, P, S, 4, a[40]), P = d(P, O, I, $, s, 11, a[41]), $ = d($, P, O, I, h, 16, a[42]), I = d(I, $, P, O, v, 23, a[43]), O = d(O, I, $, P, _, 4, a[44]), P = d(P, O, I, $, x, 11, a[45]), $ = d($, P, O, I, z, 16, a[46]), I = d(I, $, P, O, f, 23, a[47]), O = p(O, I, $, P, s, 6, a[48]), P = p(P, O, I, $, y, 10, a[49]), $ = p($, P, O, I, E, 15, a[50]), I = p(I, $, P, O, g, 21, a[51]), O = p(O, I, $, P, x, 6, a[52]), P = p(P, O, I, $, h, 10, a[53]), $ = p($, P, O, I, w, 15, a[54]), I = p(I, $, P, O, u, 21, a[55]), O = p(O, I, $, P, b, 6, a[56]), P = p(P, O, I, $, z, 10, a[57]), $ = p($, P, O, I, v, 15, a[58]), I = p(I, $, P, O, S, 21, a[59]), O = p(O, I, $, P, m, 6, a[60]), P = p(P, O, I, $, k, 10, a[61]), $ = p($, P, O, I, f, 15, a[62]), I = p(I, $, P, O, _, 21, a[63]), o[0] = o[0] + O | 0, o[1] = o[1] + I | 0, o[2] = o[2] + $ | 0, o[3] = o[3] + P | 0;
698
+ var o = this._hash.words, s = e[t + 0], u = e[t + 1], p = e[t + 2], h = e[t + 3], m = e[t + 4], g = e[t + 5], y = e[t + 6], v = e[t + 7], b = e[t + 8], _ = e[t + 9], w = e[t + 10], k = e[t + 11], x = e[t + 12], S = e[t + 13], E = e[t + 14], z = e[t + 15], O = o[0], I = o[1], $ = o[2], A = o[3];
699
+ O = l(O, I, $, A, s, 7, a[0]), A = l(A, O, I, $, u, 12, a[1]), $ = l($, A, O, I, p, 17, a[2]), I = l(I, $, A, O, h, 22, a[3]), O = l(O, I, $, A, m, 7, a[4]), A = l(A, O, I, $, g, 12, a[5]), $ = l($, A, O, I, y, 17, a[6]), I = l(I, $, A, O, v, 22, a[7]), O = l(O, I, $, A, b, 7, a[8]), A = l(A, O, I, $, _, 12, a[9]), $ = l($, A, O, I, w, 17, a[10]), I = l(I, $, A, O, k, 22, a[11]), O = l(O, I, $, A, x, 7, a[12]), A = l(A, O, I, $, S, 12, a[13]), $ = l($, A, O, I, E, 17, a[14]), I = l(I, $, A, O, z, 22, a[15]), O = c(O, I, $, A, u, 5, a[16]), A = c(A, O, I, $, y, 9, a[17]), $ = c($, A, O, I, k, 14, a[18]), I = c(I, $, A, O, s, 20, a[19]), O = c(O, I, $, A, g, 5, a[20]), A = c(A, O, I, $, w, 9, a[21]), $ = c($, A, O, I, z, 14, a[22]), I = c(I, $, A, O, m, 20, a[23]), O = c(O, I, $, A, _, 5, a[24]), A = c(A, O, I, $, E, 9, a[25]), $ = c($, A, O, I, h, 14, a[26]), I = c(I, $, A, O, b, 20, a[27]), O = c(O, I, $, A, S, 5, a[28]), A = c(A, O, I, $, p, 9, a[29]), $ = c($, A, O, I, v, 14, a[30]), I = c(I, $, A, O, x, 20, a[31]), O = f(O, I, $, A, g, 4, a[32]), A = f(A, O, I, $, b, 11, a[33]), $ = f($, A, O, I, k, 16, a[34]), I = f(I, $, A, O, E, 23, a[35]), O = f(O, I, $, A, u, 4, a[36]), A = f(A, O, I, $, m, 11, a[37]), $ = f($, A, O, I, v, 16, a[38]), I = f(I, $, A, O, w, 23, a[39]), O = f(O, I, $, A, S, 4, a[40]), A = f(A, O, I, $, s, 11, a[41]), $ = f($, A, O, I, h, 16, a[42]), I = f(I, $, A, O, y, 23, a[43]), O = f(O, I, $, A, _, 4, a[44]), A = f(A, O, I, $, x, 11, a[45]), $ = f($, A, O, I, z, 16, a[46]), I = f(I, $, A, O, p, 23, a[47]), O = d(O, I, $, A, s, 6, a[48]), A = d(A, O, I, $, v, 10, a[49]), $ = d($, A, O, I, E, 15, a[50]), I = d(I, $, A, O, g, 21, a[51]), O = d(O, I, $, A, x, 6, a[52]), A = d(A, O, I, $, h, 10, a[53]), $ = d($, A, O, I, w, 15, a[54]), I = d(I, $, A, O, u, 21, a[55]), O = d(O, I, $, A, b, 6, a[56]), A = d(A, O, I, $, z, 10, a[57]), $ = d($, A, O, I, y, 15, a[58]), I = d(I, $, A, O, S, 21, a[59]), O = d(O, I, $, A, m, 6, a[60]), A = d(A, O, I, $, k, 10, a[61]), $ = d($, A, O, I, p, 15, a[62]), I = d(I, $, A, O, _, 21, a[63]), o[0] = o[0] + O | 0, o[1] = o[1] + I | 0, o[2] = o[2] + $ | 0, o[3] = o[3] + A | 0;
700
700
  },
701
701
  _doFinalize: function() {
702
702
  var e = this._data, n = e.words, r = 8 * this._nDataBytes, i = 8 * e.sigBytes;
@@ -722,11 +722,11 @@ var __webpack_modules__ = {
722
722
  var a = e + (t & r | n & ~r) + i + s;
723
723
  return (a << o | a >>> 32 - o) + t;
724
724
  }
725
- function d(e, t, n, r, i, o, s) {
725
+ function f(e, t, n, r, i, o, s) {
726
726
  var a = e + (t ^ n ^ r) + i + s;
727
727
  return (a << o | a >>> 32 - o) + t;
728
728
  }
729
- function p(e, t, n, r, i, o, s) {
729
+ function d(e, t, n, r, i, o, s) {
730
730
  var a = e + (n ^ (t | ~r)) + i + s;
731
731
  return (a << o | a >>> 32 - o) + t;
732
732
  }
@@ -766,7 +766,7 @@ var __webpack_modules__ = {
766
766
  })(e);
767
767
  } : l;
768
768
  };
769
- function d() {
769
+ function f() {
770
770
  var e = new o(0, 0), t = 0;
771
771
  if (this.len - this.pos > 4) {
772
772
  for(; t < 4; ++t)if (e.lo = (e.lo | (127 & this.buf[this.pos]) << 7 * t) >>> 0, this.buf[this.pos++] < 128) return e;
@@ -787,12 +787,12 @@ var __webpack_modules__ = {
787
787
  }
788
788
  throw Error("invalid varint encoding");
789
789
  }
790
- function p(e, t) {
790
+ function d(e, t) {
791
791
  return (e[t - 4] | e[t - 3] << 8 | e[t - 2] << 16 | e[t - 1] << 24) >>> 0;
792
792
  }
793
- function f() {
793
+ function p() {
794
794
  if (this.pos + 8 > this.len) throw a(this, 8);
795
- return new o(p(this.buf, this.pos += 4), p(this.buf, this.pos += 4));
795
+ return new o(d(this.buf, this.pos += 4), d(this.buf, this.pos += 4));
796
796
  }
797
797
  u.create = c(), u.prototype._slice = i.Array.prototype.subarray || i.Array.prototype.slice, u.prototype.uint32 = function() {
798
798
  var e = 4294967295;
@@ -810,10 +810,10 @@ var __webpack_modules__ = {
810
810
  return 0 !== this.uint32();
811
811
  }, u.prototype.fixed32 = function() {
812
812
  if (this.pos + 4 > this.len) throw a(this, 4);
813
- return p(this.buf, this.pos += 4);
813
+ return d(this.buf, this.pos += 4);
814
814
  }, u.prototype.sfixed32 = function() {
815
815
  if (this.pos + 4 > this.len) throw a(this, 4);
816
- return 0 | p(this.buf, this.pos += 4);
816
+ return 0 | d(this.buf, this.pos += 4);
817
817
  }, u.prototype.float = function() {
818
818
  if (this.pos + 4 > this.len) throw a(this, 4);
819
819
  var e = i.float.readFloatLE(this.buf, this.pos);
@@ -867,19 +867,19 @@ var __webpack_modules__ = {
867
867
  var t = i.Long ? "toLong" : "toNumber";
868
868
  i.merge(u.prototype, {
869
869
  int64: function() {
870
- return d.call(this)[t](!1);
870
+ return f.call(this)[t](!1);
871
871
  },
872
872
  uint64: function() {
873
- return d.call(this)[t](!0);
873
+ return f.call(this)[t](!0);
874
874
  },
875
875
  sint64: function() {
876
- return d.call(this).zzDecode()[t](!1);
876
+ return f.call(this).zzDecode()[t](!1);
877
877
  },
878
878
  fixed64: function() {
879
- return f.call(this)[t](!0);
879
+ return p.call(this)[t](!0);
880
880
  },
881
881
  sfixed64: function() {
882
- return f.call(this)[t](!1);
882
+ return p.call(this)[t](!1);
883
883
  }
884
884
  });
885
885
  };
@@ -1090,7 +1090,7 @@ var __webpack_modules__ = {
1090
1090
  };
1091
1091
  },
1092
1092
  114: function(e, t, n) {
1093
- e.exports = d;
1093
+ e.exports = f;
1094
1094
  var r, i = n(837), o = i.LongBits, s = i.base64, a = i.utf8;
1095
1095
  function u(e, t, n) {
1096
1096
  this.fn = e, this.len = t, this.next = void 0, this.val = n;
@@ -1099,19 +1099,19 @@ var __webpack_modules__ = {
1099
1099
  function c(e) {
1100
1100
  this.head = e.head, this.tail = e.tail, this.len = e.len, this.next = e.states;
1101
1101
  }
1102
- function d() {
1102
+ function f() {
1103
1103
  this.len = 0, this.head = new u(l, 0, 0), this.tail = this.head, this.states = null;
1104
1104
  }
1105
- var p = function() {
1105
+ var d = function() {
1106
1106
  return i.Buffer ? function() {
1107
- return (d.create = function() {
1107
+ return (f.create = function() {
1108
1108
  return new r();
1109
1109
  })();
1110
1110
  } : function() {
1111
- return new d();
1111
+ return new f();
1112
1112
  };
1113
1113
  };
1114
- function f(e, t, n) {
1114
+ function p(e, t, n) {
1115
1115
  t[n] = 255 & e;
1116
1116
  }
1117
1117
  function h(e, t, n) {
@@ -1126,65 +1126,65 @@ var __webpack_modules__ = {
1126
1126
  for(; e.lo > 127;)t[n++] = 127 & e.lo | 128, e.lo = e.lo >>> 7;
1127
1127
  t[n++] = e.lo;
1128
1128
  }
1129
- function v(e, t, n) {
1129
+ function y(e, t, n) {
1130
1130
  t[n] = 255 & e, t[n + 1] = e >>> 8 & 255, t[n + 2] = e >>> 16 & 255, t[n + 3] = e >>> 24;
1131
1131
  }
1132
- d.create = p(), d.alloc = function(e) {
1132
+ f.create = d(), f.alloc = function(e) {
1133
1133
  return new i.Array(e);
1134
- }, i.Array !== Array && (d.alloc = i.pool(d.alloc, i.Array.prototype.subarray)), d.prototype._push = function(e, t, n) {
1134
+ }, i.Array !== Array && (f.alloc = i.pool(f.alloc, i.Array.prototype.subarray)), f.prototype._push = function(e, t, n) {
1135
1135
  return this.tail = this.tail.next = new u(e, t, n), this.len += t, this;
1136
- }, m.prototype = Object.create(u.prototype), m.prototype.fn = h, d.prototype.uint32 = function(e) {
1136
+ }, m.prototype = Object.create(u.prototype), m.prototype.fn = h, f.prototype.uint32 = function(e) {
1137
1137
  return this.len += (this.tail = this.tail.next = new m((e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 2097152 ? 3 : e < 268435456 ? 4 : 5, e)).len, this;
1138
- }, d.prototype.int32 = function(e) {
1138
+ }, f.prototype.int32 = function(e) {
1139
1139
  return e < 0 ? this._push(g, 10, o.fromNumber(e)) : this.uint32(e);
1140
- }, d.prototype.sint32 = function(e) {
1140
+ }, f.prototype.sint32 = function(e) {
1141
1141
  return this.uint32((e << 1 ^ e >> 31) >>> 0);
1142
- }, d.prototype.uint64 = function(e) {
1142
+ }, f.prototype.uint64 = function(e) {
1143
1143
  var t = o.from(e);
1144
1144
  return this._push(g, t.length(), t);
1145
- }, d.prototype.int64 = d.prototype.uint64, d.prototype.sint64 = function(e) {
1145
+ }, f.prototype.int64 = f.prototype.uint64, f.prototype.sint64 = function(e) {
1146
1146
  var t = o.from(e).zzEncode();
1147
1147
  return this._push(g, t.length(), t);
1148
- }, d.prototype.bool = function(e) {
1149
- return this._push(f, 1, +!!e);
1150
- }, d.prototype.fixed32 = function(e) {
1151
- return this._push(v, 4, e >>> 0);
1152
- }, d.prototype.sfixed32 = d.prototype.fixed32, d.prototype.fixed64 = function(e) {
1148
+ }, f.prototype.bool = function(e) {
1149
+ return this._push(p, 1, +!!e);
1150
+ }, f.prototype.fixed32 = function(e) {
1151
+ return this._push(y, 4, e >>> 0);
1152
+ }, f.prototype.sfixed32 = f.prototype.fixed32, f.prototype.fixed64 = function(e) {
1153
1153
  var t = o.from(e);
1154
- return this._push(v, 4, t.lo)._push(v, 4, t.hi);
1155
- }, d.prototype.sfixed64 = d.prototype.fixed64, d.prototype.float = function(e) {
1154
+ return this._push(y, 4, t.lo)._push(y, 4, t.hi);
1155
+ }, f.prototype.sfixed64 = f.prototype.fixed64, f.prototype.float = function(e) {
1156
1156
  return this._push(i.float.writeFloatLE, 4, e);
1157
- }, d.prototype.double = function(e) {
1157
+ }, f.prototype.double = function(e) {
1158
1158
  return this._push(i.float.writeDoubleLE, 8, e);
1159
1159
  };
1160
- var y = i.Array.prototype.set ? function(e, t, n) {
1160
+ var v = i.Array.prototype.set ? function(e, t, n) {
1161
1161
  t.set(e, n);
1162
1162
  } : function(e, t, n) {
1163
1163
  for(var r = 0; r < e.length; ++r)t[n + r] = e[r];
1164
1164
  };
1165
- d.prototype.bytes = function(e) {
1165
+ f.prototype.bytes = function(e) {
1166
1166
  var t = e.length >>> 0;
1167
- if (!t) return this._push(f, 1, 0);
1167
+ if (!t) return this._push(p, 1, 0);
1168
1168
  if (i.isString(e)) {
1169
- var n = d.alloc(t = s.length(e));
1169
+ var n = f.alloc(t = s.length(e));
1170
1170
  s.decode(e, n, 0), e = n;
1171
1171
  }
1172
- return this.uint32(t)._push(y, t, e);
1173
- }, d.prototype.string = function(e) {
1172
+ return this.uint32(t)._push(v, t, e);
1173
+ }, f.prototype.string = function(e) {
1174
1174
  var t = a.length(e);
1175
- return t ? this.uint32(t)._push(a.write, t, e) : this._push(f, 1, 0);
1176
- }, d.prototype.fork = function() {
1175
+ return t ? this.uint32(t)._push(a.write, t, e) : this._push(p, 1, 0);
1176
+ }, f.prototype.fork = function() {
1177
1177
  return this.states = new c(this), this.head = this.tail = new u(l, 0, 0), this.len = 0, this;
1178
- }, d.prototype.reset = function() {
1178
+ }, f.prototype.reset = function() {
1179
1179
  return this.states ? (this.head = this.states.head, this.tail = this.states.tail, this.len = this.states.len, this.states = this.states.next) : (this.head = this.tail = new u(l, 0, 0), this.len = 0), this;
1180
- }, d.prototype.ldelim = function() {
1180
+ }, f.prototype.ldelim = function() {
1181
1181
  var e = this.head, t = this.tail, n = this.len;
1182
1182
  return this.reset().uint32(n), n && (this.tail.next = e.next, this.tail = t, this.len += n), this;
1183
- }, d.prototype.finish = function() {
1183
+ }, f.prototype.finish = function() {
1184
1184
  for(var e = this.head.next, t = this.constructor.alloc(this.len), n = 0; e;)e.fn(e.val, t, n), n += e.len, e = e.next;
1185
1185
  return t;
1186
- }, d._configure = function(e) {
1187
- r = e, d.create = p(), r._configure();
1186
+ }, f._configure = function(e) {
1187
+ r = e, f.create = d(), r._configure();
1188
1188
  };
1189
1189
  },
1190
1190
  491: function(e, t, n) {
@@ -1268,10 +1268,10 @@ var __webpack_modules__ = {
1268
1268
  },
1269
1269
  337: function(e, t, n) {
1270
1270
  var r = n(995), i = n(682), o = /^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/, s = /[\n\r\t]/g, a = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//, u = /:\d+$/, l = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i, c = /^[a-zA-Z]:/;
1271
- function d(e) {
1271
+ function f(e) {
1272
1272
  return (e || '').toString().replace(o, '');
1273
1273
  }
1274
- var p = [
1274
+ var d = [
1275
1275
  [
1276
1276
  '#',
1277
1277
  'hash'
@@ -1312,16 +1312,16 @@ var __webpack_modules__ = {
1312
1312
  1,
1313
1313
  1
1314
1314
  ]
1315
- ], f = {
1315
+ ], p = {
1316
1316
  hash: 1,
1317
1317
  query: 1
1318
1318
  };
1319
1319
  function h(e) {
1320
1320
  var t, r, i = (t = 'undefined' != typeof window ? window : void 0 !== n.g ? n.g : 'undefined' != typeof self ? self : {}).location || {}, o = {}, s = typeof (e = e || i);
1321
- if ('blob:' === e.protocol) o = new y(unescape(e.pathname), {});
1322
- else if ('string' === s) for(r in o = new y(e, {}), f)delete o[r];
1321
+ if ('blob:' === e.protocol) o = new v(unescape(e.pathname), {});
1322
+ else if ('string' === s) for(r in o = new v(e, {}), p)delete o[r];
1323
1323
  else if ('object' === s) {
1324
- for(r in e)r in f || (o[r] = e[r]);
1324
+ for(r in e)r in p || (o[r] = e[r]);
1325
1325
  void 0 === o.slashes && (o.slashes = a.test(e.href));
1326
1326
  }
1327
1327
  return o;
@@ -1330,7 +1330,7 @@ var __webpack_modules__ = {
1330
1330
  return 'file:' === e || 'ftp:' === e || 'http:' === e || 'https:' === e || 'ws:' === e || 'wss:' === e;
1331
1331
  }
1332
1332
  function g(e, t) {
1333
- e = (e = d(e)).replace(s, ''), t = t || {};
1333
+ e = (e = f(e)).replace(s, ''), t = t || {};
1334
1334
  var n, r = l.exec(e), i = r[1] ? r[1].toLowerCase() : '', o = !!r[2], a = !!r[3], u = 0;
1335
1335
  return o ? a ? (n = r[2] + r[3] + r[4], u = r[2].length + r[3].length) : (n = r[2] + r[4], u = r[2].length) : a ? (n = r[3] + r[4], u = r[3].length) : n = r[4], 'file:' === i ? u >= 2 && (n = n.slice(2)) : m(i) ? n = r[4] : i ? o && (n = n.slice(2)) : u >= 2 && m(t.protocol) && (n = r[4]), {
1336
1336
  protocol: i,
@@ -1339,14 +1339,14 @@ var __webpack_modules__ = {
1339
1339
  rest: n
1340
1340
  };
1341
1341
  }
1342
- function v(e, t) {
1342
+ function y(e, t) {
1343
1343
  if ('' === e) return t;
1344
1344
  for(var n = (t || '/').split('/').slice(0, -1).concat(e.split('/')), r = n.length, i = n[r - 1], o = !1, s = 0; r--;)'.' === n[r] ? n.splice(r, 1) : '..' === n[r] ? (n.splice(r, 1), s++) : s && (0 === r && (o = !0), n.splice(r, 1), s--);
1345
1345
  return o && n.unshift(''), ('.' === i || '..' === i) && n.push(''), n.join('/');
1346
1346
  }
1347
- function y(e, t, n) {
1348
- if (e = (e = d(e)).replace(s, ''), !(this instanceof y)) return new y(e, t, n);
1349
- var o, a, u, l, f, b, _ = p.slice(), w = typeof t, k = this, x = 0;
1347
+ function v(e, t, n) {
1348
+ if (e = (e = f(e)).replace(s, ''), !(this instanceof v)) return new v(e, t, n);
1349
+ var o, a, u, l, p, b, _ = d.slice(), w = typeof t, k = this, x = 0;
1350
1350
  for('object' !== w && 'string' !== w && (n = t, t = null), n && 'function' != typeof n && (n = i.parse), o = !(a = g(e || '', t = h(t))).protocol && !a.slashes, k.slashes = a.slashes || o && t.slashes, k.protocol = a.protocol || t.protocol || '', e = a.rest, ('file:' === a.protocol && (2 !== a.slashesCount || c.test(e)) || !a.slashes && (a.protocol || a.slashesCount < 2 || !m(k.protocol))) && (_[3] = [
1351
1351
  /(.*)/,
1352
1352
  'pathname'
@@ -1355,11 +1355,11 @@ var __webpack_modules__ = {
1355
1355
  e = l(e, k);
1356
1356
  continue;
1357
1357
  }
1358
- u = l[0], b = l[1], u != u ? k[b] = e : 'string' == typeof u ? ~(f = '@' === u ? e.lastIndexOf(u) : e.indexOf(u)) && ('number' == typeof l[2] ? (k[b] = e.slice(0, f), e = e.slice(f + l[2])) : (k[b] = e.slice(f), e = e.slice(0, f))) : (f = u.exec(e)) && (k[b] = f[1], e = e.slice(0, f.index)), k[b] = k[b] || o && l[3] && t[b] || '', l[4] && (k[b] = k[b].toLowerCase());
1358
+ u = l[0], b = l[1], u != u ? k[b] = e : 'string' == typeof u ? ~(p = '@' === u ? e.lastIndexOf(u) : e.indexOf(u)) && ('number' == typeof l[2] ? (k[b] = e.slice(0, p), e = e.slice(p + l[2])) : (k[b] = e.slice(p), e = e.slice(0, p))) : (p = u.exec(e)) && (k[b] = p[1], e = e.slice(0, p.index)), k[b] = k[b] || o && l[3] && t[b] || '', l[4] && (k[b] = k[b].toLowerCase());
1359
1359
  }
1360
- n && (k.query = n(k.query)), o && t.slashes && '/' !== k.pathname.charAt(0) && ('' !== k.pathname || '' !== t.pathname) && (k.pathname = v(k.pathname, t.pathname)), '/' !== k.pathname.charAt(0) && m(k.protocol) && (k.pathname = '/' + k.pathname), r(k.port, k.protocol) || (k.host = k.hostname, k.port = ''), k.username = k.password = '', k.auth && (~(f = k.auth.indexOf(':')) ? (k.username = k.auth.slice(0, f), k.username = encodeURIComponent(decodeURIComponent(k.username)), k.password = k.auth.slice(f + 1), k.password = encodeURIComponent(decodeURIComponent(k.password))) : k.username = encodeURIComponent(decodeURIComponent(k.auth)), k.auth = k.password ? k.username + ':' + k.password : k.username), k.origin = 'file:' !== k.protocol && m(k.protocol) && k.host ? k.protocol + '//' + k.host : 'null', k.href = k.toString();
1360
+ n && (k.query = n(k.query)), o && t.slashes && '/' !== k.pathname.charAt(0) && ('' !== k.pathname || '' !== t.pathname) && (k.pathname = y(k.pathname, t.pathname)), '/' !== k.pathname.charAt(0) && m(k.protocol) && (k.pathname = '/' + k.pathname), r(k.port, k.protocol) || (k.host = k.hostname, k.port = ''), k.username = k.password = '', k.auth && (~(p = k.auth.indexOf(':')) ? (k.username = k.auth.slice(0, p), k.username = encodeURIComponent(decodeURIComponent(k.username)), k.password = k.auth.slice(p + 1), k.password = encodeURIComponent(decodeURIComponent(k.password))) : k.username = encodeURIComponent(decodeURIComponent(k.auth)), k.auth = k.password ? k.username + ':' + k.password : k.username), k.origin = 'file:' !== k.protocol && m(k.protocol) && k.host ? k.protocol + '//' + k.host : 'null', k.href = k.toString();
1361
1361
  }
1362
- y.prototype = {
1362
+ v.prototype = {
1363
1363
  set: function(e, t, n) {
1364
1364
  var o = this;
1365
1365
  switch(e){
@@ -1393,8 +1393,8 @@ var __webpack_modules__ = {
1393
1393
  var a = t.indexOf(':');
1394
1394
  ~a ? (o.username = t.slice(0, a), o.username = encodeURIComponent(decodeURIComponent(o.username)), o.password = t.slice(a + 1), o.password = encodeURIComponent(decodeURIComponent(o.password))) : o.username = encodeURIComponent(decodeURIComponent(t));
1395
1395
  }
1396
- for(var l = 0; l < p.length; l++){
1397
- var c = p[l];
1396
+ for(var l = 0; l < d.length; l++){
1397
+ var c = d[l];
1398
1398
  c[4] && (o[c[1]] = o[c[1]].toLowerCase());
1399
1399
  }
1400
1400
  return o.auth = o.password ? o.username + ':' + o.password : o.username, o.origin = 'file:' !== o.protocol && m(o.protocol) && o.host ? o.protocol + '//' + o.host : 'null', o.href = o.toString(), o;
@@ -1406,7 +1406,7 @@ var __webpack_modules__ = {
1406
1406
  var s = o + (n.protocol && n.slashes || m(n.protocol) ? '//' : '');
1407
1407
  return n.username ? (s += n.username, n.password && (s += ':' + n.password), s += '@') : n.password ? (s += ':' + n.password, s += '@') : 'file:' !== n.protocol && m(n.protocol) && !r && '/' !== n.pathname && (s += '@'), (':' === r[r.length - 1] || u.test(n.hostname) && !n.port) && (r += ':'), s += r + n.pathname, (t = 'object' == typeof n.query ? e(n.query) : n.query) && (s += '?' !== t.charAt(0) ? '?' + t : t), n.hash && (s += n.hash), s;
1408
1408
  }
1409
- }, y.extractProtocol = g, y.location = h, y.trimLeft = d, y.qs = i, e.exports = y;
1409
+ }, v.extractProtocol = g, v.location = h, v.trimLeft = f, v.qs = i, e.exports = v;
1410
1410
  },
1411
1411
  602: function() {}
1412
1412
  }, __webpack_module_cache__ = {};
@@ -2618,48 +2618,48 @@ const $ZodObject = $constructor("$ZodObject", (e, t)=>{
2618
2618
  let a = t.compile();
2619
2619
  return (t, n)=>a(e, t, n);
2620
2620
  }, s = util_isObject, a = !globalConfig.jitless, u = util_allowsEval, l = a && u.value, c = t.catchall;
2621
- e._zod.parse = (u, d)=>{
2621
+ e._zod.parse = (u, f)=>{
2622
2622
  r ?? (r = i.value);
2623
- let p = u.value;
2624
- if (!s(p)) return u.issues.push({
2623
+ let d = u.value;
2624
+ if (!s(d)) return u.issues.push({
2625
2625
  expected: "object",
2626
2626
  code: "invalid_type",
2627
- input: p,
2627
+ input: d,
2628
2628
  inst: e
2629
2629
  }), u;
2630
- let f = [];
2631
- if (a && l && d?.async === !1 && !0 !== d.jitless) n || (n = o(t.shape)), u = n(u, d);
2630
+ let p = [];
2631
+ if (a && l && f?.async === !1 && !0 !== f.jitless) n || (n = o(t.shape)), u = n(u, f);
2632
2632
  else {
2633
2633
  u.value = {};
2634
2634
  let e = r.shape;
2635
2635
  for (let t of r.keys){
2636
2636
  let n = e[t]._zod.run({
2637
- value: p[t],
2637
+ value: d[t],
2638
2638
  issues: []
2639
- }, d);
2640
- n instanceof Promise ? f.push(n.then((e)=>handlePropertyResult(e, u, t, p))) : handlePropertyResult(n, u, t, p);
2639
+ }, f);
2640
+ n instanceof Promise ? p.push(n.then((e)=>handlePropertyResult(e, u, t, d))) : handlePropertyResult(n, u, t, d);
2641
2641
  }
2642
2642
  }
2643
- if (!c) return f.length ? Promise.all(f).then(()=>u) : u;
2644
- let h = [], m = r.keySet, g = c._zod, v = g.def.type;
2645
- for (let e of Object.keys(p)){
2643
+ if (!c) return p.length ? Promise.all(p).then(()=>u) : u;
2644
+ let h = [], m = r.keySet, g = c._zod, y = g.def.type;
2645
+ for (let e of Object.keys(d)){
2646
2646
  if (m.has(e)) continue;
2647
- if ("never" === v) {
2647
+ if ("never" === y) {
2648
2648
  h.push(e);
2649
2649
  continue;
2650
2650
  }
2651
2651
  let t = g.run({
2652
- value: p[e],
2652
+ value: d[e],
2653
2653
  issues: []
2654
- }, d);
2655
- t instanceof Promise ? f.push(t.then((t)=>handlePropertyResult(t, u, e, p))) : handlePropertyResult(t, u, e, p);
2654
+ }, f);
2655
+ t instanceof Promise ? p.push(t.then((t)=>handlePropertyResult(t, u, e, d))) : handlePropertyResult(t, u, e, d);
2656
2656
  }
2657
2657
  return (h.length && u.issues.push({
2658
2658
  code: "unrecognized_keys",
2659
2659
  keys: h,
2660
- input: p,
2660
+ input: d,
2661
2661
  inst: e
2662
- }), f.length) ? Promise.all(f).then(()=>u) : u;
2662
+ }), p.length) ? Promise.all(p).then(()=>u) : u;
2663
2663
  };
2664
2664
  });
2665
2665
  function handleUnionResults(e, t, n, r) {
@@ -3028,6 +3028,13 @@ function _string(e, t) {
3028
3028
  ...normalizeParams(t)
3029
3029
  });
3030
3030
  }
3031
+ function _coercedString(e, t) {
3032
+ return new e({
3033
+ type: "string",
3034
+ coerce: !0,
3035
+ ...normalizeParams(t)
3036
+ });
3037
+ }
3031
3038
  function _email(e, t) {
3032
3039
  return new e({
3033
3040
  type: "string",
@@ -3866,35 +3873,13 @@ function refine(e, t = {}) {
3866
3873
  function superRefine(e) {
3867
3874
  return _superRefine(e);
3868
3875
  }
3869
- function omit_omit(e, t) {
3870
- let n = {
3871
- ...e
3872
- };
3873
- for(let e = 0; e < t.length; e++){
3874
- let r = t[e];
3875
- delete n[r];
3876
- }
3877
- return n;
3878
- }
3879
- function isUnsafeProperty(e) {
3880
- return '__proto__' === e;
3881
- }
3882
- function isPlainObject_isPlainObject(e) {
3883
- if (!e || 'object' != typeof e) return !1;
3884
- let t = Object.getPrototypeOf(e);
3885
- return (null === t || t === Object.prototype || null === Object.getPrototypeOf(t)) && '[object Object]' === Object.prototype.toString.call(e);
3876
+ function coerce_string(e) {
3877
+ return _coercedString(ZodString, e);
3886
3878
  }
3887
- function merge_merge(e, t) {
3888
- let n = Object.keys(t);
3889
- for(let r = 0; r < n.length; r++){
3890
- let i = n[r];
3891
- if (isUnsafeProperty(i)) continue;
3892
- let o = t[i], s = e[i];
3893
- Array.isArray(o) ? Array.isArray(s) ? e[i] = merge_merge(s, o) : e[i] = merge_merge([], o) : isPlainObject_isPlainObject(o) ? isPlainObject_isPlainObject(s) ? e[i] = merge_merge(s, o) : e[i] = merge_merge({}, o) : (void 0 === s || void 0 !== o) && (e[i] = o);
3894
- }
3895
- return e;
3879
+ function coerce_number(e) {
3880
+ return _coercedNumber(ZodNumber, e);
3896
3881
  }
3897
- var url_parse = __webpack_require__(337), url_parse_default = __webpack_require__.n(url_parse), enc_base64 = __webpack_require__(716), enc_base64_default = __webpack_require__.n(enc_base64);
3882
+ var enc_base64 = __webpack_require__(716), enc_base64_default = __webpack_require__.n(enc_base64);
3898
3883
  function safeJsonParse(e) {
3899
3884
  try {
3900
3885
  if (!e) return null;
@@ -3973,7 +3958,41 @@ class Storage {
3973
3958
  _define_property(this, "defaultTTL", TTL_5_MINUTES);
3974
3959
  }
3975
3960
  }
3976
- const storage = new Storage();
3961
+ const storage = new Storage(), getExternalIdsByTmdbId = async (e, t)=>{
3962
+ let n = null, r = `tmdb:${e}:${t}:external_ids`, i = storage.getJson(r);
3963
+ return i ? n = i : (n = await Widget.tmdb.get(`/${e}/${t}/external_ids`), storage.setJson(r, n, {
3964
+ ttl: TTL_7_DAYS
3965
+ })), n;
3966
+ };
3967
+ function omit_omit(e, t) {
3968
+ let n = {
3969
+ ...e
3970
+ };
3971
+ for(let e = 0; e < t.length; e++){
3972
+ let r = t[e];
3973
+ delete n[r];
3974
+ }
3975
+ return n;
3976
+ }
3977
+ function isUnsafeProperty(e) {
3978
+ return '__proto__' === e;
3979
+ }
3980
+ function isPlainObject_isPlainObject(e) {
3981
+ if (!e || 'object' != typeof e) return !1;
3982
+ let t = Object.getPrototypeOf(e);
3983
+ return (null === t || t === Object.prototype || null === Object.getPrototypeOf(t)) && '[object Object]' === Object.prototype.toString.call(e);
3984
+ }
3985
+ function merge_merge(e, t) {
3986
+ let n = Object.keys(t);
3987
+ for(let r = 0; r < n.length; r++){
3988
+ let i = n[r];
3989
+ if (isUnsafeProperty(i)) continue;
3990
+ let o = t[i], s = e[i];
3991
+ Array.isArray(o) ? Array.isArray(s) ? e[i] = merge_merge(s, o) : e[i] = merge_merge([], o) : isPlainObject_isPlainObject(o) ? isPlainObject_isPlainObject(s) ? e[i] = merge_merge(s, o) : e[i] = merge_merge({}, o) : (void 0 === s || void 0 !== o) && (e[i] = o);
3992
+ }
3993
+ return e;
3994
+ }
3995
+ var url_parse = __webpack_require__(337), url_parse_default = __webpack_require__.n(url_parse);
3977
3996
  function fetch_define_property(e, t, n) {
3978
3997
  return t in e ? Object.defineProperty(e, t, {
3979
3998
  value: n,
@@ -4062,13 +4081,13 @@ class Fetch {
4062
4081
  }, s), r = storage.getJson(n);
4063
4082
  if (r) return console.debug("fetch cache hit", n), Promise.resolve(r);
4064
4083
  }
4065
- let a = o ? void 0 : n, { timeout: u, schema: l, params: c, ...d } = s, p = t;
4066
- c && (p = `${t}?${url_parse.qs.stringify(c)}`), console.debug("\u2B06\uFE0F fetch", p, null != a ? a : "", d);
4067
- let f = o ? Widget.http.get(p, d) : Widget.http.post(p, a, d);
4084
+ let a = o ? void 0 : n, { timeout: u, schema: l, params: c, ...f } = s, d = t;
4085
+ c && (d = `${t}?${url_parse.qs.stringify(c)}`), console.debug("\u2B06\uFE0F fetch", d, null != a ? a : "", f);
4086
+ let p = o ? Widget.http.get(d, f) : Widget.http.post(d, a, f);
4068
4087
  return u && u > 0 ? Promise.race([
4069
- f,
4088
+ p,
4070
4089
  this.createTimeoutPromise(u)
4071
- ]) : f;
4090
+ ]) : p;
4072
4091
  }
4073
4092
  getCacheKey(e, t) {
4074
4093
  var n;
@@ -4106,11 +4125,7 @@ class Fetch {
4106
4125
  };
4107
4126
  }
4108
4127
  }
4109
- const fetch_fetch = new Fetch();
4110
- function coerce_number(e) {
4111
- return _coercedNumber(ZodNumber, e);
4112
- }
4113
- const BASE_URL = "https://api.imdbapi.dev", imdb_fetch = new Fetch(), episodesRequestSchema = schemas_object({
4128
+ const fetch = new Fetch(), BASE_URL = "https://api.imdbapi.dev", imdb_fetch = new Fetch(), episodesRequestSchema = schemas_object({
4114
4129
  season: coerce_number().optional().default(1),
4115
4130
  pageSize: coerce_number().optional().default(20),
4116
4131
  pageToken: schemas_string().optional()
@@ -4187,7 +4202,7 @@ const BASE_URL = "https://api.imdbapi.dev", imdb_fetch = new Fetch(), episodesRe
4187
4202
  u = null != (s = null == r || null == (o = r.episodes.find((e)=>1 === e.episodeNumber)) ? void 0 : o.id) ? s : "";
4188
4203
  }
4189
4204
  u || (u = e), console.log("Get douban info by imdb id", u);
4190
- let l = await fetch_fetch.post(`https://api.douban.com/v2/movie/imdb/${u}`, {
4205
+ let l = await fetch.post(`https://api.douban.com/v2/movie/imdb/${u}`, {
4191
4206
  apikey: DOUBAN_API_KEY
4192
4207
  }, {
4193
4208
  headers: {
@@ -4206,12 +4221,84 @@ const BASE_URL = "https://api.imdbapi.dev", imdb_fetch = new Fetch(), episodesRe
4206
4221
  doubanId: c,
4207
4222
  originResponse: l.data
4208
4223
  } : null;
4209
- }, getExternalIdsByTmdbId = async (e, t)=>{
4210
- let n = null, r = `tmdb:${e}:${t}:external_ids`, i = storage.getJson(r);
4211
- return i ? n = i : (n = await Widget.tmdb.get(`/${e}/${t}/external_ids`), storage.setJson(r, n, {
4212
- ttl: TTL_7_DAYS
4213
- })), n;
4224
+ };
4225
+ function compact(e) {
4226
+ let t = [];
4227
+ for(let n = 0; n < e.length; n++){
4228
+ let r = e[n];
4229
+ r && t.push(r);
4230
+ }
4231
+ return t;
4232
+ }
4233
+ const doubanSubjectItemSchema = schemas_object({
4234
+ type_name: schemas_string(),
4235
+ target_type: schemas_string(),
4236
+ target_id: schemas_string(),
4237
+ target: schemas_object({
4238
+ title: schemas_string(),
4239
+ has_linewatch: schemas_boolean().refine((e)=>e)
4240
+ })
4241
+ }), doubanSearchResponseSchema = schemas_object({
4242
+ subjects: schemas_object({
4243
+ items: schemas_array(unknown().transform((e)=>{
4244
+ var t;
4245
+ return null != (t = doubanSubjectItemSchema.safeParse(e).data) ? t : null;
4246
+ })).transform((e)=>compact(e))
4247
+ })
4248
+ }), searchDoubanInfoByName = async (e)=>{
4249
+ var t, n;
4250
+ return e && null != (n = null == (t = (await fetch.get("https://m.douban.com/rexxar/api/v2/search", {
4251
+ params: {
4252
+ q: e,
4253
+ start: 0,
4254
+ count: 20,
4255
+ type: "movie"
4256
+ },
4257
+ headers: {
4258
+ Referer: "https://m.douban.com/movie/",
4259
+ "Content-Type": "application/json"
4260
+ },
4261
+ schema: doubanSearchResponseSchema,
4262
+ cache: {
4263
+ cacheKey: [
4264
+ "douban",
4265
+ "search",
4266
+ e
4267
+ ].filter(Boolean).join(":")
4268
+ }
4269
+ })).data) ? void 0 : t.subjects.items) ? n : [];
4270
+ }, getDoubanInfoParamsSchema = schemas_object({
4271
+ tmdbId: coerce_string().optional(),
4272
+ type: schemas_enum([
4273
+ "movie",
4274
+ "tv"
4275
+ ]).transform((e)=>e),
4276
+ title: coerce_string().optional(),
4277
+ seriesName: coerce_string().optional(),
4278
+ season: coerce_number().optional(),
4279
+ episode: coerce_number().optional(),
4280
+ fuzzyMatch: schemas_enum([
4281
+ "always",
4282
+ "never",
4283
+ "auto"
4284
+ ]).catch("auto").optional().default("auto")
4285
+ }), getDoubanIds = async (e)=>{
4286
+ let t = new Set(), { tmdbId: n, type: r, seriesName: i, season: o, fuzzyMatch: s } = getDoubanInfoParamsSchema.parse(e);
4287
+ try {
4288
+ let e = await getDoubanInfoByTmdbId(r, n, o);
4289
+ (null == e ? void 0 : e.doubanId) && t.add(e.doubanId);
4290
+ } catch (e) {
4291
+ console.error("Error getting douban info by tmdb id", e);
4292
+ }
4293
+ if ("always" === s || "auto" === s && !t.size) try {
4294
+ let e = i;
4295
+ for (let n of (o && parseInt(o.toString()) > 1 && (e += o.toString()), await searchDoubanInfoByName(e)))t.add(n.target_id);
4296
+ } catch (e) {
4297
+ console.error("Error searching douban info by name", e);
4298
+ }
4299
+ return Array.from(t);
4214
4300
  }, getDoubanInfoByTmdbId = async (e, t, n)=>{
4301
+ if (!t) return null;
4215
4302
  let r = await getExternalIdsByTmdbId(e, t);
4216
4303
  return (console.log("Get external ids by tmdb id", r), r.imdb_id) ? getDoubanInfoByImdbId(r.imdb_id, n) : null;
4217
4304
  }, doubanInfoResponseSchema = schemas_object({
@@ -4223,7 +4310,7 @@ const BASE_URL = "https://api.imdbapi.dev", imdb_fetch = new Fetch(), episodesRe
4223
4310
  }))
4224
4311
  }), getVideoPlatformInfoByDoubanId = async (e)=>{
4225
4312
  var t, n, r;
4226
- let i = await fetch_fetch.get(`https://m.douban.com/rexxar/api/v2/movie/${e}?for_mobile=1`, {
4313
+ let i = await fetch.get(`https://m.douban.com/rexxar/api/v2/movie/${e}?for_mobile=1`, {
4227
4314
  headers: {
4228
4315
  Referer: `https://m.douban.com/movie/subject/${e}/?dt_dapp=1`,
4229
4316
  "Content-Type": "application/json"
@@ -4280,23 +4367,6 @@ const BASE_URL = "https://api.imdbapi.dev", imdb_fetch = new Fetch(), episodesRe
4280
4367
  }
4281
4368
  return o;
4282
4369
  };
4283
- function compact(e) {
4284
- let t = [];
4285
- for(let n = 0; n < e.length; n++){
4286
- let r = e[n];
4287
- r && t.push(r);
4288
- }
4289
- return t;
4290
- }
4291
- const doubanSubjectItemSchema = schemas_object({
4292
- type_name: schemas_string(),
4293
- target_type: schemas_string(),
4294
- target_id: coerce_number(),
4295
- target: schemas_object({
4296
- title: schemas_string(),
4297
- has_linewatch: schemas_boolean().refine((e)=>e)
4298
- })
4299
- });
4300
4370
  function keyBy(e, t) {
4301
4371
  let n = {};
4302
4372
  for(let r = 0; r < e.length; r++){
@@ -4323,6 +4393,134 @@ function sortBy(e, t) {
4323
4393
  'asc'
4324
4394
  ]);
4325
4395
  }
4396
+ function uniqWith(e, t) {
4397
+ let n = [];
4398
+ for(let r = 0; r < e.length; r++){
4399
+ let i = e[r];
4400
+ n.every((e)=>!t(e, i)) && n.push(i);
4401
+ }
4402
+ return n;
4403
+ }
4404
+ function getSymbols(e) {
4405
+ return Object.getOwnPropertySymbols(e).filter((t)=>Object.prototype.propertyIsEnumerable.call(e, t));
4406
+ }
4407
+ function getTag(e) {
4408
+ return null == e ? void 0 === e ? '[object Undefined]' : '[object Null]' : Object.prototype.toString.call(e);
4409
+ }
4410
+ const regexpTag = '[object RegExp]', stringTag = '[object String]', numberTag = '[object Number]', booleanTag = '[object Boolean]', argumentsTag = '[object Arguments]', symbolTag = '[object Symbol]', dateTag = '[object Date]', mapTag = '[object Map]', setTag = '[object Set]', arrayTag = '[object Array]', functionTag = '[object Function]', arrayBufferTag = '[object ArrayBuffer]', objectTag = '[object Object]', errorTag = '[object Error]', dataViewTag = '[object DataView]', uint8ArrayTag = '[object Uint8Array]', uint8ClampedArrayTag = '[object Uint8ClampedArray]', uint16ArrayTag = '[object Uint16Array]', uint32ArrayTag = '[object Uint32Array]', bigUint64ArrayTag = '[object BigUint64Array]', int8ArrayTag = '[object Int8Array]', int16ArrayTag = '[object Int16Array]', int32ArrayTag = '[object Int32Array]', bigInt64ArrayTag = '[object BigInt64Array]', float32ArrayTag = '[object Float32Array]', float64ArrayTag = '[object Float64Array]';
4411
+ function eq(e, t) {
4412
+ return e === t || Number.isNaN(e) && Number.isNaN(t);
4413
+ }
4414
+ function isEqualWith(e, t, n) {
4415
+ return isEqualWithImpl(e, t, void 0, void 0, void 0, void 0, n);
4416
+ }
4417
+ function isEqualWithImpl(e, t, n, r, i, o, s) {
4418
+ let a = s(e, t, n, r, i, o);
4419
+ if (void 0 !== a) return a;
4420
+ if (typeof e == typeof t) switch(typeof e){
4421
+ case 'bigint':
4422
+ case 'string':
4423
+ case 'boolean':
4424
+ case 'symbol':
4425
+ case 'undefined':
4426
+ case 'function':
4427
+ return e === t;
4428
+ case 'number':
4429
+ return e === t || Object.is(e, t);
4430
+ }
4431
+ return areObjectsEqual(e, t, o, s);
4432
+ }
4433
+ function areObjectsEqual(e, t, n, r) {
4434
+ if (Object.is(e, t)) return !0;
4435
+ let i = getTag(e), o = getTag(t);
4436
+ if (i === argumentsTag && (i = objectTag), o === argumentsTag && (o = objectTag), i !== o) return !1;
4437
+ switch(i){
4438
+ case stringTag:
4439
+ return e.toString() === t.toString();
4440
+ case numberTag:
4441
+ return eq(e.valueOf(), t.valueOf());
4442
+ case booleanTag:
4443
+ case dateTag:
4444
+ case symbolTag:
4445
+ return Object.is(e.valueOf(), t.valueOf());
4446
+ case regexpTag:
4447
+ return e.source === t.source && e.flags === t.flags;
4448
+ case functionTag:
4449
+ return e === t;
4450
+ }
4451
+ let s = (n = n ?? new Map()).get(e), a = n.get(t);
4452
+ if (null != s && null != a) return s === t;
4453
+ n.set(e, t), n.set(t, e);
4454
+ try {
4455
+ switch(i){
4456
+ case mapTag:
4457
+ if (e.size !== t.size) return !1;
4458
+ for (let [i, o] of e.entries())if (!t.has(i) || !isEqualWithImpl(o, t.get(i), i, e, t, n, r)) return !1;
4459
+ return !0;
4460
+ case setTag:
4461
+ {
4462
+ if (e.size !== t.size) return !1;
4463
+ let i = Array.from(e.values()), o = Array.from(t.values());
4464
+ for(let s = 0; s < i.length; s++){
4465
+ let a = i[s], u = o.findIndex((i)=>isEqualWithImpl(a, i, void 0, e, t, n, r));
4466
+ if (-1 === u) return !1;
4467
+ o.splice(u, 1);
4468
+ }
4469
+ return !0;
4470
+ }
4471
+ case arrayTag:
4472
+ case uint8ArrayTag:
4473
+ case uint8ClampedArrayTag:
4474
+ case uint16ArrayTag:
4475
+ case uint32ArrayTag:
4476
+ case bigUint64ArrayTag:
4477
+ case int8ArrayTag:
4478
+ case int16ArrayTag:
4479
+ case int32ArrayTag:
4480
+ case bigInt64ArrayTag:
4481
+ case float32ArrayTag:
4482
+ case float64ArrayTag:
4483
+ if ('undefined' != typeof Buffer && Buffer.isBuffer(e) !== Buffer.isBuffer(t) || e.length !== t.length) return !1;
4484
+ for(let i = 0; i < e.length; i++)if (!isEqualWithImpl(e[i], t[i], i, e, t, n, r)) return !1;
4485
+ return !0;
4486
+ case arrayBufferTag:
4487
+ if (e.byteLength !== t.byteLength) return !1;
4488
+ return areObjectsEqual(new Uint8Array(e), new Uint8Array(t), n, r);
4489
+ case dataViewTag:
4490
+ if (e.byteLength !== t.byteLength || e.byteOffset !== t.byteOffset) return !1;
4491
+ return areObjectsEqual(new Uint8Array(e), new Uint8Array(t), n, r);
4492
+ case errorTag:
4493
+ return e.name === t.name && e.message === t.message;
4494
+ case objectTag:
4495
+ {
4496
+ if (!(areObjectsEqual(e.constructor, t.constructor, n, r) || isPlainObject_isPlainObject(e) && isPlainObject_isPlainObject(t))) return !1;
4497
+ let i = [
4498
+ ...Object.keys(e),
4499
+ ...getSymbols(e)
4500
+ ], o = [
4501
+ ...Object.keys(t),
4502
+ ...getSymbols(t)
4503
+ ];
4504
+ if (i.length !== o.length) return !1;
4505
+ for(let o = 0; o < i.length; o++){
4506
+ let s = i[o], a = e[s];
4507
+ if (!Object.hasOwn(t, s)) return !1;
4508
+ let u = t[s];
4509
+ if (!isEqualWithImpl(a, u, s, e, t, n, r)) return !1;
4510
+ }
4511
+ return !0;
4512
+ }
4513
+ default:
4514
+ return !1;
4515
+ }
4516
+ } finally{
4517
+ n.delete(e), n.delete(t);
4518
+ }
4519
+ }
4520
+ function noop() {}
4521
+ function isEqual(e, t) {
4522
+ return isEqualWith(e, t, noop);
4523
+ }
4326
4524
  function base_define_property(e, t, n) {
4327
4525
  return t in e ? Object.defineProperty(e, t, {
4328
4526
  value: n,
@@ -4331,14 +4529,6 @@ function base_define_property(e, t, n) {
4331
4529
  writable: !0
4332
4530
  }) : e[t] = n, e;
4333
4531
  }
4334
- schemas_object({
4335
- subjects: schemas_object({
4336
- items: schemas_array(unknown().transform((e)=>{
4337
- var t;
4338
- return null != (t = doubanSubjectItemSchema.safeParse(e).data) ? t : null;
4339
- })).transform((e)=>compact(e))
4340
- })
4341
- });
4342
4532
  class BaseScraper {
4343
4533
  parseIdString(e) {
4344
4534
  var t, n;
@@ -4889,32 +5079,32 @@ const parseXml = function(e) {
4889
5079
  }
4890
5080
  ]) : n.add(this.options.textNodeName, a), o = t + 2;
4891
5081
  } else {
4892
- let s = readTagExp(e, o, this.options.removeNSPrefix), a = s.tagName, u = s.rawTagName, l = s.tagExp, c = s.attrExpPresent, d = s.closeIndex;
5082
+ let s = readTagExp(e, o, this.options.removeNSPrefix), a = s.tagName, u = s.rawTagName, l = s.tagExp, c = s.attrExpPresent, f = s.closeIndex;
4893
5083
  this.options.transformTagName && (a = this.options.transformTagName(a)), n && r && '!xml' !== n.tagname && (r = this.saveTextToParentTag(r, n, i, !1));
4894
- let p = n;
4895
- p && -1 !== this.options.unpairedTags.indexOf(p.tagname) && (n = this.tagsNodeStack.pop(), i = i.substring(0, i.lastIndexOf("."))), a !== t.tagname && (i += i ? "." + a : a);
4896
- let f = o;
5084
+ let d = n;
5085
+ d && -1 !== this.options.unpairedTags.indexOf(d.tagname) && (n = this.tagsNodeStack.pop(), i = i.substring(0, i.lastIndexOf("."))), a !== t.tagname && (i += i ? "." + a : a);
5086
+ let p = o;
4897
5087
  if (this.isItStopNode(this.options.stopNodes, i, a)) {
4898
5088
  let t = "";
4899
5089
  if (l.length > 0 && l.lastIndexOf("/") === l.length - 1) "/" === a[a.length - 1] ? (a = a.substr(0, a.length - 1), i = i.substr(0, i.length - 1), l = a) : l = l.substr(0, l.length - 1), o = s.closeIndex;
4900
5090
  else if (-1 !== this.options.unpairedTags.indexOf(a)) o = s.closeIndex;
4901
5091
  else {
4902
- let n = this.readStopNodeData(e, u, d + 1);
5092
+ let n = this.readStopNodeData(e, u, f + 1);
4903
5093
  if (!n) throw Error(`Unexpected end of ${u}`);
4904
5094
  o = n.i, t = n.tagContent;
4905
5095
  }
4906
5096
  let r = new XmlNode(a);
4907
- a !== l && c && (r[":@"] = this.buildAttributesMap(l, i, a)), t && (t = this.parseTextData(t, a, i, !0, c, !0, !0)), i = i.substr(0, i.lastIndexOf(".")), r.add(this.options.textNodeName, t), this.addChild(n, r, i, f);
5097
+ a !== l && c && (r[":@"] = this.buildAttributesMap(l, i, a)), t && (t = this.parseTextData(t, a, i, !0, c, !0, !0)), i = i.substr(0, i.lastIndexOf(".")), r.add(this.options.textNodeName, t), this.addChild(n, r, i, p);
4908
5098
  } else {
4909
5099
  if (l.length > 0 && l.lastIndexOf("/") === l.length - 1) {
4910
5100
  "/" === a[a.length - 1] ? (a = a.substr(0, a.length - 1), i = i.substr(0, i.length - 1), l = a) : l = l.substr(0, l.length - 1), this.options.transformTagName && (a = this.options.transformTagName(a));
4911
5101
  let e = new XmlNode(a);
4912
- a !== l && c && (e[":@"] = this.buildAttributesMap(l, i, a)), this.addChild(n, e, i, f), i = i.substr(0, i.lastIndexOf("."));
5102
+ a !== l && c && (e[":@"] = this.buildAttributesMap(l, i, a)), this.addChild(n, e, i, p), i = i.substr(0, i.lastIndexOf("."));
4913
5103
  } else {
4914
5104
  let e = new XmlNode(a);
4915
- this.tagsNodeStack.push(n), a !== l && c && (e[":@"] = this.buildAttributesMap(l, i, a)), this.addChild(n, e, i, f), n = e;
5105
+ this.tagsNodeStack.push(n), a !== l && c && (e[":@"] = this.buildAttributesMap(l, i, a)), this.addChild(n, e, i, p), n = e;
4916
5106
  }
4917
- r = "", o = d;
5107
+ r = "", o = f;
4918
5108
  }
4919
5109
  }
4920
5110
  else r += e[o];
@@ -5397,7 +5587,7 @@ class IqiyiScraper extends BaseScraper {
5397
5587
  console.debug(`URL\u{6784}\u{5EFA}: s1=${i}, s2=${o}, \u{5B8C}\u{6574}URL=${s}`);
5398
5588
  let a = await this.fetch.get(s, {
5399
5589
  zlibMode: !0
5400
- }), u = this.xmlParser.parse(a.data), { success: l, data: c, error: d } = iqiyiCommentsResponseSchema.safeParse(u);
5590
+ }), u = this.xmlParser.parse(a.data), { success: l, data: c, error: f } = iqiyiCommentsResponseSchema.safeParse(u);
5401
5591
  return l ? c.map((e)=>{
5402
5592
  let t = 16777215;
5403
5593
  try {
@@ -5410,7 +5600,7 @@ class IqiyiScraper extends BaseScraper {
5410
5600
  color: t,
5411
5601
  content: e.content
5412
5602
  };
5413
- }) : (console.warn(`\u{7231}\u{5947}\u{827A}: \u{89E3}\u{6790}\u{5F39}\u{5E55}\u{6570}\u{636E}\u{65F6}\u{53D1}\u{751F}\u{9519}\u{8BEF}:`, prettifyError(d)), []);
5603
+ }) : (console.warn(`\u{7231}\u{5947}\u{827A}: \u{89E3}\u{6790}\u{5F39}\u{5E55}\u{6570}\u{636E}\u{65F6}\u{53D1}\u{751F}\u{9519}\u{8BEF}:`, prettifyError(f)), []);
5414
5604
  }
5415
5605
  async getEpisodesV3(e) {
5416
5606
  let t = {
@@ -5447,7 +5637,7 @@ class IqiyiScraper extends BaseScraper {
5447
5637
  if (!c.length) {
5448
5638
  let t = null == e || null == (u = e.data) || null == (a = u.template) || null == (s = a.tabs) ? void 0 : s.flatMap((e)=>e.blocks || []).find((e)=>"selector_bk" === e.bk_id && "album_episodes" === e.bk_type || "film_feature_bk" === e.bk_id && "video_list" === e.bk_type), { success: n, data: r, error: i } = iqiyiEpisodeTabDataSchema.safeParse(null == t ? void 0 : t.data);
5449
5639
  if (!n) return console.warn(`\u{7231}\u{5947}\u{827A}: \u{89E3}\u{6790}\u{5206}\u{96C6}\u{6570}\u{636E}\u{65F6}\u{53D1}\u{751F}\u{9519}\u{8BEF}:`, prettifyError(i), t), [];
5450
- let o = this.getEpisodeBlacklistPattern(), d = 1;
5640
+ let o = this.getEpisodeBlacklistPattern(), f = 1;
5451
5641
  for (let e of r.data){
5452
5642
  if (17 === e.mark_type_show) continue;
5453
5643
  let t = this.videoIdToEntityId(e.videoId);
@@ -5457,8 +5647,8 @@ class IqiyiScraper extends BaseScraper {
5457
5647
  entityId: t
5458
5648
  }),
5459
5649
  episodeTitle: e.title,
5460
- episodeNumber: e.short_display_name && null != (l = this.getEpisodeIndexFromTitle(e.short_display_name)) ? l : d
5461
- }), d += 1));
5650
+ episodeNumber: e.short_display_name && null != (l = this.getEpisodeIndexFromTitle(e.short_display_name)) ? l : f
5651
+ }), f += 1));
5462
5652
  }
5463
5653
  }
5464
5654
  return c;
@@ -5788,12 +5978,12 @@ class YoukuScraper extends BaseScraper {
5788
5978
  }),
5789
5979
  episodeTitle: e.title,
5790
5980
  episodeNumber: t
5791
- }), o = await this.getEpisodesPage(s, l, a), c = e(null != (r = null == o ? void 0 : o.videos) ? r : []), d = c.find((e)=>e.seq === u);
5792
- if (d) return [
5793
- n(d, u)
5981
+ }), o = await this.getEpisodesPage(s, l, a), c = e(null != (r = null == o ? void 0 : o.videos) ? r : []), f = c.find((e)=>e.seq === u);
5982
+ if (f) return [
5983
+ n(f, u)
5794
5984
  ];
5795
- let p = Number(null != (i = null == o ? void 0 : o.total) ? i : 0), f = Math.max(1, Math.ceil(p / a)), h = Array.from({
5796
- length: f
5985
+ let d = Number(null != (i = null == o ? void 0 : o.total) ? i : 0), p = Math.max(1, Math.ceil(d / a)), h = Array.from({
5986
+ length: p
5797
5987
  }, (e, t)=>t + 1).filter((e)=>e !== l), m = [];
5798
5988
  for (let e of h){
5799
5989
  await this.sleep(500);
@@ -5803,17 +5993,17 @@ class YoukuScraper extends BaseScraper {
5803
5993
  let g = e(m.flatMap((e)=>{
5804
5994
  var t;
5805
5995
  return null != (t = null == e ? void 0 : e.videos) ? t : [];
5806
- })), v = [
5996
+ })), y = [
5807
5997
  ...c,
5808
5998
  ...g
5809
5999
  ];
5810
6000
  if (void 0 !== t) {
5811
- let e = v.find((e)=>e.seq === u);
6001
+ let e = y.find((e)=>e.seq === u);
5812
6002
  return e ? [
5813
6003
  n(e, u)
5814
6004
  ] : [];
5815
6005
  }
5816
- return v.sort((e, t)=>{
6006
+ return y.sort((e, t)=>{
5817
6007
  var n, r;
5818
6008
  return (null != (n = e.seq) ? n : Number.MAX_SAFE_INTEGER) - (null != (r = t.seq) ? r : Number.MAX_SAFE_INTEGER);
5819
6009
  }).map((e, t)=>n(e, t + 1));
@@ -6100,9 +6290,9 @@ class scrapers_Scraper {
6100
6290
  episodeNumber: this.getEpisodeNumber(t, n)
6101
6291
  });
6102
6292
  }
6103
- async getDetailWithDoubanId(e, t, n) {
6104
- let r = await getVideoPlatformInfoByDoubanId(e.toString()), i = this.getEpisodeNumber(t, n), o = [];
6105
- return Object.entries(r.providers).forEach((e)=>{
6293
+ async getDetailWithDoubanIds(e, t, n) {
6294
+ let r = await Promise.all(e.map((e)=>getVideoPlatformInfoByDoubanId(e).catch(()=>null))), i = this.getEpisodeNumber(t, n), o = [];
6295
+ for (let e of r)e && Object.entries(e.providers).forEach((e)=>{
6106
6296
  var t, n;
6107
6297
  let [r, s] = e;
6108
6298
  o.push({
@@ -6110,7 +6300,8 @@ class scrapers_Scraper {
6110
6300
  idString: null != (n = null == (t = this.scraperMap[r]) ? void 0 : t.generateIdString(s)) ? n : "",
6111
6301
  episodeNumber: i
6112
6302
  });
6113
- }), this.getEpisodes(...o);
6303
+ });
6304
+ return this.getEpisodes(...uniqWith(o, isEqual));
6114
6305
  }
6115
6306
  constructor(){
6116
6307
  scrapers_define_property(this, "scrapers", []), scrapers.forEach((e)=>{
@@ -6118,7 +6309,7 @@ class scrapers_Scraper {
6118
6309
  });
6119
6310
  }
6120
6311
  }
6121
- const widgetVersion = "0.0.16";
6312
+ const widgetVersion = "0.1.0";
6122
6313
  WidgetMetadata = {
6123
6314
  id: "baranwang.danmu.universe",
6124
6315
  title: "\u901A\u7528\u5F39\u5E55",
@@ -6127,6 +6318,29 @@ WidgetMetadata = {
6127
6318
  version: widgetVersion,
6128
6319
  site: "https://github.com/baranwang/forward-widgets/tree/main/packages/danmu-universe",
6129
6320
  requiredVersion: "0.0.2",
6321
+ globalParams: [
6322
+ {
6323
+ title: "\u6A21\u7CCA\u5339\u914D",
6324
+ name: "fuzzyMatch",
6325
+ description: "\u662F\u5426\u5F00\u542F\u6A21\u7CCA\u5339\u914D",
6326
+ value: "auto",
6327
+ type: "enumeration",
6328
+ enumOptions: [
6329
+ {
6330
+ title: "\u81EA\u52A8",
6331
+ value: "auto"
6332
+ },
6333
+ {
6334
+ title: "\u59CB\u7EC8\u5F00\u542F",
6335
+ value: "always"
6336
+ },
6337
+ {
6338
+ title: "\u59CB\u7EC8\u5173\u95ED",
6339
+ value: "never"
6340
+ }
6341
+ ]
6342
+ }
6343
+ ],
6130
6344
  modules: [
6131
6345
  {
6132
6346
  type: "danmu",
@@ -6160,11 +6374,12 @@ WidgetMetadata = {
6160
6374
  };
6161
6375
  const src_scraper = new scrapers_Scraper();
6162
6376
  searchDanmu = async (e)=>{
6163
- let { tmdbId: t, type: n, season: r, episode: i } = e;
6377
+ storage.cleanup();
6378
+ let { tmdbId: t, type: n, episode: r } = e;
6164
6379
  if (!t) return null;
6165
- let o = await getDoubanInfoByTmdbId(n, t, r);
6166
- return (null == o ? void 0 : o.doubanId) ? {
6167
- animes: (await src_scraper.getDetailWithDoubanId(o.doubanId, n, i)).map((e)=>{
6380
+ let i = await getDoubanIds(e);
6381
+ return i.length ? {
6382
+ animes: (await src_scraper.getDetailWithDoubanIds(i, n, r)).map((e)=>{
6168
6383
  let t = `[${PROVIDER_NAMES[e.provider]}] `;
6169
6384
  return e.episodeTitle && (t += e.episodeTitle), {
6170
6385
  animeId: e.episodeId,
@@ -6173,26 +6388,25 @@ searchDanmu = async (e)=>{
6173
6388
  })
6174
6389
  } : null;
6175
6390
  }, getDetail = async (e)=>{
6176
- var t;
6177
- let { animeId: n, tmdbId: r, type: i, season: o, episode: s } = e;
6178
- if (!r && !n) return null;
6179
- if (n) return src_scraper.getDetailWithAnimeId(n.toString(), i, s);
6180
- let a = await getDoubanInfoByTmdbId(i, null != r ? r : "", o);
6181
- return src_scraper.getDetailWithDoubanId(null != (t = null == a ? void 0 : a.doubanId) ? t : "", i, s);
6391
+ let { animeId: t, tmdbId: n, type: r, episode: i } = e;
6392
+ if (!n && !t) return null;
6393
+ if (t) return src_scraper.getDetailWithAnimeId(t.toString(), r, i);
6394
+ let o = await getDoubanIds(e);
6395
+ return o.length ? src_scraper.getDetailWithDoubanIds(o, r, i) : null;
6182
6396
  }, getComments = async (e)=>{
6183
- let { animeId: t, commentId: n, segmentTime: r, tmdbId: i, type: o, season: s, episode: a } = e, u = null != n ? n : t;
6184
- if (!u) {
6185
- var l;
6397
+ let { animeId: t, commentId: n, segmentTime: r, tmdbId: i, type: o, episode: s } = e, a = null != n ? n : t;
6398
+ if (!a) {
6186
6399
  if (!i) return null;
6187
- let e = await getDoubanInfoByTmdbId(o, i, s);
6188
- u = (await src_scraper.getDetailWithDoubanId(null != (l = null == e ? void 0 : e.doubanId) ? l : "", o, a)).map((e)=>[
6400
+ let t = await getDoubanIds(e);
6401
+ if (!t.length) return null;
6402
+ a = (await src_scraper.getDetailWithDoubanIds(t, o, s)).map((e)=>[
6189
6403
  e.provider,
6190
6404
  e.episodeId
6191
6405
  ].join(":")).join(",");
6192
6406
  }
6193
- let c = await src_scraper.getDanmuWithSegmentTimeByVideoId(u.toString(), r);
6407
+ let u = await src_scraper.getDanmuWithSegmentTimeByVideoId(a.toString(), r);
6194
6408
  return {
6195
- comments: c,
6196
- count: c.length
6409
+ comments: u,
6410
+ count: u.length
6197
6411
  };
6198
6412
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forward-widget/danmu-universe",
3
- "version": "0.0.16",
3
+ "version": "0.1.0",
4
4
  "type": "module",
5
5
  "main": "./dist/danmu-universe.js",
6
6
  "exports": {