xmlui 0.5.2-beta.2 → 0.5.2-beta.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/dist/{apiInterceptorWorker-CLcJFUAE.mjs → apiInterceptorWorker-0fG_4UGR.mjs} +578 -587
- package/dist/{core-Df4Xz6Zv.mjs → core-BfTKHuQQ.mjs} +13 -17
- package/dist/{index-DnAEgnWl.mjs → index-DA1g4kmb.mjs} +5710 -5816
- package/dist/xmlui-standalone.umd.js +62 -62
- package/dist/xmlui.mjs +1 -1
- package/dist/xmlui.umd.js +63 -63
- package/package.json +2 -2
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
if (!t.has(e))
|
|
5
|
-
throw TypeError("Cannot " + r);
|
|
1
|
+
var Pr = Object.defineProperty;
|
|
2
|
+
var Be = (e) => {
|
|
3
|
+
throw TypeError(e);
|
|
6
4
|
};
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import Ve from "dexie";
|
|
17
|
-
var Fr = /(%?)(%([sdijo]))/g;
|
|
18
|
-
function Br(e, t) {
|
|
5
|
+
var Lr = (e, t, r) => t in e ? Pr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
6
|
+
var $ = (e, t, r) => Lr(e, typeof t != "symbol" ? t + "" : t, r), ve = (e, t, r) => t.has(e) || Be("Cannot " + r);
|
|
7
|
+
var Q = (e, t, r) => (ve(e, t, "read from private field"), r ? r.call(e) : t.get(e)), Ee = (e, t, r) => t.has(e) ? Be("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), Ve = (e, t, r, s) => (ve(e, t, "write to private field"), s ? s.call(e, r) : t.set(e, r), r), ie = (e, t, r) => (ve(e, t, "access private method"), r);
|
|
8
|
+
import { isArray as It, isObject as Nt, mapValues as Sr } from "lodash-es";
|
|
9
|
+
import { delay as Dr, HttpResponse as K, http as Cr } from "msw";
|
|
10
|
+
import { r as qr, d as Mr, m as $r, a as Ur, g as jr, o as we, T as Fr } from "./index-DA1g4kmb.mjs";
|
|
11
|
+
import We from "dexie";
|
|
12
|
+
var Br = /(%?)(%([sdijo]))/g;
|
|
13
|
+
function Vr(e, t) {
|
|
19
14
|
switch (t) {
|
|
20
15
|
case "s":
|
|
21
16
|
return e;
|
|
@@ -36,30 +31,30 @@ function Y(e, ...t) {
|
|
|
36
31
|
if (t.length === 0)
|
|
37
32
|
return e;
|
|
38
33
|
let r = 0, s = e.replace(
|
|
39
|
-
|
|
34
|
+
Br,
|
|
40
35
|
(n, i, a, l) => {
|
|
41
|
-
const o = t[r], c =
|
|
36
|
+
const o = t[r], c = Vr(o, l);
|
|
42
37
|
return i ? n : (r++, c);
|
|
43
38
|
}
|
|
44
39
|
);
|
|
45
40
|
return r < t.length && (s += ` ${t.slice(r).join(" ")}`), s = s.replace(/%{2,2}/g, "%"), s;
|
|
46
41
|
}
|
|
47
|
-
var
|
|
48
|
-
function
|
|
42
|
+
var Wr = 2;
|
|
43
|
+
function Gr(e) {
|
|
49
44
|
if (!e.stack)
|
|
50
45
|
return;
|
|
51
46
|
const t = e.stack.split(`
|
|
52
47
|
`);
|
|
53
|
-
t.splice(1,
|
|
48
|
+
t.splice(1, Wr), e.stack = t.join(`
|
|
54
49
|
`);
|
|
55
50
|
}
|
|
56
|
-
var
|
|
51
|
+
var Hr = class extends Error {
|
|
57
52
|
constructor(e, ...t) {
|
|
58
|
-
super(e), this.message = e, this.name = "Invariant Violation", this.message = Y(e, ...t),
|
|
53
|
+
super(e), this.message = e, this.name = "Invariant Violation", this.message = Y(e, ...t), Gr(this);
|
|
59
54
|
}
|
|
60
55
|
}, D = (e, t, ...r) => {
|
|
61
56
|
if (!e)
|
|
62
|
-
throw new
|
|
57
|
+
throw new Hr(t, ...r);
|
|
63
58
|
};
|
|
64
59
|
D.as = (e, t, r, ...s) => {
|
|
65
60
|
if (!t) {
|
|
@@ -93,23 +88,23 @@ var U = async (e) => {
|
|
|
93
88
|
return { error: t, data: null };
|
|
94
89
|
}
|
|
95
90
|
};
|
|
96
|
-
const
|
|
91
|
+
const Xr = "[MSW]";
|
|
97
92
|
function qe(e, ...t) {
|
|
98
93
|
const r = Y(e, ...t);
|
|
99
|
-
return `${
|
|
94
|
+
return `${Xr} ${r}`;
|
|
100
95
|
}
|
|
101
|
-
function
|
|
96
|
+
function zr(e, ...t) {
|
|
102
97
|
console.warn(qe(e, ...t));
|
|
103
98
|
}
|
|
104
|
-
function
|
|
99
|
+
function Yr(e, ...t) {
|
|
105
100
|
console.error(qe(e, ...t));
|
|
106
101
|
}
|
|
107
102
|
const T = {
|
|
108
103
|
formatMessage: qe,
|
|
109
|
-
warn:
|
|
110
|
-
error:
|
|
104
|
+
warn: zr,
|
|
105
|
+
error: Yr
|
|
111
106
|
};
|
|
112
|
-
var
|
|
107
|
+
var Jr = (e, t, r) => new Promise((s, n) => {
|
|
113
108
|
var i = (o) => {
|
|
114
109
|
try {
|
|
115
110
|
l(r.next(o));
|
|
@@ -125,7 +120,7 @@ var Yr = (e, t, r) => new Promise((s, n) => {
|
|
|
125
120
|
}, l = (o) => o.done ? s(o.value) : Promise.resolve(o.value).then(i, a);
|
|
126
121
|
l((r = r.apply(e, t)).next());
|
|
127
122
|
});
|
|
128
|
-
const
|
|
123
|
+
const Qr = (e, t, r) => Jr(void 0, null, function* () {
|
|
129
124
|
let s = null, n = null;
|
|
130
125
|
for (const i of t)
|
|
131
126
|
if (n = yield i.run({ request: e, resolutionContext: r }), n !== null && (s = i), n != null && n.response)
|
|
@@ -136,21 +131,21 @@ const Jr = (e, t, r) => Yr(void 0, null, function* () {
|
|
|
136
131
|
response: n == null ? void 0 : n.response
|
|
137
132
|
} : null;
|
|
138
133
|
});
|
|
139
|
-
var
|
|
140
|
-
return t || (0, e[
|
|
141
|
-
},
|
|
134
|
+
var Kr = Object.create, kt = Object.defineProperty, Zr = Object.getOwnPropertyDescriptor, Pt = Object.getOwnPropertyNames, en = Object.getPrototypeOf, tn = Object.prototype.hasOwnProperty, rn = (e, t) => function() {
|
|
135
|
+
return t || (0, e[Pt(e)[0]])((t = { exports: {} }).exports, t), t.exports;
|
|
136
|
+
}, nn = (e, t, r, s) => {
|
|
142
137
|
if (t && typeof t == "object" || typeof t == "function")
|
|
143
|
-
for (let n of
|
|
144
|
-
!
|
|
138
|
+
for (let n of Pt(t))
|
|
139
|
+
!tn.call(e, n) && n !== r && kt(e, n, { get: () => t[n], enumerable: !(s = Zr(t, n)) || s.enumerable });
|
|
145
140
|
return e;
|
|
146
|
-
},
|
|
141
|
+
}, sn = (e, t, r) => (r = e != null ? Kr(en(e)) : {}, nn(
|
|
147
142
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
148
143
|
// file that has been converted to a CommonJS file using a Babel-
|
|
149
144
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
150
145
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
151
|
-
|
|
146
|
+
kt(r, "default", { value: e, enumerable: !0 }),
|
|
152
147
|
e
|
|
153
|
-
)),
|
|
148
|
+
)), on = rn({
|
|
154
149
|
"node_modules/js-levenshtein/index.js"(e, t) {
|
|
155
150
|
t.exports = /* @__PURE__ */ function() {
|
|
156
151
|
function r(s, n, i, a, l) {
|
|
@@ -182,8 +177,8 @@ var Qr = Object.create, Nt = Object.defineProperty, Kr = Object.getOwnPropertyDe
|
|
|
182
177
|
};
|
|
183
178
|
}();
|
|
184
179
|
}
|
|
185
|
-
}),
|
|
186
|
-
function
|
|
180
|
+
}), an = sn(on()), cn = an.default;
|
|
181
|
+
function ln() {
|
|
187
182
|
D(
|
|
188
183
|
typeof URL < "u",
|
|
189
184
|
T.formatMessage(
|
|
@@ -191,18 +186,18 @@ function cn() {
|
|
|
191
186
|
)
|
|
192
187
|
);
|
|
193
188
|
}
|
|
194
|
-
var
|
|
189
|
+
var un = class extends Error {
|
|
195
190
|
constructor(e, t, r) {
|
|
196
191
|
super(
|
|
197
192
|
`Possible EventEmitter memory leak detected. ${r} ${t.toString()} listeners added. Use emitter.setMaxListeners() to increase limit`
|
|
198
193
|
), this.emitter = e, this.type = t, this.count = r, this.name = "MaxListenersExceededWarning";
|
|
199
194
|
}
|
|
200
|
-
},
|
|
195
|
+
}, Lt = class {
|
|
201
196
|
static listenerCount(e, t) {
|
|
202
197
|
return e.listenerCount(t);
|
|
203
198
|
}
|
|
204
199
|
constructor() {
|
|
205
|
-
this.events = /* @__PURE__ */ new Map(), this.maxListeners =
|
|
200
|
+
this.events = /* @__PURE__ */ new Map(), this.maxListeners = Lt.defaultMaxListeners, this.hasWarnedAboutPotentialMemoryLeak = !1;
|
|
206
201
|
}
|
|
207
202
|
_emitInternalEvent(e, t, r) {
|
|
208
203
|
this.emit(
|
|
@@ -260,7 +255,7 @@ var ln = class extends Error {
|
|
|
260
255
|
const r = this._getListeners(e).concat(t);
|
|
261
256
|
if (this.events.set(e, r), this.maxListeners > 0 && this.listenerCount(e) > this.maxListeners && !this.hasWarnedAboutPotentialMemoryLeak) {
|
|
262
257
|
this.hasWarnedAboutPotentialMemoryLeak = !0;
|
|
263
|
-
const s = new
|
|
258
|
+
const s = new un(
|
|
264
259
|
this,
|
|
265
260
|
e,
|
|
266
261
|
this.listenerCount(e)
|
|
@@ -324,19 +319,19 @@ var ln = class extends Error {
|
|
|
324
319
|
rawListeners(e) {
|
|
325
320
|
return this.listeners(e);
|
|
326
321
|
}
|
|
327
|
-
}, de =
|
|
322
|
+
}, de = Lt;
|
|
328
323
|
de.defaultMaxListeners = 10;
|
|
329
|
-
function
|
|
324
|
+
function hn(e, t) {
|
|
330
325
|
const r = e.emit;
|
|
331
326
|
r._isPiped || (e.emit = function(s, ...n) {
|
|
332
327
|
return t.emit(s, ...n), r.call(this, s, ...n);
|
|
333
328
|
}, e.emit._isPiped = !0);
|
|
334
329
|
}
|
|
335
|
-
function
|
|
330
|
+
function Ge(e) {
|
|
336
331
|
const t = [...e];
|
|
337
332
|
return Object.freeze(t), t;
|
|
338
333
|
}
|
|
339
|
-
var
|
|
334
|
+
var dn = (e, t, r) => new Promise((s, n) => {
|
|
340
335
|
var i = (o) => {
|
|
341
336
|
try {
|
|
342
337
|
l(r.next(o));
|
|
@@ -352,19 +347,19 @@ var hn = (e, t, r) => new Promise((s, n) => {
|
|
|
352
347
|
}, l = (o) => o.done ? s(o.value) : Promise.resolve(o.value).then(i, a);
|
|
353
348
|
l((r = r.apply(e, t)).next());
|
|
354
349
|
});
|
|
355
|
-
class
|
|
350
|
+
class pn {
|
|
356
351
|
constructor() {
|
|
357
352
|
this.subscriptions = [];
|
|
358
353
|
}
|
|
359
354
|
dispose() {
|
|
360
|
-
return
|
|
355
|
+
return dn(this, null, function* () {
|
|
361
356
|
yield Promise.all(this.subscriptions.map((t) => t()));
|
|
362
357
|
});
|
|
363
358
|
}
|
|
364
359
|
}
|
|
365
|
-
class
|
|
360
|
+
class fn extends pn {
|
|
366
361
|
constructor(...t) {
|
|
367
|
-
super(), this.validateHandlers(...t), this.initialHandlers =
|
|
362
|
+
super(), this.validateHandlers(...t), this.initialHandlers = Ge(t), this.currentHandlers = [...t], this.emitter = new de(), this.publicEmitter = new de(), hn(this.emitter, this.publicEmitter), this.events = this.createLifeCycleEvents(), this.subscriptions.push(() => {
|
|
368
363
|
this.emitter.removeAllListeners(), this.publicEmitter.removeAllListeners();
|
|
369
364
|
});
|
|
370
365
|
}
|
|
@@ -390,7 +385,7 @@ class pn extends dn {
|
|
|
390
385
|
this.currentHandlers = t.length > 0 ? [...t] : [...this.initialHandlers];
|
|
391
386
|
}
|
|
392
387
|
listHandlers() {
|
|
393
|
-
return
|
|
388
|
+
return Ge(this.currentHandlers);
|
|
394
389
|
}
|
|
395
390
|
createLifeCycleEvents() {
|
|
396
391
|
return {
|
|
@@ -400,26 +395,26 @@ class pn extends dn {
|
|
|
400
395
|
};
|
|
401
396
|
}
|
|
402
397
|
}
|
|
403
|
-
const
|
|
404
|
-
function
|
|
398
|
+
const mn = /[\/\\]msw[\/\\]src[\/\\](.+)/, yn = /(node_modules)?[\/\\]lib[\/\\](core|browser|node|native|iife)[\/\\]|^[^\/\\]*$/;
|
|
399
|
+
function gn(e) {
|
|
405
400
|
const t = e.stack;
|
|
406
401
|
if (!t)
|
|
407
402
|
return;
|
|
408
403
|
const s = t.split(`
|
|
409
|
-
`).slice(1).find((i) => !(
|
|
404
|
+
`).slice(1).find((i) => !(mn.test(i) || yn.test(i)));
|
|
410
405
|
return s ? s.replace(/\s*at [^()]*\(([^)]+)\)/, "$1").replace(/^@/, "") : void 0;
|
|
411
406
|
}
|
|
412
|
-
function
|
|
407
|
+
function vn(e) {
|
|
413
408
|
return e ? typeof e[Symbol.iterator] == "function" : !1;
|
|
414
409
|
}
|
|
415
|
-
var
|
|
410
|
+
var En = Object.defineProperty, wn = Object.defineProperties, bn = Object.getOwnPropertyDescriptors, He = Object.getOwnPropertySymbols, _n = Object.prototype.hasOwnProperty, xn = Object.prototype.propertyIsEnumerable, Xe = (e, t, r) => t in e ? En(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, ze = (e, t) => {
|
|
416
411
|
for (var r in t || (t = {}))
|
|
417
|
-
|
|
418
|
-
if (
|
|
419
|
-
for (var r of
|
|
420
|
-
|
|
412
|
+
_n.call(t, r) && Xe(e, r, t[r]);
|
|
413
|
+
if (He)
|
|
414
|
+
for (var r of He(t))
|
|
415
|
+
xn.call(t, r) && Xe(e, r, t[r]);
|
|
421
416
|
return e;
|
|
422
|
-
},
|
|
417
|
+
}, Ye = (e, t) => wn(e, bn(t)), oe = (e, t, r) => new Promise((s, n) => {
|
|
423
418
|
var i = (o) => {
|
|
424
419
|
try {
|
|
425
420
|
l(r.next(o));
|
|
@@ -435,11 +430,11 @@ var vn = Object.defineProperty, En = Object.defineProperties, wn = Object.getOwn
|
|
|
435
430
|
}, l = (o) => o.done ? s(o.value) : Promise.resolve(o.value).then(i, a);
|
|
436
431
|
l((r = r.apply(e, t)).next());
|
|
437
432
|
});
|
|
438
|
-
class
|
|
433
|
+
class St {
|
|
439
434
|
constructor(t) {
|
|
440
435
|
this.resolver = t.resolver, this.options = t.options;
|
|
441
|
-
const r =
|
|
442
|
-
this.info = ze(
|
|
436
|
+
const r = gn(new Error());
|
|
437
|
+
this.info = Ye(ze({}, t.info), {
|
|
443
438
|
callFrame: r
|
|
444
439
|
}), this.isUsed = !1;
|
|
445
440
|
}
|
|
@@ -495,7 +490,7 @@ class Lt {
|
|
|
495
490
|
const a = this.wrapResolver(this.resolver), l = this.extendResolverArgs({
|
|
496
491
|
request: t.request,
|
|
497
492
|
parsedResult: n
|
|
498
|
-
}), o = yield a(ze(
|
|
493
|
+
}), o = yield a(Ye(ze({}, l), {
|
|
499
494
|
request: t.request
|
|
500
495
|
}));
|
|
501
496
|
return this.createExecutionResult({
|
|
@@ -510,7 +505,7 @@ class Lt {
|
|
|
510
505
|
wrapResolver(t) {
|
|
511
506
|
return (r) => oe(this, null, function* () {
|
|
512
507
|
const s = this.resolverGenerator || (yield t(r));
|
|
513
|
-
if (
|
|
508
|
+
if (vn(s)) {
|
|
514
509
|
this.isUsed = !1;
|
|
515
510
|
const { value: n, done: i } = s[Symbol.iterator]().next(), a = yield n;
|
|
516
511
|
return i && (this.isUsed = !0), !a && i ? (D(
|
|
@@ -530,17 +525,17 @@ class Lt {
|
|
|
530
525
|
};
|
|
531
526
|
}
|
|
532
527
|
}
|
|
533
|
-
function
|
|
528
|
+
function Dt(e, t) {
|
|
534
529
|
return e.toLowerCase() === t.toLowerCase();
|
|
535
530
|
}
|
|
536
|
-
function
|
|
531
|
+
function Ct(e) {
|
|
537
532
|
return e < 300 ? "#69AB32" : e < 400 ? "#F0BB4B" : "#E95F5D";
|
|
538
533
|
}
|
|
539
|
-
function
|
|
534
|
+
function qt() {
|
|
540
535
|
const e = /* @__PURE__ */ new Date();
|
|
541
536
|
return [e.getHours(), e.getMinutes(), e.getSeconds()].map(String).map((t) => t.slice(0, 2)).map((t) => t.padStart(2, "0")).join(":");
|
|
542
537
|
}
|
|
543
|
-
var
|
|
538
|
+
var Tn = (e, t, r) => new Promise((s, n) => {
|
|
544
539
|
var i = (o) => {
|
|
545
540
|
try {
|
|
546
541
|
l(r.next(o));
|
|
@@ -556,8 +551,8 @@ var xn = (e, t, r) => new Promise((s, n) => {
|
|
|
556
551
|
}, l = (o) => o.done ? s(o.value) : Promise.resolve(o.value).then(i, a);
|
|
557
552
|
l((r = r.apply(e, t)).next());
|
|
558
553
|
});
|
|
559
|
-
function
|
|
560
|
-
return
|
|
554
|
+
function Mt(e) {
|
|
555
|
+
return Tn(this, null, function* () {
|
|
561
556
|
const r = yield e.clone().text();
|
|
562
557
|
return {
|
|
563
558
|
url: new URL(e.url),
|
|
@@ -567,21 +562,21 @@ function qt(e) {
|
|
|
567
562
|
};
|
|
568
563
|
});
|
|
569
564
|
}
|
|
570
|
-
var
|
|
571
|
-
return t || (0, e[
|
|
572
|
-
},
|
|
565
|
+
var On = Object.create, $t = Object.defineProperty, An = Object.getOwnPropertyDescriptor, Ut = Object.getOwnPropertyNames, Rn = Object.getPrototypeOf, In = Object.prototype.hasOwnProperty, jt = (e, t) => function() {
|
|
566
|
+
return t || (0, e[Ut(e)[0]])((t = { exports: {} }).exports, t), t.exports;
|
|
567
|
+
}, Nn = (e, t, r, s) => {
|
|
573
568
|
if (t && typeof t == "object" || typeof t == "function")
|
|
574
|
-
for (let n of
|
|
575
|
-
!
|
|
569
|
+
for (let n of Ut(t))
|
|
570
|
+
!In.call(e, n) && n !== r && $t(e, n, { get: () => t[n], enumerable: !(s = An(t, n)) || s.enumerable });
|
|
576
571
|
return e;
|
|
577
|
-
},
|
|
572
|
+
}, kn = (e, t, r) => (r = e != null ? On(Rn(e)) : {}, Nn(
|
|
578
573
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
579
574
|
// file that has been converted to a CommonJS file using a Babel-
|
|
580
575
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
581
576
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
582
|
-
|
|
577
|
+
$t(r, "default", { value: e, enumerable: !0 }),
|
|
583
578
|
e
|
|
584
|
-
)),
|
|
579
|
+
)), Pn = jt({
|
|
585
580
|
"node_modules/statuses/codes.json"(e, t) {
|
|
586
581
|
t.exports = {
|
|
587
582
|
100: "Continue",
|
|
@@ -649,9 +644,9 @@ var Tn = Object.create, Mt = Object.defineProperty, On = Object.getOwnPropertyDe
|
|
|
649
644
|
511: "Network Authentication Required"
|
|
650
645
|
};
|
|
651
646
|
}
|
|
652
|
-
}),
|
|
647
|
+
}), Ln = jt({
|
|
653
648
|
"node_modules/statuses/index.js"(e, t) {
|
|
654
|
-
var r =
|
|
649
|
+
var r = Pn();
|
|
655
650
|
t.exports = l, l.message = r, l.code = s(r), l.codes = n(r), l.redirect = {
|
|
656
651
|
300: !0,
|
|
657
652
|
301: !0,
|
|
@@ -701,7 +696,7 @@ var Tn = Object.create, Mt = Object.defineProperty, On = Object.getOwnPropertyDe
|
|
|
701
696
|
return isNaN(c) ? i(o) : a(c);
|
|
702
697
|
}
|
|
703
698
|
}
|
|
704
|
-
}),
|
|
699
|
+
}), Sn = kn(Ln()), Dn = Sn.default;
|
|
705
700
|
/*! Bundled license information:
|
|
706
701
|
|
|
707
702
|
statuses/index.js:
|
|
@@ -712,7 +707,7 @@ statuses/index.js:
|
|
|
712
707
|
* MIT Licensed
|
|
713
708
|
*)
|
|
714
709
|
*/
|
|
715
|
-
var
|
|
710
|
+
var Cn = (e, t, r) => new Promise((s, n) => {
|
|
716
711
|
var i = (o) => {
|
|
717
712
|
try {
|
|
718
713
|
l(r.next(o));
|
|
@@ -728,10 +723,10 @@ var Dn = (e, t, r) => new Promise((s, n) => {
|
|
|
728
723
|
}, l = (o) => o.done ? s(o.value) : Promise.resolve(o.value).then(i, a);
|
|
729
724
|
l((r = r.apply(e, t)).next());
|
|
730
725
|
});
|
|
731
|
-
const { message:
|
|
732
|
-
function
|
|
733
|
-
return
|
|
734
|
-
const t = e.clone(), r = yield t.text(), s = t.status || 200, n = t.statusText ||
|
|
726
|
+
const { message: qn } = Dn;
|
|
727
|
+
function Ft(e) {
|
|
728
|
+
return Cn(this, null, function* () {
|
|
729
|
+
const t = e.clone(), r = yield t.text(), s = t.status || 200, n = t.statusText || qn[s] || "OK";
|
|
735
730
|
return {
|
|
736
731
|
status: s,
|
|
737
732
|
statusText: n,
|
|
@@ -740,7 +735,7 @@ function jt(e) {
|
|
|
740
735
|
};
|
|
741
736
|
});
|
|
742
737
|
}
|
|
743
|
-
function
|
|
738
|
+
function Mn(e) {
|
|
744
739
|
for (var t = [], r = 0; r < e.length; ) {
|
|
745
740
|
var s = e[r];
|
|
746
741
|
if (s === "*" || s === "+" || s === "?") {
|
|
@@ -808,17 +803,17 @@ function qn(e) {
|
|
|
808
803
|
}
|
|
809
804
|
return t.push({ type: "END", index: r, value: "" }), t;
|
|
810
805
|
}
|
|
811
|
-
function
|
|
806
|
+
function $n(e, t) {
|
|
812
807
|
t === void 0 && (t = {});
|
|
813
|
-
for (var r =
|
|
808
|
+
for (var r = Mn(e), s = t.prefixes, n = s === void 0 ? "./" : s, i = t.delimiter, a = i === void 0 ? "/#?" : i, l = [], o = 0, c = 0, u = "", h = function(N) {
|
|
814
809
|
if (c < r.length && r[c].type === N)
|
|
815
810
|
return r[c++].value;
|
|
816
811
|
}, d = function(N) {
|
|
817
812
|
var I = h(N);
|
|
818
813
|
if (I !== void 0)
|
|
819
814
|
return I;
|
|
820
|
-
var L = r[c], ge = L.type,
|
|
821
|
-
throw new TypeError("Unexpected ".concat(ge, " at ").concat(
|
|
815
|
+
var L = r[c], ge = L.type, kr = L.index;
|
|
816
|
+
throw new TypeError("Unexpected ".concat(ge, " at ").concat(kr, ", expected ").concat(N));
|
|
822
817
|
}, m = function() {
|
|
823
818
|
for (var N = "", I; I = h("CHAR") || h("ESCAPED_CHAR"); )
|
|
824
819
|
N += I;
|
|
@@ -870,11 +865,11 @@ function Mn(e, t) {
|
|
|
870
865
|
}
|
|
871
866
|
return l;
|
|
872
867
|
}
|
|
873
|
-
function
|
|
874
|
-
var r = [], s =
|
|
875
|
-
return
|
|
868
|
+
function Un(e, t) {
|
|
869
|
+
var r = [], s = Vt(e, r, t);
|
|
870
|
+
return jn(s, r, t);
|
|
876
871
|
}
|
|
877
|
-
function
|
|
872
|
+
function jn(e, t, r) {
|
|
878
873
|
r === void 0 && (r = {});
|
|
879
874
|
var s = r.decode, n = s === void 0 ? function(i) {
|
|
880
875
|
return i;
|
|
@@ -898,10 +893,10 @@ function Un(e, t, r) {
|
|
|
898
893
|
function q(e) {
|
|
899
894
|
return e.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1");
|
|
900
895
|
}
|
|
901
|
-
function
|
|
896
|
+
function Bt(e) {
|
|
902
897
|
return e && e.sensitive ? "" : "i";
|
|
903
898
|
}
|
|
904
|
-
function
|
|
899
|
+
function Fn(e, t) {
|
|
905
900
|
if (!t)
|
|
906
901
|
return e;
|
|
907
902
|
for (var r = /\((?:\?<(.*?)>)?(?!\?)/g, s = 0, n = r.exec(e.source); n; )
|
|
@@ -915,16 +910,16 @@ function jn(e, t) {
|
|
|
915
910
|
}), n = r.exec(e.source);
|
|
916
911
|
return e;
|
|
917
912
|
}
|
|
918
|
-
function
|
|
913
|
+
function Bn(e, t, r) {
|
|
919
914
|
var s = e.map(function(n) {
|
|
920
|
-
return
|
|
915
|
+
return Vt(n, t, r).source;
|
|
921
916
|
});
|
|
922
|
-
return new RegExp("(?:".concat(s.join("|"), ")"),
|
|
923
|
-
}
|
|
924
|
-
function Bn(e, t, r) {
|
|
925
|
-
return Vn(Mn(e, r), t, r);
|
|
917
|
+
return new RegExp("(?:".concat(s.join("|"), ")"), Bt(r));
|
|
926
918
|
}
|
|
927
919
|
function Vn(e, t, r) {
|
|
920
|
+
return Wn($n(e, r), t, r);
|
|
921
|
+
}
|
|
922
|
+
function Wn(e, t, r) {
|
|
928
923
|
r === void 0 && (r = {});
|
|
929
924
|
for (var s = r.strict, n = s === void 0 ? !1 : s, i = r.start, a = i === void 0 ? !0 : i, l = r.end, o = l === void 0 ? !0 : l, c = r.encode, u = c === void 0 ? function(I) {
|
|
930
925
|
return I;
|
|
@@ -956,69 +951,69 @@ function Vn(e, t, r) {
|
|
|
956
951
|
var B = e[e.length - 1], N = typeof B == "string" ? v.indexOf(B[B.length - 1]) > -1 : B === void 0;
|
|
957
952
|
n || (E += "(?:".concat(v, "(?=").concat(y, "))?")), N || (E += "(?=".concat(v, "|").concat(y, ")"));
|
|
958
953
|
}
|
|
959
|
-
return new RegExp(E,
|
|
954
|
+
return new RegExp(E, Bt(r));
|
|
960
955
|
}
|
|
961
|
-
function
|
|
962
|
-
return e instanceof RegExp ?
|
|
956
|
+
function Vt(e, t, r) {
|
|
957
|
+
return e instanceof RegExp ? Fn(e, t) : Array.isArray(e) ? Bn(e, t, r) : Vn(e, t, r);
|
|
963
958
|
}
|
|
964
|
-
var
|
|
965
|
-
function
|
|
966
|
-
return
|
|
959
|
+
var Gn = new TextEncoder();
|
|
960
|
+
function Hn(e) {
|
|
961
|
+
return Gn.encode(e);
|
|
967
962
|
}
|
|
968
|
-
function
|
|
963
|
+
function Xn(e, t) {
|
|
969
964
|
return new TextDecoder(t).decode(e);
|
|
970
965
|
}
|
|
971
|
-
function
|
|
966
|
+
function zn(e) {
|
|
972
967
|
return e.buffer.slice(
|
|
973
968
|
e.byteOffset,
|
|
974
969
|
e.byteOffset + e.byteLength
|
|
975
970
|
);
|
|
976
971
|
}
|
|
977
|
-
var
|
|
972
|
+
var Yn = /* @__PURE__ */ new Set([
|
|
978
973
|
101,
|
|
979
974
|
103,
|
|
980
975
|
204,
|
|
981
976
|
205,
|
|
982
977
|
304
|
|
983
978
|
]);
|
|
984
|
-
function
|
|
985
|
-
return
|
|
979
|
+
function Jn(e) {
|
|
980
|
+
return Yn.has(e);
|
|
986
981
|
}
|
|
987
|
-
var
|
|
982
|
+
var Qn = Object.defineProperty, Kn = (e, t) => {
|
|
988
983
|
for (var r in t)
|
|
989
|
-
|
|
984
|
+
Qn(e, r, { get: t[r], enumerable: !0 });
|
|
990
985
|
}, Re = {};
|
|
991
|
-
|
|
992
|
-
blue: () =>
|
|
986
|
+
Kn(Re, {
|
|
987
|
+
blue: () => es,
|
|
993
988
|
gray: () => Ie,
|
|
994
|
-
green: () =>
|
|
995
|
-
red: () =>
|
|
996
|
-
yellow: () =>
|
|
989
|
+
green: () => rs,
|
|
990
|
+
red: () => ts,
|
|
991
|
+
yellow: () => Zn
|
|
997
992
|
});
|
|
998
|
-
function
|
|
993
|
+
function Zn(e) {
|
|
999
994
|
return `\x1B[33m${e}\x1B[0m`;
|
|
1000
995
|
}
|
|
1001
|
-
function
|
|
996
|
+
function es(e) {
|
|
1002
997
|
return `\x1B[34m${e}\x1B[0m`;
|
|
1003
998
|
}
|
|
1004
999
|
function Ie(e) {
|
|
1005
1000
|
return `\x1B[90m${e}\x1B[0m`;
|
|
1006
1001
|
}
|
|
1007
|
-
function
|
|
1002
|
+
function ts(e) {
|
|
1008
1003
|
return `\x1B[31m${e}\x1B[0m`;
|
|
1009
1004
|
}
|
|
1010
|
-
function
|
|
1005
|
+
function rs(e) {
|
|
1011
1006
|
return `\x1B[32m${e}\x1B[0m`;
|
|
1012
1007
|
}
|
|
1013
|
-
var fe = Ce(),
|
|
1008
|
+
var fe = Ce(), Wt = class {
|
|
1014
1009
|
constructor(e) {
|
|
1015
1010
|
$(this, "prefix");
|
|
1016
1011
|
this.name = e, this.prefix = `[${this.name}]`;
|
|
1017
|
-
const t =
|
|
1012
|
+
const t = Je("DEBUG"), r = Je("LOG_LEVEL");
|
|
1018
1013
|
t === "1" || t === "true" || typeof t < "u" && this.name.startsWith(t) ? (this.debug = Z(r, "debug") ? S : this.debug, this.info = Z(r, "info") ? S : this.info, this.success = Z(r, "success") ? S : this.success, this.warning = Z(r, "warning") ? S : this.warning, this.error = Z(r, "error") ? S : this.error) : (this.info = S, this.success = S, this.warning = S, this.error = S, this.only = S);
|
|
1019
1014
|
}
|
|
1020
1015
|
extend(e) {
|
|
1021
|
-
return new
|
|
1016
|
+
return new Wt(`${this.name}:${e}`);
|
|
1022
1017
|
}
|
|
1023
1018
|
/**
|
|
1024
1019
|
* Print a debug message.
|
|
@@ -1051,7 +1046,7 @@ var fe = Ce(), Vt = class {
|
|
|
1051
1046
|
prefix: "blue"
|
|
1052
1047
|
}
|
|
1053
1048
|
});
|
|
1054
|
-
const r = new
|
|
1049
|
+
const r = new ns();
|
|
1055
1050
|
return (s, ...n) => {
|
|
1056
1051
|
r.measure(), this.logEntry({
|
|
1057
1052
|
level: "info",
|
|
@@ -1146,8 +1141,8 @@ var fe = Ce(), Vt = class {
|
|
|
1146
1141
|
prefix: Re[o]
|
|
1147
1142
|
};
|
|
1148
1143
|
this.getWriter(t)(
|
|
1149
|
-
[c.timestamp(this.formatTimestamp(a.timestamp))].concat(s != null ? c.prefix(s) : []).concat(
|
|
1150
|
-
...i.map(
|
|
1144
|
+
[c.timestamp(this.formatTimestamp(a.timestamp))].concat(s != null ? c.prefix(s) : []).concat(Qe(r)).join(" "),
|
|
1145
|
+
...i.map(Qe)
|
|
1151
1146
|
);
|
|
1152
1147
|
}
|
|
1153
1148
|
formatTimestamp(e) {
|
|
@@ -1160,14 +1155,14 @@ var fe = Ce(), Vt = class {
|
|
|
1160
1155
|
case "debug":
|
|
1161
1156
|
case "success":
|
|
1162
1157
|
case "info":
|
|
1163
|
-
return ns;
|
|
1164
|
-
case "warning":
|
|
1165
1158
|
return ss;
|
|
1166
|
-
case "
|
|
1159
|
+
case "warning":
|
|
1167
1160
|
return is;
|
|
1161
|
+
case "error":
|
|
1162
|
+
return os;
|
|
1168
1163
|
}
|
|
1169
1164
|
}
|
|
1170
|
-
},
|
|
1165
|
+
}, ns = class {
|
|
1171
1166
|
constructor() {
|
|
1172
1167
|
$(this, "startTime");
|
|
1173
1168
|
$(this, "endTime");
|
|
@@ -1181,7 +1176,7 @@ var fe = Ce(), Vt = class {
|
|
|
1181
1176
|
}
|
|
1182
1177
|
}, S = () => {
|
|
1183
1178
|
};
|
|
1184
|
-
function
|
|
1179
|
+
function ss(e, ...t) {
|
|
1185
1180
|
if (fe) {
|
|
1186
1181
|
process.stdout.write(Y(e, ...t) + `
|
|
1187
1182
|
`);
|
|
@@ -1189,7 +1184,7 @@ function ns(e, ...t) {
|
|
|
1189
1184
|
}
|
|
1190
1185
|
console.log(e, ...t);
|
|
1191
1186
|
}
|
|
1192
|
-
function
|
|
1187
|
+
function is(e, ...t) {
|
|
1193
1188
|
if (fe) {
|
|
1194
1189
|
process.stderr.write(Y(e, ...t) + `
|
|
1195
1190
|
`);
|
|
@@ -1197,7 +1192,7 @@ function ss(e, ...t) {
|
|
|
1197
1192
|
}
|
|
1198
1193
|
console.warn(e, ...t);
|
|
1199
1194
|
}
|
|
1200
|
-
function
|
|
1195
|
+
function os(e, ...t) {
|
|
1201
1196
|
if (fe) {
|
|
1202
1197
|
process.stderr.write(Y(e, ...t) + `
|
|
1203
1198
|
`);
|
|
@@ -1205,32 +1200,32 @@ function is(e, ...t) {
|
|
|
1205
1200
|
}
|
|
1206
1201
|
console.error(e, ...t);
|
|
1207
1202
|
}
|
|
1208
|
-
function
|
|
1203
|
+
function Je(e) {
|
|
1209
1204
|
var t;
|
|
1210
1205
|
return fe ? process.env[e] : (t = globalThis[e]) == null ? void 0 : t.toString();
|
|
1211
1206
|
}
|
|
1212
1207
|
function Z(e, t) {
|
|
1213
1208
|
return e !== void 0 && e !== t;
|
|
1214
1209
|
}
|
|
1215
|
-
function
|
|
1210
|
+
function Qe(e) {
|
|
1216
1211
|
return typeof e > "u" ? "undefined" : e === null ? "null" : typeof e == "string" ? e : typeof e == "object" ? JSON.stringify(e) : e.toString();
|
|
1217
1212
|
}
|
|
1218
1213
|
var X = Symbol("isPatchedModule");
|
|
1219
|
-
function
|
|
1214
|
+
function Ke(e) {
|
|
1220
1215
|
return (
|
|
1221
1216
|
// @ts-ignore https://github.com/Microsoft/TypeScript/issues/24587
|
|
1222
1217
|
globalThis[e] || void 0
|
|
1223
1218
|
);
|
|
1224
1219
|
}
|
|
1225
|
-
function
|
|
1220
|
+
function as(e, t) {
|
|
1226
1221
|
globalThis[e] = t;
|
|
1227
1222
|
}
|
|
1228
|
-
function
|
|
1223
|
+
function cs(e) {
|
|
1229
1224
|
delete globalThis[e];
|
|
1230
1225
|
}
|
|
1231
1226
|
var Me = class {
|
|
1232
1227
|
constructor(e) {
|
|
1233
|
-
this.symbol = e, this.readyState = "INACTIVE", this.emitter = new de(), this.subscriptions = [], this.logger = new
|
|
1228
|
+
this.symbol = e, this.readyState = "INACTIVE", this.emitter = new de(), this.subscriptions = [], this.logger = new Wt(e.description), this.emitter.setMaxListeners(0), this.logger.info("constructing the interceptor...");
|
|
1234
1229
|
}
|
|
1235
1230
|
/**
|
|
1236
1231
|
* Determine if this interceptor can be applied
|
|
@@ -1299,7 +1294,7 @@ var Me = class {
|
|
|
1299
1294
|
e.info("no interceptors running, skipping dispose...");
|
|
1300
1295
|
return;
|
|
1301
1296
|
}
|
|
1302
|
-
if (this.clearInstance(), e.info("global symbol deleted:",
|
|
1297
|
+
if (this.clearInstance(), e.info("global symbol deleted:", Ke(this.symbol)), this.subscriptions.length > 0) {
|
|
1303
1298
|
e.info("disposing of %d subscriptions...", this.subscriptions.length);
|
|
1304
1299
|
for (const t of this.subscriptions)
|
|
1305
1300
|
t();
|
|
@@ -1309,14 +1304,14 @@ var Me = class {
|
|
|
1309
1304
|
}
|
|
1310
1305
|
getInstance() {
|
|
1311
1306
|
var e;
|
|
1312
|
-
const t =
|
|
1307
|
+
const t = Ke(this.symbol);
|
|
1313
1308
|
return this.logger.info("retrieved global instance:", (e = t == null ? void 0 : t.constructor) == null ? void 0 : e.name), t;
|
|
1314
1309
|
}
|
|
1315
1310
|
setInstance() {
|
|
1316
|
-
|
|
1311
|
+
as(this.symbol, this), this.logger.info("set global instance!", this.symbol.description);
|
|
1317
1312
|
}
|
|
1318
1313
|
clearInstance() {
|
|
1319
|
-
|
|
1314
|
+
cs(this.symbol), this.logger.info("cleared global instance!", this.symbol.description);
|
|
1320
1315
|
}
|
|
1321
1316
|
}, Ne = class extends Me {
|
|
1322
1317
|
constructor(e) {
|
|
@@ -1349,21 +1344,21 @@ var Me = class {
|
|
|
1349
1344
|
return this;
|
|
1350
1345
|
}
|
|
1351
1346
|
};
|
|
1352
|
-
function
|
|
1347
|
+
function ls(e, t = !0) {
|
|
1353
1348
|
return [t && e.origin, e.pathname].filter(Boolean).join("");
|
|
1354
1349
|
}
|
|
1355
|
-
const
|
|
1356
|
-
function
|
|
1350
|
+
const us = /[\?|#].*$/g;
|
|
1351
|
+
function hs(e) {
|
|
1357
1352
|
return new URL(`/${e}`, "http://localhost").searchParams;
|
|
1358
1353
|
}
|
|
1359
|
-
function
|
|
1360
|
-
return e.replace(
|
|
1354
|
+
function Gt(e) {
|
|
1355
|
+
return e.replace(us, "");
|
|
1361
1356
|
}
|
|
1362
|
-
function
|
|
1357
|
+
function ds(e) {
|
|
1363
1358
|
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e);
|
|
1364
1359
|
}
|
|
1365
|
-
function
|
|
1366
|
-
if (
|
|
1360
|
+
function ps(e, t) {
|
|
1361
|
+
if (ds(e) || e.startsWith("*"))
|
|
1367
1362
|
return e;
|
|
1368
1363
|
const r = t || typeof document < "u" && document.baseURI;
|
|
1369
1364
|
return r ? (
|
|
@@ -1371,13 +1366,13 @@ function ds(e, t) {
|
|
|
1371
1366
|
decodeURI(new URL(encodeURI(e), r).href)
|
|
1372
1367
|
) : e;
|
|
1373
1368
|
}
|
|
1374
|
-
function
|
|
1369
|
+
function fs(e, t) {
|
|
1375
1370
|
if (e instanceof RegExp)
|
|
1376
1371
|
return e;
|
|
1377
|
-
const r =
|
|
1378
|
-
return
|
|
1372
|
+
const r = ps(e, t);
|
|
1373
|
+
return Gt(r);
|
|
1379
1374
|
}
|
|
1380
|
-
function
|
|
1375
|
+
function ms(e) {
|
|
1381
1376
|
return e.replace(
|
|
1382
1377
|
/([:a-zA-Z_-]*)(\*{1,2})+/g,
|
|
1383
1378
|
(t, r, s) => {
|
|
@@ -1386,8 +1381,8 @@ function fs(e) {
|
|
|
1386
1381
|
}
|
|
1387
1382
|
).replace(/([^\/])(:)(?=\d+)/, "$1\\$2").replace(/^([^\/]+)(:)(?=\/\/)/, "$1\\$2");
|
|
1388
1383
|
}
|
|
1389
|
-
function
|
|
1390
|
-
const s =
|
|
1384
|
+
function Ht(e, t, r) {
|
|
1385
|
+
const s = fs(t, r), n = typeof s == "string" ? ms(s) : s, i = ls(e), a = Un(n, { decode: decodeURIComponent })(i), l = a && a.params || {};
|
|
1391
1386
|
return {
|
|
1392
1387
|
matches: a !== !1,
|
|
1393
1388
|
params: l
|
|
@@ -1399,21 +1394,21 @@ function se(e) {
|
|
|
1399
1394
|
const t = new URL(e.url);
|
|
1400
1395
|
return t.origin === location.origin ? t.pathname : t.origin + t.pathname;
|
|
1401
1396
|
}
|
|
1402
|
-
var
|
|
1403
|
-
return t || (0, e[
|
|
1404
|
-
},
|
|
1397
|
+
var ys = Object.create, Xt = Object.defineProperty, gs = Object.getOwnPropertyDescriptor, zt = Object.getOwnPropertyNames, vs = Object.getPrototypeOf, Es = Object.prototype.hasOwnProperty, ws = (e, t) => function() {
|
|
1398
|
+
return t || (0, e[zt(e)[0]])((t = { exports: {} }).exports, t), t.exports;
|
|
1399
|
+
}, bs = (e, t, r, s) => {
|
|
1405
1400
|
if (t && typeof t == "object" || typeof t == "function")
|
|
1406
|
-
for (let n of
|
|
1407
|
-
!
|
|
1401
|
+
for (let n of zt(t))
|
|
1402
|
+
!Es.call(e, n) && n !== r && Xt(e, n, { get: () => t[n], enumerable: !(s = gs(t, n)) || s.enumerable });
|
|
1408
1403
|
return e;
|
|
1409
|
-
},
|
|
1404
|
+
}, _s = (e, t, r) => (r = e != null ? ys(vs(e)) : {}, bs(
|
|
1410
1405
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
1411
1406
|
// file that has been converted to a CommonJS file using a Babel-
|
|
1412
1407
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
1413
1408
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
1414
|
-
|
|
1409
|
+
Xt(r, "default", { value: e, enumerable: !0 }),
|
|
1415
1410
|
e
|
|
1416
|
-
)),
|
|
1411
|
+
)), xs = ws({
|
|
1417
1412
|
"node_modules/cookie/index.js"(e) {
|
|
1418
1413
|
e.parse = s, e.serialize = n;
|
|
1419
1414
|
var t = Object.prototype.toString, r = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
|
|
@@ -1526,7 +1521,7 @@ var ms = Object.create, Ht = Object.defineProperty, ys = Object.getOwnPropertyDe
|
|
|
1526
1521
|
}
|
|
1527
1522
|
}
|
|
1528
1523
|
}
|
|
1529
|
-
}),
|
|
1524
|
+
}), Ts = _s(xs()), Yt = Ts.default;
|
|
1530
1525
|
/*! Bundled license information:
|
|
1531
1526
|
|
|
1532
1527
|
cookie/index.js:
|
|
@@ -1537,17 +1532,17 @@ cookie/index.js:
|
|
|
1537
1532
|
* MIT Licensed
|
|
1538
1533
|
*)
|
|
1539
1534
|
*/
|
|
1540
|
-
var
|
|
1541
|
-
return t || (0, e[
|
|
1542
|
-
},
|
|
1535
|
+
var Os = Object.create, Jt = Object.defineProperty, As = Object.getOwnPropertyDescriptor, Qt = Object.getOwnPropertyNames, Rs = Object.getPrototypeOf, Is = Object.prototype.hasOwnProperty, Ns = (e, t) => function() {
|
|
1536
|
+
return t || (0, e[Qt(e)[0]])((t = { exports: {} }).exports, t), t.exports;
|
|
1537
|
+
}, ks = (e, t, r, s) => {
|
|
1543
1538
|
if (t && typeof t == "object" || typeof t == "function")
|
|
1544
|
-
for (let n of
|
|
1545
|
-
!
|
|
1539
|
+
for (let n of Qt(t))
|
|
1540
|
+
!Is.call(e, n) && n !== r && Jt(e, n, { get: () => t[n], enumerable: !(s = As(t, n)) || s.enumerable });
|
|
1546
1541
|
return e;
|
|
1547
|
-
},
|
|
1548
|
-
!e || !e.__esModule ?
|
|
1542
|
+
}, Ps = (e, t, r) => (r = e != null ? Os(Rs(e)) : {}, ks(
|
|
1543
|
+
!e || !e.__esModule ? Jt(r, "default", { value: e, enumerable: !0 }) : r,
|
|
1549
1544
|
e
|
|
1550
|
-
)),
|
|
1545
|
+
)), Ls = Ns({
|
|
1551
1546
|
"node_modules/set-cookie-parser/lib/set-cookie.js"(e, t) {
|
|
1552
1547
|
var r = {
|
|
1553
1548
|
decodeValues: !0,
|
|
@@ -1636,8 +1631,8 @@ var Ts = Object.create, Yt = Object.defineProperty, Os = Object.getOwnPropertyDe
|
|
|
1636
1631
|
}
|
|
1637
1632
|
t.exports = a, t.exports.parse = a, t.exports.parseString = n, t.exports.splitCookiesString = l;
|
|
1638
1633
|
}
|
|
1639
|
-
}),
|
|
1640
|
-
function
|
|
1634
|
+
}), Ze = Ps(Ls()), G = "MSW_COOKIE_STORE";
|
|
1635
|
+
function Ss() {
|
|
1641
1636
|
try {
|
|
1642
1637
|
if (localStorage == null)
|
|
1643
1638
|
return !1;
|
|
@@ -1647,25 +1642,25 @@ function Ls() {
|
|
|
1647
1642
|
return !1;
|
|
1648
1643
|
}
|
|
1649
1644
|
}
|
|
1650
|
-
var
|
|
1651
|
-
function
|
|
1645
|
+
var et = Ss();
|
|
1646
|
+
function tt(e, t) {
|
|
1652
1647
|
try {
|
|
1653
1648
|
return e[t], !0;
|
|
1654
1649
|
} catch {
|
|
1655
1650
|
return !1;
|
|
1656
1651
|
}
|
|
1657
1652
|
}
|
|
1658
|
-
var
|
|
1653
|
+
var Ds = class {
|
|
1659
1654
|
constructor() {
|
|
1660
1655
|
this.store = /* @__PURE__ */ new Map();
|
|
1661
1656
|
}
|
|
1662
1657
|
add(e, t) {
|
|
1663
|
-
if (
|
|
1658
|
+
if (tt(e, "credentials") && e.credentials === "omit")
|
|
1664
1659
|
return;
|
|
1665
1660
|
const r = new URL(e.url), s = t.headers.get("set-cookie");
|
|
1666
1661
|
if (!s)
|
|
1667
1662
|
return;
|
|
1668
|
-
const n = Date.now(), i = (0,
|
|
1663
|
+
const n = Date.now(), i = (0, Ze.parse)(s).map(
|
|
1669
1664
|
({ maxAge: l, ...o }) => ({
|
|
1670
1665
|
...o,
|
|
1671
1666
|
expires: l === void 0 ? o.expires : new Date(n + l * 1e3),
|
|
@@ -1679,11 +1674,11 @@ var Ss = class {
|
|
|
1679
1674
|
get(e) {
|
|
1680
1675
|
this.deleteExpiredCookies();
|
|
1681
1676
|
const t = new URL(e.url), r = this.store.get(t.origin) || /* @__PURE__ */ new Map();
|
|
1682
|
-
if (!
|
|
1677
|
+
if (!tt(e, "credentials"))
|
|
1683
1678
|
return r;
|
|
1684
1679
|
switch (e.credentials) {
|
|
1685
1680
|
case "include":
|
|
1686
|
-
return typeof document > "u" || (0,
|
|
1681
|
+
return typeof document > "u" || (0, Ze.parse)(document.cookie).forEach((n) => {
|
|
1687
1682
|
r.set(n.name, n);
|
|
1688
1683
|
}), r;
|
|
1689
1684
|
case "same-origin":
|
|
@@ -1703,7 +1698,7 @@ var Ss = class {
|
|
|
1703
1698
|
this.store.clear();
|
|
1704
1699
|
}
|
|
1705
1700
|
hydrate() {
|
|
1706
|
-
if (!
|
|
1701
|
+
if (!et)
|
|
1707
1702
|
return;
|
|
1708
1703
|
const e = localStorage.getItem(G);
|
|
1709
1704
|
if (e)
|
|
@@ -1733,7 +1728,7 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
1733
1728
|
}
|
|
1734
1729
|
}
|
|
1735
1730
|
persist() {
|
|
1736
|
-
if (!
|
|
1731
|
+
if (!et)
|
|
1737
1732
|
return;
|
|
1738
1733
|
const e = Array.from(this.store.entries()).map(
|
|
1739
1734
|
([t, r]) => [t, Array.from(r.entries())]
|
|
@@ -1748,44 +1743,44 @@ Invalid value has been removed from localStorage to prevent subsequent failed pa
|
|
|
1748
1743
|
}), t.size === 0 && this.store.delete(r);
|
|
1749
1744
|
});
|
|
1750
1745
|
}
|
|
1751
|
-
}, pe = new
|
|
1746
|
+
}, pe = new Ds(), Cs = Object.defineProperty, rt = Object.getOwnPropertySymbols, qs = Object.prototype.hasOwnProperty, Ms = Object.prototype.propertyIsEnumerable, nt = (e, t, r) => t in e ? Cs(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, ae = (e, t) => {
|
|
1752
1747
|
for (var r in t || (t = {}))
|
|
1753
|
-
|
|
1754
|
-
if (
|
|
1755
|
-
for (var r of
|
|
1756
|
-
|
|
1748
|
+
qs.call(t, r) && nt(e, r, t[r]);
|
|
1749
|
+
if (rt)
|
|
1750
|
+
for (var r of rt(t))
|
|
1751
|
+
Ms.call(t, r) && nt(e, r, t[r]);
|
|
1757
1752
|
return e;
|
|
1758
1753
|
};
|
|
1759
|
-
function
|
|
1760
|
-
return
|
|
1754
|
+
function st() {
|
|
1755
|
+
return Yt.parse(document.cookie);
|
|
1761
1756
|
}
|
|
1762
|
-
function
|
|
1757
|
+
function $s(e) {
|
|
1763
1758
|
if (typeof document > "u" || typeof location > "u")
|
|
1764
1759
|
return {};
|
|
1765
1760
|
switch (e.credentials) {
|
|
1766
1761
|
case "same-origin": {
|
|
1767
1762
|
const t = new URL(e.url);
|
|
1768
|
-
return location.origin === t.origin ?
|
|
1763
|
+
return location.origin === t.origin ? st() : {};
|
|
1769
1764
|
}
|
|
1770
1765
|
case "include":
|
|
1771
|
-
return
|
|
1766
|
+
return st();
|
|
1772
1767
|
default:
|
|
1773
1768
|
return {};
|
|
1774
1769
|
}
|
|
1775
1770
|
}
|
|
1776
|
-
function
|
|
1771
|
+
function Us(e) {
|
|
1777
1772
|
var t;
|
|
1778
|
-
const r = e.headers.get("cookie"), s = r ?
|
|
1773
|
+
const r = e.headers.get("cookie"), s = r ? Yt.parse(r) : {};
|
|
1779
1774
|
pe.hydrate();
|
|
1780
1775
|
const n = Array.from((t = pe.get(e)) == null ? void 0 : t.entries()).reduce(
|
|
1781
1776
|
(l, [o, { value: c }]) => Object.assign(l, { [o.trim()]: c }),
|
|
1782
1777
|
{}
|
|
1783
|
-
), i =
|
|
1778
|
+
), i = $s(e), a = ae(ae({}, i), n);
|
|
1784
1779
|
for (const [l, o] of Object.entries(a))
|
|
1785
1780
|
e.headers.append("cookie", `${l}=${o}`);
|
|
1786
1781
|
return ae(ae({}, a), s);
|
|
1787
1782
|
}
|
|
1788
|
-
var
|
|
1783
|
+
var it = (e, t, r) => new Promise((s, n) => {
|
|
1789
1784
|
var i = (o) => {
|
|
1790
1785
|
try {
|
|
1791
1786
|
l(r.next(o));
|
|
@@ -1801,7 +1796,7 @@ var st = (e, t, r) => new Promise((s, n) => {
|
|
|
1801
1796
|
}, l = (o) => o.done ? s(o.value) : Promise.resolve(o.value).then(i, a);
|
|
1802
1797
|
l((r = r.apply(e, t)).next());
|
|
1803
1798
|
});
|
|
1804
|
-
class
|
|
1799
|
+
class js extends St {
|
|
1805
1800
|
constructor(t, r, s, n) {
|
|
1806
1801
|
super({
|
|
1807
1802
|
info: {
|
|
@@ -1815,21 +1810,21 @@ class Us extends Lt {
|
|
|
1815
1810
|
}
|
|
1816
1811
|
checkRedundantQueryParameters() {
|
|
1817
1812
|
const { method: t, path: r } = this.info;
|
|
1818
|
-
if (r instanceof RegExp ||
|
|
1813
|
+
if (r instanceof RegExp || Gt(r) === r)
|
|
1819
1814
|
return;
|
|
1820
|
-
|
|
1815
|
+
hs(r).forEach((i, a) => {
|
|
1821
1816
|
}), T.warn(
|
|
1822
1817
|
`Found a redundant usage of query parameters in the request handler URL for "${t} ${r}". Please match against a path instead and access query parameters in the response resolver function using "req.url.searchParams".`
|
|
1823
1818
|
);
|
|
1824
1819
|
}
|
|
1825
1820
|
parse(t) {
|
|
1826
|
-
return
|
|
1821
|
+
return it(this, null, function* () {
|
|
1827
1822
|
var r;
|
|
1828
|
-
const s = new URL(t.request.url), n =
|
|
1823
|
+
const s = new URL(t.request.url), n = Ht(
|
|
1829
1824
|
s,
|
|
1830
1825
|
this.info.path,
|
|
1831
1826
|
(r = t.resolutionContext) == null ? void 0 : r.baseUrl
|
|
1832
|
-
), i =
|
|
1827
|
+
), i = Us(t.request);
|
|
1833
1828
|
return {
|
|
1834
1829
|
match: n,
|
|
1835
1830
|
cookies: i
|
|
@@ -1841,7 +1836,7 @@ class Us extends Lt {
|
|
|
1841
1836
|
return r && s;
|
|
1842
1837
|
}
|
|
1843
1838
|
matchMethod(t) {
|
|
1844
|
-
return this.info.method instanceof RegExp ? this.info.method.test(t) :
|
|
1839
|
+
return this.info.method instanceof RegExp ? this.info.method.test(t) : Dt(this.info.method, t);
|
|
1845
1840
|
}
|
|
1846
1841
|
extendResolverArgs(t) {
|
|
1847
1842
|
var r;
|
|
@@ -1851,11 +1846,11 @@ class Us extends Lt {
|
|
|
1851
1846
|
};
|
|
1852
1847
|
}
|
|
1853
1848
|
log(t) {
|
|
1854
|
-
return
|
|
1855
|
-
const r = se(t.request), s = yield
|
|
1849
|
+
return it(this, null, function* () {
|
|
1850
|
+
const r = se(t.request), s = yield Mt(t.request), n = yield Ft(t.response), i = Ct(n.status);
|
|
1856
1851
|
console.groupCollapsed(
|
|
1857
1852
|
T.formatMessage("%s %s %s (%c%s%c)"),
|
|
1858
|
-
|
|
1853
|
+
qt(),
|
|
1859
1854
|
t.request.method,
|
|
1860
1855
|
r,
|
|
1861
1856
|
`color:${i}`,
|
|
@@ -1869,20 +1864,20 @@ function be(e, t) {
|
|
|
1869
1864
|
if (!!!e)
|
|
1870
1865
|
throw new Error(t);
|
|
1871
1866
|
}
|
|
1872
|
-
function
|
|
1867
|
+
function Fs(e) {
|
|
1873
1868
|
return typeof e == "object" && e !== null;
|
|
1874
1869
|
}
|
|
1875
|
-
function
|
|
1870
|
+
function Bs(e, t) {
|
|
1876
1871
|
if (!!!e)
|
|
1877
1872
|
throw new Error(
|
|
1878
1873
|
"Unexpected invariant triggered."
|
|
1879
1874
|
);
|
|
1880
1875
|
}
|
|
1881
|
-
const
|
|
1876
|
+
const Vs = /\r\n|[\n\r]/g;
|
|
1882
1877
|
function ke(e, t) {
|
|
1883
1878
|
let r = 0, s = 1;
|
|
1884
|
-
for (const n of e.body.matchAll(
|
|
1885
|
-
if (typeof n.index == "number" ||
|
|
1879
|
+
for (const n of e.body.matchAll(Vs)) {
|
|
1880
|
+
if (typeof n.index == "number" || Bs(!1), n.index >= t)
|
|
1886
1881
|
break;
|
|
1887
1882
|
r = n.index + n[0].length, s += 1;
|
|
1888
1883
|
}
|
|
@@ -1891,27 +1886,27 @@ function ke(e, t) {
|
|
|
1891
1886
|
column: t + 1 - r
|
|
1892
1887
|
};
|
|
1893
1888
|
}
|
|
1894
|
-
function
|
|
1895
|
-
return
|
|
1889
|
+
function Ws(e) {
|
|
1890
|
+
return Kt(
|
|
1896
1891
|
e.source,
|
|
1897
1892
|
ke(e.source, e.start)
|
|
1898
1893
|
);
|
|
1899
1894
|
}
|
|
1900
|
-
function
|
|
1895
|
+
function Kt(e, t) {
|
|
1901
1896
|
const r = e.locationOffset.column - 1, s = "".padStart(r) + e.body, n = t.line - 1, i = e.locationOffset.line - 1, a = t.line + i, l = t.line === 1 ? r : 0, o = t.column + l, c = `${e.name}:${a}:${o}
|
|
1902
1897
|
`, u = s.split(/\r\n|[\n\r]/g), h = u[n];
|
|
1903
1898
|
if (h.length > 120) {
|
|
1904
1899
|
const d = Math.floor(o / 80), m = o % 80, f = [];
|
|
1905
1900
|
for (let y = 0; y < h.length; y += 80)
|
|
1906
1901
|
f.push(h.slice(y, y + 80));
|
|
1907
|
-
return c +
|
|
1902
|
+
return c + ot([
|
|
1908
1903
|
[`${a} |`, f[0]],
|
|
1909
1904
|
...f.slice(1, d + 1).map((y) => ["|", y]),
|
|
1910
1905
|
["|", "^".padStart(m)],
|
|
1911
1906
|
["|", f[d + 1]]
|
|
1912
1907
|
]);
|
|
1913
1908
|
}
|
|
1914
|
-
return c +
|
|
1909
|
+
return c + ot([
|
|
1915
1910
|
// Lines specified like this: ["prefix", "string"],
|
|
1916
1911
|
[`${a - 1} |`, u[n - 1]],
|
|
1917
1912
|
[`${a} |`, h],
|
|
@@ -1919,12 +1914,12 @@ function Qt(e, t) {
|
|
|
1919
1914
|
[`${a + 1} |`, u[n + 1]]
|
|
1920
1915
|
]);
|
|
1921
1916
|
}
|
|
1922
|
-
function
|
|
1917
|
+
function ot(e) {
|
|
1923
1918
|
const t = e.filter(([s, n]) => n !== void 0), r = Math.max(...t.map(([s]) => s.length));
|
|
1924
1919
|
return t.map(([s, n]) => s.padStart(r) + (n ? " " + n : "")).join(`
|
|
1925
1920
|
`);
|
|
1926
1921
|
}
|
|
1927
|
-
function
|
|
1922
|
+
function Gs(e) {
|
|
1928
1923
|
const t = e[0];
|
|
1929
1924
|
return t == null || "kind" in t || "length" in t ? {
|
|
1930
1925
|
nodes: t,
|
|
@@ -1976,15 +1971,15 @@ class $e extends Error {
|
|
|
1976
1971
|
*/
|
|
1977
1972
|
constructor(t, ...r) {
|
|
1978
1973
|
var s, n, i;
|
|
1979
|
-
const { nodes: a, source: l, positions: o, path: c, originalError: u, extensions: h } =
|
|
1980
|
-
super(t), this.name = "GraphQLError", this.path = c ?? void 0, this.originalError = u ?? void 0, this.nodes =
|
|
1974
|
+
const { nodes: a, source: l, positions: o, path: c, originalError: u, extensions: h } = Gs(r);
|
|
1975
|
+
super(t), this.name = "GraphQLError", this.path = c ?? void 0, this.originalError = u ?? void 0, this.nodes = at(
|
|
1981
1976
|
Array.isArray(a) ? a : a ? [a] : void 0
|
|
1982
1977
|
);
|
|
1983
|
-
const d =
|
|
1978
|
+
const d = at(
|
|
1984
1979
|
(s = this.nodes) === null || s === void 0 ? void 0 : s.map((f) => f.loc).filter((f) => f != null)
|
|
1985
1980
|
);
|
|
1986
1981
|
this.source = l ?? (d == null || (n = d[0]) === null || n === void 0 ? void 0 : n.source), this.positions = o ?? (d == null ? void 0 : d.map((f) => f.start)), this.locations = o && l ? o.map((f) => ke(l, f)) : d == null ? void 0 : d.map((f) => ke(f.source, f.start));
|
|
1987
|
-
const m =
|
|
1982
|
+
const m = Fs(
|
|
1988
1983
|
u == null ? void 0 : u.extensions
|
|
1989
1984
|
) ? u == null ? void 0 : u.extensions : void 0;
|
|
1990
1985
|
this.extensions = (i = h ?? m) !== null && i !== void 0 ? i : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
|
|
@@ -2026,12 +2021,12 @@ class $e extends Error {
|
|
|
2026
2021
|
for (const r of this.nodes)
|
|
2027
2022
|
r.loc && (t += `
|
|
2028
2023
|
|
|
2029
|
-
` +
|
|
2024
|
+
` + Ws(r.loc));
|
|
2030
2025
|
else if (this.source && this.locations)
|
|
2031
2026
|
for (const r of this.locations)
|
|
2032
2027
|
t += `
|
|
2033
2028
|
|
|
2034
|
-
` +
|
|
2029
|
+
` + Kt(this.source, r);
|
|
2035
2030
|
return t;
|
|
2036
2031
|
}
|
|
2037
2032
|
toJSON() {
|
|
@@ -2041,7 +2036,7 @@ class $e extends Error {
|
|
|
2041
2036
|
return this.locations != null && (t.locations = this.locations), this.path != null && (t.path = this.path), this.extensions != null && Object.keys(this.extensions).length > 0 && (t.extensions = this.extensions), t;
|
|
2042
2037
|
}
|
|
2043
2038
|
}
|
|
2044
|
-
function
|
|
2039
|
+
function at(e) {
|
|
2045
2040
|
return e === void 0 || e.length === 0 ? void 0 : e;
|
|
2046
2041
|
}
|
|
2047
2042
|
function R(e, t, r) {
|
|
@@ -2050,7 +2045,7 @@ function R(e, t, r) {
|
|
|
2050
2045
|
positions: [t]
|
|
2051
2046
|
});
|
|
2052
2047
|
}
|
|
2053
|
-
class
|
|
2048
|
+
class Hs {
|
|
2054
2049
|
/**
|
|
2055
2050
|
* The character offset at which this Node begins.
|
|
2056
2051
|
*/
|
|
@@ -2079,7 +2074,7 @@ class Gs {
|
|
|
2079
2074
|
};
|
|
2080
2075
|
}
|
|
2081
2076
|
}
|
|
2082
|
-
class
|
|
2077
|
+
class Zt {
|
|
2083
2078
|
/**
|
|
2084
2079
|
* The kind of Token.
|
|
2085
2080
|
*/
|
|
@@ -2121,7 +2116,7 @@ class Kt {
|
|
|
2121
2116
|
};
|
|
2122
2117
|
}
|
|
2123
2118
|
}
|
|
2124
|
-
const
|
|
2119
|
+
const Xs = {
|
|
2125
2120
|
Name: [],
|
|
2126
2121
|
Document: ["definitions"],
|
|
2127
2122
|
OperationDefinition: [
|
|
@@ -2196,7 +2191,7 @@ const Hs = {
|
|
|
2196
2191
|
EnumTypeExtension: ["name", "directives", "values"],
|
|
2197
2192
|
InputObjectTypeExtension: ["name", "directives", "fields"]
|
|
2198
2193
|
};
|
|
2199
|
-
new Set(Object.keys(
|
|
2194
|
+
new Set(Object.keys(Xs));
|
|
2200
2195
|
var H;
|
|
2201
2196
|
(function(e) {
|
|
2202
2197
|
e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
|
|
@@ -2209,28 +2204,28 @@ var g;
|
|
|
2209
2204
|
(function(e) {
|
|
2210
2205
|
e.NAME = "Name", e.DOCUMENT = "Document", e.OPERATION_DEFINITION = "OperationDefinition", e.VARIABLE_DEFINITION = "VariableDefinition", e.SELECTION_SET = "SelectionSet", e.FIELD = "Field", e.ARGUMENT = "Argument", e.FRAGMENT_SPREAD = "FragmentSpread", e.INLINE_FRAGMENT = "InlineFragment", e.FRAGMENT_DEFINITION = "FragmentDefinition", e.VARIABLE = "Variable", e.INT = "IntValue", e.FLOAT = "FloatValue", e.STRING = "StringValue", e.BOOLEAN = "BooleanValue", e.NULL = "NullValue", e.ENUM = "EnumValue", e.LIST = "ListValue", e.OBJECT = "ObjectValue", e.OBJECT_FIELD = "ObjectField", e.DIRECTIVE = "Directive", e.NAMED_TYPE = "NamedType", e.LIST_TYPE = "ListType", e.NON_NULL_TYPE = "NonNullType", e.SCHEMA_DEFINITION = "SchemaDefinition", e.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", e.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", e.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", e.FIELD_DEFINITION = "FieldDefinition", e.INPUT_VALUE_DEFINITION = "InputValueDefinition", e.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", e.UNION_TYPE_DEFINITION = "UnionTypeDefinition", e.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", e.ENUM_VALUE_DEFINITION = "EnumValueDefinition", e.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", e.DIRECTIVE_DEFINITION = "DirectiveDefinition", e.SCHEMA_EXTENSION = "SchemaExtension", e.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", e.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", e.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", e.UNION_TYPE_EXTENSION = "UnionTypeExtension", e.ENUM_TYPE_EXTENSION = "EnumTypeExtension", e.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension";
|
|
2211
2206
|
})(g || (g = {}));
|
|
2212
|
-
function
|
|
2207
|
+
function zs(e) {
|
|
2213
2208
|
return e === 9 || e === 32;
|
|
2214
2209
|
}
|
|
2215
2210
|
function ne(e) {
|
|
2216
2211
|
return e >= 48 && e <= 57;
|
|
2217
2212
|
}
|
|
2218
|
-
function
|
|
2213
|
+
function er(e) {
|
|
2219
2214
|
return e >= 97 && e <= 122 || // A-Z
|
|
2220
2215
|
e >= 65 && e <= 90;
|
|
2221
2216
|
}
|
|
2222
|
-
function
|
|
2223
|
-
return
|
|
2224
|
-
}
|
|
2225
|
-
function zs(e) {
|
|
2226
|
-
return Zt(e) || ne(e) || e === 95;
|
|
2217
|
+
function tr(e) {
|
|
2218
|
+
return er(e) || e === 95;
|
|
2227
2219
|
}
|
|
2228
2220
|
function Ys(e) {
|
|
2221
|
+
return er(e) || ne(e) || e === 95;
|
|
2222
|
+
}
|
|
2223
|
+
function Js(e) {
|
|
2229
2224
|
var t;
|
|
2230
2225
|
let r = Number.MAX_SAFE_INTEGER, s = null, n = -1;
|
|
2231
2226
|
for (let a = 0; a < e.length; ++a) {
|
|
2232
2227
|
var i;
|
|
2233
|
-
const l = e[a], o =
|
|
2228
|
+
const l = e[a], o = Qs(l);
|
|
2234
2229
|
o !== l.length && (s = (i = s) !== null && i !== void 0 ? i : a, n = a, a !== 0 && o < r && (r = o));
|
|
2235
2230
|
}
|
|
2236
2231
|
return e.map((a, l) => l === 0 ? a : a.slice(r)).slice(
|
|
@@ -2238,9 +2233,9 @@ function Ys(e) {
|
|
|
2238
2233
|
n + 1
|
|
2239
2234
|
);
|
|
2240
2235
|
}
|
|
2241
|
-
function
|
|
2236
|
+
function Qs(e) {
|
|
2242
2237
|
let t = 0;
|
|
2243
|
-
for (; t < e.length &&
|
|
2238
|
+
for (; t < e.length && zs(e.charCodeAt(t)); )
|
|
2244
2239
|
++t;
|
|
2245
2240
|
return t;
|
|
2246
2241
|
}
|
|
@@ -2248,7 +2243,7 @@ var p;
|
|
|
2248
2243
|
(function(e) {
|
|
2249
2244
|
e.SOF = "<SOF>", e.EOF = "<EOF>", e.BANG = "!", e.DOLLAR = "$", e.AMP = "&", e.PAREN_L = "(", e.PAREN_R = ")", e.SPREAD = "...", e.COLON = ":", e.EQUALS = "=", e.AT = "@", e.BRACKET_L = "[", e.BRACKET_R = "]", e.BRACE_L = "{", e.PIPE = "|", e.BRACE_R = "}", e.NAME = "Name", e.INT = "Int", e.FLOAT = "Float", e.STRING = "String", e.BLOCK_STRING = "BlockString", e.COMMENT = "Comment";
|
|
2250
2245
|
})(p || (p = {}));
|
|
2251
|
-
class
|
|
2246
|
+
class Ks {
|
|
2252
2247
|
/**
|
|
2253
2248
|
* The previously focused non-ignored token.
|
|
2254
2249
|
*/
|
|
@@ -2262,7 +2257,7 @@ class Qs {
|
|
|
2262
2257
|
* The character offset at which the current line begins.
|
|
2263
2258
|
*/
|
|
2264
2259
|
constructor(t) {
|
|
2265
|
-
const r = new
|
|
2260
|
+
const r = new Zt(p.SOF, 0, 0, 0, 0);
|
|
2266
2261
|
this.source = t, this.lastToken = r, this.token = r, this.line = 1, this.lineStart = 0;
|
|
2267
2262
|
}
|
|
2268
2263
|
get [Symbol.toStringTag]() {
|
|
@@ -2285,26 +2280,26 @@ class Qs {
|
|
|
2285
2280
|
if (t.next)
|
|
2286
2281
|
t = t.next;
|
|
2287
2282
|
else {
|
|
2288
|
-
const r =
|
|
2283
|
+
const r = ei(this, t.end);
|
|
2289
2284
|
t.next = r, r.prev = t, t = r;
|
|
2290
2285
|
}
|
|
2291
2286
|
while (t.kind === p.COMMENT);
|
|
2292
2287
|
return t;
|
|
2293
2288
|
}
|
|
2294
2289
|
}
|
|
2295
|
-
function
|
|
2290
|
+
function Zs(e) {
|
|
2296
2291
|
return e === p.BANG || e === p.DOLLAR || e === p.AMP || e === p.PAREN_L || e === p.PAREN_R || e === p.SPREAD || e === p.COLON || e === p.EQUALS || e === p.AT || e === p.BRACKET_L || e === p.BRACKET_R || e === p.BRACE_L || e === p.PIPE || e === p.BRACE_R;
|
|
2297
2292
|
}
|
|
2298
2293
|
function J(e) {
|
|
2299
2294
|
return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
|
|
2300
2295
|
}
|
|
2301
2296
|
function me(e, t) {
|
|
2302
|
-
return
|
|
2297
|
+
return rr(e.charCodeAt(t)) && nr(e.charCodeAt(t + 1));
|
|
2303
2298
|
}
|
|
2304
|
-
function
|
|
2299
|
+
function rr(e) {
|
|
2305
2300
|
return e >= 55296 && e <= 56319;
|
|
2306
2301
|
}
|
|
2307
|
-
function
|
|
2302
|
+
function nr(e) {
|
|
2308
2303
|
return e >= 56320 && e <= 57343;
|
|
2309
2304
|
}
|
|
2310
2305
|
function j(e, t) {
|
|
@@ -2319,9 +2314,9 @@ function j(e, t) {
|
|
|
2319
2314
|
}
|
|
2320
2315
|
function O(e, t, r, s, n) {
|
|
2321
2316
|
const i = e.line, a = 1 + r - e.lineStart;
|
|
2322
|
-
return new
|
|
2317
|
+
return new Zt(t, r, s, i, a, n);
|
|
2323
2318
|
}
|
|
2324
|
-
function
|
|
2319
|
+
function ei(e, t) {
|
|
2325
2320
|
const r = e.source.body, s = r.length;
|
|
2326
2321
|
let n = t;
|
|
2327
2322
|
for (; n < s; ) {
|
|
@@ -2340,7 +2335,7 @@ function Zs(e, t) {
|
|
|
2340
2335
|
r.charCodeAt(n + 1) === 10 ? n += 2 : ++n, ++e.line, e.lineStart = n;
|
|
2341
2336
|
continue;
|
|
2342
2337
|
case 35:
|
|
2343
|
-
return
|
|
2338
|
+
return ti(e, n);
|
|
2344
2339
|
case 33:
|
|
2345
2340
|
return O(e, p.BANG, n, n + 1);
|
|
2346
2341
|
case 36:
|
|
@@ -2372,12 +2367,12 @@ function Zs(e, t) {
|
|
|
2372
2367
|
case 125:
|
|
2373
2368
|
return O(e, p.BRACE_R, n, n + 1);
|
|
2374
2369
|
case 34:
|
|
2375
|
-
return r.charCodeAt(n + 1) === 34 && r.charCodeAt(n + 2) === 34 ?
|
|
2370
|
+
return r.charCodeAt(n + 1) === 34 && r.charCodeAt(n + 2) === 34 ? ai(e, n) : ni(e, n);
|
|
2376
2371
|
}
|
|
2377
2372
|
if (ne(i) || i === 45)
|
|
2378
|
-
return
|
|
2379
|
-
if (
|
|
2380
|
-
return
|
|
2373
|
+
return ri(e, n, i);
|
|
2374
|
+
if (tr(i))
|
|
2375
|
+
return ci(e, n);
|
|
2381
2376
|
throw R(
|
|
2382
2377
|
e.source,
|
|
2383
2378
|
n,
|
|
@@ -2386,7 +2381,7 @@ function Zs(e, t) {
|
|
|
2386
2381
|
}
|
|
2387
2382
|
return O(e, p.EOF, s, s);
|
|
2388
2383
|
}
|
|
2389
|
-
function
|
|
2384
|
+
function ti(e, t) {
|
|
2390
2385
|
const r = e.source.body, s = r.length;
|
|
2391
2386
|
let n = t + 1;
|
|
2392
2387
|
for (; n < s; ) {
|
|
@@ -2408,7 +2403,7 @@ function ei(e, t) {
|
|
|
2408
2403
|
r.slice(t + 1, n)
|
|
2409
2404
|
);
|
|
2410
2405
|
}
|
|
2411
|
-
function
|
|
2406
|
+
function ri(e, t, r) {
|
|
2412
2407
|
const s = e.source.body;
|
|
2413
2408
|
let n = t, i = r, a = !1;
|
|
2414
2409
|
if (i === 45 && (i = s.charCodeAt(++n)), i === 48) {
|
|
@@ -2423,7 +2418,7 @@ function ti(e, t, r) {
|
|
|
2423
2418
|
);
|
|
2424
2419
|
} else
|
|
2425
2420
|
n = _e(e, n, i), i = s.charCodeAt(n);
|
|
2426
|
-
if (i === 46 && (a = !0, i = s.charCodeAt(++n), n = _e(e, n, i), i = s.charCodeAt(n)), (i === 69 || i === 101) && (a = !0, i = s.charCodeAt(++n), (i === 43 || i === 45) && (i = s.charCodeAt(++n)), n = _e(e, n, i), i = s.charCodeAt(n)), i === 46 ||
|
|
2421
|
+
if (i === 46 && (a = !0, i = s.charCodeAt(++n), n = _e(e, n, i), i = s.charCodeAt(n)), (i === 69 || i === 101) && (a = !0, i = s.charCodeAt(++n), (i === 43 || i === 45) && (i = s.charCodeAt(++n)), n = _e(e, n, i), i = s.charCodeAt(n)), i === 46 || tr(i))
|
|
2427
2422
|
throw R(
|
|
2428
2423
|
e.source,
|
|
2429
2424
|
n,
|
|
@@ -2456,7 +2451,7 @@ function _e(e, t, r) {
|
|
|
2456
2451
|
++n;
|
|
2457
2452
|
return n;
|
|
2458
2453
|
}
|
|
2459
|
-
function
|
|
2454
|
+
function ni(e, t) {
|
|
2460
2455
|
const r = e.source.body, s = r.length;
|
|
2461
2456
|
let n = t + 1, i = n, a = "";
|
|
2462
2457
|
for (; n < s; ) {
|
|
@@ -2465,7 +2460,7 @@ function ri(e, t) {
|
|
|
2465
2460
|
return a += r.slice(i, n), O(e, p.STRING, t, n + 1, a);
|
|
2466
2461
|
if (l === 92) {
|
|
2467
2462
|
a += r.slice(i, n);
|
|
2468
|
-
const o = r.charCodeAt(n + 1) === 117 ? r.charCodeAt(n + 2) === 123 ?
|
|
2463
|
+
const o = r.charCodeAt(n + 1) === 117 ? r.charCodeAt(n + 2) === 123 ? si(e, n) : ii(e, n) : oi(e, n);
|
|
2469
2464
|
a += o.value, n += o.size, i = n;
|
|
2470
2465
|
continue;
|
|
2471
2466
|
}
|
|
@@ -2487,7 +2482,7 @@ function ri(e, t) {
|
|
|
2487
2482
|
}
|
|
2488
2483
|
throw R(e.source, n, "Unterminated string.");
|
|
2489
2484
|
}
|
|
2490
|
-
function
|
|
2485
|
+
function si(e, t) {
|
|
2491
2486
|
const r = e.source.body;
|
|
2492
2487
|
let s = 0, n = 3;
|
|
2493
2488
|
for (; n < 12; ) {
|
|
@@ -2512,16 +2507,16 @@ function ni(e, t) {
|
|
|
2512
2507
|
)}".`
|
|
2513
2508
|
);
|
|
2514
2509
|
}
|
|
2515
|
-
function
|
|
2516
|
-
const r = e.source.body, s =
|
|
2510
|
+
function ii(e, t) {
|
|
2511
|
+
const r = e.source.body, s = ct(r, t + 2);
|
|
2517
2512
|
if (J(s))
|
|
2518
2513
|
return {
|
|
2519
2514
|
value: String.fromCodePoint(s),
|
|
2520
2515
|
size: 6
|
|
2521
2516
|
};
|
|
2522
|
-
if (
|
|
2523
|
-
const n =
|
|
2524
|
-
if (
|
|
2517
|
+
if (rr(s) && r.charCodeAt(t + 6) === 92 && r.charCodeAt(t + 7) === 117) {
|
|
2518
|
+
const n = ct(r, t + 8);
|
|
2519
|
+
if (nr(n))
|
|
2525
2520
|
return {
|
|
2526
2521
|
value: String.fromCodePoint(s, n),
|
|
2527
2522
|
size: 12
|
|
@@ -2533,13 +2528,13 @@ function si(e, t) {
|
|
|
2533
2528
|
`Invalid Unicode escape sequence: "${r.slice(t, t + 6)}".`
|
|
2534
2529
|
);
|
|
2535
2530
|
}
|
|
2536
|
-
function
|
|
2531
|
+
function ct(e, t) {
|
|
2537
2532
|
return re(e.charCodeAt(t)) << 12 | re(e.charCodeAt(t + 1)) << 8 | re(e.charCodeAt(t + 2)) << 4 | re(e.charCodeAt(t + 3));
|
|
2538
2533
|
}
|
|
2539
2534
|
function re(e) {
|
|
2540
2535
|
return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
|
|
2541
2536
|
}
|
|
2542
|
-
function
|
|
2537
|
+
function oi(e, t) {
|
|
2543
2538
|
const r = e.source.body;
|
|
2544
2539
|
switch (r.charCodeAt(t + 1)) {
|
|
2545
2540
|
case 34:
|
|
@@ -2593,7 +2588,7 @@ function ii(e, t) {
|
|
|
2593
2588
|
)}".`
|
|
2594
2589
|
);
|
|
2595
2590
|
}
|
|
2596
|
-
function
|
|
2591
|
+
function ai(e, t) {
|
|
2597
2592
|
const r = e.source.body, s = r.length;
|
|
2598
2593
|
let n = e.lineStart, i = t + 3, a = i, l = "";
|
|
2599
2594
|
const o = [];
|
|
@@ -2607,7 +2602,7 @@ function oi(e, t) {
|
|
|
2607
2602
|
t,
|
|
2608
2603
|
i + 3,
|
|
2609
2604
|
// Return a string of the lines joined with U+000A.
|
|
2610
|
-
|
|
2605
|
+
Js(o).join(`
|
|
2611
2606
|
`)
|
|
2612
2607
|
);
|
|
2613
2608
|
return e.line += o.length - 1, e.lineStart = n, u;
|
|
@@ -2636,12 +2631,12 @@ function oi(e, t) {
|
|
|
2636
2631
|
}
|
|
2637
2632
|
throw R(e.source, i, "Unterminated string.");
|
|
2638
2633
|
}
|
|
2639
|
-
function
|
|
2634
|
+
function ci(e, t) {
|
|
2640
2635
|
const r = e.source.body, s = r.length;
|
|
2641
2636
|
let n = t + 1;
|
|
2642
2637
|
for (; n < s; ) {
|
|
2643
2638
|
const i = r.charCodeAt(n);
|
|
2644
|
-
if (
|
|
2639
|
+
if (Ys(i))
|
|
2645
2640
|
++n;
|
|
2646
2641
|
else
|
|
2647
2642
|
break;
|
|
@@ -2654,8 +2649,8 @@ function ai(e, t) {
|
|
|
2654
2649
|
r.slice(t, n)
|
|
2655
2650
|
);
|
|
2656
2651
|
}
|
|
2657
|
-
const
|
|
2658
|
-
function
|
|
2652
|
+
const li = 10, sr = 2;
|
|
2653
|
+
function ir(e) {
|
|
2659
2654
|
return ye(e, []);
|
|
2660
2655
|
}
|
|
2661
2656
|
function ye(e, t) {
|
|
@@ -2665,45 +2660,45 @@ function ye(e, t) {
|
|
|
2665
2660
|
case "function":
|
|
2666
2661
|
return e.name ? `[function ${e.name}]` : "[function]";
|
|
2667
2662
|
case "object":
|
|
2668
|
-
return
|
|
2663
|
+
return ui(e, t);
|
|
2669
2664
|
default:
|
|
2670
2665
|
return String(e);
|
|
2671
2666
|
}
|
|
2672
2667
|
}
|
|
2673
|
-
function
|
|
2668
|
+
function ui(e, t) {
|
|
2674
2669
|
if (e === null)
|
|
2675
2670
|
return "null";
|
|
2676
2671
|
if (t.includes(e))
|
|
2677
2672
|
return "[Circular]";
|
|
2678
2673
|
const r = [...t, e];
|
|
2679
|
-
if (
|
|
2674
|
+
if (hi(e)) {
|
|
2680
2675
|
const s = e.toJSON();
|
|
2681
2676
|
if (s !== e)
|
|
2682
2677
|
return typeof s == "string" ? s : ye(s, r);
|
|
2683
2678
|
} else if (Array.isArray(e))
|
|
2684
|
-
return
|
|
2685
|
-
return
|
|
2679
|
+
return pi(e, r);
|
|
2680
|
+
return di(e, r);
|
|
2686
2681
|
}
|
|
2687
|
-
function
|
|
2682
|
+
function hi(e) {
|
|
2688
2683
|
return typeof e.toJSON == "function";
|
|
2689
2684
|
}
|
|
2690
|
-
function
|
|
2685
|
+
function di(e, t) {
|
|
2691
2686
|
const r = Object.entries(e);
|
|
2692
|
-
return r.length === 0 ? "{}" : t.length >
|
|
2687
|
+
return r.length === 0 ? "{}" : t.length > sr ? "[" + fi(e) + "]" : "{ " + r.map(
|
|
2693
2688
|
([n, i]) => n + ": " + ye(i, t)
|
|
2694
2689
|
).join(", ") + " }";
|
|
2695
2690
|
}
|
|
2696
|
-
function
|
|
2691
|
+
function pi(e, t) {
|
|
2697
2692
|
if (e.length === 0)
|
|
2698
2693
|
return "[]";
|
|
2699
|
-
if (t.length >
|
|
2694
|
+
if (t.length > sr)
|
|
2700
2695
|
return "[Array]";
|
|
2701
|
-
const r = Math.min(
|
|
2696
|
+
const r = Math.min(li, e.length), s = e.length - r, n = [];
|
|
2702
2697
|
for (let i = 0; i < r; ++i)
|
|
2703
2698
|
n.push(ye(e[i], t));
|
|
2704
2699
|
return s === 1 ? n.push("... 1 more item") : s > 1 && n.push(`... ${s} more items`), "[" + n.join(", ") + "]";
|
|
2705
2700
|
}
|
|
2706
|
-
function
|
|
2701
|
+
function fi(e) {
|
|
2707
2702
|
const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
|
|
2708
2703
|
if (t === "Object" && typeof e.constructor == "function") {
|
|
2709
2704
|
const r = e.constructor.name;
|
|
@@ -2712,11 +2707,11 @@ function pi(e) {
|
|
|
2712
2707
|
}
|
|
2713
2708
|
return t;
|
|
2714
2709
|
}
|
|
2715
|
-
const
|
|
2716
|
-
process.env.NODE_ENV === "production",
|
|
2710
|
+
const mi = globalThis.process && // eslint-disable-next-line no-undef
|
|
2711
|
+
process.env.NODE_ENV === "production", yi = (
|
|
2717
2712
|
/* c8 ignore next 6 */
|
|
2718
2713
|
// FIXME: https://github.com/graphql/graphql-js/issues/2317
|
|
2719
|
-
|
|
2714
|
+
mi ? function(t, r) {
|
|
2720
2715
|
return t instanceof r;
|
|
2721
2716
|
} : function(t, r) {
|
|
2722
2717
|
if (t instanceof r)
|
|
@@ -2728,7 +2723,7 @@ process.env.NODE_ENV === "production", mi = (
|
|
|
2728
2723
|
Symbol.toStringTag in t ? t[Symbol.toStringTag] : (s = t.constructor) === null || s === void 0 ? void 0 : s.name
|
|
2729
2724
|
);
|
|
2730
2725
|
if (n === i) {
|
|
2731
|
-
const a =
|
|
2726
|
+
const a = ir(t);
|
|
2732
2727
|
throw new Error(`Cannot use ${n} "${a}" from another module or realm.
|
|
2733
2728
|
|
|
2734
2729
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
@@ -2746,12 +2741,12 @@ spurious results.`);
|
|
|
2746
2741
|
return !1;
|
|
2747
2742
|
}
|
|
2748
2743
|
);
|
|
2749
|
-
class
|
|
2744
|
+
class or {
|
|
2750
2745
|
constructor(t, r = "GraphQL request", s = {
|
|
2751
2746
|
line: 1,
|
|
2752
2747
|
column: 1
|
|
2753
2748
|
}) {
|
|
2754
|
-
typeof t == "string" || be(!1, `Body must be a string. Received: ${
|
|
2749
|
+
typeof t == "string" || be(!1, `Body must be a string. Received: ${ir(t)}.`), this.body = t, this.name = r, this.locationOffset = s, this.locationOffset.line > 0 || be(
|
|
2755
2750
|
!1,
|
|
2756
2751
|
"line in locationOffset is 1-indexed and must be positive."
|
|
2757
2752
|
), this.locationOffset.column > 0 || be(
|
|
@@ -2763,16 +2758,16 @@ class ir {
|
|
|
2763
2758
|
return "Source";
|
|
2764
2759
|
}
|
|
2765
2760
|
}
|
|
2766
|
-
function
|
|
2767
|
-
return
|
|
2761
|
+
function gi(e) {
|
|
2762
|
+
return yi(e, or);
|
|
2768
2763
|
}
|
|
2769
|
-
function
|
|
2770
|
-
return new
|
|
2764
|
+
function vi(e, t) {
|
|
2765
|
+
return new Ei(e, t).parseDocument();
|
|
2771
2766
|
}
|
|
2772
|
-
class
|
|
2767
|
+
class Ei {
|
|
2773
2768
|
constructor(t, r = {}) {
|
|
2774
|
-
const s =
|
|
2775
|
-
this._lexer = new
|
|
2769
|
+
const s = gi(t) ? t : new or(t);
|
|
2770
|
+
this._lexer = new Ks(s), this._options = r, this._tokenCounter = 0;
|
|
2776
2771
|
}
|
|
2777
2772
|
/**
|
|
2778
2773
|
* Converts a name lex token into a name parse node.
|
|
@@ -3739,7 +3734,7 @@ class vi {
|
|
|
3739
3734
|
* given parsed object.
|
|
3740
3735
|
*/
|
|
3741
3736
|
node(t, r) {
|
|
3742
|
-
return this._options.noLocation !== !0 && (r.loc = new
|
|
3737
|
+
return this._options.noLocation !== !0 && (r.loc = new Hs(
|
|
3743
3738
|
t,
|
|
3744
3739
|
this._lexer.lastToken,
|
|
3745
3740
|
this._lexer.source
|
|
@@ -3762,7 +3757,7 @@ class vi {
|
|
|
3762
3757
|
throw R(
|
|
3763
3758
|
this._lexer.source,
|
|
3764
3759
|
r.start,
|
|
3765
|
-
`Expected ${
|
|
3760
|
+
`Expected ${ar(t)}, found ${ce(r)}.`
|
|
3766
3761
|
);
|
|
3767
3762
|
}
|
|
3768
3763
|
/**
|
|
@@ -3872,10 +3867,10 @@ class vi {
|
|
|
3872
3867
|
}
|
|
3873
3868
|
function ce(e) {
|
|
3874
3869
|
const t = e.value;
|
|
3875
|
-
return
|
|
3870
|
+
return ar(e.kind) + (t != null ? ` "${t}"` : "");
|
|
3876
3871
|
}
|
|
3877
|
-
function
|
|
3878
|
-
return
|
|
3872
|
+
function ar(e) {
|
|
3873
|
+
return Zs(e) ? `"${e}"` : e;
|
|
3879
3874
|
}
|
|
3880
3875
|
function xe(e) {
|
|
3881
3876
|
try {
|
|
@@ -3884,21 +3879,21 @@ function xe(e) {
|
|
|
3884
3879
|
return;
|
|
3885
3880
|
}
|
|
3886
3881
|
}
|
|
3887
|
-
var
|
|
3888
|
-
return t || (0, e[
|
|
3889
|
-
},
|
|
3882
|
+
var wi = Object.create, cr = Object.defineProperty, bi = Object.getOwnPropertyDescriptor, lr = Object.getOwnPropertyNames, _i = Object.getPrototypeOf, xi = Object.prototype.hasOwnProperty, Ti = (e, t) => function() {
|
|
3883
|
+
return t || (0, e[lr(e)[0]])((t = { exports: {} }).exports, t), t.exports;
|
|
3884
|
+
}, Oi = (e, t, r, s) => {
|
|
3890
3885
|
if (t && typeof t == "object" || typeof t == "function")
|
|
3891
|
-
for (let n of
|
|
3892
|
-
!
|
|
3886
|
+
for (let n of lr(t))
|
|
3887
|
+
!xi.call(e, n) && n !== r && cr(e, n, { get: () => t[n], enumerable: !(s = bi(t, n)) || s.enumerable });
|
|
3893
3888
|
return e;
|
|
3894
|
-
},
|
|
3889
|
+
}, Ai = (e, t, r) => (r = e != null ? wi(_i(e)) : {}, Oi(
|
|
3895
3890
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
3896
3891
|
// file that has been converted to a CommonJS file using a Babel-
|
|
3897
3892
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
3898
3893
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
3899
|
-
!e || !e.__esModule ?
|
|
3894
|
+
!e || !e.__esModule ? cr(r, "default", { value: e, enumerable: !0 }) : r,
|
|
3900
3895
|
e
|
|
3901
|
-
)),
|
|
3896
|
+
)), Ri = Ti({
|
|
3902
3897
|
"node_modules/set-cookie-parser/lib/set-cookie.js"(e, t) {
|
|
3903
3898
|
var r = {
|
|
3904
3899
|
decodeValues: !0,
|
|
@@ -3987,36 +3982,36 @@ var Ei = Object.create, ar = Object.defineProperty, wi = Object.getOwnPropertyDe
|
|
|
3987
3982
|
}
|
|
3988
3983
|
t.exports = a, t.exports.parse = a, t.exports.parseString = n, t.exports.splitCookiesString = l;
|
|
3989
3984
|
}
|
|
3990
|
-
}),
|
|
3985
|
+
}), Ii = Ai(Ri()), Ni = /[^a-z0-9\-#$%&'*+.^_`|~]/i;
|
|
3991
3986
|
function ee(e) {
|
|
3992
|
-
if (
|
|
3987
|
+
if (Ni.test(e) || e.trim() === "")
|
|
3993
3988
|
throw new TypeError("Invalid character in header field name");
|
|
3994
3989
|
return e.trim().toLowerCase();
|
|
3995
3990
|
}
|
|
3996
|
-
var
|
|
3991
|
+
var lt = [
|
|
3997
3992
|
`
|
|
3998
3993
|
`,
|
|
3999
3994
|
"\r",
|
|
4000
3995
|
" ",
|
|
4001
3996
|
" "
|
|
4002
|
-
],
|
|
4003
|
-
`(^[${
|
|
3997
|
+
], ki = new RegExp(
|
|
3998
|
+
`(^[${lt.join("")}]|$[${lt.join("")}])`,
|
|
4004
3999
|
"g"
|
|
4005
4000
|
);
|
|
4006
4001
|
function Te(e) {
|
|
4007
|
-
return e.replace(
|
|
4002
|
+
return e.replace(ki, "");
|
|
4008
4003
|
}
|
|
4009
4004
|
function te(e) {
|
|
4010
4005
|
if (typeof e != "string" || e.length === 0)
|
|
4011
4006
|
return !1;
|
|
4012
4007
|
for (let t = 0; t < e.length; t++) {
|
|
4013
4008
|
const r = e.charCodeAt(t);
|
|
4014
|
-
if (r > 127 || !
|
|
4009
|
+
if (r > 127 || !Pi(r))
|
|
4015
4010
|
return !1;
|
|
4016
4011
|
}
|
|
4017
4012
|
return !0;
|
|
4018
4013
|
}
|
|
4019
|
-
function
|
|
4014
|
+
function Pi(e) {
|
|
4020
4015
|
return ![
|
|
4021
4016
|
127,
|
|
4022
4017
|
32,
|
|
@@ -4039,7 +4034,7 @@ function ki(e) {
|
|
|
4039
4034
|
"}"
|
|
4040
4035
|
].includes(e);
|
|
4041
4036
|
}
|
|
4042
|
-
function
|
|
4037
|
+
function ut(e) {
|
|
4043
4038
|
if (typeof e != "string" || e.trim() !== e)
|
|
4044
4039
|
return !1;
|
|
4045
4040
|
for (let t = 0; t < e.length; t++) {
|
|
@@ -4053,24 +4048,24 @@ function lt(e) {
|
|
|
4053
4048
|
}
|
|
4054
4049
|
return !0;
|
|
4055
4050
|
}
|
|
4056
|
-
var V = Symbol("normalizedHeaders"), Oe = Symbol("rawHeaderNames"),
|
|
4051
|
+
var V = Symbol("normalizedHeaders"), Oe = Symbol("rawHeaderNames"), ht = ", ", dt, pt, ft, Li = class ur {
|
|
4057
4052
|
constructor(t) {
|
|
4058
|
-
this[
|
|
4053
|
+
this[dt] = {}, this[pt] = /* @__PURE__ */ new Map(), this[ft] = "Headers", ["Headers", "HeadersPolyfill"].includes(t == null ? void 0 : t.constructor.name) || t instanceof ur || typeof globalThis.Headers < "u" && t instanceof globalThis.Headers ? t.forEach((s, n) => {
|
|
4059
4054
|
this.append(n, s);
|
|
4060
4055
|
}, this) : Array.isArray(t) ? t.forEach(([r, s]) => {
|
|
4061
4056
|
this.append(
|
|
4062
4057
|
r,
|
|
4063
|
-
Array.isArray(s) ? s.join(
|
|
4058
|
+
Array.isArray(s) ? s.join(ht) : s
|
|
4064
4059
|
);
|
|
4065
4060
|
}) : t && Object.getOwnPropertyNames(t).forEach((r) => {
|
|
4066
4061
|
const s = t[r];
|
|
4067
4062
|
this.append(
|
|
4068
4063
|
r,
|
|
4069
|
-
Array.isArray(s) ? s.join(
|
|
4064
|
+
Array.isArray(s) ? s.join(ht) : s
|
|
4070
4065
|
);
|
|
4071
4066
|
});
|
|
4072
4067
|
}
|
|
4073
|
-
[(
|
|
4068
|
+
[(dt = V, pt = Oe, ft = Symbol.toStringTag, Symbol.iterator)]() {
|
|
4074
4069
|
return this.entries();
|
|
4075
4070
|
}
|
|
4076
4071
|
*keys() {
|
|
@@ -4112,7 +4107,7 @@ var V = Symbol("normalizedHeaders"), Oe = Symbol("rawHeaderNames"), ut = ", ", h
|
|
|
4112
4107
|
* Sets a new value for an existing header inside a `Headers` object, or adds the header if it does not already exist.
|
|
4113
4108
|
*/
|
|
4114
4109
|
set(t, r) {
|
|
4115
|
-
if (!te(t) || !
|
|
4110
|
+
if (!te(t) || !ut(r))
|
|
4116
4111
|
return;
|
|
4117
4112
|
const s = ee(t), n = Te(r);
|
|
4118
4113
|
this[V][s] = Te(n), this[Oe].set(s, t);
|
|
@@ -4121,7 +4116,7 @@ var V = Symbol("normalizedHeaders"), Oe = Symbol("rawHeaderNames"), ut = ", ", h
|
|
|
4121
4116
|
* Appends a new value onto an existing header inside a `Headers` object, or adds the header if it does not already exist.
|
|
4122
4117
|
*/
|
|
4123
4118
|
append(t, r) {
|
|
4124
|
-
if (!te(t) || !
|
|
4119
|
+
if (!te(t) || !ut(r))
|
|
4125
4120
|
return;
|
|
4126
4121
|
const s = ee(t), n = Te(r);
|
|
4127
4122
|
let i = this.has(s) ? `${this.get(s)}, ${n}` : n;
|
|
@@ -4151,20 +4146,20 @@ var V = Symbol("normalizedHeaders"), Oe = Symbol("rawHeaderNames"), ut = ", ", h
|
|
|
4151
4146
|
*/
|
|
4152
4147
|
getSetCookie() {
|
|
4153
4148
|
const t = this.get("set-cookie");
|
|
4154
|
-
return t === null ? [] : t === "" ? [""] : (0,
|
|
4149
|
+
return t === null ? [] : t === "" ? [""] : (0, Ii.splitCookiesString)(t);
|
|
4155
4150
|
}
|
|
4156
4151
|
};
|
|
4157
|
-
function
|
|
4152
|
+
function Si(e) {
|
|
4158
4153
|
return e.trim().split(/[\r\n]+/).reduce((r, s) => {
|
|
4159
4154
|
if (s.trim() === "")
|
|
4160
4155
|
return r;
|
|
4161
4156
|
const n = s.split(": "), i = n.shift(), a = n.join(": ");
|
|
4162
4157
|
return r.append(i, a), r;
|
|
4163
|
-
}, new
|
|
4158
|
+
}, new Li());
|
|
4164
4159
|
}
|
|
4165
|
-
function
|
|
4160
|
+
function Di(e) {
|
|
4166
4161
|
var t, r;
|
|
4167
|
-
const s =
|
|
4162
|
+
const s = Si(e), n = s.get("content-type") || "text/plain", i = s.get("content-disposition");
|
|
4168
4163
|
if (!i)
|
|
4169
4164
|
throw new Error('"Content-Disposition" header is required.');
|
|
4170
4165
|
const a = i.split(";").reduce((c, u) => {
|
|
@@ -4177,7 +4172,7 @@ function Si(e) {
|
|
|
4177
4172
|
contentType: n
|
|
4178
4173
|
};
|
|
4179
4174
|
}
|
|
4180
|
-
function
|
|
4175
|
+
function Ci(e, t) {
|
|
4181
4176
|
const r = t == null ? void 0 : t.get("content-type");
|
|
4182
4177
|
if (!r)
|
|
4183
4178
|
return;
|
|
@@ -4196,7 +4191,7 @@ function Di(e, t) {
|
|
|
4196
4191
|
\r
|
|
4197
4192
|
`), h = u.join(`\r
|
|
4198
4193
|
\r
|
|
4199
|
-
`), { contentType: d, filename: m, name: f } =
|
|
4194
|
+
`), { contentType: d, filename: m, name: f } = Di(c), y = m === void 0 ? h : new File([h], m, { type: d }), v = l[f];
|
|
4200
4195
|
v === void 0 ? l[f] = y : Array.isArray(v) ? l[f] = [...v, y] : l[f] = [v, y];
|
|
4201
4196
|
}
|
|
4202
4197
|
return l;
|
|
@@ -4204,15 +4199,15 @@ function Di(e, t) {
|
|
|
4204
4199
|
return;
|
|
4205
4200
|
}
|
|
4206
4201
|
}
|
|
4207
|
-
var
|
|
4202
|
+
var mt = Object.getOwnPropertySymbols, qi = Object.prototype.hasOwnProperty, Mi = Object.prototype.propertyIsEnumerable, $i = (e, t) => {
|
|
4208
4203
|
var r = {};
|
|
4209
4204
|
for (var s in e)
|
|
4210
|
-
|
|
4211
|
-
if (e != null &&
|
|
4212
|
-
for (var s of
|
|
4213
|
-
t.indexOf(s) < 0 &&
|
|
4205
|
+
qi.call(e, s) && t.indexOf(s) < 0 && (r[s] = e[s]);
|
|
4206
|
+
if (e != null && mt)
|
|
4207
|
+
for (var s of mt(e))
|
|
4208
|
+
t.indexOf(s) < 0 && Mi.call(e, s) && (r[s] = e[s]);
|
|
4214
4209
|
return r;
|
|
4215
|
-
},
|
|
4210
|
+
}, hr = (e, t, r) => new Promise((s, n) => {
|
|
4216
4211
|
var i = (o) => {
|
|
4217
4212
|
try {
|
|
4218
4213
|
l(r.next(o));
|
|
@@ -4228,7 +4223,7 @@ var ft = Object.getOwnPropertySymbols, Ci = Object.prototype.hasOwnProperty, qi
|
|
|
4228
4223
|
}, l = (o) => o.done ? s(o.value) : Promise.resolve(o.value).then(i, a);
|
|
4229
4224
|
l((r = r.apply(e, t)).next());
|
|
4230
4225
|
});
|
|
4231
|
-
function
|
|
4226
|
+
function dr(e) {
|
|
4232
4227
|
var t;
|
|
4233
4228
|
const r = e.definitions.find((s) => s.kind === "OperationDefinition");
|
|
4234
4229
|
return {
|
|
@@ -4236,15 +4231,15 @@ function hr(e) {
|
|
|
4236
4231
|
operationName: (t = r == null ? void 0 : r.name) == null ? void 0 : t.value
|
|
4237
4232
|
};
|
|
4238
4233
|
}
|
|
4239
|
-
function
|
|
4234
|
+
function Ui(e) {
|
|
4240
4235
|
try {
|
|
4241
|
-
const t =
|
|
4242
|
-
return
|
|
4236
|
+
const t = vi(e);
|
|
4237
|
+
return dr(t);
|
|
4243
4238
|
} catch (t) {
|
|
4244
4239
|
return t;
|
|
4245
4240
|
}
|
|
4246
4241
|
}
|
|
4247
|
-
function
|
|
4242
|
+
function ji(e, t, r) {
|
|
4248
4243
|
const s = { variables: e };
|
|
4249
4244
|
for (const [n, i] of Object.entries(t)) {
|
|
4250
4245
|
if (!(n in r))
|
|
@@ -4262,8 +4257,8 @@ function Ui(e, t, r) {
|
|
|
4262
4257
|
}
|
|
4263
4258
|
return s.variables;
|
|
4264
4259
|
}
|
|
4265
|
-
function
|
|
4266
|
-
return
|
|
4260
|
+
function Fi(e) {
|
|
4261
|
+
return hr(this, null, function* () {
|
|
4267
4262
|
var t;
|
|
4268
4263
|
switch (e.method) {
|
|
4269
4264
|
case "GET": {
|
|
@@ -4276,18 +4271,18 @@ function ji(e) {
|
|
|
4276
4271
|
case "POST": {
|
|
4277
4272
|
const r = e.clone();
|
|
4278
4273
|
if ((t = e.headers.get("content-type")) != null && t.includes("multipart/form-data")) {
|
|
4279
|
-
const n =
|
|
4274
|
+
const n = Ci(
|
|
4280
4275
|
yield r.text(),
|
|
4281
4276
|
e.headers
|
|
4282
4277
|
);
|
|
4283
4278
|
if (!n)
|
|
4284
4279
|
return null;
|
|
4285
|
-
const i = n, { operations: a, map: l } = i, o =
|
|
4280
|
+
const i = n, { operations: a, map: l } = i, o = $i(i, ["operations", "map"]), c = xe(
|
|
4286
4281
|
a
|
|
4287
4282
|
) || {};
|
|
4288
4283
|
if (!c.query)
|
|
4289
4284
|
return null;
|
|
4290
|
-
const u = xe(l || "") || {}, h = c.variables ?
|
|
4285
|
+
const u = xe(l || "") || {}, h = c.variables ? ji(
|
|
4291
4286
|
c.variables,
|
|
4292
4287
|
u,
|
|
4293
4288
|
o
|
|
@@ -4311,12 +4306,12 @@ function ji(e) {
|
|
|
4311
4306
|
}
|
|
4312
4307
|
});
|
|
4313
4308
|
}
|
|
4314
|
-
function
|
|
4315
|
-
return
|
|
4316
|
-
const t = yield
|
|
4309
|
+
function pr(e) {
|
|
4310
|
+
return hr(this, null, function* () {
|
|
4311
|
+
const t = yield Fi(e);
|
|
4317
4312
|
if (!t || !t.query)
|
|
4318
4313
|
return;
|
|
4319
|
-
const { query: r, variables: s } = t, n =
|
|
4314
|
+
const { query: r, variables: s } = t, n = Ui(r);
|
|
4320
4315
|
if (n instanceof Error) {
|
|
4321
4316
|
const i = se(e);
|
|
4322
4317
|
throw new Error(
|
|
@@ -4338,7 +4333,7 @@ function dr(e) {
|
|
|
4338
4333
|
};
|
|
4339
4334
|
});
|
|
4340
4335
|
}
|
|
4341
|
-
var
|
|
4336
|
+
var yt = (e, t, r) => new Promise((s, n) => {
|
|
4342
4337
|
var i = (o) => {
|
|
4343
4338
|
try {
|
|
4344
4339
|
l(r.next(o));
|
|
@@ -4354,14 +4349,14 @@ var mt = (e, t, r) => new Promise((s, n) => {
|
|
|
4354
4349
|
}, l = (o) => o.done ? s(o.value) : Promise.resolve(o.value).then(i, a);
|
|
4355
4350
|
l((r = r.apply(e, t)).next());
|
|
4356
4351
|
});
|
|
4357
|
-
function
|
|
4352
|
+
function Bi(e) {
|
|
4358
4353
|
return e == null ? !1 : typeof e == "object" && "kind" in e && "definitions" in e;
|
|
4359
4354
|
}
|
|
4360
|
-
class
|
|
4355
|
+
class Vi extends St {
|
|
4361
4356
|
constructor(t, r, s, n, i) {
|
|
4362
4357
|
let a = r;
|
|
4363
|
-
if (
|
|
4364
|
-
const o =
|
|
4358
|
+
if (Bi(r)) {
|
|
4359
|
+
const o = dr(r);
|
|
4365
4360
|
if (o.operationType !== t)
|
|
4366
4361
|
throw new Error(
|
|
4367
4362
|
`Failed to create a GraphQL handler: provided a DocumentNode with a mismatched operation type (expected "${t}", but got "${o.operationType}").`
|
|
@@ -4384,8 +4379,8 @@ class Bi extends Lt {
|
|
|
4384
4379
|
}), this.endpoint = s;
|
|
4385
4380
|
}
|
|
4386
4381
|
parse(t) {
|
|
4387
|
-
return
|
|
4388
|
-
return
|
|
4382
|
+
return yt(this, null, function* () {
|
|
4383
|
+
return pr(t.request).catch((r) => {
|
|
4389
4384
|
console.error(r);
|
|
4390
4385
|
});
|
|
4391
4386
|
});
|
|
@@ -4399,7 +4394,7 @@ class Bi extends Lt {
|
|
|
4399
4394
|
|
|
4400
4395
|
Consider naming this operation or using "graphql.operation()" request handler to intercept GraphQL requests regardless of their operation name/type. Read more: https://mswjs.io/docs/api/graphql/operation`), !1;
|
|
4401
4396
|
}
|
|
4402
|
-
const r =
|
|
4397
|
+
const r = Ht(
|
|
4403
4398
|
new URL(t.request.url),
|
|
4404
4399
|
this.endpoint
|
|
4405
4400
|
), s = this.info.operationType === "all" || t.parsedResult.operationType === this.info.operationType, n = this.info.operationName instanceof RegExp ? this.info.operationName.test(t.parsedResult.operationName || "") : t.parsedResult.operationName === this.info.operationName;
|
|
@@ -4414,12 +4409,12 @@ Consider naming this operation or using "graphql.operation()" request handler to
|
|
|
4414
4409
|
};
|
|
4415
4410
|
}
|
|
4416
4411
|
log(t) {
|
|
4417
|
-
return
|
|
4412
|
+
return yt(this, null, function* () {
|
|
4418
4413
|
var r, s, n, i;
|
|
4419
|
-
const a = yield
|
|
4414
|
+
const a = yield Mt(t.request), l = yield Ft(t.response), o = Ct(l.status), c = (r = t.parsedResult) != null && r.operationName ? `${(s = t.parsedResult) == null ? void 0 : s.operationType} ${(n = t.parsedResult) == null ? void 0 : n.operationName}` : `anonymous ${(i = t.parsedResult) == null ? void 0 : i.operationType}`;
|
|
4420
4415
|
console.groupCollapsed(
|
|
4421
4416
|
T.formatMessage("%s %s (%c%s%c)"),
|
|
4422
|
-
|
|
4417
|
+
qt(),
|
|
4423
4418
|
`${c}`,
|
|
4424
4419
|
`color:${o}`,
|
|
4425
4420
|
`${l.status} ${l.statusText}`,
|
|
@@ -4428,8 +4423,8 @@ Consider naming this operation or using "graphql.operation()" request handler to
|
|
|
4428
4423
|
});
|
|
4429
4424
|
}
|
|
4430
4425
|
}
|
|
4431
|
-
|
|
4432
|
-
var
|
|
4426
|
+
ln();
|
|
4427
|
+
var Wi = (e, t, r) => new Promise((s, n) => {
|
|
4433
4428
|
var i = (o) => {
|
|
4434
4429
|
try {
|
|
4435
4430
|
l(r.next(o));
|
|
@@ -4445,60 +4440,60 @@ var Vi = (e, t, r) => new Promise((s, n) => {
|
|
|
4445
4440
|
}, l = (o) => o.done ? s(o.value) : Promise.resolve(o.value).then(i, a);
|
|
4446
4441
|
l((r = r.apply(e, t)).next());
|
|
4447
4442
|
});
|
|
4448
|
-
const
|
|
4449
|
-
function
|
|
4443
|
+
const fr = cn, Gi = 3, Hi = 4, mr = 0.5;
|
|
4444
|
+
function Xi(e) {
|
|
4450
4445
|
return e.reduce(
|
|
4451
|
-
(t, r) => (r instanceof
|
|
4446
|
+
(t, r) => (r instanceof js && t.http.push(r), r instanceof Vi && t.graphql.push(r), t),
|
|
4452
4447
|
{
|
|
4453
4448
|
http: [],
|
|
4454
4449
|
graphql: []
|
|
4455
4450
|
}
|
|
4456
4451
|
);
|
|
4457
4452
|
}
|
|
4458
|
-
function
|
|
4453
|
+
function zi() {
|
|
4459
4454
|
return (e, t) => {
|
|
4460
4455
|
const { path: r, method: s } = t.info;
|
|
4461
4456
|
if (r instanceof RegExp || s instanceof RegExp)
|
|
4462
4457
|
return 1 / 0;
|
|
4463
|
-
const i =
|
|
4464
|
-
return
|
|
4458
|
+
const i = Dt(e.method, s) ? mr : 0, a = se(e);
|
|
4459
|
+
return fr(a, r) - i;
|
|
4465
4460
|
};
|
|
4466
4461
|
}
|
|
4467
|
-
function
|
|
4462
|
+
function Yi(e) {
|
|
4468
4463
|
return (t, r) => {
|
|
4469
4464
|
if (typeof e.operationName > "u")
|
|
4470
4465
|
return 1 / 0;
|
|
4471
4466
|
const { operationType: s, operationName: n } = r.info;
|
|
4472
4467
|
if (typeof n != "string")
|
|
4473
4468
|
return 1 / 0;
|
|
4474
|
-
const a = e.operationType === s ?
|
|
4475
|
-
return
|
|
4469
|
+
const a = e.operationType === s ? mr : 0;
|
|
4470
|
+
return fr(e.operationName, n) - a;
|
|
4476
4471
|
};
|
|
4477
4472
|
}
|
|
4478
|
-
function
|
|
4473
|
+
function Ji(e, t, r) {
|
|
4479
4474
|
return t.reduce((n, i) => {
|
|
4480
4475
|
const a = r(e, i);
|
|
4481
4476
|
return n.concat([[a, i]]);
|
|
4482
|
-
}, []).sort(([n], [i]) => n - i).filter(([n]) => n <=
|
|
4477
|
+
}, []).sort(([n], [i]) => n - i).filter(([n]) => n <= Gi).slice(0, Hi).map(([, n]) => n);
|
|
4483
4478
|
}
|
|
4484
|
-
function
|
|
4479
|
+
function Qi(e) {
|
|
4485
4480
|
return e.length > 1 ? `Did you mean to request one of the following resources instead?
|
|
4486
4481
|
|
|
4487
4482
|
${e.map((t) => ` • ${t.info.header}`).join(`
|
|
4488
4483
|
`)}` : `Did you mean to request "${e[0].info.header}" instead?`;
|
|
4489
4484
|
}
|
|
4490
|
-
function
|
|
4491
|
-
return
|
|
4492
|
-
const s = yield
|
|
4485
|
+
function Ki(e, t, r = "warn") {
|
|
4486
|
+
return Wi(this, null, function* () {
|
|
4487
|
+
const s = yield pr(e).catch(
|
|
4493
4488
|
() => null
|
|
4494
4489
|
), n = se(e);
|
|
4495
4490
|
function i() {
|
|
4496
|
-
const c =
|
|
4491
|
+
const c = Xi(t), u = s ? c.graphql : c.http, h = Ji(
|
|
4497
4492
|
e,
|
|
4498
4493
|
u,
|
|
4499
|
-
s ?
|
|
4494
|
+
s ? Yi(s) : zi()
|
|
4500
4495
|
);
|
|
4501
|
-
return h.length > 0 ?
|
|
4496
|
+
return h.length > 0 ? Qi(h) : "";
|
|
4502
4497
|
}
|
|
4503
4498
|
function a(c) {
|
|
4504
4499
|
return c != null && c.operationName ? `${c.operationType} ${c.operationName} (${e.method} ${n})` : `anonymous ${c == null ? void 0 : c.operationType} (${e.method} ${n})`;
|
|
@@ -4549,18 +4544,18 @@ Read more: https://mswjs.io/docs/getting-started/mocks`
|
|
|
4549
4544
|
o(r);
|
|
4550
4545
|
});
|
|
4551
4546
|
}
|
|
4552
|
-
var
|
|
4547
|
+
var Zi = Object.defineProperty, eo = Object.defineProperties, to = Object.getOwnPropertyDescriptors, gt = Object.getOwnPropertySymbols, ro = Object.prototype.hasOwnProperty, no = Object.prototype.propertyIsEnumerable, vt = (e, t, r) => t in e ? Zi(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, so = (e, t) => {
|
|
4553
4548
|
for (var r in t || (t = {}))
|
|
4554
|
-
|
|
4555
|
-
if (
|
|
4556
|
-
for (var r of
|
|
4557
|
-
|
|
4549
|
+
ro.call(t, r) && vt(e, r, t[r]);
|
|
4550
|
+
if (gt)
|
|
4551
|
+
for (var r of gt(t))
|
|
4552
|
+
no.call(t, r) && vt(e, r, t[r]);
|
|
4558
4553
|
return e;
|
|
4559
|
-
},
|
|
4560
|
-
function
|
|
4561
|
-
pe.add(so(
|
|
4554
|
+
}, io = (e, t) => eo(e, to(t));
|
|
4555
|
+
function oo(e, t) {
|
|
4556
|
+
pe.add(io(so({}, e), { url: e.url.toString() }), t), pe.persist();
|
|
4562
4557
|
}
|
|
4563
|
-
var
|
|
4558
|
+
var ao = (e, t, r) => new Promise((s, n) => {
|
|
4564
4559
|
var i = (o) => {
|
|
4565
4560
|
try {
|
|
4566
4561
|
l(r.next(o));
|
|
@@ -4576,14 +4571,14 @@ var oo = (e, t, r) => new Promise((s, n) => {
|
|
|
4576
4571
|
}, l = (o) => o.done ? s(o.value) : Promise.resolve(o.value).then(i, a);
|
|
4577
4572
|
l((r = r.apply(e, t)).next());
|
|
4578
4573
|
});
|
|
4579
|
-
function
|
|
4580
|
-
return
|
|
4574
|
+
function yr(e, t, r, s, n, i) {
|
|
4575
|
+
return ao(this, null, function* () {
|
|
4581
4576
|
var a, l, o, c, u, h;
|
|
4582
4577
|
if (n.emit("request:start", { request: e, requestId: t }), e.headers.get("x-msw-intention") === "bypass") {
|
|
4583
4578
|
n.emit("request:end", { request: e, requestId: t }), (a = i == null ? void 0 : i.onPassthroughResponse) == null || a.call(i, e);
|
|
4584
4579
|
return;
|
|
4585
4580
|
}
|
|
4586
|
-
const d = yield U(() =>
|
|
4581
|
+
const d = yield U(() => Qr(
|
|
4587
4582
|
e,
|
|
4588
4583
|
r,
|
|
4589
4584
|
i == null ? void 0 : i.resolutionContext
|
|
@@ -4595,7 +4590,7 @@ function mr(e, t, r, s, n, i) {
|
|
|
4595
4590
|
requestId: t
|
|
4596
4591
|
}), d.error;
|
|
4597
4592
|
if (!d.data) {
|
|
4598
|
-
yield
|
|
4593
|
+
yield Ki(e, r, s.onUnhandledRequest), n.emit("request:unhandled", { request: e, requestId: t }), n.emit("request:end", { request: e, requestId: t }), (l = i == null ? void 0 : i.onPassthroughResponse) == null || l.call(i, e);
|
|
4599
4594
|
return;
|
|
4600
4595
|
}
|
|
4601
4596
|
const { response: m } = d.data;
|
|
@@ -4607,7 +4602,7 @@ function mr(e, t, r, s, n, i) {
|
|
|
4607
4602
|
n.emit("request:end", { request: e, requestId: t }), (c = i == null ? void 0 : i.onPassthroughResponse) == null || c.call(i, e);
|
|
4608
4603
|
return;
|
|
4609
4604
|
}
|
|
4610
|
-
|
|
4605
|
+
oo(e, m), n.emit("request:match", { request: e, requestId: t });
|
|
4611
4606
|
const f = d.data, y = ((u = i == null ? void 0 : i.transformResponse) == null ? void 0 : u.call(i, m)) || m;
|
|
4612
4607
|
return (h = i == null ? void 0 : i.onMockedResponse) == null || h.call(
|
|
4613
4608
|
i,
|
|
@@ -4616,23 +4611,23 @@ function mr(e, t, r, s, n, i) {
|
|
|
4616
4611
|
), n.emit("request:end", { request: e, requestId: t }), y;
|
|
4617
4612
|
});
|
|
4618
4613
|
}
|
|
4619
|
-
function
|
|
4614
|
+
function co(e) {
|
|
4620
4615
|
return {
|
|
4621
4616
|
status: e.status,
|
|
4622
4617
|
statusText: e.statusText,
|
|
4623
4618
|
headers: Object.fromEntries(e.headers.entries())
|
|
4624
4619
|
};
|
|
4625
4620
|
}
|
|
4626
|
-
function
|
|
4621
|
+
function Et(e) {
|
|
4627
4622
|
return e != null && typeof e == "object" && !Array.isArray(e);
|
|
4628
4623
|
}
|
|
4629
|
-
function
|
|
4624
|
+
function gr(e, t) {
|
|
4630
4625
|
return Object.entries(t).reduce((r, [s, n]) => {
|
|
4631
4626
|
const i = r[s];
|
|
4632
|
-
return Array.isArray(i) && Array.isArray(n) ? (r[s] = i.concat(n), r) :
|
|
4627
|
+
return Array.isArray(i) && Array.isArray(n) ? (r[s] = i.concat(n), r) : Et(i) && Et(n) ? (r[s] = gr(i, n), r) : (r[s] = n, r);
|
|
4633
4628
|
}, Object.assign({}, e));
|
|
4634
4629
|
}
|
|
4635
|
-
function
|
|
4630
|
+
function lo() {
|
|
4636
4631
|
const e = (t, r) => {
|
|
4637
4632
|
e.state = "pending", e.resolve = (s) => {
|
|
4638
4633
|
if (e.state !== "pending")
|
|
@@ -4651,17 +4646,17 @@ function co() {
|
|
|
4651
4646
|
};
|
|
4652
4647
|
return e;
|
|
4653
4648
|
}
|
|
4654
|
-
var M, z, ue,
|
|
4649
|
+
var M, z, ue, Rt, vr = (Rt = class extends Promise {
|
|
4655
4650
|
constructor(t = null) {
|
|
4656
|
-
const r =
|
|
4651
|
+
const r = lo();
|
|
4657
4652
|
super((s, n) => {
|
|
4658
4653
|
r(s, n), t == null || t(r.resolve, r.reject);
|
|
4659
4654
|
});
|
|
4660
4655
|
Ee(this, z);
|
|
4661
|
-
Ee(this, M
|
|
4656
|
+
Ee(this, M);
|
|
4662
4657
|
$(this, "resolve");
|
|
4663
4658
|
$(this, "reject");
|
|
4664
|
-
|
|
4659
|
+
Ve(this, M, r), this.resolve = Q(this, M).resolve, this.reject = Q(this, M).reject;
|
|
4665
4660
|
}
|
|
4666
4661
|
get state() {
|
|
4667
4662
|
return Q(this, M).state;
|
|
@@ -4683,16 +4678,16 @@ var M, z, ue, At, gr = (At = class extends Promise {
|
|
|
4683
4678
|
resolve: { configurable: !0, value: this.resolve },
|
|
4684
4679
|
reject: { configurable: !0, value: this.reject }
|
|
4685
4680
|
});
|
|
4686
|
-
},
|
|
4687
|
-
function
|
|
4681
|
+
}, Rt);
|
|
4682
|
+
function Er() {
|
|
4688
4683
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
4689
4684
|
const t = Math.random() * 16 | 0;
|
|
4690
4685
|
return (e == "x" ? t : t & 3 | 8).toString(16);
|
|
4691
4686
|
});
|
|
4692
4687
|
}
|
|
4693
|
-
var
|
|
4688
|
+
var uo = class {
|
|
4694
4689
|
constructor(e) {
|
|
4695
|
-
this.request = e, this.responsePromise = new
|
|
4690
|
+
this.request = e, this.responsePromise = new vr();
|
|
4696
4691
|
}
|
|
4697
4692
|
respondWith(e) {
|
|
4698
4693
|
D(
|
|
@@ -4703,8 +4698,8 @@ var lo = class {
|
|
|
4703
4698
|
), this.responsePromise.resolve(e);
|
|
4704
4699
|
}
|
|
4705
4700
|
};
|
|
4706
|
-
function
|
|
4707
|
-
const t = new
|
|
4701
|
+
function wr(e) {
|
|
4702
|
+
const t = new uo(e);
|
|
4708
4703
|
return Reflect.set(
|
|
4709
4704
|
e,
|
|
4710
4705
|
"respondWith",
|
|
@@ -4714,29 +4709,29 @@ function Er(e) {
|
|
|
4714
4709
|
requestController: t
|
|
4715
4710
|
};
|
|
4716
4711
|
}
|
|
4717
|
-
async function
|
|
4712
|
+
async function br(e, t, ...r) {
|
|
4718
4713
|
const s = e.listeners(t);
|
|
4719
4714
|
if (s.length !== 0)
|
|
4720
4715
|
for (const n of s)
|
|
4721
4716
|
await n.apply(e, r);
|
|
4722
4717
|
}
|
|
4723
|
-
function
|
|
4718
|
+
function ho(e, t) {
|
|
4724
4719
|
try {
|
|
4725
4720
|
return e[t], !0;
|
|
4726
4721
|
} catch {
|
|
4727
4722
|
return !1;
|
|
4728
4723
|
}
|
|
4729
4724
|
}
|
|
4730
|
-
function
|
|
4725
|
+
function po(e) {
|
|
4731
4726
|
try {
|
|
4732
4727
|
return new URL(e), !0;
|
|
4733
4728
|
} catch {
|
|
4734
4729
|
return !1;
|
|
4735
4730
|
}
|
|
4736
4731
|
}
|
|
4737
|
-
var
|
|
4732
|
+
var _r = class extends Me {
|
|
4738
4733
|
constructor() {
|
|
4739
|
-
super(
|
|
4734
|
+
super(_r.symbol);
|
|
4740
4735
|
}
|
|
4741
4736
|
checkEnvironment() {
|
|
4742
4737
|
return typeof globalThis < "u" && typeof globalThis.fetch < "u";
|
|
@@ -4748,16 +4743,16 @@ var br = class extends Me {
|
|
|
4748
4743
|
'Failed to patch the "fetch" module: already patched.'
|
|
4749
4744
|
), globalThis.fetch = async (t, r) => {
|
|
4750
4745
|
var s;
|
|
4751
|
-
const n =
|
|
4746
|
+
const n = Er(), i = typeof t == "string" && typeof location < "u" && !po(t) ? new URL(t, location.origin) : t, a = new Request(i, r);
|
|
4752
4747
|
this.logger.info("[%s] %s", a.method, a.url);
|
|
4753
|
-
const { interactiveRequest: l, requestController: o } =
|
|
4748
|
+
const { interactiveRequest: l, requestController: o } = wr(a);
|
|
4754
4749
|
this.logger.info(
|
|
4755
4750
|
'emitting the "request" event for %d listener(s)...',
|
|
4756
4751
|
this.emitter.listenerCount("request")
|
|
4757
4752
|
), this.emitter.once("request", ({ requestId: m }) => {
|
|
4758
4753
|
m === n && o.responsePromise.state === "pending" && o.responsePromise.resolve(void 0);
|
|
4759
4754
|
}), this.logger.info("awaiting for the mocked response...");
|
|
4760
|
-
const c = l.signal, u = new
|
|
4755
|
+
const c = l.signal, u = new vr();
|
|
4761
4756
|
c && c.addEventListener(
|
|
4762
4757
|
"abort",
|
|
4763
4758
|
() => {
|
|
@@ -4766,7 +4761,7 @@ var br = class extends Me {
|
|
|
4766
4761
|
{ once: !0 }
|
|
4767
4762
|
);
|
|
4768
4763
|
const h = await U(async () => {
|
|
4769
|
-
const m =
|
|
4764
|
+
const m = br(this.emitter, "request", {
|
|
4770
4765
|
request: l,
|
|
4771
4766
|
requestId: n
|
|
4772
4767
|
});
|
|
@@ -4784,13 +4779,13 @@ var br = class extends Me {
|
|
|
4784
4779
|
if (u.state === "rejected")
|
|
4785
4780
|
return Promise.reject(u.rejectionReason);
|
|
4786
4781
|
if (h.error)
|
|
4787
|
-
return Promise.reject(
|
|
4782
|
+
return Promise.reject(wt(h.error));
|
|
4788
4783
|
const d = h.data;
|
|
4789
4784
|
if (d && !((s = a.signal) != null && s.aborted)) {
|
|
4790
|
-
if (this.logger.info("received mocked response:", d),
|
|
4785
|
+
if (this.logger.info("received mocked response:", d), ho(d, "type") && d.type === "error")
|
|
4791
4786
|
return this.logger.info(
|
|
4792
4787
|
"received a network error response, rejecting the request promise..."
|
|
4793
|
-
), Promise.reject(
|
|
4788
|
+
), Promise.reject(wt(d));
|
|
4794
4789
|
const m = d.clone();
|
|
4795
4790
|
return this.emitter.emit("response", {
|
|
4796
4791
|
response: m,
|
|
@@ -4826,18 +4821,18 @@ var br = class extends Me {
|
|
|
4826
4821
|
);
|
|
4827
4822
|
});
|
|
4828
4823
|
}
|
|
4829
|
-
},
|
|
4830
|
-
|
|
4831
|
-
function
|
|
4824
|
+
}, xr = _r;
|
|
4825
|
+
xr.symbol = Symbol("fetch");
|
|
4826
|
+
function wt(e) {
|
|
4832
4827
|
return Object.assign(new TypeError("Failed to fetch"), {
|
|
4833
4828
|
cause: e
|
|
4834
4829
|
});
|
|
4835
4830
|
}
|
|
4836
|
-
function
|
|
4831
|
+
function fo(e, t) {
|
|
4837
4832
|
const r = new Uint8Array(e.byteLength + t.byteLength);
|
|
4838
4833
|
return r.set(e, 0), r.set(t, e.byteLength), r;
|
|
4839
4834
|
}
|
|
4840
|
-
var
|
|
4835
|
+
var Tr = class {
|
|
4841
4836
|
constructor(e, t) {
|
|
4842
4837
|
this.AT_TARGET = 0, this.BUBBLING_PHASE = 0, this.CAPTURING_PHASE = 0, this.NONE = 0, this.type = "", this.srcElement = null, this.currentTarget = null, this.eventPhase = 0, this.isTrusted = !0, this.composed = !1, this.cancelable = !0, this.defaultPrevented = !1, this.bubbles = !0, this.lengthComputable = !0, this.loaded = 0, this.total = 0, this.cancelBubble = !1, this.returnValue = !0, this.type = e, this.target = (t == null ? void 0 : t.target) || null, this.currentTarget = (t == null ? void 0 : t.currentTarget) || null, this.timeStamp = Date.now();
|
|
4843
4838
|
}
|
|
@@ -4854,12 +4849,12 @@ var xr = class {
|
|
|
4854
4849
|
}
|
|
4855
4850
|
stopImmediatePropagation() {
|
|
4856
4851
|
}
|
|
4857
|
-
},
|
|
4852
|
+
}, mo = class extends Tr {
|
|
4858
4853
|
constructor(e, t) {
|
|
4859
4854
|
super(e), this.lengthComputable = (t == null ? void 0 : t.lengthComputable) || !1, this.composed = (t == null ? void 0 : t.composed) || !1, this.loaded = (t == null ? void 0 : t.loaded) || 0, this.total = (t == null ? void 0 : t.total) || 0;
|
|
4860
4855
|
}
|
|
4861
|
-
},
|
|
4862
|
-
function
|
|
4856
|
+
}, yo = typeof ProgressEvent < "u";
|
|
4857
|
+
function go(e, t, r) {
|
|
4863
4858
|
const s = [
|
|
4864
4859
|
"error",
|
|
4865
4860
|
"progress",
|
|
@@ -4868,35 +4863,35 @@ function yo(e, t, r) {
|
|
|
4868
4863
|
"load",
|
|
4869
4864
|
"timeout",
|
|
4870
4865
|
"abort"
|
|
4871
|
-
], n =
|
|
4866
|
+
], n = yo ? ProgressEvent : mo;
|
|
4872
4867
|
return s.includes(t) ? new n(t, {
|
|
4873
4868
|
lengthComputable: !0,
|
|
4874
4869
|
loaded: (r == null ? void 0 : r.loaded) || 0,
|
|
4875
4870
|
total: (r == null ? void 0 : r.total) || 0
|
|
4876
|
-
}) : new
|
|
4871
|
+
}) : new Tr(t, {
|
|
4877
4872
|
target: e,
|
|
4878
4873
|
currentTarget: e
|
|
4879
4874
|
});
|
|
4880
4875
|
}
|
|
4881
|
-
function
|
|
4876
|
+
function Or(e, t) {
|
|
4882
4877
|
if (!(t in e))
|
|
4883
4878
|
return null;
|
|
4884
4879
|
if (Object.prototype.hasOwnProperty.call(e, t))
|
|
4885
4880
|
return e;
|
|
4886
4881
|
const s = Reflect.getPrototypeOf(e);
|
|
4887
|
-
return s ?
|
|
4882
|
+
return s ? Or(s, t) : null;
|
|
4888
4883
|
}
|
|
4889
|
-
function
|
|
4890
|
-
return new Proxy(e,
|
|
4884
|
+
function bt(e, t) {
|
|
4885
|
+
return new Proxy(e, vo(t));
|
|
4891
4886
|
}
|
|
4892
|
-
function
|
|
4887
|
+
function vo(e) {
|
|
4893
4888
|
const { constructorCall: t, methodCall: r, getProperty: s, setProperty: n } = e, i = {};
|
|
4894
4889
|
return typeof t < "u" && (i.construct = function(a, l, o) {
|
|
4895
4890
|
const c = Reflect.construct.bind(null, a, l, o);
|
|
4896
4891
|
return t.call(o, l, c);
|
|
4897
4892
|
}), i.set = function(a, l, o) {
|
|
4898
4893
|
const c = () => {
|
|
4899
|
-
const u =
|
|
4894
|
+
const u = Or(a, l) || a, h = Reflect.getOwnPropertyDescriptor(
|
|
4900
4895
|
u,
|
|
4901
4896
|
l
|
|
4902
4897
|
);
|
|
@@ -4916,7 +4911,7 @@ function go(e) {
|
|
|
4916
4911
|
} : u;
|
|
4917
4912
|
}, i;
|
|
4918
4913
|
}
|
|
4919
|
-
function
|
|
4914
|
+
function Eo(e) {
|
|
4920
4915
|
return [
|
|
4921
4916
|
"application/xhtml+xml",
|
|
4922
4917
|
"application/xml",
|
|
@@ -4925,24 +4920,24 @@ function vo(e) {
|
|
|
4925
4920
|
"text/xml"
|
|
4926
4921
|
].some((r) => e.startsWith(r));
|
|
4927
4922
|
}
|
|
4928
|
-
function
|
|
4923
|
+
function wo(e) {
|
|
4929
4924
|
try {
|
|
4930
4925
|
return JSON.parse(e);
|
|
4931
4926
|
} catch {
|
|
4932
4927
|
return null;
|
|
4933
4928
|
}
|
|
4934
4929
|
}
|
|
4935
|
-
function
|
|
4936
|
-
const r =
|
|
4930
|
+
function bo(e, t) {
|
|
4931
|
+
const r = Jn(e.status) ? null : t;
|
|
4937
4932
|
return new Response(r, {
|
|
4938
4933
|
status: e.status,
|
|
4939
4934
|
statusText: e.statusText,
|
|
4940
|
-
headers:
|
|
4935
|
+
headers: _o(
|
|
4941
4936
|
e.getAllResponseHeaders()
|
|
4942
4937
|
)
|
|
4943
4938
|
});
|
|
4944
4939
|
}
|
|
4945
|
-
function
|
|
4940
|
+
function _o(e) {
|
|
4946
4941
|
const t = new Headers(), r = e.split(/[\r\n]+/);
|
|
4947
4942
|
for (const s of r) {
|
|
4948
4943
|
if (s.trim() === "")
|
|
@@ -4952,9 +4947,9 @@ function bo(e) {
|
|
|
4952
4947
|
}
|
|
4953
4948
|
return t;
|
|
4954
4949
|
}
|
|
4955
|
-
var
|
|
4950
|
+
var _t = Symbol("isMockedResponse"), xo = Ce(), To = class {
|
|
4956
4951
|
constructor(e, t) {
|
|
4957
|
-
this.initialRequest = e, this.logger = t, this.method = "GET", this.url = null, this.events = /* @__PURE__ */ new Map(), this.requestId =
|
|
4952
|
+
this.initialRequest = e, this.logger = t, this.method = "GET", this.url = null, this.events = /* @__PURE__ */ new Map(), this.requestId = Er(), this.requestHeaders = new Headers(), this.responseBuffer = new Uint8Array(), this.request = bt(e, {
|
|
4958
4953
|
setProperty: ([r, s], n) => {
|
|
4959
4954
|
switch (r) {
|
|
4960
4955
|
case "ontimeout": {
|
|
@@ -4972,7 +4967,7 @@ var bt = Symbol("isMockedResponse"), _o = Ce(), xo = class {
|
|
|
4972
4967
|
switch (r) {
|
|
4973
4968
|
case "open": {
|
|
4974
4969
|
const [a, l] = s;
|
|
4975
|
-
return typeof l > "u" ? (this.method = "GET", this.url =
|
|
4970
|
+
return typeof l > "u" ? (this.method = "GET", this.url = xt(a)) : (this.method = a, this.url = xt(l)), this.logger = this.logger.extend(`${this.method} ${this.url.href}`), this.logger.info("open", this.method, this.url.href), n();
|
|
4976
4971
|
}
|
|
4977
4972
|
case "addEventListener": {
|
|
4978
4973
|
const [a, l] = s;
|
|
@@ -4984,9 +4979,9 @@ var bt = Symbol("isMockedResponse"), _o = Ce(), xo = class {
|
|
|
4984
4979
|
}
|
|
4985
4980
|
case "send": {
|
|
4986
4981
|
const [a] = s;
|
|
4987
|
-
a != null && (this.requestBody = typeof a == "string" ?
|
|
4982
|
+
a != null && (this.requestBody = typeof a == "string" ? Hn(a) : a), this.request.addEventListener("load", () => {
|
|
4988
4983
|
if (typeof this.onResponse < "u") {
|
|
4989
|
-
const c =
|
|
4984
|
+
const c = bo(
|
|
4990
4985
|
this.request,
|
|
4991
4986
|
/**
|
|
4992
4987
|
* The `response` property is the right way to read
|
|
@@ -4997,7 +4992,7 @@ var bt = Symbol("isMockedResponse"), _o = Ce(), xo = class {
|
|
|
4997
4992
|
);
|
|
4998
4993
|
this.onResponse.call(this, {
|
|
4999
4994
|
response: c,
|
|
5000
|
-
isMockedResponse:
|
|
4995
|
+
isMockedResponse: _t in this.request,
|
|
5001
4996
|
request: l,
|
|
5002
4997
|
requestId: this.requestId
|
|
5003
4998
|
});
|
|
@@ -5012,7 +5007,7 @@ var bt = Symbol("isMockedResponse"), _o = Ce(), xo = class {
|
|
|
5012
5007
|
return this.logger.info(
|
|
5013
5008
|
"request callback settled but request has not been handled (readystate %d), performing as-is...",
|
|
5014
5009
|
this.request.readyState
|
|
5015
|
-
),
|
|
5010
|
+
), xo && this.request.setRequestHeader("X-Request-Id", this.requestId), n();
|
|
5016
5011
|
});
|
|
5017
5012
|
break;
|
|
5018
5013
|
}
|
|
@@ -5035,7 +5030,7 @@ var bt = Symbol("isMockedResponse"), _o = Ce(), xo = class {
|
|
|
5035
5030
|
"responding with a mocked response: %d %s",
|
|
5036
5031
|
e.status,
|
|
5037
5032
|
e.statusText
|
|
5038
|
-
), W(this.request,
|
|
5033
|
+
), W(this.request, _t, !0), W(this.request, "status", e.status), W(this.request, "statusText", e.statusText), W(this.request, "responseURL", this.url.href), this.request.getResponseHeader = new Proxy(this.request.getResponseHeader, {
|
|
5039
5034
|
apply: (s, n, i) => {
|
|
5040
5035
|
if (this.logger.info("getResponseHeader", i[0]), this.request.readyState < this.request.HEADERS_RECEIVED)
|
|
5041
5036
|
return this.logger.info("headers not received yet, returning null"), null;
|
|
@@ -5101,7 +5096,7 @@ var bt = Symbol("isMockedResponse"), _o = Ce(), xo = class {
|
|
|
5101
5096
|
this.logger.info("response body stream done!"), r();
|
|
5102
5097
|
return;
|
|
5103
5098
|
}
|
|
5104
|
-
i && (this.logger.info("read response body chunk:", i), this.responseBuffer =
|
|
5099
|
+
i && (this.logger.info("read response body chunk:", i), this.responseBuffer = fo(this.responseBuffer, i), this.trigger("progress", {
|
|
5105
5100
|
loaded: this.responseBuffer.byteLength,
|
|
5106
5101
|
total: t
|
|
5107
5102
|
})), n();
|
|
@@ -5111,7 +5106,7 @@ var bt = Symbol("isMockedResponse"), _o = Ce(), xo = class {
|
|
|
5111
5106
|
r();
|
|
5112
5107
|
}
|
|
5113
5108
|
responseBufferToText() {
|
|
5114
|
-
return
|
|
5109
|
+
return Xn(this.responseBuffer);
|
|
5115
5110
|
}
|
|
5116
5111
|
get response() {
|
|
5117
5112
|
if (this.logger.info(
|
|
@@ -5121,11 +5116,11 @@ var bt = Symbol("isMockedResponse"), _o = Ce(), xo = class {
|
|
|
5121
5116
|
return null;
|
|
5122
5117
|
switch (this.request.responseType) {
|
|
5123
5118
|
case "json": {
|
|
5124
|
-
const e =
|
|
5119
|
+
const e = wo(this.responseBufferToText());
|
|
5125
5120
|
return this.logger.info("resolved response JSON", e), e;
|
|
5126
5121
|
}
|
|
5127
5122
|
case "arraybuffer": {
|
|
5128
|
-
const e =
|
|
5123
|
+
const e = zn(this.responseBuffer);
|
|
5129
5124
|
return this.logger.info("resolved response ArrayBuffer", e), e;
|
|
5130
5125
|
}
|
|
5131
5126
|
case "blob": {
|
|
@@ -5166,7 +5161,7 @@ var bt = Symbol("isMockedResponse"), _o = Ce(), xo = class {
|
|
|
5166
5161
|
const e = this.request.getResponseHeader("Content-Type") || "";
|
|
5167
5162
|
return typeof DOMParser > "u" ? (console.warn(
|
|
5168
5163
|
"Cannot retrieve XMLHttpRequest response body as XML: DOMParser is not defined. You are likely using an environment that is not browser or does not polyfill browser globals correctly."
|
|
5169
|
-
), null) :
|
|
5164
|
+
), null) : Eo(e) ? new DOMParser().parseFromString(
|
|
5170
5165
|
this.responseBufferToText(),
|
|
5171
5166
|
e
|
|
5172
5167
|
) : null;
|
|
@@ -5192,7 +5187,7 @@ var bt = Symbol("isMockedResponse"), _o = Ce(), xo = class {
|
|
|
5192
5187
|
* Triggers given event on the `XMLHttpRequest` instance.
|
|
5193
5188
|
*/
|
|
5194
5189
|
trigger(e, t) {
|
|
5195
|
-
const r = this.request[`on${e}`], s =
|
|
5190
|
+
const r = this.request[`on${e}`], s = go(this.request, e, t);
|
|
5196
5191
|
this.logger.info('trigger "%s"', e, t || ""), typeof r == "function" && (this.logger.info('found a direct "%s" callback, calling...', e), r.call(this.request, s));
|
|
5197
5192
|
for (const [n, i] of this.events)
|
|
5198
5193
|
n === e && (this.logger.info(
|
|
@@ -5214,7 +5209,7 @@ var bt = Symbol("isMockedResponse"), _o = Ce(), xo = class {
|
|
|
5214
5209
|
*/
|
|
5215
5210
|
credentials: this.request.withCredentials ? "include" : "same-origin",
|
|
5216
5211
|
body: ["GET", "HEAD"].includes(this.method) ? null : this.requestBody
|
|
5217
|
-
}), t =
|
|
5212
|
+
}), t = bt(e.headers, {
|
|
5218
5213
|
methodCall: ([r, s], n) => {
|
|
5219
5214
|
switch (r) {
|
|
5220
5215
|
case "append":
|
|
@@ -5237,7 +5232,7 @@ var bt = Symbol("isMockedResponse"), _o = Ce(), xo = class {
|
|
|
5237
5232
|
return W(e, "headers", t), this.logger.info("converted request to a Fetch API Request!", e), e;
|
|
5238
5233
|
}
|
|
5239
5234
|
};
|
|
5240
|
-
function
|
|
5235
|
+
function xt(e) {
|
|
5241
5236
|
return typeof location > "u" ? new URL(e) : new URL(e.toString(), location.href);
|
|
5242
5237
|
}
|
|
5243
5238
|
function W(e, t, r) {
|
|
@@ -5248,7 +5243,7 @@ function W(e, t, r) {
|
|
|
5248
5243
|
value: r
|
|
5249
5244
|
});
|
|
5250
5245
|
}
|
|
5251
|
-
function
|
|
5246
|
+
function Oo({
|
|
5252
5247
|
emitter: e,
|
|
5253
5248
|
logger: t
|
|
5254
5249
|
}) {
|
|
@@ -5264,12 +5259,12 @@ function To({
|
|
|
5264
5259
|
c,
|
|
5265
5260
|
l[c]
|
|
5266
5261
|
);
|
|
5267
|
-
const o = new
|
|
5262
|
+
const o = new To(
|
|
5268
5263
|
a,
|
|
5269
5264
|
t
|
|
5270
5265
|
);
|
|
5271
5266
|
return o.onRequest = async function({ request: c, requestId: u }) {
|
|
5272
|
-
const { interactiveRequest: h, requestController: d } =
|
|
5267
|
+
const { interactiveRequest: h, requestController: d } = wr(c);
|
|
5273
5268
|
this.logger.info("awaiting mocked response..."), e.once("request", ({ requestId: y }) => {
|
|
5274
5269
|
y === u && d.responsePromise.state === "pending" && d.respondWith(void 0);
|
|
5275
5270
|
});
|
|
@@ -5277,7 +5272,7 @@ function To({
|
|
|
5277
5272
|
this.logger.info(
|
|
5278
5273
|
'emitting the "request" event for %s listener(s)...',
|
|
5279
5274
|
e.listenerCount("request")
|
|
5280
|
-
), await
|
|
5275
|
+
), await br(e, "request", {
|
|
5281
5276
|
request: h,
|
|
5282
5277
|
requestId: u
|
|
5283
5278
|
}), this.logger.info('all "request" listeners settled!');
|
|
@@ -5327,9 +5322,9 @@ function To({
|
|
|
5327
5322
|
}
|
|
5328
5323
|
});
|
|
5329
5324
|
}
|
|
5330
|
-
var
|
|
5325
|
+
var Ar = class extends Me {
|
|
5331
5326
|
constructor() {
|
|
5332
|
-
super(
|
|
5327
|
+
super(Ar.interceptorSymbol);
|
|
5333
5328
|
}
|
|
5334
5329
|
checkEnvironment() {
|
|
5335
5330
|
return typeof globalThis.XMLHttpRequest < "u";
|
|
@@ -5341,7 +5336,7 @@ var Or = class extends Me {
|
|
|
5341
5336
|
D(
|
|
5342
5337
|
!t[X],
|
|
5343
5338
|
'Failed to patch the "XMLHttpRequest" module: already patched.'
|
|
5344
|
-
), globalThis.XMLHttpRequest =
|
|
5339
|
+
), globalThis.XMLHttpRequest = Oo({
|
|
5345
5340
|
emitter: this.emitter,
|
|
5346
5341
|
logger: this.logger
|
|
5347
5342
|
}), e.info(
|
|
@@ -5360,16 +5355,16 @@ var Or = class extends Me {
|
|
|
5360
5355
|
);
|
|
5361
5356
|
});
|
|
5362
5357
|
}
|
|
5363
|
-
},
|
|
5364
|
-
|
|
5365
|
-
var
|
|
5358
|
+
}, Rr = Ar;
|
|
5359
|
+
Rr.interceptorSymbol = Symbol("xhr");
|
|
5360
|
+
var Ao = Object.defineProperty, Ro = Object.defineProperties, Io = Object.getOwnPropertyDescriptors, Tt = Object.getOwnPropertySymbols, No = Object.prototype.hasOwnProperty, ko = Object.prototype.propertyIsEnumerable, Ot = (e, t, r) => t in e ? Ao(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Le = (e, t) => {
|
|
5366
5361
|
for (var r in t || (t = {}))
|
|
5367
|
-
|
|
5368
|
-
if (
|
|
5369
|
-
for (var r of
|
|
5370
|
-
|
|
5362
|
+
No.call(t, r) && Ot(e, r, t[r]);
|
|
5363
|
+
if (Tt)
|
|
5364
|
+
for (var r of Tt(t))
|
|
5365
|
+
ko.call(t, r) && Ot(e, r, t[r]);
|
|
5371
5366
|
return e;
|
|
5372
|
-
}, Se = (e, t) =>
|
|
5367
|
+
}, Se = (e, t) => Ro(e, Io(t)), k = (e, t, r) => new Promise((s, n) => {
|
|
5373
5368
|
var i = (o) => {
|
|
5374
5369
|
try {
|
|
5375
5370
|
l(r.next(o));
|
|
@@ -5385,7 +5380,7 @@ var Oo = Object.defineProperty, Ao = Object.defineProperties, Ro = Object.getOwn
|
|
|
5385
5380
|
}, l = (o) => o.done ? s(o.value) : Promise.resolve(o.value).then(i, a);
|
|
5386
5381
|
l((r = r.apply(e, t)).next());
|
|
5387
5382
|
});
|
|
5388
|
-
function
|
|
5383
|
+
function Po(e) {
|
|
5389
5384
|
return new URL(e, location.href).href;
|
|
5390
5385
|
}
|
|
5391
5386
|
function Ae(e, t, r) {
|
|
@@ -5395,8 +5390,8 @@ function Ae(e, t, r) {
|
|
|
5395
5390
|
e.waiting
|
|
5396
5391
|
].filter((a) => a != null).find((a) => r(a.scriptURL, t)) || null;
|
|
5397
5392
|
}
|
|
5398
|
-
var
|
|
5399
|
-
const i =
|
|
5393
|
+
var Lo = (e, ...t) => k(void 0, [e, ...t], function* (r, s = {}, n) {
|
|
5394
|
+
const i = Po(r), a = yield navigator.serviceWorker.getRegistrations().then(
|
|
5400
5395
|
(c) => c.filter(
|
|
5401
5396
|
(u) => Ae(u, i, n)
|
|
5402
5397
|
)
|
|
@@ -5445,7 +5440,7 @@ Learn more about creating the Service Worker script: https://mswjs.io/docs/cli/i
|
|
|
5445
5440
|
}
|
|
5446
5441
|
return o.data;
|
|
5447
5442
|
});
|
|
5448
|
-
function
|
|
5443
|
+
function Ir(e = {}) {
|
|
5449
5444
|
if (e.quiet)
|
|
5450
5445
|
return;
|
|
5451
5446
|
const t = e.message || "Mocking enabled.";
|
|
@@ -5458,7 +5453,7 @@ function Rr(e = {}) {
|
|
|
5458
5453
|
"font-weight:normal"
|
|
5459
5454
|
), console.log("Found an issue? https://github.com/mswjs/msw/issues"), e.workerUrl && console.log("Worker script URL:", e.workerUrl), e.workerScope && console.log("Worker scope:", e.workerScope), console.groupEnd();
|
|
5460
5455
|
}
|
|
5461
|
-
function
|
|
5456
|
+
function So(e, t) {
|
|
5462
5457
|
return k(this, null, function* () {
|
|
5463
5458
|
var r, s;
|
|
5464
5459
|
if (e.workerChannel.send("MOCK_ACTIVATE"), yield e.events.once("MOCKING_ENABLED"), e.isMockingEnabled) {
|
|
@@ -5467,14 +5462,14 @@ function Lo(e, t) {
|
|
|
5467
5462
|
);
|
|
5468
5463
|
return;
|
|
5469
5464
|
}
|
|
5470
|
-
e.isMockingEnabled = !0,
|
|
5465
|
+
e.isMockingEnabled = !0, Ir({
|
|
5471
5466
|
quiet: t.quiet,
|
|
5472
5467
|
workerScope: (r = e.registration) == null ? void 0 : r.scope,
|
|
5473
5468
|
workerUrl: (s = e.worker) == null ? void 0 : s.scriptURL
|
|
5474
5469
|
});
|
|
5475
5470
|
});
|
|
5476
5471
|
}
|
|
5477
|
-
var
|
|
5472
|
+
var Do = class {
|
|
5478
5473
|
constructor(e) {
|
|
5479
5474
|
this.port = e;
|
|
5480
5475
|
}
|
|
@@ -5490,21 +5485,21 @@ var So = class {
|
|
|
5490
5485
|
);
|
|
5491
5486
|
}
|
|
5492
5487
|
};
|
|
5493
|
-
function
|
|
5488
|
+
function Co(e) {
|
|
5494
5489
|
if (!["HEAD", "GET"].includes(e.method))
|
|
5495
5490
|
return e.body;
|
|
5496
5491
|
}
|
|
5497
|
-
function
|
|
5492
|
+
function qo(e) {
|
|
5498
5493
|
return new Request(e.url, Se(Le({}, e), {
|
|
5499
|
-
body:
|
|
5494
|
+
body: Co(e)
|
|
5500
5495
|
}));
|
|
5501
5496
|
}
|
|
5502
|
-
var
|
|
5497
|
+
var Mo = (e, t) => (r, s) => k(void 0, null, function* () {
|
|
5503
5498
|
var n;
|
|
5504
|
-
const i = new
|
|
5499
|
+
const i = new Do(r.ports[0]), a = s.payload.id, l = qo(s.payload), o = l.clone();
|
|
5505
5500
|
try {
|
|
5506
5501
|
let c;
|
|
5507
|
-
yield
|
|
5502
|
+
yield yr(
|
|
5508
5503
|
l,
|
|
5509
5504
|
a,
|
|
5510
5505
|
e.requestHandlers,
|
|
@@ -5516,7 +5511,7 @@ var qo = (e, t) => (r, s) => k(void 0, null, function* () {
|
|
|
5516
5511
|
},
|
|
5517
5512
|
onMockedResponse(u, h) {
|
|
5518
5513
|
return k(this, arguments, function* (d, { handler: m, parsedResult: f }) {
|
|
5519
|
-
const y = d.clone(), v = d.clone(), E =
|
|
5514
|
+
const y = d.clone(), v = d.clone(), E = co(d);
|
|
5520
5515
|
if (e.supports.readableStreamTransfer) {
|
|
5521
5516
|
const w = d.body;
|
|
5522
5517
|
i.postMessage(
|
|
@@ -5567,7 +5562,7 @@ This exception has been gracefully handled as a 500 response, however, it's stro
|
|
|
5567
5562
|
}));
|
|
5568
5563
|
}
|
|
5569
5564
|
});
|
|
5570
|
-
function
|
|
5565
|
+
function $o(e, t) {
|
|
5571
5566
|
return k(this, null, function* () {
|
|
5572
5567
|
e.workerChannel.send("INTEGRITY_CHECK_REQUEST");
|
|
5573
5568
|
const { payload: r } = yield e.events.once(
|
|
@@ -5580,7 +5575,7 @@ function Mo(e, t) {
|
|
|
5580
5575
|
return t;
|
|
5581
5576
|
});
|
|
5582
5577
|
}
|
|
5583
|
-
function
|
|
5578
|
+
function Uo(e) {
|
|
5584
5579
|
const t = window.XMLHttpRequest.prototype.send;
|
|
5585
5580
|
window.XMLHttpRequest.prototype.send = function(...s) {
|
|
5586
5581
|
U(() => e).then(() => {
|
|
@@ -5592,7 +5587,7 @@ function $o(e) {
|
|
|
5592
5587
|
return yield U(() => e), window.fetch = r, window.fetch(...s);
|
|
5593
5588
|
});
|
|
5594
5589
|
}
|
|
5595
|
-
function
|
|
5590
|
+
function jo(e) {
|
|
5596
5591
|
return (t, r) => {
|
|
5597
5592
|
var s;
|
|
5598
5593
|
const { payload: n } = r;
|
|
@@ -5613,7 +5608,7 @@ function Uo(e) {
|
|
|
5613
5608
|
);
|
|
5614
5609
|
};
|
|
5615
5610
|
}
|
|
5616
|
-
function
|
|
5611
|
+
function Fo(e, t) {
|
|
5617
5612
|
!(t != null && t.quiet) && !location.href.startsWith(e.scope) && T.warn(
|
|
5618
5613
|
`Cannot intercept requests on this page because it's outside of the worker's scope ("${e.scope}"). If you wish to mock API requests on this page, you must resolve this scope issue.
|
|
5619
5614
|
|
|
@@ -5621,13 +5616,13 @@ function jo(e, t) {
|
|
|
5621
5616
|
- Set the "Service-Worker-Allowed" response header to allow out-of-scope workers.`
|
|
5622
5617
|
);
|
|
5623
5618
|
}
|
|
5624
|
-
var
|
|
5619
|
+
var Bo = (e) => function(r, s) {
|
|
5625
5620
|
const i = k(this, null, function* () {
|
|
5626
5621
|
e.events.removeAllListeners(), e.workerChannel.on(
|
|
5627
5622
|
"REQUEST",
|
|
5628
|
-
|
|
5629
|
-
), e.workerChannel.on("RESPONSE",
|
|
5630
|
-
const a = yield
|
|
5623
|
+
Mo(e, r)
|
|
5624
|
+
), e.workerChannel.on("RESPONSE", jo(e));
|
|
5625
|
+
const a = yield Lo(
|
|
5631
5626
|
r.serviceWorker.url,
|
|
5632
5627
|
r.serviceWorker.options,
|
|
5633
5628
|
r.findWorker
|
|
@@ -5655,7 +5650,7 @@ Please consider using a custom "serviceWorker.url" option to point to the actual
|
|
|
5655
5650
|
l.state !== "redundant" && e.workerChannel.send("CLIENT_CLOSED"), window.clearInterval(e.keepAliveInterval);
|
|
5656
5651
|
});
|
|
5657
5652
|
const c = yield U(
|
|
5658
|
-
() =>
|
|
5653
|
+
() => $o(e, l)
|
|
5659
5654
|
);
|
|
5660
5655
|
return c.error && T.error(`Detected outdated Service Worker: ${c.error.message}
|
|
5661
5656
|
|
|
@@ -5667,7 +5662,7 @@ This is necessary to ensure that the Service Worker is in sync with the library
|
|
|
5667
5662
|
If this message still persists after updating, please report an issue: https://github.com/open-draft/msw/issues `), e.keepAliveInterval = window.setInterval(
|
|
5668
5663
|
() => e.workerChannel.send("KEEPALIVE_REQUEST"),
|
|
5669
5664
|
5e3
|
|
5670
|
-
),
|
|
5665
|
+
), Fo(o, e.startOptions), o;
|
|
5671
5666
|
}).then(
|
|
5672
5667
|
(a) => k(this, null, function* () {
|
|
5673
5668
|
const l = a.installing || a.waiting;
|
|
@@ -5676,20 +5671,20 @@ If this message still persists after updating, please report an issue: https://g
|
|
|
5676
5671
|
if (l.state === "activated")
|
|
5677
5672
|
return o();
|
|
5678
5673
|
});
|
|
5679
|
-
})), yield
|
|
5674
|
+
})), yield So(e, r).catch((o) => {
|
|
5680
5675
|
throw new Error(`Failed to enable mocking: ${o == null ? void 0 : o.message}`);
|
|
5681
5676
|
}), a;
|
|
5682
5677
|
})
|
|
5683
5678
|
);
|
|
5684
|
-
return r.waitUntilReady &&
|
|
5679
|
+
return r.waitUntilReady && Uo(i), i;
|
|
5685
5680
|
};
|
|
5686
|
-
function
|
|
5681
|
+
function Nr(e = {}) {
|
|
5687
5682
|
e.quiet || console.log(
|
|
5688
5683
|
`%c${T.formatMessage("Mocking disabled.")}`,
|
|
5689
5684
|
"color:orangered;font-weight:bold;"
|
|
5690
5685
|
);
|
|
5691
5686
|
}
|
|
5692
|
-
var
|
|
5687
|
+
var Vo = (e) => function() {
|
|
5693
5688
|
var r;
|
|
5694
5689
|
if (!e.isMockingEnabled) {
|
|
5695
5690
|
T.warn(
|
|
@@ -5697,8 +5692,8 @@ var Bo = (e) => function() {
|
|
|
5697
5692
|
);
|
|
5698
5693
|
return;
|
|
5699
5694
|
}
|
|
5700
|
-
e.workerChannel.send("MOCK_DEACTIVATE"), e.isMockingEnabled = !1, window.clearInterval(e.keepAliveInterval),
|
|
5701
|
-
},
|
|
5695
|
+
e.workerChannel.send("MOCK_DEACTIVATE"), e.isMockingEnabled = !1, window.clearInterval(e.keepAliveInterval), Nr({ quiet: (r = e.startOptions) == null ? void 0 : r.quiet });
|
|
5696
|
+
}, Wo = {
|
|
5702
5697
|
serviceWorker: {
|
|
5703
5698
|
url: "/mockServiceWorker.js",
|
|
5704
5699
|
options: null
|
|
@@ -5710,13 +5705,13 @@ var Bo = (e) => function() {
|
|
|
5710
5705
|
return e === t;
|
|
5711
5706
|
}
|
|
5712
5707
|
};
|
|
5713
|
-
function
|
|
5708
|
+
function Go(e, t) {
|
|
5714
5709
|
const r = new Ne({
|
|
5715
5710
|
name: "fallback",
|
|
5716
|
-
interceptors: [new
|
|
5711
|
+
interceptors: [new xr(), new Rr()]
|
|
5717
5712
|
});
|
|
5718
5713
|
return r.on("request", (s) => k(this, [s], function* ({ request: n, requestId: i }) {
|
|
5719
|
-
const a = n.clone(), l = yield
|
|
5714
|
+
const a = n.clone(), l = yield yr(
|
|
5720
5715
|
n,
|
|
5721
5716
|
i,
|
|
5722
5717
|
e.requestHandlers,
|
|
@@ -5749,26 +5744,26 @@ function Wo(e, t) {
|
|
|
5749
5744
|
}
|
|
5750
5745
|
), r.apply(), r;
|
|
5751
5746
|
}
|
|
5752
|
-
function
|
|
5747
|
+
function Ho(e) {
|
|
5753
5748
|
return function(r) {
|
|
5754
5749
|
return k(this, null, function* () {
|
|
5755
|
-
e.fallbackInterceptor =
|
|
5750
|
+
e.fallbackInterceptor = Go(
|
|
5756
5751
|
e,
|
|
5757
5752
|
r
|
|
5758
|
-
),
|
|
5753
|
+
), Ir({
|
|
5759
5754
|
message: "Mocking enabled (fallback mode).",
|
|
5760
5755
|
quiet: r.quiet
|
|
5761
5756
|
});
|
|
5762
5757
|
});
|
|
5763
5758
|
};
|
|
5764
5759
|
}
|
|
5765
|
-
function
|
|
5760
|
+
function Xo(e) {
|
|
5766
5761
|
return function() {
|
|
5767
5762
|
var r, s;
|
|
5768
|
-
(r = e.fallbackInterceptor) == null || r.dispose(),
|
|
5763
|
+
(r = e.fallbackInterceptor) == null || r.dispose(), Nr({ quiet: (s = e.startOptions) == null ? void 0 : s.quiet });
|
|
5769
5764
|
};
|
|
5770
5765
|
}
|
|
5771
|
-
function
|
|
5766
|
+
function zo() {
|
|
5772
5767
|
try {
|
|
5773
5768
|
const e = new ReadableStream({
|
|
5774
5769
|
start: (r) => r.close()
|
|
@@ -5778,7 +5773,7 @@ function Xo() {
|
|
|
5778
5773
|
return !1;
|
|
5779
5774
|
}
|
|
5780
5775
|
}
|
|
5781
|
-
var
|
|
5776
|
+
var Yo = class extends fn {
|
|
5782
5777
|
constructor(...e) {
|
|
5783
5778
|
super(...e), this.startHandler = null, this.stopHandler = null, D(
|
|
5784
5779
|
!Ce(),
|
|
@@ -5854,19 +5849,19 @@ var zo = class extends pn {
|
|
|
5854
5849
|
},
|
|
5855
5850
|
supports: {
|
|
5856
5851
|
serviceWorkerApi: !("serviceWorker" in navigator) || location.protocol === "file:",
|
|
5857
|
-
readableStreamTransfer:
|
|
5852
|
+
readableStreamTransfer: zo()
|
|
5858
5853
|
}
|
|
5859
5854
|
};
|
|
5860
5855
|
return Object.defineProperties(e, {
|
|
5861
5856
|
requestHandlers: {
|
|
5862
5857
|
get: () => this.currentHandlers
|
|
5863
5858
|
}
|
|
5864
|
-
}), this.startHandler = e.supports.serviceWorkerApi ?
|
|
5859
|
+
}), this.startHandler = e.supports.serviceWorkerApi ? Ho(e) : Bo(e), this.stopHandler = e.supports.serviceWorkerApi ? Xo(e) : Vo(e), e;
|
|
5865
5860
|
}
|
|
5866
5861
|
start() {
|
|
5867
5862
|
return k(this, arguments, function* (e = {}) {
|
|
5868
|
-
return this.context.startOptions =
|
|
5869
|
-
|
|
5863
|
+
return this.context.startOptions = gr(
|
|
5864
|
+
Wo,
|
|
5870
5865
|
e
|
|
5871
5866
|
), yield this.startHandler(this.context.startOptions, e);
|
|
5872
5867
|
});
|
|
@@ -5875,8 +5870,8 @@ var zo = class extends pn {
|
|
|
5875
5870
|
super.dispose(), this.context.events.removeAllListeners(), this.context.emitter.removeAllListeners(), this.stopHandler();
|
|
5876
5871
|
}
|
|
5877
5872
|
};
|
|
5878
|
-
function
|
|
5879
|
-
return new
|
|
5873
|
+
function Jo(...e) {
|
|
5874
|
+
return new Yo(...e);
|
|
5880
5875
|
}
|
|
5881
5876
|
var he = /* @__PURE__ */ ((e) => (e[e.Continue = 100] = "Continue", e[e.SwitchingProtocols = 101] = "SwitchingProtocols", e[e.Processing = 102] = "Processing", e[e.EarlyHints = 103] = "EarlyHints", e[e.Ok = 200] = "Ok", e[e.Created = 201] = "Created", e[e.Accepted = 202] = "Accepted", e[e.NonAuthoritativeInformation = 203] = "NonAuthoritativeInformation", e[e.NoContent = 204] = "NoContent", e[e.ResetContent = 205] = "ResetContent", e[e.PartialContent = 206] = "PartialContent", e[e.MultiStatus = 207] = "MultiStatus", e[e.AlreadyReported = 208] = "AlreadyReported", e[e.ImUsed = 226] = "ImUsed", e[e.MultipleChoices = 300] = "MultipleChoices", e[e.MovedPermanently = 301] = "MovedPermanently", e[e.Found = 302] = "Found", e[e.SeeOther = 303] = "SeeOther", e[e.NotModified = 304] = "NotModified", e[e.UseProxy = 305] = "UseProxy", e[e.Unused = 306] = "Unused", e[e.TemporaryRedirect = 307] = "TemporaryRedirect", e[e.PermanentRedirect = 308] = "PermanentRedirect", e[e.BadRequest = 400] = "BadRequest", e[e.Unauthorized = 401] = "Unauthorized", e[e.PaymentRequired = 402] = "PaymentRequired", e[e.Forbidden = 403] = "Forbidden", e[e.NotFound = 404] = "NotFound", e[e.MethodNotAllowed = 405] = "MethodNotAllowed", e[e.NotAcceptable = 406] = "NotAcceptable", e[e.ProxyAuthenticationRequired = 407] = "ProxyAuthenticationRequired", e[e.RequestTimeout = 408] = "RequestTimeout", e[e.Conflict = 409] = "Conflict", e[e.Gone = 410] = "Gone", e[e.LengthRequired = 411] = "LengthRequired", e[e.PreconditionFailed = 412] = "PreconditionFailed", e[e.PayloadTooLarge = 413] = "PayloadTooLarge", e[e.UriTooLong = 414] = "UriTooLong", e[e.UnsupportedMediaType = 415] = "UnsupportedMediaType", e[e.RangeNotSatisfiable = 416] = "RangeNotSatisfiable", e[e.ExpectationFailed = 417] = "ExpectationFailed", e[e.ImATeapot = 418] = "ImATeapot", e[e.MisdirectedRequest = 421] = "MisdirectedRequest", e[e.UnprocessableEntity = 422] = "UnprocessableEntity", e[e.Locked = 423] = "Locked", e[e.FailedDependency = 424] = "FailedDependency", e[e.TooEarly = 425] = "TooEarly", e[e.UpgradeRequired = 426] = "UpgradeRequired", e[e.PreconditionRequired = 428] = "PreconditionRequired", e[e.TooManyRequests = 429] = "TooManyRequests", e[e.RequestHeaderFieldsTooLarge = 431] = "RequestHeaderFieldsTooLarge", e[e.UnavailableForLegalReasons = 451] = "UnavailableForLegalReasons", e[e.InternalServerError = 500] = "InternalServerError", e[e.NotImplemented = 501] = "NotImplemented", e[e.BadGateway = 502] = "BadGateway", e[e.ServiceUnavailable = 503] = "ServiceUnavailable", e[e.GatewayTimeout = 504] = "GatewayTimeout", e[e.HttpVersionNotSupported = 505] = "HttpVersionNotSupported", e[e.VariantAlsoNegotiates = 506] = "VariantAlsoNegotiates", e[e.InsufficientStorage = 507] = "InsufficientStorage", e[e.LoopDetected = 508] = "LoopDetected", e[e.NotExtended = 510] = "NotExtended", e[e.NetworkAuthenticationRequired = 511] = "NetworkAuthenticationRequired", e))(he || {});
|
|
5882
5877
|
class F extends Error {
|
|
@@ -5905,15 +5900,15 @@ function le(e) {
|
|
|
5905
5900
|
message: e
|
|
5906
5901
|
} : t = e), t;
|
|
5907
5902
|
}
|
|
5908
|
-
const
|
|
5903
|
+
const Qo = {
|
|
5909
5904
|
NotFound404: (e) => new Ue(le(e)),
|
|
5910
5905
|
Unauthorized401: (e) => new je(le(e)),
|
|
5911
5906
|
HttpError: (e, t) => new F(e, le(t)),
|
|
5912
5907
|
Conflict409: (e) => new Fe(le(e))
|
|
5913
|
-
},
|
|
5908
|
+
}, Ko = {
|
|
5914
5909
|
getDate: (e) => e ? new Date(e) : /* @__PURE__ */ new Date()
|
|
5915
|
-
}, De = (e, t) =>
|
|
5916
|
-
class
|
|
5910
|
+
}, De = (e, t) => It(e) ? e.map((r) => De(r, t)) : Nt(e) ? Sr(e, (r) => De(r, t)) : t(e);
|
|
5911
|
+
class Zo {
|
|
5917
5912
|
constructor() {
|
|
5918
5913
|
this.cookies = {};
|
|
5919
5914
|
}
|
|
@@ -5927,7 +5922,7 @@ class Ko {
|
|
|
5927
5922
|
}), new Headers(t);
|
|
5928
5923
|
}
|
|
5929
5924
|
}
|
|
5930
|
-
class
|
|
5925
|
+
class ea {
|
|
5931
5926
|
constructor() {
|
|
5932
5927
|
this.headers = {};
|
|
5933
5928
|
}
|
|
@@ -5941,7 +5936,7 @@ class Zo {
|
|
|
5941
5936
|
}), new Headers(t);
|
|
5942
5937
|
}
|
|
5943
5938
|
}
|
|
5944
|
-
class
|
|
5939
|
+
class ta {
|
|
5945
5940
|
constructor(t, r, s) {
|
|
5946
5941
|
this.definition = t, this.db = r, this.authService = s, this.apiStateHash = {}, this.resolvedHelpers = De(t.helpers, (n) => typeof n == "string" ? (...i) => this.runFn(n, ...i) : n);
|
|
5947
5942
|
}
|
|
@@ -5959,7 +5954,7 @@ class ea {
|
|
|
5959
5954
|
$db: this.db,
|
|
5960
5955
|
$state: this.apiStateHash,
|
|
5961
5956
|
$authService: this.authService,
|
|
5962
|
-
$env:
|
|
5957
|
+
$env: Ko,
|
|
5963
5958
|
$loggedInUser: this.authService.getLoggedInUser(),
|
|
5964
5959
|
$pathParams: (i = r[0]) == null ? void 0 : i.pathParams,
|
|
5965
5960
|
$queryParams: (a = r[0]) == null ? void 0 : a.queryParams,
|
|
@@ -5971,22 +5966,22 @@ class ea {
|
|
|
5971
5966
|
$headerService: r[2]
|
|
5972
5967
|
//TODO really ugly, temporary solution
|
|
5973
5968
|
};
|
|
5974
|
-
const n =
|
|
5969
|
+
const n = ra({
|
|
5975
5970
|
localContext: s,
|
|
5976
5971
|
eventArgs: r,
|
|
5977
5972
|
appContext: {
|
|
5978
|
-
...qr,
|
|
5979
5973
|
...Mr,
|
|
5980
|
-
|
|
5981
|
-
|
|
5974
|
+
...$r,
|
|
5975
|
+
delay: Ur,
|
|
5976
|
+
Errors: Qo,
|
|
5982
5977
|
createFile: (...d) => new File(d[0], d[1], d[2]),
|
|
5983
|
-
getDate:
|
|
5978
|
+
getDate: jr
|
|
5984
5979
|
}
|
|
5985
5980
|
});
|
|
5986
|
-
return await
|
|
5981
|
+
return await qr(t, n), (h = (u = n.mainThread) == null ? void 0 : u.blocks) != null && h.length ? n.mainThread.blocks[n.mainThread.blocks.length - 1].returnValue : void 0;
|
|
5987
5982
|
}
|
|
5988
5983
|
}
|
|
5989
|
-
function
|
|
5984
|
+
function ra(e) {
|
|
5990
5985
|
return {
|
|
5991
5986
|
mainThread: {
|
|
5992
5987
|
childThreads: [],
|
|
@@ -6084,7 +6079,7 @@ class x {
|
|
|
6084
6079
|
return new x(this.list.slice(t, r + t));
|
|
6085
6080
|
}
|
|
6086
6081
|
}
|
|
6087
|
-
class
|
|
6082
|
+
class na {
|
|
6088
6083
|
constructor(t, r = {}, s) {
|
|
6089
6084
|
this.tables = t, this.initialData = r, this.config = s, this.db = null, this.getItems = (n) => this.getDb().table(n).toArray(), this.findItems = async (n, i) => {
|
|
6090
6085
|
const a = await this.getItems(n), l = await Promise.all(a.map(i));
|
|
@@ -6122,26 +6117,25 @@ class ra {
|
|
|
6122
6117
|
}
|
|
6123
6118
|
})
|
|
6124
6119
|
), s.forEach((c) => {
|
|
6125
|
-
this[`$${c}`] =
|
|
6120
|
+
this[`$${c}`] = sa(this.getDb().table(c));
|
|
6126
6121
|
});
|
|
6127
6122
|
}
|
|
6128
6123
|
createDbInstance() {
|
|
6129
6124
|
var t;
|
|
6130
|
-
return new
|
|
6125
|
+
return new We(((t = this.config) == null ? void 0 : t.database) ?? "defaultIndexDb");
|
|
6131
6126
|
}
|
|
6132
6127
|
async dropDbOnVersionChange(t) {
|
|
6133
6128
|
const r = this.createDbInstance();
|
|
6134
|
-
return await
|
|
6129
|
+
return await We.exists(r.name) ? (await r.open(), r.verno !== t ? (await r.delete(), !0) : (r.close(), !1)) : !0;
|
|
6135
6130
|
}
|
|
6136
6131
|
// --- This method signifies that a section of operations is executed in a transaction
|
|
6137
6132
|
async transaction(t) {
|
|
6138
|
-
if (!this.db)
|
|
6139
|
-
return;
|
|
6133
|
+
if (!this.db) return;
|
|
6140
6134
|
const r = this.db.tables;
|
|
6141
6135
|
await this.db.transaction("rw", r, t);
|
|
6142
6136
|
}
|
|
6143
6137
|
}
|
|
6144
|
-
async function
|
|
6138
|
+
async function sa(e) {
|
|
6145
6139
|
const t = () => e.db.table(e.name), r = async (s) => {
|
|
6146
6140
|
const n = await e.toArray(), i = await Promise.all(n.map(s ?? (async () => !0)));
|
|
6147
6141
|
return n.filter((a, l) => i[l]);
|
|
@@ -6183,13 +6177,11 @@ async function na(e) {
|
|
|
6183
6177
|
skipTake: async (s, n) => await new x(await e.toArray()).skipTake(s, n)
|
|
6184
6178
|
};
|
|
6185
6179
|
}
|
|
6186
|
-
function
|
|
6187
|
-
if (!t)
|
|
6188
|
-
return e;
|
|
6180
|
+
function At(e, t) {
|
|
6181
|
+
if (!t) return e;
|
|
6189
6182
|
const r = { ...e };
|
|
6190
6183
|
return Object.keys(e).forEach((s) => {
|
|
6191
|
-
if (!(s in t))
|
|
6192
|
-
return;
|
|
6184
|
+
if (!(s in t)) return;
|
|
6193
6185
|
const n = e[s], i = typeof n;
|
|
6194
6186
|
switch (t[s]) {
|
|
6195
6187
|
case "integer":
|
|
@@ -6244,10 +6236,10 @@ function Ot(e, t) {
|
|
|
6244
6236
|
}
|
|
6245
6237
|
}), r;
|
|
6246
6238
|
}
|
|
6247
|
-
function
|
|
6239
|
+
function ia(...e) {
|
|
6248
6240
|
const t = {};
|
|
6249
6241
|
for (const r of e) {
|
|
6250
|
-
if (!
|
|
6242
|
+
if (!Nt(r))
|
|
6251
6243
|
throw new TypeError("All arguments must be of type object");
|
|
6252
6244
|
const s = new Headers(r);
|
|
6253
6245
|
for (const [n, i] of s.entries())
|
|
@@ -6255,7 +6247,7 @@ function sa(...e) {
|
|
|
6255
6247
|
}
|
|
6256
6248
|
return new Headers(t);
|
|
6257
6249
|
}
|
|
6258
|
-
class
|
|
6250
|
+
class oa {
|
|
6259
6251
|
constructor(t) {
|
|
6260
6252
|
const r = JSON.parse(sessionStorage.getItem("session-logged-in-user"));
|
|
6261
6253
|
this.loggedInUser = r || (t == null ? void 0 : t.defaultLoggedInUser);
|
|
@@ -6276,7 +6268,7 @@ class ia {
|
|
|
6276
6268
|
return this.loggedInUser;
|
|
6277
6269
|
}
|
|
6278
6270
|
}
|
|
6279
|
-
class
|
|
6271
|
+
class aa {
|
|
6280
6272
|
constructor(t) {
|
|
6281
6273
|
this.apiDef = t, this.backend = null;
|
|
6282
6274
|
}
|
|
@@ -6286,13 +6278,13 @@ class oa {
|
|
|
6286
6278
|
Object.entries(this.apiDef.operations || {}).forEach(([a, l]) => {
|
|
6287
6279
|
t[a] = l.handler;
|
|
6288
6280
|
});
|
|
6289
|
-
const r = new
|
|
6281
|
+
const r = new oa(this.apiDef.auth), s = new na((i = this.apiDef.schemaDescriptor) == null ? void 0 : i.tables, this.apiDef.initialData, this.apiDef.config);
|
|
6290
6282
|
await s.initialize();
|
|
6291
6283
|
const n = {
|
|
6292
6284
|
operations: t,
|
|
6293
6285
|
helpers: this.apiDef.helpers
|
|
6294
6286
|
};
|
|
6295
|
-
this.backend = new
|
|
6287
|
+
this.backend = new ta(n, s, r);
|
|
6296
6288
|
}
|
|
6297
6289
|
getOperations() {
|
|
6298
6290
|
return this.apiDef.operations || {};
|
|
@@ -6317,8 +6309,7 @@ class oa {
|
|
|
6317
6309
|
f.length === 1 ? d[m] = f[0] : d[m] = f;
|
|
6318
6310
|
}
|
|
6319
6311
|
a = d;
|
|
6320
|
-
} else
|
|
6321
|
-
i.requestShape === "blob" ? a = await r.blob() : a = await r.json();
|
|
6312
|
+
} else i.requestShape === "blob" ? a = await r.blob() : a = await r.json();
|
|
6322
6313
|
} catch {
|
|
6323
6314
|
}
|
|
6324
6315
|
const l = this.convertRequestParams(
|
|
@@ -6331,10 +6322,10 @@ class oa {
|
|
|
6331
6322
|
},
|
|
6332
6323
|
i
|
|
6333
6324
|
);
|
|
6334
|
-
await
|
|
6335
|
-
const o = new
|
|
6325
|
+
await Dr();
|
|
6326
|
+
const o = new Zo(), c = new ea();
|
|
6336
6327
|
try {
|
|
6337
|
-
const h = await this.backend.executeOperation(t, l, o, c), d = h == null, m = i.successStatusCode ?? (d ? he.NoContent : he.Ok), f =
|
|
6328
|
+
const h = await this.backend.executeOperation(t, l, o, c), d = h == null, m = i.successStatusCode ?? (d ? he.NoContent : he.Ok), f = ia(o.getCookieHeader(), c.getHeaders());
|
|
6338
6329
|
return h instanceof File ? (f.append("Content-type", h.type), f.append("Content-Length", h.size + ""), f.append("Content-Disposition", `attachment; filename="${h.name}"; filename*=utf-8''${h.name}`), K.arrayBuffer(await h.arrayBuffer(), {
|
|
6339
6330
|
headers: f,
|
|
6340
6331
|
status: m
|
|
@@ -6346,7 +6337,7 @@ class oa {
|
|
|
6346
6337
|
status: m
|
|
6347
6338
|
});
|
|
6348
6339
|
} catch (h) {
|
|
6349
|
-
return console.error(h), h instanceof
|
|
6340
|
+
return console.error(h), h instanceof Fr && h.errorObject instanceof F ? K.json(h.errorObject.details, {
|
|
6350
6341
|
headers: o.getCookieHeader(),
|
|
6351
6342
|
status: h.errorObject.status
|
|
6352
6343
|
}) : K.json(
|
|
@@ -6362,29 +6353,29 @@ class oa {
|
|
|
6362
6353
|
convertRequestParams(t, r) {
|
|
6363
6354
|
return {
|
|
6364
6355
|
...t,
|
|
6365
|
-
pathParams:
|
|
6366
|
-
queryParams:
|
|
6356
|
+
pathParams: At(t.pathParams, r.pathParamTypes),
|
|
6357
|
+
queryParams: At(t.queryParams, r.queryParamTypes)
|
|
6367
6358
|
};
|
|
6368
6359
|
}
|
|
6369
6360
|
}
|
|
6370
|
-
function
|
|
6361
|
+
function ca(e) {
|
|
6371
6362
|
const t = e.getOperations();
|
|
6372
6363
|
let r = [];
|
|
6373
6364
|
return Object.entries(t).forEach(([s, n]) => {
|
|
6374
6365
|
let i = [n.url];
|
|
6375
|
-
|
|
6366
|
+
It(n.url) && (i = n.url), i.forEach((a) => {
|
|
6376
6367
|
r.push(
|
|
6377
|
-
|
|
6368
|
+
Cr[n.method](`${e.getApiUrl()}${a}`, async ({ request: l, cookies: o, params: c }) => await e.executeOperation(s, l, o, c))
|
|
6378
6369
|
);
|
|
6379
6370
|
});
|
|
6380
6371
|
}), r;
|
|
6381
6372
|
}
|
|
6382
|
-
const
|
|
6383
|
-
const t = new
|
|
6373
|
+
const fa = async (e) => {
|
|
6374
|
+
const t = new aa(e);
|
|
6384
6375
|
await t.initialize();
|
|
6385
|
-
const r =
|
|
6386
|
-
return
|
|
6376
|
+
const r = ca(t);
|
|
6377
|
+
return Jo(...r);
|
|
6387
6378
|
};
|
|
6388
6379
|
export {
|
|
6389
|
-
|
|
6380
|
+
fa as createApiInterceptorWorker
|
|
6390
6381
|
};
|