@qxs-bns/utils 0.0.2 → 0.0.4
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/index.cjs +1 -1
- package/index.js +2 -2
- package/package.json +1 -4
- package/src/device.cjs +1 -1
- package/src/device.js +20 -17
- package/src/file-operations.cjs +1 -1
- package/src/file-operations.js +56 -51
- package/types/index.d.ts +10 -7
- package/vendor/ali-oss/dist/aliyun-oss-sdk.js.cjs +83 -0
- package/vendor/ali-oss/dist/aliyun-oss-sdk.js.js +20175 -0
- package/lib/aliyun-upload-sdk-1.5.6.min.cjs +0 -6
- package/lib/aliyun-upload-sdk-1.5.6.min.js +0 -1986
- /package/{_virtual/aliyun-oss-sdk.cjs → vendor/ali-oss/dist/aliyun-oss-sdk.js?commonjs-module.cjs} +0 -0
- /package/{_virtual/aliyun-oss-sdk.js → vendor/ali-oss/dist/aliyun-oss-sdk.js?commonjs-module.js} +0 -0
|
@@ -1,1986 +0,0 @@
|
|
|
1
|
-
(function(H) {
|
|
2
|
-
function E(_) {
|
|
3
|
-
if (A[_]) return A[_].exports;
|
|
4
|
-
var k = A[_] = { i: _, l: !1, exports: {} };
|
|
5
|
-
return H[_].call(k.exports, k, k.exports, E), k.l = !0, k.exports;
|
|
6
|
-
}
|
|
7
|
-
var A = {};
|
|
8
|
-
E.m = H, E.c = A, E.d = function(_, k, R) {
|
|
9
|
-
E.o(_, k) || Object.defineProperty(_, k, { configurable: !1, enumerable: !0, get: R });
|
|
10
|
-
}, E.n = function(_) {
|
|
11
|
-
var k = _ && _.__esModule ? function() {
|
|
12
|
-
return _.default;
|
|
13
|
-
} : function() {
|
|
14
|
-
return _;
|
|
15
|
-
};
|
|
16
|
-
return E.d(k, "a", k), k;
|
|
17
|
-
}, E.o = function(_, k) {
|
|
18
|
-
return Object.prototype.hasOwnProperty.call(_, k);
|
|
19
|
-
}, E.p = "", E(E.s = 13);
|
|
20
|
-
})([function(H, E, A) {
|
|
21
|
-
(function(_) {
|
|
22
|
-
(function(k, R) {
|
|
23
|
-
H.exports = E = R();
|
|
24
|
-
})(0, function() {
|
|
25
|
-
var k = k || function(R, r) {
|
|
26
|
-
var c;
|
|
27
|
-
if (typeof window != "undefined" && window.crypto && (c = window.crypto), typeof self != "undefined" && self.crypto && (c = self.crypto), typeof globalThis != "undefined" && globalThis.crypto && (c = globalThis.crypto), !c && typeof window != "undefined" && window.msCrypto && (c = window.msCrypto), !c && _ !== void 0 && _.crypto && (c = _.crypto), !c) try {
|
|
28
|
-
c = A(28);
|
|
29
|
-
} catch (y) {
|
|
30
|
-
}
|
|
31
|
-
var d = function() {
|
|
32
|
-
if (c) {
|
|
33
|
-
if (typeof c.getRandomValues == "function") try {
|
|
34
|
-
return c.getRandomValues(new Uint32Array(1))[0];
|
|
35
|
-
} catch (y) {
|
|
36
|
-
}
|
|
37
|
-
if (typeof c.randomBytes == "function") try {
|
|
38
|
-
return c.randomBytes(4).readInt32LE();
|
|
39
|
-
} catch (y) {
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
throw new Error("Native crypto module could not be used to get secure random number.");
|
|
43
|
-
}, u = Object.create || /* @__PURE__ */ function() {
|
|
44
|
-
function y() {
|
|
45
|
-
}
|
|
46
|
-
return function(S) {
|
|
47
|
-
var M;
|
|
48
|
-
return y.prototype = S, M = new y(), y.prototype = null, M;
|
|
49
|
-
};
|
|
50
|
-
}(), o = {}, i = o.lib = {}, a = i.Base = /* @__PURE__ */ function() {
|
|
51
|
-
return { extend: function(y) {
|
|
52
|
-
var S = u(this);
|
|
53
|
-
return y && S.mixIn(y), S.hasOwnProperty("init") && this.init !== S.init || (S.init = function() {
|
|
54
|
-
S.$super.init.apply(this, arguments);
|
|
55
|
-
}), S.init.prototype = S, S.$super = this, S;
|
|
56
|
-
}, create: function() {
|
|
57
|
-
var y = this.extend();
|
|
58
|
-
return y.init.apply(y, arguments), y;
|
|
59
|
-
}, init: function() {
|
|
60
|
-
}, mixIn: function(y) {
|
|
61
|
-
for (var S in y) y.hasOwnProperty(S) && (this[S] = y[S]);
|
|
62
|
-
y.hasOwnProperty("toString") && (this.toString = y.toString);
|
|
63
|
-
}, clone: function() {
|
|
64
|
-
return this.init.prototype.extend(this);
|
|
65
|
-
} };
|
|
66
|
-
}(), h = i.WordArray = a.extend({ init: function(y, S) {
|
|
67
|
-
y = this.words = y || [], this.sigBytes = S != null ? S : 4 * y.length;
|
|
68
|
-
}, toString: function(y) {
|
|
69
|
-
return (y || m).stringify(this);
|
|
70
|
-
}, concat: function(y) {
|
|
71
|
-
var S = this.words, M = y.words, L = this.sigBytes, z = y.sigBytes;
|
|
72
|
-
if (this.clamp(), L % 4) for (var V = 0; V < z; V++) {
|
|
73
|
-
var q = M[V >>> 2] >>> 24 - V % 4 * 8 & 255;
|
|
74
|
-
S[L + V >>> 2] |= q << 24 - (L + V) % 4 * 8;
|
|
75
|
-
}
|
|
76
|
-
else for (var W = 0; W < z; W += 4) S[L + W >>> 2] = M[W >>> 2];
|
|
77
|
-
return this.sigBytes += z, this;
|
|
78
|
-
}, clamp: function() {
|
|
79
|
-
var y = this.words, S = this.sigBytes;
|
|
80
|
-
y[S >>> 2] &= 4294967295 << 32 - S % 4 * 8, y.length = R.ceil(S / 4);
|
|
81
|
-
}, clone: function() {
|
|
82
|
-
var y = a.clone.call(this);
|
|
83
|
-
return y.words = this.words.slice(0), y;
|
|
84
|
-
}, random: function(y) {
|
|
85
|
-
for (var S = [], M = 0; M < y; M += 4) S.push(d());
|
|
86
|
-
return new h.init(S, y);
|
|
87
|
-
} }), l = o.enc = {}, m = l.Hex = { stringify: function(y) {
|
|
88
|
-
for (var S = y.words, M = y.sigBytes, L = [], z = 0; z < M; z++) {
|
|
89
|
-
var V = S[z >>> 2] >>> 24 - z % 4 * 8 & 255;
|
|
90
|
-
L.push((V >>> 4).toString(16)), L.push((15 & V).toString(16));
|
|
91
|
-
}
|
|
92
|
-
return L.join("");
|
|
93
|
-
}, parse: function(y) {
|
|
94
|
-
for (var S = y.length, M = [], L = 0; L < S; L += 2) M[L >>> 3] |= parseInt(y.substr(L, 2), 16) << 24 - L % 8 * 4;
|
|
95
|
-
return new h.init(M, S / 2);
|
|
96
|
-
} }, p = l.Latin1 = { stringify: function(y) {
|
|
97
|
-
for (var S = y.words, M = y.sigBytes, L = [], z = 0; z < M; z++) {
|
|
98
|
-
var V = S[z >>> 2] >>> 24 - z % 4 * 8 & 255;
|
|
99
|
-
L.push(String.fromCharCode(V));
|
|
100
|
-
}
|
|
101
|
-
return L.join("");
|
|
102
|
-
}, parse: function(y) {
|
|
103
|
-
for (var S = y.length, M = [], L = 0; L < S; L++) M[L >>> 2] |= (255 & y.charCodeAt(L)) << 24 - L % 4 * 8;
|
|
104
|
-
return new h.init(M, S);
|
|
105
|
-
} }, w = l.Utf8 = { stringify: function(y) {
|
|
106
|
-
try {
|
|
107
|
-
return decodeURIComponent(escape(p.stringify(y)));
|
|
108
|
-
} catch (S) {
|
|
109
|
-
throw new Error("Malformed UTF-8 data");
|
|
110
|
-
}
|
|
111
|
-
}, parse: function(y) {
|
|
112
|
-
return p.parse(unescape(encodeURIComponent(y)));
|
|
113
|
-
} }, B = i.BufferedBlockAlgorithm = a.extend({ reset: function() {
|
|
114
|
-
this._data = new h.init(), this._nDataBytes = 0;
|
|
115
|
-
}, _append: function(y) {
|
|
116
|
-
typeof y == "string" && (y = w.parse(y)), this._data.concat(y), this._nDataBytes += y.sigBytes;
|
|
117
|
-
}, _process: function(y) {
|
|
118
|
-
var S, M = this._data, L = M.words, z = M.sigBytes, V = this.blockSize, q = 4 * V, W = z / q;
|
|
119
|
-
W = y ? R.ceil(W) : R.max((0 | W) - this._minBufferSize, 0);
|
|
120
|
-
var s = W * V, g = R.min(4 * s, z);
|
|
121
|
-
if (s) {
|
|
122
|
-
for (var b = 0; b < s; b += V) this._doProcessBlock(L, b);
|
|
123
|
-
S = L.splice(0, s), M.sigBytes -= g;
|
|
124
|
-
}
|
|
125
|
-
return new h.init(S, g);
|
|
126
|
-
}, clone: function() {
|
|
127
|
-
var y = a.clone.call(this);
|
|
128
|
-
return y._data = this._data.clone(), y;
|
|
129
|
-
}, _minBufferSize: 0 }), I = (i.Hasher = B.extend({ cfg: a.extend(), init: function(y) {
|
|
130
|
-
this.cfg = this.cfg.extend(y), this.reset();
|
|
131
|
-
}, reset: function() {
|
|
132
|
-
B.reset.call(this), this._doReset();
|
|
133
|
-
}, update: function(y) {
|
|
134
|
-
return this._append(y), this._process(), this;
|
|
135
|
-
}, finalize: function(y) {
|
|
136
|
-
return y && this._append(y), this._doFinalize();
|
|
137
|
-
}, blockSize: 16, _createHelper: function(y) {
|
|
138
|
-
return function(S, M) {
|
|
139
|
-
return new y.init(M).finalize(S);
|
|
140
|
-
};
|
|
141
|
-
}, _createHmacHelper: function(y) {
|
|
142
|
-
return function(S, M) {
|
|
143
|
-
return new I.HMAC.init(y, M).finalize(S);
|
|
144
|
-
};
|
|
145
|
-
} }), o.algo = {});
|
|
146
|
-
return o;
|
|
147
|
-
}(Math);
|
|
148
|
-
return k;
|
|
149
|
-
});
|
|
150
|
-
}).call(E, A(4));
|
|
151
|
-
}, function(H, E, A) {
|
|
152
|
-
function _(r, c) {
|
|
153
|
-
if (!(r instanceof c)) throw new TypeError("Cannot call a class as a function");
|
|
154
|
-
}
|
|
155
|
-
Object.defineProperty(E, "__esModule", { value: !0 });
|
|
156
|
-
var k = /* @__PURE__ */ function() {
|
|
157
|
-
function r(c, d) {
|
|
158
|
-
for (var u = 0; u < d.length; u++) {
|
|
159
|
-
var o = d[u];
|
|
160
|
-
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(c, o.key, o);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
return function(c, d, u) {
|
|
164
|
-
return d && r(c.prototype, d), u && r(c, u), c;
|
|
165
|
-
};
|
|
166
|
-
}(), R = function() {
|
|
167
|
-
function r() {
|
|
168
|
-
_(this, r);
|
|
169
|
-
}
|
|
170
|
-
return k(r, null, [{ key: "detectIEVersion", value: function() {
|
|
171
|
-
for (var c = 4, d = document.createElement("div"), u = d.getElementsByTagName("i"); d.innerHTML = "<!--[if gt IE " + c + "]><i></i><![endif]-->", u[0]; ) c++;
|
|
172
|
-
return c > 4 && c;
|
|
173
|
-
} }, { key: "extend", value: function(c, d) {
|
|
174
|
-
for (var u in d) Object.prototype.hasOwnProperty.call(d, u) && d[u] && (c[u] = d[u]);
|
|
175
|
-
} }, { key: "isArray", value: function(c) {
|
|
176
|
-
return Object.prototype.toString.call(arg) === "[object Array]";
|
|
177
|
-
} }, { key: "getFileType", value: function(c) {
|
|
178
|
-
return c = c.toLowerCase(), /.mp4|.flv|.m3u8|.avi|.rm|.rmvb|.mpeg|.mpg|.mov|.wmv|.3gp|.asf|.dat|.dv|.f4v|.gif|.m2t|.m4v|.mj2|.mjpeg|.mpe|.mts|.ogg|.qt|.swf|.ts|.vob|.wmv|.webm/.test(c) ? "video" : /.mp3|.wav|.ape|.cda|.au|.midi|.mac|.aac|.ac3|.acm|.amr|.caf|.flac|.m4a|.ra|.wma/.test(c) ? "audio" : /.bmp|.jpg|.jpeg|.png/.test(c) ? "img" : "other";
|
|
179
|
-
} }, { key: "isImage", value: function(c) {
|
|
180
|
-
return c = c.toLowerCase(), !!/.jpg|.jpeg|.png/.test(c);
|
|
181
|
-
} }, { key: "ISODateString", value: function(c) {
|
|
182
|
-
function d(u) {
|
|
183
|
-
return u < 10 ? "0" + u : u;
|
|
184
|
-
}
|
|
185
|
-
return c.getUTCFullYear() + "-" + d(c.getUTCMonth() + 1) + "-" + d(c.getUTCDate()) + "T" + d(c.getUTCHours()) + ":" + d(c.getUTCMinutes()) + ":" + d(c.getUTCSeconds()) + "Z";
|
|
186
|
-
} }, { key: "isIntNum", value: function(c) {
|
|
187
|
-
return !!/^\d+$/.test(c);
|
|
188
|
-
} }]), r;
|
|
189
|
-
}();
|
|
190
|
-
E.default = R;
|
|
191
|
-
}, function(H, E, A) {
|
|
192
|
-
(function(_, k) {
|
|
193
|
-
H.exports = k(A(0));
|
|
194
|
-
})(0, function(_) {
|
|
195
|
-
return function(k) {
|
|
196
|
-
function R(p, w, B, I, y, S, M) {
|
|
197
|
-
var L = p + (w & B | ~w & I) + y + M;
|
|
198
|
-
return (L << S | L >>> 32 - S) + w;
|
|
199
|
-
}
|
|
200
|
-
function r(p, w, B, I, y, S, M) {
|
|
201
|
-
var L = p + (w & I | B & ~I) + y + M;
|
|
202
|
-
return (L << S | L >>> 32 - S) + w;
|
|
203
|
-
}
|
|
204
|
-
function c(p, w, B, I, y, S, M) {
|
|
205
|
-
var L = p + (w ^ B ^ I) + y + M;
|
|
206
|
-
return (L << S | L >>> 32 - S) + w;
|
|
207
|
-
}
|
|
208
|
-
function d(p, w, B, I, y, S, M) {
|
|
209
|
-
var L = p + (B ^ (w | ~I)) + y + M;
|
|
210
|
-
return (L << S | L >>> 32 - S) + w;
|
|
211
|
-
}
|
|
212
|
-
var u = _, o = u.lib, i = o.WordArray, a = o.Hasher, h = u.algo, l = [];
|
|
213
|
-
(function() {
|
|
214
|
-
for (var p = 0; p < 64; p++) l[p] = 4294967296 * k.abs(k.sin(p + 1)) | 0;
|
|
215
|
-
})();
|
|
216
|
-
var m = h.MD5 = a.extend({ _doReset: function() {
|
|
217
|
-
this._hash = new i.init([1732584193, 4023233417, 2562383102, 271733878]);
|
|
218
|
-
}, _doProcessBlock: function(p, w) {
|
|
219
|
-
for (var B = 0; B < 16; B++) {
|
|
220
|
-
var I = w + B, y = p[I];
|
|
221
|
-
p[I] = 16711935 & (y << 8 | y >>> 24) | 4278255360 & (y << 24 | y >>> 8);
|
|
222
|
-
}
|
|
223
|
-
var S = this._hash.words, M = p[w + 0], L = p[w + 1], z = p[w + 2], V = p[w + 3], q = p[w + 4], W = p[w + 5], s = p[w + 6], g = p[w + 7], b = p[w + 8], P = p[w + 9], x = p[w + 10], F = p[w + 11], j = p[w + 12], N = p[w + 13], K = p[w + 14], X = p[w + 15], O = S[0], D = S[1], U = S[2], C = S[3];
|
|
224
|
-
O = R(O, D, U, C, M, 7, l[0]), C = R(C, O, D, U, L, 12, l[1]), U = R(U, C, O, D, z, 17, l[2]), D = R(D, U, C, O, V, 22, l[3]), O = R(O, D, U, C, q, 7, l[4]), C = R(C, O, D, U, W, 12, l[5]), U = R(U, C, O, D, s, 17, l[6]), D = R(D, U, C, O, g, 22, l[7]), O = R(O, D, U, C, b, 7, l[8]), C = R(C, O, D, U, P, 12, l[9]), U = R(U, C, O, D, x, 17, l[10]), D = R(D, U, C, O, F, 22, l[11]), O = R(O, D, U, C, j, 7, l[12]), C = R(C, O, D, U, N, 12, l[13]), U = R(U, C, O, D, K, 17, l[14]), D = R(D, U, C, O, X, 22, l[15]), O = r(O, D, U, C, L, 5, l[16]), C = r(C, O, D, U, s, 9, l[17]), U = r(U, C, O, D, F, 14, l[18]), D = r(D, U, C, O, M, 20, l[19]), O = r(O, D, U, C, W, 5, l[20]), C = r(C, O, D, U, x, 9, l[21]), U = r(U, C, O, D, X, 14, l[22]), D = r(D, U, C, O, q, 20, l[23]), O = r(O, D, U, C, P, 5, l[24]), C = r(C, O, D, U, K, 9, l[25]), U = r(U, C, O, D, V, 14, l[26]), D = r(D, U, C, O, b, 20, l[27]), O = r(O, D, U, C, N, 5, l[28]), C = r(C, O, D, U, z, 9, l[29]), U = r(U, C, O, D, g, 14, l[30]), D = r(D, U, C, O, j, 20, l[31]), O = c(O, D, U, C, W, 4, l[32]), C = c(C, O, D, U, b, 11, l[33]), U = c(U, C, O, D, F, 16, l[34]), D = c(D, U, C, O, K, 23, l[35]), O = c(O, D, U, C, L, 4, l[36]), C = c(C, O, D, U, q, 11, l[37]), U = c(U, C, O, D, g, 16, l[38]), D = c(D, U, C, O, x, 23, l[39]), O = c(O, D, U, C, N, 4, l[40]), C = c(C, O, D, U, M, 11, l[41]), U = c(U, C, O, D, V, 16, l[42]), D = c(D, U, C, O, s, 23, l[43]), O = c(O, D, U, C, P, 4, l[44]), C = c(C, O, D, U, j, 11, l[45]), U = c(U, C, O, D, X, 16, l[46]), D = c(D, U, C, O, z, 23, l[47]), O = d(O, D, U, C, M, 6, l[48]), C = d(C, O, D, U, g, 10, l[49]), U = d(U, C, O, D, K, 15, l[50]), D = d(D, U, C, O, W, 21, l[51]), O = d(O, D, U, C, j, 6, l[52]), C = d(C, O, D, U, V, 10, l[53]), U = d(U, C, O, D, x, 15, l[54]), D = d(D, U, C, O, L, 21, l[55]), O = d(O, D, U, C, b, 6, l[56]), C = d(C, O, D, U, X, 10, l[57]), U = d(U, C, O, D, s, 15, l[58]), D = d(D, U, C, O, N, 21, l[59]), O = d(O, D, U, C, q, 6, l[60]), C = d(C, O, D, U, F, 10, l[61]), U = d(U, C, O, D, z, 15, l[62]), D = d(D, U, C, O, P, 21, l[63]), S[0] = S[0] + O | 0, S[1] = S[1] + D | 0, S[2] = S[2] + U | 0, S[3] = S[3] + C | 0;
|
|
225
|
-
}, _doFinalize: function() {
|
|
226
|
-
var p = this._data, w = p.words, B = 8 * this._nDataBytes, I = 8 * p.sigBytes;
|
|
227
|
-
w[I >>> 5] |= 128 << 24 - I % 32;
|
|
228
|
-
var y = k.floor(B / 4294967296), S = B;
|
|
229
|
-
w[15 + (I + 64 >>> 9 << 4)] = 16711935 & (y << 8 | y >>> 24) | 4278255360 & (y << 24 | y >>> 8), w[14 + (I + 64 >>> 9 << 4)] = 16711935 & (S << 8 | S >>> 24) | 4278255360 & (S << 24 | S >>> 8), p.sigBytes = 4 * (w.length + 1), this._process();
|
|
230
|
-
for (var M = this._hash, L = M.words, z = 0; z < 4; z++) {
|
|
231
|
-
var V = L[z];
|
|
232
|
-
L[z] = 16711935 & (V << 8 | V >>> 24) | 4278255360 & (V << 24 | V >>> 8);
|
|
233
|
-
}
|
|
234
|
-
return M;
|
|
235
|
-
}, clone: function() {
|
|
236
|
-
var p = a.clone.call(this);
|
|
237
|
-
return p._hash = this._hash.clone(), p;
|
|
238
|
-
} });
|
|
239
|
-
u.MD5 = a._createHelper(m), u.HmacMD5 = a._createHmacHelper(m);
|
|
240
|
-
}(Math), _.MD5;
|
|
241
|
-
});
|
|
242
|
-
}, function(H, E, A) {
|
|
243
|
-
Object.defineProperty(E, "__esModule", { value: !0 }), E.UPLOADSTATE = { INIT: "init", UPLOADING: "uploading", COMPLETE: "complete", INTERRUPT: "interrupt" }, E.UPLOADSTEP = { INIT: "init", PART: "part", COMPLETE: "complete" }, E.UPLOADDEFAULT = { PARALLEL: 5, PARTSIZE: 1048576 };
|
|
244
|
-
}, function(H, E) {
|
|
245
|
-
var A;
|
|
246
|
-
A = /* @__PURE__ */ function() {
|
|
247
|
-
return this;
|
|
248
|
-
}();
|
|
249
|
-
try {
|
|
250
|
-
A = A || Function("return this")() || (0, eval)("this");
|
|
251
|
-
} catch (_) {
|
|
252
|
-
typeof window == "object" && (A = window);
|
|
253
|
-
}
|
|
254
|
-
H.exports = A;
|
|
255
|
-
}, function(H, E, A) {
|
|
256
|
-
function _(m) {
|
|
257
|
-
return m && m.__esModule ? m : { default: m };
|
|
258
|
-
}
|
|
259
|
-
function k(m, p) {
|
|
260
|
-
if (!(m instanceof p)) throw new TypeError("Cannot call a class as a function");
|
|
261
|
-
}
|
|
262
|
-
Object.defineProperty(E, "__esModule", { value: !0 });
|
|
263
|
-
var R = /* @__PURE__ */ function() {
|
|
264
|
-
function m(p, w) {
|
|
265
|
-
for (var B = 0; B < w.length; B++) {
|
|
266
|
-
var I = w[B];
|
|
267
|
-
I.enumerable = I.enumerable || !1, I.configurable = !0, "value" in I && (I.writable = !0), Object.defineProperty(p, I.key, I);
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
return function(p, w, B) {
|
|
271
|
-
return w && m(p.prototype, w), B && m(p, B), p;
|
|
272
|
-
};
|
|
273
|
-
}(), r = A(6), c = _(r), d = A(25), u = _(d), o = A(7), i = _(o), a = A(8), h = _(a), l = function() {
|
|
274
|
-
function m(p) {
|
|
275
|
-
k(this, m);
|
|
276
|
-
var w = h.default.os.name, B = h.default.os.version || "", I = h.default.browser.name, y = h.default.browser.version || "", S = window.location.href, M = "";
|
|
277
|
-
S && (M = h.default.getHost(S));
|
|
278
|
-
var L = "pc";
|
|
279
|
-
h.default.os.ipad ? L = "pad" : (h.default.os.iphone || h.default.os.android) && (L = "phone"), this._ri = c.default.create(), this.initParam = { APIVersion: "0.6.0", lv: "1", av: i.default.version, pd: "upload", sm: "upload", md: "uploader", uuid: m.getUuid(), os: w, ov: B, et: I, ev: y, uat: navigator.userAgent, app_n: M, tt: L, dm: "h5", ut: "" };
|
|
280
|
-
}
|
|
281
|
-
return R(m, [{ key: "log", value: function(p, w) {
|
|
282
|
-
w && w.ri ? (this._ri = w.ri, delete w.ri) : this._ri = c.default.create(), w && w.ut && (this.initParam.ut = w.ut, delete w.ut), this.initParam.t = (/* @__PURE__ */ new Date()).getTime(), this.initParam.ll = p == "20006" ? "error" : "info", this.initParam.ri = this._ri, this.initParam.e = p;
|
|
283
|
-
var B = [];
|
|
284
|
-
if (w) for (var I in w) B.push(I + "=" + w[I]);
|
|
285
|
-
var y = B.join("&");
|
|
286
|
-
this.initParam.args = encodeURIComponent(y == "" ? "0" : y);
|
|
287
|
-
var S = [];
|
|
288
|
-
for (var I in this.initParam) S.push(I + "=" + this.initParam[I]);
|
|
289
|
-
var M = S.join("&");
|
|
290
|
-
AliyunUpload && AliyunUpload.__logTestCallback__ ? AliyunUpload.__logTestCallback__(M) : new Image(0, 0).src = "https://videocloud.cn-hangzhou.log.aliyuncs.com/logstores/upload/track?" + M;
|
|
291
|
-
} }], [{ key: "getUuid", value: function() {
|
|
292
|
-
var p = u.default.get("p_h5_upload_u");
|
|
293
|
-
return p || (p = c.default.create(), u.default.set("p_h5_upload_u", p, 730)), p;
|
|
294
|
-
} }, { key: "getClientId", value: function() {
|
|
295
|
-
return u.default.get("p_h5_upload_clientId");
|
|
296
|
-
} }, { key: "setClientId", value: function(p) {
|
|
297
|
-
return p || (p = c.default.create()), u.default.set("p_h5_upload_clientId", p, 730), p;
|
|
298
|
-
} }]), m;
|
|
299
|
-
}();
|
|
300
|
-
E.default = l;
|
|
301
|
-
}, function(H, E, A) {
|
|
302
|
-
function _(r, c) {
|
|
303
|
-
if (!(r instanceof c)) throw new TypeError("Cannot call a class as a function");
|
|
304
|
-
}
|
|
305
|
-
Object.defineProperty(E, "__esModule", { value: !0 });
|
|
306
|
-
var k = /* @__PURE__ */ function() {
|
|
307
|
-
function r(c, d) {
|
|
308
|
-
for (var u = 0; u < d.length; u++) {
|
|
309
|
-
var o = d[u];
|
|
310
|
-
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(c, o.key, o);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
return function(c, d, u) {
|
|
314
|
-
return d && r(c.prototype, d), u && r(c, u), c;
|
|
315
|
-
};
|
|
316
|
-
}(), R = function() {
|
|
317
|
-
function r() {
|
|
318
|
-
_(this, r);
|
|
319
|
-
}
|
|
320
|
-
return k(r, null, [{ key: "create", value: function(c, d) {
|
|
321
|
-
var u, o = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), i = [];
|
|
322
|
-
if (d = d || o.length, c) for (u = 0; u < c; u++) i[u] = o[0 | Math.random() * d];
|
|
323
|
-
else {
|
|
324
|
-
var a;
|
|
325
|
-
for (i[8] = i[13] = i[18] = i[23] = "-", i[14] = "4", u = 0; u < 36; u++) i[u] || (a = 0 | 16 * Math.random(), i[u] = o[u == 19 ? 3 & a | 8 : a]);
|
|
326
|
-
}
|
|
327
|
-
return i.join("");
|
|
328
|
-
} }]), r;
|
|
329
|
-
}();
|
|
330
|
-
E.default = R;
|
|
331
|
-
}, function(H, E, A) {
|
|
332
|
-
Object.defineProperty(E, "__esModule", { value: !0 });
|
|
333
|
-
var _ = { version: "1.5.0" };
|
|
334
|
-
E.default = _;
|
|
335
|
-
}, function(H, E, A) {
|
|
336
|
-
function _(o, i) {
|
|
337
|
-
if (!(o instanceof i)) throw new TypeError("Cannot call a class as a function");
|
|
338
|
-
}
|
|
339
|
-
Object.defineProperty(E, "__esModule", { value: !0 });
|
|
340
|
-
var k = /* @__PURE__ */ function() {
|
|
341
|
-
function o(i, a) {
|
|
342
|
-
for (var h = 0; h < a.length; h++) {
|
|
343
|
-
var l = a[h];
|
|
344
|
-
l.enumerable = l.enumerable || !1, l.configurable = !0, "value" in l && (l.writable = !0), Object.defineProperty(i, l.key, l);
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
return function(i, a, h) {
|
|
348
|
-
return a && o(i.prototype, a), h && o(i, h), i;
|
|
349
|
-
};
|
|
350
|
-
}(), R = function(o) {
|
|
351
|
-
var i = navigator.userAgent, a = "other";
|
|
352
|
-
if (o.ios) return "iOS";
|
|
353
|
-
if (o.android) return "android";
|
|
354
|
-
if (i.indexOf("Baiduspider") > -1) return "Baiduspider";
|
|
355
|
-
if (i.indexOf("PlayStation") > -1) return "PS4";
|
|
356
|
-
var h = navigator.platform == "Win32" || navigator.platform == "Windows" || i.indexOf("Windows") > -1, l = navigator.platform == "Mac68K" || navigator.platform == "MacPPC" || navigator.platform == "Macintosh" || navigator.platform == "MacIntel";
|
|
357
|
-
return l && (a = "macOS"), navigator.platform == "X11" && !h && !l && (a = "Unix"), String(navigator.platform).indexOf("Linux") > -1 && (a = "Linux"), h ? "windows" : a;
|
|
358
|
-
}, r = function() {
|
|
359
|
-
var o = navigator.userAgent, i = "";
|
|
360
|
-
return (o.indexOf("Windows NT 5.0") > -1 || o.indexOf("Windows 2000") > -1) && (i = "2000"), (o.indexOf("Windows NT 5.1") > -1 || o.indexOf("Windows XP") > -1) && (i = "XP"), (o.indexOf("Windows NT 5.2") > -1 || o.indexOf("Windows 2003") > -1) && (i = "2003"), (o.indexOf("Windows NT 6.0") > -1 || o.indexOf("Windows Vista") > -1) && (i = "Vista"), (o.indexOf("Windows NT 6.1") > -1 || o.indexOf("Windows 7") > -1) && (i = "7"), (o.indexOf("Windows NT 6.2") > -1 || o.indexOf("Windows 8") > -1) && (i = "8"), (o.indexOf("Windows NT 6.3") > -1 || o.indexOf("Windows 8.1") > -1) && (i = "8.1"), (o.indexOf("Windows NT 10") > -1 || o.indexOf("Windows 10") > -1) && (i = "10"), i;
|
|
361
|
-
}, c = function(o) {
|
|
362
|
-
var i = navigator.userAgent.toLowerCase();
|
|
363
|
-
return o.chrome ? "Chrome" : o.firefox ? "Firefox" : o.safari ? "Safari" : o.webview ? "webview" : o.ie ? /edge/.test(i) ? "Edge" : "IE" : /baiduspider/.test(i) ? "Baiduspider" : /ucweb/.test(i) || /UCBrowser/.test(i) ? "UC" : /opera/.test(i) ? "Opera" : /ucweb/.test(i) ? "UC" : /360se/.test(i) ? "360浏览器" : /bidubrowser/.test(i) ? "百度浏览器" : /metasr/.test(i) ? "搜狗浏览器" : /lbbrowser/.test(i) ? "猎豹浏览器" : /micromessenger/.test(i) ? "微信内置浏览器" : /qqbrowser/.test(i) ? "QQ浏览器" : /playstation/.test(i) ? "PS4浏览器" : void 0;
|
|
364
|
-
}, d = function() {
|
|
365
|
-
var o = {}, i = {}, a = navigator.userAgent, h = navigator.platform, l = a.match(/Web[kK]it[\/]{0,1}([\d.]+)/), m = a.match(/(Android);?[\s\/]+([\d.]+)?/), p = !!a.match(/\(Macintosh\; Intel /), w = a.match(/(iPad).*OS\s([\d_]+)/), B = a.match(/(iPod)(.*OS\s([\d_]+))?/), I = !w && a.match(/(iPhone\sOS)\s([\d_]+)/), y = a.match(/(webOS|hpwOS)[\s\/]([\d.]+)/), S = /Win\d{2}|Windows/.test(h), M = a.match(/Windows Phone ([\d.]+)/), L = y && a.match(/TouchPad/), z = a.match(/Kindle\/([\d.]+)/), V = a.match(/Silk\/([\d._]+)/), q = a.match(/(BlackBerry).*Version\/([\d.]+)/), W = a.match(/(BB10).*Version\/([\d.]+)/), s = a.match(/(RIM\sTablet\sOS)\s([\d.]+)/), g = a.match(/PlayBook/), b = a.match(/Chrome\/([\d.]+)/) || a.match(/CriOS\/([\d.]+)/), P = a.match(/Firefox\/([\d.]+)/), x = a.match(/\((?:Mobile|Tablet); rv:([\d.]+)\).*Firefox\/[\d.]+/), F = a.match(/MSIE\s([\d.]+)/) || a.match(/Trident\/[\d](?=[^\?]+).*rv:([0-9.].)/), j = !b && a.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/), N = j || a.match(/Version\/([\d.]+)([^S](Safari)|[^M]*(Mobile)[^S]*(Safari))/);
|
|
366
|
-
if ((i.webkit = !!l) && (i.version = l[1]), m && (o.android = !0, o.version = m[2]), I && !B && (o.ios = o.iphone = !0, o.version = I[2].replace(/_/g, ".")), w && (o.ios = o.ipad = !0, o.version = w[2].replace(/_/g, ".")), B && (o.ios = o.ipod = !0, o.version = B[3] ? B[3].replace(/_/g, ".") : null), M && (o.wp = !0, o.version = M[1]), y && (o.webos = !0, o.version = y[2]), L && (o.touchpad = !0), q && (o.blackberry = !0, o.version = q[2]), W && (o.bb10 = !0, o.version = W[2]), s && (o.rimtabletos = !0, o.version = s[2]), g && (i.playbook = !0), z && (o.kindle = !0, o.version = z[1]), V && (i.silk = !0, i.version = V[1]), !V && o.android && a.match(/Kindle Fire/) && (i.silk = !0), b && (i.chrome = !0, i.version = b[1]), P && (i.firefox = !0, i.version = P[1]), x && (o.firefoxos = !0, o.version = x[1]), F && (i.ie = !0, i.version = F[1]), N && (p || o.ios || S || m) && (i.safari = !0, o.ios || (i.version = N[1])), j && (i.webview = !0), p) {
|
|
367
|
-
var K = a.match(/[\d]*_[\d]*_[\d]*/);
|
|
368
|
-
K && K.length > 0 && K[0] && (o.version = K[0].replace(/_/g, "."));
|
|
369
|
-
}
|
|
370
|
-
return o.tablet = !!(w || g || m && !a.match(/Mobile/) || P && a.match(/Tablet/) || F && !a.match(/Phone/) && a.match(/Touch/)), o.phone = !(o.tablet || o.ipod || !(m || I || y || q || W || b && a.match(/Android/) || b && a.match(/CriOS\/([\d.]+)/) || P && a.match(/Mobile/) || F && a.match(/Touch/))), o.pc = !o.tablet && !o.phone, p ? o.name = "macOS" : S ? (o.name = "windows", o.version = r()) : o.name = R(o), i.name = c(i), { os: o, browser: i };
|
|
371
|
-
}(), u = function() {
|
|
372
|
-
function o() {
|
|
373
|
-
_(this, o);
|
|
374
|
-
}
|
|
375
|
-
return k(o, null, [{ key: "getHost", value: function(i) {
|
|
376
|
-
var l = "";
|
|
377
|
-
if (i === void 0 || i == null || i == "") return "";
|
|
378
|
-
var a = i.indexOf("//"), h = i;
|
|
379
|
-
a > -1 && (h = i.substring(a + 2));
|
|
380
|
-
var l = h, m = h.split("/");
|
|
381
|
-
return m && m.length > 0 && (l = m[0]), m = l.split(":"), m && m.length > 0 && (l = m[0]), l;
|
|
382
|
-
} }, { key: "os", get: function() {
|
|
383
|
-
return d.os;
|
|
384
|
-
} }, { key: "browser", get: function() {
|
|
385
|
-
var i = d.browser;
|
|
386
|
-
return i.name || (i.name = c()), i;
|
|
387
|
-
} }]), o;
|
|
388
|
-
}();
|
|
389
|
-
E.default = u;
|
|
390
|
-
}, function(H, E, A) {
|
|
391
|
-
function _(r, c) {
|
|
392
|
-
if (!(r instanceof c)) throw new TypeError("Cannot call a class as a function");
|
|
393
|
-
}
|
|
394
|
-
Object.defineProperty(E, "__esModule", { value: !0 });
|
|
395
|
-
var k = /* @__PURE__ */ function() {
|
|
396
|
-
function r(c, d) {
|
|
397
|
-
for (var u = 0; u < d.length; u++) {
|
|
398
|
-
var o = d[u];
|
|
399
|
-
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(c, o.key, o);
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
return function(c, d, u) {
|
|
403
|
-
return d && r(c.prototype, d), u && r(c, u), c;
|
|
404
|
-
};
|
|
405
|
-
}(), R = function() {
|
|
406
|
-
function r() {
|
|
407
|
-
_(this, r);
|
|
408
|
-
}
|
|
409
|
-
return k(r, null, [{ key: "get", value: function(c, d, u, o, i) {
|
|
410
|
-
var a;
|
|
411
|
-
u = u || function() {
|
|
412
|
-
}, typeof XMLHttpRequest == "undefined" && (window.XMLHttpRequest = function() {
|
|
413
|
-
try {
|
|
414
|
-
return new window.ActiveXObject("Msxml2.XMLHTTP.6.0");
|
|
415
|
-
} catch (h) {
|
|
416
|
-
}
|
|
417
|
-
try {
|
|
418
|
-
return new window.ActiveXObject("Msxml2.XMLHTTP.3.0");
|
|
419
|
-
} catch (h) {
|
|
420
|
-
}
|
|
421
|
-
try {
|
|
422
|
-
return new window.ActiveXObject("Msxml2.XMLHTTP");
|
|
423
|
-
} catch (h) {
|
|
424
|
-
}
|
|
425
|
-
throw new Error("This browser does not support XMLHttpRequest.");
|
|
426
|
-
}), a = new XMLHttpRequest(), a.onreadystatechange = function() {
|
|
427
|
-
a.readyState === 4 && (a.status === 200 ? d(a.responseText) : u(a.responseText));
|
|
428
|
-
};
|
|
429
|
-
try {
|
|
430
|
-
o === void 0 && (o = !0), a.open("GET", c, o), i && (a.withCredentials = !0);
|
|
431
|
-
} catch (h) {
|
|
432
|
-
return void u(h);
|
|
433
|
-
}
|
|
434
|
-
try {
|
|
435
|
-
a.send();
|
|
436
|
-
} catch (h) {
|
|
437
|
-
u(h);
|
|
438
|
-
}
|
|
439
|
-
} }, { key: "post", value: function(c, d, u, o, i, a) {
|
|
440
|
-
var h;
|
|
441
|
-
u = u || function() {
|
|
442
|
-
}, typeof XMLHttpRequest == "undefined" && (window.XMLHttpRequest = function() {
|
|
443
|
-
try {
|
|
444
|
-
return new window.ActiveXObject("Msxml2.XMLHTTP.6.0");
|
|
445
|
-
} catch (l) {
|
|
446
|
-
}
|
|
447
|
-
try {
|
|
448
|
-
return new window.ActiveXObject("Msxml2.XMLHTTP.3.0");
|
|
449
|
-
} catch (l) {
|
|
450
|
-
}
|
|
451
|
-
try {
|
|
452
|
-
return new window.ActiveXObject("Msxml2.XMLHTTP");
|
|
453
|
-
} catch (l) {
|
|
454
|
-
}
|
|
455
|
-
throw new Error("This browser does not support XMLHttpRequest.");
|
|
456
|
-
}), h = new XMLHttpRequest(), h.onreadystatechange = function() {
|
|
457
|
-
h.readyState === 4 && (h.status === 200 ? d(h.responseText) : u(h.responseText));
|
|
458
|
-
};
|
|
459
|
-
try {
|
|
460
|
-
i === void 0 && (i = !0), h.open("POST", c, i), a && (h.withCredentials = !0);
|
|
461
|
-
} catch (l) {
|
|
462
|
-
return void u(l);
|
|
463
|
-
}
|
|
464
|
-
h.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
|
465
|
-
try {
|
|
466
|
-
h.send(o);
|
|
467
|
-
} catch (l) {
|
|
468
|
-
u(l);
|
|
469
|
-
}
|
|
470
|
-
} }]), r;
|
|
471
|
-
}();
|
|
472
|
-
E.default = R;
|
|
473
|
-
}, function(H, E, A) {
|
|
474
|
-
function _(d, u) {
|
|
475
|
-
if (!(d instanceof u)) throw new TypeError("Cannot call a class as a function");
|
|
476
|
-
}
|
|
477
|
-
Object.defineProperty(E, "__esModule", { value: !0 });
|
|
478
|
-
var k = /* @__PURE__ */ function() {
|
|
479
|
-
function d(u, o) {
|
|
480
|
-
for (var i = 0; i < o.length; i++) {
|
|
481
|
-
var a = o[i];
|
|
482
|
-
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(u, a.key, a);
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
return function(u, o, i) {
|
|
486
|
-
return o && d(u.prototype, o), i && d(u, i), u;
|
|
487
|
-
};
|
|
488
|
-
}(), R = A(27), r = A(31), c = (A(11), function() {
|
|
489
|
-
function d() {
|
|
490
|
-
_(this, d);
|
|
491
|
-
}
|
|
492
|
-
return k(d, null, [{ key: "randomUUID", value: function() {
|
|
493
|
-
for (var u = [], o = "0123456789abcdef", i = 0; i < 36; i++) u[i] = o.substr(Math.floor(16 * Math.random()), 1);
|
|
494
|
-
return u[14] = "4", u[19] = o.substr(3 & u[19] | 8, 1), u[8] = u[13] = u[18] = u[23] = "-", u.join("");
|
|
495
|
-
} }, { key: "aliyunEncodeURI", value: function(u) {
|
|
496
|
-
var o = encodeURIComponent(u);
|
|
497
|
-
return o = o.replace(/\+/g, "%20").replace(/\*/g, "%2A").replace(/%7E/g, "~").replace(/!/g, "%21").replace(/\(/g, "%28").replace(/\)/g, "%29").replace(/'/g, "%27");
|
|
498
|
-
} }, { key: "makeUTF8sort", value: function(u, o, i) {
|
|
499
|
-
if (!u) throw new Error("PrismPlayer Error: vid should not be null!");
|
|
500
|
-
var a = [];
|
|
501
|
-
for (var h in u) a.push(h);
|
|
502
|
-
for (var l = a.sort(), m = "", p = l.length, h = 0; h < p; h++) {
|
|
503
|
-
var w = d.aliyunEncodeURI(l[h]), B = d.aliyunEncodeURI(u[l[h]]);
|
|
504
|
-
m == "" ? m = w + o + B : m += i + w + o + B;
|
|
505
|
-
}
|
|
506
|
-
return m;
|
|
507
|
-
} }, { key: "makeChangeSiga", value: function(u, o) {
|
|
508
|
-
if (!u) throw new Error("PrismPlayer Error: vid should not be null!");
|
|
509
|
-
return r.stringify(R("GET&" + d.aliyunEncodeURI("/") + "&" + d.aliyunEncodeURI(d.makeUTF8sort(u, "=", "&")), o + "&"));
|
|
510
|
-
} }]), d;
|
|
511
|
-
}());
|
|
512
|
-
E.default = c;
|
|
513
|
-
}, function(H, E, A) {
|
|
514
|
-
(function(_, k) {
|
|
515
|
-
H.exports = k(A(0));
|
|
516
|
-
})(0, function(_) {
|
|
517
|
-
return _.enc.Utf8;
|
|
518
|
-
});
|
|
519
|
-
}, function(H, E, A) {
|
|
520
|
-
(function(_, k) {
|
|
521
|
-
H.exports = k(A(0));
|
|
522
|
-
})(0, function(_) {
|
|
523
|
-
return _.enc.Hex;
|
|
524
|
-
});
|
|
525
|
-
}, function(H, E, A) {
|
|
526
|
-
H.exports = A(14);
|
|
527
|
-
}, function(H, E, A) {
|
|
528
|
-
var _, k, R = A(15), r = function(d) {
|
|
529
|
-
return d && d.__esModule ? d : { default: d };
|
|
530
|
-
}(R), c = { Vod: r.default };
|
|
531
|
-
_ = [], (k = function() {
|
|
532
|
-
return c;
|
|
533
|
-
}.apply(E, _)) !== void 0 && (H.exports = k), FileReader.prototype.readAsBinaryString || (FileReader.prototype.readAsBinaryString = function(d) {
|
|
534
|
-
var u = "", o = this, i = new FileReader();
|
|
535
|
-
i.onload = function(a) {
|
|
536
|
-
for (var h = new Uint8Array(i.result), l = h.byteLength, m = 0; m < l; m++) u += String.fromCharCode(h[m]);
|
|
537
|
-
o.content = u, o.onload();
|
|
538
|
-
}, i.readAsArrayBuffer(d);
|
|
539
|
-
}), window.AliyunUpload = c;
|
|
540
|
-
}, function(H, E, A) {
|
|
541
|
-
function _(W) {
|
|
542
|
-
return W && W.__esModule ? W : { default: W };
|
|
543
|
-
}
|
|
544
|
-
function k(W, s) {
|
|
545
|
-
if (!(W instanceof s)) throw new TypeError("Cannot call a class as a function");
|
|
546
|
-
}
|
|
547
|
-
Object.defineProperty(E, "__esModule", { value: !0 });
|
|
548
|
-
var R = /* @__PURE__ */ function() {
|
|
549
|
-
function W(s, g) {
|
|
550
|
-
for (var b = 0; b < g.length; b++) {
|
|
551
|
-
var P = g[b];
|
|
552
|
-
P.enumerable = P.enumerable || !1, P.configurable = !0, "value" in P && (P.writable = !0), Object.defineProperty(s, P.key, P);
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
return function(s, g, b) {
|
|
556
|
-
return g && W(s.prototype, g), b && W(s, b), s;
|
|
557
|
-
};
|
|
558
|
-
}(), r = A(16), c = A(3), d = A(17), u = _(d), o = A(19), i = _(o), a = A(24), h = _(a), l = A(5), m = _(l), p = A(1), w = _(p), B = A(6), I = _(B), y = A(26), S = _(y), M = A(32), L = _(M), z = A(33), V = _(z), q = (A(2), function() {
|
|
559
|
-
function W(s) {
|
|
560
|
-
k(this, W), this.options = s, this.options.partSize = this.options.partSize || c.UPLOADDEFAULT.PARTSIZE, this.options.parallel = this.options.parallel || c.UPLOADDEFAULT.PARALLEL, this.options.region = this.options.region || "cn-shanghai", this.options.cname = this.options.cname || !1, this.options.localCheckpoint = this.options.localCheckpoint || !1, this.options.enableUploadProgress = this.options.enableUploadProgress || !0, this._ossCreditor = new Object(), this._state = r.VODSTATE.INIT, this._uploadList = [], this._curIndex = -1, this._ossUpload = null, this._log = new m.default(), this._retryCount = 0, this._retryTotal = this.options.retryCount || 3, this._retryDuration = this.options.retryDuration || 2, this._state = r.VODSTATE.INIT, this._uploadWay = "vod", this._onbeforeunload = !1, this._invalidUserId = !1, this._initEvent();
|
|
561
|
-
}
|
|
562
|
-
return R(W, [{ key: "init", value: function(s, g, b, P) {
|
|
563
|
-
return this._retryCount = 0, !(b && !P || !b && P) && !(s && !g || !s && g) && (this._ossCreditor.accessKeyId = s, this._ossCreditor.accessKeySecret = g, this._ossCreditor.securityToken = b, this._ossCreditor.expireTime = P, !0);
|
|
564
|
-
} }, { key: "addFile", value: function(s, g, b, P, x, F) {
|
|
565
|
-
if (!s) return !1;
|
|
566
|
-
if (s.size == 0) try {
|
|
567
|
-
this.options.onUploadFailed({ file: s }, "EmptyFile", "文件大小为0,不能上传");
|
|
568
|
-
} catch (X) {
|
|
569
|
-
}
|
|
570
|
-
for (var j = (this.options, 0); j < this._uploadList.length; j++) if (this._uploadList[j].file == s) return !1;
|
|
571
|
-
var N = new Object();
|
|
572
|
-
if (N.file = s, N._endpoint = g, N._bucket = b, N._object = P, N.state = r.UPLOADSTATE.INIT, N.isImage = w.default.isImage(s.name), x && (N.videoInfo = x ? JSON.parse(x).Vod : {}, N.userData = i.default.encode(x)), N.ri = I.default.create(), this._uploadList.push(N), !N.isImage && this.options.enableUploadProgress) {
|
|
573
|
-
var K = this;
|
|
574
|
-
V.default.getMd5(s, function(X, O) {
|
|
575
|
-
N.fileHash = X, N.fileMd5 = O;
|
|
576
|
-
var D = K._getCheckoutpoint(N);
|
|
577
|
-
K.options.localCheckpoint || D ? K.addFileCallback(N) : K._getCheckoutpointFromCloud(N, function(U) {
|
|
578
|
-
if (U.UploadPoint) {
|
|
579
|
-
var C = JSON.parse(U.UploadPoint);
|
|
580
|
-
C.loaded != 1 && (N.checkpoint = C.checkpoint, N.loaded = C.loaded, N.videoId = U.VideoId, K._saveCheckoutpoint(N, C.checkpoint));
|
|
581
|
-
}
|
|
582
|
-
K.addFileCallback(N);
|
|
583
|
-
}, function(U) {
|
|
584
|
-
try {
|
|
585
|
-
if ((U = JSON.parse(U)) && U.Code == "InvalidParameter" && U.Message.indexOf("UserId") > 0) {
|
|
586
|
-
K._invalidUserId = !0;
|
|
587
|
-
var C = U.Message + ",正确账号ID(userId)请参考:https://help.aliyun.com/knowledge_detail/37196.html";
|
|
588
|
-
}
|
|
589
|
-
} catch (ie) {
|
|
590
|
-
}
|
|
591
|
-
});
|
|
592
|
-
});
|
|
593
|
-
} else this.addFileCallback(N);
|
|
594
|
-
} }, { key: "addFileCallback", value: function(s) {
|
|
595
|
-
this._reportLog("20001", s, { ql: this._uploadList.length });
|
|
596
|
-
try {
|
|
597
|
-
this.options.addFileSuccess && this.options.addFileSuccess(s);
|
|
598
|
-
} catch (g) {
|
|
599
|
-
}
|
|
600
|
-
return !0;
|
|
601
|
-
} }, { key: "deleteFile", value: function(s) {
|
|
602
|
-
return !!this.cancelFile(s) && (this._uploadList.splice(s, 1), !0);
|
|
603
|
-
} }, { key: "cleanList", value: function() {
|
|
604
|
-
this.stopUpload(), this._uploadList.length = 0, this._curIndex = -1;
|
|
605
|
-
} }, { key: "cancelFile", value: function(s) {
|
|
606
|
-
if (this.options, s < 0 || s >= this._uploadList.length) return !1;
|
|
607
|
-
var g = this._uploadList[s];
|
|
608
|
-
if (s == this._curIndex && g.state == r.UPLOADSTATE.UPLOADING) {
|
|
609
|
-
g.state = r.UPLOADSTATE.CANCELED;
|
|
610
|
-
var b = this._getCheckoutpoint(g);
|
|
611
|
-
b && b.checkpoint && (b = b.checkpoint), b && this._ossUpload.cancel(), this._removeCheckoutpoint(g), this.nextUpload();
|
|
612
|
-
} else g.state != r.UPLOADSTATE.SUCCESS && (g.state = r.UPLOADSTATE.CANCELED);
|
|
613
|
-
return this._reportLog("20008", g), !0;
|
|
614
|
-
} }, { key: "resumeFile", value: function(s) {
|
|
615
|
-
if (this.options, s < 0 || s >= this._uploadList.length) return !1;
|
|
616
|
-
var g = this._uploadList[s];
|
|
617
|
-
return g.state == r.UPLOADSTATE.CANCELED && (g.state = r.UPLOADSTATE.INIT, !0);
|
|
618
|
-
} }, { key: "listFiles", value: function() {
|
|
619
|
-
return this._uploadList;
|
|
620
|
-
} }, { key: "getCheckpoint", value: function(s) {
|
|
621
|
-
return this._getCheckoutpoint({ file: s });
|
|
622
|
-
} }, { key: "startUpload", value: function(s) {
|
|
623
|
-
if (this._retryCount = 0, this.options, !(this._state == r.VODSTATE.START || this._state == r.VODSTATE.EXPIRE)) {
|
|
624
|
-
if (this._initState(), this._curIndex = this._findUploadIndex(), this._curIndex == -1) return void (this._state = r.VODSTATE.END);
|
|
625
|
-
var g = this._uploadList[this._curIndex];
|
|
626
|
-
this._ossUpload = null, this._upload(g), this._state = r.VODSTATE.START;
|
|
627
|
-
}
|
|
628
|
-
} }, { key: "nextUpload", value: function() {
|
|
629
|
-
var s = this.options;
|
|
630
|
-
if (this._state == r.VODSTATE.START) if (this._curIndex = this._findUploadIndex(), this._curIndex != -1) {
|
|
631
|
-
var g = this._uploadList[this._curIndex];
|
|
632
|
-
this._ossUpload = null, this._upload(g);
|
|
633
|
-
} else {
|
|
634
|
-
this._state = r.VODSTATE.END;
|
|
635
|
-
try {
|
|
636
|
-
s.onUploadEnd && s.onUploadEnd(g);
|
|
637
|
-
} catch (b) {
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
} }, { key: "clear", value: function(s) {
|
|
641
|
-
for (var g = this.options, b = 0, P = 0; P < this._uploadList.length; P++) g.uploadList[P].state == r.UPLOADSTATE.SUCCESS && b++, this._uploadList[P].state == s && (g.uploadList.splice(P, 1), P--);
|
|
642
|
-
g.onClear && g.onClear(g.uploadList.length, b);
|
|
643
|
-
} }, { key: "stopUpload", value: function() {
|
|
644
|
-
if ((this._state == r.VODSTATE.START || this._state == r.VODSTATE.FAILURE || this._curIndex == -1) && this._curIndex != -1) {
|
|
645
|
-
var s = this._uploadList[this._curIndex];
|
|
646
|
-
this._state = r.VODSTATE.STOP, s.state = r.UPLOADSTATE.STOPED, this._changeState(s, r.UPLOADSTATE.STOPED), this._ossUpload.cancel();
|
|
647
|
-
}
|
|
648
|
-
} }, { key: "resumeUploadWithAuth", value: function(s) {
|
|
649
|
-
var g = this;
|
|
650
|
-
if (!s) return !1;
|
|
651
|
-
var b = JSON.parse(i.default.decode(s));
|
|
652
|
-
return !!(b.AccessKeyId && b.AccessKeySecret && b.SecurityToken && b.Expiration) && g.resumeUploadWithToken(b.AccessKeyId, b.AccessKeySecret, b.SecurityToken, b.Expiration);
|
|
653
|
-
} }, { key: "resumeUploadWithToken", value: function(s, g, b, P) {
|
|
654
|
-
if (this.options, !(s && g && b && P) || this._state != r.VODSTATE.EXPIRE || this._curIndex == -1) return !1;
|
|
655
|
-
var x = "";
|
|
656
|
-
return this._uploadList.length > this._curIndex && (x = this._uploadList[this._curIndex]), x && (this.init(s, g, b, P), this._state = r.VODSTATE.START, this._ossUpload = null, this._uploadCore(x, x.retry), x.retry = !1), !0;
|
|
657
|
-
} }, { key: "resumeUploadWithSTSToken", value: function(s, g, b) {
|
|
658
|
-
if (this._curIndex == -1 || this._state != r.VODSTATE.EXPIRE) return !1;
|
|
659
|
-
if (this._uploadList.length > this._curIndex) {
|
|
660
|
-
var P = this._uploadList[this._curIndex];
|
|
661
|
-
P.object ? this._refreshSTSTokenUpload(P, s, g, b) : this.setSTSToken(P, s, g, b);
|
|
662
|
-
}
|
|
663
|
-
} }, { key: "setSTSTokenDirectlyUpload", value: function(s, g, b, P, x) {
|
|
664
|
-
if (!(g && b && P && x)) return !1;
|
|
665
|
-
this._ut = "oss";
|
|
666
|
-
var F = s;
|
|
667
|
-
this.init(g, b, P, x), F.endpoint = F._endpoint, F.bucket = F._bucket, F.object = F._object, this._ossUpload = null, this._uploadCore(F, s.retry), s.retry = !1;
|
|
668
|
-
} }, { key: "setSTSToken", value: function(s, g, b, P) {
|
|
669
|
-
if (!g || !b || !P) return !1;
|
|
670
|
-
this._ut = "vod", this._uploadWay = "sts";
|
|
671
|
-
var x = s.videoInfo, F = { accessKeyId: g, securityToken: P, accessKeySecret: b, fileName: s.file.name, title: x.Title, requestId: s.ri, region: this.options.region };
|
|
672
|
-
x.ImageType && (F.imageType = x.ImageType), x.ImageExt && (F.imageExt = x.ImageExt), x.FileSize && (F.fileSize = x.FileSize), x.Description && (F.description = x.Description), x.CateId && (F.cateId = x.CateId), x.Tags && (F.tags = x.Tags), x.TemplateGroupId && (F.templateGroupId = x.TemplateGroupId), x.StorageLocation && (F.storageLocation = x.StorageLocation), x.CoverURL && (F.coverUrl = x.CoverURL), x.TransCodeMode && (F.transCodeMode = x.TransCodeMode), x.UserData && (F.userData = x.UserData), x.WorkflowId && (F.WorkflowId = x.WorkflowId), x.AppId && (F.AppId = x.AppId);
|
|
673
|
-
var j = this, N = "getUploadAuth";
|
|
674
|
-
s.videoId ? (F.videoId = s.videoId, N = "refreshUploadAuth") : s.isImage && (N = "getImageUploadAuth"), S.default[N](F, function(K) {
|
|
675
|
-
s.videoId = K.VideoId ? K.VideoId : s.videoId, j.setUploadAuthAndAddress(s, K.UploadAuth, K.UploadAddress), j._state = r.VODSTATE.START;
|
|
676
|
-
}, function(K) {
|
|
677
|
-
j._error(s, { name: K.Code, code: K.Code, message: K.Message, requestId: K.RequestId });
|
|
678
|
-
});
|
|
679
|
-
} }, { key: "setUploadAuthAndAddress", value: function(s, g, b, P) {
|
|
680
|
-
if (!s || !g || !b) return !1;
|
|
681
|
-
var x = JSON.parse(i.default.decode(g));
|
|
682
|
-
if (!(x.AccessKeyId && x.AccessKeySecret && x.SecurityToken && x.Expiration)) return !1;
|
|
683
|
-
var F = {}, j = s;
|
|
684
|
-
if (b) {
|
|
685
|
-
if (F = JSON.parse(i.default.decode(b)), !F.Endpoint || !F.Bucket || !F.FileName) return !1;
|
|
686
|
-
} else F.Endpoint = j.endpoint, F.Bucket = j.bucket, F.FileName = j.object;
|
|
687
|
-
this._ut = "vod", this._uploadWay = "vod", this.options.region = x.Region || this.options.region, this.init(x.AccessKeyId, x.AccessKeySecret, x.SecurityToken, x.Expiration), j.endpoint = j._endpoint ? j._endpoint : F.Endpoint, j.bucket = j._bucket ? j._bucket : F.Bucket, j.object = j._object ? j._object : F.FileName, j.region = this.options.region, P && (j.videoId = P), this._ossUpload = null, this._uploadCore(j, s.retry), s.retry = !1;
|
|
688
|
-
} }, { key: "_refreshSTSTokenUpload", value: function(s, g, b, P) {
|
|
689
|
-
if (!g || !b || !P) return !1;
|
|
690
|
-
var x = { accessKeyId: g, securityToken: P, accessKeySecret: b, videoId: s.object, requestId: s.ri, region: this.options.region }, F = this, j = "refreshUploadAuth";
|
|
691
|
-
s.isImage && (j = "getImageUploadAuth"), S.default[j](x, function(N) {
|
|
692
|
-
F.setUploadAuthAndAddress(s, N.UploadAuth, UploadAddress), F._state = r.VODSTATE.START;
|
|
693
|
-
}, function(N) {
|
|
694
|
-
F._error(s, { name: N.Code, code: N.Code, message: N.Message, requestId: N.RequestId });
|
|
695
|
-
});
|
|
696
|
-
} }, { key: "_upload", value: function(s) {
|
|
697
|
-
var g = arguments.length > 1 && arguments[1] !== void 0 && arguments[1], b = this.options;
|
|
698
|
-
if (s.retry = g, b.onUploadstarted && !g) try {
|
|
699
|
-
var P = this._getCheckoutpoint(s);
|
|
700
|
-
P && P.state != r.UPLOADSTATE.UPLOADING && (s.checkpoint = P, s.videoId = P.videoId), b.onUploadstarted(s);
|
|
701
|
-
} catch (x) {
|
|
702
|
-
}
|
|
703
|
-
} }, { key: "_uploadCore", value: function(s) {
|
|
704
|
-
if (!this._ossCreditor.accessKeyId || !this._ossCreditor.accessKeySecret || !this._ossCreditor.securityToken) throw new Error("AccessKeyId、AccessKeySecret、securityToken should not be null");
|
|
705
|
-
if (s.state = r.UPLOADSTATE.UPLOADING, !this._ossUpload) {
|
|
706
|
-
s.endpoint = s.endpoint || "http://oss-cn-hangzhou.aliyuncs.com";
|
|
707
|
-
var g = this;
|
|
708
|
-
this._ossUpload = new u.default({ bucket: s.bucket, endpoint: s.endpoint, AccessKeyId: this._ossCreditor.accessKeyId, AccessKeySecret: this._ossCreditor.accessKeySecret, SecurityToken: this._ossCreditor.securityToken, timeout: this.options.timeout, cname: this.options.cname }, { onerror: function(K, X) {
|
|
709
|
-
g._error.call(g, K, X);
|
|
710
|
-
}, oncomplete: function(K, X) {
|
|
711
|
-
g._complete.call(g, K, X);
|
|
712
|
-
}, onprogress: function(K, X, O) {
|
|
713
|
-
g._progress.call(g, K, X, O);
|
|
714
|
-
} });
|
|
715
|
-
}
|
|
716
|
-
var b = w.default.getFileType(s.file.name), P = this._getCheckoutpoint(s), x = "", F = "";
|
|
717
|
-
P && P.checkpoint && (F = P.state, x = P.videoId, P = P.checkpoint), P && x == s.videoId && F != r.UPLOADSTATE.UPLOADING && (P.file = s.file, s.checkpoint = P, P.uploadId);
|
|
718
|
-
var j = this._adjustPartSize(s);
|
|
719
|
-
this._reportLog("20002", s, { ft: b, fs: s.file.size, bu: s.bucket, ok: s.object, vid: s.videoId || "", fn: s.file.name, fw: null, fh: null, ps: j });
|
|
720
|
-
var N = { headers: { "x-oss-notification": s.userData ? s.userData : "", "x-oss-md5": s.fileMd5 ? s.fileMd5 : "" }, partSize: j, parallel: this.options.parallel };
|
|
721
|
-
this._ossUpload.upload(s, N);
|
|
722
|
-
} }, { key: "_findUploadIndex", value: function() {
|
|
723
|
-
for (var s = -1, g = 0; g < this._uploadList.length; g++) if (this._uploadList[g].state == r.UPLOADSTATE.INIT) {
|
|
724
|
-
s = g;
|
|
725
|
-
break;
|
|
726
|
-
}
|
|
727
|
-
return s;
|
|
728
|
-
} }, { key: "_error", value: function(s, g) {
|
|
729
|
-
if (g.name == "cancel") try {
|
|
730
|
-
this.options.onUploadCanceled(s, g);
|
|
731
|
-
} catch (P) {
|
|
732
|
-
}
|
|
733
|
-
else {
|
|
734
|
-
if (g.message.indexOf("InvalidAccessKeyIdError") > 0 || g.name == "SignatureDoesNotMatchError" || g.code == "SecurityTokenExpired" || g.code == "InvalidSecurityToken.Expired" || g.code == "InvalidAccessKeyId" && this._ossCreditor.securityToken) {
|
|
735
|
-
if (this.options.onUploadTokenExpired) {
|
|
736
|
-
this._state = r.VODSTATE.EXPIRE, s.state = r.UPLOADSTATE.FAIlURE;
|
|
737
|
-
try {
|
|
738
|
-
this.options.onUploadTokenExpired(s, g);
|
|
739
|
-
} catch (P) {
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
return;
|
|
743
|
-
}
|
|
744
|
-
if ((g.name == "RequestTimeoutError" || g.name == "ConnectionTimeout" || g.name == "ConnectionTimeoutError") && this._retryTotal > this._retryCount) {
|
|
745
|
-
var b = this;
|
|
746
|
-
return setTimeout(function() {
|
|
747
|
-
b._uploadCore(s, !0);
|
|
748
|
-
}, 1e3 * b._retryDuration), void this._retryCount++;
|
|
749
|
-
}
|
|
750
|
-
g.name == "NoSuchUploadError" ? this._removeCheckoutpoint(s) : g.name == "abort" && (this._removeCheckoutpoint(s), this.options.onUploadFailed(s, "OSSAbort", "由于 OSS Abort 上传中止")), this._handleError(s, g);
|
|
751
|
-
}
|
|
752
|
-
} }, { key: "_handleError", value: function(s, g) {
|
|
753
|
-
var b = !(arguments.length > 2 && arguments[2] !== void 0) || arguments[2], P = r.UPLOADSTATE.FAIlURE;
|
|
754
|
-
if (s.state != r.UPLOADSTATE.CANCELED && (s.state = r.UPLOADSTATE.FAIlURE, this._state = r.VODSTATE.FAILURE, this.options.onUploadFailed && g && g.code && g.message)) try {
|
|
755
|
-
this.options.onUploadFailed(s, g.code, g.message);
|
|
756
|
-
} catch (F) {
|
|
757
|
-
}
|
|
758
|
-
if (b && this._changeState(s, P), this._reportLog("20006", s, { code: g.name, message: g.message, requestId: g.requestId, fs: s.file.size, bu: s.bucket, ok: s.object, fn: s.file.name }), this._reportLog("20004", s, { requestId: g.requestId, fs: s.file.size, bu: s.bucket, ok: s.object, fn: s.file.name }), s.ri = I.default.create(), this._findUploadIndex() != -1) {
|
|
759
|
-
var x = this;
|
|
760
|
-
this._state = r.VODSTATE.START, setTimeout(function() {
|
|
761
|
-
x.nextUpload();
|
|
762
|
-
}, 100);
|
|
763
|
-
}
|
|
764
|
-
} }, { key: "_complete", value: function(s, g) {
|
|
765
|
-
if (s.state = r.UPLOADSTATE.SUCCESS, this.options.onUploadSucceed) try {
|
|
766
|
-
this.options.onUploadSucceed(s);
|
|
767
|
-
} catch (x) {
|
|
768
|
-
}
|
|
769
|
-
var b = 0;
|
|
770
|
-
g && g.res && g.res.headers && (b = g.res.headers["x-oss-request-id"]), this._removeCheckoutpoint(s);
|
|
771
|
-
var P = this;
|
|
772
|
-
setTimeout(function() {
|
|
773
|
-
P.nextUpload();
|
|
774
|
-
}, 100), this._retryCount = 0, this._reportLog("20003", s, { requestId: b });
|
|
775
|
-
} }, { key: "_progress", value: function(s, g, b) {
|
|
776
|
-
if (this.options.onUploadProgress) try {
|
|
777
|
-
s.loaded = g.loaded, this.options.onUploadProgress(s, g.total, g.loaded);
|
|
778
|
-
} catch (X) {
|
|
779
|
-
}
|
|
780
|
-
var P = g.checkpoint, x = 0;
|
|
781
|
-
P && !this._onbeforeunload && (s.checkpoint = P, this._saveCheckoutpoint(s, P, r.UPLOADSTATE.UPLOADING), x = P.uploadId), this._retryCount = 0;
|
|
782
|
-
var F = this._getPortNumber(P), j = 0;
|
|
783
|
-
if (b && b.headers && (j = b.headers["x-oss-request-id"]), g.loaded != 0 && this._reportLog("20007", s, { pn: F, requestId: j }), g.loaded != 1 && this._reportLog("20005", s, { UploadId: x, pn: F + 1, pr: s.retry ? 1 : 0, fs: s.file.size, bu: s.bucket, ok: s.object, fn: s.file.name }), !this._invalidUserId && !s.isImage && this._ut == "vod" && this.options.enableUploadProgress) {
|
|
784
|
-
var N = { file: s.file, checkpoint: g, userId: this.options.userId, videoId: s.videoId, region: this.options.region, fileHash: s.fileHash };
|
|
785
|
-
try {
|
|
786
|
-
var K = this;
|
|
787
|
-
L.default.upload(N, function() {
|
|
788
|
-
}, function(X) {
|
|
789
|
-
if ((X = JSON.parse(X)) && X.Code == "InvalidParameter" && X.Message.indexOf("UserId") > 0) {
|
|
790
|
-
K._invalidUserId = !0;
|
|
791
|
-
var O = X.Message + ",正确账号ID(userId)请参考:https://help.aliyun.com/knowledge_detail/37196.html";
|
|
792
|
-
}
|
|
793
|
-
});
|
|
794
|
-
} catch (X) {
|
|
795
|
-
}
|
|
796
|
-
}
|
|
797
|
-
} }, { key: "_getPortNumber", value: function(s) {
|
|
798
|
-
if (s) {
|
|
799
|
-
var g = s.doneParts;
|
|
800
|
-
if (g && g.length > 0) return g[g.length - 1].number;
|
|
801
|
-
}
|
|
802
|
-
return 0;
|
|
803
|
-
} }, { key: "_removeCheckoutpoint", value: function(s) {
|
|
804
|
-
var g = this._getCheckoutpointKey(s);
|
|
805
|
-
h.default.remove(g);
|
|
806
|
-
} }, { key: "_getCheckoutpoint", value: function(s) {
|
|
807
|
-
var g = this._getCheckoutpointKey(s), b = h.default.get(g);
|
|
808
|
-
if (b) try {
|
|
809
|
-
return JSON.parse(b);
|
|
810
|
-
} catch (P) {
|
|
811
|
-
}
|
|
812
|
-
return "";
|
|
813
|
-
} }, { key: "_saveCheckoutpoint", value: function(s, g, b) {
|
|
814
|
-
if (g) {
|
|
815
|
-
var P = this._getCheckoutpointKey(s), x = s.file, F = { fileName: x.name, lastModified: x.lastModified, size: x.size, object: s.object, videoId: s.videoId, bucket: s.bucket, endpoint: s.endpoint, checkpoint: g, loaded: s.loaded, state: b };
|
|
816
|
-
h.default.set(P, JSON.stringify(F));
|
|
817
|
-
}
|
|
818
|
-
} }, { key: "_changeState", value: function(s, g) {
|
|
819
|
-
var b = this._getCheckoutpoint(s);
|
|
820
|
-
b && ((this._onbeforeunload = !0) && (g = r.UPLOADSTATE.STOPED), this._saveCheckoutpoint(s, b.checkpoint, g));
|
|
821
|
-
} }, { key: "_getCheckoutpointKey", value: function(s) {
|
|
822
|
-
return "upload_" + s.file.lastModified + "_" + s.file.name + "_" + s.file.size;
|
|
823
|
-
} }, { key: "_getCheckoutpointFromCloud", value: function(s, g, b) {
|
|
824
|
-
var P = { userId: this.options.userId, uploadInfoList: [{ FileName: s.file.name, FileSize: s.file.size, FileCreateTime: s.file.lastModified, FileHash: s.fileHash }], region: this.options.region };
|
|
825
|
-
L.default.get(P, function(x) {
|
|
826
|
-
g(x);
|
|
827
|
-
}, b);
|
|
828
|
-
} }, { key: "_reportLog", value: function(s, g, b) {
|
|
829
|
-
b || (b = {}), b.ri = g.ri, this._ut && (b.ut = this._ut), this._log.log(s, b);
|
|
830
|
-
} }, { key: "_initEvent", value: function() {
|
|
831
|
-
var s = this;
|
|
832
|
-
window && (window.onbeforeunload = function(g) {
|
|
833
|
-
if (s._onbeforeunload = !0, s._curIndex != -1 && s._uploadList.length > s._curIndex) {
|
|
834
|
-
var b = s._uploadList[s._curIndex];
|
|
835
|
-
s._changeState(b, r.UPLOADSTATE.STOPED);
|
|
836
|
-
}
|
|
837
|
-
});
|
|
838
|
-
} }, { key: "_initState", value: function() {
|
|
839
|
-
for (var s = 0; s < this._uploadList.length; s++) {
|
|
840
|
-
var g = this._uploadList[s];
|
|
841
|
-
g.state != r.UPLOADSTATE.FAIlURE && g.state != r.UPLOADSTATE.STOPED || (g.state = r.UPLOADSTATE.INIT);
|
|
842
|
-
}
|
|
843
|
-
this._state = r.VODSTATE.INIT;
|
|
844
|
-
} }, { key: "_adjustPartSize", value: function(s) {
|
|
845
|
-
return s.file.size / this.options.partSize > 1e4 ? s.file.size / 9999 : this.options.partSize;
|
|
846
|
-
} }]), W;
|
|
847
|
-
}());
|
|
848
|
-
E.default = q;
|
|
849
|
-
}, function(H, E, A) {
|
|
850
|
-
Object.defineProperty(E, "__esModule", { value: !0 }), E.UPLOADSTATE = { INIT: "Ready", UPLOADING: "Uploading", SUCCESS: "Success", FAIlURE: "Failure", CANCELED: "Canceled", STOPED: "Stoped" }, E.VODSTATE = { INIT: "Init", START: "Start", STOP: "Stop", FAILURE: "Failure", EXPIRE: "Expire", END: "End" };
|
|
851
|
-
}, function(H, E, A) {
|
|
852
|
-
function _(o) {
|
|
853
|
-
return o && o.__esModule ? o : { default: o };
|
|
854
|
-
}
|
|
855
|
-
function k(o, i) {
|
|
856
|
-
if (!(o instanceof i)) throw new TypeError("Cannot call a class as a function");
|
|
857
|
-
}
|
|
858
|
-
Object.defineProperty(E, "__esModule", { value: !0 });
|
|
859
|
-
var R = /* @__PURE__ */ function() {
|
|
860
|
-
function o(i, a) {
|
|
861
|
-
for (var h = 0; h < a.length; h++) {
|
|
862
|
-
var l = a[h];
|
|
863
|
-
l.enumerable = l.enumerable || !1, l.configurable = !0, "value" in l && (l.writable = !0), Object.defineProperty(i, l.key, l);
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
return function(i, a, h) {
|
|
867
|
-
return a && o(i.prototype, a), h && o(i, h), i;
|
|
868
|
-
};
|
|
869
|
-
}(), r = A(3), c = A(18), d = (_(c), A(1)), u = (_(d), function() {
|
|
870
|
-
function o(i, a) {
|
|
871
|
-
if (k(this, o), i) {
|
|
872
|
-
this._config = i, this.create(this._config), this._uploadInfo = null, this._callback = {};
|
|
873
|
-
var h = function() {
|
|
874
|
-
};
|
|
875
|
-
this._callback.onerror = a.onerror || h, this._callback.oncomplete = a.oncomplete || h, this._callback.onprogress = a.onprogress || h;
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
return R(o, [{ key: "create", value: function(i) {
|
|
879
|
-
if (i.endpoint = i.endpoint || this._config.endpoint, i.bucket = i.bucket || this._config.bucket, !(i.AccessKeyId && i.AccessKeySecret && i.endpoint && i.SecurityToken)) throw new Error("AccessKeyId、AccessKeySecret、endpoint should not be null");
|
|
880
|
-
var a = { accessKeyId: i.AccessKeyId, accessKeySecret: i.AccessKeySecret, stsToken: i.SecurityToken, endpoint: i.endpoint || this._config.endpoint, bucket: i.bucket || this._config.bucket, secure: !0, cname: i.cname };
|
|
881
|
-
i.timeout && (a.timeout = i.timeout), this.oss = new OSS(a);
|
|
882
|
-
} }, { key: "abort", value: function(i) {
|
|
883
|
-
if (i.checkpoint) {
|
|
884
|
-
var a = i.checkpoint.uploadId;
|
|
885
|
-
this.oss.abortMultipartUpload(i.object, a);
|
|
886
|
-
}
|
|
887
|
-
} }, { key: "getVersion", value: function() {
|
|
888
|
-
} }, { key: "cancel", value: function() {
|
|
889
|
-
this.oss.cancel && this.oss.cancel();
|
|
890
|
-
} }, { key: "upload", value: function(i, a) {
|
|
891
|
-
this._uploadInfo = i;
|
|
892
|
-
var h = this, l = function(p, w, B) {
|
|
893
|
-
l = h._progress(p, w, B);
|
|
894
|
-
}, m = { parallel: a.parallel || this._config.parallel || r.UPLOADDEFAULT.PARALLEL, partSize: Math.round(a.partSize || this._config.partSize || r.UPLOADDEFAULT.PARTSIZE), progress: l };
|
|
895
|
-
a.headers && (m.headers = a.headers), i.checkpoint && (m.checkpoint = i.checkpoint), i.bucket || (this.oss.options.bucket = i.bucket), i.endpoint || (this.oss.options.endpoint = i.endpoint), this.oss.multipartUpload(i.object, i.file, m).then(function(p, w) {
|
|
896
|
-
h._complete(p);
|
|
897
|
-
}).catch(function(p) {
|
|
898
|
-
h.oss.cancel && (h.oss && h.oss.isCancel() || h.oss.cancel()), h._error(p);
|
|
899
|
-
});
|
|
900
|
-
} }, { key: "header", value: function(i, a, h) {
|
|
901
|
-
this.oss.get(i.object).then(function(l) {
|
|
902
|
-
a(l);
|
|
903
|
-
}).catch(function(l) {
|
|
904
|
-
h(l);
|
|
905
|
-
});
|
|
906
|
-
} }, { key: "_progress", value: function(i, a, h) {
|
|
907
|
-
this._callback.onprogress(this._uploadInfo, { loaded: i, total: this._uploadInfo.file.size, checkpoint: a }, h);
|
|
908
|
-
} }, { key: "_error", value: function(i) {
|
|
909
|
-
this._callback.onerror(this._uploadInfo, i);
|
|
910
|
-
} }, { key: "_complete", value: function(i) {
|
|
911
|
-
this._callback.oncomplete(this._uploadInfo, i);
|
|
912
|
-
} }]), o;
|
|
913
|
-
}());
|
|
914
|
-
E.default = u;
|
|
915
|
-
}, function(H, E, A) {
|
|
916
|
-
function _(r, c) {
|
|
917
|
-
if (!(r instanceof c)) throw new TypeError("Cannot call a class as a function");
|
|
918
|
-
}
|
|
919
|
-
Object.defineProperty(E, "__esModule", { value: !0 });
|
|
920
|
-
var k = /* @__PURE__ */ function() {
|
|
921
|
-
function r(c, d) {
|
|
922
|
-
for (var u = 0; u < d.length; u++) {
|
|
923
|
-
var o = d[u];
|
|
924
|
-
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(c, o.key, o);
|
|
925
|
-
}
|
|
926
|
-
}
|
|
927
|
-
return function(c, d, u) {
|
|
928
|
-
return d && r(c.prototype, d), u && r(c, u), c;
|
|
929
|
-
};
|
|
930
|
-
}(), R = function() {
|
|
931
|
-
function r() {
|
|
932
|
-
_(this, r);
|
|
933
|
-
}
|
|
934
|
-
return k(r, null, [{ key: "format", value: function(c) {
|
|
935
|
-
if (arguments.length < 2) return null;
|
|
936
|
-
for (var d = arguments[1], u = 1; u < arguments.length; u++) {
|
|
937
|
-
var o = new RegExp("\\{" + (u - 1) + "\\}", "gm");
|
|
938
|
-
d = d.replace(o, arguments[u + 1]);
|
|
939
|
-
}
|
|
940
|
-
return { code: c, message: d };
|
|
941
|
-
} }, { key: "CODE", get: function() {
|
|
942
|
-
return { SUCCESS: "Successful", EmptyValue: "InvalidParameter.EmptyValue", STSInvalid: "InvalidParameter.TokenInvalid", ReadFileError: "ReadFileError", FILEDUPLICATION: "FileDuplication", UploadALEADRYSTARTED: "UploadAlearyStarted" };
|
|
943
|
-
} }, { key: "MESSAGE", get: function() {
|
|
944
|
-
return { SUCCESS: "Successful", EmptyValue: "参数 {0} 不能为空。", STSInvalid: "STS参数非法, accessKeyId、accessKeySecret、secretToken、expireTime都不能为空。", ReadFileError: "读取文件{0}{1}失败.", FILEDUPLICATION: "文件重复添加 {0}", UploadALEADRYSTARTED: "重复开始." };
|
|
945
|
-
} }]), r;
|
|
946
|
-
}();
|
|
947
|
-
E.default = R;
|
|
948
|
-
}, function(H, E, A) {
|
|
949
|
-
(function(_) {
|
|
950
|
-
function k(c, d) {
|
|
951
|
-
if (!(c instanceof d)) throw new TypeError("Cannot call a class as a function");
|
|
952
|
-
}
|
|
953
|
-
Object.defineProperty(E, "__esModule", { value: !0 });
|
|
954
|
-
var R = /* @__PURE__ */ function() {
|
|
955
|
-
function c(d, u) {
|
|
956
|
-
for (var o = 0; o < u.length; o++) {
|
|
957
|
-
var i = u[o];
|
|
958
|
-
i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(d, i.key, i);
|
|
959
|
-
}
|
|
960
|
-
}
|
|
961
|
-
return function(d, u, o) {
|
|
962
|
-
return u && c(d.prototype, u), o && c(d, o), d;
|
|
963
|
-
};
|
|
964
|
-
}(), r = function() {
|
|
965
|
-
function c() {
|
|
966
|
-
k(this, c);
|
|
967
|
-
}
|
|
968
|
-
return R(c, null, [{ key: "encode", value: function(d) {
|
|
969
|
-
return new _(d).toString("base64");
|
|
970
|
-
} }, { key: "decode", value: function(d) {
|
|
971
|
-
return new _(d, "base64").toString();
|
|
972
|
-
} }]), c;
|
|
973
|
-
}();
|
|
974
|
-
E.default = r;
|
|
975
|
-
}).call(E, A(20).Buffer);
|
|
976
|
-
}, function(H, E, A) {
|
|
977
|
-
(function(_) {
|
|
978
|
-
function k() {
|
|
979
|
-
return r.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823;
|
|
980
|
-
}
|
|
981
|
-
function R(e, t) {
|
|
982
|
-
if (k() < t) throw new RangeError("Invalid typed array length");
|
|
983
|
-
return r.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t), e.__proto__ = r.prototype) : (e === null && (e = new r(t)), e.length = t), e;
|
|
984
|
-
}
|
|
985
|
-
function r(e, t, n) {
|
|
986
|
-
if (!(r.TYPED_ARRAY_SUPPORT || this instanceof r)) return new r(e, t, n);
|
|
987
|
-
if (typeof e == "number") {
|
|
988
|
-
if (typeof t == "string") throw new Error("If encoding is specified then the first argument must be a string");
|
|
989
|
-
return o(this, e);
|
|
990
|
-
}
|
|
991
|
-
return c(this, e, t, n);
|
|
992
|
-
}
|
|
993
|
-
function c(e, t, n, f) {
|
|
994
|
-
if (typeof t == "number") throw new TypeError('"value" argument must not be a number');
|
|
995
|
-
return typeof ArrayBuffer != "undefined" && t instanceof ArrayBuffer ? h(e, t, n, f) : typeof t == "string" ? i(e, t, n) : l(e, t);
|
|
996
|
-
}
|
|
997
|
-
function d(e) {
|
|
998
|
-
if (typeof e != "number") throw new TypeError('"size" argument must be a number');
|
|
999
|
-
if (e < 0) throw new RangeError('"size" argument must not be negative');
|
|
1000
|
-
}
|
|
1001
|
-
function u(e, t, n, f) {
|
|
1002
|
-
return d(t), t <= 0 ? R(e, t) : n !== void 0 ? typeof f == "string" ? R(e, t).fill(n, f) : R(e, t).fill(n) : R(e, t);
|
|
1003
|
-
}
|
|
1004
|
-
function o(e, t) {
|
|
1005
|
-
if (d(t), e = R(e, t < 0 ? 0 : 0 | m(t)), !r.TYPED_ARRAY_SUPPORT) for (var n = 0; n < t; ++n) e[n] = 0;
|
|
1006
|
-
return e;
|
|
1007
|
-
}
|
|
1008
|
-
function i(e, t, n) {
|
|
1009
|
-
if (typeof n == "string" && n !== "" || (n = "utf8"), !r.isEncoding(n)) throw new TypeError('"encoding" must be a valid string encoding');
|
|
1010
|
-
var f = 0 | w(t, n);
|
|
1011
|
-
e = R(e, f);
|
|
1012
|
-
var v = e.write(t, n);
|
|
1013
|
-
return v !== f && (e = e.slice(0, v)), e;
|
|
1014
|
-
}
|
|
1015
|
-
function a(e, t) {
|
|
1016
|
-
var n = t.length < 0 ? 0 : 0 | m(t.length);
|
|
1017
|
-
e = R(e, n);
|
|
1018
|
-
for (var f = 0; f < n; f += 1) e[f] = 255 & t[f];
|
|
1019
|
-
return e;
|
|
1020
|
-
}
|
|
1021
|
-
function h(e, t, n, f) {
|
|
1022
|
-
if (t.byteLength, n < 0 || t.byteLength < n) throw new RangeError("'offset' is out of bounds");
|
|
1023
|
-
if (t.byteLength < n + (f || 0)) throw new RangeError("'length' is out of bounds");
|
|
1024
|
-
return t = n === void 0 && f === void 0 ? new Uint8Array(t) : f === void 0 ? new Uint8Array(t, n) : new Uint8Array(t, n, f), r.TYPED_ARRAY_SUPPORT ? (e = t, e.__proto__ = r.prototype) : e = a(e, t), e;
|
|
1025
|
-
}
|
|
1026
|
-
function l(e, t) {
|
|
1027
|
-
if (r.isBuffer(t)) {
|
|
1028
|
-
var n = 0 | m(t.length);
|
|
1029
|
-
return e = R(e, n), e.length === 0 || t.copy(e, 0, 0, n), e;
|
|
1030
|
-
}
|
|
1031
|
-
if (t) {
|
|
1032
|
-
if (typeof ArrayBuffer != "undefined" && t.buffer instanceof ArrayBuffer || "length" in t) return typeof t.length != "number" || ge(t.length) ? R(e, 0) : a(e, t);
|
|
1033
|
-
if (t.type === "Buffer" && se(t.data)) return a(e, t.data);
|
|
1034
|
-
}
|
|
1035
|
-
throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");
|
|
1036
|
-
}
|
|
1037
|
-
function m(e) {
|
|
1038
|
-
if (e >= k()) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + k().toString(16) + " bytes");
|
|
1039
|
-
return 0 | e;
|
|
1040
|
-
}
|
|
1041
|
-
function p(e) {
|
|
1042
|
-
return +e != e && (e = 0), r.alloc(+e);
|
|
1043
|
-
}
|
|
1044
|
-
function w(e, t) {
|
|
1045
|
-
if (r.isBuffer(e)) return e.length;
|
|
1046
|
-
if (typeof ArrayBuffer != "undefined" && typeof ArrayBuffer.isView == "function" && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer)) return e.byteLength;
|
|
1047
|
-
typeof e != "string" && (e = "" + e);
|
|
1048
|
-
var n = e.length;
|
|
1049
|
-
if (n === 0) return 0;
|
|
1050
|
-
for (var f = !1; ; ) switch (t) {
|
|
1051
|
-
case "ascii":
|
|
1052
|
-
case "latin1":
|
|
1053
|
-
case "binary":
|
|
1054
|
-
return n;
|
|
1055
|
-
case "utf8":
|
|
1056
|
-
case "utf-8":
|
|
1057
|
-
case void 0:
|
|
1058
|
-
return te(e).length;
|
|
1059
|
-
case "ucs2":
|
|
1060
|
-
case "ucs-2":
|
|
1061
|
-
case "utf16le":
|
|
1062
|
-
case "utf-16le":
|
|
1063
|
-
return 2 * n;
|
|
1064
|
-
case "hex":
|
|
1065
|
-
return n >>> 1;
|
|
1066
|
-
case "base64":
|
|
1067
|
-
return ae(e).length;
|
|
1068
|
-
default:
|
|
1069
|
-
if (f) return te(e).length;
|
|
1070
|
-
t = ("" + t).toLowerCase(), f = !0;
|
|
1071
|
-
}
|
|
1072
|
-
}
|
|
1073
|
-
function B(e, t, n) {
|
|
1074
|
-
var f = !1;
|
|
1075
|
-
if ((t === void 0 || t < 0) && (t = 0), t > this.length || ((n === void 0 || n > this.length) && (n = this.length), n <= 0) || (n >>>= 0, t >>>= 0, n <= t)) return "";
|
|
1076
|
-
for (e || (e = "utf8"); ; ) switch (e) {
|
|
1077
|
-
case "hex":
|
|
1078
|
-
return F(this, t, n);
|
|
1079
|
-
case "utf8":
|
|
1080
|
-
case "utf-8":
|
|
1081
|
-
return g(this, t, n);
|
|
1082
|
-
case "ascii":
|
|
1083
|
-
return P(this, t, n);
|
|
1084
|
-
case "latin1":
|
|
1085
|
-
case "binary":
|
|
1086
|
-
return x(this, t, n);
|
|
1087
|
-
case "base64":
|
|
1088
|
-
return s(this, t, n);
|
|
1089
|
-
case "ucs2":
|
|
1090
|
-
case "ucs-2":
|
|
1091
|
-
case "utf16le":
|
|
1092
|
-
case "utf-16le":
|
|
1093
|
-
return j(this, t, n);
|
|
1094
|
-
default:
|
|
1095
|
-
if (f) throw new TypeError("Unknown encoding: " + e);
|
|
1096
|
-
e = (e + "").toLowerCase(), f = !0;
|
|
1097
|
-
}
|
|
1098
|
-
}
|
|
1099
|
-
function I(e, t, n) {
|
|
1100
|
-
var f = e[t];
|
|
1101
|
-
e[t] = e[n], e[n] = f;
|
|
1102
|
-
}
|
|
1103
|
-
function y(e, t, n, f, v) {
|
|
1104
|
-
if (e.length === 0) return -1;
|
|
1105
|
-
if (typeof n == "string" ? (f = n, n = 0) : n > 2147483647 ? n = 2147483647 : n < -2147483648 && (n = -2147483648), n = +n, isNaN(n) && (n = v ? 0 : e.length - 1), n < 0 && (n = e.length + n), n >= e.length) {
|
|
1106
|
-
if (v) return -1;
|
|
1107
|
-
n = e.length - 1;
|
|
1108
|
-
} else if (n < 0) {
|
|
1109
|
-
if (!v) return -1;
|
|
1110
|
-
n = 0;
|
|
1111
|
-
}
|
|
1112
|
-
if (typeof t == "string" && (t = r.from(t, f)), r.isBuffer(t)) return t.length === 0 ? -1 : S(e, t, n, f, v);
|
|
1113
|
-
if (typeof t == "number") return t &= 255, r.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf == "function" ? v ? Uint8Array.prototype.indexOf.call(e, t, n) : Uint8Array.prototype.lastIndexOf.call(e, t, n) : S(e, [t], n, f, v);
|
|
1114
|
-
throw new TypeError("val must be string, number or Buffer");
|
|
1115
|
-
}
|
|
1116
|
-
function S(e, t, n, f, v) {
|
|
1117
|
-
function T(ce, le) {
|
|
1118
|
-
return Y === 1 ? ce[le] : ce.readUInt16BE(le * Y);
|
|
1119
|
-
}
|
|
1120
|
-
var Y = 1, J = e.length, Q = t.length;
|
|
1121
|
-
if (f !== void 0 && ((f = String(f).toLowerCase()) === "ucs2" || f === "ucs-2" || f === "utf16le" || f === "utf-16le")) {
|
|
1122
|
-
if (e.length < 2 || t.length < 2) return -1;
|
|
1123
|
-
Y = 2, J /= 2, Q /= 2, n /= 2;
|
|
1124
|
-
}
|
|
1125
|
-
var G;
|
|
1126
|
-
if (v) {
|
|
1127
|
-
var Z = -1;
|
|
1128
|
-
for (G = n; G < J; G++) if (T(e, G) === T(t, Z === -1 ? 0 : G - Z)) {
|
|
1129
|
-
if (Z === -1 && (Z = G), G - Z + 1 === Q) return Z * Y;
|
|
1130
|
-
} else Z !== -1 && (G -= G - Z), Z = -1;
|
|
1131
|
-
} else for (n + Q > J && (n = J - Q), G = n; G >= 0; G--) {
|
|
1132
|
-
for (var $ = !0, re = 0; re < Q; re++) if (T(e, G + re) !== T(t, re)) {
|
|
1133
|
-
$ = !1;
|
|
1134
|
-
break;
|
|
1135
|
-
}
|
|
1136
|
-
if ($) return G;
|
|
1137
|
-
}
|
|
1138
|
-
return -1;
|
|
1139
|
-
}
|
|
1140
|
-
function M(e, t, n, f) {
|
|
1141
|
-
n = Number(n) || 0;
|
|
1142
|
-
var v = e.length - n;
|
|
1143
|
-
f ? (f = Number(f)) > v && (f = v) : f = v;
|
|
1144
|
-
var T = t.length;
|
|
1145
|
-
if (T % 2 != 0) throw new TypeError("Invalid hex string");
|
|
1146
|
-
f > T / 2 && (f = T / 2);
|
|
1147
|
-
for (var Y = 0; Y < f; ++Y) {
|
|
1148
|
-
var J = parseInt(t.substr(2 * Y, 2), 16);
|
|
1149
|
-
if (isNaN(J)) return Y;
|
|
1150
|
-
e[n + Y] = J;
|
|
1151
|
-
}
|
|
1152
|
-
return Y;
|
|
1153
|
-
}
|
|
1154
|
-
function L(e, t, n, f) {
|
|
1155
|
-
return ne(te(t, e.length - n), e, n, f);
|
|
1156
|
-
}
|
|
1157
|
-
function z(e, t, n, f) {
|
|
1158
|
-
return ne(he(t), e, n, f);
|
|
1159
|
-
}
|
|
1160
|
-
function V(e, t, n, f) {
|
|
1161
|
-
return z(e, t, n, f);
|
|
1162
|
-
}
|
|
1163
|
-
function q(e, t, n, f) {
|
|
1164
|
-
return ne(ae(t), e, n, f);
|
|
1165
|
-
}
|
|
1166
|
-
function W(e, t, n, f) {
|
|
1167
|
-
return ne(pe(t, e.length - n), e, n, f);
|
|
1168
|
-
}
|
|
1169
|
-
function s(e, t, n) {
|
|
1170
|
-
return t === 0 && n === e.length ? oe.fromByteArray(e) : oe.fromByteArray(e.slice(t, n));
|
|
1171
|
-
}
|
|
1172
|
-
function g(e, t, n) {
|
|
1173
|
-
n = Math.min(e.length, n);
|
|
1174
|
-
for (var f = [], v = t; v < n; ) {
|
|
1175
|
-
var T = e[v], Y = null, J = T > 239 ? 4 : T > 223 ? 3 : T > 191 ? 2 : 1;
|
|
1176
|
-
if (v + J <= n) {
|
|
1177
|
-
var Q, G, Z, $;
|
|
1178
|
-
switch (J) {
|
|
1179
|
-
case 1:
|
|
1180
|
-
T < 128 && (Y = T);
|
|
1181
|
-
break;
|
|
1182
|
-
case 2:
|
|
1183
|
-
Q = e[v + 1], (192 & Q) == 128 && ($ = (31 & T) << 6 | 63 & Q) > 127 && (Y = $);
|
|
1184
|
-
break;
|
|
1185
|
-
case 3:
|
|
1186
|
-
Q = e[v + 1], G = e[v + 2], (192 & Q) == 128 && (192 & G) == 128 && ($ = (15 & T) << 12 | (63 & Q) << 6 | 63 & G) > 2047 && ($ < 55296 || $ > 57343) && (Y = $);
|
|
1187
|
-
break;
|
|
1188
|
-
case 4:
|
|
1189
|
-
Q = e[v + 1], G = e[v + 2], Z = e[v + 3], (192 & Q) == 128 && (192 & G) == 128 && (192 & Z) == 128 && ($ = (15 & T) << 18 | (63 & Q) << 12 | (63 & G) << 6 | 63 & Z) > 65535 && $ < 1114112 && (Y = $);
|
|
1190
|
-
}
|
|
1191
|
-
}
|
|
1192
|
-
Y === null ? (Y = 65533, J = 1) : Y > 65535 && (Y -= 65536, f.push(Y >>> 10 & 1023 | 55296), Y = 56320 | 1023 & Y), f.push(Y), v += J;
|
|
1193
|
-
}
|
|
1194
|
-
return b(f);
|
|
1195
|
-
}
|
|
1196
|
-
function b(e) {
|
|
1197
|
-
var t = e.length;
|
|
1198
|
-
if (t <= ue) return String.fromCharCode.apply(String, e);
|
|
1199
|
-
for (var n = "", f = 0; f < t; ) n += String.fromCharCode.apply(String, e.slice(f, f += ue));
|
|
1200
|
-
return n;
|
|
1201
|
-
}
|
|
1202
|
-
function P(e, t, n) {
|
|
1203
|
-
var f = "";
|
|
1204
|
-
n = Math.min(e.length, n);
|
|
1205
|
-
for (var v = t; v < n; ++v) f += String.fromCharCode(127 & e[v]);
|
|
1206
|
-
return f;
|
|
1207
|
-
}
|
|
1208
|
-
function x(e, t, n) {
|
|
1209
|
-
var f = "";
|
|
1210
|
-
n = Math.min(e.length, n);
|
|
1211
|
-
for (var v = t; v < n; ++v) f += String.fromCharCode(e[v]);
|
|
1212
|
-
return f;
|
|
1213
|
-
}
|
|
1214
|
-
function F(e, t, n) {
|
|
1215
|
-
var f = e.length;
|
|
1216
|
-
(!t || t < 0) && (t = 0), (!n || n < 0 || n > f) && (n = f);
|
|
1217
|
-
for (var v = "", T = t; T < n; ++T) v += de(e[T]);
|
|
1218
|
-
return v;
|
|
1219
|
-
}
|
|
1220
|
-
function j(e, t, n) {
|
|
1221
|
-
for (var f = e.slice(t, n), v = "", T = 0; T < f.length; T += 2) v += String.fromCharCode(f[T] + 256 * f[T + 1]);
|
|
1222
|
-
return v;
|
|
1223
|
-
}
|
|
1224
|
-
function N(e, t, n) {
|
|
1225
|
-
if (e % 1 != 0 || e < 0) throw new RangeError("offset is not uint");
|
|
1226
|
-
if (e + t > n) throw new RangeError("Trying to access beyond buffer length");
|
|
1227
|
-
}
|
|
1228
|
-
function K(e, t, n, f, v, T) {
|
|
1229
|
-
if (!r.isBuffer(e)) throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
1230
|
-
if (t > v || t < T) throw new RangeError('"value" argument is out of bounds');
|
|
1231
|
-
if (n + f > e.length) throw new RangeError("Index out of range");
|
|
1232
|
-
}
|
|
1233
|
-
function X(e, t, n, f) {
|
|
1234
|
-
t < 0 && (t = 65535 + t + 1);
|
|
1235
|
-
for (var v = 0, T = Math.min(e.length - n, 2); v < T; ++v) e[n + v] = (t & 255 << 8 * (f ? v : 1 - v)) >>> 8 * (f ? v : 1 - v);
|
|
1236
|
-
}
|
|
1237
|
-
function O(e, t, n, f) {
|
|
1238
|
-
t < 0 && (t = 4294967295 + t + 1);
|
|
1239
|
-
for (var v = 0, T = Math.min(e.length - n, 4); v < T; ++v) e[n + v] = t >>> 8 * (f ? v : 3 - v) & 255;
|
|
1240
|
-
}
|
|
1241
|
-
function D(e, t, n, f, v, T) {
|
|
1242
|
-
if (n + f > e.length) throw new RangeError("Index out of range");
|
|
1243
|
-
if (n < 0) throw new RangeError("Index out of range");
|
|
1244
|
-
}
|
|
1245
|
-
function U(e, t, n, f, v) {
|
|
1246
|
-
return v || D(e, t, n, 4), ee.write(e, t, n, f, 23, 4), n + 4;
|
|
1247
|
-
}
|
|
1248
|
-
function C(e, t, n, f, v) {
|
|
1249
|
-
return v || D(e, t, n, 8), ee.write(e, t, n, f, 52, 8), n + 8;
|
|
1250
|
-
}
|
|
1251
|
-
function ie(e) {
|
|
1252
|
-
if (e = fe(e).replace(ye, ""), e.length < 2) return "";
|
|
1253
|
-
for (; e.length % 4 != 0; ) e += "=";
|
|
1254
|
-
return e;
|
|
1255
|
-
}
|
|
1256
|
-
function fe(e) {
|
|
1257
|
-
return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "");
|
|
1258
|
-
}
|
|
1259
|
-
function de(e) {
|
|
1260
|
-
return e < 16 ? "0" + e.toString(16) : e.toString(16);
|
|
1261
|
-
}
|
|
1262
|
-
function te(e, t) {
|
|
1263
|
-
t = t || 1 / 0;
|
|
1264
|
-
for (var n, f = e.length, v = null, T = [], Y = 0; Y < f; ++Y) {
|
|
1265
|
-
if ((n = e.charCodeAt(Y)) > 55295 && n < 57344) {
|
|
1266
|
-
if (!v) {
|
|
1267
|
-
if (n > 56319) {
|
|
1268
|
-
(t -= 3) > -1 && T.push(239, 191, 189);
|
|
1269
|
-
continue;
|
|
1270
|
-
}
|
|
1271
|
-
if (Y + 1 === f) {
|
|
1272
|
-
(t -= 3) > -1 && T.push(239, 191, 189);
|
|
1273
|
-
continue;
|
|
1274
|
-
}
|
|
1275
|
-
v = n;
|
|
1276
|
-
continue;
|
|
1277
|
-
}
|
|
1278
|
-
if (n < 56320) {
|
|
1279
|
-
(t -= 3) > -1 && T.push(239, 191, 189), v = n;
|
|
1280
|
-
continue;
|
|
1281
|
-
}
|
|
1282
|
-
n = 65536 + (v - 55296 << 10 | n - 56320);
|
|
1283
|
-
} else v && (t -= 3) > -1 && T.push(239, 191, 189);
|
|
1284
|
-
if (v = null, n < 128) {
|
|
1285
|
-
if ((t -= 1) < 0) break;
|
|
1286
|
-
T.push(n);
|
|
1287
|
-
} else if (n < 2048) {
|
|
1288
|
-
if ((t -= 2) < 0) break;
|
|
1289
|
-
T.push(n >> 6 | 192, 63 & n | 128);
|
|
1290
|
-
} else if (n < 65536) {
|
|
1291
|
-
if ((t -= 3) < 0) break;
|
|
1292
|
-
T.push(n >> 12 | 224, n >> 6 & 63 | 128, 63 & n | 128);
|
|
1293
|
-
} else {
|
|
1294
|
-
if (!(n < 1114112)) throw new Error("Invalid code point");
|
|
1295
|
-
if ((t -= 4) < 0) break;
|
|
1296
|
-
T.push(n >> 18 | 240, n >> 12 & 63 | 128, n >> 6 & 63 | 128, 63 & n | 128);
|
|
1297
|
-
}
|
|
1298
|
-
}
|
|
1299
|
-
return T;
|
|
1300
|
-
}
|
|
1301
|
-
function he(e) {
|
|
1302
|
-
for (var t = [], n = 0; n < e.length; ++n) t.push(255 & e.charCodeAt(n));
|
|
1303
|
-
return t;
|
|
1304
|
-
}
|
|
1305
|
-
function pe(e, t) {
|
|
1306
|
-
for (var n, f, v, T = [], Y = 0; Y < e.length && !((t -= 2) < 0); ++Y) n = e.charCodeAt(Y), f = n >> 8, v = n % 256, T.push(v), T.push(f);
|
|
1307
|
-
return T;
|
|
1308
|
-
}
|
|
1309
|
-
function ae(e) {
|
|
1310
|
-
return oe.toByteArray(ie(e));
|
|
1311
|
-
}
|
|
1312
|
-
function ne(e, t, n, f) {
|
|
1313
|
-
for (var v = 0; v < f && !(v + n >= t.length || v >= e.length); ++v) t[v + n] = e[v];
|
|
1314
|
-
return v;
|
|
1315
|
-
}
|
|
1316
|
-
function ge(e) {
|
|
1317
|
-
return e !== e;
|
|
1318
|
-
}
|
|
1319
|
-
/*!
|
|
1320
|
-
* The buffer module from node.js, for the browser.
|
|
1321
|
-
*
|
|
1322
|
-
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
1323
|
-
* @license MIT
|
|
1324
|
-
*/
|
|
1325
|
-
var oe = A(21), ee = A(22), se = A(23);
|
|
1326
|
-
E.Buffer = r, E.SlowBuffer = p, E.INSPECT_MAX_BYTES = 50, r.TYPED_ARRAY_SUPPORT = _.TYPED_ARRAY_SUPPORT !== void 0 ? _.TYPED_ARRAY_SUPPORT : function() {
|
|
1327
|
-
try {
|
|
1328
|
-
var e = new Uint8Array(1);
|
|
1329
|
-
return e.__proto__ = { __proto__: Uint8Array.prototype, foo: function() {
|
|
1330
|
-
return 42;
|
|
1331
|
-
} }, e.foo() === 42 && typeof e.subarray == "function" && e.subarray(1, 1).byteLength === 0;
|
|
1332
|
-
} catch (t) {
|
|
1333
|
-
return !1;
|
|
1334
|
-
}
|
|
1335
|
-
}(), E.kMaxLength = k(), r.poolSize = 8192, r._augment = function(e) {
|
|
1336
|
-
return e.__proto__ = r.prototype, e;
|
|
1337
|
-
}, r.from = function(e, t, n) {
|
|
1338
|
-
return c(null, e, t, n);
|
|
1339
|
-
}, r.TYPED_ARRAY_SUPPORT && (r.prototype.__proto__ = Uint8Array.prototype, r.__proto__ = Uint8Array, typeof Symbol != "undefined" && Symbol.species && r[Symbol.species] === r && Object.defineProperty(r, Symbol.species, { value: null, configurable: !0 })), r.alloc = function(e, t, n) {
|
|
1340
|
-
return u(null, e, t, n);
|
|
1341
|
-
}, r.allocUnsafe = function(e) {
|
|
1342
|
-
return o(null, e);
|
|
1343
|
-
}, r.allocUnsafeSlow = function(e) {
|
|
1344
|
-
return o(null, e);
|
|
1345
|
-
}, r.isBuffer = function(e) {
|
|
1346
|
-
return !(e == null || !e._isBuffer);
|
|
1347
|
-
}, r.compare = function(e, t) {
|
|
1348
|
-
if (!r.isBuffer(e) || !r.isBuffer(t)) throw new TypeError("Arguments must be Buffers");
|
|
1349
|
-
if (e === t) return 0;
|
|
1350
|
-
for (var n = e.length, f = t.length, v = 0, T = Math.min(n, f); v < T; ++v) if (e[v] !== t[v]) {
|
|
1351
|
-
n = e[v], f = t[v];
|
|
1352
|
-
break;
|
|
1353
|
-
}
|
|
1354
|
-
return n < f ? -1 : f < n ? 1 : 0;
|
|
1355
|
-
}, r.isEncoding = function(e) {
|
|
1356
|
-
switch (String(e).toLowerCase()) {
|
|
1357
|
-
case "hex":
|
|
1358
|
-
case "utf8":
|
|
1359
|
-
case "utf-8":
|
|
1360
|
-
case "ascii":
|
|
1361
|
-
case "latin1":
|
|
1362
|
-
case "binary":
|
|
1363
|
-
case "base64":
|
|
1364
|
-
case "ucs2":
|
|
1365
|
-
case "ucs-2":
|
|
1366
|
-
case "utf16le":
|
|
1367
|
-
case "utf-16le":
|
|
1368
|
-
return !0;
|
|
1369
|
-
default:
|
|
1370
|
-
return !1;
|
|
1371
|
-
}
|
|
1372
|
-
}, r.concat = function(e, t) {
|
|
1373
|
-
if (!se(e)) throw new TypeError('"list" argument must be an Array of Buffers');
|
|
1374
|
-
if (e.length === 0) return r.alloc(0);
|
|
1375
|
-
var n;
|
|
1376
|
-
if (t === void 0) for (t = 0, n = 0; n < e.length; ++n) t += e[n].length;
|
|
1377
|
-
var f = r.allocUnsafe(t), v = 0;
|
|
1378
|
-
for (n = 0; n < e.length; ++n) {
|
|
1379
|
-
var T = e[n];
|
|
1380
|
-
if (!r.isBuffer(T)) throw new TypeError('"list" argument must be an Array of Buffers');
|
|
1381
|
-
T.copy(f, v), v += T.length;
|
|
1382
|
-
}
|
|
1383
|
-
return f;
|
|
1384
|
-
}, r.byteLength = w, r.prototype._isBuffer = !0, r.prototype.swap16 = function() {
|
|
1385
|
-
var e = this.length;
|
|
1386
|
-
if (e % 2 != 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
|
|
1387
|
-
for (var t = 0; t < e; t += 2) I(this, t, t + 1);
|
|
1388
|
-
return this;
|
|
1389
|
-
}, r.prototype.swap32 = function() {
|
|
1390
|
-
var e = this.length;
|
|
1391
|
-
if (e % 4 != 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
|
|
1392
|
-
for (var t = 0; t < e; t += 4) I(this, t, t + 3), I(this, t + 1, t + 2);
|
|
1393
|
-
return this;
|
|
1394
|
-
}, r.prototype.swap64 = function() {
|
|
1395
|
-
var e = this.length;
|
|
1396
|
-
if (e % 8 != 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
|
|
1397
|
-
for (var t = 0; t < e; t += 8) I(this, t, t + 7), I(this, t + 1, t + 6), I(this, t + 2, t + 5), I(this, t + 3, t + 4);
|
|
1398
|
-
return this;
|
|
1399
|
-
}, r.prototype.toString = function() {
|
|
1400
|
-
var e = 0 | this.length;
|
|
1401
|
-
return e === 0 ? "" : arguments.length === 0 ? g(this, 0, e) : B.apply(this, arguments);
|
|
1402
|
-
}, r.prototype.equals = function(e) {
|
|
1403
|
-
if (!r.isBuffer(e)) throw new TypeError("Argument must be a Buffer");
|
|
1404
|
-
return this === e || r.compare(this, e) === 0;
|
|
1405
|
-
}, r.prototype.inspect = function() {
|
|
1406
|
-
var e = "", t = E.INSPECT_MAX_BYTES;
|
|
1407
|
-
return this.length > 0 && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "), this.length > t && (e += " ... ")), "<Buffer " + e + ">";
|
|
1408
|
-
}, r.prototype.compare = function(e, t, n, f, v) {
|
|
1409
|
-
if (!r.isBuffer(e)) throw new TypeError("Argument must be a Buffer");
|
|
1410
|
-
if (t === void 0 && (t = 0), n === void 0 && (n = e ? e.length : 0), f === void 0 && (f = 0), v === void 0 && (v = this.length), t < 0 || n > e.length || f < 0 || v > this.length) throw new RangeError("out of range index");
|
|
1411
|
-
if (f >= v && t >= n) return 0;
|
|
1412
|
-
if (f >= v) return -1;
|
|
1413
|
-
if (t >= n) return 1;
|
|
1414
|
-
if (t >>>= 0, n >>>= 0, f >>>= 0, v >>>= 0, this === e) return 0;
|
|
1415
|
-
for (var T = v - f, Y = n - t, J = Math.min(T, Y), Q = this.slice(f, v), G = e.slice(t, n), Z = 0; Z < J; ++Z) if (Q[Z] !== G[Z]) {
|
|
1416
|
-
T = Q[Z], Y = G[Z];
|
|
1417
|
-
break;
|
|
1418
|
-
}
|
|
1419
|
-
return T < Y ? -1 : Y < T ? 1 : 0;
|
|
1420
|
-
}, r.prototype.includes = function(e, t, n) {
|
|
1421
|
-
return this.indexOf(e, t, n) !== -1;
|
|
1422
|
-
}, r.prototype.indexOf = function(e, t, n) {
|
|
1423
|
-
return y(this, e, t, n, !0);
|
|
1424
|
-
}, r.prototype.lastIndexOf = function(e, t, n) {
|
|
1425
|
-
return y(this, e, t, n, !1);
|
|
1426
|
-
}, r.prototype.write = function(e, t, n, f) {
|
|
1427
|
-
if (t === void 0) f = "utf8", n = this.length, t = 0;
|
|
1428
|
-
else if (n === void 0 && typeof t == "string") f = t, n = this.length, t = 0;
|
|
1429
|
-
else {
|
|
1430
|
-
if (!isFinite(t)) throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
|
|
1431
|
-
t |= 0, isFinite(n) ? (n |= 0, f === void 0 && (f = "utf8")) : (f = n, n = void 0);
|
|
1432
|
-
}
|
|
1433
|
-
var v = this.length - t;
|
|
1434
|
-
if ((n === void 0 || n > v) && (n = v), e.length > 0 && (n < 0 || t < 0) || t > this.length) throw new RangeError("Attempt to write outside buffer bounds");
|
|
1435
|
-
f || (f = "utf8");
|
|
1436
|
-
for (var T = !1; ; ) switch (f) {
|
|
1437
|
-
case "hex":
|
|
1438
|
-
return M(this, e, t, n);
|
|
1439
|
-
case "utf8":
|
|
1440
|
-
case "utf-8":
|
|
1441
|
-
return L(this, e, t, n);
|
|
1442
|
-
case "ascii":
|
|
1443
|
-
return z(this, e, t, n);
|
|
1444
|
-
case "latin1":
|
|
1445
|
-
case "binary":
|
|
1446
|
-
return V(this, e, t, n);
|
|
1447
|
-
case "base64":
|
|
1448
|
-
return q(this, e, t, n);
|
|
1449
|
-
case "ucs2":
|
|
1450
|
-
case "ucs-2":
|
|
1451
|
-
case "utf16le":
|
|
1452
|
-
case "utf-16le":
|
|
1453
|
-
return W(this, e, t, n);
|
|
1454
|
-
default:
|
|
1455
|
-
if (T) throw new TypeError("Unknown encoding: " + f);
|
|
1456
|
-
f = ("" + f).toLowerCase(), T = !0;
|
|
1457
|
-
}
|
|
1458
|
-
}, r.prototype.toJSON = function() {
|
|
1459
|
-
return { type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0) };
|
|
1460
|
-
};
|
|
1461
|
-
var ue = 4096;
|
|
1462
|
-
r.prototype.slice = function(e, t) {
|
|
1463
|
-
var n = this.length;
|
|
1464
|
-
e = ~~e, t = t === void 0 ? n : ~~t, e < 0 ? (e += n) < 0 && (e = 0) : e > n && (e = n), t < 0 ? (t += n) < 0 && (t = 0) : t > n && (t = n), t < e && (t = e);
|
|
1465
|
-
var f;
|
|
1466
|
-
if (r.TYPED_ARRAY_SUPPORT) f = this.subarray(e, t), f.__proto__ = r.prototype;
|
|
1467
|
-
else {
|
|
1468
|
-
var v = t - e;
|
|
1469
|
-
f = new r(v, void 0);
|
|
1470
|
-
for (var T = 0; T < v; ++T) f[T] = this[T + e];
|
|
1471
|
-
}
|
|
1472
|
-
return f;
|
|
1473
|
-
}, r.prototype.readUIntLE = function(e, t, n) {
|
|
1474
|
-
e |= 0, t |= 0, n || N(e, t, this.length);
|
|
1475
|
-
for (var f = this[e], v = 1, T = 0; ++T < t && (v *= 256); ) f += this[e + T] * v;
|
|
1476
|
-
return f;
|
|
1477
|
-
}, r.prototype.readUIntBE = function(e, t, n) {
|
|
1478
|
-
e |= 0, t |= 0, n || N(e, t, this.length);
|
|
1479
|
-
for (var f = this[e + --t], v = 1; t > 0 && (v *= 256); ) f += this[e + --t] * v;
|
|
1480
|
-
return f;
|
|
1481
|
-
}, r.prototype.readUInt8 = function(e, t) {
|
|
1482
|
-
return t || N(e, 1, this.length), this[e];
|
|
1483
|
-
}, r.prototype.readUInt16LE = function(e, t) {
|
|
1484
|
-
return t || N(e, 2, this.length), this[e] | this[e + 1] << 8;
|
|
1485
|
-
}, r.prototype.readUInt16BE = function(e, t) {
|
|
1486
|
-
return t || N(e, 2, this.length), this[e] << 8 | this[e + 1];
|
|
1487
|
-
}, r.prototype.readUInt32LE = function(e, t) {
|
|
1488
|
-
return t || N(e, 4, this.length), (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3];
|
|
1489
|
-
}, r.prototype.readUInt32BE = function(e, t) {
|
|
1490
|
-
return t || N(e, 4, this.length), 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]);
|
|
1491
|
-
}, r.prototype.readIntLE = function(e, t, n) {
|
|
1492
|
-
e |= 0, t |= 0, n || N(e, t, this.length);
|
|
1493
|
-
for (var f = this[e], v = 1, T = 0; ++T < t && (v *= 256); ) f += this[e + T] * v;
|
|
1494
|
-
return v *= 128, f >= v && (f -= Math.pow(2, 8 * t)), f;
|
|
1495
|
-
}, r.prototype.readIntBE = function(e, t, n) {
|
|
1496
|
-
e |= 0, t |= 0, n || N(e, t, this.length);
|
|
1497
|
-
for (var f = t, v = 1, T = this[e + --f]; f > 0 && (v *= 256); ) T += this[e + --f] * v;
|
|
1498
|
-
return v *= 128, T >= v && (T -= Math.pow(2, 8 * t)), T;
|
|
1499
|
-
}, r.prototype.readInt8 = function(e, t) {
|
|
1500
|
-
return t || N(e, 1, this.length), 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e];
|
|
1501
|
-
}, r.prototype.readInt16LE = function(e, t) {
|
|
1502
|
-
t || N(e, 2, this.length);
|
|
1503
|
-
var n = this[e] | this[e + 1] << 8;
|
|
1504
|
-
return 32768 & n ? 4294901760 | n : n;
|
|
1505
|
-
}, r.prototype.readInt16BE = function(e, t) {
|
|
1506
|
-
t || N(e, 2, this.length);
|
|
1507
|
-
var n = this[e + 1] | this[e] << 8;
|
|
1508
|
-
return 32768 & n ? 4294901760 | n : n;
|
|
1509
|
-
}, r.prototype.readInt32LE = function(e, t) {
|
|
1510
|
-
return t || N(e, 4, this.length), this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24;
|
|
1511
|
-
}, r.prototype.readInt32BE = function(e, t) {
|
|
1512
|
-
return t || N(e, 4, this.length), this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3];
|
|
1513
|
-
}, r.prototype.readFloatLE = function(e, t) {
|
|
1514
|
-
return t || N(e, 4, this.length), ee.read(this, e, !0, 23, 4);
|
|
1515
|
-
}, r.prototype.readFloatBE = function(e, t) {
|
|
1516
|
-
return t || N(e, 4, this.length), ee.read(this, e, !1, 23, 4);
|
|
1517
|
-
}, r.prototype.readDoubleLE = function(e, t) {
|
|
1518
|
-
return t || N(e, 8, this.length), ee.read(this, e, !0, 52, 8);
|
|
1519
|
-
}, r.prototype.readDoubleBE = function(e, t) {
|
|
1520
|
-
return t || N(e, 8, this.length), ee.read(this, e, !1, 52, 8);
|
|
1521
|
-
}, r.prototype.writeUIntLE = function(e, t, n, f) {
|
|
1522
|
-
e = +e, t |= 0, n |= 0, !f && K(this, e, t, n, Math.pow(2, 8 * n) - 1, 0);
|
|
1523
|
-
var v = 1, T = 0;
|
|
1524
|
-
for (this[t] = 255 & e; ++T < n && (v *= 256); ) this[t + T] = e / v & 255;
|
|
1525
|
-
return t + n;
|
|
1526
|
-
}, r.prototype.writeUIntBE = function(e, t, n, f) {
|
|
1527
|
-
e = +e, t |= 0, n |= 0, !f && K(this, e, t, n, Math.pow(2, 8 * n) - 1, 0);
|
|
1528
|
-
var v = n - 1, T = 1;
|
|
1529
|
-
for (this[t + v] = 255 & e; --v >= 0 && (T *= 256); ) this[t + v] = e / T & 255;
|
|
1530
|
-
return t + n;
|
|
1531
|
-
}, r.prototype.writeUInt8 = function(e, t, n) {
|
|
1532
|
-
return e = +e, t |= 0, n || K(this, e, t, 1, 255, 0), r.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), this[t] = 255 & e, t + 1;
|
|
1533
|
-
}, r.prototype.writeUInt16LE = function(e, t, n) {
|
|
1534
|
-
return e = +e, t |= 0, n || K(this, e, t, 2, 65535, 0), r.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e, this[t + 1] = e >>> 8) : X(this, e, t, !0), t + 2;
|
|
1535
|
-
}, r.prototype.writeUInt16BE = function(e, t, n) {
|
|
1536
|
-
return e = +e, t |= 0, n || K(this, e, t, 2, 65535, 0), r.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8, this[t + 1] = 255 & e) : X(this, e, t, !1), t + 2;
|
|
1537
|
-
}, r.prototype.writeUInt32LE = function(e, t, n) {
|
|
1538
|
-
return e = +e, t |= 0, n || K(this, e, t, 4, 4294967295, 0), r.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24, this[t + 2] = e >>> 16, this[t + 1] = e >>> 8, this[t] = 255 & e) : O(this, e, t, !0), t + 4;
|
|
1539
|
-
}, r.prototype.writeUInt32BE = function(e, t, n) {
|
|
1540
|
-
return e = +e, t |= 0, n || K(this, e, t, 4, 4294967295, 0), r.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = 255 & e) : O(this, e, t, !1), t + 4;
|
|
1541
|
-
}, r.prototype.writeIntLE = function(e, t, n, f) {
|
|
1542
|
-
if (e = +e, t |= 0, !f) {
|
|
1543
|
-
var v = Math.pow(2, 8 * n - 1);
|
|
1544
|
-
K(this, e, t, n, v - 1, -v);
|
|
1545
|
-
}
|
|
1546
|
-
var T = 0, Y = 1, J = 0;
|
|
1547
|
-
for (this[t] = 255 & e; ++T < n && (Y *= 256); ) e < 0 && J === 0 && this[t + T - 1] !== 0 && (J = 1), this[t + T] = (e / Y >> 0) - J & 255;
|
|
1548
|
-
return t + n;
|
|
1549
|
-
}, r.prototype.writeIntBE = function(e, t, n, f) {
|
|
1550
|
-
if (e = +e, t |= 0, !f) {
|
|
1551
|
-
var v = Math.pow(2, 8 * n - 1);
|
|
1552
|
-
K(this, e, t, n, v - 1, -v);
|
|
1553
|
-
}
|
|
1554
|
-
var T = n - 1, Y = 1, J = 0;
|
|
1555
|
-
for (this[t + T] = 255 & e; --T >= 0 && (Y *= 256); ) e < 0 && J === 0 && this[t + T + 1] !== 0 && (J = 1), this[t + T] = (e / Y >> 0) - J & 255;
|
|
1556
|
-
return t + n;
|
|
1557
|
-
}, r.prototype.writeInt8 = function(e, t, n) {
|
|
1558
|
-
return e = +e, t |= 0, n || K(this, e, t, 1, 127, -128), r.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), e < 0 && (e = 255 + e + 1), this[t] = 255 & e, t + 1;
|
|
1559
|
-
}, r.prototype.writeInt16LE = function(e, t, n) {
|
|
1560
|
-
return e = +e, t |= 0, n || K(this, e, t, 2, 32767, -32768), r.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e, this[t + 1] = e >>> 8) : X(this, e, t, !0), t + 2;
|
|
1561
|
-
}, r.prototype.writeInt16BE = function(e, t, n) {
|
|
1562
|
-
return e = +e, t |= 0, n || K(this, e, t, 2, 32767, -32768), r.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8, this[t + 1] = 255 & e) : X(this, e, t, !1), t + 2;
|
|
1563
|
-
}, r.prototype.writeInt32LE = function(e, t, n) {
|
|
1564
|
-
return e = +e, t |= 0, n || K(this, e, t, 4, 2147483647, -2147483648), r.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e, this[t + 1] = e >>> 8, this[t + 2] = e >>> 16, this[t + 3] = e >>> 24) : O(this, e, t, !0), t + 4;
|
|
1565
|
-
}, r.prototype.writeInt32BE = function(e, t, n) {
|
|
1566
|
-
return e = +e, t |= 0, n || K(this, e, t, 4, 2147483647, -2147483648), e < 0 && (e = 4294967295 + e + 1), r.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24, this[t + 1] = e >>> 16, this[t + 2] = e >>> 8, this[t + 3] = 255 & e) : O(this, e, t, !1), t + 4;
|
|
1567
|
-
}, r.prototype.writeFloatLE = function(e, t, n) {
|
|
1568
|
-
return U(this, e, t, !0, n);
|
|
1569
|
-
}, r.prototype.writeFloatBE = function(e, t, n) {
|
|
1570
|
-
return U(this, e, t, !1, n);
|
|
1571
|
-
}, r.prototype.writeDoubleLE = function(e, t, n) {
|
|
1572
|
-
return C(this, e, t, !0, n);
|
|
1573
|
-
}, r.prototype.writeDoubleBE = function(e, t, n) {
|
|
1574
|
-
return C(this, e, t, !1, n);
|
|
1575
|
-
}, r.prototype.copy = function(e, t, n, f) {
|
|
1576
|
-
if (n || (n = 0), f || f === 0 || (f = this.length), t >= e.length && (t = e.length), t || (t = 0), f > 0 && f < n && (f = n), f === n || e.length === 0 || this.length === 0) return 0;
|
|
1577
|
-
if (t < 0) throw new RangeError("targetStart out of bounds");
|
|
1578
|
-
if (n < 0 || n >= this.length) throw new RangeError("sourceStart out of bounds");
|
|
1579
|
-
if (f < 0) throw new RangeError("sourceEnd out of bounds");
|
|
1580
|
-
f > this.length && (f = this.length), e.length - t < f - n && (f = e.length - t + n);
|
|
1581
|
-
var v, T = f - n;
|
|
1582
|
-
if (this === e && n < t && t < f) for (v = T - 1; v >= 0; --v) e[v + t] = this[v + n];
|
|
1583
|
-
else if (T < 1e3 || !r.TYPED_ARRAY_SUPPORT) for (v = 0; v < T; ++v) e[v + t] = this[v + n];
|
|
1584
|
-
else Uint8Array.prototype.set.call(e, this.subarray(n, n + T), t);
|
|
1585
|
-
return T;
|
|
1586
|
-
}, r.prototype.fill = function(e, t, n, f) {
|
|
1587
|
-
if (typeof e == "string") {
|
|
1588
|
-
if (typeof t == "string" ? (f = t, t = 0, n = this.length) : typeof n == "string" && (f = n, n = this.length), e.length === 1) {
|
|
1589
|
-
var v = e.charCodeAt(0);
|
|
1590
|
-
v < 256 && (e = v);
|
|
1591
|
-
}
|
|
1592
|
-
if (f !== void 0 && typeof f != "string") throw new TypeError("encoding must be a string");
|
|
1593
|
-
if (typeof f == "string" && !r.isEncoding(f)) throw new TypeError("Unknown encoding: " + f);
|
|
1594
|
-
} else typeof e == "number" && (e &= 255);
|
|
1595
|
-
if (t < 0 || this.length < t || this.length < n) throw new RangeError("Out of range index");
|
|
1596
|
-
if (n <= t) return this;
|
|
1597
|
-
t >>>= 0, n = n === void 0 ? this.length : n >>> 0, e || (e = 0);
|
|
1598
|
-
var T;
|
|
1599
|
-
if (typeof e == "number") for (T = t; T < n; ++T) this[T] = e;
|
|
1600
|
-
else {
|
|
1601
|
-
var Y = r.isBuffer(e) ? e : te(new r(e, f).toString()), J = Y.length;
|
|
1602
|
-
for (T = 0; T < n - t; ++T) this[T + t] = Y[T % J];
|
|
1603
|
-
}
|
|
1604
|
-
return this;
|
|
1605
|
-
};
|
|
1606
|
-
var ye = /[^+\/0-9A-Za-z-_]/g;
|
|
1607
|
-
}).call(E, A(4));
|
|
1608
|
-
}, function(H, E, A) {
|
|
1609
|
-
function _(m) {
|
|
1610
|
-
var p = m.length;
|
|
1611
|
-
if (p % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4");
|
|
1612
|
-
return m[p - 2] === "=" ? 2 : m[p - 1] === "=" ? 1 : 0;
|
|
1613
|
-
}
|
|
1614
|
-
function k(m) {
|
|
1615
|
-
return 3 * m.length / 4 - _(m);
|
|
1616
|
-
}
|
|
1617
|
-
function R(m) {
|
|
1618
|
-
var p, w, B, I, y, S = m.length;
|
|
1619
|
-
I = _(m), y = new i(3 * S / 4 - I), w = I > 0 ? S - 4 : S;
|
|
1620
|
-
var M = 0;
|
|
1621
|
-
for (p = 0; p < w; p += 4) B = o[m.charCodeAt(p)] << 18 | o[m.charCodeAt(p + 1)] << 12 | o[m.charCodeAt(p + 2)] << 6 | o[m.charCodeAt(p + 3)], y[M++] = B >> 16 & 255, y[M++] = B >> 8 & 255, y[M++] = 255 & B;
|
|
1622
|
-
return I === 2 ? (B = o[m.charCodeAt(p)] << 2 | o[m.charCodeAt(p + 1)] >> 4, y[M++] = 255 & B) : I === 1 && (B = o[m.charCodeAt(p)] << 10 | o[m.charCodeAt(p + 1)] << 4 | o[m.charCodeAt(p + 2)] >> 2, y[M++] = B >> 8 & 255, y[M++] = 255 & B), y;
|
|
1623
|
-
}
|
|
1624
|
-
function r(m) {
|
|
1625
|
-
return u[m >> 18 & 63] + u[m >> 12 & 63] + u[m >> 6 & 63] + u[63 & m];
|
|
1626
|
-
}
|
|
1627
|
-
function c(m, p, w) {
|
|
1628
|
-
for (var B, I = [], y = p; y < w; y += 3) B = (m[y] << 16) + (m[y + 1] << 8) + m[y + 2], I.push(r(B));
|
|
1629
|
-
return I.join("");
|
|
1630
|
-
}
|
|
1631
|
-
function d(m) {
|
|
1632
|
-
for (var p, w = m.length, B = w % 3, I = "", y = [], S = 0, M = w - B; S < M; S += 16383) y.push(c(m, S, S + 16383 > M ? M : S + 16383));
|
|
1633
|
-
return B === 1 ? (p = m[w - 1], I += u[p >> 2], I += u[p << 4 & 63], I += "==") : B === 2 && (p = (m[w - 2] << 8) + m[w - 1], I += u[p >> 10], I += u[p >> 4 & 63], I += u[p << 2 & 63], I += "="), y.push(I), y.join("");
|
|
1634
|
-
}
|
|
1635
|
-
E.byteLength = k, E.toByteArray = R, E.fromByteArray = d;
|
|
1636
|
-
for (var u = [], o = [], i = typeof Uint8Array != "undefined" ? Uint8Array : Array, a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", h = 0, l = a.length; h < l; ++h) u[h] = a[h], o[a.charCodeAt(h)] = h;
|
|
1637
|
-
o[45] = 62, o[95] = 63;
|
|
1638
|
-
}, function(H, E) {
|
|
1639
|
-
E.read = function(A, _, k, R, r) {
|
|
1640
|
-
var c, d, u = 8 * r - R - 1, o = (1 << u) - 1, i = o >> 1, a = -7, h = k ? r - 1 : 0, l = k ? -1 : 1, m = A[_ + h];
|
|
1641
|
-
for (h += l, c = m & (1 << -a) - 1, m >>= -a, a += u; a > 0; c = 256 * c + A[_ + h], h += l, a -= 8) ;
|
|
1642
|
-
for (d = c & (1 << -a) - 1, c >>= -a, a += R; a > 0; d = 256 * d + A[_ + h], h += l, a -= 8) ;
|
|
1643
|
-
if (c === 0) c = 1 - i;
|
|
1644
|
-
else {
|
|
1645
|
-
if (c === o) return d ? NaN : 1 / 0 * (m ? -1 : 1);
|
|
1646
|
-
d += Math.pow(2, R), c -= i;
|
|
1647
|
-
}
|
|
1648
|
-
return (m ? -1 : 1) * d * Math.pow(2, c - R);
|
|
1649
|
-
}, E.write = function(A, _, k, R, r, c) {
|
|
1650
|
-
var d, u, o, i = 8 * c - r - 1, a = (1 << i) - 1, h = a >> 1, l = r === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, m = R ? 0 : c - 1, p = R ? 1 : -1, w = _ < 0 || _ === 0 && 1 / _ < 0 ? 1 : 0;
|
|
1651
|
-
for (_ = Math.abs(_), isNaN(_) || _ === 1 / 0 ? (u = isNaN(_) ? 1 : 0, d = a) : (d = Math.floor(Math.log(_) / Math.LN2), _ * (o = Math.pow(2, -d)) < 1 && (d--, o *= 2), _ += d + h >= 1 ? l / o : l * Math.pow(2, 1 - h), _ * o >= 2 && (d++, o /= 2), d + h >= a ? (u = 0, d = a) : d + h >= 1 ? (u = (_ * o - 1) * Math.pow(2, r), d += h) : (u = _ * Math.pow(2, h - 1) * Math.pow(2, r), d = 0)); r >= 8; A[k + m] = 255 & u, m += p, u /= 256, r -= 8) ;
|
|
1652
|
-
for (d = d << r | u, i += r; i > 0; A[k + m] = 255 & d, m += p, d /= 256, i -= 8) ;
|
|
1653
|
-
A[k + m - p] |= 128 * w;
|
|
1654
|
-
};
|
|
1655
|
-
}, function(H, E) {
|
|
1656
|
-
var A = {}.toString;
|
|
1657
|
-
H.exports = Array.isArray || function(_) {
|
|
1658
|
-
return A.call(_) == "[object Array]";
|
|
1659
|
-
};
|
|
1660
|
-
}, function(H, E, A) {
|
|
1661
|
-
function _(r, c) {
|
|
1662
|
-
if (!(r instanceof c)) throw new TypeError("Cannot call a class as a function");
|
|
1663
|
-
}
|
|
1664
|
-
Object.defineProperty(E, "__esModule", { value: !0 });
|
|
1665
|
-
var k = /* @__PURE__ */ function() {
|
|
1666
|
-
function r(c, d) {
|
|
1667
|
-
for (var u = 0; u < d.length; u++) {
|
|
1668
|
-
var o = d[u];
|
|
1669
|
-
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(c, o.key, o);
|
|
1670
|
-
}
|
|
1671
|
-
}
|
|
1672
|
-
return function(c, d, u) {
|
|
1673
|
-
return d && r(c.prototype, d), u && r(c, u), c;
|
|
1674
|
-
};
|
|
1675
|
-
}(), R = function() {
|
|
1676
|
-
function r() {
|
|
1677
|
-
_(this, r);
|
|
1678
|
-
}
|
|
1679
|
-
return k(r, null, [{ key: "set", value: function(c, d) {
|
|
1680
|
-
try {
|
|
1681
|
-
window.localStorage && localStorage.setItem(c, d);
|
|
1682
|
-
} catch (u) {
|
|
1683
|
-
window[c + "_localStorage"] = d;
|
|
1684
|
-
}
|
|
1685
|
-
} }, { key: "get", value: function(c) {
|
|
1686
|
-
try {
|
|
1687
|
-
if (window.localStorage) return localStorage.getItem(c);
|
|
1688
|
-
} catch (d) {
|
|
1689
|
-
return window[c + "_localStorage"];
|
|
1690
|
-
}
|
|
1691
|
-
return "";
|
|
1692
|
-
} }, { key: "remove", value: function(c) {
|
|
1693
|
-
try {
|
|
1694
|
-
window.localStorage && localStorage.removeItem(c);
|
|
1695
|
-
} catch (d) {
|
|
1696
|
-
delete window[c + "_localStorage"];
|
|
1697
|
-
}
|
|
1698
|
-
} }]), r;
|
|
1699
|
-
}();
|
|
1700
|
-
E.default = R;
|
|
1701
|
-
}, function(H, E, A) {
|
|
1702
|
-
function _(r, c) {
|
|
1703
|
-
if (!(r instanceof c)) throw new TypeError("Cannot call a class as a function");
|
|
1704
|
-
}
|
|
1705
|
-
Object.defineProperty(E, "__esModule", { value: !0 });
|
|
1706
|
-
var k = /* @__PURE__ */ function() {
|
|
1707
|
-
function r(c, d) {
|
|
1708
|
-
for (var u = 0; u < d.length; u++) {
|
|
1709
|
-
var o = d[u];
|
|
1710
|
-
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(c, o.key, o);
|
|
1711
|
-
}
|
|
1712
|
-
}
|
|
1713
|
-
return function(c, d, u) {
|
|
1714
|
-
return d && r(c.prototype, d), u && r(c, u), c;
|
|
1715
|
-
};
|
|
1716
|
-
}(), R = function() {
|
|
1717
|
-
function r() {
|
|
1718
|
-
_(this, r);
|
|
1719
|
-
}
|
|
1720
|
-
return k(r, null, [{ key: "get", value: function(c) {
|
|
1721
|
-
for (var d = c + "", u = document.cookie.split(";"), o = 0; o < u.length; o++) {
|
|
1722
|
-
var i = u[o].trim();
|
|
1723
|
-
if (i.indexOf(d) == 0) return unescape(i.substring(d.length + 1, i.length));
|
|
1724
|
-
}
|
|
1725
|
-
return "";
|
|
1726
|
-
} }, { key: "set", value: function(c, d, u) {
|
|
1727
|
-
var o = /* @__PURE__ */ new Date();
|
|
1728
|
-
o.setTime(o.getTime() + 24 * u * 60 * 60 * 1e3);
|
|
1729
|
-
var i = "expires=" + o.toGMTString();
|
|
1730
|
-
document.cookie = c + "=" + escape(d) + "; " + i;
|
|
1731
|
-
} }]), r;
|
|
1732
|
-
}();
|
|
1733
|
-
E.default = R;
|
|
1734
|
-
}, function(H, E, A) {
|
|
1735
|
-
function _(i) {
|
|
1736
|
-
return i && i.__esModule ? i : { default: i };
|
|
1737
|
-
}
|
|
1738
|
-
function k(i, a) {
|
|
1739
|
-
if (!(i instanceof a)) throw new TypeError("Cannot call a class as a function");
|
|
1740
|
-
}
|
|
1741
|
-
Object.defineProperty(E, "__esModule", { value: !0 });
|
|
1742
|
-
var R = /* @__PURE__ */ function() {
|
|
1743
|
-
function i(a, h) {
|
|
1744
|
-
for (var l = 0; l < h.length; l++) {
|
|
1745
|
-
var m = h[l];
|
|
1746
|
-
m.enumerable = m.enumerable || !1, m.configurable = !0, "value" in m && (m.writable = !0), Object.defineProperty(a, m.key, m);
|
|
1747
|
-
}
|
|
1748
|
-
}
|
|
1749
|
-
return function(a, h, l) {
|
|
1750
|
-
return h && i(a.prototype, h), l && i(a, l), a;
|
|
1751
|
-
};
|
|
1752
|
-
}(), r = A(9), c = _(r), d = A(10), u = _(d), o = function() {
|
|
1753
|
-
function i() {
|
|
1754
|
-
k(this, i);
|
|
1755
|
-
}
|
|
1756
|
-
return R(i, null, [{ key: "refreshUploadAuth", value: function(a, h, l) {
|
|
1757
|
-
var m = (u.default.randomUUID(), u.default.randomUUID()), p = { AccessKeyId: a.accessKeyId, SecurityToken: a.securityToken, Action: "RefreshUploadVideo", VideoId: a.videoId, Version: "2017-03-21", Format: "JSON", SignatureMethod: "HMAC-SHA1", SignatureVersion: "1.0", SignatureNonce: m, RequestId: a.requestId }, w = u.default.makeUTF8sort(p, "=", "&") + "&Signature=" + u.default.aliyunEncodeURI(u.default.makeChangeSiga(p, a.accessKeySecret)), B = "https://vod." + a.region + ".aliyuncs.com/?" + w;
|
|
1758
|
-
c.default.get(B, function(y) {
|
|
1759
|
-
var y = JSON.parse(y);
|
|
1760
|
-
h && h(y);
|
|
1761
|
-
}, function(I) {
|
|
1762
|
-
if (l) {
|
|
1763
|
-
var y = JSON.parse(I);
|
|
1764
|
-
l(y);
|
|
1765
|
-
}
|
|
1766
|
-
});
|
|
1767
|
-
} }, { key: "getUploadAuth", value: function(a, h, l) {
|
|
1768
|
-
var m = (u.default.randomUUID(), u.default.randomUUID()), p = { AccessKeyId: a.accessKeyId, SecurityToken: a.securityToken, Action: "CreateUploadVideo", Title: a.title, FileName: a.fileName, Version: "2017-03-21", Format: "JSON", SignatureMethod: "HMAC-SHA1", SignatureVersion: "1.0", SignatureNonce: m, RequestId: a.requestId };
|
|
1769
|
-
a.fileSize && (p.FileSize = a.fileSize), a.description && (p.Description = a.description), a.cateId && (p.CateId = a.cateId), a.tags && (p.Tags = a.tags), a.templateGroupId && (p.TemplateGroupId = a.templateGroupId), a.storageLocation && (p.StorageLocation = a.storageLocation), a.coverUrl && (p.CoverURL = a.coverUrl), a.transCodeMode && (p.TransCodeMode = a.transCodeMode), a.userData && (p.UserData = JSON.stringify(a.userData)), a.WorkflowId && (p.WorkflowId = a.WorkflowId), a.AppId && (p.AppId = a.AppId);
|
|
1770
|
-
var w = u.default.makeUTF8sort(p, "=", "&") + "&Signature=" + u.default.aliyunEncodeURI(u.default.makeChangeSiga(p, a.accessKeySecret)), B = "https://vod." + a.region + ".aliyuncs.com/?" + w;
|
|
1771
|
-
c.default.get(B, function(I) {
|
|
1772
|
-
try {
|
|
1773
|
-
I = JSON.parse(I);
|
|
1774
|
-
} catch (y) {
|
|
1775
|
-
if (l) return void l({ Code: "GetUploadAuthFailed", Message: "获取uploadauth失败" });
|
|
1776
|
-
}
|
|
1777
|
-
h && h(I);
|
|
1778
|
-
}, function(I) {
|
|
1779
|
-
if (l) {
|
|
1780
|
-
var y = { Code: "GetUploadAuthFailed", Message: "获取uploadauth失败" };
|
|
1781
|
-
try {
|
|
1782
|
-
y = JSON.parse(I);
|
|
1783
|
-
} catch (S) {
|
|
1784
|
-
}
|
|
1785
|
-
l(y);
|
|
1786
|
-
}
|
|
1787
|
-
});
|
|
1788
|
-
} }, { key: "getImageUploadAuth", value: function(a, h, l) {
|
|
1789
|
-
var m = (u.default.randomUUID(), u.default.randomUUID()), p = { AccessKeyId: a.accessKeyId, SecurityToken: a.securityToken, Action: "CreateUploadImage", ImageType: a.imageType ? a.imageType : "default", Version: "2017-03-21", Format: "JSON", SignatureMethod: "HMAC-SHA1", SignatureVersion: "1.0", SignatureNonce: m, RequestId: a.requestId };
|
|
1790
|
-
a.title && (p.Title = a.title), a.imageExt && (p.ImageExt = a.imageExt), a.tags && (p.Tags = a.tags), a.storageLocation && (p.StorageLocation = a.storageLocation);
|
|
1791
|
-
var w = u.default.makeUTF8sort(p, "=", "&") + "&Signature=" + u.default.aliyunEncodeURI(u.default.makeChangeSiga(p, a.accessKeySecret)), B = "https://vod." + a.region + ".aliyuncs.com/?" + w;
|
|
1792
|
-
c.default.get(B, function(I) {
|
|
1793
|
-
I = JSON.parse(I), h && h(I);
|
|
1794
|
-
}, function(I) {
|
|
1795
|
-
if (l) {
|
|
1796
|
-
var y = JSON.parse(I);
|
|
1797
|
-
l(y);
|
|
1798
|
-
}
|
|
1799
|
-
});
|
|
1800
|
-
} }]), i;
|
|
1801
|
-
}();
|
|
1802
|
-
E.default = o;
|
|
1803
|
-
}, function(H, E, A) {
|
|
1804
|
-
(function(_, k, R) {
|
|
1805
|
-
H.exports = k(A(0), A(29), A(30));
|
|
1806
|
-
})(0, function(_) {
|
|
1807
|
-
return _.HmacSHA1;
|
|
1808
|
-
});
|
|
1809
|
-
}, function(H, E) {
|
|
1810
|
-
}, function(H, E, A) {
|
|
1811
|
-
(function(_, k) {
|
|
1812
|
-
H.exports = k(A(0));
|
|
1813
|
-
})(0, function(_) {
|
|
1814
|
-
return function() {
|
|
1815
|
-
var k = _, R = k.lib, r = R.WordArray, c = R.Hasher, d = k.algo, u = [], o = d.SHA1 = c.extend({ _doReset: function() {
|
|
1816
|
-
this._hash = new r.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);
|
|
1817
|
-
}, _doProcessBlock: function(i, a) {
|
|
1818
|
-
for (var h = this._hash.words, l = h[0], m = h[1], p = h[2], w = h[3], B = h[4], I = 0; I < 80; I++) {
|
|
1819
|
-
if (I < 16) u[I] = 0 | i[a + I];
|
|
1820
|
-
else {
|
|
1821
|
-
var y = u[I - 3] ^ u[I - 8] ^ u[I - 14] ^ u[I - 16];
|
|
1822
|
-
u[I] = y << 1 | y >>> 31;
|
|
1823
|
-
}
|
|
1824
|
-
var S = (l << 5 | l >>> 27) + B + u[I];
|
|
1825
|
-
S += I < 20 ? 1518500249 + (m & p | ~m & w) : I < 40 ? 1859775393 + (m ^ p ^ w) : I < 60 ? (m & p | m & w | p & w) - 1894007588 : (m ^ p ^ w) - 899497514, B = w, w = p, p = m << 30 | m >>> 2, m = l, l = S;
|
|
1826
|
-
}
|
|
1827
|
-
h[0] = h[0] + l | 0, h[1] = h[1] + m | 0, h[2] = h[2] + p | 0, h[3] = h[3] + w | 0, h[4] = h[4] + B | 0;
|
|
1828
|
-
}, _doFinalize: function() {
|
|
1829
|
-
var i = this._data, a = i.words, h = 8 * this._nDataBytes, l = 8 * i.sigBytes;
|
|
1830
|
-
return a[l >>> 5] |= 128 << 24 - l % 32, a[14 + (l + 64 >>> 9 << 4)] = Math.floor(h / 4294967296), a[15 + (l + 64 >>> 9 << 4)] = h, i.sigBytes = 4 * a.length, this._process(), this._hash;
|
|
1831
|
-
}, clone: function() {
|
|
1832
|
-
var i = c.clone.call(this);
|
|
1833
|
-
return i._hash = this._hash.clone(), i;
|
|
1834
|
-
} });
|
|
1835
|
-
k.SHA1 = c._createHelper(o), k.HmacSHA1 = c._createHmacHelper(o);
|
|
1836
|
-
}(), _.SHA1;
|
|
1837
|
-
});
|
|
1838
|
-
}, function(H, E, A) {
|
|
1839
|
-
(function(_, k) {
|
|
1840
|
-
H.exports = k(A(0));
|
|
1841
|
-
})(0, function(_) {
|
|
1842
|
-
(function() {
|
|
1843
|
-
var k = _, R = k.lib, r = R.Base, c = k.enc, d = c.Utf8, u = k.algo;
|
|
1844
|
-
u.HMAC = r.extend({ init: function(o, i) {
|
|
1845
|
-
o = this._hasher = new o.init(), typeof i == "string" && (i = d.parse(i));
|
|
1846
|
-
var a = o.blockSize, h = 4 * a;
|
|
1847
|
-
i.sigBytes > h && (i = o.finalize(i)), i.clamp();
|
|
1848
|
-
for (var l = this._oKey = i.clone(), m = this._iKey = i.clone(), p = l.words, w = m.words, B = 0; B < a; B++) p[B] ^= 1549556828, w[B] ^= 909522486;
|
|
1849
|
-
l.sigBytes = m.sigBytes = h, this.reset();
|
|
1850
|
-
}, reset: function() {
|
|
1851
|
-
var o = this._hasher;
|
|
1852
|
-
o.reset(), o.update(this._iKey);
|
|
1853
|
-
}, update: function(o) {
|
|
1854
|
-
return this._hasher.update(o), this;
|
|
1855
|
-
}, finalize: function(o) {
|
|
1856
|
-
var i = this._hasher, a = i.finalize(o);
|
|
1857
|
-
return i.reset(), i.finalize(this._oKey.clone().concat(a));
|
|
1858
|
-
} });
|
|
1859
|
-
})();
|
|
1860
|
-
});
|
|
1861
|
-
}, function(H, E, A) {
|
|
1862
|
-
(function(_, k) {
|
|
1863
|
-
H.exports = k(A(0));
|
|
1864
|
-
})(0, function(_) {
|
|
1865
|
-
return function() {
|
|
1866
|
-
function k(u, o, i) {
|
|
1867
|
-
for (var a = [], h = 0, l = 0; l < o; l++) if (l % 4) {
|
|
1868
|
-
var m = i[u.charCodeAt(l - 1)] << l % 4 * 2, p = i[u.charCodeAt(l)] >>> 6 - l % 4 * 2, w = m | p;
|
|
1869
|
-
a[h >>> 2] |= w << 24 - h % 4 * 8, h++;
|
|
1870
|
-
}
|
|
1871
|
-
return c.create(a, h);
|
|
1872
|
-
}
|
|
1873
|
-
var R = _, r = R.lib, c = r.WordArray, d = R.enc;
|
|
1874
|
-
d.Base64 = { stringify: function(u) {
|
|
1875
|
-
var o = u.words, i = u.sigBytes, a = this._map;
|
|
1876
|
-
u.clamp();
|
|
1877
|
-
for (var h = [], l = 0; l < i; l += 3) for (var m = o[l >>> 2] >>> 24 - l % 4 * 8 & 255, p = o[l + 1 >>> 2] >>> 24 - (l + 1) % 4 * 8 & 255, w = o[l + 2 >>> 2] >>> 24 - (l + 2) % 4 * 8 & 255, B = m << 16 | p << 8 | w, I = 0; I < 4 && l + 0.75 * I < i; I++) h.push(a.charAt(B >>> 6 * (3 - I) & 63));
|
|
1878
|
-
var y = a.charAt(64);
|
|
1879
|
-
if (y) for (; h.length % 4; ) h.push(y);
|
|
1880
|
-
return h.join("");
|
|
1881
|
-
}, parse: function(u) {
|
|
1882
|
-
var o = u.length, i = this._map, a = this._reverseMap;
|
|
1883
|
-
if (!a) {
|
|
1884
|
-
a = this._reverseMap = [];
|
|
1885
|
-
for (var h = 0; h < i.length; h++) a[i.charCodeAt(h)] = h;
|
|
1886
|
-
}
|
|
1887
|
-
var l = i.charAt(64);
|
|
1888
|
-
if (l) {
|
|
1889
|
-
var m = u.indexOf(l);
|
|
1890
|
-
m !== -1 && (o = m);
|
|
1891
|
-
}
|
|
1892
|
-
return k(u, o, a);
|
|
1893
|
-
}, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" };
|
|
1894
|
-
}(), _.enc.Base64;
|
|
1895
|
-
});
|
|
1896
|
-
}, function(H, E, A) {
|
|
1897
|
-
function _(M) {
|
|
1898
|
-
return M && M.__esModule ? M : { default: M };
|
|
1899
|
-
}
|
|
1900
|
-
function k(M, L) {
|
|
1901
|
-
if (!(M instanceof L)) throw new TypeError("Cannot call a class as a function");
|
|
1902
|
-
}
|
|
1903
|
-
Object.defineProperty(E, "__esModule", { value: !0 });
|
|
1904
|
-
var R = /* @__PURE__ */ function() {
|
|
1905
|
-
function M(L, z) {
|
|
1906
|
-
for (var V = 0; V < z.length; V++) {
|
|
1907
|
-
var q = z[V];
|
|
1908
|
-
q.enumerable = q.enumerable || !1, q.configurable = !0, "value" in q && (q.writable = !0), Object.defineProperty(L, q.key, q);
|
|
1909
|
-
}
|
|
1910
|
-
}
|
|
1911
|
-
return function(L, z, V) {
|
|
1912
|
-
return z && M(L.prototype, z), V && M(L, V), L;
|
|
1913
|
-
};
|
|
1914
|
-
}(), r = A(9), c = _(r), d = A(8), u = _(d), o = A(5), i = _(o), a = A(7), h = _(a), l = A(1), m = _(l), p = A(10), w = _(p), B = A(2), I = A(12), y = A(11), S = function() {
|
|
1915
|
-
function M() {
|
|
1916
|
-
k(this, M);
|
|
1917
|
-
}
|
|
1918
|
-
return R(M, null, [{ key: "getAuthInfo", value: function(L, z, V) {
|
|
1919
|
-
var q = L + "|f#Ylm&^1TppeRhLg|" + V;
|
|
1920
|
-
return z && (q = L + "|" + z + "|f#Ylm&^1TppeRhLg|" + V), B(y.parse(q)).toString(I);
|
|
1921
|
-
} }, { key: "upload", value: function(L, z, V) {
|
|
1922
|
-
var q = m.default.ISODateString(/* @__PURE__ */ new Date()), W = Math.floor((/* @__PURE__ */ new Date()).valueOf() / 1e3), s = i.default.getClientId();
|
|
1923
|
-
s = i.default.setClientId(s);
|
|
1924
|
-
var g = M.getAuthInfo(L.userId, s, W), b = w.default.randomUUID(), P = { Source: "WebSDK", BusinessType: "UploadVideo", Action: "ReportUploadProgress", TerminalType: "H5", DeviceModel: u.default.browser.name + (u.default.browser.version || ""), AppVersion: h.default.version, AuthTimestamp: W, Timestamp: q, AuthInfo: g, FileName: L.file.name, FileSize: L.file.size, FileCreateTime: L.file.lastModified, FileHash: L.fileHash, UploadId: L.checkpoint.checkpoint.uploadId, PartSize: L.checkpoint.checkpoint.partSize, DonePartsCount: L.checkpoint.checkpoint.doneParts.length, UploadPoint: JSON.stringify(L.checkpoint), UploadRatio: L.checkpoint.loaded, UserId: L.userId, VideoId: L.videoId, Version: "2017-03-21", Format: "JSON", SignatureMethod: "HMAC-SHA1", SignatureVersion: "1.0", SignatureNonce: b };
|
|
1925
|
-
s && (P.ClientId = s);
|
|
1926
|
-
var x = w.default.makeUTF8sort(P, "=", "&") + "&Signature=" + w.default.aliyunEncodeURI(w.default.makeChangeSiga(P, L.accessKeySecret)), F = "https://vod." + L.region + ".aliyuncs.com/?";
|
|
1927
|
-
c.default.post(F, function(j) {
|
|
1928
|
-
z && z();
|
|
1929
|
-
}, function(j) {
|
|
1930
|
-
j && V(j);
|
|
1931
|
-
}, x);
|
|
1932
|
-
} }, { key: "get", value: function(L, z, V) {
|
|
1933
|
-
var q = m.default.ISODateString(/* @__PURE__ */ new Date()), W = Math.floor((/* @__PURE__ */ new Date()).valueOf() / 1e3), s = i.default.getClientId(), g = M.getAuthInfo(L.userId, s, W), b = w.default.randomUUID(), P = { Source: "WebSDK", BusinessType: "UploadVideo", Action: "GetUploadProgress", TerminalType: "H5", DeviceModel: u.default.browser.name + (u.default.browser.version || ""), AppVersion: h.default.version, AuthTimestamp: W, Timestamp: q, AuthInfo: g, UserId: L.userId, UploadInfoList: JSON.stringify(L.uploadInfoList), Version: "2017-03-21", Format: "JSON", SignatureMethod: "HMAC-SHA1", SignatureVersion: "1.0", SignatureNonce: b };
|
|
1934
|
-
s && (P.ClientId = s);
|
|
1935
|
-
var x = w.default.makeUTF8sort(P, "=", "&") + "&Signature=" + w.default.aliyunEncodeURI(w.default.makeChangeSiga(P, L.accessKeySecret)), F = "https://vod." + L.region + ".aliyuncs.com/?" + x;
|
|
1936
|
-
c.default.get(F, function(j) {
|
|
1937
|
-
var N = {}, K = s;
|
|
1938
|
-
j = j ? JSON.parse(j) : {}, j.UploadProgress && j.UploadProgress.UploadProgressList && j.UploadProgress.UploadProgressList.length > 0 && (N = j.UploadProgress.UploadProgressList[0], K = N.ClientId), i.default.setClientId(K), z && z(N);
|
|
1939
|
-
}, function(j) {
|
|
1940
|
-
j && V(j);
|
|
1941
|
-
});
|
|
1942
|
-
} }]), M;
|
|
1943
|
-
}();
|
|
1944
|
-
E.default = S;
|
|
1945
|
-
}, function(H, E, A) {
|
|
1946
|
-
function _(d, u) {
|
|
1947
|
-
if (!(d instanceof u)) throw new TypeError("Cannot call a class as a function");
|
|
1948
|
-
}
|
|
1949
|
-
Object.defineProperty(E, "__esModule", { value: !0 });
|
|
1950
|
-
var k = /* @__PURE__ */ function() {
|
|
1951
|
-
function d(u, o) {
|
|
1952
|
-
for (var i = 0; i < o.length; i++) {
|
|
1953
|
-
var a = o[i];
|
|
1954
|
-
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(u, a.key, a);
|
|
1955
|
-
}
|
|
1956
|
-
}
|
|
1957
|
-
return function(u, o, i) {
|
|
1958
|
-
return o && d(u.prototype, o), i && d(u, i), u;
|
|
1959
|
-
};
|
|
1960
|
-
}(), R = A(2), r = A(34), c = (A(12), function() {
|
|
1961
|
-
function d() {
|
|
1962
|
-
_(this, d);
|
|
1963
|
-
}
|
|
1964
|
-
return k(d, null, [{ key: "getMd5", value: function(u, o, i) {
|
|
1965
|
-
var a = new FileReader();
|
|
1966
|
-
a.onload = function(m) {
|
|
1967
|
-
try {
|
|
1968
|
-
var p = m && m.target.result || a.content, w = R(r.parse(p)), B = w.toString(), I = window.btoa(w.toString(r));
|
|
1969
|
-
o(B, I);
|
|
1970
|
-
} catch (y) {
|
|
1971
|
-
}
|
|
1972
|
-
}, a.onerror = function(m) {
|
|
1973
|
-
errorCallback(m);
|
|
1974
|
-
};
|
|
1975
|
-
var h = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice, l = h.call(u, 0, 1024);
|
|
1976
|
-
a.readAsBinaryString(l);
|
|
1977
|
-
} }]), d;
|
|
1978
|
-
}());
|
|
1979
|
-
E.default = c;
|
|
1980
|
-
}, function(H, E, A) {
|
|
1981
|
-
(function(_, k) {
|
|
1982
|
-
H.exports = k(A(0));
|
|
1983
|
-
})(0, function(_) {
|
|
1984
|
-
return _.enc.Latin1;
|
|
1985
|
-
});
|
|
1986
|
-
}]);
|