@sheetxl/studio-vanilla 0.4.21 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/cjs/2QmtjcI-saz2rkIA.cjs +6 -0
- package/browser/cjs/3UFq2FybsZfoS4JL.cjs +6 -0
- package/browser/cjs/B-fFQgxMHns-eg-y.cjs +6 -0
- package/browser/cjs/{n6CXzSocLW_BCO8w.cjs → B2hhcNzdkhGrH1O6.cjs} +6 -6
- package/browser/cjs/BASsCVA0ArIVtY7I.cjs +6 -0
- package/browser/cjs/BAxy7pwmXg8SI_oi.cjs +6 -0
- package/browser/cjs/BCwHln5zBNJSn0bb.cjs +6 -0
- package/browser/cjs/BQYUcoxlHrpI0-pX.cjs +6 -0
- package/browser/cjs/BVbQCweLw_r05vPF.cjs +15 -0
- package/browser/cjs/BYJxHR3K0UQJ8mYe.cjs +6 -0
- package/browser/cjs/Ba8eoGTjjWBH8TbP.cjs +6 -0
- package/browser/cjs/BdCoVNJwhPpWfQw2.cjs +6 -0
- package/browser/cjs/BkZzUVGQfrUTPE_K.cjs +6 -0
- package/browser/cjs/BlpCu5z9eT8rzsZl.cjs +6 -0
- package/browser/cjs/BlqTaZ2U_mKVK2lb.cjs +6 -0
- package/browser/cjs/BpeteRa_oZ-wN4Yl.cjs +6 -0
- package/browser/cjs/BxqDS9XynU5GFbP7.cjs +16 -0
- package/browser/cjs/ByB_fmjdLNTv0T0U.cjs +145 -0
- package/browser/cjs/C-6TpShR6Bn0HnEd.cjs +7 -0
- package/browser/cjs/C5T_oiCG4PwTFSZA.cjs +6 -0
- package/browser/cjs/C5e1IjdRuLyAQqNX.cjs +7 -0
- package/browser/cjs/CAZoVQtxsVdAtVKy.cjs +6 -0
- package/browser/cjs/CBS2kMyEf0c_PUbQ.cjs +12 -0
- package/browser/cjs/CO7VEOXret0qr-X3.cjs +6 -0
- package/browser/cjs/CVIlAq9nwlOXfHMl.cjs +161 -0
- package/browser/cjs/CZEOikBcE4OIr49t.cjs +6 -0
- package/browser/cjs/Ce8AVRntRnXZtgzH.cjs +6 -0
- package/browser/cjs/ClEZHGlmkSIz6S1O.cjs +6 -0
- package/browser/cjs/CvO-oyQ3syx7EGUA.cjs +6 -0
- package/browser/cjs/CwqvcNlwUtXJrzsk.cjs +6 -0
- package/browser/cjs/D-su0R92LmYTQVL3.cjs +11 -0
- package/browser/cjs/D178aT-dgy-ngzYG.cjs +6 -0
- package/browser/cjs/D5z-zqUVI3G9JXBC.cjs +1501 -0
- package/browser/cjs/D68uE8Ovq38Aj-88.cjs +330 -0
- package/browser/cjs/D8mjDoZ4Yyous_Fc.cjs +6 -0
- package/browser/cjs/DASsVvQwE2-IWxLR.cjs +6 -0
- package/browser/cjs/DBavSByKdf-juvFm.cjs +32 -0
- package/browser/cjs/DHRZzqw46ad6Mtw6.cjs +6 -0
- package/browser/cjs/DJZBxKlTP03_1kyT.cjs +6 -0
- package/browser/cjs/DKq35Q191eW-MovK.cjs +6 -0
- package/browser/cjs/DMUFBhoYpT3ai2Sb.cjs +6 -0
- package/browser/cjs/DX2XUDUIVBx4UFrJ.cjs +6 -0
- package/browser/cjs/DdzEWCcupF-0WS8y.cjs +11 -0
- package/browser/cjs/Dg9j6yGv8nrILfzN.cjs +6 -0
- package/browser/cjs/DjB9MJwDT6_HgF4U.cjs +6 -0
- package/browser/cjs/Dl5mwbo0ahDUm0he.cjs +6 -0
- package/browser/cjs/DmT6vIsFpZJ2c8cx.cjs +15 -0
- package/browser/cjs/Hi6aVJR9PyRbNYjO.cjs +6 -0
- package/browser/cjs/K7QHOvYV_yvLLjsS.cjs +6 -0
- package/browser/cjs/LhLQSvaxn8yxAIwj.cjs +6 -0
- package/browser/cjs/MgEzGw411nlqjqfH.cjs +42 -0
- package/browser/cjs/WJXT0W6bS3bZdAUV.cjs +6 -0
- package/browser/cjs/f_Vbi-Lelt9tKZrz.cjs +19 -0
- package/browser/cjs/index.cjs +2 -80
- package/browser/cjs/tNT3tUxdeIp_Iq2Y.cjs +7 -0
- package/browser/cjs/vNEwUuTKk3qucC3P.cjs +6 -0
- package/browser/cjs/xMzLyo_gIl82xG8k.cjs +6 -0
- package/browser/cjs/yc1bXLJ1yRhBFy0X.cjs +124 -0
- package/browser/esm/2fFz5u9jPgrNzcVF.mjs +21 -0
- package/browser/esm/2kXHnuU_uz-F9i1S.mjs +44550 -0
- package/browser/esm/5F1_gQbzWEFsWO0i.mjs +84 -0
- package/browser/esm/9MchcnSGrYDjX4zQ.mjs +46 -0
- package/browser/esm/Af7aikoKHz0rpjfv.mjs +10 -0
- package/browser/esm/B1Kc7dS9N2PVqxMT.mjs +10 -0
- package/browser/esm/B8ePgT5XZ0JlU3T6.mjs +1352 -0
- package/browser/esm/B8uy0BSOVjfUw27f.mjs +12 -0
- package/browser/esm/BFweWj2oKpTGl7m3.mjs +1672 -0
- package/browser/esm/BLseM2hNBI2PgQaX.mjs +13391 -0
- package/browser/esm/BUNUi9F3xbjfUKty.mjs +24 -0
- package/browser/esm/BV3ROKbw5yMVArqX.mjs +10 -0
- package/browser/esm/BXKXqOluLdKs4-V0.mjs +3802 -0
- package/browser/esm/BZpMA4DGM1kbVAKF.mjs +10 -0
- package/browser/esm/Bg59p3YlNG6o7-M3.mjs +260 -0
- package/browser/esm/BlFzVqIUaXFtDy81.mjs +10 -0
- package/browser/esm/BtBECeJ4mwD7SUx8.mjs +3936 -0
- package/browser/esm/Buw1VxSLsNI8pSYS.mjs +5585 -0
- package/browser/esm/BxoWypkKac-_VAm5.mjs +39 -0
- package/browser/esm/By3EkyTg3ZYh63C7.mjs +56 -0
- package/browser/esm/CDu4VlyMAQ3nxTQG.mjs +10 -0
- package/browser/esm/CJ9ZL3uskq3W6s-m.mjs +10 -0
- package/browser/esm/CP_sGa9QGT2Nq5ym.mjs +1702 -0
- package/browser/esm/CaIFrnjL0xBOtFfM.mjs +10 -0
- package/browser/esm/CeP-AnEtOGkuxLqE.mjs +10 -0
- package/browser/esm/CjScjxhY2mD7nPZA.mjs +633 -0
- package/browser/esm/CozWNYg-NXzV84fz.mjs +10 -0
- package/browser/esm/Cprnt9pNXzIiMmkN.mjs +29 -0
- package/browser/esm/Cq-wjvtZ92uenxU1.mjs +20 -0
- package/browser/esm/CsVeeu8D1A8I-BbH.mjs +1575 -0
- package/browser/esm/CzMxOWYq4nqRtKmm.mjs +1366 -0
- package/browser/esm/D9MGSJr45cVRF75O.mjs +1466 -0
- package/browser/esm/DAUV_w2uv0nHdk5N.mjs +10 -0
- package/browser/esm/DIypkIIonThPr-Vt.mjs +47 -0
- package/browser/esm/DOG1CaEQVF1sTUFi.mjs +10 -0
- package/browser/esm/DOv9FndcEVmQ2LJK.mjs +392 -0
- package/browser/esm/DSCVDOwTpDzUVuFj.mjs +10 -0
- package/browser/esm/DYF-8AnNDaQUy3aL.mjs +2344 -0
- package/browser/esm/Dd0avXHDTPFrx-ot.mjs +44 -0
- package/browser/esm/DdQY6IuT4OziHv5i.mjs +48 -0
- package/browser/esm/DfRKIODWn8ElqMWa.mjs +425 -0
- package/browser/esm/Dfbzljrnj4KrvtaN.mjs +10 -0
- package/browser/esm/DfdWpPG9ZcbRBGUg.mjs +10 -0
- package/browser/esm/Di8JLQMx61fnrhOn.mjs +10 -0
- package/browser/esm/DirXlaTG7TKxrqSR.mjs +10 -0
- package/browser/esm/DjGdyf6zsnIMRkQb.mjs +41 -0
- package/browser/esm/Dm4Fun7UoovVHafs.mjs +147 -0
- package/browser/esm/DwpS4SI4gT1eqfOs.mjs +10 -0
- package/browser/esm/DzZDYedlR-CIW2TI.mjs +21 -0
- package/browser/esm/HlyDPlaZCA3IOmF2.mjs +2081 -0
- package/browser/esm/PzIeb5aTX9JzTTfm.mjs +424 -0
- package/browser/esm/{NBuS53B7u8hItiXf.mjs → QPkYQWSepZNIhJst.mjs} +937 -933
- package/browser/esm/UENfAV2nBd83yFu7.mjs +10 -0
- package/browser/esm/YYqCu_-Z9nzvEseu.mjs +10 -0
- package/browser/esm/aEhgzbKqmuKv1oqm.mjs +10 -0
- package/browser/esm/bxGRTnY732xGNtpL.mjs +10 -0
- package/browser/esm/index.mjs +4 -176
- package/browser/esm/zQSjT9VbN7kMDV88.mjs +21 -0
- package/cdn/assets/2fFz5u9jPgrNzcVF.js +21 -0
- package/cdn/assets/7ZUzaBw_VH3Cvii1.js +1702 -0
- package/cdn/assets/7bmIdE8Moi7orOeU.js +50 -0
- package/cdn/assets/Af7aikoKHz0rpjfv.js +10 -0
- package/cdn/assets/B1Kc7dS9N2PVqxMT.js +10 -0
- package/cdn/assets/B6QHusAaPSos46yi.js +3802 -0
- package/cdn/assets/B8ePgT5XZ0JlU3T6.js +1352 -0
- package/cdn/assets/B8uy0BSOVjfUw27f.js +12 -0
- package/cdn/assets/BFweWj2oKpTGl7m3.js +1672 -0
- package/cdn/assets/BGF-bSrwdriQTytG.js +1466 -0
- package/cdn/assets/BLseM2hNBI2PgQaX.js +13391 -0
- package/cdn/assets/BQvzpOcCO8uM_ZaF.js +46 -0
- package/cdn/assets/BUNUi9F3xbjfUKty.js +24 -0
- package/cdn/assets/BV3ROKbw5yMVArqX.js +10 -0
- package/cdn/assets/BZpMA4DGM1kbVAKF.js +10 -0
- package/cdn/assets/BlFzVqIUaXFtDy81.js +10 -0
- package/cdn/assets/BrwV_8GjxcVuWuUk.js +44377 -0
- package/cdn/assets/C7SHJrlOqTIZCB3t.js +41 -0
- package/cdn/assets/CCbJipmDawMQQxRJ.js +36 -0
- package/cdn/assets/CDu4VlyMAQ3nxTQG.js +10 -0
- package/cdn/assets/CEcpUxbZ1W-G1EPq.js +2346 -0
- package/cdn/assets/CJ9ZL3uskq3W6s-m.js +10 -0
- package/cdn/assets/CaIFrnjL0xBOtFfM.js +10 -0
- package/cdn/assets/CaN0O_koLgCkhgEh.js +1575 -0
- package/cdn/assets/CeP-AnEtOGkuxLqE.js +10 -0
- package/cdn/assets/CjScjxhY2mD7nPZA.js +633 -0
- package/cdn/assets/ClkFsS16G5memDzX.js +22 -0
- package/cdn/assets/CmUGAy0Bu36DiwJO.js +84 -0
- package/cdn/assets/CozWNYg-NXzV84fz.js +10 -0
- package/cdn/assets/CsYr_9x-OIQSqGIL.js +27 -0
- package/cdn/assets/CzEv6qEIPTHOwOdU.js +2083 -0
- package/cdn/assets/CzMF1riupKc6HLGE.js +6481 -0
- package/cdn/assets/CzMxOWYq4nqRtKmm.js +1366 -0
- package/cdn/assets/D-W_ANt_qJ9dfGy9.js +425 -0
- package/cdn/assets/DAI9BFZBDQlMP1v4.js +149 -0
- package/cdn/assets/DAUV_w2uv0nHdk5N.js +10 -0
- package/cdn/assets/DOG1CaEQVF1sTUFi.js +10 -0
- package/cdn/assets/DSCVDOwTpDzUVuFj.js +10 -0
- package/cdn/assets/DSv3gXCV9xifjdta.js +23 -0
- package/cdn/assets/DaYZ-afnc3QhJo5R.js +58 -0
- package/cdn/assets/Dfbzljrnj4KrvtaN.js +10 -0
- package/cdn/assets/DfdWpPG9ZcbRBGUg.js +10 -0
- package/cdn/assets/Di8JLQMx61fnrhOn.js +10 -0
- package/cdn/assets/DirXlaTG7TKxrqSR.js +10 -0
- package/cdn/assets/DivRRrwWTqpDEOsE.js +392 -0
- package/cdn/assets/DlGa-wREL0uZB2Nx.js +43 -0
- package/cdn/assets/DlMH1vSjXgvZMwQJ.js +90 -0
- package/cdn/assets/Dml7K4XhLTRwUDTY.js +27 -0
- package/cdn/assets/DwpS4SI4gT1eqfOs.js +10 -0
- package/cdn/assets/G0GROjU63_EPzAF7.js +241 -0
- package/cdn/assets/NoCZPCkSed8lQpNi.js +46 -0
- package/cdn/assets/O-MB9oo65vbYOjfG.js +260 -0
- package/cdn/assets/PzIeb5aTX9JzTTfm.js +424 -0
- package/cdn/assets/UENfAV2nBd83yFu7.js +10 -0
- package/cdn/assets/V2bW77WyjoyjJMvZ.js +5585 -0
- package/cdn/assets/YJiNeqIJTFYDQPxS.js +3936 -0
- package/cdn/assets/YYqCu_-Z9nzvEseu.js +10 -0
- package/cdn/assets/Yp0FxpbZyyvU_u6y.js +49 -0
- package/cdn/assets/aEhgzbKqmuKv1oqm.js +10 -0
- package/cdn/assets/bxGRTnY732xGNtpL.js +10 -0
- package/cdn/assets/djN8Su_7GYF42GqX.js +21 -0
- package/cdn/assets/m-A0SfNBx32zKuZU.js +29 -0
- package/cdn/assets/uvZYEIW4EfvcdsXG.js +12 -0
- package/cdn/assets/zZGhctwBXNlAYrJr.js +21 -0
- package/cdn/index.js +2 -2
- package/cdn/loader.js +1 -1
- package/package.json +3 -3
- package/cdn/assets/CY8njwo06MWkoPz2.js +0 -21
|
@@ -0,0 +1,1672 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.5.0
|
|
3
|
+
*
|
|
4
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/
|
|
7
|
+
function Pe() {
|
|
8
|
+
}
|
|
9
|
+
function R(e) {
|
|
10
|
+
return typeof e == "object" && e !== null || typeof e == "function";
|
|
11
|
+
}
|
|
12
|
+
const tr = Pe;
|
|
13
|
+
function m(e, t) {
|
|
14
|
+
try {
|
|
15
|
+
Object.defineProperty(e, "name", { value: t, configurable: !0 });
|
|
16
|
+
} catch {
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
const St = Promise, eo = Promise.resolve.bind(St), to = Promise.prototype.then, ro = Promise.reject.bind(St), oo = eo;
|
|
20
|
+
function P(e) {
|
|
21
|
+
return new St(e);
|
|
22
|
+
}
|
|
23
|
+
function v(e) {
|
|
24
|
+
return P((t) => t(e));
|
|
25
|
+
}
|
|
26
|
+
function c(e) {
|
|
27
|
+
return ro(e);
|
|
28
|
+
}
|
|
29
|
+
function B(e, t, r) {
|
|
30
|
+
return to.call(e, t, r);
|
|
31
|
+
}
|
|
32
|
+
function W(e, t, r) {
|
|
33
|
+
B(B(e, t, r), void 0, tr);
|
|
34
|
+
}
|
|
35
|
+
function nt(e, t) {
|
|
36
|
+
W(e, t);
|
|
37
|
+
}
|
|
38
|
+
function bt(e, t) {
|
|
39
|
+
W(e, void 0, t);
|
|
40
|
+
}
|
|
41
|
+
function ne(e, t, r) {
|
|
42
|
+
return B(e, t, r);
|
|
43
|
+
}
|
|
44
|
+
function Ae(e) {
|
|
45
|
+
B(e, void 0, tr);
|
|
46
|
+
}
|
|
47
|
+
let ie = (e) => {
|
|
48
|
+
if (typeof queueMicrotask == "function") ie = queueMicrotask;
|
|
49
|
+
else {
|
|
50
|
+
const t = v(void 0);
|
|
51
|
+
ie = (r) => B(t, r);
|
|
52
|
+
}
|
|
53
|
+
return ie(e);
|
|
54
|
+
};
|
|
55
|
+
function me(e, t, r) {
|
|
56
|
+
if (typeof e != "function") throw new TypeError("Argument is not a function");
|
|
57
|
+
return Function.prototype.apply.call(e, t, r);
|
|
58
|
+
}
|
|
59
|
+
function ge(e, t, r) {
|
|
60
|
+
try {
|
|
61
|
+
return v(me(e, t, r));
|
|
62
|
+
} catch (o) {
|
|
63
|
+
return c(o);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
class j {
|
|
67
|
+
constructor() {
|
|
68
|
+
this._cursor = 0, this._size = 0, this._front = { _elements: [], _next: void 0 }, this._back = this._front, this._cursor = 0, this._size = 0;
|
|
69
|
+
}
|
|
70
|
+
get length() {
|
|
71
|
+
return this._size;
|
|
72
|
+
}
|
|
73
|
+
push(t) {
|
|
74
|
+
const r = this._back;
|
|
75
|
+
let o = r;
|
|
76
|
+
r._elements.length === 16383 && (o = { _elements: [], _next: void 0 }), r._elements.push(t), o !== r && (this._back = o, r._next = o), ++this._size;
|
|
77
|
+
}
|
|
78
|
+
shift() {
|
|
79
|
+
const t = this._front;
|
|
80
|
+
let r = t;
|
|
81
|
+
const o = this._cursor;
|
|
82
|
+
let i = o + 1;
|
|
83
|
+
const n = t._elements, s = n[o];
|
|
84
|
+
return i === 16384 && (r = t._next, i = 0), --this._size, this._cursor = i, t !== r && (this._front = r), n[o] = void 0, s;
|
|
85
|
+
}
|
|
86
|
+
forEach(t) {
|
|
87
|
+
let r = this._cursor, o = this._front, i = o._elements;
|
|
88
|
+
for (; !(r === i.length && o._next === void 0 || r === i.length && (o = o._next, i = o._elements, r = 0, i.length === 0)); ) t(i[r]), ++r;
|
|
89
|
+
}
|
|
90
|
+
peek() {
|
|
91
|
+
const t = this._front, r = this._cursor;
|
|
92
|
+
return t._elements[r];
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const rr = Symbol("[[AbortSteps]]"), or = Symbol("[[ErrorSteps]]"), Rt = Symbol("[[CancelSteps]]"), Tt = Symbol("[[PullSteps]]"), qt = Symbol("[[ReleaseSteps]]");
|
|
96
|
+
function nr(e, t) {
|
|
97
|
+
var r;
|
|
98
|
+
e._ownerReadableStream = t, t._reader = e, t._state === "readable" ? ht(e) : t._state === "closed" ? (ht(r = e), ar(r)) : ir(e, t._storedError);
|
|
99
|
+
}
|
|
100
|
+
function Et(e, t) {
|
|
101
|
+
return k(e._ownerReadableStream, t);
|
|
102
|
+
}
|
|
103
|
+
function L(e) {
|
|
104
|
+
const t = e._ownerReadableStream;
|
|
105
|
+
t._state === "readable" ? Pt(e, new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")) : ir(e, new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")), t._readableStreamController[qt](), t._reader = void 0, e._ownerReadableStream = void 0;
|
|
106
|
+
}
|
|
107
|
+
function He(e) {
|
|
108
|
+
return new TypeError("Cannot " + e + " a stream using a released reader");
|
|
109
|
+
}
|
|
110
|
+
function ht(e) {
|
|
111
|
+
e._closedPromise = P((t, r) => {
|
|
112
|
+
e._closedPromise_resolve = t, e._closedPromise_reject = r;
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
function ir(e, t) {
|
|
116
|
+
ht(e), Pt(e, t);
|
|
117
|
+
}
|
|
118
|
+
function Pt(e, t) {
|
|
119
|
+
e._closedPromise_reject !== void 0 && (Ae(e._closedPromise), e._closedPromise_reject(t), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0);
|
|
120
|
+
}
|
|
121
|
+
function ar(e) {
|
|
122
|
+
e._closedPromise_resolve !== void 0 && (e._closedPromise_resolve(void 0), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0);
|
|
123
|
+
}
|
|
124
|
+
const Mt = Number.isFinite || function(e) {
|
|
125
|
+
return typeof e == "number" && isFinite(e);
|
|
126
|
+
}, no = Math.trunc || function(e) {
|
|
127
|
+
return e < 0 ? Math.ceil(e) : Math.floor(e);
|
|
128
|
+
};
|
|
129
|
+
function V(e, t) {
|
|
130
|
+
if (e !== void 0 && typeof (r = e) != "object" && typeof r != "function") throw new TypeError(`${t} is not an object.`);
|
|
131
|
+
var r;
|
|
132
|
+
}
|
|
133
|
+
function X(e, t) {
|
|
134
|
+
if (typeof e != "function") throw new TypeError(`${t} is not a function.`);
|
|
135
|
+
}
|
|
136
|
+
function sr(e, t) {
|
|
137
|
+
if (!/* @__PURE__ */ function(r) {
|
|
138
|
+
return typeof r == "object" && r !== null || typeof r == "function";
|
|
139
|
+
}(e)) throw new TypeError(`${t} is not an object.`);
|
|
140
|
+
}
|
|
141
|
+
function ae(e, t, r) {
|
|
142
|
+
if (e === void 0) throw new TypeError(`Parameter ${t} is required in '${r}'.`);
|
|
143
|
+
}
|
|
144
|
+
function Nt(e, t, r) {
|
|
145
|
+
if (e === void 0) throw new TypeError(`${t} is required in '${r}'.`);
|
|
146
|
+
}
|
|
147
|
+
function lr(e) {
|
|
148
|
+
return Number(e);
|
|
149
|
+
}
|
|
150
|
+
function Yt(e) {
|
|
151
|
+
return e === 0 ? 0 : e;
|
|
152
|
+
}
|
|
153
|
+
function Ct(e, t) {
|
|
154
|
+
const r = Number.MAX_SAFE_INTEGER;
|
|
155
|
+
let o = Number(e);
|
|
156
|
+
if (o = Yt(o), !Mt(o)) throw new TypeError(`${t} is not a finite number`);
|
|
157
|
+
if (o = Yt(no(o)), o < 0 || o > r) throw new TypeError(`${t} is outside the accepted range of 0 to ${r}, inclusive`);
|
|
158
|
+
return Mt(o) && o !== 0 ? o : 0;
|
|
159
|
+
}
|
|
160
|
+
function Ot(e, t) {
|
|
161
|
+
if (!D(e)) throw new TypeError(`${t} is not a ReadableStream.`);
|
|
162
|
+
}
|
|
163
|
+
function ce(e) {
|
|
164
|
+
return new ee(e);
|
|
165
|
+
}
|
|
166
|
+
function ur(e, t) {
|
|
167
|
+
e._reader._readRequests.push(t);
|
|
168
|
+
}
|
|
169
|
+
function At(e, t, r) {
|
|
170
|
+
const o = e._reader._readRequests.shift();
|
|
171
|
+
r ? o._closeSteps() : o._chunkSteps(t);
|
|
172
|
+
}
|
|
173
|
+
function Ze(e) {
|
|
174
|
+
return e._reader._readRequests.length;
|
|
175
|
+
}
|
|
176
|
+
function cr(e) {
|
|
177
|
+
const t = e._reader;
|
|
178
|
+
return t !== void 0 && !!U(t);
|
|
179
|
+
}
|
|
180
|
+
class ee {
|
|
181
|
+
constructor(t) {
|
|
182
|
+
if (ae(t, 1, "ReadableStreamDefaultReader"), Ot(t, "First parameter"), H(t)) throw new TypeError("This stream has already been locked for exclusive reading by another reader");
|
|
183
|
+
nr(this, t), this._readRequests = new j();
|
|
184
|
+
}
|
|
185
|
+
get closed() {
|
|
186
|
+
return U(this) ? this._closedPromise : c(We("closed"));
|
|
187
|
+
}
|
|
188
|
+
cancel(t = void 0) {
|
|
189
|
+
return U(this) ? this._ownerReadableStream === void 0 ? c(He("cancel")) : Et(this, t) : c(We("cancel"));
|
|
190
|
+
}
|
|
191
|
+
read() {
|
|
192
|
+
if (!U(this)) return c(We("read"));
|
|
193
|
+
if (this._ownerReadableStream === void 0) return c(He("read from"));
|
|
194
|
+
let t, r;
|
|
195
|
+
const o = P((i, n) => {
|
|
196
|
+
t = i, r = n;
|
|
197
|
+
});
|
|
198
|
+
return Ce(this, { _chunkSteps: (i) => t({ value: i, done: !1 }), _closeSteps: () => t({ value: void 0, done: !0 }), _errorSteps: (i) => r(i) }), o;
|
|
199
|
+
}
|
|
200
|
+
releaseLock() {
|
|
201
|
+
if (!U(this)) throw We("releaseLock");
|
|
202
|
+
var t;
|
|
203
|
+
this._ownerReadableStream !== void 0 && (L(t = this), dr(t, new TypeError("Reader was released")));
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
function U(e) {
|
|
207
|
+
return !!R(e) && !!Object.prototype.hasOwnProperty.call(e, "_readRequests") && e instanceof ee;
|
|
208
|
+
}
|
|
209
|
+
function Ce(e, t) {
|
|
210
|
+
const r = e._ownerReadableStream;
|
|
211
|
+
r._disturbed = !0, r._state === "closed" ? t._closeSteps() : r._state === "errored" ? t._errorSteps(r._storedError) : r._readableStreamController[Tt](t);
|
|
212
|
+
}
|
|
213
|
+
function dr(e, t) {
|
|
214
|
+
const r = e._readRequests;
|
|
215
|
+
e._readRequests = new j(), r.forEach((o) => {
|
|
216
|
+
o._errorSteps(t);
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
function We(e) {
|
|
220
|
+
return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`);
|
|
221
|
+
}
|
|
222
|
+
var it, at, st;
|
|
223
|
+
function Se(e) {
|
|
224
|
+
return e.slice();
|
|
225
|
+
}
|
|
226
|
+
function fr(e, t, r, o, i) {
|
|
227
|
+
new Uint8Array(e).set(new Uint8Array(r, o, i), t);
|
|
228
|
+
}
|
|
229
|
+
Object.defineProperties(ee.prototype, { cancel: { enumerable: !0 }, read: { enumerable: !0 }, releaseLock: { enumerable: !0 }, closed: { enumerable: !0 } }), m(ee.prototype.cancel, "cancel"), m(ee.prototype.read, "read"), m(ee.prototype.releaseLock, "releaseLock"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(ee.prototype, Symbol.toStringTag, { value: "ReadableStreamDefaultReader", configurable: !0 });
|
|
230
|
+
let se = (e) => (se = typeof e.transfer == "function" ? (t) => t.transfer() : typeof structuredClone == "function" ? (t) => structuredClone(t, { transfer: [t] }) : (t) => t, se(e)), le = (e) => (le = typeof e.detached == "boolean" ? (t) => t.detached : (t) => t.byteLength === 0, le(e));
|
|
231
|
+
function br(e, t, r) {
|
|
232
|
+
if (e.slice) return e.slice(t, r);
|
|
233
|
+
const o = r - t, i = new ArrayBuffer(o);
|
|
234
|
+
return fr(i, 0, e, t, o), i;
|
|
235
|
+
}
|
|
236
|
+
function Te(e, t) {
|
|
237
|
+
const r = e[t];
|
|
238
|
+
if (r != null) {
|
|
239
|
+
if (typeof r != "function") throw new TypeError(`${String(t)} is not a function`);
|
|
240
|
+
return r;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
function Vt(e) {
|
|
244
|
+
try {
|
|
245
|
+
const t = e.done, r = e.value;
|
|
246
|
+
return B(oo(r), (o) => ({ done: t, value: o }));
|
|
247
|
+
} catch (t) {
|
|
248
|
+
return c(t);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
const je = (st = (it = Symbol.asyncIterator) !== null && it !== void 0 ? it : (at = Symbol.for) === null || at === void 0 ? void 0 : at.call(Symbol, "Symbol.asyncIterator")) !== null && st !== void 0 ? st : "@@asyncIterator";
|
|
252
|
+
function hr(e, t = "sync", r) {
|
|
253
|
+
if (r === void 0) if (t === "async") {
|
|
254
|
+
if ((r = Te(e, je)) === void 0) return function(i) {
|
|
255
|
+
const n = { next() {
|
|
256
|
+
let s;
|
|
257
|
+
try {
|
|
258
|
+
s = _r(i);
|
|
259
|
+
} catch (a) {
|
|
260
|
+
return c(a);
|
|
261
|
+
}
|
|
262
|
+
return Vt(s);
|
|
263
|
+
}, return(s) {
|
|
264
|
+
let a;
|
|
265
|
+
try {
|
|
266
|
+
const l = Te(i.iterator, "return");
|
|
267
|
+
if (l === void 0) return v({ done: !0, value: s });
|
|
268
|
+
a = me(l, i.iterator, [s]);
|
|
269
|
+
} catch (l) {
|
|
270
|
+
return c(l);
|
|
271
|
+
}
|
|
272
|
+
return R(a) ? Vt(a) : c(new TypeError("The iterator.return() method must return an object"));
|
|
273
|
+
} };
|
|
274
|
+
return { iterator: n, nextMethod: n.next, done: !1 };
|
|
275
|
+
}(hr(e, "sync", Te(e, Symbol.iterator)));
|
|
276
|
+
} else r = Te(e, Symbol.iterator);
|
|
277
|
+
if (r === void 0) throw new TypeError("The object is not iterable");
|
|
278
|
+
const o = me(r, e, []);
|
|
279
|
+
if (!R(o)) throw new TypeError("The iterator method must return an object");
|
|
280
|
+
return { iterator: o, nextMethod: o.next, done: !1 };
|
|
281
|
+
}
|
|
282
|
+
function _r(e) {
|
|
283
|
+
const t = me(e.nextMethod, e.iterator, []);
|
|
284
|
+
if (!R(t)) throw new TypeError("The iterator.next() method must return an object");
|
|
285
|
+
return t;
|
|
286
|
+
}
|
|
287
|
+
class pr {
|
|
288
|
+
constructor(t, r) {
|
|
289
|
+
this._ongoingPromise = void 0, this._isFinished = !1, this._reader = t, this._preventCancel = r;
|
|
290
|
+
}
|
|
291
|
+
next() {
|
|
292
|
+
const t = () => this._nextSteps();
|
|
293
|
+
return this._ongoingPromise = this._ongoingPromise ? ne(this._ongoingPromise, t, t) : t(), this._ongoingPromise;
|
|
294
|
+
}
|
|
295
|
+
return(t) {
|
|
296
|
+
const r = () => this._returnSteps(t);
|
|
297
|
+
return this._ongoingPromise = this._ongoingPromise ? ne(this._ongoingPromise, r, r) : r(), this._ongoingPromise;
|
|
298
|
+
}
|
|
299
|
+
_nextSteps() {
|
|
300
|
+
if (this._isFinished) return Promise.resolve({ value: void 0, done: !0 });
|
|
301
|
+
const t = this._reader;
|
|
302
|
+
let r, o;
|
|
303
|
+
const i = P((n, s) => {
|
|
304
|
+
r = n, o = s;
|
|
305
|
+
});
|
|
306
|
+
return Ce(t, { _chunkSteps: (n) => {
|
|
307
|
+
this._ongoingPromise = void 0, ie(() => r({ value: n, done: !1 }));
|
|
308
|
+
}, _closeSteps: () => {
|
|
309
|
+
this._ongoingPromise = void 0, this._isFinished = !0, L(t), r({ value: void 0, done: !0 });
|
|
310
|
+
}, _errorSteps: (n) => {
|
|
311
|
+
this._ongoingPromise = void 0, this._isFinished = !0, L(t), o(n);
|
|
312
|
+
} }), i;
|
|
313
|
+
}
|
|
314
|
+
_returnSteps(t) {
|
|
315
|
+
if (this._isFinished) return Promise.resolve({ value: t, done: !0 });
|
|
316
|
+
this._isFinished = !0;
|
|
317
|
+
const r = this._reader;
|
|
318
|
+
if (!this._preventCancel) {
|
|
319
|
+
const o = Et(r, t);
|
|
320
|
+
return L(r), ne(o, () => ({ value: t, done: !0 }));
|
|
321
|
+
}
|
|
322
|
+
return L(r), v({ value: t, done: !0 });
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
const mr = { next() {
|
|
326
|
+
return Ut(this) ? this._asyncIteratorImpl.next() : c(Ht("next"));
|
|
327
|
+
}, return(e) {
|
|
328
|
+
return Ut(this) ? this._asyncIteratorImpl.return(e) : c(Ht("return"));
|
|
329
|
+
}, [je]() {
|
|
330
|
+
return this;
|
|
331
|
+
} };
|
|
332
|
+
function Ut(e) {
|
|
333
|
+
if (!R(e) || !Object.prototype.hasOwnProperty.call(e, "_asyncIteratorImpl")) return !1;
|
|
334
|
+
try {
|
|
335
|
+
return e._asyncIteratorImpl instanceof pr;
|
|
336
|
+
} catch {
|
|
337
|
+
return !1;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
function Ht(e) {
|
|
341
|
+
return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`);
|
|
342
|
+
}
|
|
343
|
+
Object.defineProperty(mr, je, { enumerable: !1 });
|
|
344
|
+
const yr = Number.isNaN || function(e) {
|
|
345
|
+
return e != e;
|
|
346
|
+
};
|
|
347
|
+
function Gt(e) {
|
|
348
|
+
const t = br(e.buffer, e.byteOffset, e.byteOffset + e.byteLength);
|
|
349
|
+
return new Uint8Array(t);
|
|
350
|
+
}
|
|
351
|
+
function _t(e) {
|
|
352
|
+
const t = e._queue.shift();
|
|
353
|
+
return e._queueTotalSize -= t.size, e._queueTotalSize < 0 && (e._queueTotalSize = 0), t.value;
|
|
354
|
+
}
|
|
355
|
+
function jt(e, t, r) {
|
|
356
|
+
if (typeof (o = r) != "number" || yr(o) || o < 0 || r === 1 / 0) throw new RangeError("Size must be a finite, non-NaN, non-negative number.");
|
|
357
|
+
var o;
|
|
358
|
+
e._queue.push({ value: t, size: r }), e._queueTotalSize += r;
|
|
359
|
+
}
|
|
360
|
+
function J(e) {
|
|
361
|
+
e._queue = new j(), e._queueTotalSize = 0;
|
|
362
|
+
}
|
|
363
|
+
function vr(e) {
|
|
364
|
+
return e === DataView;
|
|
365
|
+
}
|
|
366
|
+
class be {
|
|
367
|
+
constructor() {
|
|
368
|
+
throw new TypeError("Illegal constructor");
|
|
369
|
+
}
|
|
370
|
+
get view() {
|
|
371
|
+
if (!lt(this)) throw ut("view");
|
|
372
|
+
return this._view;
|
|
373
|
+
}
|
|
374
|
+
respond(t) {
|
|
375
|
+
if (!lt(this)) throw ut("respond");
|
|
376
|
+
if (ae(t, 1, "respond"), t = Ct(t, "First parameter"), this._associatedReadableByteStreamController === void 0) throw new TypeError("This BYOB request has been invalidated");
|
|
377
|
+
if (le(this._view.buffer)) throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");
|
|
378
|
+
Ye(this._associatedReadableByteStreamController, t);
|
|
379
|
+
}
|
|
380
|
+
respondWithNewView(t) {
|
|
381
|
+
if (!lt(this)) throw ut("respondWithNewView");
|
|
382
|
+
if (ae(t, 1, "respondWithNewView"), !ArrayBuffer.isView(t)) throw new TypeError("You can only respond with array buffer views");
|
|
383
|
+
if (this._associatedReadableByteStreamController === void 0) throw new TypeError("This BYOB request has been invalidated");
|
|
384
|
+
if (le(t.buffer)) throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");
|
|
385
|
+
Ve(this._associatedReadableByteStreamController, t);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
Object.defineProperties(be.prototype, { respond: { enumerable: !0 }, respondWithNewView: { enumerable: !0 }, view: { enumerable: !0 } }), m(be.prototype.respond, "respond"), m(be.prototype.respondWithNewView, "respondWithNewView"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(be.prototype, Symbol.toStringTag, { value: "ReadableStreamBYOBRequest", configurable: !0 });
|
|
389
|
+
class N {
|
|
390
|
+
constructor() {
|
|
391
|
+
throw new TypeError("Illegal constructor");
|
|
392
|
+
}
|
|
393
|
+
get byobRequest() {
|
|
394
|
+
if (!te(this)) throw Re("byobRequest");
|
|
395
|
+
return mt(this);
|
|
396
|
+
}
|
|
397
|
+
get desiredSize() {
|
|
398
|
+
if (!te(this)) throw Re("desiredSize");
|
|
399
|
+
return Ar(this);
|
|
400
|
+
}
|
|
401
|
+
close() {
|
|
402
|
+
if (!te(this)) throw Re("close");
|
|
403
|
+
if (this._closeRequested) throw new TypeError("The stream has already been closed; do not close it again!");
|
|
404
|
+
const t = this._controlledReadableByteStream._state;
|
|
405
|
+
if (t !== "readable") throw new TypeError(`The stream (in ${t} state) is not in the readable state and cannot be closed`);
|
|
406
|
+
qe(this);
|
|
407
|
+
}
|
|
408
|
+
enqueue(t) {
|
|
409
|
+
if (!te(this)) throw Re("enqueue");
|
|
410
|
+
if (ae(t, 1, "enqueue"), !ArrayBuffer.isView(t)) throw new TypeError("chunk must be an array buffer view");
|
|
411
|
+
if (t.byteLength === 0) throw new TypeError("chunk must have non-zero byteLength");
|
|
412
|
+
if (t.buffer.byteLength === 0) throw new TypeError("chunk's buffer must have non-zero byteLength");
|
|
413
|
+
if (this._closeRequested) throw new TypeError("stream is closed or draining");
|
|
414
|
+
const r = this._controlledReadableByteStream._state;
|
|
415
|
+
if (r !== "readable") throw new TypeError(`The stream (in ${r} state) is not in the readable state and cannot be enqueued to`);
|
|
416
|
+
Ne(this, t);
|
|
417
|
+
}
|
|
418
|
+
error(t = void 0) {
|
|
419
|
+
if (!te(this)) throw Re("error");
|
|
420
|
+
A(this, t);
|
|
421
|
+
}
|
|
422
|
+
[Rt](t) {
|
|
423
|
+
wr(this), J(this);
|
|
424
|
+
const r = this._cancelAlgorithm(t);
|
|
425
|
+
return et(this), r;
|
|
426
|
+
}
|
|
427
|
+
[Tt](t) {
|
|
428
|
+
const r = this._controlledReadableByteStream;
|
|
429
|
+
if (this._queueTotalSize > 0) return void Or(this, t);
|
|
430
|
+
const o = this._autoAllocateChunkSize;
|
|
431
|
+
if (o !== void 0) {
|
|
432
|
+
let i;
|
|
433
|
+
try {
|
|
434
|
+
i = new ArrayBuffer(o);
|
|
435
|
+
} catch (s) {
|
|
436
|
+
return void t._errorSteps(s);
|
|
437
|
+
}
|
|
438
|
+
const n = { buffer: i, bufferByteLength: o, byteOffset: 0, byteLength: o, bytesFilled: 0, minimumFill: 1, elementSize: 1, viewConstructor: Uint8Array, readerType: "default" };
|
|
439
|
+
this._pendingPullIntos.push(n);
|
|
440
|
+
}
|
|
441
|
+
ur(r, t), ue(this);
|
|
442
|
+
}
|
|
443
|
+
[qt]() {
|
|
444
|
+
if (this._pendingPullIntos.length > 0) {
|
|
445
|
+
const t = this._pendingPullIntos.peek();
|
|
446
|
+
t.readerType = "none", this._pendingPullIntos = new j(), this._pendingPullIntos.push(t);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
function te(e) {
|
|
451
|
+
return !!R(e) && !!Object.prototype.hasOwnProperty.call(e, "_controlledReadableByteStream") && e instanceof N;
|
|
452
|
+
}
|
|
453
|
+
function lt(e) {
|
|
454
|
+
return !!R(e) && !!Object.prototype.hasOwnProperty.call(e, "_associatedReadableByteStreamController") && e instanceof be;
|
|
455
|
+
}
|
|
456
|
+
function ue(e) {
|
|
457
|
+
(function(t) {
|
|
458
|
+
const r = t._controlledReadableByteStream;
|
|
459
|
+
return !(r._state !== "readable" || t._closeRequested || !t._started) && (!!(cr(r) && Ze(r) > 0 || Wt(r) && kr(r) > 0) || Ar(t) > 0);
|
|
460
|
+
})(e) && (e._pulling ? e._pullAgain = !0 : (e._pulling = !0, W(e._pullAlgorithm(), () => (e._pulling = !1, e._pullAgain && (e._pullAgain = !1, ue(e)), null), (t) => (A(e, t), null))));
|
|
461
|
+
}
|
|
462
|
+
function wr(e) {
|
|
463
|
+
kt(e), e._pendingPullIntos = new j();
|
|
464
|
+
}
|
|
465
|
+
function gr(e, t) {
|
|
466
|
+
let r = !1;
|
|
467
|
+
e._state === "closed" && (r = !0);
|
|
468
|
+
const o = Sr(t);
|
|
469
|
+
t.readerType === "default" ? At(e, o, r) : function(i, n, s) {
|
|
470
|
+
const a = i._reader._readIntoRequests.shift();
|
|
471
|
+
s ? a._closeSteps(n) : a._chunkSteps(n);
|
|
472
|
+
}(e, o, r);
|
|
473
|
+
}
|
|
474
|
+
function De(e, t) {
|
|
475
|
+
for (let r = 0; r < t.length; ++r) gr(e, t[r]);
|
|
476
|
+
}
|
|
477
|
+
function Sr(e) {
|
|
478
|
+
const t = e.bytesFilled, r = e.elementSize;
|
|
479
|
+
return new e.viewConstructor(e.buffer, e.byteOffset, t / r);
|
|
480
|
+
}
|
|
481
|
+
function Me(e, t, r, o) {
|
|
482
|
+
e._queue.push({ buffer: t, byteOffset: r, byteLength: o }), e._queueTotalSize += o;
|
|
483
|
+
}
|
|
484
|
+
function Rr(e, t, r, o) {
|
|
485
|
+
let i;
|
|
486
|
+
try {
|
|
487
|
+
i = br(t, r, r + o);
|
|
488
|
+
} catch (n) {
|
|
489
|
+
throw A(e, n), n;
|
|
490
|
+
}
|
|
491
|
+
Me(e, i, 0, o);
|
|
492
|
+
}
|
|
493
|
+
function Tr(e, t) {
|
|
494
|
+
t.bytesFilled > 0 && Rr(e, t.buffer, t.byteOffset, t.bytesFilled), _e(e);
|
|
495
|
+
}
|
|
496
|
+
function qr(e, t) {
|
|
497
|
+
const r = Math.min(e._queueTotalSize, t.byteLength - t.bytesFilled), o = t.bytesFilled + r;
|
|
498
|
+
let i = r, n = !1;
|
|
499
|
+
const s = o - o % t.elementSize;
|
|
500
|
+
s >= t.minimumFill && (i = s - t.bytesFilled, n = !0);
|
|
501
|
+
const a = e._queue;
|
|
502
|
+
for (; i > 0; ) {
|
|
503
|
+
const l = a.peek(), u = Math.min(i, l.byteLength), h = t.byteOffset + t.bytesFilled;
|
|
504
|
+
fr(t.buffer, h, l.buffer, l.byteOffset, u), l.byteLength === u ? a.shift() : (l.byteOffset += u, l.byteLength -= u), e._queueTotalSize -= u, Er(e, u, t), i -= u;
|
|
505
|
+
}
|
|
506
|
+
return n;
|
|
507
|
+
}
|
|
508
|
+
function Er(e, t, r) {
|
|
509
|
+
r.bytesFilled += t;
|
|
510
|
+
}
|
|
511
|
+
function Pr(e) {
|
|
512
|
+
e._queueTotalSize === 0 && e._closeRequested ? (et(e), ke(e._controlledReadableByteStream)) : ue(e);
|
|
513
|
+
}
|
|
514
|
+
function kt(e) {
|
|
515
|
+
e._byobRequest !== null && (e._byobRequest._associatedReadableByteStreamController = void 0, e._byobRequest._view = null, e._byobRequest = null);
|
|
516
|
+
}
|
|
517
|
+
function pt(e) {
|
|
518
|
+
const t = [];
|
|
519
|
+
for (; e._pendingPullIntos.length > 0 && e._queueTotalSize !== 0; ) {
|
|
520
|
+
const r = e._pendingPullIntos.peek();
|
|
521
|
+
qr(e, r) && (_e(e), t.push(r));
|
|
522
|
+
}
|
|
523
|
+
return t;
|
|
524
|
+
}
|
|
525
|
+
function Cr(e, t) {
|
|
526
|
+
const r = e._pendingPullIntos.peek();
|
|
527
|
+
kt(e), e._controlledReadableByteStream._state === "closed" ? function(o, i) {
|
|
528
|
+
i.readerType === "none" && _e(o);
|
|
529
|
+
const n = o._controlledReadableByteStream;
|
|
530
|
+
if (Wt(n)) {
|
|
531
|
+
const s = [];
|
|
532
|
+
for (let a = 0; a < kr(n); ++a) s.push(_e(o));
|
|
533
|
+
De(n, s);
|
|
534
|
+
}
|
|
535
|
+
}(e, r) : function(o, i, n) {
|
|
536
|
+
if (Er(0, i, n), n.readerType === "none") {
|
|
537
|
+
Tr(o, n);
|
|
538
|
+
const l = pt(o);
|
|
539
|
+
return void De(o._controlledReadableByteStream, l);
|
|
540
|
+
}
|
|
541
|
+
if (n.bytesFilled < n.minimumFill) return;
|
|
542
|
+
_e(o);
|
|
543
|
+
const s = n.bytesFilled % n.elementSize;
|
|
544
|
+
if (s > 0) {
|
|
545
|
+
const l = n.byteOffset + n.bytesFilled;
|
|
546
|
+
Rr(o, n.buffer, l - s, s);
|
|
547
|
+
}
|
|
548
|
+
n.bytesFilled -= s;
|
|
549
|
+
const a = pt(o);
|
|
550
|
+
gr(o._controlledReadableByteStream, n), De(o._controlledReadableByteStream, a);
|
|
551
|
+
}(e, t, r), ue(e);
|
|
552
|
+
}
|
|
553
|
+
function _e(e) {
|
|
554
|
+
return e._pendingPullIntos.shift();
|
|
555
|
+
}
|
|
556
|
+
function et(e) {
|
|
557
|
+
e._pullAlgorithm = void 0, e._cancelAlgorithm = void 0;
|
|
558
|
+
}
|
|
559
|
+
function qe(e) {
|
|
560
|
+
const t = e._controlledReadableByteStream;
|
|
561
|
+
if (!e._closeRequested && t._state === "readable") if (e._queueTotalSize > 0) e._closeRequested = !0;
|
|
562
|
+
else {
|
|
563
|
+
if (e._pendingPullIntos.length > 0) {
|
|
564
|
+
const r = e._pendingPullIntos.peek();
|
|
565
|
+
if (r.bytesFilled % r.elementSize != 0) {
|
|
566
|
+
const o = new TypeError("Insufficient bytes to fill elements in the given buffer");
|
|
567
|
+
throw A(e, o), o;
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
et(e), ke(t);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
function Ne(e, t) {
|
|
574
|
+
const r = e._controlledReadableByteStream;
|
|
575
|
+
if (e._closeRequested || r._state !== "readable") return;
|
|
576
|
+
const { buffer: o, byteOffset: i, byteLength: n } = t;
|
|
577
|
+
if (le(o)) throw new TypeError("chunk's buffer is detached and so cannot be enqueued");
|
|
578
|
+
const s = se(o);
|
|
579
|
+
if (e._pendingPullIntos.length > 0) {
|
|
580
|
+
const a = e._pendingPullIntos.peek();
|
|
581
|
+
if (le(a.buffer)) throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");
|
|
582
|
+
kt(e), a.buffer = se(a.buffer), a.readerType === "none" && Tr(e, a);
|
|
583
|
+
}
|
|
584
|
+
if (cr(r)) (function(a) {
|
|
585
|
+
const l = a._controlledReadableByteStream._reader;
|
|
586
|
+
for (; l._readRequests.length > 0; ) {
|
|
587
|
+
if (a._queueTotalSize === 0) return;
|
|
588
|
+
Or(a, l._readRequests.shift());
|
|
589
|
+
}
|
|
590
|
+
})(e), Ze(r) === 0 ? Me(e, s, i, n) : (e._pendingPullIntos.length > 0 && _e(e), At(r, new Uint8Array(s, i, n), !1));
|
|
591
|
+
else if (Wt(r)) {
|
|
592
|
+
Me(e, s, i, n);
|
|
593
|
+
const a = pt(e);
|
|
594
|
+
De(e._controlledReadableByteStream, a);
|
|
595
|
+
} else Me(e, s, i, n);
|
|
596
|
+
ue(e);
|
|
597
|
+
}
|
|
598
|
+
function A(e, t) {
|
|
599
|
+
const r = e._controlledReadableByteStream;
|
|
600
|
+
r._state === "readable" && (wr(e), J(e), et(e), Qr(r, t));
|
|
601
|
+
}
|
|
602
|
+
function Or(e, t) {
|
|
603
|
+
const r = e._queue.shift();
|
|
604
|
+
e._queueTotalSize -= r.byteLength, Pr(e);
|
|
605
|
+
const o = new Uint8Array(r.buffer, r.byteOffset, r.byteLength);
|
|
606
|
+
t._chunkSteps(o);
|
|
607
|
+
}
|
|
608
|
+
function mt(e) {
|
|
609
|
+
if (e._byobRequest === null && e._pendingPullIntos.length > 0) {
|
|
610
|
+
const i = e._pendingPullIntos.peek(), n = new Uint8Array(i.buffer, i.byteOffset + i.bytesFilled, i.byteLength - i.bytesFilled), s = Object.create(be.prototype);
|
|
611
|
+
r = e, o = n, (t = s)._associatedReadableByteStreamController = r, t._view = o, e._byobRequest = s;
|
|
612
|
+
}
|
|
613
|
+
var t, r, o;
|
|
614
|
+
return e._byobRequest;
|
|
615
|
+
}
|
|
616
|
+
function Ar(e) {
|
|
617
|
+
const t = e._controlledReadableByteStream._state;
|
|
618
|
+
return t === "errored" ? null : t === "closed" ? 0 : e._strategyHWM - e._queueTotalSize;
|
|
619
|
+
}
|
|
620
|
+
function Ye(e, t) {
|
|
621
|
+
const r = e._pendingPullIntos.peek();
|
|
622
|
+
if (e._controlledReadableByteStream._state === "closed") {
|
|
623
|
+
if (t !== 0) throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");
|
|
624
|
+
} else {
|
|
625
|
+
if (t === 0) throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");
|
|
626
|
+
if (r.bytesFilled + t > r.byteLength) throw new RangeError("bytesWritten out of range");
|
|
627
|
+
}
|
|
628
|
+
r.buffer = se(r.buffer), Cr(e, t);
|
|
629
|
+
}
|
|
630
|
+
function Ve(e, t) {
|
|
631
|
+
const r = e._pendingPullIntos.peek();
|
|
632
|
+
if (e._controlledReadableByteStream._state === "closed") {
|
|
633
|
+
if (t.byteLength !== 0) throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream");
|
|
634
|
+
} else if (t.byteLength === 0) throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");
|
|
635
|
+
if (r.byteOffset + r.bytesFilled !== t.byteOffset) throw new RangeError("The region specified by view does not match byobRequest");
|
|
636
|
+
if (r.bufferByteLength !== t.buffer.byteLength) throw new RangeError("The buffer of view has different capacity than byobRequest");
|
|
637
|
+
if (r.bytesFilled + t.byteLength > r.byteLength) throw new RangeError("The region specified by view is larger than byobRequest");
|
|
638
|
+
const o = t.byteLength;
|
|
639
|
+
r.buffer = se(t.buffer), Cr(e, o);
|
|
640
|
+
}
|
|
641
|
+
function jr(e, t, r, o, i, n, s) {
|
|
642
|
+
t._controlledReadableByteStream = e, t._pullAgain = !1, t._pulling = !1, t._byobRequest = null, t._queue = t._queueTotalSize = void 0, J(t), t._closeRequested = !1, t._started = !1, t._strategyHWM = n, t._pullAlgorithm = o, t._cancelAlgorithm = i, t._autoAllocateChunkSize = s, t._pendingPullIntos = new j(), e._readableStreamController = t, W(v(r()), () => (t._started = !0, ue(t), null), (a) => (A(t, a), null));
|
|
643
|
+
}
|
|
644
|
+
function ut(e) {
|
|
645
|
+
return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`);
|
|
646
|
+
}
|
|
647
|
+
function Re(e) {
|
|
648
|
+
return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`);
|
|
649
|
+
}
|
|
650
|
+
function io(e, t) {
|
|
651
|
+
if ((e = `${e}`) != "byob") throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);
|
|
652
|
+
return e;
|
|
653
|
+
}
|
|
654
|
+
function Xt(e) {
|
|
655
|
+
return new re(e);
|
|
656
|
+
}
|
|
657
|
+
function Jt(e, t) {
|
|
658
|
+
e._reader._readIntoRequests.push(t);
|
|
659
|
+
}
|
|
660
|
+
function kr(e) {
|
|
661
|
+
return e._reader._readIntoRequests.length;
|
|
662
|
+
}
|
|
663
|
+
function Wt(e) {
|
|
664
|
+
const t = e._reader;
|
|
665
|
+
return t !== void 0 && !!oe(t);
|
|
666
|
+
}
|
|
667
|
+
Object.defineProperties(N.prototype, { close: { enumerable: !0 }, enqueue: { enumerable: !0 }, error: { enumerable: !0 }, byobRequest: { enumerable: !0 }, desiredSize: { enumerable: !0 } }), m(N.prototype.close, "close"), m(N.prototype.enqueue, "enqueue"), m(N.prototype.error, "error"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(N.prototype, Symbol.toStringTag, { value: "ReadableByteStreamController", configurable: !0 });
|
|
668
|
+
class re {
|
|
669
|
+
constructor(t) {
|
|
670
|
+
if (ae(t, 1, "ReadableStreamBYOBReader"), Ot(t, "First parameter"), H(t)) throw new TypeError("This stream has already been locked for exclusive reading by another reader");
|
|
671
|
+
if (!te(t._readableStreamController)) throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");
|
|
672
|
+
nr(this, t), this._readIntoRequests = new j();
|
|
673
|
+
}
|
|
674
|
+
get closed() {
|
|
675
|
+
return oe(this) ? this._closedPromise : c(ze("closed"));
|
|
676
|
+
}
|
|
677
|
+
cancel(t = void 0) {
|
|
678
|
+
return oe(this) ? this._ownerReadableStream === void 0 ? c(He("cancel")) : Et(this, t) : c(ze("cancel"));
|
|
679
|
+
}
|
|
680
|
+
read(t, r = {}) {
|
|
681
|
+
if (!oe(this)) return c(ze("read"));
|
|
682
|
+
if (!ArrayBuffer.isView(t)) return c(new TypeError("view must be an array buffer view"));
|
|
683
|
+
if (t.byteLength === 0) return c(new TypeError("view must have non-zero byteLength"));
|
|
684
|
+
if (t.buffer.byteLength === 0) return c(new TypeError("view's buffer must have non-zero byteLength"));
|
|
685
|
+
if (le(t.buffer)) return c(new TypeError("view's buffer has been detached"));
|
|
686
|
+
let o;
|
|
687
|
+
try {
|
|
688
|
+
V(i = r, n = "options"), o = { min: Ct((s = i?.min) !== null && s !== void 0 ? s : 1, `${n} has member 'min' that`) };
|
|
689
|
+
} catch (f) {
|
|
690
|
+
return c(f);
|
|
691
|
+
}
|
|
692
|
+
var i, n, s;
|
|
693
|
+
const a = o.min;
|
|
694
|
+
if (a === 0) return c(new TypeError("options.min must be greater than 0"));
|
|
695
|
+
if (function(f) {
|
|
696
|
+
return vr(f.constructor);
|
|
697
|
+
}(t)) {
|
|
698
|
+
if (a > t.byteLength) return c(new RangeError("options.min must be less than or equal to view's byteLength"));
|
|
699
|
+
} else if (a > t.length) return c(new RangeError("options.min must be less than or equal to view's length"));
|
|
700
|
+
if (this._ownerReadableStream === void 0) return c(He("read from"));
|
|
701
|
+
let l, u;
|
|
702
|
+
const h = P((f, b) => {
|
|
703
|
+
l = f, u = b;
|
|
704
|
+
});
|
|
705
|
+
return Wr(this, t, a, { _chunkSteps: (f) => l({ value: f, done: !1 }), _closeSteps: (f) => l({ value: f, done: !0 }), _errorSteps: (f) => u(f) }), h;
|
|
706
|
+
}
|
|
707
|
+
releaseLock() {
|
|
708
|
+
if (!oe(this)) throw ze("releaseLock");
|
|
709
|
+
var t;
|
|
710
|
+
this._ownerReadableStream !== void 0 && (L(t = this), zr(t, new TypeError("Reader was released")));
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
function oe(e) {
|
|
714
|
+
return !!R(e) && !!Object.prototype.hasOwnProperty.call(e, "_readIntoRequests") && e instanceof re;
|
|
715
|
+
}
|
|
716
|
+
function Wr(e, t, r, o) {
|
|
717
|
+
const i = e._ownerReadableStream;
|
|
718
|
+
i._disturbed = !0, i._state === "errored" ? o._errorSteps(i._storedError) : function(n, s, a, l) {
|
|
719
|
+
const u = n._controlledReadableByteStream, h = s.constructor, f = vr(q = h) ? 1 : q.BYTES_PER_ELEMENT, { byteOffset: b, byteLength: w } = s, T = a * f;
|
|
720
|
+
var q;
|
|
721
|
+
let y;
|
|
722
|
+
try {
|
|
723
|
+
y = se(s.buffer);
|
|
724
|
+
} catch (g) {
|
|
725
|
+
return void l._errorSteps(g);
|
|
726
|
+
}
|
|
727
|
+
const _ = { buffer: y, bufferByteLength: y.byteLength, byteOffset: b, byteLength: w, bytesFilled: 0, minimumFill: T, elementSize: f, viewConstructor: h, readerType: "byob" };
|
|
728
|
+
if (n._pendingPullIntos.length > 0) return n._pendingPullIntos.push(_), void Jt(u, l);
|
|
729
|
+
if (u._state !== "closed") {
|
|
730
|
+
if (n._queueTotalSize > 0) {
|
|
731
|
+
if (qr(n, _)) {
|
|
732
|
+
const g = Sr(_);
|
|
733
|
+
return Pr(n), void l._chunkSteps(g);
|
|
734
|
+
}
|
|
735
|
+
if (n._closeRequested) {
|
|
736
|
+
const g = new TypeError("Insufficient bytes to fill elements in the given buffer");
|
|
737
|
+
return A(n, g), void l._errorSteps(g);
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
n._pendingPullIntos.push(_), Jt(u, l), ue(n);
|
|
741
|
+
} else {
|
|
742
|
+
const g = new h(_.buffer, _.byteOffset, 0);
|
|
743
|
+
l._closeSteps(g);
|
|
744
|
+
}
|
|
745
|
+
}(i._readableStreamController, t, r, o);
|
|
746
|
+
}
|
|
747
|
+
function zr(e, t) {
|
|
748
|
+
const r = e._readIntoRequests;
|
|
749
|
+
e._readIntoRequests = new j(), r.forEach((o) => {
|
|
750
|
+
o._errorSteps(t);
|
|
751
|
+
});
|
|
752
|
+
}
|
|
753
|
+
function ze(e) {
|
|
754
|
+
return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`);
|
|
755
|
+
}
|
|
756
|
+
function yt(e, t) {
|
|
757
|
+
const { highWaterMark: r } = e;
|
|
758
|
+
if (r === void 0) return t;
|
|
759
|
+
if (yr(r) || r < 0) throw new RangeError("Invalid highWaterMark");
|
|
760
|
+
return r;
|
|
761
|
+
}
|
|
762
|
+
function Br(e) {
|
|
763
|
+
const { size: t } = e;
|
|
764
|
+
return t || (() => 1);
|
|
765
|
+
}
|
|
766
|
+
function Fr(e, t) {
|
|
767
|
+
V(e, t);
|
|
768
|
+
const r = e?.highWaterMark, o = e?.size;
|
|
769
|
+
return { highWaterMark: r === void 0 ? void 0 : lr(r), size: o === void 0 ? void 0 : ao(o, `${t} has member 'size' that`) };
|
|
770
|
+
}
|
|
771
|
+
function ao(e, t) {
|
|
772
|
+
return X(e, t), (r) => lr(e(r));
|
|
773
|
+
}
|
|
774
|
+
function so(e, t, r) {
|
|
775
|
+
return X(e, r), (o) => ge(e, t, [o]);
|
|
776
|
+
}
|
|
777
|
+
function lo(e, t, r) {
|
|
778
|
+
return X(e, r), () => ge(e, t, []);
|
|
779
|
+
}
|
|
780
|
+
function uo(e, t, r) {
|
|
781
|
+
return X(e, r), (o) => me(e, t, [o]);
|
|
782
|
+
}
|
|
783
|
+
function co(e, t, r) {
|
|
784
|
+
return X(e, r), (o, i) => ge(e, t, [o, i]);
|
|
785
|
+
}
|
|
786
|
+
function Ir(e, t) {
|
|
787
|
+
if (!he(e)) throw new TypeError(`${t} is not a WritableStream.`);
|
|
788
|
+
}
|
|
789
|
+
Object.defineProperties(re.prototype, { cancel: { enumerable: !0 }, read: { enumerable: !0 }, releaseLock: { enumerable: !0 }, closed: { enumerable: !0 } }), m(re.prototype.cancel, "cancel"), m(re.prototype.read, "read"), m(re.prototype.releaseLock, "releaseLock"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(re.prototype, Symbol.toStringTag, { value: "ReadableStreamBYOBReader", configurable: !0 });
|
|
790
|
+
class de {
|
|
791
|
+
constructor(t = {}, r = {}) {
|
|
792
|
+
t === void 0 ? t = null : sr(t, "First parameter");
|
|
793
|
+
const o = Fr(r, "Second parameter"), i = function(a, l) {
|
|
794
|
+
V(a, l);
|
|
795
|
+
const u = a?.abort, h = a?.close, f = a?.start, b = a?.type, w = a?.write;
|
|
796
|
+
return { abort: u === void 0 ? void 0 : so(u, a, `${l} has member 'abort' that`), close: h === void 0 ? void 0 : lo(h, a, `${l} has member 'close' that`), start: f === void 0 ? void 0 : uo(f, a, `${l} has member 'start' that`), write: w === void 0 ? void 0 : co(w, a, `${l} has member 'write' that`), type: b };
|
|
797
|
+
}(t, "First parameter");
|
|
798
|
+
if ((n = this)._state = "writable", n._storedError = void 0, n._writer = void 0, n._writableStreamController = void 0, n._writeRequests = new j(), n._inFlightWriteRequest = void 0, n._closeRequest = void 0, n._inFlightCloseRequest = void 0, n._pendingAbortRequest = void 0, n._backpressure = !1, i.type !== void 0) throw new RangeError("Invalid type is specified");
|
|
799
|
+
var n;
|
|
800
|
+
const s = Br(o);
|
|
801
|
+
(function(a, l, u, h) {
|
|
802
|
+
const f = Object.create(Xe.prototype);
|
|
803
|
+
let b, w, T, q;
|
|
804
|
+
b = l.start !== void 0 ? () => l.start(f) : () => {
|
|
805
|
+
}, w = l.write !== void 0 ? (y) => l.write(y, f) : () => v(void 0), T = l.close !== void 0 ? () => l.close() : () => v(void 0), q = l.abort !== void 0 ? (y) => l.abort(y) : () => v(void 0), function(y, _, g, z, I, d, p, S) {
|
|
806
|
+
_._controlledWritableStream = y, y._writableStreamController = _, _._queue = void 0, _._queueTotalSize = void 0, J(_), _._abortReason = void 0, _._abortController = function() {
|
|
807
|
+
if (typeof AbortController == "function") return new AbortController();
|
|
808
|
+
}(), _._started = !1, _._strategySizeAlgorithm = S, _._strategyHWM = p, _._writeAlgorithm = z, _._closeAlgorithm = I, _._abortAlgorithm = d;
|
|
809
|
+
const E = It(_);
|
|
810
|
+
Ft(y, E), W(v(g()), () => (_._started = !0, tt(_), null), (O) => (_._started = !0, vt(y, O), null));
|
|
811
|
+
}(a, f, b, w, T, q, u, h);
|
|
812
|
+
})(this, i, yt(o, 1), s);
|
|
813
|
+
}
|
|
814
|
+
get locked() {
|
|
815
|
+
if (!he(this)) throw Fe("locked");
|
|
816
|
+
return pe(this);
|
|
817
|
+
}
|
|
818
|
+
abort(t = void 0) {
|
|
819
|
+
return he(this) ? pe(this) ? c(new TypeError("Cannot abort a stream that already has a writer")) : Ge(this, t) : c(Fe("abort"));
|
|
820
|
+
}
|
|
821
|
+
close() {
|
|
822
|
+
return he(this) ? pe(this) ? c(new TypeError("Cannot close a stream that already has a writer")) : F(this) ? c(new TypeError("Cannot close an already-closing stream")) : $r(this) : c(Fe("close"));
|
|
823
|
+
}
|
|
824
|
+
getWriter() {
|
|
825
|
+
if (!he(this)) throw Fe("getWriter");
|
|
826
|
+
return Lr(this);
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
function Lr(e) {
|
|
830
|
+
return new M(e);
|
|
831
|
+
}
|
|
832
|
+
function he(e) {
|
|
833
|
+
return !!R(e) && !!Object.prototype.hasOwnProperty.call(e, "_writableStreamController") && e instanceof de;
|
|
834
|
+
}
|
|
835
|
+
function pe(e) {
|
|
836
|
+
return e._writer !== void 0;
|
|
837
|
+
}
|
|
838
|
+
function Ge(e, t) {
|
|
839
|
+
var r;
|
|
840
|
+
if (e._state === "closed" || e._state === "errored") return v(void 0);
|
|
841
|
+
e._writableStreamController._abortReason = t, (r = e._writableStreamController._abortController) === null || r === void 0 || r.abort(t);
|
|
842
|
+
const o = e._state;
|
|
843
|
+
if (o === "closed" || o === "errored") return v(void 0);
|
|
844
|
+
if (e._pendingAbortRequest !== void 0) return e._pendingAbortRequest._promise;
|
|
845
|
+
let i = !1;
|
|
846
|
+
o === "erroring" && (i = !0, t = void 0);
|
|
847
|
+
const n = P((s, a) => {
|
|
848
|
+
e._pendingAbortRequest = { _promise: void 0, _resolve: s, _reject: a, _reason: t, _wasAlreadyErroring: i };
|
|
849
|
+
});
|
|
850
|
+
return e._pendingAbortRequest._promise = n, i || zt(e, t), n;
|
|
851
|
+
}
|
|
852
|
+
function $r(e) {
|
|
853
|
+
const t = e._state;
|
|
854
|
+
if (t === "closed" || t === "errored") return c(new TypeError(`The stream (in ${t} state) is not in the writable state and cannot be closed`));
|
|
855
|
+
const r = P((n, s) => {
|
|
856
|
+
const a = { _resolve: n, _reject: s };
|
|
857
|
+
e._closeRequest = a;
|
|
858
|
+
}), o = e._writer;
|
|
859
|
+
var i;
|
|
860
|
+
return o !== void 0 && e._backpressure && t === "writable" && $t(o), jt(i = e._writableStreamController, Yr, 0), tt(i), r;
|
|
861
|
+
}
|
|
862
|
+
function vt(e, t) {
|
|
863
|
+
e._state !== "writable" ? Bt(e) : zt(e, t);
|
|
864
|
+
}
|
|
865
|
+
function zt(e, t) {
|
|
866
|
+
const r = e._writableStreamController;
|
|
867
|
+
e._state = "erroring", e._storedError = t;
|
|
868
|
+
const o = e._writer;
|
|
869
|
+
var i;
|
|
870
|
+
o !== void 0 && Dr(o, t), (i = e)._inFlightWriteRequest === void 0 && i._inFlightCloseRequest === void 0 && r._started && Bt(e);
|
|
871
|
+
}
|
|
872
|
+
function Bt(e) {
|
|
873
|
+
e._state = "errored", e._writableStreamController[or]();
|
|
874
|
+
const t = e._storedError;
|
|
875
|
+
if (e._writeRequests.forEach((o) => {
|
|
876
|
+
o._reject(t);
|
|
877
|
+
}), e._writeRequests = new j(), e._pendingAbortRequest === void 0) return void Be(e);
|
|
878
|
+
const r = e._pendingAbortRequest;
|
|
879
|
+
if (e._pendingAbortRequest = void 0, r._wasAlreadyErroring) return r._reject(t), void Be(e);
|
|
880
|
+
W(e._writableStreamController[rr](r._reason), () => (r._resolve(), Be(e), null), (o) => (r._reject(o), Be(e), null));
|
|
881
|
+
}
|
|
882
|
+
function F(e) {
|
|
883
|
+
return e._closeRequest !== void 0 || e._inFlightCloseRequest !== void 0;
|
|
884
|
+
}
|
|
885
|
+
function Be(e) {
|
|
886
|
+
e._closeRequest !== void 0 && (e._closeRequest._reject(e._storedError), e._closeRequest = void 0);
|
|
887
|
+
const t = e._writer;
|
|
888
|
+
t !== void 0 && Lt(t, e._storedError);
|
|
889
|
+
}
|
|
890
|
+
function Ft(e, t) {
|
|
891
|
+
const r = e._writer;
|
|
892
|
+
r !== void 0 && t !== e._backpressure && (t ? rt(r) : $t(r)), e._backpressure = t;
|
|
893
|
+
}
|
|
894
|
+
Object.defineProperties(de.prototype, { abort: { enumerable: !0 }, close: { enumerable: !0 }, getWriter: { enumerable: !0 }, locked: { enumerable: !0 } }), m(de.prototype.abort, "abort"), m(de.prototype.close, "close"), m(de.prototype.getWriter, "getWriter"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(de.prototype, Symbol.toStringTag, { value: "WritableStream", configurable: !0 });
|
|
895
|
+
class M {
|
|
896
|
+
constructor(t) {
|
|
897
|
+
if (ae(t, 1, "WritableStreamDefaultWriter"), Ir(t, "First parameter"), pe(t)) throw new TypeError("This stream has already been locked for exclusive writing by another writer");
|
|
898
|
+
this._ownerWritableStream = t, t._writer = this;
|
|
899
|
+
const r = t._state;
|
|
900
|
+
if (r === "writable") !F(t) && t._backpressure ? rt(this) : Kt(this), Ue(this);
|
|
901
|
+
else if (r === "erroring") gt(this, t._storedError), Ue(this);
|
|
902
|
+
else if (r === "closed") Kt(this), Ue(this), Gr(this);
|
|
903
|
+
else {
|
|
904
|
+
const o = t._storedError;
|
|
905
|
+
gt(this, o), Hr(this, o);
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
get closed() {
|
|
909
|
+
return K(this) ? this._closedPromise : c(Q("closed"));
|
|
910
|
+
}
|
|
911
|
+
get desiredSize() {
|
|
912
|
+
if (!K(this)) throw Q("desiredSize");
|
|
913
|
+
if (this._ownerWritableStream === void 0) throw Ee("desiredSize");
|
|
914
|
+
return function(t) {
|
|
915
|
+
const r = t._ownerWritableStream, o = r._state;
|
|
916
|
+
return o === "errored" || o === "erroring" ? null : o === "closed" ? 0 : Vr(r._writableStreamController);
|
|
917
|
+
}(this);
|
|
918
|
+
}
|
|
919
|
+
get ready() {
|
|
920
|
+
return K(this) ? this._readyPromise : c(Q("ready"));
|
|
921
|
+
}
|
|
922
|
+
abort(t = void 0) {
|
|
923
|
+
return K(this) ? this._ownerWritableStream === void 0 ? c(Ee("abort")) : (r = t, Ge(this._ownerWritableStream, r)) : c(Q("abort"));
|
|
924
|
+
var r;
|
|
925
|
+
}
|
|
926
|
+
close() {
|
|
927
|
+
if (!K(this)) return c(Q("close"));
|
|
928
|
+
const t = this._ownerWritableStream;
|
|
929
|
+
return t === void 0 ? c(Ee("close")) : F(t) ? c(new TypeError("Cannot close an already-closing stream")) : xr(this);
|
|
930
|
+
}
|
|
931
|
+
releaseLock() {
|
|
932
|
+
if (!K(this)) throw Q("releaseLock");
|
|
933
|
+
this._ownerWritableStream !== void 0 && Mr(this);
|
|
934
|
+
}
|
|
935
|
+
write(t = void 0) {
|
|
936
|
+
return K(this) ? this._ownerWritableStream === void 0 ? c(Ee("write to")) : Nr(this, t) : c(Q("write"));
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
function K(e) {
|
|
940
|
+
return !!R(e) && !!Object.prototype.hasOwnProperty.call(e, "_ownerWritableStream") && e instanceof M;
|
|
941
|
+
}
|
|
942
|
+
function xr(e) {
|
|
943
|
+
return $r(e._ownerWritableStream);
|
|
944
|
+
}
|
|
945
|
+
function Dr(e, t) {
|
|
946
|
+
e._readyPromiseState === "pending" ? Xr(e, t) : gt(e, t);
|
|
947
|
+
}
|
|
948
|
+
function Mr(e) {
|
|
949
|
+
const t = e._ownerWritableStream, r = new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");
|
|
950
|
+
var o, i;
|
|
951
|
+
Dr(e, r), i = r, (o = e)._closedPromiseState === "pending" ? Lt(o, i) : Hr(o, i), t._writer = void 0, e._ownerWritableStream = void 0;
|
|
952
|
+
}
|
|
953
|
+
function Nr(e, t) {
|
|
954
|
+
const r = e._ownerWritableStream, o = r._writableStreamController, i = function(l, u) {
|
|
955
|
+
if (l._strategySizeAlgorithm === void 0) return 1;
|
|
956
|
+
try {
|
|
957
|
+
return l._strategySizeAlgorithm(u);
|
|
958
|
+
} catch (h) {
|
|
959
|
+
return wt(l, h), 1;
|
|
960
|
+
}
|
|
961
|
+
}(o, t);
|
|
962
|
+
if (r !== e._ownerWritableStream) return c(Ee("write to"));
|
|
963
|
+
const n = r._state;
|
|
964
|
+
if (n === "errored") return c(r._storedError);
|
|
965
|
+
if (F(r) || n === "closed") return c(new TypeError("The stream is closing or closed and cannot be written to"));
|
|
966
|
+
if (n === "erroring") return c(r._storedError);
|
|
967
|
+
const s = (a = r, P((l, u) => {
|
|
968
|
+
const h = { _resolve: l, _reject: u };
|
|
969
|
+
a._writeRequests.push(h);
|
|
970
|
+
}));
|
|
971
|
+
var a;
|
|
972
|
+
return function(l, u, h) {
|
|
973
|
+
try {
|
|
974
|
+
jt(l, u, h);
|
|
975
|
+
} catch (b) {
|
|
976
|
+
return void wt(l, b);
|
|
977
|
+
}
|
|
978
|
+
const f = l._controlledWritableStream;
|
|
979
|
+
F(f) || f._state !== "writable" || Ft(f, It(l)), tt(l);
|
|
980
|
+
}(o, t, i), s;
|
|
981
|
+
}
|
|
982
|
+
Object.defineProperties(M.prototype, { abort: { enumerable: !0 }, close: { enumerable: !0 }, releaseLock: { enumerable: !0 }, write: { enumerable: !0 }, closed: { enumerable: !0 }, desiredSize: { enumerable: !0 }, ready: { enumerable: !0 } }), m(M.prototype.abort, "abort"), m(M.prototype.close, "close"), m(M.prototype.releaseLock, "releaseLock"), m(M.prototype.write, "write"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(M.prototype, Symbol.toStringTag, { value: "WritableStreamDefaultWriter", configurable: !0 });
|
|
983
|
+
const Yr = {};
|
|
984
|
+
class Xe {
|
|
985
|
+
constructor() {
|
|
986
|
+
throw new TypeError("Illegal constructor");
|
|
987
|
+
}
|
|
988
|
+
get abortReason() {
|
|
989
|
+
if (!ct(this)) throw dt("abortReason");
|
|
990
|
+
return this._abortReason;
|
|
991
|
+
}
|
|
992
|
+
get signal() {
|
|
993
|
+
if (!ct(this)) throw dt("signal");
|
|
994
|
+
if (this._abortController === void 0) throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");
|
|
995
|
+
return this._abortController.signal;
|
|
996
|
+
}
|
|
997
|
+
error(t = void 0) {
|
|
998
|
+
if (!ct(this)) throw dt("error");
|
|
999
|
+
this._controlledWritableStream._state === "writable" && Ur(this, t);
|
|
1000
|
+
}
|
|
1001
|
+
[rr](t) {
|
|
1002
|
+
const r = this._abortAlgorithm(t);
|
|
1003
|
+
return Je(this), r;
|
|
1004
|
+
}
|
|
1005
|
+
[or]() {
|
|
1006
|
+
J(this);
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
function ct(e) {
|
|
1010
|
+
return !!R(e) && !!Object.prototype.hasOwnProperty.call(e, "_controlledWritableStream") && e instanceof Xe;
|
|
1011
|
+
}
|
|
1012
|
+
function Je(e) {
|
|
1013
|
+
e._writeAlgorithm = void 0, e._closeAlgorithm = void 0, e._abortAlgorithm = void 0, e._strategySizeAlgorithm = void 0;
|
|
1014
|
+
}
|
|
1015
|
+
function Vr(e) {
|
|
1016
|
+
return e._strategyHWM - e._queueTotalSize;
|
|
1017
|
+
}
|
|
1018
|
+
function tt(e) {
|
|
1019
|
+
const t = e._controlledWritableStream;
|
|
1020
|
+
if (!e._started || t._inFlightWriteRequest !== void 0) return;
|
|
1021
|
+
if (t._state === "erroring") return void Bt(t);
|
|
1022
|
+
if (e._queue.length === 0) return;
|
|
1023
|
+
const r = e._queue.peek().value;
|
|
1024
|
+
r === Yr ? function(o) {
|
|
1025
|
+
const i = o._controlledWritableStream;
|
|
1026
|
+
var n;
|
|
1027
|
+
(n = i)._inFlightCloseRequest = n._closeRequest, n._closeRequest = void 0, _t(o);
|
|
1028
|
+
const s = o._closeAlgorithm();
|
|
1029
|
+
Je(o), W(s, () => (function(a) {
|
|
1030
|
+
a._inFlightCloseRequest._resolve(void 0), a._inFlightCloseRequest = void 0, a._state === "erroring" && (a._storedError = void 0, a._pendingAbortRequest !== void 0 && (a._pendingAbortRequest._resolve(), a._pendingAbortRequest = void 0)), a._state = "closed";
|
|
1031
|
+
const l = a._writer;
|
|
1032
|
+
l !== void 0 && Gr(l);
|
|
1033
|
+
}(i), null), (a) => {
|
|
1034
|
+
return u = a, (l = i)._inFlightCloseRequest._reject(u), l._inFlightCloseRequest = void 0, l._pendingAbortRequest !== void 0 && (l._pendingAbortRequest._reject(u), l._pendingAbortRequest = void 0), vt(l, u), null;
|
|
1035
|
+
var l, u;
|
|
1036
|
+
});
|
|
1037
|
+
}(e) : function(o, i) {
|
|
1038
|
+
const n = o._controlledWritableStream;
|
|
1039
|
+
var s;
|
|
1040
|
+
(s = n)._inFlightWriteRequest = s._writeRequests.shift(), W(o._writeAlgorithm(i), () => {
|
|
1041
|
+
var a;
|
|
1042
|
+
(a = n)._inFlightWriteRequest._resolve(void 0), a._inFlightWriteRequest = void 0;
|
|
1043
|
+
const l = n._state;
|
|
1044
|
+
if (_t(o), !F(n) && l === "writable") {
|
|
1045
|
+
const u = It(o);
|
|
1046
|
+
Ft(n, u);
|
|
1047
|
+
}
|
|
1048
|
+
return tt(o), null;
|
|
1049
|
+
}, (a) => {
|
|
1050
|
+
return n._state === "writable" && Je(o), u = a, (l = n)._inFlightWriteRequest._reject(u), l._inFlightWriteRequest = void 0, vt(l, u), null;
|
|
1051
|
+
var l, u;
|
|
1052
|
+
});
|
|
1053
|
+
}(e, r);
|
|
1054
|
+
}
|
|
1055
|
+
function wt(e, t) {
|
|
1056
|
+
e._controlledWritableStream._state === "writable" && Ur(e, t);
|
|
1057
|
+
}
|
|
1058
|
+
function It(e) {
|
|
1059
|
+
return Vr(e) <= 0;
|
|
1060
|
+
}
|
|
1061
|
+
function Ur(e, t) {
|
|
1062
|
+
const r = e._controlledWritableStream;
|
|
1063
|
+
Je(e), zt(r, t);
|
|
1064
|
+
}
|
|
1065
|
+
function Fe(e) {
|
|
1066
|
+
return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`);
|
|
1067
|
+
}
|
|
1068
|
+
function dt(e) {
|
|
1069
|
+
return new TypeError(`WritableStreamDefaultController.prototype.${e} can only be used on a WritableStreamDefaultController`);
|
|
1070
|
+
}
|
|
1071
|
+
function Q(e) {
|
|
1072
|
+
return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`);
|
|
1073
|
+
}
|
|
1074
|
+
function Ee(e) {
|
|
1075
|
+
return new TypeError("Cannot " + e + " a stream using a released writer");
|
|
1076
|
+
}
|
|
1077
|
+
function Ue(e) {
|
|
1078
|
+
e._closedPromise = P((t, r) => {
|
|
1079
|
+
e._closedPromise_resolve = t, e._closedPromise_reject = r, e._closedPromiseState = "pending";
|
|
1080
|
+
});
|
|
1081
|
+
}
|
|
1082
|
+
function Hr(e, t) {
|
|
1083
|
+
Ue(e), Lt(e, t);
|
|
1084
|
+
}
|
|
1085
|
+
function Lt(e, t) {
|
|
1086
|
+
e._closedPromise_reject !== void 0 && (Ae(e._closedPromise), e._closedPromise_reject(t), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0, e._closedPromiseState = "rejected");
|
|
1087
|
+
}
|
|
1088
|
+
function Gr(e) {
|
|
1089
|
+
e._closedPromise_resolve !== void 0 && (e._closedPromise_resolve(void 0), e._closedPromise_resolve = void 0, e._closedPromise_reject = void 0, e._closedPromiseState = "resolved");
|
|
1090
|
+
}
|
|
1091
|
+
function rt(e) {
|
|
1092
|
+
e._readyPromise = P((t, r) => {
|
|
1093
|
+
e._readyPromise_resolve = t, e._readyPromise_reject = r;
|
|
1094
|
+
}), e._readyPromiseState = "pending";
|
|
1095
|
+
}
|
|
1096
|
+
function gt(e, t) {
|
|
1097
|
+
rt(e), Xr(e, t);
|
|
1098
|
+
}
|
|
1099
|
+
function Kt(e) {
|
|
1100
|
+
rt(e), $t(e);
|
|
1101
|
+
}
|
|
1102
|
+
function Xr(e, t) {
|
|
1103
|
+
e._readyPromise_reject !== void 0 && (Ae(e._readyPromise), e._readyPromise_reject(t), e._readyPromise_resolve = void 0, e._readyPromise_reject = void 0, e._readyPromiseState = "rejected");
|
|
1104
|
+
}
|
|
1105
|
+
function $t(e) {
|
|
1106
|
+
e._readyPromise_resolve !== void 0 && (e._readyPromise_resolve(void 0), e._readyPromise_resolve = void 0, e._readyPromise_reject = void 0, e._readyPromiseState = "fulfilled");
|
|
1107
|
+
}
|
|
1108
|
+
Object.defineProperties(Xe.prototype, { abortReason: { enumerable: !0 }, signal: { enumerable: !0 }, error: { enumerable: !0 } }), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(Xe.prototype, Symbol.toStringTag, { value: "WritableStreamDefaultController", configurable: !0 });
|
|
1109
|
+
const fo = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof global < "u" ? global : void 0, bo = function() {
|
|
1110
|
+
const e = fo?.DOMException;
|
|
1111
|
+
return function(t) {
|
|
1112
|
+
if (typeof t != "function" && typeof t != "object" || t.name !== "DOMException") return !1;
|
|
1113
|
+
try {
|
|
1114
|
+
return new t(), !0;
|
|
1115
|
+
} catch {
|
|
1116
|
+
return !1;
|
|
1117
|
+
}
|
|
1118
|
+
}(e) ? e : void 0;
|
|
1119
|
+
}() || function() {
|
|
1120
|
+
const e = function(t, r) {
|
|
1121
|
+
this.message = t || "", this.name = r || "Error", Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
|
|
1122
|
+
};
|
|
1123
|
+
return m(e, "DOMException"), e.prototype = Object.create(Error.prototype), Object.defineProperty(e.prototype, "constructor", { value: e, writable: !0, configurable: !0 }), e;
|
|
1124
|
+
}();
|
|
1125
|
+
function Qt(e, t, r, o, i, n) {
|
|
1126
|
+
const s = ce(e), a = Lr(t);
|
|
1127
|
+
e._disturbed = !0;
|
|
1128
|
+
let l = !1, u = v(void 0);
|
|
1129
|
+
return P((h, f) => {
|
|
1130
|
+
let b;
|
|
1131
|
+
if (n !== void 0) {
|
|
1132
|
+
if (b = () => {
|
|
1133
|
+
const d = n.reason !== void 0 ? n.reason : new bo("Aborted", "AbortError"), p = [];
|
|
1134
|
+
o || p.push(() => t._state === "writable" ? Ge(t, d) : v(void 0)), i || p.push(() => e._state === "readable" ? k(e, d) : v(void 0)), g(() => Promise.all(p.map((S) => S())), !0, d);
|
|
1135
|
+
}, n.aborted) return void b();
|
|
1136
|
+
n.addEventListener("abort", b);
|
|
1137
|
+
}
|
|
1138
|
+
var w, T, q;
|
|
1139
|
+
if (_(e, s._closedPromise, (d) => (o ? z(!0, d) : g(() => Ge(t, d), !0, d), null)), _(t, a._closedPromise, (d) => (i ? z(!0, d) : g(() => k(e, d), !0, d), null)), w = e, T = s._closedPromise, q = () => (r ? z() : g(() => function(d) {
|
|
1140
|
+
const p = d._ownerWritableStream, S = p._state;
|
|
1141
|
+
return F(p) || S === "closed" ? v(void 0) : S === "errored" ? c(p._storedError) : xr(d);
|
|
1142
|
+
}(a)), null), w._state === "closed" ? q() : nt(T, q), F(t) || t._state === "closed") {
|
|
1143
|
+
const d = new TypeError("the destination writable stream closed before all data could be piped to it");
|
|
1144
|
+
i ? z(!0, d) : g(() => k(e, d), !0, d);
|
|
1145
|
+
}
|
|
1146
|
+
function y() {
|
|
1147
|
+
const d = u;
|
|
1148
|
+
return B(u, () => d !== u ? y() : void 0);
|
|
1149
|
+
}
|
|
1150
|
+
function _(d, p, S) {
|
|
1151
|
+
d._state === "errored" ? S(d._storedError) : bt(p, S);
|
|
1152
|
+
}
|
|
1153
|
+
function g(d, p, S) {
|
|
1154
|
+
function E() {
|
|
1155
|
+
return W(d(), () => I(p, S), (O) => I(!0, O)), null;
|
|
1156
|
+
}
|
|
1157
|
+
l || (l = !0, t._state !== "writable" || F(t) ? E() : nt(y(), E));
|
|
1158
|
+
}
|
|
1159
|
+
function z(d, p) {
|
|
1160
|
+
l || (l = !0, t._state !== "writable" || F(t) ? I(d, p) : nt(y(), () => I(d, p)));
|
|
1161
|
+
}
|
|
1162
|
+
function I(d, p) {
|
|
1163
|
+
return Mr(a), L(s), n !== void 0 && n.removeEventListener("abort", b), d ? f(p) : h(void 0), null;
|
|
1164
|
+
}
|
|
1165
|
+
Ae(P((d, p) => {
|
|
1166
|
+
(function S(E) {
|
|
1167
|
+
E ? d() : B(l ? v(!0) : B(a._readyPromise, () => P((O, $) => {
|
|
1168
|
+
Ce(s, { _chunkSteps: (x) => {
|
|
1169
|
+
u = B(Nr(a, x), void 0, Pe), O(!1);
|
|
1170
|
+
}, _closeSteps: () => O(!0), _errorSteps: $ });
|
|
1171
|
+
})), S, p);
|
|
1172
|
+
})(!1);
|
|
1173
|
+
}));
|
|
1174
|
+
});
|
|
1175
|
+
}
|
|
1176
|
+
class Y {
|
|
1177
|
+
constructor() {
|
|
1178
|
+
throw new TypeError("Illegal constructor");
|
|
1179
|
+
}
|
|
1180
|
+
get desiredSize() {
|
|
1181
|
+
if (!Ie(this)) throw Le("desiredSize");
|
|
1182
|
+
return xt(this);
|
|
1183
|
+
}
|
|
1184
|
+
close() {
|
|
1185
|
+
if (!Ie(this)) throw Le("close");
|
|
1186
|
+
if (!we(this)) throw new TypeError("The stream is not in a state that permits close");
|
|
1187
|
+
ye(this);
|
|
1188
|
+
}
|
|
1189
|
+
enqueue(t = void 0) {
|
|
1190
|
+
if (!Ie(this)) throw Le("enqueue");
|
|
1191
|
+
if (!we(this)) throw new TypeError("The stream is not in a state that permits enqueue");
|
|
1192
|
+
return ve(this, t);
|
|
1193
|
+
}
|
|
1194
|
+
error(t = void 0) {
|
|
1195
|
+
if (!Ie(this)) throw Le("error");
|
|
1196
|
+
G(this, t);
|
|
1197
|
+
}
|
|
1198
|
+
[Rt](t) {
|
|
1199
|
+
J(this);
|
|
1200
|
+
const r = this._cancelAlgorithm(t);
|
|
1201
|
+
return Ke(this), r;
|
|
1202
|
+
}
|
|
1203
|
+
[Tt](t) {
|
|
1204
|
+
const r = this._controlledReadableStream;
|
|
1205
|
+
if (this._queue.length > 0) {
|
|
1206
|
+
const o = _t(this);
|
|
1207
|
+
this._closeRequested && this._queue.length === 0 ? (Ke(this), ke(r)) : Oe(this), t._chunkSteps(o);
|
|
1208
|
+
} else ur(r, t), Oe(this);
|
|
1209
|
+
}
|
|
1210
|
+
[qt]() {
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
function Ie(e) {
|
|
1214
|
+
return !!R(e) && !!Object.prototype.hasOwnProperty.call(e, "_controlledReadableStream") && e instanceof Y;
|
|
1215
|
+
}
|
|
1216
|
+
function Oe(e) {
|
|
1217
|
+
Jr(e) && (e._pulling ? e._pullAgain = !0 : (e._pulling = !0, W(e._pullAlgorithm(), () => (e._pulling = !1, e._pullAgain && (e._pullAgain = !1, Oe(e)), null), (t) => (G(e, t), null))));
|
|
1218
|
+
}
|
|
1219
|
+
function Jr(e) {
|
|
1220
|
+
const t = e._controlledReadableStream;
|
|
1221
|
+
return !!we(e) && !!e._started && (!!(H(t) && Ze(t) > 0) || xt(e) > 0);
|
|
1222
|
+
}
|
|
1223
|
+
function Ke(e) {
|
|
1224
|
+
e._pullAlgorithm = void 0, e._cancelAlgorithm = void 0, e._strategySizeAlgorithm = void 0;
|
|
1225
|
+
}
|
|
1226
|
+
function ye(e) {
|
|
1227
|
+
if (!we(e)) return;
|
|
1228
|
+
const t = e._controlledReadableStream;
|
|
1229
|
+
e._closeRequested = !0, e._queue.length === 0 && (Ke(e), ke(t));
|
|
1230
|
+
}
|
|
1231
|
+
function ve(e, t) {
|
|
1232
|
+
if (!we(e)) return;
|
|
1233
|
+
const r = e._controlledReadableStream;
|
|
1234
|
+
if (H(r) && Ze(r) > 0) At(r, t, !1);
|
|
1235
|
+
else {
|
|
1236
|
+
let o;
|
|
1237
|
+
try {
|
|
1238
|
+
o = e._strategySizeAlgorithm(t);
|
|
1239
|
+
} catch (i) {
|
|
1240
|
+
throw G(e, i), i;
|
|
1241
|
+
}
|
|
1242
|
+
try {
|
|
1243
|
+
jt(e, t, o);
|
|
1244
|
+
} catch (i) {
|
|
1245
|
+
throw G(e, i), i;
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
Oe(e);
|
|
1249
|
+
}
|
|
1250
|
+
function G(e, t) {
|
|
1251
|
+
const r = e._controlledReadableStream;
|
|
1252
|
+
r._state === "readable" && (J(e), Ke(e), Qr(r, t));
|
|
1253
|
+
}
|
|
1254
|
+
function xt(e) {
|
|
1255
|
+
const t = e._controlledReadableStream._state;
|
|
1256
|
+
return t === "errored" ? null : t === "closed" ? 0 : e._strategyHWM - e._queueTotalSize;
|
|
1257
|
+
}
|
|
1258
|
+
function we(e) {
|
|
1259
|
+
const t = e._controlledReadableStream._state;
|
|
1260
|
+
return !e._closeRequested && t === "readable";
|
|
1261
|
+
}
|
|
1262
|
+
function Kr(e, t, r, o, i, n, s) {
|
|
1263
|
+
t._controlledReadableStream = e, t._queue = void 0, t._queueTotalSize = void 0, J(t), t._started = !1, t._closeRequested = !1, t._pullAgain = !1, t._pulling = !1, t._strategySizeAlgorithm = s, t._strategyHWM = n, t._pullAlgorithm = o, t._cancelAlgorithm = i, e._readableStreamController = t, W(v(r()), () => (t._started = !0, Oe(t), null), (a) => (G(t, a), null));
|
|
1264
|
+
}
|
|
1265
|
+
function Le(e) {
|
|
1266
|
+
return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`);
|
|
1267
|
+
}
|
|
1268
|
+
function ho(e) {
|
|
1269
|
+
return R(t = e) && t.getReader !== void 0 ? function(r) {
|
|
1270
|
+
let o;
|
|
1271
|
+
return o = Qe(Pe, function() {
|
|
1272
|
+
let i;
|
|
1273
|
+
try {
|
|
1274
|
+
i = r.read();
|
|
1275
|
+
} catch (n) {
|
|
1276
|
+
return c(n);
|
|
1277
|
+
}
|
|
1278
|
+
return ne(i, (n) => {
|
|
1279
|
+
if (!R(n)) throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");
|
|
1280
|
+
if (n.done) ye(o._readableStreamController);
|
|
1281
|
+
else {
|
|
1282
|
+
const s = n.value;
|
|
1283
|
+
ve(o._readableStreamController, s);
|
|
1284
|
+
}
|
|
1285
|
+
});
|
|
1286
|
+
}, function(i) {
|
|
1287
|
+
try {
|
|
1288
|
+
return v(r.cancel(i));
|
|
1289
|
+
} catch (n) {
|
|
1290
|
+
return c(n);
|
|
1291
|
+
}
|
|
1292
|
+
}, 0), o;
|
|
1293
|
+
}(e.getReader()) : function(r) {
|
|
1294
|
+
let o;
|
|
1295
|
+
const i = hr(r, "async");
|
|
1296
|
+
return o = Qe(Pe, function() {
|
|
1297
|
+
let n;
|
|
1298
|
+
try {
|
|
1299
|
+
n = _r(i);
|
|
1300
|
+
} catch (s) {
|
|
1301
|
+
return c(s);
|
|
1302
|
+
}
|
|
1303
|
+
return ne(v(n), (s) => {
|
|
1304
|
+
if (!R(s)) throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");
|
|
1305
|
+
if (s.done) ye(o._readableStreamController);
|
|
1306
|
+
else {
|
|
1307
|
+
const a = s.value;
|
|
1308
|
+
ve(o._readableStreamController, a);
|
|
1309
|
+
}
|
|
1310
|
+
});
|
|
1311
|
+
}, function(n) {
|
|
1312
|
+
const s = i.iterator;
|
|
1313
|
+
let a;
|
|
1314
|
+
try {
|
|
1315
|
+
a = Te(s, "return");
|
|
1316
|
+
} catch (l) {
|
|
1317
|
+
return c(l);
|
|
1318
|
+
}
|
|
1319
|
+
return a === void 0 ? v(void 0) : ne(ge(a, s, [n]), (l) => {
|
|
1320
|
+
if (!R(l)) throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object");
|
|
1321
|
+
});
|
|
1322
|
+
}, 0), o;
|
|
1323
|
+
}(e);
|
|
1324
|
+
var t;
|
|
1325
|
+
}
|
|
1326
|
+
function _o(e, t, r) {
|
|
1327
|
+
return X(e, r), (o) => ge(e, t, [o]);
|
|
1328
|
+
}
|
|
1329
|
+
function po(e, t, r) {
|
|
1330
|
+
return X(e, r), (o) => ge(e, t, [o]);
|
|
1331
|
+
}
|
|
1332
|
+
function mo(e, t, r) {
|
|
1333
|
+
return X(e, r), (o) => me(e, t, [o]);
|
|
1334
|
+
}
|
|
1335
|
+
function yo(e, t) {
|
|
1336
|
+
if ((e = `${e}`) != "bytes") throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamType`);
|
|
1337
|
+
return e;
|
|
1338
|
+
}
|
|
1339
|
+
function Zt(e, t) {
|
|
1340
|
+
V(e, t);
|
|
1341
|
+
const r = e?.preventAbort, o = e?.preventCancel, i = e?.preventClose, n = e?.signal;
|
|
1342
|
+
return n !== void 0 && function(s, a) {
|
|
1343
|
+
if (!function(l) {
|
|
1344
|
+
if (typeof l != "object" || l === null) return !1;
|
|
1345
|
+
try {
|
|
1346
|
+
return typeof l.aborted == "boolean";
|
|
1347
|
+
} catch {
|
|
1348
|
+
return !1;
|
|
1349
|
+
}
|
|
1350
|
+
}(s)) throw new TypeError(`${a} is not an AbortSignal.`);
|
|
1351
|
+
}(n, `${t} has member 'signal' that`), { preventAbort: !!r, preventCancel: !!o, preventClose: !!i, signal: n };
|
|
1352
|
+
}
|
|
1353
|
+
Object.defineProperties(Y.prototype, { close: { enumerable: !0 }, enqueue: { enumerable: !0 }, error: { enumerable: !0 }, desiredSize: { enumerable: !0 } }), m(Y.prototype.close, "close"), m(Y.prototype.enqueue, "enqueue"), m(Y.prototype.error, "error"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(Y.prototype, Symbol.toStringTag, { value: "ReadableStreamDefaultController", configurable: !0 });
|
|
1354
|
+
class C {
|
|
1355
|
+
constructor(t = {}, r = {}) {
|
|
1356
|
+
t === void 0 ? t = null : sr(t, "First parameter");
|
|
1357
|
+
const o = Fr(r, "Second parameter"), i = function(n, s) {
|
|
1358
|
+
V(n, s);
|
|
1359
|
+
const a = n, l = a?.autoAllocateChunkSize, u = a?.cancel, h = a?.pull, f = a?.start, b = a?.type;
|
|
1360
|
+
return { autoAllocateChunkSize: l === void 0 ? void 0 : Ct(l, `${s} has member 'autoAllocateChunkSize' that`), cancel: u === void 0 ? void 0 : _o(u, a, `${s} has member 'cancel' that`), pull: h === void 0 ? void 0 : po(h, a, `${s} has member 'pull' that`), start: f === void 0 ? void 0 : mo(f, a, `${s} has member 'start' that`), type: b === void 0 ? void 0 : yo(b, `${s} has member 'type' that`) };
|
|
1361
|
+
}(t, "First parameter");
|
|
1362
|
+
if (Dt(this), i.type === "bytes") {
|
|
1363
|
+
if (o.size !== void 0) throw new RangeError("The strategy for a byte stream cannot have a size function");
|
|
1364
|
+
(function(n, s, a) {
|
|
1365
|
+
const l = Object.create(N.prototype);
|
|
1366
|
+
let u, h, f;
|
|
1367
|
+
u = s.start !== void 0 ? () => s.start(l) : () => {
|
|
1368
|
+
}, h = s.pull !== void 0 ? () => s.pull(l) : () => v(void 0), f = s.cancel !== void 0 ? (w) => s.cancel(w) : () => v(void 0);
|
|
1369
|
+
const b = s.autoAllocateChunkSize;
|
|
1370
|
+
if (b === 0) throw new TypeError("autoAllocateChunkSize must be greater than 0");
|
|
1371
|
+
jr(n, l, u, h, f, a, b);
|
|
1372
|
+
})(this, i, yt(o, 0));
|
|
1373
|
+
} else {
|
|
1374
|
+
const n = Br(o);
|
|
1375
|
+
(function(s, a, l, u) {
|
|
1376
|
+
const h = Object.create(Y.prototype);
|
|
1377
|
+
let f, b, w;
|
|
1378
|
+
f = a.start !== void 0 ? () => a.start(h) : () => {
|
|
1379
|
+
}, b = a.pull !== void 0 ? () => a.pull(h) : () => v(void 0), w = a.cancel !== void 0 ? (T) => a.cancel(T) : () => v(void 0), Kr(s, h, f, b, w, l, u);
|
|
1380
|
+
})(this, i, yt(o, 1), n);
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
get locked() {
|
|
1384
|
+
if (!D(this)) throw Z("locked");
|
|
1385
|
+
return H(this);
|
|
1386
|
+
}
|
|
1387
|
+
cancel(t = void 0) {
|
|
1388
|
+
return D(this) ? H(this) ? c(new TypeError("Cannot cancel a stream that already has a reader")) : k(this, t) : c(Z("cancel"));
|
|
1389
|
+
}
|
|
1390
|
+
getReader(t = void 0) {
|
|
1391
|
+
if (!D(this)) throw Z("getReader");
|
|
1392
|
+
return function(r, o) {
|
|
1393
|
+
V(r, o);
|
|
1394
|
+
const i = r?.mode;
|
|
1395
|
+
return { mode: i === void 0 ? void 0 : io(i, `${o} has member 'mode' that`) };
|
|
1396
|
+
}(t, "First parameter").mode === void 0 ? ce(this) : Xt(this);
|
|
1397
|
+
}
|
|
1398
|
+
pipeThrough(t, r = {}) {
|
|
1399
|
+
if (!D(this)) throw Z("pipeThrough");
|
|
1400
|
+
ae(t, 1, "pipeThrough");
|
|
1401
|
+
const o = function(n, s) {
|
|
1402
|
+
V(n, s);
|
|
1403
|
+
const a = n?.readable;
|
|
1404
|
+
Nt(a, "readable", "ReadableWritablePair"), Ot(a, `${s} has member 'readable' that`);
|
|
1405
|
+
const l = n?.writable;
|
|
1406
|
+
return Nt(l, "writable", "ReadableWritablePair"), Ir(l, `${s} has member 'writable' that`), { readable: a, writable: l };
|
|
1407
|
+
}(t, "First parameter"), i = Zt(r, "Second parameter");
|
|
1408
|
+
if (H(this)) throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");
|
|
1409
|
+
if (pe(o.writable)) throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");
|
|
1410
|
+
return Ae(Qt(this, o.writable, i.preventClose, i.preventAbort, i.preventCancel, i.signal)), o.readable;
|
|
1411
|
+
}
|
|
1412
|
+
pipeTo(t, r = {}) {
|
|
1413
|
+
if (!D(this)) return c(Z("pipeTo"));
|
|
1414
|
+
if (t === void 0) return c("Parameter 1 is required in 'pipeTo'.");
|
|
1415
|
+
if (!he(t)) return c(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));
|
|
1416
|
+
let o;
|
|
1417
|
+
try {
|
|
1418
|
+
o = Zt(r, "Second parameter");
|
|
1419
|
+
} catch (i) {
|
|
1420
|
+
return c(i);
|
|
1421
|
+
}
|
|
1422
|
+
return H(this) ? c(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")) : pe(t) ? c(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")) : Qt(this, t, o.preventClose, o.preventAbort, o.preventCancel, o.signal);
|
|
1423
|
+
}
|
|
1424
|
+
tee() {
|
|
1425
|
+
if (!D(this)) throw Z("tee");
|
|
1426
|
+
return Se(te((t = this)._readableStreamController) ? function(r) {
|
|
1427
|
+
let o, i, n, s, a, l = ce(r), u = !1, h = !1, f = !1, b = !1, w = !1;
|
|
1428
|
+
const T = P((d) => {
|
|
1429
|
+
a = d;
|
|
1430
|
+
});
|
|
1431
|
+
function q(d) {
|
|
1432
|
+
bt(d._closedPromise, (p) => (d !== l || (A(n._readableStreamController, p), A(s._readableStreamController, p), b && w || a(void 0)), null));
|
|
1433
|
+
}
|
|
1434
|
+
function y() {
|
|
1435
|
+
oe(l) && (L(l), l = ce(r), q(l)), Ce(l, { _chunkSteps: (d) => {
|
|
1436
|
+
ie(() => {
|
|
1437
|
+
h = !1, f = !1;
|
|
1438
|
+
const p = d;
|
|
1439
|
+
let S = d;
|
|
1440
|
+
if (!b && !w) try {
|
|
1441
|
+
S = Gt(d);
|
|
1442
|
+
} catch (E) {
|
|
1443
|
+
return A(n._readableStreamController, E), A(s._readableStreamController, E), void a(k(r, E));
|
|
1444
|
+
}
|
|
1445
|
+
b || Ne(n._readableStreamController, p), w || Ne(s._readableStreamController, S), u = !1, h ? g() : f && z();
|
|
1446
|
+
});
|
|
1447
|
+
}, _closeSteps: () => {
|
|
1448
|
+
u = !1, b || qe(n._readableStreamController), w || qe(s._readableStreamController), n._readableStreamController._pendingPullIntos.length > 0 && Ye(n._readableStreamController, 0), s._readableStreamController._pendingPullIntos.length > 0 && Ye(s._readableStreamController, 0), b && w || a(void 0);
|
|
1449
|
+
}, _errorSteps: () => {
|
|
1450
|
+
u = !1;
|
|
1451
|
+
} });
|
|
1452
|
+
}
|
|
1453
|
+
function _(d, p) {
|
|
1454
|
+
U(l) && (L(l), l = Xt(r), q(l));
|
|
1455
|
+
const S = p ? s : n, E = p ? n : s;
|
|
1456
|
+
Wr(l, d, 1, { _chunkSteps: (O) => {
|
|
1457
|
+
ie(() => {
|
|
1458
|
+
h = !1, f = !1;
|
|
1459
|
+
const $ = p ? w : b;
|
|
1460
|
+
if (p ? b : w) $ || Ve(S._readableStreamController, O);
|
|
1461
|
+
else {
|
|
1462
|
+
let x;
|
|
1463
|
+
try {
|
|
1464
|
+
x = Gt(O);
|
|
1465
|
+
} catch (ot) {
|
|
1466
|
+
return A(S._readableStreamController, ot), A(E._readableStreamController, ot), void a(k(r, ot));
|
|
1467
|
+
}
|
|
1468
|
+
$ || Ve(S._readableStreamController, O), Ne(E._readableStreamController, x);
|
|
1469
|
+
}
|
|
1470
|
+
u = !1, h ? g() : f && z();
|
|
1471
|
+
});
|
|
1472
|
+
}, _closeSteps: (O) => {
|
|
1473
|
+
u = !1;
|
|
1474
|
+
const $ = p ? w : b, x = p ? b : w;
|
|
1475
|
+
$ || qe(S._readableStreamController), x || qe(E._readableStreamController), O !== void 0 && ($ || Ve(S._readableStreamController, O), !x && E._readableStreamController._pendingPullIntos.length > 0 && Ye(E._readableStreamController, 0)), $ && x || a(void 0);
|
|
1476
|
+
}, _errorSteps: () => {
|
|
1477
|
+
u = !1;
|
|
1478
|
+
} });
|
|
1479
|
+
}
|
|
1480
|
+
function g() {
|
|
1481
|
+
if (u) return h = !0, v(void 0);
|
|
1482
|
+
u = !0;
|
|
1483
|
+
const d = mt(n._readableStreamController);
|
|
1484
|
+
return d === null ? y() : _(d._view, !1), v(void 0);
|
|
1485
|
+
}
|
|
1486
|
+
function z() {
|
|
1487
|
+
if (u) return f = !0, v(void 0);
|
|
1488
|
+
u = !0;
|
|
1489
|
+
const d = mt(s._readableStreamController);
|
|
1490
|
+
return d === null ? y() : _(d._view, !0), v(void 0);
|
|
1491
|
+
}
|
|
1492
|
+
function I() {
|
|
1493
|
+
}
|
|
1494
|
+
return n = er(I, g, function(d) {
|
|
1495
|
+
if (b = !0, o = d, w) {
|
|
1496
|
+
const p = Se([o, i]), S = k(r, p);
|
|
1497
|
+
a(S);
|
|
1498
|
+
}
|
|
1499
|
+
return T;
|
|
1500
|
+
}), s = er(I, z, function(d) {
|
|
1501
|
+
if (w = !0, i = d, b) {
|
|
1502
|
+
const p = Se([o, i]), S = k(r, p);
|
|
1503
|
+
a(S);
|
|
1504
|
+
}
|
|
1505
|
+
return T;
|
|
1506
|
+
}), q(l), [n, s];
|
|
1507
|
+
}(t) : function(r) {
|
|
1508
|
+
const o = ce(r);
|
|
1509
|
+
let i, n, s, a, l, u = !1, h = !1, f = !1, b = !1;
|
|
1510
|
+
const w = P((y) => {
|
|
1511
|
+
l = y;
|
|
1512
|
+
});
|
|
1513
|
+
function T() {
|
|
1514
|
+
return u ? (h = !0, v(void 0)) : (u = !0, Ce(o, { _chunkSteps: (y) => {
|
|
1515
|
+
ie(() => {
|
|
1516
|
+
h = !1;
|
|
1517
|
+
const _ = y, g = y;
|
|
1518
|
+
f || ve(s._readableStreamController, _), b || ve(a._readableStreamController, g), u = !1, h && T();
|
|
1519
|
+
});
|
|
1520
|
+
}, _closeSteps: () => {
|
|
1521
|
+
u = !1, f || ye(s._readableStreamController), b || ye(a._readableStreamController), f && b || l(void 0);
|
|
1522
|
+
}, _errorSteps: () => {
|
|
1523
|
+
u = !1;
|
|
1524
|
+
} }), v(void 0));
|
|
1525
|
+
}
|
|
1526
|
+
function q() {
|
|
1527
|
+
}
|
|
1528
|
+
return s = Qe(q, T, function(y) {
|
|
1529
|
+
if (f = !0, i = y, b) {
|
|
1530
|
+
const _ = Se([i, n]), g = k(r, _);
|
|
1531
|
+
l(g);
|
|
1532
|
+
}
|
|
1533
|
+
return w;
|
|
1534
|
+
}), a = Qe(q, T, function(y) {
|
|
1535
|
+
if (b = !0, n = y, f) {
|
|
1536
|
+
const _ = Se([i, n]), g = k(r, _);
|
|
1537
|
+
l(g);
|
|
1538
|
+
}
|
|
1539
|
+
return w;
|
|
1540
|
+
}), bt(o._closedPromise, (y) => (G(s._readableStreamController, y), G(a._readableStreamController, y), f && b || l(void 0), null)), [s, a];
|
|
1541
|
+
}(t));
|
|
1542
|
+
var t;
|
|
1543
|
+
}
|
|
1544
|
+
values(t = void 0) {
|
|
1545
|
+
if (!D(this)) throw Z("values");
|
|
1546
|
+
return function(o, i) {
|
|
1547
|
+
const n = ce(o), s = new pr(n, i), a = Object.create(mr);
|
|
1548
|
+
return a._asyncIteratorImpl = s, a;
|
|
1549
|
+
}(this, (r = t, V(r, "First parameter"), { preventCancel: !!r?.preventCancel }).preventCancel);
|
|
1550
|
+
var r;
|
|
1551
|
+
}
|
|
1552
|
+
[je](t) {
|
|
1553
|
+
return this.values(t);
|
|
1554
|
+
}
|
|
1555
|
+
static from(t) {
|
|
1556
|
+
return ho(t);
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
function Qe(e, t, r, o = 1, i = () => 1) {
|
|
1560
|
+
const n = Object.create(C.prototype);
|
|
1561
|
+
return Dt(n), Kr(n, Object.create(Y.prototype), e, t, r, o, i), n;
|
|
1562
|
+
}
|
|
1563
|
+
function er(e, t, r) {
|
|
1564
|
+
const o = Object.create(C.prototype);
|
|
1565
|
+
return Dt(o), jr(o, Object.create(N.prototype), e, t, r, 0, void 0), o;
|
|
1566
|
+
}
|
|
1567
|
+
function Dt(e) {
|
|
1568
|
+
e._state = "readable", e._reader = void 0, e._storedError = void 0, e._disturbed = !1;
|
|
1569
|
+
}
|
|
1570
|
+
function D(e) {
|
|
1571
|
+
return !!R(e) && !!Object.prototype.hasOwnProperty.call(e, "_readableStreamController") && e instanceof C;
|
|
1572
|
+
}
|
|
1573
|
+
function H(e) {
|
|
1574
|
+
return e._reader !== void 0;
|
|
1575
|
+
}
|
|
1576
|
+
function k(e, t) {
|
|
1577
|
+
if (e._disturbed = !0, e._state === "closed") return v(void 0);
|
|
1578
|
+
if (e._state === "errored") return c(e._storedError);
|
|
1579
|
+
ke(e);
|
|
1580
|
+
const r = e._reader;
|
|
1581
|
+
if (r !== void 0 && oe(r)) {
|
|
1582
|
+
const o = r._readIntoRequests;
|
|
1583
|
+
r._readIntoRequests = new j(), o.forEach((i) => {
|
|
1584
|
+
i._closeSteps(void 0);
|
|
1585
|
+
});
|
|
1586
|
+
}
|
|
1587
|
+
return ne(e._readableStreamController[Rt](t), Pe);
|
|
1588
|
+
}
|
|
1589
|
+
function ke(e) {
|
|
1590
|
+
e._state = "closed";
|
|
1591
|
+
const t = e._reader;
|
|
1592
|
+
if (t !== void 0 && (ar(t), U(t))) {
|
|
1593
|
+
const r = t._readRequests;
|
|
1594
|
+
t._readRequests = new j(), r.forEach((o) => {
|
|
1595
|
+
o._closeSteps();
|
|
1596
|
+
});
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
function Qr(e, t) {
|
|
1600
|
+
e._state = "errored", e._storedError = t;
|
|
1601
|
+
const r = e._reader;
|
|
1602
|
+
r !== void 0 && (Pt(r, t), U(r) ? dr(r, t) : zr(r, t));
|
|
1603
|
+
}
|
|
1604
|
+
function Z(e) {
|
|
1605
|
+
return new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`);
|
|
1606
|
+
}
|
|
1607
|
+
function ft(e, t) {
|
|
1608
|
+
var r;
|
|
1609
|
+
(r = e._transformStreamController)._transformAlgorithm = void 0, r._flushAlgorithm = void 0, r._cancelAlgorithm = void 0, wt(e._writable._writableStreamController, t), function(o) {
|
|
1610
|
+
o._backpressure && Zr(o, !1);
|
|
1611
|
+
}(e);
|
|
1612
|
+
}
|
|
1613
|
+
function Zr(e, t) {
|
|
1614
|
+
e._backpressureChangePromise !== void 0 && e._backpressureChangePromise_resolve(), e._backpressureChangePromise = P((r) => {
|
|
1615
|
+
e._backpressureChangePromise_resolve = r;
|
|
1616
|
+
}), e._backpressure = t;
|
|
1617
|
+
}
|
|
1618
|
+
Object.defineProperties(C, { from: { enumerable: !0 } }), Object.defineProperties(C.prototype, { cancel: { enumerable: !0 }, getReader: { enumerable: !0 }, pipeThrough: { enumerable: !0 }, pipeTo: { enumerable: !0 }, tee: { enumerable: !0 }, values: { enumerable: !0 }, locked: { enumerable: !0 } }), m(C.from, "from"), m(C.prototype.cancel, "cancel"), m(C.prototype.getReader, "getReader"), m(C.prototype.pipeThrough, "pipeThrough"), m(C.prototype.pipeTo, "pipeTo"), m(C.prototype.tee, "tee"), m(C.prototype.values, "values"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(C.prototype, Symbol.toStringTag, { value: "ReadableStream", configurable: !0 }), Object.defineProperty(C.prototype, je, { value: C.prototype.values, writable: !0, configurable: !0 }), m((e) => e.byteLength, "size"), m(() => 1, "size");
|
|
1619
|
+
class fe {
|
|
1620
|
+
constructor() {
|
|
1621
|
+
throw new TypeError("Illegal constructor");
|
|
1622
|
+
}
|
|
1623
|
+
get desiredSize() {
|
|
1624
|
+
if (!$e(this)) throw xe("desiredSize");
|
|
1625
|
+
return xt(this._controlledTransformStream._readable._readableStreamController);
|
|
1626
|
+
}
|
|
1627
|
+
enqueue(t = void 0) {
|
|
1628
|
+
if (!$e(this)) throw xe("enqueue");
|
|
1629
|
+
(function(r, o) {
|
|
1630
|
+
const i = r._controlledTransformStream, n = i._readable._readableStreamController;
|
|
1631
|
+
if (!we(n)) throw new TypeError("Readable side is not in a state that permits enqueue");
|
|
1632
|
+
try {
|
|
1633
|
+
ve(n, o);
|
|
1634
|
+
} catch (a) {
|
|
1635
|
+
throw ft(i, a), i._readable._storedError;
|
|
1636
|
+
}
|
|
1637
|
+
var s;
|
|
1638
|
+
!Jr(s = n) !== i._backpressure && Zr(i, !0);
|
|
1639
|
+
})(this, t);
|
|
1640
|
+
}
|
|
1641
|
+
error(t = void 0) {
|
|
1642
|
+
if (!$e(this)) throw xe("error");
|
|
1643
|
+
var r, o, i;
|
|
1644
|
+
r = t, o = this._controlledTransformStream, i = r, G(o._readable._readableStreamController, i), ft(o, i);
|
|
1645
|
+
}
|
|
1646
|
+
terminate() {
|
|
1647
|
+
if (!$e(this)) throw xe("terminate");
|
|
1648
|
+
(function(t) {
|
|
1649
|
+
const r = t._controlledTransformStream;
|
|
1650
|
+
ye(r._readable._readableStreamController), ft(r, new TypeError("TransformStream terminated"));
|
|
1651
|
+
})(this);
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
function $e(e) {
|
|
1655
|
+
return !!R(e) && !!Object.prototype.hasOwnProperty.call(e, "_controlledTransformStream") && e instanceof fe;
|
|
1656
|
+
}
|
|
1657
|
+
function xe(e) {
|
|
1658
|
+
return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`);
|
|
1659
|
+
}
|
|
1660
|
+
Object.defineProperties(fe.prototype, { enqueue: { enumerable: !0 }, error: { enumerable: !0 }, terminate: { enumerable: !0 }, desiredSize: { enumerable: !0 } }), m(fe.prototype.enqueue, "enqueue"), m(fe.prototype.error, "error"), m(fe.prototype.terminate, "terminate"), typeof Symbol.toStringTag == "symbol" && Object.defineProperty(fe.prototype, Symbol.toStringTag, { value: "TransformStreamDefaultController", configurable: !0 });
|
|
1661
|
+
export {
|
|
1662
|
+
N as ReadableByteStreamController,
|
|
1663
|
+
C as ReadableStream,
|
|
1664
|
+
re as ReadableStreamBYOBReader,
|
|
1665
|
+
be as ReadableStreamBYOBRequest,
|
|
1666
|
+
Y as ReadableStreamDefaultController,
|
|
1667
|
+
ee as ReadableStreamDefaultReader,
|
|
1668
|
+
fe as TransformStreamDefaultController,
|
|
1669
|
+
de as WritableStream,
|
|
1670
|
+
Xe as WritableStreamDefaultController,
|
|
1671
|
+
M as WritableStreamDefaultWriter
|
|
1672
|
+
};
|