apiuikit 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CodeSamples-CXtSA6EK.js → CodeSamples-6zm8Tjnl.js} +763 -781
- package/dist/{CodeSamples-D7dq1xEM.cjs → CodeSamples-OTh-LQZJ.cjs} +33 -33
- package/dist/apiuikit.cjs.js +1 -1
- package/dist/apiuikit.css +1 -1
- package/dist/apiuikit.es.js +1 -1
- package/dist/{index-BoAORjov.cjs → index-B-1zJx9W.cjs} +1 -1
- package/dist/{index-CZjVUeK4.cjs → index-BlUAYvlu.cjs} +1 -1
- package/dist/{index-BMRPdMaB.js → index-CdicOrT3.js} +1 -1
- package/dist/{index-ib-tk7y5.js → index-DNLwvW38.js} +1 -1
- package/dist/{index-BJ0X8yP3.cjs → index-D_7O8w46.cjs} +13 -13
- package/dist/{index-DwzxTmOd.js → index-DxCSxdSs.js} +178 -177
- package/dist/{protoToJsonSchema-Btyc_WLL.js → protoToJsonSchema-BiGedOci.js} +1 -1
- package/dist/{protoToJsonSchema-wxazjeYy.cjs → protoToJsonSchema-CXmX3vNq.cjs} +1 -1
- package/dist/{protobufSchemaParser-9KjS7p8W.js → protobufSchemaParser-Bq5Fy-MT.js} +2 -2
- package/dist/{protobufSchemaParser-G1NujZ28.cjs → protobufSchemaParser-CsPesPSp.cjs} +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { g as
|
|
4
|
-
function
|
|
1
|
+
import { jsxs as or, jsx as Ne } from "react/jsx-runtime";
|
|
2
|
+
import { useId as Cn, useMemo as ze, useState as gt, useEffect as ir } from "react";
|
|
3
|
+
import { g as kn, c as rt, a as An, H as Kr, u as Rn, C as Nn } from "./index-DxCSxdSs.js";
|
|
4
|
+
function Dr(t, e = /* @__PURE__ */ new Set()) {
|
|
5
5
|
if (e.has(t)) return t;
|
|
6
6
|
if (t.type === "object" && t.properties && typeof t.properties == "object") {
|
|
7
7
|
e.add(t);
|
|
@@ -9,7 +9,7 @@ function en(t, e = /* @__PURE__ */ new Set()) {
|
|
|
9
9
|
const r = {};
|
|
10
10
|
for (const [n, s] of Object.entries(t.properties)) {
|
|
11
11
|
const o = /id$/i.test(n) && s.type === "string" && !s.format && !s.examples, a = s.type === "string" && !s.format && !s.examples && !s.enum;
|
|
12
|
-
r[n] = o ? { ...s, format: "uuid" } : a ? { ...s, examples: ["string"] } :
|
|
12
|
+
r[n] = o ? { ...s, format: "uuid" } : a ? { ...s, examples: ["string"] } : Dr(s, e);
|
|
13
13
|
}
|
|
14
14
|
return { ...t, properties: r };
|
|
15
15
|
} finally {
|
|
@@ -18,10 +18,10 @@ function en(t, e = /* @__PURE__ */ new Set()) {
|
|
|
18
18
|
}
|
|
19
19
|
return t;
|
|
20
20
|
}
|
|
21
|
-
async function
|
|
21
|
+
async function qn(t) {
|
|
22
22
|
try {
|
|
23
23
|
const { generate: e } = await import("./index-DCDYBZcY.js");
|
|
24
|
-
return await e(
|
|
24
|
+
return await e(Dr(t), {
|
|
25
25
|
seed: 42,
|
|
26
26
|
useExamplesValue: !0,
|
|
27
27
|
optionalsProbability: 1
|
|
@@ -30,7 +30,7 @@ async function Fn(t) {
|
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
const
|
|
33
|
+
const ar = "", sr = `
|
|
34
34
|
`;
|
|
35
35
|
var E = class {
|
|
36
36
|
/**
|
|
@@ -38,7 +38,7 @@ var E = class {
|
|
|
38
38
|
* Lines are aggregated in a `code` array, and need to be joined to obtain a proper code snippet.
|
|
39
39
|
*/
|
|
40
40
|
constructor({ indent: t, join: e } = {}) {
|
|
41
|
-
this.postProcessors = [], this.code = [], this.indentationCharacter =
|
|
41
|
+
this.postProcessors = [], this.code = [], this.indentationCharacter = ar, this.lineJoin = sr, this.indentLine = (r, n = 0) => `${this.indentationCharacter.repeat(n)}${r}`, this.unshift = (r, n) => {
|
|
42
42
|
const s = this.indentLine(r, n);
|
|
43
43
|
this.code.unshift(s);
|
|
44
44
|
}, this.push = (r, n) => {
|
|
@@ -55,18 +55,18 @@ var E = class {
|
|
|
55
55
|
return this.postProcessors.reduce((n, s) => s(n), r);
|
|
56
56
|
}, this.addPostProcessor = (r) => {
|
|
57
57
|
this.postProcessors = [...this.postProcessors, r];
|
|
58
|
-
}, this.indentationCharacter = t ||
|
|
58
|
+
}, this.indentationCharacter = t || ar, this.lineJoin = e ?? sr;
|
|
59
59
|
}
|
|
60
|
-
},
|
|
60
|
+
}, _n = function(t) {
|
|
61
61
|
return Object.prototype.toString.call(t) === "[object RegExp]";
|
|
62
|
-
},
|
|
62
|
+
}, Ln = function(t) {
|
|
63
63
|
var e = typeof t;
|
|
64
64
|
return t !== null && (e === "object" || e === "function");
|
|
65
|
-
},
|
|
66
|
-
Object.defineProperty(
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
var
|
|
65
|
+
}, Qt = {};
|
|
66
|
+
Object.defineProperty(Qt, "__esModule", { value: !0 });
|
|
67
|
+
Qt.default = (t) => Object.getOwnPropertySymbols(t).filter((e) => Object.prototype.propertyIsEnumerable.call(t, e));
|
|
68
|
+
const In = _n, Un = Ln, Fn = Qt.default;
|
|
69
|
+
var Hn = (t, e, r) => {
|
|
70
70
|
const n = [];
|
|
71
71
|
return (function s(o, a, i) {
|
|
72
72
|
a = a || {}, a.indent = a.indent || " ", i = i || "";
|
|
@@ -93,7 +93,7 @@ var Gn = (t, e, r) => {
|
|
|
93
93
|
};
|
|
94
94
|
if (n.indexOf(o) !== -1)
|
|
95
95
|
return '"[Circular]"';
|
|
96
|
-
if (o == null || typeof o == "number" || typeof o == "boolean" || typeof o == "function" || typeof o == "symbol" ||
|
|
96
|
+
if (o == null || typeof o == "number" || typeof o == "boolean" || typeof o == "function" || typeof o == "symbol" || In(o))
|
|
97
97
|
return String(o);
|
|
98
98
|
if (o instanceof Date)
|
|
99
99
|
return `new Date('${o.toISOString()}')`;
|
|
@@ -101,22 +101,22 @@ var Gn = (t, e, r) => {
|
|
|
101
101
|
if (o.length === 0)
|
|
102
102
|
return "[]";
|
|
103
103
|
n.push(o);
|
|
104
|
-
const f = "[" + c.newLine + o.map((u,
|
|
105
|
-
const
|
|
104
|
+
const f = "[" + c.newLine + o.map((u, d) => {
|
|
105
|
+
const p = o.length - 1 === d ? c.newLine : "," + c.newLineOrSpace;
|
|
106
106
|
let h = s(u, a, i + a.indent);
|
|
107
|
-
return a.transform && (h = a.transform(o,
|
|
107
|
+
return a.transform && (h = a.transform(o, d, h)), c.indent + h + p;
|
|
108
108
|
}).join("") + c.pad + "]";
|
|
109
109
|
return n.pop(), l(f);
|
|
110
110
|
}
|
|
111
|
-
if (
|
|
112
|
-
let f = Object.keys(o).concat(
|
|
113
|
-
if (a.filter && (f = f.filter((
|
|
111
|
+
if (Un(o)) {
|
|
112
|
+
let f = Object.keys(o).concat(Fn(o));
|
|
113
|
+
if (a.filter && (f = f.filter((d) => a.filter(o, d))), f.length === 0)
|
|
114
114
|
return "{}";
|
|
115
115
|
n.push(o);
|
|
116
|
-
const u = "{" + c.newLine + f.map((
|
|
117
|
-
const h = f.length - 1 ===
|
|
118
|
-
let m = s(o[
|
|
119
|
-
return a.transform && (m = a.transform(o,
|
|
116
|
+
const u = "{" + c.newLine + f.map((d, p) => {
|
|
117
|
+
const h = f.length - 1 === p ? c.newLine : "," + c.newLineOrSpace, y = typeof d == "symbol", g = !y && /^[a-z$_][a-z$_0-9]*$/i.test(d), $ = y || g ? d : s(d, a);
|
|
118
|
+
let m = s(o[d], a, i + a.indent);
|
|
119
|
+
return a.transform && (m = a.transform(o, d, m)), c.indent + String($) + ": " + m + h;
|
|
120
120
|
}).join("") + c.pad + "}";
|
|
121
121
|
return n.pop(), l(u);
|
|
122
122
|
}
|
|
@@ -124,17 +124,17 @@ var Gn = (t, e, r) => {
|
|
|
124
124
|
` ? "\\n" : "\\r"), a.singleQuotes === !1 ? (o = o.replace(/"/g, '\\"'), `"${o}"`) : (o = o.replace(/\\?'/g, "\\'"), `'${o}'`);
|
|
125
125
|
})(t, e, r);
|
|
126
126
|
};
|
|
127
|
-
const oe = /* @__PURE__ */
|
|
127
|
+
const oe = /* @__PURE__ */ kn(Hn), J = (t, e) => Object.keys(t).find((r) => r.toLowerCase() === e.toLowerCase()), se = (t, e) => {
|
|
128
128
|
const r = J(t, e);
|
|
129
129
|
if (r)
|
|
130
130
|
return t[r];
|
|
131
|
-
}, nt = (t, e) => !!J(t, e),
|
|
131
|
+
}, nt = (t, e) => !!J(t, e), Mn = (t) => [
|
|
132
132
|
"application/json",
|
|
133
133
|
"application/x-json",
|
|
134
134
|
"text/json",
|
|
135
135
|
"text/x-json",
|
|
136
136
|
"+json"
|
|
137
|
-
].some((e) => t.indexOf(e) > -1),
|
|
137
|
+
].some((e) => t.indexOf(e) > -1), Bn = {
|
|
138
138
|
info: {
|
|
139
139
|
key: "agent",
|
|
140
140
|
title: "Agent",
|
|
@@ -168,7 +168,7 @@ function He(t, e = {}) {
|
|
|
168
168
|
return [...t.toString()].map((o) => o === "\b" ? `${n}b` : o === " " ? `${n}t` : o === `
|
|
169
169
|
` ? s ? `${n}n` : o : o === "\f" ? `${n}f` : o === "\r" ? s ? `${n}r` : o : o === n ? n + n : o === r ? n + r : o < " " || o > "~" ? JSON.stringify(o).slice(1, -1) : o).join("");
|
|
170
170
|
}
|
|
171
|
-
const Ce = (t) => He(t, { delimiter: "'" }), I = (t) => He(t, { delimiter: '"' }),
|
|
171
|
+
const Ce = (t) => He(t, { delimiter: "'" }), I = (t) => He(t, { delimiter: '"' }), Wn = {
|
|
172
172
|
info: {
|
|
173
173
|
key: "c",
|
|
174
174
|
title: "C",
|
|
@@ -193,23 +193,23 @@ const Ce = (t) => He(t, { delimiter: "'" }), I = (t) => He(t, { delimiter: '"' }
|
|
|
193
193
|
}
|
|
194
194
|
} }
|
|
195
195
|
};
|
|
196
|
-
var
|
|
196
|
+
var cr = class {
|
|
197
197
|
constructor(t) {
|
|
198
198
|
this.name = "", this.toString = () => `:${this.name}`, this.name = t;
|
|
199
199
|
}
|
|
200
|
-
},
|
|
200
|
+
}, Jn = class {
|
|
201
201
|
constructor(t) {
|
|
202
202
|
this.path = "", this.toString = () => `(clojure.java.io/file "${this.path}")`, this.path = t;
|
|
203
203
|
}
|
|
204
204
|
};
|
|
205
|
-
const
|
|
205
|
+
const Qr = (t) => t === void 0 ? null : t === null ? "null" : t.constructor.name.toLowerCase(), Yr = (t) => t === void 0 ? !0 : Qr(t) === "object" ? Object.keys(t).length === 0 : !1, lr = (t) => (Object.keys(t).filter((e) => Yr(t[e])).forEach((e) => {
|
|
206
206
|
delete t[e];
|
|
207
207
|
}), t), Qe = (t, e) => {
|
|
208
208
|
const r = " ".repeat(t);
|
|
209
209
|
return e.replace(/\n/g, `
|
|
210
210
|
${r}`);
|
|
211
|
-
},
|
|
212
|
-
switch (
|
|
211
|
+
}, It = (t) => {
|
|
212
|
+
switch (Qr(t)) {
|
|
213
213
|
case "string":
|
|
214
214
|
return `"${t.replace(/"/g, '\\"')}"`;
|
|
215
215
|
case "file":
|
|
@@ -221,18 +221,18 @@ ${r}`);
|
|
|
221
221
|
case "regexp":
|
|
222
222
|
return `#"${t.source}"`;
|
|
223
223
|
case "object": {
|
|
224
|
-
const e = Object.keys(t).reduce((r, n) => `${r}:${n} ${Qe(n.length + 2,
|
|
224
|
+
const e = Object.keys(t).reduce((r, n) => `${r}:${n} ${Qe(n.length + 2, It(t[n]))}
|
|
225
225
|
`, "").trim();
|
|
226
226
|
return `{${Qe(1, e)}}`;
|
|
227
227
|
}
|
|
228
228
|
case "array": {
|
|
229
|
-
const e = t.reduce((r, n) => `${r} ${
|
|
229
|
+
const e = t.reduce((r, n) => `${r} ${It(n)}`, "").trim();
|
|
230
230
|
return `[${Qe(1, e)}]`;
|
|
231
231
|
}
|
|
232
232
|
default:
|
|
233
233
|
return t.toString();
|
|
234
234
|
}
|
|
235
|
-
},
|
|
235
|
+
}, Gn = {
|
|
236
236
|
info: {
|
|
237
237
|
key: "clojure",
|
|
238
238
|
title: "Clojure",
|
|
@@ -265,7 +265,7 @@ ${r}`);
|
|
|
265
265
|
switch (r.mimeType) {
|
|
266
266
|
case "application/json":
|
|
267
267
|
{
|
|
268
|
-
l["content-type"] = new
|
|
268
|
+
l["content-type"] = new cr("json"), l["form-params"] = r.jsonObj;
|
|
269
269
|
const f = J(l.headers, "content-type");
|
|
270
270
|
f && delete l.headers[f];
|
|
271
271
|
}
|
|
@@ -288,7 +288,7 @@ ${r}`);
|
|
|
288
288
|
if (r.params) {
|
|
289
289
|
l.multipart = r.params.map((u) => u.fileName && !u.value ? {
|
|
290
290
|
name: u.name,
|
|
291
|
-
content: new
|
|
291
|
+
content: new Jn(u.fileName)
|
|
292
292
|
} : {
|
|
293
293
|
name: u.name,
|
|
294
294
|
content: u.value
|
|
@@ -301,22 +301,22 @@ ${r}`);
|
|
|
301
301
|
switch (se(l.headers, "accept")) {
|
|
302
302
|
case "application/json":
|
|
303
303
|
{
|
|
304
|
-
l.accept = new
|
|
304
|
+
l.accept = new cr("json");
|
|
305
305
|
const f = J(l.headers, "accept");
|
|
306
306
|
f && delete l.headers[f];
|
|
307
307
|
}
|
|
308
308
|
break;
|
|
309
309
|
}
|
|
310
310
|
if (a(`(require '[clj-http.client :as client])
|
|
311
|
-
`),
|
|
311
|
+
`), Yr(lr(l))) a(`(client/${e} "${n}")`);
|
|
312
312
|
else {
|
|
313
|
-
const f = 11 + e.length + n.length, u = Qe(f,
|
|
313
|
+
const f = 11 + e.length + n.length, u = Qe(f, It(lr(l)));
|
|
314
314
|
a(`(client/${e} "${n}" ${u})`);
|
|
315
315
|
}
|
|
316
316
|
return i();
|
|
317
317
|
}
|
|
318
318
|
} }
|
|
319
|
-
},
|
|
319
|
+
}, zn = {
|
|
320
320
|
info: {
|
|
321
321
|
key: "crystal",
|
|
322
322
|
title: "Crystal",
|
|
@@ -345,11 +345,11 @@ ${r}`);
|
|
|
345
345
|
"PATCH",
|
|
346
346
|
"PUT",
|
|
347
347
|
"OPTIONS"
|
|
348
|
-
],
|
|
349
|
-
return u.includes(f) ? a(`response = HTTP::Client.${f.toLowerCase()} url${
|
|
348
|
+
], d = l.length ? ", headers: headers" : "", p = r.text ? ", body: reqBody" : "", h = o ? ", tls: OpenSSL::SSL::Context::Client.insecure" : "";
|
|
349
|
+
return u.includes(f) ? a(`response = HTTP::Client.${f.toLowerCase()} url${d}${p}${h}`) : a(`response = HTTP::Client.exec "${f}", url${d}${p}${h}`), a("puts response.body"), c();
|
|
350
350
|
}
|
|
351
351
|
} }
|
|
352
|
-
},
|
|
352
|
+
}, Vn = (t) => {
|
|
353
353
|
let e = se(t, "accept-encoding");
|
|
354
354
|
if (!e) return [];
|
|
355
355
|
const r = {
|
|
@@ -365,7 +365,7 @@ ${r}`);
|
|
|
365
365
|
}
|
|
366
366
|
});
|
|
367
367
|
}), n;
|
|
368
|
-
},
|
|
368
|
+
}, Kn = {
|
|
369
369
|
info: {
|
|
370
370
|
key: "httpclient",
|
|
371
371
|
title: "HttpClient",
|
|
@@ -374,14 +374,14 @@ ${r}`);
|
|
|
374
374
|
extname: ".cs"
|
|
375
375
|
},
|
|
376
376
|
convert: ({ allHeaders: t, postData: e, method: r, fullUrl: n }, s) => {
|
|
377
|
-
var
|
|
377
|
+
var d, p;
|
|
378
378
|
const { push: o, join: a } = new E({ indent: {
|
|
379
379
|
indent: " ",
|
|
380
380
|
...s
|
|
381
381
|
}.indent });
|
|
382
382
|
o("using System.Net.Http.Headers;");
|
|
383
383
|
let i = "";
|
|
384
|
-
const c = !!t.cookie, l =
|
|
384
|
+
const c = !!t.cookie, l = Vn(t);
|
|
385
385
|
(c || l.length) && (i = "clientHandler", o("var clientHandler = new HttpClientHandler"), o("{"), c && o("UseCookies = false,", 1), l.length && o(`AutomaticDecompression = ${l.join(" | ")},`, 1), o("};")), o(`var client = new HttpClient(${i});`), o("var request = new HttpRequestMessage"), o("{");
|
|
386
386
|
const f = [
|
|
387
387
|
"GET",
|
|
@@ -410,12 +410,12 @@ ${r}`);
|
|
|
410
410
|
const h = e.mimeType;
|
|
411
411
|
switch (h) {
|
|
412
412
|
case "application/x-www-form-urlencoded":
|
|
413
|
-
o("Content = new FormUrlEncodedContent(new Dictionary<string, string>", 1), o("{", 1), (
|
|
413
|
+
o("Content = new FormUrlEncodedContent(new Dictionary<string, string>", 1), o("{", 1), (d = e.params) == null || d.forEach((y) => {
|
|
414
414
|
o(`{ "${y.name}", "${y.value}" },`, 2);
|
|
415
415
|
}), o("}),", 1);
|
|
416
416
|
break;
|
|
417
417
|
case "multipart/form-data":
|
|
418
|
-
o("Content = new MultipartFormDataContent", 1), o("{", 1), (
|
|
418
|
+
o("Content = new MultipartFormDataContent", 1), o("{", 1), (p = e.params) == null || p.forEach((y) => {
|
|
419
419
|
o(`new StringContent(${JSON.stringify(y.value || "")})`, 2), o("{", 2), o("Headers =", 3), o("{", 3), y.contentType && o(`ContentType = new MediaTypeHeaderValue("${y.contentType}"),`, 4), o('ContentDisposition = new ContentDispositionHeaderValue("form-data")', 4), o("{", 4), o(`Name = "${y.name}",`, 5), y.fileName && o(`FileName = "${y.fileName}",`, 5), o("}", 4), o("}", 3), o("},", 2);
|
|
420
420
|
}), o("},", 1);
|
|
421
421
|
break;
|
|
@@ -427,10 +427,10 @@ ${r}`);
|
|
|
427
427
|
return o("};"), o("using (var response = await client.SendAsync(request))"), o("{"), o("response.EnsureSuccessStatusCode();", 1), o("var body = await response.Content.ReadAsStringAsync();", 1), o("Console.WriteLine(body);", 1), o("}"), a();
|
|
428
428
|
}
|
|
429
429
|
};
|
|
430
|
-
function
|
|
430
|
+
function Dn(t) {
|
|
431
431
|
return t[0].toUpperCase() + t.slice(1).toLowerCase();
|
|
432
432
|
}
|
|
433
|
-
const
|
|
433
|
+
const Qn = {
|
|
434
434
|
info: {
|
|
435
435
|
key: "csharp",
|
|
436
436
|
title: "C#",
|
|
@@ -438,7 +438,7 @@ const to = {
|
|
|
438
438
|
cli: "dotnet"
|
|
439
439
|
},
|
|
440
440
|
clientsById: {
|
|
441
|
-
httpclient:
|
|
441
|
+
httpclient: Kn,
|
|
442
442
|
restsharp: {
|
|
443
443
|
info: {
|
|
444
444
|
key: "restsharp",
|
|
@@ -492,13 +492,13 @@ const to = {
|
|
|
492
492
|
if (!s.text) break;
|
|
493
493
|
a(`request.AddStringBody("${s.text}", "${s.mimeType}");`);
|
|
494
494
|
}
|
|
495
|
-
return a(`var response = await client.${
|
|
495
|
+
return a(`var response = await client.${Dn(t)}Async(request);
|
|
496
496
|
`), a(`Console.WriteLine("{0}", response.Content);
|
|
497
497
|
`), i();
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
|
-
},
|
|
501
|
+
}, Yn = {
|
|
502
502
|
info: {
|
|
503
503
|
key: "go",
|
|
504
504
|
title: "Go",
|
|
@@ -514,18 +514,18 @@ const to = {
|
|
|
514
514
|
extname: ".go"
|
|
515
515
|
},
|
|
516
516
|
convert: ({ postData: t, method: e, allHeaders: r, fullUrl: n }, s = {}) => {
|
|
517
|
-
const { blank: o, push: a, join: i } = new E({ indent: " " }), { showBoilerplate: c = !0, checkErrors: l = !1, printBody: f = !0, timeout: u = -1, insecureSkipVerify:
|
|
517
|
+
const { blank: o, push: a, join: i } = new E({ indent: " " }), { showBoilerplate: c = !0, checkErrors: l = !1, printBody: f = !0, timeout: u = -1, insecureSkipVerify: d = !1 } = s, p = l ? "err" : "_", h = c ? 1 : 0, y = () => {
|
|
518
518
|
l && (a("if err != nil {", h), a("panic(err)", h + 1), a("}", h));
|
|
519
519
|
};
|
|
520
|
-
c && (a("package main"), o(), a("import ("), a('"fmt"', h), u > 0 && a('"time"', h),
|
|
521
|
-
const g = u > 0, $ = g ||
|
|
522
|
-
return $ && (a("client := http.Client{", h), g && a(`Timeout: time.Duration(${u} * time.Second),`, h + 1),
|
|
520
|
+
c && (a("package main"), o(), a("import ("), a('"fmt"', h), u > 0 && a('"time"', h), d && a('"crypto/tls"', h), t.text && a('"strings"', h), a('"net/http"', h), f && a('"io"', h), a(")"), o(), a("func main() {"), o()), d && (a("insecureTransport := http.DefaultTransport.(*http.Transport).Clone()", h), a("insecureTransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}", h));
|
|
521
|
+
const g = u > 0, $ = g || d, m = $ ? "client" : "http.DefaultClient";
|
|
522
|
+
return $ && (a("client := http.Client{", h), g && a(`Timeout: time.Duration(${u} * time.Second),`, h + 1), d && a("Transport: insecureTransport,", h + 1), a("}", h), o()), a(`url := "${n}"`, h), o(), t.text ? (a(`payload := strings.NewReader(${JSON.stringify(t.text)})`, h), o(), a(`req, ${p} := http.NewRequest("${e}", url, payload)`, h), o()) : (a(`req, ${p} := http.NewRequest("${e}", url, nil)`, h), o()), y(), Object.keys(r).length && (Object.keys(r).forEach((b) => {
|
|
523
523
|
a(`req.Header.Add("${b}", "${I(r[b])}")`, h);
|
|
524
|
-
}), o()), a(`res, ${
|
|
524
|
+
}), o()), a(`res, ${p} := ${m}.Do(req)`, h), y(), f && (o(), a("defer res.Body.Close()", h), a(`body, ${p} := io.ReadAll(res.Body)`, h), y()), o(), f && a("fmt.Println(string(body))", h), c && (o(), a("}")), i();
|
|
525
525
|
}
|
|
526
526
|
} }
|
|
527
|
-
},
|
|
528
|
-
`,
|
|
527
|
+
}, fr = `\r
|
|
528
|
+
`, Xn = {
|
|
529
529
|
info: {
|
|
530
530
|
key: "http",
|
|
531
531
|
title: "HTTP",
|
|
@@ -547,7 +547,7 @@ const to = {
|
|
|
547
547
|
...a
|
|
548
548
|
}, { blank: c, push: l, join: f } = new E({
|
|
549
549
|
indent: "",
|
|
550
|
-
join:
|
|
550
|
+
join: fr
|
|
551
551
|
});
|
|
552
552
|
l(`${t} ${i.absoluteURI ? e : r.path} ${n}`);
|
|
553
553
|
const u = Object.keys(s);
|
|
@@ -555,11 +555,11 @@ const to = {
|
|
|
555
555
|
const y = h.toLowerCase().replace(/(^|-)(\w)/g, (g) => g.toUpperCase());
|
|
556
556
|
l(`${y}: ${s[h]}`);
|
|
557
557
|
}), i.autoHost && !u.includes("host") && l(`Host: ${r.host}`), i.autoContentLength && o.text && !u.includes("content-length") && l(`Content-Length: ${Buffer.byteLength(o.text, "ascii").toString()}`), c();
|
|
558
|
-
const
|
|
559
|
-
return `${
|
|
558
|
+
const d = f(), p = o.text || "";
|
|
559
|
+
return `${d}${fr}${p}`;
|
|
560
560
|
}
|
|
561
561
|
} }
|
|
562
|
-
},
|
|
562
|
+
}, Zn = {
|
|
563
563
|
info: {
|
|
564
564
|
key: "java",
|
|
565
565
|
title: "Java",
|
|
@@ -659,7 +659,7 @@ const to = {
|
|
|
659
659
|
}
|
|
660
660
|
}
|
|
661
661
|
}
|
|
662
|
-
},
|
|
662
|
+
}, eo = {
|
|
663
663
|
info: {
|
|
664
664
|
key: "javascript",
|
|
665
665
|
title: "JavaScript",
|
|
@@ -781,12 +781,12 @@ const to = {
|
|
|
781
781
|
return l.headers && !Object.keys(l.headers).length && delete l.headers, c(`const options = ${oe(l, {
|
|
782
782
|
indent: o.indent,
|
|
783
783
|
inlineCharacterLimit: 80,
|
|
784
|
-
transform: (f, u,
|
|
784
|
+
transform: (f, u, d) => {
|
|
785
785
|
if (u === "body") {
|
|
786
|
-
if (r.mimeType === "application/x-www-form-urlencoded") return `new URLSearchParams(${
|
|
787
|
-
if (r.mimeType === "application/json") return `JSON.stringify(${
|
|
786
|
+
if (r.mimeType === "application/x-www-form-urlencoded") return `new URLSearchParams(${d})`;
|
|
787
|
+
if (r.mimeType === "application/json") return `JSON.stringify(${d})`;
|
|
788
788
|
}
|
|
789
|
-
return
|
|
789
|
+
return d;
|
|
790
790
|
}
|
|
791
791
|
})};`), a(), r.params && r.mimeType === "multipart/form-data" && (c("options.body = form;"), a()), c(`fetch('${n}', options)`), c(".then(res => res.json())", 1), c(".then(res => console.log(res))", 1), c(".catch(err => console.error(err));", 1), i();
|
|
792
792
|
}
|
|
@@ -835,7 +835,7 @@ const to = {
|
|
|
835
835
|
}
|
|
836
836
|
}
|
|
837
837
|
}
|
|
838
|
-
},
|
|
838
|
+
}, to = {
|
|
839
839
|
info: {
|
|
840
840
|
key: "json",
|
|
841
841
|
title: "JSON",
|
|
@@ -876,7 +876,7 @@ const to = {
|
|
|
876
876
|
return typeof n > "u" || n === "" ? "No JSON body" : JSON.stringify(n, null, r.indent);
|
|
877
877
|
}
|
|
878
878
|
} }
|
|
879
|
-
},
|
|
879
|
+
}, ro = {
|
|
880
880
|
info: {
|
|
881
881
|
key: "kotlin",
|
|
882
882
|
title: "Kotlin",
|
|
@@ -912,7 +912,7 @@ const to = {
|
|
|
912
912
|
}), i(".build()", 1), o(), i("val response = client.newCall(request).execute()"), a();
|
|
913
913
|
}
|
|
914
914
|
} }
|
|
915
|
-
},
|
|
915
|
+
}, no = {
|
|
916
916
|
info: {
|
|
917
917
|
key: "node",
|
|
918
918
|
title: "Node.js",
|
|
@@ -1008,15 +1008,15 @@ const to = {
|
|
|
1008
1008
|
...o
|
|
1009
1009
|
};
|
|
1010
1010
|
let i = !1;
|
|
1011
|
-
const { blank: c, push: l, join: f, unshift: u } = new E({ indent: a.indent }),
|
|
1012
|
-
switch (Object.keys(n).length && (
|
|
1011
|
+
const { blank: c, push: l, join: f, unshift: u } = new E({ indent: a.indent }), d = e, p = { method: t };
|
|
1012
|
+
switch (Object.keys(n).length && (p.headers = n), r.mimeType) {
|
|
1013
1013
|
case "application/x-www-form-urlencoded":
|
|
1014
1014
|
l("const encodedParams = new URLSearchParams();"), (h = r.params) == null || h.forEach((y) => {
|
|
1015
1015
|
l(`encodedParams.set('${y.name}', '${y.value}');`);
|
|
1016
|
-
}),
|
|
1016
|
+
}), p.body = "encodedParams", c();
|
|
1017
1017
|
break;
|
|
1018
1018
|
case "application/json":
|
|
1019
|
-
r.jsonObj && (
|
|
1019
|
+
r.jsonObj && (p.body = r.jsonObj);
|
|
1020
1020
|
break;
|
|
1021
1021
|
case "multipart/form-data": {
|
|
1022
1022
|
if (!r.params) break;
|
|
@@ -1027,17 +1027,17 @@ const to = {
|
|
|
1027
1027
|
return;
|
|
1028
1028
|
}
|
|
1029
1029
|
g.fileName && (i = !0, l(`formData.append('${g.name}', await new Response(fs.createReadStream('${g.fileName}')).blob());`));
|
|
1030
|
-
}),
|
|
1030
|
+
}), p.body = "formData", c();
|
|
1031
1031
|
break;
|
|
1032
1032
|
}
|
|
1033
1033
|
default:
|
|
1034
|
-
r.text && (
|
|
1034
|
+
r.text && (p.body = r.text);
|
|
1035
1035
|
}
|
|
1036
1036
|
if (s.length) {
|
|
1037
1037
|
const y = s.map(({ name: g, value: $ }) => `${encodeURIComponent(g)}=${encodeURIComponent($)}`).join("; ");
|
|
1038
|
-
|
|
1038
|
+
p.headers || (p.headers = {}), p.headers.cookie = y;
|
|
1039
1039
|
}
|
|
1040
|
-
return l(`const url = '${
|
|
1040
|
+
return l(`const url = '${d}';`), p.headers && !Object.keys(p.headers).length && delete p.headers, l(`const options = ${oe(p, {
|
|
1041
1041
|
indent: " ",
|
|
1042
1042
|
inlineCharacterLimit: 80,
|
|
1043
1043
|
transform: (y, g, $) => g === "body" && r.mimeType === "application/json" ? `JSON.stringify(${$})` : $
|
|
@@ -1048,19 +1048,19 @@ const to = {
|
|
|
1048
1048
|
}
|
|
1049
1049
|
}, bt = (t, e, r, n) => {
|
|
1050
1050
|
const s = `${t} *${e} = `;
|
|
1051
|
-
return `${s}${
|
|
1052
|
-
},
|
|
1051
|
+
return `${s}${Ut(r, n ? s.length : void 0)};`;
|
|
1052
|
+
}, Ut = (t, e) => {
|
|
1053
1053
|
const r = e === void 0 ? ", " : `,
|
|
1054
1054
|
${" ".repeat(e)}`;
|
|
1055
1055
|
switch (Object.prototype.toString.call(t)) {
|
|
1056
1056
|
case "[object Number]":
|
|
1057
1057
|
return `@${t}`;
|
|
1058
1058
|
case "[object Array]":
|
|
1059
|
-
return `@[ ${t.map((n) =>
|
|
1059
|
+
return `@[ ${t.map((n) => Ut(n)).join(r)} ]`;
|
|
1060
1060
|
case "[object Object]": {
|
|
1061
1061
|
const n = [];
|
|
1062
1062
|
return Object.keys(t).forEach((s) => {
|
|
1063
|
-
n.push(`@"${s}": ${
|
|
1063
|
+
n.push(`@"${s}": ${Ut(t[s])}`);
|
|
1064
1064
|
}), `@{ ${n.join(r)} }`;
|
|
1065
1065
|
}
|
|
1066
1066
|
case "[object Boolean]":
|
|
@@ -1068,7 +1068,7 @@ const to = {
|
|
|
1068
1068
|
default:
|
|
1069
1069
|
return t == null ? "" : `@"${t.toString().replace(/"/g, '\\"')}"`;
|
|
1070
1070
|
}
|
|
1071
|
-
},
|
|
1071
|
+
}, oo = {
|
|
1072
1072
|
info: {
|
|
1073
1073
|
key: "objc",
|
|
1074
1074
|
title: "Objective-C",
|
|
@@ -1098,9 +1098,9 @@ const to = {
|
|
|
1098
1098
|
case "application/x-www-form-urlencoded":
|
|
1099
1099
|
if ((f = e.params) != null && f.length) {
|
|
1100
1100
|
c();
|
|
1101
|
-
const [u, ...
|
|
1102
|
-
a(`NSMutableData *postData = [[NSMutableData alloc] initWithData:[@"${u.name}=${u.value}" dataUsingEncoding:NSUTF8StringEncoding]];`),
|
|
1103
|
-
a(`[postData appendData:[@"&${
|
|
1101
|
+
const [u, ...d] = e.params;
|
|
1102
|
+
a(`NSMutableData *postData = [[NSMutableData alloc] initWithData:[@"${u.name}=${u.value}" dataUsingEncoding:NSUTF8StringEncoding]];`), d.forEach(({ name: p, value: h }) => {
|
|
1103
|
+
a(`[postData appendData:[@"&${p}=${h}" dataUsingEncoding:NSUTF8StringEncoding]];`);
|
|
1104
1104
|
});
|
|
1105
1105
|
} else l.hasBody = !1;
|
|
1106
1106
|
break;
|
|
@@ -1116,7 +1116,7 @@ const to = {
|
|
|
1116
1116
|
return c(), a(`NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"${n}"]`), a(" cachePolicy:NSURLRequestUseProtocolCachePolicy"), a(` timeoutInterval:${o.timeout.toFixed(1)}];`), a(`[request setHTTPMethod:@"${r}"];`), l.hasHeaders && a("[request setAllHTTPHeaderFields:headers];"), l.hasBody && a("[request setHTTPBody:postData];"), c(), a("NSURLSession *session = [NSURLSession sharedSession];"), a("NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request"), a(" completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {"), a(" if (error) {", 1), a(' NSLog(@"%@", error);', 2), a(" } else {", 1), a(" NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;", 2), a(' NSLog(@"%@", httpResponse);', 2), a(" }", 1), a(" }];"), a("[dataTask resume];"), i();
|
|
1117
1117
|
}
|
|
1118
1118
|
} }
|
|
1119
|
-
},
|
|
1119
|
+
}, io = {
|
|
1120
1120
|
info: {
|
|
1121
1121
|
key: "ocaml",
|
|
1122
1122
|
title: "OCaml",
|
|
@@ -1184,7 +1184,7 @@ ${r}]`;
|
|
|
1184
1184
|
default:
|
|
1185
1185
|
return "null";
|
|
1186
1186
|
}
|
|
1187
|
-
},
|
|
1187
|
+
}, ur = [
|
|
1188
1188
|
"ACL",
|
|
1189
1189
|
"BASELINE_CONTROL",
|
|
1190
1190
|
"CHECKIN",
|
|
@@ -1212,7 +1212,7 @@ ${r}]`;
|
|
|
1212
1212
|
"UNLOCK",
|
|
1213
1213
|
"UPDATE",
|
|
1214
1214
|
"VERSION_CONTROL"
|
|
1215
|
-
],
|
|
1215
|
+
], ao = {
|
|
1216
1216
|
info: {
|
|
1217
1217
|
key: "php",
|
|
1218
1218
|
title: "PHP",
|
|
@@ -1229,8 +1229,8 @@ ${r}]`;
|
|
|
1229
1229
|
extname: ".php"
|
|
1230
1230
|
},
|
|
1231
1231
|
convert: ({ uriObj: t, postData: e, fullUrl: r, method: n, httpVersion: s, cookies: o, headersObj: a }, i = {}) => {
|
|
1232
|
-
const { closingTag: c = !1, indent: l = " ", maxRedirects: f = 10, namedErrors: u = !1, noTags:
|
|
1233
|
-
|
|
1232
|
+
const { closingTag: c = !1, indent: l = " ", maxRedirects: f = 10, namedErrors: u = !1, noTags: d = !1, shortTags: p = !1, timeout: h = 30 } = i, { push: y, blank: g, join: $ } = new E({ indent: l });
|
|
1233
|
+
d || (y(p ? "<?" : "<?php"), g()), y("$curl = curl_init();"), g();
|
|
1234
1234
|
const m = [
|
|
1235
1235
|
{
|
|
1236
1236
|
escape: !0,
|
|
@@ -1291,7 +1291,7 @@ ${l}`
|
|
|
1291
1291
|
S.length && b.push(`CURLOPT_COOKIE => "${S.join("; ")}",`);
|
|
1292
1292
|
const O = Object.keys(a).sort().map((v) => `"${v}: ${I(a[v])}"`);
|
|
1293
1293
|
return O.length && (b.push("CURLOPT_HTTPHEADER => ["), b.push(O.join(`,
|
|
1294
|
-
${l}${l}`), 1), b.push("],")), y(b.join(), 1), y("]);"), g(), y("$response = curl_exec($curl);"), y("$err = curl_error($curl);"), g(), y("curl_close($curl);"), g(), y("if ($err) {"), y(u ? 'echo array_flip(get_defined_constants(true)["curl"])[$err];' : 'echo "cURL Error #:" . $err;', 1), y("} else {"), y("echo $response;", 1), y("}"), !
|
|
1294
|
+
${l}${l}`), 1), b.push("],")), y(b.join(), 1), y("]);"), g(), y("$response = curl_exec($curl);"), y("$err = curl_error($curl);"), g(), y("curl_close($curl);"), g(), y("if ($err) {"), y(u ? 'echo array_flip(get_defined_constants(true)["curl"])[$err];' : 'echo "cURL Error #:" . $err;', 1), y("} else {"), y("echo $response;", 1), y("}"), !d && c && (g(), y("?>")), $();
|
|
1295
1295
|
}
|
|
1296
1296
|
},
|
|
1297
1297
|
guzzle: {
|
|
@@ -1311,7 +1311,7 @@ ${l}${l}`), 1), b.push("],")), y(b.join(), 1), y("]);"), g(), y("$response = cur
|
|
|
1311
1311
|
noTags: !1,
|
|
1312
1312
|
shortTags: !1,
|
|
1313
1313
|
...o
|
|
1314
|
-
}, { push: i, blank: c, join: l } = new E({ indent: a.indent }), { code: f, push: u, join:
|
|
1314
|
+
}, { push: i, blank: c, join: l } = new E({ indent: a.indent }), { code: f, push: u, join: d } = new E({ indent: a.indent });
|
|
1315
1315
|
switch (a.noTags || i(a.shortTags ? "<?" : "<?php"), i("require_once('vendor/autoload.php');"), c(), t.mimeType) {
|
|
1316
1316
|
case "application/x-www-form-urlencoded":
|
|
1317
1317
|
u(`'form_params' => ${k(t.paramsObj, a.indent + a.indent, a.indent)},`, 1);
|
|
@@ -1339,9 +1339,9 @@ ${l}${l}`), 1), b.push("],")), y(b.join(), 1), y("]);"), g(), y("$response = cur
|
|
|
1339
1339
|
default:
|
|
1340
1340
|
t.text && u(`'body' => ${k(t.text)},`, 1);
|
|
1341
1341
|
}
|
|
1342
|
-
const
|
|
1343
|
-
return h.length &&
|
|
1344
|
-
`)), u("],", 1)), i("$client = new \\GuzzleHttp\\Client();"), c(), f.length ? (i(`$response = $client->request('${r}', '${e}', [`), i(
|
|
1342
|
+
const p = Object.keys(s).sort().map((g) => `${a.indent}${a.indent}'${g}' => '${Ce(s[g])}',`), h = n.map((g) => `${encodeURIComponent(g.name)}=${encodeURIComponent(g.value)}`).join("; ");
|
|
1343
|
+
return h.length && p.push(`${a.indent}${a.indent}'cookie' => '${Ce(h)}',`), p.length && (u("'headers' => [", 1), u(p.join(`
|
|
1344
|
+
`)), u("],", 1)), i("$client = new \\GuzzleHttp\\Client();"), c(), f.length ? (i(`$response = $client->request('${r}', '${e}', [`), i(d()), i("]);")) : i(`$response = $client->request('${r}', '${e}');`), c(), i("echo $response->getBody();"), !a.noTags && a.closingTag && (c(), i("?>")), l();
|
|
1345
1345
|
}
|
|
1346
1346
|
},
|
|
1347
1347
|
http1: {
|
|
@@ -1353,18 +1353,18 @@ ${l}${l}`), 1), b.push("],")), y(b.join(), 1), y("]);"), g(), y("$response = cur
|
|
|
1353
1353
|
extname: ".php"
|
|
1354
1354
|
},
|
|
1355
1355
|
convert: ({ method: t, url: e, postData: r, queryObj: n, headersObj: s, cookiesObj: o }, a = {}) => {
|
|
1356
|
-
const { closingTag: i = !1, indent: c = " ", noTags: l = !1, shortTags: f = !1 } = a, { push: u, blank:
|
|
1357
|
-
switch (l || (u(f ? "<?" : "<?php"),
|
|
1356
|
+
const { closingTag: i = !1, indent: c = " ", noTags: l = !1, shortTags: f = !1 } = a, { push: u, blank: d, join: p } = new E({ indent: c });
|
|
1357
|
+
switch (l || (u(f ? "<?" : "<?php"), d()), ur.includes(t.toUpperCase()) || u(`HttpRequest::methodRegister('${t}');`), u("$request = new HttpRequest();"), u(`$request->setUrl(${k(e)});`), ur.includes(t.toUpperCase()) ? u(`$request->setMethod(HTTP_METH_${t.toUpperCase()});`) : u(`$request->setMethod(HttpRequest::HTTP_METH_${t.toUpperCase()});`), d(), Object.keys(n).length && (u(`$request->setQueryData(${k(n, c)});`), d()), Object.keys(s).length && (u(`$request->setHeaders(${k(s, c)});`), d()), Object.keys(o).length && (u(`$request->setCookies(${k(o, c)});`), d()), r.mimeType) {
|
|
1358
1358
|
case "application/x-www-form-urlencoded":
|
|
1359
|
-
u(`$request->setContentType(${k(r.mimeType)});`), u(`$request->setPostFields(${k(r.paramsObj, c)});`),
|
|
1359
|
+
u(`$request->setContentType(${k(r.mimeType)});`), u(`$request->setPostFields(${k(r.paramsObj, c)});`), d();
|
|
1360
1360
|
break;
|
|
1361
1361
|
case "application/json":
|
|
1362
|
-
u(`$request->setContentType(${k(r.mimeType)});`), u(`$request->setBody(json_encode(${k(r.jsonObj, c)}));`),
|
|
1362
|
+
u(`$request->setContentType(${k(r.mimeType)});`), u(`$request->setBody(json_encode(${k(r.jsonObj, c)}));`), d();
|
|
1363
1363
|
break;
|
|
1364
1364
|
default:
|
|
1365
|
-
r.text && (u(`$request->setBody(${k(r.text)});`),
|
|
1365
|
+
r.text && (u(`$request->setBody(${k(r.text)});`), d());
|
|
1366
1366
|
}
|
|
1367
|
-
return u("try {"), u("$response = $request->send();", 1),
|
|
1367
|
+
return u("try {"), u("$response = $request->send();", 1), d(), u("echo $response->getBody();", 1), u("} catch (HttpException $ex) {"), u("echo $ex;", 1), u("}"), !l && i && (d(), u("?>")), p();
|
|
1368
1368
|
}
|
|
1369
1369
|
},
|
|
1370
1370
|
http2: {
|
|
@@ -1377,11 +1377,11 @@ ${l}${l}`), 1), b.push("],")), y(b.join(), 1), y("]);"), g(), y("$response = cur
|
|
|
1377
1377
|
},
|
|
1378
1378
|
convert: ({ postData: t, headersObj: e, method: r, queryObj: n, cookiesObj: s, url: o }, a = {}) => {
|
|
1379
1379
|
var y;
|
|
1380
|
-
const { closingTag: i = !1, indent: c = " ", noTags: l = !1, shortTags: f = !1 } = a, { push: u, blank:
|
|
1380
|
+
const { closingTag: i = !1, indent: c = " ", noTags: l = !1, shortTags: f = !1 } = a, { push: u, blank: d, join: p } = new E({ indent: c });
|
|
1381
1381
|
let h = !1;
|
|
1382
|
-
switch (l || (u(f ? "<?" : "<?php"),
|
|
1382
|
+
switch (l || (u(f ? "<?" : "<?php"), d()), u("$client = new http\\Client;"), u("$request = new http\\Client\\Request;"), d(), t.mimeType) {
|
|
1383
1383
|
case "application/x-www-form-urlencoded":
|
|
1384
|
-
u("$body = new http\\Message\\Body;"), u(`$body->append(new http\\QueryString(${k(t.paramsObj, c)}));`),
|
|
1384
|
+
u("$body = new http\\Message\\Body;"), u(`$body->append(new http\\QueryString(${k(t.paramsObj, c)}));`), d(), h = !0;
|
|
1385
1385
|
break;
|
|
1386
1386
|
case "multipart/form-data": {
|
|
1387
1387
|
if (!t.params) break;
|
|
@@ -1403,20 +1403,20 @@ ${l}${l}`), 1), b.push("],")), y(b.join(), 1), y("]);"), g(), y("$response = cur
|
|
|
1403
1403
|
const S = J(e, "content-type");
|
|
1404
1404
|
S && delete e[S];
|
|
1405
1405
|
}
|
|
1406
|
-
|
|
1406
|
+
d(), h = !0;
|
|
1407
1407
|
break;
|
|
1408
1408
|
}
|
|
1409
1409
|
case "application/json":
|
|
1410
1410
|
u("$body = new http\\Message\\Body;"), u(`$body->append(json_encode(${k(t.jsonObj, c)}));`), h = !0;
|
|
1411
1411
|
break;
|
|
1412
1412
|
default:
|
|
1413
|
-
t.text && (u("$body = new http\\Message\\Body;"), u(`$body->append(${k(t.text)});`),
|
|
1413
|
+
t.text && (u("$body = new http\\Message\\Body;"), u(`$body->append(${k(t.text)});`), d(), h = !0);
|
|
1414
1414
|
}
|
|
1415
|
-
return u(`$request->setRequestUrl(${k(o)});`), u(`$request->setRequestMethod(${k(r)});`), h && (u("$request->setBody($body);"),
|
|
1415
|
+
return u(`$request->setRequestUrl(${k(o)});`), u(`$request->setRequestMethod(${k(r)});`), h && (u("$request->setBody($body);"), d()), Object.keys(n).length && (u(`$request->setQuery(new http\\QueryString(${k(n, c)}));`), d()), Object.keys(e).length && (u(`$request->setHeaders(${k(e, c)});`), d()), Object.keys(s).length && (d(), u(`$client->setCookies(${k(s, c)});`), d()), u("$client->enqueue($request)->send();"), u("$response = $client->getResponse();"), d(), u("echo $response->getBody();"), !l && i && (d(), u("?>")), p();
|
|
1416
1416
|
}
|
|
1417
1417
|
}
|
|
1418
1418
|
}
|
|
1419
|
-
},
|
|
1419
|
+
}, Xr = (t) => ({ method: r, headersObj: n, cookies: s, uriObj: o, fullUrl: a, postData: i, allHeaders: c }) => {
|
|
1420
1420
|
const { push: l, join: f } = new E();
|
|
1421
1421
|
if (![
|
|
1422
1422
|
"GET",
|
|
@@ -1427,16 +1427,16 @@ ${l}${l}`), 1), b.push("],")), y(b.join(), 1), y("]);"), g(), y("$response = cur
|
|
|
1427
1427
|
"HEAD",
|
|
1428
1428
|
"OPTIONS"
|
|
1429
1429
|
].includes(r.toUpperCase())) return "Method not supported";
|
|
1430
|
-
const u = [],
|
|
1431
|
-
return
|
|
1432
|
-
|
|
1433
|
-
}), u.push("-Headers $headers")), s.length && (l("$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession"), s.forEach((
|
|
1434
|
-
l("$cookie = New-Object System.Net.Cookie"), l(`$cookie.Name = '${
|
|
1430
|
+
const u = [], d = Object.keys(n);
|
|
1431
|
+
return d.length && (l("$headers=@{}"), d.forEach((p) => {
|
|
1432
|
+
p !== "connection" && l(`$headers.Add("${p}", "${He(n[p], { escapeChar: "`" })}")`);
|
|
1433
|
+
}), u.push("-Headers $headers")), s.length && (l("$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession"), s.forEach((p) => {
|
|
1434
|
+
l("$cookie = New-Object System.Net.Cookie"), l(`$cookie.Name = '${p.name}'`), l(`$cookie.Value = '${p.value}'`), l(`$cookie.Domain = '${o.host}'`), l("$session.Cookies.Add($cookie)");
|
|
1435
1435
|
}), u.push("-WebSession $session")), i.text && (u.push(`-ContentType '${He(se(c, "content-type"), {
|
|
1436
1436
|
delimiter: "'",
|
|
1437
1437
|
escapeChar: "`"
|
|
1438
1438
|
})}'`), u.push(`-Body '${i.text}'`)), l(`$response = ${t} -Uri '${a}' -Method ${r} ${u.join(" ")}`.trim()), f();
|
|
1439
|
-
},
|
|
1439
|
+
}, so = {
|
|
1440
1440
|
info: {
|
|
1441
1441
|
key: "restmethod",
|
|
1442
1442
|
title: "Invoke-RestMethod",
|
|
@@ -1444,8 +1444,8 @@ ${l}${l}`), 1), b.push("],")), y(b.join(), 1), y("]);"), g(), y("$response = cur
|
|
|
1444
1444
|
description: "Powershell Invoke-RestMethod client",
|
|
1445
1445
|
extname: ".ps1"
|
|
1446
1446
|
},
|
|
1447
|
-
convert:
|
|
1448
|
-
},
|
|
1447
|
+
convert: Xr("Invoke-RestMethod")
|
|
1448
|
+
}, co = {
|
|
1449
1449
|
info: {
|
|
1450
1450
|
key: "powershell",
|
|
1451
1451
|
title: "Powershell",
|
|
@@ -1460,12 +1460,12 @@ ${l}${l}`), 1), b.push("],")), y(b.join(), 1), y("]);"), g(), y("$response = cur
|
|
|
1460
1460
|
description: "Powershell Invoke-WebRequest client",
|
|
1461
1461
|
extname: ".ps1"
|
|
1462
1462
|
},
|
|
1463
|
-
convert:
|
|
1463
|
+
convert: Xr("Invoke-WebRequest")
|
|
1464
1464
|
},
|
|
1465
|
-
restmethod:
|
|
1465
|
+
restmethod: so
|
|
1466
1466
|
}
|
|
1467
1467
|
};
|
|
1468
|
-
function
|
|
1468
|
+
function pr(t, e, r, n, s) {
|
|
1469
1469
|
const o = n.repeat(s), a = n.repeat(s - 1), i = r ? `,
|
|
1470
1470
|
${o}` : ", ", c = t === "object" ? "{" : "[", l = t === "object" ? "}" : "]";
|
|
1471
1471
|
return r ? `${c}
|
|
@@ -1478,12 +1478,12 @@ const Oe = (t, e, r) => {
|
|
|
1478
1478
|
return t;
|
|
1479
1479
|
case "[object Array]": {
|
|
1480
1480
|
let n = !1;
|
|
1481
|
-
return
|
|
1481
|
+
return pr("array", t.map((s) => (Object.prototype.toString.call(s) === "[object Object]" && (n = Object.keys(s).length > 1), Oe(s, e, r))), n, e.indent, r);
|
|
1482
1482
|
}
|
|
1483
1483
|
case "[object Object]": {
|
|
1484
1484
|
const n = [];
|
|
1485
1485
|
for (const s in t) n.push(`"${s}": ${Oe(t[s], e, r)}`);
|
|
1486
|
-
return
|
|
1486
|
+
return pr("object", n, e.pretty && n.length > 1, e.indent, r);
|
|
1487
1487
|
}
|
|
1488
1488
|
case "[object Null]":
|
|
1489
1489
|
return "None";
|
|
@@ -1492,7 +1492,7 @@ const Oe = (t, e, r) => {
|
|
|
1492
1492
|
default:
|
|
1493
1493
|
return t == null ? "" : `"${t.toString().replace(/"/g, '\\"')}"`;
|
|
1494
1494
|
}
|
|
1495
|
-
},
|
|
1495
|
+
}, lo = [
|
|
1496
1496
|
"HEAD",
|
|
1497
1497
|
"GET",
|
|
1498
1498
|
"POST",
|
|
@@ -1500,7 +1500,7 @@ const Oe = (t, e, r) => {
|
|
|
1500
1500
|
"PATCH",
|
|
1501
1501
|
"DELETE",
|
|
1502
1502
|
"OPTIONS"
|
|
1503
|
-
],
|
|
1503
|
+
], fo = {
|
|
1504
1504
|
info: {
|
|
1505
1505
|
key: "python",
|
|
1506
1506
|
title: "Python",
|
|
@@ -1525,8 +1525,8 @@ const Oe = (t, e, r) => {
|
|
|
1525
1525
|
a("import requests"), i(), a(`url = "${t}"`), i();
|
|
1526
1526
|
const f = r;
|
|
1527
1527
|
let u = {};
|
|
1528
|
-
const
|
|
1529
|
-
let
|
|
1528
|
+
const d = {};
|
|
1529
|
+
let p = !1, h = !1, y = !1;
|
|
1530
1530
|
switch (e.mimeType) {
|
|
1531
1531
|
case "application/json":
|
|
1532
1532
|
e.jsonObj && (a(`payload = ${Oe(e.jsonObj, o)}`), y = !0, h = !0);
|
|
@@ -1534,9 +1534,9 @@ const Oe = (t, e, r) => {
|
|
|
1534
1534
|
case "multipart/form-data":
|
|
1535
1535
|
if (!e.params) break;
|
|
1536
1536
|
if (u = {}, e.params.forEach((m) => {
|
|
1537
|
-
m.fileName ? (m.contentType ?
|
|
1538
|
-
}),
|
|
1539
|
-
a(`files = ${Oe(
|
|
1537
|
+
m.fileName ? (m.contentType ? d[m.name] = `('${m.fileName}', open('${m.fileName}', 'rb'), '${m.contentType}')` : d[m.name] = `('${m.fileName}', open('${m.fileName}', 'rb'))`, p = !0) : (u[m.name] = m.value, h = !0);
|
|
1538
|
+
}), p) {
|
|
1539
|
+
a(`files = ${Oe(d, o)}`), h && a(`payload = ${Oe(u, o)}`);
|
|
1540
1540
|
const m = J(f, "content-type");
|
|
1541
1541
|
m && delete f[m];
|
|
1542
1542
|
} else {
|
|
@@ -1555,7 +1555,7 @@ const Oe = (t, e, r) => {
|
|
|
1555
1555
|
}
|
|
1556
1556
|
}
|
|
1557
1557
|
const g = Object.keys(f).length;
|
|
1558
|
-
if (g === 0 && (h ||
|
|
1558
|
+
if (g === 0 && (h || p)) i();
|
|
1559
1559
|
else if (g === 1) Object.keys(f).forEach((m) => {
|
|
1560
1560
|
a(`headers = {"${m}": "${I(f[m])}"}`), i();
|
|
1561
1561
|
});
|
|
@@ -1565,11 +1565,11 @@ const Oe = (t, e, r) => {
|
|
|
1565
1565
|
a(m !== g ? `"${b}": "${I(f[b])}",` : `"${b}": "${I(f[b])}"`, 1), m += 1;
|
|
1566
1566
|
}), a("}"), i();
|
|
1567
1567
|
}
|
|
1568
|
-
let $ =
|
|
1569
|
-
return h && (y ? $ += ", json=payload" : $ += ", data=payload"),
|
|
1568
|
+
let $ = lo.includes(n) ? `response = requests.${n.toLowerCase()}(url` : `response = requests.request("${n}", url`;
|
|
1569
|
+
return h && (y ? $ += ", json=payload" : $ += ", data=payload"), p && ($ += ", files=files"), g > 0 && ($ += ", headers=headers"), $ += ")", a($), i(), a("print(response.text)"), c();
|
|
1570
1570
|
}
|
|
1571
1571
|
} }
|
|
1572
|
-
},
|
|
1572
|
+
}, uo = {
|
|
1573
1573
|
info: {
|
|
1574
1574
|
key: "r",
|
|
1575
1575
|
title: "R",
|
|
@@ -1607,7 +1607,7 @@ const Oe = (t, e, r) => {
|
|
|
1607
1607
|
a('encode <- "raw"'), i();
|
|
1608
1608
|
break;
|
|
1609
1609
|
}
|
|
1610
|
-
const
|
|
1610
|
+
const d = se(s, "cookie"), p = se(s, "accept"), h = d ? `set_cookies(\`${String(d).replace(/;/g, '", `').replace(/` /g, "`").replace(/[=]/g, '` = "')}")` : void 0, y = p ? `accept("${I(p)}")` : void 0, g = `content_type("${I(n.mimeType)}")`, $ = Object.entries(s).filter(([O]) => ![
|
|
1611
1611
|
"cookie",
|
|
1612
1612
|
"accept",
|
|
1613
1613
|
"content-type"
|
|
@@ -1623,7 +1623,7 @@ const Oe = (t, e, r) => {
|
|
|
1623
1623
|
return S && (b += `, ${S}`), (n.text || n.jsonObj || n.params) && (b += ", encode = encode"), b += ")", a(b), i(), a('content(response, "text")'), c();
|
|
1624
1624
|
}
|
|
1625
1625
|
} }
|
|
1626
|
-
},
|
|
1626
|
+
}, po = {
|
|
1627
1627
|
info: {
|
|
1628
1628
|
key: "ruby",
|
|
1629
1629
|
title: "Ruby",
|
|
@@ -1657,8 +1657,8 @@ const Oe = (t, e, r) => {
|
|
|
1657
1657
|
], f = c.charAt(0) + c.substring(1).toLowerCase();
|
|
1658
1658
|
l.includes(c) || (o(`class Net::HTTP::${f} < Net::HTTPRequest`), o(` METHOD = '${c.toUpperCase()}'`), o(` REQUEST_HAS_BODY = '${n.text ? "true" : "false"}'`), o(" RESPONSE_HAS_BODY = true"), o("end"), a()), o(`url = URI("${r}")`), a(), o("http = Net::HTTP.new(url.host, url.port)"), t.protocol === "https:" && o("http.use_ssl = true"), a(), o(`request = Net::HTTP::${f}.new(url)`);
|
|
1659
1659
|
const u = Object.keys(s);
|
|
1660
|
-
return u.length && u.forEach((
|
|
1661
|
-
o(`request["${
|
|
1660
|
+
return u.length && u.forEach((d) => {
|
|
1661
|
+
o(`request["${d}"] = '${Ce(s[d])}'`);
|
|
1662
1662
|
}), n.text && o(`request.body = ${JSON.stringify(n.text)}`), a(), o("response = http.request(request)"), o("puts response.read_body"), i();
|
|
1663
1663
|
}
|
|
1664
1664
|
},
|
|
@@ -1711,7 +1711,7 @@ const Oe = (t, e, r) => {
|
|
|
1711
1711
|
}
|
|
1712
1712
|
}
|
|
1713
1713
|
};
|
|
1714
|
-
function
|
|
1714
|
+
function dr(t, e, r, n, s) {
|
|
1715
1715
|
const o = n.repeat(s), a = n.repeat(s - 1), i = r ? `,
|
|
1716
1716
|
${o}` : ", ", c = t === "object" ? "json!({" : "(", l = t === "object" ? "})" : ")";
|
|
1717
1717
|
return r ? `${c}
|
|
@@ -1725,12 +1725,12 @@ const Te = (t, e, r) => {
|
|
|
1725
1725
|
case "[object Array]": {
|
|
1726
1726
|
if (t.length === 0) return "json!([])";
|
|
1727
1727
|
let n = !1;
|
|
1728
|
-
return
|
|
1728
|
+
return dr("array", t.map((s) => (Object.prototype.toString.call(s) === "[object Object]" && (n = Object.keys(s).length > 1), Te(s, e, r))), n, e.indent, r);
|
|
1729
1729
|
}
|
|
1730
1730
|
case "[object Object]": {
|
|
1731
1731
|
const n = [];
|
|
1732
1732
|
for (const s in t) n.push(`"${s}": ${Te(t[s], e, r)}`);
|
|
1733
|
-
return
|
|
1733
|
+
return dr("object", n, e.pretty && n.length > 1, e.indent, r);
|
|
1734
1734
|
}
|
|
1735
1735
|
case "[object Null]":
|
|
1736
1736
|
return "json!(null)";
|
|
@@ -1739,7 +1739,7 @@ const Te = (t, e, r) => {
|
|
|
1739
1739
|
default:
|
|
1740
1740
|
return t == null ? "" : `"${t.toString().replace(/"/g, '\\"')}"`;
|
|
1741
1741
|
}
|
|
1742
|
-
},
|
|
1742
|
+
}, ho = {
|
|
1743
1743
|
info: {
|
|
1744
1744
|
key: "reqwest",
|
|
1745
1745
|
title: "reqwest",
|
|
@@ -1754,11 +1754,11 @@ const Te = (t, e, r) => {
|
|
|
1754
1754
|
...o
|
|
1755
1755
|
};
|
|
1756
1756
|
let i = 0;
|
|
1757
|
-
const { push: c, blank: l, join: f, pushToLast: u, unshift:
|
|
1757
|
+
const { push: c, blank: l, join: f, pushToLast: u, unshift: d } = new E({ indent: a.indent });
|
|
1758
1758
|
c("use reqwest;", i), l(), c("#[tokio::main]", i), c("pub async fn main() {", i), i += 1, c(`let url = "${e}";`, i), l();
|
|
1759
|
-
let
|
|
1759
|
+
let p = !1;
|
|
1760
1760
|
if (Object.keys(t).length) {
|
|
1761
|
-
|
|
1761
|
+
p = !0, c("let querystring = [", i), i += 1;
|
|
1762
1762
|
for (const [v, T] of Object.entries(t)) if (Array.isArray(T)) for (const P of T) c(`("${v}", "${decodeURIComponent(P)}"),`, i);
|
|
1763
1763
|
else c(`("${v}", "${decodeURIComponent(String(T))}"),`, i);
|
|
1764
1764
|
i -= 1, c("];", i), l();
|
|
@@ -1778,7 +1778,7 @@ const Te = (t, e, r) => {
|
|
|
1778
1778
|
if (h = {}, r.params.forEach((v) => {
|
|
1779
1779
|
v.fileName ? (y[v.name] = v.fileName, g = !0) : h[v.name] = v.value;
|
|
1780
1780
|
}), g) {
|
|
1781
|
-
for (const v of
|
|
1781
|
+
for (const v of yo) c(v, i);
|
|
1782
1782
|
l();
|
|
1783
1783
|
}
|
|
1784
1784
|
c("let form = reqwest::multipart::Form::new()", i);
|
|
@@ -1796,7 +1796,7 @@ const Te = (t, e, r) => {
|
|
|
1796
1796
|
break;
|
|
1797
1797
|
}
|
|
1798
1798
|
}
|
|
1799
|
-
($ || b) &&
|
|
1799
|
+
($ || b) && d("use serde_json::json;"), ($ || b || m || S) && l();
|
|
1800
1800
|
const O = Object.entries(n).filter(([v]) => !(v.toLowerCase() === "content-type" && S));
|
|
1801
1801
|
switch (c("let client = reqwest::Client::new();", i), s) {
|
|
1802
1802
|
case "POST":
|
|
@@ -1806,30 +1806,30 @@ const Te = (t, e, r) => {
|
|
|
1806
1806
|
c("let response = client.get(url)", i);
|
|
1807
1807
|
break;
|
|
1808
1808
|
default:
|
|
1809
|
-
c(`let response = client.request(reqwest::Method::from_str("${s}").unwrap(), url)`, i),
|
|
1809
|
+
c(`let response = client.request(reqwest::Method::from_str("${s}").unwrap(), url)`, i), d("use std::str::FromStr;");
|
|
1810
1810
|
break;
|
|
1811
1811
|
}
|
|
1812
|
-
|
|
1812
|
+
p && c(".query(&querystring)", i + 1), S && c(".multipart(form)", i + 1);
|
|
1813
1813
|
for (const [v, T] of O) c(`.header("${v}", ${Te(T, a)})`, i + 1);
|
|
1814
1814
|
return b && c(".json(&payload)", i + 1), $ && c(".form(&payload)", i + 1), m && c(".body(payload)", i + 1), c(".send()", i + 1), c(".await;", i + 1), l(), c("let results = response.unwrap()", i), c(".json::<serde_json::Value>()", i + 1), c(".await", i + 1), c(".unwrap();", i + 1), l(), c('println!("{}", results);', i), c(`}
|
|
1815
1815
|
`), f();
|
|
1816
1816
|
}
|
|
1817
|
-
},
|
|
1817
|
+
}, yo = [
|
|
1818
1818
|
"async fn file_to_part(file_name: &'static str) -> reqwest::multipart::Part {",
|
|
1819
1819
|
" let bytes = tokio::fs::read(file_name).await.unwrap();",
|
|
1820
1820
|
" reqwest::multipart::Part::bytes(bytes)",
|
|
1821
1821
|
" .file_name(file_name)",
|
|
1822
1822
|
' .mime_str("text/plain").unwrap()',
|
|
1823
1823
|
"}"
|
|
1824
|
-
],
|
|
1824
|
+
], mo = {
|
|
1825
1825
|
info: {
|
|
1826
1826
|
key: "rust",
|
|
1827
1827
|
title: "Rust",
|
|
1828
1828
|
default: "reqwest",
|
|
1829
1829
|
cli: "rust"
|
|
1830
1830
|
},
|
|
1831
|
-
clientsById: { reqwest:
|
|
1832
|
-
}, M = (t = "") => /^[a-z0-9-_/.@%^=:]+$/i.test(t) ? t : `'${t.replace(/'/g, "'\\''")}'`,
|
|
1831
|
+
clientsById: { reqwest: ho }
|
|
1832
|
+
}, M = (t = "") => /^[a-z0-9-_/.@%^=:]+$/i.test(t) ? t : `'${t.replace(/'/g, "'\\''")}'`, go = (t) => t.replace(/\r/g, "\\r").replace(/\n/g, "\\n"), bo = {
|
|
1833
1833
|
"http1.0": "0",
|
|
1834
1834
|
"url ": "",
|
|
1835
1835
|
cookie: "b",
|
|
@@ -1839,13 +1839,13 @@ const Te = (t, e, r) => {
|
|
|
1839
1839
|
header: "H",
|
|
1840
1840
|
insecure: "k",
|
|
1841
1841
|
request: "X"
|
|
1842
|
-
},
|
|
1842
|
+
}, $o = (t) => (e) => {
|
|
1843
1843
|
if (t) {
|
|
1844
|
-
const r =
|
|
1844
|
+
const r = bo[e];
|
|
1845
1845
|
return r ? `-${r}` : "";
|
|
1846
1846
|
}
|
|
1847
1847
|
return `--${e}`;
|
|
1848
|
-
},
|
|
1848
|
+
}, vo = {
|
|
1849
1849
|
info: {
|
|
1850
1850
|
key: "shell",
|
|
1851
1851
|
title: "Shell",
|
|
@@ -1863,13 +1863,13 @@ const Te = (t, e, r) => {
|
|
|
1863
1863
|
},
|
|
1864
1864
|
convert: ({ fullUrl: t, method: e, httpVersion: r, headersObj: n, allHeaders: s, postData: o }, a = {}) => {
|
|
1865
1865
|
var $;
|
|
1866
|
-
const { binary: i = !1, globOff: c = !1, indent: l = " ", insecureSkipVerify: f = !1, short: u = !1 } = a,
|
|
1866
|
+
const { binary: i = !1, globOff: c = !1, indent: l = " ", insecureSkipVerify: f = !1, short: u = !1 } = a, d = " ", { push: p, join: h } = new E({
|
|
1867
1867
|
...typeof l == "string" ? { indent: l } : {},
|
|
1868
1868
|
join: l !== !1 ? ` \\
|
|
1869
1869
|
${l}` : " "
|
|
1870
|
-
}), y =
|
|
1870
|
+
}), y = $o(u);
|
|
1871
1871
|
let g = M(t);
|
|
1872
|
-
if (
|
|
1872
|
+
if (p(`curl ${y("request")} ${e}`), c && (g = unescape(g), p(y("globoff"))), p(`${y("url ")}${g}`), f && p(y("insecure")), r === "HTTP/1.0" && p(y("http1.0")), se(s, "accept-encoding") && p("--compressed"), o.mimeType === "multipart/form-data") {
|
|
1873
1873
|
const m = J(n, "content-type");
|
|
1874
1874
|
if (m) {
|
|
1875
1875
|
const b = n[m];
|
|
@@ -1881,34 +1881,34 @@ ${l}` : " "
|
|
|
1881
1881
|
}
|
|
1882
1882
|
switch (Object.keys(n).sort().forEach((m) => {
|
|
1883
1883
|
const b = `${m}: ${n[m]}`;
|
|
1884
|
-
|
|
1885
|
-
}), s.cookie &&
|
|
1884
|
+
p(`${y("header")} ${M(b)}`);
|
|
1885
|
+
}), s.cookie && p(`${y("cookie")} ${M(s.cookie)}`), o.mimeType) {
|
|
1886
1886
|
case "multipart/form-data":
|
|
1887
1887
|
($ = o.params) == null || $.forEach((m) => {
|
|
1888
1888
|
let b = "";
|
|
1889
|
-
m.fileName ? b = `${m.name}='@${m.fileName}'` : b = M(`${m.name}=${m.value}`),
|
|
1889
|
+
m.fileName ? b = `${m.name}='@${m.fileName}'` : b = M(`${m.name}=${m.value}`), p(`${y("form")} ${b}`);
|
|
1890
1890
|
});
|
|
1891
1891
|
break;
|
|
1892
1892
|
case "application/x-www-form-urlencoded":
|
|
1893
1893
|
o.params ? o.params.forEach((m) => {
|
|
1894
1894
|
const b = encodeURIComponent(m.name), S = b !== m.name ? b : m.name;
|
|
1895
|
-
|
|
1896
|
-
}) :
|
|
1895
|
+
p(`${i ? "--data-binary" : "--data-urlencode"} ${M(`${S}=${m.value}`)}`);
|
|
1896
|
+
}) : p(`${i ? "--data-binary" : y("data")} ${M(o.text)}`);
|
|
1897
1897
|
break;
|
|
1898
1898
|
default: {
|
|
1899
1899
|
if (!o.text) break;
|
|
1900
1900
|
let m = !1;
|
|
1901
|
-
if (
|
|
1901
|
+
if (Mn(o.mimeType) && o.text.length > 20)
|
|
1902
1902
|
try {
|
|
1903
1903
|
const b = JSON.parse(o.text);
|
|
1904
|
-
m = !0, o.text.indexOf("'") > 0 ?
|
|
1905
|
-
${JSON.stringify(b, null,
|
|
1906
|
-
EOF`) :
|
|
1907
|
-
${JSON.stringify(b, null,
|
|
1904
|
+
m = !0, o.text.indexOf("'") > 0 ? p(`${i ? "--data-binary" : y("data")} @- <<EOF
|
|
1905
|
+
${JSON.stringify(b, null, d)}
|
|
1906
|
+
EOF`) : p(`${i ? "--data-binary" : y("data")} '
|
|
1907
|
+
${JSON.stringify(b, null, d)}
|
|
1908
1908
|
'`);
|
|
1909
1909
|
} catch {
|
|
1910
1910
|
}
|
|
1911
|
-
m ||
|
|
1911
|
+
m || p(`${i ? "--data-binary" : y("data")} ${M(o.text)}`);
|
|
1912
1912
|
}
|
|
1913
1913
|
}
|
|
1914
1914
|
return h();
|
|
@@ -1945,19 +1945,19 @@ ${JSON.stringify(b, null, p)}
|
|
|
1945
1945
|
${i.indent}` : " "
|
|
1946
1946
|
});
|
|
1947
1947
|
let u = !1;
|
|
1948
|
-
const
|
|
1949
|
-
i.headers &&
|
|
1948
|
+
const d = [];
|
|
1949
|
+
i.headers && d.push(i.short ? "-h" : "--headers"), i.body && d.push(i.short ? "-b" : "--body"), i.verbose && d.push(i.short ? "-v" : "--verbose"), i.print && d.push(`${i.short ? "-p" : "--print"}=${i.print}`), i.verify && d.push(`--verify=${i.verify}`), i.cert && d.push(`--cert=${i.cert}`), i.pretty && d.push(`--pretty=${i.pretty}`), i.style && d.push(`--style=${i.style}`), i.timeout && d.push(`--timeout=${i.timeout}`), i.queryParams && Object.keys(r).forEach((y) => {
|
|
1950
1950
|
const g = r[y];
|
|
1951
1951
|
Array.isArray(g) ? g.forEach(($) => {
|
|
1952
1952
|
c(`${y}==${M($)}`);
|
|
1953
1953
|
}) : c(`${y}==${M(g)}`);
|
|
1954
1954
|
}), Object.keys(t).sort().forEach((y) => {
|
|
1955
1955
|
c(`${y}:${M(t[y])}`);
|
|
1956
|
-
}), e.mimeType === "application/x-www-form-urlencoded" ? (h = e.params) != null && h.length && (
|
|
1956
|
+
}), e.mimeType === "application/x-www-form-urlencoded" ? (h = e.params) != null && h.length && (d.push(i.short ? "-f" : "--form"), e.params.forEach((y) => {
|
|
1957
1957
|
c(`${y.name}=${M(y.value)}`);
|
|
1958
1958
|
})) : u = !0;
|
|
1959
|
-
const
|
|
1960
|
-
return o = M(i.queryParams ? o : n), f(`http ${
|
|
1959
|
+
const p = d.length ? `${d.join(" ")} ` : "";
|
|
1960
|
+
return o = M(i.queryParams ? o : n), f(`http ${p}${s} ${o}`), u && e.text && f(`echo ${M(e.text)} | `), l();
|
|
1961
1961
|
}
|
|
1962
1962
|
},
|
|
1963
1963
|
wget: {
|
|
@@ -1982,29 +1982,29 @@ ${o.indent}` : " "
|
|
|
1982
1982
|
return o.verbose ? a(`wget ${o.short ? "-v" : "--verbose"}`) : a(`wget ${o.short ? "-q" : "--quiet"}`), a(`--method ${M(t)}`), Object.keys(r).forEach((c) => {
|
|
1983
1983
|
const l = `${c}: ${r[c]}`;
|
|
1984
1984
|
a(`--header ${M(l)}`);
|
|
1985
|
-
}), e.text && a(`--body-data ${
|
|
1985
|
+
}), e.text && a(`--body-data ${go(M(e.text))}`), a(o.short ? "-O" : "--output-document"), a(`- ${M(n)}`), i();
|
|
1986
1986
|
}
|
|
1987
1987
|
}
|
|
1988
1988
|
}
|
|
1989
|
-
},
|
|
1990
|
-
const s =
|
|
1989
|
+
}, hr = (t, e) => e.repeat(t), yr = (t, e, r, n) => {
|
|
1990
|
+
const s = hr(n, r), o = hr(n - 1, r), a = e ? `,
|
|
1991
1991
|
${s}` : ", ";
|
|
1992
1992
|
return e ? `[
|
|
1993
1993
|
${s}${t.join(a)}
|
|
1994
1994
|
${o}]` : `[${t.join(a)}]`;
|
|
1995
|
-
},
|
|
1995
|
+
}, mr = (t, e, r) => `let ${t} = ${ot(e, r)}`, ot = (t, e, r) => {
|
|
1996
1996
|
switch (r = r === void 0 ? 1 : r + 1, Object.prototype.toString.call(t)) {
|
|
1997
1997
|
case "[object Number]":
|
|
1998
1998
|
return t;
|
|
1999
1999
|
case "[object Array]": {
|
|
2000
2000
|
let n = !1;
|
|
2001
2001
|
const s = t.map((o) => (Object.prototype.toString.call(o) === "[object Object]" && (n = Object.keys(o).length > 1), ot(o, e, r)));
|
|
2002
|
-
return
|
|
2002
|
+
return yr(s, n, e.indent, r);
|
|
2003
2003
|
}
|
|
2004
2004
|
case "[object Object]": {
|
|
2005
2005
|
const n = [];
|
|
2006
2006
|
for (const s in t) n.push(`"${s}": ${ot(t[s], e, r)}`);
|
|
2007
|
-
return
|
|
2007
|
+
return yr(n, e.pretty && n.length > 1, e.indent, r);
|
|
2008
2008
|
}
|
|
2009
2009
|
case "[object Boolean]":
|
|
2010
2010
|
return t.toString();
|
|
@@ -2012,27 +2012,27 @@ ${o}]` : `[${t.join(a)}]`;
|
|
|
2012
2012
|
return t == null ? "nil" : `"${t.toString().replace(/"/g, '\\"')}"`;
|
|
2013
2013
|
}
|
|
2014
2014
|
}, xe = {
|
|
2015
|
-
agent:
|
|
2016
|
-
c:
|
|
2017
|
-
clojure:
|
|
2018
|
-
crystal:
|
|
2019
|
-
csharp:
|
|
2020
|
-
go:
|
|
2021
|
-
http:
|
|
2022
|
-
java:
|
|
2023
|
-
javascript:
|
|
2024
|
-
json:
|
|
2025
|
-
kotlin:
|
|
2026
|
-
node:
|
|
2027
|
-
objc:
|
|
2028
|
-
ocaml:
|
|
2029
|
-
php:
|
|
2030
|
-
powershell:
|
|
2031
|
-
python:
|
|
2032
|
-
r:
|
|
2033
|
-
ruby:
|
|
2034
|
-
rust:
|
|
2035
|
-
shell:
|
|
2015
|
+
agent: Bn,
|
|
2016
|
+
c: Wn,
|
|
2017
|
+
clojure: Gn,
|
|
2018
|
+
crystal: zn,
|
|
2019
|
+
csharp: Qn,
|
|
2020
|
+
go: Yn,
|
|
2021
|
+
http: Xn,
|
|
2022
|
+
java: Zn,
|
|
2023
|
+
javascript: eo,
|
|
2024
|
+
json: to,
|
|
2025
|
+
kotlin: ro,
|
|
2026
|
+
node: no,
|
|
2027
|
+
objc: oo,
|
|
2028
|
+
ocaml: io,
|
|
2029
|
+
php: ao,
|
|
2030
|
+
powershell: co,
|
|
2031
|
+
python: fo,
|
|
2032
|
+
r: uo,
|
|
2033
|
+
ruby: po,
|
|
2034
|
+
rust: mo,
|
|
2035
|
+
shell: vo,
|
|
2036
2036
|
swift: {
|
|
2037
2037
|
info: {
|
|
2038
2038
|
key: "swift",
|
|
@@ -2048,7 +2048,7 @@ ${o}]` : `[${t.join(a)}]`;
|
|
|
2048
2048
|
extname: ".swift"
|
|
2049
2049
|
},
|
|
2050
2050
|
convert: ({ allHeaders: t, postData: e, uriObj: r, queryObj: n, method: s }, o) => {
|
|
2051
|
-
var
|
|
2051
|
+
var d;
|
|
2052
2052
|
const a = {
|
|
2053
2053
|
indent: " ",
|
|
2054
2054
|
pretty: !0,
|
|
@@ -2059,26 +2059,26 @@ ${o}]` : `[${t.join(a)}]`;
|
|
|
2059
2059
|
const f = e.text || e.jsonObj || e.params;
|
|
2060
2060
|
if (f) switch (e.mimeType) {
|
|
2061
2061
|
case "application/x-www-form-urlencoded":
|
|
2062
|
-
if ((
|
|
2063
|
-
const
|
|
2064
|
-
a.pretty ? (i("let parameters = ["),
|
|
2062
|
+
if ((d = e.params) != null && d.length) {
|
|
2063
|
+
const p = e.params.map((h) => `"${h.name}": "${h.value}"`);
|
|
2064
|
+
a.pretty ? (i("let parameters = ["), p.forEach((h) => {
|
|
2065
2065
|
i(`${h},`, 1);
|
|
2066
|
-
}), i("]")) : i(`let parameters = [${
|
|
2066
|
+
}), i("]")) : i(`let parameters = [${p.join(", ")}]`), i('let joinedParameters = parameters.map { "\\($0.key)=\\($0.value)" }.joined(separator: "&")'), i("let postData = Data(joinedParameters.utf8)"), c();
|
|
2067
2067
|
}
|
|
2068
2068
|
break;
|
|
2069
2069
|
case "application/json":
|
|
2070
|
-
e.jsonObj && (i(`${
|
|
2070
|
+
e.jsonObj && (i(`${mr("parameters", e.jsonObj, a)} as [String : Any?]`), c(), i("let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])"), c());
|
|
2071
2071
|
break;
|
|
2072
2072
|
case "multipart/form-data":
|
|
2073
|
-
i(
|
|
2073
|
+
i(mr("parameters", e.params, a)), c(), i(`let boundary = "${e.boundary}"`), c(), i('var body = ""'), i("for param in parameters {"), i('let paramName = param["name"]!', 1), i('body += "--\\(boundary)\\r\\n"', 1), i('body += "Content-Disposition:form-data; name=\\"\\(paramName)\\""', 1), i('if let filename = param["fileName"] {', 1), i('let contentType = param["contentType"]!', 2), i("let fileContent = try String(contentsOfFile: filename, encoding: .utf8)", 2), i('body += "; filename=\\"\\(filename)\\"\\r\\n"', 2), i('body += "Content-Type: \\(contentType)\\r\\n\\r\\n"', 2), i("body += fileContent", 2), i('} else if let paramValue = param["value"] {', 1), i('body += "\\r\\n\\r\\n\\(paramValue)"', 2), i("}", 1), i("}"), c(), i("let postData = Data(body.utf8)"), c();
|
|
2074
2074
|
break;
|
|
2075
2075
|
default:
|
|
2076
2076
|
i(`let postData = Data("${e.text}".utf8)`), c();
|
|
2077
2077
|
}
|
|
2078
2078
|
i(`let url = URL(string: "${r.href}")!`);
|
|
2079
2079
|
const u = n ? Object.entries(n) : [];
|
|
2080
|
-
return u.length < 1 ? i("var request = URLRequest(url: url)") : (i("var components = URLComponents(url: url, resolvingAgainstBaseURL: true)!"), i("let queryItems: [URLQueryItem] = ["), u.forEach((
|
|
2081
|
-
const h =
|
|
2080
|
+
return u.length < 1 ? i("var request = URLRequest(url: url)") : (i("var components = URLComponents(url: url, resolvingAgainstBaseURL: true)!"), i("let queryItems: [URLQueryItem] = ["), u.forEach((p) => {
|
|
2081
|
+
const h = p[0], y = p[1];
|
|
2082
2082
|
switch (Object.prototype.toString.call(y)) {
|
|
2083
2083
|
case "[object String]":
|
|
2084
2084
|
i(`URLQueryItem(name: "${h}", value: "${y}"),`, 1);
|
|
@@ -2093,18 +2093,18 @@ ${o}]` : `[${t.join(a)}]`;
|
|
|
2093
2093
|
}
|
|
2094
2094
|
} }
|
|
2095
2095
|
}
|
|
2096
|
-
},
|
|
2096
|
+
}, gr = (t, e) => {
|
|
2097
2097
|
const r = t[e.name];
|
|
2098
2098
|
return r === void 0 ? (t[e.name] = e.value, t) : Array.isArray(r) ? (r.push(e.value), t) : (t[e.name] = [r, e.value], t);
|
|
2099
2099
|
};
|
|
2100
2100
|
var it = { exports: {} };
|
|
2101
2101
|
/*! https://mths.be/punycode v1.4.1 by @mathias */
|
|
2102
|
-
var
|
|
2102
|
+
var wo = it.exports;
|
|
2103
2103
|
(function(t, e) {
|
|
2104
2104
|
(function(r) {
|
|
2105
2105
|
var n = e && !e.nodeType && e, s = t && !t.nodeType && t, o = typeof rt == "object" && rt;
|
|
2106
2106
|
(o.global === o || o.window === o || o.self === o) && (r = o);
|
|
2107
|
-
var a, i = 2147483647, c = 36, l = 1, f = 26, u = 38,
|
|
2107
|
+
var a, i = 2147483647, c = 36, l = 1, f = 26, u = 38, d = 700, p = 72, h = 128, y = "-", g = /^xn--/, $ = /[^\x20-\x7E]/, m = /[\x2E\u3002\uFF0E\uFF61]/g, b = {
|
|
2108
2108
|
overflow: "Overflow: input needs wider integers to process",
|
|
2109
2109
|
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
|
|
2110
2110
|
"invalid-input": "Invalid input"
|
|
@@ -2120,12 +2120,12 @@ var Eo = it.exports;
|
|
|
2120
2120
|
function U(w, x) {
|
|
2121
2121
|
var C = w.split("@"), R = "";
|
|
2122
2122
|
C.length > 1 && (R = C[0] + "@", w = C[1]), w = w.replace(m, ".");
|
|
2123
|
-
var
|
|
2123
|
+
var q = w.split("."), z = A(q, x).join(".");
|
|
2124
2124
|
return R + z;
|
|
2125
2125
|
}
|
|
2126
2126
|
function Q(w) {
|
|
2127
|
-
for (var x = [], C = 0, R = w.length,
|
|
2128
|
-
|
|
2127
|
+
for (var x = [], C = 0, R = w.length, q, z; C < R; )
|
|
2128
|
+
q = w.charCodeAt(C++), q >= 55296 && q <= 56319 && C < R ? (z = w.charCodeAt(C++), (z & 64512) == 56320 ? x.push(((q & 1023) << 10) + (z & 1023) + 65536) : (x.push(q), C--)) : x.push(q);
|
|
2129
2129
|
return x;
|
|
2130
2130
|
}
|
|
2131
2131
|
function Y(w) {
|
|
@@ -2142,26 +2142,26 @@ var Eo = it.exports;
|
|
|
2142
2142
|
}
|
|
2143
2143
|
function B(w, x, C) {
|
|
2144
2144
|
var R = 0;
|
|
2145
|
-
for (w = C ? O(w /
|
|
2145
|
+
for (w = C ? O(w / d) : w >> 1, w += O(w / x); w > S * f >> 1; R += c)
|
|
2146
2146
|
w = O(w / S);
|
|
2147
2147
|
return O(R + (S + 1) * w / (w + u));
|
|
2148
2148
|
}
|
|
2149
2149
|
function V(w) {
|
|
2150
|
-
var x = [], C = w.length, R,
|
|
2150
|
+
var x = [], C = w.length, R, q = 0, z = h, H = p, K, X, te, ce, W, D, Z, ue, he;
|
|
2151
2151
|
for (K = w.lastIndexOf(y), K < 0 && (K = 0), X = 0; X < K; ++X)
|
|
2152
2152
|
w.charCodeAt(X) >= 128 && P("not-basic"), x.push(w.charCodeAt(X));
|
|
2153
2153
|
for (te = K > 0 ? K + 1 : 0; te < C; ) {
|
|
2154
|
-
for (ce =
|
|
2154
|
+
for (ce = q, W = 1, D = c; te >= C && P("invalid-input"), Z = _(w.charCodeAt(te++)), (Z >= c || Z > O((i - q) / W)) && P("overflow"), q += Z * W, ue = D <= H ? l : D >= H + f ? f : D - H, !(Z < ue); D += c)
|
|
2155
2155
|
he = c - ue, W > O(i / he) && P("overflow"), W *= he;
|
|
2156
|
-
R = x.length + 1, H = B(
|
|
2156
|
+
R = x.length + 1, H = B(q - ce, R, ce == 0), O(q / R) > i - z && P("overflow"), z += O(q / R), q %= R, x.splice(q++, 0, z);
|
|
2157
2157
|
}
|
|
2158
2158
|
return Y(x);
|
|
2159
2159
|
}
|
|
2160
2160
|
function fe(w) {
|
|
2161
|
-
var x, C, R,
|
|
2162
|
-
for (w = Q(w), Z = w.length, x = h, C = 0, z =
|
|
2161
|
+
var x, C, R, q, z, H, K, X, te, ce, W, D = [], Z, ue, he, mt;
|
|
2162
|
+
for (w = Q(w), Z = w.length, x = h, C = 0, z = p, H = 0; H < Z; ++H)
|
|
2163
2163
|
W = w[H], W < 128 && D.push(v(W));
|
|
2164
|
-
for (R =
|
|
2164
|
+
for (R = q = D.length, q && D.push(y); R < Z; ) {
|
|
2165
2165
|
for (K = i, H = 0; H < Z; ++H)
|
|
2166
2166
|
W = w[H], W >= x && W < K && (K = W);
|
|
2167
2167
|
for (ue = R + 1, K - x > O((i - C) / ue) && P("overflow"), C += (K - x) * ue, x = K, H = 0; H < Z; ++H)
|
|
@@ -2170,7 +2170,7 @@ var Eo = it.exports;
|
|
|
2170
2170
|
mt = X - ce, he = c - ce, D.push(
|
|
2171
2171
|
v(G(ce + mt % he, 0))
|
|
2172
2172
|
), X = O(mt / he);
|
|
2173
|
-
D.push(v(G(X, 0))), z = B(C, ue, R ==
|
|
2173
|
+
D.push(v(G(X, 0))), z = B(C, ue, R == q), C = 0, ++R;
|
|
2174
2174
|
}
|
|
2175
2175
|
++C, ++x;
|
|
2176
2176
|
}
|
|
@@ -2216,42 +2216,42 @@ var Eo = it.exports;
|
|
|
2216
2216
|
a.hasOwnProperty(T) && (n[T] = a[T]);
|
|
2217
2217
|
else
|
|
2218
2218
|
r.punycode = a;
|
|
2219
|
-
})(
|
|
2219
|
+
})(wo);
|
|
2220
2220
|
})(it, it.exports);
|
|
2221
|
-
var
|
|
2222
|
-
const
|
|
2223
|
-
Object.assign(
|
|
2224
|
-
const
|
|
2221
|
+
var So = it.exports, Re = TypeError;
|
|
2222
|
+
const Zr = (t) => String(t);
|
|
2223
|
+
Object.assign(Zr, { custom: Symbol.for("nodejs.util.inspect.custom") });
|
|
2224
|
+
const Oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2225
2225
|
__proto__: null,
|
|
2226
|
-
default:
|
|
2227
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2228
|
-
var
|
|
2226
|
+
default: Zr
|
|
2227
|
+
}, Symbol.toStringTag, { value: "Module" })), To = /* @__PURE__ */ An(Oo);
|
|
2228
|
+
var Yt = typeof Map == "function" && Map.prototype, $t = Object.getOwnPropertyDescriptor && Yt ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, at = Yt && $t && typeof $t.get == "function" ? $t.get : null, br = Yt && Map.prototype.forEach, Xt = typeof Set == "function" && Set.prototype, vt = Object.getOwnPropertyDescriptor && Xt ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, st = Xt && vt && typeof vt.get == "function" ? vt.get : null, $r = Xt && Set.prototype.forEach, xo = typeof WeakMap == "function" && WeakMap.prototype, Le = xo ? WeakMap.prototype.has : null, Eo = typeof WeakSet == "function" && WeakSet.prototype, Ie = Eo ? WeakSet.prototype.has : null, jo = typeof WeakRef == "function" && WeakRef.prototype, vr = jo ? WeakRef.prototype.deref : null, Po = Boolean.prototype.valueOf, Co = Object.prototype.toString, ko = Function.prototype.toString, Ao = String.prototype.match, Zt = String.prototype.slice, pe = String.prototype.replace, Ro = String.prototype.toUpperCase, wr = String.prototype.toLowerCase, en = RegExp.prototype.test, Sr = Array.prototype.concat, ie = Array.prototype.join, No = Array.prototype.slice, Or = Math.floor, Ft = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, wt = Object.getOwnPropertySymbols, Ht = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, ke = typeof Symbol == "function" && typeof Symbol.iterator == "object", Ue = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === ke || !0) ? Symbol.toStringTag : null, tn = Object.prototype.propertyIsEnumerable, Tr = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(t) {
|
|
2229
2229
|
return t.__proto__;
|
|
2230
2230
|
} : null);
|
|
2231
|
-
function
|
|
2232
|
-
if (t === 1 / 0 || t === -1 / 0 || t !== t || t && t > -1e3 && t < 1e3 ||
|
|
2231
|
+
function xr(t, e) {
|
|
2232
|
+
if (t === 1 / 0 || t === -1 / 0 || t !== t || t && t > -1e3 && t < 1e3 || en.call(/e/, e))
|
|
2233
2233
|
return e;
|
|
2234
2234
|
var r = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
|
|
2235
2235
|
if (typeof t == "number") {
|
|
2236
|
-
var n = t < 0 ? -
|
|
2236
|
+
var n = t < 0 ? -Or(-t) : Or(t);
|
|
2237
2237
|
if (n !== t) {
|
|
2238
|
-
var s = String(n), o =
|
|
2238
|
+
var s = String(n), o = Zt.call(e, s.length + 1);
|
|
2239
2239
|
return pe.call(s, r, "$&_") + "." + pe.call(pe.call(o, /([0-9]{3})/g, "$&_"), /_$/, "");
|
|
2240
2240
|
}
|
|
2241
2241
|
}
|
|
2242
2242
|
return pe.call(e, r, "$&_");
|
|
2243
2243
|
}
|
|
2244
|
-
var
|
|
2244
|
+
var Mt = To, Er = Mt.custom, jr = on(Er) ? Er : null, rn = {
|
|
2245
2245
|
__proto__: null,
|
|
2246
2246
|
double: '"',
|
|
2247
2247
|
single: "'"
|
|
2248
|
-
},
|
|
2248
|
+
}, qo = {
|
|
2249
2249
|
__proto__: null,
|
|
2250
2250
|
double: /(["\\])/g,
|
|
2251
2251
|
single: /(['\\])/g
|
|
2252
2252
|
}, ft = function t(e, r, n, s) {
|
|
2253
2253
|
var o = r || {};
|
|
2254
|
-
if (le(o, "quoteStyle") && !le(
|
|
2254
|
+
if (le(o, "quoteStyle") && !le(rn, o.quoteStyle))
|
|
2255
2255
|
throw new TypeError('option "quoteStyle" must be "single" or "double"');
|
|
2256
2256
|
if (le(o, "maxStringLength") && (typeof o.maxStringLength == "number" ? o.maxStringLength < 0 && o.maxStringLength !== 1 / 0 : o.maxStringLength !== null))
|
|
2257
2257
|
throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
|
|
@@ -2270,27 +2270,27 @@ var Jt = Co, Cr = Jt.custom, kr = fn(Cr) ? Cr : null, cn = {
|
|
|
2270
2270
|
if (typeof e == "boolean")
|
|
2271
2271
|
return e ? "true" : "false";
|
|
2272
2272
|
if (typeof e == "string")
|
|
2273
|
-
return
|
|
2273
|
+
return sn(e, o);
|
|
2274
2274
|
if (typeof e == "number") {
|
|
2275
2275
|
if (e === 0)
|
|
2276
2276
|
return 1 / 0 / e > 0 ? "0" : "-0";
|
|
2277
2277
|
var c = String(e);
|
|
2278
|
-
return i ?
|
|
2278
|
+
return i ? xr(e, c) : c;
|
|
2279
2279
|
}
|
|
2280
2280
|
if (typeof e == "bigint") {
|
|
2281
2281
|
var l = String(e) + "n";
|
|
2282
|
-
return i ?
|
|
2282
|
+
return i ? xr(e, l) : l;
|
|
2283
2283
|
}
|
|
2284
2284
|
var f = typeof o.depth > "u" ? 5 : o.depth;
|
|
2285
2285
|
if (typeof n > "u" && (n = 0), n >= f && f > 0 && typeof e == "object")
|
|
2286
|
-
return
|
|
2287
|
-
var u =
|
|
2286
|
+
return Bt(e) ? "[Array]" : "[Object]";
|
|
2287
|
+
var u = Xo(o, n);
|
|
2288
2288
|
if (typeof s > "u")
|
|
2289
2289
|
s = [];
|
|
2290
|
-
else if (
|
|
2290
|
+
else if (an(s, e) >= 0)
|
|
2291
2291
|
return "[Circular]";
|
|
2292
|
-
function
|
|
2293
|
-
if (G && (s =
|
|
2292
|
+
function d(_, G, B) {
|
|
2293
|
+
if (G && (s = No.call(s), s.push(G)), B) {
|
|
2294
2294
|
var V = {
|
|
2295
2295
|
depth: o.depth
|
|
2296
2296
|
};
|
|
@@ -2298,140 +2298,140 @@ var Jt = Co, Cr = Jt.custom, kr = fn(Cr) ? Cr : null, cn = {
|
|
|
2298
2298
|
}
|
|
2299
2299
|
return t(_, o, n + 1, s);
|
|
2300
2300
|
}
|
|
2301
|
-
if (typeof e == "function" && !
|
|
2302
|
-
var
|
|
2303
|
-
return "[Function" + (
|
|
2301
|
+
if (typeof e == "function" && !Pr(e)) {
|
|
2302
|
+
var p = Wo(e), h = Ve(e, d);
|
|
2303
|
+
return "[Function" + (p ? ": " + p : " (anonymous)") + "]" + (h.length > 0 ? " { " + ie.call(h, ", ") + " }" : "");
|
|
2304
2304
|
}
|
|
2305
|
-
if (
|
|
2306
|
-
var y = ke ? pe.call(String(e), /^(Symbol\(.*\))_[^)]*$/, "$1") :
|
|
2307
|
-
return typeof e == "object" && !ke ?
|
|
2305
|
+
if (on(e)) {
|
|
2306
|
+
var y = ke ? pe.call(String(e), /^(Symbol\(.*\))_[^)]*$/, "$1") : Ht.call(e);
|
|
2307
|
+
return typeof e == "object" && !ke ? qe(y) : y;
|
|
2308
2308
|
}
|
|
2309
|
-
if (
|
|
2310
|
-
for (var g = "<" +
|
|
2311
|
-
g += " " + $[m].name + "=" +
|
|
2312
|
-
return g += ">", e.childNodes && e.childNodes.length && (g += "..."), g += "</" +
|
|
2309
|
+
if (Do(e)) {
|
|
2310
|
+
for (var g = "<" + wr.call(String(e.nodeName)), $ = e.attributes || [], m = 0; m < $.length; m++)
|
|
2311
|
+
g += " " + $[m].name + "=" + nn(_o($[m].value), "double", o);
|
|
2312
|
+
return g += ">", e.childNodes && e.childNodes.length && (g += "..."), g += "</" + wr.call(String(e.nodeName)) + ">", g;
|
|
2313
2313
|
}
|
|
2314
|
-
if (
|
|
2314
|
+
if (Bt(e)) {
|
|
2315
2315
|
if (e.length === 0)
|
|
2316
2316
|
return "[]";
|
|
2317
|
-
var b = Ve(e,
|
|
2318
|
-
return u && !
|
|
2317
|
+
var b = Ve(e, d);
|
|
2318
|
+
return u && !Yo(b) ? "[" + Wt(b, u) + "]" : "[ " + ie.call(b, ", ") + " ]";
|
|
2319
2319
|
}
|
|
2320
|
-
if (
|
|
2321
|
-
var S = Ve(e,
|
|
2322
|
-
return !("cause" in Error.prototype) && "cause" in e && !
|
|
2320
|
+
if (Io(e)) {
|
|
2321
|
+
var S = Ve(e, d);
|
|
2322
|
+
return !("cause" in Error.prototype) && "cause" in e && !tn.call(e, "cause") ? "{ [" + String(e) + "] " + ie.call(Sr.call("[cause]: " + d(e.cause), S), ", ") + " }" : S.length === 0 ? "[" + String(e) + "]" : "{ [" + String(e) + "] " + ie.call(S, ", ") + " }";
|
|
2323
2323
|
}
|
|
2324
2324
|
if (typeof e == "object" && a) {
|
|
2325
|
-
if (
|
|
2326
|
-
return
|
|
2325
|
+
if (jr && typeof e[jr] == "function" && Mt)
|
|
2326
|
+
return Mt(e, { depth: f - n });
|
|
2327
2327
|
if (a !== "symbol" && typeof e.inspect == "function")
|
|
2328
2328
|
return e.inspect();
|
|
2329
2329
|
}
|
|
2330
|
-
if (
|
|
2330
|
+
if (Jo(e)) {
|
|
2331
2331
|
var O = [];
|
|
2332
|
-
return
|
|
2333
|
-
O.push(
|
|
2334
|
-
}),
|
|
2332
|
+
return br && br.call(e, function(_, G) {
|
|
2333
|
+
O.push(d(G, e, !0) + " => " + d(_, e));
|
|
2334
|
+
}), Cr("Map", at.call(e), O, u);
|
|
2335
2335
|
}
|
|
2336
|
-
if (
|
|
2336
|
+
if (Vo(e)) {
|
|
2337
2337
|
var v = [];
|
|
2338
|
-
return
|
|
2339
|
-
v.push(
|
|
2340
|
-
}),
|
|
2338
|
+
return $r && $r.call(e, function(_) {
|
|
2339
|
+
v.push(d(_, e));
|
|
2340
|
+
}), Cr("Set", st.call(e), v, u);
|
|
2341
2341
|
}
|
|
2342
|
-
if (
|
|
2342
|
+
if (Go(e))
|
|
2343
2343
|
return St("WeakMap");
|
|
2344
|
-
if (
|
|
2344
|
+
if (Ko(e))
|
|
2345
2345
|
return St("WeakSet");
|
|
2346
|
-
if (Yo(e))
|
|
2347
|
-
return St("WeakRef");
|
|
2348
|
-
if (Jo(e))
|
|
2349
|
-
return Ne(p(Number(e)));
|
|
2350
2346
|
if (zo(e))
|
|
2351
|
-
return
|
|
2352
|
-
if (
|
|
2353
|
-
return
|
|
2354
|
-
if (
|
|
2355
|
-
return
|
|
2347
|
+
return St("WeakRef");
|
|
2348
|
+
if (Fo(e))
|
|
2349
|
+
return qe(d(Number(e)));
|
|
2350
|
+
if (Mo(e))
|
|
2351
|
+
return qe(d(Ft.call(e)));
|
|
2352
|
+
if (Ho(e))
|
|
2353
|
+
return qe(Po.call(e));
|
|
2354
|
+
if (Uo(e))
|
|
2355
|
+
return qe(d(String(e)));
|
|
2356
2356
|
if (typeof window < "u" && e === window)
|
|
2357
2357
|
return "{ [object Window] }";
|
|
2358
2358
|
if (typeof globalThis < "u" && e === globalThis || typeof rt < "u" && e === rt)
|
|
2359
2359
|
return "{ [object globalThis] }";
|
|
2360
|
-
if (!
|
|
2361
|
-
var T = Ve(e,
|
|
2362
|
-
return T.length === 0 ? Y + "{}" : u ? Y + "{" +
|
|
2360
|
+
if (!Lo(e) && !Pr(e)) {
|
|
2361
|
+
var T = Ve(e, d), P = Tr ? Tr(e) === Object.prototype : e instanceof Object || e.constructor === Object, A = e instanceof Object ? "" : "null prototype", U = !P && Ue && Object(e) === e && Ue in e ? Zt.call(de(e), 8, -1) : A ? "Object" : "", Q = P || typeof e.constructor != "function" ? "" : e.constructor.name ? e.constructor.name + " " : "", Y = Q + (U || A ? "[" + ie.call(Sr.call([], U || [], A || []), ": ") + "] " : "");
|
|
2362
|
+
return T.length === 0 ? Y + "{}" : u ? Y + "{" + Wt(T, u) + "}" : Y + "{ " + ie.call(T, ", ") + " }";
|
|
2363
2363
|
}
|
|
2364
2364
|
return String(e);
|
|
2365
2365
|
};
|
|
2366
|
-
function
|
|
2367
|
-
var n = r.quoteStyle || e, s =
|
|
2366
|
+
function nn(t, e, r) {
|
|
2367
|
+
var n = r.quoteStyle || e, s = rn[n];
|
|
2368
2368
|
return s + t + s;
|
|
2369
2369
|
}
|
|
2370
|
-
function
|
|
2370
|
+
function _o(t) {
|
|
2371
2371
|
return pe.call(String(t), /"/g, """);
|
|
2372
2372
|
}
|
|
2373
2373
|
function $e(t) {
|
|
2374
2374
|
return !Ue || !(typeof t == "object" && (Ue in t || typeof t[Ue] < "u"));
|
|
2375
2375
|
}
|
|
2376
|
-
function
|
|
2376
|
+
function Bt(t) {
|
|
2377
2377
|
return de(t) === "[object Array]" && $e(t);
|
|
2378
2378
|
}
|
|
2379
|
-
function
|
|
2379
|
+
function Lo(t) {
|
|
2380
2380
|
return de(t) === "[object Date]" && $e(t);
|
|
2381
2381
|
}
|
|
2382
|
-
function
|
|
2382
|
+
function Pr(t) {
|
|
2383
2383
|
return de(t) === "[object RegExp]" && $e(t);
|
|
2384
2384
|
}
|
|
2385
|
-
function
|
|
2385
|
+
function Io(t) {
|
|
2386
2386
|
return de(t) === "[object Error]" && $e(t);
|
|
2387
2387
|
}
|
|
2388
|
-
function
|
|
2388
|
+
function Uo(t) {
|
|
2389
2389
|
return de(t) === "[object String]" && $e(t);
|
|
2390
2390
|
}
|
|
2391
|
-
function
|
|
2391
|
+
function Fo(t) {
|
|
2392
2392
|
return de(t) === "[object Number]" && $e(t);
|
|
2393
2393
|
}
|
|
2394
|
-
function
|
|
2394
|
+
function Ho(t) {
|
|
2395
2395
|
return de(t) === "[object Boolean]" && $e(t);
|
|
2396
2396
|
}
|
|
2397
|
-
function
|
|
2397
|
+
function on(t) {
|
|
2398
2398
|
if (ke)
|
|
2399
2399
|
return t && typeof t == "object" && t instanceof Symbol;
|
|
2400
2400
|
if (typeof t == "symbol")
|
|
2401
2401
|
return !0;
|
|
2402
|
-
if (!t || typeof t != "object" || !
|
|
2402
|
+
if (!t || typeof t != "object" || !Ht)
|
|
2403
2403
|
return !1;
|
|
2404
2404
|
try {
|
|
2405
|
-
return
|
|
2405
|
+
return Ht.call(t), !0;
|
|
2406
2406
|
} catch {
|
|
2407
2407
|
}
|
|
2408
2408
|
return !1;
|
|
2409
2409
|
}
|
|
2410
|
-
function
|
|
2411
|
-
if (!t || typeof t != "object" || !
|
|
2410
|
+
function Mo(t) {
|
|
2411
|
+
if (!t || typeof t != "object" || !Ft)
|
|
2412
2412
|
return !1;
|
|
2413
2413
|
try {
|
|
2414
|
-
return
|
|
2414
|
+
return Ft.call(t), !0;
|
|
2415
2415
|
} catch {
|
|
2416
2416
|
}
|
|
2417
2417
|
return !1;
|
|
2418
2418
|
}
|
|
2419
|
-
var
|
|
2419
|
+
var Bo = Object.prototype.hasOwnProperty || function(t) {
|
|
2420
2420
|
return t in this;
|
|
2421
2421
|
};
|
|
2422
2422
|
function le(t, e) {
|
|
2423
|
-
return
|
|
2423
|
+
return Bo.call(t, e);
|
|
2424
2424
|
}
|
|
2425
2425
|
function de(t) {
|
|
2426
|
-
return
|
|
2426
|
+
return Co.call(t);
|
|
2427
2427
|
}
|
|
2428
|
-
function
|
|
2428
|
+
function Wo(t) {
|
|
2429
2429
|
if (t.name)
|
|
2430
2430
|
return t.name;
|
|
2431
|
-
var e =
|
|
2431
|
+
var e = Ao.call(ko.call(t), /^function\s*([\w$]+)/);
|
|
2432
2432
|
return e ? e[1] : null;
|
|
2433
2433
|
}
|
|
2434
|
-
function
|
|
2434
|
+
function an(t, e) {
|
|
2435
2435
|
if (t.indexOf)
|
|
2436
2436
|
return t.indexOf(e);
|
|
2437
2437
|
for (var r = 0, n = t.length; r < n; r++)
|
|
@@ -2439,7 +2439,7 @@ function un(t, e) {
|
|
|
2439
2439
|
return r;
|
|
2440
2440
|
return -1;
|
|
2441
2441
|
}
|
|
2442
|
-
function
|
|
2442
|
+
function Jo(t) {
|
|
2443
2443
|
if (!at || !t || typeof t != "object")
|
|
2444
2444
|
return !1;
|
|
2445
2445
|
try {
|
|
@@ -2454,7 +2454,7 @@ function Do(t) {
|
|
|
2454
2454
|
}
|
|
2455
2455
|
return !1;
|
|
2456
2456
|
}
|
|
2457
|
-
function
|
|
2457
|
+
function Go(t) {
|
|
2458
2458
|
if (!Le || !t || typeof t != "object")
|
|
2459
2459
|
return !1;
|
|
2460
2460
|
try {
|
|
@@ -2469,16 +2469,16 @@ function Qo(t) {
|
|
|
2469
2469
|
}
|
|
2470
2470
|
return !1;
|
|
2471
2471
|
}
|
|
2472
|
-
function
|
|
2473
|
-
if (!
|
|
2472
|
+
function zo(t) {
|
|
2473
|
+
if (!vr || !t || typeof t != "object")
|
|
2474
2474
|
return !1;
|
|
2475
2475
|
try {
|
|
2476
|
-
return
|
|
2476
|
+
return vr.call(t), !0;
|
|
2477
2477
|
} catch {
|
|
2478
2478
|
}
|
|
2479
2479
|
return !1;
|
|
2480
2480
|
}
|
|
2481
|
-
function
|
|
2481
|
+
function Vo(t) {
|
|
2482
2482
|
if (!st || !t || typeof t != "object")
|
|
2483
2483
|
return !1;
|
|
2484
2484
|
try {
|
|
@@ -2493,7 +2493,7 @@ function Xo(t) {
|
|
|
2493
2493
|
}
|
|
2494
2494
|
return !1;
|
|
2495
2495
|
}
|
|
2496
|
-
function
|
|
2496
|
+
function Ko(t) {
|
|
2497
2497
|
if (!Ie || !t || typeof t != "object")
|
|
2498
2498
|
return !1;
|
|
2499
2499
|
try {
|
|
@@ -2508,20 +2508,20 @@ function Zo(t) {
|
|
|
2508
2508
|
}
|
|
2509
2509
|
return !1;
|
|
2510
2510
|
}
|
|
2511
|
-
function
|
|
2511
|
+
function Do(t) {
|
|
2512
2512
|
return !t || typeof t != "object" ? !1 : typeof HTMLElement < "u" && t instanceof HTMLElement ? !0 : typeof t.nodeName == "string" && typeof t.getAttribute == "function";
|
|
2513
2513
|
}
|
|
2514
|
-
function
|
|
2514
|
+
function sn(t, e) {
|
|
2515
2515
|
if (t.length > e.maxStringLength) {
|
|
2516
2516
|
var r = t.length - e.maxStringLength, n = "... " + r + " more character" + (r > 1 ? "s" : "");
|
|
2517
|
-
return
|
|
2517
|
+
return sn(Zt.call(t, 0, e.maxStringLength), e) + n;
|
|
2518
2518
|
}
|
|
2519
|
-
var s =
|
|
2519
|
+
var s = qo[e.quoteStyle || "single"];
|
|
2520
2520
|
s.lastIndex = 0;
|
|
2521
|
-
var o = pe.call(pe.call(t, s, "\\$1"), /[\x00-\x1f]/g,
|
|
2522
|
-
return
|
|
2521
|
+
var o = pe.call(pe.call(t, s, "\\$1"), /[\x00-\x1f]/g, Qo);
|
|
2522
|
+
return nn(o, "single", e);
|
|
2523
2523
|
}
|
|
2524
|
-
function
|
|
2524
|
+
function Qo(t) {
|
|
2525
2525
|
var e = t.charCodeAt(0), r = {
|
|
2526
2526
|
8: "b",
|
|
2527
2527
|
9: "t",
|
|
@@ -2529,26 +2529,26 @@ function ti(t) {
|
|
|
2529
2529
|
12: "f",
|
|
2530
2530
|
13: "r"
|
|
2531
2531
|
}[e];
|
|
2532
|
-
return r ? "\\" + r : "\\x" + (e < 16 ? "0" : "") +
|
|
2532
|
+
return r ? "\\" + r : "\\x" + (e < 16 ? "0" : "") + Ro.call(e.toString(16));
|
|
2533
2533
|
}
|
|
2534
|
-
function
|
|
2534
|
+
function qe(t) {
|
|
2535
2535
|
return "Object(" + t + ")";
|
|
2536
2536
|
}
|
|
2537
2537
|
function St(t) {
|
|
2538
2538
|
return t + " { ? }";
|
|
2539
2539
|
}
|
|
2540
|
-
function
|
|
2541
|
-
var s = n ?
|
|
2540
|
+
function Cr(t, e, r, n) {
|
|
2541
|
+
var s = n ? Wt(r, n) : ie.call(r, ", ");
|
|
2542
2542
|
return t + " (" + e + ") {" + s + "}";
|
|
2543
2543
|
}
|
|
2544
|
-
function
|
|
2544
|
+
function Yo(t) {
|
|
2545
2545
|
for (var e = 0; e < t.length; e++)
|
|
2546
|
-
if (
|
|
2546
|
+
if (an(t[e], `
|
|
2547
2547
|
`) >= 0)
|
|
2548
2548
|
return !1;
|
|
2549
2549
|
return !0;
|
|
2550
2550
|
}
|
|
2551
|
-
function
|
|
2551
|
+
function Xo(t, e) {
|
|
2552
2552
|
var r;
|
|
2553
2553
|
if (t.indent === " ")
|
|
2554
2554
|
r = " ";
|
|
@@ -2561,7 +2561,7 @@ function ni(t, e) {
|
|
|
2561
2561
|
prev: ie.call(Array(e + 1), r)
|
|
2562
2562
|
};
|
|
2563
2563
|
}
|
|
2564
|
-
function
|
|
2564
|
+
function Wt(t, e) {
|
|
2565
2565
|
if (t.length === 0)
|
|
2566
2566
|
return "";
|
|
2567
2567
|
var r = `
|
|
@@ -2570,7 +2570,7 @@ function zt(t, e) {
|
|
|
2570
2570
|
` + e.prev;
|
|
2571
2571
|
}
|
|
2572
2572
|
function Ve(t, e) {
|
|
2573
|
-
var r =
|
|
2573
|
+
var r = Bt(t), n = [];
|
|
2574
2574
|
if (r) {
|
|
2575
2575
|
n.length = t.length;
|
|
2576
2576
|
for (var s = 0; s < t.length; s++)
|
|
@@ -2583,23 +2583,23 @@ function Ve(t, e) {
|
|
|
2583
2583
|
a["$" + o[i]] = o[i];
|
|
2584
2584
|
}
|
|
2585
2585
|
for (var c in t)
|
|
2586
|
-
le(t, c) && (r && String(Number(c)) === c && c < t.length || ke && a["$" + c] instanceof Symbol || (
|
|
2586
|
+
le(t, c) && (r && String(Number(c)) === c && c < t.length || ke && a["$" + c] instanceof Symbol || (en.call(/[^\w$]/, c) ? n.push(e(c, t) + ": " + e(t[c], t)) : n.push(c + ": " + e(t[c], t))));
|
|
2587
2587
|
if (typeof wt == "function")
|
|
2588
2588
|
for (var l = 0; l < o.length; l++)
|
|
2589
|
-
|
|
2589
|
+
tn.call(t, o[l]) && n.push("[" + e(o[l]) + "]: " + e(t[o[l]], t));
|
|
2590
2590
|
return n;
|
|
2591
2591
|
}
|
|
2592
|
-
var
|
|
2592
|
+
var Zo = ft, ei = Re, ut = function(t, e, r) {
|
|
2593
2593
|
for (var n = t, s; (s = n.next) != null; n = s)
|
|
2594
2594
|
if (s.key === e)
|
|
2595
2595
|
return n.next = s.next, r || (s.next = /** @type {NonNullable<typeof list.next>} */
|
|
2596
2596
|
t.next, t.next = s), s;
|
|
2597
|
-
},
|
|
2597
|
+
}, ti = function(t, e) {
|
|
2598
2598
|
if (t) {
|
|
2599
2599
|
var r = ut(t, e);
|
|
2600
2600
|
return r && r.value;
|
|
2601
2601
|
}
|
|
2602
|
-
},
|
|
2602
|
+
}, ri = function(t, e, r) {
|
|
2603
2603
|
var n = ut(t, e);
|
|
2604
2604
|
n ? n.value = r : t.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */
|
|
2605
2605
|
{
|
|
@@ -2608,31 +2608,31 @@ var oi = ft, ii = Re, ut = function(t, e, r) {
|
|
|
2608
2608
|
next: t.next,
|
|
2609
2609
|
value: r
|
|
2610
2610
|
};
|
|
2611
|
-
},
|
|
2611
|
+
}, ni = function(t, e) {
|
|
2612
2612
|
return t ? !!ut(t, e) : !1;
|
|
2613
|
-
},
|
|
2613
|
+
}, oi = function(t, e) {
|
|
2614
2614
|
if (t)
|
|
2615
2615
|
return ut(t, e, !0);
|
|
2616
|
-
},
|
|
2616
|
+
}, ii = function() {
|
|
2617
2617
|
var e, r = {
|
|
2618
2618
|
assert: function(n) {
|
|
2619
2619
|
if (!r.has(n))
|
|
2620
|
-
throw new
|
|
2620
|
+
throw new ei("Side channel does not contain " + Zo(n));
|
|
2621
2621
|
},
|
|
2622
2622
|
delete: function(n) {
|
|
2623
|
-
var s =
|
|
2623
|
+
var s = oi(e, n);
|
|
2624
2624
|
return s && e && !e.next && (e = void 0), !!s;
|
|
2625
2625
|
},
|
|
2626
2626
|
get: function(n) {
|
|
2627
|
-
return
|
|
2627
|
+
return ti(e, n);
|
|
2628
2628
|
},
|
|
2629
2629
|
has: function(n) {
|
|
2630
|
-
return
|
|
2630
|
+
return ni(e, n);
|
|
2631
2631
|
},
|
|
2632
2632
|
set: function(n, s) {
|
|
2633
2633
|
e || (e = {
|
|
2634
2634
|
next: void 0
|
|
2635
|
-
}),
|
|
2635
|
+
}), ri(
|
|
2636
2636
|
/** @type {NonNullable<typeof $o>} */
|
|
2637
2637
|
e,
|
|
2638
2638
|
n,
|
|
@@ -2641,27 +2641,27 @@ var oi = ft, ii = Re, ut = function(t, e, r) {
|
|
|
2641
2641
|
}
|
|
2642
2642
|
};
|
|
2643
2643
|
return r;
|
|
2644
|
-
},
|
|
2644
|
+
}, cn = Object, ai = Error, si = EvalError, ci = RangeError, li = ReferenceError, fi = SyntaxError, ui = URIError, pi = Math.abs, di = Math.floor, hi = Math.max, yi = Math.min, mi = Math.pow, gi = Math.round, bi = Number.isNaN || function(e) {
|
|
2645
2645
|
return e !== e;
|
|
2646
|
-
},
|
|
2647
|
-
return
|
|
2648
|
-
},
|
|
2646
|
+
}, $i = bi, vi = function(e) {
|
|
2647
|
+
return $i(e) || e === 0 ? e : e < 0 ? -1 : 1;
|
|
2648
|
+
}, wi = Object.getOwnPropertyDescriptor, Ye = wi;
|
|
2649
2649
|
if (Ye)
|
|
2650
2650
|
try {
|
|
2651
2651
|
Ye([], "length");
|
|
2652
2652
|
} catch {
|
|
2653
2653
|
Ye = null;
|
|
2654
2654
|
}
|
|
2655
|
-
var
|
|
2655
|
+
var ln = Ye, Xe = Object.defineProperty || !1;
|
|
2656
2656
|
if (Xe)
|
|
2657
2657
|
try {
|
|
2658
2658
|
Xe({}, "a", { value: 1 });
|
|
2659
2659
|
} catch {
|
|
2660
2660
|
Xe = !1;
|
|
2661
2661
|
}
|
|
2662
|
-
var
|
|
2663
|
-
function
|
|
2664
|
-
return
|
|
2662
|
+
var fn = Xe, Ot, kr;
|
|
2663
|
+
function Si() {
|
|
2664
|
+
return kr || (kr = 1, Ot = function() {
|
|
2665
2665
|
if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
|
|
2666
2666
|
return !1;
|
|
2667
2667
|
if (typeof Symbol.iterator == "symbol")
|
|
@@ -2689,95 +2689,77 @@ function ji() {
|
|
|
2689
2689
|
return !0;
|
|
2690
2690
|
}), Ot;
|
|
2691
2691
|
}
|
|
2692
|
-
var Tt,
|
|
2693
|
-
function
|
|
2694
|
-
if (
|
|
2695
|
-
|
|
2696
|
-
var t = typeof Symbol < "u" && Symbol, e =
|
|
2692
|
+
var Tt, Ar;
|
|
2693
|
+
function Oi() {
|
|
2694
|
+
if (Ar) return Tt;
|
|
2695
|
+
Ar = 1;
|
|
2696
|
+
var t = typeof Symbol < "u" && Symbol, e = Si();
|
|
2697
2697
|
return Tt = function() {
|
|
2698
2698
|
return typeof t != "function" || typeof Symbol != "function" || typeof t("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : e();
|
|
2699
2699
|
}, Tt;
|
|
2700
2700
|
}
|
|
2701
|
-
var xt,
|
|
2702
|
-
function
|
|
2703
|
-
return
|
|
2701
|
+
var xt, Rr;
|
|
2702
|
+
function un() {
|
|
2703
|
+
return Rr || (Rr = 1, xt = typeof Reflect < "u" && Reflect.getPrototypeOf || null), xt;
|
|
2704
2704
|
}
|
|
2705
|
-
var Et,
|
|
2706
|
-
function
|
|
2707
|
-
if (
|
|
2708
|
-
|
|
2709
|
-
var t =
|
|
2705
|
+
var Et, Nr;
|
|
2706
|
+
function pn() {
|
|
2707
|
+
if (Nr) return Et;
|
|
2708
|
+
Nr = 1;
|
|
2709
|
+
var t = cn;
|
|
2710
2710
|
return Et = t.getPrototypeOf || null, Et;
|
|
2711
2711
|
}
|
|
2712
|
-
var
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
for (var f = o(arguments, 1), u, p = function() {
|
|
2736
|
-
if (this instanceof u) {
|
|
2737
|
-
var $ = l.apply(
|
|
2738
|
-
this,
|
|
2739
|
-
s(f, arguments)
|
|
2740
|
-
);
|
|
2741
|
-
return Object($) === $ ? $ : this;
|
|
2742
|
-
}
|
|
2743
|
-
return l.apply(
|
|
2744
|
-
c,
|
|
2745
|
-
s(f, arguments)
|
|
2712
|
+
var Ti = "Function.prototype.bind called on incompatible ", xi = Object.prototype.toString, Ei = Math.max, ji = "[object Function]", qr = function(e, r) {
|
|
2713
|
+
for (var n = [], s = 0; s < e.length; s += 1)
|
|
2714
|
+
n[s] = e[s];
|
|
2715
|
+
for (var o = 0; o < r.length; o += 1)
|
|
2716
|
+
n[o + e.length] = r[o];
|
|
2717
|
+
return n;
|
|
2718
|
+
}, Pi = function(e, r) {
|
|
2719
|
+
for (var n = [], s = r, o = 0; s < e.length; s += 1, o += 1)
|
|
2720
|
+
n[o] = e[s];
|
|
2721
|
+
return n;
|
|
2722
|
+
}, Ci = function(t, e) {
|
|
2723
|
+
for (var r = "", n = 0; n < t.length; n += 1)
|
|
2724
|
+
r += t[n], n + 1 < t.length && (r += e);
|
|
2725
|
+
return r;
|
|
2726
|
+
}, ki = function(e) {
|
|
2727
|
+
var r = this;
|
|
2728
|
+
if (typeof r != "function" || xi.apply(r) !== ji)
|
|
2729
|
+
throw new TypeError(Ti + r);
|
|
2730
|
+
for (var n = Pi(arguments, 1), s, o = function() {
|
|
2731
|
+
if (this instanceof s) {
|
|
2732
|
+
var f = r.apply(
|
|
2733
|
+
this,
|
|
2734
|
+
qr(n, arguments)
|
|
2746
2735
|
);
|
|
2747
|
-
|
|
2748
|
-
h[y] = "$" + y;
|
|
2749
|
-
if (u = Function("binder", "return function (" + a(h, ",") + "){ return binder.apply(this,arguments); }")(p), l.prototype) {
|
|
2750
|
-
var g = function() {
|
|
2751
|
-
};
|
|
2752
|
-
g.prototype = l.prototype, u.prototype = new g(), g.prototype = null;
|
|
2736
|
+
return Object(f) === f ? f : this;
|
|
2753
2737
|
}
|
|
2754
|
-
return
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
function bn() {
|
|
2770
|
-
return Hr || (Hr = 1, kt = Function.prototype.apply), kt;
|
|
2738
|
+
return r.apply(
|
|
2739
|
+
e,
|
|
2740
|
+
qr(n, arguments)
|
|
2741
|
+
);
|
|
2742
|
+
}, a = Ei(0, r.length - n.length), i = [], c = 0; c < a; c++)
|
|
2743
|
+
i[c] = "$" + c;
|
|
2744
|
+
if (s = Function("binder", "return function (" + Ci(i, ",") + "){ return binder.apply(this,arguments); }")(o), r.prototype) {
|
|
2745
|
+
var l = function() {
|
|
2746
|
+
};
|
|
2747
|
+
l.prototype = r.prototype, s.prototype = new l(), l.prototype = null;
|
|
2748
|
+
}
|
|
2749
|
+
return s;
|
|
2750
|
+
}, Ai = ki, pt = Function.prototype.bind || Ai, er = Function.prototype.call, jt, _r;
|
|
2751
|
+
function dn() {
|
|
2752
|
+
return _r || (_r = 1, jt = Function.prototype.apply), jt;
|
|
2771
2753
|
}
|
|
2772
|
-
var
|
|
2754
|
+
var Ri = typeof Reflect < "u" && Reflect && Reflect.apply, Ni = pt, qi = dn(), _i = er, Li = Ri, Ii = Li || Ni.call(_i, qi), Ui = pt, Fi = Re, Hi = er, Mi = Ii, hn = function(e) {
|
|
2773
2755
|
if (e.length < 1 || typeof e[0] != "function")
|
|
2774
|
-
throw new
|
|
2775
|
-
return
|
|
2776
|
-
},
|
|
2777
|
-
function
|
|
2778
|
-
if (
|
|
2779
|
-
|
|
2780
|
-
var t =
|
|
2756
|
+
throw new Fi("a function is required");
|
|
2757
|
+
return Mi(Ui, Hi, e);
|
|
2758
|
+
}, Pt, Lr;
|
|
2759
|
+
function Bi() {
|
|
2760
|
+
if (Lr) return Pt;
|
|
2761
|
+
Lr = 1;
|
|
2762
|
+
var t = hn, e = ln, r;
|
|
2781
2763
|
try {
|
|
2782
2764
|
r = /** @type {{ __proto__?: typeof Array.prototype }} */
|
|
2783
2765
|
[].__proto__ === Array.prototype;
|
|
@@ -2790,19 +2772,19 @@ function Hi() {
|
|
|
2790
2772
|
/** @type {keyof typeof Object.prototype} */
|
|
2791
2773
|
"__proto__"
|
|
2792
2774
|
), s = Object, o = s.getPrototypeOf;
|
|
2793
|
-
return
|
|
2775
|
+
return Pt = n && typeof n.get == "function" ? t([n.get]) : typeof o == "function" ? (
|
|
2794
2776
|
/** @type {import('./get')} */
|
|
2795
2777
|
function(i) {
|
|
2796
2778
|
return o(i == null ? i : s(i));
|
|
2797
2779
|
}
|
|
2798
|
-
) : !1,
|
|
2780
|
+
) : !1, Pt;
|
|
2799
2781
|
}
|
|
2800
|
-
var
|
|
2801
|
-
function
|
|
2802
|
-
if (
|
|
2803
|
-
|
|
2804
|
-
var t =
|
|
2805
|
-
return
|
|
2782
|
+
var Ct, Ir;
|
|
2783
|
+
function Wi() {
|
|
2784
|
+
if (Ir) return Ct;
|
|
2785
|
+
Ir = 1;
|
|
2786
|
+
var t = un(), e = pn(), r = /* @__PURE__ */ Bi();
|
|
2787
|
+
return Ct = t ? function(s) {
|
|
2806
2788
|
return t(s);
|
|
2807
2789
|
} : e ? function(s) {
|
|
2808
2790
|
if (!s || typeof s != "object" && typeof s != "function")
|
|
@@ -2810,33 +2792,33 @@ function Mi() {
|
|
|
2810
2792
|
return e(s);
|
|
2811
2793
|
} : r ? function(s) {
|
|
2812
2794
|
return r(s);
|
|
2813
|
-
} : null,
|
|
2795
|
+
} : null, Ct;
|
|
2814
2796
|
}
|
|
2815
|
-
var
|
|
2816
|
-
function
|
|
2817
|
-
if (
|
|
2818
|
-
|
|
2819
|
-
var t = Function.prototype.call, e = Object.prototype.hasOwnProperty, r = pt
|
|
2820
|
-
return
|
|
2797
|
+
var kt, Ur;
|
|
2798
|
+
function Ji() {
|
|
2799
|
+
if (Ur) return kt;
|
|
2800
|
+
Ur = 1;
|
|
2801
|
+
var t = Function.prototype.call, e = Object.prototype.hasOwnProperty, r = pt;
|
|
2802
|
+
return kt = r.call(t, e), kt;
|
|
2821
2803
|
}
|
|
2822
|
-
var j,
|
|
2804
|
+
var j, Gi = cn, zi = ai, Vi = si, Ki = ci, Di = li, Ae = fi, je = Re, Qi = ui, Yi = pi, Xi = di, Zi = hi, ea = yi, ta = mi, ra = gi, na = vi, yn = Function, At = function(t) {
|
|
2823
2805
|
try {
|
|
2824
|
-
return
|
|
2806
|
+
return yn('"use strict"; return (' + t + ").constructor;")();
|
|
2825
2807
|
} catch {
|
|
2826
2808
|
}
|
|
2827
|
-
}, Me =
|
|
2809
|
+
}, Me = ln, oa = fn, Rt = function() {
|
|
2828
2810
|
throw new je();
|
|
2829
|
-
},
|
|
2811
|
+
}, ia = Me ? (function() {
|
|
2830
2812
|
try {
|
|
2831
|
-
return arguments.callee,
|
|
2813
|
+
return arguments.callee, Rt;
|
|
2832
2814
|
} catch {
|
|
2833
2815
|
try {
|
|
2834
2816
|
return Me(arguments, "callee").get;
|
|
2835
2817
|
} catch {
|
|
2836
|
-
return
|
|
2818
|
+
return Rt;
|
|
2837
2819
|
}
|
|
2838
2820
|
}
|
|
2839
|
-
})() :
|
|
2821
|
+
})() : Rt, ve = Oi()(), F = Wi(), aa = pn(), sa = un(), mn = dn(), Be = er, Se = {}, ca = typeof Uint8Array > "u" || !F ? j : F(Uint8Array), be = {
|
|
2840
2822
|
__proto__: null,
|
|
2841
2823
|
"%AggregateError%": typeof AggregateError > "u" ? j : AggregateError,
|
|
2842
2824
|
"%Array%": Array,
|
|
@@ -2858,15 +2840,15 @@ var j, Wi = dn, Ji = ui, Gi = pi, zi = di, Vi = hi, Ae = yi, je = Re, Ki = mi, D
|
|
|
2858
2840
|
"%decodeURIComponent%": decodeURIComponent,
|
|
2859
2841
|
"%encodeURI%": encodeURI,
|
|
2860
2842
|
"%encodeURIComponent%": encodeURIComponent,
|
|
2861
|
-
"%Error%":
|
|
2843
|
+
"%Error%": zi,
|
|
2862
2844
|
"%eval%": eval,
|
|
2863
2845
|
// eslint-disable-line no-eval
|
|
2864
|
-
"%EvalError%":
|
|
2846
|
+
"%EvalError%": Vi,
|
|
2865
2847
|
"%Float16Array%": typeof Float16Array > "u" ? j : Float16Array,
|
|
2866
2848
|
"%Float32Array%": typeof Float32Array > "u" ? j : Float32Array,
|
|
2867
2849
|
"%Float64Array%": typeof Float64Array > "u" ? j : Float64Array,
|
|
2868
2850
|
"%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? j : FinalizationRegistry,
|
|
2869
|
-
"%Function%":
|
|
2851
|
+
"%Function%": yn,
|
|
2870
2852
|
"%GeneratorFunction%": Se,
|
|
2871
2853
|
"%Int8Array%": typeof Int8Array > "u" ? j : Int8Array,
|
|
2872
2854
|
"%Int16Array%": typeof Int16Array > "u" ? j : Int16Array,
|
|
@@ -2879,14 +2861,14 @@ var j, Wi = dn, Ji = ui, Gi = pi, zi = di, Vi = hi, Ae = yi, je = Re, Ki = mi, D
|
|
|
2879
2861
|
"%MapIteratorPrototype%": typeof Map > "u" || !ve || !F ? j : F((/* @__PURE__ */ new Map())[Symbol.iterator]()),
|
|
2880
2862
|
"%Math%": Math,
|
|
2881
2863
|
"%Number%": Number,
|
|
2882
|
-
"%Object%":
|
|
2864
|
+
"%Object%": Gi,
|
|
2883
2865
|
"%Object.getOwnPropertyDescriptor%": Me,
|
|
2884
2866
|
"%parseFloat%": parseFloat,
|
|
2885
2867
|
"%parseInt%": parseInt,
|
|
2886
2868
|
"%Promise%": typeof Promise > "u" ? j : Promise,
|
|
2887
2869
|
"%Proxy%": typeof Proxy > "u" ? j : Proxy,
|
|
2888
|
-
"%RangeError%":
|
|
2889
|
-
"%ReferenceError%":
|
|
2870
|
+
"%RangeError%": Ki,
|
|
2871
|
+
"%ReferenceError%": Di,
|
|
2890
2872
|
"%Reflect%": typeof Reflect > "u" ? j : Reflect,
|
|
2891
2873
|
"%RegExp%": RegExp,
|
|
2892
2874
|
"%Set%": typeof Set > "u" ? j : Set,
|
|
@@ -2896,45 +2878,45 @@ var j, Wi = dn, Ji = ui, Gi = pi, zi = di, Vi = hi, Ae = yi, je = Re, Ki = mi, D
|
|
|
2896
2878
|
"%StringIteratorPrototype%": ve && F ? F(""[Symbol.iterator]()) : j,
|
|
2897
2879
|
"%Symbol%": ve ? Symbol : j,
|
|
2898
2880
|
"%SyntaxError%": Ae,
|
|
2899
|
-
"%ThrowTypeError%":
|
|
2900
|
-
"%TypedArray%":
|
|
2881
|
+
"%ThrowTypeError%": ia,
|
|
2882
|
+
"%TypedArray%": ca,
|
|
2901
2883
|
"%TypeError%": je,
|
|
2902
2884
|
"%Uint8Array%": typeof Uint8Array > "u" ? j : Uint8Array,
|
|
2903
2885
|
"%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? j : Uint8ClampedArray,
|
|
2904
2886
|
"%Uint16Array%": typeof Uint16Array > "u" ? j : Uint16Array,
|
|
2905
2887
|
"%Uint32Array%": typeof Uint32Array > "u" ? j : Uint32Array,
|
|
2906
|
-
"%URIError%":
|
|
2888
|
+
"%URIError%": Qi,
|
|
2907
2889
|
"%WeakMap%": typeof WeakMap > "u" ? j : WeakMap,
|
|
2908
2890
|
"%WeakRef%": typeof WeakRef > "u" ? j : WeakRef,
|
|
2909
2891
|
"%WeakSet%": typeof WeakSet > "u" ? j : WeakSet,
|
|
2910
2892
|
"%Function.prototype.call%": Be,
|
|
2911
|
-
"%Function.prototype.apply%":
|
|
2912
|
-
"%Object.defineProperty%":
|
|
2913
|
-
"%Object.getPrototypeOf%":
|
|
2914
|
-
"%Math.abs%":
|
|
2915
|
-
"%Math.floor%":
|
|
2916
|
-
"%Math.max%":
|
|
2917
|
-
"%Math.min%":
|
|
2918
|
-
"%Math.pow%":
|
|
2919
|
-
"%Math.round%":
|
|
2920
|
-
"%Math.sign%":
|
|
2921
|
-
"%Reflect.getPrototypeOf%":
|
|
2893
|
+
"%Function.prototype.apply%": mn,
|
|
2894
|
+
"%Object.defineProperty%": oa,
|
|
2895
|
+
"%Object.getPrototypeOf%": aa,
|
|
2896
|
+
"%Math.abs%": Yi,
|
|
2897
|
+
"%Math.floor%": Xi,
|
|
2898
|
+
"%Math.max%": Zi,
|
|
2899
|
+
"%Math.min%": ea,
|
|
2900
|
+
"%Math.pow%": ta,
|
|
2901
|
+
"%Math.round%": ra,
|
|
2902
|
+
"%Math.sign%": na,
|
|
2903
|
+
"%Reflect.getPrototypeOf%": sa
|
|
2922
2904
|
};
|
|
2923
2905
|
if (F)
|
|
2924
2906
|
try {
|
|
2925
2907
|
null.error;
|
|
2926
2908
|
} catch (t) {
|
|
2927
|
-
var
|
|
2928
|
-
be["%Error.prototype%"] =
|
|
2909
|
+
var la = F(F(t));
|
|
2910
|
+
be["%Error.prototype%"] = la;
|
|
2929
2911
|
}
|
|
2930
|
-
var
|
|
2912
|
+
var fa = function t(e) {
|
|
2931
2913
|
var r;
|
|
2932
2914
|
if (e === "%AsyncFunction%")
|
|
2933
|
-
r =
|
|
2915
|
+
r = At("async function () {}");
|
|
2934
2916
|
else if (e === "%GeneratorFunction%")
|
|
2935
|
-
r =
|
|
2917
|
+
r = At("function* () {}");
|
|
2936
2918
|
else if (e === "%AsyncGeneratorFunction%")
|
|
2937
|
-
r =
|
|
2919
|
+
r = At("async function* () {}");
|
|
2938
2920
|
else if (e === "%AsyncGenerator%") {
|
|
2939
2921
|
var n = t("%AsyncGeneratorFunction%");
|
|
2940
2922
|
n && (r = n.prototype);
|
|
@@ -2943,7 +2925,7 @@ var ca = function t(e) {
|
|
|
2943
2925
|
s && F && (r = F(s.prototype));
|
|
2944
2926
|
}
|
|
2945
2927
|
return be[e] = r, r;
|
|
2946
|
-
},
|
|
2928
|
+
}, Fr = {
|
|
2947
2929
|
__proto__: null,
|
|
2948
2930
|
"%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
|
|
2949
2931
|
"%ArrayPrototype%": ["Array", "prototype"],
|
|
@@ -2996,21 +2978,21 @@ var ca = function t(e) {
|
|
|
2996
2978
|
"%URIErrorPrototype%": ["URIError", "prototype"],
|
|
2997
2979
|
"%WeakMapPrototype%": ["WeakMap", "prototype"],
|
|
2998
2980
|
"%WeakSetPrototype%": ["WeakSet", "prototype"]
|
|
2999
|
-
}, We = pt
|
|
2981
|
+
}, We = pt, ct = /* @__PURE__ */ Ji(), ua = We.call(Be, Array.prototype.concat), pa = We.call(mn, Array.prototype.splice), Hr = We.call(Be, String.prototype.replace), lt = We.call(Be, String.prototype.slice), da = We.call(Be, RegExp.prototype.exec), ha = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, ya = /\\(\\)?/g, ma = function(e) {
|
|
3000
2982
|
var r = lt(e, 0, 1), n = lt(e, -1);
|
|
3001
2983
|
if (r === "%" && n !== "%")
|
|
3002
2984
|
throw new Ae("invalid intrinsic syntax, expected closing `%`");
|
|
3003
2985
|
if (n === "%" && r !== "%")
|
|
3004
2986
|
throw new Ae("invalid intrinsic syntax, expected opening `%`");
|
|
3005
2987
|
var s = [];
|
|
3006
|
-
return
|
|
3007
|
-
s[s.length] = i ?
|
|
2988
|
+
return Hr(e, ha, function(o, a, i, c) {
|
|
2989
|
+
s[s.length] = i ? Hr(c, ya, "$1") : a || o;
|
|
3008
2990
|
}), s;
|
|
3009
|
-
},
|
|
2991
|
+
}, ga = function(e, r) {
|
|
3010
2992
|
var n = e, s;
|
|
3011
|
-
if (ct(
|
|
2993
|
+
if (ct(Fr, n) && (s = Fr[n], n = "%" + s[0] + "%"), ct(be, n)) {
|
|
3012
2994
|
var o = be[n];
|
|
3013
|
-
if (o === Se && (o =
|
|
2995
|
+
if (o === Se && (o = fa(n)), typeof o > "u" && !r)
|
|
3014
2996
|
throw new je("intrinsic " + e + " exists, but is not available. Please file an issue!");
|
|
3015
2997
|
return {
|
|
3016
2998
|
alias: s,
|
|
@@ -3019,105 +3001,105 @@ var ca = function t(e) {
|
|
|
3019
3001
|
};
|
|
3020
3002
|
}
|
|
3021
3003
|
throw new Ae("intrinsic " + e + " does not exist!");
|
|
3022
|
-
},
|
|
3004
|
+
}, tr = function(e, r) {
|
|
3023
3005
|
if (typeof e != "string" || e.length === 0)
|
|
3024
3006
|
throw new je("intrinsic name must be a non-empty string");
|
|
3025
3007
|
if (arguments.length > 1 && typeof r != "boolean")
|
|
3026
3008
|
throw new je('"allowMissing" argument must be a boolean');
|
|
3027
|
-
if (
|
|
3009
|
+
if (da(/^%?[^%]*%?$/, e) === null)
|
|
3028
3010
|
throw new Ae("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
|
|
3029
|
-
var n =
|
|
3030
|
-
l && (s = l[0],
|
|
3011
|
+
var n = ma(e), s = n.length > 0 ? n[0] : "", o = ga("%" + s + "%", r), a = o.name, i = o.value, c = !1, l = o.alias;
|
|
3012
|
+
l && (s = l[0], pa(n, ua([0, 1], l)));
|
|
3031
3013
|
for (var f = 1, u = !0; f < n.length; f += 1) {
|
|
3032
|
-
var
|
|
3033
|
-
if ((
|
|
3014
|
+
var d = n[f], p = lt(d, 0, 1), h = lt(d, -1);
|
|
3015
|
+
if ((p === '"' || p === "'" || p === "`" || h === '"' || h === "'" || h === "`") && p !== h)
|
|
3034
3016
|
throw new Ae("property names with quotes must have matching quotes");
|
|
3035
|
-
if ((
|
|
3017
|
+
if ((d === "constructor" || !u) && (c = !0), s += "." + d, a = "%" + s + "%", ct(be, a))
|
|
3036
3018
|
i = be[a];
|
|
3037
3019
|
else if (i != null) {
|
|
3038
|
-
if (!(
|
|
3020
|
+
if (!(d in i)) {
|
|
3039
3021
|
if (!r)
|
|
3040
3022
|
throw new je("base intrinsic for " + e + " exists, but the property is not available.");
|
|
3041
3023
|
return;
|
|
3042
3024
|
}
|
|
3043
3025
|
if (Me && f + 1 >= n.length) {
|
|
3044
|
-
var y = Me(i,
|
|
3045
|
-
u = !!y, u && "get" in y && !("originalValue" in y.get) ? i = y.get : i = i[
|
|
3026
|
+
var y = Me(i, d);
|
|
3027
|
+
u = !!y, u && "get" in y && !("originalValue" in y.get) ? i = y.get : i = i[d];
|
|
3046
3028
|
} else
|
|
3047
|
-
u = ct(i,
|
|
3029
|
+
u = ct(i, d), i = i[d];
|
|
3048
3030
|
u && !c && (be[a] = i);
|
|
3049
3031
|
}
|
|
3050
3032
|
}
|
|
3051
3033
|
return i;
|
|
3052
|
-
},
|
|
3034
|
+
}, gn = tr, bn = hn, ba = bn([gn("%String.prototype.indexOf%")]), $n = function(e, r) {
|
|
3053
3035
|
var n = (
|
|
3054
3036
|
/** @type {(this: unknown, ...args: unknown[]) => unknown} */
|
|
3055
|
-
|
|
3037
|
+
gn(e, !!r)
|
|
3056
3038
|
);
|
|
3057
|
-
return typeof n == "function" &&
|
|
3039
|
+
return typeof n == "function" && ba(e, ".prototype.") > -1 ? bn(
|
|
3058
3040
|
/** @type {const} */
|
|
3059
3041
|
[n]
|
|
3060
3042
|
) : n;
|
|
3061
|
-
},
|
|
3043
|
+
}, $a = tr, Je = $n, va = ft, wa = Re, Mr = $a("%Map%", !0), Sa = Je("Map.prototype.get", !0), Oa = Je("Map.prototype.set", !0), Ta = Je("Map.prototype.has", !0), xa = Je("Map.prototype.delete", !0), Ea = Je("Map.prototype.size", !0), vn = !!Mr && /** @type {Exclude<import('.'), false>} */
|
|
3062
3044
|
function() {
|
|
3063
3045
|
var e, r = {
|
|
3064
3046
|
assert: function(n) {
|
|
3065
3047
|
if (!r.has(n))
|
|
3066
|
-
throw new
|
|
3048
|
+
throw new wa("Side channel does not contain " + va(n));
|
|
3067
3049
|
},
|
|
3068
3050
|
delete: function(n) {
|
|
3069
3051
|
if (e) {
|
|
3070
|
-
var s =
|
|
3071
|
-
return
|
|
3052
|
+
var s = xa(e, n);
|
|
3053
|
+
return Ea(e) === 0 && (e = void 0), s;
|
|
3072
3054
|
}
|
|
3073
3055
|
return !1;
|
|
3074
3056
|
},
|
|
3075
3057
|
get: function(n) {
|
|
3076
3058
|
if (e)
|
|
3077
|
-
return
|
|
3059
|
+
return Sa(e, n);
|
|
3078
3060
|
},
|
|
3079
3061
|
has: function(n) {
|
|
3080
|
-
return e ?
|
|
3062
|
+
return e ? Ta(e, n) : !1;
|
|
3081
3063
|
},
|
|
3082
3064
|
set: function(n, s) {
|
|
3083
|
-
e || (e = new
|
|
3065
|
+
e || (e = new Mr()), Oa(e, n, s);
|
|
3084
3066
|
}
|
|
3085
3067
|
};
|
|
3086
3068
|
return r;
|
|
3087
|
-
},
|
|
3069
|
+
}, ja = tr, dt = $n, Pa = ft, Ke = vn, Ca = Re, we = ja("%WeakMap%", !0), ka = dt("WeakMap.prototype.get", !0), Aa = dt("WeakMap.prototype.set", !0), Ra = dt("WeakMap.prototype.has", !0), Na = dt("WeakMap.prototype.delete", !0), qa = we ? (
|
|
3088
3070
|
/** @type {Exclude<import('.'), false>} */
|
|
3089
3071
|
function() {
|
|
3090
3072
|
var e, r, n = {
|
|
3091
3073
|
assert: function(s) {
|
|
3092
3074
|
if (!n.has(s))
|
|
3093
|
-
throw new
|
|
3075
|
+
throw new Ca("Side channel does not contain " + Pa(s));
|
|
3094
3076
|
},
|
|
3095
3077
|
delete: function(s) {
|
|
3096
3078
|
if (we && s && (typeof s == "object" || typeof s == "function")) {
|
|
3097
3079
|
if (e)
|
|
3098
|
-
return
|
|
3080
|
+
return Na(e, s);
|
|
3099
3081
|
} else if (Ke && r)
|
|
3100
3082
|
return r.delete(s);
|
|
3101
3083
|
return !1;
|
|
3102
3084
|
},
|
|
3103
3085
|
get: function(s) {
|
|
3104
|
-
return we && s && (typeof s == "object" || typeof s == "function") && e ?
|
|
3086
|
+
return we && s && (typeof s == "object" || typeof s == "function") && e ? ka(e, s) : r && r.get(s);
|
|
3105
3087
|
},
|
|
3106
3088
|
has: function(s) {
|
|
3107
|
-
return we && s && (typeof s == "object" || typeof s == "function") && e ?
|
|
3089
|
+
return we && s && (typeof s == "object" || typeof s == "function") && e ? Ra(e, s) : !!r && r.has(s);
|
|
3108
3090
|
},
|
|
3109
3091
|
set: function(s, o) {
|
|
3110
|
-
we && s && (typeof s == "object" || typeof s == "function") ? (e || (e = new we()),
|
|
3092
|
+
we && s && (typeof s == "object" || typeof s == "function") ? (e || (e = new we()), Aa(e, s, o)) : Ke && (r || (r = Ke()), r.set(s, o));
|
|
3111
3093
|
}
|
|
3112
3094
|
};
|
|
3113
3095
|
return n;
|
|
3114
3096
|
}
|
|
3115
|
-
) : Ke,
|
|
3097
|
+
) : Ke, _a = Re, La = ft, Ia = ii, Ua = vn, Fa = qa, Ha = Fa || Ua || Ia, wn = function() {
|
|
3116
3098
|
var e, r = {
|
|
3117
3099
|
assert: function(n) {
|
|
3118
3100
|
if (!r.has(n)) {
|
|
3119
|
-
var s = n && Object(n) === n ? "the given object key" :
|
|
3120
|
-
throw new
|
|
3101
|
+
var s = n && Object(n) === n ? "the given object key" : La(n);
|
|
3102
|
+
throw new _a("Side channel does not contain " + s);
|
|
3121
3103
|
}
|
|
3122
3104
|
},
|
|
3123
3105
|
delete: function(n) {
|
|
@@ -3130,38 +3112,38 @@ function() {
|
|
|
3130
3112
|
return !!e && e.has(n);
|
|
3131
3113
|
},
|
|
3132
3114
|
set: function(n, s) {
|
|
3133
|
-
e || (e =
|
|
3115
|
+
e || (e = Ha()), e.set(n, s);
|
|
3134
3116
|
}
|
|
3135
3117
|
};
|
|
3136
3118
|
return r;
|
|
3137
|
-
},
|
|
3119
|
+
}, Ma = String.prototype.replace, Ba = /%20/g, Nt = {
|
|
3138
3120
|
RFC1738: "RFC1738",
|
|
3139
3121
|
RFC3986: "RFC3986"
|
|
3140
|
-
},
|
|
3141
|
-
default:
|
|
3122
|
+
}, rr = {
|
|
3123
|
+
default: Nt.RFC3986,
|
|
3142
3124
|
formatters: {
|
|
3143
3125
|
RFC1738: function(t) {
|
|
3144
|
-
return
|
|
3126
|
+
return Ma.call(t, Ba, "+");
|
|
3145
3127
|
},
|
|
3146
3128
|
RFC3986: function(t) {
|
|
3147
3129
|
return String(t);
|
|
3148
3130
|
}
|
|
3149
3131
|
},
|
|
3150
|
-
RFC1738:
|
|
3151
|
-
RFC3986:
|
|
3152
|
-
},
|
|
3132
|
+
RFC1738: Nt.RFC1738,
|
|
3133
|
+
RFC3986: Nt.RFC3986
|
|
3134
|
+
}, Wa = rr, Sn = wn, Br = fn, qt = Object.prototype.hasOwnProperty, ye = Array.isArray, ht = Sn(), me = function(e, r) {
|
|
3153
3135
|
return ht.set(e, r), e;
|
|
3154
3136
|
}, ge = function(e) {
|
|
3155
3137
|
return ht.has(e);
|
|
3156
3138
|
}, _e = function(e) {
|
|
3157
3139
|
return ht.get(e);
|
|
3158
|
-
},
|
|
3140
|
+
}, Jt = function(e, r) {
|
|
3159
3141
|
ht.set(e, r);
|
|
3160
3142
|
}, re = (function() {
|
|
3161
3143
|
for (var t = [], e = 0; e < 256; ++e)
|
|
3162
3144
|
t[t.length] = "%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase();
|
|
3163
3145
|
return t;
|
|
3164
|
-
})(),
|
|
3146
|
+
})(), Ja = function(e) {
|
|
3165
3147
|
for (; e.length > 1; ) {
|
|
3166
3148
|
var r = e.pop(), n = r.obj[r.prop];
|
|
3167
3149
|
if (ye(n)) {
|
|
@@ -3174,14 +3156,14 @@ function() {
|
|
|
3174
3156
|
for (var n = r && r.plainObjects ? { __proto__: null } : {}, s = 0; s < e.length; ++s)
|
|
3175
3157
|
typeof e[s] < "u" && (n[s] = e[s]);
|
|
3176
3158
|
return n;
|
|
3177
|
-
},
|
|
3178
|
-
r === "__proto__" &&
|
|
3159
|
+
}, Gt = function(e, r, n) {
|
|
3160
|
+
r === "__proto__" && Br ? Br(e, r, {
|
|
3179
3161
|
configurable: !0,
|
|
3180
3162
|
enumerable: !0,
|
|
3181
3163
|
value: n,
|
|
3182
3164
|
writable: !0
|
|
3183
3165
|
}) : e[r] = n;
|
|
3184
|
-
},
|
|
3166
|
+
}, Ga = function t(e, r, n) {
|
|
3185
3167
|
if (!r)
|
|
3186
3168
|
return e;
|
|
3187
3169
|
if (typeof r != "object" && typeof r != "function") {
|
|
@@ -3196,11 +3178,11 @@ function() {
|
|
|
3196
3178
|
} else if (e && typeof e == "object")
|
|
3197
3179
|
if (ge(e)) {
|
|
3198
3180
|
var o = _e(e) + 1;
|
|
3199
|
-
e[o] = r,
|
|
3181
|
+
e[o] = r, Jt(e, o);
|
|
3200
3182
|
} else {
|
|
3201
3183
|
if (n && n.strictMerge)
|
|
3202
3184
|
return [e, r];
|
|
3203
|
-
(n && (n.plainObjects || n.allowPrototypes) || !
|
|
3185
|
+
(n && (n.plainObjects || n.allowPrototypes) || !qt.call(Object.prototype, r)) && (e[r] = !0);
|
|
3204
3186
|
}
|
|
3205
3187
|
else
|
|
3206
3188
|
return [e, r];
|
|
@@ -3224,12 +3206,12 @@ function() {
|
|
|
3224
3206
|
}
|
|
3225
3207
|
var u = e;
|
|
3226
3208
|
if (ye(e) && !ye(r) && (u = Ee(e, n)), ye(e) && ye(r)) {
|
|
3227
|
-
if (r.forEach(function(
|
|
3228
|
-
if (
|
|
3229
|
-
var h = e[
|
|
3230
|
-
h && typeof h == "object" &&
|
|
3209
|
+
if (r.forEach(function(d, p) {
|
|
3210
|
+
if (qt.call(e, p)) {
|
|
3211
|
+
var h = e[p];
|
|
3212
|
+
h && typeof h == "object" && d && typeof d == "object" ? e[p] = t(h, d, n) : e[e.length] = d;
|
|
3231
3213
|
} else
|
|
3232
|
-
e[
|
|
3214
|
+
e[p] = d;
|
|
3233
3215
|
}), n && typeof n.arrayLimit == "number" && e.length > n.arrayLimit) {
|
|
3234
3216
|
if (n.throwOnLimitExceeded)
|
|
3235
3217
|
throw new RangeError("Array limit exceeded. Only " + n.arrayLimit + " element" + (n.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
|
|
@@ -3237,19 +3219,19 @@ function() {
|
|
|
3237
3219
|
}
|
|
3238
3220
|
return e;
|
|
3239
3221
|
}
|
|
3240
|
-
return Object.keys(r).reduce(function(
|
|
3241
|
-
var h = r[
|
|
3242
|
-
if (
|
|
3243
|
-
var y = parseInt(
|
|
3244
|
-
String(y) ===
|
|
3222
|
+
return Object.keys(r).reduce(function(d, p) {
|
|
3223
|
+
var h = r[p];
|
|
3224
|
+
if (qt.call(d, p) ? Gt(d, p, t(d[p], h, n)) : Gt(d, p, h), ge(r) && !ge(d) && me(d, _e(r)), ge(d)) {
|
|
3225
|
+
var y = parseInt(p, 10);
|
|
3226
|
+
String(y) === p && y >= 0 && y > _e(d) && Jt(d, y);
|
|
3245
3227
|
}
|
|
3246
|
-
return
|
|
3228
|
+
return d;
|
|
3247
3229
|
}, u);
|
|
3248
|
-
},
|
|
3230
|
+
}, za = function(e, r) {
|
|
3249
3231
|
return Object.keys(r).reduce(function(n, s) {
|
|
3250
|
-
return
|
|
3232
|
+
return Gt(n, s, r[s]), n;
|
|
3251
3233
|
}, e);
|
|
3252
|
-
},
|
|
3234
|
+
}, Va = function(t, e, r) {
|
|
3253
3235
|
var n = t.replace(/\+/g, " ");
|
|
3254
3236
|
if (r === "iso-8859-1")
|
|
3255
3237
|
return n.replace(/%[0-9a-f]{2}/gi, unescape);
|
|
@@ -3258,7 +3240,7 @@ function() {
|
|
|
3258
3240
|
} catch {
|
|
3259
3241
|
return n;
|
|
3260
3242
|
}
|
|
3261
|
-
}, De = 1024,
|
|
3243
|
+
}, De = 1024, Ka = function(e, r, n, s, o) {
|
|
3262
3244
|
if (e.length === 0)
|
|
3263
3245
|
return e;
|
|
3264
3246
|
var a = e;
|
|
@@ -3272,46 +3254,46 @@ function() {
|
|
|
3272
3254
|
var f = l.charCodeAt(l.length - 1);
|
|
3273
3255
|
f >= 55296 && f <= 56319 && (l = l.slice(0, -1), c -= 1);
|
|
3274
3256
|
}
|
|
3275
|
-
for (var u = [],
|
|
3276
|
-
var
|
|
3277
|
-
if (
|
|
3278
|
-
u[u.length] = l.charAt(
|
|
3257
|
+
for (var u = [], d = 0; d < l.length; ++d) {
|
|
3258
|
+
var p = l.charCodeAt(d);
|
|
3259
|
+
if (p === 45 || p === 46 || p === 95 || p === 126 || p >= 48 && p <= 57 || p >= 65 && p <= 90 || p >= 97 && p <= 122 || o === Wa.RFC1738 && (p === 40 || p === 41)) {
|
|
3260
|
+
u[u.length] = l.charAt(d);
|
|
3279
3261
|
continue;
|
|
3280
3262
|
}
|
|
3281
|
-
if (
|
|
3282
|
-
u[u.length] = re[
|
|
3263
|
+
if (p < 128) {
|
|
3264
|
+
u[u.length] = re[p];
|
|
3283
3265
|
continue;
|
|
3284
3266
|
}
|
|
3285
|
-
if (
|
|
3286
|
-
u[u.length] = re[192 |
|
|
3267
|
+
if (p < 2048) {
|
|
3268
|
+
u[u.length] = re[192 | p >> 6] + re[128 | p & 63];
|
|
3287
3269
|
continue;
|
|
3288
3270
|
}
|
|
3289
|
-
if (
|
|
3290
|
-
u[u.length] = re[224 |
|
|
3271
|
+
if (p < 55296 || p >= 57344) {
|
|
3272
|
+
u[u.length] = re[224 | p >> 12] + re[128 | p >> 6 & 63] + re[128 | p & 63];
|
|
3291
3273
|
continue;
|
|
3292
3274
|
}
|
|
3293
|
-
|
|
3275
|
+
d += 1, p = 65536 + ((p & 1023) << 10 | l.charCodeAt(d) & 1023), u[u.length] = re[240 | p >> 18] + re[128 | p >> 12 & 63] + re[128 | p >> 6 & 63] + re[128 | p & 63];
|
|
3294
3276
|
}
|
|
3295
3277
|
i += u.join("");
|
|
3296
3278
|
}
|
|
3297
3279
|
return i;
|
|
3298
|
-
},
|
|
3299
|
-
for (var r = [{ obj: { o: e }, prop: "o" }], n =
|
|
3280
|
+
}, Da = function(e) {
|
|
3281
|
+
for (var r = [{ obj: { o: e }, prop: "o" }], n = Sn(), s = 0; s < r.length; ++s)
|
|
3300
3282
|
for (var o = r[s], a = o.obj[o.prop], i = Object.keys(a), c = 0; c < i.length; ++c) {
|
|
3301
3283
|
var l = i[c], f = a[l];
|
|
3302
3284
|
typeof f == "object" && f !== null && !n.has(f) && (r[r.length] = { obj: a, prop: l }, n.set(f, !0));
|
|
3303
3285
|
}
|
|
3304
|
-
return
|
|
3305
|
-
},
|
|
3286
|
+
return Ja(r), e;
|
|
3287
|
+
}, Qa = function(e) {
|
|
3306
3288
|
return Object.prototype.toString.call(e) === "[object RegExp]";
|
|
3307
|
-
},
|
|
3289
|
+
}, Ya = function(e) {
|
|
3308
3290
|
return !e || typeof e != "object" ? !1 : !!(e.constructor && e.constructor.isBuffer && e.constructor.isBuffer(e));
|
|
3309
|
-
},
|
|
3291
|
+
}, Xa = function(e, r, n, s, o) {
|
|
3310
3292
|
if (ge(e)) {
|
|
3311
3293
|
if (o)
|
|
3312
3294
|
throw new RangeError("Array limit exceeded. Only " + n + " element" + (n === 1 ? "" : "s") + " allowed in an array.");
|
|
3313
3295
|
var a = _e(e) + 1;
|
|
3314
|
-
return e[a] = r,
|
|
3296
|
+
return e[a] = r, Jt(e, a), e;
|
|
3315
3297
|
}
|
|
3316
3298
|
var i = [].concat(e, r);
|
|
3317
3299
|
if (i.length > n) {
|
|
@@ -3320,27 +3302,27 @@ function() {
|
|
|
3320
3302
|
return me(Ee(i, { plainObjects: s }), i.length - 1);
|
|
3321
3303
|
}
|
|
3322
3304
|
return i;
|
|
3323
|
-
},
|
|
3305
|
+
}, Za = function(e, r) {
|
|
3324
3306
|
if (ye(e)) {
|
|
3325
3307
|
for (var n = [], s = 0; s < e.length; s += 1)
|
|
3326
3308
|
n[n.length] = r(e[s]);
|
|
3327
3309
|
return n;
|
|
3328
3310
|
}
|
|
3329
3311
|
return r(e);
|
|
3330
|
-
},
|
|
3312
|
+
}, On = {
|
|
3331
3313
|
arrayToObject: Ee,
|
|
3332
|
-
assign:
|
|
3333
|
-
combine:
|
|
3334
|
-
compact:
|
|
3335
|
-
decode:
|
|
3336
|
-
encode:
|
|
3337
|
-
isBuffer:
|
|
3314
|
+
assign: za,
|
|
3315
|
+
combine: Xa,
|
|
3316
|
+
compact: Da,
|
|
3317
|
+
decode: Va,
|
|
3318
|
+
encode: Ka,
|
|
3319
|
+
isBuffer: Ya,
|
|
3338
3320
|
isOverflow: ge,
|
|
3339
|
-
isRegExp:
|
|
3321
|
+
isRegExp: Qa,
|
|
3340
3322
|
markOverflow: me,
|
|
3341
|
-
maybeMap:
|
|
3342
|
-
merge:
|
|
3343
|
-
},
|
|
3323
|
+
maybeMap: Za,
|
|
3324
|
+
merge: Ga
|
|
3325
|
+
}, Tn = wn, Ze = On, Fe = rr, es = Object.prototype.hasOwnProperty, xn = {
|
|
3344
3326
|
brackets: function(e) {
|
|
3345
3327
|
return e + "[]";
|
|
3346
3328
|
},
|
|
@@ -3351,9 +3333,9 @@ function() {
|
|
|
3351
3333
|
repeat: function(e) {
|
|
3352
3334
|
return e;
|
|
3353
3335
|
}
|
|
3354
|
-
}, ne = Array.isArray,
|
|
3355
|
-
|
|
3356
|
-
},
|
|
3336
|
+
}, ne = Array.isArray, ts = Array.prototype.push, En = function(t, e) {
|
|
3337
|
+
ts.apply(t, ne(e) ? e : [e]);
|
|
3338
|
+
}, rs = Date.prototype.toISOString, Wr = Fe.default, L = {
|
|
3357
3339
|
addQueryPrefix: !1,
|
|
3358
3340
|
allowDots: !1,
|
|
3359
3341
|
allowEmptyArrays: !1,
|
|
@@ -3367,35 +3349,35 @@ function() {
|
|
|
3367
3349
|
encoder: Ze.encode,
|
|
3368
3350
|
encodeValuesOnly: !1,
|
|
3369
3351
|
filter: void 0,
|
|
3370
|
-
format:
|
|
3371
|
-
formatter: Fe.formatters[
|
|
3352
|
+
format: Wr,
|
|
3353
|
+
formatter: Fe.formatters[Wr],
|
|
3372
3354
|
// deprecated
|
|
3373
3355
|
indices: !1,
|
|
3374
3356
|
serializeDate: function(e) {
|
|
3375
|
-
return
|
|
3357
|
+
return rs.call(e);
|
|
3376
3358
|
},
|
|
3377
3359
|
skipNulls: !1,
|
|
3378
3360
|
strictNullHandling: !1
|
|
3379
|
-
},
|
|
3361
|
+
}, ns = function(e) {
|
|
3380
3362
|
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" || typeof e == "bigint";
|
|
3381
|
-
},
|
|
3382
|
-
for (var b = e, S = m, O = 0, v = !1; (S = S.get(
|
|
3363
|
+
}, _t = {}, os = function t(e, r, n, s, o, a, i, c, l, f, u, d, p, h, y, g, $, m) {
|
|
3364
|
+
for (var b = e, S = m, O = 0, v = !1; (S = S.get(_t)) !== void 0 && !v; ) {
|
|
3383
3365
|
var T = S.get(e);
|
|
3384
3366
|
if (O += 1, typeof T < "u") {
|
|
3385
3367
|
if (T === O)
|
|
3386
3368
|
throw new RangeError("Cyclic object value");
|
|
3387
3369
|
v = !0;
|
|
3388
3370
|
}
|
|
3389
|
-
typeof S.get(
|
|
3371
|
+
typeof S.get(_t) > "u" && (O = 0);
|
|
3390
3372
|
}
|
|
3391
|
-
if (typeof f == "function" ? b = f(r, b) : b instanceof Date ? b =
|
|
3392
|
-
return w instanceof Date ?
|
|
3373
|
+
if (typeof f == "function" ? b = f(r, b) : b instanceof Date ? b = p(b) : n === "comma" && ne(b) && (b = Ze.maybeMap(b, function(w) {
|
|
3374
|
+
return w instanceof Date ? p(w) : w;
|
|
3393
3375
|
})), b === null) {
|
|
3394
3376
|
if (a)
|
|
3395
3377
|
return y(l && !g ? l(r, L.encoder, $, "key", h) : r);
|
|
3396
3378
|
b = "";
|
|
3397
3379
|
}
|
|
3398
|
-
if (
|
|
3380
|
+
if (ns(b) || Ze.isBuffer(b)) {
|
|
3399
3381
|
if (l) {
|
|
3400
3382
|
var P = g ? r : l(r, L.encoder, $, "key", h);
|
|
3401
3383
|
return [y(P) + "=" + y(l(b, L.encoder, $, "value", h))];
|
|
@@ -3422,10 +3404,10 @@ function() {
|
|
|
3422
3404
|
for (var G = 0; G < U.length; ++G) {
|
|
3423
3405
|
var B = U[G], V = typeof B == "object" && B && typeof B.value < "u" ? B.value : b[B];
|
|
3424
3406
|
if (!(i && V === null)) {
|
|
3425
|
-
var fe =
|
|
3407
|
+
var fe = d && c ? String(B).replace(/\./g, "%2E") : String(B), yt = ne(b) ? typeof n == "function" ? n(_, fe) : _ : _ + (d ? "." + fe : "[" + fe + "]");
|
|
3426
3408
|
m.set(e, O);
|
|
3427
|
-
var Ge =
|
|
3428
|
-
Ge.set(
|
|
3409
|
+
var Ge = Tn();
|
|
3410
|
+
Ge.set(_t, m), En(A, t(
|
|
3429
3411
|
V,
|
|
3430
3412
|
yt,
|
|
3431
3413
|
n,
|
|
@@ -3437,8 +3419,8 @@ function() {
|
|
|
3437
3419
|
n === "comma" && g && ne(b) ? null : l,
|
|
3438
3420
|
f,
|
|
3439
3421
|
u,
|
|
3440
|
-
p,
|
|
3441
3422
|
d,
|
|
3423
|
+
p,
|
|
3442
3424
|
h,
|
|
3443
3425
|
y,
|
|
3444
3426
|
g,
|
|
@@ -3448,7 +3430,7 @@ function() {
|
|
|
3448
3430
|
}
|
|
3449
3431
|
}
|
|
3450
3432
|
return A;
|
|
3451
|
-
},
|
|
3433
|
+
}, is = function(e) {
|
|
3452
3434
|
if (!e)
|
|
3453
3435
|
return L;
|
|
3454
3436
|
if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean")
|
|
@@ -3462,14 +3444,14 @@ function() {
|
|
|
3462
3444
|
throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
|
|
3463
3445
|
var n = Fe.default;
|
|
3464
3446
|
if (typeof e.format < "u") {
|
|
3465
|
-
if (!
|
|
3447
|
+
if (!es.call(Fe.formatters, e.format))
|
|
3466
3448
|
throw new TypeError("Unknown format option provided.");
|
|
3467
3449
|
n = e.format;
|
|
3468
3450
|
}
|
|
3469
3451
|
var s = Fe.formatters[n], o = L.filter;
|
|
3470
3452
|
(typeof e.filter == "function" || ne(e.filter)) && (o = e.filter);
|
|
3471
3453
|
var a;
|
|
3472
|
-
if (e.arrayFormat in
|
|
3454
|
+
if (e.arrayFormat in xn ? a = e.arrayFormat : "indices" in e ? a = e.indices ? "indices" : "repeat" : a = L.arrayFormat, "commaRoundTrip" in e && typeof e.commaRoundTrip != "boolean")
|
|
3473
3455
|
throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
|
|
3474
3456
|
var i = typeof e.allowDots > "u" ? e.encodeDotInKeys === !0 ? !0 : L.allowDots : !!e.allowDots;
|
|
3475
3457
|
return {
|
|
@@ -3493,20 +3475,20 @@ function() {
|
|
|
3493
3475
|
sort: typeof e.sort == "function" ? e.sort : null,
|
|
3494
3476
|
strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : L.strictNullHandling
|
|
3495
3477
|
};
|
|
3496
|
-
},
|
|
3497
|
-
var r = t, n =
|
|
3478
|
+
}, as = function(t, e) {
|
|
3479
|
+
var r = t, n = is(e), s, o;
|
|
3498
3480
|
typeof n.filter == "function" ? (o = n.filter, r = o("", r)) : ne(n.filter) && (o = n.filter, s = o);
|
|
3499
3481
|
var a = [];
|
|
3500
3482
|
if (typeof r != "object" || r === null)
|
|
3501
3483
|
return "";
|
|
3502
|
-
var i =
|
|
3484
|
+
var i = xn[n.arrayFormat], c = i === "comma" && n.commaRoundTrip;
|
|
3503
3485
|
s || (s = Object.keys(r)), n.sort && s.sort(n.sort);
|
|
3504
|
-
for (var l =
|
|
3486
|
+
for (var l = Tn(), f = 0; f < s.length; ++f) {
|
|
3505
3487
|
var u = s[f];
|
|
3506
3488
|
if (!(typeof u > "u" || u === null)) {
|
|
3507
|
-
var
|
|
3508
|
-
n.skipNulls &&
|
|
3509
|
-
|
|
3489
|
+
var d = r[u];
|
|
3490
|
+
n.skipNulls && d === null || En(a, os(
|
|
3491
|
+
d,
|
|
3510
3492
|
u,
|
|
3511
3493
|
i,
|
|
3512
3494
|
c,
|
|
@@ -3527,9 +3509,9 @@ function() {
|
|
|
3527
3509
|
));
|
|
3528
3510
|
}
|
|
3529
3511
|
}
|
|
3530
|
-
var
|
|
3531
|
-
return n.charsetSentinel && (n.charset === "iso-8859-1" ? h += "utf8=%26%2310003%3B" + n.delimiter : h += "utf8=%E2%9C%93" + n.delimiter),
|
|
3532
|
-
}, ae =
|
|
3512
|
+
var p = a.join(n.delimiter), h = n.addQueryPrefix === !0 ? "?" : "";
|
|
3513
|
+
return n.charsetSentinel && (n.charset === "iso-8859-1" ? h += "utf8=%26%2310003%3B" + n.delimiter : h += "utf8=%E2%9C%93" + n.delimiter), p.length > 0 ? h + p : "";
|
|
3514
|
+
}, ae = On, et = Object.prototype.hasOwnProperty, Lt = Array.isArray, N = {
|
|
3533
3515
|
allowDots: !1,
|
|
3534
3516
|
allowEmptyArrays: !1,
|
|
3535
3517
|
allowPrototypes: !1,
|
|
@@ -3552,11 +3534,11 @@ function() {
|
|
|
3552
3534
|
strictMerge: !0,
|
|
3553
3535
|
strictNullHandling: !1,
|
|
3554
3536
|
throwOnLimitExceeded: !1
|
|
3555
|
-
},
|
|
3537
|
+
}, ss = function(t) {
|
|
3556
3538
|
return t.replace(/&#(\d+);/g, function(e, r) {
|
|
3557
3539
|
return String.fromCharCode(parseInt(r, 10));
|
|
3558
3540
|
});
|
|
3559
|
-
},
|
|
3541
|
+
}, jn = function(t, e, r, n) {
|
|
3560
3542
|
if (t && typeof t == "string" && e.comma && t.indexOf(",") > -1) {
|
|
3561
3543
|
if (n && e.throwOnLimitExceeded)
|
|
3562
3544
|
for (var s = 0, o = t.indexOf(","); o > -1; ) {
|
|
@@ -3569,7 +3551,7 @@ function() {
|
|
|
3569
3551
|
if (e.throwOnLimitExceeded && r >= e.arrayLimit)
|
|
3570
3552
|
throw new RangeError("Array limit exceeded. Only " + e.arrayLimit + " element" + (e.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
|
|
3571
3553
|
return t;
|
|
3572
|
-
},
|
|
3554
|
+
}, cs = "utf8=%26%2310003%3B", ls = "utf8=%E2%9C%93", fs = function(e, r) {
|
|
3573
3555
|
var n = { __proto__: null }, s = r.ignoreQueryPrefix ? e.replace(/^\?/, "") : e;
|
|
3574
3556
|
s = s.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
3575
3557
|
var o = r.parameterLimit === 1 / 0 ? void 0 : r.parameterLimit, a = s.split(
|
|
@@ -3581,39 +3563,39 @@ function() {
|
|
|
3581
3563
|
var i = -1, c, l = r.charset;
|
|
3582
3564
|
if (r.charsetSentinel)
|
|
3583
3565
|
for (c = 0; c < a.length; ++c)
|
|
3584
|
-
a[c].indexOf("utf8=") === 0 && (a[c] ===
|
|
3566
|
+
a[c].indexOf("utf8=") === 0 && (a[c] === ls ? l = "utf-8" : a[c] === cs && (l = "iso-8859-1"), i = c, c = a.length);
|
|
3585
3567
|
for (c = 0; c < a.length; ++c)
|
|
3586
3568
|
if (c !== i) {
|
|
3587
|
-
var f = a[c], u = f.indexOf("]="),
|
|
3588
|
-
if (
|
|
3589
|
-
|
|
3590
|
-
f.slice(
|
|
3569
|
+
var f = a[c], u = f.indexOf("]="), d = u === -1 ? f.indexOf("=") : u + 1, p, h;
|
|
3570
|
+
if (d === -1 ? (p = r.decoder(f, N.decoder, l, "key"), h = r.strictNullHandling ? null : "") : (p = r.decoder(f.slice(0, d), N.decoder, l, "key"), p !== null && (h = ae.maybeMap(
|
|
3571
|
+
jn(
|
|
3572
|
+
f.slice(d + 1),
|
|
3591
3573
|
r,
|
|
3592
|
-
|
|
3574
|
+
Lt(n[p]) ? n[p].length : 0,
|
|
3593
3575
|
f.indexOf("[]=") === -1
|
|
3594
3576
|
),
|
|
3595
3577
|
function(g) {
|
|
3596
|
-
return r.decoder(g,
|
|
3578
|
+
return r.decoder(g, N.decoder, l, "value");
|
|
3597
3579
|
}
|
|
3598
|
-
))), h && r.interpretNumericEntities && l === "iso-8859-1" && (h =
|
|
3599
|
-
var y = et.call(n,
|
|
3600
|
-
y && (r.duplicates === "combine" || f.indexOf("[]=") > -1) ? n[
|
|
3601
|
-
n[
|
|
3580
|
+
))), h && r.interpretNumericEntities && l === "iso-8859-1" && (h = ss(String(h))), f.indexOf("[]=") > -1 && (h = Lt(h) ? [h] : h), r.comma && Lt(h) && h.length > r.arrayLimit && (h = ae.combine([], h, r.arrayLimit, r.plainObjects, r.throwOnLimitExceeded)), p !== null) {
|
|
3581
|
+
var y = et.call(n, p);
|
|
3582
|
+
y && (r.duplicates === "combine" || f.indexOf("[]=") > -1) ? n[p] = ae.combine(
|
|
3583
|
+
n[p],
|
|
3602
3584
|
h,
|
|
3603
3585
|
r.arrayLimit,
|
|
3604
3586
|
r.plainObjects,
|
|
3605
3587
|
r.throwOnLimitExceeded
|
|
3606
|
-
) : (!y || r.duplicates === "last") && (n[
|
|
3588
|
+
) : (!y || r.duplicates === "last") && (n[p] = h);
|
|
3607
3589
|
}
|
|
3608
3590
|
}
|
|
3609
3591
|
return n;
|
|
3610
|
-
},
|
|
3592
|
+
}, us = function(t, e, r, n) {
|
|
3611
3593
|
var s = 0;
|
|
3612
3594
|
if (t.length > 0 && t[t.length - 1] === "[]") {
|
|
3613
3595
|
var o = t.slice(0, -1).join("");
|
|
3614
3596
|
s = Array.isArray(e) && e[o] ? e[o].length : 0;
|
|
3615
3597
|
}
|
|
3616
|
-
for (var a = n ? e :
|
|
3598
|
+
for (var a = n ? e : jn(e, r, s), i = t.length - 1; i >= 0; --i) {
|
|
3617
3599
|
var c, l = t[i];
|
|
3618
3600
|
if (l === "[]" && r.parseArrays)
|
|
3619
3601
|
ae.isOverflow(a) ? c = a : c = r.allowEmptyArrays && (a === "" || r.strictNullHandling && a === null) ? [] : ae.combine(
|
|
@@ -3625,21 +3607,21 @@ function() {
|
|
|
3625
3607
|
);
|
|
3626
3608
|
else {
|
|
3627
3609
|
c = r.plainObjects ? { __proto__: null } : {};
|
|
3628
|
-
var f = l.charAt(0) === "[" && l.charAt(l.length - 1) === "]" ? l.slice(1, -1) : l, u = r.decodeDotInKeys ? f.replace(/%2E/g, ".") : f,
|
|
3610
|
+
var f = l.charAt(0) === "[" && l.charAt(l.length - 1) === "]" ? l.slice(1, -1) : l, u = r.decodeDotInKeys ? f.replace(/%2E/g, ".") : f, d = parseInt(u, 10), p = !isNaN(d) && l !== u && String(d) === u && d >= 0 && r.parseArrays;
|
|
3629
3611
|
if (!r.parseArrays && u === "")
|
|
3630
3612
|
c = { 0: a };
|
|
3631
|
-
else if (
|
|
3632
|
-
c = [], c[
|
|
3613
|
+
else if (p && d < r.arrayLimit)
|
|
3614
|
+
c = [], c[d] = a;
|
|
3633
3615
|
else {
|
|
3634
|
-
if (
|
|
3616
|
+
if (p && r.throwOnLimitExceeded)
|
|
3635
3617
|
throw new RangeError("Array limit exceeded. Only " + r.arrayLimit + " element" + (r.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
|
|
3636
|
-
|
|
3618
|
+
p ? (c[d] = a, ae.markOverflow(c, d)) : u !== "__proto__" && (c[u] = a);
|
|
3637
3619
|
}
|
|
3638
3620
|
}
|
|
3639
3621
|
a = c;
|
|
3640
3622
|
}
|
|
3641
3623
|
return a;
|
|
3642
|
-
},
|
|
3624
|
+
}, ps = function(e, r) {
|
|
3643
3625
|
var n = r.allowDots ? e.replace(/\.([^.[]+)/g, "[$1]") : e;
|
|
3644
3626
|
if (r.depth <= 0)
|
|
3645
3627
|
return !r.plainObjects && et.call(Object.prototype, n) && !r.allowPrototypes ? void 0 : [n];
|
|
@@ -3650,16 +3632,16 @@ function() {
|
|
|
3650
3632
|
s[s.length] = a;
|
|
3651
3633
|
}
|
|
3652
3634
|
for (var i = n.length, c = o, l = 0; c >= 0 && l < r.depth; ) {
|
|
3653
|
-
for (var f = 1, u = c + 1,
|
|
3654
|
-
var
|
|
3655
|
-
|
|
3635
|
+
for (var f = 1, u = c + 1, d = -1; u < i && d < 0; ) {
|
|
3636
|
+
var p = n.charCodeAt(u);
|
|
3637
|
+
p === 91 ? f += 1 : p === 93 && (f -= 1, f === 0 && (d = u)), u += 1;
|
|
3656
3638
|
}
|
|
3657
|
-
if (
|
|
3639
|
+
if (d < 0)
|
|
3658
3640
|
return s[s.length] = "[" + n.slice(c) + "]", s;
|
|
3659
|
-
var h = n.slice(c,
|
|
3641
|
+
var h = n.slice(c, d + 1), y = h.slice(1, -1);
|
|
3660
3642
|
if (!r.plainObjects && et.call(Object.prototype, y) && !r.allowPrototypes)
|
|
3661
3643
|
return;
|
|
3662
|
-
s[s.length] = h, l += 1, c = n.indexOf("[",
|
|
3644
|
+
s[s.length] = h, l += 1, c = n.indexOf("[", d + 1);
|
|
3663
3645
|
}
|
|
3664
3646
|
if (c >= 0) {
|
|
3665
3647
|
if (r.strictDepth === !0)
|
|
@@ -3667,15 +3649,15 @@ function() {
|
|
|
3667
3649
|
s[s.length] = "[" + n.slice(c) + "]";
|
|
3668
3650
|
}
|
|
3669
3651
|
return s;
|
|
3670
|
-
},
|
|
3652
|
+
}, ds = function(e, r, n, s) {
|
|
3671
3653
|
if (e) {
|
|
3672
|
-
var o =
|
|
3654
|
+
var o = ps(e, n);
|
|
3673
3655
|
if (o)
|
|
3674
|
-
return
|
|
3656
|
+
return us(o, r, n, s);
|
|
3675
3657
|
}
|
|
3676
|
-
},
|
|
3658
|
+
}, hs = function(e) {
|
|
3677
3659
|
if (!e)
|
|
3678
|
-
return
|
|
3660
|
+
return N;
|
|
3679
3661
|
if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean")
|
|
3680
3662
|
throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
|
|
3681
3663
|
if (typeof e.decodeDotInKeys < "u" && typeof e.decodeDotInKeys != "boolean")
|
|
@@ -3686,53 +3668,53 @@ function() {
|
|
|
3686
3668
|
throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
|
|
3687
3669
|
if (typeof e.throwOnLimitExceeded < "u" && typeof e.throwOnLimitExceeded != "boolean")
|
|
3688
3670
|
throw new TypeError("`throwOnLimitExceeded` option must be a boolean");
|
|
3689
|
-
var r = typeof e.charset > "u" ?
|
|
3671
|
+
var r = typeof e.charset > "u" ? N.charset : e.charset, n = typeof e.duplicates > "u" ? N.duplicates : e.duplicates;
|
|
3690
3672
|
if (n !== "combine" && n !== "first" && n !== "last")
|
|
3691
3673
|
throw new TypeError("The duplicates option must be either combine, first, or last");
|
|
3692
|
-
var s = typeof e.allowDots > "u" ? e.decodeDotInKeys === !0 ? !0 :
|
|
3674
|
+
var s = typeof e.allowDots > "u" ? e.decodeDotInKeys === !0 ? !0 : N.allowDots : !!e.allowDots;
|
|
3693
3675
|
return {
|
|
3694
3676
|
allowDots: s,
|
|
3695
|
-
allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays :
|
|
3696
|
-
allowPrototypes: typeof e.allowPrototypes == "boolean" ? e.allowPrototypes :
|
|
3697
|
-
allowSparse: typeof e.allowSparse == "boolean" ? e.allowSparse :
|
|
3698
|
-
arrayLimit: typeof e.arrayLimit == "number" ? e.arrayLimit :
|
|
3677
|
+
allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : N.allowEmptyArrays,
|
|
3678
|
+
allowPrototypes: typeof e.allowPrototypes == "boolean" ? e.allowPrototypes : N.allowPrototypes,
|
|
3679
|
+
allowSparse: typeof e.allowSparse == "boolean" ? e.allowSparse : N.allowSparse,
|
|
3680
|
+
arrayLimit: typeof e.arrayLimit == "number" ? e.arrayLimit : N.arrayLimit,
|
|
3699
3681
|
charset: r,
|
|
3700
|
-
charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel :
|
|
3701
|
-
comma: typeof e.comma == "boolean" ? e.comma :
|
|
3702
|
-
decodeDotInKeys: typeof e.decodeDotInKeys == "boolean" ? e.decodeDotInKeys :
|
|
3703
|
-
decoder: typeof e.decoder == "function" ? e.decoder :
|
|
3704
|
-
delimiter: typeof e.delimiter == "string" || ae.isRegExp(e.delimiter) ? e.delimiter :
|
|
3682
|
+
charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : N.charsetSentinel,
|
|
3683
|
+
comma: typeof e.comma == "boolean" ? e.comma : N.comma,
|
|
3684
|
+
decodeDotInKeys: typeof e.decodeDotInKeys == "boolean" ? e.decodeDotInKeys : N.decodeDotInKeys,
|
|
3685
|
+
decoder: typeof e.decoder == "function" ? e.decoder : N.decoder,
|
|
3686
|
+
delimiter: typeof e.delimiter == "string" || ae.isRegExp(e.delimiter) ? e.delimiter : N.delimiter,
|
|
3705
3687
|
// eslint-disable-next-line no-implicit-coercion, no-extra-parens
|
|
3706
|
-
depth: typeof e.depth == "number" || e.depth === !1 ? +e.depth :
|
|
3688
|
+
depth: typeof e.depth == "number" || e.depth === !1 ? +e.depth : N.depth,
|
|
3707
3689
|
duplicates: n,
|
|
3708
3690
|
ignoreQueryPrefix: e.ignoreQueryPrefix === !0,
|
|
3709
|
-
interpretNumericEntities: typeof e.interpretNumericEntities == "boolean" ? e.interpretNumericEntities :
|
|
3710
|
-
parameterLimit: typeof e.parameterLimit == "number" ? e.parameterLimit :
|
|
3691
|
+
interpretNumericEntities: typeof e.interpretNumericEntities == "boolean" ? e.interpretNumericEntities : N.interpretNumericEntities,
|
|
3692
|
+
parameterLimit: typeof e.parameterLimit == "number" ? e.parameterLimit : N.parameterLimit,
|
|
3711
3693
|
parseArrays: e.parseArrays !== !1,
|
|
3712
|
-
plainObjects: typeof e.plainObjects == "boolean" ? e.plainObjects :
|
|
3713
|
-
strictDepth: typeof e.strictDepth == "boolean" ? !!e.strictDepth :
|
|
3714
|
-
strictMerge: typeof e.strictMerge == "boolean" ? !!e.strictMerge :
|
|
3715
|
-
strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling :
|
|
3694
|
+
plainObjects: typeof e.plainObjects == "boolean" ? e.plainObjects : N.plainObjects,
|
|
3695
|
+
strictDepth: typeof e.strictDepth == "boolean" ? !!e.strictDepth : N.strictDepth,
|
|
3696
|
+
strictMerge: typeof e.strictMerge == "boolean" ? !!e.strictMerge : N.strictMerge,
|
|
3697
|
+
strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : N.strictNullHandling,
|
|
3716
3698
|
throwOnLimitExceeded: typeof e.throwOnLimitExceeded == "boolean" ? e.throwOnLimitExceeded : !1
|
|
3717
3699
|
};
|
|
3718
|
-
},
|
|
3719
|
-
var r =
|
|
3700
|
+
}, ys = function(t, e) {
|
|
3701
|
+
var r = hs(e);
|
|
3720
3702
|
if (t === "" || t === null || typeof t > "u")
|
|
3721
3703
|
return r.plainObjects ? { __proto__: null } : {};
|
|
3722
|
-
for (var n = typeof t == "string" ?
|
|
3723
|
-
var i = o[a], c =
|
|
3704
|
+
for (var n = typeof t == "string" ? fs(t, r) : t, s = r.plainObjects ? { __proto__: null } : {}, o = Object.keys(n), a = 0; a < o.length; ++a) {
|
|
3705
|
+
var i = o[a], c = ds(i, n[i], r, typeof t == "string");
|
|
3724
3706
|
s = ae.merge(s, c, r);
|
|
3725
3707
|
}
|
|
3726
3708
|
return r.allowSparse === !0 ? s : ae.compact(s);
|
|
3727
|
-
},
|
|
3728
|
-
formats:
|
|
3729
|
-
parse:
|
|
3730
|
-
stringify:
|
|
3731
|
-
},
|
|
3709
|
+
}, ms = as, gs = ys, bs = rr, tt = {
|
|
3710
|
+
formats: bs,
|
|
3711
|
+
parse: gs,
|
|
3712
|
+
stringify: ms
|
|
3713
|
+
}, $s = So;
|
|
3732
3714
|
function ee() {
|
|
3733
3715
|
this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null;
|
|
3734
3716
|
}
|
|
3735
|
-
var
|
|
3717
|
+
var vs = /^([a-z0-9.+-]+:)/i, ws = /:[0-9]*$/, Ss = /^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/, Os = [
|
|
3736
3718
|
"<",
|
|
3737
3719
|
">",
|
|
3738
3720
|
'"',
|
|
@@ -3742,27 +3724,27 @@ var bs = /^([a-z0-9.+-]+:)/i, $s = /:[0-9]*$/, vs = /^(\/\/?(?!\/)[^?\s]*)(\?[^\
|
|
|
3742
3724
|
`
|
|
3743
3725
|
`,
|
|
3744
3726
|
" "
|
|
3745
|
-
],
|
|
3727
|
+
], Ts = [
|
|
3746
3728
|
"{",
|
|
3747
3729
|
"}",
|
|
3748
3730
|
"|",
|
|
3749
3731
|
"\\",
|
|
3750
3732
|
"^",
|
|
3751
3733
|
"`"
|
|
3752
|
-
].concat(
|
|
3734
|
+
].concat(Os), zt = ["'"].concat(Ts), Jr = [
|
|
3753
3735
|
"%",
|
|
3754
3736
|
"/",
|
|
3755
3737
|
"?",
|
|
3756
3738
|
";",
|
|
3757
3739
|
"#"
|
|
3758
|
-
].concat(
|
|
3740
|
+
].concat(zt), Gr = [
|
|
3759
3741
|
"/",
|
|
3760
3742
|
"?",
|
|
3761
3743
|
"#"
|
|
3762
|
-
],
|
|
3744
|
+
], xs = 255, zr = /^[+a-z0-9A-Z_-]{0,63}$/, Es = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, js = {
|
|
3763
3745
|
javascript: !0,
|
|
3764
3746
|
"javascript:": !0
|
|
3765
|
-
},
|
|
3747
|
+
}, Vt = {
|
|
3766
3748
|
javascript: !0,
|
|
3767
3749
|
"javascript:": !0
|
|
3768
3750
|
}, Pe = {
|
|
@@ -3776,8 +3758,8 @@ var bs = /^([a-z0-9.+-]+:)/i, $s = /:[0-9]*$/, vs = /^(\/\/?(?!\/)[^?\s]*)(\?[^\
|
|
|
3776
3758
|
"ftp:": !0,
|
|
3777
3759
|
"gopher:": !0,
|
|
3778
3760
|
"file:": !0
|
|
3779
|
-
},
|
|
3780
|
-
function
|
|
3761
|
+
}, Kt = tt;
|
|
3762
|
+
function nr(t, e, r) {
|
|
3781
3763
|
if (t && typeof t == "object" && t instanceof ee)
|
|
3782
3764
|
return t;
|
|
3783
3765
|
var n = new ee();
|
|
@@ -3790,11 +3772,11 @@ ee.prototype.parse = function(t, e, r) {
|
|
|
3790
3772
|
o[0] = o[0].replace(a, "/"), t = o.join(s);
|
|
3791
3773
|
var i = t;
|
|
3792
3774
|
if (i = i.trim(), !r && t.split("#").length === 1) {
|
|
3793
|
-
var c =
|
|
3775
|
+
var c = Ss.exec(i);
|
|
3794
3776
|
if (c)
|
|
3795
|
-
return this.path = i, this.href = i, this.pathname = c[1], c[2] ? (this.search = c[2], e ? this.query =
|
|
3777
|
+
return this.path = i, this.href = i, this.pathname = c[1], c[2] ? (this.search = c[2], e ? this.query = Kt.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : e && (this.search = "", this.query = {}), this;
|
|
3796
3778
|
}
|
|
3797
|
-
var l =
|
|
3779
|
+
var l = vs.exec(i);
|
|
3798
3780
|
if (l) {
|
|
3799
3781
|
l = l[0];
|
|
3800
3782
|
var f = l.toLowerCase();
|
|
@@ -3802,41 +3784,41 @@ ee.prototype.parse = function(t, e, r) {
|
|
|
3802
3784
|
}
|
|
3803
3785
|
if (r || l || i.match(/^\/\/[^@/]+@[^@/]+/)) {
|
|
3804
3786
|
var u = i.substr(0, 2) === "//";
|
|
3805
|
-
u && !(l &&
|
|
3787
|
+
u && !(l && Vt[l]) && (i = i.substr(2), this.slashes = !0);
|
|
3806
3788
|
}
|
|
3807
|
-
if (!
|
|
3808
|
-
for (var
|
|
3809
|
-
var h = i.indexOf(
|
|
3810
|
-
h !== -1 && (
|
|
3789
|
+
if (!Vt[l] && (u || l && !Pe[l])) {
|
|
3790
|
+
for (var d = -1, p = 0; p < Gr.length; p++) {
|
|
3791
|
+
var h = i.indexOf(Gr[p]);
|
|
3792
|
+
h !== -1 && (d === -1 || h < d) && (d = h);
|
|
3811
3793
|
}
|
|
3812
3794
|
var y, g;
|
|
3813
|
-
|
|
3814
|
-
for (var
|
|
3815
|
-
var h = i.indexOf(
|
|
3816
|
-
h !== -1 && (
|
|
3795
|
+
d === -1 ? g = i.lastIndexOf("@") : g = i.lastIndexOf("@", d), g !== -1 && (y = i.slice(0, g), i = i.slice(g + 1), this.auth = decodeURIComponent(y)), d = -1;
|
|
3796
|
+
for (var p = 0; p < Jr.length; p++) {
|
|
3797
|
+
var h = i.indexOf(Jr[p]);
|
|
3798
|
+
h !== -1 && (d === -1 || h < d) && (d = h);
|
|
3817
3799
|
}
|
|
3818
|
-
|
|
3800
|
+
d === -1 && (d = i.length), this.host = i.slice(0, d), i = i.slice(d), this.parseHost(), this.hostname = this.hostname || "";
|
|
3819
3801
|
var $ = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]";
|
|
3820
3802
|
if (!$)
|
|
3821
|
-
for (var m = this.hostname.split(/\./),
|
|
3822
|
-
var S = m[
|
|
3823
|
-
if (S && !S.match(
|
|
3803
|
+
for (var m = this.hostname.split(/\./), p = 0, b = m.length; p < b; p++) {
|
|
3804
|
+
var S = m[p];
|
|
3805
|
+
if (S && !S.match(zr)) {
|
|
3824
3806
|
for (var O = "", v = 0, T = S.length; v < T; v++)
|
|
3825
3807
|
S.charCodeAt(v) > 127 ? O += "x" : O += S[v];
|
|
3826
|
-
if (!O.match(
|
|
3827
|
-
var P = m.slice(0,
|
|
3808
|
+
if (!O.match(zr)) {
|
|
3809
|
+
var P = m.slice(0, p), A = m.slice(p + 1), U = S.match(Es);
|
|
3828
3810
|
U && (P.push(U[1]), A.unshift(U[2])), A.length && (i = "/" + A.join(".") + i), this.hostname = P.join(".");
|
|
3829
3811
|
break;
|
|
3830
3812
|
}
|
|
3831
3813
|
}
|
|
3832
3814
|
}
|
|
3833
|
-
this.hostname.length >
|
|
3815
|
+
this.hostname.length > xs ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(), $ || (this.hostname = $s.toASCII(this.hostname));
|
|
3834
3816
|
var Q = this.port ? ":" + this.port : "", Y = this.hostname || "";
|
|
3835
3817
|
this.host = Y + Q, this.href += this.host, $ && (this.hostname = this.hostname.substr(1, this.hostname.length - 2), i[0] !== "/" && (i = "/" + i));
|
|
3836
3818
|
}
|
|
3837
|
-
if (!
|
|
3838
|
-
for (var
|
|
3839
|
-
var _ =
|
|
3819
|
+
if (!js[f])
|
|
3820
|
+
for (var p = 0, b = zt.length; p < b; p++) {
|
|
3821
|
+
var _ = zt[p];
|
|
3840
3822
|
if (i.indexOf(_) !== -1) {
|
|
3841
3823
|
var G = encodeURIComponent(_);
|
|
3842
3824
|
G === _ && (G = escape(_)), i = i.split(_).join(G);
|
|
@@ -3845,20 +3827,20 @@ ee.prototype.parse = function(t, e, r) {
|
|
|
3845
3827
|
var B = i.indexOf("#");
|
|
3846
3828
|
B !== -1 && (this.hash = i.substr(B), i = i.slice(0, B));
|
|
3847
3829
|
var V = i.indexOf("?");
|
|
3848
|
-
if (V !== -1 ? (this.search = i.substr(V), this.query = i.substr(V + 1), e && (this.query =
|
|
3830
|
+
if (V !== -1 ? (this.search = i.substr(V), this.query = i.substr(V + 1), e && (this.query = Kt.parse(this.query)), i = i.slice(0, V)) : e && (this.search = "", this.query = {}), i && (this.pathname = i), Pe[f] && this.hostname && !this.pathname && (this.pathname = "/"), this.pathname || this.search) {
|
|
3849
3831
|
var Q = this.pathname || "", fe = this.search || "";
|
|
3850
3832
|
this.path = Q + fe;
|
|
3851
3833
|
}
|
|
3852
3834
|
return this.href = this.format(), this;
|
|
3853
3835
|
};
|
|
3854
|
-
function
|
|
3855
|
-
return typeof t == "string" && (t =
|
|
3836
|
+
function Ps(t) {
|
|
3837
|
+
return typeof t == "string" && (t = nr(t)), t instanceof ee ? t.format() : ee.prototype.format.call(t);
|
|
3856
3838
|
}
|
|
3857
3839
|
ee.prototype.format = function() {
|
|
3858
3840
|
var t = this.auth || "";
|
|
3859
3841
|
t && (t = encodeURIComponent(t), t = t.replace(/%3A/i, ":"), t += "@");
|
|
3860
3842
|
var e = this.protocol || "", r = this.pathname || "", n = this.hash || "", s = !1, o = "";
|
|
3861
|
-
this.host ? s = t + this.host : this.hostname && (s = t + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"), this.port && (s += ":" + this.port)), this.query && typeof this.query == "object" && Object.keys(this.query).length && (o =
|
|
3843
|
+
this.host ? s = t + this.host : this.hostname && (s = t + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"), this.port && (s += ":" + this.port)), this.query && typeof this.query == "object" && Object.keys(this.query).length && (o = Kt.stringify(this.query, {
|
|
3862
3844
|
arrayFormat: "repeat",
|
|
3863
3845
|
addQueryPrefix: !1
|
|
3864
3846
|
}));
|
|
@@ -3868,7 +3850,7 @@ ee.prototype.format = function() {
|
|
|
3868
3850
|
}), a = a.replace("#", "%23"), e + s + r + a + n;
|
|
3869
3851
|
};
|
|
3870
3852
|
ee.prototype.resolve = function(t) {
|
|
3871
|
-
return this.resolveObject(
|
|
3853
|
+
return this.resolveObject(nr(t, !1, !0)).format();
|
|
3872
3854
|
};
|
|
3873
3855
|
ee.prototype.resolveObject = function(t) {
|
|
3874
3856
|
if (typeof t == "string") {
|
|
@@ -3896,15 +3878,15 @@ ee.prototype.resolveObject = function(t) {
|
|
|
3896
3878
|
}
|
|
3897
3879
|
return r.href = r.format(), r;
|
|
3898
3880
|
}
|
|
3899
|
-
if (r.protocol = t.protocol, !t.host && !
|
|
3881
|
+
if (r.protocol = t.protocol, !t.host && !Vt[t.protocol]) {
|
|
3900
3882
|
for (var b = (t.pathname || "").split("/"); b.length && !(t.host = b.shift()); )
|
|
3901
3883
|
;
|
|
3902
3884
|
t.host || (t.host = ""), t.hostname || (t.hostname = ""), b[0] !== "" && b.unshift(""), b.length < 2 && b.unshift(""), r.pathname = b.join("/");
|
|
3903
3885
|
} else
|
|
3904
3886
|
r.pathname = t.pathname;
|
|
3905
3887
|
if (r.search = t.search, r.query = t.query, r.host = t.host || "", r.auth = t.auth, r.hostname = t.hostname || t.host, r.port = t.port, r.pathname || r.search) {
|
|
3906
|
-
var
|
|
3907
|
-
r.path =
|
|
3888
|
+
var d = r.pathname || "", p = r.search || "";
|
|
3889
|
+
r.path = d + p;
|
|
3908
3890
|
}
|
|
3909
3891
|
return r.slashes = r.slashes || t.slashes, r.href = r.format(), r;
|
|
3910
3892
|
}
|
|
@@ -3938,20 +3920,20 @@ ee.prototype.resolveObject = function(t) {
|
|
|
3938
3920
|
return g = g || r.host && m.length, g && !U && m.unshift(""), m.length > 0 ? r.pathname = m.join("/") : (r.pathname = null, r.path = null), (r.pathname !== null || r.search !== null) && (r.path = (r.pathname ? r.pathname : "") + (r.search ? r.search : "")), r.auth = t.auth || r.auth, r.slashes = r.slashes || t.slashes, r.href = r.format(), r;
|
|
3939
3921
|
};
|
|
3940
3922
|
ee.prototype.parseHost = function() {
|
|
3941
|
-
var t = this.host, e =
|
|
3923
|
+
var t = this.host, e = ws.exec(t);
|
|
3942
3924
|
e && (e = e[0], e !== ":" && (this.port = e.substr(1)), t = t.substr(0, t.length - e.length)), t && (this.hostname = t);
|
|
3943
3925
|
};
|
|
3944
|
-
var
|
|
3945
|
-
const
|
|
3926
|
+
var Cs = nr, Vr = Ps;
|
|
3927
|
+
const ks = () => Object.keys(xe).map((t) => ({
|
|
3946
3928
|
...xe[t].info,
|
|
3947
3929
|
clients: Object.keys(xe[t].clientsById).map((e) => xe[t].clientsById[e].info)
|
|
3948
|
-
})),
|
|
3949
|
-
var
|
|
3930
|
+
})), As = (t) => typeof t == "object" && "log" in t && typeof t.log == "object" && "entries" in t.log && Array.isArray(t.log.entries);
|
|
3931
|
+
var Rs = class {
|
|
3950
3932
|
constructor(t, e = {}) {
|
|
3951
3933
|
this.initCalled = !1, this.entries = [], this.requests = [], this.options = {}, this.options = {
|
|
3952
3934
|
harIsAlreadyEncoded: !1,
|
|
3953
3935
|
...e
|
|
3954
|
-
}, this.requests = [],
|
|
3936
|
+
}, this.requests = [], As(t) ? this.entries = t.log.entries : this.entries = [{ request: t }];
|
|
3955
3937
|
}
|
|
3956
3938
|
init() {
|
|
3957
3939
|
return this.initCalled = !0, this.requests = this.entries.map(({ request: t }) => {
|
|
@@ -3970,7 +3952,7 @@ var ks = class {
|
|
|
3970
3952
|
}), this;
|
|
3971
3953
|
}
|
|
3972
3954
|
prepare(t, e) {
|
|
3973
|
-
var f, u,
|
|
3955
|
+
var f, u, d;
|
|
3974
3956
|
const r = {
|
|
3975
3957
|
...t,
|
|
3976
3958
|
fullUrl: "",
|
|
@@ -3980,42 +3962,42 @@ var ks = class {
|
|
|
3980
3962
|
cookiesObj: {},
|
|
3981
3963
|
allHeaders: {}
|
|
3982
3964
|
};
|
|
3983
|
-
if (r != null && r.queryString.length && (r.queryObj = r.queryString.reduce(
|
|
3984
|
-
const
|
|
3965
|
+
if (r != null && r.queryString.length && (r.queryObj = r.queryString.reduce(gr, {})), r != null && r.headers.length) {
|
|
3966
|
+
const p = /^HTTP\/2/;
|
|
3985
3967
|
r.headersObj = r.headers.reduce((h, { name: y, value: g }) => {
|
|
3986
|
-
const $ =
|
|
3968
|
+
const $ = p.exec(r.httpVersion) ? y.toLocaleLowerCase() : y;
|
|
3987
3969
|
return {
|
|
3988
3970
|
...h,
|
|
3989
3971
|
[$]: g
|
|
3990
3972
|
};
|
|
3991
3973
|
}, {});
|
|
3992
3974
|
}
|
|
3993
|
-
r != null && r.cookies.length && (r.cookiesObj = r.cookies.reduceRight((
|
|
3994
|
-
...
|
|
3975
|
+
r != null && r.cookies.length && (r.cookiesObj = r.cookies.reduceRight((p, { name: h, value: y }) => ({
|
|
3976
|
+
...p,
|
|
3995
3977
|
[h]: y
|
|
3996
3978
|
}), {}));
|
|
3997
|
-
const n = (f = r.cookies) == null ? void 0 : f.map(({ name:
|
|
3979
|
+
const n = (f = r.cookies) == null ? void 0 : f.map(({ name: p, value: h }) => e.harIsAlreadyEncoded ? `${p}=${h}` : `${encodeURIComponent(p)}=${encodeURIComponent(h)}`);
|
|
3998
3980
|
switch (n != null && n.length && (r.allHeaders.cookie = n.join("; ")), r.postData.mimeType) {
|
|
3999
3981
|
case "multipart/mixed":
|
|
4000
3982
|
case "multipart/related":
|
|
4001
3983
|
case "multipart/form-data":
|
|
4002
3984
|
case "multipart/alternative":
|
|
4003
3985
|
if (r.postData.text = "", r.postData.mimeType = "multipart/form-data", (u = r.postData) != null && u.params) {
|
|
4004
|
-
const
|
|
3986
|
+
const p = "---011000010111000001101001", h = `${p}--`, y = `\r
|
|
4005
3987
|
`;
|
|
4006
3988
|
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
|
|
4007
3989
|
const g = (S) => S.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"), $ = (S) => S.replace(/\r?\n|\r/g, `\r
|
|
4008
|
-
`), m = [`--${
|
|
4009
|
-
(
|
|
3990
|
+
`), m = [`--${p}`];
|
|
3991
|
+
(d = r.postData) == null || d.params.forEach((S, O) => {
|
|
4010
3992
|
const v = S.name, T = S.value || "", P = S.fileName || null, A = S.contentType || "application/octet-stream";
|
|
4011
|
-
P ? (m.push(`Content-Disposition: form-data; name="${g($(v))}"; filename="${P}"`), m.push(`Content-Type: ${A}`)) : m.push(`Content-Disposition: form-data; name="${escape($(v))}"`), m.push(""), m.push($(T)), O !== r.postData.params.length - 1 && m.push(`--${
|
|
4012
|
-
}), m.push(`--${h}`), r.postData.boundary =
|
|
3993
|
+
P ? (m.push(`Content-Disposition: form-data; name="${g($(v))}"; filename="${P}"`), m.push(`Content-Type: ${A}`)) : m.push(`Content-Disposition: form-data; name="${escape($(v))}"`), m.push(""), m.push($(T)), O !== r.postData.params.length - 1 && m.push(`--${p}`);
|
|
3994
|
+
}), m.push(`--${h}`), r.postData.boundary = p, r.postData.text = m.join(y);
|
|
4013
3995
|
const b = J(r.headersObj, "content-type") || "content-type";
|
|
4014
|
-
r.headersObj[b] = `multipart/form-data; boundary=${
|
|
3996
|
+
r.headersObj[b] = `multipart/form-data; boundary=${p}`;
|
|
4015
3997
|
}
|
|
4016
3998
|
break;
|
|
4017
3999
|
case "application/x-www-form-urlencoded":
|
|
4018
|
-
r.postData.params ? (r.postData.paramsObj = r.postData.params.reduce(
|
|
4000
|
+
r.postData.params ? (r.postData.paramsObj = r.postData.params.reduce(gr, {}), r.postData.text = tt.stringify(r.postData.paramsObj)) : r.postData.text = "";
|
|
4019
4001
|
break;
|
|
4020
4002
|
case "text/json":
|
|
4021
4003
|
case "text/x-json":
|
|
@@ -4031,7 +4013,7 @@ var ks = class {
|
|
|
4031
4013
|
const s = {
|
|
4032
4014
|
...r.allHeaders,
|
|
4033
4015
|
...r.headersObj
|
|
4034
|
-
}, o =
|
|
4016
|
+
}, o = Cs(r.url, !0, !0);
|
|
4035
4017
|
r.queryObj = {
|
|
4036
4018
|
...r.queryObj,
|
|
4037
4019
|
...o.query
|
|
@@ -4046,11 +4028,11 @@ var ks = class {
|
|
|
4046
4028
|
query: r.queryObj,
|
|
4047
4029
|
search: a,
|
|
4048
4030
|
path: a ? `${o.pathname}?${a}` : o.pathname
|
|
4049
|
-
}, c =
|
|
4031
|
+
}, c = Vr({
|
|
4050
4032
|
...o,
|
|
4051
4033
|
query: null,
|
|
4052
4034
|
search: null
|
|
4053
|
-
}), l =
|
|
4035
|
+
}), l = Vr({
|
|
4054
4036
|
...o,
|
|
4055
4037
|
...i
|
|
4056
4038
|
});
|
|
@@ -4077,11 +4059,11 @@ var ks = class {
|
|
|
4077
4059
|
return this.requests.map((o) => s != null && s.installation ? s.installation(o, r) : !1);
|
|
4078
4060
|
}
|
|
4079
4061
|
};
|
|
4080
|
-
const
|
|
4081
|
-
function
|
|
4082
|
-
return
|
|
4062
|
+
const Ns = "agent", qs = "prompt";
|
|
4063
|
+
function _s() {
|
|
4064
|
+
return ks();
|
|
4083
4065
|
}
|
|
4084
|
-
function
|
|
4066
|
+
function Ls(t) {
|
|
4085
4067
|
var n;
|
|
4086
4068
|
const e = t == null ? void 0 : t[0];
|
|
4087
4069
|
if (!e) return "http://localhost";
|
|
@@ -4092,12 +4074,12 @@ function Ns(t) {
|
|
|
4092
4074
|
}
|
|
4093
4075
|
return r;
|
|
4094
4076
|
}
|
|
4095
|
-
function
|
|
4077
|
+
function Is(t) {
|
|
4096
4078
|
if (t.example !== void 0 || t.examples && Object.keys(t.examples).length > 0) return !0;
|
|
4097
4079
|
const e = t.schema;
|
|
4098
4080
|
return !!((e == null ? void 0 : e.example) !== void 0 || e != null && e.enum && e.enum.length > 0);
|
|
4099
4081
|
}
|
|
4100
|
-
function
|
|
4082
|
+
function Pn(t) {
|
|
4101
4083
|
if (t.example !== void 0) return String(t.example);
|
|
4102
4084
|
if (t.examples) {
|
|
4103
4085
|
for (const r of Object.values(t.examples))
|
|
@@ -4107,16 +4089,16 @@ function qn(t) {
|
|
|
4107
4089
|
const e = t.schema;
|
|
4108
4090
|
return (e == null ? void 0 : e.example) !== void 0 ? String(e.example) : e != null && e.enum && e.enum.length > 0 ? String(e.enum[0]) : `{${t.name}}`;
|
|
4109
4091
|
}
|
|
4110
|
-
function
|
|
4092
|
+
function Us(t, e, r) {
|
|
4111
4093
|
const n = e.replace(/\{([^}]+)\}/g, (s, o) => {
|
|
4112
4094
|
const a = r.find((c) => c.in === "path" && c.name === o);
|
|
4113
4095
|
if (!a) return s;
|
|
4114
|
-
const i =
|
|
4096
|
+
const i = Pn(a);
|
|
4115
4097
|
return i === `{${o}}` ? i : encodeURIComponent(i);
|
|
4116
4098
|
});
|
|
4117
4099
|
return `${t.replace(/\/$/, "")}${n}`;
|
|
4118
4100
|
}
|
|
4119
|
-
function
|
|
4101
|
+
function Fs(t, e) {
|
|
4120
4102
|
var s;
|
|
4121
4103
|
const r = t[0];
|
|
4122
4104
|
if (!r || !e) return [];
|
|
@@ -4138,7 +4120,7 @@ function Is(t, e) {
|
|
|
4138
4120
|
}
|
|
4139
4121
|
return n;
|
|
4140
4122
|
}
|
|
4141
|
-
function
|
|
4123
|
+
function Hs(t) {
|
|
4142
4124
|
const e = t == null ? void 0 : t.content;
|
|
4143
4125
|
if (!e) return null;
|
|
4144
4126
|
const r = "application/json" in e ? "application/json" : Object.keys(e)[0];
|
|
@@ -4154,12 +4136,12 @@ function Us(t) {
|
|
|
4154
4136
|
}
|
|
4155
4137
|
return { contentType: r, schema: n.schema, authorExample: s };
|
|
4156
4138
|
}
|
|
4157
|
-
function
|
|
4158
|
-
const e =
|
|
4139
|
+
function Ms(t) {
|
|
4140
|
+
const e = Ls(t.servers), r = Us(e, t.path, t.parameters), n = Fs(t.security, t.securitySchemes), s = [], o = [], a = [];
|
|
4159
4141
|
for (const c of n)
|
|
4160
4142
|
(c.location === "header" ? s : c.location === "query" ? o : a).push({ name: c.name, value: c.value });
|
|
4161
4143
|
for (const c of t.parameters)
|
|
4162
|
-
c.in === "query" && (c.required ||
|
|
4144
|
+
c.in === "query" && (c.required || Is(c)) && o.push({ name: c.name, value: Pn(c) });
|
|
4163
4145
|
const i = {
|
|
4164
4146
|
method: t.method.toUpperCase(),
|
|
4165
4147
|
url: r,
|
|
@@ -4170,15 +4152,15 @@ function Fs(t) {
|
|
|
4170
4152
|
};
|
|
4171
4153
|
return t.media && t.resolvedBodyValue !== void 0 && (s.push({ name: "Content-Type", value: t.media.contentType }), i.postData = { mimeType: t.media.contentType, text: JSON.stringify(t.resolvedBodyValue, null, 2) }), i;
|
|
4172
4154
|
}
|
|
4173
|
-
function
|
|
4155
|
+
function Bs(t, e, r) {
|
|
4174
4156
|
try {
|
|
4175
|
-
const n = new
|
|
4157
|
+
const n = new Rs(t), [s] = n.convert(e, r);
|
|
4176
4158
|
return typeof s == "string" ? s : "";
|
|
4177
4159
|
} catch {
|
|
4178
4160
|
return "";
|
|
4179
4161
|
}
|
|
4180
4162
|
}
|
|
4181
|
-
const
|
|
4163
|
+
const Ws = {
|
|
4182
4164
|
agent: "plaintext",
|
|
4183
4165
|
c: "c",
|
|
4184
4166
|
clojure: "clojure",
|
|
@@ -4202,10 +4184,10 @@ const Ms = {
|
|
|
4202
4184
|
shell: "bash",
|
|
4203
4185
|
swift: "swift"
|
|
4204
4186
|
};
|
|
4205
|
-
function
|
|
4206
|
-
return
|
|
4187
|
+
function Js(t) {
|
|
4188
|
+
return Ws[t] ?? "plaintext";
|
|
4207
4189
|
}
|
|
4208
|
-
const
|
|
4190
|
+
const Gs = {
|
|
4209
4191
|
c: () => import("./c-Bz1-FJiA.js"),
|
|
4210
4192
|
clojure: () => import("./clojure-aY2138WD.js"),
|
|
4211
4193
|
crystal: () => import("./crystal-BtD5fR4q.js"),
|
|
@@ -4223,34 +4205,34 @@ const Ws = {
|
|
|
4223
4205
|
rust: () => import("./rust-BocnJ3Ns.js"),
|
|
4224
4206
|
swift: () => import("./swift-C35Eof-I.js")
|
|
4225
4207
|
};
|
|
4226
|
-
function
|
|
4227
|
-
return t === "plaintext" || !!
|
|
4208
|
+
function Dt(t) {
|
|
4209
|
+
return t === "plaintext" || !!Kr.getLanguage(t);
|
|
4228
4210
|
}
|
|
4229
|
-
async function
|
|
4230
|
-
if (
|
|
4231
|
-
const e =
|
|
4211
|
+
async function zs(t) {
|
|
4212
|
+
if (Dt(t)) return;
|
|
4213
|
+
const e = Gs[t];
|
|
4232
4214
|
if (!e) return;
|
|
4233
4215
|
const r = await e();
|
|
4234
|
-
|
|
4216
|
+
Kr.registerLanguage(t, r.default);
|
|
4235
4217
|
}
|
|
4236
|
-
const
|
|
4237
|
-
function
|
|
4218
|
+
const Vs = `${Ns}:${qs}`;
|
|
4219
|
+
function Ys({ method: t, path: e, parameters: r, requestBody: n, security: s, id: o }) {
|
|
4238
4220
|
var v;
|
|
4239
|
-
const { document: a, showCodeSamples: i } =
|
|
4240
|
-
|
|
4221
|
+
const { document: a, showCodeSamples: i } = Rn(), c = a, l = Cn(), f = ze(() => _s(), []), [u, d] = gt(Vs), [p, h] = u.split(":"), y = Js(p), g = ze(() => Hs(n), [n]), [$, m] = gt(void 0);
|
|
4222
|
+
ir(() => {
|
|
4241
4223
|
if (m(void 0), !g || g.authorExample !== void 0 || !g.schema) return;
|
|
4242
4224
|
let T = !1;
|
|
4243
|
-
return
|
|
4225
|
+
return qn(g.schema).then((P) => {
|
|
4244
4226
|
T || m(P);
|
|
4245
4227
|
}), () => {
|
|
4246
4228
|
T = !0;
|
|
4247
4229
|
};
|
|
4248
4230
|
}, [g]);
|
|
4249
|
-
const [, b] = gt(() =>
|
|
4250
|
-
|
|
4251
|
-
b(
|
|
4231
|
+
const [, b] = gt(() => Dt(y));
|
|
4232
|
+
ir(() => {
|
|
4233
|
+
b(Dt(y));
|
|
4252
4234
|
let T = !1;
|
|
4253
|
-
return
|
|
4235
|
+
return zs(y).then(() => {
|
|
4254
4236
|
T || b(!0);
|
|
4255
4237
|
}), () => {
|
|
4256
4238
|
T = !0;
|
|
@@ -4259,7 +4241,7 @@ function Ds({ method: t, path: e, parameters: r, requestBody: n, security: s, id
|
|
|
4259
4241
|
const S = ze(
|
|
4260
4242
|
() => {
|
|
4261
4243
|
var T;
|
|
4262
|
-
return
|
|
4244
|
+
return Ms({
|
|
4263
4245
|
method: t,
|
|
4264
4246
|
path: e,
|
|
4265
4247
|
servers: c.servers,
|
|
@@ -4272,27 +4254,27 @@ function Ds({ method: t, path: e, parameters: r, requestBody: n, security: s, id
|
|
|
4272
4254
|
},
|
|
4273
4255
|
[t, e, c.servers, r, s, (v = c.components) == null ? void 0 : v.securitySchemes, g, $]
|
|
4274
4256
|
), O = ze(
|
|
4275
|
-
() =>
|
|
4276
|
-
[S,
|
|
4257
|
+
() => Bs(S, p, h),
|
|
4258
|
+
[S, p, h]
|
|
4277
4259
|
);
|
|
4278
|
-
return i ? /* @__PURE__ */
|
|
4279
|
-
/* @__PURE__ */
|
|
4280
|
-
/* @__PURE__ */
|
|
4281
|
-
/* @__PURE__ */
|
|
4260
|
+
return i ? /* @__PURE__ */ or("div", { id: `endpoint-${o}-code-samples`, children: [
|
|
4261
|
+
/* @__PURE__ */ or("div", { className: "flex items-center justify-between mb-2", children: [
|
|
4262
|
+
/* @__PURE__ */ Ne("label", { htmlFor: l, className: "text-xs font-medium text-foreground-muted uppercase tracking-wider", children: "Example Request" }),
|
|
4263
|
+
/* @__PURE__ */ Ne(
|
|
4282
4264
|
"select",
|
|
4283
4265
|
{
|
|
4284
4266
|
id: l,
|
|
4285
4267
|
value: u,
|
|
4286
|
-
onChange: (T) =>
|
|
4268
|
+
onChange: (T) => d(T.target.value),
|
|
4287
4269
|
"aria-label": "Code sample language",
|
|
4288
4270
|
className: "text-xs font-medium rounded-md border border-border bg-surface px-2 py-1 text-foreground-secondary focus:border-secondary-500 focus:ring-secondary-500",
|
|
4289
|
-
children: f.map((T) => /* @__PURE__ */
|
|
4271
|
+
children: f.map((T) => /* @__PURE__ */ Ne("optgroup", { label: T.title, children: T.clients.map((P) => /* @__PURE__ */ Ne("option", { value: `${T.key}:${P.key}`, children: P.title }, P.key)) }, T.key))
|
|
4290
4272
|
}
|
|
4291
4273
|
)
|
|
4292
4274
|
] }),
|
|
4293
|
-
/* @__PURE__ */
|
|
4275
|
+
/* @__PURE__ */ Ne(Nn, { code: O, language: y })
|
|
4294
4276
|
] }) : null;
|
|
4295
4277
|
}
|
|
4296
4278
|
export {
|
|
4297
|
-
|
|
4279
|
+
Ys as CodeSamples
|
|
4298
4280
|
};
|