mphttpx 1.0.2 → 1.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/README.md +35 -1
- package/dist/index.cjs.js +986 -834
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.d.ts +132 -184
- package/dist/index.esm.js +986 -834
- package/dist/index.esm.min.js +1 -1
- package/dist/types/AbortSignalP.d.ts +7 -3
- package/dist/types/BlobP.d.ts +4 -2
- package/dist/types/BodyP.d.ts +5 -10
- package/dist/types/EventP.d.ts +21 -11
- package/dist/types/EventTargetP.d.ts +3 -4
- package/dist/types/FileReaderP.d.ts +13 -13
- package/dist/types/FormDataP.d.ts +5 -3
- package/dist/types/HeadersP.d.ts +4 -2
- package/dist/types/ProgressEventP.d.ts +5 -3
- package/dist/types/RequestP.d.ts +3 -3
- package/dist/types/ResponseP.d.ts +3 -2
- package/dist/types/TextDecoderP.d.ts +4 -2
- package/dist/types/URLSearchParamsP.d.ts +3 -2
- package/dist/types/XMLHttpRequestEventTargetP.d.ts +12 -9
- package/dist/types/XMLHttpRequestP.d.ts +25 -23
- package/dist/types/isPolyfill.d.ts +2 -1
- package/dist/types/request.d.ts +2 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
const polyfill = Symbol("isPolyfill");
|
|
2
|
-
const state$9 = Symbol("INTERNAL_STATE");
|
|
3
2
|
/* eslint-disable no-prototype-builtins */
|
|
4
3
|
const g = (typeof globalThis !== "undefined" && globalThis) ||
|
|
5
4
|
(typeof self !== "undefined" && self) ||
|
|
@@ -19,13 +18,13 @@ function isPolyfillType(name, value) {
|
|
|
19
18
|
&& value.isPolyfill.symbol === polyfill
|
|
20
19
|
&& "hierarchy" in value.isPolyfill
|
|
21
20
|
&& Array.isArray(value.isPolyfill.hierarchy)
|
|
22
|
-
&& value.isPolyfill.hierarchy.
|
|
21
|
+
&& value.isPolyfill.hierarchy.indexOf(name) > -1;
|
|
23
22
|
}
|
|
24
23
|
class MPException extends Error {
|
|
25
24
|
constructor(message, name) {
|
|
26
25
|
super();
|
|
27
|
-
this.message = message
|
|
28
|
-
this.name = name
|
|
26
|
+
this.message = message !== null && message !== void 0 ? message : this.message;
|
|
27
|
+
this.name = name !== null && name !== void 0 ? name : this.name;
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
30
|
function defineStringTag(targetFunc, stringTag) {
|
|
@@ -34,6 +33,12 @@ function defineStringTag(targetFunc, stringTag) {
|
|
|
34
33
|
value: stringTag,
|
|
35
34
|
});
|
|
36
35
|
}
|
|
36
|
+
function objectValues(obj) {
|
|
37
|
+
return Object.keys(obj).map(key => obj[key]);
|
|
38
|
+
}
|
|
39
|
+
function objectEntries(obj) {
|
|
40
|
+
return Object.keys(obj).map(key => [key, obj[key]]);
|
|
41
|
+
}
|
|
37
42
|
|
|
38
43
|
class TextEncoderP {
|
|
39
44
|
get encoding() { return "utf-8"; }
|
|
@@ -134,21 +139,22 @@ function encodeText(input, destination) {
|
|
|
134
139
|
}
|
|
135
140
|
const TextEncoderE = g["TextEncoder"] || TextEncoderP;
|
|
136
141
|
|
|
137
|
-
|
|
142
|
+
var _a$a, _b$3;
|
|
143
|
+
const state$h = Symbol( /* "TextDecoderState" */);
|
|
138
144
|
class TextDecoderP {
|
|
139
145
|
constructor(utfLabel = "utf-8", { fatal = false, ignoreBOM = false } = {}) {
|
|
140
|
-
if (
|
|
146
|
+
if (UTF8Labels.indexOf(utfLabel.toLowerCase()) === -1) {
|
|
141
147
|
throw new RangeError("TextDecoder: The encoding label provided ('" + utfLabel + "') is invalid.");
|
|
142
148
|
}
|
|
143
|
-
this[state$
|
|
144
|
-
this[state$
|
|
145
|
-
this[state$
|
|
149
|
+
this[state$h] = new TextDecoderState();
|
|
150
|
+
this[state$h].fatal = fatal;
|
|
151
|
+
this[state$h].ignoreBOM = ignoreBOM;
|
|
146
152
|
}
|
|
147
|
-
[state$8];
|
|
148
153
|
get encoding() { return "utf-8"; }
|
|
149
|
-
get fatal() { return this[state$
|
|
150
|
-
get ignoreBOM() { return this[state$
|
|
154
|
+
get fatal() { return this[state$h].fatal; }
|
|
155
|
+
get ignoreBOM() { return this[state$h].ignoreBOM; }
|
|
151
156
|
decode(buffer, { stream = false } = {}) {
|
|
157
|
+
const that = this[state$h];
|
|
152
158
|
let buf;
|
|
153
159
|
if (typeof buffer !== "undefined") {
|
|
154
160
|
if (buffer instanceof Uint8Array) {
|
|
@@ -162,28 +168,28 @@ class TextDecoderP {
|
|
|
162
168
|
}
|
|
163
169
|
}
|
|
164
170
|
else {
|
|
165
|
-
if (
|
|
171
|
+
if (that[_partial].length > 0) {
|
|
166
172
|
if (this.fatal) {
|
|
167
173
|
throw new TypeError("TextDecoder: Incomplete UTF-8 sequence.");
|
|
168
174
|
}
|
|
169
175
|
else {
|
|
170
|
-
|
|
176
|
+
that[_partial] = [];
|
|
171
177
|
}
|
|
172
178
|
}
|
|
173
179
|
return "";
|
|
174
180
|
}
|
|
175
|
-
if (!
|
|
181
|
+
if (!that[_bomSeen] && this.ignoreBOM && buf.length >= 3) {
|
|
176
182
|
if (buf[0] === 0xef && buf[1] === 0xbb && buf[2] === 0xbf) {
|
|
177
183
|
buf = buf.subarray(3);
|
|
178
|
-
|
|
184
|
+
that[_bomSeen] = true;
|
|
179
185
|
}
|
|
180
186
|
}
|
|
181
|
-
if (
|
|
182
|
-
let merged = new Uint8Array(
|
|
183
|
-
merged.set(
|
|
184
|
-
merged.set(buf,
|
|
187
|
+
if (that[_partial].length > 0) {
|
|
188
|
+
let merged = new Uint8Array(that[_partial].length + buf.length);
|
|
189
|
+
merged.set(that[_partial], 0);
|
|
190
|
+
merged.set(buf, that[_partial].length);
|
|
185
191
|
buf = merged;
|
|
186
|
-
|
|
192
|
+
that[_partial] = [];
|
|
187
193
|
}
|
|
188
194
|
let end = buf.length;
|
|
189
195
|
let res = [];
|
|
@@ -200,7 +206,7 @@ class TextDecoderP {
|
|
|
200
206
|
}
|
|
201
207
|
i--;
|
|
202
208
|
}
|
|
203
|
-
|
|
209
|
+
that[_partial] = Array.from(buf.slice(end)); // save tail
|
|
204
210
|
buf = buf.slice(0, end);
|
|
205
211
|
}
|
|
206
212
|
let i = 0;
|
|
@@ -277,128 +283,155 @@ class TextDecoderP {
|
|
|
277
283
|
get isPolyfill() { return { symbol: polyfill, hierarchy: ["TextDecoder"] }; }
|
|
278
284
|
}
|
|
279
285
|
defineStringTag(TextDecoderP, "TextDecoder");
|
|
286
|
+
const _bomSeen = Symbol();
|
|
287
|
+
const _partial = Symbol();
|
|
280
288
|
class TextDecoderState {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
289
|
+
constructor() {
|
|
290
|
+
this.fatal = false;
|
|
291
|
+
this.ignoreBOM = false;
|
|
292
|
+
this[_a$a] = false;
|
|
293
|
+
this[_b$3] = [];
|
|
294
|
+
}
|
|
285
295
|
}
|
|
296
|
+
_a$a = _bomSeen, _b$3 = _partial;
|
|
286
297
|
const UTF8Labels = ["utf-8", "utf8", "unicode-1-1-utf-8"];
|
|
287
298
|
function getBytesPerSequence(byte) {
|
|
288
299
|
return (byte > 0xEF) ? 4 : (byte > 0xDF) ? 3 : (byte > 0xBF) ? 2 : 1;
|
|
289
300
|
}
|
|
290
301
|
const TextDecoderE = g["TextDecoder"] || TextDecoderP;
|
|
291
302
|
|
|
303
|
+
var _a$9, _b$2, _c$1, _d$1, _e$1, _f$1;
|
|
304
|
+
const state$g = Symbol( /* "EventState" */);
|
|
292
305
|
class EventP {
|
|
293
|
-
static NONE = 0;
|
|
294
|
-
static CAPTURING_PHASE = 1;
|
|
295
|
-
static AT_TARGET = 2;
|
|
296
|
-
static BUBBLING_PHASE = 3;
|
|
297
306
|
constructor(type, eventInitDict) {
|
|
298
|
-
this
|
|
299
|
-
this
|
|
300
|
-
this
|
|
301
|
-
this
|
|
302
|
-
this[state$
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
get
|
|
310
|
-
get
|
|
311
|
-
get
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
get srcElement() { return this[state$
|
|
317
|
-
cancelBubble
|
|
318
|
-
|
|
319
|
-
get
|
|
307
|
+
this.NONE = EventP.NONE;
|
|
308
|
+
this.CAPTURING_PHASE = EventP.CAPTURING_PHASE;
|
|
309
|
+
this.AT_TARGET = EventP.AT_TARGET;
|
|
310
|
+
this.BUBBLING_PHASE = EventP.BUBBLING_PHASE;
|
|
311
|
+
this[state$g] = new EventState();
|
|
312
|
+
const that = this[state$g];
|
|
313
|
+
that.type = String(type);
|
|
314
|
+
that.bubbles = !!(eventInitDict === null || eventInitDict === void 0 ? void 0 : eventInitDict.bubbles);
|
|
315
|
+
that.cancelable = !!(eventInitDict === null || eventInitDict === void 0 ? void 0 : eventInitDict.cancelable);
|
|
316
|
+
that.composed = !!(eventInitDict === null || eventInitDict === void 0 ? void 0 : eventInitDict.composed);
|
|
317
|
+
}
|
|
318
|
+
get type() { return this[state$g].type; }
|
|
319
|
+
get bubbles() { return this[state$g].bubbles; }
|
|
320
|
+
get cancelable() { return this[state$g].cancelable; }
|
|
321
|
+
get composed() { return this[state$g].composed; }
|
|
322
|
+
get target() { return this[state$g].target; }
|
|
323
|
+
get currentTarget() { return this[state$g].currentTarget; }
|
|
324
|
+
get eventPhase() { return this[state$g].eventPhase; }
|
|
325
|
+
get srcElement() { return this[state$g].target; }
|
|
326
|
+
get cancelBubble() { return this[state$g].cancelBubble; }
|
|
327
|
+
set cancelBubble(value) { this[state$g].cancelBubble = value; }
|
|
328
|
+
get defaultPrevented() { return this[state$g].defaultPrevented; }
|
|
329
|
+
get returnValue() { return this[state$g].returnValue; }
|
|
320
330
|
set returnValue(value) { if (!value) {
|
|
321
331
|
this.preventDefault();
|
|
322
332
|
} }
|
|
323
|
-
get isTrusted() { return this[state$
|
|
324
|
-
get timeStamp() { return this[state$
|
|
333
|
+
get isTrusted() { return this[state$g][_isTrusted]; }
|
|
334
|
+
get timeStamp() { return this[state$g].timeStamp; }
|
|
325
335
|
composedPath() {
|
|
326
336
|
const path = !!this.target ? [this.target] : [];
|
|
327
337
|
if (!!this.currentTarget && this.currentTarget !== this.target)
|
|
328
338
|
path.push(this.currentTarget);
|
|
329
339
|
return path;
|
|
330
340
|
}
|
|
331
|
-
initEvent
|
|
332
|
-
|
|
341
|
+
initEvent(type, bubbles, cancelable) {
|
|
342
|
+
const that = this[state$g];
|
|
343
|
+
if (that[_dispatched])
|
|
333
344
|
return;
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
}
|
|
338
|
-
preventDefault
|
|
339
|
-
|
|
345
|
+
that.type = String(type);
|
|
346
|
+
that.bubbles = !!bubbles;
|
|
347
|
+
that.cancelable = !!cancelable;
|
|
348
|
+
}
|
|
349
|
+
preventDefault() {
|
|
350
|
+
const that = this[state$g];
|
|
351
|
+
if (that[_passive]) {
|
|
340
352
|
console.warn(`Ignoring 'preventDefault()' call on event of type '${this.type}' from a listener registered as 'passive'.`);
|
|
341
353
|
return;
|
|
342
354
|
}
|
|
343
355
|
if (this.cancelable) {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
356
|
+
that[_preventDefaultCalled] = true;
|
|
357
|
+
that.defaultPrevented = true;
|
|
358
|
+
that.returnValue = false;
|
|
347
359
|
}
|
|
348
|
-
}
|
|
349
|
-
stopImmediatePropagation
|
|
350
|
-
this[state$
|
|
360
|
+
}
|
|
361
|
+
stopImmediatePropagation() {
|
|
362
|
+
this[state$g][_stopImmediatePropagationCalled] = true;
|
|
351
363
|
this.cancelBubble = true;
|
|
352
|
-
}
|
|
364
|
+
}
|
|
353
365
|
stopPropagation() {
|
|
354
366
|
this.cancelBubble = true;
|
|
355
367
|
}
|
|
356
368
|
toString() { return "[object Event]"; }
|
|
357
369
|
get isPolyfill() { return { symbol: polyfill, hierarchy: ["Event"] }; }
|
|
358
370
|
}
|
|
371
|
+
EventP.NONE = 0;
|
|
372
|
+
EventP.CAPTURING_PHASE = 1;
|
|
373
|
+
EventP.AT_TARGET = 2;
|
|
374
|
+
EventP.BUBBLING_PHASE = 3;
|
|
359
375
|
defineStringTag(EventP, "Event");
|
|
376
|
+
const _TimeStamp = Symbol();
|
|
377
|
+
const _isTrusted = Symbol();
|
|
378
|
+
const _passive = Symbol();
|
|
379
|
+
const _dispatched = Symbol();
|
|
380
|
+
const _preventDefaultCalled = Symbol();
|
|
381
|
+
const _stopImmediatePropagationCalled = Symbol();
|
|
360
382
|
class EventState {
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
383
|
+
constructor() {
|
|
384
|
+
this.type = "";
|
|
385
|
+
this.bubbles = false;
|
|
386
|
+
this.cancelable = false;
|
|
387
|
+
this.composed = false;
|
|
388
|
+
this.target = null;
|
|
389
|
+
this.currentTarget = null;
|
|
390
|
+
this.eventPhase = EventP.NONE;
|
|
391
|
+
this.cancelBubble = false;
|
|
392
|
+
this.defaultPrevented = false;
|
|
393
|
+
this.returnValue = true;
|
|
394
|
+
this.timeStamp = (new Date()).getTime() - EventState[_TimeStamp];
|
|
395
|
+
this[_b$2] = false;
|
|
396
|
+
this[_c$1] = false;
|
|
397
|
+
this[_d$1] = false;
|
|
398
|
+
this[_e$1] = false;
|
|
399
|
+
this[_f$1] = false;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
_a$9 = _TimeStamp, _b$2 = _isTrusted, _c$1 = _passive, _d$1 = _dispatched, _e$1 = _preventDefaultCalled, _f$1 = _stopImmediatePropagationCalled;
|
|
403
|
+
EventState[_a$9] = (new Date()).getTime();
|
|
404
|
+
function createInnerEvent(target, type, eventInitDict, isTrusted = true) {
|
|
405
|
+
const event = new EventP(type, eventInitDict);
|
|
406
|
+
event[state$g].target = target;
|
|
407
|
+
event[state$g][_isTrusted] = isTrusted;
|
|
408
|
+
return event;
|
|
377
409
|
}
|
|
378
410
|
const EventE = g["EventTarget"] ? g["Event"] : EventP;
|
|
379
411
|
|
|
380
|
-
|
|
412
|
+
var _a$8;
|
|
413
|
+
const state$f = Symbol( /* "EventTargetState" */);
|
|
381
414
|
class EventTargetP {
|
|
382
415
|
constructor() {
|
|
383
|
-
this[state$
|
|
416
|
+
this[state$f] = new EventTargetState(this);
|
|
384
417
|
}
|
|
385
|
-
[state$7];
|
|
386
418
|
addEventListener(type, callback, options) {
|
|
419
|
+
const that = this[state$f];
|
|
387
420
|
const executor = new Executor(type, callback);
|
|
388
|
-
executor.options.capture = typeof options === "boolean" ? options : !!options
|
|
389
|
-
if (!
|
|
421
|
+
executor.options.capture = typeof options === "boolean" ? options : !!(options === null || options === void 0 ? void 0 : options.capture);
|
|
422
|
+
if (!that[_executors].some(x => x.equals(executor))) {
|
|
390
423
|
if (typeof options === "object") {
|
|
391
424
|
const { once, passive, signal } = options;
|
|
392
425
|
executor.options.once = !!once;
|
|
393
426
|
executor.options.passive = !!passive;
|
|
394
427
|
if (signal) {
|
|
395
428
|
executor.options.signal = signal;
|
|
396
|
-
|
|
429
|
+
reply.call(that, signal, executor);
|
|
397
430
|
}
|
|
398
431
|
}
|
|
399
|
-
|
|
432
|
+
that[_executors].push(executor);
|
|
400
433
|
const f = (v) => !!v.options.capture ? 0 : 1;
|
|
401
|
-
|
|
434
|
+
that[_executors] = that[_executors].sort((a, b) => f(a) - f(b));
|
|
402
435
|
}
|
|
403
436
|
}
|
|
404
437
|
dispatchEvent(event) {
|
|
@@ -408,104 +441,104 @@ class EventTargetP {
|
|
|
408
441
|
if (!(event instanceof EventP)) {
|
|
409
442
|
throw new TypeError("EventTarget.dispatchEvent: Argument 1 does not implement interface Event.");
|
|
410
443
|
}
|
|
411
|
-
const s = event[state$
|
|
444
|
+
const s = event[state$g];
|
|
412
445
|
s.target = this;
|
|
413
|
-
s
|
|
414
|
-
return this[state$
|
|
446
|
+
s[_isTrusted] = false;
|
|
447
|
+
return fire.call(this[state$f], event);
|
|
415
448
|
}
|
|
416
449
|
removeEventListener(type, callback, options) {
|
|
450
|
+
const that = this[state$f];
|
|
417
451
|
const executor = new Executor(type, callback);
|
|
418
|
-
executor.options.capture = typeof options === "boolean" ? options : !!options
|
|
419
|
-
if (
|
|
420
|
-
|
|
452
|
+
executor.options.capture = typeof options === "boolean" ? options : !!(options === null || options === void 0 ? void 0 : options.capture);
|
|
453
|
+
if (that[_executors].some(x => x.equals(executor))) {
|
|
454
|
+
that[_executors] = that[_executors].filter(x => !x.equals(executor));
|
|
421
455
|
}
|
|
422
456
|
}
|
|
423
457
|
toString() { return "[object EventTarget]"; }
|
|
424
458
|
get isPolyfill() { return { symbol: polyfill, hierarchy: ["EventTarget"] }; }
|
|
425
459
|
}
|
|
426
460
|
defineStringTag(EventTargetP, "EventTarget");
|
|
461
|
+
const _executors = Symbol();
|
|
427
462
|
class EventTargetState {
|
|
428
463
|
constructor(target) {
|
|
464
|
+
this[_a$8] = [];
|
|
429
465
|
this.target = target;
|
|
430
466
|
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
const { callback: cb } = executor;
|
|
450
|
-
if (typeof cb === "function")
|
|
451
|
-
cb.call(this.target, event);
|
|
452
|
-
}
|
|
453
|
-
catch (e) {
|
|
454
|
-
console.error(e);
|
|
455
|
-
}
|
|
456
|
-
s._passive = false;
|
|
457
|
-
if (s._stopImmediatePropagationCalled)
|
|
458
|
-
break;
|
|
459
|
-
}
|
|
460
|
-
if (onceIndexes.length > 0) {
|
|
461
|
-
this.executors = this.executors.reduce((acc, cur, index) => {
|
|
462
|
-
if (!onceIndexes.includes(index))
|
|
463
|
-
acc.push(cur);
|
|
464
|
-
return acc;
|
|
465
|
-
}, []);
|
|
466
|
-
}
|
|
467
|
-
s.currentTarget = null;
|
|
468
|
-
s.eventPhase = EventP.NONE;
|
|
469
|
-
s._dispatched = false;
|
|
470
|
-
return !(event.cancelable && s._preventDefaultCalled);
|
|
471
|
-
}
|
|
472
|
-
reply(signal, executor) {
|
|
467
|
+
}
|
|
468
|
+
_a$8 = _executors;
|
|
469
|
+
function fire(event) {
|
|
470
|
+
const s = event[state$g];
|
|
471
|
+
if (!event.target)
|
|
472
|
+
s.target = this.target;
|
|
473
|
+
s.currentTarget = this.target;
|
|
474
|
+
s.eventPhase = EventP.AT_TARGET;
|
|
475
|
+
s[_dispatched] = true;
|
|
476
|
+
const onceIndexes = [];
|
|
477
|
+
for (let i = 0; i < this[_executors].length; ++i) {
|
|
478
|
+
const executor = this[_executors][i];
|
|
479
|
+
if (executor.type !== event.type)
|
|
480
|
+
continue;
|
|
481
|
+
s[_passive] = !!executor.options.passive;
|
|
482
|
+
if (executor.options.once)
|
|
483
|
+
onceIndexes.push(i);
|
|
484
|
+
const { callback: cb } = executor;
|
|
473
485
|
try {
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
signal.removeEventListener("abort", onAbort);
|
|
477
|
-
};
|
|
478
|
-
signal.addEventListener("abort", onAbort);
|
|
486
|
+
if (typeof cb === "function")
|
|
487
|
+
cb.call(this.target, event);
|
|
479
488
|
}
|
|
480
489
|
catch (e) {
|
|
481
490
|
console.error(e);
|
|
482
491
|
}
|
|
492
|
+
s[_passive] = false;
|
|
493
|
+
if (s[_stopImmediatePropagationCalled])
|
|
494
|
+
break;
|
|
483
495
|
}
|
|
496
|
+
if (onceIndexes.length > 0) {
|
|
497
|
+
this[_executors] = this[_executors].reduce((acc, cur, index) => {
|
|
498
|
+
if (onceIndexes.indexOf(index) === -1)
|
|
499
|
+
acc.push(cur);
|
|
500
|
+
return acc;
|
|
501
|
+
}, []);
|
|
502
|
+
}
|
|
503
|
+
s.currentTarget = null;
|
|
504
|
+
s.eventPhase = EventP.NONE;
|
|
505
|
+
s[_dispatched] = false;
|
|
506
|
+
return !(event.cancelable && s[_preventDefaultCalled]);
|
|
484
507
|
}
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
}
|
|
493
|
-
else {
|
|
494
|
-
return cb;
|
|
495
|
-
}
|
|
508
|
+
function reply(signal, executor) {
|
|
509
|
+
const onAbort = () => {
|
|
510
|
+
this[_executors] = this[_executors].filter(x => !x.equals(executor));
|
|
511
|
+
signal.removeEventListener("abort", onAbort);
|
|
512
|
+
};
|
|
513
|
+
try {
|
|
514
|
+
signal.addEventListener("abort", onAbort);
|
|
496
515
|
}
|
|
516
|
+
catch (e) {
|
|
517
|
+
console.error(e);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
class Executor {
|
|
497
521
|
constructor(type, callback) {
|
|
522
|
+
this.options = {};
|
|
498
523
|
this.type = String(type);
|
|
499
|
-
this.callback =
|
|
524
|
+
this.callback = extract(callback);
|
|
500
525
|
}
|
|
501
|
-
type;
|
|
502
|
-
callback;
|
|
503
|
-
options = {};
|
|
504
526
|
equals(executor) {
|
|
505
527
|
return Object.is(this.type, executor.type) && Object.is(this.callback, executor.callback)
|
|
506
528
|
&& Object.is(this.options.capture, executor.options.capture);
|
|
507
529
|
}
|
|
508
530
|
}
|
|
531
|
+
function extract(cb) {
|
|
532
|
+
if (typeof cb === "function") {
|
|
533
|
+
return cb;
|
|
534
|
+
}
|
|
535
|
+
else if (isEventListenerObject(cb)) {
|
|
536
|
+
return cb.handleEvent;
|
|
537
|
+
}
|
|
538
|
+
else {
|
|
539
|
+
return cb;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
509
542
|
function isEventListenerObject(cb) {
|
|
510
543
|
return !!cb && "handleEvent" in cb && typeof cb.handleEvent === "function";
|
|
511
544
|
}
|
|
@@ -523,54 +556,77 @@ function executeFn(cb, ev) {
|
|
|
523
556
|
}
|
|
524
557
|
const EventTargetE = g["EventTarget"] || EventTargetP;
|
|
525
558
|
|
|
526
|
-
const state$
|
|
559
|
+
const state$e = Symbol( /* "CustomEventState" */);
|
|
527
560
|
class CustomEventP extends EventP {
|
|
528
561
|
constructor(type, eventInitDict) {
|
|
562
|
+
var _a;
|
|
529
563
|
super(type, eventInitDict);
|
|
530
|
-
this[state$
|
|
531
|
-
this[state$
|
|
564
|
+
this[state$e] = new CustomEventState();
|
|
565
|
+
this[state$e].detail = (_a = eventInitDict === null || eventInitDict === void 0 ? void 0 : eventInitDict.detail) !== null && _a !== void 0 ? _a : null;
|
|
532
566
|
}
|
|
533
|
-
[state$
|
|
534
|
-
get detail() { return this[state$6].detail; }
|
|
567
|
+
get detail() { return this[state$e].detail; }
|
|
535
568
|
initCustomEvent(type, bubbles, cancelable, detail) {
|
|
536
|
-
if (this[state$
|
|
569
|
+
if (this[state$g][_dispatched])
|
|
537
570
|
return;
|
|
538
571
|
this.initEvent(type, bubbles, cancelable);
|
|
539
|
-
this[state$
|
|
572
|
+
this[state$e].detail = detail !== null && detail !== void 0 ? detail : null;
|
|
540
573
|
}
|
|
541
574
|
toString() { return "[object CustomEvent]"; }
|
|
542
575
|
get isPolyfill() { return { symbol: polyfill, hierarchy: ["CustomEvent", "Event"] }; }
|
|
543
576
|
}
|
|
544
577
|
defineStringTag(CustomEventP, "CustomEvent");
|
|
545
578
|
class CustomEventState {
|
|
546
|
-
detail;
|
|
547
579
|
}
|
|
548
580
|
const CustomEventE = g["EventTarget"] ? g["CustomEvent"] : CustomEventP;
|
|
549
581
|
|
|
550
|
-
const state$
|
|
582
|
+
const state$d = Symbol( /* "ProgressEventState" */);
|
|
551
583
|
class ProgressEventP extends EventP {
|
|
552
584
|
constructor(type, eventInitDict) {
|
|
585
|
+
var _a, _b;
|
|
553
586
|
super(type, eventInitDict);
|
|
554
|
-
this[state$
|
|
555
|
-
this[state$
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
get lengthComputable() { return this[state$
|
|
561
|
-
get loaded() { return this[state$
|
|
562
|
-
get total() { return this[state$
|
|
587
|
+
this[state$d] = new ProgressEventState();
|
|
588
|
+
const that = this[state$d];
|
|
589
|
+
that.lengthComputable = !!(eventInitDict === null || eventInitDict === void 0 ? void 0 : eventInitDict.lengthComputable);
|
|
590
|
+
that.loaded = (_a = eventInitDict === null || eventInitDict === void 0 ? void 0 : eventInitDict.loaded) !== null && _a !== void 0 ? _a : 0;
|
|
591
|
+
that.total = (_b = eventInitDict === null || eventInitDict === void 0 ? void 0 : eventInitDict.total) !== null && _b !== void 0 ? _b : 0;
|
|
592
|
+
}
|
|
593
|
+
get lengthComputable() { return getValue(this[state$d].lengthComputable); }
|
|
594
|
+
get loaded() { return getValue(this[state$d].loaded); }
|
|
595
|
+
get total() { return getValue(this[state$d].total); }
|
|
563
596
|
toString() { return "[object ProgressEvent]"; }
|
|
564
597
|
get isPolyfill() { return { symbol: polyfill, hierarchy: ["ProgressEvent", "Event"] }; }
|
|
565
598
|
}
|
|
566
599
|
defineStringTag(ProgressEventP, "ProgressEvent");
|
|
567
600
|
class ProgressEventState {
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
601
|
+
constructor() {
|
|
602
|
+
this.lengthComputable = false;
|
|
603
|
+
this.loaded = 0;
|
|
604
|
+
this.total = 0;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
function getValue(val) {
|
|
608
|
+
return typeof val === "function" ? val() : val;
|
|
609
|
+
}
|
|
610
|
+
function createInnerProgressEvent(target, type, { lengthComputable = false, loaded = 0, total = 0, } = {}) {
|
|
611
|
+
const event = new ProgressEventP(type);
|
|
612
|
+
event[state$d].lengthComputable = lengthComputable;
|
|
613
|
+
event[state$d].loaded = loaded;
|
|
614
|
+
event[state$d].total = total;
|
|
615
|
+
event[state$g].target = target;
|
|
616
|
+
event[state$g][_isTrusted] = true;
|
|
617
|
+
return event;
|
|
618
|
+
}
|
|
619
|
+
function emitProcessEvent(target, type, loaded = 0, total = 0) {
|
|
620
|
+
const event = createInnerProgressEvent(target, type, {
|
|
621
|
+
lengthComputable: () => { return getValue(total) > 0; },
|
|
622
|
+
loaded,
|
|
623
|
+
total,
|
|
624
|
+
});
|
|
625
|
+
fire.call(target[state$f], event);
|
|
571
626
|
}
|
|
572
627
|
const ProgressEventE = g["EventTarget"] ? g["ProgressEvent"] : ProgressEventP;
|
|
573
628
|
|
|
629
|
+
const state$c = Symbol( /* "BlobState" */);
|
|
574
630
|
class BlobP {
|
|
575
631
|
constructor(blobParts = [], options) {
|
|
576
632
|
if (!Array.isArray(blobParts)) {
|
|
@@ -579,7 +635,7 @@ class BlobP {
|
|
|
579
635
|
let encoder = null;
|
|
580
636
|
let chunks = blobParts.reduce((chunks, part) => {
|
|
581
637
|
if (isPolyfillType("Blob", part)) {
|
|
582
|
-
chunks.push(part[state$
|
|
638
|
+
chunks.push(part[state$c][_u8array]);
|
|
583
639
|
}
|
|
584
640
|
else if (part instanceof ArrayBuffer || ArrayBuffer.isView(part)) {
|
|
585
641
|
chunks.push(convert$1(part));
|
|
@@ -592,42 +648,42 @@ class BlobP {
|
|
|
592
648
|
}
|
|
593
649
|
return chunks;
|
|
594
650
|
}, []);
|
|
595
|
-
this[state$
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
get size() { return this[state$
|
|
602
|
-
get type() { return this[state$
|
|
651
|
+
this[state$c] = new BlobState(concat(chunks));
|
|
652
|
+
const that = this[state$c];
|
|
653
|
+
that.size = that[_u8array].length;
|
|
654
|
+
const rawType = (options === null || options === void 0 ? void 0 : options.type) || "";
|
|
655
|
+
that.type = /[^\u0020-\u007E]/.test(rawType) ? "" : rawType.toLowerCase();
|
|
656
|
+
}
|
|
657
|
+
get size() { return this[state$c].size; }
|
|
658
|
+
get type() { return this[state$c].type; }
|
|
603
659
|
arrayBuffer() {
|
|
604
|
-
return Promise.resolve(clone(this[state$
|
|
660
|
+
return Promise.resolve(clone(this[state$c][_u8array].buffer).buffer);
|
|
605
661
|
}
|
|
606
662
|
bytes() {
|
|
607
|
-
return Promise.resolve(clone(this[state$
|
|
663
|
+
return Promise.resolve(clone(this[state$c][_u8array].buffer));
|
|
608
664
|
}
|
|
609
665
|
slice(start, end, contentType) {
|
|
610
|
-
const sliced = this[state$
|
|
611
|
-
return new BlobP([sliced], { type: contentType
|
|
666
|
+
const sliced = this[state$c][_u8array].slice(start !== null && start !== void 0 ? start : 0, end !== null && end !== void 0 ? end : this[state$c][_u8array].length);
|
|
667
|
+
return new BlobP([sliced], { type: contentType !== null && contentType !== void 0 ? contentType : "" });
|
|
612
668
|
}
|
|
613
669
|
stream() {
|
|
614
670
|
throw new ReferenceError("ReadableStream is not defined");
|
|
615
671
|
}
|
|
616
672
|
text() {
|
|
617
673
|
const decoder = new TextDecoderP();
|
|
618
|
-
return Promise.resolve(decoder.decode(this[state$
|
|
674
|
+
return Promise.resolve(decoder.decode(this[state$c][_u8array]));
|
|
619
675
|
}
|
|
620
676
|
toString() { return "[object Blob]"; }
|
|
621
677
|
get isPolyfill() { return { symbol: polyfill, hierarchy: ["Blob"] }; }
|
|
622
678
|
}
|
|
623
679
|
defineStringTag(BlobP, "Blob");
|
|
680
|
+
const _u8array = Symbol();
|
|
624
681
|
class BlobState {
|
|
625
682
|
constructor(buffer) {
|
|
626
|
-
this.
|
|
683
|
+
this.size = 0;
|
|
684
|
+
this.type = "";
|
|
685
|
+
this[_u8array] = buffer;
|
|
627
686
|
}
|
|
628
|
-
size = 0;
|
|
629
|
-
type = "";
|
|
630
|
-
_u8array;
|
|
631
687
|
}
|
|
632
688
|
function u8array2base64(input) {
|
|
633
689
|
let byteToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
|
@@ -674,151 +730,151 @@ function concat(chunks) {
|
|
|
674
730
|
}
|
|
675
731
|
const BlobE = g["Blob"] || BlobP;
|
|
676
732
|
|
|
677
|
-
const state$
|
|
733
|
+
const state$b = Symbol( /* "FileState" */);
|
|
678
734
|
class FileP extends BlobP {
|
|
679
735
|
constructor(fileBits, fileName, options) {
|
|
680
736
|
super(fileBits, options);
|
|
681
|
-
this[state$
|
|
682
|
-
this[state$
|
|
683
|
-
this[state$
|
|
737
|
+
this[state$b] = new FileState();
|
|
738
|
+
this[state$b].lastModified = +((options === null || options === void 0 ? void 0 : options.lastModified) ? new Date(options.lastModified) : new Date());
|
|
739
|
+
this[state$b].name = fileName.replace(/\//g, ":");
|
|
684
740
|
}
|
|
685
|
-
[state$
|
|
686
|
-
get
|
|
687
|
-
get name() { return this[state$4].name; }
|
|
741
|
+
get lastModified() { return this[state$b].lastModified; }
|
|
742
|
+
get name() { return this[state$b].name; }
|
|
688
743
|
get webkitRelativePath() { return ""; }
|
|
689
744
|
toString() { return "[object File]"; }
|
|
690
745
|
get isPolyfill() { return { symbol: polyfill, hierarchy: ["File", "Blob"] }; }
|
|
691
746
|
}
|
|
692
747
|
defineStringTag(FileP, "File");
|
|
693
748
|
class FileState {
|
|
694
|
-
|
|
695
|
-
|
|
749
|
+
constructor() {
|
|
750
|
+
this.lastModified = 0;
|
|
751
|
+
this.name = "";
|
|
752
|
+
}
|
|
696
753
|
}
|
|
697
754
|
const FileE = g["Blob"] ? g["File"] : FileP;
|
|
698
755
|
|
|
699
|
-
|
|
756
|
+
var _a$7;
|
|
757
|
+
const state$a = Symbol( /* "FileReaderState" */);
|
|
700
758
|
class FileReaderP extends EventTargetP {
|
|
701
|
-
static EMPTY = 0;
|
|
702
|
-
static LOADING = 1;
|
|
703
|
-
static DONE = 2;
|
|
704
759
|
constructor() {
|
|
705
760
|
super();
|
|
706
|
-
this
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
get error() { return this[state$3].error; }
|
|
761
|
+
this.EMPTY = 0;
|
|
762
|
+
this.LOADING = 1;
|
|
763
|
+
this.DONE = 2;
|
|
764
|
+
this[state$a] = new FileReaderState(this);
|
|
765
|
+
}
|
|
766
|
+
get readyState() { return this[state$a].readyState; }
|
|
767
|
+
get result() { return this[state$a].result; }
|
|
768
|
+
get error() { return this[state$a].error; }
|
|
715
769
|
abort() {
|
|
716
770
|
if (this.readyState === FileReaderP.LOADING) {
|
|
717
|
-
this[state$
|
|
718
|
-
this[state$
|
|
719
|
-
|
|
771
|
+
this[state$a].readyState = FileReaderP.DONE;
|
|
772
|
+
this[state$a].result = null;
|
|
773
|
+
emitProcessEvent(this, "abort");
|
|
720
774
|
}
|
|
721
775
|
}
|
|
722
|
-
readAsArrayBuffer
|
|
723
|
-
this[state$
|
|
724
|
-
this[state$
|
|
776
|
+
readAsArrayBuffer(blob) {
|
|
777
|
+
read$1.call(this[state$a], "readAsArrayBuffer", blob, () => {
|
|
778
|
+
this[state$a].result = blob[state$c][_u8array].buffer.slice(0);
|
|
725
779
|
});
|
|
726
|
-
}
|
|
727
|
-
readAsBinaryString
|
|
728
|
-
this[state$
|
|
729
|
-
this[state$
|
|
780
|
+
}
|
|
781
|
+
readAsBinaryString(blob) {
|
|
782
|
+
read$1.call(this[state$a], "readAsBinaryString", blob, () => {
|
|
783
|
+
this[state$a].result = blob[state$c][_u8array].reduce((acc, cur) => {
|
|
730
784
|
acc += String.fromCharCode(cur);
|
|
731
785
|
return acc;
|
|
732
786
|
}, "");
|
|
733
787
|
});
|
|
734
|
-
}
|
|
735
|
-
readAsDataURL
|
|
736
|
-
this[state$
|
|
737
|
-
this[state$
|
|
788
|
+
}
|
|
789
|
+
readAsDataURL(blob) {
|
|
790
|
+
read$1.call(this[state$a], "readAsDataURL", blob, () => {
|
|
791
|
+
this[state$a].result = "data:" + blob.type + ";base64," + u8array2base64(blob[state$c][_u8array]);
|
|
738
792
|
});
|
|
739
|
-
}
|
|
740
|
-
readAsText
|
|
741
|
-
this[state$
|
|
742
|
-
this[state$
|
|
793
|
+
}
|
|
794
|
+
readAsText(blob, encoding) {
|
|
795
|
+
read$1.call(this[state$a], "readAsText", blob, () => {
|
|
796
|
+
this[state$a].result = (new TextDecoderP(encoding)).decode(blob[state$c][_u8array]);
|
|
743
797
|
});
|
|
744
|
-
}
|
|
745
|
-
get onabort() { return this[state$
|
|
746
|
-
set onabort(value) { this[state$
|
|
747
|
-
get onerror() { return this[state$
|
|
748
|
-
set onerror(value) { this[state$
|
|
749
|
-
get onload() { return this[state$
|
|
750
|
-
set onload(value) { this[state$
|
|
751
|
-
get onloadend() { return this[state$
|
|
752
|
-
set onloadend(value) { this[state$
|
|
753
|
-
get onloadstart() { return this[state$
|
|
754
|
-
set onloadstart(value) { this[state$
|
|
755
|
-
get onprogress() { return this[state$
|
|
756
|
-
set onprogress(value) { this[state$
|
|
798
|
+
}
|
|
799
|
+
get onabort() { return this[state$a].onabort; }
|
|
800
|
+
set onabort(value) { this[state$a].onabort = value; attach$1.call(this[state$a], "abort"); }
|
|
801
|
+
get onerror() { return this[state$a].onerror; }
|
|
802
|
+
set onerror(value) { this[state$a].onerror = value; attach$1.call(this[state$a], "error"); }
|
|
803
|
+
get onload() { return this[state$a].onload; }
|
|
804
|
+
set onload(value) { this[state$a].onload = value; attach$1.call(this[state$a], "load"); }
|
|
805
|
+
get onloadend() { return this[state$a].onloadend; }
|
|
806
|
+
set onloadend(value) { this[state$a].onloadend = value; attach$1.call(this[state$a], "loadend"); }
|
|
807
|
+
get onloadstart() { return this[state$a].onloadstart; }
|
|
808
|
+
set onloadstart(value) { this[state$a].onloadstart = value; attach$1.call(this[state$a], "loadstart"); }
|
|
809
|
+
get onprogress() { return this[state$a].onprogress; }
|
|
810
|
+
set onprogress(value) { this[state$a].onprogress = value; attach$1.call(this[state$a], "progress"); }
|
|
757
811
|
toString() { return "[object FileReader]"; }
|
|
758
812
|
get isPolyfill() { return { symbol: polyfill, hierarchy: ["FileReader", "EventTarget"] }; }
|
|
759
813
|
}
|
|
814
|
+
FileReaderP.EMPTY = 0;
|
|
815
|
+
FileReaderP.LOADING = 1;
|
|
816
|
+
FileReaderP.DONE = 2;
|
|
760
817
|
defineStringTag(FileReaderP, "FileReader");
|
|
818
|
+
const _handlers$3 = Symbol();
|
|
761
819
|
class FileReaderState {
|
|
762
820
|
constructor(target) {
|
|
821
|
+
this.readyState = FileReaderP.EMPTY;
|
|
822
|
+
this.result = null;
|
|
823
|
+
this.error = null;
|
|
824
|
+
this[_a$7] = getHandlers$3.call(this);
|
|
825
|
+
this.onabort = null;
|
|
826
|
+
this.onerror = null;
|
|
827
|
+
this.onload = null;
|
|
828
|
+
this.onloadend = null;
|
|
829
|
+
this.onloadstart = null;
|
|
830
|
+
this.onprogress = null;
|
|
763
831
|
this.target = target;
|
|
764
832
|
}
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
if (!isPolyfillType("Blob", blob)) {
|
|
771
|
-
throw new TypeError("Failed to execute '" + kind + "' on 'FileReader': parameter 1 is not of type 'Blob'.");
|
|
772
|
-
}
|
|
773
|
-
this.error = null;
|
|
774
|
-
this.readyState = FileReaderP.LOADING;
|
|
775
|
-
this.emitProcessEvent("loadstart", 0, blob.size);
|
|
776
|
-
setTimeout(() => {
|
|
777
|
-
if (this.readyState === FileReaderP.LOADING) {
|
|
778
|
-
this.readyState = FileReaderP.DONE;
|
|
779
|
-
try {
|
|
780
|
-
setResult();
|
|
781
|
-
this.emitProcessEvent("load", blob.size, blob.size);
|
|
782
|
-
}
|
|
783
|
-
catch (e) {
|
|
784
|
-
this.result = null;
|
|
785
|
-
this.error = e;
|
|
786
|
-
this.emitProcessEvent("error", 0, blob.size);
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
this.emitProcessEvent("loadend", !!this.result ? blob.size : 0, blob.size);
|
|
790
|
-
});
|
|
833
|
+
}
|
|
834
|
+
_a$7 = _handlers$3;
|
|
835
|
+
function read$1(kind, blob, setResult) {
|
|
836
|
+
if (!isPolyfillType("Blob", blob)) {
|
|
837
|
+
throw new TypeError("Failed to execute '" + kind + "' on 'FileReader': parameter 1 is not of type 'Blob'.");
|
|
791
838
|
}
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
839
|
+
this.error = null;
|
|
840
|
+
this.readyState = FileReaderP.LOADING;
|
|
841
|
+
emitProcessEvent(this.target, "loadstart", 0, blob.size);
|
|
842
|
+
setTimeout(() => {
|
|
843
|
+
if (this.readyState === FileReaderP.LOADING) {
|
|
844
|
+
this.readyState = FileReaderP.DONE;
|
|
845
|
+
try {
|
|
846
|
+
setResult();
|
|
847
|
+
emitProcessEvent(this.target, "load", blob.size, blob.size);
|
|
848
|
+
}
|
|
849
|
+
catch (e) {
|
|
850
|
+
this.result = null;
|
|
851
|
+
this.error = e;
|
|
852
|
+
emitProcessEvent(this.target, "error", 0, blob.size);
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
emitProcessEvent(this.target, "loadend", !!this.result ? blob.size : 0, blob.size);
|
|
856
|
+
});
|
|
857
|
+
}
|
|
858
|
+
function attach$1(type) {
|
|
859
|
+
const fnName = ("on" + type);
|
|
860
|
+
const cb = this[fnName];
|
|
861
|
+
const listener = this[_handlers$3][fnName];
|
|
862
|
+
attachFn.call(this.target, type, cb, listener);
|
|
863
|
+
}
|
|
864
|
+
function getHandlers$3() {
|
|
865
|
+
return {
|
|
866
|
+
onabort: (ev) => { executeFn.call(this.target, this.onabort, ev); },
|
|
867
|
+
onerror: (ev) => { executeFn.call(this.target, this.onerror, ev); },
|
|
868
|
+
onload: (ev) => { executeFn.call(this.target, this.onload, ev); },
|
|
869
|
+
onloadend: (ev) => { executeFn.call(this.target, this.onloadend, ev); },
|
|
870
|
+
onloadstart: (ev) => { executeFn.call(this.target, this.onloadstart, ev); },
|
|
871
|
+
onprogress: (ev) => { executeFn.call(this.target, this.onprogress, ev); },
|
|
872
|
+
};
|
|
819
873
|
}
|
|
820
874
|
const FileReaderE = g["Blob"] ? g["FileReader"] : FileReaderP;
|
|
821
875
|
|
|
876
|
+
var _a$6;
|
|
877
|
+
const state$9 = Symbol( /* "FormDataState" */);
|
|
822
878
|
class FormDataP {
|
|
823
879
|
constructor(form, submitter) {
|
|
824
880
|
if (form !== void 0) {
|
|
@@ -829,20 +885,19 @@ class FormDataP {
|
|
|
829
885
|
}
|
|
830
886
|
this[state$9] = new FormDataState();
|
|
831
887
|
}
|
|
832
|
-
[state$9];
|
|
833
888
|
append(name, value, filename) {
|
|
834
|
-
this[state$9].
|
|
889
|
+
this[state$9][_formData].push(normalizeArgs(name, value, filename));
|
|
835
890
|
}
|
|
836
891
|
delete(name) {
|
|
837
892
|
const result = [];
|
|
838
893
|
name = String(name);
|
|
839
|
-
each(this[state$9]
|
|
894
|
+
each(this[state$9][_formData], entry => {
|
|
840
895
|
entry[0] !== name && result.push(entry);
|
|
841
896
|
});
|
|
842
|
-
this[state$9]
|
|
897
|
+
this[state$9][_formData] = result;
|
|
843
898
|
}
|
|
844
899
|
get(name) {
|
|
845
|
-
const entries = this[state$9]
|
|
900
|
+
const entries = this[state$9][_formData];
|
|
846
901
|
name = String(name);
|
|
847
902
|
for (let i = 0; i < entries.length; ++i) {
|
|
848
903
|
if (entries[i][0] === name) {
|
|
@@ -854,15 +909,15 @@ class FormDataP {
|
|
|
854
909
|
getAll(name) {
|
|
855
910
|
const result = [];
|
|
856
911
|
name = String(name);
|
|
857
|
-
each(this[state$9]
|
|
912
|
+
each(this[state$9][_formData], data => {
|
|
858
913
|
data[0] === name && result.push(data[1]);
|
|
859
914
|
});
|
|
860
915
|
return result;
|
|
861
916
|
}
|
|
862
917
|
has(name) {
|
|
863
918
|
name = String(name);
|
|
864
|
-
for (let i = 0; i < this[state$9].
|
|
865
|
-
if (this[state$9]
|
|
919
|
+
for (let i = 0; i < this[state$9][_formData].length; ++i) {
|
|
920
|
+
if (this[state$9][_formData][i][0] === name) {
|
|
866
921
|
return true;
|
|
867
922
|
}
|
|
868
923
|
}
|
|
@@ -873,13 +928,13 @@ class FormDataP {
|
|
|
873
928
|
const result = [];
|
|
874
929
|
const args = normalizeArgs(name, value, filename);
|
|
875
930
|
let replace = true;
|
|
876
|
-
each(this[state$9]
|
|
931
|
+
each(this[state$9][_formData], data => {
|
|
877
932
|
data[0] === name
|
|
878
933
|
? replace && (replace = !result.push(args))
|
|
879
934
|
: result.push(data);
|
|
880
935
|
});
|
|
881
936
|
replace && result.push(args);
|
|
882
|
-
this[state$9]
|
|
937
|
+
this[state$9][_formData] = result;
|
|
883
938
|
}
|
|
884
939
|
forEach(callbackfn, thisArg) {
|
|
885
940
|
for (const [name, value] of this) {
|
|
@@ -887,13 +942,13 @@ class FormDataP {
|
|
|
887
942
|
}
|
|
888
943
|
}
|
|
889
944
|
entries() {
|
|
890
|
-
return this[state$9].
|
|
945
|
+
return this[state$9][_formData].values();
|
|
891
946
|
}
|
|
892
947
|
keys() {
|
|
893
|
-
return this[state$9].
|
|
948
|
+
return this[state$9][_formData].map(x => x[0]).values();
|
|
894
949
|
}
|
|
895
950
|
values() {
|
|
896
|
-
return this[state$9].
|
|
951
|
+
return this[state$9][_formData].map(x => x[1]).values();
|
|
897
952
|
}
|
|
898
953
|
[Symbol.iterator]() {
|
|
899
954
|
return this.entries();
|
|
@@ -902,13 +957,16 @@ class FormDataP {
|
|
|
902
957
|
get isPolyfill() { return { symbol: polyfill, hierarchy: ["FormData"] }; }
|
|
903
958
|
}
|
|
904
959
|
defineStringTag(FormDataP, "FormData");
|
|
960
|
+
const _formData = Symbol();
|
|
905
961
|
class FormDataState {
|
|
906
|
-
|
|
962
|
+
constructor() {
|
|
963
|
+
this[_a$6] = [];
|
|
964
|
+
}
|
|
907
965
|
toBlob() {
|
|
908
966
|
const boundary = "----formdata-polyfill-" + Math.random();
|
|
909
967
|
const p = `--${boundary}\r\nContent-Disposition: form-data; name="`;
|
|
910
968
|
let chunks = [];
|
|
911
|
-
for (const [name, value] of this.
|
|
969
|
+
for (const [name, value] of this[_formData].values()) {
|
|
912
970
|
if (typeof value === "string") {
|
|
913
971
|
chunks.push(p + escape(normalizeLinefeeds(name)) + `"\r\n\r\n${normalizeLinefeeds(value)}\r\n`);
|
|
914
972
|
}
|
|
@@ -922,6 +980,7 @@ class FormDataState {
|
|
|
922
980
|
});
|
|
923
981
|
}
|
|
924
982
|
}
|
|
983
|
+
_a$6 = _formData;
|
|
925
984
|
function normalizeArgs(name, value, filename) {
|
|
926
985
|
if (isPolyfillType("Blob", value)) {
|
|
927
986
|
filename = filename !== undefined
|
|
@@ -952,7 +1011,7 @@ function escape(str) {
|
|
|
952
1011
|
* @param body - Text in multipart/form-data format (including boundaries and data)
|
|
953
1012
|
* @returns Parsed FormData object (text fields as strings, files as File objects)
|
|
954
1013
|
*/
|
|
955
|
-
function
|
|
1014
|
+
function createFormDataFromBody(body, errMsg = "Failed to fetch") {
|
|
956
1015
|
const formData = new FormDataP();
|
|
957
1016
|
if (typeof body !== "string" || body.trim() === "") {
|
|
958
1017
|
return formData;
|
|
@@ -961,7 +1020,7 @@ function createFormData(body) {
|
|
|
961
1020
|
const firstLineEnd = body.indexOf("\r\n");
|
|
962
1021
|
if (firstLineEnd === -1) {
|
|
963
1022
|
// Invalid multipart format: Missing line break in header
|
|
964
|
-
throw new TypeError(
|
|
1023
|
+
throw new TypeError(errMsg);
|
|
965
1024
|
}
|
|
966
1025
|
const boundary = body.substring(2, firstLineEnd).trim();
|
|
967
1026
|
if (!boundary) {
|
|
@@ -975,7 +1034,7 @@ function createFormData(body) {
|
|
|
975
1034
|
});
|
|
976
1035
|
if (parts.length === 0) {
|
|
977
1036
|
// Invalid multipart format: No parts found
|
|
978
|
-
throw new TypeError(
|
|
1037
|
+
throw new TypeError(errMsg);
|
|
979
1038
|
}
|
|
980
1039
|
// 3. Parse each part
|
|
981
1040
|
parts.forEach(part => {
|
|
@@ -983,7 +1042,7 @@ function createFormData(body) {
|
|
|
983
1042
|
const separatorIndex = part.indexOf("\r\n\r\n");
|
|
984
1043
|
if (separatorIndex === -1) {
|
|
985
1044
|
// Invalid part format: Missing header-content separator
|
|
986
|
-
throw new TypeError(
|
|
1045
|
+
throw new TypeError(errMsg);
|
|
987
1046
|
}
|
|
988
1047
|
// Extract header (Content-Disposition and Content-Type)
|
|
989
1048
|
const headerRaw = part.substring(0, separatorIndex).trim();
|
|
@@ -994,7 +1053,7 @@ function createFormData(body) {
|
|
|
994
1053
|
const contentTypeMatch = headerRaw.match(/Content-Type: ([^\r\n]+)/); // MIME type (optional)
|
|
995
1054
|
if (!nameMatch || !nameMatch[1]) {
|
|
996
1055
|
// Invalid part format: Missing field name
|
|
997
|
-
throw new TypeError(
|
|
1056
|
+
throw new TypeError(errMsg);
|
|
998
1057
|
}
|
|
999
1058
|
const fieldName = nameMatch[1];
|
|
1000
1059
|
const isFile = !!filenameMatch; // Whether it's a file field
|
|
@@ -1015,7 +1074,7 @@ function createFormData(body) {
|
|
|
1015
1074
|
}
|
|
1016
1075
|
catch (e) {
|
|
1017
1076
|
// `Failed to process file field "${fieldName}": ${(e as Error).message}`
|
|
1018
|
-
throw new TypeError(
|
|
1077
|
+
throw new TypeError(errMsg);
|
|
1019
1078
|
}
|
|
1020
1079
|
}
|
|
1021
1080
|
else {
|
|
@@ -1028,25 +1087,26 @@ function createFormData(body) {
|
|
|
1028
1087
|
}
|
|
1029
1088
|
const FormDataE = g["FormData"] || FormDataP;
|
|
1030
1089
|
|
|
1090
|
+
var _a$5;
|
|
1091
|
+
const state$8 = Symbol( /* "URLSearchParamsState" */);
|
|
1031
1092
|
class URLSearchParamsP {
|
|
1032
1093
|
constructor(init) {
|
|
1033
1094
|
let search = init || "";
|
|
1034
1095
|
if (isObjectType("URLSearchParams", search)) {
|
|
1035
1096
|
search = search.toString();
|
|
1036
1097
|
}
|
|
1037
|
-
this[state$
|
|
1038
|
-
this[state$
|
|
1098
|
+
this[state$8] = new URLSearchParamsState();
|
|
1099
|
+
this[state$8][_urlspDict] = parseToDict(search);
|
|
1039
1100
|
}
|
|
1040
|
-
[state$9];
|
|
1041
1101
|
get size() {
|
|
1042
|
-
return
|
|
1102
|
+
return objectValues(this[state$8][_urlspDict]).reduce((acc, cur) => acc + cur.length, 0);
|
|
1043
1103
|
}
|
|
1044
1104
|
append(name, value) {
|
|
1045
|
-
appendTo(this[state$
|
|
1105
|
+
appendTo(this[state$8][_urlspDict], name, value);
|
|
1046
1106
|
}
|
|
1047
1107
|
delete(name, value) {
|
|
1048
1108
|
let dict = {};
|
|
1049
|
-
for (let [key, values] of
|
|
1109
|
+
for (let [key, values] of objectEntries(this[state$8][_urlspDict])) {
|
|
1050
1110
|
if (key === name) {
|
|
1051
1111
|
if (value !== undefined) {
|
|
1052
1112
|
let vals = values.filter(x => x !== ("" + value));
|
|
@@ -1057,64 +1117,66 @@ class URLSearchParamsP {
|
|
|
1057
1117
|
}
|
|
1058
1118
|
Object.assign(dict, { [key]: values });
|
|
1059
1119
|
}
|
|
1060
|
-
this[state$
|
|
1120
|
+
this[state$8][_urlspDict] = dict;
|
|
1061
1121
|
}
|
|
1062
1122
|
get(name) {
|
|
1063
|
-
|
|
1123
|
+
var _b;
|
|
1124
|
+
return this.has(name) ? (_b = this[state$8][_urlspDict][name][0]) !== null && _b !== void 0 ? _b : null : null;
|
|
1064
1125
|
}
|
|
1065
1126
|
getAll(name) {
|
|
1066
|
-
return this.has(name) ? this[state$
|
|
1127
|
+
return this.has(name) ? this[state$8][_urlspDict][name].slice(0) : [];
|
|
1067
1128
|
}
|
|
1068
1129
|
has(name, value) {
|
|
1069
|
-
if (hasOwnProperty(this[state$
|
|
1130
|
+
if (hasOwnProperty(this[state$8][_urlspDict], name)) {
|
|
1070
1131
|
if (value !== undefined) {
|
|
1071
|
-
return this[state$
|
|
1132
|
+
return this[state$8][_urlspDict][name].indexOf(("" + value)) > -1;
|
|
1072
1133
|
}
|
|
1073
1134
|
return true;
|
|
1074
1135
|
}
|
|
1075
1136
|
return false;
|
|
1076
1137
|
}
|
|
1077
1138
|
set(name, value) {
|
|
1078
|
-
this[state$
|
|
1139
|
+
this[state$8][_urlspDict][name] = ["" + value];
|
|
1079
1140
|
}
|
|
1080
1141
|
sort() {
|
|
1081
|
-
|
|
1142
|
+
const that = this[state$8];
|
|
1143
|
+
let keys = Object.keys(that[_urlspDict]);
|
|
1082
1144
|
keys.sort();
|
|
1083
1145
|
let dict = {};
|
|
1084
1146
|
for (let key of keys) {
|
|
1085
|
-
Object.assign(dict, { [key]:
|
|
1147
|
+
Object.assign(dict, { [key]: that[_urlspDict][key] });
|
|
1086
1148
|
}
|
|
1087
|
-
|
|
1149
|
+
that[_urlspDict] = dict;
|
|
1088
1150
|
}
|
|
1089
1151
|
forEach(callbackfn, thisArg) {
|
|
1090
|
-
|
|
1152
|
+
objectEntries(this[state$8][_urlspDict]).forEach(([key, values]) => {
|
|
1091
1153
|
values.forEach(value => {
|
|
1092
1154
|
callbackfn.call(thisArg, value, key, this);
|
|
1093
1155
|
});
|
|
1094
1156
|
});
|
|
1095
1157
|
}
|
|
1096
1158
|
entries() {
|
|
1097
|
-
return
|
|
1159
|
+
return objectEntries(this[state$8][_urlspDict])
|
|
1098
1160
|
.map(([key, values]) => {
|
|
1099
1161
|
return values.map(value => {
|
|
1100
1162
|
return [key, value];
|
|
1101
1163
|
});
|
|
1102
1164
|
})
|
|
1103
|
-
.
|
|
1165
|
+
.reduce(flatCb, [])
|
|
1104
1166
|
.values();
|
|
1105
1167
|
}
|
|
1106
1168
|
keys() {
|
|
1107
|
-
return Object.keys(this[state$
|
|
1169
|
+
return Object.keys(this[state$8][_urlspDict]).values();
|
|
1108
1170
|
}
|
|
1109
1171
|
values() {
|
|
1110
|
-
return
|
|
1172
|
+
return objectValues(this[state$8][_urlspDict]).reduce(flatCb, []).values();
|
|
1111
1173
|
}
|
|
1112
1174
|
[Symbol.iterator]() {
|
|
1113
1175
|
return this.entries();
|
|
1114
1176
|
}
|
|
1115
1177
|
toString() {
|
|
1116
1178
|
let query = [];
|
|
1117
|
-
for (let [key, values] of
|
|
1179
|
+
for (let [key, values] of objectEntries(this[state$8][_urlspDict])) {
|
|
1118
1180
|
let name = encode$1(key);
|
|
1119
1181
|
for (let val of values) {
|
|
1120
1182
|
query.push(name + "=" + encode$1(val));
|
|
@@ -1125,9 +1187,13 @@ class URLSearchParamsP {
|
|
|
1125
1187
|
get isPolyfill() { return { symbol: polyfill, hierarchy: ["URLSearchParams"] }; }
|
|
1126
1188
|
}
|
|
1127
1189
|
defineStringTag(URLSearchParamsP, "URLSearchParams");
|
|
1190
|
+
const _urlspDict = Symbol();
|
|
1128
1191
|
class URLSearchParamsState {
|
|
1129
|
-
|
|
1192
|
+
constructor() {
|
|
1193
|
+
this[_a$5] = {};
|
|
1194
|
+
}
|
|
1130
1195
|
}
|
|
1196
|
+
_a$5 = _urlspDict;
|
|
1131
1197
|
function parseToDict(search) {
|
|
1132
1198
|
let dict = {};
|
|
1133
1199
|
if (typeof search === "object") {
|
|
@@ -1201,26 +1267,34 @@ function decode$1(str) {
|
|
|
1201
1267
|
function hasOwnProperty(obj, prop) {
|
|
1202
1268
|
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
1203
1269
|
}
|
|
1270
|
+
function flatCb(acc, cur) {
|
|
1271
|
+
for (const item of cur) {
|
|
1272
|
+
acc.push(item);
|
|
1273
|
+
}
|
|
1274
|
+
return acc;
|
|
1275
|
+
}
|
|
1204
1276
|
const URLSearchParamsE = g["URLSearchParams"] || URLSearchParamsP;
|
|
1205
1277
|
|
|
1278
|
+
var _a$4;
|
|
1279
|
+
const state$7 = Symbol( /* "AbortSignalState" */);
|
|
1206
1280
|
class AbortSignalP extends EventTargetP {
|
|
1207
1281
|
static abort(reason) {
|
|
1208
1282
|
const signal = createAbortSignalP();
|
|
1209
|
-
signal[state$
|
|
1283
|
+
abort.call(signal[state$7], reason, false);
|
|
1210
1284
|
return signal;
|
|
1211
1285
|
}
|
|
1212
1286
|
static any(signals) {
|
|
1213
1287
|
const signal = createAbortSignalP();
|
|
1214
1288
|
const abortedSignal = signals.find(x => x.aborted);
|
|
1215
1289
|
if (abortedSignal) {
|
|
1216
|
-
signal[state$
|
|
1290
|
+
abort.call(signal[state$7], abortedSignal.reason, false);
|
|
1217
1291
|
}
|
|
1218
1292
|
else {
|
|
1219
1293
|
function abortFn(ev) {
|
|
1220
1294
|
for (const sig of signals) {
|
|
1221
1295
|
sig.removeEventListener("abort", abortFn);
|
|
1222
1296
|
}
|
|
1223
|
-
signal[state$
|
|
1297
|
+
abort.call(signal[state$7], this.reason, true, ev.isTrusted);
|
|
1224
1298
|
}
|
|
1225
1299
|
for (const sig of signals) {
|
|
1226
1300
|
sig.addEventListener("abort", abortFn);
|
|
@@ -1231,7 +1305,7 @@ class AbortSignalP extends EventTargetP {
|
|
|
1231
1305
|
static timeout(milliseconds) {
|
|
1232
1306
|
const signal = createAbortSignalP();
|
|
1233
1307
|
setTimeout(() => {
|
|
1234
|
-
signal[state$
|
|
1308
|
+
abort.call(signal[state$7], new MPException("signal timed out", "TimeoutError"));
|
|
1235
1309
|
}, milliseconds);
|
|
1236
1310
|
return signal;
|
|
1237
1311
|
}
|
|
@@ -1240,128 +1314,140 @@ class AbortSignalP extends EventTargetP {
|
|
|
1240
1314
|
throw new TypeError("Failed to construct 'AbortSignal': Illegal constructor");
|
|
1241
1315
|
}
|
|
1242
1316
|
super();
|
|
1243
|
-
this[state$
|
|
1317
|
+
this[state$7] = new AbortSignalState(this);
|
|
1244
1318
|
}
|
|
1245
|
-
[state$
|
|
1246
|
-
get
|
|
1247
|
-
get reason() { return this[state$9].reason; }
|
|
1319
|
+
get aborted() { return this[state$7].aborted; }
|
|
1320
|
+
get reason() { return this[state$7].reason; }
|
|
1248
1321
|
throwIfAborted() {
|
|
1249
1322
|
if (this.aborted) {
|
|
1250
1323
|
throw this.reason;
|
|
1251
1324
|
}
|
|
1252
1325
|
}
|
|
1253
|
-
get onabort() { return this[state$
|
|
1326
|
+
get onabort() { return this[state$7].onabort; }
|
|
1254
1327
|
set onabort(value) {
|
|
1255
|
-
this[state$
|
|
1256
|
-
attachFn.call(this, "abort", value, this[state$
|
|
1328
|
+
this[state$7].onabort = value;
|
|
1329
|
+
attachFn.call(this, "abort", value, this[state$7][_handlers$2].onabort);
|
|
1257
1330
|
}
|
|
1258
1331
|
toString() { return "[object AbortSignal]"; }
|
|
1259
1332
|
get isPolyfill() { return { symbol: polyfill, hierarchy: ["AbortSignal", "EventTarget"] }; }
|
|
1260
1333
|
}
|
|
1261
1334
|
defineStringTag(AbortSignalP, "AbortSignal");
|
|
1335
|
+
const _handlers$2 = Symbol();
|
|
1262
1336
|
class AbortSignalState {
|
|
1263
1337
|
constructor(target) {
|
|
1338
|
+
this.aborted = false;
|
|
1339
|
+
this.reason = undefined;
|
|
1340
|
+
this[_a$4] = getHandlers$2.call(this);
|
|
1341
|
+
this.onabort = null;
|
|
1264
1342
|
this.target = target;
|
|
1265
1343
|
}
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
evt[state$9].target = this.target;
|
|
1276
|
-
evt[state$9].isTrusted = isTrusted;
|
|
1277
|
-
this.target[state$7].fire(evt);
|
|
1278
|
-
}
|
|
1344
|
+
}
|
|
1345
|
+
_a$4 = _handlers$2;
|
|
1346
|
+
function abort(reason, notify = true, isTrusted = true) {
|
|
1347
|
+
if (!this.aborted) {
|
|
1348
|
+
this.aborted = true;
|
|
1349
|
+
this.reason = reason !== null && reason !== void 0 ? reason : (new MPException("signal is aborted without reason", "AbortError"));
|
|
1350
|
+
if (notify) {
|
|
1351
|
+
const evt = createInnerEvent(this.target, "abort", undefined, isTrusted);
|
|
1352
|
+
fire.call(this.target[state$f], evt);
|
|
1279
1353
|
}
|
|
1280
1354
|
}
|
|
1281
|
-
|
|
1282
|
-
|
|
1355
|
+
}
|
|
1356
|
+
function getHandlers$2() {
|
|
1357
|
+
return {
|
|
1358
|
+
onabort: (ev) => { executeFn.call(this.target, this.onabort, ev); },
|
|
1359
|
+
};
|
|
1283
1360
|
}
|
|
1284
1361
|
function createAbortSignalP() {
|
|
1285
1362
|
const instance = Object.create(AbortSignalP.prototype);
|
|
1286
|
-
instance[state$
|
|
1287
|
-
instance[state$
|
|
1363
|
+
instance[state$f] = new EventTargetState(instance);
|
|
1364
|
+
instance[state$7] = new AbortSignalState(instance);
|
|
1288
1365
|
return instance;
|
|
1289
1366
|
}
|
|
1290
1367
|
const AbortSignalE = g["AbortSignal"] || AbortSignalP;
|
|
1291
1368
|
|
|
1292
|
-
const state$
|
|
1369
|
+
const state$6 = Symbol( /* "AbortControllerState" */);
|
|
1293
1370
|
class AbortControllerP {
|
|
1294
1371
|
constructor() {
|
|
1295
|
-
this[state$
|
|
1372
|
+
this[state$6] = new AbortControllerState();
|
|
1296
1373
|
}
|
|
1297
|
-
[state$
|
|
1298
|
-
get signal() { return this[state$2].signal; }
|
|
1374
|
+
get signal() { return this[state$6].signal; }
|
|
1299
1375
|
abort(reason) {
|
|
1300
|
-
this[state$
|
|
1376
|
+
abort.call(this[state$6].signal[state$7], reason);
|
|
1301
1377
|
}
|
|
1302
1378
|
toString() { return "[object AbortController]"; }
|
|
1303
1379
|
get isPolyfill() { return { symbol: polyfill, hierarchy: ["AbortController"] }; }
|
|
1304
1380
|
}
|
|
1305
1381
|
defineStringTag(AbortControllerP, "AbortController");
|
|
1306
1382
|
class AbortControllerState {
|
|
1307
|
-
|
|
1383
|
+
constructor() {
|
|
1384
|
+
this.signal = createAbortSignalP();
|
|
1385
|
+
}
|
|
1308
1386
|
}
|
|
1309
1387
|
const AbortControllerE = g["AbortController"] || AbortControllerP;
|
|
1310
1388
|
|
|
1389
|
+
var _a$3;
|
|
1390
|
+
const state$5 = Symbol( /* "XMLHttpRequestEventTargetState" */);
|
|
1311
1391
|
class XMLHttpRequestEventTargetP extends EventTargetP {
|
|
1312
1392
|
constructor() {
|
|
1313
1393
|
if (new.target === XMLHttpRequestEventTargetP) {
|
|
1314
1394
|
throw new TypeError("Failed to construct 'XMLHttpRequestEventTarget': Illegal constructor");
|
|
1315
1395
|
}
|
|
1316
1396
|
super();
|
|
1317
|
-
this[state$
|
|
1318
|
-
}
|
|
1319
|
-
[state$
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
set ontimeout(value) { this[state$9].ontimeout = value; this[state$9].attach("timeout"); }
|
|
1397
|
+
this[state$5] = new XMLHttpRequestEventTargetState(this);
|
|
1398
|
+
}
|
|
1399
|
+
get onabort() { return this[state$5].onabort; }
|
|
1400
|
+
set onabort(value) { this[state$5].onabort = value; attach.call(this[state$5], "abort"); }
|
|
1401
|
+
get onerror() { return this[state$5].onerror; }
|
|
1402
|
+
set onerror(value) { this[state$5].onerror = value; attach.call(this[state$5], "error"); }
|
|
1403
|
+
get onload() { return this[state$5].onload; }
|
|
1404
|
+
set onload(value) { this[state$5].onload = value; attach.call(this[state$5], "load"); }
|
|
1405
|
+
get onloadend() { return this[state$5].onloadend; }
|
|
1406
|
+
set onloadend(value) { this[state$5].onloadend = value; attach.call(this[state$5], "loadend"); }
|
|
1407
|
+
get onloadstart() { return this[state$5].onloadstart; }
|
|
1408
|
+
set onloadstart(value) { this[state$5].onloadstart = value; attach.call(this[state$5], "loadstart"); }
|
|
1409
|
+
get onprogress() { return this[state$5].onprogress; }
|
|
1410
|
+
set onprogress(value) { this[state$5].onprogress = value; attach.call(this[state$5], "progress"); }
|
|
1411
|
+
get ontimeout() { return this[state$5].ontimeout; }
|
|
1412
|
+
set ontimeout(value) { this[state$5].ontimeout = value; attach.call(this[state$5], "timeout"); }
|
|
1334
1413
|
toString() { return "[object XMLHttpRequestEventTarget]"; }
|
|
1335
1414
|
get isPolyfill() { return { symbol: polyfill, hierarchy: ["XMLHttpRequestEventTarget", "EventTarget"] }; }
|
|
1336
1415
|
}
|
|
1337
1416
|
defineStringTag(XMLHttpRequestEventTargetP, "XMLHttpRequestEventTarget");
|
|
1417
|
+
const _handlers$1 = Symbol();
|
|
1338
1418
|
class XMLHttpRequestEventTargetState {
|
|
1339
1419
|
/**
|
|
1340
1420
|
* @param _target XMLHttpRequestEventTargetP
|
|
1341
1421
|
*/
|
|
1342
1422
|
constructor(_target) {
|
|
1423
|
+
this[_a$3] = getHandlers$1.call(this);
|
|
1424
|
+
this.onabort = null;
|
|
1425
|
+
this.onerror = null;
|
|
1426
|
+
this.onload = null;
|
|
1427
|
+
this.onloadend = null;
|
|
1428
|
+
this.onloadstart = null;
|
|
1429
|
+
this.onprogress = null;
|
|
1430
|
+
this.ontimeout = null;
|
|
1343
1431
|
this.target = _target;
|
|
1344
1432
|
}
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
ontimeout = null;
|
|
1364
|
-
_ontimeout = (ev) => { executeFn.call(this.target, this.ontimeout, ev); };
|
|
1433
|
+
}
|
|
1434
|
+
_a$3 = _handlers$1;
|
|
1435
|
+
function attach(type) {
|
|
1436
|
+
const fnName = ("on" + type);
|
|
1437
|
+
const cb = this[fnName];
|
|
1438
|
+
const listener = this[_handlers$1][fnName];
|
|
1439
|
+
attachFn.call(this.target, type, cb, listener);
|
|
1440
|
+
}
|
|
1441
|
+
function getHandlers$1() {
|
|
1442
|
+
return {
|
|
1443
|
+
onabort: (ev) => { executeFn.call(this.target, this.onabort, ev); },
|
|
1444
|
+
onerror: (ev) => { executeFn.call(this.target, this.onerror, ev); },
|
|
1445
|
+
onload: (ev) => { executeFn.call(this.target, this.onload, ev); },
|
|
1446
|
+
onloadend: (ev) => { executeFn.call(this.target, this.onloadend, ev); },
|
|
1447
|
+
onloadstart: (ev) => { executeFn.call(this.target, this.onloadstart, ev); },
|
|
1448
|
+
onprogress: (ev) => { executeFn.call(this.target, this.onprogress, ev); },
|
|
1449
|
+
ontimeout: (ev) => { executeFn.call(this.target, this.ontimeout, ev); },
|
|
1450
|
+
};
|
|
1365
1451
|
}
|
|
1366
1452
|
|
|
1367
1453
|
class XMLHttpRequestUploadP extends XMLHttpRequestEventTargetP {
|
|
@@ -1377,8 +1463,8 @@ class XMLHttpRequestUploadP extends XMLHttpRequestEventTargetP {
|
|
|
1377
1463
|
defineStringTag(XMLHttpRequestUploadP, "XMLHttpRequestUpload");
|
|
1378
1464
|
function createXMLHttpRequestUploadP() {
|
|
1379
1465
|
const instance = Object.create(XMLHttpRequestUploadP.prototype);
|
|
1380
|
-
instance[state$
|
|
1381
|
-
instance[state$
|
|
1466
|
+
instance[state$f] = new EventTargetState(instance);
|
|
1467
|
+
instance[state$5] = new XMLHttpRequestEventTargetState(instance);
|
|
1382
1468
|
return instance;
|
|
1383
1469
|
}
|
|
1384
1470
|
|
|
@@ -1387,22 +1473,23 @@ const mp = (() => {
|
|
|
1387
1473
|
let u = "undefined", r = "request", f = "function";
|
|
1388
1474
|
let mp;
|
|
1389
1475
|
mp =
|
|
1390
|
-
(typeof wx !== u && typeof wx
|
|
1391
|
-
(typeof my !== u && typeof my
|
|
1392
|
-
(typeof qq !== u && typeof qq
|
|
1393
|
-
(typeof jd !== u && typeof jd
|
|
1394
|
-
(typeof swan !== u && typeof swan
|
|
1395
|
-
(typeof tt !== u && typeof tt
|
|
1396
|
-
(typeof ks !== u && typeof ks
|
|
1397
|
-
(typeof qh !== u && typeof qh
|
|
1476
|
+
(typeof wx !== u && typeof (wx === null || wx === void 0 ? void 0 : wx[r]) === f && wx) || // 微信
|
|
1477
|
+
(typeof my !== u && typeof (my === null || my === void 0 ? void 0 : my[r]) === f && my) || // 支付宝
|
|
1478
|
+
(typeof qq !== u && typeof (qq === null || qq === void 0 ? void 0 : qq[r]) === f && qq) || // QQ
|
|
1479
|
+
(typeof jd !== u && typeof (jd === null || jd === void 0 ? void 0 : jd[r]) === f && jd) || // 京东
|
|
1480
|
+
(typeof swan !== u && typeof (swan === null || swan === void 0 ? void 0 : swan[r]) === f && swan) || // 百度
|
|
1481
|
+
(typeof tt !== u && typeof (tt === null || tt === void 0 ? void 0 : tt[r]) === f && tt) || // 抖音 | 飞书
|
|
1482
|
+
(typeof ks !== u && typeof (ks === null || ks === void 0 ? void 0 : ks[r]) === f && ks) || // 快手
|
|
1483
|
+
(typeof qh !== u && typeof (qh === null || qh === void 0 ? void 0 : qh[r]) === f && qh) || // 360
|
|
1484
|
+
(typeof xhs !== u && typeof (xhs === null || xhs === void 0 ? void 0 : xhs[r]) === f && xhs) || // 小红书
|
|
1398
1485
|
undefined;
|
|
1399
1486
|
if (typeof g["XMLHttpRequest"] === f) {
|
|
1400
1487
|
return;
|
|
1401
1488
|
}
|
|
1402
1489
|
if (mp === undefined)
|
|
1403
1490
|
mp =
|
|
1404
|
-
(typeof uni !== u && typeof uni
|
|
1405
|
-
(typeof Taro !== u && typeof Taro
|
|
1491
|
+
(typeof uni !== u && typeof (uni === null || uni === void 0 ? void 0 : uni[r]) === f && uni) || // UniApp
|
|
1492
|
+
(typeof Taro !== u && typeof (Taro === null || Taro === void 0 ? void 0 : Taro[r]) === f && Taro) || // Taro
|
|
1406
1493
|
undefined;
|
|
1407
1494
|
return mp;
|
|
1408
1495
|
})();
|
|
@@ -1420,300 +1507,319 @@ const request = mp ? mp.request : function errorRequest(options) {
|
|
|
1420
1507
|
useHttpDNS: false,
|
|
1421
1508
|
};
|
|
1422
1509
|
Promise.resolve(err)
|
|
1423
|
-
.then(err => {
|
|
1424
|
-
options.fail
|
|
1510
|
+
.then(err => { try {
|
|
1511
|
+
if (options.fail) {
|
|
1512
|
+
options.fail(err);
|
|
1513
|
+
}
|
|
1514
|
+
}
|
|
1515
|
+
catch (e) {
|
|
1516
|
+
console.warn(e);
|
|
1425
1517
|
} })
|
|
1426
|
-
.
|
|
1518
|
+
.then(() => { if (options.complete) {
|
|
1427
1519
|
options.complete(err);
|
|
1428
1520
|
} });
|
|
1429
1521
|
throw new ReferenceError("request is not defined");
|
|
1430
1522
|
};
|
|
1431
1523
|
|
|
1432
|
-
|
|
1524
|
+
var _a$2, _b$1, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1525
|
+
const state$4 = Symbol( /* "XMLHttpRequestState" */);
|
|
1433
1526
|
class XMLHttpRequestP extends XMLHttpRequestEventTargetP {
|
|
1434
|
-
static UNSENT = 0;
|
|
1435
|
-
static OPENED = 1;
|
|
1436
|
-
static HEADERS_RECEIVED = 2;
|
|
1437
|
-
static LOADING = 3;
|
|
1438
|
-
static DONE = 4;
|
|
1439
1527
|
constructor() {
|
|
1440
1528
|
super();
|
|
1441
|
-
this
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
get
|
|
1450
|
-
get response() { return this[state$1].response; }
|
|
1529
|
+
this.UNSENT = 0;
|
|
1530
|
+
this.OPENED = 1;
|
|
1531
|
+
this.HEADERS_RECEIVED = 2;
|
|
1532
|
+
this.LOADING = 3;
|
|
1533
|
+
this.DONE = 4;
|
|
1534
|
+
this[state$4] = new XMLHttpRequestState(this);
|
|
1535
|
+
}
|
|
1536
|
+
get readyState() { return this[state$4].readyState; }
|
|
1537
|
+
get response() { return this[state$4].response; }
|
|
1451
1538
|
get responseText() { return (!this.responseType || this.responseType === "text") ? this.response : ""; }
|
|
1452
|
-
get responseType() { return this[state$
|
|
1453
|
-
set responseType(value) { this[state$
|
|
1454
|
-
get responseURL() { return this[state$
|
|
1539
|
+
get responseType() { return this[state$4].responseType; }
|
|
1540
|
+
set responseType(value) { this[state$4].responseType = value; }
|
|
1541
|
+
get responseURL() { return this[state$4].responseURL; }
|
|
1455
1542
|
get responseXML() { return null; }
|
|
1456
|
-
get status() { return this[state$
|
|
1543
|
+
get status() { return this[state$4].status; }
|
|
1457
1544
|
get statusText() {
|
|
1458
1545
|
if (this.readyState === XMLHttpRequestP.UNSENT || this.readyState === XMLHttpRequestP.OPENED)
|
|
1459
1546
|
return "";
|
|
1460
|
-
return this[state$
|
|
1547
|
+
return this[state$4].statusText || statusTextMap(this.status);
|
|
1461
1548
|
}
|
|
1462
|
-
get timeout() { return this[state$
|
|
1463
|
-
set timeout(value) { this[state$
|
|
1464
|
-
get upload() { return this[state$
|
|
1465
|
-
get withCredentials() { return this[state$
|
|
1466
|
-
set withCredentials(value) { this[state$
|
|
1549
|
+
get timeout() { return this[state$4].timeout; }
|
|
1550
|
+
set timeout(value) { this[state$4].timeout = value; }
|
|
1551
|
+
get upload() { return this[state$4].upload; }
|
|
1552
|
+
get withCredentials() { return this[state$4].withCredentials; }
|
|
1553
|
+
set withCredentials(value) { this[state$4].withCredentials = value; }
|
|
1467
1554
|
abort() {
|
|
1468
|
-
this[state$
|
|
1555
|
+
clearRequest.call(this[state$4]);
|
|
1469
1556
|
}
|
|
1470
1557
|
getAllResponseHeaders() {
|
|
1471
|
-
if (!this[state$
|
|
1558
|
+
if (!this[state$4][_responseHeaders])
|
|
1472
1559
|
return "";
|
|
1473
|
-
return
|
|
1560
|
+
return objectEntries(this[state$4][_responseHeaders] || {}).map(([k, v]) => `${k}: ${v}\r\n`).join("");
|
|
1474
1561
|
}
|
|
1475
1562
|
getResponseHeader(name) {
|
|
1476
|
-
|
|
1563
|
+
var _l, _m;
|
|
1564
|
+
if (!this[state$4][_responseHeaders])
|
|
1477
1565
|
return null;
|
|
1478
|
-
|
|
1566
|
+
const nameKey = name.toLowerCase();
|
|
1567
|
+
return (_m = (_l = objectEntries(this[state$4][_responseHeaders] || {}).find(x => x[0].toLowerCase() === nameKey)) === null || _l === void 0 ? void 0 : _l[1]) !== null && _m !== void 0 ? _m : null;
|
|
1479
1568
|
}
|
|
1480
1569
|
open(...args) {
|
|
1481
1570
|
const [method, url, async = true, username = null, password = null] = args;
|
|
1571
|
+
const that = this[state$4];
|
|
1482
1572
|
if (args.length < 2) {
|
|
1483
1573
|
throw new TypeError(`Failed to execute 'open' on 'XMLHttpRequest': 2 arguments required, but only ${args.length} present.`);
|
|
1484
1574
|
}
|
|
1485
1575
|
if (!async) {
|
|
1486
|
-
console.warn("Synchronous XMLHttpRequest is
|
|
1576
|
+
console.warn("Synchronous XMLHttpRequest is not supported because of its detrimental effects to the end user's experience.");
|
|
1577
|
+
}
|
|
1578
|
+
clearRequest.call(that, false);
|
|
1579
|
+
that[_method] = normalizeMethod(method);
|
|
1580
|
+
that[_requestURL] = String(url);
|
|
1581
|
+
if (username !== null || password !== null) {
|
|
1582
|
+
const _username = String(username !== null && username !== void 0 ? username : "");
|
|
1583
|
+
const _password = String(password !== null && password !== void 0 ? password : "");
|
|
1584
|
+
if (_username.length > 0 || _password.length > 0) {
|
|
1585
|
+
const auth = `Basic ${u8array2base64((new TextEncoderP()).encode(_username + ":" + _password))}`;
|
|
1586
|
+
this.setRequestHeader("Authorization", auth);
|
|
1587
|
+
}
|
|
1588
|
+
}
|
|
1589
|
+
that[_inAfterOpenBeforeSend] = true;
|
|
1590
|
+
setReadyStateAndNotify.call(that, XMLHttpRequestP.OPENED);
|
|
1591
|
+
}
|
|
1592
|
+
overrideMimeType(mime) {
|
|
1593
|
+
if (this[state$4][_inAfterOpenBeforeSend]) {
|
|
1594
|
+
console.warn(`XMLHttpRequest.overrideMimeType(${mime}) is not implemented: The method will have no effect on response parsing.`);
|
|
1487
1595
|
}
|
|
1488
|
-
this[state$1].clearRequest(false);
|
|
1489
|
-
this[state$1]._method = normalizeMethod(method);
|
|
1490
|
-
this[state$1]._reqURL = String(url);
|
|
1491
|
-
this[state$1]._reqCanSend = true;
|
|
1492
|
-
this[state$1].setReadyStateAndNotify(XMLHttpRequestP.OPENED);
|
|
1493
1596
|
}
|
|
1494
|
-
overrideMimeType(mime) { }
|
|
1495
1597
|
send(body) {
|
|
1496
|
-
|
|
1598
|
+
const that = this[state$4];
|
|
1599
|
+
if (!that[_inAfterOpenBeforeSend] || that.readyState !== XMLHttpRequestP.OPENED) {
|
|
1497
1600
|
throw new MPException("Failed to execute 'send' on 'XMLHttpRequest': The object's state must be OPENED.", "InvalidStateError");
|
|
1498
1601
|
}
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
assignRequestHeader(this[state$1]._reqHeaders, name, value);
|
|
1505
|
-
}
|
|
1506
|
-
get onreadystatechange() { return this[state$1].onreadystatechange; }
|
|
1507
|
-
set onreadystatechange(value) {
|
|
1508
|
-
this[state$1].onreadystatechange = value;
|
|
1509
|
-
attachFn.call(this, "readystatechange", value, this[state$1]._onreadystatechange);
|
|
1510
|
-
}
|
|
1511
|
-
toString() { return "[object XMLHttpRequest"; }
|
|
1512
|
-
get isPolyfill() { return { symbol: polyfill, hierarchy: ["XMLHttpRequest", "XMLHttpRequestEventTarget", "EventTarget"] }; }
|
|
1513
|
-
}
|
|
1514
|
-
defineStringTag(XMLHttpRequestP, "XMLHttpRequest");
|
|
1515
|
-
class XMLHttpRequestState {
|
|
1516
|
-
constructor(target) {
|
|
1517
|
-
this.target = target;
|
|
1518
|
-
this.upload = createXMLHttpRequestUploadP();
|
|
1519
|
-
}
|
|
1520
|
-
target;
|
|
1521
|
-
readyState = XMLHttpRequestP.UNSENT;
|
|
1522
|
-
response = "";
|
|
1523
|
-
responseType = "";
|
|
1524
|
-
responseURL = "";
|
|
1525
|
-
status = 0;
|
|
1526
|
-
statusText = "";
|
|
1527
|
-
timeout = 0;
|
|
1528
|
-
upload;
|
|
1529
|
-
withCredentials = false;
|
|
1530
|
-
_reqCanSend = false;
|
|
1531
|
-
_resetPending = false;
|
|
1532
|
-
_timeoutId = 0;
|
|
1533
|
-
_reqURL = "";
|
|
1534
|
-
_method = "GET";
|
|
1535
|
-
_reqHeaders = { Accept: "*/*" };
|
|
1536
|
-
_resHeaders = null;
|
|
1537
|
-
_resContLen = 0;
|
|
1538
|
-
_requestTask = null;
|
|
1539
|
-
execRequest(body) {
|
|
1540
|
-
const allowsRequestBody = !["GET", "HEAD"].includes(this._method);
|
|
1541
|
-
const contentTypeExists = Object.keys(this._reqHeaders).map(x => x.toLowerCase()).includes("Content-Type".toLowerCase());
|
|
1542
|
-
const processHeaders = allowsRequestBody && !contentTypeExists;
|
|
1543
|
-
const processContentLength = this.upload[state$7].executors.length > 0;
|
|
1544
|
-
let headers = { ...this._reqHeaders };
|
|
1602
|
+
that[_inAfterOpenBeforeSend] = false;
|
|
1603
|
+
const allowsRequestBody = ["GET", "HEAD"].indexOf(that[_method]) === -1;
|
|
1604
|
+
const processHeaders = allowsRequestBody && Object.keys(that[_requestHeaders]).map(x => x.toLowerCase()).indexOf("content-type") === -1;
|
|
1605
|
+
const processContentLength = that.upload[state$f][_executors].length > 0;
|
|
1606
|
+
let headers = Object.assign({}, that[_requestHeaders]);
|
|
1545
1607
|
let contentLength = 0;
|
|
1546
|
-
let data = convert(body, processHeaders ? v => { headers
|
|
1547
|
-
|
|
1548
|
-
url:
|
|
1549
|
-
method:
|
|
1608
|
+
let data = convert(body, processHeaders ? v => { assignRequestHeader(headers, "Content-Type", v); } : void 0, processContentLength ? v => { contentLength = v; } : void 0);
|
|
1609
|
+
that[_requestTask] = request({
|
|
1610
|
+
url: that[_requestURL],
|
|
1611
|
+
method: that[_method],
|
|
1550
1612
|
header: headers,
|
|
1551
1613
|
data,
|
|
1552
|
-
dataType:
|
|
1553
|
-
responseType:
|
|
1554
|
-
success:
|
|
1555
|
-
fail:
|
|
1556
|
-
complete:
|
|
1614
|
+
dataType: that.responseType === "json" ? "json" : normalizeDataType(that.responseType),
|
|
1615
|
+
responseType: normalizeDataType(that.responseType),
|
|
1616
|
+
success: requestSuccess.bind(that),
|
|
1617
|
+
fail: requestFail.bind(that),
|
|
1618
|
+
complete: requestComplete.bind(that),
|
|
1557
1619
|
});
|
|
1558
|
-
|
|
1620
|
+
emitProcessEvent(this, "loadstart");
|
|
1559
1621
|
if (processContentLength) {
|
|
1560
|
-
const hasRequestBody = allowsRequestBody &&
|
|
1622
|
+
const hasRequestBody = allowsRequestBody && (typeof data === "string" ? data.length > 0 : data.byteLength > 0);
|
|
1561
1623
|
if (hasRequestBody) {
|
|
1562
|
-
|
|
1624
|
+
emitProcessEvent(that.upload, "loadstart", 0, contentLength);
|
|
1563
1625
|
}
|
|
1564
1626
|
setTimeout(() => {
|
|
1565
|
-
const _aborted =
|
|
1627
|
+
const _aborted = that[_inAfterOpenBeforeSend] || that.readyState !== XMLHttpRequestP.OPENED;
|
|
1566
1628
|
const _contentLength = _aborted ? 0 : contentLength;
|
|
1567
1629
|
if (_aborted) {
|
|
1568
|
-
|
|
1630
|
+
emitProcessEvent(that.upload, "abort");
|
|
1569
1631
|
}
|
|
1570
1632
|
else {
|
|
1571
1633
|
if (hasRequestBody) {
|
|
1572
|
-
|
|
1634
|
+
emitProcessEvent(that.upload, "load", _contentLength, _contentLength);
|
|
1573
1635
|
}
|
|
1574
1636
|
}
|
|
1575
1637
|
if (_aborted || hasRequestBody) {
|
|
1576
|
-
|
|
1638
|
+
emitProcessEvent(that.upload, "loadend", _contentLength, _contentLength);
|
|
1577
1639
|
}
|
|
1578
1640
|
});
|
|
1579
1641
|
}
|
|
1642
|
+
checkRequestTimeout.call(that);
|
|
1580
1643
|
}
|
|
1581
|
-
|
|
1582
|
-
this
|
|
1583
|
-
this.status = statusCode;
|
|
1584
|
-
this._resHeaders = header;
|
|
1585
|
-
this._resContLen = parseInt(this.target.getResponseHeader("Content-Length") || "0");
|
|
1586
|
-
if (this.readyState === XMLHttpRequestP.OPENED) {
|
|
1587
|
-
this.setReadyStateAndNotify(XMLHttpRequestP.HEADERS_RECEIVED);
|
|
1588
|
-
this.setReadyStateAndNotify(XMLHttpRequestP.LOADING);
|
|
1589
|
-
setTimeout(() => {
|
|
1590
|
-
if (!this._reqCanSend) {
|
|
1591
|
-
let l = this._resContLen;
|
|
1592
|
-
try {
|
|
1593
|
-
this.response = convertBack(this.responseType, data);
|
|
1594
|
-
this.emitProcessEvent("load", l, l);
|
|
1595
|
-
}
|
|
1596
|
-
catch (e) {
|
|
1597
|
-
console.error(e);
|
|
1598
|
-
this.emitProcessEvent("error");
|
|
1599
|
-
}
|
|
1600
|
-
}
|
|
1601
|
-
});
|
|
1602
|
-
}
|
|
1644
|
+
setRequestHeader(name, value) {
|
|
1645
|
+
assignRequestHeader(this[state$4][_requestHeaders], name, value);
|
|
1603
1646
|
}
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1647
|
+
get onreadystatechange() { return this[state$4].onreadystatechange; }
|
|
1648
|
+
set onreadystatechange(value) {
|
|
1649
|
+
this[state$4].onreadystatechange = value;
|
|
1650
|
+
attachFn.call(this, "readystatechange", value, this[state$4][_handlers].onreadystatechange);
|
|
1651
|
+
}
|
|
1652
|
+
toString() { return "[object XMLHttpRequest]"; }
|
|
1653
|
+
get isPolyfill() { return { symbol: polyfill, hierarchy: ["XMLHttpRequest", "XMLHttpRequestEventTarget", "EventTarget"] }; }
|
|
1654
|
+
}
|
|
1655
|
+
XMLHttpRequestP.UNSENT = 0;
|
|
1656
|
+
XMLHttpRequestP.OPENED = 1;
|
|
1657
|
+
XMLHttpRequestP.HEADERS_RECEIVED = 2;
|
|
1658
|
+
XMLHttpRequestP.LOADING = 3;
|
|
1659
|
+
XMLHttpRequestP.DONE = 4;
|
|
1660
|
+
defineStringTag(XMLHttpRequestP, "XMLHttpRequest");
|
|
1661
|
+
const _handlers = Symbol();
|
|
1662
|
+
const _inAfterOpenBeforeSend = Symbol();
|
|
1663
|
+
const _resetPending = Symbol();
|
|
1664
|
+
const _timeoutId = Symbol();
|
|
1665
|
+
const _requestURL = Symbol();
|
|
1666
|
+
const _method = Symbol();
|
|
1667
|
+
const _requestHeaders = Symbol();
|
|
1668
|
+
const _responseHeaders = Symbol();
|
|
1669
|
+
const _responseContentLength = Symbol();
|
|
1670
|
+
const _requestTask = Symbol();
|
|
1671
|
+
class XMLHttpRequestState {
|
|
1672
|
+
constructor(target) {
|
|
1673
|
+
this.readyState = XMLHttpRequestP.UNSENT;
|
|
1674
|
+
this.response = "";
|
|
1675
|
+
this.responseType = "";
|
|
1676
|
+
this.responseURL = "";
|
|
1617
1677
|
this.status = 0;
|
|
1618
|
-
this.statusText = "
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1678
|
+
this.statusText = "";
|
|
1679
|
+
this.timeout = 0;
|
|
1680
|
+
this.withCredentials = false;
|
|
1681
|
+
this[_a$2] = getHandlers.call(this);
|
|
1682
|
+
this.onreadystatechange = null;
|
|
1683
|
+
this[_b$1] = false;
|
|
1684
|
+
this[_c] = false;
|
|
1685
|
+
this[_d] = 0;
|
|
1686
|
+
this[_e] = "";
|
|
1687
|
+
this[_f] = "GET";
|
|
1688
|
+
this[_g] = { Accept: "*/*" };
|
|
1689
|
+
this[_h] = null;
|
|
1690
|
+
this[_j] = 0;
|
|
1691
|
+
this[_k] = null;
|
|
1692
|
+
this.target = target;
|
|
1693
|
+
this.upload = createXMLHttpRequestUploadP();
|
|
1623
1694
|
}
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1695
|
+
}
|
|
1696
|
+
_a$2 = _handlers, _b$1 = _inAfterOpenBeforeSend, _c = _resetPending, _d = _timeoutId, _e = _requestURL, _f = _method, _g = _requestHeaders, _h = _responseHeaders, _j = _responseContentLength, _k = _requestTask;
|
|
1697
|
+
function requestSuccess({ statusCode, header, data }) {
|
|
1698
|
+
this.responseURL = this[_requestURL];
|
|
1699
|
+
this.status = statusCode;
|
|
1700
|
+
this[_responseHeaders] = header;
|
|
1701
|
+
const lengthStr = this.target.getResponseHeader("Content-Length");
|
|
1702
|
+
this[_responseContentLength] = () => { return lengthStr ? parseInt(lengthStr) : 0; };
|
|
1703
|
+
if (this.readyState === XMLHttpRequestP.OPENED) {
|
|
1704
|
+
setReadyStateAndNotify.call(this, XMLHttpRequestP.HEADERS_RECEIVED);
|
|
1705
|
+
setReadyStateAndNotify.call(this, XMLHttpRequestP.LOADING);
|
|
1629
1706
|
setTimeout(() => {
|
|
1630
|
-
if (!this
|
|
1631
|
-
let l = this
|
|
1632
|
-
|
|
1707
|
+
if (!this[_inAfterOpenBeforeSend]) {
|
|
1708
|
+
let l = this[_responseContentLength];
|
|
1709
|
+
try {
|
|
1710
|
+
this.response = convertBack(this.responseType, data);
|
|
1711
|
+
emitProcessEvent(this.target, "load", l, l);
|
|
1712
|
+
}
|
|
1713
|
+
catch (e) {
|
|
1714
|
+
console.error(e);
|
|
1715
|
+
emitProcessEvent(this.target, "error");
|
|
1716
|
+
}
|
|
1633
1717
|
}
|
|
1634
1718
|
});
|
|
1635
1719
|
}
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1720
|
+
}
|
|
1721
|
+
function requestFail(err) {
|
|
1722
|
+
// Alipay Mini Programs
|
|
1723
|
+
// error: 14 --- JSON parse data error
|
|
1724
|
+
// error: 19 --- http status error
|
|
1725
|
+
// At this point, the error data object will contain three pieces of information
|
|
1726
|
+
// returned from the server: status, headers, and data.
|
|
1727
|
+
// In the browser's XMLHttpRequest, these two errors (Error 14 and Error 19)
|
|
1728
|
+
// differ from those in Alipay Mini Programs and should instead return normally.
|
|
1729
|
+
// Therefore, this scenario is also handled here as a successful request response.
|
|
1730
|
+
if ("status" in err) {
|
|
1731
|
+
requestSuccess.call(this, { statusCode: err.status, header: err.headers, data: err.data });
|
|
1732
|
+
return;
|
|
1733
|
+
}
|
|
1734
|
+
this.status = 0;
|
|
1735
|
+
this.statusText = "errMsg" in err ? err.errMsg : "errorMessage" in err ? err.errorMessage : "";
|
|
1736
|
+
if (!this[_inAfterOpenBeforeSend] && this.readyState !== XMLHttpRequestP.UNSENT && this.readyState !== XMLHttpRequestP.DONE) {
|
|
1737
|
+
emitProcessEvent(this.target, "error");
|
|
1738
|
+
resetRequestTimeout.call(this);
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
function requestComplete() {
|
|
1742
|
+
this[_requestTask] = null;
|
|
1743
|
+
if (!this[_inAfterOpenBeforeSend] && (this.readyState === XMLHttpRequestP.OPENED || this.readyState === XMLHttpRequestP.LOADING)) {
|
|
1744
|
+
setReadyStateAndNotify.call(this, XMLHttpRequestP.DONE);
|
|
1745
|
+
}
|
|
1746
|
+
setTimeout(() => {
|
|
1747
|
+
if (!this[_inAfterOpenBeforeSend]) {
|
|
1748
|
+
let l = this[_responseContentLength];
|
|
1749
|
+
emitProcessEvent(this.target, "loadend", l, l);
|
|
1750
|
+
}
|
|
1751
|
+
});
|
|
1752
|
+
}
|
|
1753
|
+
function clearRequest(delay = true) {
|
|
1754
|
+
const timerFn = delay ? setTimeout : (f) => { f(); };
|
|
1755
|
+
this[_resetPending] = true;
|
|
1756
|
+
if (this[_requestTask] && this.readyState !== XMLHttpRequestP.DONE) {
|
|
1757
|
+
if (delay) {
|
|
1758
|
+
setReadyStateAndNotify.call(this, XMLHttpRequestP.DONE);
|
|
1655
1759
|
}
|
|
1656
1760
|
timerFn(() => {
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1761
|
+
const requestTask = this[_requestTask];
|
|
1762
|
+
if (requestTask) {
|
|
1763
|
+
requestTask.abort();
|
|
1764
|
+
}
|
|
1765
|
+
if (delay) {
|
|
1766
|
+
emitProcessEvent(this.target, "abort");
|
|
1767
|
+
}
|
|
1768
|
+
if (delay && !requestTask) {
|
|
1769
|
+
emitProcessEvent(this.target, "loadend");
|
|
1662
1770
|
}
|
|
1663
1771
|
});
|
|
1664
1772
|
}
|
|
1665
|
-
|
|
1666
|
-
if (this
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
this.setReadyStateAndNotify(XMLHttpRequestP.DONE);
|
|
1672
|
-
this.emitProcessEvent("timeout");
|
|
1673
|
-
}
|
|
1674
|
-
}, this.timeout);
|
|
1773
|
+
timerFn(() => {
|
|
1774
|
+
if (this[_resetPending]) {
|
|
1775
|
+
if (delay) {
|
|
1776
|
+
this.readyState = XMLHttpRequestP.UNSENT;
|
|
1777
|
+
}
|
|
1778
|
+
resetXHR.call(this);
|
|
1675
1779
|
}
|
|
1780
|
+
});
|
|
1781
|
+
}
|
|
1782
|
+
function checkRequestTimeout() {
|
|
1783
|
+
if (this.timeout) {
|
|
1784
|
+
this[_timeoutId] = setTimeout(() => {
|
|
1785
|
+
if (!this.status && this.readyState !== XMLHttpRequestP.DONE) {
|
|
1786
|
+
if (this[_requestTask])
|
|
1787
|
+
this[_requestTask].abort();
|
|
1788
|
+
setReadyStateAndNotify.call(this, XMLHttpRequestP.DONE);
|
|
1789
|
+
emitProcessEvent(this.target, "timeout");
|
|
1790
|
+
}
|
|
1791
|
+
}, this.timeout);
|
|
1676
1792
|
}
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
}
|
|
1694
|
-
emitProcessEvent(type, loaded = 0, total = 0, target) {
|
|
1695
|
-
const _target = target ?? this.target;
|
|
1696
|
-
const _event = new ProgressEventP(type, {
|
|
1697
|
-
lengthComputable: total > 0,
|
|
1698
|
-
loaded,
|
|
1699
|
-
total,
|
|
1700
|
-
});
|
|
1701
|
-
_event[state$9].target = _target;
|
|
1702
|
-
_event[state$9].isTrusted = true;
|
|
1703
|
-
_target[state$7].fire(_event);
|
|
1793
|
+
}
|
|
1794
|
+
function resetXHR() {
|
|
1795
|
+
this[_resetPending] = false;
|
|
1796
|
+
resetRequestTimeout.call(this);
|
|
1797
|
+
this.response = "";
|
|
1798
|
+
this.responseURL = "";
|
|
1799
|
+
this.status = 0;
|
|
1800
|
+
this.statusText = "";
|
|
1801
|
+
this[_requestHeaders] = {};
|
|
1802
|
+
this[_responseHeaders] = null;
|
|
1803
|
+
this[_responseContentLength] = 0;
|
|
1804
|
+
}
|
|
1805
|
+
function resetRequestTimeout() {
|
|
1806
|
+
if (this[_timeoutId]) {
|
|
1807
|
+
clearTimeout(this[_timeoutId]);
|
|
1808
|
+
this[_timeoutId] = 0;
|
|
1704
1809
|
}
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
this.target[state$7].fire(evt);
|
|
1713
|
-
}
|
|
1810
|
+
}
|
|
1811
|
+
function setReadyStateAndNotify(value) {
|
|
1812
|
+
const hasChanged = value !== this.readyState;
|
|
1813
|
+
this.readyState = value;
|
|
1814
|
+
if (hasChanged) {
|
|
1815
|
+
const evt = createInnerEvent(this.target, "readystatechange");
|
|
1816
|
+
fire.call(this.target[state$f], evt);
|
|
1714
1817
|
}
|
|
1715
|
-
|
|
1716
|
-
|
|
1818
|
+
}
|
|
1819
|
+
function getHandlers() {
|
|
1820
|
+
return {
|
|
1821
|
+
onreadystatechange: (ev) => { executeFn.call(this.target, this.onreadystatechange, ev); },
|
|
1822
|
+
};
|
|
1717
1823
|
}
|
|
1718
1824
|
// HTTP methods whose capitalization should be normalized
|
|
1719
1825
|
const methods = ["CONNECT", "DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "TRACE"];
|
|
@@ -1721,9 +1827,13 @@ function normalizeMethod(method) {
|
|
|
1721
1827
|
let upcased = method.toUpperCase();
|
|
1722
1828
|
return methods.indexOf(upcased) > -1 ? upcased : method;
|
|
1723
1829
|
}
|
|
1830
|
+
function normalizeDataType(responseType) {
|
|
1831
|
+
return (responseType === "blob" || responseType === "arraybuffer") ? "arraybuffer" : "text";
|
|
1832
|
+
}
|
|
1724
1833
|
function assignRequestHeader(headers, name, value) {
|
|
1834
|
+
const nameKey = name.toLowerCase();
|
|
1725
1835
|
for (const key of Object.keys(headers)) {
|
|
1726
|
-
if (key.toLowerCase() ===
|
|
1836
|
+
if (key.toLowerCase() === nameKey) {
|
|
1727
1837
|
headers[key] = value;
|
|
1728
1838
|
return;
|
|
1729
1839
|
}
|
|
@@ -1760,14 +1870,14 @@ function convert(body, setContentType, setContentLength) {
|
|
|
1760
1870
|
result = body.buffer.slice(body.byteOffset, body.byteOffset + body.byteLength);
|
|
1761
1871
|
}
|
|
1762
1872
|
else if (isPolyfillType("Blob", body)) {
|
|
1763
|
-
result = body[state$
|
|
1873
|
+
result = body[state$c][_u8array].buffer.slice(0);
|
|
1764
1874
|
if (setContentType && body.type) {
|
|
1765
1875
|
setContentType(body.type);
|
|
1766
1876
|
}
|
|
1767
1877
|
}
|
|
1768
1878
|
else if (isPolyfillType("FormData", body)) {
|
|
1769
1879
|
const blob = body[state$9].toBlob();
|
|
1770
|
-
result = blob[state$
|
|
1880
|
+
result = blob[state$c][_u8array].buffer;
|
|
1771
1881
|
if (setContentType) {
|
|
1772
1882
|
setContentType(blob.type);
|
|
1773
1883
|
}
|
|
@@ -1779,7 +1889,12 @@ function convert(body, setContentType, setContentLength) {
|
|
|
1779
1889
|
result = String(body);
|
|
1780
1890
|
}
|
|
1781
1891
|
if (setContentLength) {
|
|
1782
|
-
|
|
1892
|
+
if (typeof result === "string") {
|
|
1893
|
+
setContentLength(() => { return encode(result).byteLength; });
|
|
1894
|
+
}
|
|
1895
|
+
else {
|
|
1896
|
+
setContentLength(result.byteLength);
|
|
1897
|
+
}
|
|
1783
1898
|
}
|
|
1784
1899
|
return result;
|
|
1785
1900
|
}
|
|
@@ -1869,107 +1984,117 @@ function statusTextMap(val) {
|
|
|
1869
1984
|
}
|
|
1870
1985
|
const XMLHttpRequestE = (typeof XMLHttpRequest !== "undefined" && XMLHttpRequest) || XMLHttpRequestP;
|
|
1871
1986
|
|
|
1872
|
-
|
|
1987
|
+
var _a$1, _b;
|
|
1988
|
+
const state$3 = Symbol( /* "BodyState" */);
|
|
1873
1989
|
class BodyP {
|
|
1874
1990
|
constructor() {
|
|
1875
1991
|
if (new.target === BodyP) {
|
|
1876
1992
|
throw new TypeError("Failed to construct 'Body': Illegal constructor");
|
|
1877
1993
|
}
|
|
1878
|
-
this[state] = new BodyState();
|
|
1994
|
+
this[state$3] = new BodyState();
|
|
1879
1995
|
}
|
|
1880
|
-
[state];
|
|
1881
1996
|
get body() {
|
|
1882
|
-
if (!this[state]
|
|
1997
|
+
if (!this[state$3][_body]) {
|
|
1883
1998
|
return null;
|
|
1884
1999
|
}
|
|
1885
2000
|
throw new ReferenceError("ReadableStream is not defined");
|
|
1886
2001
|
}
|
|
1887
|
-
get bodyUsed() { return this[state].bodyUsed; }
|
|
2002
|
+
get bodyUsed() { return this[state$3].bodyUsed; }
|
|
1888
2003
|
;
|
|
1889
2004
|
arrayBuffer() {
|
|
1890
2005
|
const kind = "arrayBuffer";
|
|
1891
|
-
return this[state]
|
|
2006
|
+
return consumed.call(this[state$3], kind) || read.call(this[state$3], kind);
|
|
1892
2007
|
}
|
|
1893
2008
|
blob() {
|
|
1894
2009
|
const kind = "blob";
|
|
1895
|
-
return this[state]
|
|
2010
|
+
return consumed.call(this[state$3], kind) || read.call(this[state$3], kind);
|
|
1896
2011
|
}
|
|
1897
2012
|
bytes() {
|
|
1898
2013
|
const kind = "bytes";
|
|
1899
|
-
return this[state]
|
|
2014
|
+
return consumed.call(this[state$3], kind) || read.call(this[state$3], kind);
|
|
1900
2015
|
}
|
|
1901
2016
|
formData() {
|
|
1902
2017
|
const kind = "formData";
|
|
1903
|
-
return this[state]
|
|
2018
|
+
return consumed.call(this[state$3], kind) || read.call(this[state$3], kind);
|
|
1904
2019
|
}
|
|
1905
2020
|
json() {
|
|
1906
2021
|
const kind = "json";
|
|
1907
|
-
return this[state]
|
|
2022
|
+
return consumed.call(this[state$3], kind) || read.call(this[state$3], kind);
|
|
1908
2023
|
}
|
|
1909
2024
|
text() {
|
|
1910
2025
|
const kind = "text";
|
|
1911
|
-
return this[state]
|
|
2026
|
+
return consumed.call(this[state$3], kind) || read.call(this[state$3], kind);
|
|
1912
2027
|
}
|
|
1913
2028
|
toString() { return "[object Body]"; }
|
|
1914
2029
|
get isPolyfill() { return { symbol: polyfill, hierarchy: ["Body"] }; }
|
|
1915
2030
|
}
|
|
1916
2031
|
defineStringTag(BodyP, "Body");
|
|
2032
|
+
const _name = Symbol();
|
|
2033
|
+
const _body = Symbol();
|
|
1917
2034
|
class BodyState {
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
if (isObjectType("ReadableStream", body)) {
|
|
1923
|
-
throw new ReferenceError("ReadableStream is not defined");
|
|
1924
|
-
}
|
|
1925
|
-
this._body = convert(body, type => {
|
|
1926
|
-
if (headers && !headers.get("Content-Type")) {
|
|
1927
|
-
headers.set("Content-Type", type);
|
|
1928
|
-
}
|
|
1929
|
-
});
|
|
2035
|
+
constructor() {
|
|
2036
|
+
this.bodyUsed = false;
|
|
2037
|
+
this[_a$1] = "Body";
|
|
2038
|
+
this[_b] = "";
|
|
1930
2039
|
}
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
}
|
|
1937
|
-
else if (kind === "blob") {
|
|
1938
|
-
resolve(convertBack("blob", this._body));
|
|
1939
|
-
}
|
|
1940
|
-
else if (kind === "bytes") {
|
|
1941
|
-
let arrayBuffer = convertBack("arraybuffer", this._body);
|
|
1942
|
-
resolve(new Uint8Array(arrayBuffer));
|
|
1943
|
-
}
|
|
1944
|
-
else if (kind === "formData") {
|
|
1945
|
-
let text = convertBack("text", this._body);
|
|
1946
|
-
resolve(createFormData(text));
|
|
1947
|
-
}
|
|
1948
|
-
else if (kind === "json") {
|
|
1949
|
-
resolve(convertBack("json", this._body));
|
|
1950
|
-
}
|
|
1951
|
-
else {
|
|
1952
|
-
resolve(convertBack("text", this._body));
|
|
1953
|
-
}
|
|
1954
|
-
}
|
|
1955
|
-
catch (e) {
|
|
1956
|
-
reject(e);
|
|
1957
|
-
}
|
|
1958
|
-
});
|
|
2040
|
+
}
|
|
2041
|
+
_a$1 = _name, _b = _body;
|
|
2042
|
+
function initFn(body, headers) {
|
|
2043
|
+
if (isObjectType("ReadableStream", body)) {
|
|
2044
|
+
throw new ReferenceError("ReadableStream is not defined");
|
|
1959
2045
|
}
|
|
1960
|
-
|
|
1961
|
-
if (!
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
2046
|
+
this[_body] = convert(body, type => {
|
|
2047
|
+
if (headers && !headers.get("Content-Type")) {
|
|
2048
|
+
headers.set("Content-Type", type);
|
|
2049
|
+
}
|
|
2050
|
+
});
|
|
2051
|
+
}
|
|
2052
|
+
function read(kind) {
|
|
2053
|
+
return new Promise((resolve, reject) => {
|
|
2054
|
+
try {
|
|
2055
|
+
resolve(readSync.call(this, kind));
|
|
2056
|
+
}
|
|
2057
|
+
catch (e) {
|
|
2058
|
+
reject(e);
|
|
1965
2059
|
}
|
|
1966
|
-
|
|
2060
|
+
});
|
|
2061
|
+
}
|
|
2062
|
+
function readSync(kind) {
|
|
2063
|
+
if (kind === "arrayBuffer") {
|
|
2064
|
+
return convertBack("arraybuffer", this[_body]);
|
|
2065
|
+
}
|
|
2066
|
+
else if (kind === "blob") {
|
|
2067
|
+
return convertBack("blob", this[_body]);
|
|
2068
|
+
}
|
|
2069
|
+
else if (kind === "bytes") {
|
|
2070
|
+
let arrayBuffer = convertBack("arraybuffer", this[_body]);
|
|
2071
|
+
return new Uint8Array(arrayBuffer);
|
|
2072
|
+
}
|
|
2073
|
+
else if (kind === "formData") {
|
|
2074
|
+
let text = convertBack("text", this[_body]);
|
|
2075
|
+
return createFormDataFromBody(text);
|
|
2076
|
+
}
|
|
2077
|
+
else if (kind === "json") {
|
|
2078
|
+
return convertBack("json", this[_body]);
|
|
2079
|
+
}
|
|
2080
|
+
else {
|
|
2081
|
+
return convertBack("text", this[_body]);
|
|
1967
2082
|
}
|
|
1968
2083
|
}
|
|
2084
|
+
function consumed(kind) {
|
|
2085
|
+
if (!this[_body])
|
|
2086
|
+
return;
|
|
2087
|
+
if (this.bodyUsed) {
|
|
2088
|
+
return Promise.reject(new TypeError(`TypeError: Failed to execute '${kind}' on '${this[_name]}': body stream already read`));
|
|
2089
|
+
}
|
|
2090
|
+
this.bodyUsed = true;
|
|
2091
|
+
}
|
|
1969
2092
|
|
|
2093
|
+
var _a;
|
|
2094
|
+
const state$2 = Symbol( /* "HeadersState" */);
|
|
1970
2095
|
class HeadersP {
|
|
1971
2096
|
constructor(init) {
|
|
1972
|
-
this[state$
|
|
2097
|
+
this[state$2] = new HeadersState();
|
|
1973
2098
|
if (isObjectType("Headers", init)) {
|
|
1974
2099
|
init.forEach((value, name) => {
|
|
1975
2100
|
this.append(name, value);
|
|
@@ -1987,25 +2112,26 @@ class HeadersP {
|
|
|
1987
2112
|
});
|
|
1988
2113
|
}
|
|
1989
2114
|
else if (init) {
|
|
1990
|
-
|
|
2115
|
+
objectEntries(init).forEach(([name, value]) => {
|
|
1991
2116
|
this.append(name, value);
|
|
1992
2117
|
});
|
|
1993
2118
|
}
|
|
1994
2119
|
}
|
|
1995
|
-
[state$9];
|
|
1996
2120
|
append(name, value) {
|
|
2121
|
+
var _b;
|
|
1997
2122
|
let key = normalizeName(name, "append");
|
|
1998
2123
|
value = normalizeValue(value);
|
|
1999
|
-
let oldValue = this[state$
|
|
2000
|
-
this[state$
|
|
2124
|
+
let oldValue = (_b = this[state$2][_headersMap].get(key)) === null || _b === void 0 ? void 0 : _b[1];
|
|
2125
|
+
this[state$2][_headersMap].set(key, ["" + name, oldValue ? `${oldValue}, ${value}` : value]);
|
|
2001
2126
|
}
|
|
2002
2127
|
delete(name) {
|
|
2003
2128
|
let key = normalizeName(name, "delete");
|
|
2004
|
-
this[state$
|
|
2129
|
+
this[state$2][_headersMap].delete(key);
|
|
2005
2130
|
}
|
|
2006
2131
|
get(name) {
|
|
2132
|
+
var _b, _c;
|
|
2007
2133
|
let key = normalizeName(name, "get");
|
|
2008
|
-
return this[state$
|
|
2134
|
+
return (_c = (_b = this[state$2][_headersMap].get(key)) === null || _b === void 0 ? void 0 : _b[1]) !== null && _c !== void 0 ? _c : null;
|
|
2009
2135
|
}
|
|
2010
2136
|
getSetCookie() {
|
|
2011
2137
|
let value = this.get("Set-Cookie");
|
|
@@ -2013,11 +2139,11 @@ class HeadersP {
|
|
|
2013
2139
|
}
|
|
2014
2140
|
has(name) {
|
|
2015
2141
|
let key = normalizeName(name, "has");
|
|
2016
|
-
return this[state$
|
|
2142
|
+
return this[state$2][_headersMap].has(key);
|
|
2017
2143
|
}
|
|
2018
2144
|
set(name, value) {
|
|
2019
2145
|
let key = normalizeName(name, "set");
|
|
2020
|
-
this[state$
|
|
2146
|
+
this[state$2][_headersMap].set(key, ["" + name, normalizeValue(value)]);
|
|
2021
2147
|
}
|
|
2022
2148
|
forEach(callbackfn, thisArg) {
|
|
2023
2149
|
Array.from(this.entries()).forEach(([name, value]) => {
|
|
@@ -2025,7 +2151,7 @@ class HeadersP {
|
|
|
2025
2151
|
});
|
|
2026
2152
|
}
|
|
2027
2153
|
entries() {
|
|
2028
|
-
return this[state$
|
|
2154
|
+
return this[state$2][_headersMap].values();
|
|
2029
2155
|
}
|
|
2030
2156
|
keys() {
|
|
2031
2157
|
return Array.from(this.entries()).map(pair => pair[0]).values();
|
|
@@ -2040,9 +2166,13 @@ class HeadersP {
|
|
|
2040
2166
|
get isPolyfill() { return { symbol: polyfill, hierarchy: ["Headers"] }; }
|
|
2041
2167
|
}
|
|
2042
2168
|
defineStringTag(HeadersP, "Headers");
|
|
2169
|
+
const _headersMap = Symbol();
|
|
2043
2170
|
class HeadersState {
|
|
2044
|
-
|
|
2171
|
+
constructor() {
|
|
2172
|
+
this[_a] = new Map();
|
|
2173
|
+
}
|
|
2045
2174
|
}
|
|
2175
|
+
_a = _headersMap;
|
|
2046
2176
|
function normalizeName(name, kind = "") {
|
|
2047
2177
|
if (typeof name !== "string") {
|
|
2048
2178
|
name = String(name);
|
|
@@ -2060,142 +2190,186 @@ function normalizeValue(value) {
|
|
|
2060
2190
|
}
|
|
2061
2191
|
return value;
|
|
2062
2192
|
}
|
|
2193
|
+
function parseHeaders(rawHeaders) {
|
|
2194
|
+
let headers = new HeadersP();
|
|
2195
|
+
let preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, " ");
|
|
2196
|
+
preProcessedHeaders
|
|
2197
|
+
.split("\r")
|
|
2198
|
+
.map(function (header) {
|
|
2199
|
+
return header.indexOf("\n") === 0 ? header.substring(1, header.length) : header;
|
|
2200
|
+
})
|
|
2201
|
+
.forEach(function (line) {
|
|
2202
|
+
let parts = line.split(":");
|
|
2203
|
+
let key = parts.shift().trim();
|
|
2204
|
+
if (key) {
|
|
2205
|
+
let value = parts.join(":").trim();
|
|
2206
|
+
try {
|
|
2207
|
+
headers.append(key, value);
|
|
2208
|
+
}
|
|
2209
|
+
catch (error) {
|
|
2210
|
+
console.warn("Response " + error.message);
|
|
2211
|
+
}
|
|
2212
|
+
}
|
|
2213
|
+
});
|
|
2214
|
+
return headers;
|
|
2215
|
+
}
|
|
2063
2216
|
const HeadersE = g["Headers"] || HeadersP;
|
|
2064
2217
|
|
|
2218
|
+
const state$1 = Symbol( /* "RequestState" */);
|
|
2065
2219
|
class RequestP extends BodyP {
|
|
2066
2220
|
constructor(input, init) {
|
|
2067
2221
|
super();
|
|
2068
|
-
this[state$
|
|
2069
|
-
this[state]
|
|
2070
|
-
|
|
2222
|
+
this[state$1] = new RequestState();
|
|
2223
|
+
const that = this[state$1];
|
|
2224
|
+
this[state$3][_name] = "Request";
|
|
2225
|
+
let options = init !== null && init !== void 0 ? init : {};
|
|
2071
2226
|
let body = options.body;
|
|
2072
2227
|
if (isPolyfillType("Request", input)) {
|
|
2073
2228
|
if (input.bodyUsed) {
|
|
2074
2229
|
throw new TypeError("Failed to construct 'Request': Cannot construct a Request with a Request object that has already been used.");
|
|
2075
2230
|
}
|
|
2076
|
-
|
|
2231
|
+
that.credentials = input.credentials;
|
|
2077
2232
|
if (!options.headers) {
|
|
2078
|
-
|
|
2233
|
+
that.headers = new HeadersP(input.headers);
|
|
2079
2234
|
}
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2235
|
+
that.method = input.method;
|
|
2236
|
+
that.mode = input.mode;
|
|
2237
|
+
that.signal = input.signal;
|
|
2238
|
+
that.url = input.url;
|
|
2084
2239
|
let _input = input;
|
|
2085
|
-
if (!body && _input[state]
|
|
2086
|
-
body = _input[state]
|
|
2087
|
-
_input[state].bodyUsed = true;
|
|
2240
|
+
if (!body && _input[state$3][_body] !== null) {
|
|
2241
|
+
body = _input[state$3][_body];
|
|
2242
|
+
_input[state$3].bodyUsed = true;
|
|
2088
2243
|
}
|
|
2089
2244
|
}
|
|
2090
2245
|
else {
|
|
2091
|
-
|
|
2246
|
+
that.url = String(input);
|
|
2092
2247
|
}
|
|
2093
2248
|
if (options.credentials) {
|
|
2094
|
-
|
|
2249
|
+
that.credentials = options.credentials;
|
|
2095
2250
|
}
|
|
2096
2251
|
if (options.headers) {
|
|
2097
|
-
|
|
2252
|
+
that.headers = new HeadersP(options.headers);
|
|
2098
2253
|
}
|
|
2099
2254
|
if (options.method) {
|
|
2100
|
-
|
|
2255
|
+
that.method = normalizeMethod(options.method);
|
|
2101
2256
|
}
|
|
2102
2257
|
if (options.mode) {
|
|
2103
|
-
|
|
2258
|
+
that.mode = options.mode;
|
|
2104
2259
|
}
|
|
2105
2260
|
if (options.signal) {
|
|
2106
|
-
|
|
2261
|
+
that.signal = options.signal;
|
|
2107
2262
|
}
|
|
2108
2263
|
if ((this.method === "GET" || this.method === "HEAD") && body) {
|
|
2109
2264
|
throw new TypeError("Failed to construct 'Request': Request with GET/HEAD method cannot have body.");
|
|
2110
2265
|
}
|
|
2111
|
-
this[state]
|
|
2266
|
+
initFn.call(this[state$3], body, this.headers);
|
|
2112
2267
|
if (this.method === "GET" || this.method === "HEAD") {
|
|
2113
2268
|
if (options.cache === "no-store" || options.cache === "no-cache") {
|
|
2114
2269
|
// Search for a '_' parameter in the query string
|
|
2115
2270
|
let reParamSearch = /([?&])_=[^&]*/;
|
|
2116
2271
|
if (reParamSearch.test(this.url)) {
|
|
2117
2272
|
// If it already exists then set the value with the current time
|
|
2118
|
-
|
|
2273
|
+
that.url = this.url.replace(reParamSearch, "$1_=" + (new Date()).getTime());
|
|
2119
2274
|
}
|
|
2120
2275
|
else {
|
|
2121
2276
|
// Otherwise add a new '_' parameter to the end with the current time
|
|
2122
2277
|
let reQueryString = /\?/;
|
|
2123
|
-
|
|
2278
|
+
that.url += (reQueryString.test(this.url) ? "&" : "?") + "_=" + (new Date()).getTime();
|
|
2124
2279
|
}
|
|
2125
2280
|
}
|
|
2126
2281
|
}
|
|
2127
2282
|
}
|
|
2128
|
-
[state$
|
|
2129
|
-
get
|
|
2130
|
-
get
|
|
2131
|
-
get
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
get
|
|
2139
|
-
get
|
|
2140
|
-
get
|
|
2141
|
-
get
|
|
2283
|
+
get cache() { return this[state$1].cache; }
|
|
2284
|
+
get credentials() { return this[state$1].credentials; }
|
|
2285
|
+
get destination() { return this[state$1].destination; }
|
|
2286
|
+
get headers() {
|
|
2287
|
+
const that = this[state$1];
|
|
2288
|
+
if (!that.headers) {
|
|
2289
|
+
that.headers = new HeadersP();
|
|
2290
|
+
}
|
|
2291
|
+
return that.headers;
|
|
2292
|
+
}
|
|
2293
|
+
get integrity() { return this[state$1].integrity; }
|
|
2294
|
+
get keepalive() { return this[state$1].keepalive; }
|
|
2295
|
+
get method() { return this[state$1].method; }
|
|
2296
|
+
get mode() { return this[state$1].mode; }
|
|
2297
|
+
get redirect() { return this[state$1].redirect; }
|
|
2298
|
+
get referrer() { return this[state$1].referrer; }
|
|
2299
|
+
get referrerPolicy() { return this[state$1].referrerPolicy; }
|
|
2300
|
+
get signal() {
|
|
2301
|
+
const that = this[state$1];
|
|
2302
|
+
if (!that.signal) {
|
|
2303
|
+
that.signal = (new AbortControllerP()).signal;
|
|
2304
|
+
}
|
|
2305
|
+
return that.signal;
|
|
2306
|
+
}
|
|
2307
|
+
get url() { return this[state$1].url; }
|
|
2142
2308
|
clone() {
|
|
2143
|
-
|
|
2309
|
+
var _a;
|
|
2310
|
+
return new RequestP(this, { body: (_a = this[state$3][_body]) !== null && _a !== void 0 ? _a : null });
|
|
2144
2311
|
}
|
|
2145
2312
|
toString() { return "[object Request]"; }
|
|
2146
2313
|
get isPolyfill() { return { symbol: polyfill, hierarchy: ["Request"] }; }
|
|
2147
2314
|
}
|
|
2148
2315
|
defineStringTag(RequestP, "Request");
|
|
2149
2316
|
class RequestState {
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2317
|
+
constructor() {
|
|
2318
|
+
this.cache = "default";
|
|
2319
|
+
this.credentials = "same-origin";
|
|
2320
|
+
this.destination = "";
|
|
2321
|
+
this.integrity = "";
|
|
2322
|
+
this.keepalive = false;
|
|
2323
|
+
this.method = "GET";
|
|
2324
|
+
this.mode = "cors";
|
|
2325
|
+
this.redirect = "follow";
|
|
2326
|
+
this.referrer = "about:client";
|
|
2327
|
+
this.referrerPolicy = "";
|
|
2328
|
+
this.url = "";
|
|
2329
|
+
}
|
|
2163
2330
|
}
|
|
2164
2331
|
const RequestE = g["Request"] || RequestP;
|
|
2165
2332
|
|
|
2333
|
+
const state = Symbol( /* "ResponseState" */);
|
|
2166
2334
|
class ResponseP extends BodyP {
|
|
2167
2335
|
constructor(body, init) {
|
|
2168
2336
|
super();
|
|
2169
|
-
this[state
|
|
2170
|
-
this[state]
|
|
2171
|
-
|
|
2337
|
+
this[state] = new ResponseState();
|
|
2338
|
+
const that = this[state];
|
|
2339
|
+
this[state$3][_name] = "Response";
|
|
2340
|
+
let options = init !== null && init !== void 0 ? init : {};
|
|
2172
2341
|
let status = options.status === undefined ? 200 : options.status;
|
|
2173
2342
|
if (status < 200 || status > 500) {
|
|
2174
2343
|
throw new RangeError(`Failed to construct 'Response': The status provided (${+status}) is outside the range [200, 599].`);
|
|
2175
2344
|
}
|
|
2176
2345
|
if (options.headers) {
|
|
2177
|
-
|
|
2178
|
-
}
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
this[state]
|
|
2183
|
-
}
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
get
|
|
2346
|
+
that.headers = new HeadersP(options.headers);
|
|
2347
|
+
}
|
|
2348
|
+
that.ok = this.status >= 200 && this.status < 300;
|
|
2349
|
+
that.status = status;
|
|
2350
|
+
that.statusText = options.statusText === undefined ? "" : "" + options.statusText;
|
|
2351
|
+
initFn.call(this[state$3], body, this.headers);
|
|
2352
|
+
}
|
|
2353
|
+
get headers() {
|
|
2354
|
+
const that = this[state];
|
|
2355
|
+
if (!that.headers) {
|
|
2356
|
+
that.headers = new HeadersP();
|
|
2357
|
+
}
|
|
2358
|
+
return that.headers;
|
|
2359
|
+
}
|
|
2360
|
+
get ok() { return this[state].ok; }
|
|
2361
|
+
get redirected() { return this[state].redirected; }
|
|
2362
|
+
get status() { return this[state].status; }
|
|
2363
|
+
get statusText() { return this[state].statusText; }
|
|
2364
|
+
get type() { return this[state].type; }
|
|
2365
|
+
get url() { return this[state].url; }
|
|
2192
2366
|
clone() {
|
|
2193
|
-
const response = new ResponseP(this[state]
|
|
2367
|
+
const response = new ResponseP(this[state$3][_body], {
|
|
2194
2368
|
headers: new HeadersP(this.headers),
|
|
2195
2369
|
status: this.status,
|
|
2196
2370
|
statusText: this.statusText,
|
|
2197
2371
|
});
|
|
2198
|
-
response[state
|
|
2372
|
+
response[state].url = this.url;
|
|
2199
2373
|
return response;
|
|
2200
2374
|
}
|
|
2201
2375
|
static json(data, init) {
|
|
@@ -2203,9 +2377,9 @@ class ResponseP extends BodyP {
|
|
|
2203
2377
|
}
|
|
2204
2378
|
static error() {
|
|
2205
2379
|
const response = new ResponseP(null, { status: 200, statusText: "" });
|
|
2206
|
-
response[state
|
|
2207
|
-
response[state
|
|
2208
|
-
response[state
|
|
2380
|
+
response[state].ok = false;
|
|
2381
|
+
response[state].status = 0;
|
|
2382
|
+
response[state].type = "error";
|
|
2209
2383
|
return response;
|
|
2210
2384
|
}
|
|
2211
2385
|
static redirect(url, status = 301) {
|
|
@@ -2219,13 +2393,14 @@ class ResponseP extends BodyP {
|
|
|
2219
2393
|
}
|
|
2220
2394
|
defineStringTag(ResponseP, "Response");
|
|
2221
2395
|
class ResponseState {
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2396
|
+
constructor() {
|
|
2397
|
+
this.ok = true;
|
|
2398
|
+
this.redirected = false;
|
|
2399
|
+
this.status = 200;
|
|
2400
|
+
this.statusText = "";
|
|
2401
|
+
this.type = "default";
|
|
2402
|
+
this.url = "";
|
|
2403
|
+
}
|
|
2229
2404
|
}
|
|
2230
2405
|
const ResponseE = g["Response"] || ResponseP;
|
|
2231
2406
|
|
|
@@ -2241,13 +2416,13 @@ function fetchP(input, init) {
|
|
|
2241
2416
|
let xhr = new XMLHttpRequestE();
|
|
2242
2417
|
xhr.onload = function () {
|
|
2243
2418
|
let options = {
|
|
2244
|
-
headers: xhr instanceof XMLHttpRequestP ? (new HeadersP(xhr[state$
|
|
2419
|
+
headers: xhr instanceof XMLHttpRequestP ? (new HeadersP(xhr[state$4][_responseHeaders] || undefined)) : parseHeaders(xhr.getAllResponseHeaders() || ""),
|
|
2245
2420
|
status: xhr.status,
|
|
2246
2421
|
statusText: xhr.statusText,
|
|
2247
2422
|
};
|
|
2248
2423
|
setTimeout(() => {
|
|
2249
2424
|
const response = new ResponseP(xhr.response, options);
|
|
2250
|
-
response[state
|
|
2425
|
+
response[state].url = xhr.responseURL;
|
|
2251
2426
|
resolve(response);
|
|
2252
2427
|
});
|
|
2253
2428
|
};
|
|
@@ -2276,7 +2451,7 @@ function fetchP(input, init) {
|
|
|
2276
2451
|
if (init && isObjectHeaders(init.headers)) {
|
|
2277
2452
|
let headers = init.headers;
|
|
2278
2453
|
let names = [];
|
|
2279
|
-
|
|
2454
|
+
objectEntries(headers).forEach(([name, value]) => {
|
|
2280
2455
|
names.push(normalizeName(name));
|
|
2281
2456
|
xhr.setRequestHeader(name, normalizeValue(value));
|
|
2282
2457
|
});
|
|
@@ -2301,35 +2476,12 @@ function fetchP(input, init) {
|
|
|
2301
2476
|
}
|
|
2302
2477
|
};
|
|
2303
2478
|
}
|
|
2304
|
-
xhr.send(request[state]
|
|
2479
|
+
xhr.send(request[state$3][_body]);
|
|
2305
2480
|
});
|
|
2306
2481
|
}
|
|
2307
2482
|
function isObjectHeaders(val) {
|
|
2308
2483
|
return typeof val === "object" && !isObjectType("Headers", val);
|
|
2309
2484
|
}
|
|
2310
|
-
function parseHeaders(rawHeaders) {
|
|
2311
|
-
let headers = new HeadersP();
|
|
2312
|
-
let preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, " ");
|
|
2313
|
-
preProcessedHeaders
|
|
2314
|
-
.split("\r")
|
|
2315
|
-
.map(function (header) {
|
|
2316
|
-
return header.indexOf("\n") === 0 ? header.substring(1, header.length) : header;
|
|
2317
|
-
})
|
|
2318
|
-
.forEach(function (line) {
|
|
2319
|
-
let parts = line.split(":");
|
|
2320
|
-
let key = parts.shift().trim();
|
|
2321
|
-
if (key) {
|
|
2322
|
-
let value = parts.join(":").trim();
|
|
2323
|
-
try {
|
|
2324
|
-
headers.append(key, value);
|
|
2325
|
-
}
|
|
2326
|
-
catch (error) {
|
|
2327
|
-
console.warn("Response " + error.message);
|
|
2328
|
-
}
|
|
2329
|
-
}
|
|
2330
|
-
});
|
|
2331
|
-
return headers;
|
|
2332
|
-
}
|
|
2333
2485
|
const fetchE = g["fetch"] || fetchP;
|
|
2334
2486
|
|
|
2335
2487
|
export { AbortControllerE as AbortController, AbortControllerP, AbortSignalE as AbortSignal, AbortSignalP, BlobE as Blob, BlobP, CustomEventE as CustomEvent, CustomEventP, EventE as Event, EventP, EventTargetE as EventTarget, EventTargetP, FileE as File, FileP, FileReaderE as FileReader, FileReaderP, FormDataE as FormData, FormDataP, HeadersE as Headers, HeadersP, ProgressEventE as ProgressEvent, ProgressEventP, RequestE as Request, RequestP, ResponseE as Response, ResponseP, TextDecoderE as TextDecoder, TextDecoderP, TextEncoderE as TextEncoder, TextEncoderP, URLSearchParamsE as URLSearchParams, URLSearchParamsP, XMLHttpRequestE as XMLHttpRequest, XMLHttpRequestP, fetchE as fetch, fetchP };
|