@cagatayfdn/flora-components 0.0.83 → 0.0.84

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