icms-api 0.1.1 → 0.1.2
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/icms-api.cjs.js +2 -2
- package/dist/icms-api.cjs.js.map +1 -1
- package/dist/icms-api.es.js +515 -505
- package/dist/icms-api.es.js.map +1 -1
- package/dist/icms-api.umd.js +2 -2
- package/dist/icms-api.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/icms-api.es.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import Xt from "pino";
|
|
2
|
+
import Wt from "pino-pretty";
|
|
3
|
+
import zt from "js-md5";
|
|
4
4
|
import ne from "crypto-js";
|
|
5
5
|
import "h3";
|
|
6
|
-
var
|
|
6
|
+
var Zt = {
|
|
7
7
|
TYPE_MGT: 0,
|
|
8
8
|
TYPE_C: 1,
|
|
9
9
|
TYPE_B: 2
|
|
10
|
-
},
|
|
10
|
+
}, er = Wt({
|
|
11
11
|
colorize: !0,
|
|
12
12
|
destination: process.stdout,
|
|
13
13
|
translateTime: "SYS:yyyy-mm-dd HH:MM:ss",
|
|
14
14
|
ignore: "pid,hostname",
|
|
15
15
|
messageFormat: "{msg}",
|
|
16
16
|
singleLine: !0
|
|
17
|
-
}),
|
|
17
|
+
}), U = Xt({
|
|
18
18
|
name: process.env.APP_NAME ?? "iBoot",
|
|
19
19
|
level: process.env.APP_ENV === "production" ? "info" : "debug",
|
|
20
20
|
nestedKey: "payload"
|
|
21
|
-
},
|
|
21
|
+
}, er), tr = {}, Mt = (e) => {
|
|
22
22
|
let t = e || 32, n = "";
|
|
23
23
|
for (let e = 0; e < t; e++) n += "ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678".charAt(Math.floor(Math.random() * 48));
|
|
24
24
|
return n;
|
|
25
25
|
};
|
|
26
|
-
function
|
|
26
|
+
function rr() {
|
|
27
27
|
try {
|
|
28
|
-
let e =
|
|
28
|
+
let e = tr.networkInterfaces();
|
|
29
29
|
for (let t of Object.keys(e)) {
|
|
30
30
|
let n = e[t];
|
|
31
31
|
if (n) {
|
|
@@ -34,12 +34,299 @@ function tr() {
|
|
|
34
34
|
}
|
|
35
35
|
return crypto.randomUUID().replace(/-/g, "").toUpperCase();
|
|
36
36
|
} catch {
|
|
37
|
-
return
|
|
37
|
+
return Mt(10);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
var k = {
|
|
41
|
+
IBOOT_DEVICE_ID: "dvid",
|
|
42
|
+
IBOOT_LANG: "lang",
|
|
43
|
+
IBOOT_WEBSITE_ID: "wid",
|
|
44
|
+
IBOOT_WEBSITE_NO: "wno",
|
|
45
|
+
IBOOT_TOKEN: "token",
|
|
46
|
+
IBOOT_USER: "user"
|
|
47
|
+
}, Y = "Content-Type", M = {
|
|
48
|
+
applicationJson: "application/json",
|
|
49
|
+
multipartFormData: "multipart/form-data",
|
|
50
|
+
applicationXwwwFormUrlencoded: "application/x-www-form-urlencoded"
|
|
51
|
+
}, nr = "zh-CN", K = {
|
|
52
|
+
DEVICE_ID: "Device-Id",
|
|
53
|
+
LANG: "Lang",
|
|
54
|
+
WEBSITE_ID: "Website-Id",
|
|
55
|
+
WEBSITE_NO: "Website-No"
|
|
56
|
+
}, Ee = {
|
|
57
|
+
maxAge: -1,
|
|
58
|
+
httpOnly: !0,
|
|
59
|
+
path: "/"
|
|
60
|
+
}, ut = () => ({
|
|
61
|
+
path: "/",
|
|
62
|
+
secure: process.env.APP_ENV === "production",
|
|
63
|
+
httpOnly: !0,
|
|
64
|
+
sameSite: "strict"
|
|
65
|
+
}), ir = (e) => {
|
|
66
|
+
if (e.get) {
|
|
67
|
+
let t = e.get(K.DEVICE_ID), n = e.get(K.LANG), r = e.get(K.WEBSITE_ID), i = e.get(K.WEBSITE_NO), a = {};
|
|
68
|
+
return t && t.length > 0 && (a.deviceId = t), n && n.length > 0 && (a.lang = n), r && r.length > 0 && (a.websiteId = r), i && i.length > 0 && (a.websiteNo = i), a;
|
|
69
|
+
}
|
|
70
|
+
throw Error("The get method of IStorage has not been implemented.");
|
|
71
|
+
}, or = (e) => {
|
|
72
|
+
if (e.get) {
|
|
73
|
+
let t = e.get(k.IBOOT_DEVICE_ID), n = e.get(k.IBOOT_LANG), r = e.get(k.IBOOT_WEBSITE_ID), i = e.get(k.IBOOT_WEBSITE_NO), a = {};
|
|
74
|
+
return t && t.length > 0 && (a.deviceId = t), n && n.length > 0 && (a.lang = n), r && r.length > 0 && (a.websiteId = r), i && i.length > 0 && (a.websiteNo = i), a;
|
|
75
|
+
}
|
|
76
|
+
throw Error("The get method of ICookies has not been implemented.");
|
|
77
|
+
}, Gr = (e, t) => {
|
|
78
|
+
if (e.set) t.deviceId && e.set(k.IBOOT_DEVICE_ID, t.deviceId), t.lang && e.set(k.IBOOT_LANG, t.lang), t.websiteId && e.set(k.IBOOT_WEBSITE_ID, t.websiteId), t.websiteNo && e.set(k.IBOOT_WEBSITE_NO, t.websiteNo);
|
|
79
|
+
else throw Error("The set method of ICookies has not been implemented.");
|
|
80
|
+
}, sr = (e) => {
|
|
81
|
+
if (e.get) {
|
|
82
|
+
let t = e[k.IBOOT_USER];
|
|
83
|
+
if (t && t.length > 0) {
|
|
84
|
+
let n = JSON.parse(t), r = n.username, i = n.userType.toString(), a = e[k.IBOOT_TOKEN];
|
|
85
|
+
if (a) return {
|
|
86
|
+
username: r,
|
|
87
|
+
utype: i,
|
|
88
|
+
token: a
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}, ar = (e, t) => {
|
|
93
|
+
let { id: n, name: r, username: i, nickname: a, headImg: o, token: s, lastLoginTime: c, deviceId: l, userType: d, mustChangePwd: f } = e, p = {
|
|
94
|
+
id: n,
|
|
95
|
+
name: r,
|
|
96
|
+
username: i,
|
|
97
|
+
nickname: a || r,
|
|
98
|
+
headImg: o,
|
|
99
|
+
lastLoginTime: c,
|
|
100
|
+
deviceId: l,
|
|
101
|
+
userType: d,
|
|
102
|
+
accountType: 0,
|
|
103
|
+
needToReview: !1,
|
|
104
|
+
socketOnline: !1,
|
|
105
|
+
mustChangePwd: f
|
|
106
|
+
};
|
|
107
|
+
t.cookies[k.IBOOT_TOKEN] = {
|
|
108
|
+
value: s,
|
|
109
|
+
options: ut()
|
|
110
|
+
}, t.cookies[k.IBOOT_USER] = {
|
|
111
|
+
value: JSON.stringify(p),
|
|
112
|
+
options: ut()
|
|
113
|
+
};
|
|
114
|
+
}, ur = (e) => {
|
|
115
|
+
if (!e.set) throw Error("cookies set function is undefined");
|
|
116
|
+
if (e.set(k.IBOOT_TOKEN, "", Ee), e.set(k.IBOOT_USER, "", Ee), !e.delete) throw Error("cookies delete function is undefined");
|
|
117
|
+
e.delete(k.IBOOT_TOKEN, Ee), e.delete(k.IBOOT_USER, Ee);
|
|
118
|
+
}, cr = class {
|
|
119
|
+
baseUrl;
|
|
120
|
+
helloMethod;
|
|
121
|
+
apiKey;
|
|
122
|
+
userType;
|
|
123
|
+
userFrom;
|
|
124
|
+
deviceId;
|
|
125
|
+
version = "1";
|
|
126
|
+
lang;
|
|
127
|
+
websiteId;
|
|
128
|
+
websiteNo;
|
|
129
|
+
constructor(e) {
|
|
130
|
+
process.env.APP_ENV === "production" || U.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 ?? Zt.TYPE_MGT, this.deviceId = e.deviceId ?? rr(), this.lang = e.lang ?? nr, this.websiteId = e.websiteId, this.websiteNo = e.websiteNo;
|
|
131
|
+
}
|
|
132
|
+
encrypt(e) {
|
|
133
|
+
let t = ne.enc.Utf8.parse(this.apiKey);
|
|
134
|
+
return ne.AES.encrypt(e, t).toString();
|
|
135
|
+
}
|
|
136
|
+
decrypt(e) {
|
|
137
|
+
let t = ne.enc.Utf8.parse(this.apiKey);
|
|
138
|
+
return ne.AES.decrypt(e, t, { mode: ne.mode.ECB }).toString(ne.enc.Utf8);
|
|
139
|
+
}
|
|
140
|
+
setHttpOptsToCookies = (e) => {
|
|
141
|
+
this.deviceId && this.deviceId.length > 0 && (e[k.IBOOT_DEVICE_ID] = this.deviceId), this.websiteId && this.websiteId.length > 0 && (e[k.IBOOT_WEBSITE_ID] = this.websiteId), this.websiteNo && this.websiteNo.length > 0 && (e[k.IBOOT_WEBSITE_NO] = this.websiteNo), this.lang && this.lang.length > 0 && (e[k.IBOOT_LANG] = this.lang);
|
|
142
|
+
};
|
|
143
|
+
async sign(e) {
|
|
144
|
+
let t = "&key=" + await this.helloIboot(), r = [];
|
|
145
|
+
for (let t of e.keys()) r.push(t);
|
|
146
|
+
r.sort((e, t) => {
|
|
147
|
+
let n = e.match(/(\d+)/), r = t.match(/(\d+)/);
|
|
148
|
+
return n && r && e.replace(/\d+/, "") === t.replace(/\d+/, "") ? parseInt(n[1]) - parseInt(r[1]) : e.toLowerCase().localeCompare(t.toLowerCase(), void 0, {
|
|
149
|
+
numeric: !0,
|
|
150
|
+
sensitivity: "base"
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
let i = [];
|
|
154
|
+
r.forEach((t) => {
|
|
155
|
+
let n = e.get(t);
|
|
156
|
+
n && i.push(t + "=" + n);
|
|
157
|
+
});
|
|
158
|
+
let a = i.join("&"), s = zt.md5((a + t).toLocaleUpperCase()), c = {
|
|
159
|
+
params: a,
|
|
160
|
+
md5: s
|
|
161
|
+
};
|
|
162
|
+
return U.debug(c, "API_SIGN"), s;
|
|
163
|
+
}
|
|
164
|
+
assemblyParameter(e, t) {
|
|
165
|
+
let n = e ?? new URLSearchParams(), r = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
166
|
+
return n.set("timezone", r), n.set("timestamp", Date.now().toString()), n.set("echostr", Mt(10)), n.set("version", this.version), n.set("deviceId", this.deviceId), n.set("webid", this.websiteId ?? ""), n.set("apiKey", this.apiKey), t && t.length > 0 && n.set("username", t), new URLSearchParams([...n].filter(([, e]) => e !== ""));
|
|
167
|
+
}
|
|
168
|
+
async assemblyHeader({ urlParams: e, token: t }) {
|
|
169
|
+
let n = {
|
|
170
|
+
"Res-Type": "json",
|
|
171
|
+
"Device-Id": this.deviceId,
|
|
172
|
+
"User-Type": t?.utype.toString() ?? this.userType.toString(),
|
|
173
|
+
"User-From": this.userFrom,
|
|
174
|
+
"Api-Key": this.apiKey
|
|
175
|
+
};
|
|
176
|
+
return n[Y] = M.applicationXwwwFormUrlencoded, this.lang && this.lang.length > 0 && (n.Lang = this.lang), this.websiteId && this.websiteId.length > 0 && (n["Web-Id"] = this.websiteId), this.websiteNo && this.websiteNo.length > 0 && (n["Web-No"] = this.websiteNo), t && (t.token && t.token.length > 0 && t.username && t.username.length > 0 && (n.Authorization = t.token, n.Username = t.username), t.xcsrf && (n[t.xcsrf.csrfHeader] = t.xcsrf.csrfToken)), n.Sign = await this.sign(e), n;
|
|
177
|
+
}
|
|
178
|
+
async helloIboot() {
|
|
179
|
+
if (this.helloMethod.length <= 0) return this.apiKey;
|
|
180
|
+
let e = this.getApiUrl(this.helloMethod), t = {
|
|
181
|
+
"Res-Type": "json",
|
|
182
|
+
"Api-Key": this.apiKey
|
|
183
|
+
};
|
|
184
|
+
t[Y] = M.applicationXwwwFormUrlencoded;
|
|
185
|
+
let n = {
|
|
186
|
+
url: e,
|
|
187
|
+
headers: t
|
|
188
|
+
};
|
|
189
|
+
U.debug(n, "HELLO");
|
|
190
|
+
let r = await fetch(e, {
|
|
191
|
+
method: "GET",
|
|
192
|
+
headers: t,
|
|
193
|
+
credentials: "include",
|
|
194
|
+
cache: "force-cache"
|
|
195
|
+
});
|
|
196
|
+
if (r.ok) {
|
|
197
|
+
let e = await r.json();
|
|
198
|
+
return U.debug(e.data, "HELLO RESULT"), e.data;
|
|
199
|
+
}
|
|
200
|
+
throw Error("hello iBoot error!");
|
|
201
|
+
}
|
|
202
|
+
getApiUrl(e) {
|
|
203
|
+
return `${this.baseUrl}/${e}`;
|
|
204
|
+
}
|
|
205
|
+
async csrf() {
|
|
206
|
+
let e = await this.get({ url: "guest/csrf" });
|
|
207
|
+
if (e.success) {
|
|
208
|
+
let t = e.data;
|
|
209
|
+
if (t) return t.csrfToken.toString();
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
async get({ url: e, data: t, token: n, cache: r = "default" }) {
|
|
213
|
+
let i = this.assemblyParameter(t ? new URLSearchParams(t) : void 0), a = await this.assemblyHeader({
|
|
214
|
+
urlParams: i,
|
|
215
|
+
token: n
|
|
216
|
+
}), s = `${this.getApiUrl(e)}?${i.toString()}`, c = {
|
|
217
|
+
url: s,
|
|
218
|
+
headers: a
|
|
219
|
+
};
|
|
220
|
+
U.info(c, "GET");
|
|
221
|
+
let l = await fetch(s, {
|
|
222
|
+
method: "GET",
|
|
223
|
+
headers: a,
|
|
224
|
+
credentials: "include",
|
|
225
|
+
cache: r
|
|
226
|
+
});
|
|
227
|
+
if (l.ok) {
|
|
228
|
+
let e = Object.fromEntries(l.headers.entries()), t = {
|
|
229
|
+
...await l.json(),
|
|
230
|
+
headers: e
|
|
231
|
+
};
|
|
232
|
+
return U.debug(t, "GET_RESULT"), t;
|
|
233
|
+
}
|
|
234
|
+
let u = {
|
|
235
|
+
code: l.status,
|
|
236
|
+
success: !1,
|
|
237
|
+
msg: l.statusText
|
|
238
|
+
};
|
|
239
|
+
return U.error(u), u;
|
|
240
|
+
}
|
|
241
|
+
async post({ url: e, data: t, token: n, cache: r = "default" }) {
|
|
242
|
+
let i = t ? { ...t } : {}, a = i.buffer ?? void 0, s = i.boundary ?? void 0;
|
|
243
|
+
a && delete i.buffer, s && delete i.boundary;
|
|
244
|
+
let c = this.assemblyParameter(new URLSearchParams(i)), l = await this.assemblyHeader({
|
|
245
|
+
urlParams: c,
|
|
246
|
+
token: n
|
|
247
|
+
});
|
|
248
|
+
a && s && (l[Y] = `multipart/form-data; boundary=${s}`);
|
|
249
|
+
let u = this.getApiUrl(e), f = {
|
|
250
|
+
url: u,
|
|
251
|
+
headers: l,
|
|
252
|
+
params: c
|
|
253
|
+
};
|
|
254
|
+
U.info(f, "POST");
|
|
255
|
+
let p = a ? `${u}?${c}` : u, m = await fetch(p, {
|
|
256
|
+
method: "POST",
|
|
257
|
+
headers: l,
|
|
258
|
+
body: a || c,
|
|
259
|
+
credentials: "include",
|
|
260
|
+
cache: r
|
|
261
|
+
});
|
|
262
|
+
if (m.ok) {
|
|
263
|
+
let e = Object.fromEntries(m.headers.entries()), t = {
|
|
264
|
+
...await m.json(),
|
|
265
|
+
headers: e
|
|
266
|
+
};
|
|
267
|
+
return U.debug(t, "POST_RESULT"), t;
|
|
268
|
+
}
|
|
269
|
+
let h = {
|
|
270
|
+
code: m.status,
|
|
271
|
+
success: !1,
|
|
272
|
+
msg: m.statusText
|
|
273
|
+
};
|
|
274
|
+
return U.error(h), h;
|
|
275
|
+
}
|
|
276
|
+
}, Qe = "Post request error!", ie = {
|
|
277
|
+
info: (e, t) => {
|
|
278
|
+
console.info(t, JSON.stringify(e));
|
|
279
|
+
},
|
|
280
|
+
debug: (e, t) => {
|
|
281
|
+
console.debug(t, JSON.stringify(e));
|
|
282
|
+
},
|
|
283
|
+
error: (e) => {
|
|
284
|
+
console.error(JSON.stringify(e));
|
|
285
|
+
}
|
|
286
|
+
}, Xr = (e) => {
|
|
287
|
+
if (e.get) {
|
|
288
|
+
let t = e.get(k.IBOOT_USER);
|
|
289
|
+
if (t && t.length > 0) return JSON.parse(t);
|
|
290
|
+
}
|
|
291
|
+
}, jt = async (e, t) => {
|
|
292
|
+
let n = t?.data ?? {}, r = t?.headers, i, a = t?.headers, o = new Headers(a);
|
|
293
|
+
if (n instanceof FormData ? i = n : (i = JSON.stringify(n), o.set(Y, M.applicationJson)), r) for (let e in r) {
|
|
294
|
+
let t = r[e];
|
|
295
|
+
t && o.set(e, t);
|
|
296
|
+
}
|
|
297
|
+
ie.info({
|
|
298
|
+
url: e,
|
|
299
|
+
headers: o
|
|
300
|
+
}, "POST");
|
|
301
|
+
let s = await fetch(e, {
|
|
302
|
+
method: "POST",
|
|
303
|
+
headers: o,
|
|
304
|
+
body: i
|
|
305
|
+
});
|
|
306
|
+
if (s.ok) {
|
|
307
|
+
let e = Object.fromEntries(s.headers.entries()), t = {
|
|
308
|
+
...await s.json(),
|
|
309
|
+
headers: e
|
|
310
|
+
};
|
|
311
|
+
return ie.debug(t, "POST_RESULT"), t;
|
|
312
|
+
}
|
|
313
|
+
let c = {
|
|
314
|
+
code: s.status,
|
|
315
|
+
success: !1,
|
|
316
|
+
msg: s.statusText
|
|
317
|
+
};
|
|
318
|
+
return ie.error(c), c;
|
|
319
|
+
}, zr = async (e, t) => {
|
|
320
|
+
let n = await jt(e, t);
|
|
321
|
+
if (n.success) return n.data;
|
|
322
|
+
if (t?.showError) {
|
|
323
|
+
t.showError(n.msg ?? Qe);
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
throw Error(n.msg ?? Qe);
|
|
327
|
+
}, ve = { exports: {} }, Te = {}, Ie = {}, Ae = {}, lt;
|
|
328
|
+
function hr() {
|
|
329
|
+
return lt || (lt = 1, (function(e) {
|
|
43
330
|
Object.defineProperty(e, "__esModule", { value: !0 }), Object.defineProperty(e, "detectDomainLocale", {
|
|
44
331
|
enumerable: !0,
|
|
45
332
|
get: function() {
|
|
@@ -55,11 +342,11 @@ function rr() {
|
|
|
55
342
|
}
|
|
56
343
|
}
|
|
57
344
|
}
|
|
58
|
-
})(
|
|
345
|
+
})(Ae)), Ae;
|
|
59
346
|
}
|
|
60
|
-
var
|
|
61
|
-
function
|
|
62
|
-
return
|
|
347
|
+
var Oe = {}, xe = {}, dt;
|
|
348
|
+
function fr() {
|
|
349
|
+
return dt || (dt = 1, (function(e) {
|
|
63
350
|
Object.defineProperty(e, "__esModule", { value: !0 }), Object.defineProperty(e, "removeTrailingSlash", {
|
|
64
351
|
enumerable: !0,
|
|
65
352
|
get: function() {
|
|
@@ -69,11 +356,11 @@ function nr() {
|
|
|
69
356
|
function t(e) {
|
|
70
357
|
return e.replace(/\/$/, "") || "/";
|
|
71
358
|
}
|
|
72
|
-
})(
|
|
359
|
+
})(xe)), xe;
|
|
73
360
|
}
|
|
74
|
-
var
|
|
75
|
-
function
|
|
76
|
-
return
|
|
361
|
+
var Ne = {}, Ce = {}, ht;
|
|
362
|
+
function tt() {
|
|
363
|
+
return ht || (ht = 1, (function(e) {
|
|
77
364
|
Object.defineProperty(e, "__esModule", { value: !0 }), Object.defineProperty(e, "parsePath", {
|
|
78
365
|
enumerable: !0,
|
|
79
366
|
get: function() {
|
|
@@ -92,95 +379,95 @@ function et() {
|
|
|
92
379
|
hash: ""
|
|
93
380
|
};
|
|
94
381
|
}
|
|
95
|
-
})(
|
|
382
|
+
})(Ce)), Ce;
|
|
96
383
|
}
|
|
97
|
-
var
|
|
98
|
-
function
|
|
99
|
-
return
|
|
384
|
+
var ft;
|
|
385
|
+
function qt() {
|
|
386
|
+
return ft || (ft = 1, (function(e) {
|
|
100
387
|
Object.defineProperty(e, "__esModule", { value: !0 }), Object.defineProperty(e, "addPathPrefix", {
|
|
101
388
|
enumerable: !0,
|
|
102
389
|
get: function() {
|
|
103
390
|
return n;
|
|
104
391
|
}
|
|
105
392
|
});
|
|
106
|
-
let t =
|
|
393
|
+
let t = tt();
|
|
107
394
|
function n(e, n) {
|
|
108
395
|
if (!e.startsWith("/") || !n) return e;
|
|
109
396
|
let { pathname: r, query: i, hash: a } = (0, t.parsePath)(e);
|
|
110
397
|
return "" + n + r + i + a;
|
|
111
398
|
}
|
|
112
|
-
})(
|
|
399
|
+
})(Ne)), Ne;
|
|
113
400
|
}
|
|
114
|
-
var
|
|
115
|
-
function
|
|
116
|
-
return
|
|
401
|
+
var Le = {}, pt;
|
|
402
|
+
function pr() {
|
|
403
|
+
return pt || (pt = 1, (function(e) {
|
|
117
404
|
Object.defineProperty(e, "__esModule", { value: !0 }), Object.defineProperty(e, "addPathSuffix", {
|
|
118
405
|
enumerable: !0,
|
|
119
406
|
get: function() {
|
|
120
407
|
return n;
|
|
121
408
|
}
|
|
122
409
|
});
|
|
123
|
-
let t =
|
|
410
|
+
let t = tt();
|
|
124
411
|
function n(e, n) {
|
|
125
412
|
if (!e.startsWith("/") || !n) return e;
|
|
126
413
|
let { pathname: r, query: i, hash: a } = (0, t.parsePath)(e);
|
|
127
414
|
return "" + r + n + i + a;
|
|
128
415
|
}
|
|
129
|
-
})(
|
|
416
|
+
})(Le)), Le;
|
|
130
417
|
}
|
|
131
|
-
var
|
|
132
|
-
function
|
|
133
|
-
return
|
|
418
|
+
var ke = {}, Ue = {}, mt;
|
|
419
|
+
function rt() {
|
|
420
|
+
return mt || (mt = 1, (function(e) {
|
|
134
421
|
Object.defineProperty(e, "__esModule", { value: !0 }), Object.defineProperty(e, "pathHasPrefix", {
|
|
135
422
|
enumerable: !0,
|
|
136
423
|
get: function() {
|
|
137
424
|
return n;
|
|
138
425
|
}
|
|
139
426
|
});
|
|
140
|
-
let t =
|
|
427
|
+
let t = tt();
|
|
141
428
|
function n(e, n) {
|
|
142
429
|
if (typeof e != "string") return !1;
|
|
143
430
|
let { pathname: r } = (0, t.parsePath)(e);
|
|
144
431
|
return r === n || r.startsWith(n + "/");
|
|
145
432
|
}
|
|
146
|
-
})(
|
|
433
|
+
})(Ue)), Ue;
|
|
147
434
|
}
|
|
148
|
-
var
|
|
149
|
-
function
|
|
150
|
-
return
|
|
435
|
+
var _t;
|
|
436
|
+
function mr() {
|
|
437
|
+
return _t || (_t = 1, (function(e) {
|
|
151
438
|
Object.defineProperty(e, "__esModule", { value: !0 }), Object.defineProperty(e, "addLocale", {
|
|
152
439
|
enumerable: !0,
|
|
153
440
|
get: function() {
|
|
154
441
|
return r;
|
|
155
442
|
}
|
|
156
443
|
});
|
|
157
|
-
let t =
|
|
444
|
+
let t = qt(), n = rt();
|
|
158
445
|
function r(e, r, i, a) {
|
|
159
446
|
if (!r || r === i) return e;
|
|
160
447
|
let o = e.toLowerCase();
|
|
161
448
|
return !a && ((0, n.pathHasPrefix)(o, "/api") || (0, n.pathHasPrefix)(o, "/" + r.toLowerCase())) ? e : (0, t.addPathPrefix)(e, "/" + r);
|
|
162
449
|
}
|
|
163
|
-
})(
|
|
450
|
+
})(ke)), ke;
|
|
164
451
|
}
|
|
165
|
-
var
|
|
166
|
-
function
|
|
167
|
-
return
|
|
452
|
+
var bt;
|
|
453
|
+
function _r() {
|
|
454
|
+
return bt || (bt = 1, (function(e) {
|
|
168
455
|
Object.defineProperty(e, "__esModule", { value: !0 }), Object.defineProperty(e, "formatNextPathnameInfo", {
|
|
169
456
|
enumerable: !0,
|
|
170
457
|
get: function() {
|
|
171
458
|
return a;
|
|
172
459
|
}
|
|
173
460
|
});
|
|
174
|
-
let t =
|
|
461
|
+
let t = fr(), n = qt(), r = pr(), i = mr();
|
|
175
462
|
function a(e) {
|
|
176
463
|
let a = (0, i.addLocale)(e.pathname, e.locale, e.buildId ? void 0 : e.defaultLocale, e.ignorePrefix);
|
|
177
464
|
return (e.buildId || !e.trailingSlash) && (a = (0, t.removeTrailingSlash)(a)), e.buildId && (a = (0, r.addPathSuffix)((0, n.addPathPrefix)(a, "/_next/data/" + e.buildId), e.pathname === "/" ? "index.json" : ".json")), a = (0, n.addPathPrefix)(a, e.basePath), !e.buildId && e.trailingSlash ? a.endsWith("/") ? a : (0, r.addPathSuffix)(a, "/") : (0, t.removeTrailingSlash)(a);
|
|
178
465
|
}
|
|
179
|
-
})(
|
|
466
|
+
})(Oe)), Oe;
|
|
180
467
|
}
|
|
181
|
-
var
|
|
182
|
-
function
|
|
183
|
-
return
|
|
468
|
+
var De = {}, gt;
|
|
469
|
+
function br() {
|
|
470
|
+
return gt || (gt = 1, (function(e) {
|
|
184
471
|
Object.defineProperty(e, "__esModule", { value: !0 }), Object.defineProperty(e, "getHostname", {
|
|
185
472
|
enumerable: !0,
|
|
186
473
|
get: function() {
|
|
@@ -194,11 +481,11 @@ function ar() {
|
|
|
194
481
|
else return;
|
|
195
482
|
return n.toLowerCase();
|
|
196
483
|
}
|
|
197
|
-
})(
|
|
484
|
+
})(De)), De;
|
|
198
485
|
}
|
|
199
|
-
var
|
|
200
|
-
function
|
|
201
|
-
return
|
|
486
|
+
var Me = {}, je = {}, wt;
|
|
487
|
+
function gr() {
|
|
488
|
+
return wt || (wt = 1, (function(e) {
|
|
202
489
|
Object.defineProperty(e, "__esModule", { value: !0 }), Object.defineProperty(e, "normalizeLocalePath", {
|
|
203
490
|
enumerable: !0,
|
|
204
491
|
get: function() {
|
|
@@ -212,35 +499,35 @@ function ur() {
|
|
|
212
499
|
detectedLocale: n
|
|
213
500
|
};
|
|
214
501
|
}
|
|
215
|
-
})(
|
|
502
|
+
})(je)), je;
|
|
216
503
|
}
|
|
217
|
-
var
|
|
218
|
-
function
|
|
219
|
-
return
|
|
504
|
+
var qe = {}, Et;
|
|
505
|
+
function wr() {
|
|
506
|
+
return Et || (Et = 1, (function(e) {
|
|
220
507
|
Object.defineProperty(e, "__esModule", { value: !0 }), Object.defineProperty(e, "removePathPrefix", {
|
|
221
508
|
enumerable: !0,
|
|
222
509
|
get: function() {
|
|
223
510
|
return n;
|
|
224
511
|
}
|
|
225
512
|
});
|
|
226
|
-
let t =
|
|
513
|
+
let t = rt();
|
|
227
514
|
function n(e, n) {
|
|
228
515
|
if (!(0, t.pathHasPrefix)(e, n)) return e;
|
|
229
516
|
let r = e.slice(n.length);
|
|
230
517
|
return r.startsWith("/") ? r : "/" + r;
|
|
231
518
|
}
|
|
232
|
-
})(
|
|
519
|
+
})(qe)), qe;
|
|
233
520
|
}
|
|
234
|
-
var
|
|
235
|
-
function
|
|
236
|
-
return
|
|
521
|
+
var vt;
|
|
522
|
+
function Er() {
|
|
523
|
+
return vt || (vt = 1, (function(e) {
|
|
237
524
|
Object.defineProperty(e, "__esModule", { value: !0 }), Object.defineProperty(e, "getNextPathnameInfo", {
|
|
238
525
|
enumerable: !0,
|
|
239
526
|
get: function() {
|
|
240
527
|
return i;
|
|
241
528
|
}
|
|
242
529
|
});
|
|
243
|
-
let t =
|
|
530
|
+
let t = gr(), n = wr(), r = rt();
|
|
244
531
|
function i(e, i) {
|
|
245
532
|
let { basePath: a, i18n: o, trailingSlash: s } = i.nextConfig ?? {}, c = {
|
|
246
533
|
pathname: e,
|
|
@@ -258,18 +545,18 @@ function lr() {
|
|
|
258
545
|
}
|
|
259
546
|
return c;
|
|
260
547
|
}
|
|
261
|
-
})(
|
|
548
|
+
})(Me)), Me;
|
|
262
549
|
}
|
|
263
|
-
var
|
|
264
|
-
function
|
|
265
|
-
return
|
|
550
|
+
var Rt;
|
|
551
|
+
function Ht() {
|
|
552
|
+
return Rt || (Rt = 1, (function(e) {
|
|
266
553
|
Object.defineProperty(e, "__esModule", { value: !0 }), Object.defineProperty(e, "NextURL", {
|
|
267
554
|
enumerable: !0,
|
|
268
555
|
get: function() {
|
|
269
556
|
return c;
|
|
270
557
|
}
|
|
271
558
|
});
|
|
272
|
-
let t =
|
|
559
|
+
let t = hr(), n = _r(), r = br(), i = Er(), a = /(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/;
|
|
273
560
|
function o(e, t) {
|
|
274
561
|
return new URL(String(e).replace(a, "localhost"), t && String(t).replace(a, "localhost"));
|
|
275
562
|
}
|
|
@@ -426,11 +713,11 @@ function jt() {
|
|
|
426
713
|
return new c(String(this), this[s].options);
|
|
427
714
|
}
|
|
428
715
|
}
|
|
429
|
-
})(
|
|
716
|
+
})(Ie)), Ie;
|
|
430
717
|
}
|
|
431
|
-
var
|
|
432
|
-
function
|
|
433
|
-
return
|
|
718
|
+
var He = {}, Fe = {}, Pt;
|
|
719
|
+
function vr() {
|
|
720
|
+
return Pt || (Pt = 1, (function(e) {
|
|
434
721
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
435
722
|
function t(e, t) {
|
|
436
723
|
for (var n in t) Object.defineProperty(e, n, {
|
|
@@ -452,7 +739,7 @@ function dr() {
|
|
|
452
739
|
return T;
|
|
453
740
|
},
|
|
454
741
|
ESLINT_DEFAULT_DIRS: function() {
|
|
455
|
-
return
|
|
742
|
+
return wn;
|
|
456
743
|
},
|
|
457
744
|
GSP_NO_RETURNED_VALUE: function() {
|
|
458
745
|
return B;
|
|
@@ -461,7 +748,7 @@ function dr() {
|
|
|
461
748
|
return H;
|
|
462
749
|
},
|
|
463
750
|
GSSP_NO_RETURNED_VALUE: function() {
|
|
464
|
-
return
|
|
751
|
+
return Sn;
|
|
465
752
|
},
|
|
466
753
|
INSTRUMENTATION_HOOK_FILENAME: function() {
|
|
467
754
|
return C;
|
|
@@ -524,22 +811,22 @@ function dr() {
|
|
|
524
811
|
return a;
|
|
525
812
|
},
|
|
526
813
|
PUBLIC_DIR_MIDDLEWARE_CONFLICT: function() {
|
|
527
|
-
return
|
|
814
|
+
return P;
|
|
528
815
|
},
|
|
529
816
|
ROOT_DIR_ALIAS: function() {
|
|
530
817
|
return E;
|
|
531
818
|
},
|
|
532
819
|
RSC_ACTION_CLIENT_WRAPPER_ALIAS: function() {
|
|
533
|
-
return
|
|
820
|
+
return N;
|
|
534
821
|
},
|
|
535
822
|
RSC_ACTION_ENCRYPTION_ALIAS: function() {
|
|
536
|
-
return
|
|
823
|
+
return xn;
|
|
537
824
|
},
|
|
538
825
|
RSC_ACTION_PROXY_ALIAS: function() {
|
|
539
|
-
return
|
|
826
|
+
return j;
|
|
540
827
|
},
|
|
541
828
|
RSC_ACTION_VALIDATE_ALIAS: function() {
|
|
542
|
-
return
|
|
829
|
+
return A;
|
|
543
830
|
},
|
|
544
831
|
RSC_MOD_REF_PROXY_ALIAS: function() {
|
|
545
832
|
return O;
|
|
@@ -554,19 +841,19 @@ function dr() {
|
|
|
554
841
|
return z;
|
|
555
842
|
},
|
|
556
843
|
SERVER_PROPS_GET_INIT_PROPS_CONFLICT: function() {
|
|
557
|
-
return
|
|
844
|
+
return I;
|
|
558
845
|
},
|
|
559
846
|
SERVER_PROPS_SSG_CONFLICT: function() {
|
|
560
|
-
return
|
|
847
|
+
return L;
|
|
561
848
|
},
|
|
562
849
|
SERVER_RUNTIME: function() {
|
|
563
|
-
return
|
|
850
|
+
return Tn;
|
|
564
851
|
},
|
|
565
852
|
SSG_FALLBACK_EXPORT_ERROR: function() {
|
|
566
|
-
return
|
|
853
|
+
return Cn;
|
|
567
854
|
},
|
|
568
855
|
SSG_GET_INITIAL_PROPS_CONFLICT: function() {
|
|
569
|
-
return
|
|
856
|
+
return F;
|
|
570
857
|
},
|
|
571
858
|
STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR: function() {
|
|
572
859
|
return R;
|
|
@@ -578,16 +865,16 @@ function dr() {
|
|
|
578
865
|
return q;
|
|
579
866
|
},
|
|
580
867
|
WEBPACK_RESOURCE_QUERIES: function() {
|
|
581
|
-
return
|
|
868
|
+
return En;
|
|
582
869
|
}
|
|
583
870
|
});
|
|
584
|
-
let n = "nxtP", r = "nxtI", i = "x-prerender-revalidate", a = "x-prerender-revalidate-if-generated", o = ".prefetch.rsc", s = ".rsc", c = ".action", l = ".json", u = ".meta", d = ".body", f = "x-next-cache-tags", p = "x-next-cache-soft-tags", m = "x-next-revalidated-tags", h = "x-next-revalidate-tag-token", g = 128, _ = 256, v = 1024, y = "_N_T_", b = 31536e3, x = "middleware", S = `(?:src/)?${x}`, C = "instrumentation", w = "private-next-pages", T = "private-dot-next", E = "private-next-root-dir", D = "private-next-app-dir", O = "private-next-rsc-mod-ref-proxy",
|
|
871
|
+
let n = "nxtP", r = "nxtI", i = "x-prerender-revalidate", a = "x-prerender-revalidate-if-generated", o = ".prefetch.rsc", s = ".rsc", c = ".action", l = ".json", u = ".meta", d = ".body", f = "x-next-cache-tags", p = "x-next-cache-soft-tags", m = "x-next-revalidated-tags", h = "x-next-revalidate-tag-token", g = 128, _ = 256, v = 1024, y = "_N_T_", b = 31536e3, x = "middleware", S = `(?:src/)?${x}`, C = "instrumentation", w = "private-next-pages", T = "private-dot-next", E = "private-next-root-dir", D = "private-next-app-dir", O = "private-next-rsc-mod-ref-proxy", A = "private-next-rsc-action-validate", j = "private-next-rsc-server-reference", xn = "private-next-rsc-action-encryption", N = "private-next-rsc-action-client-wrapper", P = "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", F = "You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps", I = "You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.", L = "You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps", R = "can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props", z = "pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export", B = "Your `getStaticProps` function did not return an object. Did you forget to add a `return`?", Sn = "Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?", V = "The `unstable_revalidate` property is available for general use.\nPlease use `revalidate` instead.", H = "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", W = "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", Cn = "Pages with `fallback` enabled in `getStaticPaths` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export", wn = [
|
|
585
872
|
"app",
|
|
586
873
|
"pages",
|
|
587
874
|
"components",
|
|
588
875
|
"lib",
|
|
589
876
|
"src"
|
|
590
|
-
],
|
|
877
|
+
], Tn = {
|
|
591
878
|
edge: "edge",
|
|
592
879
|
experimentalEdge: "experimental-edge",
|
|
593
880
|
nodejs: "nodejs"
|
|
@@ -626,17 +913,17 @@ function dr() {
|
|
|
626
913
|
G.instrument
|
|
627
914
|
]
|
|
628
915
|
}
|
|
629
|
-
},
|
|
916
|
+
}, En = {
|
|
630
917
|
edgeSSREntry: "__next_edge_ssr_entry__",
|
|
631
918
|
metadata: "__next_metadata__",
|
|
632
919
|
metadataRoute: "__next_metadata_route__",
|
|
633
920
|
metadataImageMeta: "__next_metadata_image_meta__"
|
|
634
921
|
};
|
|
635
|
-
})(
|
|
922
|
+
})(Fe)), Fe;
|
|
636
923
|
}
|
|
637
|
-
var
|
|
638
|
-
function
|
|
639
|
-
return
|
|
924
|
+
var yt;
|
|
925
|
+
function Ft() {
|
|
926
|
+
return yt || (yt = 1, (function(e) {
|
|
640
927
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
641
928
|
function t(e, t) {
|
|
642
929
|
for (var n in t) Object.defineProperty(e, n, {
|
|
@@ -661,7 +948,7 @@ function qt() {
|
|
|
661
948
|
return o;
|
|
662
949
|
}
|
|
663
950
|
});
|
|
664
|
-
let n =
|
|
951
|
+
let n = vr();
|
|
665
952
|
function r(e) {
|
|
666
953
|
let t = new Headers();
|
|
667
954
|
for (let [n, r] of Object.entries(e)) {
|
|
@@ -704,11 +991,11 @@ function qt() {
|
|
|
704
991
|
let r = [n.NEXT_QUERY_PARAM_PREFIX, n.NEXT_INTERCEPTION_MARKER_PREFIX];
|
|
705
992
|
for (let n of r) e !== n && e.startsWith(n) && t(e.substring(n.length));
|
|
706
993
|
}
|
|
707
|
-
})(
|
|
994
|
+
})(He)), He;
|
|
708
995
|
}
|
|
709
|
-
var
|
|
710
|
-
function
|
|
711
|
-
return
|
|
996
|
+
var Be = {}, St;
|
|
997
|
+
function Rr() {
|
|
998
|
+
return St || (St = 1, (function(e) {
|
|
712
999
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
713
1000
|
function t(e, t) {
|
|
714
1001
|
for (var n in t) Object.defineProperty(e, n, {
|
|
@@ -749,12 +1036,12 @@ function hr() {
|
|
|
749
1036
|
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 ");
|
|
750
1037
|
}
|
|
751
1038
|
}
|
|
752
|
-
})(
|
|
1039
|
+
})(Be)), Be;
|
|
753
1040
|
}
|
|
754
|
-
var
|
|
755
|
-
function
|
|
756
|
-
if (
|
|
757
|
-
|
|
1041
|
+
var Ge = {}, Xe, Tt;
|
|
1042
|
+
function Pr() {
|
|
1043
|
+
if (Tt) return Xe;
|
|
1044
|
+
Tt = 1;
|
|
758
1045
|
var e = Object.defineProperty, t = Object.getOwnPropertyDescriptor, n = Object.getOwnPropertyNames, r = Object.prototype.hasOwnProperty, i = (t, n) => {
|
|
759
1046
|
for (var r in n) e(t, r, {
|
|
760
1047
|
get: n[r],
|
|
@@ -773,7 +1060,7 @@ function fr() {
|
|
|
773
1060
|
parseCookie: () => l,
|
|
774
1061
|
parseSetCookie: () => u,
|
|
775
1062
|
stringifyCookie: () => c
|
|
776
|
-
}),
|
|
1063
|
+
}), Xe = o(s);
|
|
777
1064
|
function c(e) {
|
|
778
1065
|
let t = [
|
|
779
1066
|
"path" in e && e.path && `Path=${e.path}`,
|
|
@@ -980,11 +1267,11 @@ function fr() {
|
|
|
980
1267
|
}) {
|
|
981
1268
|
return typeof e.expires == "number" && (e.expires = new Date(e.expires)), e.maxAge && (e.expires = new Date(Date.now() + e.maxAge * 1e3)), (e.path === null || e.path === void 0) && (e.path = "/"), e;
|
|
982
1269
|
}
|
|
983
|
-
return
|
|
1270
|
+
return Xe;
|
|
984
1271
|
}
|
|
985
|
-
var
|
|
986
|
-
function
|
|
987
|
-
return
|
|
1272
|
+
var It;
|
|
1273
|
+
function Ze() {
|
|
1274
|
+
return It || (It = 1, (function(e) {
|
|
988
1275
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
989
1276
|
function t(e, t) {
|
|
990
1277
|
for (var n in t) Object.defineProperty(e, n, {
|
|
@@ -1003,12 +1290,12 @@ function $e() {
|
|
|
1003
1290
|
return n.stringifyCookie;
|
|
1004
1291
|
}
|
|
1005
1292
|
});
|
|
1006
|
-
let n =
|
|
1007
|
-
})(
|
|
1293
|
+
let n = Pr();
|
|
1294
|
+
})(Ge)), Ge;
|
|
1008
1295
|
}
|
|
1009
|
-
var
|
|
1010
|
-
function
|
|
1011
|
-
return
|
|
1296
|
+
var At;
|
|
1297
|
+
function yr() {
|
|
1298
|
+
return At || (At = 1, (function(e) {
|
|
1012
1299
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
1013
1300
|
function t(e, t) {
|
|
1014
1301
|
for (var n in t) Object.defineProperty(e, n, {
|
|
@@ -1024,7 +1311,7 @@ function pr() {
|
|
|
1024
1311
|
return s;
|
|
1025
1312
|
}
|
|
1026
1313
|
});
|
|
1027
|
-
let n =
|
|
1314
|
+
let n = Ht(), r = Ft(), i = Rr(), a = Ze(), o = /* @__PURE__ */ Symbol("internal request");
|
|
1028
1315
|
class s extends Request {
|
|
1029
1316
|
constructor(e, t = {}) {
|
|
1030
1317
|
let i = typeof e != "string" && "url" in e ? e.url : String(e);
|
|
@@ -1087,9 +1374,9 @@ function pr() {
|
|
|
1087
1374
|
}
|
|
1088
1375
|
})(Te)), Te;
|
|
1089
1376
|
}
|
|
1090
|
-
var
|
|
1091
|
-
function
|
|
1092
|
-
return
|
|
1377
|
+
var We = {}, ze = {}, Ot;
|
|
1378
|
+
function Sr() {
|
|
1379
|
+
return Ot || (Ot = 1, (function(e) {
|
|
1093
1380
|
Object.defineProperty(e, "__esModule", { value: !0 }), Object.defineProperty(e, "ReflectAdapter", {
|
|
1094
1381
|
enumerable: !0,
|
|
1095
1382
|
get: function() {
|
|
@@ -1111,18 +1398,18 @@ function mr() {
|
|
|
1111
1398
|
return Reflect.deleteProperty(e, t);
|
|
1112
1399
|
}
|
|
1113
1400
|
}
|
|
1114
|
-
})(
|
|
1401
|
+
})(ze)), ze;
|
|
1115
1402
|
}
|
|
1116
|
-
var
|
|
1117
|
-
function
|
|
1118
|
-
return
|
|
1403
|
+
var xt;
|
|
1404
|
+
function Tr() {
|
|
1405
|
+
return xt || (xt = 1, (function(e) {
|
|
1119
1406
|
Object.defineProperty(e, "__esModule", { value: !0 }), Object.defineProperty(e, "NextResponse", {
|
|
1120
1407
|
enumerable: !0,
|
|
1121
1408
|
get: function() {
|
|
1122
1409
|
return l;
|
|
1123
1410
|
}
|
|
1124
1411
|
});
|
|
1125
|
-
let t =
|
|
1412
|
+
let t = Ze(), n = Ht(), r = Ft(), i = Sr(), a = Ze(), o = /* @__PURE__ */ Symbol("internal response"), s = /* @__PURE__ */ new Set([
|
|
1126
1413
|
301,
|
|
1127
1414
|
302,
|
|
1128
1415
|
303,
|
|
@@ -1205,11 +1492,11 @@ function _r() {
|
|
|
1205
1492
|
});
|
|
1206
1493
|
}
|
|
1207
1494
|
}
|
|
1208
|
-
})(
|
|
1495
|
+
})(We)), We;
|
|
1209
1496
|
}
|
|
1210
|
-
var
|
|
1211
|
-
function
|
|
1212
|
-
return
|
|
1497
|
+
var Ve = {}, Nt;
|
|
1498
|
+
function Ir() {
|
|
1499
|
+
return Nt || (Nt = 1, (function(e) {
|
|
1213
1500
|
Object.defineProperty(e, "__esModule", { value: !0 }), Object.defineProperty(e, "ImageResponse", {
|
|
1214
1501
|
enumerable: !0,
|
|
1215
1502
|
get: function() {
|
|
@@ -1219,27 +1506,27 @@ function br() {
|
|
|
1219
1506
|
function t() {
|
|
1220
1507
|
throw Error("ImageResponse moved from \"next/server\" to \"next/og\" since Next.js 14, please import from \"next/og\" instead");
|
|
1221
1508
|
}
|
|
1222
|
-
})(
|
|
1509
|
+
})(Ve)), Ve;
|
|
1223
1510
|
}
|
|
1224
|
-
var
|
|
1225
|
-
function
|
|
1226
|
-
return
|
|
1511
|
+
var Ke = {}, Ye = { exports: {} }, Ct;
|
|
1512
|
+
function Ar() {
|
|
1513
|
+
return Ct || (Ct = 1, (() => {
|
|
1227
1514
|
var e = { 226: function(e, t) {
|
|
1228
1515
|
(function(n, r) {
|
|
1229
|
-
var i = "1.0.35", a = "", o = "?", s = "function", c = "undefined", l = "object", u = "string", d = "major", f = "model", p = "name", m = "type", h = "vendor", g = "version", _ = "architecture", v = "console", y = "mobile", b = "tablet", x = "smarttv", S = "wearable", C = "embedded", w = 350, T = "Amazon", E = "Apple", D = "ASUS", O = "BlackBerry",
|
|
1516
|
+
var i = "1.0.35", a = "", o = "?", s = "function", c = "undefined", l = "object", u = "string", d = "major", f = "model", p = "name", m = "type", h = "vendor", g = "version", _ = "architecture", v = "console", y = "mobile", b = "tablet", x = "smarttv", S = "wearable", C = "embedded", w = 350, T = "Amazon", E = "Apple", D = "ASUS", O = "BlackBerry", A = "Browser", j = "Chrome", xn = "Edge", N = "Firefox", P = "Google", F = "Huawei", I = "LG", L = "Microsoft", R = "Motorola", z = "Opera", B = "Samsung", Sn = "Sharp", V = "Sony", H = "Xiaomi", W = "Zebra", Cn = "Facebook", wn = "Chromium OS", Tn = "Mac OS", G = function(e, t) {
|
|
1230
1517
|
var n = {};
|
|
1231
1518
|
for (var r in e) t[r] && t[r].length % 2 == 0 ? n[r] = t[r].concat(e[r]) : n[r] = e[r];
|
|
1232
1519
|
return n;
|
|
1233
1520
|
}, q = function(e) {
|
|
1234
1521
|
for (var t = {}, n = 0; n < e.length; n++) t[e[n].toUpperCase()] = e[n];
|
|
1235
1522
|
return t;
|
|
1236
|
-
},
|
|
1523
|
+
}, En = function(e, t) {
|
|
1237
1524
|
return typeof e === u ? J(t).indexOf(J(e)) !== -1 : !1;
|
|
1238
1525
|
}, J = function(e) {
|
|
1239
1526
|
return e.toLowerCase();
|
|
1240
|
-
},
|
|
1527
|
+
}, Dn = function(e) {
|
|
1241
1528
|
return typeof e === u ? e.replace(/[^\d\.]/g, a).split(".")[0] : r;
|
|
1242
|
-
},
|
|
1529
|
+
}, On = function(e, t) {
|
|
1243
1530
|
if (typeof e === u) return e = e.replace(/^\s\s*/, a), typeof t === c ? e : e.substring(0, w);
|
|
1244
1531
|
}, X = function(e, t) {
|
|
1245
1532
|
for (var n = 0, i, a, o, c, u, d; n < t.length && !u;) {
|
|
@@ -1247,12 +1534,12 @@ function gr() {
|
|
|
1247
1534
|
for (i = a = 0; i < f.length && !u && f[i];) if (u = f[i++].exec(e), u) for (o = 0; o < p.length; o++) d = u[++a], c = p[o], typeof c === l && c.length > 0 ? c.length === 2 ? typeof c[1] == s ? this[c[0]] = c[1].call(this, d) : this[c[0]] = c[1] : c.length === 3 ? typeof c[1] === s && !(c[1].exec && c[1].test) ? this[c[0]] = d ? c[1].call(this, d, c[2]) : r : this[c[0]] = d ? d.replace(c[1], c[2]) : r : c.length === 4 && (this[c[0]] = d ? c[3].call(this, d.replace(c[1], c[2])) : r) : this[c] = d || r;
|
|
1248
1535
|
n += 2;
|
|
1249
1536
|
}
|
|
1250
|
-
},
|
|
1537
|
+
}, kn = function(e, t) {
|
|
1251
1538
|
for (var n in t) if (typeof t[n] === l && t[n].length > 0) {
|
|
1252
|
-
for (var i = 0; i < t[n].length; i++) if (
|
|
1253
|
-
} else if (
|
|
1539
|
+
for (var i = 0; i < t[n].length; i++) if (En(t[n][i], e)) return n === o ? r : n;
|
|
1540
|
+
} else if (En(t[n], e)) return n === o ? r : n;
|
|
1254
1541
|
return e;
|
|
1255
|
-
},
|
|
1542
|
+
}, An = {
|
|
1256
1543
|
"1.0": "/8",
|
|
1257
1544
|
1.2: "/1",
|
|
1258
1545
|
1.3: "/3",
|
|
@@ -1261,7 +1548,7 @@ function gr() {
|
|
|
1261
1548
|
"2.0.3": "/417",
|
|
1262
1549
|
"2.0.4": "/419",
|
|
1263
1550
|
"?": "/"
|
|
1264
|
-
},
|
|
1551
|
+
}, jn = {
|
|
1265
1552
|
ME: "4.90",
|
|
1266
1553
|
"NT 3.11": "NT3.51",
|
|
1267
1554
|
"NT 4.0": "NT4.0",
|
|
@@ -1273,7 +1560,7 @@ function gr() {
|
|
|
1273
1560
|
8.1: "NT 6.3",
|
|
1274
1561
|
10: ["NT 6.4", "NT 10.0"],
|
|
1275
1562
|
RT: "ARM"
|
|
1276
|
-
},
|
|
1563
|
+
}, Mn = {
|
|
1277
1564
|
browser: [
|
|
1278
1565
|
[/\b(?:crmo|crios)\/([\w\.]+)/i],
|
|
1279
1566
|
[g, [p, "Chrome"]],
|
|
@@ -1301,7 +1588,7 @@ function gr() {
|
|
|
1301
1588
|
],
|
|
1302
1589
|
[p, g],
|
|
1303
1590
|
[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],
|
|
1304
|
-
[g, [p, "UC" +
|
|
1591
|
+
[g, [p, "UC" + A]],
|
|
1305
1592
|
[/microm.+\bqbcore\/([\w\.]+)/i, /\bqbcore\/([\w\.]+).+microm/i],
|
|
1306
1593
|
[g, [p, "WeChat(Win) Desktop"]],
|
|
1307
1594
|
[/micromessenger\/([\w\.]+)/i],
|
|
@@ -1316,10 +1603,10 @@ function gr() {
|
|
|
1316
1603
|
[[
|
|
1317
1604
|
p,
|
|
1318
1605
|
/(.+)/,
|
|
1319
|
-
"$1 Secure " +
|
|
1606
|
+
"$1 Secure " + A
|
|
1320
1607
|
], g],
|
|
1321
1608
|
[/\bfocus\/([\w\.]+)/i],
|
|
1322
|
-
[g, [p,
|
|
1609
|
+
[g, [p, N + " Focus"]],
|
|
1323
1610
|
[/\bopt\/([\w\.]+)/i],
|
|
1324
1611
|
[g, [p, z + " Touch"]],
|
|
1325
1612
|
[/coc_coc\w+\/([\w\.]+)/i],
|
|
@@ -1329,16 +1616,16 @@ function gr() {
|
|
|
1329
1616
|
[/coast\/([\w\.]+)/i],
|
|
1330
1617
|
[g, [p, z + " Coast"]],
|
|
1331
1618
|
[/miuibrowser\/([\w\.]+)/i],
|
|
1332
|
-
[g, [p, "MIUI " +
|
|
1619
|
+
[g, [p, "MIUI " + A]],
|
|
1333
1620
|
[/fxios\/([-\w\.]+)/i],
|
|
1334
|
-
[g, [p,
|
|
1621
|
+
[g, [p, N]],
|
|
1335
1622
|
[/\bqihu|(qi?ho?o?|360)browser/i],
|
|
1336
|
-
[[p, "360 " +
|
|
1623
|
+
[[p, "360 " + A]],
|
|
1337
1624
|
[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],
|
|
1338
1625
|
[[
|
|
1339
1626
|
p,
|
|
1340
1627
|
/(.+)/,
|
|
1341
|
-
"$1 " +
|
|
1628
|
+
"$1 " + A
|
|
1342
1629
|
], g],
|
|
1343
1630
|
[/(comodo_dragon)\/([\w\.]+)/i],
|
|
1344
1631
|
[[
|
|
@@ -1359,7 +1646,7 @@ function gr() {
|
|
|
1359
1646
|
],
|
|
1360
1647
|
[p],
|
|
1361
1648
|
[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],
|
|
1362
|
-
[[p,
|
|
1649
|
+
[[p, Cn], g],
|
|
1363
1650
|
[
|
|
1364
1651
|
/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,
|
|
1365
1652
|
/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,
|
|
@@ -1373,11 +1660,11 @@ function gr() {
|
|
|
1373
1660
|
[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],
|
|
1374
1661
|
[g, [p, "TikTok"]],
|
|
1375
1662
|
[/headlesschrome(?:\/([\w\.]+)| )/i],
|
|
1376
|
-
[g, [p,
|
|
1663
|
+
[g, [p, j + " Headless"]],
|
|
1377
1664
|
[/ wv\).+(chrome)\/([\w\.]+)/i],
|
|
1378
|
-
[[p,
|
|
1665
|
+
[[p, j + " WebView"], g],
|
|
1379
1666
|
[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],
|
|
1380
|
-
[g, [p, "Android " +
|
|
1667
|
+
[g, [p, "Android " + A]],
|
|
1381
1668
|
[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],
|
|
1382
1669
|
[p, g],
|
|
1383
1670
|
[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],
|
|
@@ -1387,15 +1674,15 @@ function gr() {
|
|
|
1387
1674
|
[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],
|
|
1388
1675
|
[p, [
|
|
1389
1676
|
g,
|
|
1390
|
-
|
|
1391
|
-
|
|
1677
|
+
kn,
|
|
1678
|
+
An
|
|
1392
1679
|
]],
|
|
1393
1680
|
[/(webkit|khtml)\/([\w\.]+)/i],
|
|
1394
1681
|
[p, g],
|
|
1395
1682
|
[/(navigator|netscape\d?)\/([-\w\.]+)/i],
|
|
1396
1683
|
[[p, "Netscape"], g],
|
|
1397
1684
|
[/mobile vr; rv:([\w\.]+)\).+firefox/i],
|
|
1398
|
-
[g, [p,
|
|
1685
|
+
[g, [p, N + " Reality"]],
|
|
1399
1686
|
[
|
|
1400
1687
|
/ekiohf.+(flow)\/([\w\.]+)/i,
|
|
1401
1688
|
/(swiftfox)/i,
|
|
@@ -1478,19 +1765,19 @@ function gr() {
|
|
|
1478
1765
|
[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],
|
|
1479
1766
|
[
|
|
1480
1767
|
f,
|
|
1481
|
-
[h,
|
|
1768
|
+
[h, Sn],
|
|
1482
1769
|
[m, y]
|
|
1483
1770
|
],
|
|
1484
1771
|
[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],
|
|
1485
1772
|
[
|
|
1486
1773
|
f,
|
|
1487
|
-
[h,
|
|
1774
|
+
[h, F],
|
|
1488
1775
|
[m, b]
|
|
1489
1776
|
],
|
|
1490
1777
|
[/(?:huawei|honor)([-\w ]+)[;\)]/i, /\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],
|
|
1491
1778
|
[
|
|
1492
1779
|
f,
|
|
1493
|
-
[h,
|
|
1780
|
+
[h, F],
|
|
1494
1781
|
[m, y]
|
|
1495
1782
|
],
|
|
1496
1783
|
[
|
|
@@ -1556,7 +1843,7 @@ function gr() {
|
|
|
1556
1843
|
[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],
|
|
1557
1844
|
[
|
|
1558
1845
|
f,
|
|
1559
|
-
[h,
|
|
1846
|
+
[h, I],
|
|
1560
1847
|
[m, b]
|
|
1561
1848
|
],
|
|
1562
1849
|
[
|
|
@@ -1566,7 +1853,7 @@ function gr() {
|
|
|
1566
1853
|
],
|
|
1567
1854
|
[
|
|
1568
1855
|
f,
|
|
1569
|
-
[h,
|
|
1856
|
+
[h, I],
|
|
1570
1857
|
[m, y]
|
|
1571
1858
|
],
|
|
1572
1859
|
[/(ideatab[-\w ]+)/i, /lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],
|
|
@@ -1588,13 +1875,13 @@ function gr() {
|
|
|
1588
1875
|
[/(pixel c)\b/i],
|
|
1589
1876
|
[
|
|
1590
1877
|
f,
|
|
1591
|
-
[h,
|
|
1878
|
+
[h, P],
|
|
1592
1879
|
[m, b]
|
|
1593
1880
|
],
|
|
1594
1881
|
[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],
|
|
1595
1882
|
[
|
|
1596
1883
|
f,
|
|
1597
|
-
[h,
|
|
1884
|
+
[h, P],
|
|
1598
1885
|
[m, y]
|
|
1599
1886
|
],
|
|
1600
1887
|
[/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],
|
|
@@ -1725,7 +2012,7 @@ function gr() {
|
|
|
1725
2012
|
[/(surface duo)/i],
|
|
1726
2013
|
[
|
|
1727
2014
|
f,
|
|
1728
|
-
[h,
|
|
2015
|
+
[h, L],
|
|
1729
2016
|
[m, b]
|
|
1730
2017
|
],
|
|
1731
2018
|
[/droid [\d\.]+; (fp\du?)(?: b|\))/i],
|
|
@@ -1879,7 +2166,7 @@ function gr() {
|
|
|
1879
2166
|
/\./g,
|
|
1880
2167
|
" "
|
|
1881
2168
|
],
|
|
1882
|
-
[h,
|
|
2169
|
+
[h, L],
|
|
1883
2170
|
[m, y]
|
|
1884
2171
|
],
|
|
1885
2172
|
[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],
|
|
@@ -1907,7 +2194,7 @@ function gr() {
|
|
|
1907
2194
|
[m, x]
|
|
1908
2195
|
],
|
|
1909
2196
|
[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],
|
|
1910
|
-
[[h,
|
|
2197
|
+
[[h, I], [m, x]],
|
|
1911
2198
|
[/(apple) ?tv/i],
|
|
1912
2199
|
[
|
|
1913
2200
|
h,
|
|
@@ -1916,8 +2203,8 @@ function gr() {
|
|
|
1916
2203
|
],
|
|
1917
2204
|
[/crkey/i],
|
|
1918
2205
|
[
|
|
1919
|
-
[f,
|
|
1920
|
-
[h,
|
|
2206
|
+
[f, j + "cast"],
|
|
2207
|
+
[h, P],
|
|
1921
2208
|
[m, x]
|
|
1922
2209
|
],
|
|
1923
2210
|
[/droid.+aft(\w)( bui|\))/i],
|
|
@@ -1929,7 +2216,7 @@ function gr() {
|
|
|
1929
2216
|
[/\(dtv[\);].+(aquos)/i, /(aquos-tv[\w ]+)\)/i],
|
|
1930
2217
|
[
|
|
1931
2218
|
f,
|
|
1932
|
-
[h,
|
|
2219
|
+
[h, Sn],
|
|
1933
2220
|
[m, x]
|
|
1934
2221
|
],
|
|
1935
2222
|
[/(bravia[\w ]+)( bui|\))/i],
|
|
@@ -1952,8 +2239,8 @@ function gr() {
|
|
|
1952
2239
|
],
|
|
1953
2240
|
[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i, /hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],
|
|
1954
2241
|
[
|
|
1955
|
-
[h,
|
|
1956
|
-
[f,
|
|
2242
|
+
[h, On],
|
|
2243
|
+
[f, On],
|
|
1957
2244
|
[m, x]
|
|
1958
2245
|
],
|
|
1959
2246
|
[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],
|
|
@@ -1979,7 +2266,7 @@ function gr() {
|
|
|
1979
2266
|
[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],
|
|
1980
2267
|
[
|
|
1981
2268
|
f,
|
|
1982
|
-
[h,
|
|
2269
|
+
[h, L],
|
|
1983
2270
|
[m, v]
|
|
1984
2271
|
],
|
|
1985
2272
|
[/((pebble))app/i],
|
|
@@ -1997,7 +2284,7 @@ function gr() {
|
|
|
1997
2284
|
[/droid.+; (glass) \d/i],
|
|
1998
2285
|
[
|
|
1999
2286
|
f,
|
|
2000
|
-
[h,
|
|
2287
|
+
[h, P],
|
|
2001
2288
|
[m, S]
|
|
2002
2289
|
],
|
|
2003
2290
|
[/droid.+; (wt63?0{2,3})\)/i],
|
|
@@ -2009,7 +2296,7 @@ function gr() {
|
|
|
2009
2296
|
[/(quest( 2| pro)?)/i],
|
|
2010
2297
|
[
|
|
2011
2298
|
f,
|
|
2012
|
-
[h,
|
|
2299
|
+
[h, Cn],
|
|
2013
2300
|
[m, S]
|
|
2014
2301
|
],
|
|
2015
2302
|
[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],
|
|
@@ -2033,7 +2320,7 @@ function gr() {
|
|
|
2033
2320
|
],
|
|
2034
2321
|
engine: [
|
|
2035
2322
|
[/windows.+ edge\/([\w\.]+)/i],
|
|
2036
|
-
[g, [p,
|
|
2323
|
+
[g, [p, xn + "HTML"]],
|
|
2037
2324
|
[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],
|
|
2038
2325
|
[g, [p, "Blink"]],
|
|
2039
2326
|
[
|
|
@@ -2058,14 +2345,14 @@ function gr() {
|
|
|
2058
2345
|
],
|
|
2059
2346
|
[p, [
|
|
2060
2347
|
g,
|
|
2061
|
-
|
|
2062
|
-
|
|
2348
|
+
kn,
|
|
2349
|
+
jn
|
|
2063
2350
|
]],
|
|
2064
2351
|
[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],
|
|
2065
2352
|
[[p, "Windows"], [
|
|
2066
2353
|
g,
|
|
2067
|
-
|
|
2068
|
-
|
|
2354
|
+
kn,
|
|
2355
|
+
jn
|
|
2069
2356
|
]],
|
|
2070
2357
|
[
|
|
2071
2358
|
/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,
|
|
@@ -2078,7 +2365,7 @@ function gr() {
|
|
|
2078
2365
|
"."
|
|
2079
2366
|
], [p, "iOS"]],
|
|
2080
2367
|
[/(mac os x) ?([\w\. ]*)/i, /(macintosh|mac_powerpc\b)(?!.+haiku)/i],
|
|
2081
|
-
[[p,
|
|
2368
|
+
[[p, Tn], [
|
|
2082
2369
|
g,
|
|
2083
2370
|
/_/g,
|
|
2084
2371
|
"."
|
|
@@ -2097,15 +2384,15 @@ function gr() {
|
|
|
2097
2384
|
[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],
|
|
2098
2385
|
[g, [p, "Symbian"]],
|
|
2099
2386
|
[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],
|
|
2100
|
-
[g, [p,
|
|
2387
|
+
[g, [p, N + " OS"]],
|
|
2101
2388
|
[/web0s;.+rt(tv)/i, /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],
|
|
2102
2389
|
[g, [p, "webOS"]],
|
|
2103
2390
|
[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],
|
|
2104
2391
|
[g, [p, "watchOS"]],
|
|
2105
2392
|
[/crkey\/([\d\.]+)/i],
|
|
2106
|
-
[g, [p,
|
|
2393
|
+
[g, [p, j + "cast"]],
|
|
2107
2394
|
[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],
|
|
2108
|
-
[[p,
|
|
2395
|
+
[[p, wn], g],
|
|
2109
2396
|
[
|
|
2110
2397
|
/panasonic;(viera)/i,
|
|
2111
2398
|
/(netrange)mmh/i,
|
|
@@ -2134,10 +2421,10 @@ function gr() {
|
|
|
2134
2421
|
]
|
|
2135
2422
|
}, Z = function(e, t) {
|
|
2136
2423
|
if (typeof e === l && (t = e, e = r), !(this instanceof Z)) return new Z(e, t).getResult();
|
|
2137
|
-
var i = typeof n !== c && n.navigator ? n.navigator : r, o = e || (i && i.userAgent ? i.userAgent : a), v = i && i.userAgentData ? i.userAgentData : r, x = t ? G(
|
|
2424
|
+
var i = typeof n !== c && n.navigator ? n.navigator : r, o = e || (i && i.userAgent ? i.userAgent : a), v = i && i.userAgentData ? i.userAgentData : r, x = t ? G(Mn, t) : Mn, S = i && i.userAgent == o;
|
|
2138
2425
|
return this.getBrowser = function() {
|
|
2139
2426
|
var e = {};
|
|
2140
|
-
return e[p] = r, e[g] = r, X.call(e, o, x.browser), e[d] =
|
|
2427
|
+
return e[p] = r, e[g] = r, X.call(e, o, x.browser), e[d] = Dn(e[g]), S && i && i.brave && typeof i.brave.isBrave == s && (e[p] = "Brave"), e;
|
|
2141
2428
|
}, this.getCPU = function() {
|
|
2142
2429
|
var e = {};
|
|
2143
2430
|
return e[_] = r, X.call(e, o, x.cpu), e;
|
|
@@ -2149,7 +2436,7 @@ function gr() {
|
|
|
2149
2436
|
return e[p] = r, e[g] = r, X.call(e, o, x.engine), e;
|
|
2150
2437
|
}, this.getOS = function() {
|
|
2151
2438
|
var e = {};
|
|
2152
|
-
return e[p] = r, e[g] = r, X.call(e, o, x.os), S && !e[p] && v && v.platform != "Unknown" && (e[p] = v.platform.replace(/chrome os/i,
|
|
2439
|
+
return e[p] = r, e[g] = r, X.call(e, o, x.os), S && !e[p] && v && v.platform != "Unknown" && (e[p] = v.platform.replace(/chrome os/i, wn).replace(/macos/i, Tn)), e;
|
|
2153
2440
|
}, this.getResult = function() {
|
|
2154
2441
|
return {
|
|
2155
2442
|
ua: this.getUA(),
|
|
@@ -2162,7 +2449,7 @@ function gr() {
|
|
|
2162
2449
|
}, this.getUA = function() {
|
|
2163
2450
|
return o;
|
|
2164
2451
|
}, this.setUA = function(e) {
|
|
2165
|
-
return o = typeof e === u && e.length > w ?
|
|
2452
|
+
return o = typeof e === u && e.length > w ? On(e, w) : e, this;
|
|
2166
2453
|
}, this.setUA(o), this;
|
|
2167
2454
|
};
|
|
2168
2455
|
Z.VERSION = i, Z.BROWSER = q([
|
|
@@ -2204,12 +2491,12 @@ function gr() {
|
|
|
2204
2491
|
}
|
|
2205
2492
|
return a.exports;
|
|
2206
2493
|
}
|
|
2207
|
-
typeof n < "u" && (n.ab = {}.dirname + "/"),
|
|
2208
|
-
})()),
|
|
2494
|
+
typeof n < "u" && (n.ab = {}.dirname + "/"), Ye.exports = n(226);
|
|
2495
|
+
})()), Ye.exports;
|
|
2209
2496
|
}
|
|
2210
|
-
var
|
|
2211
|
-
function
|
|
2212
|
-
return
|
|
2497
|
+
var Lt;
|
|
2498
|
+
function kt() {
|
|
2499
|
+
return Lt || (Lt = 1, (function(e) {
|
|
2213
2500
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
2214
2501
|
function t(e, t) {
|
|
2215
2502
|
for (var n in t) Object.defineProperty(e, n, {
|
|
@@ -2228,7 +2515,7 @@ function Nt() {
|
|
|
2228
2515
|
return a;
|
|
2229
2516
|
}
|
|
2230
2517
|
});
|
|
2231
|
-
let n = /* @__PURE__ */ r(
|
|
2518
|
+
let n = /* @__PURE__ */ r(Ar());
|
|
2232
2519
|
function r(e) {
|
|
2233
2520
|
return e && e.__esModule ? e : { default: e };
|
|
2234
2521
|
}
|
|
@@ -2244,11 +2531,11 @@ function Nt() {
|
|
|
2244
2531
|
function o({ headers: e }) {
|
|
2245
2532
|
return a(e.get("user-agent") || void 0);
|
|
2246
2533
|
}
|
|
2247
|
-
})(
|
|
2534
|
+
})(Ke)), Ke;
|
|
2248
2535
|
}
|
|
2249
|
-
var
|
|
2250
|
-
function
|
|
2251
|
-
return
|
|
2536
|
+
var Je = {}, Ut;
|
|
2537
|
+
function Or() {
|
|
2538
|
+
return Ut || (Ut = 1, (function(e) {
|
|
2252
2539
|
Object.defineProperty(e, "__esModule", { value: !0 }), Object.defineProperty(e, "URLPattern", {
|
|
2253
2540
|
enumerable: !0,
|
|
2254
2541
|
get: function() {
|
|
@@ -2256,39 +2543,35 @@ function wr() {
|
|
|
2256
2543
|
}
|
|
2257
2544
|
});
|
|
2258
2545
|
let t = typeof URLPattern > "u" ? void 0 : URLPattern;
|
|
2259
|
-
})(
|
|
2546
|
+
})(Je)), Je;
|
|
2260
2547
|
}
|
|
2261
|
-
var
|
|
2262
|
-
function
|
|
2263
|
-
return
|
|
2548
|
+
var Dt;
|
|
2549
|
+
function xr() {
|
|
2550
|
+
return Dt || (Dt = 1, (function(e, t) {
|
|
2264
2551
|
let n = {
|
|
2265
|
-
NextRequest:
|
|
2266
|
-
NextResponse:
|
|
2267
|
-
ImageResponse:
|
|
2268
|
-
userAgentFromString:
|
|
2269
|
-
userAgent:
|
|
2270
|
-
URLPattern:
|
|
2552
|
+
NextRequest: yr().NextRequest,
|
|
2553
|
+
NextResponse: Tr().NextResponse,
|
|
2554
|
+
ImageResponse: Ir().ImageResponse,
|
|
2555
|
+
userAgentFromString: kt().userAgentFromString,
|
|
2556
|
+
userAgent: kt().userAgent,
|
|
2557
|
+
URLPattern: Or().URLPattern
|
|
2271
2558
|
};
|
|
2272
2559
|
e.exports = n, t.NextRequest = n.NextRequest, t.NextResponse = n.NextResponse, t.ImageResponse = n.ImageResponse, t.userAgentFromString = n.userAgentFromString, t.userAgent = n.userAgent, t.URLPattern = n.URLPattern;
|
|
2273
|
-
})(
|
|
2560
|
+
})(ve, ve.exports)), ve.exports;
|
|
2274
2561
|
}
|
|
2275
|
-
|
|
2276
|
-
var
|
|
2562
|
+
xr();
|
|
2563
|
+
var et = /* @__PURE__ */ ((e) => (e[e.login = 0] = "login", e[e.logout = 1] = "logout", e))(et || {}), $e = {
|
|
2277
2564
|
login: "login",
|
|
2278
2565
|
logout: "logout",
|
|
2279
2566
|
unknown: ""
|
|
2280
|
-
},
|
|
2281
|
-
applicationJson: "application/json",
|
|
2282
|
-
multipartFormData: "multipart/form-data",
|
|
2283
|
-
applicationXwwwFormUrlencoded: "application/x-www-form-urlencoded"
|
|
2284
|
-
}, Gr = class {
|
|
2567
|
+
}, Jr = class {
|
|
2285
2568
|
config;
|
|
2286
2569
|
http;
|
|
2287
2570
|
adapter;
|
|
2288
2571
|
constructor({ config: e, adapter: t, storage: n }) {
|
|
2289
2572
|
this.config = e;
|
|
2290
|
-
let r =
|
|
2291
|
-
(!i || !a || !o || !s) && (r =
|
|
2573
|
+
let r = ir(n.headers), i = r.deviceId && r.deviceId.length > 0, a = r.websiteId && r.websiteId.length > 0, o = r.websiteNo && r.websiteNo.length > 0, s = r.lang && r.lang.length > 0;
|
|
2574
|
+
(!i || !a || !o || !s) && (r = or(n.cookies)), this.http = new cr({
|
|
2292
2575
|
...r,
|
|
2293
2576
|
userType: e.userType,
|
|
2294
2577
|
helloURL: e.helloURL
|
|
@@ -2299,20 +2582,20 @@ var Qe = /* @__PURE__ */ ((e) => (e[e.login = 0] = "login", e[e.logout = 1] = "l
|
|
|
2299
2582
|
let t = await this.adapter.parseRequest(e), n = await this.processRequest(t);
|
|
2300
2583
|
return this.adapter.createResponse(n);
|
|
2301
2584
|
} catch (e) {
|
|
2302
|
-
|
|
2585
|
+
U.error({ error: e?.toString() || "Internal server error" }, "ROUTE ERROR");
|
|
2303
2586
|
let t = this.createErrorResponse(500, e?.toString() || "Internal server error");
|
|
2304
2587
|
return this.adapter.createResponse(t);
|
|
2305
2588
|
}
|
|
2306
2589
|
}
|
|
2307
2590
|
async processRequest(e) {
|
|
2308
2591
|
let t = e.url.searchParams, n = t.get("m") ?? "unknown", r = {
|
|
2309
|
-
|
|
2592
|
+
...$e,
|
|
2310
2593
|
...this.config.APIMAP
|
|
2311
2594
|
}[n], i = e.cookies;
|
|
2312
2595
|
if (this.http.setHttpOptsToCookies(i), !r || r.length === 0) return this.createErrorResponse(404, "API not found", i);
|
|
2313
2596
|
let a;
|
|
2314
|
-
if ((r.startsWith("admin/") || r.startsWith("api/")) && (a =
|
|
2315
|
-
|
|
2597
|
+
if ((r.startsWith("admin/") || r.startsWith("api/")) && (a = sr(i), U.debug(a, "token"), !a || a.username.length === 0 || a.token.length === 0)) return this.createErrorResponse(409, "Authentication required", i);
|
|
2598
|
+
U.debug({ "content-type": e.contentType }, "Content-Type"), U.debug({
|
|
2316
2599
|
hostUrl: r,
|
|
2317
2600
|
token: a ? { ...a } : ""
|
|
2318
2601
|
}, "processRequest");
|
|
@@ -2371,12 +2654,12 @@ var Qe = /* @__PURE__ */ ((e) => (e[e.login = 0] = "login", e[e.logout = 1] = "l
|
|
|
2371
2654
|
};
|
|
2372
2655
|
if (t.success) {
|
|
2373
2656
|
switch (e) {
|
|
2374
|
-
case
|
|
2657
|
+
case $e[et[0]]:
|
|
2375
2658
|
let e = t.data;
|
|
2376
|
-
|
|
2659
|
+
ar(e, a);
|
|
2377
2660
|
break;
|
|
2378
|
-
case
|
|
2379
|
-
a.cleanCookies = (e) =>
|
|
2661
|
+
case $e[et[1]]:
|
|
2662
|
+
a.cleanCookies = (e) => ur(e);
|
|
2380
2663
|
break;
|
|
2381
2664
|
}
|
|
2382
2665
|
n.onHandlerSuccess && n.onHandlerSuccess({
|
|
@@ -2407,279 +2690,6 @@ var Qe = /* @__PURE__ */ ((e) => (e[e.login = 0] = "login", e[e.logout = 1] = "l
|
|
|
2407
2690
|
t[e] = { value: n };
|
|
2408
2691
|
}), t;
|
|
2409
2692
|
}
|
|
2410
|
-
}, Rr = "zh-CN", Ze = "Post request error!", U = {
|
|
2411
|
-
IBOOT_DEVICE_ID: "dvid",
|
|
2412
|
-
IBOOT_LANG: "lang",
|
|
2413
|
-
IBOOT_WEBSITE_ID: "wid",
|
|
2414
|
-
IBOOT_WEBSITE_NO: "wno",
|
|
2415
|
-
IBOOT_TOKEN: "token",
|
|
2416
|
-
IBOOT_USER: "user"
|
|
2417
|
-
}, K = {
|
|
2418
|
-
DEVICE_ID: "Device-Id",
|
|
2419
|
-
LANG: "Lang",
|
|
2420
|
-
WEBSITE_ID: "Website-Id",
|
|
2421
|
-
WEBSITE_NO: "Website-No"
|
|
2422
|
-
}, Ht = async (e, t) => {
|
|
2423
|
-
let n = t?.data ?? {}, r = t?.headers, i, a = t?.headers, s = new Headers(a);
|
|
2424
|
-
if (n instanceof FormData ? i = n : (i = JSON.stringify(n), s.set("Content-Type", M.applicationJson)), r) for (let e in r) {
|
|
2425
|
-
let t = r[e];
|
|
2426
|
-
t && s.set(e, t);
|
|
2427
|
-
}
|
|
2428
|
-
L.info({
|
|
2429
|
-
url: e,
|
|
2430
|
-
headers: s
|
|
2431
|
-
}, "POST");
|
|
2432
|
-
let c = await fetch(e, {
|
|
2433
|
-
method: "POST",
|
|
2434
|
-
headers: s,
|
|
2435
|
-
body: i
|
|
2436
|
-
});
|
|
2437
|
-
if (c.ok) {
|
|
2438
|
-
let e = Object.fromEntries(c.headers.entries()), t = {
|
|
2439
|
-
...await c.json(),
|
|
2440
|
-
headers: e
|
|
2441
|
-
};
|
|
2442
|
-
return L.debug(t, "POST_RESULT"), t;
|
|
2443
|
-
}
|
|
2444
|
-
let l = {
|
|
2445
|
-
code: c.status,
|
|
2446
|
-
success: !1,
|
|
2447
|
-
msg: c.statusText
|
|
2448
|
-
};
|
|
2449
|
-
return L.error(l), l;
|
|
2450
|
-
}, Wr = async (e, t) => {
|
|
2451
|
-
let n = await Ht(e, t);
|
|
2452
|
-
if (n.success) return n.data;
|
|
2453
|
-
if (t?.showError) {
|
|
2454
|
-
t.showError(n.msg ?? Ze);
|
|
2455
|
-
return;
|
|
2456
|
-
}
|
|
2457
|
-
throw Error(n.msg ?? Ze);
|
|
2458
|
-
}, Tr = (e) => {
|
|
2459
|
-
if (e.get) {
|
|
2460
|
-
let t = e.get(K.DEVICE_ID), n = e.get(K.LANG), r = e.get(K.WEBSITE_ID), i = e.get(K.WEBSITE_NO), a = {};
|
|
2461
|
-
return t && t.length > 0 && (a.deviceId = t), n && n.length > 0 && (a.lang = n), r && r.length > 0 && (a.websiteId = r), i && i.length > 0 && (a.websiteNo = i), a;
|
|
2462
|
-
}
|
|
2463
|
-
throw Error("The get method of IStorage has not been implemented.");
|
|
2464
|
-
}, Sr = (e) => {
|
|
2465
|
-
if (e.get) {
|
|
2466
|
-
let t = e.get(U.IBOOT_DEVICE_ID), n = e.get(U.IBOOT_LANG), r = e.get(U.IBOOT_WEBSITE_ID), i = e.get(U.IBOOT_WEBSITE_NO), a = {};
|
|
2467
|
-
return t && t.length > 0 && (a.deviceId = t), n && n.length > 0 && (a.lang = n), r && r.length > 0 && (a.websiteId = r), i && i.length > 0 && (a.websiteNo = i), a;
|
|
2468
|
-
}
|
|
2469
|
-
throw Error("The get method of ICookies has not been implemented.");
|
|
2470
|
-
}, Kr = (e, t) => {
|
|
2471
|
-
if (e.set) t.deviceId && e.set(U.IBOOT_DEVICE_ID, t.deviceId), t.lang && e.set(U.IBOOT_LANG, t.lang), t.websiteId && e.set(U.IBOOT_WEBSITE_ID, t.websiteId), t.websiteNo && e.set(U.IBOOT_WEBSITE_NO, t.websiteNo);
|
|
2472
|
-
else throw Error("The set method of ICookies has not been implemented.");
|
|
2473
|
-
}, Yr = (e) => {
|
|
2474
|
-
if (e.get) {
|
|
2475
|
-
let t = e.get(U.IBOOT_USER);
|
|
2476
|
-
if (t && t.length > 0) return JSON.parse(t);
|
|
2477
|
-
}
|
|
2478
|
-
}, Ir = (e) => {
|
|
2479
|
-
if (e.get) {
|
|
2480
|
-
let t = e[U.IBOOT_USER];
|
|
2481
|
-
if (t && t.length > 0) {
|
|
2482
|
-
let n = JSON.parse(t), r = n.username, i = n.userType.toString(), a = e[U.IBOOT_TOKEN];
|
|
2483
|
-
if (a) return {
|
|
2484
|
-
username: r,
|
|
2485
|
-
utype: i,
|
|
2486
|
-
token: a
|
|
2487
|
-
};
|
|
2488
|
-
}
|
|
2489
|
-
}
|
|
2490
|
-
}, Ut = () => ({
|
|
2491
|
-
path: "/",
|
|
2492
|
-
secure: process.env.APP_ENV === "production",
|
|
2493
|
-
httpOnly: !0,
|
|
2494
|
-
sameSite: "strict"
|
|
2495
|
-
}), Ee = {
|
|
2496
|
-
maxAge: -1,
|
|
2497
|
-
httpOnly: !0,
|
|
2498
|
-
path: "/"
|
|
2499
|
-
}, Ar = (e, t) => {
|
|
2500
|
-
let { id: n, name: r, username: i, nickname: a, headImg: o, token: s, lastLoginTime: c, deviceId: l, userType: u, mustChangePwd: d } = e, f = {
|
|
2501
|
-
id: n,
|
|
2502
|
-
name: r,
|
|
2503
|
-
username: i,
|
|
2504
|
-
nickname: a || r,
|
|
2505
|
-
headImg: o,
|
|
2506
|
-
lastLoginTime: c,
|
|
2507
|
-
deviceId: l,
|
|
2508
|
-
userType: u,
|
|
2509
|
-
accountType: 0,
|
|
2510
|
-
needToReview: !1,
|
|
2511
|
-
socketOnline: !1,
|
|
2512
|
-
mustChangePwd: d
|
|
2513
|
-
};
|
|
2514
|
-
t.cookies[U.IBOOT_TOKEN] = {
|
|
2515
|
-
value: s,
|
|
2516
|
-
options: Ut()
|
|
2517
|
-
}, t.cookies[U.IBOOT_USER] = {
|
|
2518
|
-
value: JSON.stringify(f),
|
|
2519
|
-
options: Ut()
|
|
2520
|
-
};
|
|
2521
|
-
}, Or = (e) => {
|
|
2522
|
-
if (!e.set) throw Error("cookies set function is undefined");
|
|
2523
|
-
if (e.set(U.IBOOT_TOKEN, "", Ee), e.set(U.IBOOT_USER, "", Ee), !e.delete) throw Error("cookies delete function is undefined");
|
|
2524
|
-
e.delete(U.IBOOT_TOKEN, Ee), e.delete(U.IBOOT_USER, Ee);
|
|
2525
|
-
}, xr = class {
|
|
2526
|
-
baseUrl;
|
|
2527
|
-
helloMethod;
|
|
2528
|
-
apiKey;
|
|
2529
|
-
userType;
|
|
2530
|
-
userFrom;
|
|
2531
|
-
deviceId;
|
|
2532
|
-
version = "1";
|
|
2533
|
-
lang;
|
|
2534
|
-
websiteId;
|
|
2535
|
-
websiteNo;
|
|
2536
|
-
constructor(e) {
|
|
2537
|
-
process.env.APP_ENV === "production" || L.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 ?? Qt.TYPE_MGT, this.deviceId = e.deviceId ?? tr(), this.lang = e.lang ?? Rr, this.websiteId = e.websiteId, this.websiteNo = e.websiteNo;
|
|
2538
|
-
}
|
|
2539
|
-
encrypt(e) {
|
|
2540
|
-
let t = ne.enc.Utf8.parse(this.apiKey);
|
|
2541
|
-
return ne.AES.encrypt(e, t).toString();
|
|
2542
|
-
}
|
|
2543
|
-
decrypt(e) {
|
|
2544
|
-
let t = ne.enc.Utf8.parse(this.apiKey);
|
|
2545
|
-
return ne.AES.decrypt(e, t, { mode: ne.mode.ECB }).toString(ne.enc.Utf8);
|
|
2546
|
-
}
|
|
2547
|
-
setHttpOptsToCookies = (e) => {
|
|
2548
|
-
this.deviceId && this.deviceId.length > 0 && (e[U.IBOOT_DEVICE_ID] = this.deviceId), this.websiteId && this.websiteId.length > 0 && (e[U.IBOOT_WEBSITE_ID] = this.websiteId), this.websiteNo && this.websiteNo.length > 0 && (e[U.IBOOT_WEBSITE_NO] = this.websiteNo), this.lang && this.lang.length > 0 && (e[U.IBOOT_LANG] = this.lang);
|
|
2549
|
-
};
|
|
2550
|
-
async sign(e) {
|
|
2551
|
-
let t = "&key=" + await this.helloIboot(), r = [];
|
|
2552
|
-
for (let t of e.keys()) r.push(t);
|
|
2553
|
-
r.sort((e, t) => {
|
|
2554
|
-
let n = e.match(/(\d+)/), r = t.match(/(\d+)/);
|
|
2555
|
-
return n && r && e.replace(/\d+/, "") === t.replace(/\d+/, "") ? parseInt(n[1]) - parseInt(r[1]) : e.toLowerCase().localeCompare(t.toLowerCase(), void 0, {
|
|
2556
|
-
numeric: !0,
|
|
2557
|
-
sensitivity: "base"
|
|
2558
|
-
});
|
|
2559
|
-
});
|
|
2560
|
-
let i = [];
|
|
2561
|
-
r.forEach((t) => {
|
|
2562
|
-
let n = e.get(t);
|
|
2563
|
-
n && i.push(t + "=" + n);
|
|
2564
|
-
});
|
|
2565
|
-
let a = i.join("&"), s = Wt.md5((a + t).toLocaleUpperCase()), c = {
|
|
2566
|
-
params: a,
|
|
2567
|
-
md5: s
|
|
2568
|
-
};
|
|
2569
|
-
return L.debug(c, "API_SIGN"), s;
|
|
2570
|
-
}
|
|
2571
|
-
assemblyParameter(e, t) {
|
|
2572
|
-
let n = e ?? new URLSearchParams(), r = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
2573
|
-
return n.set("timezone", r), n.set("timestamp", Date.now().toString()), n.set("echostr", Dt(10)), n.set("version", this.version), n.set("deviceId", this.deviceId), n.set("webid", this.websiteId ?? ""), n.set("apiKey", this.apiKey), t && t.length > 0 && n.set("username", t), new URLSearchParams([...n].filter(([, e]) => e !== ""));
|
|
2574
|
-
}
|
|
2575
|
-
async assemblyHeader({ urlParams: e, token: t }) {
|
|
2576
|
-
let n = {
|
|
2577
|
-
"Res-Type": "json",
|
|
2578
|
-
"Device-Id": this.deviceId,
|
|
2579
|
-
"User-Type": t?.utype.toString() ?? this.userType.toString(),
|
|
2580
|
-
"User-From": this.userFrom,
|
|
2581
|
-
"Api-Key": this.apiKey
|
|
2582
|
-
};
|
|
2583
|
-
return n[Y] = M.applicationXwwwFormUrlencoded, this.lang && this.lang.length > 0 && (n.Lang = this.lang), this.websiteId && this.websiteId.length > 0 && (n["Web-Id"] = this.websiteId), this.websiteNo && this.websiteNo.length > 0 && (n["Web-No"] = this.websiteNo), t && (t.token && t.token.length > 0 && t.username && t.username.length > 0 && (n.Authorization = t.token, n.Username = t.username), t.xcsrf && (n[t.xcsrf.csrfHeader] = t.xcsrf.csrfToken)), n.Sign = await this.sign(e), n;
|
|
2584
|
-
}
|
|
2585
|
-
async helloIboot() {
|
|
2586
|
-
if (this.helloMethod.length <= 0) return this.apiKey;
|
|
2587
|
-
let e = this.getApiUrl(this.helloMethod), t = {
|
|
2588
|
-
"Res-Type": "json",
|
|
2589
|
-
"Api-Key": this.apiKey
|
|
2590
|
-
};
|
|
2591
|
-
t[Y] = M.applicationXwwwFormUrlencoded;
|
|
2592
|
-
let n = {
|
|
2593
|
-
url: e,
|
|
2594
|
-
headers: t
|
|
2595
|
-
};
|
|
2596
|
-
L.debug(n, "HELLO");
|
|
2597
|
-
let r = await fetch(e, {
|
|
2598
|
-
method: "GET",
|
|
2599
|
-
headers: t,
|
|
2600
|
-
credentials: "include",
|
|
2601
|
-
cache: "force-cache"
|
|
2602
|
-
});
|
|
2603
|
-
if (r.ok) {
|
|
2604
|
-
let e = await r.json();
|
|
2605
|
-
return L.debug(e.data, "HELLO RESULT"), e.data;
|
|
2606
|
-
}
|
|
2607
|
-
throw Error("hello iBoot error!");
|
|
2608
|
-
}
|
|
2609
|
-
getApiUrl(e) {
|
|
2610
|
-
return `${this.baseUrl}/${e}`;
|
|
2611
|
-
}
|
|
2612
|
-
async csrf() {
|
|
2613
|
-
let e = await this.get({ url: "guest/csrf" });
|
|
2614
|
-
if (e.success) {
|
|
2615
|
-
let t = e.data;
|
|
2616
|
-
if (t) return t.csrfToken.toString();
|
|
2617
|
-
}
|
|
2618
|
-
}
|
|
2619
|
-
async get({ url: e, data: t, token: n, cache: r = "default" }) {
|
|
2620
|
-
let i = this.assemblyParameter(t ? new URLSearchParams(t) : void 0), a = await this.assemblyHeader({
|
|
2621
|
-
urlParams: i,
|
|
2622
|
-
token: n
|
|
2623
|
-
}), s = `${this.getApiUrl(e)}?${i.toString()}`, c = {
|
|
2624
|
-
url: s,
|
|
2625
|
-
headers: a
|
|
2626
|
-
};
|
|
2627
|
-
L.info(c, "GET");
|
|
2628
|
-
let l = await fetch(s, {
|
|
2629
|
-
method: "GET",
|
|
2630
|
-
headers: a,
|
|
2631
|
-
credentials: "include",
|
|
2632
|
-
cache: r
|
|
2633
|
-
});
|
|
2634
|
-
if (l.ok) {
|
|
2635
|
-
let e = Object.fromEntries(l.headers.entries()), t = {
|
|
2636
|
-
...await l.json(),
|
|
2637
|
-
headers: e
|
|
2638
|
-
};
|
|
2639
|
-
return L.debug(t, "GET_RESULT"), t;
|
|
2640
|
-
}
|
|
2641
|
-
let u = {
|
|
2642
|
-
code: l.status,
|
|
2643
|
-
success: !1,
|
|
2644
|
-
msg: l.statusText
|
|
2645
|
-
};
|
|
2646
|
-
return L.error(u), u;
|
|
2647
|
-
}
|
|
2648
|
-
async post({ url: e, data: t, token: n, cache: r = "default" }) {
|
|
2649
|
-
let i = t ? { ...t } : {}, a = i.buffer ?? void 0, s = i.boundary ?? void 0;
|
|
2650
|
-
a && delete i.buffer, s && delete i.boundary;
|
|
2651
|
-
let c = this.assemblyParameter(new URLSearchParams(i)), l = await this.assemblyHeader({
|
|
2652
|
-
urlParams: c,
|
|
2653
|
-
token: n
|
|
2654
|
-
});
|
|
2655
|
-
a && s && (l["Content-Type"] = `multipart/form-data; boundary=${s}`);
|
|
2656
|
-
let u = this.getApiUrl(e), d = {
|
|
2657
|
-
url: u,
|
|
2658
|
-
headers: l,
|
|
2659
|
-
params: c
|
|
2660
|
-
};
|
|
2661
|
-
L.info(d, "POST");
|
|
2662
|
-
let f = a ? `${u}?${c}` : u, p = await fetch(f, {
|
|
2663
|
-
method: "POST",
|
|
2664
|
-
headers: l,
|
|
2665
|
-
body: a || c,
|
|
2666
|
-
credentials: "include",
|
|
2667
|
-
cache: r
|
|
2668
|
-
});
|
|
2669
|
-
if (p.ok) {
|
|
2670
|
-
let e = Object.fromEntries(p.headers.entries()), t = {
|
|
2671
|
-
...await p.json(),
|
|
2672
|
-
headers: e
|
|
2673
|
-
};
|
|
2674
|
-
return L.debug(t, "POST_RESULT"), t;
|
|
2675
|
-
}
|
|
2676
|
-
let m = {
|
|
2677
|
-
code: p.status,
|
|
2678
|
-
success: !1,
|
|
2679
|
-
msg: p.statusText
|
|
2680
|
-
};
|
|
2681
|
-
return L.error(m), m;
|
|
2682
|
-
}
|
|
2683
2693
|
}, baseUrl = {
|
|
2684
2694
|
site: "guest/site/",
|
|
2685
2695
|
shop: "guest/site/shop/"
|
|
@@ -2696,9 +2706,9 @@ const helloURL = `${baseUrl.site}helloIBoot`;
|
|
|
2696
2706
|
var ICMSServer = class {
|
|
2697
2707
|
http;
|
|
2698
2708
|
constructor(e) {
|
|
2699
|
-
this.http = new
|
|
2700
|
-
...
|
|
2701
|
-
userType:
|
|
2709
|
+
this.http = new cr({
|
|
2710
|
+
...or(e),
|
|
2711
|
+
userType: Zt.TYPE_C,
|
|
2702
2712
|
helloURL
|
|
2703
2713
|
});
|
|
2704
2714
|
}
|
|
@@ -2708,7 +2718,7 @@ var ICMSServer = class {
|
|
|
2708
2718
|
let t = n.headers;
|
|
2709
2719
|
if (t) {
|
|
2710
2720
|
let n = t["device-id"], r = t.lang, i = t["web-id"], a = t["web-no"], o = {};
|
|
2711
|
-
n && n.length > 0 && (o.deviceId = n), r && r.length > 0 && (o.lang = r), i && i.length > 0 && (o.websiteId = i), a && a.length > 0 && (o.websiteNo = a),
|
|
2721
|
+
n && n.length > 0 && (o.deviceId = n), r && r.length > 0 && (o.lang = r), i && i.length > 0 && (o.websiteId = i), a && a.length > 0 && (o.websiteNo = a), Gr(e, o);
|
|
2712
2722
|
}
|
|
2713
2723
|
}
|
|
2714
2724
|
}
|
|
@@ -2862,9 +2872,9 @@ var ICMSServer = class {
|
|
|
2862
2872
|
throw Error(n.msg);
|
|
2863
2873
|
}
|
|
2864
2874
|
}, APIMAP = {};
|
|
2865
|
-
const icmsRouter = async ({ request: e, routeAdapter: t, storage: n }) => await new
|
|
2875
|
+
const icmsRouter = async ({ request: e, routeAdapter: t, storage: n }) => await new Jr({
|
|
2866
2876
|
config: {
|
|
2867
|
-
userType:
|
|
2877
|
+
userType: Zt.TYPE_C,
|
|
2868
2878
|
APIMAP,
|
|
2869
2879
|
helloURL
|
|
2870
2880
|
},
|
|
@@ -2879,13 +2889,13 @@ var ICMSClient = class {
|
|
|
2879
2889
|
return this.cookies = e, this;
|
|
2880
2890
|
}
|
|
2881
2891
|
async login({ username: e, password: t }) {
|
|
2882
|
-
if (await
|
|
2892
|
+
if (await zr("login", { data: {
|
|
2883
2893
|
username: e,
|
|
2884
2894
|
password: t
|
|
2885
|
-
} }), this.cookies) return
|
|
2895
|
+
} }), this.cookies) return Xr(this.cookies);
|
|
2886
2896
|
}
|
|
2887
2897
|
async logout() {
|
|
2888
|
-
await
|
|
2898
|
+
await zr("logout");
|
|
2889
2899
|
}
|
|
2890
2900
|
};
|
|
2891
2901
|
export { ICMSClient, ICMSServer, helloURL, icmsRouter };
|