@kong-ui-public/core 1.10.9 → 1.10.10-pr.2030.2349ecd36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.es.js DELETED
@@ -1,1447 +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
- am: "am",
618
- pm: "pm",
619
- midnight: "midnight",
620
- noon: "noon",
621
- morning: "morning",
622
- afternoon: "afternoon",
623
- evening: "evening",
624
- night: "night"
625
- }, R = {
626
- // Era
627
- G: function(t, e, n) {
628
- const r = t.getFullYear() > 0 ? 1 : 0;
629
- switch (e) {
630
- case "G":
631
- case "GG":
632
- case "GGG":
633
- return n.era(r, { width: "abbreviated" });
634
- case "GGGGG":
635
- return n.era(r, { width: "narrow" });
636
- case "GGGG":
637
- default:
638
- return n.era(r, { width: "wide" });
639
- }
640
- },
641
- // Year
642
- y: function(t, e, n) {
643
- if (e === "yo") {
644
- const r = t.getFullYear(), a = r > 0 ? r : 1 - r;
645
- return n.ordinalNumber(a, { unit: "year" });
646
- }
647
- return y.y(t, e);
648
- },
649
- // Local week-numbering year
650
- Y: function(t, e, n, r) {
651
- const a = j(t, r), i = a > 0 ? a : 1 - a;
652
- if (e === "YY") {
653
- const c = i % 100;
654
- return s(c, 2);
655
- }
656
- return e === "Yo" ? n.ordinalNumber(i, { unit: "year" }) : s(i, e.length);
657
- },
658
- // ISO week-numbering year
659
- R: function(t, e) {
660
- const n = G(t);
661
- return s(n, e.length);
662
- },
663
- // Extended year. This is a single number designating the year of this calendar system.
664
- // The main difference between `y` and `u` localizers are B.C. years:
665
- // | Year | `y` | `u` |
666
- // |------|-----|-----|
667
- // | AC 1 | 1 | 1 |
668
- // | BC 1 | 1 | 0 |
669
- // | BC 2 | 2 | -1 |
670
- // Also `yy` always returns the last two digits of a year,
671
- // while `uu` pads single digit years to 2 characters and returns other years unchanged.
672
- u: function(t, e) {
673
- const n = t.getFullYear();
674
- return s(n, e.length);
675
- },
676
- // Quarter
677
- Q: function(t, e, n) {
678
- const r = Math.ceil((t.getMonth() + 1) / 3);
679
- switch (e) {
680
- case "Q":
681
- return String(r);
682
- case "QQ":
683
- return s(r, 2);
684
- case "Qo":
685
- return n.ordinalNumber(r, { unit: "quarter" });
686
- case "QQQ":
687
- return n.quarter(r, {
688
- width: "abbreviated",
689
- context: "formatting"
690
- });
691
- case "QQQQQ":
692
- return n.quarter(r, {
693
- width: "narrow",
694
- context: "formatting"
695
- });
696
- case "QQQQ":
697
- default:
698
- return n.quarter(r, {
699
- width: "wide",
700
- context: "formatting"
701
- });
702
- }
703
- },
704
- // Stand-alone quarter
705
- q: function(t, e, n) {
706
- const r = Math.ceil((t.getMonth() + 1) / 3);
707
- switch (e) {
708
- case "q":
709
- return String(r);
710
- case "qq":
711
- return s(r, 2);
712
- case "qo":
713
- return n.ordinalNumber(r, { unit: "quarter" });
714
- case "qqq":
715
- return n.quarter(r, {
716
- width: "abbreviated",
717
- context: "standalone"
718
- });
719
- case "qqqqq":
720
- return n.quarter(r, {
721
- width: "narrow",
722
- context: "standalone"
723
- });
724
- case "qqqq":
725
- default:
726
- return n.quarter(r, {
727
- width: "wide",
728
- context: "standalone"
729
- });
730
- }
731
- },
732
- // Month
733
- M: function(t, e, n) {
734
- const r = t.getMonth();
735
- switch (e) {
736
- case "M":
737
- case "MM":
738
- return y.M(t, e);
739
- case "Mo":
740
- return n.ordinalNumber(r + 1, { unit: "month" });
741
- case "MMM":
742
- return n.month(r, {
743
- width: "abbreviated",
744
- context: "formatting"
745
- });
746
- case "MMMMM":
747
- return n.month(r, {
748
- width: "narrow",
749
- context: "formatting"
750
- });
751
- case "MMMM":
752
- default:
753
- return n.month(r, { width: "wide", context: "formatting" });
754
- }
755
- },
756
- // Stand-alone month
757
- L: function(t, e, n) {
758
- const r = t.getMonth();
759
- switch (e) {
760
- case "L":
761
- return String(r + 1);
762
- case "LL":
763
- return s(r + 1, 2);
764
- case "Lo":
765
- return n.ordinalNumber(r + 1, { unit: "month" });
766
- case "LLL":
767
- return n.month(r, {
768
- width: "abbreviated",
769
- context: "standalone"
770
- });
771
- case "LLLLL":
772
- return n.month(r, {
773
- width: "narrow",
774
- context: "standalone"
775
- });
776
- case "LLLL":
777
- default:
778
- return n.month(r, { width: "wide", context: "standalone" });
779
- }
780
- },
781
- // Local week of year
782
- w: function(t, e, n, r) {
783
- const a = He(t, r);
784
- return e === "wo" ? n.ordinalNumber(a, { unit: "week" }) : s(a, e.length);
785
- },
786
- // ISO week of year
787
- I: function(t, e, n) {
788
- const r = Re(t);
789
- return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) : s(r, e.length);
790
- },
791
- // Day of the month
792
- d: function(t, e, n) {
793
- return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : y.d(t, e);
794
- },
795
- // Day of year
796
- D: function(t, e, n) {
797
- const r = _e(t);
798
- return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : s(r, e.length);
799
- },
800
- // Day of week
801
- E: function(t, e, n) {
802
- const r = t.getDay();
803
- switch (e) {
804
- case "E":
805
- case "EE":
806
- case "EEE":
807
- return n.day(r, {
808
- width: "abbreviated",
809
- context: "formatting"
810
- });
811
- case "EEEEE":
812
- return n.day(r, {
813
- width: "narrow",
814
- context: "formatting"
815
- });
816
- case "EEEEEE":
817
- return n.day(r, {
818
- width: "short",
819
- context: "formatting"
820
- });
821
- case "EEEE":
822
- default:
823
- return n.day(r, {
824
- width: "wide",
825
- context: "formatting"
826
- });
827
- }
828
- },
829
- // Local day of week
830
- e: function(t, e, n, r) {
831
- const a = t.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
832
- switch (e) {
833
- case "e":
834
- return String(i);
835
- case "ee":
836
- return s(i, 2);
837
- case "eo":
838
- return n.ordinalNumber(i, { unit: "day" });
839
- case "eee":
840
- return n.day(a, {
841
- width: "abbreviated",
842
- context: "formatting"
843
- });
844
- case "eeeee":
845
- return n.day(a, {
846
- width: "narrow",
847
- context: "formatting"
848
- });
849
- case "eeeeee":
850
- return n.day(a, {
851
- width: "short",
852
- context: "formatting"
853
- });
854
- case "eeee":
855
- default:
856
- return n.day(a, {
857
- width: "wide",
858
- context: "formatting"
859
- });
860
- }
861
- },
862
- // Stand-alone local day of week
863
- c: function(t, e, n, r) {
864
- const a = t.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
865
- switch (e) {
866
- case "c":
867
- return String(i);
868
- case "cc":
869
- return s(i, e.length);
870
- case "co":
871
- return n.ordinalNumber(i, { unit: "day" });
872
- case "ccc":
873
- return n.day(a, {
874
- width: "abbreviated",
875
- context: "standalone"
876
- });
877
- case "ccccc":
878
- return n.day(a, {
879
- width: "narrow",
880
- context: "standalone"
881
- });
882
- case "cccccc":
883
- return n.day(a, {
884
- width: "short",
885
- context: "standalone"
886
- });
887
- case "cccc":
888
- default:
889
- return n.day(a, {
890
- width: "wide",
891
- context: "standalone"
892
- });
893
- }
894
- },
895
- // ISO day of week
896
- i: function(t, e, n) {
897
- const r = t.getDay(), a = r === 0 ? 7 : r;
898
- switch (e) {
899
- case "i":
900
- return String(a);
901
- case "ii":
902
- return s(a, e.length);
903
- case "io":
904
- return n.ordinalNumber(a, { unit: "day" });
905
- case "iii":
906
- return n.day(r, {
907
- width: "abbreviated",
908
- context: "formatting"
909
- });
910
- case "iiiii":
911
- return n.day(r, {
912
- width: "narrow",
913
- context: "formatting"
914
- });
915
- case "iiiiii":
916
- return n.day(r, {
917
- width: "short",
918
- context: "formatting"
919
- });
920
- case "iiii":
921
- default:
922
- return n.day(r, {
923
- width: "wide",
924
- context: "formatting"
925
- });
926
- }
927
- },
928
- // AM or PM
929
- a: function(t, e, n) {
930
- const a = t.getHours() / 12 >= 1 ? "pm" : "am";
931
- switch (e) {
932
- case "a":
933
- case "aa":
934
- return n.dayPeriod(a, {
935
- width: "abbreviated",
936
- context: "formatting"
937
- });
938
- case "aaa":
939
- return n.dayPeriod(a, {
940
- width: "abbreviated",
941
- context: "formatting"
942
- }).toLowerCase();
943
- case "aaaaa":
944
- return n.dayPeriod(a, {
945
- width: "narrow",
946
- context: "formatting"
947
- });
948
- case "aaaa":
949
- default:
950
- return n.dayPeriod(a, {
951
- width: "wide",
952
- context: "formatting"
953
- });
954
- }
955
- },
956
- // AM, PM, midnight, noon
957
- b: function(t, e, n) {
958
- const r = t.getHours();
959
- let a;
960
- switch (r === 12 ? a = S.noon : r === 0 ? a = S.midnight : a = r / 12 >= 1 ? "pm" : "am", e) {
961
- case "b":
962
- case "bb":
963
- return n.dayPeriod(a, {
964
- width: "abbreviated",
965
- context: "formatting"
966
- });
967
- case "bbb":
968
- return n.dayPeriod(a, {
969
- width: "abbreviated",
970
- context: "formatting"
971
- }).toLowerCase();
972
- case "bbbbb":
973
- return n.dayPeriod(a, {
974
- width: "narrow",
975
- context: "formatting"
976
- });
977
- case "bbbb":
978
- default:
979
- return n.dayPeriod(a, {
980
- width: "wide",
981
- context: "formatting"
982
- });
983
- }
984
- },
985
- // in the morning, in the afternoon, in the evening, at night
986
- B: function(t, e, n) {
987
- const r = t.getHours();
988
- let a;
989
- switch (r >= 17 ? a = S.evening : r >= 12 ? a = S.afternoon : r >= 4 ? a = S.morning : a = S.night, e) {
990
- case "B":
991
- case "BB":
992
- case "BBB":
993
- return n.dayPeriod(a, {
994
- width: "abbreviated",
995
- context: "formatting"
996
- });
997
- case "BBBBB":
998
- return n.dayPeriod(a, {
999
- width: "narrow",
1000
- context: "formatting"
1001
- });
1002
- case "BBBB":
1003
- default:
1004
- return n.dayPeriod(a, {
1005
- width: "wide",
1006
- context: "formatting"
1007
- });
1008
- }
1009
- },
1010
- // Hour [1-12]
1011
- h: function(t, e, n) {
1012
- if (e === "ho") {
1013
- let r = t.getHours() % 12;
1014
- return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
1015
- }
1016
- return y.h(t, e);
1017
- },
1018
- // Hour [0-23]
1019
- H: function(t, e, n) {
1020
- return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : y.H(t, e);
1021
- },
1022
- // Hour [0-11]
1023
- K: function(t, e, n) {
1024
- const r = t.getHours() % 12;
1025
- return e === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : s(r, e.length);
1026
- },
1027
- // Hour [1-24]
1028
- k: function(t, e, n) {
1029
- let r = t.getHours();
1030
- return r === 0 && (r = 24), e === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : s(r, e.length);
1031
- },
1032
- // Minute
1033
- m: function(t, e, n) {
1034
- return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : y.m(t, e);
1035
- },
1036
- // Second
1037
- s: function(t, e, n) {
1038
- return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : y.s(t, e);
1039
- },
1040
- // Fraction of second
1041
- S: function(t, e) {
1042
- return y.S(t, e);
1043
- },
1044
- // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1045
- X: function(t, e, n) {
1046
- const r = t.getTimezoneOffset();
1047
- if (r === 0)
1048
- return "Z";
1049
- switch (e) {
1050
- case "X":
1051
- return H(r);
1052
- case "XXXX":
1053
- case "XX":
1054
- return v(r);
1055
- case "XXXXX":
1056
- case "XXX":
1057
- default:
1058
- return v(r, ":");
1059
- }
1060
- },
1061
- // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1062
- x: function(t, e, n) {
1063
- const r = t.getTimezoneOffset();
1064
- switch (e) {
1065
- case "x":
1066
- return H(r);
1067
- case "xxxx":
1068
- case "xx":
1069
- return v(r);
1070
- case "xxxxx":
1071
- case "xxx":
1072
- default:
1073
- return v(r, ":");
1074
- }
1075
- },
1076
- // Timezone (GMT)
1077
- O: function(t, e, n) {
1078
- const r = t.getTimezoneOffset();
1079
- switch (e) {
1080
- case "O":
1081
- case "OO":
1082
- case "OOO":
1083
- return "GMT" + I(r, ":");
1084
- case "OOOO":
1085
- default:
1086
- return "GMT" + v(r, ":");
1087
- }
1088
- },
1089
- // Timezone (specific non-location)
1090
- z: function(t, e, n) {
1091
- const r = t.getTimezoneOffset();
1092
- switch (e) {
1093
- case "z":
1094
- case "zz":
1095
- case "zzz":
1096
- return "GMT" + I(r, ":");
1097
- case "zzzz":
1098
- default:
1099
- return "GMT" + v(r, ":");
1100
- }
1101
- },
1102
- // Seconds timestamp
1103
- t: function(t, e, n) {
1104
- const r = Math.trunc(+t / 1e3);
1105
- return s(r, e.length);
1106
- },
1107
- // Milliseconds timestamp
1108
- T: function(t, e, n) {
1109
- return s(+t, e.length);
1110
- }
1111
- };
1112
- function I(t, e = "") {
1113
- const n = t > 0 ? "-" : "+", r = Math.abs(t), a = Math.trunc(r / 60), i = r % 60;
1114
- return i === 0 ? n + String(a) : n + String(a) + e + s(i, 2);
1115
- }
1116
- function H(t, e) {
1117
- return t % 60 === 0 ? (t > 0 ? "-" : "+") + s(Math.abs(t) / 60, 2) : v(t, e);
1118
- }
1119
- function v(t, e = "") {
1120
- const n = t > 0 ? "-" : "+", r = Math.abs(t), a = s(Math.trunc(r / 60), 2), i = s(r % 60, 2);
1121
- return n + a + e + i;
1122
- }
1123
- const q = (t, e) => {
1124
- switch (t) {
1125
- case "P":
1126
- return e.date({ width: "short" });
1127
- case "PP":
1128
- return e.date({ width: "medium" });
1129
- case "PPP":
1130
- return e.date({ width: "long" });
1131
- case "PPPP":
1132
- default:
1133
- return e.date({ width: "full" });
1134
- }
1135
- }, X = (t, e) => {
1136
- switch (t) {
1137
- case "p":
1138
- return e.time({ width: "short" });
1139
- case "pp":
1140
- return e.time({ width: "medium" });
1141
- case "ppp":
1142
- return e.time({ width: "long" });
1143
- case "pppp":
1144
- default:
1145
- return e.time({ width: "full" });
1146
- }
1147
- }, qe = (t, e) => {
1148
- const n = t.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
1149
- if (!a)
1150
- return q(t, e);
1151
- let i;
1152
- switch (r) {
1153
- case "P":
1154
- i = e.dateTime({ width: "short" });
1155
- break;
1156
- case "PP":
1157
- i = e.dateTime({ width: "medium" });
1158
- break;
1159
- case "PPP":
1160
- i = e.dateTime({ width: "long" });
1161
- break;
1162
- case "PPPP":
1163
- default:
1164
- i = e.dateTime({ width: "full" });
1165
- break;
1166
- }
1167
- return i.replace("{{date}}", q(r, e)).replace("{{time}}", X(a, e));
1168
- }, pe = {
1169
- p: X,
1170
- P: qe
1171
- }, Ge = /^D+$/, je = /^Y+$/, Xe = ["D", "DD", "YY", "YYYY"];
1172
- function Qe(t) {
1173
- return Ge.test(t);
1174
- }
1175
- function Be(t) {
1176
- return je.test(t);
1177
- }
1178
- function Ve(t, e, n) {
1179
- const r = Ue(t, e, n);
1180
- if (console.warn(r), Xe.includes(t)) throw new RangeError(r);
1181
- }
1182
- function Ue(t, e, n) {
1183
- const r = t[0] === "Y" ? "years" : "days of the month";
1184
- 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`;
1185
- }
1186
- const Je = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, $e = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, ze = /^'([^]*?)'?$/, Ke = /''/g, Ze = /[a-zA-Z]/;
1187
- function et(t, e, n) {
1188
- var f, g, h, w;
1189
- 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);
1190
- if (!te(u))
1191
- throw new RangeError("Invalid time value");
1192
- let o = e.match($e).map((m) => {
1193
- const l = m[0];
1194
- if (l === "p" || l === "P") {
1195
- const E = pe[l];
1196
- return E(m, a.formatLong);
1197
- }
1198
- return m;
1199
- }).join("").match(Je).map((m) => {
1200
- if (m === "''")
1201
- return { isToken: !1, value: "'" };
1202
- const l = m[0];
1203
- if (l === "'")
1204
- return { isToken: !1, value: tt(m) };
1205
- if (R[l])
1206
- return { isToken: !0, value: m };
1207
- if (l.match(Ze))
1208
- throw new RangeError(
1209
- "Format string contains an unescaped latin alphabet character `" + l + "`"
1210
- );
1211
- return { isToken: !1, value: m };
1212
- });
1213
- a.localize.preprocessor && (o = a.localize.preprocessor(u, o));
1214
- const d = {
1215
- firstWeekContainsDate: i,
1216
- weekStartsOn: c,
1217
- locale: a
1218
- };
1219
- return o.map((m) => {
1220
- if (!m.isToken) return m.value;
1221
- const l = m.value;
1222
- (Be(l) || Qe(l)) && Ve(l, e, String(t));
1223
- const E = R[l[0]];
1224
- return E(u, l, a.localize, d);
1225
- }).join("");
1226
- }
1227
- function tt(t) {
1228
- const e = t.match(ze);
1229
- return e ? e[1].replace(Ke, "'") : t;
1230
- }
1231
- function ct() {
1232
- return {
1233
- formatDateBy: (n, r = {}) => {
1234
- if (isNaN(n))
1235
- return null;
1236
- try {
1237
- return new Date(n * 1e3).toLocaleDateString("en-US", {
1238
- year: "numeric",
1239
- month: "long",
1240
- day: "numeric",
1241
- weekday: "short",
1242
- hour: "numeric",
1243
- minute: "numeric",
1244
- second: "numeric",
1245
- hour12: !1,
1246
- ...r
1247
- });
1248
- } catch {
1249
- return null;
1250
- }
1251
- },
1252
- formatUnixToDate: (n, r) => {
1253
- if (!n)
1254
- return "";
1255
- const a = r ? "yyyy-MM-dd HH:mm:ss" : "yyyy-MM-dd HH:mm:ss XX";
1256
- try {
1257
- const i = new Date(n * 1e3);
1258
- return et(i, a);
1259
- } catch {
1260
- return "";
1261
- }
1262
- }
1263
- };
1264
- }
1265
- function ut() {
1266
- return {
1267
- debounce: (e, n) => {
1268
- let r;
1269
- return (...a) => {
1270
- clearTimeout(r), r = window == null ? void 0 : window.setTimeout(() => {
1271
- e(...a);
1272
- }, n);
1273
- };
1274
- }
1275
- };
1276
- }
1277
- function st({ script: t, styles: e, onReady: n }) {
1278
- const r = T(!0), a = T(!0), i = async () => {
1279
- const { libName: o, url: d, type: f } = t;
1280
- if ((f !== void 0 && ["umd", "es"].includes(f) ? f : "umd") === "es") {
1281
- await import(
1282
- /* @vite-ignore */
1283
- d
1284
- ), typeof n == "function" && await n();
1285
- return;
1286
- }
1287
- const h = o.startsWith("kong-ui-") ? o : `kong-ui-${o}`;
1288
- return window[h] || (window[h] = await new Promise((w, m) => {
1289
- const l = document.createElement("script");
1290
- l.async = !0, l.addEventListener("load", async () => {
1291
- typeof n == "function" && await n(), r.value = !1, w(window[h]);
1292
- }), l.addEventListener("error", () => {
1293
- m(new Error(`Could not load '${h}' from ${d}`));
1294
- }), l.src = d, document.head.appendChild(l);
1295
- })), window[h];
1296
- }, c = async (o, d) => {
1297
- var f;
1298
- for (const g of o) {
1299
- const h = document.createElement("link");
1300
- h.type = "text/css", h.rel = "stylesheet", h.href = g;
1301
- const w = d ? document.querySelector(d) : null, m = d ? (f = w == null ? void 0 : w.shadowRoot) == null ? void 0 : f.children[0] : null;
1302
- if (w && m)
1303
- try {
1304
- m.appendChild(h);
1305
- } catch {
1306
- document.head.appendChild(h);
1307
- }
1308
- else
1309
- document.head.appendChild(h);
1310
- }
1311
- };
1312
- return {
1313
- importPackage: async () => {
1314
- var d, f;
1315
- if (!t || !t.url || typeof window > "u" || typeof document > "u") return;
1316
- const o = V(() => !!(e && (e != null && e.urls) && (e != null && e.urls.length) && e.shadowRoot));
1317
- 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)
1318
- return await i();
1319
- 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);
1320
- },
1321
- loadingPackage: Y(r),
1322
- loadingStyles: Y(a)
1323
- };
1324
- }
1325
- 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 || {});
1326
- const nt = (t) => {
1327
- var e, n, r, a, i;
1328
- return t ? !!// TODO: revisit: currently only the first check ever matters?
1329
- ((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;
1330
- };
1331
- function dt(t = T({}), e, n, r = nt) {
1332
- const a = T(
1333
- "PENDING"
1334
- /* PENDING */
1335
- );
1336
- return U(() => {
1337
- const i = r(t.value);
1338
- if (t.value && i && n.value) {
1339
- a.value = "VALIDATING_HAS_DATA";
1340
- return;
1341
- }
1342
- if (t.value && n.value) {
1343
- a.value = "VALIDATING";
1344
- return;
1345
- }
1346
- if (t.value && e.value) {
1347
- a.value = "STALE_IF_ERROR";
1348
- return;
1349
- }
1350
- if (t.value === void 0 && !e.value) {
1351
- a.value = "PENDING";
1352
- return;
1353
- }
1354
- if (t.value && !e.value && i) {
1355
- a.value = "SUCCESS_HAS_DATA";
1356
- return;
1357
- }
1358
- if (t.value && !e.value) {
1359
- a.value = "SUCCESS";
1360
- return;
1361
- }
1362
- t.value === void 0 && e && (a.value = "ERROR");
1363
- }), {
1364
- state: a,
1365
- swrvState: Q
1366
- };
1367
- }
1368
- const A = "khcp-user-table-preferences", rt = {
1369
- pageSize: 30,
1370
- sortColumnKey: void 0,
1371
- sortColumnOrder: void 0,
1372
- columnVisibility: {}
1373
- };
1374
- function ft() {
1375
- const t = (i) => {
1376
- if (typeof i == "string")
1377
- try {
1378
- return JSON.parse(i);
1379
- } catch (c) {
1380
- console.error("useTablePreferences(tryParseJson)", c);
1381
- return;
1382
- }
1383
- }, e = () => {
1384
- const i = t(localStorage.getItem(A));
1385
- return !i || !Object.keys(i).length ? /* @__PURE__ */ new Map() : new Map(Object.entries(i));
1386
- };
1387
- return {
1388
- setTablePreferences: (i, c) => {
1389
- try {
1390
- const u = e();
1391
- u.set(i, c), localStorage.setItem(A, JSON.stringify(Object.fromEntries(u.entries())));
1392
- } catch (u) {
1393
- console.error("useTablePreferences(setTablePreferences)", u);
1394
- }
1395
- },
1396
- getTablePreferences: (i, c) => {
1397
- const u = e();
1398
- return (u == null ? void 0 : u.get(i)) || void 0 || c || rt;
1399
- },
1400
- deleteAllTablePreferences: () => {
1401
- localStorage.removeItem(A);
1402
- }
1403
- };
1404
- }
1405
- function lt() {
1406
- const t = () => {
1407
- var o;
1408
- return ((o = window == null ? void 0 : window.location) == null ? void 0 : o.search) || "";
1409
- };
1410
- return {
1411
- getLocationSearch: t,
1412
- getLocationHostname: () => {
1413
- var o;
1414
- return ((o = window == null ? void 0 : window.location) == null ? void 0 : o.hostname) || "";
1415
- },
1416
- getLocationHref: () => {
1417
- var o;
1418
- return ((o = window == null ? void 0 : window.location) == null ? void 0 : o.href) || "";
1419
- },
1420
- getLocationPathname: () => {
1421
- var o;
1422
- return ((o = window == null ? void 0 : window.location) == null ? void 0 : o.pathname) || "";
1423
- },
1424
- getLocationOrigin: () => {
1425
- var o;
1426
- return ((o = window == null ? void 0 : window.location) == null ? void 0 : o.origin) || "";
1427
- },
1428
- getUrlSearchParams: () => new URLSearchParams(t()),
1429
- setLocationAssign: (o) => {
1430
- window.location.assign(o);
1431
- },
1432
- setLocationReplace: (o) => {
1433
- window.location.replace(o);
1434
- }
1435
- };
1436
- }
1437
- export {
1438
- rt as DEFAULT_USER_TABLE_PREFERENCES,
1439
- A as USER_TABLE_PREFERENCES_LOCAL_STORAGE_KEY,
1440
- ot as useAxios,
1441
- ct as useDate,
1442
- ut as useDebounce,
1443
- st as usePackage,
1444
- dt as useSwrvState,
1445
- ft as useTablePreferences,
1446
- lt as useWindow
1447
- };