@kong-ui-public/core 1.0.1-pr.615.98eb515.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.
@@ -0,0 +1,1898 @@
1
+ import { ref as q, readonly as ae, computed as fe, nextTick as ie, getCurrentInstance as ye, reactive as Te, onMounted as pe, onUnmounted as Ce, watch as De, isReadonly as Se, toRefs as Oe, watchEffect as Pe } from "vue";
2
+ function B(r) {
3
+ "@babel/helpers - typeof";
4
+ return B = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
5
+ return typeof e;
6
+ } : function(e) {
7
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
8
+ }, B(r);
9
+ }
10
+ function A(r) {
11
+ if (r === null || r === !0 || r === !1)
12
+ return NaN;
13
+ var e = Number(r);
14
+ return isNaN(e) ? e : e < 0 ? Math.ceil(e) : Math.floor(e);
15
+ }
16
+ function T(r, e) {
17
+ if (e.length < r)
18
+ throw new TypeError(r + " argument" + (r > 1 ? "s" : "") + " required, but only " + e.length + " present");
19
+ }
20
+ function P(r) {
21
+ T(1, arguments);
22
+ var e = Object.prototype.toString.call(r);
23
+ return r instanceof Date || B(r) === "object" && e === "[object Date]" ? new Date(r.getTime()) : typeof r == "number" || e === "[object Number]" ? new Date(r) : ((typeof r == "string" || e === "[object String]") && typeof console < "u" && (console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"), console.warn(new Error().stack)), /* @__PURE__ */ new Date(NaN));
24
+ }
25
+ function Ee(r, e) {
26
+ T(2, arguments);
27
+ var t = P(r).getTime(), n = A(e);
28
+ return new Date(t + n);
29
+ }
30
+ var Me = {};
31
+ function K() {
32
+ return Me;
33
+ }
34
+ function ke(r) {
35
+ var e = new Date(Date.UTC(r.getFullYear(), r.getMonth(), r.getDate(), r.getHours(), r.getMinutes(), r.getSeconds(), r.getMilliseconds()));
36
+ return e.setUTCFullYear(r.getFullYear()), r.getTime() - e.getTime();
37
+ }
38
+ function _e(r) {
39
+ return T(1, arguments), r instanceof Date || B(r) === "object" && Object.prototype.toString.call(r) === "[object Date]";
40
+ }
41
+ function xe(r) {
42
+ if (T(1, arguments), !_e(r) && typeof r != "number")
43
+ return !1;
44
+ var e = P(r);
45
+ return !isNaN(Number(e));
46
+ }
47
+ function We(r, e) {
48
+ T(2, arguments);
49
+ var t = A(e);
50
+ return Ee(r, -t);
51
+ }
52
+ var Re = 864e5;
53
+ function Ue(r) {
54
+ T(1, arguments);
55
+ var e = P(r), t = e.getTime();
56
+ e.setUTCMonth(0, 1), e.setUTCHours(0, 0, 0, 0);
57
+ var n = e.getTime(), a = t - n;
58
+ return Math.floor(a / Re) + 1;
59
+ }
60
+ function X(r) {
61
+ T(1, arguments);
62
+ var e = 1, t = P(r), n = t.getUTCDay(), a = (n < e ? 7 : 0) + n - e;
63
+ return t.setUTCDate(t.getUTCDate() - a), t.setUTCHours(0, 0, 0, 0), t;
64
+ }
65
+ function ve(r) {
66
+ T(1, arguments);
67
+ var e = P(r), t = e.getUTCFullYear(), n = /* @__PURE__ */ new Date(0);
68
+ n.setUTCFullYear(t + 1, 0, 4), n.setUTCHours(0, 0, 0, 0);
69
+ var a = X(n), i = /* @__PURE__ */ new Date(0);
70
+ i.setUTCFullYear(t, 0, 4), i.setUTCHours(0, 0, 0, 0);
71
+ var o = X(i);
72
+ return e.getTime() >= a.getTime() ? t + 1 : e.getTime() >= o.getTime() ? t : t - 1;
73
+ }
74
+ function Ae(r) {
75
+ T(1, arguments);
76
+ var e = ve(r), t = /* @__PURE__ */ new Date(0);
77
+ t.setUTCFullYear(e, 0, 4), t.setUTCHours(0, 0, 0, 0);
78
+ var n = X(t);
79
+ return n;
80
+ }
81
+ var Le = 6048e5;
82
+ function Ye(r) {
83
+ T(1, arguments);
84
+ var e = P(r), t = X(e).getTime() - Ae(e).getTime();
85
+ return Math.round(t / Le) + 1;
86
+ }
87
+ function Q(r, e) {
88
+ var t, n, a, i, o, s, l, u;
89
+ T(1, arguments);
90
+ var c = K(), v = A((t = (n = (a = (i = e == null ? void 0 : e.weekStartsOn) !== null && i !== void 0 ? i : e == null || (o = e.locale) === null || o === void 0 || (s = o.options) === null || s === void 0 ? void 0 : s.weekStartsOn) !== null && a !== void 0 ? a : c.weekStartsOn) !== null && n !== void 0 ? n : (l = c.locale) === null || l === void 0 || (u = l.options) === null || u === void 0 ? void 0 : u.weekStartsOn) !== null && t !== void 0 ? t : 0);
91
+ if (!(v >= 0 && v <= 6))
92
+ throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
93
+ var d = P(r), f = d.getUTCDay(), g = (f < v ? 7 : 0) + f - v;
94
+ return d.setUTCDate(d.getUTCDate() - g), d.setUTCHours(0, 0, 0, 0), d;
95
+ }
96
+ function he(r, e) {
97
+ var t, n, a, i, o, s, l, u;
98
+ T(1, arguments);
99
+ var c = P(r), v = c.getUTCFullYear(), d = K(), f = A((t = (n = (a = (i = e == null ? void 0 : e.firstWeekContainsDate) !== null && i !== void 0 ? i : e == null || (o = e.locale) === null || o === void 0 || (s = o.options) === null || s === void 0 ? void 0 : s.firstWeekContainsDate) !== null && a !== void 0 ? a : d.firstWeekContainsDate) !== null && n !== void 0 ? n : (l = d.locale) === null || l === void 0 || (u = l.options) === null || u === void 0 ? void 0 : u.firstWeekContainsDate) !== null && t !== void 0 ? t : 1);
100
+ if (!(f >= 1 && f <= 7))
101
+ throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
102
+ var g = /* @__PURE__ */ new Date(0);
103
+ g.setUTCFullYear(v + 1, 0, f), g.setUTCHours(0, 0, 0, 0);
104
+ var b = Q(g, e), p = /* @__PURE__ */ new Date(0);
105
+ p.setUTCFullYear(v, 0, f), p.setUTCHours(0, 0, 0, 0);
106
+ var W = Q(p, e);
107
+ return c.getTime() >= b.getTime() ? v + 1 : c.getTime() >= W.getTime() ? v : v - 1;
108
+ }
109
+ function Ne(r, e) {
110
+ var t, n, a, i, o, s, l, u;
111
+ T(1, arguments);
112
+ var c = K(), v = A((t = (n = (a = (i = e == null ? void 0 : e.firstWeekContainsDate) !== null && i !== void 0 ? i : e == null || (o = e.locale) === null || o === void 0 || (s = o.options) === null || s === void 0 ? void 0 : s.firstWeekContainsDate) !== null && a !== void 0 ? a : c.firstWeekContainsDate) !== null && n !== void 0 ? n : (l = c.locale) === null || l === void 0 || (u = l.options) === null || u === void 0 ? void 0 : u.firstWeekContainsDate) !== null && t !== void 0 ? t : 1), d = he(r, e), f = /* @__PURE__ */ new Date(0);
113
+ f.setUTCFullYear(d, 0, v), f.setUTCHours(0, 0, 0, 0);
114
+ var g = Q(f, e);
115
+ return g;
116
+ }
117
+ var Ie = 6048e5;
118
+ function Fe(r, e) {
119
+ T(1, arguments);
120
+ var t = P(r), n = Q(t, e).getTime() - Ne(t, e).getTime();
121
+ return Math.round(n / Ie) + 1;
122
+ }
123
+ function h(r, e) {
124
+ for (var t = r < 0 ? "-" : "", n = Math.abs(r).toString(); n.length < e; )
125
+ n = "0" + n;
126
+ return t + n;
127
+ }
128
+ var He = {
129
+ // Year
130
+ y: function(e, t) {
131
+ var n = e.getUTCFullYear(), a = n > 0 ? n : 1 - n;
132
+ return h(t === "yy" ? a % 100 : a, t.length);
133
+ },
134
+ // Month
135
+ M: function(e, t) {
136
+ var n = e.getUTCMonth();
137
+ return t === "M" ? String(n + 1) : h(n + 1, 2);
138
+ },
139
+ // Day of the month
140
+ d: function(e, t) {
141
+ return h(e.getUTCDate(), t.length);
142
+ },
143
+ // AM or PM
144
+ a: function(e, t) {
145
+ var n = e.getUTCHours() / 12 >= 1 ? "pm" : "am";
146
+ switch (t) {
147
+ case "a":
148
+ case "aa":
149
+ return n.toUpperCase();
150
+ case "aaa":
151
+ return n;
152
+ case "aaaaa":
153
+ return n[0];
154
+ case "aaaa":
155
+ default:
156
+ return n === "am" ? "a.m." : "p.m.";
157
+ }
158
+ },
159
+ // Hour [1-12]
160
+ h: function(e, t) {
161
+ return h(e.getUTCHours() % 12 || 12, t.length);
162
+ },
163
+ // Hour [0-23]
164
+ H: function(e, t) {
165
+ return h(e.getUTCHours(), t.length);
166
+ },
167
+ // Minute
168
+ m: function(e, t) {
169
+ return h(e.getUTCMinutes(), t.length);
170
+ },
171
+ // Second
172
+ s: function(e, t) {
173
+ return h(e.getUTCSeconds(), t.length);
174
+ },
175
+ // Fraction of second
176
+ S: function(e, t) {
177
+ var n = t.length, a = e.getUTCMilliseconds(), i = Math.floor(a * Math.pow(10, n - 3));
178
+ return h(i, t.length);
179
+ }
180
+ };
181
+ const x = He;
182
+ var N = {
183
+ am: "am",
184
+ pm: "pm",
185
+ midnight: "midnight",
186
+ noon: "noon",
187
+ morning: "morning",
188
+ afternoon: "afternoon",
189
+ evening: "evening",
190
+ night: "night"
191
+ }, $e = {
192
+ // Era
193
+ G: function(e, t, n) {
194
+ var a = e.getUTCFullYear() > 0 ? 1 : 0;
195
+ switch (t) {
196
+ case "G":
197
+ case "GG":
198
+ case "GGG":
199
+ return n.era(a, {
200
+ width: "abbreviated"
201
+ });
202
+ case "GGGGG":
203
+ return n.era(a, {
204
+ width: "narrow"
205
+ });
206
+ case "GGGG":
207
+ default:
208
+ return n.era(a, {
209
+ width: "wide"
210
+ });
211
+ }
212
+ },
213
+ // Year
214
+ y: function(e, t, n) {
215
+ if (t === "yo") {
216
+ var a = e.getUTCFullYear(), i = a > 0 ? a : 1 - a;
217
+ return n.ordinalNumber(i, {
218
+ unit: "year"
219
+ });
220
+ }
221
+ return x.y(e, t);
222
+ },
223
+ // Local week-numbering year
224
+ Y: function(e, t, n, a) {
225
+ var i = he(e, a), o = i > 0 ? i : 1 - i;
226
+ if (t === "YY") {
227
+ var s = o % 100;
228
+ return h(s, 2);
229
+ }
230
+ return t === "Yo" ? n.ordinalNumber(o, {
231
+ unit: "year"
232
+ }) : h(o, t.length);
233
+ },
234
+ // ISO week-numbering year
235
+ R: function(e, t) {
236
+ var n = ve(e);
237
+ return h(n, t.length);
238
+ },
239
+ // Extended year. This is a single number designating the year of this calendar system.
240
+ // The main difference between `y` and `u` localizers are B.C. years:
241
+ // | Year | `y` | `u` |
242
+ // |------|-----|-----|
243
+ // | AC 1 | 1 | 1 |
244
+ // | BC 1 | 1 | 0 |
245
+ // | BC 2 | 2 | -1 |
246
+ // Also `yy` always returns the last two digits of a year,
247
+ // while `uu` pads single digit years to 2 characters and returns other years unchanged.
248
+ u: function(e, t) {
249
+ var n = e.getUTCFullYear();
250
+ return h(n, t.length);
251
+ },
252
+ // Quarter
253
+ Q: function(e, t, n) {
254
+ var a = Math.ceil((e.getUTCMonth() + 1) / 3);
255
+ switch (t) {
256
+ case "Q":
257
+ return String(a);
258
+ case "QQ":
259
+ return h(a, 2);
260
+ case "Qo":
261
+ return n.ordinalNumber(a, {
262
+ unit: "quarter"
263
+ });
264
+ case "QQQ":
265
+ return n.quarter(a, {
266
+ width: "abbreviated",
267
+ context: "formatting"
268
+ });
269
+ case "QQQQQ":
270
+ return n.quarter(a, {
271
+ width: "narrow",
272
+ context: "formatting"
273
+ });
274
+ case "QQQQ":
275
+ default:
276
+ return n.quarter(a, {
277
+ width: "wide",
278
+ context: "formatting"
279
+ });
280
+ }
281
+ },
282
+ // Stand-alone quarter
283
+ q: function(e, t, n) {
284
+ var a = Math.ceil((e.getUTCMonth() + 1) / 3);
285
+ switch (t) {
286
+ case "q":
287
+ return String(a);
288
+ case "qq":
289
+ return h(a, 2);
290
+ case "qo":
291
+ return n.ordinalNumber(a, {
292
+ unit: "quarter"
293
+ });
294
+ case "qqq":
295
+ return n.quarter(a, {
296
+ width: "abbreviated",
297
+ context: "standalone"
298
+ });
299
+ case "qqqqq":
300
+ return n.quarter(a, {
301
+ width: "narrow",
302
+ context: "standalone"
303
+ });
304
+ case "qqqq":
305
+ default:
306
+ return n.quarter(a, {
307
+ width: "wide",
308
+ context: "standalone"
309
+ });
310
+ }
311
+ },
312
+ // Month
313
+ M: function(e, t, n) {
314
+ var a = e.getUTCMonth();
315
+ switch (t) {
316
+ case "M":
317
+ case "MM":
318
+ return x.M(e, t);
319
+ case "Mo":
320
+ return n.ordinalNumber(a + 1, {
321
+ unit: "month"
322
+ });
323
+ case "MMM":
324
+ return n.month(a, {
325
+ width: "abbreviated",
326
+ context: "formatting"
327
+ });
328
+ case "MMMMM":
329
+ return n.month(a, {
330
+ width: "narrow",
331
+ context: "formatting"
332
+ });
333
+ case "MMMM":
334
+ default:
335
+ return n.month(a, {
336
+ width: "wide",
337
+ context: "formatting"
338
+ });
339
+ }
340
+ },
341
+ // Stand-alone month
342
+ L: function(e, t, n) {
343
+ var a = e.getUTCMonth();
344
+ switch (t) {
345
+ case "L":
346
+ return String(a + 1);
347
+ case "LL":
348
+ return h(a + 1, 2);
349
+ case "Lo":
350
+ return n.ordinalNumber(a + 1, {
351
+ unit: "month"
352
+ });
353
+ case "LLL":
354
+ return n.month(a, {
355
+ width: "abbreviated",
356
+ context: "standalone"
357
+ });
358
+ case "LLLLL":
359
+ return n.month(a, {
360
+ width: "narrow",
361
+ context: "standalone"
362
+ });
363
+ case "LLLL":
364
+ default:
365
+ return n.month(a, {
366
+ width: "wide",
367
+ context: "standalone"
368
+ });
369
+ }
370
+ },
371
+ // Local week of year
372
+ w: function(e, t, n, a) {
373
+ var i = Fe(e, a);
374
+ return t === "wo" ? n.ordinalNumber(i, {
375
+ unit: "week"
376
+ }) : h(i, t.length);
377
+ },
378
+ // ISO week of year
379
+ I: function(e, t, n) {
380
+ var a = Ye(e);
381
+ return t === "Io" ? n.ordinalNumber(a, {
382
+ unit: "week"
383
+ }) : h(a, t.length);
384
+ },
385
+ // Day of the month
386
+ d: function(e, t, n) {
387
+ return t === "do" ? n.ordinalNumber(e.getUTCDate(), {
388
+ unit: "date"
389
+ }) : x.d(e, t);
390
+ },
391
+ // Day of year
392
+ D: function(e, t, n) {
393
+ var a = Ue(e);
394
+ return t === "Do" ? n.ordinalNumber(a, {
395
+ unit: "dayOfYear"
396
+ }) : h(a, t.length);
397
+ },
398
+ // Day of week
399
+ E: function(e, t, n) {
400
+ var a = e.getUTCDay();
401
+ switch (t) {
402
+ case "E":
403
+ case "EE":
404
+ case "EEE":
405
+ return n.day(a, {
406
+ width: "abbreviated",
407
+ context: "formatting"
408
+ });
409
+ case "EEEEE":
410
+ return n.day(a, {
411
+ width: "narrow",
412
+ context: "formatting"
413
+ });
414
+ case "EEEEEE":
415
+ return n.day(a, {
416
+ width: "short",
417
+ context: "formatting"
418
+ });
419
+ case "EEEE":
420
+ default:
421
+ return n.day(a, {
422
+ width: "wide",
423
+ context: "formatting"
424
+ });
425
+ }
426
+ },
427
+ // Local day of week
428
+ e: function(e, t, n, a) {
429
+ var i = e.getUTCDay(), o = (i - a.weekStartsOn + 8) % 7 || 7;
430
+ switch (t) {
431
+ case "e":
432
+ return String(o);
433
+ case "ee":
434
+ return h(o, 2);
435
+ case "eo":
436
+ return n.ordinalNumber(o, {
437
+ unit: "day"
438
+ });
439
+ case "eee":
440
+ return n.day(i, {
441
+ width: "abbreviated",
442
+ context: "formatting"
443
+ });
444
+ case "eeeee":
445
+ return n.day(i, {
446
+ width: "narrow",
447
+ context: "formatting"
448
+ });
449
+ case "eeeeee":
450
+ return n.day(i, {
451
+ width: "short",
452
+ context: "formatting"
453
+ });
454
+ case "eeee":
455
+ default:
456
+ return n.day(i, {
457
+ width: "wide",
458
+ context: "formatting"
459
+ });
460
+ }
461
+ },
462
+ // Stand-alone local day of week
463
+ c: function(e, t, n, a) {
464
+ var i = e.getUTCDay(), o = (i - a.weekStartsOn + 8) % 7 || 7;
465
+ switch (t) {
466
+ case "c":
467
+ return String(o);
468
+ case "cc":
469
+ return h(o, t.length);
470
+ case "co":
471
+ return n.ordinalNumber(o, {
472
+ unit: "day"
473
+ });
474
+ case "ccc":
475
+ return n.day(i, {
476
+ width: "abbreviated",
477
+ context: "standalone"
478
+ });
479
+ case "ccccc":
480
+ return n.day(i, {
481
+ width: "narrow",
482
+ context: "standalone"
483
+ });
484
+ case "cccccc":
485
+ return n.day(i, {
486
+ width: "short",
487
+ context: "standalone"
488
+ });
489
+ case "cccc":
490
+ default:
491
+ return n.day(i, {
492
+ width: "wide",
493
+ context: "standalone"
494
+ });
495
+ }
496
+ },
497
+ // ISO day of week
498
+ i: function(e, t, n) {
499
+ var a = e.getUTCDay(), i = a === 0 ? 7 : a;
500
+ switch (t) {
501
+ case "i":
502
+ return String(i);
503
+ case "ii":
504
+ return h(i, t.length);
505
+ case "io":
506
+ return n.ordinalNumber(i, {
507
+ unit: "day"
508
+ });
509
+ case "iii":
510
+ return n.day(a, {
511
+ width: "abbreviated",
512
+ context: "formatting"
513
+ });
514
+ case "iiiii":
515
+ return n.day(a, {
516
+ width: "narrow",
517
+ context: "formatting"
518
+ });
519
+ case "iiiiii":
520
+ return n.day(a, {
521
+ width: "short",
522
+ context: "formatting"
523
+ });
524
+ case "iiii":
525
+ default:
526
+ return n.day(a, {
527
+ width: "wide",
528
+ context: "formatting"
529
+ });
530
+ }
531
+ },
532
+ // AM or PM
533
+ a: function(e, t, n) {
534
+ var a = e.getUTCHours(), i = a / 12 >= 1 ? "pm" : "am";
535
+ switch (t) {
536
+ case "a":
537
+ case "aa":
538
+ return n.dayPeriod(i, {
539
+ width: "abbreviated",
540
+ context: "formatting"
541
+ });
542
+ case "aaa":
543
+ return n.dayPeriod(i, {
544
+ width: "abbreviated",
545
+ context: "formatting"
546
+ }).toLowerCase();
547
+ case "aaaaa":
548
+ return n.dayPeriod(i, {
549
+ width: "narrow",
550
+ context: "formatting"
551
+ });
552
+ case "aaaa":
553
+ default:
554
+ return n.dayPeriod(i, {
555
+ width: "wide",
556
+ context: "formatting"
557
+ });
558
+ }
559
+ },
560
+ // AM, PM, midnight, noon
561
+ b: function(e, t, n) {
562
+ var a = e.getUTCHours(), i;
563
+ switch (a === 12 ? i = N.noon : a === 0 ? i = N.midnight : i = a / 12 >= 1 ? "pm" : "am", t) {
564
+ case "b":
565
+ case "bb":
566
+ return n.dayPeriod(i, {
567
+ width: "abbreviated",
568
+ context: "formatting"
569
+ });
570
+ case "bbb":
571
+ return n.dayPeriod(i, {
572
+ width: "abbreviated",
573
+ context: "formatting"
574
+ }).toLowerCase();
575
+ case "bbbbb":
576
+ return n.dayPeriod(i, {
577
+ width: "narrow",
578
+ context: "formatting"
579
+ });
580
+ case "bbbb":
581
+ default:
582
+ return n.dayPeriod(i, {
583
+ width: "wide",
584
+ context: "formatting"
585
+ });
586
+ }
587
+ },
588
+ // in the morning, in the afternoon, in the evening, at night
589
+ B: function(e, t, n) {
590
+ var a = e.getUTCHours(), i;
591
+ switch (a >= 17 ? i = N.evening : a >= 12 ? i = N.afternoon : a >= 4 ? i = N.morning : i = N.night, t) {
592
+ case "B":
593
+ case "BB":
594
+ case "BBB":
595
+ return n.dayPeriod(i, {
596
+ width: "abbreviated",
597
+ context: "formatting"
598
+ });
599
+ case "BBBBB":
600
+ return n.dayPeriod(i, {
601
+ width: "narrow",
602
+ context: "formatting"
603
+ });
604
+ case "BBBB":
605
+ default:
606
+ return n.dayPeriod(i, {
607
+ width: "wide",
608
+ context: "formatting"
609
+ });
610
+ }
611
+ },
612
+ // Hour [1-12]
613
+ h: function(e, t, n) {
614
+ if (t === "ho") {
615
+ var a = e.getUTCHours() % 12;
616
+ return a === 0 && (a = 12), n.ordinalNumber(a, {
617
+ unit: "hour"
618
+ });
619
+ }
620
+ return x.h(e, t);
621
+ },
622
+ // Hour [0-23]
623
+ H: function(e, t, n) {
624
+ return t === "Ho" ? n.ordinalNumber(e.getUTCHours(), {
625
+ unit: "hour"
626
+ }) : x.H(e, t);
627
+ },
628
+ // Hour [0-11]
629
+ K: function(e, t, n) {
630
+ var a = e.getUTCHours() % 12;
631
+ return t === "Ko" ? n.ordinalNumber(a, {
632
+ unit: "hour"
633
+ }) : h(a, t.length);
634
+ },
635
+ // Hour [1-24]
636
+ k: function(e, t, n) {
637
+ var a = e.getUTCHours();
638
+ return a === 0 && (a = 24), t === "ko" ? n.ordinalNumber(a, {
639
+ unit: "hour"
640
+ }) : h(a, t.length);
641
+ },
642
+ // Minute
643
+ m: function(e, t, n) {
644
+ return t === "mo" ? n.ordinalNumber(e.getUTCMinutes(), {
645
+ unit: "minute"
646
+ }) : x.m(e, t);
647
+ },
648
+ // Second
649
+ s: function(e, t, n) {
650
+ return t === "so" ? n.ordinalNumber(e.getUTCSeconds(), {
651
+ unit: "second"
652
+ }) : x.s(e, t);
653
+ },
654
+ // Fraction of second
655
+ S: function(e, t) {
656
+ return x.S(e, t);
657
+ },
658
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
659
+ X: function(e, t, n, a) {
660
+ var i = a._originalDate || e, o = i.getTimezoneOffset();
661
+ if (o === 0)
662
+ return "Z";
663
+ switch (t) {
664
+ case "X":
665
+ return ue(o);
666
+ case "XXXX":
667
+ case "XX":
668
+ return U(o);
669
+ case "XXXXX":
670
+ case "XXX":
671
+ default:
672
+ return U(o, ":");
673
+ }
674
+ },
675
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
676
+ x: function(e, t, n, a) {
677
+ var i = a._originalDate || e, o = i.getTimezoneOffset();
678
+ switch (t) {
679
+ case "x":
680
+ return ue(o);
681
+ case "xxxx":
682
+ case "xx":
683
+ return U(o);
684
+ case "xxxxx":
685
+ case "xxx":
686
+ default:
687
+ return U(o, ":");
688
+ }
689
+ },
690
+ // Timezone (GMT)
691
+ O: function(e, t, n, a) {
692
+ var i = a._originalDate || e, o = i.getTimezoneOffset();
693
+ switch (t) {
694
+ case "O":
695
+ case "OO":
696
+ case "OOO":
697
+ return "GMT" + oe(o, ":");
698
+ case "OOOO":
699
+ default:
700
+ return "GMT" + U(o, ":");
701
+ }
702
+ },
703
+ // Timezone (specific non-location)
704
+ z: function(e, t, n, a) {
705
+ var i = a._originalDate || e, o = i.getTimezoneOffset();
706
+ switch (t) {
707
+ case "z":
708
+ case "zz":
709
+ case "zzz":
710
+ return "GMT" + oe(o, ":");
711
+ case "zzzz":
712
+ default:
713
+ return "GMT" + U(o, ":");
714
+ }
715
+ },
716
+ // Seconds timestamp
717
+ t: function(e, t, n, a) {
718
+ var i = a._originalDate || e, o = Math.floor(i.getTime() / 1e3);
719
+ return h(o, t.length);
720
+ },
721
+ // Milliseconds timestamp
722
+ T: function(e, t, n, a) {
723
+ var i = a._originalDate || e, o = i.getTime();
724
+ return h(o, t.length);
725
+ }
726
+ };
727
+ function oe(r, e) {
728
+ var t = r > 0 ? "-" : "+", n = Math.abs(r), a = Math.floor(n / 60), i = n % 60;
729
+ if (i === 0)
730
+ return t + String(a);
731
+ var o = e || "";
732
+ return t + String(a) + o + h(i, 2);
733
+ }
734
+ function ue(r, e) {
735
+ if (r % 60 === 0) {
736
+ var t = r > 0 ? "-" : "+";
737
+ return t + h(Math.abs(r) / 60, 2);
738
+ }
739
+ return U(r, e);
740
+ }
741
+ function U(r, e) {
742
+ var t = e || "", n = r > 0 ? "-" : "+", a = Math.abs(r), i = h(Math.floor(a / 60), 2), o = h(a % 60, 2);
743
+ return n + i + t + o;
744
+ }
745
+ const Ve = $e;
746
+ var le = function(e, t) {
747
+ switch (e) {
748
+ case "P":
749
+ return t.date({
750
+ width: "short"
751
+ });
752
+ case "PP":
753
+ return t.date({
754
+ width: "medium"
755
+ });
756
+ case "PPP":
757
+ return t.date({
758
+ width: "long"
759
+ });
760
+ case "PPPP":
761
+ default:
762
+ return t.date({
763
+ width: "full"
764
+ });
765
+ }
766
+ }, me = function(e, t) {
767
+ switch (e) {
768
+ case "p":
769
+ return t.time({
770
+ width: "short"
771
+ });
772
+ case "pp":
773
+ return t.time({
774
+ width: "medium"
775
+ });
776
+ case "ppp":
777
+ return t.time({
778
+ width: "long"
779
+ });
780
+ case "pppp":
781
+ default:
782
+ return t.time({
783
+ width: "full"
784
+ });
785
+ }
786
+ }, qe = function(e, t) {
787
+ var n = e.match(/(P+)(p+)?/) || [], a = n[1], i = n[2];
788
+ if (!i)
789
+ return le(e, t);
790
+ var o;
791
+ switch (a) {
792
+ case "P":
793
+ o = t.dateTime({
794
+ width: "short"
795
+ });
796
+ break;
797
+ case "PP":
798
+ o = t.dateTime({
799
+ width: "medium"
800
+ });
801
+ break;
802
+ case "PPP":
803
+ o = t.dateTime({
804
+ width: "long"
805
+ });
806
+ break;
807
+ case "PPPP":
808
+ default:
809
+ o = t.dateTime({
810
+ width: "full"
811
+ });
812
+ break;
813
+ }
814
+ return o.replace("{{date}}", le(a, t)).replace("{{time}}", me(i, t));
815
+ }, Ge = {
816
+ p: me,
817
+ P: qe
818
+ };
819
+ const je = Ge;
820
+ var Be = ["D", "DD"], Xe = ["YY", "YYYY"];
821
+ function Qe(r) {
822
+ return Be.indexOf(r) !== -1;
823
+ }
824
+ function Je(r) {
825
+ return Xe.indexOf(r) !== -1;
826
+ }
827
+ function se(r, e, t) {
828
+ if (r === "YYYY")
829
+ throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e, "`) for formatting years to the input `").concat(t, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
830
+ if (r === "YY")
831
+ throw new RangeError("Use `yy` instead of `YY` (in `".concat(e, "`) for formatting years to the input `").concat(t, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
832
+ if (r === "D")
833
+ throw new RangeError("Use `d` instead of `D` (in `".concat(e, "`) for formatting days of the month to the input `").concat(t, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
834
+ if (r === "DD")
835
+ throw new RangeError("Use `dd` instead of `DD` (in `".concat(e, "`) for formatting days of the month to the input `").concat(t, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
836
+ }
837
+ var Ke = {
838
+ lessThanXSeconds: {
839
+ one: "less than a second",
840
+ other: "less than {{count}} seconds"
841
+ },
842
+ xSeconds: {
843
+ one: "1 second",
844
+ other: "{{count}} seconds"
845
+ },
846
+ halfAMinute: "half a minute",
847
+ lessThanXMinutes: {
848
+ one: "less than a minute",
849
+ other: "less than {{count}} minutes"
850
+ },
851
+ xMinutes: {
852
+ one: "1 minute",
853
+ other: "{{count}} minutes"
854
+ },
855
+ aboutXHours: {
856
+ one: "about 1 hour",
857
+ other: "about {{count}} hours"
858
+ },
859
+ xHours: {
860
+ one: "1 hour",
861
+ other: "{{count}} hours"
862
+ },
863
+ xDays: {
864
+ one: "1 day",
865
+ other: "{{count}} days"
866
+ },
867
+ aboutXWeeks: {
868
+ one: "about 1 week",
869
+ other: "about {{count}} weeks"
870
+ },
871
+ xWeeks: {
872
+ one: "1 week",
873
+ other: "{{count}} weeks"
874
+ },
875
+ aboutXMonths: {
876
+ one: "about 1 month",
877
+ other: "about {{count}} months"
878
+ },
879
+ xMonths: {
880
+ one: "1 month",
881
+ other: "{{count}} months"
882
+ },
883
+ aboutXYears: {
884
+ one: "about 1 year",
885
+ other: "about {{count}} years"
886
+ },
887
+ xYears: {
888
+ one: "1 year",
889
+ other: "{{count}} years"
890
+ },
891
+ overXYears: {
892
+ one: "over 1 year",
893
+ other: "over {{count}} years"
894
+ },
895
+ almostXYears: {
896
+ one: "almost 1 year",
897
+ other: "almost {{count}} years"
898
+ }
899
+ }, ze = function(e, t, n) {
900
+ var a, i = Ke[e];
901
+ return typeof i == "string" ? a = i : t === 1 ? a = i.one : a = i.other.replace("{{count}}", t.toString()), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "in " + a : a + " ago" : a;
902
+ };
903
+ const Ze = ze;
904
+ function z(r) {
905
+ return function() {
906
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.width ? String(e.width) : r.defaultWidth, n = r.formats[t] || r.formats[r.defaultWidth];
907
+ return n;
908
+ };
909
+ }
910
+ var et = {
911
+ full: "EEEE, MMMM do, y",
912
+ long: "MMMM do, y",
913
+ medium: "MMM d, y",
914
+ short: "MM/dd/yyyy"
915
+ }, tt = {
916
+ full: "h:mm:ss a zzzz",
917
+ long: "h:mm:ss a z",
918
+ medium: "h:mm:ss a",
919
+ short: "h:mm a"
920
+ }, rt = {
921
+ full: "{{date}} 'at' {{time}}",
922
+ long: "{{date}} 'at' {{time}}",
923
+ medium: "{{date}}, {{time}}",
924
+ short: "{{date}}, {{time}}"
925
+ }, nt = {
926
+ date: z({
927
+ formats: et,
928
+ defaultWidth: "full"
929
+ }),
930
+ time: z({
931
+ formats: tt,
932
+ defaultWidth: "full"
933
+ }),
934
+ dateTime: z({
935
+ formats: rt,
936
+ defaultWidth: "full"
937
+ })
938
+ };
939
+ const at = nt;
940
+ var it = {
941
+ lastWeek: "'last' eeee 'at' p",
942
+ yesterday: "'yesterday at' p",
943
+ today: "'today at' p",
944
+ tomorrow: "'tomorrow at' p",
945
+ nextWeek: "eeee 'at' p",
946
+ other: "P"
947
+ }, ot = function(e, t, n, a) {
948
+ return it[e];
949
+ };
950
+ const ut = ot;
951
+ function $(r) {
952
+ return function(e, t) {
953
+ var n = t != null && t.context ? String(t.context) : "standalone", a;
954
+ if (n === "formatting" && r.formattingValues) {
955
+ var i = r.defaultFormattingWidth || r.defaultWidth, o = t != null && t.width ? String(t.width) : i;
956
+ a = r.formattingValues[o] || r.formattingValues[i];
957
+ } else {
958
+ var s = r.defaultWidth, l = t != null && t.width ? String(t.width) : r.defaultWidth;
959
+ a = r.values[l] || r.values[s];
960
+ }
961
+ var u = r.argumentCallback ? r.argumentCallback(e) : e;
962
+ return a[u];
963
+ };
964
+ }
965
+ var lt = {
966
+ narrow: ["B", "A"],
967
+ abbreviated: ["BC", "AD"],
968
+ wide: ["Before Christ", "Anno Domini"]
969
+ }, st = {
970
+ narrow: ["1", "2", "3", "4"],
971
+ abbreviated: ["Q1", "Q2", "Q3", "Q4"],
972
+ wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
973
+ }, ct = {
974
+ narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
975
+ abbreviated: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
976
+ wide: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
977
+ }, dt = {
978
+ narrow: ["S", "M", "T", "W", "T", "F", "S"],
979
+ short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
980
+ abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
981
+ wide: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
982
+ }, ft = {
983
+ narrow: {
984
+ am: "a",
985
+ pm: "p",
986
+ midnight: "mi",
987
+ noon: "n",
988
+ morning: "morning",
989
+ afternoon: "afternoon",
990
+ evening: "evening",
991
+ night: "night"
992
+ },
993
+ abbreviated: {
994
+ am: "AM",
995
+ pm: "PM",
996
+ midnight: "midnight",
997
+ noon: "noon",
998
+ morning: "morning",
999
+ afternoon: "afternoon",
1000
+ evening: "evening",
1001
+ night: "night"
1002
+ },
1003
+ wide: {
1004
+ am: "a.m.",
1005
+ pm: "p.m.",
1006
+ midnight: "midnight",
1007
+ noon: "noon",
1008
+ morning: "morning",
1009
+ afternoon: "afternoon",
1010
+ evening: "evening",
1011
+ night: "night"
1012
+ }
1013
+ }, vt = {
1014
+ narrow: {
1015
+ am: "a",
1016
+ pm: "p",
1017
+ midnight: "mi",
1018
+ noon: "n",
1019
+ morning: "in the morning",
1020
+ afternoon: "in the afternoon",
1021
+ evening: "in the evening",
1022
+ night: "at night"
1023
+ },
1024
+ abbreviated: {
1025
+ am: "AM",
1026
+ pm: "PM",
1027
+ midnight: "midnight",
1028
+ noon: "noon",
1029
+ morning: "in the morning",
1030
+ afternoon: "in the afternoon",
1031
+ evening: "in the evening",
1032
+ night: "at night"
1033
+ },
1034
+ wide: {
1035
+ am: "a.m.",
1036
+ pm: "p.m.",
1037
+ midnight: "midnight",
1038
+ noon: "noon",
1039
+ morning: "in the morning",
1040
+ afternoon: "in the afternoon",
1041
+ evening: "in the evening",
1042
+ night: "at night"
1043
+ }
1044
+ }, ht = function(e, t) {
1045
+ var n = Number(e), a = n % 100;
1046
+ if (a > 20 || a < 10)
1047
+ switch (a % 10) {
1048
+ case 1:
1049
+ return n + "st";
1050
+ case 2:
1051
+ return n + "nd";
1052
+ case 3:
1053
+ return n + "rd";
1054
+ }
1055
+ return n + "th";
1056
+ }, mt = {
1057
+ ordinalNumber: ht,
1058
+ era: $({
1059
+ values: lt,
1060
+ defaultWidth: "wide"
1061
+ }),
1062
+ quarter: $({
1063
+ values: st,
1064
+ defaultWidth: "wide",
1065
+ argumentCallback: function(e) {
1066
+ return e - 1;
1067
+ }
1068
+ }),
1069
+ month: $({
1070
+ values: ct,
1071
+ defaultWidth: "wide"
1072
+ }),
1073
+ day: $({
1074
+ values: dt,
1075
+ defaultWidth: "wide"
1076
+ }),
1077
+ dayPeriod: $({
1078
+ values: ft,
1079
+ defaultWidth: "wide",
1080
+ formattingValues: vt,
1081
+ defaultFormattingWidth: "wide"
1082
+ })
1083
+ };
1084
+ const gt = mt;
1085
+ function V(r) {
1086
+ return function(e) {
1087
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.width, a = n && r.matchPatterns[n] || r.matchPatterns[r.defaultMatchWidth], i = e.match(a);
1088
+ if (!i)
1089
+ return null;
1090
+ var o = i[0], s = n && r.parsePatterns[n] || r.parsePatterns[r.defaultParseWidth], l = Array.isArray(s) ? bt(s, function(v) {
1091
+ return v.test(o);
1092
+ }) : wt(s, function(v) {
1093
+ return v.test(o);
1094
+ }), u;
1095
+ u = r.valueCallback ? r.valueCallback(l) : l, u = t.valueCallback ? t.valueCallback(u) : u;
1096
+ var c = e.slice(o.length);
1097
+ return {
1098
+ value: u,
1099
+ rest: c
1100
+ };
1101
+ };
1102
+ }
1103
+ function wt(r, e) {
1104
+ for (var t in r)
1105
+ if (r.hasOwnProperty(t) && e(r[t]))
1106
+ return t;
1107
+ }
1108
+ function bt(r, e) {
1109
+ for (var t = 0; t < r.length; t++)
1110
+ if (e(r[t]))
1111
+ return t;
1112
+ }
1113
+ function yt(r) {
1114
+ return function(e) {
1115
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = e.match(r.matchPattern);
1116
+ if (!n)
1117
+ return null;
1118
+ var a = n[0], i = e.match(r.parsePattern);
1119
+ if (!i)
1120
+ return null;
1121
+ var o = r.valueCallback ? r.valueCallback(i[0]) : i[0];
1122
+ o = t.valueCallback ? t.valueCallback(o) : o;
1123
+ var s = e.slice(a.length);
1124
+ return {
1125
+ value: o,
1126
+ rest: s
1127
+ };
1128
+ };
1129
+ }
1130
+ var Tt = /^(\d+)(th|st|nd|rd)?/i, pt = /\d+/i, Ct = {
1131
+ narrow: /^(b|a)/i,
1132
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
1133
+ wide: /^(before christ|before common era|anno domini|common era)/i
1134
+ }, Dt = {
1135
+ any: [/^b/i, /^(a|c)/i]
1136
+ }, St = {
1137
+ narrow: /^[1234]/i,
1138
+ abbreviated: /^q[1234]/i,
1139
+ wide: /^[1234](th|st|nd|rd)? quarter/i
1140
+ }, Ot = {
1141
+ any: [/1/i, /2/i, /3/i, /4/i]
1142
+ }, Pt = {
1143
+ narrow: /^[jfmasond]/i,
1144
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
1145
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
1146
+ }, Et = {
1147
+ narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
1148
+ any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
1149
+ }, Mt = {
1150
+ narrow: /^[smtwf]/i,
1151
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
1152
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
1153
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
1154
+ }, kt = {
1155
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
1156
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
1157
+ }, _t = {
1158
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
1159
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
1160
+ }, xt = {
1161
+ any: {
1162
+ am: /^a/i,
1163
+ pm: /^p/i,
1164
+ midnight: /^mi/i,
1165
+ noon: /^no/i,
1166
+ morning: /morning/i,
1167
+ afternoon: /afternoon/i,
1168
+ evening: /evening/i,
1169
+ night: /night/i
1170
+ }
1171
+ }, Wt = {
1172
+ ordinalNumber: yt({
1173
+ matchPattern: Tt,
1174
+ parsePattern: pt,
1175
+ valueCallback: function(e) {
1176
+ return parseInt(e, 10);
1177
+ }
1178
+ }),
1179
+ era: V({
1180
+ matchPatterns: Ct,
1181
+ defaultMatchWidth: "wide",
1182
+ parsePatterns: Dt,
1183
+ defaultParseWidth: "any"
1184
+ }),
1185
+ quarter: V({
1186
+ matchPatterns: St,
1187
+ defaultMatchWidth: "wide",
1188
+ parsePatterns: Ot,
1189
+ defaultParseWidth: "any",
1190
+ valueCallback: function(e) {
1191
+ return e + 1;
1192
+ }
1193
+ }),
1194
+ month: V({
1195
+ matchPatterns: Pt,
1196
+ defaultMatchWidth: "wide",
1197
+ parsePatterns: Et,
1198
+ defaultParseWidth: "any"
1199
+ }),
1200
+ day: V({
1201
+ matchPatterns: Mt,
1202
+ defaultMatchWidth: "wide",
1203
+ parsePatterns: kt,
1204
+ defaultParseWidth: "any"
1205
+ }),
1206
+ dayPeriod: V({
1207
+ matchPatterns: _t,
1208
+ defaultMatchWidth: "any",
1209
+ parsePatterns: xt,
1210
+ defaultParseWidth: "any"
1211
+ })
1212
+ };
1213
+ const Rt = Wt;
1214
+ var Ut = {
1215
+ code: "en-US",
1216
+ formatDistance: Ze,
1217
+ formatLong: at,
1218
+ formatRelative: ut,
1219
+ localize: gt,
1220
+ match: Rt,
1221
+ options: {
1222
+ weekStartsOn: 0,
1223
+ firstWeekContainsDate: 1
1224
+ }
1225
+ };
1226
+ const At = Ut;
1227
+ var Lt = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Yt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Nt = /^'([^]*?)'?$/, It = /''/g, Ft = /[a-zA-Z]/;
1228
+ function Ht(r, e, t) {
1229
+ var n, a, i, o, s, l, u, c, v, d, f, g, b, p, W, w, m, L;
1230
+ T(2, arguments);
1231
+ var C = String(e), D = K(), S = (n = (a = t == null ? void 0 : t.locale) !== null && a !== void 0 ? a : D.locale) !== null && n !== void 0 ? n : At, R = A((i = (o = (s = (l = t == null ? void 0 : t.firstWeekContainsDate) !== null && l !== void 0 ? l : t == null || (u = t.locale) === null || u === void 0 || (c = u.options) === null || c === void 0 ? void 0 : c.firstWeekContainsDate) !== null && s !== void 0 ? s : D.firstWeekContainsDate) !== null && o !== void 0 ? o : (v = D.locale) === null || v === void 0 || (d = v.options) === null || d === void 0 ? void 0 : d.firstWeekContainsDate) !== null && i !== void 0 ? i : 1);
1232
+ if (!(R >= 1 && R <= 7))
1233
+ throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
1234
+ var Y = A((f = (g = (b = (p = t == null ? void 0 : t.weekStartsOn) !== null && p !== void 0 ? p : t == null || (W = t.locale) === null || W === void 0 || (w = W.options) === null || w === void 0 ? void 0 : w.weekStartsOn) !== null && b !== void 0 ? b : D.weekStartsOn) !== null && g !== void 0 ? g : (m = D.locale) === null || m === void 0 || (L = m.options) === null || L === void 0 ? void 0 : L.weekStartsOn) !== null && f !== void 0 ? f : 0);
1235
+ if (!(Y >= 0 && Y <= 6))
1236
+ throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
1237
+ if (!S.localize)
1238
+ throw new RangeError("locale must contain localize property");
1239
+ if (!S.formatLong)
1240
+ throw new RangeError("locale must contain formatLong property");
1241
+ var _ = P(r);
1242
+ if (!xe(_))
1243
+ throw new RangeError("Invalid time value");
1244
+ var G = ke(_), H = We(_, G), E = {
1245
+ firstWeekContainsDate: R,
1246
+ weekStartsOn: Y,
1247
+ locale: S,
1248
+ _originalDate: _
1249
+ }, j = C.match(Yt).map(function(y) {
1250
+ var O = y[0];
1251
+ if (O === "p" || O === "P") {
1252
+ var M = je[O];
1253
+ return M(y, S.formatLong);
1254
+ }
1255
+ return y;
1256
+ }).join("").match(Lt).map(function(y) {
1257
+ if (y === "''")
1258
+ return "'";
1259
+ var O = y[0];
1260
+ if (O === "'")
1261
+ return $t(y);
1262
+ var M = Ve[O];
1263
+ if (M)
1264
+ return !(t != null && t.useAdditionalWeekYearTokens) && Je(y) && se(y, e, String(r)), !(t != null && t.useAdditionalDayOfYearTokens) && Qe(y) && se(y, e, String(r)), M(H, y, S.localize, E);
1265
+ if (O.match(Ft))
1266
+ throw new RangeError("Format string contains an unescaped latin alphabet character `" + O + "`");
1267
+ return y;
1268
+ }).join("");
1269
+ return j;
1270
+ }
1271
+ function $t(r) {
1272
+ var e = r.match(Nt);
1273
+ return e ? e[1].replace(It, "'") : r;
1274
+ }
1275
+ function nr() {
1276
+ return {
1277
+ formatDateBy: (t, n = {}) => {
1278
+ if (isNaN(t))
1279
+ return null;
1280
+ try {
1281
+ return new Date(t * 1e3).toLocaleDateString("en-US", {
1282
+ year: "numeric",
1283
+ month: "long",
1284
+ day: "numeric",
1285
+ weekday: "short",
1286
+ hour: "numeric",
1287
+ minute: "numeric",
1288
+ second: "numeric",
1289
+ hour12: !1,
1290
+ ...n
1291
+ });
1292
+ } catch {
1293
+ return null;
1294
+ }
1295
+ },
1296
+ formatUnixToDate: (t, n) => {
1297
+ if (!t)
1298
+ return "";
1299
+ const a = n ? "yyyy-MM-dd HH:mm:ss" : "yyyy-MM-dd HH:mm:ss XX";
1300
+ try {
1301
+ const i = new Date(t * 1e3);
1302
+ return Ht(i, a);
1303
+ } catch {
1304
+ return "";
1305
+ }
1306
+ }
1307
+ };
1308
+ }
1309
+ function ar() {
1310
+ return {
1311
+ debounce: (e, t) => {
1312
+ let n;
1313
+ return (...a) => {
1314
+ clearTimeout(n), n = window == null ? void 0 : window.setTimeout(() => {
1315
+ e(...a);
1316
+ }, t);
1317
+ };
1318
+ }
1319
+ };
1320
+ }
1321
+ function ir({ script: r, styles: e, onReady: t }) {
1322
+ const n = q(!0), a = q(!0), i = async () => {
1323
+ const { libName: l, url: u, type: c } = r;
1324
+ if ((c !== void 0 && ["umd", "es"].includes(c) ? c : "umd") === "es") {
1325
+ await import(
1326
+ /* @vite-ignore */
1327
+ u
1328
+ ), typeof t == "function" && await t();
1329
+ return;
1330
+ }
1331
+ const d = l.startsWith("kong-ui-") ? l : `kong-ui-${l}`;
1332
+ return window[d] || (window[d] = await new Promise((f, g) => {
1333
+ const b = document.createElement("script");
1334
+ b.async = !0, b.addEventListener("load", async () => {
1335
+ typeof t == "function" && await t(), n.value = !1, f(window[d]);
1336
+ }), b.addEventListener("error", () => {
1337
+ g(new Error(`Could not load '${d}' from ${u}`));
1338
+ }), b.src = u, document.head.appendChild(b);
1339
+ })), window[d];
1340
+ }, o = async (l, u) => {
1341
+ var c;
1342
+ for (const v of l) {
1343
+ const d = document.createElement("link");
1344
+ d.type = "text/css", d.rel = "stylesheet", d.href = v;
1345
+ const f = u ? document.querySelector(u) : null, g = u ? (c = f == null ? void 0 : f.shadowRoot) == null ? void 0 : c.children[0] : null;
1346
+ if (f && g)
1347
+ try {
1348
+ g.appendChild(d);
1349
+ } catch {
1350
+ document.head.appendChild(d);
1351
+ }
1352
+ else
1353
+ document.head.appendChild(d);
1354
+ }
1355
+ };
1356
+ return {
1357
+ importPackage: async () => {
1358
+ var u, c;
1359
+ if (!r || !r.url || typeof window > "u" || typeof document > "u")
1360
+ return;
1361
+ const l = fe(() => !!(e && (e != null && e.urls) && (e != null && e.urls.length) && e.shadowRoot));
1362
+ if ((!e || !(e != null && e.urls) || !((u = e == null ? void 0 : e.urls) != null && u.length)) && (a.value = !1), e != null && e.urls && ((c = e == null ? void 0 : e.urls) != null && c.length) && !l.value && (await o(e.urls), a.value = !1), (!r.type || r.type === "umd") && !l.value)
1363
+ return await i();
1364
+ await i(), await ie(), n.value = !1, e != null && e.urls && l.value && (await o(e.urls, e == null ? void 0 : e.shadowRoot), await ie(), a.value = !1);
1365
+ },
1366
+ loadingPackage: ae(n),
1367
+ loadingStyles: ae(a)
1368
+ };
1369
+ }
1370
+ var Z = /* @__PURE__ */ new WeakMap(), ce = 0;
1371
+ function Vt(r) {
1372
+ if (!r.length)
1373
+ return "";
1374
+ for (var e = "arg", t = 0; t < r.length; ++t) {
1375
+ var n = void 0;
1376
+ r[t] === null || typeof r[t] != "object" && typeof r[t] != "function" ? typeof r[t] == "string" ? n = '"' + r[t] + '"' : n = String(r[t]) : Z.has(r[t]) ? n = Z.get(r[t]) : (n = ce, Z.set(r[t], ce++)), e += "@" + n;
1377
+ }
1378
+ return e;
1379
+ }
1380
+ function qt(r) {
1381
+ if (typeof r == "function")
1382
+ try {
1383
+ r = r();
1384
+ } catch {
1385
+ r = "";
1386
+ }
1387
+ return Array.isArray(r) ? r = Vt(r) : r = String(r || ""), r;
1388
+ }
1389
+ var ne = (
1390
+ /** @class */
1391
+ function() {
1392
+ function r(e) {
1393
+ e === void 0 && (e = 0), this.items = /* @__PURE__ */ new Map(), this.ttl = e;
1394
+ }
1395
+ return r.prototype.serializeKey = function(e) {
1396
+ return qt(e);
1397
+ }, r.prototype.get = function(e) {
1398
+ var t = this.serializeKey(e);
1399
+ return this.items.get(t);
1400
+ }, r.prototype.set = function(e, t, n) {
1401
+ var a = this.serializeKey(e), i = n || this.ttl, o = Date.now(), s = {
1402
+ data: t,
1403
+ createdAt: o,
1404
+ expiresAt: i ? o + i : 1 / 0
1405
+ };
1406
+ this.dispatchExpire(i, s, a), this.items.set(a, s);
1407
+ }, r.prototype.dispatchExpire = function(e, t, n) {
1408
+ var a = this;
1409
+ e && setTimeout(function() {
1410
+ var i = Date.now(), o = i >= t.expiresAt;
1411
+ o && a.delete(n);
1412
+ }, e);
1413
+ }, r.prototype.delete = function(e) {
1414
+ this.items.delete(e);
1415
+ }, r;
1416
+ }()
1417
+ );
1418
+ function Gt() {
1419
+ return typeof navigator.onLine < "u" ? navigator.onLine : !0;
1420
+ }
1421
+ function jt() {
1422
+ return typeof document < "u" && typeof document.visibilityState < "u" ? document.visibilityState !== "hidden" : !0;
1423
+ }
1424
+ var Bt = function(r) {
1425
+ return fetch(r).then(function(e) {
1426
+ return e.json();
1427
+ });
1428
+ };
1429
+ const ee = {
1430
+ isOnline: Gt,
1431
+ isDocumentVisible: jt,
1432
+ fetcher: Bt
1433
+ };
1434
+ var k = globalThis && globalThis.__assign || function() {
1435
+ return k = Object.assign || function(r) {
1436
+ for (var e, t = 1, n = arguments.length; t < n; t++) {
1437
+ e = arguments[t];
1438
+ for (var a in e)
1439
+ Object.prototype.hasOwnProperty.call(e, a) && (r[a] = e[a]);
1440
+ }
1441
+ return r;
1442
+ }, k.apply(this, arguments);
1443
+ }, I = globalThis && globalThis.__awaiter || function(r, e, t, n) {
1444
+ function a(i) {
1445
+ return i instanceof t ? i : new t(function(o) {
1446
+ o(i);
1447
+ });
1448
+ }
1449
+ return new (t || (t = Promise))(function(i, o) {
1450
+ function s(c) {
1451
+ try {
1452
+ u(n.next(c));
1453
+ } catch (v) {
1454
+ o(v);
1455
+ }
1456
+ }
1457
+ function l(c) {
1458
+ try {
1459
+ u(n.throw(c));
1460
+ } catch (v) {
1461
+ o(v);
1462
+ }
1463
+ }
1464
+ function u(c) {
1465
+ c.done ? i(c.value) : a(c.value).then(s, l);
1466
+ }
1467
+ u((n = n.apply(r, e || [])).next());
1468
+ });
1469
+ }, F = globalThis && globalThis.__generator || function(r, e) {
1470
+ var t = { label: 0, sent: function() {
1471
+ if (i[0] & 1)
1472
+ throw i[1];
1473
+ return i[1];
1474
+ }, trys: [], ops: [] }, n, a, i, o;
1475
+ return o = { next: s(0), throw: s(1), return: s(2) }, typeof Symbol == "function" && (o[Symbol.iterator] = function() {
1476
+ return this;
1477
+ }), o;
1478
+ function s(u) {
1479
+ return function(c) {
1480
+ return l([u, c]);
1481
+ };
1482
+ }
1483
+ function l(u) {
1484
+ if (n)
1485
+ throw new TypeError("Generator is already executing.");
1486
+ for (; t; )
1487
+ try {
1488
+ if (n = 1, a && (i = u[0] & 2 ? a.return : u[0] ? a.throw || ((i = a.return) && i.call(a), 0) : a.next) && !(i = i.call(a, u[1])).done)
1489
+ return i;
1490
+ switch (a = 0, i && (u = [u[0] & 2, i.value]), u[0]) {
1491
+ case 0:
1492
+ case 1:
1493
+ i = u;
1494
+ break;
1495
+ case 4:
1496
+ return t.label++, { value: u[1], done: !1 };
1497
+ case 5:
1498
+ t.label++, a = u[1], u = [0];
1499
+ continue;
1500
+ case 7:
1501
+ u = t.ops.pop(), t.trys.pop();
1502
+ continue;
1503
+ default:
1504
+ if (i = t.trys, !(i = i.length > 0 && i[i.length - 1]) && (u[0] === 6 || u[0] === 2)) {
1505
+ t = 0;
1506
+ continue;
1507
+ }
1508
+ if (u[0] === 3 && (!i || u[1] > i[0] && u[1] < i[3])) {
1509
+ t.label = u[1];
1510
+ break;
1511
+ }
1512
+ if (u[0] === 6 && t.label < i[1]) {
1513
+ t.label = i[1], i = u;
1514
+ break;
1515
+ }
1516
+ if (i && t.label < i[2]) {
1517
+ t.label = i[2], t.ops.push(u);
1518
+ break;
1519
+ }
1520
+ i[2] && t.ops.pop(), t.trys.pop();
1521
+ continue;
1522
+ }
1523
+ u = e.call(r, t);
1524
+ } catch (c) {
1525
+ u = [6, c], a = 0;
1526
+ } finally {
1527
+ n = i = 0;
1528
+ }
1529
+ if (u[0] & 5)
1530
+ throw u[1];
1531
+ return { value: u[0] ? u[1] : void 0, done: !0 };
1532
+ }
1533
+ }, Xt = globalThis && globalThis.__read || function(r, e) {
1534
+ var t = typeof Symbol == "function" && r[Symbol.iterator];
1535
+ if (!t)
1536
+ return r;
1537
+ var n = t.call(r), a, i = [], o;
1538
+ try {
1539
+ for (; (e === void 0 || e-- > 0) && !(a = n.next()).done; )
1540
+ i.push(a.value);
1541
+ } catch (s) {
1542
+ o = { error: s };
1543
+ } finally {
1544
+ try {
1545
+ a && !a.done && (t = n.return) && t.call(n);
1546
+ } finally {
1547
+ if (o)
1548
+ throw o.error;
1549
+ }
1550
+ }
1551
+ return i;
1552
+ }, Qt = globalThis && globalThis.__spreadArray || function(r, e, t) {
1553
+ if (t || arguments.length === 2)
1554
+ for (var n = 0, a = e.length, i; n < a; n++)
1555
+ (i || !(n in e)) && (i || (i = Array.prototype.slice.call(e, 0, n)), i[n] = e[n]);
1556
+ return r.concat(i || Array.prototype.slice.call(e));
1557
+ }, ge = new ne(), J = new ne(), te = new ne(), we = {
1558
+ cache: ge,
1559
+ refreshInterval: 0,
1560
+ ttl: 0,
1561
+ serverTTL: 1e3,
1562
+ dedupingInterval: 2e3,
1563
+ revalidateOnFocus: !0,
1564
+ revalidateDebounce: 0,
1565
+ shouldRetryOnError: !0,
1566
+ errorRetryInterval: 5e3,
1567
+ errorRetryCount: 5,
1568
+ fetcher: ee.fetcher,
1569
+ isOnline: ee.isOnline,
1570
+ isDocumentVisible: ee.isDocumentVisible
1571
+ };
1572
+ function Jt(r, e, t) {
1573
+ var n = J.get(r);
1574
+ if (n)
1575
+ n.data.push(e);
1576
+ else {
1577
+ var a = 5e3;
1578
+ J.set(r, [e], t > 0 ? t + a : t);
1579
+ }
1580
+ }
1581
+ function Kt(r, e, t) {
1582
+ if (t.isDocumentVisible() && !(t.errorRetryCount !== void 0 && e > t.errorRetryCount)) {
1583
+ var n = Math.min(e || 0, t.errorRetryCount), a = n * t.errorRetryInterval;
1584
+ setTimeout(function() {
1585
+ r(null, { errorRetryCount: n + 1, shouldRetryOnError: !0 });
1586
+ }, a);
1587
+ }
1588
+ }
1589
+ var de = function(r, e, t, n) {
1590
+ return t === void 0 && (t = ge), n === void 0 && (n = we.ttl), I(void 0, void 0, void 0, function() {
1591
+ var a, i, o, s, l, u, c;
1592
+ return F(this, function(v) {
1593
+ switch (v.label) {
1594
+ case 0:
1595
+ if (!Zt(e))
1596
+ return [3, 5];
1597
+ v.label = 1;
1598
+ case 1:
1599
+ return v.trys.push([1, 3, , 4]), [4, e];
1600
+ case 2:
1601
+ return a = v.sent(), [3, 4];
1602
+ case 3:
1603
+ return s = v.sent(), i = s, [3, 4];
1604
+ case 4:
1605
+ return [3, 6];
1606
+ case 5:
1607
+ a = e, v.label = 6;
1608
+ case 6:
1609
+ if (o = !1, l = { data: a, error: i, isValidating: o }, typeof a < "u")
1610
+ try {
1611
+ t.set(r, l, n);
1612
+ } catch (d) {
1613
+ console.error("swrv(mutate): failed to set cache", d);
1614
+ }
1615
+ return u = J.get(r), u && u.data.length && (c = u.data.filter(function(d) {
1616
+ return d.key === r;
1617
+ }), c.forEach(function(d, f) {
1618
+ typeof l.data < "u" && (d.data = l.data), d.error = l.error, d.isValidating = l.isValidating;
1619
+ var g = f === c.length - 1;
1620
+ g || delete c[f];
1621
+ }), c = c.filter(Boolean)), [2, l];
1622
+ }
1623
+ });
1624
+ });
1625
+ };
1626
+ function zt() {
1627
+ for (var r = this, e = [], t = 0; t < arguments.length; t++)
1628
+ e[t] = arguments[t];
1629
+ var n, a, i = k({}, we), o = !1, s = !1, l = ye(), u = (l == null ? void 0 : l.proxy) || l;
1630
+ if (!u)
1631
+ return console.error("Could not get current instance, check to make sure that `useSwrv` is declared in the top level of the setup function."), null;
1632
+ var c = (u == null ? void 0 : u.$isServer) || !1;
1633
+ e.length >= 1 && (n = e[0]), e.length >= 2 && (a = e[1]), e.length > 2 && (i = k(k({}, i), e[2]));
1634
+ var v = c ? i.serverTTL : i.ttl, d = typeof n == "function" ? n : q(n);
1635
+ typeof a > "u" && (a = i.fetcher);
1636
+ var f = null;
1637
+ f || (f = Te({
1638
+ data: void 0,
1639
+ error: void 0,
1640
+ isValidating: !0,
1641
+ key: null
1642
+ }));
1643
+ var g = function(w, m) {
1644
+ return I(r, void 0, void 0, function() {
1645
+ var L, C, D, S, R, Y, _, G = this;
1646
+ return F(this, function(H) {
1647
+ switch (H.label) {
1648
+ case 0:
1649
+ return L = f.data === void 0, C = d.value, C ? (D = i.cache.get(C), S = D && D.data, f.isValidating = !0, S && (f.data = S.data, f.error = S.error), R = w || a, !R || !i.isDocumentVisible() && !L || (m == null ? void 0 : m.forceRevalidate) !== void 0 && !(m != null && m.forceRevalidate) ? (f.isValidating = !1, [
1650
+ 2
1651
+ /*return*/
1652
+ ]) : D && (Y = !!(Date.now() - D.createdAt >= i.dedupingInterval || m != null && m.forceRevalidate), !Y) ? (f.isValidating = !1, [
1653
+ 2
1654
+ /*return*/
1655
+ ]) : (_ = function() {
1656
+ return I(G, void 0, void 0, function() {
1657
+ var E, j, y, O;
1658
+ return F(this, function(M) {
1659
+ switch (M.label) {
1660
+ case 0:
1661
+ return E = te.get(C), E ? [3, 2] : (j = Array.isArray(C) ? C : [C], y = R.apply(void 0, Qt([], Xt(j), !1)), te.set(C, y, i.dedupingInterval), [4, de(C, y, i.cache, v)]);
1662
+ case 1:
1663
+ return M.sent(), [3, 4];
1664
+ case 2:
1665
+ return [4, de(C, E.data, i.cache, v)];
1666
+ case 3:
1667
+ M.sent(), M.label = 4;
1668
+ case 4:
1669
+ return f.isValidating = !1, te.delete(C), f.error !== void 0 && (O = !o && i.shouldRetryOnError && (m ? m.shouldRetryOnError : !0), O && Kt(g, m ? m.errorRetryCount : 1, i)), [
1670
+ 2
1671
+ /*return*/
1672
+ ];
1673
+ }
1674
+ });
1675
+ });
1676
+ }, S && i.revalidateDebounce ? (setTimeout(function() {
1677
+ return I(G, void 0, void 0, function() {
1678
+ return F(this, function(E) {
1679
+ switch (E.label) {
1680
+ case 0:
1681
+ return o ? [3, 2] : [4, _()];
1682
+ case 1:
1683
+ E.sent(), E.label = 2;
1684
+ case 2:
1685
+ return [
1686
+ 2
1687
+ /*return*/
1688
+ ];
1689
+ }
1690
+ });
1691
+ });
1692
+ }, i.revalidateDebounce), [3, 3]) : [3, 1])) : [
1693
+ 2
1694
+ /*return*/
1695
+ ];
1696
+ case 1:
1697
+ return [4, _()];
1698
+ case 2:
1699
+ H.sent(), H.label = 3;
1700
+ case 3:
1701
+ return [
1702
+ 2
1703
+ /*return*/
1704
+ ];
1705
+ }
1706
+ });
1707
+ });
1708
+ }, b = function() {
1709
+ return I(r, void 0, void 0, function() {
1710
+ return F(this, function(w) {
1711
+ return [2, g(null, { shouldRetryOnError: !1 })];
1712
+ });
1713
+ });
1714
+ }, p = null;
1715
+ pe(function() {
1716
+ var w = function() {
1717
+ return I(r, void 0, void 0, function() {
1718
+ return F(this, function(m) {
1719
+ switch (m.label) {
1720
+ case 0:
1721
+ return !f.error && i.isOnline() ? [4, g()] : [3, 2];
1722
+ case 1:
1723
+ return m.sent(), [3, 3];
1724
+ case 2:
1725
+ p && clearTimeout(p), m.label = 3;
1726
+ case 3:
1727
+ return i.refreshInterval && !o && (p = setTimeout(w, i.refreshInterval)), [
1728
+ 2
1729
+ /*return*/
1730
+ ];
1731
+ }
1732
+ });
1733
+ });
1734
+ };
1735
+ i.refreshInterval && (p = setTimeout(w, i.refreshInterval)), i.revalidateOnFocus && (document.addEventListener("visibilitychange", b, !1), window.addEventListener("focus", b, !1));
1736
+ }), Ce(function() {
1737
+ o = !0, p && clearTimeout(p), i.revalidateOnFocus && (document.removeEventListener("visibilitychange", b, !1), window.removeEventListener("focus", b, !1));
1738
+ var w = J.get(d.value);
1739
+ w && (w.data = w.data.filter(function(m) {
1740
+ return m !== f;
1741
+ }));
1742
+ });
1743
+ try {
1744
+ De(d, function(w) {
1745
+ Se(d) || (d.value = w), f.key = w, f.isValidating = !!w, Jt(d.value, f, v), !c && !s && d.value && g(), s = !1;
1746
+ }, {
1747
+ immediate: !0
1748
+ });
1749
+ } catch {
1750
+ }
1751
+ var W = k(k({}, Oe(f)), { mutate: function(w, m) {
1752
+ return g(w, k(k({}, m), { forceRevalidate: !0 }));
1753
+ } });
1754
+ return W;
1755
+ }
1756
+ function Zt(r) {
1757
+ return r !== null && typeof r == "object" && typeof r.then == "function";
1758
+ }
1759
+ function or(r, e, t) {
1760
+ const { data: n, error: a, isValidating: i, mutate: o } = zt(r, e, {
1761
+ revalidateDebounce: 500,
1762
+ revalidateOnFocus: !1,
1763
+ dedupingInterval: 100,
1764
+ ...t
1765
+ });
1766
+ return {
1767
+ data: fe(() => {
1768
+ var l;
1769
+ return (l = n.value) == null ? void 0 : l.data;
1770
+ }),
1771
+ response: n,
1772
+ error: a,
1773
+ isValidating: i,
1774
+ revalidate: o
1775
+ };
1776
+ }
1777
+ var be = /* @__PURE__ */ ((r) => (r.VALIDATING = "VALIDATING", r.VALIDATING_HAS_DATA = "VALIDATING_HAS_DATA", r.PENDING = "PENDING", r.SUCCESS = "SUCCESS", r.SUCCESS_HAS_DATA = "SUCCESS_HAS_DATA", r.ERROR = "ERROR", r.STALE_IF_ERROR = "STALE_IF_ERROR", r))(be || {});
1778
+ const er = (r) => {
1779
+ var e, t, n, a, i;
1780
+ return r ? !!// TODO: revisit: currently only the first check ever matters?
1781
+ ((e = Object.keys(r)) != null && e.length || (t = r.data) != null && t.length || (a = (n = r.data) == null ? void 0 : n.data) != null && a.length || !((i = r.data) != null && i.data) && typeof r.data == "object" && Object.keys(r == null ? void 0 : r.data).length) : !1;
1782
+ };
1783
+ function ur(r = q({}), e, t, n = er) {
1784
+ const a = q(
1785
+ "PENDING"
1786
+ /* PENDING */
1787
+ );
1788
+ return Pe(() => {
1789
+ const i = n(r.value);
1790
+ if (r.value && i && t.value) {
1791
+ a.value = "VALIDATING_HAS_DATA";
1792
+ return;
1793
+ }
1794
+ if (r.value && t.value) {
1795
+ a.value = "VALIDATING";
1796
+ return;
1797
+ }
1798
+ if (r.value && e.value) {
1799
+ a.value = "STALE_IF_ERROR";
1800
+ return;
1801
+ }
1802
+ if (r.value === void 0 && !e.value) {
1803
+ a.value = "PENDING";
1804
+ return;
1805
+ }
1806
+ if (r.value && !e.value && i) {
1807
+ a.value = "SUCCESS_HAS_DATA";
1808
+ return;
1809
+ }
1810
+ if (r.value && !e.value) {
1811
+ a.value = "SUCCESS";
1812
+ return;
1813
+ }
1814
+ r.value === void 0 && e && (a.value = "ERROR");
1815
+ }), {
1816
+ state: a,
1817
+ swrvState: be
1818
+ };
1819
+ }
1820
+ const re = "khcp-user-table-preferences", tr = {
1821
+ pageSize: 30,
1822
+ sortColumnKey: void 0,
1823
+ sortColumnOrder: void 0
1824
+ };
1825
+ function lr() {
1826
+ const r = (i) => {
1827
+ if (typeof i == "string")
1828
+ try {
1829
+ return JSON.parse(i);
1830
+ } catch (o) {
1831
+ console.error("useTablePreferences(tryParseJson)", o);
1832
+ return;
1833
+ }
1834
+ }, e = () => {
1835
+ const i = r(localStorage.getItem(re));
1836
+ return !i || !Object.keys(i).length ? /* @__PURE__ */ new Map() : new Map(Object.entries(i));
1837
+ };
1838
+ return {
1839
+ setTablePreferences: (i, o) => {
1840
+ try {
1841
+ const s = e();
1842
+ s.set(i, o), localStorage.setItem(re, JSON.stringify(Object.fromEntries(s.entries())));
1843
+ } catch (s) {
1844
+ console.error("useTablePreferences(setTablePreferences)", s);
1845
+ }
1846
+ },
1847
+ getTablePreferences: (i) => {
1848
+ const o = e();
1849
+ return (o == null ? void 0 : o.get(i)) || void 0 || tr;
1850
+ },
1851
+ deleteAllTablePreferences: () => {
1852
+ localStorage.removeItem(re);
1853
+ }
1854
+ };
1855
+ }
1856
+ function sr() {
1857
+ const r = () => {
1858
+ var l;
1859
+ return ((l = window == null ? void 0 : window.location) == null ? void 0 : l.search) || "";
1860
+ };
1861
+ return {
1862
+ getLocationSearch: r,
1863
+ getLocationHostname: () => {
1864
+ var l;
1865
+ return ((l = window == null ? void 0 : window.location) == null ? void 0 : l.hostname) || "";
1866
+ },
1867
+ getLocationHref: () => {
1868
+ var l;
1869
+ return ((l = window == null ? void 0 : window.location) == null ? void 0 : l.href) || "";
1870
+ },
1871
+ getLocationPathname: () => {
1872
+ var l;
1873
+ return ((l = window == null ? void 0 : window.location) == null ? void 0 : l.pathname) || "";
1874
+ },
1875
+ getLocationOrigin: () => {
1876
+ var l;
1877
+ return ((l = window == null ? void 0 : window.location) == null ? void 0 : l.origin) || "";
1878
+ },
1879
+ getUrlSearchParams: () => new URLSearchParams(r()),
1880
+ setLocationAssign: (l) => {
1881
+ window.location.assign(l);
1882
+ },
1883
+ setLocationReplace: (l) => {
1884
+ window.location.replace(l);
1885
+ }
1886
+ };
1887
+ }
1888
+ export {
1889
+ tr as DEFAULT_USER_TABLE_PREFERENCES,
1890
+ re as USER_TABLE_PREFERENCES_LOCAL_STORAGE_KEY,
1891
+ nr as useDate,
1892
+ ar as useDebounce,
1893
+ ir as usePackage,
1894
+ or as useSwrvRequest,
1895
+ ur as useSwrvState,
1896
+ lr as useTablePreferences,
1897
+ sr as useWindow
1898
+ };