@forward-widget/danmu-universe 0.0.12 → 0.0.14
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/README.md +2 -0
- package/dist/danmu-universe.js +381 -230
- package/package.json +3 -2
package/dist/danmu-universe.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
let METADATA_SYMBOL;
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
|
|
3
|
+
188: function(e) {
|
|
4
4
|
e.exports = t;
|
|
5
5
|
function t(e, t) {
|
|
6
6
|
for(var n = Array(arguments.length - 1), r = 0, i = 2, o = !0; i < arguments.length;)n[r++] = arguments[i++];
|
|
@@ -20,7 +20,7 @@ var __webpack_modules__ = {
|
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
|
-
|
|
23
|
+
4: function(e, t) {
|
|
24
24
|
var n = t;
|
|
25
25
|
n.length = function(e) {
|
|
26
26
|
var t = e.length;
|
|
@@ -72,7 +72,7 @@ var __webpack_modules__ = {
|
|
|
72
72
|
return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e);
|
|
73
73
|
};
|
|
74
74
|
},
|
|
75
|
-
|
|
75
|
+
730: function(e) {
|
|
76
76
|
function t() {
|
|
77
77
|
this._listeners = {};
|
|
78
78
|
}
|
|
@@ -95,7 +95,7 @@ var __webpack_modules__ = {
|
|
|
95
95
|
return this;
|
|
96
96
|
};
|
|
97
97
|
},
|
|
98
|
-
|
|
98
|
+
791: function(e) {
|
|
99
99
|
function t(e) {
|
|
100
100
|
return "undefined" != typeof Float32Array ? !function() {
|
|
101
101
|
var t = new Float32Array([
|
|
@@ -181,7 +181,7 @@ var __webpack_modules__ = {
|
|
|
181
181
|
}
|
|
182
182
|
e.exports = t(t);
|
|
183
183
|
},
|
|
184
|
-
|
|
184
|
+
706: function(module) {
|
|
185
185
|
module.exports = inquire;
|
|
186
186
|
function inquire(moduleName) {
|
|
187
187
|
try {
|
|
@@ -191,7 +191,7 @@ var __webpack_modules__ = {
|
|
|
191
191
|
return null;
|
|
192
192
|
}
|
|
193
193
|
},
|
|
194
|
-
|
|
194
|
+
338: function(e) {
|
|
195
195
|
e.exports = t;
|
|
196
196
|
function t(e, t, n) {
|
|
197
197
|
var r = n || 8192, i = r >>> 1, o = null, s = r;
|
|
@@ -203,7 +203,7 @@ var __webpack_modules__ = {
|
|
|
203
203
|
};
|
|
204
204
|
}
|
|
205
205
|
},
|
|
206
|
-
|
|
206
|
+
322: function(e, t) {
|
|
207
207
|
var n = t;
|
|
208
208
|
n.length = function(e) {
|
|
209
209
|
for(var t = 0, n = 0, r = 0; r < e.length; ++r)(n = e.charCodeAt(r)) < 128 ? t += 1 : n < 2048 ? t += 2 : (0xFC00 & n) == 0xD800 && (0xFC00 & e.charCodeAt(r + 1)) == 0xDC00 ? (++r, t += 4) : t += 3;
|
|
@@ -217,11 +217,11 @@ var __webpack_modules__ = {
|
|
|
217
217
|
return n - o;
|
|
218
218
|
};
|
|
219
219
|
},
|
|
220
|
-
|
|
220
|
+
252: function(e, t, n) {
|
|
221
221
|
e = n.nmd(e), function(t, r) {
|
|
222
222
|
'function' == typeof define && define.amd ? define([
|
|
223
223
|
"protobufjs/minimal"
|
|
224
|
-
], r) : e && e.exports && (e.exports = r(n(
|
|
224
|
+
], r) : e && e.exports && (e.exports = r(n(643)));
|
|
225
225
|
}(0, function(e) {
|
|
226
226
|
"use strict";
|
|
227
227
|
var t = e.Reader, n = e.Writer, r = e.util, i = e.roots.default || (e.roots.default = {});
|
|
@@ -464,13 +464,13 @@ var __webpack_modules__ = {
|
|
|
464
464
|
}(), i;
|
|
465
465
|
});
|
|
466
466
|
},
|
|
467
|
-
|
|
467
|
+
95: function(e, t, n) {
|
|
468
468
|
!function(n, r) {
|
|
469
469
|
e.exports = t = r();
|
|
470
470
|
}(0, function() {
|
|
471
471
|
var e = e || function(e, t) {
|
|
472
472
|
if ('undefined' != typeof window && window.crypto && (r = window.crypto), 'undefined' != typeof self && self.crypto && (r = self.crypto), 'undefined' != typeof globalThis && globalThis.crypto && (r = globalThis.crypto), !r && 'undefined' != typeof window && window.msCrypto && (r = window.msCrypto), !r && void 0 !== n.g && n.g.crypto && (r = n.g.crypto), !r) try {
|
|
473
|
-
r = n(
|
|
473
|
+
r = n(602);
|
|
474
474
|
} catch (e) {}
|
|
475
475
|
var r, i = function() {
|
|
476
476
|
if (r) {
|
|
@@ -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
|
-
},
|
|
552
|
+
}, f = 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,23 +561,23 @@ 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
|
-
},
|
|
564
|
+
}, p = c.Utf8 = {
|
|
565
565
|
stringify: function(e) {
|
|
566
566
|
try {
|
|
567
|
-
return decodeURIComponent(escape(
|
|
567
|
+
return decodeURIComponent(escape(f.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
|
|
573
|
+
return f.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 =
|
|
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);
|
|
@@ -625,9 +625,9 @@ var __webpack_modules__ = {
|
|
|
625
625
|
return e;
|
|
626
626
|
});
|
|
627
627
|
},
|
|
628
|
-
|
|
628
|
+
716: function(e, t, n) {
|
|
629
629
|
!function(r, i) {
|
|
630
|
-
e.exports = t = i(n(
|
|
630
|
+
e.exports = t = i(n(95));
|
|
631
631
|
}(0, function(e) {
|
|
632
632
|
return !function() {
|
|
633
633
|
var t = e, n = t.lib.WordArray;
|
|
@@ -665,16 +665,16 @@ var __webpack_modules__ = {
|
|
|
665
665
|
}(), e.enc.Base64;
|
|
666
666
|
});
|
|
667
667
|
},
|
|
668
|
-
|
|
668
|
+
60: function(e, t, n) {
|
|
669
669
|
!function(r, i) {
|
|
670
|
-
e.exports = t = i(n(
|
|
670
|
+
e.exports = t = i(n(95));
|
|
671
671
|
}(0, function(e) {
|
|
672
672
|
return e.enc.Utf8;
|
|
673
673
|
});
|
|
674
674
|
},
|
|
675
|
-
|
|
675
|
+
478: function(e, t, n) {
|
|
676
676
|
!function(r, i) {
|
|
677
|
-
e.exports = t = i(n(
|
|
677
|
+
e.exports = t = i(n(95));
|
|
678
678
|
}(0, function(e) {
|
|
679
679
|
return !function(t) {
|
|
680
680
|
var n = e, r = n.lib, i = r.WordArray, o = r.Hasher, s = n.algo, a = [];
|
|
@@ -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],
|
|
699
|
-
|
|
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], 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], E = e[t + 13], S = 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, p, 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, $, E, 12, a[13]), $ = l($, P, O, I, S, 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, $, S, 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, E, 5, a[28]), P = c(P, O, I, $, p, 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, S, 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, E, 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, p, 23, a[47]), O = f(O, I, $, P, s, 6, a[48]), P = f(P, O, I, $, y, 10, a[49]), $ = f($, P, O, I, S, 15, a[50]), I = f(I, $, P, O, g, 21, a[51]), O = f(O, I, $, P, x, 6, a[52]), P = f(P, O, I, $, h, 10, a[53]), $ = f($, P, O, I, w, 15, a[54]), I = f(I, $, P, O, u, 21, a[55]), O = f(O, I, $, P, b, 6, a[56]), P = f(P, O, I, $, z, 10, a[57]), $ = f($, P, O, I, v, 15, a[58]), I = f(I, $, P, O, E, 21, a[59]), O = f(O, I, $, P, m, 6, a[60]), P = f(P, O, I, $, k, 10, a[61]), $ = f($, P, O, I, p, 15, a[62]), I = f(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;
|
|
700
700
|
},
|
|
701
701
|
_doFinalize: function() {
|
|
702
702
|
var e = this._data, n = e.words, r = 8 * this._nDataBytes, i = 8 * e.sigBytes;
|
|
@@ -726,7 +726,7 @@ var __webpack_modules__ = {
|
|
|
726
726
|
var a = e + (t ^ n ^ r) + i + s;
|
|
727
727
|
return (a << o | a >>> 32 - o) + t;
|
|
728
728
|
}
|
|
729
|
-
function
|
|
729
|
+
function f(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
|
}
|
|
@@ -734,19 +734,19 @@ var __webpack_modules__ = {
|
|
|
734
734
|
}(Math), e.MD5;
|
|
735
735
|
});
|
|
736
736
|
},
|
|
737
|
-
|
|
738
|
-
e.exports = n(
|
|
737
|
+
643: function(e, t, n) {
|
|
738
|
+
e.exports = n(447);
|
|
739
739
|
},
|
|
740
|
-
|
|
740
|
+
447: function(e, t, n) {
|
|
741
741
|
var r = t;
|
|
742
742
|
function i() {
|
|
743
743
|
r.util._configure(), r.Writer._configure(r.BufferWriter), r.Reader._configure(r.BufferReader);
|
|
744
744
|
}
|
|
745
|
-
r.build = "minimal", r.Writer = n(
|
|
745
|
+
r.build = "minimal", r.Writer = n(114), r.BufferWriter = n(491), r.Reader = n(762), r.BufferReader = n(171), r.util = n(837), r.rpc = n(366), r.roots = n(264), r.configure = i, i();
|
|
746
746
|
},
|
|
747
|
-
|
|
747
|
+
762: function(e, t, n) {
|
|
748
748
|
e.exports = u;
|
|
749
|
-
var r, i = n(
|
|
749
|
+
var r, i = n(837), o = i.LongBits, s = i.utf8;
|
|
750
750
|
function a(e, t) {
|
|
751
751
|
return RangeError("index out of range: " + e.pos + " + " + (t || 1) + " > " + e.len);
|
|
752
752
|
}
|
|
@@ -787,12 +787,12 @@ var __webpack_modules__ = {
|
|
|
787
787
|
}
|
|
788
788
|
throw Error("invalid varint encoding");
|
|
789
789
|
}
|
|
790
|
-
function
|
|
790
|
+
function f(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
|
|
793
|
+
function p() {
|
|
794
794
|
if (this.pos + 8 > this.len) throw a(this, 8);
|
|
795
|
-
return new o(
|
|
795
|
+
return new o(f(this.buf, this.pos += 4), f(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
|
|
813
|
+
return f(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 |
|
|
816
|
+
return 0 | f(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);
|
|
@@ -876,19 +876,19 @@ var __webpack_modules__ = {
|
|
|
876
876
|
return d.call(this).zzDecode()[t](!1);
|
|
877
877
|
},
|
|
878
878
|
fixed64: function() {
|
|
879
|
-
return
|
|
879
|
+
return p.call(this)[t](!0);
|
|
880
880
|
},
|
|
881
881
|
sfixed64: function() {
|
|
882
|
-
return
|
|
882
|
+
return p.call(this)[t](!1);
|
|
883
883
|
}
|
|
884
884
|
});
|
|
885
885
|
};
|
|
886
886
|
},
|
|
887
|
-
|
|
887
|
+
171: function(e, t, n) {
|
|
888
888
|
e.exports = o;
|
|
889
|
-
var r = n(
|
|
889
|
+
var r = n(762);
|
|
890
890
|
(o.prototype = Object.create(r.prototype)).constructor = o;
|
|
891
|
-
var i = n(
|
|
891
|
+
var i = n(837);
|
|
892
892
|
function o(e) {
|
|
893
893
|
r.call(this, e);
|
|
894
894
|
}
|
|
@@ -899,15 +899,15 @@ var __webpack_modules__ = {
|
|
|
899
899
|
return this.buf.utf8Slice ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + e, this.len)) : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + e, this.len));
|
|
900
900
|
}, o._configure();
|
|
901
901
|
},
|
|
902
|
-
|
|
902
|
+
264: function(e) {
|
|
903
903
|
e.exports = {};
|
|
904
904
|
},
|
|
905
|
-
|
|
906
|
-
t.Service = n(
|
|
905
|
+
366: function(e, t, n) {
|
|
906
|
+
t.Service = n(286);
|
|
907
907
|
},
|
|
908
|
-
|
|
908
|
+
286: function(e, t, n) {
|
|
909
909
|
e.exports = i;
|
|
910
|
-
var r = n(
|
|
910
|
+
var r = n(837);
|
|
911
911
|
function i(e, t, n) {
|
|
912
912
|
if ("function" != typeof e) throw TypeError("rpcImpl must be a function");
|
|
913
913
|
r.EventEmitter.call(this), this.rpcImpl = e, this.requestDelimited = !!t, this.responseDelimited = !!n;
|
|
@@ -940,9 +940,9 @@ var __webpack_modules__ = {
|
|
|
940
940
|
return this.rpcImpl && (e || this.rpcImpl(null, null, null), this.rpcImpl = null, this.emit("end").off()), this;
|
|
941
941
|
};
|
|
942
942
|
},
|
|
943
|
-
|
|
943
|
+
926: function(e, t, n) {
|
|
944
944
|
e.exports = i;
|
|
945
|
-
var r = n(
|
|
945
|
+
var r = n(837);
|
|
946
946
|
function i(e, t) {
|
|
947
947
|
this.lo = e >>> 0, this.hi = t >>> 0;
|
|
948
948
|
}
|
|
@@ -995,7 +995,7 @@ var __webpack_modules__ = {
|
|
|
995
995
|
return 0 === n ? 0 === t ? e < 16384 ? e < 128 ? 1 : 2 : e < 2097152 ? 3 : 4 : t < 16384 ? t < 128 ? 5 : 6 : t < 2097152 ? 7 : 8 : n < 128 ? 9 : 10;
|
|
996
996
|
};
|
|
997
997
|
},
|
|
998
|
-
|
|
998
|
+
837: function(e, t, n) {
|
|
999
999
|
var r = t;
|
|
1000
1000
|
function i(e, t, n) {
|
|
1001
1001
|
for(var r = Object.keys(t), i = 0; i < r.length; ++i)void 0 !== e[r[i]] && n || (e[r[i]] = t[r[i]]);
|
|
@@ -1037,7 +1037,7 @@ var __webpack_modules__ = {
|
|
|
1037
1037
|
}
|
|
1038
1038
|
}), t;
|
|
1039
1039
|
}
|
|
1040
|
-
r.asPromise = n(
|
|
1040
|
+
r.asPromise = n(188), r.base64 = n(4), r.EventEmitter = n(730), r.float = n(791), r.inquire = n(706), r.utf8 = n(322), r.pool = n(338), r.LongBits = n(926), r.isNode = !!(void 0 !== n.g && n.g && n.g.process && n.g.process.versions && n.g.process.versions.node), r.global = r.isNode && n.g || "undefined" != typeof window && window || "undefined" != typeof self && self || this, r.emptyArray = Object.freeze ? Object.freeze([]) : [], r.emptyObject = Object.freeze ? Object.freeze({}) : {}, r.isInteger = Number.isInteger || function(e) {
|
|
1041
1041
|
return "number" == typeof e && isFinite(e) && Math.floor(e) === e;
|
|
1042
1042
|
}, r.isString = function(e) {
|
|
1043
1043
|
return "string" == typeof e || e instanceof String;
|
|
@@ -1089,9 +1089,9 @@ var __webpack_modules__ = {
|
|
|
1089
1089
|
};
|
|
1090
1090
|
};
|
|
1091
1091
|
},
|
|
1092
|
-
|
|
1092
|
+
114: function(e, t, n) {
|
|
1093
1093
|
e.exports = d;
|
|
1094
|
-
var r, i = n(
|
|
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;
|
|
1097
1097
|
}
|
|
@@ -1102,7 +1102,7 @@ var __webpack_modules__ = {
|
|
|
1102
1102
|
function d() {
|
|
1103
1103
|
this.len = 0, this.head = new u(l, 0, 0), this.tail = this.head, this.states = null;
|
|
1104
1104
|
}
|
|
1105
|
-
var
|
|
1105
|
+
var f = function() {
|
|
1106
1106
|
return i.Buffer ? function() {
|
|
1107
1107
|
return (d.create = function() {
|
|
1108
1108
|
return new r();
|
|
@@ -1111,7 +1111,7 @@ var __webpack_modules__ = {
|
|
|
1111
1111
|
return new d();
|
|
1112
1112
|
};
|
|
1113
1113
|
};
|
|
1114
|
-
function
|
|
1114
|
+
function p(e, t, n) {
|
|
1115
1115
|
t[n] = 255 & e;
|
|
1116
1116
|
}
|
|
1117
1117
|
function h(e, t, n) {
|
|
@@ -1129,7 +1129,7 @@ var __webpack_modules__ = {
|
|
|
1129
1129
|
function v(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 =
|
|
1132
|
+
d.create = f(), d.alloc = function(e) {
|
|
1133
1133
|
return new i.Array(e);
|
|
1134
1134
|
}, i.Array !== Array && (d.alloc = i.pool(d.alloc, i.Array.prototype.subarray)), d.prototype._push = function(e, t, n) {
|
|
1135
1135
|
return this.tail = this.tail.next = new u(e, t, n), this.len += t, this;
|
|
@@ -1146,7 +1146,7 @@ var __webpack_modules__ = {
|
|
|
1146
1146
|
var t = o.from(e).zzEncode();
|
|
1147
1147
|
return this._push(g, t.length(), t);
|
|
1148
1148
|
}, d.prototype.bool = function(e) {
|
|
1149
|
-
return this._push(
|
|
1149
|
+
return this._push(p, 1, +!!e);
|
|
1150
1150
|
}, d.prototype.fixed32 = function(e) {
|
|
1151
1151
|
return this._push(v, 4, e >>> 0);
|
|
1152
1152
|
}, d.prototype.sfixed32 = d.prototype.fixed32, d.prototype.fixed64 = function(e) {
|
|
@@ -1164,7 +1164,7 @@ var __webpack_modules__ = {
|
|
|
1164
1164
|
};
|
|
1165
1165
|
d.prototype.bytes = function(e) {
|
|
1166
1166
|
var t = e.length >>> 0;
|
|
1167
|
-
if (!t) return this._push(
|
|
1167
|
+
if (!t) return this._push(p, 1, 0);
|
|
1168
1168
|
if (i.isString(e)) {
|
|
1169
1169
|
var n = d.alloc(t = s.length(e));
|
|
1170
1170
|
s.decode(e, n, 0), e = n;
|
|
@@ -1172,7 +1172,7 @@ var __webpack_modules__ = {
|
|
|
1172
1172
|
return this.uint32(t)._push(y, t, e);
|
|
1173
1173
|
}, d.prototype.string = function(e) {
|
|
1174
1174
|
var t = a.length(e);
|
|
1175
|
-
return t ? this.uint32(t)._push(a.write, t, e) : this._push(
|
|
1175
|
+
return t ? this.uint32(t)._push(a.write, t, e) : this._push(p, 1, 0);
|
|
1176
1176
|
}, d.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
1178
|
}, d.prototype.reset = function() {
|
|
@@ -1184,14 +1184,14 @@ var __webpack_modules__ = {
|
|
|
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
1186
|
}, d._configure = function(e) {
|
|
1187
|
-
r = e, d.create =
|
|
1187
|
+
r = e, d.create = f(), r._configure();
|
|
1188
1188
|
};
|
|
1189
1189
|
},
|
|
1190
|
-
|
|
1190
|
+
491: function(e, t, n) {
|
|
1191
1191
|
e.exports = o;
|
|
1192
|
-
var r = n(
|
|
1192
|
+
var r = n(114);
|
|
1193
1193
|
(o.prototype = Object.create(r.prototype)).constructor = o;
|
|
1194
|
-
var i = n(
|
|
1194
|
+
var i = n(837);
|
|
1195
1195
|
function o() {
|
|
1196
1196
|
r.call(this);
|
|
1197
1197
|
}
|
|
@@ -1214,7 +1214,7 @@ var __webpack_modules__ = {
|
|
|
1214
1214
|
return this.uint32(t), t && this._push(s, t, e), this;
|
|
1215
1215
|
}, o._configure();
|
|
1216
1216
|
},
|
|
1217
|
-
|
|
1217
|
+
682: function(e, t) {
|
|
1218
1218
|
var n, r = Object.prototype.hasOwnProperty;
|
|
1219
1219
|
function i(e) {
|
|
1220
1220
|
try {
|
|
@@ -1246,7 +1246,7 @@ var __webpack_modules__ = {
|
|
|
1246
1246
|
return a.length ? t + a.join('&') : '';
|
|
1247
1247
|
}, t.parse = s;
|
|
1248
1248
|
},
|
|
1249
|
-
|
|
1249
|
+
995: function(e) {
|
|
1250
1250
|
e.exports = function(e, t) {
|
|
1251
1251
|
if (t = t.split(':')[0], !(e *= 1)) return !1;
|
|
1252
1252
|
switch(t){
|
|
@@ -1266,12 +1266,12 @@ var __webpack_modules__ = {
|
|
|
1266
1266
|
return 0 !== e;
|
|
1267
1267
|
};
|
|
1268
1268
|
},
|
|
1269
|
-
|
|
1270
|
-
var r = n(
|
|
1269
|
+
337: function(e, t, n) {
|
|
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
1271
|
function d(e) {
|
|
1272
1272
|
return (e || '').toString().replace(o, '');
|
|
1273
1273
|
}
|
|
1274
|
-
var
|
|
1274
|
+
var f = [
|
|
1275
1275
|
[
|
|
1276
1276
|
'#',
|
|
1277
1277
|
'hash'
|
|
@@ -1312,16 +1312,16 @@ var __webpack_modules__ = {
|
|
|
1312
1312
|
1,
|
|
1313
1313
|
1
|
|
1314
1314
|
]
|
|
1315
|
-
],
|
|
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
1321
|
if ('blob:' === e.protocol) o = new y(unescape(e.pathname), {});
|
|
1322
|
-
else if ('string' === s) for(r in o = new y(e, {}),
|
|
1322
|
+
else if ('string' === s) for(r in o = new y(e, {}), p)delete o[r];
|
|
1323
1323
|
else if ('object' === s) {
|
|
1324
|
-
for(r in e)r in
|
|
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;
|
|
@@ -1346,18 +1346,18 @@ var __webpack_modules__ = {
|
|
|
1346
1346
|
}
|
|
1347
1347
|
function y(e, t, n) {
|
|
1348
1348
|
if (e = (e = d(e)).replace(s, ''), !(this instanceof y)) return new y(e, t, n);
|
|
1349
|
-
var o, a, u, l,
|
|
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,
|
|
1349
|
+
var o, a, u, l, p, b, _ = f.slice(), w = typeof t, k = this, x = 0;
|
|
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'
|
|
1353
|
-
]);
|
|
1354
|
-
if ('function' == typeof (l = _[
|
|
1355
|
-
e = l(e,
|
|
1353
|
+
]); x < _.length; x++){
|
|
1354
|
+
if ('function' == typeof (l = _[x])) {
|
|
1355
|
+
e = l(e, k);
|
|
1356
1356
|
continue;
|
|
1357
1357
|
}
|
|
1358
|
-
u = l[0], b = l[1], u != u ?
|
|
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 && (
|
|
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 && (~(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
1362
|
y.prototype = {
|
|
1363
1363
|
set: function(e, t, n) {
|
|
@@ -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 <
|
|
1397
|
-
var c =
|
|
1396
|
+
for(var l = 0; l < f.length; l++){
|
|
1397
|
+
var c = f[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;
|
|
@@ -1408,7 +1408,7 @@ var __webpack_modules__ = {
|
|
|
1408
1408
|
}
|
|
1409
1409
|
}, y.extractProtocol = g, y.location = h, y.trimLeft = d, y.qs = i, e.exports = y;
|
|
1410
1410
|
},
|
|
1411
|
-
|
|
1411
|
+
602: function() {}
|
|
1412
1412
|
}, __webpack_module_cache__ = {};
|
|
1413
1413
|
function __webpack_require__(e) {
|
|
1414
1414
|
var t = __webpack_module_cache__[e];
|
|
@@ -1454,7 +1454,7 @@ const DOUBAN_API_KEY = "0ac44ae016490db2204ce0a042db2916", PROVIDER_NAMES = {
|
|
|
1454
1454
|
youku: "\u4F18\u9177\u89C6\u9891",
|
|
1455
1455
|
bilibili: "\u54D4\u54E9\u54D4\u54E9"
|
|
1456
1456
|
};
|
|
1457
|
-
var url_parse = __webpack_require__(
|
|
1457
|
+
var url_parse = __webpack_require__(337), url_parse_default = __webpack_require__.n(url_parse);
|
|
1458
1458
|
function $constructor(e, t, n) {
|
|
1459
1459
|
function r(n, r) {
|
|
1460
1460
|
var i;
|
|
@@ -1493,15 +1493,20 @@ class $ZodAsyncError extends Error {
|
|
|
1493
1493
|
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
1494
1494
|
}
|
|
1495
1495
|
}
|
|
1496
|
+
class $ZodEncodeError extends Error {
|
|
1497
|
+
constructor(e){
|
|
1498
|
+
super(`Encountered unidirectional transform during encode: ${e}`), this.name = "ZodEncodeError";
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1496
1501
|
const globalConfig = {};
|
|
1497
1502
|
function core_config(e) {
|
|
1498
1503
|
return e && Object.assign(globalConfig, e), globalConfig;
|
|
1499
1504
|
}
|
|
1500
|
-
const cuid = /^[cC][^\s-]{8,}$/, cuid2 = /^[0-9a-z]+$/, ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, xid = /^[0-9a-vA-V]{20}$/, ksuid = /^[A-Za-z0-9]{27}$/, nanoid = /^[a-zA-Z0-9_-]{21}$/, regexes_duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, uuid = (e)=>e ? RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/, email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, _emoji = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
1505
|
+
const cuid = /^[cC][^\s-]{8,}$/, cuid2 = /^[0-9a-z]+$/, ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, xid = /^[0-9a-vA-V]{20}$/, ksuid = /^[A-Za-z0-9]{27}$/, nanoid = /^[a-zA-Z0-9_-]{21}$/, regexes_duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, uuid = (e)=>e ? RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, _emoji = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
1501
1506
|
function emoji() {
|
|
1502
1507
|
return RegExp(_emoji, "u");
|
|
1503
1508
|
}
|
|
1504
|
-
const ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/, cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, regexes_base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,
|
|
1509
|
+
const ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/, cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, regexes_base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, regexes_base64url = /^[A-Za-z0-9_-]*$/, hostname = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, e164 = /^\+(?:[0-9]){6,14}[0-9]$/, dateSource = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", regexes_date = RegExp(`^${dateSource}$`);
|
|
1505
1510
|
function timeSource(e) {
|
|
1506
1511
|
let t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
1507
1512
|
return "number" == typeof e.precision ? -1 === e.precision ? `${t}` : 0 === e.precision ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
@@ -1702,7 +1707,9 @@ function omit(e, t) {
|
|
|
1702
1707
|
}
|
|
1703
1708
|
function extend(e, t) {
|
|
1704
1709
|
if (!isPlainObject(t)) throw Error("Invalid input to extend: expected a plain object");
|
|
1705
|
-
let n =
|
|
1710
|
+
let n = e._zod.def.checks;
|
|
1711
|
+
if (n && n.length > 0) throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
|
|
1712
|
+
let r = mergeDefs(e._zod.def, {
|
|
1706
1713
|
get shape () {
|
|
1707
1714
|
let n = {
|
|
1708
1715
|
...e._zod.def.shape,
|
|
@@ -1712,6 +1719,21 @@ function extend(e, t) {
|
|
|
1712
1719
|
},
|
|
1713
1720
|
checks: []
|
|
1714
1721
|
});
|
|
1722
|
+
return clone(e, r);
|
|
1723
|
+
}
|
|
1724
|
+
function safeExtend(e, t) {
|
|
1725
|
+
if (!isPlainObject(t)) throw Error("Invalid input to safeExtend: expected a plain object");
|
|
1726
|
+
let n = {
|
|
1727
|
+
...e._zod.def,
|
|
1728
|
+
get shape () {
|
|
1729
|
+
let n = {
|
|
1730
|
+
...e._zod.def.shape,
|
|
1731
|
+
...t
|
|
1732
|
+
};
|
|
1733
|
+
return assignProp(this, "shape", n), n;
|
|
1734
|
+
},
|
|
1735
|
+
checks: e._zod.def.checks
|
|
1736
|
+
};
|
|
1715
1737
|
return clone(e, n);
|
|
1716
1738
|
}
|
|
1717
1739
|
function merge(e, t) {
|
|
@@ -1777,6 +1799,7 @@ function required(e, t, n) {
|
|
|
1777
1799
|
return clone(t, r);
|
|
1778
1800
|
}
|
|
1779
1801
|
function aborted(e, t = 0) {
|
|
1802
|
+
if (!0 === e.aborted) return !0;
|
|
1780
1803
|
for(let n = t; n < e.issues.length; n++)if (e.issues[n]?.continue !== !0) return !0;
|
|
1781
1804
|
return !1;
|
|
1782
1805
|
}
|
|
@@ -2233,10 +2256,38 @@ const _parse = (e)=>(t, n, r, i)=>{
|
|
|
2233
2256
|
success: !0,
|
|
2234
2257
|
data: o.value
|
|
2235
2258
|
};
|
|
2236
|
-
}, safeParseAsync = _safeParseAsync($ZodRealError),
|
|
2259
|
+
}, safeParseAsync = _safeParseAsync($ZodRealError), _encode = (e)=>(t, n, r)=>{
|
|
2260
|
+
let i = r ? Object.assign(r, {
|
|
2261
|
+
direction: "backward"
|
|
2262
|
+
}) : {
|
|
2263
|
+
direction: "backward"
|
|
2264
|
+
};
|
|
2265
|
+
return _parse(e)(t, n, i);
|
|
2266
|
+
}, _decode = (e)=>(t, n, r)=>_parse(e)(t, n, r), _encodeAsync = (e)=>async (t, n, r)=>{
|
|
2267
|
+
let i = r ? Object.assign(r, {
|
|
2268
|
+
direction: "backward"
|
|
2269
|
+
}) : {
|
|
2270
|
+
direction: "backward"
|
|
2271
|
+
};
|
|
2272
|
+
return _parseAsync(e)(t, n, i);
|
|
2273
|
+
}, _decodeAsync = (e)=>async (t, n, r)=>_parseAsync(e)(t, n, r), _safeEncode = (e)=>(t, n, r)=>{
|
|
2274
|
+
let i = r ? Object.assign(r, {
|
|
2275
|
+
direction: "backward"
|
|
2276
|
+
}) : {
|
|
2277
|
+
direction: "backward"
|
|
2278
|
+
};
|
|
2279
|
+
return _safeParse(e)(t, n, i);
|
|
2280
|
+
}, _safeDecode = (e)=>(t, n, r)=>_safeParse(e)(t, n, r), _safeEncodeAsync = (e)=>async (t, n, r)=>{
|
|
2281
|
+
let i = r ? Object.assign(r, {
|
|
2282
|
+
direction: "backward"
|
|
2283
|
+
}) : {
|
|
2284
|
+
direction: "backward"
|
|
2285
|
+
};
|
|
2286
|
+
return _safeParseAsync(e)(t, n, i);
|
|
2287
|
+
}, _safeDecodeAsync = (e)=>async (t, n, r)=>_safeParseAsync(e)(t, n, r), versions_version = {
|
|
2237
2288
|
major: 4,
|
|
2238
|
-
minor:
|
|
2239
|
-
patch:
|
|
2289
|
+
minor: 1,
|
|
2290
|
+
patch: 5
|
|
2240
2291
|
}, $ZodType = $constructor("$ZodType", (e, t)=>{
|
|
2241
2292
|
var n;
|
|
2242
2293
|
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = versions_version;
|
|
@@ -2265,14 +2316,33 @@ const _parse = (e)=>(t, n, r, i)=>{
|
|
|
2265
2316
|
}
|
|
2266
2317
|
}
|
|
2267
2318
|
return r ? r.then(()=>e) : e;
|
|
2319
|
+
}, n = (n, i, o)=>{
|
|
2320
|
+
if (aborted(n)) return n.aborted = !0, n;
|
|
2321
|
+
let s = t(i, r, o);
|
|
2322
|
+
if (s instanceof Promise) {
|
|
2323
|
+
if (!1 === o.async) throw new $ZodAsyncError();
|
|
2324
|
+
return s.then((t)=>e._zod.parse(t, o));
|
|
2325
|
+
}
|
|
2326
|
+
return e._zod.parse(s, o);
|
|
2268
2327
|
};
|
|
2269
|
-
e._zod.run = (
|
|
2270
|
-
|
|
2271
|
-
if (
|
|
2272
|
-
|
|
2273
|
-
|
|
2328
|
+
e._zod.run = (i, o)=>{
|
|
2329
|
+
if (o.skipChecks) return e._zod.parse(i, o);
|
|
2330
|
+
if ("backward" === o.direction) {
|
|
2331
|
+
let t = e._zod.parse({
|
|
2332
|
+
value: i.value,
|
|
2333
|
+
issues: []
|
|
2334
|
+
}, {
|
|
2335
|
+
...o,
|
|
2336
|
+
skipChecks: !0
|
|
2337
|
+
});
|
|
2338
|
+
return t instanceof Promise ? t.then((e)=>n(e, i, o)) : n(t, i, o);
|
|
2274
2339
|
}
|
|
2275
|
-
|
|
2340
|
+
let s = e._zod.parse(i, o);
|
|
2341
|
+
if (s instanceof Promise) {
|
|
2342
|
+
if (!1 === o.async) throw new $ZodAsyncError();
|
|
2343
|
+
return s.then((e)=>t(e, r, o));
|
|
2344
|
+
}
|
|
2345
|
+
return t(s, r, o);
|
|
2276
2346
|
};
|
|
2277
2347
|
}
|
|
2278
2348
|
e["~standard"] = {
|
|
@@ -2380,7 +2450,7 @@ const _parse = (e)=>(t, n, r, i)=>{
|
|
|
2380
2450
|
}), $ZodISODateTime = $constructor("$ZodISODateTime", (e, t)=>{
|
|
2381
2451
|
t.pattern ?? (t.pattern = datetime(t)), $ZodStringFormat.init(e, t);
|
|
2382
2452
|
}), $ZodISODate = $constructor("$ZodISODate", (e, t)=>{
|
|
2383
|
-
t.pattern ?? (t.pattern =
|
|
2453
|
+
t.pattern ?? (t.pattern = regexes_date), $ZodStringFormat.init(e, t);
|
|
2384
2454
|
}), $ZodISOTime = $constructor("$ZodISOTime", (e, t)=>{
|
|
2385
2455
|
t.pattern ?? (t.pattern = regexes_time(t)), $ZodStringFormat.init(e, t);
|
|
2386
2456
|
}), $ZodISODuration = $constructor("$ZodISODuration", (e, t)=>{
|
|
@@ -2449,12 +2519,12 @@ const $ZodBase64 = $constructor("$ZodBase64", (e, t)=>{
|
|
|
2449
2519
|
};
|
|
2450
2520
|
});
|
|
2451
2521
|
function isValidBase64URL(e) {
|
|
2452
|
-
if (!
|
|
2522
|
+
if (!regexes_base64url.test(e)) return !1;
|
|
2453
2523
|
let t = e.replace(/[-_]/g, (e)=>"-" === e ? "+" : "/");
|
|
2454
2524
|
return isValidBase64(t.padEnd(4 * Math.ceil(t.length / 4), "="));
|
|
2455
2525
|
}
|
|
2456
2526
|
const $ZodBase64URL = $constructor("$ZodBase64URL", (e, t)=>{
|
|
2457
|
-
t.pattern ?? (t.pattern =
|
|
2527
|
+
t.pattern ?? (t.pattern = regexes_base64url), $ZodStringFormat.init(e, t), e._zod.onattach.push((e)=>{
|
|
2458
2528
|
e._zod.bag.contentEncoding = "base64url";
|
|
2459
2529
|
}), e._zod.check = (n)=>{
|
|
2460
2530
|
isValidBase64URL(n.value) || n.issues.push({
|
|
@@ -2561,21 +2631,43 @@ const $ZodArray = $constructor("$ZodArray", (e, t)=>{
|
|
|
2561
2631
|
function handlePropertyResult(e, t, n, r) {
|
|
2562
2632
|
e.issues.length && t.issues.push(...prefixIssues(n, e.issues)), void 0 === e.value ? n in r && (t.value[n] = void 0) : t.value[n] = e.value;
|
|
2563
2633
|
}
|
|
2634
|
+
function normalizeDef(e) {
|
|
2635
|
+
let t = Object.keys(e.shape);
|
|
2636
|
+
for (let n of t)if (!e.shape[n]._zod.traits.has("$ZodType")) throw Error(`Invalid element at key "${n}": expected a Zod schema`);
|
|
2637
|
+
let n = optionalKeys(e.shape);
|
|
2638
|
+
return {
|
|
2639
|
+
...e,
|
|
2640
|
+
keys: t,
|
|
2641
|
+
keySet: new Set(t),
|
|
2642
|
+
numKeys: t.length,
|
|
2643
|
+
optionalKeys: new Set(n)
|
|
2644
|
+
};
|
|
2645
|
+
}
|
|
2646
|
+
function handleCatchall(e, t, n, r, i, o) {
|
|
2647
|
+
let s = [], a = i.keySet, u = i.catchall._zod, l = u.def.type;
|
|
2648
|
+
for (let i of Object.keys(t)){
|
|
2649
|
+
if (a.has(i)) continue;
|
|
2650
|
+
if ("never" === l) {
|
|
2651
|
+
s.push(i);
|
|
2652
|
+
continue;
|
|
2653
|
+
}
|
|
2654
|
+
let o = u.run({
|
|
2655
|
+
value: t[i],
|
|
2656
|
+
issues: []
|
|
2657
|
+
}, r);
|
|
2658
|
+
o instanceof Promise ? e.push(o.then((e)=>handlePropertyResult(e, n, i, t))) : handlePropertyResult(o, n, i, t);
|
|
2659
|
+
}
|
|
2660
|
+
return (s.length && n.issues.push({
|
|
2661
|
+
code: "unrecognized_keys",
|
|
2662
|
+
keys: s,
|
|
2663
|
+
input: t,
|
|
2664
|
+
inst: o
|
|
2665
|
+
}), e.length) ? Promise.all(e).then(()=>n) : n;
|
|
2666
|
+
}
|
|
2564
2667
|
const $ZodObject = $constructor("$ZodObject", (e, t)=>{
|
|
2565
|
-
let n
|
|
2668
|
+
let n;
|
|
2566
2669
|
$ZodType.init(e, t);
|
|
2567
|
-
let
|
|
2568
|
-
let e = Object.keys(t.shape);
|
|
2569
|
-
for (let n of e)if (!t.shape[n]._zod.traits.has("$ZodType")) throw Error(`Invalid element at key "${n}": expected a Zod schema`);
|
|
2570
|
-
let n = optionalKeys(t.shape);
|
|
2571
|
-
return {
|
|
2572
|
-
shape: t.shape,
|
|
2573
|
-
keys: e,
|
|
2574
|
-
keySet: new Set(e),
|
|
2575
|
-
numKeys: e.length,
|
|
2576
|
-
optionalKeys: new Set(n)
|
|
2577
|
-
};
|
|
2578
|
-
});
|
|
2670
|
+
let r = util_cached(()=>normalizeDef(t));
|
|
2579
2671
|
defineLazy(e._zod, "propValues", ()=>{
|
|
2580
2672
|
let e = t.shape, n = {};
|
|
2581
2673
|
for(let t in e){
|
|
@@ -2584,83 +2676,74 @@ const $ZodObject = $constructor("$ZodObject", (e, t)=>{
|
|
|
2584
2676
|
}
|
|
2585
2677
|
return n;
|
|
2586
2678
|
});
|
|
2587
|
-
let o =
|
|
2679
|
+
let i = util_isObject, o = t.catchall;
|
|
2680
|
+
e._zod.parse = (t, s)=>{
|
|
2681
|
+
n ?? (n = r.value);
|
|
2682
|
+
let a = t.value;
|
|
2683
|
+
if (!i(a)) return t.issues.push({
|
|
2684
|
+
expected: "object",
|
|
2685
|
+
code: "invalid_type",
|
|
2686
|
+
input: a,
|
|
2687
|
+
inst: e
|
|
2688
|
+
}), t;
|
|
2689
|
+
t.value = {};
|
|
2690
|
+
let u = [], l = n.shape;
|
|
2691
|
+
for (let e of n.keys){
|
|
2692
|
+
let n = l[e]._zod.run({
|
|
2693
|
+
value: a[e],
|
|
2694
|
+
issues: []
|
|
2695
|
+
}, s);
|
|
2696
|
+
n instanceof Promise ? u.push(n.then((n)=>handlePropertyResult(n, t, e, a))) : handlePropertyResult(n, t, e, a);
|
|
2697
|
+
}
|
|
2698
|
+
return o ? handleCatchall(u, a, t, s, r.value, e) : u.length ? Promise.all(u).then(()=>t) : t;
|
|
2699
|
+
};
|
|
2700
|
+
}), $ZodObjectJIT = $constructor("$ZodObjectJIT", (e, t)=>{
|
|
2701
|
+
let n, r;
|
|
2702
|
+
$ZodObject.init(e, t);
|
|
2703
|
+
let i = e._zod.parse, o = util_cached(()=>normalizeDef(t)), s = (e)=>{
|
|
2588
2704
|
let t = new Doc([
|
|
2589
2705
|
"shape",
|
|
2590
2706
|
"payload",
|
|
2591
2707
|
"ctx"
|
|
2592
|
-
]), n =
|
|
2708
|
+
]), n = o.value, r = (e)=>{
|
|
2593
2709
|
let t = esc(e);
|
|
2594
2710
|
return `shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`;
|
|
2595
2711
|
};
|
|
2596
2712
|
t.write("const input = payload.value;");
|
|
2597
|
-
let
|
|
2598
|
-
for (let e of n.keys)
|
|
2713
|
+
let i = Object.create(null), s = 0;
|
|
2714
|
+
for (let e of n.keys)i[e] = `key_${s++}`;
|
|
2599
2715
|
for (let e of (t.write("const newResult = {}"), n.keys)){
|
|
2600
|
-
let n =
|
|
2716
|
+
let n = i[e], o = esc(e);
|
|
2601
2717
|
t.write(`const ${n} = ${r(e)};`), t.write(`
|
|
2602
2718
|
if (${n}.issues.length) {
|
|
2603
2719
|
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
2604
2720
|
...iss,
|
|
2605
|
-
path: iss.path ? [${
|
|
2721
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
2606
2722
|
})));
|
|
2607
2723
|
}
|
|
2608
2724
|
|
|
2609
2725
|
if (${n}.value === undefined) {
|
|
2610
|
-
if (${
|
|
2611
|
-
newResult[${
|
|
2726
|
+
if (${o} in input) {
|
|
2727
|
+
newResult[${o}] = undefined;
|
|
2612
2728
|
}
|
|
2613
2729
|
} else {
|
|
2614
|
-
newResult[${
|
|
2730
|
+
newResult[${o}] = ${n}.value;
|
|
2615
2731
|
}
|
|
2616
2732
|
`);
|
|
2617
2733
|
}
|
|
2618
2734
|
t.write("payload.value = newResult;"), t.write("return payload;");
|
|
2619
2735
|
let a = t.compile();
|
|
2620
2736
|
return (t, n)=>a(e, t, n);
|
|
2621
|
-
},
|
|
2622
|
-
e._zod.parse = (
|
|
2623
|
-
r ?? (r =
|
|
2624
|
-
let p =
|
|
2625
|
-
|
|
2737
|
+
}, a = util_isObject, u = !globalConfig.jitless, l = util_allowsEval, c = u && l.value, d = t.catchall;
|
|
2738
|
+
e._zod.parse = (l, f)=>{
|
|
2739
|
+
r ?? (r = o.value);
|
|
2740
|
+
let p = l.value;
|
|
2741
|
+
return a(p) ? u && c && f?.async === !1 && !0 !== f.jitless ? (n || (n = s(t.shape)), l = n(l, f), d) ? handleCatchall([], p, l, f, r, e) : l : i(l, f) : (l.issues.push({
|
|
2626
2742
|
expected: "object",
|
|
2627
2743
|
code: "invalid_type",
|
|
2628
2744
|
input: p,
|
|
2629
2745
|
inst: e
|
|
2630
|
-
}),
|
|
2631
|
-
let f = [];
|
|
2632
|
-
if (a && l && d?.async === !1 && !0 !== d.jitless) n || (n = o(t.shape)), u = n(u, d);
|
|
2633
|
-
else {
|
|
2634
|
-
u.value = {};
|
|
2635
|
-
let e = r.shape;
|
|
2636
|
-
for (let t of r.keys){
|
|
2637
|
-
let n = e[t]._zod.run({
|
|
2638
|
-
value: p[t],
|
|
2639
|
-
issues: []
|
|
2640
|
-
}, d);
|
|
2641
|
-
n instanceof Promise ? f.push(n.then((e)=>handlePropertyResult(e, u, t, p))) : handlePropertyResult(n, u, t, p);
|
|
2642
|
-
}
|
|
2643
|
-
}
|
|
2644
|
-
if (!c) return f.length ? Promise.all(f).then(()=>u) : u;
|
|
2645
|
-
let h = [], m = r.keySet, g = c._zod, v = g.def.type;
|
|
2646
|
-
for (let e of Object.keys(p)){
|
|
2647
|
-
if (m.has(e)) continue;
|
|
2648
|
-
if ("never" === v) {
|
|
2649
|
-
h.push(e);
|
|
2650
|
-
continue;
|
|
2651
|
-
}
|
|
2652
|
-
let t = g.run({
|
|
2653
|
-
value: p[e],
|
|
2654
|
-
issues: []
|
|
2655
|
-
}, d);
|
|
2656
|
-
t instanceof Promise ? f.push(t.then((t)=>handlePropertyResult(t, u, e, p))) : handlePropertyResult(t, u, e, p);
|
|
2657
|
-
}
|
|
2658
|
-
return (h.length && u.issues.push({
|
|
2659
|
-
code: "unrecognized_keys",
|
|
2660
|
-
keys: h,
|
|
2661
|
-
input: p,
|
|
2662
|
-
inst: e
|
|
2663
|
-
}), f.length) ? Promise.all(f).then(()=>u) : u;
|
|
2746
|
+
}), l);
|
|
2664
2747
|
};
|
|
2665
2748
|
});
|
|
2666
2749
|
function handleUnionResults(e, t, n, r) {
|
|
@@ -2855,11 +2938,12 @@ const $ZodRecord = $constructor("$ZodRecord", (e, t)=>{
|
|
|
2855
2938
|
}), n;
|
|
2856
2939
|
};
|
|
2857
2940
|
}), $ZodTransform = $constructor("$ZodTransform", (e, t)=>{
|
|
2858
|
-
$ZodType.init(e, t), e._zod.parse = (
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
if (r instanceof Promise
|
|
2862
|
-
|
|
2941
|
+
$ZodType.init(e, t), e._zod.parse = (n, r)=>{
|
|
2942
|
+
if ("backward" === r.direction) throw new $ZodEncodeError(e.constructor.name);
|
|
2943
|
+
let i = t.transform(n.value, n);
|
|
2944
|
+
if (r.async) return (i instanceof Promise ? i : Promise.resolve(i)).then((e)=>(n.value = e, n));
|
|
2945
|
+
if (i instanceof Promise) throw new $ZodAsyncError();
|
|
2946
|
+
return n.value = i, n;
|
|
2863
2947
|
};
|
|
2864
2948
|
});
|
|
2865
2949
|
function handleOptionalResult(e, t) {
|
|
@@ -2892,6 +2976,7 @@ const $ZodOptional = $constructor("$ZodOptional", (e, t)=>{
|
|
|
2892
2976
|
]) : void 0), e._zod.parse = (e, n)=>null === e.value ? e : t.innerType._zod.run(e, n);
|
|
2893
2977
|
}), $ZodDefault = $constructor("$ZodDefault", (e, t)=>{
|
|
2894
2978
|
$ZodType.init(e, t), e._zod.optin = "optional", defineLazy(e._zod, "values", ()=>t.innerType._zod.values), e._zod.parse = (e, n)=>{
|
|
2979
|
+
if ("backward" === n.direction) return t.innerType._zod.run(e, n);
|
|
2895
2980
|
if (void 0 === e.value) return e.value = t.defaultValue, e;
|
|
2896
2981
|
let r = t.innerType._zod.run(e, n);
|
|
2897
2982
|
return r instanceof Promise ? r.then((e)=>handleDefaultResult(e, t)) : handleDefaultResult(r, t);
|
|
@@ -2901,7 +2986,7 @@ function handleDefaultResult(e, t) {
|
|
|
2901
2986
|
return void 0 === e.value && (e.value = t.defaultValue), e;
|
|
2902
2987
|
}
|
|
2903
2988
|
const $ZodPrefault = $constructor("$ZodPrefault", (e, t)=>{
|
|
2904
|
-
$ZodType.init(e, t), e._zod.optin = "optional", defineLazy(e._zod, "values", ()=>t.innerType._zod.values), e._zod.parse = (e, n)=>(void 0 === e.value && (e.value = t.defaultValue), t.innerType._zod.run(e, n));
|
|
2989
|
+
$ZodType.init(e, t), e._zod.optin = "optional", defineLazy(e._zod, "values", ()=>t.innerType._zod.values), e._zod.parse = (e, n)=>("backward" === n.direction || void 0 === e.value && (e.value = t.defaultValue), t.innerType._zod.run(e, n));
|
|
2905
2990
|
}), $ZodNonOptional = $constructor("$ZodNonOptional", (e, t)=>{
|
|
2906
2991
|
$ZodType.init(e, t), defineLazy(e._zod, "values", ()=>{
|
|
2907
2992
|
let e = t.innerType._zod.values;
|
|
@@ -2923,6 +3008,7 @@ function handleNonOptionalResult(e, t) {
|
|
|
2923
3008
|
}
|
|
2924
3009
|
const $ZodCatch = $constructor("$ZodCatch", (e, t)=>{
|
|
2925
3010
|
$ZodType.init(e, t), defineLazy(e._zod, "optin", ()=>t.innerType._zod.optin), defineLazy(e._zod, "optout", ()=>t.innerType._zod.optout), defineLazy(e._zod, "values", ()=>t.innerType._zod.values), e._zod.parse = (e, n)=>{
|
|
3011
|
+
if ("backward" === n.direction) return t.innerType._zod.run(e, n);
|
|
2926
3012
|
let r = t.innerType._zod.run(e, n);
|
|
2927
3013
|
return r instanceof Promise ? r.then((r)=>(e.value = r.value, r.issues.length && (e.value = t.catchValue({
|
|
2928
3014
|
...e,
|
|
@@ -2940,18 +3026,23 @@ const $ZodCatch = $constructor("$ZodCatch", (e, t)=>{
|
|
|
2940
3026
|
};
|
|
2941
3027
|
}), $ZodPipe = $constructor("$ZodPipe", (e, t)=>{
|
|
2942
3028
|
$ZodType.init(e, t), defineLazy(e._zod, "values", ()=>t.in._zod.values), defineLazy(e._zod, "optin", ()=>t.in._zod.optin), defineLazy(e._zod, "optout", ()=>t.out._zod.optout), defineLazy(e._zod, "propValues", ()=>t.in._zod.propValues), e._zod.parse = (e, n)=>{
|
|
3029
|
+
if ("backward" === n.direction) {
|
|
3030
|
+
let r = t.out._zod.run(e, n);
|
|
3031
|
+
return r instanceof Promise ? r.then((e)=>handlePipeResult(e, t.in, n)) : handlePipeResult(r, t.in, n);
|
|
3032
|
+
}
|
|
2943
3033
|
let r = t.in._zod.run(e, n);
|
|
2944
|
-
return r instanceof Promise ? r.then((e)=>handlePipeResult(e, t, n)) : handlePipeResult(r, t, n);
|
|
3034
|
+
return r instanceof Promise ? r.then((e)=>handlePipeResult(e, t.out, n)) : handlePipeResult(r, t.out, n);
|
|
2945
3035
|
};
|
|
2946
3036
|
});
|
|
2947
3037
|
function handlePipeResult(e, t, n) {
|
|
2948
|
-
return e.issues.length ? e : t.
|
|
3038
|
+
return e.issues.length ? (e.aborted = !0, e) : t._zod.run({
|
|
2949
3039
|
value: e.value,
|
|
2950
3040
|
issues: e.issues
|
|
2951
3041
|
}, n);
|
|
2952
3042
|
}
|
|
2953
3043
|
const $ZodReadonly = $constructor("$ZodReadonly", (e, t)=>{
|
|
2954
3044
|
$ZodType.init(e, t), defineLazy(e._zod, "propValues", ()=>t.innerType._zod.propValues), defineLazy(e._zod, "values", ()=>t.innerType._zod.values), defineLazy(e._zod, "optin", ()=>t.innerType._zod.optin), defineLazy(e._zod, "optout", ()=>t.innerType._zod.optout), e._zod.parse = (e, n)=>{
|
|
3045
|
+
if ("backward" === n.direction) return t.innerType._zod.run(e, n);
|
|
2955
3046
|
let r = t.innerType._zod.run(e, n);
|
|
2956
3047
|
return r instanceof Promise ? r.then(handleReadonlyResult) : handleReadonlyResult(r);
|
|
2957
3048
|
};
|
|
@@ -3273,6 +3364,14 @@ function _number(e, t) {
|
|
|
3273
3364
|
...normalizeParams(t)
|
|
3274
3365
|
});
|
|
3275
3366
|
}
|
|
3367
|
+
function _coercedNumber(e, t) {
|
|
3368
|
+
return new e({
|
|
3369
|
+
type: "number",
|
|
3370
|
+
coerce: !0,
|
|
3371
|
+
checks: [],
|
|
3372
|
+
...normalizeParams(t)
|
|
3373
|
+
});
|
|
3374
|
+
}
|
|
3276
3375
|
function _int(e, t) {
|
|
3277
3376
|
return new e({
|
|
3278
3377
|
type: "number",
|
|
@@ -3505,7 +3604,7 @@ const classic_errors_initializer = (e, t)=>{
|
|
|
3505
3604
|
$constructor("ZodError", classic_errors_initializer);
|
|
3506
3605
|
const ZodRealError = $constructor("ZodError", classic_errors_initializer, {
|
|
3507
3606
|
Parent: Error
|
|
3508
|
-
}),
|
|
3607
|
+
}), classic_parse_parse = _parse(ZodRealError), classic_parse_parseAsync = _parseAsync(ZodRealError), parse_safeParse = _safeParse(ZodRealError), parse_safeParseAsync = _safeParseAsync(ZodRealError), parse_encode = _encode(ZodRealError), parse_decode = _decode(ZodRealError), parse_encodeAsync = _encodeAsync(ZodRealError), parse_decodeAsync = _decodeAsync(ZodRealError), parse_safeEncode = _safeEncode(ZodRealError), parse_safeDecode = _safeDecode(ZodRealError), parse_safeEncodeAsync = _safeEncodeAsync(ZodRealError), parse_safeDecodeAsync = _safeDecodeAsync(ZodRealError), ZodType = $constructor("ZodType", (e, t)=>($ZodType.init(e, t), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", {
|
|
3509
3608
|
value: t
|
|
3510
3609
|
}), e.check = (...n)=>e.clone({
|
|
3511
3610
|
...t,
|
|
@@ -3521,11 +3620,11 @@ const ZodRealError = $constructor("ZodError", classic_errors_initializer, {
|
|
|
3521
3620
|
}
|
|
3522
3621
|
} : e)
|
|
3523
3622
|
]
|
|
3524
|
-
}), e.clone = (t, n)=>clone(e, t, n), e.brand = ()=>e, e.register = (t, n)=>(t.add(e, n), e), e.parse = (t, n)=>
|
|
3623
|
+
}), e.clone = (t, n)=>clone(e, t, n), e.brand = ()=>e, e.register = (t, n)=>(t.add(e, n), e), e.parse = (t, n)=>classic_parse_parse(e, t, n, {
|
|
3525
3624
|
callee: e.parse
|
|
3526
|
-
}), e.safeParse = (t, n)=>parse_safeParse(e, t, n), e.parseAsync = async (t, n)=>
|
|
3625
|
+
}), e.safeParse = (t, n)=>parse_safeParse(e, t, n), e.parseAsync = async (t, n)=>classic_parse_parseAsync(e, t, n, {
|
|
3527
3626
|
callee: e.parseAsync
|
|
3528
|
-
}), e.safeParseAsync = async (t, n)=>parse_safeParseAsync(e, t, n), e.spa = e.safeParseAsync, e.refine = (t, n)=>e.check(refine(t, n)), e.superRefine = (t)=>e.check(superRefine(t)), e.overwrite = (t)=>e.check(_overwrite(t)), e.optional = ()=>optional(e), e.nullable = ()=>nullable(e), e.nullish = ()=>optional(nullable(e)), e.nonoptional = (t)=>nonoptional(e, t), e.array = ()=>schemas_array(e), e.or = (t)=>union([
|
|
3627
|
+
}), e.safeParseAsync = async (t, n)=>parse_safeParseAsync(e, t, n), e.spa = e.safeParseAsync, e.encode = (t, n)=>parse_encode(e, t, n), e.decode = (t, n)=>parse_decode(e, t, n), e.encodeAsync = async (t, n)=>parse_encodeAsync(e, t, n), e.decodeAsync = async (t, n)=>parse_decodeAsync(e, t, n), e.safeEncode = (t, n)=>parse_safeEncode(e, t, n), e.safeDecode = (t, n)=>parse_safeDecode(e, t, n), e.safeEncodeAsync = async (t, n)=>parse_safeEncodeAsync(e, t, n), e.safeDecodeAsync = async (t, n)=>parse_safeDecodeAsync(e, t, n), e.refine = (t, n)=>e.check(refine(t, n)), e.superRefine = (t)=>e.check(superRefine(t)), e.overwrite = (t)=>e.check(_overwrite(t)), e.optional = ()=>optional(e), e.nullable = ()=>nullable(e), e.nullish = ()=>optional(nullable(e)), e.nonoptional = (t)=>nonoptional(e, t), e.array = ()=>schemas_array(e), e.or = (t)=>union([
|
|
3529
3628
|
e,
|
|
3530
3629
|
t
|
|
3531
3630
|
]), e.and = (t)=>intersection(e, t), e.transform = (t)=>pipe(e, transform(t)), e.default = (t)=>schemas_default(e, t), e.prefault = (t)=>prefault(e, t), e.catch = (t)=>schemas_catch(e, t), e.pipe = (t)=>pipe(e, t), e.readonly = ()=>readonly(e), e.describe = (t)=>{
|
|
@@ -3629,7 +3728,7 @@ function schemas_array(e, t) {
|
|
|
3629
3728
|
return _array(ZodArray, e, t);
|
|
3630
3729
|
}
|
|
3631
3730
|
const ZodObject = $constructor("ZodObject", (e, t)=>{
|
|
3632
|
-
$
|
|
3731
|
+
$ZodObjectJIT.init(e, t), ZodType.init(e, t), defineLazy(e, "shape", ()=>t.shape), e.keyof = ()=>schemas_enum(Object.keys(e._zod.def.shape)), e.catchall = (t)=>e.clone({
|
|
3633
3732
|
...e._zod.def,
|
|
3634
3733
|
catchall: t
|
|
3635
3734
|
}), e.passthrough = ()=>e.clone({
|
|
@@ -3644,7 +3743,7 @@ const ZodObject = $constructor("ZodObject", (e, t)=>{
|
|
|
3644
3743
|
}), e.strip = ()=>e.clone({
|
|
3645
3744
|
...e._zod.def,
|
|
3646
3745
|
catchall: void 0
|
|
3647
|
-
}), e.extend = (t)=>extend(e, t), e.merge = (t)=>merge(e, t), e.pick = (t)=>pick(e, t), e.omit = (t)=>omit(e, t), e.partial = (...t)=>partial(ZodOptional, e, t[0]), e.required = (...t)=>required(ZodNonOptional, e, t[0]);
|
|
3746
|
+
}), e.extend = (t)=>extend(e, t), e.safeExtend = (t)=>safeExtend(e, t), e.merge = (t)=>merge(e, t), e.pick = (t)=>pick(e, t), e.omit = (t)=>omit(e, t), e.partial = (...t)=>partial(ZodOptional, e, t[0]), e.required = (...t)=>required(ZodNonOptional, e, t[0]);
|
|
3648
3747
|
});
|
|
3649
3748
|
function schemas_object(e, t) {
|
|
3650
3749
|
return new ZodObject({
|
|
@@ -3752,6 +3851,7 @@ function literal(e, t) {
|
|
|
3752
3851
|
}
|
|
3753
3852
|
const ZodTransform = $constructor("ZodTransform", (e, t)=>{
|
|
3754
3853
|
$ZodTransform.init(e, t), ZodType.init(e, t), e._zod.parse = (n, r)=>{
|
|
3854
|
+
if ("backward" === r.direction) throw new $ZodEncodeError(e.constructor.name);
|
|
3755
3855
|
n.addIssue = (r)=>{
|
|
3756
3856
|
if ("string" == typeof r) n.issues.push(util_issue(r, n.value, t));
|
|
3757
3857
|
else {
|
|
@@ -3887,7 +3987,7 @@ function merge_merge(e, t) {
|
|
|
3887
3987
|
}
|
|
3888
3988
|
return e;
|
|
3889
3989
|
}
|
|
3890
|
-
var enc_base64 = __webpack_require__(
|
|
3990
|
+
var enc_base64 = __webpack_require__(716), enc_base64_default = __webpack_require__.n(enc_base64);
|
|
3891
3991
|
function safeJsonParse(e) {
|
|
3892
3992
|
try {
|
|
3893
3993
|
if (!e) return null;
|
|
@@ -3902,7 +4002,7 @@ function safeJsonParseWithZod(e, t) {
|
|
|
3902
4002
|
let { success: r, data: i, error: o } = t.safeParse(n);
|
|
3903
4003
|
return r ? i : (console.warn(`Failed to parse JSON with Zod: ${e}`, o), null);
|
|
3904
4004
|
}
|
|
3905
|
-
function
|
|
4005
|
+
function utils_base64ToUint8Array(e) {
|
|
3906
4006
|
let t = enc_base64_default().parse(e), n = new Uint8Array(t.sigBytes);
|
|
3907
4007
|
for(let e = 0; e < t.sigBytes; e++){
|
|
3908
4008
|
let r = e >>> 2, i = e % 4;
|
|
@@ -4047,16 +4147,16 @@ class Fetch {
|
|
|
4047
4147
|
}, s), r = storage.getJson(n);
|
|
4048
4148
|
if (r) return console.debug("fetch cache hit", n), Promise.resolve(r);
|
|
4049
4149
|
}
|
|
4050
|
-
let a = o ? void 0 : n, { timeout: u, schema: l, params: c, ...d } = s,
|
|
4051
|
-
c && (
|
|
4150
|
+
let a = o ? void 0 : n, { timeout: u, schema: l, params: c, ...d } = s, f = t;
|
|
4151
|
+
c && (f = `${t}?${url_parse.qs.stringify(c)}`), console.debug("\u2B06\uFE0F fetch", t, null != a ? a : "", {
|
|
4052
4152
|
...d,
|
|
4053
4153
|
params: c
|
|
4054
4154
|
});
|
|
4055
|
-
let
|
|
4155
|
+
let p = o ? Widget.http.get(f, d) : Widget.http.post(f, a, d);
|
|
4056
4156
|
return u && u > 0 ? Promise.race([
|
|
4057
|
-
|
|
4157
|
+
p,
|
|
4058
4158
|
this.createTimeoutPromise(u)
|
|
4059
|
-
]) :
|
|
4159
|
+
]) : p;
|
|
4060
4160
|
}
|
|
4061
4161
|
getCacheKey(e, t) {
|
|
4062
4162
|
var n;
|
|
@@ -4093,12 +4193,43 @@ class Fetch {
|
|
|
4093
4193
|
};
|
|
4094
4194
|
}
|
|
4095
4195
|
}
|
|
4096
|
-
|
|
4196
|
+
function coerce_number(e) {
|
|
4197
|
+
return _coercedNumber(ZodNumber, e);
|
|
4198
|
+
}
|
|
4199
|
+
const BASE_URL = "https://api.imdbapi.dev", fetch = new Fetch(), episodesRequestSchema = schemas_object({
|
|
4200
|
+
season: coerce_number().optional().default(1),
|
|
4201
|
+
pageSize: coerce_number().optional().default(20),
|
|
4202
|
+
pageToken: schemas_string().optional()
|
|
4203
|
+
}), getEpisodesByImdbId = async (e, t)=>{
|
|
4204
|
+
let { season: n, pageSize: r, pageToken: i } = episodesRequestSchema.parse(null != t ? t : {});
|
|
4205
|
+
return (await fetch.get(`${BASE_URL}/titles/${e}/episodes`, {
|
|
4206
|
+
params: {
|
|
4207
|
+
season: n,
|
|
4208
|
+
pageSize: r,
|
|
4209
|
+
pageToken: i
|
|
4210
|
+
},
|
|
4211
|
+
cache: {
|
|
4212
|
+
cacheKey: `imdb:episodes:${e}:${n}:${r}:${i}`
|
|
4213
|
+
},
|
|
4214
|
+
successStatus: [
|
|
4215
|
+
200
|
|
4216
|
+
],
|
|
4217
|
+
schema: schemas_object({
|
|
4218
|
+
episodes: schemas_array(schemas_object({
|
|
4219
|
+
id: schemas_string(),
|
|
4220
|
+
title: schemas_string().optional(),
|
|
4221
|
+
episodeNumber: schemas_number().optional()
|
|
4222
|
+
})),
|
|
4223
|
+
totalCount: schemas_number(),
|
|
4224
|
+
nextPageToken: schemas_string().optional()
|
|
4225
|
+
})
|
|
4226
|
+
})).data;
|
|
4227
|
+
}, getExternalIdsByTmdbId = async (e, t)=>{
|
|
4097
4228
|
let n = null, r = `tmdb:${e}:${t}:external_ids`, i = storage.getJson(r);
|
|
4098
4229
|
return i ? n = i : (n = await Widget.tmdb.get(`/${e}/${t}/external_ids`), storage.setJson(r, n, {
|
|
4099
4230
|
ttl: TTL_7_DAYS
|
|
4100
4231
|
})), n;
|
|
4101
|
-
},
|
|
4232
|
+
}, douban_fetch = new Fetch(), doubanImdbResponseSchema = schemas_object({
|
|
4102
4233
|
id: schemas_string(),
|
|
4103
4234
|
rating: schemas_object({
|
|
4104
4235
|
min: schemas_number(),
|
|
@@ -4117,7 +4248,7 @@ const getExternalIdsByTmdbId = async (e, t)=>{
|
|
|
4117
4248
|
})).optional()
|
|
4118
4249
|
}), getDoubanInfoByImdbId = async (e)=>{
|
|
4119
4250
|
var t, n, r, i;
|
|
4120
|
-
let o = await
|
|
4251
|
+
let o = await douban_fetch.post(`https://api.douban.com/v2/movie/imdb/${e}`, {
|
|
4121
4252
|
apikey: DOUBAN_API_KEY
|
|
4122
4253
|
}, {
|
|
4123
4254
|
headers: {
|
|
@@ -4136,9 +4267,19 @@ const getExternalIdsByTmdbId = async (e, t)=>{
|
|
|
4136
4267
|
doubanId: s,
|
|
4137
4268
|
originResponse: o.data
|
|
4138
4269
|
} : null;
|
|
4139
|
-
}, getDoubanInfoByTmdbId = async (e, t)=>{
|
|
4140
|
-
let
|
|
4141
|
-
|
|
4270
|
+
}, getDoubanInfoByTmdbId = async (e, t, n)=>{
|
|
4271
|
+
let r = await getExternalIdsByTmdbId(e, t);
|
|
4272
|
+
console.log("Get external ids by tmdb id", r);
|
|
4273
|
+
let i = r.imdb_id;
|
|
4274
|
+
if (!i) return null;
|
|
4275
|
+
if (n && 1 !== n) {
|
|
4276
|
+
var o, s;
|
|
4277
|
+
let e = await getEpisodesByImdbId(i, {
|
|
4278
|
+
season: n
|
|
4279
|
+
});
|
|
4280
|
+
i = null != (s = null == e || null == (o = e.episodes.find((e)=>1 === e.episodeNumber)) ? void 0 : o.id) ? s : "";
|
|
4281
|
+
}
|
|
4282
|
+
return i ? getDoubanInfoByImdbId(i) : null;
|
|
4142
4283
|
}, doubanInfoResponseSchema = schemas_object({
|
|
4143
4284
|
is_tv: schemas_boolean().optional(),
|
|
4144
4285
|
vendors: schemas_array(schemas_object({
|
|
@@ -4148,7 +4289,7 @@ const getExternalIdsByTmdbId = async (e, t)=>{
|
|
|
4148
4289
|
}))
|
|
4149
4290
|
}), getVideoPlatformInfoByDoubanId = async (e)=>{
|
|
4150
4291
|
var t, n, r;
|
|
4151
|
-
let i = await
|
|
4292
|
+
let i = await douban_fetch.get(`https://m.douban.com/rexxar/api/v2/movie/${e}?for_mobile=1`, {
|
|
4152
4293
|
headers: {
|
|
4153
4294
|
Referer: `https://m.douban.com/movie/subject/${e}/?dt_dapp=1`,
|
|
4154
4295
|
"Content-Type": "application/json"
|
|
@@ -4282,7 +4423,7 @@ class BaseScraper {
|
|
|
4282
4423
|
base_define_property(this, "idSchema", void 0), base_define_property(this, "fetch", new Fetch()), base_define_property(this, "GLOBAL_EPISODE_BLACKLIST_DEFAULT", "^(.*?)((.+?\u7248)|(\u7279(\u522B|\u5178))|((\u5BFC|\u6F14)\u5458|\u5609\u5BBE|\u89D2\u8272)\u8BBF\u8C08|\u798F\u5229|\u5148\u5BFC|\u5F69\u86CB|\u82B1\u7D6E|\u9884\u544A|\u7279\u8F91|\u4E13\u8BBF|\u8BBF\u8C08|\u5E55\u540E|\u5468\u8FB9|\u8D44\u8BAF|\u770B\u70B9|\u901F\u770B|\u56DE\u987E|\u76D8\u70B9|\u5408\u96C6|PV|MV|CM|OST|ED|OP|BD|\u7279\u5178|SP|NCOP|NCED|MENU|Web-DL|rip|x264|x265|aac|flac)(.*?)$"), base_define_property(this, "PROVIDER_SPECIFIC_BLACKLIST_DEFAULT", "");
|
|
4283
4424
|
}
|
|
4284
4425
|
}
|
|
4285
|
-
var dm_proto = __webpack_require__(
|
|
4426
|
+
var dm_proto = __webpack_require__(252);
|
|
4286
4427
|
function bilibili_define_property(e, t, n) {
|
|
4287
4428
|
return t in e ? Object.defineProperty(e, t, {
|
|
4288
4429
|
value: n,
|
|
@@ -4377,7 +4518,7 @@ class BilibiliScraper extends BaseScraper {
|
|
|
4377
4518
|
base64Data: !0
|
|
4378
4519
|
});
|
|
4379
4520
|
if (404 === r.statusCode || 304 === r.statusCode) return null;
|
|
4380
|
-
let i = this.DmSegMobileReply.decode(
|
|
4521
|
+
let i = this.DmSegMobileReply.decode(utils_base64ToUint8Array(r.data));
|
|
4381
4522
|
return console.log(i), i.elems;
|
|
4382
4523
|
} catch (r) {
|
|
4383
4524
|
console.error(`\u{83B7}\u{53D6}\u{5206}\u{6BB5} ${n} \u{5931}\u{8D25} (aid=${e}, cid=${t}): ${r}`);
|
|
@@ -4390,7 +4531,7 @@ class BilibiliScraper extends BaseScraper {
|
|
|
4390
4531
|
});
|
|
4391
4532
|
}
|
|
4392
4533
|
}
|
|
4393
|
-
var md5 = __webpack_require__(
|
|
4534
|
+
var md5 = __webpack_require__(478), md5_default = __webpack_require__.n(md5);
|
|
4394
4535
|
const defaultOptions = {
|
|
4395
4536
|
preserveOrder: !1,
|
|
4396
4537
|
attributeNamePrefix: '@_',
|
|
@@ -4799,9 +4940,9 @@ const parseXml = function(e) {
|
|
|
4799
4940
|
} else {
|
|
4800
4941
|
let s = readTagExp(e, o, this.options.removeNSPrefix), a = s.tagName, u = s.rawTagName, l = s.tagExp, c = s.attrExpPresent, d = s.closeIndex;
|
|
4801
4942
|
this.options.transformTagName && (a = this.options.transformTagName(a)), n && r && '!xml' !== n.tagname && (r = this.saveTextToParentTag(r, n, i, !1));
|
|
4802
|
-
let
|
|
4803
|
-
|
|
4804
|
-
let
|
|
4943
|
+
let f = n;
|
|
4944
|
+
f && -1 !== this.options.unpairedTags.indexOf(f.tagname) && (n = this.tagsNodeStack.pop(), i = i.substring(0, i.lastIndexOf("."))), a !== t.tagname && (i += i ? "." + a : a);
|
|
4945
|
+
let p = o;
|
|
4805
4946
|
if (this.isItStopNode(this.options.stopNodes, i, a)) {
|
|
4806
4947
|
let t = "";
|
|
4807
4948
|
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;
|
|
@@ -4812,15 +4953,15 @@ const parseXml = function(e) {
|
|
|
4812
4953
|
o = n.i, t = n.tagContent;
|
|
4813
4954
|
}
|
|
4814
4955
|
let r = new XmlNode(a);
|
|
4815
|
-
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,
|
|
4956
|
+
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);
|
|
4816
4957
|
} else {
|
|
4817
4958
|
if (l.length > 0 && l.lastIndexOf("/") === l.length - 1) {
|
|
4818
4959
|
"/" === 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));
|
|
4819
4960
|
let e = new XmlNode(a);
|
|
4820
|
-
a !== l && c && (e[":@"] = this.buildAttributesMap(l, i, a)), this.addChild(n, e, i,
|
|
4961
|
+
a !== l && c && (e[":@"] = this.buildAttributesMap(l, i, a)), this.addChild(n, e, i, p), i = i.substr(0, i.lastIndexOf("."));
|
|
4821
4962
|
} else {
|
|
4822
4963
|
let e = new XmlNode(a);
|
|
4823
|
-
this.tagsNodeStack.push(n), a !== l && c && (e[":@"] = this.buildAttributesMap(l, i, a)), this.addChild(n, e, i,
|
|
4964
|
+
this.tagsNodeStack.push(n), a !== l && c && (e[":@"] = this.buildAttributesMap(l, i, a)), this.addChild(n, e, i, p), n = e;
|
|
4824
4965
|
}
|
|
4825
4966
|
r = "", o = d;
|
|
4826
4967
|
}
|
|
@@ -5192,7 +5333,7 @@ const iqiyiIdSchema = schemas_object({
|
|
|
5192
5333
|
entityId: schemas_string()
|
|
5193
5334
|
}), iqiyiEpisodeTabDataVideoSchema = schemas_object({
|
|
5194
5335
|
page_url: schemas_string(),
|
|
5195
|
-
short_display_name: schemas_string(),
|
|
5336
|
+
short_display_name: schemas_string().optional(),
|
|
5196
5337
|
title: schemas_string(),
|
|
5197
5338
|
mark_type_show: schemas_int().optional()
|
|
5198
5339
|
}).transform((e)=>({
|
|
@@ -5202,19 +5343,26 @@ const iqiyiIdSchema = schemas_object({
|
|
|
5202
5343
|
let n = e.page_url.match(/v_(\S+)\.html/);
|
|
5203
5344
|
return null != (t = null == n ? void 0 : n[1]) ? t : "";
|
|
5204
5345
|
}
|
|
5205
|
-
})),
|
|
5346
|
+
})), safeParseVideo = (e)=>{
|
|
5347
|
+
let t = iqiyiEpisodeTabDataVideoSchema.safeParse(e);
|
|
5348
|
+
return t.success ? t.data : (console.warn("\u7231\u5947\u827A: \u89E3\u6790\u5206\u96C6\u6570\u636E\u65F6\u53D1\u751F\u9519\u8BEF:", t.error.format(), e), null);
|
|
5349
|
+
}, iqiyiTvTabDataSchema = schemas_object({
|
|
5206
5350
|
data: schemas_array(schemas_object({
|
|
5207
5351
|
videos: schemas_object({
|
|
5208
|
-
feature_paged: record(schemas_string(), schemas_array(unknown().transform((e)=>{
|
|
5209
|
-
let t = iqiyiEpisodeTabDataVideoSchema.safeParse(e);
|
|
5210
|
-
return t.success || 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(t.error), e), t.data;
|
|
5211
|
-
}))).optional().transform((e)=>compact(Object.values(null != e ? e : {}).flat()))
|
|
5352
|
+
feature_paged: record(schemas_string(), schemas_array(unknown().transform((e)=>safeParseVideo(e)))).optional().transform((e)=>compact(Object.values(null != e ? e : {}).flat()))
|
|
5212
5353
|
}).optional()
|
|
5213
5354
|
}).transform((e)=>{
|
|
5214
5355
|
var t;
|
|
5215
5356
|
return null == (t = e.videos) ? void 0 : t.feature_paged;
|
|
5216
5357
|
})).transform((e)=>compact(e.flat()))
|
|
5217
|
-
}),
|
|
5358
|
+
}), iqiyiMovieTabDataSchema = schemas_object({
|
|
5359
|
+
data: schemas_object({
|
|
5360
|
+
videos: schemas_array(unknown().transform((e)=>safeParseVideo(e)))
|
|
5361
|
+
}).transform((e)=>compact(e.videos))
|
|
5362
|
+
}), iqiyiEpisodeTabDataSchema = union([
|
|
5363
|
+
iqiyiTvTabDataSchema,
|
|
5364
|
+
iqiyiMovieTabDataSchema
|
|
5365
|
+
]), iqiyiV3ApiResponseSchema = schemas_object({
|
|
5218
5366
|
status_code: schemas_number(),
|
|
5219
5367
|
data: schemas_object({
|
|
5220
5368
|
base_data: schemas_object({
|
|
@@ -5334,35 +5482,35 @@ class IqiyiScraper extends BaseScraper {
|
|
|
5334
5482
|
};
|
|
5335
5483
|
t.sign = this.createSign(t);
|
|
5336
5484
|
try {
|
|
5337
|
-
var n, r, i, o, s, a, u, l
|
|
5485
|
+
var n, r, i, o, s, a, u, l;
|
|
5338
5486
|
let e = (await this.fetch.get("https://www.iqiyi.com/prelw/tvg/v2/lw/base_info", {
|
|
5339
5487
|
params: t,
|
|
5340
5488
|
schema: iqiyiV3ApiResponseSchema
|
|
5341
|
-
})).data,
|
|
5489
|
+
})).data, c = null != (o = null == e || null == (i = e.data) || null == (r = i.base_data) || null == (n = r.video_list) ? void 0 : n.map((e)=>({
|
|
5342
5490
|
provider: this.providerName,
|
|
5343
5491
|
episodeId: e.tv_id.toString(),
|
|
5344
5492
|
episodeTitle: e.name,
|
|
5345
5493
|
episodeNumber: e.order,
|
|
5346
5494
|
url: e.play_url
|
|
5347
5495
|
}))) ? o : [];
|
|
5348
|
-
if (!
|
|
5349
|
-
let t = null == e || null == (
|
|
5496
|
+
if (!c.length) {
|
|
5497
|
+
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);
|
|
5350
5498
|
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), [];
|
|
5351
|
-
let o = this.getEpisodeBlacklistPattern(),
|
|
5499
|
+
let o = this.getEpisodeBlacklistPattern(), d = 1;
|
|
5352
5500
|
for (let e of r.data){
|
|
5353
5501
|
if (17 === e.mark_type_show) continue;
|
|
5354
5502
|
let t = this.videoIdToEntityId(e.videoId);
|
|
5355
|
-
t && (null != o && o.test(e.title) || (
|
|
5503
|
+
t && (null != o && o.test(e.title) || (c.push({
|
|
5356
5504
|
provider: this.providerName,
|
|
5357
5505
|
episodeId: this.generateIdString({
|
|
5358
5506
|
entityId: t
|
|
5359
5507
|
}),
|
|
5360
5508
|
episodeTitle: e.title,
|
|
5361
|
-
episodeNumber: null != (
|
|
5362
|
-
}),
|
|
5509
|
+
episodeNumber: e.short_display_name && null != (l = this.getEpisodeIndexFromTitle(e.short_display_name)) ? l : d
|
|
5510
|
+
}), d += 1));
|
|
5363
5511
|
}
|
|
5364
5512
|
}
|
|
5365
|
-
return
|
|
5513
|
+
return c;
|
|
5366
5514
|
} catch (e) {
|
|
5367
5515
|
return console.error(`\u{7231}\u{5947}\u{827A} (v3): \u{83B7}\u{53D6}\u{5206}\u{96C6}\u{65F6}\u{53D1}\u{751F}\u{9519}\u{8BEF}: ${e}`), [];
|
|
5368
5516
|
}
|
|
@@ -5608,7 +5756,7 @@ class TencentScraper extends BaseScraper {
|
|
|
5608
5756
|
});
|
|
5609
5757
|
}
|
|
5610
5758
|
}
|
|
5611
|
-
var enc_utf8 = __webpack_require__(
|
|
5759
|
+
var enc_utf8 = __webpack_require__(60), enc_utf8_default = __webpack_require__.n(enc_utf8);
|
|
5612
5760
|
function youku_define_property(e, t, n) {
|
|
5613
5761
|
return t in e ? Object.defineProperty(e, t, {
|
|
5614
5762
|
value: n,
|
|
@@ -5689,8 +5837,8 @@ class YoukuScraper extends BaseScraper {
|
|
|
5689
5837
|
if (d) return [
|
|
5690
5838
|
n(d, u)
|
|
5691
5839
|
];
|
|
5692
|
-
let
|
|
5693
|
-
length:
|
|
5840
|
+
let f = Number(null != (i = null == o ? void 0 : o.total) ? i : 0), p = Math.max(1, Math.ceil(f / a)), h = Array.from({
|
|
5841
|
+
length: p
|
|
5694
5842
|
}, (e, t)=>t + 1).filter((e)=>e !== l), m = [];
|
|
5695
5843
|
for (let e of h){
|
|
5696
5844
|
await this.sleep(500);
|
|
@@ -6015,12 +6163,13 @@ class scrapers_Scraper {
|
|
|
6015
6163
|
});
|
|
6016
6164
|
}
|
|
6017
6165
|
}
|
|
6166
|
+
const widgetVersion = "0.0.14";
|
|
6018
6167
|
WidgetMetadata = {
|
|
6019
6168
|
id: "baranwang.danmu.universe",
|
|
6020
6169
|
title: "\u901A\u7528\u5F39\u5E55",
|
|
6021
6170
|
description: "\u901A\u7528\u5F39\u5E55\u63D2\u4EF6\uFF0C\u652F\u6301\u817E\u8BAF\u3001\u4F18\u9177\u3001\u7231\u5947\u827A\u3001\u54D4\u54E9\u54D4\u54E9\u7B49\u5E73\u53F0",
|
|
6022
6171
|
author: "Baran",
|
|
6023
|
-
version:
|
|
6172
|
+
version: widgetVersion,
|
|
6024
6173
|
site: "https://github.com/baranwang/forward-widgets/tree/main/packages/danmu-universe",
|
|
6025
6174
|
requiredVersion: "0.0.2",
|
|
6026
6175
|
modules: [
|
|
@@ -6058,11 +6207,13 @@ const src_scraper = new scrapers_Scraper();
|
|
|
6058
6207
|
searchDanmu = async (e)=>{
|
|
6059
6208
|
var t;
|
|
6060
6209
|
storage.cleanup();
|
|
6061
|
-
let { tmdbId: n, type: r,
|
|
6062
|
-
if (!n) return
|
|
6063
|
-
|
|
6210
|
+
let { tmdbId: n, type: r, season: i, episode: o } = e;
|
|
6211
|
+
if (!n) return {
|
|
6212
|
+
animes: []
|
|
6213
|
+
};
|
|
6214
|
+
let s = await getDoubanInfoByTmdbId(r, n, i);
|
|
6064
6215
|
return {
|
|
6065
|
-
animes: (await src_scraper.getDetailWithDoubanId(null != (t = null ==
|
|
6216
|
+
animes: (await src_scraper.getDetailWithDoubanId(null != (t = null == s ? void 0 : s.doubanId) ? t : "", r, o)).map((e)=>{
|
|
6066
6217
|
let t = `[${PROVIDER_NAMES[e.provider]}] `;
|
|
6067
6218
|
return e.episodeTitle && (t += e.episodeTitle), {
|
|
6068
6219
|
animeId: e.episodeId,
|
|
@@ -6072,25 +6223,25 @@ searchDanmu = async (e)=>{
|
|
|
6072
6223
|
};
|
|
6073
6224
|
}, getDetail = async (e)=>{
|
|
6074
6225
|
var t;
|
|
6075
|
-
let { animeId: n, tmdbId: r, type: i,
|
|
6226
|
+
let { animeId: n, tmdbId: r, type: i, season: o, episode: s } = e;
|
|
6076
6227
|
if (!r && !n) return null;
|
|
6077
|
-
if (n) return src_scraper.getDetailWithAnimeId(n.toString(), i,
|
|
6078
|
-
let
|
|
6079
|
-
return src_scraper.getDetailWithDoubanId(null != (t = null ==
|
|
6228
|
+
if (n) return src_scraper.getDetailWithAnimeId(n.toString(), i, s);
|
|
6229
|
+
let a = await getDoubanInfoByTmdbId(i, null != r ? r : "", o);
|
|
6230
|
+
return src_scraper.getDetailWithDoubanId(null != (t = null == a ? void 0 : a.doubanId) ? t : "", i, s);
|
|
6080
6231
|
}, getComments = async (e)=>{
|
|
6081
|
-
let { animeId: t, commentId: n, segmentTime: r, tmdbId: i, type: o,
|
|
6082
|
-
if (!
|
|
6083
|
-
var
|
|
6232
|
+
let { animeId: t, commentId: n, segmentTime: r, tmdbId: i, type: o, season: s, episode: a } = e, u = null != n ? n : t;
|
|
6233
|
+
if (!u) {
|
|
6234
|
+
var l;
|
|
6084
6235
|
if (!i) return null;
|
|
6085
|
-
let e = await getDoubanInfoByTmdbId(o, i);
|
|
6086
|
-
|
|
6236
|
+
let e = await getDoubanInfoByTmdbId(o, i, s);
|
|
6237
|
+
u = (await src_scraper.getDetailWithDoubanId(null != (l = null == e ? void 0 : e.doubanId) ? l : "", o, a)).map((e)=>[
|
|
6087
6238
|
e.provider,
|
|
6088
6239
|
e.episodeId
|
|
6089
6240
|
].join(":")).join(",");
|
|
6090
6241
|
}
|
|
6091
|
-
let
|
|
6242
|
+
let c = await src_scraper.getDanmuWithSegmentTimeByVideoId(u.toString(), r);
|
|
6092
6243
|
return {
|
|
6093
|
-
comments:
|
|
6094
|
-
count:
|
|
6244
|
+
comments: c,
|
|
6245
|
+
count: c.length
|
|
6095
6246
|
};
|
|
6096
6247
|
};
|