@articles-media/articles-dev-box 1.0.12 → 1.0.13

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.
Files changed (42) hide show
  1. package/package.json +5 -1
  2. package/dist/Ad.cjs +0 -1
  3. package/dist/Ad.js +0 -600
  4. package/dist/AdConfirmExitModal-CKkMAvBK.js +0 -72
  5. package/dist/AdConfirmExitModal-CcSxmXKT.cjs +0 -1
  6. package/dist/AdDetailsModal-Bp5hZm9N.js +0 -83
  7. package/dist/AdDetailsModal-k840vrS2.cjs +0 -1
  8. package/dist/ArticlesAd.cjs +0 -1
  9. package/dist/ArticlesAd.js +0 -16
  10. package/dist/Button-0ZK0NKiK.cjs +0 -1
  11. package/dist/Button-_Quon8UV.js +0 -54
  12. package/dist/GameScoreboard.cjs +0 -1
  13. package/dist/GameScoreboard.js +0 -182
  14. package/dist/GlobalBody-BQ2qC81K.cjs +0 -33
  15. package/dist/GlobalBody-tmIC_GWn.js +0 -123
  16. package/dist/GlobalBody.cjs +0 -1
  17. package/dist/GlobalBody.js +0 -7
  18. package/dist/GlobalHead.cjs +0 -1
  19. package/dist/GlobalHead.js +0 -13
  20. package/dist/Modal-C9oYRgI1.js +0 -2073
  21. package/dist/Modal-Wmqy9fOm.cjs +0 -2
  22. package/dist/ReturnToLauncherButton.cjs +0 -1
  23. package/dist/ReturnToLauncherButton.js +0 -50
  24. package/dist/StatusModal-BlwaI-2B.cjs +0 -1
  25. package/dist/StatusModal-CAVxWCUq.js +0 -71
  26. package/dist/ViewUserModal.cjs +0 -1
  27. package/dist/ViewUserModal.js +0 -3189
  28. package/dist/articles-dev-box.css +0 -1
  29. package/dist/index-BlP2-uOi.cjs +0 -1
  30. package/dist/index-DLYx67wi.js +0 -2394
  31. package/dist/index-Ddv_TnxK.cjs +0 -6
  32. package/dist/index-YnD2EP-S.js +0 -43
  33. package/dist/index.cjs +0 -1
  34. package/dist/index.js +0 -20
  35. package/dist/jsx-runtime-nZSsnGb7.cjs +0 -6
  36. package/dist/jsx-runtime-tc70JA_2.js +0 -264
  37. package/dist/numberWithCommas-CRgrb58X.cjs +0 -1
  38. package/dist/numberWithCommas-DnAkiOFL.js +0 -1256
  39. package/dist/useUserDetails.cjs +0 -1
  40. package/dist/useUserDetails.js +0 -33
  41. package/dist/useUserToken.cjs +0 -1
  42. package/dist/useUserToken.js +0 -22
@@ -1,1256 +0,0 @@
1
- import { j as F } from "./jsx-runtime-tc70JA_2.js";
2
- function Rt(t) {
3
- const { href: e, children: n, newPage: r, ...a } = t;
4
- return /* @__PURE__ */ F.jsx(
5
- "a",
6
- {
7
- href: e,
8
- ...a,
9
- ...r && { target: "_blank", rel: "noopener noreferrer" },
10
- children: n
11
- }
12
- );
13
- }
14
- const C = 6048e5, _ = 864e5, Vt = 6e4, D = /* @__PURE__ */ Symbol.for("constructDateFrom");
15
- function g(t, e) {
16
- return typeof t == "function" ? t(e) : t && typeof t == "object" && D in t ? t[D](e) : t instanceof Date ? new t.constructor(e) : new Date(e);
17
- }
18
- function h(t, e) {
19
- return g(e || t, t);
20
- }
21
- let Q = {};
22
- function O() {
23
- return Q;
24
- }
25
- function M(t, e) {
26
- const n = O(), r = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, a = h(t, e?.in), o = a.getDay(), i = (o < r ? 7 : 0) + o - r;
27
- return a.setDate(a.getDate() - i), a.setHours(0, 0, 0, 0), a;
28
- }
29
- function P(t, e) {
30
- return M(t, { ...e, weekStartsOn: 1 });
31
- }
32
- function q(t, e) {
33
- const n = h(t, e?.in), r = n.getFullYear(), a = g(n, 0);
34
- a.setFullYear(r + 1, 0, 4), a.setHours(0, 0, 0, 0);
35
- const o = P(a), i = g(n, 0);
36
- i.setFullYear(r, 0, 4), i.setHours(0, 0, 0, 0);
37
- const u = P(i);
38
- return n.getTime() >= o.getTime() ? r + 1 : n.getTime() >= u.getTime() ? r : r - 1;
39
- }
40
- function W(t) {
41
- const e = h(t), n = new Date(
42
- Date.UTC(
43
- e.getFullYear(),
44
- e.getMonth(),
45
- e.getDate(),
46
- e.getHours(),
47
- e.getMinutes(),
48
- e.getSeconds(),
49
- e.getMilliseconds()
50
- )
51
- );
52
- return n.setUTCFullYear(e.getFullYear()), +t - +n;
53
- }
54
- function j(t, ...e) {
55
- const n = g.bind(
56
- null,
57
- e.find((r) => typeof r == "object")
58
- );
59
- return e.map(n);
60
- }
61
- function v(t, e) {
62
- const n = h(t, e?.in);
63
- return n.setHours(0, 0, 0, 0), n;
64
- }
65
- function X(t, e, n) {
66
- const [r, a] = j(
67
- n?.in,
68
- t,
69
- e
70
- ), o = v(r), i = v(a), u = +o - W(o), f = +i - W(i);
71
- return Math.round((u - f) / _);
72
- }
73
- function L(t, e) {
74
- const n = q(t, e), r = g(t, 0);
75
- return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), P(r);
76
- }
77
- function B(t) {
78
- return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
79
- }
80
- function G(t) {
81
- return !(!B(t) && typeof t != "number" || isNaN(+h(t)));
82
- }
83
- function A(t, e) {
84
- const n = h(t, e?.in);
85
- return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
86
- }
87
- const R = {
88
- lessThanXSeconds: {
89
- one: "less than a second",
90
- other: "less than {{count}} seconds"
91
- },
92
- xSeconds: {
93
- one: "1 second",
94
- other: "{{count}} seconds"
95
- },
96
- halfAMinute: "half a minute",
97
- lessThanXMinutes: {
98
- one: "less than a minute",
99
- other: "less than {{count}} minutes"
100
- },
101
- xMinutes: {
102
- one: "1 minute",
103
- other: "{{count}} minutes"
104
- },
105
- aboutXHours: {
106
- one: "about 1 hour",
107
- other: "about {{count}} hours"
108
- },
109
- xHours: {
110
- one: "1 hour",
111
- other: "{{count}} hours"
112
- },
113
- xDays: {
114
- one: "1 day",
115
- other: "{{count}} days"
116
- },
117
- aboutXWeeks: {
118
- one: "about 1 week",
119
- other: "about {{count}} weeks"
120
- },
121
- xWeeks: {
122
- one: "1 week",
123
- other: "{{count}} weeks"
124
- },
125
- aboutXMonths: {
126
- one: "about 1 month",
127
- other: "about {{count}} months"
128
- },
129
- xMonths: {
130
- one: "1 month",
131
- other: "{{count}} months"
132
- },
133
- aboutXYears: {
134
- one: "about 1 year",
135
- other: "about {{count}} years"
136
- },
137
- xYears: {
138
- one: "1 year",
139
- other: "{{count}} years"
140
- },
141
- overXYears: {
142
- one: "over 1 year",
143
- other: "over {{count}} years"
144
- },
145
- almostXYears: {
146
- one: "almost 1 year",
147
- other: "almost {{count}} years"
148
- }
149
- }, V = (t, e, n) => {
150
- let r;
151
- const a = R[t];
152
- return typeof a == "string" ? r = a : e === 1 ? r = a.one : r = a.other.replace("{{count}}", e.toString()), n?.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
153
- };
154
- function k(t) {
155
- return (e = {}) => {
156
- const n = e.width ? String(e.width) : t.defaultWidth;
157
- return t.formats[n] || t.formats[t.defaultWidth];
158
- };
159
- }
160
- const I = {
161
- full: "EEEE, MMMM do, y",
162
- long: "MMMM do, y",
163
- medium: "MMM d, y",
164
- short: "MM/dd/yyyy"
165
- }, J = {
166
- full: "h:mm:ss a zzzz",
167
- long: "h:mm:ss a z",
168
- medium: "h:mm:ss a",
169
- short: "h:mm a"
170
- }, $ = {
171
- full: "{{date}} 'at' {{time}}",
172
- long: "{{date}} 'at' {{time}}",
173
- medium: "{{date}}, {{time}}",
174
- short: "{{date}}, {{time}}"
175
- }, z = {
176
- date: k({
177
- formats: I,
178
- defaultWidth: "full"
179
- }),
180
- time: k({
181
- formats: J,
182
- defaultWidth: "full"
183
- }),
184
- dateTime: k({
185
- formats: $,
186
- defaultWidth: "full"
187
- })
188
- }, U = {
189
- lastWeek: "'last' eeee 'at' p",
190
- yesterday: "'yesterday at' p",
191
- today: "'today at' p",
192
- tomorrow: "'tomorrow at' p",
193
- nextWeek: "eeee 'at' p",
194
- other: "P"
195
- }, K = (t, e, n, r) => U[t];
196
- function b(t) {
197
- return (e, n) => {
198
- const r = n?.context ? String(n.context) : "standalone";
199
- let a;
200
- if (r === "formatting" && t.formattingValues) {
201
- const i = t.defaultFormattingWidth || t.defaultWidth, u = n?.width ? String(n.width) : i;
202
- a = t.formattingValues[u] || t.formattingValues[i];
203
- } else {
204
- const i = t.defaultWidth, u = n?.width ? String(n.width) : t.defaultWidth;
205
- a = t.values[u] || t.values[i];
206
- }
207
- const o = t.argumentCallback ? t.argumentCallback(e) : e;
208
- return a[o];
209
- };
210
- }
211
- const Z = {
212
- narrow: ["B", "A"],
213
- abbreviated: ["BC", "AD"],
214
- wide: ["Before Christ", "Anno Domini"]
215
- }, tt = {
216
- narrow: ["1", "2", "3", "4"],
217
- abbreviated: ["Q1", "Q2", "Q3", "Q4"],
218
- wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
219
- }, et = {
220
- narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
221
- abbreviated: [
222
- "Jan",
223
- "Feb",
224
- "Mar",
225
- "Apr",
226
- "May",
227
- "Jun",
228
- "Jul",
229
- "Aug",
230
- "Sep",
231
- "Oct",
232
- "Nov",
233
- "Dec"
234
- ],
235
- wide: [
236
- "January",
237
- "February",
238
- "March",
239
- "April",
240
- "May",
241
- "June",
242
- "July",
243
- "August",
244
- "September",
245
- "October",
246
- "November",
247
- "December"
248
- ]
249
- }, nt = {
250
- narrow: ["S", "M", "T", "W", "T", "F", "S"],
251
- short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
252
- abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
253
- wide: [
254
- "Sunday",
255
- "Monday",
256
- "Tuesday",
257
- "Wednesday",
258
- "Thursday",
259
- "Friday",
260
- "Saturday"
261
- ]
262
- }, rt = {
263
- narrow: {
264
- am: "a",
265
- pm: "p",
266
- midnight: "mi",
267
- noon: "n",
268
- morning: "morning",
269
- afternoon: "afternoon",
270
- evening: "evening",
271
- night: "night"
272
- },
273
- abbreviated: {
274
- am: "AM",
275
- pm: "PM",
276
- midnight: "midnight",
277
- noon: "noon",
278
- morning: "morning",
279
- afternoon: "afternoon",
280
- evening: "evening",
281
- night: "night"
282
- },
283
- wide: {
284
- am: "a.m.",
285
- pm: "p.m.",
286
- midnight: "midnight",
287
- noon: "noon",
288
- morning: "morning",
289
- afternoon: "afternoon",
290
- evening: "evening",
291
- night: "night"
292
- }
293
- }, at = {
294
- narrow: {
295
- am: "a",
296
- pm: "p",
297
- midnight: "mi",
298
- noon: "n",
299
- morning: "in the morning",
300
- afternoon: "in the afternoon",
301
- evening: "in the evening",
302
- night: "at night"
303
- },
304
- abbreviated: {
305
- am: "AM",
306
- pm: "PM",
307
- midnight: "midnight",
308
- noon: "noon",
309
- morning: "in the morning",
310
- afternoon: "in the afternoon",
311
- evening: "in the evening",
312
- night: "at night"
313
- },
314
- wide: {
315
- am: "a.m.",
316
- pm: "p.m.",
317
- midnight: "midnight",
318
- noon: "noon",
319
- morning: "in the morning",
320
- afternoon: "in the afternoon",
321
- evening: "in the evening",
322
- night: "at night"
323
- }
324
- }, ot = (t, e) => {
325
- const n = Number(t), r = n % 100;
326
- if (r > 20 || r < 10)
327
- switch (r % 10) {
328
- case 1:
329
- return n + "st";
330
- case 2:
331
- return n + "nd";
332
- case 3:
333
- return n + "rd";
334
- }
335
- return n + "th";
336
- }, it = {
337
- ordinalNumber: ot,
338
- era: b({
339
- values: Z,
340
- defaultWidth: "wide"
341
- }),
342
- quarter: b({
343
- values: tt,
344
- defaultWidth: "wide",
345
- argumentCallback: (t) => t - 1
346
- }),
347
- month: b({
348
- values: et,
349
- defaultWidth: "wide"
350
- }),
351
- day: b({
352
- values: nt,
353
- defaultWidth: "wide"
354
- }),
355
- dayPeriod: b({
356
- values: rt,
357
- defaultWidth: "wide",
358
- formattingValues: at,
359
- defaultFormattingWidth: "wide"
360
- })
361
- };
362
- function p(t) {
363
- return (e, n = {}) => {
364
- const r = n.width, a = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], o = e.match(a);
365
- if (!o)
366
- return null;
367
- const i = o[0], u = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], f = Array.isArray(u) ? ut(u, (c) => c.test(i)) : (
368
- // [TODO] -- I challenge you to fix the type
369
- st(u, (c) => c.test(i))
370
- );
371
- let m;
372
- m = t.valueCallback ? t.valueCallback(f) : f, m = n.valueCallback ? (
373
- // [TODO] -- I challenge you to fix the type
374
- n.valueCallback(m)
375
- ) : m;
376
- const d = e.slice(i.length);
377
- return { value: m, rest: d };
378
- };
379
- }
380
- function st(t, e) {
381
- for (const n in t)
382
- if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
383
- return n;
384
- }
385
- function ut(t, e) {
386
- for (let n = 0; n < t.length; n++)
387
- if (e(t[n]))
388
- return n;
389
- }
390
- function ct(t) {
391
- return (e, n = {}) => {
392
- const r = e.match(t.matchPattern);
393
- if (!r) return null;
394
- const a = r[0], o = e.match(t.parsePattern);
395
- if (!o) return null;
396
- let i = t.valueCallback ? t.valueCallback(o[0]) : o[0];
397
- i = n.valueCallback ? n.valueCallback(i) : i;
398
- const u = e.slice(a.length);
399
- return { value: i, rest: u };
400
- };
401
- }
402
- const dt = /^(\d+)(th|st|nd|rd)?/i, ft = /\d+/i, ht = {
403
- narrow: /^(b|a)/i,
404
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
405
- wide: /^(before christ|before common era|anno domini|common era)/i
406
- }, mt = {
407
- any: [/^b/i, /^(a|c)/i]
408
- }, lt = {
409
- narrow: /^[1234]/i,
410
- abbreviated: /^q[1234]/i,
411
- wide: /^[1234](th|st|nd|rd)? quarter/i
412
- }, gt = {
413
- any: [/1/i, /2/i, /3/i, /4/i]
414
- }, wt = {
415
- narrow: /^[jfmasond]/i,
416
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
417
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
418
- }, yt = {
419
- narrow: [
420
- /^j/i,
421
- /^f/i,
422
- /^m/i,
423
- /^a/i,
424
- /^m/i,
425
- /^j/i,
426
- /^j/i,
427
- /^a/i,
428
- /^s/i,
429
- /^o/i,
430
- /^n/i,
431
- /^d/i
432
- ],
433
- any: [
434
- /^ja/i,
435
- /^f/i,
436
- /^mar/i,
437
- /^ap/i,
438
- /^may/i,
439
- /^jun/i,
440
- /^jul/i,
441
- /^au/i,
442
- /^s/i,
443
- /^o/i,
444
- /^n/i,
445
- /^d/i
446
- ]
447
- }, bt = {
448
- narrow: /^[smtwf]/i,
449
- short: /^(su|mo|tu|we|th|fr|sa)/i,
450
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
451
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
452
- }, pt = {
453
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
454
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
455
- }, Mt = {
456
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
457
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
458
- }, Pt = {
459
- any: {
460
- am: /^a/i,
461
- pm: /^p/i,
462
- midnight: /^mi/i,
463
- noon: /^no/i,
464
- morning: /morning/i,
465
- afternoon: /afternoon/i,
466
- evening: /evening/i,
467
- night: /night/i
468
- }
469
- }, Ot = {
470
- ordinalNumber: ct({
471
- matchPattern: dt,
472
- parsePattern: ft,
473
- valueCallback: (t) => parseInt(t, 10)
474
- }),
475
- era: p({
476
- matchPatterns: ht,
477
- defaultMatchWidth: "wide",
478
- parsePatterns: mt,
479
- defaultParseWidth: "any"
480
- }),
481
- quarter: p({
482
- matchPatterns: lt,
483
- defaultMatchWidth: "wide",
484
- parsePatterns: gt,
485
- defaultParseWidth: "any",
486
- valueCallback: (t) => t + 1
487
- }),
488
- month: p({
489
- matchPatterns: wt,
490
- defaultMatchWidth: "wide",
491
- parsePatterns: yt,
492
- defaultParseWidth: "any"
493
- }),
494
- day: p({
495
- matchPatterns: bt,
496
- defaultMatchWidth: "wide",
497
- parsePatterns: pt,
498
- defaultParseWidth: "any"
499
- }),
500
- dayPeriod: p({
501
- matchPatterns: Mt,
502
- defaultMatchWidth: "any",
503
- parsePatterns: Pt,
504
- defaultParseWidth: "any"
505
- })
506
- }, xt = {
507
- code: "en-US",
508
- formatDistance: V,
509
- formatLong: z,
510
- formatRelative: K,
511
- localize: it,
512
- match: Ot,
513
- options: {
514
- weekStartsOn: 0,
515
- firstWeekContainsDate: 1
516
- }
517
- };
518
- function kt(t, e) {
519
- const n = h(t, e?.in);
520
- return X(n, A(n)) + 1;
521
- }
522
- function Dt(t, e) {
523
- const n = h(t, e?.in), r = +P(n) - +L(n);
524
- return Math.round(r / C) + 1;
525
- }
526
- function N(t, e) {
527
- const n = h(t, e?.in), r = n.getFullYear(), a = O(), o = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? a.firstWeekContainsDate ?? a.locale?.options?.firstWeekContainsDate ?? 1, i = g(e?.in || t, 0);
528
- i.setFullYear(r + 1, 0, o), i.setHours(0, 0, 0, 0);
529
- const u = M(i, e), f = g(e?.in || t, 0);
530
- f.setFullYear(r, 0, o), f.setHours(0, 0, 0, 0);
531
- const m = M(f, e);
532
- return +n >= +u ? r + 1 : +n >= +m ? r : r - 1;
533
- }
534
- function Wt(t, e) {
535
- const n = O(), r = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, a = N(t, e), o = g(e?.in || t, 0);
536
- return o.setFullYear(a, 0, r), o.setHours(0, 0, 0, 0), M(o, e);
537
- }
538
- function vt(t, e) {
539
- const n = h(t, e?.in), r = +M(n, e) - +Wt(n, e);
540
- return Math.round(r / C) + 1;
541
- }
542
- function s(t, e) {
543
- const n = t < 0 ? "-" : "", r = Math.abs(t).toString().padStart(e, "0");
544
- return n + r;
545
- }
546
- const l = {
547
- // Year
548
- y(t, e) {
549
- const n = t.getFullYear(), r = n > 0 ? n : 1 - n;
550
- return s(e === "yy" ? r % 100 : r, e.length);
551
- },
552
- // Month
553
- M(t, e) {
554
- const n = t.getMonth();
555
- return e === "M" ? String(n + 1) : s(n + 1, 2);
556
- },
557
- // Day of the month
558
- d(t, e) {
559
- return s(t.getDate(), e.length);
560
- },
561
- // AM or PM
562
- a(t, e) {
563
- const n = t.getHours() / 12 >= 1 ? "pm" : "am";
564
- switch (e) {
565
- case "a":
566
- case "aa":
567
- return n.toUpperCase();
568
- case "aaa":
569
- return n;
570
- case "aaaaa":
571
- return n[0];
572
- default:
573
- return n === "am" ? "a.m." : "p.m.";
574
- }
575
- },
576
- // Hour [1-12]
577
- h(t, e) {
578
- return s(t.getHours() % 12 || 12, e.length);
579
- },
580
- // Hour [0-23]
581
- H(t, e) {
582
- return s(t.getHours(), e.length);
583
- },
584
- // Minute
585
- m(t, e) {
586
- return s(t.getMinutes(), e.length);
587
- },
588
- // Second
589
- s(t, e) {
590
- return s(t.getSeconds(), e.length);
591
- },
592
- // Fraction of second
593
- S(t, e) {
594
- const n = e.length, r = t.getMilliseconds(), a = Math.trunc(
595
- r * Math.pow(10, n - 3)
596
- );
597
- return s(a, e.length);
598
- }
599
- }, y = {
600
- midnight: "midnight",
601
- noon: "noon",
602
- morning: "morning",
603
- afternoon: "afternoon",
604
- evening: "evening",
605
- night: "night"
606
- }, S = {
607
- // Era
608
- G: function(t, e, n) {
609
- const r = t.getFullYear() > 0 ? 1 : 0;
610
- switch (e) {
611
- // AD, BC
612
- case "G":
613
- case "GG":
614
- case "GGG":
615
- return n.era(r, { width: "abbreviated" });
616
- // A, B
617
- case "GGGGG":
618
- return n.era(r, { width: "narrow" });
619
- default:
620
- return n.era(r, { width: "wide" });
621
- }
622
- },
623
- // Year
624
- y: function(t, e, n) {
625
- if (e === "yo") {
626
- const r = t.getFullYear(), a = r > 0 ? r : 1 - r;
627
- return n.ordinalNumber(a, { unit: "year" });
628
- }
629
- return l.y(t, e);
630
- },
631
- // Local week-numbering year
632
- Y: function(t, e, n, r) {
633
- const a = N(t, r), o = a > 0 ? a : 1 - a;
634
- if (e === "YY") {
635
- const i = o % 100;
636
- return s(i, 2);
637
- }
638
- return e === "Yo" ? n.ordinalNumber(o, { unit: "year" }) : s(o, e.length);
639
- },
640
- // ISO week-numbering year
641
- R: function(t, e) {
642
- const n = q(t);
643
- return s(n, e.length);
644
- },
645
- // Extended year. This is a single number designating the year of this calendar system.
646
- // The main difference between `y` and `u` localizers are B.C. years:
647
- // | Year | `y` | `u` |
648
- // |------|-----|-----|
649
- // | AC 1 | 1 | 1 |
650
- // | BC 1 | 1 | 0 |
651
- // | BC 2 | 2 | -1 |
652
- // Also `yy` always returns the last two digits of a year,
653
- // while `uu` pads single digit years to 2 characters and returns other years unchanged.
654
- u: function(t, e) {
655
- const n = t.getFullYear();
656
- return s(n, e.length);
657
- },
658
- // Quarter
659
- Q: function(t, e, n) {
660
- const r = Math.ceil((t.getMonth() + 1) / 3);
661
- switch (e) {
662
- // 1, 2, 3, 4
663
- case "Q":
664
- return String(r);
665
- // 01, 02, 03, 04
666
- case "QQ":
667
- return s(r, 2);
668
- // 1st, 2nd, 3rd, 4th
669
- case "Qo":
670
- return n.ordinalNumber(r, { unit: "quarter" });
671
- // Q1, Q2, Q3, Q4
672
- case "QQQ":
673
- return n.quarter(r, {
674
- width: "abbreviated",
675
- context: "formatting"
676
- });
677
- // 1, 2, 3, 4 (narrow quarter; could be not numerical)
678
- case "QQQQQ":
679
- return n.quarter(r, {
680
- width: "narrow",
681
- context: "formatting"
682
- });
683
- default:
684
- return n.quarter(r, {
685
- width: "wide",
686
- context: "formatting"
687
- });
688
- }
689
- },
690
- // Stand-alone quarter
691
- q: function(t, e, n) {
692
- const r = Math.ceil((t.getMonth() + 1) / 3);
693
- switch (e) {
694
- // 1, 2, 3, 4
695
- case "q":
696
- return String(r);
697
- // 01, 02, 03, 04
698
- case "qq":
699
- return s(r, 2);
700
- // 1st, 2nd, 3rd, 4th
701
- case "qo":
702
- return n.ordinalNumber(r, { unit: "quarter" });
703
- // Q1, Q2, Q3, Q4
704
- case "qqq":
705
- return n.quarter(r, {
706
- width: "abbreviated",
707
- context: "standalone"
708
- });
709
- // 1, 2, 3, 4 (narrow quarter; could be not numerical)
710
- case "qqqqq":
711
- return n.quarter(r, {
712
- width: "narrow",
713
- context: "standalone"
714
- });
715
- default:
716
- return n.quarter(r, {
717
- width: "wide",
718
- context: "standalone"
719
- });
720
- }
721
- },
722
- // Month
723
- M: function(t, e, n) {
724
- const r = t.getMonth();
725
- switch (e) {
726
- case "M":
727
- case "MM":
728
- return l.M(t, e);
729
- // 1st, 2nd, ..., 12th
730
- case "Mo":
731
- return n.ordinalNumber(r + 1, { unit: "month" });
732
- // Jan, Feb, ..., Dec
733
- case "MMM":
734
- return n.month(r, {
735
- width: "abbreviated",
736
- context: "formatting"
737
- });
738
- // J, F, ..., D
739
- case "MMMMM":
740
- return n.month(r, {
741
- width: "narrow",
742
- context: "formatting"
743
- });
744
- default:
745
- return n.month(r, { width: "wide", context: "formatting" });
746
- }
747
- },
748
- // Stand-alone month
749
- L: function(t, e, n) {
750
- const r = t.getMonth();
751
- switch (e) {
752
- // 1, 2, ..., 12
753
- case "L":
754
- return String(r + 1);
755
- // 01, 02, ..., 12
756
- case "LL":
757
- return s(r + 1, 2);
758
- // 1st, 2nd, ..., 12th
759
- case "Lo":
760
- return n.ordinalNumber(r + 1, { unit: "month" });
761
- // Jan, Feb, ..., Dec
762
- case "LLL":
763
- return n.month(r, {
764
- width: "abbreviated",
765
- context: "standalone"
766
- });
767
- // J, F, ..., D
768
- case "LLLLL":
769
- return n.month(r, {
770
- width: "narrow",
771
- context: "standalone"
772
- });
773
- default:
774
- return n.month(r, { width: "wide", context: "standalone" });
775
- }
776
- },
777
- // Local week of year
778
- w: function(t, e, n, r) {
779
- const a = vt(t, r);
780
- return e === "wo" ? n.ordinalNumber(a, { unit: "week" }) : s(a, e.length);
781
- },
782
- // ISO week of year
783
- I: function(t, e, n) {
784
- const r = Dt(t);
785
- return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) : s(r, e.length);
786
- },
787
- // Day of the month
788
- d: function(t, e, n) {
789
- return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : l.d(t, e);
790
- },
791
- // Day of year
792
- D: function(t, e, n) {
793
- const r = kt(t);
794
- return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : s(r, e.length);
795
- },
796
- // Day of week
797
- E: function(t, e, n) {
798
- const r = t.getDay();
799
- switch (e) {
800
- // Tue
801
- case "E":
802
- case "EE":
803
- case "EEE":
804
- return n.day(r, {
805
- width: "abbreviated",
806
- context: "formatting"
807
- });
808
- // T
809
- case "EEEEE":
810
- return n.day(r, {
811
- width: "narrow",
812
- context: "formatting"
813
- });
814
- // Tu
815
- case "EEEEEE":
816
- return n.day(r, {
817
- width: "short",
818
- context: "formatting"
819
- });
820
- default:
821
- return n.day(r, {
822
- width: "wide",
823
- context: "formatting"
824
- });
825
- }
826
- },
827
- // Local day of week
828
- e: function(t, e, n, r) {
829
- const a = t.getDay(), o = (a - r.weekStartsOn + 8) % 7 || 7;
830
- switch (e) {
831
- // Numerical value (Nth day of week with current locale or weekStartsOn)
832
- case "e":
833
- return String(o);
834
- // Padded numerical value
835
- case "ee":
836
- return s(o, 2);
837
- // 1st, 2nd, ..., 7th
838
- case "eo":
839
- return n.ordinalNumber(o, { unit: "day" });
840
- case "eee":
841
- return n.day(a, {
842
- width: "abbreviated",
843
- context: "formatting"
844
- });
845
- // T
846
- case "eeeee":
847
- return n.day(a, {
848
- width: "narrow",
849
- context: "formatting"
850
- });
851
- // Tu
852
- case "eeeeee":
853
- return n.day(a, {
854
- width: "short",
855
- context: "formatting"
856
- });
857
- default:
858
- return n.day(a, {
859
- width: "wide",
860
- context: "formatting"
861
- });
862
- }
863
- },
864
- // Stand-alone local day of week
865
- c: function(t, e, n, r) {
866
- const a = t.getDay(), o = (a - r.weekStartsOn + 8) % 7 || 7;
867
- switch (e) {
868
- // Numerical value (same as in `e`)
869
- case "c":
870
- return String(o);
871
- // Padded numerical value
872
- case "cc":
873
- return s(o, e.length);
874
- // 1st, 2nd, ..., 7th
875
- case "co":
876
- return n.ordinalNumber(o, { unit: "day" });
877
- case "ccc":
878
- return n.day(a, {
879
- width: "abbreviated",
880
- context: "standalone"
881
- });
882
- // T
883
- case "ccccc":
884
- return n.day(a, {
885
- width: "narrow",
886
- context: "standalone"
887
- });
888
- // Tu
889
- case "cccccc":
890
- return n.day(a, {
891
- width: "short",
892
- context: "standalone"
893
- });
894
- default:
895
- return n.day(a, {
896
- width: "wide",
897
- context: "standalone"
898
- });
899
- }
900
- },
901
- // ISO day of week
902
- i: function(t, e, n) {
903
- const r = t.getDay(), a = r === 0 ? 7 : r;
904
- switch (e) {
905
- // 2
906
- case "i":
907
- return String(a);
908
- // 02
909
- case "ii":
910
- return s(a, e.length);
911
- // 2nd
912
- case "io":
913
- return n.ordinalNumber(a, { unit: "day" });
914
- // Tue
915
- case "iii":
916
- return n.day(r, {
917
- width: "abbreviated",
918
- context: "formatting"
919
- });
920
- // T
921
- case "iiiii":
922
- return n.day(r, {
923
- width: "narrow",
924
- context: "formatting"
925
- });
926
- // Tu
927
- case "iiiiii":
928
- return n.day(r, {
929
- width: "short",
930
- context: "formatting"
931
- });
932
- default:
933
- return n.day(r, {
934
- width: "wide",
935
- context: "formatting"
936
- });
937
- }
938
- },
939
- // AM or PM
940
- a: function(t, e, n) {
941
- const a = t.getHours() / 12 >= 1 ? "pm" : "am";
942
- switch (e) {
943
- case "a":
944
- case "aa":
945
- return n.dayPeriod(a, {
946
- width: "abbreviated",
947
- context: "formatting"
948
- });
949
- case "aaa":
950
- return n.dayPeriod(a, {
951
- width: "abbreviated",
952
- context: "formatting"
953
- }).toLowerCase();
954
- case "aaaaa":
955
- return n.dayPeriod(a, {
956
- width: "narrow",
957
- context: "formatting"
958
- });
959
- default:
960
- return n.dayPeriod(a, {
961
- width: "wide",
962
- context: "formatting"
963
- });
964
- }
965
- },
966
- // AM, PM, midnight, noon
967
- b: function(t, e, n) {
968
- const r = t.getHours();
969
- let a;
970
- switch (r === 12 ? a = y.noon : r === 0 ? a = y.midnight : a = r / 12 >= 1 ? "pm" : "am", e) {
971
- case "b":
972
- case "bb":
973
- return n.dayPeriod(a, {
974
- width: "abbreviated",
975
- context: "formatting"
976
- });
977
- case "bbb":
978
- return n.dayPeriod(a, {
979
- width: "abbreviated",
980
- context: "formatting"
981
- }).toLowerCase();
982
- case "bbbbb":
983
- return n.dayPeriod(a, {
984
- width: "narrow",
985
- context: "formatting"
986
- });
987
- default:
988
- return n.dayPeriod(a, {
989
- width: "wide",
990
- context: "formatting"
991
- });
992
- }
993
- },
994
- // in the morning, in the afternoon, in the evening, at night
995
- B: function(t, e, n) {
996
- const r = t.getHours();
997
- let a;
998
- switch (r >= 17 ? a = y.evening : r >= 12 ? a = y.afternoon : r >= 4 ? a = y.morning : a = y.night, e) {
999
- case "B":
1000
- case "BB":
1001
- case "BBB":
1002
- return n.dayPeriod(a, {
1003
- width: "abbreviated",
1004
- context: "formatting"
1005
- });
1006
- case "BBBBB":
1007
- return n.dayPeriod(a, {
1008
- width: "narrow",
1009
- context: "formatting"
1010
- });
1011
- default:
1012
- return n.dayPeriod(a, {
1013
- width: "wide",
1014
- context: "formatting"
1015
- });
1016
- }
1017
- },
1018
- // Hour [1-12]
1019
- h: function(t, e, n) {
1020
- if (e === "ho") {
1021
- let r = t.getHours() % 12;
1022
- return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
1023
- }
1024
- return l.h(t, e);
1025
- },
1026
- // Hour [0-23]
1027
- H: function(t, e, n) {
1028
- return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : l.H(t, e);
1029
- },
1030
- // Hour [0-11]
1031
- K: function(t, e, n) {
1032
- const r = t.getHours() % 12;
1033
- return e === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : s(r, e.length);
1034
- },
1035
- // Hour [1-24]
1036
- k: function(t, e, n) {
1037
- let r = t.getHours();
1038
- return r === 0 && (r = 24), e === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : s(r, e.length);
1039
- },
1040
- // Minute
1041
- m: function(t, e, n) {
1042
- return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : l.m(t, e);
1043
- },
1044
- // Second
1045
- s: function(t, e, n) {
1046
- return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : l.s(t, e);
1047
- },
1048
- // Fraction of second
1049
- S: function(t, e) {
1050
- return l.S(t, e);
1051
- },
1052
- // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1053
- X: function(t, e, n) {
1054
- const r = t.getTimezoneOffset();
1055
- if (r === 0)
1056
- return "Z";
1057
- switch (e) {
1058
- // Hours and optional minutes
1059
- case "X":
1060
- return T(r);
1061
- // Hours, minutes and optional seconds without `:` delimiter
1062
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1063
- // so this token always has the same output as `XX`
1064
- case "XXXX":
1065
- case "XX":
1066
- return w(r);
1067
- // Hours and minutes with `:` delimiter
1068
- default:
1069
- return w(r, ":");
1070
- }
1071
- },
1072
- // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1073
- x: function(t, e, n) {
1074
- const r = t.getTimezoneOffset();
1075
- switch (e) {
1076
- // Hours and optional minutes
1077
- case "x":
1078
- return T(r);
1079
- // Hours, minutes and optional seconds without `:` delimiter
1080
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1081
- // so this token always has the same output as `xx`
1082
- case "xxxx":
1083
- case "xx":
1084
- return w(r);
1085
- // Hours and minutes with `:` delimiter
1086
- default:
1087
- return w(r, ":");
1088
- }
1089
- },
1090
- // Timezone (GMT)
1091
- O: function(t, e, n) {
1092
- const r = t.getTimezoneOffset();
1093
- switch (e) {
1094
- // Short
1095
- case "O":
1096
- case "OO":
1097
- case "OOO":
1098
- return "GMT" + Y(r, ":");
1099
- default:
1100
- return "GMT" + w(r, ":");
1101
- }
1102
- },
1103
- // Timezone (specific non-location)
1104
- z: function(t, e, n) {
1105
- const r = t.getTimezoneOffset();
1106
- switch (e) {
1107
- // Short
1108
- case "z":
1109
- case "zz":
1110
- case "zzz":
1111
- return "GMT" + Y(r, ":");
1112
- default:
1113
- return "GMT" + w(r, ":");
1114
- }
1115
- },
1116
- // Seconds timestamp
1117
- t: function(t, e, n) {
1118
- const r = Math.trunc(+t / 1e3);
1119
- return s(r, e.length);
1120
- },
1121
- // Milliseconds timestamp
1122
- T: function(t, e, n) {
1123
- return s(+t, e.length);
1124
- }
1125
- };
1126
- function Y(t, e = "") {
1127
- const n = t > 0 ? "-" : "+", r = Math.abs(t), a = Math.trunc(r / 60), o = r % 60;
1128
- return o === 0 ? n + String(a) : n + String(a) + e + s(o, 2);
1129
- }
1130
- function T(t, e) {
1131
- return t % 60 === 0 ? (t > 0 ? "-" : "+") + s(Math.abs(t) / 60, 2) : w(t, e);
1132
- }
1133
- function w(t, e = "") {
1134
- const n = t > 0 ? "-" : "+", r = Math.abs(t), a = s(Math.trunc(r / 60), 2), o = s(r % 60, 2);
1135
- return n + a + e + o;
1136
- }
1137
- const E = (t, e) => {
1138
- switch (t) {
1139
- case "P":
1140
- return e.date({ width: "short" });
1141
- case "PP":
1142
- return e.date({ width: "medium" });
1143
- case "PPP":
1144
- return e.date({ width: "long" });
1145
- default:
1146
- return e.date({ width: "full" });
1147
- }
1148
- }, H = (t, e) => {
1149
- switch (t) {
1150
- case "p":
1151
- return e.time({ width: "short" });
1152
- case "pp":
1153
- return e.time({ width: "medium" });
1154
- case "ppp":
1155
- return e.time({ width: "long" });
1156
- default:
1157
- return e.time({ width: "full" });
1158
- }
1159
- }, St = (t, e) => {
1160
- const n = t.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
1161
- if (!a)
1162
- return E(t, e);
1163
- let o;
1164
- switch (r) {
1165
- case "P":
1166
- o = e.dateTime({ width: "short" });
1167
- break;
1168
- case "PP":
1169
- o = e.dateTime({ width: "medium" });
1170
- break;
1171
- case "PPP":
1172
- o = e.dateTime({ width: "long" });
1173
- break;
1174
- default:
1175
- o = e.dateTime({ width: "full" });
1176
- break;
1177
- }
1178
- return o.replace("{{date}}", E(r, e)).replace("{{time}}", H(a, e));
1179
- }, Yt = {
1180
- p: H,
1181
- P: St
1182
- }, Tt = /^D+$/, Et = /^Y+$/, Ft = ["D", "DD", "YY", "YYYY"];
1183
- function Ct(t) {
1184
- return Tt.test(t);
1185
- }
1186
- function qt(t) {
1187
- return Et.test(t);
1188
- }
1189
- function Nt(t, e, n) {
1190
- const r = Ht(t, e, n);
1191
- if (console.warn(r), Ft.includes(t)) throw new RangeError(r);
1192
- }
1193
- function Ht(t, e, n) {
1194
- const r = t[0] === "Y" ? "years" : "days of the month";
1195
- return `Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
1196
- }
1197
- const _t = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Qt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, jt = /^'([^]*?)'?$/, Xt = /''/g, Lt = /[a-zA-Z]/;
1198
- function Bt(t, e, n) {
1199
- const r = O(), a = r.locale ?? xt, o = r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, i = r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, u = h(t, n?.in);
1200
- if (!G(u))
1201
- throw new RangeError("Invalid time value");
1202
- let f = e.match(Qt).map((d) => {
1203
- const c = d[0];
1204
- if (c === "p" || c === "P") {
1205
- const x = Yt[c];
1206
- return x(d, a.formatLong);
1207
- }
1208
- return d;
1209
- }).join("").match(_t).map((d) => {
1210
- if (d === "''")
1211
- return { isToken: !1, value: "'" };
1212
- const c = d[0];
1213
- if (c === "'")
1214
- return { isToken: !1, value: Gt(d) };
1215
- if (S[c])
1216
- return { isToken: !0, value: d };
1217
- if (c.match(Lt))
1218
- throw new RangeError(
1219
- "Format string contains an unescaped latin alphabet character `" + c + "`"
1220
- );
1221
- return { isToken: !1, value: d };
1222
- });
1223
- a.localize.preprocessor && (f = a.localize.preprocessor(u, f));
1224
- const m = {
1225
- firstWeekContainsDate: o,
1226
- weekStartsOn: i,
1227
- locale: a
1228
- };
1229
- return f.map((d) => {
1230
- if (!d.isToken) return d.value;
1231
- const c = d.value;
1232
- (qt(c) || Ct(c)) && Nt(c, e, String(t));
1233
- const x = S[c[0]];
1234
- return x(u, c, a.localize, m);
1235
- }).join("");
1236
- }
1237
- function Gt(t) {
1238
- const e = t.match(jt);
1239
- return e ? e[1].replace(Xt, "'") : t;
1240
- }
1241
- function It(t) {
1242
- let e = t?.date, n = t?.format;
1243
- return e ? /* @__PURE__ */ F.jsx("span", { "date-renderer": "ArticlesDate", children: Bt(new Date(e), n || "MM/dd/yy - h:mmaa") }) : "Need date prop";
1244
- }
1245
- function Jt(t) {
1246
- return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
1247
- }
1248
- export {
1249
- It as A,
1250
- Rt as L,
1251
- j as a,
1252
- Bt as f,
1253
- Vt as m,
1254
- Jt as n,
1255
- h as t
1256
- };