@base-web-kits/base-tools-web 1.0.2-alpha.6 → 1.0.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.
@@ -1,14 +1,9 @@
1
1
  "use strict";
2
2
  var baseToolsWeb = (() => {
3
- var __create = Object.create;
4
3
  var __defProp = Object.defineProperty;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __commonJS = (cb, mod) => function __require() {
10
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
11
- };
12
7
  var __export = (target, all) => {
13
8
  for (var name in all)
14
9
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -21,691 +16,8 @@ var baseToolsWeb = (() => {
21
16
  }
22
17
  return to;
23
18
  };
24
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
- // If the importer is in node compatibility mode or this is not an ESM
26
- // file that has been converted to a CommonJS file using a Babel-
27
- // compatible transform (i.e. "__esModule" has not been set), then set
28
- // "default" to the CommonJS "module.exports" for node compatibility.
29
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
- mod
31
- ));
32
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
33
20
 
34
- // node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/dayjs.min.js
35
- var require_dayjs_min = __commonJS({
36
- "node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/dayjs.min.js"(exports, module) {
37
- "use strict";
38
- !(function(t, e) {
39
- "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs = e();
40
- })(exports, (function() {
41
- "use strict";
42
- var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) {
43
- var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
44
- return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
45
- } }, m = function(t2, e2, n2) {
46
- var r2 = String(t2);
47
- return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
48
- }, v = { s: m, z: function(t2) {
49
- var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
50
- return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
51
- }, m: function t2(e2, n2) {
52
- if (e2.date() < n2.date()) return -t2(n2, e2);
53
- var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, c), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), c);
54
- return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
55
- }, a: function(t2) {
56
- return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
57
- }, p: function(t2) {
58
- return { M: c, y: h, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: f }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
59
- }, u: function(t2) {
60
- return void 0 === t2;
61
- } }, g = "en", D = {};
62
- D[g] = M;
63
- var p = "$isDayjsObject", S = function(t2) {
64
- return t2 instanceof _ || !(!t2 || !t2[p]);
65
- }, w = function t2(e2, n2, r2) {
66
- var i2;
67
- if (!e2) return g;
68
- if ("string" == typeof e2) {
69
- var s2 = e2.toLowerCase();
70
- D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
71
- var u2 = e2.split("-");
72
- if (!i2 && u2.length > 1) return t2(u2[0]);
73
- } else {
74
- var a2 = e2.name;
75
- D[a2] = e2, i2 = a2;
76
- }
77
- return !r2 && i2 && (g = i2), i2 || !r2 && g;
78
- }, O = function(t2, e2) {
79
- if (S(t2)) return t2.clone();
80
- var n2 = "object" == typeof e2 ? e2 : {};
81
- return n2.date = t2, n2.args = arguments, new _(n2);
82
- }, b = v;
83
- b.l = w, b.i = S, b.w = function(t2, e2) {
84
- return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
85
- };
86
- var _ = (function() {
87
- function M2(t2) {
88
- this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
89
- }
90
- var m2 = M2.prototype;
91
- return m2.parse = function(t2) {
92
- this.$d = (function(t3) {
93
- var e2 = t3.date, n2 = t3.utc;
94
- if (null === e2) return /* @__PURE__ */ new Date(NaN);
95
- if (b.u(e2)) return /* @__PURE__ */ new Date();
96
- if (e2 instanceof Date) return new Date(e2);
97
- if ("string" == typeof e2 && !/Z$/i.test(e2)) {
98
- var r2 = e2.match($);
99
- if (r2) {
100
- var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
101
- return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
102
- }
103
- }
104
- return new Date(e2);
105
- })(t2), this.init();
106
- }, m2.init = function() {
107
- var t2 = this.$d;
108
- this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
109
- }, m2.$utils = function() {
110
- return b;
111
- }, m2.isValid = function() {
112
- return !(this.$d.toString() === l);
113
- }, m2.isSame = function(t2, e2) {
114
- var n2 = O(t2);
115
- return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
116
- }, m2.isAfter = function(t2, e2) {
117
- return O(t2) < this.startOf(e2);
118
- }, m2.isBefore = function(t2, e2) {
119
- return this.endOf(e2) < O(t2);
120
- }, m2.$g = function(t2, e2, n2) {
121
- return b.u(t2) ? this[e2] : this.set(n2, t2);
122
- }, m2.unix = function() {
123
- return Math.floor(this.valueOf() / 1e3);
124
- }, m2.valueOf = function() {
125
- return this.$d.getTime();
126
- }, m2.startOf = function(t2, e2) {
127
- var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = function(t3, e3) {
128
- var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
129
- return r2 ? i2 : i2.endOf(a);
130
- }, $2 = function(t3, e3) {
131
- return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
132
- }, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
133
- switch (f2) {
134
- case h:
135
- return r2 ? l2(1, 0) : l2(31, 11);
136
- case c:
137
- return r2 ? l2(1, M3) : l2(0, M3 + 1);
138
- case o:
139
- var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
140
- return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
141
- case a:
142
- case d:
143
- return $2(v2 + "Hours", 0);
144
- case u:
145
- return $2(v2 + "Minutes", 1);
146
- case s:
147
- return $2(v2 + "Seconds", 2);
148
- case i:
149
- return $2(v2 + "Milliseconds", 3);
150
- default:
151
- return this.clone();
152
- }
153
- }, m2.endOf = function(t2) {
154
- return this.startOf(t2, false);
155
- }, m2.$set = function(t2, e2) {
156
- var n2, o2 = b.p(t2), f2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f2 + "Date", n2[d] = f2 + "Date", n2[c] = f2 + "Month", n2[h] = f2 + "FullYear", n2[u] = f2 + "Hours", n2[s] = f2 + "Minutes", n2[i] = f2 + "Seconds", n2[r] = f2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
157
- if (o2 === c || o2 === h) {
158
- var y2 = this.clone().set(d, 1);
159
- y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
160
- } else l2 && this.$d[l2]($2);
161
- return this.init(), this;
162
- }, m2.set = function(t2, e2) {
163
- return this.clone().$set(t2, e2);
164
- }, m2.get = function(t2) {
165
- return this[b.p(t2)]();
166
- }, m2.add = function(r2, f2) {
167
- var d2, l2 = this;
168
- r2 = Number(r2);
169
- var $2 = b.p(f2), y2 = function(t2) {
170
- var e2 = O(l2);
171
- return b.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
172
- };
173
- if ($2 === c) return this.set(c, this.$M + r2);
174
- if ($2 === h) return this.set(h, this.$y + r2);
175
- if ($2 === a) return y2(1);
176
- if ($2 === o) return y2(7);
177
- var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
178
- return b.w(m3, this);
179
- }, m2.subtract = function(t2, e2) {
180
- return this.add(-1 * t2, e2);
181
- }, m2.format = function(t2) {
182
- var e2 = this, n2 = this.$locale();
183
- if (!this.isValid()) return n2.invalidDate || l;
184
- var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c2 = n2.months, f2 = n2.meridiem, h2 = function(t3, n3, i3, s3) {
185
- return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
186
- }, d2 = function(t3) {
187
- return b.s(s2 % 12 || 12, t3, "0");
188
- }, $2 = f2 || function(t3, e3, n3) {
189
- var r3 = t3 < 12 ? "AM" : "PM";
190
- return n3 ? r3.toLowerCase() : r3;
191
- };
192
- return r2.replace(y, (function(t3, r3) {
193
- return r3 || (function(t4) {
194
- switch (t4) {
195
- case "YY":
196
- return String(e2.$y).slice(-2);
197
- case "YYYY":
198
- return b.s(e2.$y, 4, "0");
199
- case "M":
200
- return a2 + 1;
201
- case "MM":
202
- return b.s(a2 + 1, 2, "0");
203
- case "MMM":
204
- return h2(n2.monthsShort, a2, c2, 3);
205
- case "MMMM":
206
- return h2(c2, a2);
207
- case "D":
208
- return e2.$D;
209
- case "DD":
210
- return b.s(e2.$D, 2, "0");
211
- case "d":
212
- return String(e2.$W);
213
- case "dd":
214
- return h2(n2.weekdaysMin, e2.$W, o2, 2);
215
- case "ddd":
216
- return h2(n2.weekdaysShort, e2.$W, o2, 3);
217
- case "dddd":
218
- return o2[e2.$W];
219
- case "H":
220
- return String(s2);
221
- case "HH":
222
- return b.s(s2, 2, "0");
223
- case "h":
224
- return d2(1);
225
- case "hh":
226
- return d2(2);
227
- case "a":
228
- return $2(s2, u2, true);
229
- case "A":
230
- return $2(s2, u2, false);
231
- case "m":
232
- return String(u2);
233
- case "mm":
234
- return b.s(u2, 2, "0");
235
- case "s":
236
- return String(e2.$s);
237
- case "ss":
238
- return b.s(e2.$s, 2, "0");
239
- case "SSS":
240
- return b.s(e2.$ms, 3, "0");
241
- case "Z":
242
- return i2;
243
- }
244
- return null;
245
- })(t3) || i2.replace(":", "");
246
- }));
247
- }, m2.utcOffset = function() {
248
- return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
249
- }, m2.diff = function(r2, d2, l2) {
250
- var $2, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
251
- return b.m(y2, m3);
252
- };
253
- switch (M3) {
254
- case h:
255
- $2 = D2() / 12;
256
- break;
257
- case c:
258
- $2 = D2();
259
- break;
260
- case f:
261
- $2 = D2() / 3;
262
- break;
263
- case o:
264
- $2 = (g2 - v2) / 6048e5;
265
- break;
266
- case a:
267
- $2 = (g2 - v2) / 864e5;
268
- break;
269
- case u:
270
- $2 = g2 / n;
271
- break;
272
- case s:
273
- $2 = g2 / e;
274
- break;
275
- case i:
276
- $2 = g2 / t;
277
- break;
278
- default:
279
- $2 = g2;
280
- }
281
- return l2 ? $2 : b.a($2);
282
- }, m2.daysInMonth = function() {
283
- return this.endOf(c).$D;
284
- }, m2.$locale = function() {
285
- return D[this.$L];
286
- }, m2.locale = function(t2, e2) {
287
- if (!t2) return this.$L;
288
- var n2 = this.clone(), r2 = w(t2, e2, true);
289
- return r2 && (n2.$L = r2), n2;
290
- }, m2.clone = function() {
291
- return b.w(this.$d, this);
292
- }, m2.toDate = function() {
293
- return new Date(this.valueOf());
294
- }, m2.toJSON = function() {
295
- return this.isValid() ? this.toISOString() : null;
296
- }, m2.toISOString = function() {
297
- return this.$d.toISOString();
298
- }, m2.toString = function() {
299
- return this.$d.toUTCString();
300
- }, M2;
301
- })(), k = _.prototype;
302
- return O.prototype = k, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach((function(t2) {
303
- k[t2[1]] = function(e2) {
304
- return this.$g(e2, t2[0], t2[1]);
305
- };
306
- })), O.extend = function(t2, e2) {
307
- return t2.$i || (t2(e2, _, O), t2.$i = true), O;
308
- }, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
309
- return O(1e3 * t2);
310
- }, O.en = D[g], O.Ls = D, O.p = {}, O;
311
- }));
312
- }
313
- });
314
-
315
- // node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/customParseFormat.js
316
- var require_customParseFormat = __commonJS({
317
- "node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/customParseFormat.js"(exports, module) {
318
- "use strict";
319
- !(function(e, t) {
320
- "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_customParseFormat = t();
321
- })(exports, (function() {
322
- "use strict";
323
- var e = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, t = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, n = /\d/, r = /\d\d/, i = /\d\d?/, o = /\d*[^-_:/,()\s\d]+/, s = {}, a = function(e2) {
324
- return (e2 = +e2) + (e2 > 68 ? 1900 : 2e3);
325
- };
326
- var f = function(e2) {
327
- return function(t2) {
328
- this[e2] = +t2;
329
- };
330
- }, h = [/[+-]\d\d:?(\d\d)?|Z/, function(e2) {
331
- (this.zone || (this.zone = {})).offset = (function(e3) {
332
- if (!e3) return 0;
333
- if ("Z" === e3) return 0;
334
- var t2 = e3.match(/([+-]|\d\d)/g), n2 = 60 * t2[1] + (+t2[2] || 0);
335
- return 0 === n2 ? 0 : "+" === t2[0] ? -n2 : n2;
336
- })(e2);
337
- }], u = function(e2) {
338
- var t2 = s[e2];
339
- return t2 && (t2.indexOf ? t2 : t2.s.concat(t2.f));
340
- }, d = function(e2, t2) {
341
- var n2, r2 = s.meridiem;
342
- if (r2) {
343
- for (var i2 = 1; i2 <= 24; i2 += 1) if (e2.indexOf(r2(i2, 0, t2)) > -1) {
344
- n2 = i2 > 12;
345
- break;
346
- }
347
- } else n2 = e2 === (t2 ? "pm" : "PM");
348
- return n2;
349
- }, c = { A: [o, function(e2) {
350
- this.afternoon = d(e2, false);
351
- }], a: [o, function(e2) {
352
- this.afternoon = d(e2, true);
353
- }], Q: [n, function(e2) {
354
- this.month = 3 * (e2 - 1) + 1;
355
- }], S: [n, function(e2) {
356
- this.milliseconds = 100 * +e2;
357
- }], SS: [r, function(e2) {
358
- this.milliseconds = 10 * +e2;
359
- }], SSS: [/\d{3}/, function(e2) {
360
- this.milliseconds = +e2;
361
- }], s: [i, f("seconds")], ss: [i, f("seconds")], m: [i, f("minutes")], mm: [i, f("minutes")], H: [i, f("hours")], h: [i, f("hours")], HH: [i, f("hours")], hh: [i, f("hours")], D: [i, f("day")], DD: [r, f("day")], Do: [o, function(e2) {
362
- var t2 = s.ordinal, n2 = e2.match(/\d+/);
363
- if (this.day = n2[0], t2) for (var r2 = 1; r2 <= 31; r2 += 1) t2(r2).replace(/\[|\]/g, "") === e2 && (this.day = r2);
364
- }], w: [i, f("week")], ww: [r, f("week")], M: [i, f("month")], MM: [r, f("month")], MMM: [o, function(e2) {
365
- var t2 = u("months"), n2 = (u("monthsShort") || t2.map((function(e3) {
366
- return e3.slice(0, 3);
367
- }))).indexOf(e2) + 1;
368
- if (n2 < 1) throw new Error();
369
- this.month = n2 % 12 || n2;
370
- }], MMMM: [o, function(e2) {
371
- var t2 = u("months").indexOf(e2) + 1;
372
- if (t2 < 1) throw new Error();
373
- this.month = t2 % 12 || t2;
374
- }], Y: [/[+-]?\d+/, f("year")], YY: [r, function(e2) {
375
- this.year = a(e2);
376
- }], YYYY: [/\d{4}/, f("year")], Z: h, ZZ: h };
377
- function l(n2) {
378
- var r2, i2;
379
- r2 = n2, i2 = s && s.formats;
380
- for (var o2 = (n2 = r2.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(t2, n3, r3) {
381
- var o3 = r3 && r3.toUpperCase();
382
- return n3 || i2[r3] || e[r3] || i2[o3].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(e2, t3, n4) {
383
- return t3 || n4.slice(1);
384
- }));
385
- }))).match(t), a2 = o2.length, f2 = 0; f2 < a2; f2 += 1) {
386
- var h2 = o2[f2], u2 = c[h2], d2 = u2 && u2[0], l2 = u2 && u2[1];
387
- o2[f2] = l2 ? { regex: d2, parser: l2 } : h2.replace(/^\[|\]$/g, "");
388
- }
389
- return function(e2) {
390
- for (var t2 = {}, n3 = 0, r3 = 0; n3 < a2; n3 += 1) {
391
- var i3 = o2[n3];
392
- if ("string" == typeof i3) r3 += i3.length;
393
- else {
394
- var s2 = i3.regex, f3 = i3.parser, h3 = e2.slice(r3), u3 = s2.exec(h3)[0];
395
- f3.call(t2, u3), e2 = e2.replace(u3, "");
396
- }
397
- }
398
- return (function(e3) {
399
- var t3 = e3.afternoon;
400
- if (void 0 !== t3) {
401
- var n4 = e3.hours;
402
- t3 ? n4 < 12 && (e3.hours += 12) : 12 === n4 && (e3.hours = 0), delete e3.afternoon;
403
- }
404
- })(t2), t2;
405
- };
406
- }
407
- return function(e2, t2, n2) {
408
- n2.p.customParseFormat = true, e2 && e2.parseTwoDigitYear && (a = e2.parseTwoDigitYear);
409
- var r2 = t2.prototype, i2 = r2.parse;
410
- r2.parse = function(e3) {
411
- var t3 = e3.date, r3 = e3.utc, o2 = e3.args;
412
- this.$u = r3;
413
- var a2 = o2[1];
414
- if ("string" == typeof a2) {
415
- var f2 = true === o2[2], h2 = true === o2[3], u2 = f2 || h2, d2 = o2[2];
416
- h2 && (d2 = o2[2]), s = this.$locale(), !f2 && d2 && (s = n2.Ls[d2]), this.$d = (function(e4, t4, n3, r4) {
417
- try {
418
- if (["x", "X"].indexOf(t4) > -1) return new Date(("X" === t4 ? 1e3 : 1) * e4);
419
- var i3 = l(t4)(e4), o3 = i3.year, s2 = i3.month, a3 = i3.day, f3 = i3.hours, h3 = i3.minutes, u3 = i3.seconds, d3 = i3.milliseconds, c3 = i3.zone, m2 = i3.week, M2 = /* @__PURE__ */ new Date(), Y = a3 || (o3 || s2 ? 1 : M2.getDate()), p = o3 || M2.getFullYear(), v = 0;
420
- o3 && !s2 || (v = s2 > 0 ? s2 - 1 : M2.getMonth());
421
- var D, w = f3 || 0, g = h3 || 0, y = u3 || 0, L = d3 || 0;
422
- return c3 ? new Date(Date.UTC(p, v, Y, w, g, y, L + 60 * c3.offset * 1e3)) : n3 ? new Date(Date.UTC(p, v, Y, w, g, y, L)) : (D = new Date(p, v, Y, w, g, y, L), m2 && (D = r4(D).week(m2).toDate()), D);
423
- } catch (e5) {
424
- return /* @__PURE__ */ new Date("");
425
- }
426
- })(t3, a2, r3, n2), this.init(), d2 && true !== d2 && (this.$L = this.locale(d2).$L), u2 && t3 != this.format(a2) && (this.$d = /* @__PURE__ */ new Date("")), s = {};
427
- } else if (a2 instanceof Array) for (var c2 = a2.length, m = 1; m <= c2; m += 1) {
428
- o2[1] = a2[m - 1];
429
- var M = n2.apply(this, o2);
430
- if (M.isValid()) {
431
- this.$d = M.$d, this.$L = M.$L, this.init();
432
- break;
433
- }
434
- m === c2 && (this.$d = /* @__PURE__ */ new Date(""));
435
- }
436
- else i2.call(this, e3);
437
- };
438
- };
439
- }));
440
- }
441
- });
442
-
443
- // node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/utc.js
444
- var require_utc = __commonJS({
445
- "node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/utc.js"(exports, module) {
446
- "use strict";
447
- !(function(t, i) {
448
- "object" == typeof exports && "undefined" != typeof module ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs_plugin_utc = i();
449
- })(exports, (function() {
450
- "use strict";
451
- var t = "minute", i = /[+-]\d\d(?::?\d\d)?/g, e = /([+-]|\d\d)/g;
452
- return function(s, f, n) {
453
- var u = f.prototype;
454
- n.utc = function(t2) {
455
- var i2 = { date: t2, utc: true, args: arguments };
456
- return new f(i2);
457
- }, u.utc = function(i2) {
458
- var e2 = n(this.toDate(), { locale: this.$L, utc: true });
459
- return i2 ? e2.add(this.utcOffset(), t) : e2;
460
- }, u.local = function() {
461
- return n(this.toDate(), { locale: this.$L, utc: false });
462
- };
463
- var r = u.parse;
464
- u.parse = function(t2) {
465
- t2.utc && (this.$u = true), this.$utils().u(t2.$offset) || (this.$offset = t2.$offset), r.call(this, t2);
466
- };
467
- var o = u.init;
468
- u.init = function() {
469
- if (this.$u) {
470
- var t2 = this.$d;
471
- this.$y = t2.getUTCFullYear(), this.$M = t2.getUTCMonth(), this.$D = t2.getUTCDate(), this.$W = t2.getUTCDay(), this.$H = t2.getUTCHours(), this.$m = t2.getUTCMinutes(), this.$s = t2.getUTCSeconds(), this.$ms = t2.getUTCMilliseconds();
472
- } else o.call(this);
473
- };
474
- var a = u.utcOffset;
475
- u.utcOffset = function(s2, f2) {
476
- var n2 = this.$utils().u;
477
- if (n2(s2)) return this.$u ? 0 : n2(this.$offset) ? a.call(this) : this.$offset;
478
- if ("string" == typeof s2 && (s2 = (function(t2) {
479
- void 0 === t2 && (t2 = "");
480
- var s3 = t2.match(i);
481
- if (!s3) return null;
482
- var f3 = ("" + s3[0]).match(e) || ["-", 0, 0], n3 = f3[0], u3 = 60 * +f3[1] + +f3[2];
483
- return 0 === u3 ? 0 : "+" === n3 ? u3 : -u3;
484
- })(s2), null === s2)) return this;
485
- var u2 = Math.abs(s2) <= 16 ? 60 * s2 : s2;
486
- if (0 === u2) return this.utc(f2);
487
- var r2 = this.clone();
488
- if (f2) return r2.$offset = u2, r2.$u = false, r2;
489
- var o2 = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
490
- return (r2 = this.local().add(u2 + o2, t)).$offset = u2, r2.$x.$localOffset = o2, r2;
491
- };
492
- var h = u.format;
493
- u.format = function(t2) {
494
- var i2 = t2 || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
495
- return h.call(this, i2);
496
- }, u.valueOf = function() {
497
- var t2 = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
498
- return this.$d.valueOf() - 6e4 * t2;
499
- }, u.isUTC = function() {
500
- return !!this.$u;
501
- }, u.toISOString = function() {
502
- return this.toDate().toISOString();
503
- }, u.toString = function() {
504
- return this.toDate().toUTCString();
505
- };
506
- var l = u.toDate;
507
- u.toDate = function(t2) {
508
- return "s" === t2 && this.$offset ? n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : l.call(this);
509
- };
510
- var c = u.diff;
511
- u.diff = function(t2, i2, e2) {
512
- if (t2 && this.$u === t2.$u) return c.call(this, t2, i2, e2);
513
- var s2 = this.local(), f2 = n(t2).local();
514
- return c.call(s2, f2, i2, e2);
515
- };
516
- };
517
- }));
518
- }
519
- });
520
-
521
- // node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/timezone.js
522
- var require_timezone = __commonJS({
523
- "node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/timezone.js"(exports, module) {
524
- "use strict";
525
- !(function(t, e) {
526
- "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs_plugin_timezone = e();
527
- })(exports, (function() {
528
- "use strict";
529
- var t = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, e = {};
530
- return function(n, i, o) {
531
- var r, a = function(t2, n2, i2) {
532
- void 0 === i2 && (i2 = {});
533
- var o2 = new Date(t2), r2 = (function(t3, n3) {
534
- void 0 === n3 && (n3 = {});
535
- var i3 = n3.timeZoneName || "short", o3 = t3 + "|" + i3, r3 = e[o3];
536
- return r3 || (r3 = new Intl.DateTimeFormat("en-US", { hour12: false, timeZone: t3, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: i3 }), e[o3] = r3), r3;
537
- })(n2, i2);
538
- return r2.formatToParts(o2);
539
- }, u = function(e2, n2) {
540
- for (var i2 = a(e2, n2), r2 = [], u2 = 0; u2 < i2.length; u2 += 1) {
541
- var f2 = i2[u2], s2 = f2.type, m = f2.value, c = t[s2];
542
- c >= 0 && (r2[c] = parseInt(m, 10));
543
- }
544
- var d = r2[3], l = 24 === d ? 0 : d, h = r2[0] + "-" + r2[1] + "-" + r2[2] + " " + l + ":" + r2[4] + ":" + r2[5] + ":000", v = +e2;
545
- return (o.utc(h).valueOf() - (v -= v % 1e3)) / 6e4;
546
- }, f = i.prototype;
547
- f.tz = function(t2, e2) {
548
- void 0 === t2 && (t2 = r);
549
- var n2, i2 = this.utcOffset(), a2 = this.toDate(), u2 = a2.toLocaleString("en-US", { timeZone: t2 }), f2 = Math.round((a2 - new Date(u2)) / 1e3 / 60), s2 = 15 * -Math.round(a2.getTimezoneOffset() / 15) - f2;
550
- if (!Number(s2)) n2 = this.utcOffset(0, e2);
551
- else if (n2 = o(u2, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(s2, true), e2) {
552
- var m = n2.utcOffset();
553
- n2 = n2.add(i2 - m, "minute");
554
- }
555
- return n2.$x.$timezone = t2, n2;
556
- }, f.offsetName = function(t2) {
557
- var e2 = this.$x.$timezone || o.tz.guess(), n2 = a(this.valueOf(), e2, { timeZoneName: t2 }).find((function(t3) {
558
- return "timezonename" === t3.type.toLowerCase();
559
- }));
560
- return n2 && n2.value;
561
- };
562
- var s = f.startOf;
563
- f.startOf = function(t2, e2) {
564
- if (!this.$x || !this.$x.$timezone) return s.call(this, t2, e2);
565
- var n2 = o(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
566
- return s.call(n2, t2, e2).tz(this.$x.$timezone, true);
567
- }, o.tz = function(t2, e2, n2) {
568
- var i2 = n2 && e2, a2 = n2 || e2 || r, f2 = u(+o(), a2);
569
- if ("string" != typeof t2) return o(t2).tz(a2);
570
- var s2 = (function(t3, e3, n3) {
571
- var i3 = t3 - 60 * e3 * 1e3, o2 = u(i3, n3);
572
- if (e3 === o2) return [i3, e3];
573
- var r2 = u(i3 -= 60 * (o2 - e3) * 1e3, n3);
574
- return o2 === r2 ? [i3, o2] : [t3 - 60 * Math.min(o2, r2) * 1e3, Math.max(o2, r2)];
575
- })(o.utc(t2, i2).valueOf(), f2, a2), m = s2[0], c = s2[1], d = o(m).utcOffset(c);
576
- return d.$x.$timezone = a2, d;
577
- }, o.tz.guess = function() {
578
- return Intl.DateTimeFormat().resolvedOptions().timeZone;
579
- }, o.tz.setDefault = function(t2) {
580
- r = t2;
581
- };
582
- };
583
- }));
584
- }
585
- });
586
-
587
- // node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/relativeTime.js
588
- var require_relativeTime = __commonJS({
589
- "node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/relativeTime.js"(exports, module) {
590
- "use strict";
591
- !(function(r, e) {
592
- "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (r = "undefined" != typeof globalThis ? globalThis : r || self).dayjs_plugin_relativeTime = e();
593
- })(exports, (function() {
594
- "use strict";
595
- return function(r, e, t) {
596
- r = r || {};
597
- var n = e.prototype, o = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" };
598
- function i(r2, e2, t2, o2) {
599
- return n.fromToBase(r2, e2, t2, o2);
600
- }
601
- t.en.relativeTime = o, n.fromToBase = function(e2, n2, i2, d2, u) {
602
- for (var f, a, s, l = i2.$locale().relativeTime || o, h = r.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], m = h.length, c = 0; c < m; c += 1) {
603
- var y = h[c];
604
- y.d && (f = d2 ? t(e2).diff(i2, y.d, true) : i2.diff(e2, y.d, true));
605
- var p = (r.rounding || Math.round)(Math.abs(f));
606
- if (s = f > 0, p <= y.r || !y.r) {
607
- p <= 1 && c > 0 && (y = h[c - 1]);
608
- var v = l[y.l];
609
- u && (p = u("" + p)), a = "string" == typeof v ? v.replace("%d", p) : v(p, n2, y.l, s);
610
- break;
611
- }
612
- }
613
- if (n2) return a;
614
- var M = s ? l.future : l.past;
615
- return "function" == typeof M ? M(a) : M.replace("%s", a);
616
- }, n.to = function(r2, e2) {
617
- return i(r2, e2, this, true);
618
- }, n.from = function(r2, e2) {
619
- return i(r2, e2, this);
620
- };
621
- var d = function(r2) {
622
- return r2.$u ? t.utc() : t();
623
- };
624
- n.toNow = function(r2) {
625
- return this.to(d(this), r2);
626
- }, n.fromNow = function(r2) {
627
- return this.from(d(this), r2);
628
- };
629
- };
630
- }));
631
- }
632
- });
633
-
634
- // node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/advancedFormat.js
635
- var require_advancedFormat = __commonJS({
636
- "node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/advancedFormat.js"(exports, module) {
637
- "use strict";
638
- !(function(e, t) {
639
- "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_advancedFormat = t();
640
- })(exports, (function() {
641
- "use strict";
642
- return function(e, t) {
643
- var r = t.prototype, n = r.format;
644
- r.format = function(e2) {
645
- var t2 = this, r2 = this.$locale();
646
- if (!this.isValid()) return n.bind(this)(e2);
647
- var s = this.$utils(), a = (e2 || "YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, (function(e3) {
648
- switch (e3) {
649
- case "Q":
650
- return Math.ceil((t2.$M + 1) / 3);
651
- case "Do":
652
- return r2.ordinal(t2.$D);
653
- case "gggg":
654
- return t2.weekYear();
655
- case "GGGG":
656
- return t2.isoWeekYear();
657
- case "wo":
658
- return r2.ordinal(t2.week(), "W");
659
- case "w":
660
- case "ww":
661
- return s.s(t2.week(), "w" === e3 ? 1 : 2, "0");
662
- case "W":
663
- case "WW":
664
- return s.s(t2.isoWeek(), "W" === e3 ? 1 : 2, "0");
665
- case "k":
666
- case "kk":
667
- return s.s(String(0 === t2.$H ? 24 : t2.$H), "k" === e3 ? 1 : 2, "0");
668
- case "X":
669
- return Math.floor(t2.$d.getTime() / 1e3);
670
- case "x":
671
- return t2.$d.getTime();
672
- case "z":
673
- return "[" + t2.offsetName() + "]";
674
- case "zzz":
675
- return "[" + t2.offsetName("long") + "]";
676
- default:
677
- return e3;
678
- }
679
- }));
680
- return n.bind(this)(a);
681
- };
682
- };
683
- }));
684
- }
685
- });
686
-
687
- // node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/locale/zh-cn.js
688
- var require_zh_cn = __commonJS({
689
- "node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/locale/zh-cn.js"(exports, module) {
690
- "use strict";
691
- !(function(e, _) {
692
- "object" == typeof exports && "undefined" != typeof module ? module.exports = _(require_dayjs_min()) : "function" == typeof define && define.amd ? define(["dayjs"], _) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_locale_zh_cn = _(e.dayjs);
693
- })(exports, (function(e) {
694
- "use strict";
695
- function _(e2) {
696
- return e2 && "object" == typeof e2 && "default" in e2 ? e2 : { default: e2 };
697
- }
698
- var t = _(e), d = { name: "zh-cn", weekdays: "\u661F\u671F\u65E5_\u661F\u671F\u4E00_\u661F\u671F\u4E8C_\u661F\u671F\u4E09_\u661F\u671F\u56DB_\u661F\u671F\u4E94_\u661F\u671F\u516D".split("_"), weekdaysShort: "\u5468\u65E5_\u5468\u4E00_\u5468\u4E8C_\u5468\u4E09_\u5468\u56DB_\u5468\u4E94_\u5468\u516D".split("_"), weekdaysMin: "\u65E5_\u4E00_\u4E8C_\u4E09_\u56DB_\u4E94_\u516D".split("_"), months: "\u4E00\u6708_\u4E8C\u6708_\u4E09\u6708_\u56DB\u6708_\u4E94\u6708_\u516D\u6708_\u4E03\u6708_\u516B\u6708_\u4E5D\u6708_\u5341\u6708_\u5341\u4E00\u6708_\u5341\u4E8C\u6708".split("_"), monthsShort: "1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"), ordinal: function(e2, _2) {
699
- return "W" === _2 ? e2 + "\u5468" : e2 + "\u65E5";
700
- }, weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY/MM/DD", LL: "YYYY\u5E74M\u6708D\u65E5", LLL: "YYYY\u5E74M\u6708D\u65E5Ah\u70B9mm\u5206", LLLL: "YYYY\u5E74M\u6708D\u65E5ddddAh\u70B9mm\u5206", l: "YYYY/M/D", ll: "YYYY\u5E74M\u6708D\u65E5", lll: "YYYY\u5E74M\u6708D\u65E5 HH:mm", llll: "YYYY\u5E74M\u6708D\u65E5dddd HH:mm" }, relativeTime: { future: "%s\u5185", past: "%s\u524D", s: "\u51E0\u79D2", m: "1 \u5206\u949F", mm: "%d \u5206\u949F", h: "1 \u5C0F\u65F6", hh: "%d \u5C0F\u65F6", d: "1 \u5929", dd: "%d \u5929", M: "1 \u4E2A\u6708", MM: "%d \u4E2A\u6708", y: "1 \u5E74", yy: "%d \u5E74" }, meridiem: function(e2, _2) {
701
- var t2 = 100 * e2 + _2;
702
- return t2 < 600 ? "\u51CC\u6668" : t2 < 900 ? "\u65E9\u4E0A" : t2 < 1100 ? "\u4E0A\u5348" : t2 < 1300 ? "\u4E2D\u5348" : t2 < 1800 ? "\u4E0B\u5348" : "\u665A\u4E0A";
703
- } };
704
- return t.default.locale(d, null, true), d;
705
- }));
706
- }
707
- });
708
-
709
21
  // src/web/index.ts
710
22
  var web_exports = {};
711
23
  __export(web_exports, {
@@ -718,7 +30,6 @@ var baseToolsWeb = (() => {
718
30
  copyText: () => copyText,
719
31
  copyUrl: () => copyUrl,
720
32
  download: () => download,
721
- getAppConfig: () => getAppConfig,
722
33
  getBrowserName: () => getBrowserName,
723
34
  getBrowserVersion: () => getBrowserVersion,
724
35
  getCookie: () => getCookie,
@@ -752,8 +63,6 @@ var baseToolsWeb = (() => {
752
63
  preloadImage: () => preloadImage,
753
64
  removeCookie: () => removeCookie,
754
65
  removeLocalStorage: () => removeLocalStorage,
755
- request: () => request,
756
- setBaseToolsConfig: () => setBaseToolsConfig,
757
66
  setCookie: () => setCookie,
758
67
  setLocalStorage: () => setLocalStorage,
759
68
  unlockBodyScroll: () => unlockBodyScroll,
@@ -959,15 +268,6 @@ var baseToolsWeb = (() => {
959
268
  });
960
269
  }
961
270
 
962
- // src/web/config/index.ts
963
- var appConfig = {};
964
- function getAppConfig() {
965
- return appConfig;
966
- }
967
- function setBaseToolsConfig(newConfig) {
968
- Object.assign(appConfig, newConfig);
969
- }
970
-
971
271
  // src/web/cookie/index.ts
972
272
  function setCookie(name, value, days) {
973
273
  const date = /* @__PURE__ */ new Date();
@@ -1122,7 +422,7 @@ var baseToolsWeb = (() => {
1122
422
  window.scrollTo(0, y);
1123
423
  }
1124
424
 
1125
- // src/web/network/load.ts
425
+ // src/web/load/index.ts
1126
426
  async function download(url, fileName = "") {
1127
427
  if (!url) return;
1128
428
  let blobUrl = "";
@@ -1243,690 +543,6 @@ var baseToolsWeb = (() => {
1243
543
  });
1244
544
  }
1245
545
 
1246
- // src/ts/day/index.ts
1247
- var import_dayjs = __toESM(require_dayjs_min(), 1);
1248
- var import_customParseFormat = __toESM(require_customParseFormat(), 1);
1249
- var import_utc = __toESM(require_utc(), 1);
1250
- var import_timezone = __toESM(require_timezone(), 1);
1251
- var import_relativeTime = __toESM(require_relativeTime(), 1);
1252
- var import_advancedFormat = __toESM(require_advancedFormat(), 1);
1253
- var import_zh_cn = __toESM(require_zh_cn(), 1);
1254
- import_dayjs.default.extend(import_customParseFormat.default);
1255
- import_dayjs.default.extend(import_utc.default);
1256
- import_dayjs.default.extend(import_timezone.default);
1257
- import_dayjs.default.extend(import_relativeTime.default);
1258
- import_dayjs.default.extend(import_advancedFormat.default);
1259
- import_dayjs.default.locale("zh-cn");
1260
- function toDayjs(t, fmt) {
1261
- if (t === null || t === void 0) return (0, import_dayjs.default)();
1262
- if (typeof t === "number") {
1263
- const s = String(Math.trunc(t));
1264
- return (0, import_dayjs.default)(s.length === 10 ? t * 1e3 : t, fmt);
1265
- }
1266
- if (typeof t === "string") {
1267
- const s = t.trim();
1268
- if (/^\d{10}$/.test(s)) return (0, import_dayjs.default)(Number(s) * 1e3, fmt);
1269
- if (/^\d{13}$/.test(s)) return (0, import_dayjs.default)(Number(s), fmt);
1270
- if (/^\d{4}-\d{2}-\d{2}$/.test(s)) return (0, import_dayjs.default)(s, fmt || "YYYY-MM-DD");
1271
- if (/^\d{4}\/\d{2}\/\d{2}$/.test(s)) return (0, import_dayjs.default)(s, fmt || "YYYY/MM/DD");
1272
- if (/^\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2}$/.test(s))
1273
- return (0, import_dayjs.default)(s, fmt || "YYYY-MM-DD HH:mm:ss");
1274
- if (/^\d{4}\/\d{2}\/\d{2}\s+\d{2}:\d{2}:\d{2}$/.test(s))
1275
- return (0, import_dayjs.default)(s, fmt || "YYYY/MM/DD HH:mm:ss");
1276
- return (0, import_dayjs.default)(s, fmt);
1277
- }
1278
- return (0, import_dayjs.default)(t, fmt);
1279
- }
1280
-
1281
- // node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/predicate/isPrimitive.mjs
1282
- function isPrimitive(value) {
1283
- return value == null || typeof value !== "object" && typeof value !== "function";
1284
- }
1285
-
1286
- // node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/predicate/isTypedArray.mjs
1287
- function isTypedArray(x) {
1288
- return ArrayBuffer.isView(x) && !(x instanceof DataView);
1289
- }
1290
-
1291
- // node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/compat/_internal/getSymbols.mjs
1292
- function getSymbols(object) {
1293
- return Object.getOwnPropertySymbols(object).filter((symbol) => Object.prototype.propertyIsEnumerable.call(object, symbol));
1294
- }
1295
-
1296
- // node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/compat/_internal/getTag.mjs
1297
- function getTag(value) {
1298
- if (value == null) {
1299
- return value === void 0 ? "[object Undefined]" : "[object Null]";
1300
- }
1301
- return Object.prototype.toString.call(value);
1302
- }
1303
-
1304
- // node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/compat/_internal/tags.mjs
1305
- var regexpTag = "[object RegExp]";
1306
- var stringTag = "[object String]";
1307
- var numberTag = "[object Number]";
1308
- var booleanTag = "[object Boolean]";
1309
- var argumentsTag = "[object Arguments]";
1310
- var symbolTag = "[object Symbol]";
1311
- var dateTag = "[object Date]";
1312
- var mapTag = "[object Map]";
1313
- var setTag = "[object Set]";
1314
- var arrayTag = "[object Array]";
1315
- var arrayBufferTag = "[object ArrayBuffer]";
1316
- var objectTag = "[object Object]";
1317
- var dataViewTag = "[object DataView]";
1318
- var uint8ArrayTag = "[object Uint8Array]";
1319
- var uint8ClampedArrayTag = "[object Uint8ClampedArray]";
1320
- var uint16ArrayTag = "[object Uint16Array]";
1321
- var uint32ArrayTag = "[object Uint32Array]";
1322
- var int8ArrayTag = "[object Int8Array]";
1323
- var int16ArrayTag = "[object Int16Array]";
1324
- var int32ArrayTag = "[object Int32Array]";
1325
- var float32ArrayTag = "[object Float32Array]";
1326
- var float64ArrayTag = "[object Float64Array]";
1327
-
1328
- // node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/object/cloneDeepWith.mjs
1329
- function cloneDeepWithImpl(valueToClone, keyToClone, objectToClone, stack = /* @__PURE__ */ new Map(), cloneValue = void 0) {
1330
- const cloned = cloneValue?.(valueToClone, keyToClone, objectToClone, stack);
1331
- if (cloned !== void 0) {
1332
- return cloned;
1333
- }
1334
- if (isPrimitive(valueToClone)) {
1335
- return valueToClone;
1336
- }
1337
- if (stack.has(valueToClone)) {
1338
- return stack.get(valueToClone);
1339
- }
1340
- if (Array.isArray(valueToClone)) {
1341
- const result = new Array(valueToClone.length);
1342
- stack.set(valueToClone, result);
1343
- for (let i = 0; i < valueToClone.length; i++) {
1344
- result[i] = cloneDeepWithImpl(valueToClone[i], i, objectToClone, stack, cloneValue);
1345
- }
1346
- if (Object.hasOwn(valueToClone, "index")) {
1347
- result.index = valueToClone.index;
1348
- }
1349
- if (Object.hasOwn(valueToClone, "input")) {
1350
- result.input = valueToClone.input;
1351
- }
1352
- return result;
1353
- }
1354
- if (valueToClone instanceof Date) {
1355
- return new Date(valueToClone.getTime());
1356
- }
1357
- if (valueToClone instanceof RegExp) {
1358
- const result = new RegExp(valueToClone.source, valueToClone.flags);
1359
- result.lastIndex = valueToClone.lastIndex;
1360
- return result;
1361
- }
1362
- if (valueToClone instanceof Map) {
1363
- const result = /* @__PURE__ */ new Map();
1364
- stack.set(valueToClone, result);
1365
- for (const [key, value] of valueToClone) {
1366
- result.set(key, cloneDeepWithImpl(value, key, objectToClone, stack, cloneValue));
1367
- }
1368
- return result;
1369
- }
1370
- if (valueToClone instanceof Set) {
1371
- const result = /* @__PURE__ */ new Set();
1372
- stack.set(valueToClone, result);
1373
- for (const value of valueToClone) {
1374
- result.add(cloneDeepWithImpl(value, void 0, objectToClone, stack, cloneValue));
1375
- }
1376
- return result;
1377
- }
1378
- if (typeof Buffer !== "undefined" && Buffer.isBuffer(valueToClone)) {
1379
- return valueToClone.subarray();
1380
- }
1381
- if (isTypedArray(valueToClone)) {
1382
- const result = new (Object.getPrototypeOf(valueToClone)).constructor(valueToClone.length);
1383
- stack.set(valueToClone, result);
1384
- for (let i = 0; i < valueToClone.length; i++) {
1385
- result[i] = cloneDeepWithImpl(valueToClone[i], i, objectToClone, stack, cloneValue);
1386
- }
1387
- return result;
1388
- }
1389
- if (valueToClone instanceof ArrayBuffer || typeof SharedArrayBuffer !== "undefined" && valueToClone instanceof SharedArrayBuffer) {
1390
- return valueToClone.slice(0);
1391
- }
1392
- if (valueToClone instanceof DataView) {
1393
- const result = new DataView(valueToClone.buffer.slice(0), valueToClone.byteOffset, valueToClone.byteLength);
1394
- stack.set(valueToClone, result);
1395
- copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
1396
- return result;
1397
- }
1398
- if (typeof File !== "undefined" && valueToClone instanceof File) {
1399
- const result = new File([valueToClone], valueToClone.name, {
1400
- type: valueToClone.type
1401
- });
1402
- stack.set(valueToClone, result);
1403
- copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
1404
- return result;
1405
- }
1406
- if (typeof Blob !== "undefined" && valueToClone instanceof Blob) {
1407
- const result = new Blob([valueToClone], { type: valueToClone.type });
1408
- stack.set(valueToClone, result);
1409
- copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
1410
- return result;
1411
- }
1412
- if (valueToClone instanceof Error) {
1413
- const result = new valueToClone.constructor();
1414
- stack.set(valueToClone, result);
1415
- result.message = valueToClone.message;
1416
- result.name = valueToClone.name;
1417
- result.stack = valueToClone.stack;
1418
- result.cause = valueToClone.cause;
1419
- copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
1420
- return result;
1421
- }
1422
- if (valueToClone instanceof Boolean) {
1423
- const result = new Boolean(valueToClone.valueOf());
1424
- stack.set(valueToClone, result);
1425
- copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
1426
- return result;
1427
- }
1428
- if (valueToClone instanceof Number) {
1429
- const result = new Number(valueToClone.valueOf());
1430
- stack.set(valueToClone, result);
1431
- copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
1432
- return result;
1433
- }
1434
- if (valueToClone instanceof String) {
1435
- const result = new String(valueToClone.valueOf());
1436
- stack.set(valueToClone, result);
1437
- copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
1438
- return result;
1439
- }
1440
- if (typeof valueToClone === "object" && isCloneableObject(valueToClone)) {
1441
- const result = Object.create(Object.getPrototypeOf(valueToClone));
1442
- stack.set(valueToClone, result);
1443
- copyProperties(result, valueToClone, objectToClone, stack, cloneValue);
1444
- return result;
1445
- }
1446
- return valueToClone;
1447
- }
1448
- function copyProperties(target, source, objectToClone = target, stack, cloneValue) {
1449
- const keys = [...Object.keys(source), ...getSymbols(source)];
1450
- for (let i = 0; i < keys.length; i++) {
1451
- const key = keys[i];
1452
- const descriptor = Object.getOwnPropertyDescriptor(target, key);
1453
- if (descriptor == null || descriptor.writable) {
1454
- target[key] = cloneDeepWithImpl(source[key], key, objectToClone, stack, cloneValue);
1455
- }
1456
- }
1457
- }
1458
- function isCloneableObject(object) {
1459
- switch (getTag(object)) {
1460
- case argumentsTag:
1461
- case arrayTag:
1462
- case arrayBufferTag:
1463
- case dataViewTag:
1464
- case booleanTag:
1465
- case dateTag:
1466
- case float32ArrayTag:
1467
- case float64ArrayTag:
1468
- case int8ArrayTag:
1469
- case int16ArrayTag:
1470
- case int32ArrayTag:
1471
- case mapTag:
1472
- case numberTag:
1473
- case objectTag:
1474
- case regexpTag:
1475
- case setTag:
1476
- case stringTag:
1477
- case symbolTag:
1478
- case uint8ArrayTag:
1479
- case uint8ClampedArrayTag:
1480
- case uint16ArrayTag:
1481
- case uint32ArrayTag: {
1482
- return true;
1483
- }
1484
- default: {
1485
- return false;
1486
- }
1487
- }
1488
- }
1489
-
1490
- // node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/object/cloneDeep.mjs
1491
- function cloneDeep(obj) {
1492
- return cloneDeepWithImpl(obj, void 0, obj, /* @__PURE__ */ new Map(), void 0);
1493
- }
1494
-
1495
- // node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/predicate/isPlainObject.mjs
1496
- function isPlainObject(value) {
1497
- if (!value || typeof value !== "object") {
1498
- return false;
1499
- }
1500
- const proto = Object.getPrototypeOf(value);
1501
- const hasObjectPrototype = proto === null || proto === Object.prototype || Object.getPrototypeOf(proto) === null;
1502
- if (!hasObjectPrototype) {
1503
- return false;
1504
- }
1505
- return Object.prototype.toString.call(value) === "[object Object]";
1506
- }
1507
-
1508
- // node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.mjs
1509
- function isUnsafeProperty(key) {
1510
- return key === "__proto__";
1511
- }
1512
-
1513
- // node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/object/pickBy.mjs
1514
- function pickBy(obj, shouldPick) {
1515
- const result = {};
1516
- const keys = Object.keys(obj);
1517
- for (let i = 0; i < keys.length; i++) {
1518
- const key = keys[i];
1519
- const value = obj[key];
1520
- if (shouldPick(value, key)) {
1521
- result[key] = value;
1522
- }
1523
- }
1524
- return result;
1525
- }
1526
-
1527
- // node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/compat/_internal/isDeepKey.mjs
1528
- function isDeepKey(key) {
1529
- switch (typeof key) {
1530
- case "number":
1531
- case "symbol": {
1532
- return false;
1533
- }
1534
- case "string": {
1535
- return key.includes(".") || key.includes("[") || key.includes("]");
1536
- }
1537
- }
1538
- }
1539
-
1540
- // node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/compat/_internal/toKey.mjs
1541
- function toKey(value) {
1542
- if (typeof value === "string" || typeof value === "symbol") {
1543
- return value;
1544
- }
1545
- if (Object.is(value?.valueOf?.(), -0)) {
1546
- return "-0";
1547
- }
1548
- return String(value);
1549
- }
1550
-
1551
- // node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/compat/util/toString.mjs
1552
- function toString(value) {
1553
- if (value == null) {
1554
- return "";
1555
- }
1556
- if (typeof value === "string") {
1557
- return value;
1558
- }
1559
- if (Array.isArray(value)) {
1560
- return value.map(toString).join(",");
1561
- }
1562
- const result = String(value);
1563
- if (result === "0" && Object.is(Number(value), -0)) {
1564
- return "-0";
1565
- }
1566
- return result;
1567
- }
1568
-
1569
- // node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/compat/util/toPath.mjs
1570
- function toPath(deepKey) {
1571
- if (Array.isArray(deepKey)) {
1572
- return deepKey.map(toKey);
1573
- }
1574
- if (typeof deepKey === "symbol") {
1575
- return [deepKey];
1576
- }
1577
- deepKey = toString(deepKey);
1578
- const result = [];
1579
- const length = deepKey.length;
1580
- if (length === 0) {
1581
- return result;
1582
- }
1583
- let index = 0;
1584
- let key = "";
1585
- let quoteChar = "";
1586
- let bracket = false;
1587
- if (deepKey.charCodeAt(0) === 46) {
1588
- result.push("");
1589
- index++;
1590
- }
1591
- while (index < length) {
1592
- const char = deepKey[index];
1593
- if (quoteChar) {
1594
- if (char === "\\" && index + 1 < length) {
1595
- index++;
1596
- key += deepKey[index];
1597
- } else if (char === quoteChar) {
1598
- quoteChar = "";
1599
- } else {
1600
- key += char;
1601
- }
1602
- } else if (bracket) {
1603
- if (char === '"' || char === "'") {
1604
- quoteChar = char;
1605
- } else if (char === "]") {
1606
- bracket = false;
1607
- result.push(key);
1608
- key = "";
1609
- } else {
1610
- key += char;
1611
- }
1612
- } else {
1613
- if (char === "[") {
1614
- bracket = true;
1615
- if (key) {
1616
- result.push(key);
1617
- key = "";
1618
- }
1619
- } else if (char === ".") {
1620
- if (key) {
1621
- result.push(key);
1622
- key = "";
1623
- }
1624
- } else {
1625
- key += char;
1626
- }
1627
- }
1628
- index++;
1629
- }
1630
- if (key) {
1631
- result.push(key);
1632
- }
1633
- return result;
1634
- }
1635
-
1636
- // node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/compat/object/get.mjs
1637
- function get(object, path, defaultValue) {
1638
- if (object == null) {
1639
- return defaultValue;
1640
- }
1641
- switch (typeof path) {
1642
- case "string": {
1643
- if (isUnsafeProperty(path)) {
1644
- return defaultValue;
1645
- }
1646
- const result = object[path];
1647
- if (result === void 0) {
1648
- if (isDeepKey(path)) {
1649
- return get(object, toPath(path), defaultValue);
1650
- } else {
1651
- return defaultValue;
1652
- }
1653
- }
1654
- return result;
1655
- }
1656
- case "number":
1657
- case "symbol": {
1658
- if (typeof path === "number") {
1659
- path = toKey(path);
1660
- }
1661
- const result = object[path];
1662
- if (result === void 0) {
1663
- return defaultValue;
1664
- }
1665
- return result;
1666
- }
1667
- default: {
1668
- if (Array.isArray(path)) {
1669
- return getWithPath(object, path, defaultValue);
1670
- }
1671
- if (Object.is(path?.valueOf(), -0)) {
1672
- path = "-0";
1673
- } else {
1674
- path = String(path);
1675
- }
1676
- if (isUnsafeProperty(path)) {
1677
- return defaultValue;
1678
- }
1679
- const result = object[path];
1680
- if (result === void 0) {
1681
- return defaultValue;
1682
- }
1683
- return result;
1684
- }
1685
- }
1686
- }
1687
- function getWithPath(object, path, defaultValue) {
1688
- if (path.length === 0) {
1689
- return defaultValue;
1690
- }
1691
- let current = object;
1692
- for (let index = 0; index < path.length; index++) {
1693
- if (current == null) {
1694
- return defaultValue;
1695
- }
1696
- if (isUnsafeProperty(path[index])) {
1697
- return defaultValue;
1698
- }
1699
- current = current[path[index]];
1700
- }
1701
- if (current === void 0) {
1702
- return defaultValue;
1703
- }
1704
- return current;
1705
- }
1706
-
1707
- // src/ts/object/index.ts
1708
- var getObjectValue = get;
1709
-
1710
- // src/ts/url/param/index.ts
1711
- function appendUrlParam(url, param) {
1712
- if (!param || typeof param !== "object") return url;
1713
- const hashIndex = url.indexOf("#");
1714
- const baseWithoutHash = hashIndex >= 0 ? url.slice(0, hashIndex) : url;
1715
- const hash = hashIndex >= 0 ? url.slice(hashIndex) : "";
1716
- const [base, existingQs] = baseWithoutHash.split("?");
1717
- const parts = [];
1718
- if (existingQs) parts.push(existingQs);
1719
- for (const key in param) {
1720
- const rawVal = param[key];
1721
- if (rawVal === null || rawVal === void 0) continue;
1722
- const val = typeof rawVal === "object" ? JSON.stringify(rawVal) : String(rawVal);
1723
- parts.push(`${encodeURIComponent(key)}=${encodeURIComponent(val)}`);
1724
- }
1725
- const qs = parts.filter(Boolean).join("&");
1726
- return base + (qs ? `?${qs}` : "") + hash;
1727
- }
1728
-
1729
- // src/web/network/request.ts
1730
- var requestCache = /* @__PURE__ */ new Map();
1731
- function request(config) {
1732
- const controller = new AbortController();
1733
- const signal = controller.signal;
1734
- let chunkCallback = null;
1735
- const task = {
1736
- abort: () => controller.abort(),
1737
- onChunkReceived: (cb) => {
1738
- chunkCallback = cb;
1739
- },
1740
- offChunkReceived: () => {
1741
- chunkCallback = null;
1742
- }
1743
- };
1744
- const promise = new Promise((resolve, reject) => {
1745
- const execute = async () => {
1746
- const {
1747
- url,
1748
- data,
1749
- header,
1750
- method = "GET",
1751
- resKey,
1752
- msgKey,
1753
- codeKey,
1754
- successKey,
1755
- successCode,
1756
- reloginCode,
1757
- showLoading = true,
1758
- toastError = true,
1759
- enableChunked = false,
1760
- cacheTime,
1761
- responseInterceptor,
1762
- responseType = "json",
1763
- timeout = 6e4
1764
- } = config;
1765
- const isGet = method === "GET";
1766
- const isObjectData = isPlainObject(data);
1767
- const isArrayData = !isObjectData && Array.isArray(data);
1768
- const fillData = isObjectData ? pickBy(data, (val) => val !== void 0) : data;
1769
- const fillHeader = header ? pickBy(header, (val) => !!val) : {};
1770
- if (!isGet && fillData && (isObjectData || isArrayData) && !fillHeader["Content-Type"]) {
1771
- fillHeader["Content-Type"] = "application/json";
1772
- }
1773
- const fillUrl = isGet && isObjectData ? appendUrlParam(url, fillData) : url;
1774
- const fillBody = !isGet && fillData ? isObjectData || isArrayData ? JSON.stringify(fillData) : fillData : void 0;
1775
- const logConfig = { ...config, data: fillData, header: fillHeader, url: fillUrl };
1776
- const startTime = Date.now();
1777
- const isCache = cacheTime && cacheTime > 0;
1778
- const cacheKey = isCache ? JSON.stringify({ url: fillUrl, data: fillData }) : "";
1779
- if (isCache) {
1780
- const res = checkCache(cacheKey);
1781
- if (res) {
1782
- logRequestInfo({
1783
- status: "success",
1784
- config: logConfig,
1785
- fromCache: true,
1786
- startTime,
1787
- res
1788
- });
1789
- resolve(getResult(res, resKey));
1790
- return;
1791
- }
1792
- }
1793
- const appConfig2 = getAppConfig();
1794
- if (showLoading) appConfig2.showLoading?.();
1795
- let isTimeout = false;
1796
- const timeoutId = setTimeout(() => {
1797
- isTimeout = true;
1798
- controller.abort();
1799
- }, timeout);
1800
- try {
1801
- const response = await fetch(fillUrl, {
1802
- method,
1803
- headers: fillHeader,
1804
- body: fillBody,
1805
- signal
1806
- });
1807
- if (!response.ok) {
1808
- if (showLoading) appConfig2.hideLoading?.();
1809
- throw new Error(`HTTP Error ${response.status}: ${response.statusText}`);
1810
- }
1811
- if (enableChunked) {
1812
- if (showLoading) appConfig2.hideLoading?.();
1813
- const res2 = await handleStreamResponse(response, chunkCallback);
1814
- logRequestInfo({ status: "success", config: logConfig, startTime, res: res2 });
1815
- resolve(res2);
1816
- return;
1817
- }
1818
- const resData = await parseResponse(response, responseType);
1819
- if (showLoading) appConfig2.hideLoading?.();
1820
- const res = responseInterceptor ? responseInterceptor(resData) : resData;
1821
- const code = getObjectValue(res, codeKey);
1822
- const scode = successKey ? getObjectValue(res, successKey) : code;
1823
- const msg = getObjectValue(res, msgKey);
1824
- const isSuccess = successCode.includes(scode);
1825
- const isRelogin = reloginCode.includes(code);
1826
- logRequestInfo({ status: "success", config: logConfig, startTime, res });
1827
- if (isSuccess) {
1828
- if (isCache) requestCache.set(cacheKey, { res, expire: Date.now() + cacheTime });
1829
- resolve(getResult(res, resKey));
1830
- } else if (isRelogin) {
1831
- reject(res);
1832
- appConfig2.toLogin?.();
1833
- } else {
1834
- if (toastError && msg) appConfig2.toast?.({ status: "fail", msg });
1835
- reject(res);
1836
- }
1837
- } catch (e) {
1838
- const status = "fail";
1839
- const isAbortError = e instanceof DOMException && e.name === "AbortError";
1840
- if (isAbortError && isTimeout) {
1841
- if (toastError) appConfig2.toast?.({ status, msg: "\u8BF7\u6C42\u8D85\u65F6" });
1842
- const timeoutError = new Error("Request Timeout");
1843
- logRequestInfo({ status, config: logConfig, startTime, e: timeoutError });
1844
- reject(timeoutError);
1845
- return;
1846
- }
1847
- if (!isAbortError && toastError) appConfig2.toast?.({ status, msg: "\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25" });
1848
- logRequestInfo({ status, config: logConfig, startTime, e });
1849
- reject(e);
1850
- } finally {
1851
- if (timeoutId) clearTimeout(timeoutId);
1852
- }
1853
- };
1854
- execute();
1855
- });
1856
- promise.task = task;
1857
- return promise;
1858
- }
1859
- function logRequestInfo(options) {
1860
- const { log } = getAppConfig();
1861
- const { isLog = true } = options.config;
1862
- if (!log || !isLog) return;
1863
- const { config, res, fromCache = false, startTime, status, e } = options;
1864
- const { url, data, header, method, extraLog } = config;
1865
- const endTime = Date.now();
1866
- const fmt = "YYYY-MM-DD HH:mm:ss.SSS";
1867
- const info = {
1868
- name: "request",
1869
- status,
1870
- url,
1871
- data,
1872
- method,
1873
- header,
1874
- fromCache,
1875
- startTime: toDayjs(startTime).format(fmt),
1876
- endTime: toDayjs(endTime).format(fmt),
1877
- duration: endTime - startTime,
1878
- ...extraLog
1879
- };
1880
- if (status === "success") {
1881
- info.res = cloneDeep(res);
1882
- log("info", info);
1883
- } else {
1884
- info.e = e;
1885
- log("error", info);
1886
- }
1887
- }
1888
- function getResult(res, resKey) {
1889
- if (!res || !resKey || typeof res !== "object") return res;
1890
- return getObjectValue(res, resKey);
1891
- }
1892
- function checkCache(cacheKey) {
1893
- const cached = requestCache.get(cacheKey);
1894
- if (!cached) return null;
1895
- if (cached.expire <= Date.now()) {
1896
- requestCache.delete(cacheKey);
1897
- return null;
1898
- }
1899
- return cached.res;
1900
- }
1901
- async function handleStreamResponse(response, chunkCallback) {
1902
- if (!response.body) throw new Error("Response body is null");
1903
- const reader = response.body.getReader();
1904
- while (true) {
1905
- const { done, value } = await reader.read();
1906
- if (done) break;
1907
- if (chunkCallback && value) {
1908
- chunkCallback({ data: value.buffer });
1909
- }
1910
- }
1911
- return "Stream Finished";
1912
- }
1913
- async function parseResponse(response, responseType) {
1914
- let resData;
1915
- if (responseType === "arraybuffer") {
1916
- resData = await response.arrayBuffer();
1917
- } else if (responseType === "text") {
1918
- resData = await response.text();
1919
- } else {
1920
- const text = await response.text();
1921
- try {
1922
- resData = JSON.parse(text);
1923
- } catch {
1924
- resData = text;
1925
- }
1926
- }
1927
- return resData;
1928
- }
1929
-
1930
546
  // src/web/storage/index.ts
1931
547
  var WK = {
1932
548
  val: "__l_val",