@kong-ui-public/core 1.11.3-pr.2363.57c84ee0b.0 → 1.11.4-pr.2439.ad3fb9fba.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/dist/core.es.js +0 -1445
- package/dist/core.umd.js +0 -1
- package/dist/types/constants.d.ts +0 -5
- package/dist/types/constants.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -11
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/useAxios/index.d.ts +0 -6
- package/dist/types/useAxios/index.d.ts.map +0 -1
- package/dist/types/useDate/index.d.ts +0 -5
- package/dist/types/useDate/index.d.ts.map +0 -1
- package/dist/types/useDebounce/index.d.ts +0 -4
- package/dist/types/useDebounce/index.d.ts.map +0 -1
- package/dist/types/usePackage/index.d.ts +0 -8
- package/dist/types/usePackage/index.d.ts.map +0 -1
- package/dist/types/usePackage/types/index.d.ts +0 -24
- package/dist/types/usePackage/types/index.d.ts.map +0 -1
- package/dist/types/useSwrvState/index.d.ts +0 -16
- package/dist/types/useSwrvState/index.d.ts.map +0 -1
- package/dist/types/useTablePreferences/index.d.ts +0 -7
- package/dist/types/useTablePreferences/index.d.ts.map +0 -1
- package/dist/types/useWindow/index.d.ts +0 -3
- package/dist/types/useWindow/index.d.ts.map +0 -1
- package/dist/types/useWindow/types/index.d.ts +0 -11
- package/dist/types/useWindow/types/index.d.ts.map +0 -1
package/dist/core.es.js
DELETED
|
@@ -1,1445 +0,0 @@
|
|
|
1
|
-
import C from "axios";
|
|
2
|
-
import { inject as B, ref as T, readonly as Y, computed as V, nextTick as F, watchEffect as U } from "vue";
|
|
3
|
-
function ot() {
|
|
4
|
-
return {
|
|
5
|
-
getAxiosInstance: (n = {}) => {
|
|
6
|
-
try {
|
|
7
|
-
const r = B("get-axios-instance", void 0);
|
|
8
|
-
return typeof r == "function" ? r(n) : C.create({
|
|
9
|
-
withCredentials: !0,
|
|
10
|
-
timeout: 3e4,
|
|
11
|
-
...n
|
|
12
|
-
});
|
|
13
|
-
} catch (r) {
|
|
14
|
-
return console.warn("getAxiosInstance:", r.message || r), C.create({
|
|
15
|
-
withCredentials: !0,
|
|
16
|
-
timeout: 3e4,
|
|
17
|
-
...n
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
getTraceIdFromError: (n) => {
|
|
22
|
-
var r;
|
|
23
|
-
return ((r = n == null ? void 0 : n.response) == null ? void 0 : r.headers["x-datadog-trace-id"]) || "";
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
const p = 6048e5, J = 864e5, L = Symbol.for("constructDateFrom");
|
|
28
|
-
function P(t, e) {
|
|
29
|
-
return typeof t == "function" ? t(e) : t && typeof t == "object" && L in t ? t[L](e) : t instanceof Date ? new t.constructor(e) : new Date(e);
|
|
30
|
-
}
|
|
31
|
-
function b(t, e) {
|
|
32
|
-
return P(e || t, t);
|
|
33
|
-
}
|
|
34
|
-
let $ = {};
|
|
35
|
-
function x() {
|
|
36
|
-
return $;
|
|
37
|
-
}
|
|
38
|
-
function M(t, e) {
|
|
39
|
-
var u, o, d, f;
|
|
40
|
-
const n = x(), r = (e == null ? void 0 : e.weekStartsOn) ?? ((o = (u = e == null ? void 0 : e.locale) == null ? void 0 : u.options) == null ? void 0 : o.weekStartsOn) ?? n.weekStartsOn ?? ((f = (d = n.locale) == null ? void 0 : d.options) == null ? void 0 : f.weekStartsOn) ?? 0, a = b(t, e == null ? void 0 : e.in), i = a.getDay(), c = (i < r ? 7 : 0) + i - r;
|
|
41
|
-
return a.setDate(a.getDate() - c), a.setHours(0, 0, 0, 0), a;
|
|
42
|
-
}
|
|
43
|
-
function k(t, e) {
|
|
44
|
-
return M(t, { ...e, weekStartsOn: 1 });
|
|
45
|
-
}
|
|
46
|
-
function G(t, e) {
|
|
47
|
-
const n = b(t, e == null ? void 0 : e.in), r = n.getFullYear(), a = P(n, 0);
|
|
48
|
-
a.setFullYear(r + 1, 0, 4), a.setHours(0, 0, 0, 0);
|
|
49
|
-
const i = k(a), c = P(n, 0);
|
|
50
|
-
c.setFullYear(r, 0, 4), c.setHours(0, 0, 0, 0);
|
|
51
|
-
const u = k(c);
|
|
52
|
-
return n.getTime() >= i.getTime() ? r + 1 : n.getTime() >= u.getTime() ? r : r - 1;
|
|
53
|
-
}
|
|
54
|
-
function N(t) {
|
|
55
|
-
const e = b(t), n = new Date(
|
|
56
|
-
Date.UTC(
|
|
57
|
-
e.getFullYear(),
|
|
58
|
-
e.getMonth(),
|
|
59
|
-
e.getDate(),
|
|
60
|
-
e.getHours(),
|
|
61
|
-
e.getMinutes(),
|
|
62
|
-
e.getSeconds(),
|
|
63
|
-
e.getMilliseconds()
|
|
64
|
-
)
|
|
65
|
-
);
|
|
66
|
-
return n.setUTCFullYear(e.getFullYear()), +t - +n;
|
|
67
|
-
}
|
|
68
|
-
function z(t, ...e) {
|
|
69
|
-
const n = P.bind(
|
|
70
|
-
null,
|
|
71
|
-
e.find((r) => typeof r == "object")
|
|
72
|
-
);
|
|
73
|
-
return e.map(n);
|
|
74
|
-
}
|
|
75
|
-
function _(t, e) {
|
|
76
|
-
const n = b(t, e == null ? void 0 : e.in);
|
|
77
|
-
return n.setHours(0, 0, 0, 0), n;
|
|
78
|
-
}
|
|
79
|
-
function K(t, e, n) {
|
|
80
|
-
const [r, a] = z(
|
|
81
|
-
n == null ? void 0 : n.in,
|
|
82
|
-
t,
|
|
83
|
-
e
|
|
84
|
-
), i = _(r), c = _(a), u = +i - N(i), o = +c - N(c);
|
|
85
|
-
return Math.round((u - o) / J);
|
|
86
|
-
}
|
|
87
|
-
function Z(t, e) {
|
|
88
|
-
const n = G(t, e), r = P(t, 0);
|
|
89
|
-
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), k(r);
|
|
90
|
-
}
|
|
91
|
-
function ee(t) {
|
|
92
|
-
return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
|
|
93
|
-
}
|
|
94
|
-
function te(t) {
|
|
95
|
-
return !(!ee(t) && typeof t != "number" || isNaN(+b(t)));
|
|
96
|
-
}
|
|
97
|
-
function ne(t, e) {
|
|
98
|
-
const n = b(t, e == null ? void 0 : e.in);
|
|
99
|
-
return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
100
|
-
}
|
|
101
|
-
const re = {
|
|
102
|
-
lessThanXSeconds: {
|
|
103
|
-
one: "less than a second",
|
|
104
|
-
other: "less than {{count}} seconds"
|
|
105
|
-
},
|
|
106
|
-
xSeconds: {
|
|
107
|
-
one: "1 second",
|
|
108
|
-
other: "{{count}} seconds"
|
|
109
|
-
},
|
|
110
|
-
halfAMinute: "half a minute",
|
|
111
|
-
lessThanXMinutes: {
|
|
112
|
-
one: "less than a minute",
|
|
113
|
-
other: "less than {{count}} minutes"
|
|
114
|
-
},
|
|
115
|
-
xMinutes: {
|
|
116
|
-
one: "1 minute",
|
|
117
|
-
other: "{{count}} minutes"
|
|
118
|
-
},
|
|
119
|
-
aboutXHours: {
|
|
120
|
-
one: "about 1 hour",
|
|
121
|
-
other: "about {{count}} hours"
|
|
122
|
-
},
|
|
123
|
-
xHours: {
|
|
124
|
-
one: "1 hour",
|
|
125
|
-
other: "{{count}} hours"
|
|
126
|
-
},
|
|
127
|
-
xDays: {
|
|
128
|
-
one: "1 day",
|
|
129
|
-
other: "{{count}} days"
|
|
130
|
-
},
|
|
131
|
-
aboutXWeeks: {
|
|
132
|
-
one: "about 1 week",
|
|
133
|
-
other: "about {{count}} weeks"
|
|
134
|
-
},
|
|
135
|
-
xWeeks: {
|
|
136
|
-
one: "1 week",
|
|
137
|
-
other: "{{count}} weeks"
|
|
138
|
-
},
|
|
139
|
-
aboutXMonths: {
|
|
140
|
-
one: "about 1 month",
|
|
141
|
-
other: "about {{count}} months"
|
|
142
|
-
},
|
|
143
|
-
xMonths: {
|
|
144
|
-
one: "1 month",
|
|
145
|
-
other: "{{count}} months"
|
|
146
|
-
},
|
|
147
|
-
aboutXYears: {
|
|
148
|
-
one: "about 1 year",
|
|
149
|
-
other: "about {{count}} years"
|
|
150
|
-
},
|
|
151
|
-
xYears: {
|
|
152
|
-
one: "1 year",
|
|
153
|
-
other: "{{count}} years"
|
|
154
|
-
},
|
|
155
|
-
overXYears: {
|
|
156
|
-
one: "over 1 year",
|
|
157
|
-
other: "over {{count}} years"
|
|
158
|
-
},
|
|
159
|
-
almostXYears: {
|
|
160
|
-
one: "almost 1 year",
|
|
161
|
-
other: "almost {{count}} years"
|
|
162
|
-
}
|
|
163
|
-
}, ae = (t, e, n) => {
|
|
164
|
-
let r;
|
|
165
|
-
const a = re[t];
|
|
166
|
-
return typeof a == "string" ? r = a : e === 1 ? r = a.one : r = a.other.replace("{{count}}", e.toString()), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
|
|
167
|
-
};
|
|
168
|
-
function W(t) {
|
|
169
|
-
return (e = {}) => {
|
|
170
|
-
const n = e.width ? String(e.width) : t.defaultWidth;
|
|
171
|
-
return t.formats[n] || t.formats[t.defaultWidth];
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
const ie = {
|
|
175
|
-
full: "EEEE, MMMM do, y",
|
|
176
|
-
long: "MMMM do, y",
|
|
177
|
-
medium: "MMM d, y",
|
|
178
|
-
short: "MM/dd/yyyy"
|
|
179
|
-
}, oe = {
|
|
180
|
-
full: "h:mm:ss a zzzz",
|
|
181
|
-
long: "h:mm:ss a z",
|
|
182
|
-
medium: "h:mm:ss a",
|
|
183
|
-
short: "h:mm a"
|
|
184
|
-
}, ce = {
|
|
185
|
-
full: "{{date}} 'at' {{time}}",
|
|
186
|
-
long: "{{date}} 'at' {{time}}",
|
|
187
|
-
medium: "{{date}}, {{time}}",
|
|
188
|
-
short: "{{date}}, {{time}}"
|
|
189
|
-
}, ue = {
|
|
190
|
-
date: W({
|
|
191
|
-
formats: ie,
|
|
192
|
-
defaultWidth: "full"
|
|
193
|
-
}),
|
|
194
|
-
time: W({
|
|
195
|
-
formats: oe,
|
|
196
|
-
defaultWidth: "full"
|
|
197
|
-
}),
|
|
198
|
-
dateTime: W({
|
|
199
|
-
formats: ce,
|
|
200
|
-
defaultWidth: "full"
|
|
201
|
-
})
|
|
202
|
-
}, se = {
|
|
203
|
-
lastWeek: "'last' eeee 'at' p",
|
|
204
|
-
yesterday: "'yesterday at' p",
|
|
205
|
-
today: "'today at' p",
|
|
206
|
-
tomorrow: "'tomorrow at' p",
|
|
207
|
-
nextWeek: "eeee 'at' p",
|
|
208
|
-
other: "P"
|
|
209
|
-
}, de = (t, e, n, r) => se[t];
|
|
210
|
-
function O(t) {
|
|
211
|
-
return (e, n) => {
|
|
212
|
-
const r = n != null && n.context ? String(n.context) : "standalone";
|
|
213
|
-
let a;
|
|
214
|
-
if (r === "formatting" && t.formattingValues) {
|
|
215
|
-
const c = t.defaultFormattingWidth || t.defaultWidth, u = n != null && n.width ? String(n.width) : c;
|
|
216
|
-
a = t.formattingValues[u] || t.formattingValues[c];
|
|
217
|
-
} else {
|
|
218
|
-
const c = t.defaultWidth, u = n != null && n.width ? String(n.width) : t.defaultWidth;
|
|
219
|
-
a = t.values[u] || t.values[c];
|
|
220
|
-
}
|
|
221
|
-
const i = t.argumentCallback ? t.argumentCallback(e) : e;
|
|
222
|
-
return a[i];
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
const fe = {
|
|
226
|
-
narrow: ["B", "A"],
|
|
227
|
-
abbreviated: ["BC", "AD"],
|
|
228
|
-
wide: ["Before Christ", "Anno Domini"]
|
|
229
|
-
}, le = {
|
|
230
|
-
narrow: ["1", "2", "3", "4"],
|
|
231
|
-
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
232
|
-
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
233
|
-
}, he = {
|
|
234
|
-
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
235
|
-
abbreviated: [
|
|
236
|
-
"Jan",
|
|
237
|
-
"Feb",
|
|
238
|
-
"Mar",
|
|
239
|
-
"Apr",
|
|
240
|
-
"May",
|
|
241
|
-
"Jun",
|
|
242
|
-
"Jul",
|
|
243
|
-
"Aug",
|
|
244
|
-
"Sep",
|
|
245
|
-
"Oct",
|
|
246
|
-
"Nov",
|
|
247
|
-
"Dec"
|
|
248
|
-
],
|
|
249
|
-
wide: [
|
|
250
|
-
"January",
|
|
251
|
-
"February",
|
|
252
|
-
"March",
|
|
253
|
-
"April",
|
|
254
|
-
"May",
|
|
255
|
-
"June",
|
|
256
|
-
"July",
|
|
257
|
-
"August",
|
|
258
|
-
"September",
|
|
259
|
-
"October",
|
|
260
|
-
"November",
|
|
261
|
-
"December"
|
|
262
|
-
]
|
|
263
|
-
}, me = {
|
|
264
|
-
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
265
|
-
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
266
|
-
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
267
|
-
wide: [
|
|
268
|
-
"Sunday",
|
|
269
|
-
"Monday",
|
|
270
|
-
"Tuesday",
|
|
271
|
-
"Wednesday",
|
|
272
|
-
"Thursday",
|
|
273
|
-
"Friday",
|
|
274
|
-
"Saturday"
|
|
275
|
-
]
|
|
276
|
-
}, ge = {
|
|
277
|
-
narrow: {
|
|
278
|
-
am: "a",
|
|
279
|
-
pm: "p",
|
|
280
|
-
midnight: "mi",
|
|
281
|
-
noon: "n",
|
|
282
|
-
morning: "morning",
|
|
283
|
-
afternoon: "afternoon",
|
|
284
|
-
evening: "evening",
|
|
285
|
-
night: "night"
|
|
286
|
-
},
|
|
287
|
-
abbreviated: {
|
|
288
|
-
am: "AM",
|
|
289
|
-
pm: "PM",
|
|
290
|
-
midnight: "midnight",
|
|
291
|
-
noon: "noon",
|
|
292
|
-
morning: "morning",
|
|
293
|
-
afternoon: "afternoon",
|
|
294
|
-
evening: "evening",
|
|
295
|
-
night: "night"
|
|
296
|
-
},
|
|
297
|
-
wide: {
|
|
298
|
-
am: "a.m.",
|
|
299
|
-
pm: "p.m.",
|
|
300
|
-
midnight: "midnight",
|
|
301
|
-
noon: "noon",
|
|
302
|
-
morning: "morning",
|
|
303
|
-
afternoon: "afternoon",
|
|
304
|
-
evening: "evening",
|
|
305
|
-
night: "night"
|
|
306
|
-
}
|
|
307
|
-
}, we = {
|
|
308
|
-
narrow: {
|
|
309
|
-
am: "a",
|
|
310
|
-
pm: "p",
|
|
311
|
-
midnight: "mi",
|
|
312
|
-
noon: "n",
|
|
313
|
-
morning: "in the morning",
|
|
314
|
-
afternoon: "in the afternoon",
|
|
315
|
-
evening: "in the evening",
|
|
316
|
-
night: "at night"
|
|
317
|
-
},
|
|
318
|
-
abbreviated: {
|
|
319
|
-
am: "AM",
|
|
320
|
-
pm: "PM",
|
|
321
|
-
midnight: "midnight",
|
|
322
|
-
noon: "noon",
|
|
323
|
-
morning: "in the morning",
|
|
324
|
-
afternoon: "in the afternoon",
|
|
325
|
-
evening: "in the evening",
|
|
326
|
-
night: "at night"
|
|
327
|
-
},
|
|
328
|
-
wide: {
|
|
329
|
-
am: "a.m.",
|
|
330
|
-
pm: "p.m.",
|
|
331
|
-
midnight: "midnight",
|
|
332
|
-
noon: "noon",
|
|
333
|
-
morning: "in the morning",
|
|
334
|
-
afternoon: "in the afternoon",
|
|
335
|
-
evening: "in the evening",
|
|
336
|
-
night: "at night"
|
|
337
|
-
}
|
|
338
|
-
}, be = (t, e) => {
|
|
339
|
-
const n = Number(t), r = n % 100;
|
|
340
|
-
if (r > 20 || r < 10)
|
|
341
|
-
switch (r % 10) {
|
|
342
|
-
case 1:
|
|
343
|
-
return n + "st";
|
|
344
|
-
case 2:
|
|
345
|
-
return n + "nd";
|
|
346
|
-
case 3:
|
|
347
|
-
return n + "rd";
|
|
348
|
-
}
|
|
349
|
-
return n + "th";
|
|
350
|
-
}, ye = {
|
|
351
|
-
ordinalNumber: be,
|
|
352
|
-
era: O({
|
|
353
|
-
values: fe,
|
|
354
|
-
defaultWidth: "wide"
|
|
355
|
-
}),
|
|
356
|
-
quarter: O({
|
|
357
|
-
values: le,
|
|
358
|
-
defaultWidth: "wide",
|
|
359
|
-
argumentCallback: (t) => t - 1
|
|
360
|
-
}),
|
|
361
|
-
month: O({
|
|
362
|
-
values: he,
|
|
363
|
-
defaultWidth: "wide"
|
|
364
|
-
}),
|
|
365
|
-
day: O({
|
|
366
|
-
values: me,
|
|
367
|
-
defaultWidth: "wide"
|
|
368
|
-
}),
|
|
369
|
-
dayPeriod: O({
|
|
370
|
-
values: ge,
|
|
371
|
-
defaultWidth: "wide",
|
|
372
|
-
formattingValues: we,
|
|
373
|
-
defaultFormattingWidth: "wide"
|
|
374
|
-
})
|
|
375
|
-
};
|
|
376
|
-
function D(t) {
|
|
377
|
-
return (e, n = {}) => {
|
|
378
|
-
const r = n.width, a = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], i = e.match(a);
|
|
379
|
-
if (!i)
|
|
380
|
-
return null;
|
|
381
|
-
const c = i[0], u = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], o = Array.isArray(u) ? ve(u, (g) => g.test(c)) : (
|
|
382
|
-
// [TODO] -- I challenge you to fix the type
|
|
383
|
-
Pe(u, (g) => g.test(c))
|
|
384
|
-
);
|
|
385
|
-
let d;
|
|
386
|
-
d = t.valueCallback ? t.valueCallback(o) : o, d = n.valueCallback ? (
|
|
387
|
-
// [TODO] -- I challenge you to fix the type
|
|
388
|
-
n.valueCallback(d)
|
|
389
|
-
) : d;
|
|
390
|
-
const f = e.slice(c.length);
|
|
391
|
-
return { value: d, rest: f };
|
|
392
|
-
};
|
|
393
|
-
}
|
|
394
|
-
function Pe(t, e) {
|
|
395
|
-
for (const n in t)
|
|
396
|
-
if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
|
|
397
|
-
return n;
|
|
398
|
-
}
|
|
399
|
-
function ve(t, e) {
|
|
400
|
-
for (let n = 0; n < t.length; n++)
|
|
401
|
-
if (e(t[n]))
|
|
402
|
-
return n;
|
|
403
|
-
}
|
|
404
|
-
function Se(t) {
|
|
405
|
-
return (e, n = {}) => {
|
|
406
|
-
const r = e.match(t.matchPattern);
|
|
407
|
-
if (!r) return null;
|
|
408
|
-
const a = r[0], i = e.match(t.parsePattern);
|
|
409
|
-
if (!i) return null;
|
|
410
|
-
let c = t.valueCallback ? t.valueCallback(i[0]) : i[0];
|
|
411
|
-
c = n.valueCallback ? n.valueCallback(c) : c;
|
|
412
|
-
const u = e.slice(a.length);
|
|
413
|
-
return { value: c, rest: u };
|
|
414
|
-
};
|
|
415
|
-
}
|
|
416
|
-
const Oe = /^(\d+)(th|st|nd|rd)?/i, De = /\d+/i, Me = {
|
|
417
|
-
narrow: /^(b|a)/i,
|
|
418
|
-
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
419
|
-
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
420
|
-
}, Te = {
|
|
421
|
-
any: [/^b/i, /^(a|c)/i]
|
|
422
|
-
}, ke = {
|
|
423
|
-
narrow: /^[1234]/i,
|
|
424
|
-
abbreviated: /^q[1234]/i,
|
|
425
|
-
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
426
|
-
}, xe = {
|
|
427
|
-
any: [/1/i, /2/i, /3/i, /4/i]
|
|
428
|
-
}, Ee = {
|
|
429
|
-
narrow: /^[jfmasond]/i,
|
|
430
|
-
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
431
|
-
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
432
|
-
}, We = {
|
|
433
|
-
narrow: [
|
|
434
|
-
/^j/i,
|
|
435
|
-
/^f/i,
|
|
436
|
-
/^m/i,
|
|
437
|
-
/^a/i,
|
|
438
|
-
/^m/i,
|
|
439
|
-
/^j/i,
|
|
440
|
-
/^j/i,
|
|
441
|
-
/^a/i,
|
|
442
|
-
/^s/i,
|
|
443
|
-
/^o/i,
|
|
444
|
-
/^n/i,
|
|
445
|
-
/^d/i
|
|
446
|
-
],
|
|
447
|
-
any: [
|
|
448
|
-
/^ja/i,
|
|
449
|
-
/^f/i,
|
|
450
|
-
/^mar/i,
|
|
451
|
-
/^ap/i,
|
|
452
|
-
/^may/i,
|
|
453
|
-
/^jun/i,
|
|
454
|
-
/^jul/i,
|
|
455
|
-
/^au/i,
|
|
456
|
-
/^s/i,
|
|
457
|
-
/^o/i,
|
|
458
|
-
/^n/i,
|
|
459
|
-
/^d/i
|
|
460
|
-
]
|
|
461
|
-
}, Ae = {
|
|
462
|
-
narrow: /^[smtwf]/i,
|
|
463
|
-
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
464
|
-
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
465
|
-
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
466
|
-
}, Ce = {
|
|
467
|
-
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
468
|
-
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
469
|
-
}, Ye = {
|
|
470
|
-
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
471
|
-
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
472
|
-
}, Fe = {
|
|
473
|
-
any: {
|
|
474
|
-
am: /^a/i,
|
|
475
|
-
pm: /^p/i,
|
|
476
|
-
midnight: /^mi/i,
|
|
477
|
-
noon: /^no/i,
|
|
478
|
-
morning: /morning/i,
|
|
479
|
-
afternoon: /afternoon/i,
|
|
480
|
-
evening: /evening/i,
|
|
481
|
-
night: /night/i
|
|
482
|
-
}
|
|
483
|
-
}, Le = {
|
|
484
|
-
ordinalNumber: Se({
|
|
485
|
-
matchPattern: Oe,
|
|
486
|
-
parsePattern: De,
|
|
487
|
-
valueCallback: (t) => parseInt(t, 10)
|
|
488
|
-
}),
|
|
489
|
-
era: D({
|
|
490
|
-
matchPatterns: Me,
|
|
491
|
-
defaultMatchWidth: "wide",
|
|
492
|
-
parsePatterns: Te,
|
|
493
|
-
defaultParseWidth: "any"
|
|
494
|
-
}),
|
|
495
|
-
quarter: D({
|
|
496
|
-
matchPatterns: ke,
|
|
497
|
-
defaultMatchWidth: "wide",
|
|
498
|
-
parsePatterns: xe,
|
|
499
|
-
defaultParseWidth: "any",
|
|
500
|
-
valueCallback: (t) => t + 1
|
|
501
|
-
}),
|
|
502
|
-
month: D({
|
|
503
|
-
matchPatterns: Ee,
|
|
504
|
-
defaultMatchWidth: "wide",
|
|
505
|
-
parsePatterns: We,
|
|
506
|
-
defaultParseWidth: "any"
|
|
507
|
-
}),
|
|
508
|
-
day: D({
|
|
509
|
-
matchPatterns: Ae,
|
|
510
|
-
defaultMatchWidth: "wide",
|
|
511
|
-
parsePatterns: Ce,
|
|
512
|
-
defaultParseWidth: "any"
|
|
513
|
-
}),
|
|
514
|
-
dayPeriod: D({
|
|
515
|
-
matchPatterns: Ye,
|
|
516
|
-
defaultMatchWidth: "any",
|
|
517
|
-
parsePatterns: Fe,
|
|
518
|
-
defaultParseWidth: "any"
|
|
519
|
-
})
|
|
520
|
-
}, Ne = {
|
|
521
|
-
code: "en-US",
|
|
522
|
-
formatDistance: ae,
|
|
523
|
-
formatLong: ue,
|
|
524
|
-
formatRelative: de,
|
|
525
|
-
localize: ye,
|
|
526
|
-
match: Le,
|
|
527
|
-
options: {
|
|
528
|
-
weekStartsOn: 0,
|
|
529
|
-
firstWeekContainsDate: 1
|
|
530
|
-
}
|
|
531
|
-
};
|
|
532
|
-
function _e(t, e) {
|
|
533
|
-
const n = b(t, e == null ? void 0 : e.in);
|
|
534
|
-
return K(n, ne(n)) + 1;
|
|
535
|
-
}
|
|
536
|
-
function Re(t, e) {
|
|
537
|
-
const n = b(t, e == null ? void 0 : e.in), r = +k(n) - +Z(n);
|
|
538
|
-
return Math.round(r / p) + 1;
|
|
539
|
-
}
|
|
540
|
-
function j(t, e) {
|
|
541
|
-
var f, g, h, w;
|
|
542
|
-
const n = b(t, e == null ? void 0 : e.in), r = n.getFullYear(), a = x(), i = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((g = (f = e == null ? void 0 : e.locale) == null ? void 0 : f.options) == null ? void 0 : g.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((w = (h = a.locale) == null ? void 0 : h.options) == null ? void 0 : w.firstWeekContainsDate) ?? 1, c = P((e == null ? void 0 : e.in) || t, 0);
|
|
543
|
-
c.setFullYear(r + 1, 0, i), c.setHours(0, 0, 0, 0);
|
|
544
|
-
const u = M(c, e), o = P((e == null ? void 0 : e.in) || t, 0);
|
|
545
|
-
o.setFullYear(r, 0, i), o.setHours(0, 0, 0, 0);
|
|
546
|
-
const d = M(o, e);
|
|
547
|
-
return +n >= +u ? r + 1 : +n >= +d ? r : r - 1;
|
|
548
|
-
}
|
|
549
|
-
function Ie(t, e) {
|
|
550
|
-
var u, o, d, f;
|
|
551
|
-
const n = x(), r = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((o = (u = e == null ? void 0 : e.locale) == null ? void 0 : u.options) == null ? void 0 : o.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((f = (d = n.locale) == null ? void 0 : d.options) == null ? void 0 : f.firstWeekContainsDate) ?? 1, a = j(t, e), i = P((e == null ? void 0 : e.in) || t, 0);
|
|
552
|
-
return i.setFullYear(a, 0, r), i.setHours(0, 0, 0, 0), M(i, e);
|
|
553
|
-
}
|
|
554
|
-
function He(t, e) {
|
|
555
|
-
const n = b(t, e == null ? void 0 : e.in), r = +M(n, e) - +Ie(n, e);
|
|
556
|
-
return Math.round(r / p) + 1;
|
|
557
|
-
}
|
|
558
|
-
function s(t, e) {
|
|
559
|
-
const n = t < 0 ? "-" : "", r = Math.abs(t).toString().padStart(e, "0");
|
|
560
|
-
return n + r;
|
|
561
|
-
}
|
|
562
|
-
const y = {
|
|
563
|
-
// Year
|
|
564
|
-
y(t, e) {
|
|
565
|
-
const n = t.getFullYear(), r = n > 0 ? n : 1 - n;
|
|
566
|
-
return s(e === "yy" ? r % 100 : r, e.length);
|
|
567
|
-
},
|
|
568
|
-
// Month
|
|
569
|
-
M(t, e) {
|
|
570
|
-
const n = t.getMonth();
|
|
571
|
-
return e === "M" ? String(n + 1) : s(n + 1, 2);
|
|
572
|
-
},
|
|
573
|
-
// Day of the month
|
|
574
|
-
d(t, e) {
|
|
575
|
-
return s(t.getDate(), e.length);
|
|
576
|
-
},
|
|
577
|
-
// AM or PM
|
|
578
|
-
a(t, e) {
|
|
579
|
-
const n = t.getHours() / 12 >= 1 ? "pm" : "am";
|
|
580
|
-
switch (e) {
|
|
581
|
-
case "a":
|
|
582
|
-
case "aa":
|
|
583
|
-
return n.toUpperCase();
|
|
584
|
-
case "aaa":
|
|
585
|
-
return n;
|
|
586
|
-
case "aaaaa":
|
|
587
|
-
return n[0];
|
|
588
|
-
case "aaaa":
|
|
589
|
-
default:
|
|
590
|
-
return n === "am" ? "a.m." : "p.m.";
|
|
591
|
-
}
|
|
592
|
-
},
|
|
593
|
-
// Hour [1-12]
|
|
594
|
-
h(t, e) {
|
|
595
|
-
return s(t.getHours() % 12 || 12, e.length);
|
|
596
|
-
},
|
|
597
|
-
// Hour [0-23]
|
|
598
|
-
H(t, e) {
|
|
599
|
-
return s(t.getHours(), e.length);
|
|
600
|
-
},
|
|
601
|
-
// Minute
|
|
602
|
-
m(t, e) {
|
|
603
|
-
return s(t.getMinutes(), e.length);
|
|
604
|
-
},
|
|
605
|
-
// Second
|
|
606
|
-
s(t, e) {
|
|
607
|
-
return s(t.getSeconds(), e.length);
|
|
608
|
-
},
|
|
609
|
-
// Fraction of second
|
|
610
|
-
S(t, e) {
|
|
611
|
-
const n = e.length, r = t.getMilliseconds(), a = Math.trunc(
|
|
612
|
-
r * Math.pow(10, n - 3)
|
|
613
|
-
);
|
|
614
|
-
return s(a, e.length);
|
|
615
|
-
}
|
|
616
|
-
}, S = {
|
|
617
|
-
midnight: "midnight",
|
|
618
|
-
noon: "noon",
|
|
619
|
-
morning: "morning",
|
|
620
|
-
afternoon: "afternoon",
|
|
621
|
-
evening: "evening",
|
|
622
|
-
night: "night"
|
|
623
|
-
}, R = {
|
|
624
|
-
// Era
|
|
625
|
-
G: function(t, e, n) {
|
|
626
|
-
const r = t.getFullYear() > 0 ? 1 : 0;
|
|
627
|
-
switch (e) {
|
|
628
|
-
case "G":
|
|
629
|
-
case "GG":
|
|
630
|
-
case "GGG":
|
|
631
|
-
return n.era(r, { width: "abbreviated" });
|
|
632
|
-
case "GGGGG":
|
|
633
|
-
return n.era(r, { width: "narrow" });
|
|
634
|
-
case "GGGG":
|
|
635
|
-
default:
|
|
636
|
-
return n.era(r, { width: "wide" });
|
|
637
|
-
}
|
|
638
|
-
},
|
|
639
|
-
// Year
|
|
640
|
-
y: function(t, e, n) {
|
|
641
|
-
if (e === "yo") {
|
|
642
|
-
const r = t.getFullYear(), a = r > 0 ? r : 1 - r;
|
|
643
|
-
return n.ordinalNumber(a, { unit: "year" });
|
|
644
|
-
}
|
|
645
|
-
return y.y(t, e);
|
|
646
|
-
},
|
|
647
|
-
// Local week-numbering year
|
|
648
|
-
Y: function(t, e, n, r) {
|
|
649
|
-
const a = j(t, r), i = a > 0 ? a : 1 - a;
|
|
650
|
-
if (e === "YY") {
|
|
651
|
-
const c = i % 100;
|
|
652
|
-
return s(c, 2);
|
|
653
|
-
}
|
|
654
|
-
return e === "Yo" ? n.ordinalNumber(i, { unit: "year" }) : s(i, e.length);
|
|
655
|
-
},
|
|
656
|
-
// ISO week-numbering year
|
|
657
|
-
R: function(t, e) {
|
|
658
|
-
const n = G(t);
|
|
659
|
-
return s(n, e.length);
|
|
660
|
-
},
|
|
661
|
-
// Extended year. This is a single number designating the year of this calendar system.
|
|
662
|
-
// The main difference between `y` and `u` localizers are B.C. years:
|
|
663
|
-
// | Year | `y` | `u` |
|
|
664
|
-
// |------|-----|-----|
|
|
665
|
-
// | AC 1 | 1 | 1 |
|
|
666
|
-
// | BC 1 | 1 | 0 |
|
|
667
|
-
// | BC 2 | 2 | -1 |
|
|
668
|
-
// Also `yy` always returns the last two digits of a year,
|
|
669
|
-
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
670
|
-
u: function(t, e) {
|
|
671
|
-
const n = t.getFullYear();
|
|
672
|
-
return s(n, e.length);
|
|
673
|
-
},
|
|
674
|
-
// Quarter
|
|
675
|
-
Q: function(t, e, n) {
|
|
676
|
-
const r = Math.ceil((t.getMonth() + 1) / 3);
|
|
677
|
-
switch (e) {
|
|
678
|
-
case "Q":
|
|
679
|
-
return String(r);
|
|
680
|
-
case "QQ":
|
|
681
|
-
return s(r, 2);
|
|
682
|
-
case "Qo":
|
|
683
|
-
return n.ordinalNumber(r, { unit: "quarter" });
|
|
684
|
-
case "QQQ":
|
|
685
|
-
return n.quarter(r, {
|
|
686
|
-
width: "abbreviated",
|
|
687
|
-
context: "formatting"
|
|
688
|
-
});
|
|
689
|
-
case "QQQQQ":
|
|
690
|
-
return n.quarter(r, {
|
|
691
|
-
width: "narrow",
|
|
692
|
-
context: "formatting"
|
|
693
|
-
});
|
|
694
|
-
case "QQQQ":
|
|
695
|
-
default:
|
|
696
|
-
return n.quarter(r, {
|
|
697
|
-
width: "wide",
|
|
698
|
-
context: "formatting"
|
|
699
|
-
});
|
|
700
|
-
}
|
|
701
|
-
},
|
|
702
|
-
// Stand-alone quarter
|
|
703
|
-
q: function(t, e, n) {
|
|
704
|
-
const r = Math.ceil((t.getMonth() + 1) / 3);
|
|
705
|
-
switch (e) {
|
|
706
|
-
case "q":
|
|
707
|
-
return String(r);
|
|
708
|
-
case "qq":
|
|
709
|
-
return s(r, 2);
|
|
710
|
-
case "qo":
|
|
711
|
-
return n.ordinalNumber(r, { unit: "quarter" });
|
|
712
|
-
case "qqq":
|
|
713
|
-
return n.quarter(r, {
|
|
714
|
-
width: "abbreviated",
|
|
715
|
-
context: "standalone"
|
|
716
|
-
});
|
|
717
|
-
case "qqqqq":
|
|
718
|
-
return n.quarter(r, {
|
|
719
|
-
width: "narrow",
|
|
720
|
-
context: "standalone"
|
|
721
|
-
});
|
|
722
|
-
case "qqqq":
|
|
723
|
-
default:
|
|
724
|
-
return n.quarter(r, {
|
|
725
|
-
width: "wide",
|
|
726
|
-
context: "standalone"
|
|
727
|
-
});
|
|
728
|
-
}
|
|
729
|
-
},
|
|
730
|
-
// Month
|
|
731
|
-
M: function(t, e, n) {
|
|
732
|
-
const r = t.getMonth();
|
|
733
|
-
switch (e) {
|
|
734
|
-
case "M":
|
|
735
|
-
case "MM":
|
|
736
|
-
return y.M(t, e);
|
|
737
|
-
case "Mo":
|
|
738
|
-
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
739
|
-
case "MMM":
|
|
740
|
-
return n.month(r, {
|
|
741
|
-
width: "abbreviated",
|
|
742
|
-
context: "formatting"
|
|
743
|
-
});
|
|
744
|
-
case "MMMMM":
|
|
745
|
-
return n.month(r, {
|
|
746
|
-
width: "narrow",
|
|
747
|
-
context: "formatting"
|
|
748
|
-
});
|
|
749
|
-
case "MMMM":
|
|
750
|
-
default:
|
|
751
|
-
return n.month(r, { width: "wide", context: "formatting" });
|
|
752
|
-
}
|
|
753
|
-
},
|
|
754
|
-
// Stand-alone month
|
|
755
|
-
L: function(t, e, n) {
|
|
756
|
-
const r = t.getMonth();
|
|
757
|
-
switch (e) {
|
|
758
|
-
case "L":
|
|
759
|
-
return String(r + 1);
|
|
760
|
-
case "LL":
|
|
761
|
-
return s(r + 1, 2);
|
|
762
|
-
case "Lo":
|
|
763
|
-
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
764
|
-
case "LLL":
|
|
765
|
-
return n.month(r, {
|
|
766
|
-
width: "abbreviated",
|
|
767
|
-
context: "standalone"
|
|
768
|
-
});
|
|
769
|
-
case "LLLLL":
|
|
770
|
-
return n.month(r, {
|
|
771
|
-
width: "narrow",
|
|
772
|
-
context: "standalone"
|
|
773
|
-
});
|
|
774
|
-
case "LLLL":
|
|
775
|
-
default:
|
|
776
|
-
return n.month(r, { width: "wide", context: "standalone" });
|
|
777
|
-
}
|
|
778
|
-
},
|
|
779
|
-
// Local week of year
|
|
780
|
-
w: function(t, e, n, r) {
|
|
781
|
-
const a = He(t, r);
|
|
782
|
-
return e === "wo" ? n.ordinalNumber(a, { unit: "week" }) : s(a, e.length);
|
|
783
|
-
},
|
|
784
|
-
// ISO week of year
|
|
785
|
-
I: function(t, e, n) {
|
|
786
|
-
const r = Re(t);
|
|
787
|
-
return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) : s(r, e.length);
|
|
788
|
-
},
|
|
789
|
-
// Day of the month
|
|
790
|
-
d: function(t, e, n) {
|
|
791
|
-
return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : y.d(t, e);
|
|
792
|
-
},
|
|
793
|
-
// Day of year
|
|
794
|
-
D: function(t, e, n) {
|
|
795
|
-
const r = _e(t);
|
|
796
|
-
return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : s(r, e.length);
|
|
797
|
-
},
|
|
798
|
-
// Day of week
|
|
799
|
-
E: function(t, e, n) {
|
|
800
|
-
const r = t.getDay();
|
|
801
|
-
switch (e) {
|
|
802
|
-
case "E":
|
|
803
|
-
case "EE":
|
|
804
|
-
case "EEE":
|
|
805
|
-
return n.day(r, {
|
|
806
|
-
width: "abbreviated",
|
|
807
|
-
context: "formatting"
|
|
808
|
-
});
|
|
809
|
-
case "EEEEE":
|
|
810
|
-
return n.day(r, {
|
|
811
|
-
width: "narrow",
|
|
812
|
-
context: "formatting"
|
|
813
|
-
});
|
|
814
|
-
case "EEEEEE":
|
|
815
|
-
return n.day(r, {
|
|
816
|
-
width: "short",
|
|
817
|
-
context: "formatting"
|
|
818
|
-
});
|
|
819
|
-
case "EEEE":
|
|
820
|
-
default:
|
|
821
|
-
return n.day(r, {
|
|
822
|
-
width: "wide",
|
|
823
|
-
context: "formatting"
|
|
824
|
-
});
|
|
825
|
-
}
|
|
826
|
-
},
|
|
827
|
-
// Local day of week
|
|
828
|
-
e: function(t, e, n, r) {
|
|
829
|
-
const a = t.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
830
|
-
switch (e) {
|
|
831
|
-
case "e":
|
|
832
|
-
return String(i);
|
|
833
|
-
case "ee":
|
|
834
|
-
return s(i, 2);
|
|
835
|
-
case "eo":
|
|
836
|
-
return n.ordinalNumber(i, { unit: "day" });
|
|
837
|
-
case "eee":
|
|
838
|
-
return n.day(a, {
|
|
839
|
-
width: "abbreviated",
|
|
840
|
-
context: "formatting"
|
|
841
|
-
});
|
|
842
|
-
case "eeeee":
|
|
843
|
-
return n.day(a, {
|
|
844
|
-
width: "narrow",
|
|
845
|
-
context: "formatting"
|
|
846
|
-
});
|
|
847
|
-
case "eeeeee":
|
|
848
|
-
return n.day(a, {
|
|
849
|
-
width: "short",
|
|
850
|
-
context: "formatting"
|
|
851
|
-
});
|
|
852
|
-
case "eeee":
|
|
853
|
-
default:
|
|
854
|
-
return n.day(a, {
|
|
855
|
-
width: "wide",
|
|
856
|
-
context: "formatting"
|
|
857
|
-
});
|
|
858
|
-
}
|
|
859
|
-
},
|
|
860
|
-
// Stand-alone local day of week
|
|
861
|
-
c: function(t, e, n, r) {
|
|
862
|
-
const a = t.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
863
|
-
switch (e) {
|
|
864
|
-
case "c":
|
|
865
|
-
return String(i);
|
|
866
|
-
case "cc":
|
|
867
|
-
return s(i, e.length);
|
|
868
|
-
case "co":
|
|
869
|
-
return n.ordinalNumber(i, { unit: "day" });
|
|
870
|
-
case "ccc":
|
|
871
|
-
return n.day(a, {
|
|
872
|
-
width: "abbreviated",
|
|
873
|
-
context: "standalone"
|
|
874
|
-
});
|
|
875
|
-
case "ccccc":
|
|
876
|
-
return n.day(a, {
|
|
877
|
-
width: "narrow",
|
|
878
|
-
context: "standalone"
|
|
879
|
-
});
|
|
880
|
-
case "cccccc":
|
|
881
|
-
return n.day(a, {
|
|
882
|
-
width: "short",
|
|
883
|
-
context: "standalone"
|
|
884
|
-
});
|
|
885
|
-
case "cccc":
|
|
886
|
-
default:
|
|
887
|
-
return n.day(a, {
|
|
888
|
-
width: "wide",
|
|
889
|
-
context: "standalone"
|
|
890
|
-
});
|
|
891
|
-
}
|
|
892
|
-
},
|
|
893
|
-
// ISO day of week
|
|
894
|
-
i: function(t, e, n) {
|
|
895
|
-
const r = t.getDay(), a = r === 0 ? 7 : r;
|
|
896
|
-
switch (e) {
|
|
897
|
-
case "i":
|
|
898
|
-
return String(a);
|
|
899
|
-
case "ii":
|
|
900
|
-
return s(a, e.length);
|
|
901
|
-
case "io":
|
|
902
|
-
return n.ordinalNumber(a, { unit: "day" });
|
|
903
|
-
case "iii":
|
|
904
|
-
return n.day(r, {
|
|
905
|
-
width: "abbreviated",
|
|
906
|
-
context: "formatting"
|
|
907
|
-
});
|
|
908
|
-
case "iiiii":
|
|
909
|
-
return n.day(r, {
|
|
910
|
-
width: "narrow",
|
|
911
|
-
context: "formatting"
|
|
912
|
-
});
|
|
913
|
-
case "iiiiii":
|
|
914
|
-
return n.day(r, {
|
|
915
|
-
width: "short",
|
|
916
|
-
context: "formatting"
|
|
917
|
-
});
|
|
918
|
-
case "iiii":
|
|
919
|
-
default:
|
|
920
|
-
return n.day(r, {
|
|
921
|
-
width: "wide",
|
|
922
|
-
context: "formatting"
|
|
923
|
-
});
|
|
924
|
-
}
|
|
925
|
-
},
|
|
926
|
-
// AM or PM
|
|
927
|
-
a: function(t, e, n) {
|
|
928
|
-
const a = t.getHours() / 12 >= 1 ? "pm" : "am";
|
|
929
|
-
switch (e) {
|
|
930
|
-
case "a":
|
|
931
|
-
case "aa":
|
|
932
|
-
return n.dayPeriod(a, {
|
|
933
|
-
width: "abbreviated",
|
|
934
|
-
context: "formatting"
|
|
935
|
-
});
|
|
936
|
-
case "aaa":
|
|
937
|
-
return n.dayPeriod(a, {
|
|
938
|
-
width: "abbreviated",
|
|
939
|
-
context: "formatting"
|
|
940
|
-
}).toLowerCase();
|
|
941
|
-
case "aaaaa":
|
|
942
|
-
return n.dayPeriod(a, {
|
|
943
|
-
width: "narrow",
|
|
944
|
-
context: "formatting"
|
|
945
|
-
});
|
|
946
|
-
case "aaaa":
|
|
947
|
-
default:
|
|
948
|
-
return n.dayPeriod(a, {
|
|
949
|
-
width: "wide",
|
|
950
|
-
context: "formatting"
|
|
951
|
-
});
|
|
952
|
-
}
|
|
953
|
-
},
|
|
954
|
-
// AM, PM, midnight, noon
|
|
955
|
-
b: function(t, e, n) {
|
|
956
|
-
const r = t.getHours();
|
|
957
|
-
let a;
|
|
958
|
-
switch (r === 12 ? a = S.noon : r === 0 ? a = S.midnight : a = r / 12 >= 1 ? "pm" : "am", e) {
|
|
959
|
-
case "b":
|
|
960
|
-
case "bb":
|
|
961
|
-
return n.dayPeriod(a, {
|
|
962
|
-
width: "abbreviated",
|
|
963
|
-
context: "formatting"
|
|
964
|
-
});
|
|
965
|
-
case "bbb":
|
|
966
|
-
return n.dayPeriod(a, {
|
|
967
|
-
width: "abbreviated",
|
|
968
|
-
context: "formatting"
|
|
969
|
-
}).toLowerCase();
|
|
970
|
-
case "bbbbb":
|
|
971
|
-
return n.dayPeriod(a, {
|
|
972
|
-
width: "narrow",
|
|
973
|
-
context: "formatting"
|
|
974
|
-
});
|
|
975
|
-
case "bbbb":
|
|
976
|
-
default:
|
|
977
|
-
return n.dayPeriod(a, {
|
|
978
|
-
width: "wide",
|
|
979
|
-
context: "formatting"
|
|
980
|
-
});
|
|
981
|
-
}
|
|
982
|
-
},
|
|
983
|
-
// in the morning, in the afternoon, in the evening, at night
|
|
984
|
-
B: function(t, e, n) {
|
|
985
|
-
const r = t.getHours();
|
|
986
|
-
let a;
|
|
987
|
-
switch (r >= 17 ? a = S.evening : r >= 12 ? a = S.afternoon : r >= 4 ? a = S.morning : a = S.night, e) {
|
|
988
|
-
case "B":
|
|
989
|
-
case "BB":
|
|
990
|
-
case "BBB":
|
|
991
|
-
return n.dayPeriod(a, {
|
|
992
|
-
width: "abbreviated",
|
|
993
|
-
context: "formatting"
|
|
994
|
-
});
|
|
995
|
-
case "BBBBB":
|
|
996
|
-
return n.dayPeriod(a, {
|
|
997
|
-
width: "narrow",
|
|
998
|
-
context: "formatting"
|
|
999
|
-
});
|
|
1000
|
-
case "BBBB":
|
|
1001
|
-
default:
|
|
1002
|
-
return n.dayPeriod(a, {
|
|
1003
|
-
width: "wide",
|
|
1004
|
-
context: "formatting"
|
|
1005
|
-
});
|
|
1006
|
-
}
|
|
1007
|
-
},
|
|
1008
|
-
// Hour [1-12]
|
|
1009
|
-
h: function(t, e, n) {
|
|
1010
|
-
if (e === "ho") {
|
|
1011
|
-
let r = t.getHours() % 12;
|
|
1012
|
-
return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
|
|
1013
|
-
}
|
|
1014
|
-
return y.h(t, e);
|
|
1015
|
-
},
|
|
1016
|
-
// Hour [0-23]
|
|
1017
|
-
H: function(t, e, n) {
|
|
1018
|
-
return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : y.H(t, e);
|
|
1019
|
-
},
|
|
1020
|
-
// Hour [0-11]
|
|
1021
|
-
K: function(t, e, n) {
|
|
1022
|
-
const r = t.getHours() % 12;
|
|
1023
|
-
return e === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : s(r, e.length);
|
|
1024
|
-
},
|
|
1025
|
-
// Hour [1-24]
|
|
1026
|
-
k: function(t, e, n) {
|
|
1027
|
-
let r = t.getHours();
|
|
1028
|
-
return r === 0 && (r = 24), e === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : s(r, e.length);
|
|
1029
|
-
},
|
|
1030
|
-
// Minute
|
|
1031
|
-
m: function(t, e, n) {
|
|
1032
|
-
return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : y.m(t, e);
|
|
1033
|
-
},
|
|
1034
|
-
// Second
|
|
1035
|
-
s: function(t, e, n) {
|
|
1036
|
-
return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : y.s(t, e);
|
|
1037
|
-
},
|
|
1038
|
-
// Fraction of second
|
|
1039
|
-
S: function(t, e) {
|
|
1040
|
-
return y.S(t, e);
|
|
1041
|
-
},
|
|
1042
|
-
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1043
|
-
X: function(t, e, n) {
|
|
1044
|
-
const r = t.getTimezoneOffset();
|
|
1045
|
-
if (r === 0)
|
|
1046
|
-
return "Z";
|
|
1047
|
-
switch (e) {
|
|
1048
|
-
case "X":
|
|
1049
|
-
return H(r);
|
|
1050
|
-
case "XXXX":
|
|
1051
|
-
case "XX":
|
|
1052
|
-
return v(r);
|
|
1053
|
-
case "XXXXX":
|
|
1054
|
-
case "XXX":
|
|
1055
|
-
default:
|
|
1056
|
-
return v(r, ":");
|
|
1057
|
-
}
|
|
1058
|
-
},
|
|
1059
|
-
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
1060
|
-
x: function(t, e, n) {
|
|
1061
|
-
const r = t.getTimezoneOffset();
|
|
1062
|
-
switch (e) {
|
|
1063
|
-
case "x":
|
|
1064
|
-
return H(r);
|
|
1065
|
-
case "xxxx":
|
|
1066
|
-
case "xx":
|
|
1067
|
-
return v(r);
|
|
1068
|
-
case "xxxxx":
|
|
1069
|
-
case "xxx":
|
|
1070
|
-
default:
|
|
1071
|
-
return v(r, ":");
|
|
1072
|
-
}
|
|
1073
|
-
},
|
|
1074
|
-
// Timezone (GMT)
|
|
1075
|
-
O: function(t, e, n) {
|
|
1076
|
-
const r = t.getTimezoneOffset();
|
|
1077
|
-
switch (e) {
|
|
1078
|
-
case "O":
|
|
1079
|
-
case "OO":
|
|
1080
|
-
case "OOO":
|
|
1081
|
-
return "GMT" + I(r, ":");
|
|
1082
|
-
case "OOOO":
|
|
1083
|
-
default:
|
|
1084
|
-
return "GMT" + v(r, ":");
|
|
1085
|
-
}
|
|
1086
|
-
},
|
|
1087
|
-
// Timezone (specific non-location)
|
|
1088
|
-
z: function(t, e, n) {
|
|
1089
|
-
const r = t.getTimezoneOffset();
|
|
1090
|
-
switch (e) {
|
|
1091
|
-
case "z":
|
|
1092
|
-
case "zz":
|
|
1093
|
-
case "zzz":
|
|
1094
|
-
return "GMT" + I(r, ":");
|
|
1095
|
-
case "zzzz":
|
|
1096
|
-
default:
|
|
1097
|
-
return "GMT" + v(r, ":");
|
|
1098
|
-
}
|
|
1099
|
-
},
|
|
1100
|
-
// Seconds timestamp
|
|
1101
|
-
t: function(t, e, n) {
|
|
1102
|
-
const r = Math.trunc(+t / 1e3);
|
|
1103
|
-
return s(r, e.length);
|
|
1104
|
-
},
|
|
1105
|
-
// Milliseconds timestamp
|
|
1106
|
-
T: function(t, e, n) {
|
|
1107
|
-
return s(+t, e.length);
|
|
1108
|
-
}
|
|
1109
|
-
};
|
|
1110
|
-
function I(t, e = "") {
|
|
1111
|
-
const n = t > 0 ? "-" : "+", r = Math.abs(t), a = Math.trunc(r / 60), i = r % 60;
|
|
1112
|
-
return i === 0 ? n + String(a) : n + String(a) + e + s(i, 2);
|
|
1113
|
-
}
|
|
1114
|
-
function H(t, e) {
|
|
1115
|
-
return t % 60 === 0 ? (t > 0 ? "-" : "+") + s(Math.abs(t) / 60, 2) : v(t, e);
|
|
1116
|
-
}
|
|
1117
|
-
function v(t, e = "") {
|
|
1118
|
-
const n = t > 0 ? "-" : "+", r = Math.abs(t), a = s(Math.trunc(r / 60), 2), i = s(r % 60, 2);
|
|
1119
|
-
return n + a + e + i;
|
|
1120
|
-
}
|
|
1121
|
-
const q = (t, e) => {
|
|
1122
|
-
switch (t) {
|
|
1123
|
-
case "P":
|
|
1124
|
-
return e.date({ width: "short" });
|
|
1125
|
-
case "PP":
|
|
1126
|
-
return e.date({ width: "medium" });
|
|
1127
|
-
case "PPP":
|
|
1128
|
-
return e.date({ width: "long" });
|
|
1129
|
-
case "PPPP":
|
|
1130
|
-
default:
|
|
1131
|
-
return e.date({ width: "full" });
|
|
1132
|
-
}
|
|
1133
|
-
}, X = (t, e) => {
|
|
1134
|
-
switch (t) {
|
|
1135
|
-
case "p":
|
|
1136
|
-
return e.time({ width: "short" });
|
|
1137
|
-
case "pp":
|
|
1138
|
-
return e.time({ width: "medium" });
|
|
1139
|
-
case "ppp":
|
|
1140
|
-
return e.time({ width: "long" });
|
|
1141
|
-
case "pppp":
|
|
1142
|
-
default:
|
|
1143
|
-
return e.time({ width: "full" });
|
|
1144
|
-
}
|
|
1145
|
-
}, qe = (t, e) => {
|
|
1146
|
-
const n = t.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
|
|
1147
|
-
if (!a)
|
|
1148
|
-
return q(t, e);
|
|
1149
|
-
let i;
|
|
1150
|
-
switch (r) {
|
|
1151
|
-
case "P":
|
|
1152
|
-
i = e.dateTime({ width: "short" });
|
|
1153
|
-
break;
|
|
1154
|
-
case "PP":
|
|
1155
|
-
i = e.dateTime({ width: "medium" });
|
|
1156
|
-
break;
|
|
1157
|
-
case "PPP":
|
|
1158
|
-
i = e.dateTime({ width: "long" });
|
|
1159
|
-
break;
|
|
1160
|
-
case "PPPP":
|
|
1161
|
-
default:
|
|
1162
|
-
i = e.dateTime({ width: "full" });
|
|
1163
|
-
break;
|
|
1164
|
-
}
|
|
1165
|
-
return i.replace("{{date}}", q(r, e)).replace("{{time}}", X(a, e));
|
|
1166
|
-
}, pe = {
|
|
1167
|
-
p: X,
|
|
1168
|
-
P: qe
|
|
1169
|
-
}, Ge = /^D+$/, je = /^Y+$/, Xe = ["D", "DD", "YY", "YYYY"];
|
|
1170
|
-
function Qe(t) {
|
|
1171
|
-
return Ge.test(t);
|
|
1172
|
-
}
|
|
1173
|
-
function Be(t) {
|
|
1174
|
-
return je.test(t);
|
|
1175
|
-
}
|
|
1176
|
-
function Ve(t, e, n) {
|
|
1177
|
-
const r = Ue(t, e, n);
|
|
1178
|
-
if (console.warn(r), Xe.includes(t)) throw new RangeError(r);
|
|
1179
|
-
}
|
|
1180
|
-
function Ue(t, e, n) {
|
|
1181
|
-
const r = t[0] === "Y" ? "years" : "days of the month";
|
|
1182
|
-
return `Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
1183
|
-
}
|
|
1184
|
-
const Je = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, $e = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, ze = /^'([^]*?)'?$/, Ke = /''/g, Ze = /[a-zA-Z]/;
|
|
1185
|
-
function et(t, e, n) {
|
|
1186
|
-
var f, g, h, w;
|
|
1187
|
-
const r = x(), a = r.locale ?? Ne, i = r.firstWeekContainsDate ?? ((g = (f = r.locale) == null ? void 0 : f.options) == null ? void 0 : g.firstWeekContainsDate) ?? 1, c = r.weekStartsOn ?? ((w = (h = r.locale) == null ? void 0 : h.options) == null ? void 0 : w.weekStartsOn) ?? 0, u = b(t, n == null ? void 0 : n.in);
|
|
1188
|
-
if (!te(u))
|
|
1189
|
-
throw new RangeError("Invalid time value");
|
|
1190
|
-
let o = e.match($e).map((m) => {
|
|
1191
|
-
const l = m[0];
|
|
1192
|
-
if (l === "p" || l === "P") {
|
|
1193
|
-
const E = pe[l];
|
|
1194
|
-
return E(m, a.formatLong);
|
|
1195
|
-
}
|
|
1196
|
-
return m;
|
|
1197
|
-
}).join("").match(Je).map((m) => {
|
|
1198
|
-
if (m === "''")
|
|
1199
|
-
return { isToken: !1, value: "'" };
|
|
1200
|
-
const l = m[0];
|
|
1201
|
-
if (l === "'")
|
|
1202
|
-
return { isToken: !1, value: tt(m) };
|
|
1203
|
-
if (R[l])
|
|
1204
|
-
return { isToken: !0, value: m };
|
|
1205
|
-
if (l.match(Ze))
|
|
1206
|
-
throw new RangeError(
|
|
1207
|
-
"Format string contains an unescaped latin alphabet character `" + l + "`"
|
|
1208
|
-
);
|
|
1209
|
-
return { isToken: !1, value: m };
|
|
1210
|
-
});
|
|
1211
|
-
a.localize.preprocessor && (o = a.localize.preprocessor(u, o));
|
|
1212
|
-
const d = {
|
|
1213
|
-
firstWeekContainsDate: i,
|
|
1214
|
-
weekStartsOn: c,
|
|
1215
|
-
locale: a
|
|
1216
|
-
};
|
|
1217
|
-
return o.map((m) => {
|
|
1218
|
-
if (!m.isToken) return m.value;
|
|
1219
|
-
const l = m.value;
|
|
1220
|
-
(Be(l) || Qe(l)) && Ve(l, e, String(t));
|
|
1221
|
-
const E = R[l[0]];
|
|
1222
|
-
return E(u, l, a.localize, d);
|
|
1223
|
-
}).join("");
|
|
1224
|
-
}
|
|
1225
|
-
function tt(t) {
|
|
1226
|
-
const e = t.match(ze);
|
|
1227
|
-
return e ? e[1].replace(Ke, "'") : t;
|
|
1228
|
-
}
|
|
1229
|
-
function ct() {
|
|
1230
|
-
return {
|
|
1231
|
-
formatDateBy: (n, r = {}) => {
|
|
1232
|
-
if (isNaN(n))
|
|
1233
|
-
return null;
|
|
1234
|
-
try {
|
|
1235
|
-
return new Date(n * 1e3).toLocaleDateString("en-US", {
|
|
1236
|
-
year: "numeric",
|
|
1237
|
-
month: "long",
|
|
1238
|
-
day: "numeric",
|
|
1239
|
-
weekday: "short",
|
|
1240
|
-
hour: "numeric",
|
|
1241
|
-
minute: "numeric",
|
|
1242
|
-
second: "numeric",
|
|
1243
|
-
hour12: !1,
|
|
1244
|
-
...r
|
|
1245
|
-
});
|
|
1246
|
-
} catch {
|
|
1247
|
-
return null;
|
|
1248
|
-
}
|
|
1249
|
-
},
|
|
1250
|
-
formatUnixToDate: (n, r) => {
|
|
1251
|
-
if (!n)
|
|
1252
|
-
return "";
|
|
1253
|
-
const a = r ? "yyyy-MM-dd HH:mm:ss" : "yyyy-MM-dd HH:mm:ss XX";
|
|
1254
|
-
try {
|
|
1255
|
-
const i = new Date(n * 1e3);
|
|
1256
|
-
return et(i, a);
|
|
1257
|
-
} catch {
|
|
1258
|
-
return "";
|
|
1259
|
-
}
|
|
1260
|
-
}
|
|
1261
|
-
};
|
|
1262
|
-
}
|
|
1263
|
-
function ut() {
|
|
1264
|
-
return {
|
|
1265
|
-
debounce: (e, n) => {
|
|
1266
|
-
let r;
|
|
1267
|
-
return (...a) => {
|
|
1268
|
-
clearTimeout(r), r = window == null ? void 0 : window.setTimeout(() => {
|
|
1269
|
-
e(...a);
|
|
1270
|
-
}, n);
|
|
1271
|
-
};
|
|
1272
|
-
}
|
|
1273
|
-
};
|
|
1274
|
-
}
|
|
1275
|
-
function st({ script: t, styles: e, onReady: n }) {
|
|
1276
|
-
const r = T(!0), a = T(!0), i = async () => {
|
|
1277
|
-
const { libName: o, url: d, type: f } = t;
|
|
1278
|
-
if ((f !== void 0 && ["umd", "es"].includes(f) ? f : "umd") === "es") {
|
|
1279
|
-
await import(
|
|
1280
|
-
/* @vite-ignore */
|
|
1281
|
-
d
|
|
1282
|
-
), typeof n == "function" && await n();
|
|
1283
|
-
return;
|
|
1284
|
-
}
|
|
1285
|
-
const h = o.startsWith("kong-ui-") ? o : `kong-ui-${o}`;
|
|
1286
|
-
return window[h] || (window[h] = await new Promise((w, m) => {
|
|
1287
|
-
const l = document.createElement("script");
|
|
1288
|
-
l.async = !0, l.addEventListener("load", async () => {
|
|
1289
|
-
typeof n == "function" && await n(), r.value = !1, w(window[h]);
|
|
1290
|
-
}), l.addEventListener("error", () => {
|
|
1291
|
-
m(new Error(`Could not load '${h}' from ${d}`));
|
|
1292
|
-
}), l.src = d, document.head.appendChild(l);
|
|
1293
|
-
})), window[h];
|
|
1294
|
-
}, c = async (o, d) => {
|
|
1295
|
-
var f;
|
|
1296
|
-
for (const g of o) {
|
|
1297
|
-
const h = document.createElement("link");
|
|
1298
|
-
h.type = "text/css", h.rel = "stylesheet", h.href = g;
|
|
1299
|
-
const w = d ? document.querySelector(d) : null, m = d ? (f = w == null ? void 0 : w.shadowRoot) == null ? void 0 : f.children[0] : null;
|
|
1300
|
-
if (w && m)
|
|
1301
|
-
try {
|
|
1302
|
-
m.appendChild(h);
|
|
1303
|
-
} catch {
|
|
1304
|
-
document.head.appendChild(h);
|
|
1305
|
-
}
|
|
1306
|
-
else
|
|
1307
|
-
document.head.appendChild(h);
|
|
1308
|
-
}
|
|
1309
|
-
};
|
|
1310
|
-
return {
|
|
1311
|
-
importPackage: async () => {
|
|
1312
|
-
var d, f;
|
|
1313
|
-
if (!t || !t.url || typeof window > "u" || typeof document > "u") return;
|
|
1314
|
-
const o = V(() => !!(e && (e != null && e.urls) && (e != null && e.urls.length) && e.shadowRoot));
|
|
1315
|
-
if ((!e || !(e != null && e.urls) || !((d = e == null ? void 0 : e.urls) != null && d.length)) && (a.value = !1), e != null && e.urls && ((f = e == null ? void 0 : e.urls) != null && f.length) && !o.value && (await c(e.urls), a.value = !1), (!t.type || t.type === "umd") && !o.value)
|
|
1316
|
-
return await i();
|
|
1317
|
-
await i(), await F(), r.value = !1, e != null && e.urls && o.value && (await c(e.urls, e == null ? void 0 : e.shadowRoot), await F(), a.value = !1);
|
|
1318
|
-
},
|
|
1319
|
-
loadingPackage: Y(r),
|
|
1320
|
-
loadingStyles: Y(a)
|
|
1321
|
-
};
|
|
1322
|
-
}
|
|
1323
|
-
var Q = /* @__PURE__ */ ((t) => (t.VALIDATING = "VALIDATING", t.VALIDATING_HAS_DATA = "VALIDATING_HAS_DATA", t.PENDING = "PENDING", t.SUCCESS = "SUCCESS", t.SUCCESS_HAS_DATA = "SUCCESS_HAS_DATA", t.ERROR = "ERROR", t.STALE_IF_ERROR = "STALE_IF_ERROR", t))(Q || {});
|
|
1324
|
-
const nt = (t) => {
|
|
1325
|
-
var e, n, r, a, i;
|
|
1326
|
-
return t ? !!// TODO: revisit: currently only the first check ever matters?
|
|
1327
|
-
((e = Object.keys(t)) != null && e.length || (n = t.data) != null && n.length || (a = (r = t.data) == null ? void 0 : r.data) != null && a.length || !((i = t.data) != null && i.data) && typeof t.data == "object" && Object.keys(t == null ? void 0 : t.data).length) : !1;
|
|
1328
|
-
};
|
|
1329
|
-
function dt(t = T({}), e, n, r = nt) {
|
|
1330
|
-
const a = T(
|
|
1331
|
-
"PENDING"
|
|
1332
|
-
/* PENDING */
|
|
1333
|
-
);
|
|
1334
|
-
return U(() => {
|
|
1335
|
-
const i = r(t.value);
|
|
1336
|
-
if (t.value && i && n.value) {
|
|
1337
|
-
a.value = "VALIDATING_HAS_DATA";
|
|
1338
|
-
return;
|
|
1339
|
-
}
|
|
1340
|
-
if (t.value && n.value) {
|
|
1341
|
-
a.value = "VALIDATING";
|
|
1342
|
-
return;
|
|
1343
|
-
}
|
|
1344
|
-
if (t.value && e.value) {
|
|
1345
|
-
a.value = "STALE_IF_ERROR";
|
|
1346
|
-
return;
|
|
1347
|
-
}
|
|
1348
|
-
if (t.value === void 0 && !e.value) {
|
|
1349
|
-
a.value = "PENDING";
|
|
1350
|
-
return;
|
|
1351
|
-
}
|
|
1352
|
-
if (t.value && !e.value && i) {
|
|
1353
|
-
a.value = "SUCCESS_HAS_DATA";
|
|
1354
|
-
return;
|
|
1355
|
-
}
|
|
1356
|
-
if (t.value && !e.value) {
|
|
1357
|
-
a.value = "SUCCESS";
|
|
1358
|
-
return;
|
|
1359
|
-
}
|
|
1360
|
-
t.value === void 0 && e && (a.value = "ERROR");
|
|
1361
|
-
}), {
|
|
1362
|
-
state: a,
|
|
1363
|
-
swrvState: Q
|
|
1364
|
-
};
|
|
1365
|
-
}
|
|
1366
|
-
const A = "khcp-user-table-preferences", rt = {
|
|
1367
|
-
pageSize: 30,
|
|
1368
|
-
sortColumnKey: void 0,
|
|
1369
|
-
sortColumnOrder: void 0,
|
|
1370
|
-
columnVisibility: {}
|
|
1371
|
-
};
|
|
1372
|
-
function ft() {
|
|
1373
|
-
const t = (i) => {
|
|
1374
|
-
if (typeof i == "string")
|
|
1375
|
-
try {
|
|
1376
|
-
return JSON.parse(i);
|
|
1377
|
-
} catch (c) {
|
|
1378
|
-
console.error("useTablePreferences(tryParseJson)", c);
|
|
1379
|
-
return;
|
|
1380
|
-
}
|
|
1381
|
-
}, e = () => {
|
|
1382
|
-
const i = t(localStorage.getItem(A));
|
|
1383
|
-
return !i || !Object.keys(i).length ? /* @__PURE__ */ new Map() : new Map(Object.entries(i));
|
|
1384
|
-
};
|
|
1385
|
-
return {
|
|
1386
|
-
setTablePreferences: (i, c) => {
|
|
1387
|
-
try {
|
|
1388
|
-
const u = e();
|
|
1389
|
-
u.set(i, c), localStorage.setItem(A, JSON.stringify(Object.fromEntries(u.entries())));
|
|
1390
|
-
} catch (u) {
|
|
1391
|
-
console.error("useTablePreferences(setTablePreferences)", u);
|
|
1392
|
-
}
|
|
1393
|
-
},
|
|
1394
|
-
getTablePreferences: (i, c) => {
|
|
1395
|
-
const u = e();
|
|
1396
|
-
return (u == null ? void 0 : u.get(i)) || void 0 || c || rt;
|
|
1397
|
-
},
|
|
1398
|
-
deleteAllTablePreferences: () => {
|
|
1399
|
-
localStorage.removeItem(A);
|
|
1400
|
-
}
|
|
1401
|
-
};
|
|
1402
|
-
}
|
|
1403
|
-
function lt() {
|
|
1404
|
-
const t = () => {
|
|
1405
|
-
var o;
|
|
1406
|
-
return ((o = window == null ? void 0 : window.location) == null ? void 0 : o.search) || "";
|
|
1407
|
-
};
|
|
1408
|
-
return {
|
|
1409
|
-
getLocationSearch: t,
|
|
1410
|
-
getLocationHostname: () => {
|
|
1411
|
-
var o;
|
|
1412
|
-
return ((o = window == null ? void 0 : window.location) == null ? void 0 : o.hostname) || "";
|
|
1413
|
-
},
|
|
1414
|
-
getLocationHref: () => {
|
|
1415
|
-
var o;
|
|
1416
|
-
return ((o = window == null ? void 0 : window.location) == null ? void 0 : o.href) || "";
|
|
1417
|
-
},
|
|
1418
|
-
getLocationPathname: () => {
|
|
1419
|
-
var o;
|
|
1420
|
-
return ((o = window == null ? void 0 : window.location) == null ? void 0 : o.pathname) || "";
|
|
1421
|
-
},
|
|
1422
|
-
getLocationOrigin: () => {
|
|
1423
|
-
var o;
|
|
1424
|
-
return ((o = window == null ? void 0 : window.location) == null ? void 0 : o.origin) || "";
|
|
1425
|
-
},
|
|
1426
|
-
getUrlSearchParams: () => new URLSearchParams(t()),
|
|
1427
|
-
setLocationAssign: (o) => {
|
|
1428
|
-
window.location.assign(o);
|
|
1429
|
-
},
|
|
1430
|
-
setLocationReplace: (o) => {
|
|
1431
|
-
window.location.replace(o);
|
|
1432
|
-
}
|
|
1433
|
-
};
|
|
1434
|
-
}
|
|
1435
|
-
export {
|
|
1436
|
-
rt as DEFAULT_USER_TABLE_PREFERENCES,
|
|
1437
|
-
A as USER_TABLE_PREFERENCES_LOCAL_STORAGE_KEY,
|
|
1438
|
-
ot as useAxios,
|
|
1439
|
-
ct as useDate,
|
|
1440
|
-
ut as useDebounce,
|
|
1441
|
-
st as usePackage,
|
|
1442
|
-
dt as useSwrvState,
|
|
1443
|
-
ft as useTablePreferences,
|
|
1444
|
-
lt as useWindow
|
|
1445
|
-
};
|