iboot-http-client 1.2.6 → 1.2.7
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/iboot-http-client.cjs.js +8 -1
- package/dist/iboot-http-client.cjs.js.map +1 -1
- package/dist/iboot-http-client.es.js +1977 -288
- package/dist/iboot-http-client.es.js.map +1 -1
- package/dist/iboot-http-client.umd.js +8 -1
- package/dist/iboot-http-client.umd.js.map +1 -1
- package/dist/types/http-client.d.ts +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/router-dapter/nextjs.d.ts +7 -0
- package/dist/types/router-dapter/nuxtjs.d.ts +7 -0
- package/dist/types/router.d.ts +20 -0
- package/dist/types/types/router.d.ts +60 -0
- package/package.json +17 -13
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import zt from "pino";
|
|
2
|
+
import Vt from "pino-pretty";
|
|
3
|
+
import Kt from "js-md5";
|
|
4
|
+
import ne from "crypto-js";
|
|
5
|
+
const Ir = {
|
|
6
6
|
GENERAL: 0,
|
|
7
7
|
PHONE: 1,
|
|
8
8
|
EMAIL: 2
|
|
9
|
-
},
|
|
9
|
+
}, Dt = {
|
|
10
10
|
TYPE_MGT: 0,
|
|
11
11
|
TYPE_C: 1,
|
|
12
12
|
TYPE_B: 2
|
|
13
|
-
},
|
|
13
|
+
}, Or = {
|
|
14
14
|
FROM_WEB: 1,
|
|
15
15
|
FROM_PC: 2,
|
|
16
16
|
FROM_WX_MINI_PRO: 3,
|
|
@@ -18,246 +18,1931 @@ const K = {
|
|
|
18
18
|
FROM_WX_E: 5,
|
|
19
19
|
FROM_APP: 6,
|
|
20
20
|
FROM_DEVICE: 7
|
|
21
|
-
},
|
|
21
|
+
}, xr = {
|
|
22
22
|
unknown: 0,
|
|
23
23
|
male: 1,
|
|
24
24
|
female: 2
|
|
25
|
-
},
|
|
25
|
+
}, Yt = Vt({
|
|
26
26
|
colorize: !0,
|
|
27
27
|
destination: process.stdout,
|
|
28
28
|
translateTime: "SYS:yyyy-mm-dd HH:MM:ss",
|
|
29
29
|
ignore: "pid,hostname",
|
|
30
30
|
messageFormat: "{msg}",
|
|
31
31
|
singleLine: !0
|
|
32
|
-
}),
|
|
32
|
+
}), k = zt({
|
|
33
33
|
name: process.env.APP_NAME ?? "iBoot",
|
|
34
34
|
level: process.env.APP_ENV === "production" ? "info" : "debug",
|
|
35
35
|
nestedKey: "payload"
|
|
36
|
-
},
|
|
37
|
-
const e =
|
|
38
|
-
let
|
|
39
|
-
for (let
|
|
40
|
-
|
|
41
|
-
return
|
|
42
|
-
},
|
|
36
|
+
}, Yt), st = (i) => Array.isArray(i) || typeof i == "object" && Object.prototype.toString.call(i) === "[object Array]", at = (i) => {
|
|
37
|
+
const e = i || 32, t = "ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678", o = t.length;
|
|
38
|
+
let n = "";
|
|
39
|
+
for (let a = 0; a < e; a++)
|
|
40
|
+
n += t.charAt(Math.floor(Math.random() * o));
|
|
41
|
+
return n;
|
|
42
|
+
}, Ze = (i, e) => {
|
|
43
43
|
const t = {};
|
|
44
|
-
return
|
|
45
|
-
const
|
|
46
|
-
|
|
44
|
+
return i.split("&").forEach((n) => {
|
|
45
|
+
const a = n.split("=");
|
|
46
|
+
a[1] && (!e || e.indexOf(a[0]) == -1) && (t[a[0]] = a[1]);
|
|
47
47
|
}), t;
|
|
48
|
-
},
|
|
48
|
+
}, we = (i) => !i || i == "" || i.length == 0 ? "" : encodeURIComponent(i).replace(/\(/g, "%28").replace(/\)/g, "%29").replace(/\'/g, "%27").replace(/\!/g, "%21").replace(/\~/g, "%7E"), Nr = (i, e) => {
|
|
49
49
|
const t = {
|
|
50
|
-
"M+":
|
|
50
|
+
"M+": i.getMonth() + 1,
|
|
51
51
|
//月份
|
|
52
|
-
"d+":
|
|
52
|
+
"d+": i.getDate(),
|
|
53
53
|
//日
|
|
54
|
-
"h+":
|
|
54
|
+
"h+": i.getHours(),
|
|
55
55
|
//小时
|
|
56
|
-
"m+":
|
|
56
|
+
"m+": i.getMinutes(),
|
|
57
57
|
//分
|
|
58
|
-
"s+":
|
|
58
|
+
"s+": i.getSeconds(),
|
|
59
59
|
//秒
|
|
60
|
-
"q+": Math.floor((
|
|
60
|
+
"q+": Math.floor((i.getMonth() + 3) / 3),
|
|
61
61
|
//季度
|
|
62
|
-
S:
|
|
62
|
+
S: i.getMilliseconds()
|
|
63
63
|
//毫秒
|
|
64
64
|
};
|
|
65
65
|
if (/(y+)/.test(e)) {
|
|
66
|
-
const
|
|
67
|
-
let
|
|
68
|
-
|
|
66
|
+
const n = new RegExp(/(y+)/).exec(e);
|
|
67
|
+
let a = 0;
|
|
68
|
+
n && n.length > 0 && (a = n[0].length), e = e.replace(/(y+)/, i.getFullYear() + "").substring(4 - a);
|
|
69
69
|
}
|
|
70
|
-
for (const
|
|
71
|
-
const
|
|
72
|
-
if (
|
|
73
|
-
const
|
|
74
|
-
let
|
|
75
|
-
|
|
70
|
+
for (const o in t) {
|
|
71
|
+
const n = "(" + o + ")", a = new RegExp(n);
|
|
72
|
+
if (a.test(e)) {
|
|
73
|
+
const u = a.exec(e);
|
|
74
|
+
let r = 0;
|
|
75
|
+
u && u.length > 0 && (r = u[0].length), e = e.replace(a, r == 1 ? t[o].toString() : ("00" + t[o]).substring(t[o].toString().length));
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
return e;
|
|
79
|
-
}
|
|
79
|
+
};
|
|
80
|
+
var Ee = { exports: {} }, ye = {}, Se = {}, Ae = {}, ut;
|
|
81
|
+
function $t() {
|
|
82
|
+
return ut || (ut = 1, (function(i) {
|
|
83
|
+
Object.defineProperty(i, "__esModule", {
|
|
84
|
+
value: !0
|
|
85
|
+
}), Object.defineProperty(i, "detectDomainLocale", {
|
|
86
|
+
enumerable: !0,
|
|
87
|
+
get: function() {
|
|
88
|
+
return e;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
function e(t, o, n) {
|
|
92
|
+
if (t) {
|
|
93
|
+
n && (n = n.toLowerCase());
|
|
94
|
+
for (const r of t) {
|
|
95
|
+
var a, u;
|
|
96
|
+
const d = (a = r.domain) == null ? void 0 : a.split(":", 1)[0].toLowerCase();
|
|
97
|
+
if (o === d || n === r.defaultLocale.toLowerCase() || (u = r.locales) != null && u.some((_) => _.toLowerCase() === n))
|
|
98
|
+
return r;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
})(Ae)), Ae;
|
|
103
|
+
}
|
|
104
|
+
var Te = {}, Ie = {}, ct;
|
|
105
|
+
function Jt() {
|
|
106
|
+
return ct || (ct = 1, (function(i) {
|
|
107
|
+
Object.defineProperty(i, "__esModule", {
|
|
108
|
+
value: !0
|
|
109
|
+
}), Object.defineProperty(i, "removeTrailingSlash", {
|
|
110
|
+
enumerable: !0,
|
|
111
|
+
get: function() {
|
|
112
|
+
return e;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
function e(t) {
|
|
116
|
+
return t.replace(/\/$/, "") || "/";
|
|
117
|
+
}
|
|
118
|
+
})(Ie)), Ie;
|
|
119
|
+
}
|
|
120
|
+
var Oe = {}, xe = {}, lt;
|
|
121
|
+
function et() {
|
|
122
|
+
return lt || (lt = 1, (function(i) {
|
|
123
|
+
Object.defineProperty(i, "__esModule", {
|
|
124
|
+
value: !0
|
|
125
|
+
}), Object.defineProperty(i, "parsePath", {
|
|
126
|
+
enumerable: !0,
|
|
127
|
+
get: function() {
|
|
128
|
+
return e;
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
function e(t) {
|
|
132
|
+
const o = t.indexOf("#"), n = t.indexOf("?"), a = n > -1 && (o < 0 || n < o);
|
|
133
|
+
return a || o > -1 ? {
|
|
134
|
+
pathname: t.substring(0, a ? n : o),
|
|
135
|
+
query: a ? t.substring(n, o > -1 ? o : void 0) : "",
|
|
136
|
+
hash: o > -1 ? t.slice(o) : ""
|
|
137
|
+
} : {
|
|
138
|
+
pathname: t,
|
|
139
|
+
query: "",
|
|
140
|
+
hash: ""
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
})(xe)), xe;
|
|
144
|
+
}
|
|
145
|
+
var dt;
|
|
146
|
+
function Mt() {
|
|
147
|
+
return dt || (dt = 1, (function(i) {
|
|
148
|
+
Object.defineProperty(i, "__esModule", {
|
|
149
|
+
value: !0
|
|
150
|
+
}), Object.defineProperty(i, "addPathPrefix", {
|
|
151
|
+
enumerable: !0,
|
|
152
|
+
get: function() {
|
|
153
|
+
return t;
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
const e = et();
|
|
157
|
+
function t(o, n) {
|
|
158
|
+
if (!o.startsWith("/") || !n)
|
|
159
|
+
return o;
|
|
160
|
+
const { pathname: a, query: u, hash: r } = (0, e.parsePath)(o);
|
|
161
|
+
return "" + n + a + u + r;
|
|
162
|
+
}
|
|
163
|
+
})(Oe)), Oe;
|
|
164
|
+
}
|
|
165
|
+
var Ne = {}, ht;
|
|
166
|
+
function Qt() {
|
|
167
|
+
return ht || (ht = 1, (function(i) {
|
|
168
|
+
Object.defineProperty(i, "__esModule", {
|
|
169
|
+
value: !0
|
|
170
|
+
}), Object.defineProperty(i, "addPathSuffix", {
|
|
171
|
+
enumerable: !0,
|
|
172
|
+
get: function() {
|
|
173
|
+
return t;
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
const e = et();
|
|
177
|
+
function t(o, n) {
|
|
178
|
+
if (!o.startsWith("/") || !n)
|
|
179
|
+
return o;
|
|
180
|
+
const { pathname: a, query: u, hash: r } = (0, e.parsePath)(o);
|
|
181
|
+
return "" + a + n + u + r;
|
|
182
|
+
}
|
|
183
|
+
})(Ne)), Ne;
|
|
184
|
+
}
|
|
185
|
+
var Ce = {}, Le = {}, ft;
|
|
186
|
+
function tt() {
|
|
187
|
+
return ft || (ft = 1, (function(i) {
|
|
188
|
+
Object.defineProperty(i, "__esModule", {
|
|
189
|
+
value: !0
|
|
190
|
+
}), Object.defineProperty(i, "pathHasPrefix", {
|
|
191
|
+
enumerable: !0,
|
|
192
|
+
get: function() {
|
|
193
|
+
return t;
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
const e = et();
|
|
197
|
+
function t(o, n) {
|
|
198
|
+
if (typeof o != "string")
|
|
199
|
+
return !1;
|
|
200
|
+
const { pathname: a } = (0, e.parsePath)(o);
|
|
201
|
+
return a === n || a.startsWith(n + "/");
|
|
202
|
+
}
|
|
203
|
+
})(Le)), Le;
|
|
204
|
+
}
|
|
205
|
+
var pt;
|
|
206
|
+
function Zt() {
|
|
207
|
+
return pt || (pt = 1, (function(i) {
|
|
208
|
+
Object.defineProperty(i, "__esModule", {
|
|
209
|
+
value: !0
|
|
210
|
+
}), Object.defineProperty(i, "addLocale", {
|
|
211
|
+
enumerable: !0,
|
|
212
|
+
get: function() {
|
|
213
|
+
return o;
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
const e = Mt(), t = tt();
|
|
217
|
+
function o(n, a, u, r) {
|
|
218
|
+
if (!a || a === u) return n;
|
|
219
|
+
const d = n.toLowerCase();
|
|
220
|
+
return !r && ((0, t.pathHasPrefix)(d, "/api") || (0, t.pathHasPrefix)(d, "/" + a.toLowerCase())) ? n : (0, e.addPathPrefix)(n, "/" + a);
|
|
221
|
+
}
|
|
222
|
+
})(Ce)), Ce;
|
|
223
|
+
}
|
|
224
|
+
var mt;
|
|
225
|
+
function er() {
|
|
226
|
+
return mt || (mt = 1, (function(i) {
|
|
227
|
+
Object.defineProperty(i, "__esModule", {
|
|
228
|
+
value: !0
|
|
229
|
+
}), Object.defineProperty(i, "formatNextPathnameInfo", {
|
|
230
|
+
enumerable: !0,
|
|
231
|
+
get: function() {
|
|
232
|
+
return a;
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
const e = Jt(), t = Mt(), o = Qt(), n = Zt();
|
|
236
|
+
function a(u) {
|
|
237
|
+
let r = (0, n.addLocale)(u.pathname, u.locale, u.buildId ? void 0 : u.defaultLocale, u.ignorePrefix);
|
|
238
|
+
return (u.buildId || !u.trailingSlash) && (r = (0, e.removeTrailingSlash)(r)), u.buildId && (r = (0, o.addPathSuffix)((0, t.addPathPrefix)(r, "/_next/data/" + u.buildId), u.pathname === "/" ? "index.json" : ".json")), r = (0, t.addPathPrefix)(r, u.basePath), !u.buildId && u.trailingSlash ? r.endsWith("/") ? r : (0, o.addPathSuffix)(r, "/") : (0, e.removeTrailingSlash)(r);
|
|
239
|
+
}
|
|
240
|
+
})(Te)), Te;
|
|
241
|
+
}
|
|
242
|
+
var ke = {}, _t;
|
|
243
|
+
function tr() {
|
|
244
|
+
return _t || (_t = 1, (function(i) {
|
|
245
|
+
Object.defineProperty(i, "__esModule", {
|
|
246
|
+
value: !0
|
|
247
|
+
}), Object.defineProperty(i, "getHostname", {
|
|
248
|
+
enumerable: !0,
|
|
249
|
+
get: function() {
|
|
250
|
+
return e;
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
function e(t, o) {
|
|
254
|
+
let n;
|
|
255
|
+
if (o?.host && !Array.isArray(o.host))
|
|
256
|
+
n = o.host.toString().split(":", 1)[0];
|
|
257
|
+
else if (t.hostname)
|
|
258
|
+
n = t.hostname;
|
|
259
|
+
else return;
|
|
260
|
+
return n.toLowerCase();
|
|
261
|
+
}
|
|
262
|
+
})(ke)), ke;
|
|
263
|
+
}
|
|
264
|
+
var Ue = {}, De = {}, gt;
|
|
265
|
+
function rr() {
|
|
266
|
+
return gt || (gt = 1, (function(i) {
|
|
267
|
+
Object.defineProperty(i, "__esModule", {
|
|
268
|
+
value: !0
|
|
269
|
+
}), Object.defineProperty(i, "normalizeLocalePath", {
|
|
270
|
+
enumerable: !0,
|
|
271
|
+
get: function() {
|
|
272
|
+
return e;
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
function e(t, o) {
|
|
276
|
+
let n;
|
|
277
|
+
const a = t.split("/");
|
|
278
|
+
return (o || []).some((u) => a[1] && a[1].toLowerCase() === u.toLowerCase() ? (n = u, a.splice(1, 1), t = a.join("/") || "/", !0) : !1), {
|
|
279
|
+
pathname: t,
|
|
280
|
+
detectedLocale: n
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
})(De)), De;
|
|
284
|
+
}
|
|
285
|
+
var Me = {}, bt;
|
|
286
|
+
function nr() {
|
|
287
|
+
return bt || (bt = 1, (function(i) {
|
|
288
|
+
Object.defineProperty(i, "__esModule", {
|
|
289
|
+
value: !0
|
|
290
|
+
}), Object.defineProperty(i, "removePathPrefix", {
|
|
291
|
+
enumerable: !0,
|
|
292
|
+
get: function() {
|
|
293
|
+
return t;
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
const e = tt();
|
|
297
|
+
function t(o, n) {
|
|
298
|
+
if (!(0, e.pathHasPrefix)(o, n))
|
|
299
|
+
return o;
|
|
300
|
+
const a = o.slice(n.length);
|
|
301
|
+
return a.startsWith("/") ? a : "/" + a;
|
|
302
|
+
}
|
|
303
|
+
})(Me)), Me;
|
|
304
|
+
}
|
|
305
|
+
var wt;
|
|
306
|
+
function ir() {
|
|
307
|
+
return wt || (wt = 1, (function(i) {
|
|
308
|
+
Object.defineProperty(i, "__esModule", {
|
|
309
|
+
value: !0
|
|
310
|
+
}), Object.defineProperty(i, "getNextPathnameInfo", {
|
|
311
|
+
enumerable: !0,
|
|
312
|
+
get: function() {
|
|
313
|
+
return n;
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
const e = rr(), t = nr(), o = tt();
|
|
317
|
+
function n(a, u) {
|
|
318
|
+
var r;
|
|
319
|
+
const { basePath: d, i18n: _, trailingSlash: c } = (r = u.nextConfig) != null ? r : {}, f = {
|
|
320
|
+
pathname: a,
|
|
321
|
+
trailingSlash: a !== "/" ? a.endsWith("/") : c
|
|
322
|
+
};
|
|
323
|
+
d && (0, o.pathHasPrefix)(f.pathname, d) && (f.pathname = (0, t.removePathPrefix)(f.pathname, d), f.basePath = d);
|
|
324
|
+
let g = f.pathname;
|
|
325
|
+
if (f.pathname.startsWith("/_next/data/") && f.pathname.endsWith(".json")) {
|
|
326
|
+
const S = f.pathname.replace(/^\/_next\/data\//, "").replace(/\.json$/, "").split("/"), x = S[0];
|
|
327
|
+
f.buildId = x, g = S[1] !== "index" ? "/" + S.slice(1).join("/") : "/", u.parseData === !0 && (f.pathname = g);
|
|
328
|
+
}
|
|
329
|
+
if (_) {
|
|
330
|
+
let S = u.i18nProvider ? u.i18nProvider.analyze(f.pathname) : (0, e.normalizeLocalePath)(f.pathname, _.locales);
|
|
331
|
+
f.locale = S.detectedLocale;
|
|
332
|
+
var R;
|
|
333
|
+
f.pathname = (R = S.pathname) != null ? R : f.pathname, !S.detectedLocale && f.buildId && (S = u.i18nProvider ? u.i18nProvider.analyze(g) : (0, e.normalizeLocalePath)(g, _.locales), S.detectedLocale && (f.locale = S.detectedLocale));
|
|
334
|
+
}
|
|
335
|
+
return f;
|
|
336
|
+
}
|
|
337
|
+
})(Ue)), Ue;
|
|
338
|
+
}
|
|
339
|
+
var Et;
|
|
340
|
+
function jt() {
|
|
341
|
+
return Et || (Et = 1, (function(i) {
|
|
342
|
+
Object.defineProperty(i, "__esModule", {
|
|
343
|
+
value: !0
|
|
344
|
+
}), Object.defineProperty(i, "NextURL", {
|
|
345
|
+
enumerable: !0,
|
|
346
|
+
get: function() {
|
|
347
|
+
return d;
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
const e = $t(), t = er(), o = tr(), n = ir(), a = /(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/;
|
|
351
|
+
function u(_, c) {
|
|
352
|
+
return new URL(String(_).replace(a, "localhost"), c && String(c).replace(a, "localhost"));
|
|
353
|
+
}
|
|
354
|
+
const r = /* @__PURE__ */ Symbol("NextURLInternal");
|
|
355
|
+
class d {
|
|
356
|
+
constructor(c, f, g) {
|
|
357
|
+
let R, S;
|
|
358
|
+
typeof f == "object" && "pathname" in f || typeof f == "string" ? (R = f, S = g || {}) : S = g || f || {}, this[r] = {
|
|
359
|
+
url: u(c, R ?? S.base),
|
|
360
|
+
options: S,
|
|
361
|
+
basePath: ""
|
|
362
|
+
}, this.analyze();
|
|
363
|
+
}
|
|
364
|
+
analyze() {
|
|
365
|
+
var c, f, g, R, S;
|
|
366
|
+
const x = (0, n.getNextPathnameInfo)(this[r].url.pathname, {
|
|
367
|
+
nextConfig: this[r].options.nextConfig,
|
|
368
|
+
parseData: !process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE,
|
|
369
|
+
i18nProvider: this[r].options.i18nProvider
|
|
370
|
+
}), l = (0, o.getHostname)(this[r].url, this[r].options.headers);
|
|
371
|
+
this[r].domainLocale = this[r].options.i18nProvider ? this[r].options.i18nProvider.detectDomainLocale(l) : (0, e.detectDomainLocale)((f = this[r].options.nextConfig) == null || (c = f.i18n) == null ? void 0 : c.domains, l);
|
|
372
|
+
const b = ((g = this[r].domainLocale) == null ? void 0 : g.defaultLocale) || ((S = this[r].options.nextConfig) == null || (R = S.i18n) == null ? void 0 : R.defaultLocale);
|
|
373
|
+
this[r].url.pathname = x.pathname, this[r].defaultLocale = b, this[r].basePath = x.basePath ?? "", this[r].buildId = x.buildId, this[r].locale = x.locale ?? b, this[r].trailingSlash = x.trailingSlash;
|
|
374
|
+
}
|
|
375
|
+
formatPathname() {
|
|
376
|
+
return (0, t.formatNextPathnameInfo)({
|
|
377
|
+
basePath: this[r].basePath,
|
|
378
|
+
buildId: this[r].buildId,
|
|
379
|
+
defaultLocale: this[r].options.forceLocale ? void 0 : this[r].defaultLocale,
|
|
380
|
+
locale: this[r].locale,
|
|
381
|
+
pathname: this[r].url.pathname,
|
|
382
|
+
trailingSlash: this[r].trailingSlash
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
formatSearch() {
|
|
386
|
+
return this[r].url.search;
|
|
387
|
+
}
|
|
388
|
+
get buildId() {
|
|
389
|
+
return this[r].buildId;
|
|
390
|
+
}
|
|
391
|
+
set buildId(c) {
|
|
392
|
+
this[r].buildId = c;
|
|
393
|
+
}
|
|
394
|
+
get locale() {
|
|
395
|
+
return this[r].locale ?? "";
|
|
396
|
+
}
|
|
397
|
+
set locale(c) {
|
|
398
|
+
var f, g;
|
|
399
|
+
if (!this[r].locale || !(!((g = this[r].options.nextConfig) == null || (f = g.i18n) == null) && f.locales.includes(c)))
|
|
400
|
+
throw new TypeError(`The NextURL configuration includes no locale "${c}"`);
|
|
401
|
+
this[r].locale = c;
|
|
402
|
+
}
|
|
403
|
+
get defaultLocale() {
|
|
404
|
+
return this[r].defaultLocale;
|
|
405
|
+
}
|
|
406
|
+
get domainLocale() {
|
|
407
|
+
return this[r].domainLocale;
|
|
408
|
+
}
|
|
409
|
+
get searchParams() {
|
|
410
|
+
return this[r].url.searchParams;
|
|
411
|
+
}
|
|
412
|
+
get host() {
|
|
413
|
+
return this[r].url.host;
|
|
414
|
+
}
|
|
415
|
+
set host(c) {
|
|
416
|
+
this[r].url.host = c;
|
|
417
|
+
}
|
|
418
|
+
get hostname() {
|
|
419
|
+
return this[r].url.hostname;
|
|
420
|
+
}
|
|
421
|
+
set hostname(c) {
|
|
422
|
+
this[r].url.hostname = c;
|
|
423
|
+
}
|
|
424
|
+
get port() {
|
|
425
|
+
return this[r].url.port;
|
|
426
|
+
}
|
|
427
|
+
set port(c) {
|
|
428
|
+
this[r].url.port = c;
|
|
429
|
+
}
|
|
430
|
+
get protocol() {
|
|
431
|
+
return this[r].url.protocol;
|
|
432
|
+
}
|
|
433
|
+
set protocol(c) {
|
|
434
|
+
this[r].url.protocol = c;
|
|
435
|
+
}
|
|
436
|
+
get href() {
|
|
437
|
+
const c = this.formatPathname(), f = this.formatSearch();
|
|
438
|
+
return `${this.protocol}//${this.host}${c}${f}${this.hash}`;
|
|
439
|
+
}
|
|
440
|
+
set href(c) {
|
|
441
|
+
this[r].url = u(c), this.analyze();
|
|
442
|
+
}
|
|
443
|
+
get origin() {
|
|
444
|
+
return this[r].url.origin;
|
|
445
|
+
}
|
|
446
|
+
get pathname() {
|
|
447
|
+
return this[r].url.pathname;
|
|
448
|
+
}
|
|
449
|
+
set pathname(c) {
|
|
450
|
+
this[r].url.pathname = c;
|
|
451
|
+
}
|
|
452
|
+
get hash() {
|
|
453
|
+
return this[r].url.hash;
|
|
454
|
+
}
|
|
455
|
+
set hash(c) {
|
|
456
|
+
this[r].url.hash = c;
|
|
457
|
+
}
|
|
458
|
+
get search() {
|
|
459
|
+
return this[r].url.search;
|
|
460
|
+
}
|
|
461
|
+
set search(c) {
|
|
462
|
+
this[r].url.search = c;
|
|
463
|
+
}
|
|
464
|
+
get password() {
|
|
465
|
+
return this[r].url.password;
|
|
466
|
+
}
|
|
467
|
+
set password(c) {
|
|
468
|
+
this[r].url.password = c;
|
|
469
|
+
}
|
|
470
|
+
get username() {
|
|
471
|
+
return this[r].url.username;
|
|
472
|
+
}
|
|
473
|
+
set username(c) {
|
|
474
|
+
this[r].url.username = c;
|
|
475
|
+
}
|
|
476
|
+
get basePath() {
|
|
477
|
+
return this[r].basePath;
|
|
478
|
+
}
|
|
479
|
+
set basePath(c) {
|
|
480
|
+
this[r].basePath = c.startsWith("/") ? c : `/${c}`;
|
|
481
|
+
}
|
|
482
|
+
toString() {
|
|
483
|
+
return this.href;
|
|
484
|
+
}
|
|
485
|
+
toJSON() {
|
|
486
|
+
return this.href;
|
|
487
|
+
}
|
|
488
|
+
[/* @__PURE__ */ Symbol.for("edge-runtime.inspect.custom")]() {
|
|
489
|
+
return {
|
|
490
|
+
href: this.href,
|
|
491
|
+
origin: this.origin,
|
|
492
|
+
protocol: this.protocol,
|
|
493
|
+
username: this.username,
|
|
494
|
+
password: this.password,
|
|
495
|
+
host: this.host,
|
|
496
|
+
hostname: this.hostname,
|
|
497
|
+
port: this.port,
|
|
498
|
+
pathname: this.pathname,
|
|
499
|
+
search: this.search,
|
|
500
|
+
searchParams: this.searchParams,
|
|
501
|
+
hash: this.hash
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
clone() {
|
|
505
|
+
return new d(String(this), this[r].options);
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
})(Se)), Se;
|
|
509
|
+
}
|
|
510
|
+
var je = {}, qe = {}, vt;
|
|
511
|
+
function or() {
|
|
512
|
+
return vt || (vt = 1, (function(i) {
|
|
513
|
+
Object.defineProperty(i, "__esModule", {
|
|
514
|
+
value: !0
|
|
515
|
+
});
|
|
516
|
+
function e(_e, ge) {
|
|
517
|
+
for (var $ in ge) Object.defineProperty(_e, $, {
|
|
518
|
+
enumerable: !0,
|
|
519
|
+
get: ge[$]
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
e(i, {
|
|
523
|
+
ACTION_SUFFIX: function() {
|
|
524
|
+
return d;
|
|
525
|
+
},
|
|
526
|
+
APP_DIR_ALIAS: function() {
|
|
527
|
+
return M;
|
|
528
|
+
},
|
|
529
|
+
CACHE_ONE_YEAR: function() {
|
|
530
|
+
return E;
|
|
531
|
+
},
|
|
532
|
+
DOT_NEXT_ALIAS: function() {
|
|
533
|
+
return P;
|
|
534
|
+
},
|
|
535
|
+
ESLINT_DEFAULT_DIRS: function() {
|
|
536
|
+
return te;
|
|
537
|
+
},
|
|
538
|
+
GSP_NO_RETURNED_VALUE: function() {
|
|
539
|
+
return oe;
|
|
540
|
+
},
|
|
541
|
+
GSSP_COMPONENT_MEMBER_ERROR: function() {
|
|
542
|
+
return ee;
|
|
543
|
+
},
|
|
544
|
+
GSSP_NO_RETURNED_VALUE: function() {
|
|
545
|
+
return se;
|
|
546
|
+
},
|
|
547
|
+
INSTRUMENTATION_HOOK_FILENAME: function() {
|
|
548
|
+
return p;
|
|
549
|
+
},
|
|
550
|
+
MIDDLEWARE_FILENAME: function() {
|
|
551
|
+
return s;
|
|
552
|
+
},
|
|
553
|
+
MIDDLEWARE_LOCATION_REGEXP: function() {
|
|
554
|
+
return v;
|
|
555
|
+
},
|
|
556
|
+
NEXT_BODY_SUFFIX: function() {
|
|
557
|
+
return f;
|
|
558
|
+
},
|
|
559
|
+
NEXT_CACHE_IMPLICIT_TAG_ID: function() {
|
|
560
|
+
return m;
|
|
561
|
+
},
|
|
562
|
+
NEXT_CACHE_REVALIDATED_TAGS_HEADER: function() {
|
|
563
|
+
return S;
|
|
564
|
+
},
|
|
565
|
+
NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER: function() {
|
|
566
|
+
return x;
|
|
567
|
+
},
|
|
568
|
+
NEXT_CACHE_SOFT_TAGS_HEADER: function() {
|
|
569
|
+
return R;
|
|
570
|
+
},
|
|
571
|
+
NEXT_CACHE_SOFT_TAG_MAX_LENGTH: function() {
|
|
572
|
+
return h;
|
|
573
|
+
},
|
|
574
|
+
NEXT_CACHE_TAGS_HEADER: function() {
|
|
575
|
+
return g;
|
|
576
|
+
},
|
|
577
|
+
NEXT_CACHE_TAG_MAX_ITEMS: function() {
|
|
578
|
+
return l;
|
|
579
|
+
},
|
|
580
|
+
NEXT_CACHE_TAG_MAX_LENGTH: function() {
|
|
581
|
+
return b;
|
|
582
|
+
},
|
|
583
|
+
NEXT_DATA_SUFFIX: function() {
|
|
584
|
+
return _;
|
|
585
|
+
},
|
|
586
|
+
NEXT_INTERCEPTION_MARKER_PREFIX: function() {
|
|
587
|
+
return o;
|
|
588
|
+
},
|
|
589
|
+
NEXT_META_SUFFIX: function() {
|
|
590
|
+
return c;
|
|
591
|
+
},
|
|
592
|
+
NEXT_QUERY_PARAM_PREFIX: function() {
|
|
593
|
+
return t;
|
|
594
|
+
},
|
|
595
|
+
NON_STANDARD_NODE_ENV: function() {
|
|
596
|
+
return ae;
|
|
597
|
+
},
|
|
598
|
+
PAGES_DIR_ALIAS: function() {
|
|
599
|
+
return w;
|
|
600
|
+
},
|
|
601
|
+
PRERENDER_REVALIDATE_HEADER: function() {
|
|
602
|
+
return n;
|
|
603
|
+
},
|
|
604
|
+
PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER: function() {
|
|
605
|
+
return a;
|
|
606
|
+
},
|
|
607
|
+
PUBLIC_DIR_MIDDLEWARE_CONFLICT: function() {
|
|
608
|
+
return F;
|
|
609
|
+
},
|
|
610
|
+
ROOT_DIR_ALIAS: function() {
|
|
611
|
+
return N;
|
|
612
|
+
},
|
|
613
|
+
RSC_ACTION_CLIENT_WRAPPER_ALIAS: function() {
|
|
614
|
+
return Q;
|
|
615
|
+
},
|
|
616
|
+
RSC_ACTION_ENCRYPTION_ALIAS: function() {
|
|
617
|
+
return J;
|
|
618
|
+
},
|
|
619
|
+
RSC_ACTION_PROXY_ALIAS: function() {
|
|
620
|
+
return j;
|
|
621
|
+
},
|
|
622
|
+
RSC_ACTION_VALIDATE_ALIAS: function() {
|
|
623
|
+
return H;
|
|
624
|
+
},
|
|
625
|
+
RSC_MOD_REF_PROXY_ALIAS: function() {
|
|
626
|
+
return D;
|
|
627
|
+
},
|
|
628
|
+
RSC_PREFETCH_SUFFIX: function() {
|
|
629
|
+
return u;
|
|
630
|
+
},
|
|
631
|
+
RSC_SUFFIX: function() {
|
|
632
|
+
return r;
|
|
633
|
+
},
|
|
634
|
+
SERVER_PROPS_EXPORT_ERROR: function() {
|
|
635
|
+
return de;
|
|
636
|
+
},
|
|
637
|
+
SERVER_PROPS_GET_INIT_PROPS_CONFLICT: function() {
|
|
638
|
+
return ie;
|
|
639
|
+
},
|
|
640
|
+
SERVER_PROPS_SSG_CONFLICT: function() {
|
|
641
|
+
return z;
|
|
642
|
+
},
|
|
643
|
+
SERVER_RUNTIME: function() {
|
|
644
|
+
return ue;
|
|
645
|
+
},
|
|
646
|
+
SSG_FALLBACK_EXPORT_ERROR: function() {
|
|
647
|
+
return fe;
|
|
648
|
+
},
|
|
649
|
+
SSG_GET_INITIAL_PROPS_CONFLICT: function() {
|
|
650
|
+
return W;
|
|
651
|
+
},
|
|
652
|
+
STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR: function() {
|
|
653
|
+
return Z;
|
|
654
|
+
},
|
|
655
|
+
UNSTABLE_REVALIDATE_RENAME_ERROR: function() {
|
|
656
|
+
return he;
|
|
657
|
+
},
|
|
658
|
+
WEBPACK_LAYERS: function() {
|
|
659
|
+
return pe;
|
|
660
|
+
},
|
|
661
|
+
WEBPACK_RESOURCE_QUERIES: function() {
|
|
662
|
+
return me;
|
|
663
|
+
}
|
|
664
|
+
});
|
|
665
|
+
const t = "nxtP", o = "nxtI", n = "x-prerender-revalidate", a = "x-prerender-revalidate-if-generated", u = ".prefetch.rsc", r = ".rsc", d = ".action", _ = ".json", c = ".meta", f = ".body", g = "x-next-cache-tags", R = "x-next-cache-soft-tags", S = "x-next-revalidated-tags", x = "x-next-revalidate-tag-token", l = 128, b = 256, h = 1024, m = "_N_T_", E = 31536e3, s = "middleware", v = `(?:src/)?${s}`, p = "instrumentation", w = "private-next-pages", P = "private-dot-next", N = "private-next-root-dir", M = "private-next-app-dir", D = "private-next-rsc-mod-ref-proxy", H = "private-next-rsc-action-validate", j = "private-next-rsc-server-reference", J = "private-next-rsc-action-encryption", Q = "private-next-rsc-action-client-wrapper", F = "You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict", W = "You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps", ie = "You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.", z = "You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps", Z = "can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props", de = "pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export", oe = "Your `getStaticProps` function did not return an object. Did you forget to add a `return`?", se = "Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?", he = "The `unstable_revalidate` property is available for general use.\nPlease use `revalidate` instead.", ee = "can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member", ae = 'You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env', fe = "Pages with `fallback` enabled in `getStaticPaths` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export", te = [
|
|
666
|
+
"app",
|
|
667
|
+
"pages",
|
|
668
|
+
"components",
|
|
669
|
+
"lib",
|
|
670
|
+
"src"
|
|
671
|
+
], ue = {
|
|
672
|
+
edge: "edge",
|
|
673
|
+
experimentalEdge: "experimental-edge",
|
|
674
|
+
nodejs: "nodejs"
|
|
675
|
+
}, L = {
|
|
676
|
+
/**
|
|
677
|
+
* The layer for the shared code between the client and server bundles.
|
|
678
|
+
*/
|
|
679
|
+
shared: "shared",
|
|
680
|
+
/**
|
|
681
|
+
* React Server Components layer (rsc).
|
|
682
|
+
*/
|
|
683
|
+
reactServerComponents: "rsc",
|
|
684
|
+
/**
|
|
685
|
+
* Server Side Rendering layer for app (ssr).
|
|
686
|
+
*/
|
|
687
|
+
serverSideRendering: "ssr",
|
|
688
|
+
/**
|
|
689
|
+
* The browser client bundle layer for actions.
|
|
690
|
+
*/
|
|
691
|
+
actionBrowser: "action-browser",
|
|
692
|
+
/**
|
|
693
|
+
* The layer for the API routes.
|
|
694
|
+
*/
|
|
695
|
+
api: "api",
|
|
696
|
+
/**
|
|
697
|
+
* The layer for the middleware code.
|
|
698
|
+
*/
|
|
699
|
+
middleware: "middleware",
|
|
700
|
+
/**
|
|
701
|
+
* The layer for the instrumentation hooks.
|
|
702
|
+
*/
|
|
703
|
+
instrument: "instrument",
|
|
704
|
+
/**
|
|
705
|
+
* The layer for assets on the edge.
|
|
706
|
+
*/
|
|
707
|
+
edgeAsset: "edge-asset",
|
|
708
|
+
/**
|
|
709
|
+
* The browser client bundle layer for App directory.
|
|
710
|
+
*/
|
|
711
|
+
appPagesBrowser: "app-pages-browser",
|
|
712
|
+
/**
|
|
713
|
+
* The server bundle layer for metadata routes.
|
|
714
|
+
*/
|
|
715
|
+
appMetadataRoute: "app-metadata-route",
|
|
716
|
+
/**
|
|
717
|
+
* The layer for the server bundle for App Route handlers.
|
|
718
|
+
*/
|
|
719
|
+
appRouteHandler: "app-route-handler"
|
|
720
|
+
}, pe = {
|
|
721
|
+
...L,
|
|
722
|
+
GROUP: {
|
|
723
|
+
serverOnly: [
|
|
724
|
+
L.reactServerComponents,
|
|
725
|
+
L.actionBrowser,
|
|
726
|
+
L.appMetadataRoute,
|
|
727
|
+
L.appRouteHandler,
|
|
728
|
+
L.instrument
|
|
729
|
+
],
|
|
730
|
+
clientOnly: [
|
|
731
|
+
L.serverSideRendering,
|
|
732
|
+
L.appPagesBrowser
|
|
733
|
+
],
|
|
734
|
+
nonClientServerTarget: [
|
|
735
|
+
// middleware and pages api
|
|
736
|
+
L.middleware,
|
|
737
|
+
L.api
|
|
738
|
+
],
|
|
739
|
+
app: [
|
|
740
|
+
L.reactServerComponents,
|
|
741
|
+
L.actionBrowser,
|
|
742
|
+
L.appMetadataRoute,
|
|
743
|
+
L.appRouteHandler,
|
|
744
|
+
L.serverSideRendering,
|
|
745
|
+
L.appPagesBrowser,
|
|
746
|
+
L.shared,
|
|
747
|
+
L.instrument
|
|
748
|
+
]
|
|
749
|
+
}
|
|
750
|
+
}, me = {
|
|
751
|
+
edgeSSREntry: "__next_edge_ssr_entry__",
|
|
752
|
+
metadata: "__next_metadata__",
|
|
753
|
+
metadataRoute: "__next_metadata_route__",
|
|
754
|
+
metadataImageMeta: "__next_metadata_image_meta__"
|
|
755
|
+
};
|
|
756
|
+
})(qe)), qe;
|
|
757
|
+
}
|
|
758
|
+
var Rt;
|
|
759
|
+
function qt() {
|
|
760
|
+
return Rt || (Rt = 1, (function(i) {
|
|
761
|
+
Object.defineProperty(i, "__esModule", {
|
|
762
|
+
value: !0
|
|
763
|
+
});
|
|
764
|
+
function e(d, _) {
|
|
765
|
+
for (var c in _) Object.defineProperty(d, c, {
|
|
766
|
+
enumerable: !0,
|
|
767
|
+
get: _[c]
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
e(i, {
|
|
771
|
+
fromNodeOutgoingHttpHeaders: function() {
|
|
772
|
+
return o;
|
|
773
|
+
},
|
|
774
|
+
normalizeNextQueryParam: function() {
|
|
775
|
+
return r;
|
|
776
|
+
},
|
|
777
|
+
splitCookiesString: function() {
|
|
778
|
+
return n;
|
|
779
|
+
},
|
|
780
|
+
toNodeOutgoingHttpHeaders: function() {
|
|
781
|
+
return a;
|
|
782
|
+
},
|
|
783
|
+
validateURL: function() {
|
|
784
|
+
return u;
|
|
785
|
+
}
|
|
786
|
+
});
|
|
787
|
+
const t = or();
|
|
788
|
+
function o(d) {
|
|
789
|
+
const _ = new Headers();
|
|
790
|
+
for (let [c, f] of Object.entries(d)) {
|
|
791
|
+
const g = Array.isArray(f) ? f : [
|
|
792
|
+
f
|
|
793
|
+
];
|
|
794
|
+
for (let R of g)
|
|
795
|
+
typeof R > "u" || (typeof R == "number" && (R = R.toString()), _.append(c, R));
|
|
796
|
+
}
|
|
797
|
+
return _;
|
|
798
|
+
}
|
|
799
|
+
function n(d) {
|
|
800
|
+
var _ = [], c = 0, f, g, R, S, x;
|
|
801
|
+
function l() {
|
|
802
|
+
for (; c < d.length && /\s/.test(d.charAt(c)); )
|
|
803
|
+
c += 1;
|
|
804
|
+
return c < d.length;
|
|
805
|
+
}
|
|
806
|
+
function b() {
|
|
807
|
+
return g = d.charAt(c), g !== "=" && g !== ";" && g !== ",";
|
|
808
|
+
}
|
|
809
|
+
for (; c < d.length; ) {
|
|
810
|
+
for (f = c, x = !1; l(); )
|
|
811
|
+
if (g = d.charAt(c), g === ",") {
|
|
812
|
+
for (R = c, c += 1, l(), S = c; c < d.length && b(); )
|
|
813
|
+
c += 1;
|
|
814
|
+
c < d.length && d.charAt(c) === "=" ? (x = !0, c = S, _.push(d.substring(f, R)), f = c) : c = R + 1;
|
|
815
|
+
} else
|
|
816
|
+
c += 1;
|
|
817
|
+
(!x || c >= d.length) && _.push(d.substring(f, d.length));
|
|
818
|
+
}
|
|
819
|
+
return _;
|
|
820
|
+
}
|
|
821
|
+
function a(d) {
|
|
822
|
+
const _ = {}, c = [];
|
|
823
|
+
if (d)
|
|
824
|
+
for (const [f, g] of d.entries())
|
|
825
|
+
f.toLowerCase() === "set-cookie" ? (c.push(...n(g)), _[f] = c.length === 1 ? c[0] : c) : _[f] = g;
|
|
826
|
+
return _;
|
|
827
|
+
}
|
|
828
|
+
function u(d) {
|
|
829
|
+
try {
|
|
830
|
+
return String(new URL(String(d)));
|
|
831
|
+
} catch (_) {
|
|
832
|
+
throw new Error(`URL is malformed "${String(d)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`, {
|
|
833
|
+
cause: _
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
function r(d, _) {
|
|
838
|
+
const c = [
|
|
839
|
+
t.NEXT_QUERY_PARAM_PREFIX,
|
|
840
|
+
t.NEXT_INTERCEPTION_MARKER_PREFIX
|
|
841
|
+
];
|
|
842
|
+
for (const f of c)
|
|
843
|
+
if (d !== f && d.startsWith(f)) {
|
|
844
|
+
const g = d.substring(f.length);
|
|
845
|
+
_(g);
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
})(je)), je;
|
|
849
|
+
}
|
|
850
|
+
var He = {}, Pt;
|
|
851
|
+
function sr() {
|
|
852
|
+
return Pt || (Pt = 1, (function(i) {
|
|
853
|
+
Object.defineProperty(i, "__esModule", {
|
|
854
|
+
value: !0
|
|
855
|
+
});
|
|
856
|
+
function e(a, u) {
|
|
857
|
+
for (var r in u) Object.defineProperty(a, r, {
|
|
858
|
+
enumerable: !0,
|
|
859
|
+
get: u[r]
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
e(i, {
|
|
863
|
+
PageSignatureError: function() {
|
|
864
|
+
return t;
|
|
865
|
+
},
|
|
866
|
+
RemovedPageError: function() {
|
|
867
|
+
return o;
|
|
868
|
+
},
|
|
869
|
+
RemovedUAError: function() {
|
|
870
|
+
return n;
|
|
871
|
+
}
|
|
872
|
+
});
|
|
873
|
+
class t extends Error {
|
|
874
|
+
constructor({ page: u }) {
|
|
875
|
+
super(`The middleware "${u}" accepts an async API directly with the form:
|
|
876
|
+
|
|
877
|
+
export function middleware(request, event) {
|
|
878
|
+
return NextResponse.redirect('/new-location')
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
Read more: https://nextjs.org/docs/messages/middleware-new-signature
|
|
882
|
+
`);
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
class o extends Error {
|
|
886
|
+
constructor() {
|
|
887
|
+
super("The request.page has been deprecated in favour of `URLPattern`.\n Read more: https://nextjs.org/docs/messages/middleware-request-page\n ");
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
class n extends Error {
|
|
891
|
+
constructor() {
|
|
892
|
+
super("The request.ua has been removed in favour of `userAgent` function.\n Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent\n ");
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
})(He)), He;
|
|
896
|
+
}
|
|
897
|
+
var Fe = {}, Be, yt;
|
|
898
|
+
function ar() {
|
|
899
|
+
if (yt) return Be;
|
|
900
|
+
yt = 1;
|
|
901
|
+
var i = Object.defineProperty, e = Object.getOwnPropertyDescriptor, t = Object.getOwnPropertyNames, o = Object.prototype.hasOwnProperty, n = (s, v) => {
|
|
902
|
+
for (var p in v)
|
|
903
|
+
i(s, p, { get: v[p], enumerable: !0 });
|
|
904
|
+
}, a = (s, v, p, w) => {
|
|
905
|
+
if (v && typeof v == "object" || typeof v == "function")
|
|
906
|
+
for (let P of t(v))
|
|
907
|
+
!o.call(s, P) && P !== p && i(s, P, { get: () => v[P], enumerable: !(w = e(v, P)) || w.enumerable });
|
|
908
|
+
return s;
|
|
909
|
+
}, u = (s) => a(i({}, "__esModule", { value: !0 }), s), r = {};
|
|
910
|
+
n(r, {
|
|
911
|
+
RequestCookies: () => b,
|
|
912
|
+
ResponseCookies: () => h,
|
|
913
|
+
parseCookie: () => _,
|
|
914
|
+
parseSetCookie: () => c,
|
|
915
|
+
stringifyCookie: () => d
|
|
916
|
+
}), Be = u(r);
|
|
917
|
+
function d(s) {
|
|
918
|
+
var v;
|
|
919
|
+
const p = [
|
|
920
|
+
"path" in s && s.path && `Path=${s.path}`,
|
|
921
|
+
"expires" in s && (s.expires || s.expires === 0) && `Expires=${(typeof s.expires == "number" ? new Date(s.expires) : s.expires).toUTCString()}`,
|
|
922
|
+
"maxAge" in s && typeof s.maxAge == "number" && `Max-Age=${s.maxAge}`,
|
|
923
|
+
"domain" in s && s.domain && `Domain=${s.domain}`,
|
|
924
|
+
"secure" in s && s.secure && "Secure",
|
|
925
|
+
"httpOnly" in s && s.httpOnly && "HttpOnly",
|
|
926
|
+
"sameSite" in s && s.sameSite && `SameSite=${s.sameSite}`,
|
|
927
|
+
"partitioned" in s && s.partitioned && "Partitioned",
|
|
928
|
+
"priority" in s && s.priority && `Priority=${s.priority}`
|
|
929
|
+
].filter(Boolean), w = `${s.name}=${encodeURIComponent((v = s.value) != null ? v : "")}`;
|
|
930
|
+
return p.length === 0 ? w : `${w}; ${p.join("; ")}`;
|
|
931
|
+
}
|
|
932
|
+
function _(s) {
|
|
933
|
+
const v = /* @__PURE__ */ new Map();
|
|
934
|
+
for (const p of s.split(/; */)) {
|
|
935
|
+
if (!p)
|
|
936
|
+
continue;
|
|
937
|
+
const w = p.indexOf("=");
|
|
938
|
+
if (w === -1) {
|
|
939
|
+
v.set(p, "true");
|
|
940
|
+
continue;
|
|
941
|
+
}
|
|
942
|
+
const [P, N] = [p.slice(0, w), p.slice(w + 1)];
|
|
943
|
+
try {
|
|
944
|
+
v.set(P, decodeURIComponent(N ?? "true"));
|
|
945
|
+
} catch {
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
return v;
|
|
949
|
+
}
|
|
950
|
+
function c(s) {
|
|
951
|
+
if (!s)
|
|
952
|
+
return;
|
|
953
|
+
const [[v, p], ...w] = _(s), {
|
|
954
|
+
domain: P,
|
|
955
|
+
expires: N,
|
|
956
|
+
httponly: M,
|
|
957
|
+
maxage: D,
|
|
958
|
+
path: H,
|
|
959
|
+
samesite: j,
|
|
960
|
+
secure: J,
|
|
961
|
+
partitioned: Q,
|
|
962
|
+
priority: F
|
|
963
|
+
} = Object.fromEntries(
|
|
964
|
+
w.map(([ie, z]) => [ie.toLowerCase(), z])
|
|
965
|
+
), W = {
|
|
966
|
+
name: v,
|
|
967
|
+
value: decodeURIComponent(p),
|
|
968
|
+
domain: P,
|
|
969
|
+
...N && { expires: new Date(N) },
|
|
970
|
+
...M && { httpOnly: !0 },
|
|
971
|
+
...typeof D == "string" && { maxAge: Number(D) },
|
|
972
|
+
path: H,
|
|
973
|
+
...j && { sameSite: R(j) },
|
|
974
|
+
...J && { secure: !0 },
|
|
975
|
+
...F && { priority: x(F) },
|
|
976
|
+
...Q && { partitioned: !0 }
|
|
977
|
+
};
|
|
978
|
+
return f(W);
|
|
979
|
+
}
|
|
980
|
+
function f(s) {
|
|
981
|
+
const v = {};
|
|
982
|
+
for (const p in s)
|
|
983
|
+
s[p] && (v[p] = s[p]);
|
|
984
|
+
return v;
|
|
985
|
+
}
|
|
986
|
+
var g = ["strict", "lax", "none"];
|
|
987
|
+
function R(s) {
|
|
988
|
+
return s = s.toLowerCase(), g.includes(s) ? s : void 0;
|
|
989
|
+
}
|
|
990
|
+
var S = ["low", "medium", "high"];
|
|
991
|
+
function x(s) {
|
|
992
|
+
return s = s.toLowerCase(), S.includes(s) ? s : void 0;
|
|
993
|
+
}
|
|
994
|
+
function l(s) {
|
|
995
|
+
if (!s)
|
|
996
|
+
return [];
|
|
997
|
+
var v = [], p = 0, w, P, N, M, D;
|
|
998
|
+
function H() {
|
|
999
|
+
for (; p < s.length && /\s/.test(s.charAt(p)); )
|
|
1000
|
+
p += 1;
|
|
1001
|
+
return p < s.length;
|
|
1002
|
+
}
|
|
1003
|
+
function j() {
|
|
1004
|
+
return P = s.charAt(p), P !== "=" && P !== ";" && P !== ",";
|
|
1005
|
+
}
|
|
1006
|
+
for (; p < s.length; ) {
|
|
1007
|
+
for (w = p, D = !1; H(); )
|
|
1008
|
+
if (P = s.charAt(p), P === ",") {
|
|
1009
|
+
for (N = p, p += 1, H(), M = p; p < s.length && j(); )
|
|
1010
|
+
p += 1;
|
|
1011
|
+
p < s.length && s.charAt(p) === "=" ? (D = !0, p = M, v.push(s.substring(w, N)), w = p) : p = N + 1;
|
|
1012
|
+
} else
|
|
1013
|
+
p += 1;
|
|
1014
|
+
(!D || p >= s.length) && v.push(s.substring(w, s.length));
|
|
1015
|
+
}
|
|
1016
|
+
return v;
|
|
1017
|
+
}
|
|
1018
|
+
var b = class {
|
|
1019
|
+
constructor(s) {
|
|
1020
|
+
this._parsed = /* @__PURE__ */ new Map(), this._headers = s;
|
|
1021
|
+
const v = s.get("cookie");
|
|
1022
|
+
if (v) {
|
|
1023
|
+
const p = _(v);
|
|
1024
|
+
for (const [w, P] of p)
|
|
1025
|
+
this._parsed.set(w, { name: w, value: P });
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
[Symbol.iterator]() {
|
|
1029
|
+
return this._parsed[Symbol.iterator]();
|
|
1030
|
+
}
|
|
1031
|
+
/**
|
|
1032
|
+
* The amount of cookies received from the client
|
|
1033
|
+
*/
|
|
1034
|
+
get size() {
|
|
1035
|
+
return this._parsed.size;
|
|
1036
|
+
}
|
|
1037
|
+
get(...s) {
|
|
1038
|
+
const v = typeof s[0] == "string" ? s[0] : s[0].name;
|
|
1039
|
+
return this._parsed.get(v);
|
|
1040
|
+
}
|
|
1041
|
+
getAll(...s) {
|
|
1042
|
+
var v;
|
|
1043
|
+
const p = Array.from(this._parsed);
|
|
1044
|
+
if (!s.length)
|
|
1045
|
+
return p.map(([P, N]) => N);
|
|
1046
|
+
const w = typeof s[0] == "string" ? s[0] : (v = s[0]) == null ? void 0 : v.name;
|
|
1047
|
+
return p.filter(([P]) => P === w).map(([P, N]) => N);
|
|
1048
|
+
}
|
|
1049
|
+
has(s) {
|
|
1050
|
+
return this._parsed.has(s);
|
|
1051
|
+
}
|
|
1052
|
+
set(...s) {
|
|
1053
|
+
const [v, p] = s.length === 1 ? [s[0].name, s[0].value] : s, w = this._parsed;
|
|
1054
|
+
return w.set(v, { name: v, value: p }), this._headers.set(
|
|
1055
|
+
"cookie",
|
|
1056
|
+
Array.from(w).map(([P, N]) => d(N)).join("; ")
|
|
1057
|
+
), this;
|
|
1058
|
+
}
|
|
1059
|
+
/**
|
|
1060
|
+
* Delete the cookies matching the passed name or names in the request.
|
|
1061
|
+
*/
|
|
1062
|
+
delete(s) {
|
|
1063
|
+
const v = this._parsed, p = Array.isArray(s) ? s.map((w) => v.delete(w)) : v.delete(s);
|
|
1064
|
+
return this._headers.set(
|
|
1065
|
+
"cookie",
|
|
1066
|
+
Array.from(v).map(([w, P]) => d(P)).join("; ")
|
|
1067
|
+
), p;
|
|
1068
|
+
}
|
|
1069
|
+
/**
|
|
1070
|
+
* Delete all the cookies in the cookies in the request.
|
|
1071
|
+
*/
|
|
1072
|
+
clear() {
|
|
1073
|
+
return this.delete(Array.from(this._parsed.keys())), this;
|
|
1074
|
+
}
|
|
1075
|
+
/**
|
|
1076
|
+
* Format the cookies in the request as a string for logging
|
|
1077
|
+
*/
|
|
1078
|
+
[/* @__PURE__ */ Symbol.for("edge-runtime.inspect.custom")]() {
|
|
1079
|
+
return `RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`;
|
|
1080
|
+
}
|
|
1081
|
+
toString() {
|
|
1082
|
+
return [...this._parsed.values()].map((s) => `${s.name}=${encodeURIComponent(s.value)}`).join("; ");
|
|
1083
|
+
}
|
|
1084
|
+
}, h = class {
|
|
1085
|
+
constructor(s) {
|
|
1086
|
+
this._parsed = /* @__PURE__ */ new Map();
|
|
1087
|
+
var v, p, w;
|
|
1088
|
+
this._headers = s;
|
|
1089
|
+
const P = (w = (p = (v = s.getSetCookie) == null ? void 0 : v.call(s)) != null ? p : s.get("set-cookie")) != null ? w : [], N = Array.isArray(P) ? P : l(P);
|
|
1090
|
+
for (const M of N) {
|
|
1091
|
+
const D = c(M);
|
|
1092
|
+
D && this._parsed.set(D.name, D);
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
/**
|
|
1096
|
+
* {@link https://wicg.github.io/cookie-store/#CookieStore-get CookieStore#get} without the Promise.
|
|
1097
|
+
*/
|
|
1098
|
+
get(...s) {
|
|
1099
|
+
const v = typeof s[0] == "string" ? s[0] : s[0].name;
|
|
1100
|
+
return this._parsed.get(v);
|
|
1101
|
+
}
|
|
1102
|
+
/**
|
|
1103
|
+
* {@link https://wicg.github.io/cookie-store/#CookieStore-getAll CookieStore#getAll} without the Promise.
|
|
1104
|
+
*/
|
|
1105
|
+
getAll(...s) {
|
|
1106
|
+
var v;
|
|
1107
|
+
const p = Array.from(this._parsed.values());
|
|
1108
|
+
if (!s.length)
|
|
1109
|
+
return p;
|
|
1110
|
+
const w = typeof s[0] == "string" ? s[0] : (v = s[0]) == null ? void 0 : v.name;
|
|
1111
|
+
return p.filter((P) => P.name === w);
|
|
1112
|
+
}
|
|
1113
|
+
has(s) {
|
|
1114
|
+
return this._parsed.has(s);
|
|
1115
|
+
}
|
|
1116
|
+
/**
|
|
1117
|
+
* {@link https://wicg.github.io/cookie-store/#CookieStore-set CookieStore#set} without the Promise.
|
|
1118
|
+
*/
|
|
1119
|
+
set(...s) {
|
|
1120
|
+
const [v, p, w] = s.length === 1 ? [s[0].name, s[0].value, s[0]] : s, P = this._parsed;
|
|
1121
|
+
return P.set(v, E({ name: v, value: p, ...w })), m(P, this._headers), this;
|
|
1122
|
+
}
|
|
1123
|
+
/**
|
|
1124
|
+
* {@link https://wicg.github.io/cookie-store/#CookieStore-delete CookieStore#delete} without the Promise.
|
|
1125
|
+
*/
|
|
1126
|
+
delete(...s) {
|
|
1127
|
+
const [v, p, w] = typeof s[0] == "string" ? [s[0]] : [s[0].name, s[0].path, s[0].domain];
|
|
1128
|
+
return this.set({ name: v, path: p, domain: w, value: "", expires: /* @__PURE__ */ new Date(0) });
|
|
1129
|
+
}
|
|
1130
|
+
[/* @__PURE__ */ Symbol.for("edge-runtime.inspect.custom")]() {
|
|
1131
|
+
return `ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`;
|
|
1132
|
+
}
|
|
1133
|
+
toString() {
|
|
1134
|
+
return [...this._parsed.values()].map(d).join("; ");
|
|
1135
|
+
}
|
|
1136
|
+
};
|
|
1137
|
+
function m(s, v) {
|
|
1138
|
+
v.delete("set-cookie");
|
|
1139
|
+
for (const [, p] of s) {
|
|
1140
|
+
const w = d(p);
|
|
1141
|
+
v.append("set-cookie", w);
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
function E(s = { name: "", value: "" }) {
|
|
1145
|
+
return typeof s.expires == "number" && (s.expires = new Date(s.expires)), s.maxAge && (s.expires = new Date(Date.now() + s.maxAge * 1e3)), (s.path === null || s.path === void 0) && (s.path = "/"), s;
|
|
1146
|
+
}
|
|
1147
|
+
return Be;
|
|
1148
|
+
}
|
|
1149
|
+
var St;
|
|
1150
|
+
function $e() {
|
|
1151
|
+
return St || (St = 1, (function(i) {
|
|
1152
|
+
Object.defineProperty(i, "__esModule", {
|
|
1153
|
+
value: !0
|
|
1154
|
+
});
|
|
1155
|
+
function e(o, n) {
|
|
1156
|
+
for (var a in n) Object.defineProperty(o, a, {
|
|
1157
|
+
enumerable: !0,
|
|
1158
|
+
get: n[a]
|
|
1159
|
+
});
|
|
1160
|
+
}
|
|
1161
|
+
e(i, {
|
|
1162
|
+
RequestCookies: function() {
|
|
1163
|
+
return t.RequestCookies;
|
|
1164
|
+
},
|
|
1165
|
+
ResponseCookies: function() {
|
|
1166
|
+
return t.ResponseCookies;
|
|
1167
|
+
},
|
|
1168
|
+
stringifyCookie: function() {
|
|
1169
|
+
return t.stringifyCookie;
|
|
1170
|
+
}
|
|
1171
|
+
});
|
|
1172
|
+
const t = ar();
|
|
1173
|
+
})(Fe)), Fe;
|
|
1174
|
+
}
|
|
1175
|
+
var At;
|
|
1176
|
+
function ur() {
|
|
1177
|
+
return At || (At = 1, (function(i) {
|
|
1178
|
+
Object.defineProperty(i, "__esModule", {
|
|
1179
|
+
value: !0
|
|
1180
|
+
});
|
|
1181
|
+
function e(d, _) {
|
|
1182
|
+
for (var c in _) Object.defineProperty(d, c, {
|
|
1183
|
+
enumerable: !0,
|
|
1184
|
+
get: _[c]
|
|
1185
|
+
});
|
|
1186
|
+
}
|
|
1187
|
+
e(i, {
|
|
1188
|
+
INTERNALS: function() {
|
|
1189
|
+
return u;
|
|
1190
|
+
},
|
|
1191
|
+
NextRequest: function() {
|
|
1192
|
+
return r;
|
|
1193
|
+
}
|
|
1194
|
+
});
|
|
1195
|
+
const t = jt(), o = qt(), n = sr(), a = $e(), u = /* @__PURE__ */ Symbol("internal request");
|
|
1196
|
+
class r extends Request {
|
|
1197
|
+
constructor(_, c = {}) {
|
|
1198
|
+
const f = typeof _ != "string" && "url" in _ ? _.url : String(_);
|
|
1199
|
+
(0, o.validateURL)(f), _ instanceof Request ? super(_, c) : super(f, c);
|
|
1200
|
+
const g = new t.NextURL(f, {
|
|
1201
|
+
headers: (0, o.toNodeOutgoingHttpHeaders)(this.headers),
|
|
1202
|
+
nextConfig: c.nextConfig
|
|
1203
|
+
});
|
|
1204
|
+
this[u] = {
|
|
1205
|
+
cookies: new a.RequestCookies(this.headers),
|
|
1206
|
+
geo: c.geo || {},
|
|
1207
|
+
ip: c.ip,
|
|
1208
|
+
nextUrl: g,
|
|
1209
|
+
url: process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE ? f : g.toString()
|
|
1210
|
+
};
|
|
1211
|
+
}
|
|
1212
|
+
[/* @__PURE__ */ Symbol.for("edge-runtime.inspect.custom")]() {
|
|
1213
|
+
return {
|
|
1214
|
+
cookies: this.cookies,
|
|
1215
|
+
geo: this.geo,
|
|
1216
|
+
ip: this.ip,
|
|
1217
|
+
nextUrl: this.nextUrl,
|
|
1218
|
+
url: this.url,
|
|
1219
|
+
// rest of props come from Request
|
|
1220
|
+
bodyUsed: this.bodyUsed,
|
|
1221
|
+
cache: this.cache,
|
|
1222
|
+
credentials: this.credentials,
|
|
1223
|
+
destination: this.destination,
|
|
1224
|
+
headers: Object.fromEntries(this.headers),
|
|
1225
|
+
integrity: this.integrity,
|
|
1226
|
+
keepalive: this.keepalive,
|
|
1227
|
+
method: this.method,
|
|
1228
|
+
mode: this.mode,
|
|
1229
|
+
redirect: this.redirect,
|
|
1230
|
+
referrer: this.referrer,
|
|
1231
|
+
referrerPolicy: this.referrerPolicy,
|
|
1232
|
+
signal: this.signal
|
|
1233
|
+
};
|
|
1234
|
+
}
|
|
1235
|
+
get cookies() {
|
|
1236
|
+
return this[u].cookies;
|
|
1237
|
+
}
|
|
1238
|
+
get geo() {
|
|
1239
|
+
return this[u].geo;
|
|
1240
|
+
}
|
|
1241
|
+
get ip() {
|
|
1242
|
+
return this[u].ip;
|
|
1243
|
+
}
|
|
1244
|
+
get nextUrl() {
|
|
1245
|
+
return this[u].nextUrl;
|
|
1246
|
+
}
|
|
1247
|
+
/**
|
|
1248
|
+
* @deprecated
|
|
1249
|
+
* `page` has been deprecated in favour of `URLPattern`.
|
|
1250
|
+
* Read more: https://nextjs.org/docs/messages/middleware-request-page
|
|
1251
|
+
*/
|
|
1252
|
+
get page() {
|
|
1253
|
+
throw new n.RemovedPageError();
|
|
1254
|
+
}
|
|
1255
|
+
/**
|
|
1256
|
+
* @deprecated
|
|
1257
|
+
* `ua` has been removed in favour of \`userAgent\` function.
|
|
1258
|
+
* Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
|
|
1259
|
+
*/
|
|
1260
|
+
get ua() {
|
|
1261
|
+
throw new n.RemovedUAError();
|
|
1262
|
+
}
|
|
1263
|
+
get url() {
|
|
1264
|
+
return this[u].url;
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
})(ye)), ye;
|
|
1268
|
+
}
|
|
1269
|
+
var Ge = {}, Xe = {}, Tt;
|
|
1270
|
+
function cr() {
|
|
1271
|
+
return Tt || (Tt = 1, (function(i) {
|
|
1272
|
+
Object.defineProperty(i, "__esModule", {
|
|
1273
|
+
value: !0
|
|
1274
|
+
}), Object.defineProperty(i, "ReflectAdapter", {
|
|
1275
|
+
enumerable: !0,
|
|
1276
|
+
get: function() {
|
|
1277
|
+
return e;
|
|
1278
|
+
}
|
|
1279
|
+
});
|
|
1280
|
+
class e {
|
|
1281
|
+
static get(o, n, a) {
|
|
1282
|
+
const u = Reflect.get(o, n, a);
|
|
1283
|
+
return typeof u == "function" ? u.bind(o) : u;
|
|
1284
|
+
}
|
|
1285
|
+
static set(o, n, a, u) {
|
|
1286
|
+
return Reflect.set(o, n, a, u);
|
|
1287
|
+
}
|
|
1288
|
+
static has(o, n) {
|
|
1289
|
+
return Reflect.has(o, n);
|
|
1290
|
+
}
|
|
1291
|
+
static deleteProperty(o, n) {
|
|
1292
|
+
return Reflect.deleteProperty(o, n);
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
})(Xe)), Xe;
|
|
1296
|
+
}
|
|
1297
|
+
var It;
|
|
1298
|
+
function lr() {
|
|
1299
|
+
return It || (It = 1, (function(i) {
|
|
1300
|
+
Object.defineProperty(i, "__esModule", {
|
|
1301
|
+
value: !0
|
|
1302
|
+
}), Object.defineProperty(i, "NextResponse", {
|
|
1303
|
+
enumerable: !0,
|
|
1304
|
+
get: function() {
|
|
1305
|
+
return _;
|
|
1306
|
+
}
|
|
1307
|
+
});
|
|
1308
|
+
const e = $e(), t = jt(), o = qt(), n = cr(), a = $e(), u = /* @__PURE__ */ Symbol("internal response"), r = /* @__PURE__ */ new Set([
|
|
1309
|
+
301,
|
|
1310
|
+
302,
|
|
1311
|
+
303,
|
|
1312
|
+
307,
|
|
1313
|
+
308
|
|
1314
|
+
]);
|
|
1315
|
+
function d(c, f) {
|
|
1316
|
+
var g;
|
|
1317
|
+
if (!(c == null || (g = c.request) == null) && g.headers) {
|
|
1318
|
+
if (!(c.request.headers instanceof Headers))
|
|
1319
|
+
throw new Error("request.headers must be an instance of Headers");
|
|
1320
|
+
const R = [];
|
|
1321
|
+
for (const [S, x] of c.request.headers)
|
|
1322
|
+
f.set("x-middleware-request-" + S, x), R.push(S);
|
|
1323
|
+
f.set("x-middleware-override-headers", R.join(","));
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
class _ extends Response {
|
|
1327
|
+
constructor(f, g = {}) {
|
|
1328
|
+
super(f, g);
|
|
1329
|
+
const R = this.headers, S = new a.ResponseCookies(R), x = new Proxy(S, {
|
|
1330
|
+
get(l, b, h) {
|
|
1331
|
+
switch (b) {
|
|
1332
|
+
case "delete":
|
|
1333
|
+
case "set":
|
|
1334
|
+
return (...m) => {
|
|
1335
|
+
const E = Reflect.apply(l[b], l, m), s = new Headers(R);
|
|
1336
|
+
return E instanceof a.ResponseCookies && R.set("x-middleware-set-cookie", E.getAll().map((v) => (0, e.stringifyCookie)(v)).join(",")), d(g, s), E;
|
|
1337
|
+
};
|
|
1338
|
+
default:
|
|
1339
|
+
return n.ReflectAdapter.get(l, b, h);
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
});
|
|
1343
|
+
this[u] = {
|
|
1344
|
+
cookies: x,
|
|
1345
|
+
url: g.url ? new t.NextURL(g.url, {
|
|
1346
|
+
headers: (0, o.toNodeOutgoingHttpHeaders)(R),
|
|
1347
|
+
nextConfig: g.nextConfig
|
|
1348
|
+
}) : void 0
|
|
1349
|
+
};
|
|
1350
|
+
}
|
|
1351
|
+
[/* @__PURE__ */ Symbol.for("edge-runtime.inspect.custom")]() {
|
|
1352
|
+
return {
|
|
1353
|
+
cookies: this.cookies,
|
|
1354
|
+
url: this.url,
|
|
1355
|
+
// rest of props come from Response
|
|
1356
|
+
body: this.body,
|
|
1357
|
+
bodyUsed: this.bodyUsed,
|
|
1358
|
+
headers: Object.fromEntries(this.headers),
|
|
1359
|
+
ok: this.ok,
|
|
1360
|
+
redirected: this.redirected,
|
|
1361
|
+
status: this.status,
|
|
1362
|
+
statusText: this.statusText,
|
|
1363
|
+
type: this.type
|
|
1364
|
+
};
|
|
1365
|
+
}
|
|
1366
|
+
get cookies() {
|
|
1367
|
+
return this[u].cookies;
|
|
1368
|
+
}
|
|
1369
|
+
static json(f, g) {
|
|
1370
|
+
const R = Response.json(f, g);
|
|
1371
|
+
return new _(R.body, R);
|
|
1372
|
+
}
|
|
1373
|
+
static redirect(f, g) {
|
|
1374
|
+
const R = typeof g == "number" ? g : g?.status ?? 307;
|
|
1375
|
+
if (!r.has(R))
|
|
1376
|
+
throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');
|
|
1377
|
+
const S = typeof g == "object" ? g : {}, x = new Headers(S?.headers);
|
|
1378
|
+
return x.set("Location", (0, o.validateURL)(f)), new _(null, {
|
|
1379
|
+
...S,
|
|
1380
|
+
headers: x,
|
|
1381
|
+
status: R
|
|
1382
|
+
});
|
|
1383
|
+
}
|
|
1384
|
+
static rewrite(f, g) {
|
|
1385
|
+
const R = new Headers(g?.headers);
|
|
1386
|
+
return R.set("x-middleware-rewrite", (0, o.validateURL)(f)), d(g, R), new _(null, {
|
|
1387
|
+
...g,
|
|
1388
|
+
headers: R
|
|
1389
|
+
});
|
|
1390
|
+
}
|
|
1391
|
+
static next(f) {
|
|
1392
|
+
const g = new Headers(f?.headers);
|
|
1393
|
+
return g.set("x-middleware-next", "1"), d(f, g), new _(null, {
|
|
1394
|
+
...f,
|
|
1395
|
+
headers: g
|
|
1396
|
+
});
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
})(Ge)), Ge;
|
|
1400
|
+
}
|
|
1401
|
+
var We = {}, Ot;
|
|
1402
|
+
function dr() {
|
|
1403
|
+
return Ot || (Ot = 1, (function(i) {
|
|
1404
|
+
Object.defineProperty(i, "__esModule", {
|
|
1405
|
+
value: !0
|
|
1406
|
+
}), Object.defineProperty(i, "ImageResponse", {
|
|
1407
|
+
enumerable: !0,
|
|
1408
|
+
get: function() {
|
|
1409
|
+
return e;
|
|
1410
|
+
}
|
|
1411
|
+
});
|
|
1412
|
+
function e() {
|
|
1413
|
+
throw new Error('ImageResponse moved from "next/server" to "next/og" since Next.js 14, please import from "next/og" instead');
|
|
1414
|
+
}
|
|
1415
|
+
})(We)), We;
|
|
1416
|
+
}
|
|
1417
|
+
var ze = {}, Ve = { exports: {} }, xt;
|
|
1418
|
+
function hr() {
|
|
1419
|
+
return xt || (xt = 1, (() => {
|
|
1420
|
+
var i = { 226: function(n, a) {
|
|
1421
|
+
(function(u, r) {
|
|
1422
|
+
var d = "1.0.35", _ = "", c = "?", f = "function", g = "undefined", R = "object", S = "string", x = "major", l = "model", b = "name", h = "type", m = "vendor", E = "version", s = "architecture", v = "console", p = "mobile", w = "tablet", P = "smarttv", N = "wearable", M = "embedded", D = 350, H = "Amazon", j = "Apple", J = "ASUS", Q = "BlackBerry", F = "Browser", W = "Chrome", ie = "Edge", z = "Firefox", Z = "Google", de = "Huawei", oe = "LG", se = "Microsoft", he = "Motorola", ee = "Opera", ae = "Samsung", fe = "Sharp", te = "Sony", ue = "Xiaomi", L = "Zebra", pe = "Facebook", me = "Chromium OS", _e = "Mac OS", ge = function(T, O) {
|
|
1423
|
+
var A = {};
|
|
1424
|
+
for (var C in T)
|
|
1425
|
+
O[C] && O[C].length % 2 === 0 ? A[C] = O[C].concat(T[C]) : A[C] = T[C];
|
|
1426
|
+
return A;
|
|
1427
|
+
}, $ = function(T) {
|
|
1428
|
+
for (var O = {}, A = 0; A < T.length; A++)
|
|
1429
|
+
O[T[A].toUpperCase()] = T[A];
|
|
1430
|
+
return O;
|
|
1431
|
+
}, rt = function(T, O) {
|
|
1432
|
+
return typeof T === S ? ce(O).indexOf(ce(T)) !== -1 : !1;
|
|
1433
|
+
}, ce = function(T) {
|
|
1434
|
+
return T.toLowerCase();
|
|
1435
|
+
}, Xt = function(T) {
|
|
1436
|
+
return typeof T === S ? T.replace(/[^\d\.]/g, _).split(".")[0] : r;
|
|
1437
|
+
}, ve = function(T, O) {
|
|
1438
|
+
if (typeof T === S)
|
|
1439
|
+
return T = T.replace(/^\s\s*/, _), typeof O === g ? T : T.substring(0, D);
|
|
1440
|
+
}, le = function(T, O) {
|
|
1441
|
+
for (var A = 0, C, V, B, I, y, G; A < O.length && !y; ) {
|
|
1442
|
+
var Pe = O[A], ot = O[A + 1];
|
|
1443
|
+
for (C = V = 0; C < Pe.length && !y && Pe[C]; )
|
|
1444
|
+
if (y = Pe[C++].exec(T), y)
|
|
1445
|
+
for (B = 0; B < ot.length; B++)
|
|
1446
|
+
G = y[++V], I = ot[B], typeof I === R && I.length > 0 ? I.length === 2 ? typeof I[1] == f ? this[I[0]] = I[1].call(this, G) : this[I[0]] = I[1] : I.length === 3 ? typeof I[1] === f && !(I[1].exec && I[1].test) ? this[I[0]] = G ? I[1].call(this, G, I[2]) : r : this[I[0]] = G ? G.replace(I[1], I[2]) : r : I.length === 4 && (this[I[0]] = G ? I[3].call(this, G.replace(I[1], I[2])) : r) : this[I] = G || r;
|
|
1447
|
+
A += 2;
|
|
1448
|
+
}
|
|
1449
|
+
}, Re = function(T, O) {
|
|
1450
|
+
for (var A in O)
|
|
1451
|
+
if (typeof O[A] === R && O[A].length > 0) {
|
|
1452
|
+
for (var C = 0; C < O[A].length; C++)
|
|
1453
|
+
if (rt(O[A][C], T))
|
|
1454
|
+
return A === c ? r : A;
|
|
1455
|
+
} else if (rt(O[A], T))
|
|
1456
|
+
return A === c ? r : A;
|
|
1457
|
+
return T;
|
|
1458
|
+
}, Wt = { "1.0": "/8", 1.2: "/1", 1.3: "/3", "2.0": "/412", "2.0.2": "/416", "2.0.3": "/417", "2.0.4": "/419", "?": "/" }, nt = { ME: "4.90", "NT 3.11": "NT3.51", "NT 4.0": "NT4.0", 2e3: "NT 5.0", XP: ["NT 5.1", "NT 5.2"], Vista: "NT 6.0", 7: "NT 6.1", 8: "NT 6.2", 8.1: "NT 6.3", 10: ["NT 6.4", "NT 10.0"], RT: "ARM" }, it = { browser: [[/\b(?:crmo|crios)\/([\w\.]+)/i], [E, [b, "Chrome"]], [/edg(?:e|ios|a)?\/([\w\.]+)/i], [E, [b, "Edge"]], [/(opera mini)\/([-\w\.]+)/i, /(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i, /(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i], [b, E], [/opios[\/ ]+([\w\.]+)/i], [E, [b, ee + " Mini"]], [/\bopr\/([\w\.]+)/i], [E, [b, ee]], [/(kindle)\/([\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i, /(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i, /(ba?idubrowser)[\/ ]?([\w\.]+)/i, /(?:ms|\()(ie) ([\w\.]+)/i, /(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i, /(heytap|ovi)browser\/([\d\.]+)/i, /(weibo)__([\d\.]+)/i], [b, E], [/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i], [E, [b, "UC" + F]], [/microm.+\bqbcore\/([\w\.]+)/i, /\bqbcore\/([\w\.]+).+microm/i], [E, [b, "WeChat(Win) Desktop"]], [/micromessenger\/([\w\.]+)/i], [E, [b, "WeChat"]], [/konqueror\/([\w\.]+)/i], [E, [b, "Konqueror"]], [/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i], [E, [b, "IE"]], [/ya(?:search)?browser\/([\w\.]+)/i], [E, [b, "Yandex"]], [/(avast|avg)\/([\w\.]+)/i], [[b, /(.+)/, "$1 Secure " + F], E], [/\bfocus\/([\w\.]+)/i], [E, [b, z + " Focus"]], [/\bopt\/([\w\.]+)/i], [E, [b, ee + " Touch"]], [/coc_coc\w+\/([\w\.]+)/i], [E, [b, "Coc Coc"]], [/dolfin\/([\w\.]+)/i], [E, [b, "Dolphin"]], [/coast\/([\w\.]+)/i], [E, [b, ee + " Coast"]], [/miuibrowser\/([\w\.]+)/i], [E, [b, "MIUI " + F]], [/fxios\/([-\w\.]+)/i], [E, [b, z]], [/\bqihu|(qi?ho?o?|360)browser/i], [[b, "360 " + F]], [/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i], [[b, /(.+)/, "$1 " + F], E], [/(comodo_dragon)\/([\w\.]+)/i], [[b, /_/g, " "], E], [/(electron)\/([\w\.]+) safari/i, /(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i, /m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i], [b, E], [/(metasr)[\/ ]?([\w\.]+)/i, /(lbbrowser)/i, /\[(linkedin)app\]/i], [b], [/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i], [[b, pe], E], [/(kakao(?:talk|story))[\/ ]([\w\.]+)/i, /(naver)\(.*?(\d+\.[\w\.]+).*\)/i, /safari (line)\/([\w\.]+)/i, /\b(line)\/([\w\.]+)\/iab/i, /(chromium|instagram)[\/ ]([-\w\.]+)/i], [b, E], [/\bgsa\/([\w\.]+) .*safari\//i], [E, [b, "GSA"]], [/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i], [E, [b, "TikTok"]], [/headlesschrome(?:\/([\w\.]+)| )/i], [E, [b, W + " Headless"]], [/ wv\).+(chrome)\/([\w\.]+)/i], [[b, W + " WebView"], E], [/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i], [E, [b, "Android " + F]], [/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i], [b, E], [/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i], [E, [b, "Mobile Safari"]], [/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i], [E, b], [/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i], [b, [E, Re, Wt]], [/(webkit|khtml)\/([\w\.]+)/i], [b, E], [/(navigator|netscape\d?)\/([-\w\.]+)/i], [[b, "Netscape"], E], [/mobile vr; rv:([\w\.]+)\).+firefox/i], [E, [b, z + " Reality"]], [/ekiohf.+(flow)\/([\w\.]+)/i, /(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i, /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i, /(firefox)\/([\w\.]+)/i, /(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i, /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i, /(links) \(([\w\.]+)/i, /panasonic;(viera)/i], [b, E], [/(cobalt)\/([\w\.]+)/i], [b, [E, /master.|lts./, ""]]], cpu: [[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i], [[s, "amd64"]], [/(ia32(?=;))/i], [[s, ce]], [/((?:i[346]|x)86)[;\)]/i], [[s, "ia32"]], [/\b(aarch64|arm(v?8e?l?|_?64))\b/i], [[s, "arm64"]], [/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i], [[s, "armhf"]], [/windows (ce|mobile); ppc;/i], [[s, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i], [[s, /ower/, _, ce]], [/(sun4\w)[;\)]/i], [[s, "sparc"]], [/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i], [[s, ce]]], device: [[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i], [l, [m, ae], [h, w]], [/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i, /samsung[- ]([-\w]+)/i, /sec-(sgh\w+)/i], [l, [m, ae], [h, p]], [/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i], [l, [m, j], [h, p]], [/\((ipad);[-\w\),; ]+apple/i, /applecoremedia\/[\w\.]+ \((ipad)/i, /\b(ipad)\d\d?,\d\d?[;\]].+ios/i], [l, [m, j], [h, w]], [/(macintosh);/i], [l, [m, j]], [/\b(sh-?[altvz]?\d\d[a-ekm]?)/i], [l, [m, fe], [h, p]], [/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i], [l, [m, de], [h, w]], [/(?:huawei|honor)([-\w ]+)[;\)]/i, /\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i], [l, [m, de], [h, p]], [/\b(poco[\w ]+)(?: bui|\))/i, /\b; (\w+) build\/hm\1/i, /\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i, /\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i, /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i], [[l, /_/g, " "], [m, ue], [h, p]], [/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i], [[l, /_/g, " "], [m, ue], [h, w]], [/; (\w+) bui.+ oppo/i, /\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i], [l, [m, "OPPO"], [h, p]], [/vivo (\w+)(?: bui|\))/i, /\b(v[12]\d{3}\w?[at])(?: bui|;)/i], [l, [m, "Vivo"], [h, p]], [/\b(rmx[12]\d{3})(?: bui|;|\))/i], [l, [m, "Realme"], [h, p]], [/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i, /\bmot(?:orola)?[- ](\w*)/i, /((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i], [l, [m, he], [h, p]], [/\b(mz60\d|xoom[2 ]{0,2}) build\//i], [l, [m, he], [h, w]], [/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i], [l, [m, oe], [h, w]], [/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i, /\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i, /\blg-?([\d\w]+) bui/i], [l, [m, oe], [h, p]], [/(ideatab[-\w ]+)/i, /lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i], [l, [m, "Lenovo"], [h, w]], [/(?:maemo|nokia).*(n900|lumia \d+)/i, /nokia[-_ ]?([-\w\.]*)/i], [[l, /_/g, " "], [m, "Nokia"], [h, p]], [/(pixel c)\b/i], [l, [m, Z], [h, w]], [/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i], [l, [m, Z], [h, p]], [/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i], [l, [m, te], [h, p]], [/sony tablet [ps]/i, /\b(?:sony)?sgp\w+(?: bui|\))/i], [[l, "Xperia Tablet"], [m, te], [h, w]], [/ (kb2005|in20[12]5|be20[12][59])\b/i, /(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i], [l, [m, "OnePlus"], [h, p]], [/(alexa)webm/i, /(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i, /(kf[a-z]+)( bui|\)).+silk\//i], [l, [m, H], [h, w]], [/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i], [[l, /(.+)/g, "Fire Phone $1"], [m, H], [h, p]], [/(playbook);[-\w\),; ]+(rim)/i], [l, m, [h, w]], [/\b((?:bb[a-f]|st[hv])100-\d)/i, /\(bb10; (\w+)/i], [l, [m, Q], [h, p]], [/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i], [l, [m, J], [h, w]], [/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i], [l, [m, J], [h, p]], [/(nexus 9)/i], [l, [m, "HTC"], [h, w]], [/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i, /(zte)[- ]([\w ]+?)(?: bui|\/|\))/i, /(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i], [m, [l, /_/g, " "], [h, p]], [/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i], [l, [m, "Acer"], [h, w]], [/droid.+; (m[1-5] note) bui/i, /\bmz-([-\w]{2,})/i], [l, [m, "Meizu"], [h, p]], [/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i, /(hp) ([\w ]+\w)/i, /(asus)-?(\w+)/i, /(microsoft); (lumia[\w ]+)/i, /(lenovo)[-_ ]?([-\w]+)/i, /(jolla)/i, /(oppo) ?([\w ]+) bui/i], [m, l, [h, p]], [/(kobo)\s(ereader|touch)/i, /(archos) (gamepad2?)/i, /(hp).+(touchpad(?!.+tablet)|tablet)/i, /(kindle)\/([\w\.]+)/i, /(nook)[\w ]+build\/(\w+)/i, /(dell) (strea[kpr\d ]*[\dko])/i, /(le[- ]+pan)[- ]+(\w{1,9}) bui/i, /(trinity)[- ]*(t\d{3}) bui/i, /(gigaset)[- ]+(q\w{1,9}) bui/i, /(vodafone) ([\w ]+)(?:\)| bui)/i], [m, l, [h, w]], [/(surface duo)/i], [l, [m, se], [h, w]], [/droid [\d\.]+; (fp\du?)(?: b|\))/i], [l, [m, "Fairphone"], [h, p]], [/(u304aa)/i], [l, [m, "AT&T"], [h, p]], [/\bsie-(\w*)/i], [l, [m, "Siemens"], [h, p]], [/\b(rct\w+) b/i], [l, [m, "RCA"], [h, w]], [/\b(venue[\d ]{2,7}) b/i], [l, [m, "Dell"], [h, w]], [/\b(q(?:mv|ta)\w+) b/i], [l, [m, "Verizon"], [h, w]], [/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i], [l, [m, "Barnes & Noble"], [h, w]], [/\b(tm\d{3}\w+) b/i], [l, [m, "NuVision"], [h, w]], [/\b(k88) b/i], [l, [m, "ZTE"], [h, w]], [/\b(nx\d{3}j) b/i], [l, [m, "ZTE"], [h, p]], [/\b(gen\d{3}) b.+49h/i], [l, [m, "Swiss"], [h, p]], [/\b(zur\d{3}) b/i], [l, [m, "Swiss"], [h, w]], [/\b((zeki)?tb.*\b) b/i], [l, [m, "Zeki"], [h, w]], [/\b([yr]\d{2}) b/i, /\b(dragon[- ]+touch |dt)(\w{5}) b/i], [[m, "Dragon Touch"], l, [h, w]], [/\b(ns-?\w{0,9}) b/i], [l, [m, "Insignia"], [h, w]], [/\b((nxa|next)-?\w{0,9}) b/i], [l, [m, "NextBook"], [h, w]], [/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i], [[m, "Voice"], l, [h, p]], [/\b(lvtel\-)?(v1[12]) b/i], [[m, "LvTel"], l, [h, p]], [/\b(ph-1) /i], [l, [m, "Essential"], [h, p]], [/\b(v(100md|700na|7011|917g).*\b) b/i], [l, [m, "Envizen"], [h, w]], [/\b(trio[-\w\. ]+) b/i], [l, [m, "MachSpeed"], [h, w]], [/\btu_(1491) b/i], [l, [m, "Rotor"], [h, w]], [/(shield[\w ]+) b/i], [l, [m, "Nvidia"], [h, w]], [/(sprint) (\w+)/i], [m, l, [h, p]], [/(kin\.[onetw]{3})/i], [[l, /\./g, " "], [m, se], [h, p]], [/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i], [l, [m, L], [h, w]], [/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i], [l, [m, L], [h, p]], [/smart-tv.+(samsung)/i], [m, [h, P]], [/hbbtv.+maple;(\d+)/i], [[l, /^/, "SmartTV"], [m, ae], [h, P]], [/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i], [[m, oe], [h, P]], [/(apple) ?tv/i], [m, [l, j + " TV"], [h, P]], [/crkey/i], [[l, W + "cast"], [m, Z], [h, P]], [/droid.+aft(\w)( bui|\))/i], [l, [m, H], [h, P]], [/\(dtv[\);].+(aquos)/i, /(aquos-tv[\w ]+)\)/i], [l, [m, fe], [h, P]], [/(bravia[\w ]+)( bui|\))/i], [l, [m, te], [h, P]], [/(mitv-\w{5}) bui/i], [l, [m, ue], [h, P]], [/Hbbtv.*(technisat) (.*);/i], [m, l, [h, P]], [/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i, /hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i], [[m, ve], [l, ve], [h, P]], [/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i], [[h, P]], [/(ouya)/i, /(nintendo) ([wids3utch]+)/i], [m, l, [h, v]], [/droid.+; (shield) bui/i], [l, [m, "Nvidia"], [h, v]], [/(playstation [345portablevi]+)/i], [l, [m, te], [h, v]], [/\b(xbox(?: one)?(?!; xbox))[\); ]/i], [l, [m, se], [h, v]], [/((pebble))app/i], [m, l, [h, N]], [/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i], [l, [m, j], [h, N]], [/droid.+; (glass) \d/i], [l, [m, Z], [h, N]], [/droid.+; (wt63?0{2,3})\)/i], [l, [m, L], [h, N]], [/(quest( 2| pro)?)/i], [l, [m, pe], [h, N]], [/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i], [m, [h, M]], [/(aeobc)\b/i], [l, [m, H], [h, M]], [/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i], [l, [h, p]], [/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i], [l, [h, w]], [/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i], [[h, w]], [/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i], [[h, p]], [/(android[-\w\. ]{0,9});.+buil/i], [l, [m, "Generic"]]], engine: [[/windows.+ edge\/([\w\.]+)/i], [E, [b, ie + "HTML"]], [/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i], [E, [b, "Blink"]], [/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, /ekioh(flow)\/([\w\.]+)/i, /(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, /(icab)[\/ ]([23]\.[\d\.]+)/i, /\b(libweb)/i], [b, E], [/rv\:([\w\.]{1,9})\b.+(gecko)/i], [E, b]], os: [[/microsoft (windows) (vista|xp)/i], [b, E], [/(windows) nt 6\.2; (arm)/i, /(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i, /(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i], [b, [E, Re, nt]], [/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i], [[b, "Windows"], [E, Re, nt]], [/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i, /ios;fbsv\/([\d\.]+)/i, /cfnetwork\/.+darwin/i], [[E, /_/g, "."], [b, "iOS"]], [/(mac os x) ?([\w\. ]*)/i, /(macintosh|mac_powerpc\b)(?!.+haiku)/i], [[b, _e], [E, /_/g, "."]], [/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i], [E, b], [/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i, /(blackberry)\w*\/([\w\.]*)/i, /(tizen|kaios)[\/ ]([\w\.]+)/i, /\((series40);/i], [b, E], [/\(bb(10);/i], [E, [b, Q]], [/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i], [E, [b, "Symbian"]], [/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i], [E, [b, z + " OS"]], [/web0s;.+rt(tv)/i, /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i], [E, [b, "webOS"]], [/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i], [E, [b, "watchOS"]], [/crkey\/([\d\.]+)/i], [E, [b, W + "cast"]], [/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i], [[b, me], E], [/panasonic;(viera)/i, /(netrange)mmh/i, /(nettv)\/(\d+\.[\w\.]+)/i, /(nintendo|playstation) ([wids345portablevuch]+)/i, /(xbox); +xbox ([^\);]+)/i, /\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i, /(mint)[\/\(\) ]?(\w*)/i, /(mageia|vectorlinux)[; ]/i, /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i, /(hurd|linux) ?([\w\.]*)/i, /(gnu) ?([\w\.]*)/i, /\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i, /(haiku) (\w+)/i], [b, E], [/(sunos) ?([\w\.\d]*)/i], [[b, "Solaris"], E], [/((?:open)?solaris)[-\/ ]?([\w\.]*)/i, /(aix) ((\d)(?=\.|\)| )[\w\.])*/i, /\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i, /(unix) ?([\w\.]*)/i], [b, E]] }, q = function(T, O) {
|
|
1459
|
+
if (typeof T === R && (O = T, T = r), !(this instanceof q))
|
|
1460
|
+
return new q(T, O).getResult();
|
|
1461
|
+
var A = typeof u !== g && u.navigator ? u.navigator : r, C = T || (A && A.userAgent ? A.userAgent : _), V = A && A.userAgentData ? A.userAgentData : r, B = O ? ge(it, O) : it, I = A && A.userAgent == C;
|
|
1462
|
+
return this.getBrowser = function() {
|
|
1463
|
+
var y = {};
|
|
1464
|
+
return y[b] = r, y[E] = r, le.call(y, C, B.browser), y[x] = Xt(y[E]), I && A && A.brave && typeof A.brave.isBrave == f && (y[b] = "Brave"), y;
|
|
1465
|
+
}, this.getCPU = function() {
|
|
1466
|
+
var y = {};
|
|
1467
|
+
return y[s] = r, le.call(y, C, B.cpu), y;
|
|
1468
|
+
}, this.getDevice = function() {
|
|
1469
|
+
var y = {};
|
|
1470
|
+
return y[m] = r, y[l] = r, y[h] = r, le.call(y, C, B.device), I && !y[h] && V && V.mobile && (y[h] = p), I && y[l] == "Macintosh" && A && typeof A.standalone !== g && A.maxTouchPoints && A.maxTouchPoints > 2 && (y[l] = "iPad", y[h] = w), y;
|
|
1471
|
+
}, this.getEngine = function() {
|
|
1472
|
+
var y = {};
|
|
1473
|
+
return y[b] = r, y[E] = r, le.call(y, C, B.engine), y;
|
|
1474
|
+
}, this.getOS = function() {
|
|
1475
|
+
var y = {};
|
|
1476
|
+
return y[b] = r, y[E] = r, le.call(y, C, B.os), I && !y[b] && V && V.platform != "Unknown" && (y[b] = V.platform.replace(/chrome os/i, me).replace(/macos/i, _e)), y;
|
|
1477
|
+
}, this.getResult = function() {
|
|
1478
|
+
return { ua: this.getUA(), browser: this.getBrowser(), engine: this.getEngine(), os: this.getOS(), device: this.getDevice(), cpu: this.getCPU() };
|
|
1479
|
+
}, this.getUA = function() {
|
|
1480
|
+
return C;
|
|
1481
|
+
}, this.setUA = function(y) {
|
|
1482
|
+
return C = typeof y === S && y.length > D ? ve(y, D) : y, this;
|
|
1483
|
+
}, this.setUA(C), this;
|
|
1484
|
+
};
|
|
1485
|
+
q.VERSION = d, q.BROWSER = $([b, E, x]), q.CPU = $([s]), q.DEVICE = $([l, m, h, v, p, P, w, N, M]), q.ENGINE = q.OS = $([b, E]), typeof a !== g ? (n.exports && (a = n.exports = q), a.UAParser = q) : typeof u !== g && (u.UAParser = q);
|
|
1486
|
+
var re = typeof u !== g && (u.jQuery || u.Zepto);
|
|
1487
|
+
if (re && !re.ua) {
|
|
1488
|
+
var be = new q();
|
|
1489
|
+
re.ua = be.getResult(), re.ua.get = function() {
|
|
1490
|
+
return be.getUA();
|
|
1491
|
+
}, re.ua.set = function(T) {
|
|
1492
|
+
be.setUA(T);
|
|
1493
|
+
var O = be.getResult();
|
|
1494
|
+
for (var A in O)
|
|
1495
|
+
re.ua[A] = O[A];
|
|
1496
|
+
};
|
|
1497
|
+
}
|
|
1498
|
+
})(typeof window == "object" ? window : this);
|
|
1499
|
+
} }, e = {};
|
|
1500
|
+
function t(n) {
|
|
1501
|
+
var a = e[n];
|
|
1502
|
+
if (a !== void 0)
|
|
1503
|
+
return a.exports;
|
|
1504
|
+
var u = e[n] = { exports: {} }, r = !0;
|
|
1505
|
+
try {
|
|
1506
|
+
i[n].call(u.exports, u, u.exports, t), r = !1;
|
|
1507
|
+
} finally {
|
|
1508
|
+
r && delete e[n];
|
|
1509
|
+
}
|
|
1510
|
+
return u.exports;
|
|
1511
|
+
}
|
|
1512
|
+
typeof t < "u" && (t.ab = __dirname + "/");
|
|
1513
|
+
var o = t(226);
|
|
1514
|
+
Ve.exports = o;
|
|
1515
|
+
})()), Ve.exports;
|
|
1516
|
+
}
|
|
1517
|
+
var Nt;
|
|
1518
|
+
function Ct() {
|
|
1519
|
+
return Nt || (Nt = 1, (function(i) {
|
|
1520
|
+
Object.defineProperty(i, "__esModule", {
|
|
1521
|
+
value: !0
|
|
1522
|
+
});
|
|
1523
|
+
function e(r, d) {
|
|
1524
|
+
for (var _ in d) Object.defineProperty(r, _, {
|
|
1525
|
+
enumerable: !0,
|
|
1526
|
+
get: d[_]
|
|
1527
|
+
});
|
|
1528
|
+
}
|
|
1529
|
+
e(i, {
|
|
1530
|
+
isBot: function() {
|
|
1531
|
+
return n;
|
|
1532
|
+
},
|
|
1533
|
+
userAgent: function() {
|
|
1534
|
+
return u;
|
|
1535
|
+
},
|
|
1536
|
+
userAgentFromString: function() {
|
|
1537
|
+
return a;
|
|
1538
|
+
}
|
|
1539
|
+
});
|
|
1540
|
+
const t = /* @__PURE__ */ o(hr());
|
|
1541
|
+
function o(r) {
|
|
1542
|
+
return r && r.__esModule ? r : {
|
|
1543
|
+
default: r
|
|
1544
|
+
};
|
|
1545
|
+
}
|
|
1546
|
+
function n(r) {
|
|
1547
|
+
return /Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Google-InspectionTool|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(r);
|
|
1548
|
+
}
|
|
1549
|
+
function a(r) {
|
|
1550
|
+
return {
|
|
1551
|
+
...(0, t.default)(r),
|
|
1552
|
+
isBot: r === void 0 ? !1 : n(r)
|
|
1553
|
+
};
|
|
1554
|
+
}
|
|
1555
|
+
function u({ headers: r }) {
|
|
1556
|
+
return a(r.get("user-agent") || void 0);
|
|
1557
|
+
}
|
|
1558
|
+
})(ze)), ze;
|
|
1559
|
+
}
|
|
1560
|
+
var Ke = {}, Lt;
|
|
1561
|
+
function fr() {
|
|
1562
|
+
return Lt || (Lt = 1, (function(i) {
|
|
1563
|
+
Object.defineProperty(i, "__esModule", {
|
|
1564
|
+
value: !0
|
|
1565
|
+
}), Object.defineProperty(i, "URLPattern", {
|
|
1566
|
+
enumerable: !0,
|
|
1567
|
+
get: function() {
|
|
1568
|
+
return e;
|
|
1569
|
+
}
|
|
1570
|
+
});
|
|
1571
|
+
const e = (
|
|
1572
|
+
// @ts-expect-error: URLPattern is not available in Node.js
|
|
1573
|
+
typeof URLPattern > "u" ? void 0 : URLPattern
|
|
1574
|
+
);
|
|
1575
|
+
})(Ke)), Ke;
|
|
1576
|
+
}
|
|
1577
|
+
var kt;
|
|
1578
|
+
function pr() {
|
|
1579
|
+
return kt || (kt = 1, (function(i, e) {
|
|
1580
|
+
const t = {
|
|
1581
|
+
NextRequest: ur().NextRequest,
|
|
1582
|
+
NextResponse: lr().NextResponse,
|
|
1583
|
+
ImageResponse: dr().ImageResponse,
|
|
1584
|
+
userAgentFromString: Ct().userAgentFromString,
|
|
1585
|
+
userAgent: Ct().userAgent,
|
|
1586
|
+
URLPattern: fr().URLPattern
|
|
1587
|
+
};
|
|
1588
|
+
i.exports = t, e.NextRequest = t.NextRequest, e.NextResponse = t.NextResponse, e.ImageResponse = t.ImageResponse, e.userAgentFromString = t.userAgentFromString, e.userAgent = t.userAgent, e.URLPattern = t.URLPattern;
|
|
1589
|
+
})(Ee, Ee.exports)), Ee.exports;
|
|
1590
|
+
}
|
|
1591
|
+
var mr = pr();
|
|
1592
|
+
class Cr {
|
|
1593
|
+
async parseRequest(e) {
|
|
1594
|
+
const t = new URL(e.url);
|
|
1595
|
+
let o, n;
|
|
1596
|
+
if (e.method !== "GET") {
|
|
1597
|
+
const r = e.headers.get(K) || "";
|
|
1598
|
+
if (r.includes(X.applicationJson))
|
|
1599
|
+
try {
|
|
1600
|
+
o = await e.json();
|
|
1601
|
+
} catch {
|
|
1602
|
+
k.warn("request body is null!");
|
|
1603
|
+
}
|
|
1604
|
+
else if (r.includes(X.multipartFormData))
|
|
1605
|
+
n = await e.formData();
|
|
1606
|
+
else if (r.includes(X.applicationXwwwFormUrlencoded)) {
|
|
1607
|
+
const d = await e.text();
|
|
1608
|
+
o = Ze(d);
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
const a = e.headers, u = {};
|
|
1612
|
+
return e.cookies.getAll().forEach((r) => {
|
|
1613
|
+
u[r.name] = r.value;
|
|
1614
|
+
}), {
|
|
1615
|
+
url: t,
|
|
1616
|
+
headers: a,
|
|
1617
|
+
body: o,
|
|
1618
|
+
formData: n,
|
|
1619
|
+
cookies: u,
|
|
1620
|
+
raw: e,
|
|
1621
|
+
clone() {
|
|
1622
|
+
return e.clone();
|
|
1623
|
+
}
|
|
1624
|
+
};
|
|
1625
|
+
}
|
|
1626
|
+
createResponse(e) {
|
|
1627
|
+
const t = mr.NextResponse.json(e.body, {
|
|
1628
|
+
status: e.status,
|
|
1629
|
+
headers: e.headers
|
|
1630
|
+
});
|
|
1631
|
+
return Object.entries(e.cookies).forEach(([o, n]) => {
|
|
1632
|
+
typeof n == "object" && n.value ? t.cookies.set(o, n.value, n.options) : typeof n == "string" && t.cookies.set(o, n);
|
|
1633
|
+
}), t;
|
|
1634
|
+
}
|
|
1635
|
+
setCookie(e, t, o, n) {
|
|
1636
|
+
e.cookies[t] = { value: o, options: n };
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
var Je = /* @__PURE__ */ ((i) => (i[i.login = 0] = "login", i[i.logout = 1] = "logout", i))(Je || {});
|
|
1640
|
+
const Ye = {
|
|
1641
|
+
login: "login",
|
|
1642
|
+
logout: "logout",
|
|
1643
|
+
unknown: ""
|
|
1644
|
+
}, K = "Content-Type", X = {
|
|
1645
|
+
applicationJson: "application/json",
|
|
1646
|
+
multipartFormData: "multipart/form-data",
|
|
1647
|
+
applicationXwwwFormUrlencoded: "application/x-www-form-urlencoded"
|
|
1648
|
+
};
|
|
1649
|
+
class Lr {
|
|
1650
|
+
config;
|
|
1651
|
+
http;
|
|
1652
|
+
cookies;
|
|
1653
|
+
adapter;
|
|
1654
|
+
constructor(e, t, o, n) {
|
|
1655
|
+
this.config = e;
|
|
1656
|
+
const a = wr(o);
|
|
1657
|
+
this.http = new Pr({ ...a, userType: Dt.TYPE_C }), this.cookies = n, this.adapter = t;
|
|
1658
|
+
}
|
|
1659
|
+
async handleRequest(e) {
|
|
1660
|
+
try {
|
|
1661
|
+
const t = await this.adapter.parseRequest(e), o = await this.processRequest(t);
|
|
1662
|
+
return this.adapter.createResponse(o);
|
|
1663
|
+
} catch (t) {
|
|
1664
|
+
console.error("Router error:", t);
|
|
1665
|
+
const o = {};
|
|
1666
|
+
o[K] = X.applicationJson;
|
|
1667
|
+
const n = {
|
|
1668
|
+
status: 500,
|
|
1669
|
+
headers: o,
|
|
1670
|
+
cookies: {},
|
|
1671
|
+
body: {
|
|
1672
|
+
code: 500,
|
|
1673
|
+
success: !1,
|
|
1674
|
+
msg: "Internal server error"
|
|
1675
|
+
}
|
|
1676
|
+
};
|
|
1677
|
+
return this.adapter.createResponse(n);
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
async processRequest(e) {
|
|
1681
|
+
const t = e.url.searchParams, o = t.get("m") ?? "unknown", a = { ...Ye, ...this.config.APIMAP }[o];
|
|
1682
|
+
if (!a || a.length === 0)
|
|
1683
|
+
return this.createErrorResponse(404, "API not found");
|
|
1684
|
+
let u;
|
|
1685
|
+
if ((a.startsWith("admin/") || a.startsWith("api/")) && (u = Er(this.cookies), !u || u.username.length === 0 || u.token.length === 0))
|
|
1686
|
+
return this.createErrorResponse(409, "Authentication required");
|
|
1687
|
+
let r;
|
|
1688
|
+
const d = e.method, _ = e.headers.get(K) || "";
|
|
1689
|
+
try {
|
|
1690
|
+
if (d === "GET") {
|
|
1691
|
+
const f = Ze(t.toString(), ["m"]);
|
|
1692
|
+
r = await this.http.get({
|
|
1693
|
+
url: a,
|
|
1694
|
+
data: f,
|
|
1695
|
+
token: u
|
|
1696
|
+
});
|
|
1697
|
+
} else if (d === "POST") {
|
|
1698
|
+
let f;
|
|
1699
|
+
if (_.includes(X.applicationJson) || _.includes(X.applicationXwwwFormUrlencoded))
|
|
1700
|
+
f = e.body;
|
|
1701
|
+
else if (_.includes(X.multipartFormData)) {
|
|
1702
|
+
const g = _.match(/boundary=([^\s;]+)/);
|
|
1703
|
+
if (!g)
|
|
1704
|
+
return this.createErrorResponse(411, "Missing boundary in form data");
|
|
1705
|
+
const S = await e.clone().arrayBuffer();
|
|
1706
|
+
f = {
|
|
1707
|
+
boundary: g[1],
|
|
1708
|
+
buffer: Buffer.from(S)
|
|
1709
|
+
};
|
|
1710
|
+
const l = e.formData;
|
|
1711
|
+
if (l)
|
|
1712
|
+
for (const [b, h] of Object.entries(l))
|
|
1713
|
+
b !== "file" && (f[b] = h);
|
|
1714
|
+
} else
|
|
1715
|
+
return this.createErrorResponse(410, "Unsupported content type");
|
|
1716
|
+
r = await this.http.post({
|
|
1717
|
+
url: a,
|
|
1718
|
+
data: f,
|
|
1719
|
+
token: u
|
|
1720
|
+
});
|
|
1721
|
+
} else
|
|
1722
|
+
return this.createErrorResponse(405, "Method not allowed");
|
|
1723
|
+
} catch (f) {
|
|
1724
|
+
return k.error({ "error:": f }, "API request error"), this.createErrorResponse(500, "API request failed");
|
|
1725
|
+
}
|
|
1726
|
+
const c = {
|
|
1727
|
+
status: r.success ? 200 : r.code,
|
|
1728
|
+
headers: { CONTENT_TYPE_KEY: _ },
|
|
1729
|
+
cookies: {},
|
|
1730
|
+
body: r
|
|
1731
|
+
};
|
|
1732
|
+
if (r.success)
|
|
1733
|
+
switch (a) {
|
|
1734
|
+
case Ye[Je[
|
|
1735
|
+
0
|
|
1736
|
+
/* login */
|
|
1737
|
+
]]:
|
|
1738
|
+
const f = r.data;
|
|
1739
|
+
vr(f, this.cookies);
|
|
1740
|
+
break;
|
|
1741
|
+
case Ye[Je[
|
|
1742
|
+
1
|
|
1743
|
+
/* logout */
|
|
1744
|
+
]]:
|
|
1745
|
+
Rr(this.cookies);
|
|
1746
|
+
break;
|
|
1747
|
+
}
|
|
1748
|
+
return c;
|
|
1749
|
+
}
|
|
1750
|
+
createErrorResponse(e, t) {
|
|
1751
|
+
return {
|
|
1752
|
+
status: e,
|
|
1753
|
+
headers: { "content-type": "application/json" },
|
|
1754
|
+
cookies: {},
|
|
1755
|
+
body: {
|
|
1756
|
+
code: e,
|
|
1757
|
+
success: !1,
|
|
1758
|
+
msg: t
|
|
1759
|
+
}
|
|
1760
|
+
};
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
const _r = "zh-CN", Ht = "_device_id_key", Ft = "_current_website_key", Ut = "Get request error!", Qe = "Post request error!", U = {
|
|
80
1764
|
IBOOT_DEVICE_ID: "dvid",
|
|
81
1765
|
IBOOT_LANG: "lang",
|
|
82
1766
|
IBOOT_WEBSITE_ID: "wid",
|
|
83
1767
|
IBOOT_WEBSITE_NO: "wno",
|
|
84
1768
|
IBOOT_TOKEN: "token",
|
|
85
1769
|
IBOOT_USER: "user"
|
|
86
|
-
},
|
|
1770
|
+
}, Y = {
|
|
87
1771
|
DEVICE_ID: "Device-Id",
|
|
88
1772
|
LANG: "Lang",
|
|
89
1773
|
WEBSITE_ID: "Website-Id",
|
|
90
1774
|
WEBSITE_NO: "Website-No"
|
|
91
|
-
},
|
|
92
|
-
if (!
|
|
1775
|
+
}, Bt = (i) => {
|
|
1776
|
+
if (!i.get)
|
|
93
1777
|
throw new Error("The get method of IStorage has not been implemented.");
|
|
94
|
-
const e =
|
|
95
|
-
return e.length > 0 && (
|
|
96
|
-
},
|
|
1778
|
+
const e = i.get(Ht) ?? "", t = i.get(Ft), o = t != null ? JSON.parse(t) : null, n = {};
|
|
1779
|
+
return e.length > 0 && (n["Device-Id"] = e), o && (n.Lang = o.language, o.websiteId && (n["Website-Id"] = o.websiteId), o.websiteNo && (n["Website-No"] = o.websiteNo)), n;
|
|
1780
|
+
}, kr = ({ deviceId: i, website: e }, t) => {
|
|
97
1781
|
if (!t.set)
|
|
98
1782
|
throw new Error("The set method of IStorage has not been implemented.");
|
|
99
|
-
t.set(
|
|
100
|
-
},
|
|
1783
|
+
t.set(Ht, i), e && t.set(Ft, JSON.stringify(e));
|
|
1784
|
+
}, gr = (i) => `${process.env.BASE_URL || "/api/services"}?m=${i}`, br = async (i, e) => {
|
|
1785
|
+
let t = gr(i);
|
|
101
1786
|
if (e?.data) {
|
|
102
|
-
const
|
|
103
|
-
|
|
1787
|
+
const r = new URLSearchParams(e.data);
|
|
1788
|
+
t += `&${r}`;
|
|
104
1789
|
}
|
|
105
|
-
const
|
|
1790
|
+
const o = e && e.storage && e.storage.get ? Bt(e.storage) : {}, n = e?.headers;
|
|
106
1791
|
if (n)
|
|
107
|
-
for (const
|
|
108
|
-
const
|
|
109
|
-
|
|
1792
|
+
for (const r in n) {
|
|
1793
|
+
const d = n[r];
|
|
1794
|
+
d && (o[r] = d);
|
|
110
1795
|
}
|
|
111
|
-
|
|
112
|
-
url:
|
|
113
|
-
headers:
|
|
1796
|
+
k.info({
|
|
1797
|
+
url: t,
|
|
1798
|
+
headers: o
|
|
114
1799
|
}, "GET");
|
|
115
|
-
const
|
|
1800
|
+
const a = await fetch(t, {
|
|
116
1801
|
method: "GET",
|
|
117
|
-
headers:
|
|
1802
|
+
headers: o,
|
|
118
1803
|
cache: e?.useCache ? "force-cache" : "default"
|
|
119
1804
|
});
|
|
120
|
-
if (
|
|
121
|
-
const
|
|
122
|
-
return
|
|
1805
|
+
if (a.ok) {
|
|
1806
|
+
const r = Object.fromEntries(a.headers.entries()), d = { ...await a.json(), headers: r };
|
|
1807
|
+
return k.debug(d, "GET_RESULT"), d;
|
|
123
1808
|
}
|
|
124
|
-
const
|
|
125
|
-
code:
|
|
1809
|
+
const u = {
|
|
1810
|
+
code: a.status,
|
|
126
1811
|
success: !1,
|
|
127
|
-
msg:
|
|
1812
|
+
msg: a.statusText
|
|
128
1813
|
};
|
|
129
|
-
return
|
|
130
|
-
},
|
|
131
|
-
const t = e?.data ?? {},
|
|
132
|
-
let
|
|
133
|
-
const
|
|
134
|
-
if (t instanceof FormData ?
|
|
135
|
-
for (let
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
url:
|
|
141
|
-
headers:
|
|
1814
|
+
return k.error(u), u;
|
|
1815
|
+
}, Gt = async (i, e) => {
|
|
1816
|
+
const t = e?.data ?? {}, o = e?.headers;
|
|
1817
|
+
let n;
|
|
1818
|
+
const a = e && e.storage && e.storage.get ? Bt(e.storage) : {}, u = new Headers(a);
|
|
1819
|
+
if (t instanceof FormData ? n = t : (n = JSON.stringify(t), u.set(K, X.applicationJson)), o)
|
|
1820
|
+
for (let _ in o) {
|
|
1821
|
+
const c = o[_];
|
|
1822
|
+
c && u.set(_, c);
|
|
1823
|
+
}
|
|
1824
|
+
k.info({
|
|
1825
|
+
url: i,
|
|
1826
|
+
headers: u
|
|
142
1827
|
}, "POST");
|
|
143
|
-
const
|
|
1828
|
+
const r = await fetch(i, {
|
|
144
1829
|
method: "POST",
|
|
145
|
-
headers:
|
|
146
|
-
body:
|
|
1830
|
+
headers: u,
|
|
1831
|
+
body: n
|
|
147
1832
|
});
|
|
148
|
-
if (
|
|
149
|
-
const
|
|
150
|
-
return
|
|
1833
|
+
if (r.ok) {
|
|
1834
|
+
const _ = Object.fromEntries(r.headers.entries()), c = { ...await r.json(), headers: _ };
|
|
1835
|
+
return k.debug(c, "POST_RESULT"), c;
|
|
151
1836
|
}
|
|
152
|
-
const
|
|
153
|
-
code:
|
|
1837
|
+
const d = {
|
|
1838
|
+
code: r.status,
|
|
154
1839
|
success: !1,
|
|
155
|
-
msg:
|
|
1840
|
+
msg: r.statusText
|
|
156
1841
|
};
|
|
157
|
-
return
|
|
158
|
-
},
|
|
159
|
-
const t = await
|
|
1842
|
+
return k.error(d), d;
|
|
1843
|
+
}, Ur = async (i, e) => {
|
|
1844
|
+
const t = await br(i, e);
|
|
160
1845
|
if (t.success)
|
|
161
1846
|
return t.data;
|
|
162
1847
|
if (e?.showError) {
|
|
163
|
-
e.showError(t.msg ??
|
|
1848
|
+
e.showError(t.msg ?? Ut);
|
|
164
1849
|
return;
|
|
165
1850
|
}
|
|
166
|
-
throw Error(t.msg ??
|
|
167
|
-
},
|
|
168
|
-
const t = await
|
|
1851
|
+
throw Error(t.msg ?? Ut);
|
|
1852
|
+
}, Dr = async (i, e) => {
|
|
1853
|
+
const t = await Gt(i, e);
|
|
169
1854
|
if (t.success)
|
|
170
1855
|
return t.data;
|
|
171
1856
|
if (e?.showError) {
|
|
172
|
-
e.showError(t.msg ??
|
|
1857
|
+
e.showError(t.msg ?? Qe);
|
|
173
1858
|
return;
|
|
174
1859
|
}
|
|
175
|
-
throw Error(t.msg ??
|
|
176
|
-
},
|
|
177
|
-
const t = await
|
|
178
|
-
return t.success ? (e?.showSuccess && e.showSuccess(t.msg ?? "SUCCESS"), !0) : (e?.showError && e.showError(t.msg ??
|
|
179
|
-
},
|
|
180
|
-
if (
|
|
181
|
-
const e =
|
|
182
|
-
return e && e.length > 0 && (
|
|
1860
|
+
throw Error(t.msg ?? Qe);
|
|
1861
|
+
}, Mr = async (i, e) => {
|
|
1862
|
+
const t = await Gt(i, e);
|
|
1863
|
+
return t.success ? (e?.showSuccess && e.showSuccess(t.msg ?? "SUCCESS"), !0) : (e?.showError && e.showError(t.msg ?? Qe), !1);
|
|
1864
|
+
}, wr = (i) => {
|
|
1865
|
+
if (i.get) {
|
|
1866
|
+
const e = i.get(Y.DEVICE_ID), t = i.get(Y.LANG), o = i.get(Y.WEBSITE_ID), n = i.get(Y.WEBSITE_NO), a = {};
|
|
1867
|
+
return e && e.length > 0 && (a.deviceId = e), t && t.length > 0 && (a.lang = t), o && o.length > 0 && (a.websiteId = o), n && n.length > 0 && (a.websiteNo = n), a;
|
|
183
1868
|
}
|
|
184
1869
|
throw new Error("The get method of IStorage has not been implemented.");
|
|
185
|
-
},
|
|
186
|
-
if (
|
|
187
|
-
e.deviceId &&
|
|
1870
|
+
}, jr = (i, e) => {
|
|
1871
|
+
if (i.set)
|
|
1872
|
+
e.deviceId && i.set(Y.DEVICE_ID, e.deviceId), e.lang && i.set(Y.LANG, e.lang), e.websiteId && i.set(Y.WEBSITE_ID, e.websiteId), e.websiteNo && i.set(Y.WEBSITE_NO, e.websiteNo);
|
|
188
1873
|
else
|
|
189
1874
|
throw new Error("The set method of IStorage has not been implemented.");
|
|
190
|
-
},
|
|
191
|
-
if (
|
|
192
|
-
const e =
|
|
193
|
-
return e && e.length > 0 && (
|
|
1875
|
+
}, qr = (i) => {
|
|
1876
|
+
if (i.get) {
|
|
1877
|
+
const e = i.get(U.IBOOT_DEVICE_ID), t = i.get(U.IBOOT_LANG), o = i.get(U.IBOOT_WEBSITE_ID), n = i.get(U.IBOOT_WEBSITE_NO), a = {};
|
|
1878
|
+
return e && e.length > 0 && (a.deviceId = e), t && t.length > 0 && (a.lang = t), o && o.length > 0 && (a.websiteId = o), n && n.length > 0 && (a.websiteNo = n), a;
|
|
194
1879
|
}
|
|
195
1880
|
throw new Error("The get method of ICookies has not been implemented.");
|
|
196
|
-
},
|
|
197
|
-
if (
|
|
198
|
-
e.deviceId &&
|
|
1881
|
+
}, Hr = (i, e) => {
|
|
1882
|
+
if (i.set)
|
|
1883
|
+
e.deviceId && i.set(U.IBOOT_DEVICE_ID, e.deviceId), e.lang && i.set(U.IBOOT_LANG, e.lang), e.websiteId && i.set(U.IBOOT_WEBSITE_ID, e.websiteId), e.websiteNo && i.set(U.IBOOT_WEBSITE_NO, e.websiteNo);
|
|
199
1884
|
else
|
|
200
1885
|
throw new Error("The set method of ICookies has not been implemented.");
|
|
201
|
-
},
|
|
202
|
-
if (
|
|
203
|
-
const e =
|
|
1886
|
+
}, Fr = (i) => {
|
|
1887
|
+
if (i.get) {
|
|
1888
|
+
const e = i.get(U.IBOOT_USER);
|
|
204
1889
|
if (e && e.length > 0)
|
|
205
1890
|
return JSON.parse(e);
|
|
206
1891
|
}
|
|
207
|
-
},
|
|
208
|
-
if (
|
|
209
|
-
const e =
|
|
1892
|
+
}, Er = (i) => {
|
|
1893
|
+
if (i.get) {
|
|
1894
|
+
const e = i.get(U.IBOOT_USER);
|
|
210
1895
|
if (e && e.length > 0) {
|
|
211
|
-
const t = JSON.parse(e),
|
|
212
|
-
if (
|
|
1896
|
+
const t = JSON.parse(e), o = t.username, n = t.userType.toString(), a = i.get(U.IBOOT_TOKEN);
|
|
1897
|
+
if (a)
|
|
213
1898
|
return {
|
|
214
|
-
username:
|
|
215
|
-
utype:
|
|
216
|
-
token:
|
|
1899
|
+
username: o,
|
|
1900
|
+
utype: n,
|
|
1901
|
+
token: a
|
|
217
1902
|
};
|
|
218
1903
|
}
|
|
219
1904
|
}
|
|
220
|
-
},
|
|
221
|
-
const { id: t, name:
|
|
1905
|
+
}, vr = (i, e) => {
|
|
1906
|
+
const { id: t, name: o, username: n, nickname: a, headImg: u, token: r, lastLoginTime: d, deviceId: _, userType: c, mustChangePwd: f } = i, g = {
|
|
222
1907
|
id: t,
|
|
223
|
-
name:
|
|
224
|
-
username:
|
|
225
|
-
nickname:
|
|
226
|
-
headImg:
|
|
227
|
-
lastLoginTime:
|
|
228
|
-
deviceId:
|
|
229
|
-
userType:
|
|
1908
|
+
name: o,
|
|
1909
|
+
username: n,
|
|
1910
|
+
nickname: a || o,
|
|
1911
|
+
headImg: u,
|
|
1912
|
+
lastLoginTime: d,
|
|
1913
|
+
deviceId: _,
|
|
1914
|
+
userType: c,
|
|
230
1915
|
accountType: 0,
|
|
231
1916
|
needToReview: !1,
|
|
232
1917
|
socketOnline: !1,
|
|
233
|
-
mustChangePwd:
|
|
1918
|
+
mustChangePwd: f
|
|
234
1919
|
};
|
|
235
1920
|
if (!e.set)
|
|
236
1921
|
throw new Error("cookies set function is undefined");
|
|
237
|
-
e.set(
|
|
1922
|
+
e.set(U.IBOOT_TOKEN, r, {
|
|
238
1923
|
path: "/",
|
|
239
1924
|
secure: process.env.APP_ENV === "production",
|
|
240
1925
|
httpOnly: !0,
|
|
241
1926
|
sameSite: "strict"
|
|
242
|
-
}), e.set(
|
|
243
|
-
},
|
|
244
|
-
if (!
|
|
1927
|
+
}), e.set(U.IBOOT_USER, JSON.stringify(g));
|
|
1928
|
+
}, Rr = (i) => {
|
|
1929
|
+
if (!i.set)
|
|
245
1930
|
throw new Error("cookies set function is undefined");
|
|
246
|
-
if (
|
|
1931
|
+
if (i.set(U.IBOOT_TOKEN, "", {
|
|
247
1932
|
maxAge: -1,
|
|
248
1933
|
//设置为 -1表示立即过期
|
|
249
1934
|
httpOnly: !0,
|
|
250
1935
|
path: "/"
|
|
251
|
-
}),
|
|
1936
|
+
}), i.set(U.IBOOT_USER, "", {
|
|
252
1937
|
maxAge: -1,
|
|
253
1938
|
//设置为 -1表示立即过期
|
|
254
1939
|
httpOnly: !0,
|
|
255
1940
|
path: "/"
|
|
256
|
-
}), !
|
|
1941
|
+
}), !i.delete)
|
|
257
1942
|
throw new Error("cookies delete function is undefined");
|
|
258
|
-
|
|
1943
|
+
i.delete(U.IBOOT_TOKEN), i.delete(U.IBOOT_USER);
|
|
259
1944
|
};
|
|
260
|
-
class
|
|
1945
|
+
class Pr {
|
|
261
1946
|
baseUrl;
|
|
262
1947
|
helloMethod;
|
|
263
1948
|
apiKey;
|
|
@@ -269,121 +1954,121 @@ class ne {
|
|
|
269
1954
|
websiteId;
|
|
270
1955
|
websiteNo;
|
|
271
1956
|
constructor(e) {
|
|
272
|
-
process.env.APP_ENV === "production" ||
|
|
1957
|
+
process.env.APP_ENV === "production" || k.warn("This is currently a development environment!"), this.baseUrl = process.env.APP_BASEURL, this.apiKey = process.env.APP_APIKEY, this.userFrom = process.env.APP_USERFROM ?? "1", this.helloMethod = e.helloURL ?? "", this.userType = e.userType ?? Dt.TYPE_MGT, this.deviceId = e.deviceId ?? at(10), this.lang = e.lang ?? _r, this.websiteId = e.websiteId, this.websiteNo = e.websiteNo;
|
|
273
1958
|
}
|
|
274
1959
|
encrypt(e) {
|
|
275
|
-
const t =
|
|
276
|
-
return
|
|
1960
|
+
const t = ne.enc.Utf8.parse(this.apiKey);
|
|
1961
|
+
return ne.AES.encrypt(e, t).toString();
|
|
277
1962
|
}
|
|
278
1963
|
decrypt(e) {
|
|
279
|
-
const t =
|
|
280
|
-
return
|
|
281
|
-
mode:
|
|
282
|
-
}).toString(
|
|
1964
|
+
const t = ne.enc.Utf8.parse(this.apiKey);
|
|
1965
|
+
return ne.AES.decrypt(e, t, {
|
|
1966
|
+
mode: ne.mode.ECB
|
|
1967
|
+
}).toString(ne.enc.Utf8);
|
|
283
1968
|
}
|
|
284
1969
|
//eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
285
1970
|
convertUrlParameter(e) {
|
|
286
1971
|
const t = [];
|
|
287
|
-
for (const
|
|
288
|
-
let
|
|
289
|
-
if (
|
|
290
|
-
|
|
291
|
-
else if (
|
|
292
|
-
if (
|
|
293
|
-
if (
|
|
1972
|
+
for (const o in e) {
|
|
1973
|
+
let n = e[o];
|
|
1974
|
+
if (n && typeof n == "string")
|
|
1975
|
+
n = n.trim();
|
|
1976
|
+
else if (n && typeof n == "object") {
|
|
1977
|
+
if (st(n)) {
|
|
1978
|
+
if (n.length === 0)
|
|
294
1979
|
continue;
|
|
295
|
-
for (let
|
|
296
|
-
const
|
|
297
|
-
for (const
|
|
298
|
-
const
|
|
299
|
-
if (
|
|
300
|
-
if (typeof
|
|
301
|
-
|
|
302
|
-
if (
|
|
303
|
-
for (const
|
|
304
|
-
const
|
|
305
|
-
if (
|
|
306
|
-
const
|
|
307
|
-
t.push(
|
|
1980
|
+
for (let a = 0; a < n.length; a++) {
|
|
1981
|
+
const u = n[a];
|
|
1982
|
+
for (const r in u) {
|
|
1983
|
+
const d = u[r] ?? void 0;
|
|
1984
|
+
if (d) {
|
|
1985
|
+
if (typeof d == "object")
|
|
1986
|
+
st(d) && d.forEach((_, c) => {
|
|
1987
|
+
if (_)
|
|
1988
|
+
for (const f in _) {
|
|
1989
|
+
const g = _[f];
|
|
1990
|
+
if (g && g.toString().length > 0) {
|
|
1991
|
+
const R = `[${a.toString()}].${r + `[${c.toString()}].${f}`}=${we(g)}`;
|
|
1992
|
+
t.push(o + R);
|
|
308
1993
|
}
|
|
309
1994
|
}
|
|
310
1995
|
});
|
|
311
|
-
else if (
|
|
312
|
-
const
|
|
313
|
-
t.push(
|
|
1996
|
+
else if (d.toString().length > 0) {
|
|
1997
|
+
const _ = `[${a.toString()}].${r}=${we(d.toString())}`;
|
|
1998
|
+
t.push(o + _);
|
|
314
1999
|
}
|
|
315
2000
|
}
|
|
316
2001
|
}
|
|
317
2002
|
}
|
|
318
2003
|
} else
|
|
319
|
-
for (const
|
|
320
|
-
const
|
|
321
|
-
if (
|
|
322
|
-
const
|
|
323
|
-
t.push(
|
|
2004
|
+
for (const a in n) {
|
|
2005
|
+
const u = n[a];
|
|
2006
|
+
if (u != null && u != "" && u.length != 0) {
|
|
2007
|
+
const r = `.${a}=${we(u)}`;
|
|
2008
|
+
t.push(o + r);
|
|
324
2009
|
}
|
|
325
2010
|
}
|
|
326
2011
|
continue;
|
|
327
|
-
} else
|
|
328
|
-
|
|
2012
|
+
} else n && typeof n == "function" && (n = null);
|
|
2013
|
+
n != null && n != "" && n.length != 0 && t.push(o + "=" + we(n));
|
|
329
2014
|
}
|
|
330
2015
|
return t && t.join("&");
|
|
331
2016
|
}
|
|
332
2017
|
async sign(e) {
|
|
333
|
-
const t = "&key=" + await this.helloIboot(),
|
|
334
|
-
for (const
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
const
|
|
338
|
-
|
|
339
|
-
let
|
|
340
|
-
typeof
|
|
341
|
-
});
|
|
342
|
-
const
|
|
343
|
-
params:
|
|
344
|
-
md5:
|
|
2018
|
+
const t = "&key=" + await this.helloIboot(), o = [];
|
|
2019
|
+
for (const d in e)
|
|
2020
|
+
o.push(d);
|
|
2021
|
+
o.sort((d, _) => d.toLowerCase().localeCompare(_.toLowerCase()));
|
|
2022
|
+
const n = [];
|
|
2023
|
+
o.forEach((d) => {
|
|
2024
|
+
let _ = e[d];
|
|
2025
|
+
typeof _ == "object" && (_ = JSON.stringify(_)), n.push(d + "=" + _);
|
|
2026
|
+
});
|
|
2027
|
+
const a = n.join("&"), u = Kt.md5((a + t).toLocaleUpperCase()), r = {
|
|
2028
|
+
params: a,
|
|
2029
|
+
md5: u
|
|
345
2030
|
};
|
|
346
|
-
return
|
|
2031
|
+
return k.debug(r, "API_SIGN"), u;
|
|
347
2032
|
}
|
|
348
2033
|
//eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
349
2034
|
assemblyParameter(e, t) {
|
|
350
|
-
const
|
|
351
|
-
return
|
|
2035
|
+
const o = e ?? {};
|
|
2036
|
+
return o.timestamp = Date.now() + "", o.echostr = at(10), o.version = this.version, o.deviceId = this.deviceId, o.webid = this.websiteId, o.apiKey = this.apiKey, t && t.length > 0 && (o.username = t), o;
|
|
352
2037
|
}
|
|
353
2038
|
async assemblyHeader({ urlParams: e, token: t }) {
|
|
354
|
-
const
|
|
355
|
-
"Content-Type": "application/x-www-form-urlencoded",
|
|
2039
|
+
const o = {
|
|
356
2040
|
"Res-Type": "json",
|
|
357
2041
|
"Device-Id": this.deviceId,
|
|
358
2042
|
"User-Type": t?.utype.toString() ?? this.userType.toString(),
|
|
359
2043
|
"User-From": this.userFrom,
|
|
360
2044
|
"Api-Key": this.apiKey
|
|
361
2045
|
};
|
|
362
|
-
this.lang && this.lang.length > 0 && (
|
|
363
|
-
const
|
|
364
|
-
return
|
|
2046
|
+
o[K] = X.applicationXwwwFormUrlencoded, this.lang && this.lang.length > 0 && (o.Lang = this.lang), this.websiteId && this.websiteId.length > 0 && (o["Web-Id"] = this.websiteId), this.websiteNo && this.websiteNo.length > 0 && (o["Web-No"] = this.websiteNo), t && (t.token && t.token.length > 0 && t.username && t.username.length > 0 && (o.Authorization = t.token, o.Username = t.username), t.xcsrf && (o[t.xcsrf.csrfHeader] = t.xcsrf.csrfToken));
|
|
2047
|
+
const n = Ze(e), a = await this.sign(n);
|
|
2048
|
+
return o.Sign = a, o;
|
|
365
2049
|
}
|
|
366
2050
|
async helloIboot() {
|
|
367
2051
|
if (this.helloMethod.length <= 0)
|
|
368
2052
|
return this.apiKey;
|
|
369
2053
|
const e = this.getApiUrl(this.helloMethod), t = {
|
|
370
|
-
"Content-Type": "application/x-www-form-urlencoded",
|
|
371
2054
|
"Res-Type": "json",
|
|
372
2055
|
"Api-Key": this.apiKey
|
|
373
|
-
}
|
|
2056
|
+
};
|
|
2057
|
+
t[K] = X.applicationXwwwFormUrlencoded;
|
|
2058
|
+
const o = {
|
|
374
2059
|
url: e,
|
|
375
2060
|
headers: t
|
|
376
2061
|
};
|
|
377
|
-
|
|
378
|
-
const
|
|
2062
|
+
k.debug(o, "HELLO");
|
|
2063
|
+
const n = await fetch(e, {
|
|
379
2064
|
method: "GET",
|
|
380
2065
|
headers: t,
|
|
381
2066
|
credentials: "include",
|
|
382
2067
|
cache: "force-cache"
|
|
383
2068
|
});
|
|
384
|
-
if (
|
|
385
|
-
const
|
|
386
|
-
return
|
|
2069
|
+
if (n.ok) {
|
|
2070
|
+
const a = await n.json();
|
|
2071
|
+
return k.debug(a.data, "HELLO RESULT"), a.data;
|
|
387
2072
|
}
|
|
388
2073
|
throw new Error("hello iBoot error!");
|
|
389
2074
|
}
|
|
@@ -401,119 +2086,123 @@ class ne {
|
|
|
401
2086
|
}
|
|
402
2087
|
}
|
|
403
2088
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
404
|
-
async get({ url: e, data: t, token:
|
|
405
|
-
const
|
|
406
|
-
url:
|
|
407
|
-
headers:
|
|
2089
|
+
async get({ url: e, data: t, token: o, cache: n = "default" }) {
|
|
2090
|
+
const a = this.assemblyParameter(t), u = this.convertUrlParameter(a), r = await this.assemblyHeader({ urlParams: u, token: o }), d = `${this.getApiUrl(e)}?${u.toString()}`, _ = {
|
|
2091
|
+
url: d,
|
|
2092
|
+
headers: r
|
|
408
2093
|
};
|
|
409
|
-
|
|
410
|
-
const
|
|
2094
|
+
k.info(_, "GET");
|
|
2095
|
+
const c = await fetch(d, {
|
|
411
2096
|
method: "GET",
|
|
412
|
-
headers:
|
|
2097
|
+
headers: r,
|
|
413
2098
|
credentials: "include",
|
|
414
|
-
cache:
|
|
2099
|
+
cache: n
|
|
415
2100
|
});
|
|
416
|
-
if (
|
|
417
|
-
const
|
|
418
|
-
return
|
|
2101
|
+
if (c.ok) {
|
|
2102
|
+
const g = Object.fromEntries(c.headers.entries()), R = { ...await c.json(), headers: g };
|
|
2103
|
+
return k.debug(R, "GET_RESULT"), R;
|
|
419
2104
|
}
|
|
420
|
-
const
|
|
421
|
-
code:
|
|
2105
|
+
const f = {
|
|
2106
|
+
code: c.status,
|
|
422
2107
|
success: !1,
|
|
423
|
-
msg:
|
|
2108
|
+
msg: c.statusText
|
|
424
2109
|
};
|
|
425
|
-
return
|
|
2110
|
+
return k.error(f), f;
|
|
426
2111
|
}
|
|
427
2112
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
428
|
-
async post({ url: e, data: t, token:
|
|
2113
|
+
async post({ url: e, data: t, token: o, cache: n = "default" }) {
|
|
429
2114
|
t = t ? { ...t } : {};
|
|
430
|
-
const
|
|
431
|
-
|
|
432
|
-
const
|
|
433
|
-
|
|
434
|
-
const
|
|
435
|
-
url:
|
|
436
|
-
headers:
|
|
437
|
-
params:
|
|
2115
|
+
const a = t.buffer ?? void 0, u = t.boundary ?? void 0;
|
|
2116
|
+
a && delete t.buffer, u && delete t.boundary;
|
|
2117
|
+
const r = this.assemblyParameter(t), d = this.convertUrlParameter(r), _ = await this.assemblyHeader({ urlParams: d, token: o });
|
|
2118
|
+
a && u && (_[K] = `multipart/form-data; boundary=${u}`);
|
|
2119
|
+
const c = this.getApiUrl(e), f = {
|
|
2120
|
+
url: c,
|
|
2121
|
+
headers: _,
|
|
2122
|
+
params: r
|
|
438
2123
|
};
|
|
439
|
-
|
|
440
|
-
const
|
|
2124
|
+
k.info(f, "POST");
|
|
2125
|
+
const g = a ? `${c}?${d}` : c, R = await fetch(g, {
|
|
441
2126
|
method: "POST",
|
|
442
|
-
headers:
|
|
443
|
-
body:
|
|
2127
|
+
headers: _,
|
|
2128
|
+
body: a || d.toString(),
|
|
444
2129
|
credentials: "include",
|
|
445
|
-
cache:
|
|
2130
|
+
cache: n
|
|
446
2131
|
});
|
|
447
|
-
if (
|
|
448
|
-
const
|
|
449
|
-
return
|
|
2132
|
+
if (R.ok) {
|
|
2133
|
+
const x = Object.fromEntries(R.headers.entries()), l = { ...await R.json(), headers: x };
|
|
2134
|
+
return k.debug(l, "POST_RESULT"), l;
|
|
450
2135
|
}
|
|
451
|
-
const
|
|
452
|
-
code:
|
|
2136
|
+
const S = {
|
|
2137
|
+
code: R.status,
|
|
453
2138
|
success: !1,
|
|
454
|
-
msg:
|
|
2139
|
+
msg: R.statusText
|
|
455
2140
|
};
|
|
456
|
-
return
|
|
2141
|
+
return k.error(S), S;
|
|
457
2142
|
}
|
|
458
2143
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
459
|
-
async stream({ url: e, data: t, token:
|
|
2144
|
+
async stream({ url: e, data: t, token: o }) {
|
|
460
2145
|
t = t ? { ...t } : {};
|
|
461
|
-
const
|
|
462
|
-
|
|
463
|
-
const
|
|
464
|
-
|
|
465
|
-
const
|
|
2146
|
+
const n = t.buffer ?? void 0, a = t.boundary ?? void 0;
|
|
2147
|
+
n && delete t.buffer, a && delete t.boundary;
|
|
2148
|
+
const u = this.assemblyParameter(t), r = this.convertUrlParameter(u), d = await this.assemblyHeader({ urlParams: r, token: o });
|
|
2149
|
+
n && a && (d[K] = `multipart/form-data; boundary=${a}`), d.Connection = "keep-alive", d["X-Accel-Buffering"] = "no", d["Cache-Control"] = "no-cache";
|
|
2150
|
+
const _ = this.getApiUrl(e);
|
|
466
2151
|
try {
|
|
467
|
-
const
|
|
468
|
-
url:
|
|
469
|
-
headers:
|
|
470
|
-
params:
|
|
2152
|
+
const c = n ? `${_}?${r}` : _, f = {
|
|
2153
|
+
url: _,
|
|
2154
|
+
headers: d,
|
|
2155
|
+
params: u
|
|
471
2156
|
};
|
|
472
|
-
|
|
473
|
-
const
|
|
2157
|
+
k.info(f, "STREAM");
|
|
2158
|
+
const g = await fetch(c, {
|
|
474
2159
|
method: "POST",
|
|
475
|
-
headers:
|
|
476
|
-
body:
|
|
2160
|
+
headers: d,
|
|
2161
|
+
body: n || r.toString(),
|
|
477
2162
|
credentials: "include"
|
|
478
2163
|
});
|
|
479
|
-
if (!
|
|
480
|
-
throw new Error(`HTTP error! status: ${
|
|
481
|
-
if (!
|
|
2164
|
+
if (!g.ok)
|
|
2165
|
+
throw new Error(`HTTP error! status: ${g.status}`);
|
|
2166
|
+
if (!g.body)
|
|
482
2167
|
throw new Error("No response body");
|
|
483
|
-
const
|
|
484
|
-
return new Response(
|
|
485
|
-
headers:
|
|
2168
|
+
const R = Object.fromEntries(g.headers.entries());
|
|
2169
|
+
return new Response(g.body, {
|
|
2170
|
+
headers: R
|
|
486
2171
|
});
|
|
487
|
-
} catch (
|
|
488
|
-
throw
|
|
2172
|
+
} catch (c) {
|
|
2173
|
+
throw c;
|
|
489
2174
|
}
|
|
490
2175
|
}
|
|
491
2176
|
}
|
|
492
2177
|
export {
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
2178
|
+
Ir as ACCOUNT_TYPE_MAP,
|
|
2179
|
+
K as CONTENT_TYPE_KEY,
|
|
2180
|
+
X as CONTENT_TYPE_MAP,
|
|
2181
|
+
Lr as HTTPRouter,
|
|
2182
|
+
Pr as HttpClient,
|
|
2183
|
+
Cr as NextJsAdapter,
|
|
2184
|
+
Or as USER_FORM_MAP,
|
|
2185
|
+
xr as USER_SEX_MAP,
|
|
2186
|
+
Dt as USER_TYPE_MAP,
|
|
2187
|
+
Rr as cleanToken,
|
|
2188
|
+
Nr as dateFormat,
|
|
2189
|
+
br as get,
|
|
2190
|
+
Fr as getLoginUser,
|
|
2191
|
+
qr as getServerHttpCookies,
|
|
2192
|
+
wr as getServerHttpOpts,
|
|
2193
|
+
Er as getToken,
|
|
2194
|
+
Ur as iGet,
|
|
2195
|
+
Dr as iPost,
|
|
2196
|
+
Mr as iPostSuccess,
|
|
2197
|
+
st as isArray,
|
|
2198
|
+
k as logger,
|
|
2199
|
+
Gt as post,
|
|
2200
|
+
at as randomString,
|
|
2201
|
+
kr as setClientRequestHeader,
|
|
2202
|
+
Hr as setServerHttpCookies,
|
|
2203
|
+
jr as setServerHttpHeaders,
|
|
2204
|
+
vr as setToken,
|
|
2205
|
+
we as urlEncode,
|
|
2206
|
+
Ze as urlParamToJson
|
|
518
2207
|
};
|
|
519
2208
|
//# sourceMappingURL=iboot-http-client.es.js.map
|