@jobber/components 9.14.2 → 9.14.4

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 (60) hide show
  1. package/dist/ActivityIndicator-cjs.js +1 -1
  2. package/dist/ActivityIndicator-es.js +1 -1
  3. package/dist/ConfirmationModal-cjs.js +1 -1
  4. package/dist/ConfirmationModal-es.js +1 -1
  5. package/dist/DataList/components/DataListFilters/components/DataListSort/index.cjs +3 -2
  6. package/dist/DataList/components/DataListFilters/components/DataListSort/index.mjs +3 -2
  7. package/dist/DataList/components/DataListFilters/index.cjs +3 -2
  8. package/dist/DataList/components/DataListFilters/index.mjs +3 -2
  9. package/dist/DataList/components/DataListTotalCount/DataListTotalCount.messages.d.ts +9 -7
  10. package/dist/DataList/index.cjs +1 -0
  11. package/dist/DataList/index.mjs +1 -0
  12. package/dist/DataListTotalCount-cjs.js +11 -9
  13. package/dist/DataListTotalCount-es.js +11 -9
  14. package/dist/DatePicker/index.cjs +2 -1
  15. package/dist/DatePicker/index.mjs +2 -1
  16. package/dist/DatePicker-cjs.js +70 -708
  17. package/dist/DatePicker-es.js +68 -706
  18. package/dist/FilterPicker/FilterPicker.messages.d.ts +51 -0
  19. package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentHeader/index.cjs +3 -0
  20. package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentHeader/index.mjs +3 -0
  21. package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentList/index.cjs +1 -0
  22. package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentList/index.mjs +1 -0
  23. package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentSearch/index.cjs +3 -0
  24. package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentSearch/index.mjs +3 -0
  25. package/dist/FilterPicker/components/FilterPickerContent/index.cjs +3 -2
  26. package/dist/FilterPicker/components/FilterPickerContent/index.mjs +3 -2
  27. package/dist/FilterPicker/components/FilterPickerTrigger/index.cjs +1 -0
  28. package/dist/FilterPicker/components/FilterPickerTrigger/index.mjs +1 -0
  29. package/dist/FilterPicker/index.cjs +3 -2
  30. package/dist/FilterPicker/index.mjs +3 -2
  31. package/dist/FilterPicker.messages-cjs.js +58 -0
  32. package/dist/FilterPicker.messages-es.js +56 -0
  33. package/dist/FilterPickerContentHeader-cjs.js +12 -8
  34. package/dist/FilterPickerContentHeader-es.js +12 -8
  35. package/dist/FilterPickerContentList-cjs.js +10 -10
  36. package/dist/FilterPickerContentList-es.js +10 -10
  37. package/dist/FilterPickerContentSearch-cjs.js +8 -2
  38. package/dist/FilterPickerContentSearch-es.js +8 -2
  39. package/dist/FilterPickerTrigger-cjs.js +7 -2
  40. package/dist/FilterPickerTrigger-es.js +7 -2
  41. package/dist/InputDate/index.cjs +1 -0
  42. package/dist/InputDate/index.mjs +1 -0
  43. package/dist/Spinner-cjs.js +1 -1
  44. package/dist/Spinner-es.js +1 -1
  45. package/dist/dateLocale-cjs.js +1146 -0
  46. package/dist/dateLocale-es.js +1142 -0
  47. package/dist/docs/AtlantisThemeContext/AtlantisThemeContext.md +24 -9
  48. package/dist/docs/FilterPicker/FilterPicker.md +9 -4
  49. package/dist/docs/Icon/Icon.md +1 -0
  50. package/dist/index.cjs +2 -0
  51. package/dist/index.mjs +2 -0
  52. package/dist/sharedHelpers/i18n/dateLocale.d.ts +2 -0
  53. package/dist/sharedHelpers/i18n/index.cjs +3 -0
  54. package/dist/sharedHelpers/i18n/index.d.ts +1 -0
  55. package/dist/sharedHelpers/i18n/index.mjs +1 -0
  56. package/dist/sharedHelpers/i18n/releasedLanguages.d.ts +7 -0
  57. package/dist/sharedHelpers/i18n/useAtlantisI18n.d.ts +17 -6
  58. package/dist/useAtlantisI18n-cjs.js +23 -1
  59. package/dist/useAtlantisI18n-es.js +23 -1
  60. package/package.json +4 -3
@@ -0,0 +1,1146 @@
1
+ 'use strict';
2
+
3
+ var useAtlantisI18n = require('./useAtlantisI18n-cjs.js');
4
+
5
+ function buildFormatLongFn(args) {
6
+ return (options = {}) => {
7
+ // TODO: Remove String()
8
+ const width = options.width ? String(options.width) : args.defaultWidth;
9
+ const format = args.formats[width] || args.formats[args.defaultWidth];
10
+ return format;
11
+ };
12
+ }
13
+
14
+ /**
15
+ * The localize function argument callback which allows to convert raw value to
16
+ * the actual type.
17
+ *
18
+ * @param value - The value to convert
19
+ *
20
+ * @returns The converted value
21
+ */
22
+
23
+ /**
24
+ * The map of localized values for each width.
25
+ */
26
+
27
+ /**
28
+ * The index type of the locale unit value. It types conversion of units of
29
+ * values that don't start at 0 (i.e. quarters).
30
+ */
31
+
32
+ /**
33
+ * Converts the unit value to the tuple of values.
34
+ */
35
+
36
+ /**
37
+ * The tuple of localized era values. The first element represents BC,
38
+ * the second element represents AD.
39
+ */
40
+
41
+ /**
42
+ * The tuple of localized quarter values. The first element represents Q1.
43
+ */
44
+
45
+ /**
46
+ * The tuple of localized day values. The first element represents Sunday.
47
+ */
48
+
49
+ /**
50
+ * The tuple of localized month values. The first element represents January.
51
+ */
52
+
53
+ function buildLocalizeFn(args) {
54
+ return (value, options) => {
55
+ const context = options?.context ? String(options.context) : "standalone";
56
+
57
+ let valuesArray;
58
+ if (context === "formatting" && args.formattingValues) {
59
+ const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
60
+ const width = options?.width ? String(options.width) : defaultWidth;
61
+
62
+ valuesArray =
63
+ args.formattingValues[width] || args.formattingValues[defaultWidth];
64
+ } else {
65
+ const defaultWidth = args.defaultWidth;
66
+ const width = options?.width ? String(options.width) : args.defaultWidth;
67
+
68
+ valuesArray = args.values[width] || args.values[defaultWidth];
69
+ }
70
+ const index = args.argumentCallback ? args.argumentCallback(value) : value;
71
+
72
+ // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
73
+ return valuesArray[index];
74
+ };
75
+ }
76
+
77
+ function buildMatchFn(args) {
78
+ return (string, options = {}) => {
79
+ const width = options.width;
80
+
81
+ const matchPattern =
82
+ (width && args.matchPatterns[width]) ||
83
+ args.matchPatterns[args.defaultMatchWidth];
84
+ const matchResult = string.match(matchPattern);
85
+
86
+ if (!matchResult) {
87
+ return null;
88
+ }
89
+ const matchedString = matchResult[0];
90
+
91
+ const parsePatterns =
92
+ (width && args.parsePatterns[width]) ||
93
+ args.parsePatterns[args.defaultParseWidth];
94
+
95
+ const key = Array.isArray(parsePatterns)
96
+ ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))
97
+ : // [TODO] -- I challenge you to fix the type
98
+ findKey(parsePatterns, (pattern) => pattern.test(matchedString));
99
+
100
+ let value;
101
+
102
+ value = args.valueCallback ? args.valueCallback(key) : key;
103
+ value = options.valueCallback
104
+ ? // [TODO] -- I challenge you to fix the type
105
+ options.valueCallback(value)
106
+ : value;
107
+
108
+ const rest = string.slice(matchedString.length);
109
+
110
+ return { value, rest };
111
+ };
112
+ }
113
+
114
+ function findKey(object, predicate) {
115
+ for (const key in object) {
116
+ if (
117
+ Object.prototype.hasOwnProperty.call(object, key) &&
118
+ predicate(object[key])
119
+ ) {
120
+ return key;
121
+ }
122
+ }
123
+ return undefined;
124
+ }
125
+
126
+ function findIndex(array, predicate) {
127
+ for (let key = 0; key < array.length; key++) {
128
+ if (predicate(array[key])) {
129
+ return key;
130
+ }
131
+ }
132
+ return undefined;
133
+ }
134
+
135
+ function buildMatchPatternFn(args) {
136
+ return (string, options = {}) => {
137
+ const matchResult = string.match(args.matchPattern);
138
+ if (!matchResult) return null;
139
+ const matchedString = matchResult[0];
140
+
141
+ const parseResult = string.match(args.parsePattern);
142
+ if (!parseResult) return null;
143
+ let value = args.valueCallback
144
+ ? args.valueCallback(parseResult[0])
145
+ : parseResult[0];
146
+
147
+ // [TODO] I challenge you to fix the type
148
+ value = options.valueCallback ? options.valueCallback(value) : value;
149
+
150
+ const rest = string.slice(matchedString.length);
151
+
152
+ return { value, rest };
153
+ };
154
+ }
155
+
156
+ const formatDistanceLocale$1 = {
157
+ lessThanXSeconds: {
158
+ one: "less than a second",
159
+ other: "less than {{count}} seconds",
160
+ },
161
+
162
+ xSeconds: {
163
+ one: "1 second",
164
+ other: "{{count}} seconds",
165
+ },
166
+
167
+ halfAMinute: "half a minute",
168
+
169
+ lessThanXMinutes: {
170
+ one: "less than a minute",
171
+ other: "less than {{count}} minutes",
172
+ },
173
+
174
+ xMinutes: {
175
+ one: "1 minute",
176
+ other: "{{count}} minutes",
177
+ },
178
+
179
+ aboutXHours: {
180
+ one: "about 1 hour",
181
+ other: "about {{count}} hours",
182
+ },
183
+
184
+ xHours: {
185
+ one: "1 hour",
186
+ other: "{{count}} hours",
187
+ },
188
+
189
+ xDays: {
190
+ one: "1 day",
191
+ other: "{{count}} days",
192
+ },
193
+
194
+ aboutXWeeks: {
195
+ one: "about 1 week",
196
+ other: "about {{count}} weeks",
197
+ },
198
+
199
+ xWeeks: {
200
+ one: "1 week",
201
+ other: "{{count}} weeks",
202
+ },
203
+
204
+ aboutXMonths: {
205
+ one: "about 1 month",
206
+ other: "about {{count}} months",
207
+ },
208
+
209
+ xMonths: {
210
+ one: "1 month",
211
+ other: "{{count}} months",
212
+ },
213
+
214
+ aboutXYears: {
215
+ one: "about 1 year",
216
+ other: "about {{count}} years",
217
+ },
218
+
219
+ xYears: {
220
+ one: "1 year",
221
+ other: "{{count}} years",
222
+ },
223
+
224
+ overXYears: {
225
+ one: "over 1 year",
226
+ other: "over {{count}} years",
227
+ },
228
+
229
+ almostXYears: {
230
+ one: "almost 1 year",
231
+ other: "almost {{count}} years",
232
+ },
233
+ };
234
+
235
+ const formatDistance$1 = (token, count, options) => {
236
+ let result;
237
+
238
+ const tokenValue = formatDistanceLocale$1[token];
239
+ if (typeof tokenValue === "string") {
240
+ result = tokenValue;
241
+ } else if (count === 1) {
242
+ result = tokenValue.one;
243
+ } else {
244
+ result = tokenValue.other.replace("{{count}}", count.toString());
245
+ }
246
+
247
+ if (options?.addSuffix) {
248
+ if (options.comparison && options.comparison > 0) {
249
+ return "in " + result;
250
+ } else {
251
+ return result + " ago";
252
+ }
253
+ }
254
+
255
+ return result;
256
+ };
257
+
258
+ const formatRelativeLocale$1 = {
259
+ lastWeek: "'last' eeee 'at' p",
260
+ yesterday: "'yesterday at' p",
261
+ today: "'today at' p",
262
+ tomorrow: "'tomorrow at' p",
263
+ nextWeek: "eeee 'at' p",
264
+ other: "P",
265
+ };
266
+
267
+ const formatRelative$1 = (token, _date, _baseDate, _options) =>
268
+ formatRelativeLocale$1[token];
269
+
270
+ const eraValues$1 = {
271
+ narrow: ["B", "A"],
272
+ abbreviated: ["BC", "AD"],
273
+ wide: ["Before Christ", "Anno Domini"],
274
+ };
275
+
276
+ const quarterValues$1 = {
277
+ narrow: ["1", "2", "3", "4"],
278
+ abbreviated: ["Q1", "Q2", "Q3", "Q4"],
279
+ wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"],
280
+ };
281
+
282
+ // Note: in English, the names of days of the week and months are capitalized.
283
+ // If you are making a new locale based on this one, check if the same is true for the language you're working on.
284
+ // Generally, formatted dates should look like they are in the middle of a sentence,
285
+ // e.g. in Spanish language the weekdays and months should be in the lowercase.
286
+ const monthValues$1 = {
287
+ narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
288
+ abbreviated: [
289
+ "Jan",
290
+ "Feb",
291
+ "Mar",
292
+ "Apr",
293
+ "May",
294
+ "Jun",
295
+ "Jul",
296
+ "Aug",
297
+ "Sep",
298
+ "Oct",
299
+ "Nov",
300
+ "Dec",
301
+ ],
302
+
303
+ wide: [
304
+ "January",
305
+ "February",
306
+ "March",
307
+ "April",
308
+ "May",
309
+ "June",
310
+ "July",
311
+ "August",
312
+ "September",
313
+ "October",
314
+ "November",
315
+ "December",
316
+ ],
317
+ };
318
+
319
+ const dayValues$1 = {
320
+ narrow: ["S", "M", "T", "W", "T", "F", "S"],
321
+ short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
322
+ abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
323
+ wide: [
324
+ "Sunday",
325
+ "Monday",
326
+ "Tuesday",
327
+ "Wednesday",
328
+ "Thursday",
329
+ "Friday",
330
+ "Saturday",
331
+ ],
332
+ };
333
+
334
+ const dayPeriodValues$1 = {
335
+ narrow: {
336
+ am: "a",
337
+ pm: "p",
338
+ midnight: "mi",
339
+ noon: "n",
340
+ morning: "morning",
341
+ afternoon: "afternoon",
342
+ evening: "evening",
343
+ night: "night",
344
+ },
345
+ abbreviated: {
346
+ am: "AM",
347
+ pm: "PM",
348
+ midnight: "midnight",
349
+ noon: "noon",
350
+ morning: "morning",
351
+ afternoon: "afternoon",
352
+ evening: "evening",
353
+ night: "night",
354
+ },
355
+ wide: {
356
+ am: "a.m.",
357
+ pm: "p.m.",
358
+ midnight: "midnight",
359
+ noon: "noon",
360
+ morning: "morning",
361
+ afternoon: "afternoon",
362
+ evening: "evening",
363
+ night: "night",
364
+ },
365
+ };
366
+
367
+ const formattingDayPeriodValues$1 = {
368
+ narrow: {
369
+ am: "a",
370
+ pm: "p",
371
+ midnight: "mi",
372
+ noon: "n",
373
+ morning: "in the morning",
374
+ afternoon: "in the afternoon",
375
+ evening: "in the evening",
376
+ night: "at night",
377
+ },
378
+ abbreviated: {
379
+ am: "AM",
380
+ pm: "PM",
381
+ midnight: "midnight",
382
+ noon: "noon",
383
+ morning: "in the morning",
384
+ afternoon: "in the afternoon",
385
+ evening: "in the evening",
386
+ night: "at night",
387
+ },
388
+ wide: {
389
+ am: "a.m.",
390
+ pm: "p.m.",
391
+ midnight: "midnight",
392
+ noon: "noon",
393
+ morning: "in the morning",
394
+ afternoon: "in the afternoon",
395
+ evening: "in the evening",
396
+ night: "at night",
397
+ },
398
+ };
399
+
400
+ const ordinalNumber$1 = (dirtyNumber, _options) => {
401
+ const number = Number(dirtyNumber);
402
+
403
+ // If ordinal numbers depend on context, for example,
404
+ // if they are different for different grammatical genders,
405
+ // use `options.unit`.
406
+ //
407
+ // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
408
+ // 'day', 'hour', 'minute', 'second'.
409
+
410
+ const rem100 = number % 100;
411
+ if (rem100 > 20 || rem100 < 10) {
412
+ switch (rem100 % 10) {
413
+ case 1:
414
+ return number + "st";
415
+ case 2:
416
+ return number + "nd";
417
+ case 3:
418
+ return number + "rd";
419
+ }
420
+ }
421
+ return number + "th";
422
+ };
423
+
424
+ const localize$1 = {
425
+ ordinalNumber: ordinalNumber$1,
426
+
427
+ era: buildLocalizeFn({
428
+ values: eraValues$1,
429
+ defaultWidth: "wide",
430
+ }),
431
+
432
+ quarter: buildLocalizeFn({
433
+ values: quarterValues$1,
434
+ defaultWidth: "wide",
435
+ argumentCallback: (quarter) => quarter - 1,
436
+ }),
437
+
438
+ month: buildLocalizeFn({
439
+ values: monthValues$1,
440
+ defaultWidth: "wide",
441
+ }),
442
+
443
+ day: buildLocalizeFn({
444
+ values: dayValues$1,
445
+ defaultWidth: "wide",
446
+ }),
447
+
448
+ dayPeriod: buildLocalizeFn({
449
+ values: dayPeriodValues$1,
450
+ defaultWidth: "wide",
451
+ formattingValues: formattingDayPeriodValues$1,
452
+ defaultFormattingWidth: "wide",
453
+ }),
454
+ };
455
+
456
+ const matchOrdinalNumberPattern$1 = /^(\d+)(th|st|nd|rd)?/i;
457
+ const parseOrdinalNumberPattern$1 = /\d+/i;
458
+
459
+ const matchEraPatterns$1 = {
460
+ narrow: /^(b|a)/i,
461
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
462
+ wide: /^(before christ|before common era|anno domini|common era)/i,
463
+ };
464
+ const parseEraPatterns$1 = {
465
+ any: [/^b/i, /^(a|c)/i],
466
+ };
467
+
468
+ const matchQuarterPatterns$1 = {
469
+ narrow: /^[1234]/i,
470
+ abbreviated: /^q[1234]/i,
471
+ wide: /^[1234](th|st|nd|rd)? quarter/i,
472
+ };
473
+ const parseQuarterPatterns$1 = {
474
+ any: [/1/i, /2/i, /3/i, /4/i],
475
+ };
476
+
477
+ const matchMonthPatterns$1 = {
478
+ narrow: /^[jfmasond]/i,
479
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
480
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,
481
+ };
482
+ const parseMonthPatterns$1 = {
483
+ narrow: [
484
+ /^j/i,
485
+ /^f/i,
486
+ /^m/i,
487
+ /^a/i,
488
+ /^m/i,
489
+ /^j/i,
490
+ /^j/i,
491
+ /^a/i,
492
+ /^s/i,
493
+ /^o/i,
494
+ /^n/i,
495
+ /^d/i,
496
+ ],
497
+
498
+ any: [
499
+ /^ja/i,
500
+ /^f/i,
501
+ /^mar/i,
502
+ /^ap/i,
503
+ /^may/i,
504
+ /^jun/i,
505
+ /^jul/i,
506
+ /^au/i,
507
+ /^s/i,
508
+ /^o/i,
509
+ /^n/i,
510
+ /^d/i,
511
+ ],
512
+ };
513
+
514
+ const matchDayPatterns$1 = {
515
+ narrow: /^[smtwf]/i,
516
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
517
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
518
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,
519
+ };
520
+ const parseDayPatterns$1 = {
521
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
522
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],
523
+ };
524
+
525
+ const matchDayPeriodPatterns$1 = {
526
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
527
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,
528
+ };
529
+ const parseDayPeriodPatterns$1 = {
530
+ any: {
531
+ am: /^a/i,
532
+ pm: /^p/i,
533
+ midnight: /^mi/i,
534
+ noon: /^no/i,
535
+ morning: /morning/i,
536
+ afternoon: /afternoon/i,
537
+ evening: /evening/i,
538
+ night: /night/i,
539
+ },
540
+ };
541
+
542
+ const match$1 = {
543
+ ordinalNumber: buildMatchPatternFn({
544
+ matchPattern: matchOrdinalNumberPattern$1,
545
+ parsePattern: parseOrdinalNumberPattern$1,
546
+ valueCallback: (value) => parseInt(value, 10),
547
+ }),
548
+
549
+ era: buildMatchFn({
550
+ matchPatterns: matchEraPatterns$1,
551
+ defaultMatchWidth: "wide",
552
+ parsePatterns: parseEraPatterns$1,
553
+ defaultParseWidth: "any",
554
+ }),
555
+
556
+ quarter: buildMatchFn({
557
+ matchPatterns: matchQuarterPatterns$1,
558
+ defaultMatchWidth: "wide",
559
+ parsePatterns: parseQuarterPatterns$1,
560
+ defaultParseWidth: "any",
561
+ valueCallback: (index) => index + 1,
562
+ }),
563
+
564
+ month: buildMatchFn({
565
+ matchPatterns: matchMonthPatterns$1,
566
+ defaultMatchWidth: "wide",
567
+ parsePatterns: parseMonthPatterns$1,
568
+ defaultParseWidth: "any",
569
+ }),
570
+
571
+ day: buildMatchFn({
572
+ matchPatterns: matchDayPatterns$1,
573
+ defaultMatchWidth: "wide",
574
+ parsePatterns: parseDayPatterns$1,
575
+ defaultParseWidth: "any",
576
+ }),
577
+
578
+ dayPeriod: buildMatchFn({
579
+ matchPatterns: matchDayPeriodPatterns$1,
580
+ defaultMatchWidth: "any",
581
+ parsePatterns: parseDayPeriodPatterns$1,
582
+ defaultParseWidth: "any",
583
+ }),
584
+ };
585
+
586
+ const dateFormats$1 = {
587
+ full: "EEEE, MMMM do, y",
588
+ long: "MMMM do, y",
589
+ medium: "MMM d, y",
590
+ short: "MM/dd/yyyy",
591
+ };
592
+
593
+ const timeFormats$1 = {
594
+ full: "h:mm:ss a zzzz",
595
+ long: "h:mm:ss a z",
596
+ medium: "h:mm:ss a",
597
+ short: "h:mm a",
598
+ };
599
+
600
+ const dateTimeFormats$1 = {
601
+ full: "{{date}} 'at' {{time}}",
602
+ long: "{{date}} 'at' {{time}}",
603
+ medium: "{{date}}, {{time}}",
604
+ short: "{{date}}, {{time}}",
605
+ };
606
+
607
+ const formatLong$1 = {
608
+ date: buildFormatLongFn({
609
+ formats: dateFormats$1,
610
+ defaultWidth: "full",
611
+ }),
612
+
613
+ time: buildFormatLongFn({
614
+ formats: timeFormats$1,
615
+ defaultWidth: "full",
616
+ }),
617
+
618
+ dateTime: buildFormatLongFn({
619
+ formats: dateTimeFormats$1,
620
+ defaultWidth: "full",
621
+ }),
622
+ };
623
+
624
+ /**
625
+ * @category Locales
626
+ * @summary English locale (United States).
627
+ * @language English
628
+ * @iso-639-2 eng
629
+ * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
630
+ * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
631
+ */
632
+ const enUS = {
633
+ code: "en-US",
634
+ formatDistance: formatDistance$1,
635
+ formatLong: formatLong$1,
636
+ formatRelative: formatRelative$1,
637
+ localize: localize$1,
638
+ match: match$1,
639
+ options: {
640
+ weekStartsOn: 0 /* Sunday */,
641
+ firstWeekContainsDate: 1,
642
+ },
643
+ };
644
+
645
+ const formatDistanceLocale = {
646
+ lessThanXSeconds: {
647
+ one: "menos de un segundo",
648
+ other: "menos de {{count}} segundos",
649
+ },
650
+
651
+ xSeconds: {
652
+ one: "1 segundo",
653
+ other: "{{count}} segundos",
654
+ },
655
+
656
+ halfAMinute: "medio minuto",
657
+
658
+ lessThanXMinutes: {
659
+ one: "menos de un minuto",
660
+ other: "menos de {{count}} minutos",
661
+ },
662
+
663
+ xMinutes: {
664
+ one: "1 minuto",
665
+ other: "{{count}} minutos",
666
+ },
667
+
668
+ aboutXHours: {
669
+ one: "alrededor de 1 hora",
670
+ other: "alrededor de {{count}} horas",
671
+ },
672
+
673
+ xHours: {
674
+ one: "1 hora",
675
+ other: "{{count}} horas",
676
+ },
677
+
678
+ xDays: {
679
+ one: "1 día",
680
+ other: "{{count}} días",
681
+ },
682
+
683
+ aboutXWeeks: {
684
+ one: "alrededor de 1 semana",
685
+ other: "alrededor de {{count}} semanas",
686
+ },
687
+
688
+ xWeeks: {
689
+ one: "1 semana",
690
+ other: "{{count}} semanas",
691
+ },
692
+
693
+ aboutXMonths: {
694
+ one: "alrededor de 1 mes",
695
+ other: "alrededor de {{count}} meses",
696
+ },
697
+
698
+ xMonths: {
699
+ one: "1 mes",
700
+ other: "{{count}} meses",
701
+ },
702
+
703
+ aboutXYears: {
704
+ one: "alrededor de 1 año",
705
+ other: "alrededor de {{count}} años",
706
+ },
707
+
708
+ xYears: {
709
+ one: "1 año",
710
+ other: "{{count}} años",
711
+ },
712
+
713
+ overXYears: {
714
+ one: "más de 1 año",
715
+ other: "más de {{count}} años",
716
+ },
717
+
718
+ almostXYears: {
719
+ one: "casi 1 año",
720
+ other: "casi {{count}} años",
721
+ },
722
+ };
723
+
724
+ const formatDistance = (token, count, options) => {
725
+ let result;
726
+
727
+ const tokenValue = formatDistanceLocale[token];
728
+ if (typeof tokenValue === "string") {
729
+ result = tokenValue;
730
+ } else if (count === 1) {
731
+ result = tokenValue.one;
732
+ } else {
733
+ result = tokenValue.other.replace("{{count}}", count.toString());
734
+ }
735
+
736
+ if (options?.addSuffix) {
737
+ if (options.comparison && options.comparison > 0) {
738
+ return "en " + result;
739
+ } else {
740
+ return "hace " + result;
741
+ }
742
+ }
743
+
744
+ return result;
745
+ };
746
+
747
+ const dateFormats = {
748
+ full: "EEEE, d 'de' MMMM 'de' y",
749
+ long: "d 'de' MMMM 'de' y",
750
+ medium: "d MMM y",
751
+ short: "dd/MM/y",
752
+ };
753
+
754
+ const timeFormats = {
755
+ full: "HH:mm:ss zzzz",
756
+ long: "HH:mm:ss z",
757
+ medium: "HH:mm:ss",
758
+ short: "HH:mm",
759
+ };
760
+
761
+ const dateTimeFormats = {
762
+ full: "{{date}} 'a las' {{time}}",
763
+ long: "{{date}} 'a las' {{time}}",
764
+ medium: "{{date}}, {{time}}",
765
+ short: "{{date}}, {{time}}",
766
+ };
767
+
768
+ const formatLong = {
769
+ date: buildFormatLongFn({
770
+ formats: dateFormats,
771
+ defaultWidth: "full",
772
+ }),
773
+
774
+ time: buildFormatLongFn({
775
+ formats: timeFormats,
776
+ defaultWidth: "full",
777
+ }),
778
+
779
+ dateTime: buildFormatLongFn({
780
+ formats: dateTimeFormats,
781
+ defaultWidth: "full",
782
+ }),
783
+ };
784
+
785
+ const formatRelativeLocale = {
786
+ lastWeek: "'el' eeee 'pasado a la' p",
787
+ yesterday: "'ayer a la' p",
788
+ today: "'hoy a la' p",
789
+ tomorrow: "'mañana a la' p",
790
+ nextWeek: "eeee 'a la' p",
791
+ other: "P",
792
+ };
793
+
794
+ const formatRelativeLocalePlural = {
795
+ lastWeek: "'el' eeee 'pasado a las' p",
796
+ yesterday: "'ayer a las' p",
797
+ today: "'hoy a las' p",
798
+ tomorrow: "'mañana a las' p",
799
+ nextWeek: "eeee 'a las' p",
800
+ other: "P",
801
+ };
802
+
803
+ const formatRelative = (token, date, _baseDate, _options) => {
804
+ if (date.getHours() !== 1) {
805
+ return formatRelativeLocalePlural[token];
806
+ } else {
807
+ return formatRelativeLocale[token];
808
+ }
809
+ };
810
+
811
+ const eraValues = {
812
+ narrow: ["AC", "DC"],
813
+ abbreviated: ["AC", "DC"],
814
+ wide: ["antes de cristo", "después de cristo"],
815
+ };
816
+
817
+ const quarterValues = {
818
+ narrow: ["1", "2", "3", "4"],
819
+ abbreviated: ["T1", "T2", "T3", "T4"],
820
+ wide: ["1º trimestre", "2º trimestre", "3º trimestre", "4º trimestre"],
821
+ };
822
+
823
+ const monthValues = {
824
+ narrow: ["e", "f", "m", "a", "m", "j", "j", "a", "s", "o", "n", "d"],
825
+ abbreviated: [
826
+ "ene",
827
+ "feb",
828
+ "mar",
829
+ "abr",
830
+ "may",
831
+ "jun",
832
+ "jul",
833
+ "ago",
834
+ "sep",
835
+ "oct",
836
+ "nov",
837
+ "dic",
838
+ ],
839
+
840
+ wide: [
841
+ "enero",
842
+ "febrero",
843
+ "marzo",
844
+ "abril",
845
+ "mayo",
846
+ "junio",
847
+ "julio",
848
+ "agosto",
849
+ "septiembre",
850
+ "octubre",
851
+ "noviembre",
852
+ "diciembre",
853
+ ],
854
+ };
855
+
856
+ const dayValues = {
857
+ narrow: ["d", "l", "m", "m", "j", "v", "s"],
858
+ short: ["do", "lu", "ma", "mi", "ju", "vi", "sá"],
859
+ abbreviated: ["dom", "lun", "mar", "mié", "jue", "vie", "sáb"],
860
+ wide: [
861
+ "domingo",
862
+ "lunes",
863
+ "martes",
864
+ "miércoles",
865
+ "jueves",
866
+ "viernes",
867
+ "sábado",
868
+ ],
869
+ };
870
+
871
+ const dayPeriodValues = {
872
+ narrow: {
873
+ am: "a",
874
+ pm: "p",
875
+ midnight: "mn",
876
+ noon: "md",
877
+ morning: "mañana",
878
+ afternoon: "tarde",
879
+ evening: "tarde",
880
+ night: "noche",
881
+ },
882
+ abbreviated: {
883
+ am: "AM",
884
+ pm: "PM",
885
+ midnight: "medianoche",
886
+ noon: "mediodia",
887
+ morning: "mañana",
888
+ afternoon: "tarde",
889
+ evening: "tarde",
890
+ night: "noche",
891
+ },
892
+ wide: {
893
+ am: "a.m.",
894
+ pm: "p.m.",
895
+ midnight: "medianoche",
896
+ noon: "mediodia",
897
+ morning: "mañana",
898
+ afternoon: "tarde",
899
+ evening: "tarde",
900
+ night: "noche",
901
+ },
902
+ };
903
+
904
+ const formattingDayPeriodValues = {
905
+ narrow: {
906
+ am: "a",
907
+ pm: "p",
908
+ midnight: "mn",
909
+ noon: "md",
910
+ morning: "de la mañana",
911
+ afternoon: "de la tarde",
912
+ evening: "de la tarde",
913
+ night: "de la noche",
914
+ },
915
+ abbreviated: {
916
+ am: "AM",
917
+ pm: "PM",
918
+ midnight: "medianoche",
919
+ noon: "mediodia",
920
+ morning: "de la mañana",
921
+ afternoon: "de la tarde",
922
+ evening: "de la tarde",
923
+ night: "de la noche",
924
+ },
925
+ wide: {
926
+ am: "a.m.",
927
+ pm: "p.m.",
928
+ midnight: "medianoche",
929
+ noon: "mediodia",
930
+ morning: "de la mañana",
931
+ afternoon: "de la tarde",
932
+ evening: "de la tarde",
933
+ night: "de la noche",
934
+ },
935
+ };
936
+
937
+ const ordinalNumber = (dirtyNumber, _options) => {
938
+ const number = Number(dirtyNumber);
939
+ return number + "º";
940
+ };
941
+
942
+ const localize = {
943
+ ordinalNumber: ordinalNumber,
944
+
945
+ era: buildLocalizeFn({
946
+ values: eraValues,
947
+ defaultWidth: "wide",
948
+ }),
949
+
950
+ quarter: buildLocalizeFn({
951
+ values: quarterValues,
952
+ defaultWidth: "wide",
953
+ argumentCallback: (quarter) => Number(quarter) - 1,
954
+ }),
955
+
956
+ month: buildLocalizeFn({
957
+ values: monthValues,
958
+ defaultWidth: "wide",
959
+ }),
960
+
961
+ day: buildLocalizeFn({
962
+ values: dayValues,
963
+ defaultWidth: "wide",
964
+ }),
965
+
966
+ dayPeriod: buildLocalizeFn({
967
+ values: dayPeriodValues,
968
+ defaultWidth: "wide",
969
+ formattingValues: formattingDayPeriodValues,
970
+ defaultFormattingWidth: "wide",
971
+ }),
972
+ };
973
+
974
+ const matchOrdinalNumberPattern = /^(\d+)(º)?/i;
975
+ const parseOrdinalNumberPattern = /\d+/i;
976
+
977
+ const matchEraPatterns = {
978
+ narrow: /^(ac|dc|a|d)/i,
979
+ abbreviated: /^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,
980
+ wide: /^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i,
981
+ };
982
+ const parseEraPatterns = {
983
+ any: [/^ac/i, /^dc/i],
984
+ wide: [
985
+ /^(antes de cristo|antes de la era com[uú]n)/i,
986
+ /^(despu[eé]s de cristo|era com[uú]n)/i,
987
+ ],
988
+ };
989
+
990
+ const matchQuarterPatterns = {
991
+ narrow: /^[1234]/i,
992
+ abbreviated: /^T[1234]/i,
993
+ wide: /^[1234](º)? trimestre/i,
994
+ };
995
+ const parseQuarterPatterns = {
996
+ any: [/1/i, /2/i, /3/i, /4/i],
997
+ };
998
+
999
+ const matchMonthPatterns = {
1000
+ narrow: /^[efmajsond]/i,
1001
+ abbreviated: /^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,
1002
+ wide: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
1003
+ };
1004
+ const parseMonthPatterns = {
1005
+ narrow: [
1006
+ /^e/i,
1007
+ /^f/i,
1008
+ /^m/i,
1009
+ /^a/i,
1010
+ /^m/i,
1011
+ /^j/i,
1012
+ /^j/i,
1013
+ /^a/i,
1014
+ /^s/i,
1015
+ /^o/i,
1016
+ /^n/i,
1017
+ /^d/i,
1018
+ ],
1019
+
1020
+ any: [
1021
+ /^en/i,
1022
+ /^feb/i,
1023
+ /^mar/i,
1024
+ /^abr/i,
1025
+ /^may/i,
1026
+ /^jun/i,
1027
+ /^jul/i,
1028
+ /^ago/i,
1029
+ /^sep/i,
1030
+ /^oct/i,
1031
+ /^nov/i,
1032
+ /^dic/i,
1033
+ ],
1034
+ };
1035
+
1036
+ const matchDayPatterns = {
1037
+ narrow: /^[dlmjvs]/i,
1038
+ short: /^(do|lu|ma|mi|ju|vi|s[áa])/i,
1039
+ abbreviated: /^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,
1040
+ wide: /^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i,
1041
+ };
1042
+ const parseDayPatterns = {
1043
+ narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^j/i, /^v/i, /^s/i],
1044
+ any: [/^do/i, /^lu/i, /^ma/i, /^mi/i, /^ju/i, /^vi/i, /^sa/i],
1045
+ };
1046
+
1047
+ const matchDayPeriodPatterns = {
1048
+ narrow: /^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,
1049
+ any: /^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i,
1050
+ };
1051
+ const parseDayPeriodPatterns = {
1052
+ any: {
1053
+ am: /^a/i,
1054
+ pm: /^p/i,
1055
+ midnight: /^mn/i,
1056
+ noon: /^md/i,
1057
+ morning: /mañana/i,
1058
+ afternoon: /tarde/i,
1059
+ evening: /tarde/i,
1060
+ night: /noche/i,
1061
+ },
1062
+ };
1063
+
1064
+ const match = {
1065
+ ordinalNumber: buildMatchPatternFn({
1066
+ matchPattern: matchOrdinalNumberPattern,
1067
+ parsePattern: parseOrdinalNumberPattern,
1068
+ valueCallback: function (value) {
1069
+ return parseInt(value, 10);
1070
+ },
1071
+ }),
1072
+
1073
+ era: buildMatchFn({
1074
+ matchPatterns: matchEraPatterns,
1075
+ defaultMatchWidth: "wide",
1076
+ parsePatterns: parseEraPatterns,
1077
+ defaultParseWidth: "any",
1078
+ }),
1079
+
1080
+ quarter: buildMatchFn({
1081
+ matchPatterns: matchQuarterPatterns,
1082
+ defaultMatchWidth: "wide",
1083
+ parsePatterns: parseQuarterPatterns,
1084
+ defaultParseWidth: "any",
1085
+ valueCallback: (index) => index + 1,
1086
+ }),
1087
+
1088
+ month: buildMatchFn({
1089
+ matchPatterns: matchMonthPatterns,
1090
+ defaultMatchWidth: "wide",
1091
+ parsePatterns: parseMonthPatterns,
1092
+ defaultParseWidth: "any",
1093
+ }),
1094
+
1095
+ day: buildMatchFn({
1096
+ matchPatterns: matchDayPatterns,
1097
+ defaultMatchWidth: "wide",
1098
+ parsePatterns: parseDayPatterns,
1099
+ defaultParseWidth: "any",
1100
+ }),
1101
+
1102
+ dayPeriod: buildMatchFn({
1103
+ matchPatterns: matchDayPeriodPatterns,
1104
+ defaultMatchWidth: "any",
1105
+ parsePatterns: parseDayPeriodPatterns,
1106
+ defaultParseWidth: "any",
1107
+ }),
1108
+ };
1109
+
1110
+ /**
1111
+ * @category Locales
1112
+ * @summary Spanish locale.
1113
+ * @language Spanish
1114
+ * @iso-639-2 spa
1115
+ * @author Juan Angosto [@juanangosto](https://github.com/juanangosto)
1116
+ * @author Guillermo Grau [@guigrpa](https://github.com/guigrpa)
1117
+ * @author Fernando Agüero [@fjaguero](https://github.com/fjaguero)
1118
+ * @author Gastón Haro [@harogaston](https://github.com/harogaston)
1119
+ * @author Yago Carballo [@YagoCarballo](https://github.com/YagoCarballo)
1120
+ */
1121
+ const es = {
1122
+ code: "es",
1123
+ formatDistance: formatDistance,
1124
+ formatLong: formatLong,
1125
+ formatRelative: formatRelative,
1126
+ localize: localize,
1127
+ match: match,
1128
+ options: {
1129
+ weekStartsOn: 1 /* Monday */,
1130
+ firstWeekContainsDate: 1,
1131
+ },
1132
+ };
1133
+
1134
+ function getDateLocale(locale) {
1135
+ const language = locale.split("-")[0];
1136
+ if (language === "es")
1137
+ return es;
1138
+ return enUS;
1139
+ }
1140
+ function useDateLocale() {
1141
+ return getDateLocale(useAtlantisI18n.useReleasedLocale());
1142
+ }
1143
+
1144
+ exports.enUS = enUS;
1145
+ exports.getDateLocale = getDateLocale;
1146
+ exports.useDateLocale = useDateLocale;