@everymatrix/casino-challenges-container 0.0.14 → 0.0.16

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 (29) hide show
  1. package/dist/casino-challenges-container/casino-challenge-card_5.entry.js +1 -0
  2. package/dist/casino-challenges-container/casino-challenges-container-677ffb33.js +1 -0
  3. package/dist/casino-challenges-container/casino-challenges-container.esm.js +1 -1
  4. package/dist/casino-challenges-container/index-7720ad93.js +2 -0
  5. package/dist/casino-challenges-container/index.esm.js +1 -1
  6. package/dist/cjs/casino-challenge-card_5.cjs.entry.js +3108 -0
  7. package/dist/cjs/{casino-challenges-container-13757ed0.js → casino-challenges-container-50aca824.js} +32 -8
  8. package/dist/cjs/casino-challenges-container.cjs.js +2 -2
  9. package/dist/cjs/{index-2d1d2666.js → index-d5f8d1ee.js} +32 -5
  10. package/dist/cjs/index.cjs.js +2 -2
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/collection/collection-manifest.json +12 -0
  13. package/dist/collection/components/casino-challenges-container/casino-challenges-container.js +17 -3
  14. package/dist/collection/utils/locale.utils.js +16 -4
  15. package/dist/collection/utils/types.js +7 -0
  16. package/dist/esm/casino-challenge-card_5.entry.js +3101 -0
  17. package/dist/esm/{casino-challenges-container-e2d42fb0.js → casino-challenges-container-677ffb33.js} +32 -8
  18. package/dist/esm/casino-challenges-container.js +3 -3
  19. package/dist/esm/{index-7cb21c9d.js → index-7720ad93.js} +32 -5
  20. package/dist/esm/index.js +2 -2
  21. package/dist/esm/loader.js +3 -3
  22. package/dist/types/components/casino-challenges-container/casino-challenges-container.d.ts +3 -1
  23. package/dist/types/utils/types.d.ts +28 -1
  24. package/package.json +1 -1
  25. package/dist/casino-challenges-container/casino-challenges-container-e2d42fb0.js +0 -1
  26. package/dist/casino-challenges-container/casino-challenges-container_3.entry.js +0 -1
  27. package/dist/casino-challenges-container/index-7cb21c9d.js +0 -2
  28. package/dist/cjs/casino-challenges-container_3.cjs.entry.js +0 -283
  29. package/dist/esm/casino-challenges-container_3.entry.js +0 -278
@@ -0,0 +1,3101 @@
1
+ import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-7720ad93.js';
2
+ import { s as setClientStyling, a as setClientStylingURL, b as setStreamStyling } from './casino-challenges-container-677ffb33.js';
3
+ export { C as casino_challenges_container } from './casino-challenges-container-677ffb33.js';
4
+
5
+ const DEFAULT_LANGUAGE$1 = 'en';
6
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
7
+ const TRANSLATIONS$1 = {
8
+ en: {
9
+ totalLevels: 'Total levels:',
10
+ level1: 'Level 1:',
11
+ get: 'Get:',
12
+ endsIn: 'Ends In',
13
+ expired: 'Expired',
14
+ viewDetails: 'View details',
15
+ placeBetsOf: 'Place bets of',
16
+ place: 'Place',
17
+ bet: 'bet',
18
+ bets: 'bets',
19
+ minBet: 'min bet',
20
+ forfeited: 'Forfeited',
21
+ finished: 'Finished',
22
+ suspended: 'Suspended',
23
+ start: 'Start',
24
+ resume: 'Resume',
25
+ pause: 'Pause'
26
+ },
27
+ ro: {
28
+ totalLevels: 'Niveluri totale:',
29
+ level1: 'Nivel 1:',
30
+ get: 'Obține:',
31
+ endsIn: 'Se termină în',
32
+ expired: 'Expirat',
33
+ viewDetails: 'Vezi detalii',
34
+ placeBetsOf: 'Plasează pariuri de',
35
+ place: 'Plasare',
36
+ bet: 'pariu',
37
+ bets: 'pariuri',
38
+ minBet: 'pariu minim',
39
+ forfeited: 'Pierdut',
40
+ finished: 'Terminat',
41
+ suspended: 'Suspendat',
42
+ start: 'Start',
43
+ resume: 'Reia',
44
+ pause: 'Pauză'
45
+ },
46
+ fr: {
47
+ totalLevels: 'Niveaux totaux :',
48
+ level1: 'Niveau 1 :',
49
+ get: 'Obtenir :',
50
+ endsIn: 'Se termine dans',
51
+ expired: 'Expiré',
52
+ viewDetails: 'Voir les détails',
53
+ placeBetsOf: 'Placez des paris de',
54
+ place: 'Placer',
55
+ bet: 'pari',
56
+ bets: 'paris',
57
+ minBet: 'mise minimale',
58
+ forfeited: 'Forfait',
59
+ finished: 'Terminé',
60
+ suspended: 'Suspendu',
61
+ start: 'Démarrer',
62
+ resume: 'Reprendre',
63
+ pause: 'Pause'
64
+ },
65
+ ar: {
66
+ totalLevels: 'إجمالي المستويات:',
67
+ level1: 'المستوى 1:',
68
+ get: 'احصل على:',
69
+ endsIn: 'ينتهي في',
70
+ expired: 'منتهي الصلاحية',
71
+ viewDetails: 'عرض التفاصيل',
72
+ placeBetsOf: 'قم بوضع رهانات بقيمة',
73
+ place: 'ضع',
74
+ bet: 'رهان',
75
+ bets: 'رهانات',
76
+ minBet: 'الحد الأدنى للرهان',
77
+ forfeited: 'خاسر',
78
+ finished: 'منتهي',
79
+ suspended: 'معلق',
80
+ start: 'ابدأ',
81
+ resume: 'استئناف',
82
+ pause: 'إيقاف مؤقت'
83
+ },
84
+ hr: {
85
+ totalLevels: 'Ukupno razina:',
86
+ level1: 'Razina 1:',
87
+ get: 'Dobiti:',
88
+ endsIn: 'Završava za',
89
+ expired: 'Isteklo',
90
+ viewDetails: 'Pogledaj detalje',
91
+ placeBetsOf: 'Postavite oklade od',
92
+ place: 'Postavi',
93
+ bet: 'kladnja',
94
+ bets: 'kladnje',
95
+ minBet: 'minimalna oklada',
96
+ forfeited: 'Oduzeto',
97
+ finished: 'Završeno',
98
+ suspended: 'Suspendirano',
99
+ start: 'Počni',
100
+ resume: 'Nastavi',
101
+ pause: 'Pauza'
102
+ }
103
+ };
104
+ const translate$1 = (key, customLang) => {
105
+ const lang = customLang;
106
+ return TRANSLATIONS$1[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE$1][key];
107
+ };
108
+ const getTranslations$1 = (data) => {
109
+ Object.keys(data).forEach((item) => {
110
+ for (let key in data[item]) {
111
+ TRANSLATIONS$1[item][key] = data[item][key];
112
+ }
113
+ });
114
+ };
115
+ const resolveTranslationUrl$1 = async (translationUrl) => {
116
+ if (translationUrl) {
117
+ try {
118
+ const response = await fetch(translationUrl);
119
+ if (!response.ok) {
120
+ throw new Error(`HTTP error! status: ${response.status}`);
121
+ }
122
+ const translations = await response.json();
123
+ getTranslations$1(translations);
124
+ }
125
+ catch (error) {
126
+ console.error('Failed to fetch or parse translations from URL:', error);
127
+ }
128
+ }
129
+ };
130
+
131
+ var EChallengeLevelTargetType;
132
+ (function (EChallengeLevelTargetType) {
133
+ EChallengeLevelTargetType[EChallengeLevelTargetType["Accumulative"] = 0] = "Accumulative";
134
+ EChallengeLevelTargetType[EChallengeLevelTargetType["SingleBet"] = 1] = "SingleBet";
135
+ EChallengeLevelTargetType[EChallengeLevelTargetType["MultipleOneBetSize"] = 2] = "MultipleOneBetSize";
136
+ })(EChallengeLevelTargetType || (EChallengeLevelTargetType = {}));
137
+ var EChallengeRecurrenceType;
138
+ (function (EChallengeRecurrenceType) {
139
+ EChallengeRecurrenceType[EChallengeRecurrenceType["Single"] = 0] = "Single";
140
+ EChallengeRecurrenceType[EChallengeRecurrenceType["Daily"] = 1] = "Daily";
141
+ EChallengeRecurrenceType[EChallengeRecurrenceType["Weekly"] = 2] = "Weekly";
142
+ EChallengeRecurrenceType[EChallengeRecurrenceType["Monthly"] = 3] = "Monthly";
143
+ })(EChallengeRecurrenceType || (EChallengeRecurrenceType = {}));
144
+ var EChallengeRewardType;
145
+ (function (EChallengeRewardType) {
146
+ EChallengeRewardType[EChallengeRewardType["FreeSpins"] = 0] = "FreeSpins";
147
+ EChallengeRewardType[EChallengeRewardType["LuckyWheel"] = 1] = "LuckyWheel";
148
+ EChallengeRewardType[EChallengeRewardType["Leaderboard"] = 2] = "Leaderboard";
149
+ EChallengeRewardType[EChallengeRewardType["Challenge"] = 3] = "Challenge";
150
+ EChallengeRewardType[EChallengeRewardType["Custom"] = 4] = "Custom";
151
+ })(EChallengeRewardType || (EChallengeRewardType = {}));
152
+ var EChallengeProgressStatus;
153
+ (function (EChallengeProgressStatus) {
154
+ EChallengeProgressStatus[EChallengeProgressStatus["Closed"] = 0] = "Closed";
155
+ EChallengeProgressStatus[EChallengeProgressStatus["InProgress"] = 1] = "InProgress";
156
+ EChallengeProgressStatus[EChallengeProgressStatus["Fillup"] = 2] = "Fillup";
157
+ EChallengeProgressStatus[EChallengeProgressStatus["Completed"] = 3] = "Completed";
158
+ })(EChallengeProgressStatus || (EChallengeProgressStatus = {}));
159
+ var EChallengeStatus;
160
+ (function (EChallengeStatus) {
161
+ EChallengeStatus[EChallengeStatus["Started"] = 0] = "Started";
162
+ EChallengeStatus[EChallengeStatus["InProgress"] = 1] = "InProgress";
163
+ EChallengeStatus[EChallengeStatus["PendingLevelReward"] = 2] = "PendingLevelReward";
164
+ EChallengeStatus[EChallengeStatus["Completed"] = 3] = "Completed";
165
+ EChallengeStatus[EChallengeStatus["Expired"] = 4] = "Expired";
166
+ EChallengeStatus[EChallengeStatus["Forfeited"] = 5] = "Forfeited";
167
+ EChallengeStatus[EChallengeStatus["Awaiting"] = 6] = "Awaiting";
168
+ EChallengeStatus[EChallengeStatus["Paused"] = 7] = "Paused";
169
+ })(EChallengeStatus || (EChallengeStatus = {}));
170
+ const ChallengeStatusDictionary = [
171
+ 'started',
172
+ 'inProgress',
173
+ 'pendingLevelReward',
174
+ 'completed',
175
+ 'expired',
176
+ 'forfeited',
177
+ 'awaiting',
178
+ 'paused'
179
+ ];
180
+ var EChallengeTriggerType;
181
+ (function (EChallengeTriggerType) {
182
+ EChallengeTriggerType[EChallengeTriggerType["GameLaunch"] = 0] = "GameLaunch";
183
+ EChallengeTriggerType[EChallengeTriggerType["Reward"] = 1] = "Reward";
184
+ EChallengeTriggerType[EChallengeTriggerType["Manual"] = 2] = "Manual";
185
+ })(EChallengeTriggerType || (EChallengeTriggerType = {}));
186
+ var EChallengeValidityType;
187
+ (function (EChallengeValidityType) {
188
+ EChallengeValidityType[EChallengeValidityType["Period"] = 0] = "Period";
189
+ EChallengeValidityType[EChallengeValidityType["Date"] = 1] = "Date";
190
+ })(EChallengeValidityType || (EChallengeValidityType = {}));
191
+
192
+ function getTimeLeft(endTime) {
193
+ const now = new Date();
194
+ const end = new Date(endTime);
195
+ let diff = end.getTime() - now.getTime();
196
+ if (diff <= 0) {
197
+ return;
198
+ }
199
+ const days = Math.floor(diff / (1000 * 60 * 60 * 24));
200
+ diff -= days * (1000 * 60 * 60 * 24);
201
+ const hours = Math.floor(diff / (1000 * 60 * 60));
202
+ diff -= hours * (1000 * 60 * 60);
203
+ const minutes = Math.floor(diff / (1000 * 60));
204
+ diff -= minutes * (1000 * 60);
205
+ const seconds = Math.floor(diff / 1000);
206
+ const pad = (n) => n.toString().padStart(2, '0');
207
+ return `${pad(days)} : ${pad(hours)} : ${pad(minutes)} : ${pad(seconds)}`;
208
+ }
209
+
210
+ const finishSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEuNjQ0NTQgMTIuMTI2MkMxLjU5ODQyIDEyLjEyNzkgMS41NTEyOSAxMi4xMjI3IDEuNTA0MzIgMTIuMTA5OUMxLjI1NzU3IDEyLjA0MjEgMS4xMTI0OSAxMS43ODcyIDEuMTgwMjIgMTEuNTQwM0wzLjUzMDE2IDIuOTU4N0MzLjU5NzkxIDIuNzEyMSAzLjg1MjIyIDIuNTY2NzQgNC4wOTk3MyAyLjYzNDZDNC4zNDY0NyAyLjcwMjM0IDQuNDkxNTUgMi45NTcyNyA0LjQyMzgyIDMuMjA0MTZMMi4wNzM4OCAxMS43ODU4QzIuMDE5MDIgMTEuOTg1NSAxLjg0MTIzIDEyLjExODggMS42NDQ1NCAxMi4xMjYyWiIgZmlsbD0iIzM2QkEzQiIvPgo8cGF0aCBkPSJNMS41NjMwNCAxMS4yNjM0QzEuNTQ3NjggMTEu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IuMzg1MzYgNi4yMjU0OCAyLjYwMzY5WiIgZmlsbD0iI0Q4OTI0RSIvPgo8cGF0aCBkPSJNNi4yMjU0OCAyLjUwOTk0TDYuMzk0OSAzLjAzMTM2QzYuNDI2NjIgMy4xMjkgNi41MTc2MSAzLjE5NTExIDYuNjIwMjcgMy4xOTUxMUg3LjE2ODUzQzcuMzk4MDkgMy4xOTUxMSA3LjQ5MzU0IDMuNDg4ODYgNy4zMDc4MiAzLjYyMzhMNi44NjQyNyAzLjk0NjA2QzYuNzgxMjEgNC4wMDY0IDYuNzQ2NDYgNC4xMTMzNiA2Ljc3ODE4IDQuMjExTDYuOTQ3NjEgNC43MzI0M0M3LjAxODU0IDQuOTUwNzUgNi43Njg2NiA1LjEzMjMxIDYuNTgyOTQgNC45OTczN0w2LjEzOTM5IDQuNjc1MTFDNi4wNTYzMyA0LjYxNDc3IDUuOTQzODcgNC42MTQ3NyA1Ljg2MDgxIDQuNjc1MTFMNS40MTcyNiA0Ljk5NzM3QzUuMjMxNTQgNS4xMzIzMSA0Ljk4MTY1IDQuOTUwNzUgNS4wNTI1OSA0LjczMjQzTDUuMjIyMDEgNC4yMTFDNS4yNTM3NCA0LjExMzM2IDUuMjE4OTggNC4wMDY0IDUuMTM1OTMgMy45NDYwNkw0LjY5MjM4IDMuNjIzOEM0LjUwNjY2IDMuNDg4ODYgNC42MDIxIDMuMTk1MTEgNC44MzE2NyAzLjE5NTExSDUuMzc5OTNDNS40ODI1OSAzLjE5NTExIDUuNTczNTggMy4xMjkgNS42MDUzIDMuMDMxMzZMNS43NzQ3MiAyLjUwOTk0QzUuODQ1NjYgMi4yOTE2MSA2LjE1NDU0IDIuMjkxNjEgNi4yMjU0OCAyLjUwOTk0WiIgZmlsbD0iI0ZGRURDQyIvPgo8L3N2Zz4K';
213
+
214
+ const casinoChallengeCardCss = ".card {\n width: 308px;\n border-radius: 16px;\n border: 2px solid var(--emw--button-border-color, rgba(221, 255, 207, 0.1019607843));\n background-color: var(--emw--color-background, #141515);\n box-sizing: border-box;\n position: relative;\n}\n@container challenges-container (max-width: 576px) {\n .card {\n width: 100%;\n }\n}\n.card:hover {\n background: linear-gradient(90deg, rgb(0, 62, 92) 0%, rgb(17, 59, 33) 100%);\n cursor: pointer;\n}\n.card__image {\n width: 100%;\n height: 200px;\n border-radius: 16px 16px 0 0;\n}\n@container challenges-container (max-width: 576px) {\n .card__image {\n height: 224px;\n }\n}\n.card__image.grayed {\n opacity: 0.6;\n}\n.card__title {\n color: var(--emw--color-white, #FFFFFF);\n font-size: var(--emw--font-size-medium, 16px);\n margin: 0 0 10px;\n}\n.card__content {\n padding: 20px;\n}\n.card__button {\n margin-top: 20px;\n width: 100%;\n height: 34px;\n background: transparent;\n text-transform: uppercase;\n border-radius: var(--emw--button-border-radius, 99px);\n border: 2px solid var(--emw--button-border-color, #727672);\n font-size: var(--emw--font-size-x-small, 12px);\n font-weight: var(--emw--font-weight-bold, 700);\n color: var(--emw--color-secondary, #e9931e);\n}\n.card__button:hover {\n border-color: var(--emw--color-secondary, #e9931e);\n cursor: pointer;\n}\n.card__button.filled {\n background-color: var(--emw--button-background-primary-color, #18CE51);\n color: var(--emw--color-white, #FFFFFF);\n border-color: var(--emw--color-gray-300, #083B17);\n}\n.card__button.filled:hover {\n color: var(--emw--color-gray-300, #083B17);\n border-color: transparent;\n box-shadow: 0 0 4px 0 rgba(188, 252, 177, 0.2), 0 0 20px 0 rgba(0, 183, 79, 0.5);\n}\n.card__button.grayed {\n color: var(--emw--color-gray-50, #E2E2E2);\n}\n.card__button.grayed:hover {\n color: var(--emw--color-white, #FFFFFF);\n border-color: var(--emw--button-primary-border, #24B24E);\n}\n.card__button:hover {\n border-color: var(--emw--color-secondary, #e9931e);\n cursor: pointer;\n}\n.card__button:disabled, .card__button:disabled:hover {\n color: var(--emw--color-gray-50, #E2E2E2);\n cursor: not-allowed;\n border: 2px solid var(--emw--button-border-color, #727672);\n opacity: 0.7;\n}\n.card__badge {\n position: absolute;\n background: var(--emw--color-white, #FFFFFF);\n top: 6px;\n right: 6px;\n border-radius: 30px;\n padding: 2px 12px;\n line-height: 22px;\n font-weight: var(--emw--font-weight-medium, 500);\n font-size: var(--emw--font-size-x-small, 12px);\n box-shadow: 0 4px 4px 0 var(--emw--button-box-shadow-color, rgba(0, 0, 0, 0.25));\n backdrop-filter: blur(20px);\n box-sizing: border-box;\n}\n.card__badge span {\n font-weight: var(--emw--font-weight-bold, 700);\n}\n.card__badge.expired {\n background: var(--emw--background-gray-color, rgba(250, 250, 250, 0.5019607843));\n border: 1px solid var(--emw--border-gray-color, #292C29);\n font-weight: 700;\n}\n.card__badge.completed {\n background: var(--emw--background-success-color, #C9F0D7);\n border: 1px solid var(--emw--border-success-color, #00B74F);\n color: var(--emw--color-gray-300, #083B17);\n font-weight: 700;\n}\n.card__badge.forfeited {\n background: var(--emw--background-errored-color, #FFE1DF);\n border: 1px solid var(--emw--border-errored-color, #D6421E);\n color: var(--emw--errored-color, #850606);\n font-weight: 700;\n}\n.card__badge.paused {\n background: var(--emw--background-warning-color, #F8E4AD);\n border: 1px solid var(--emw--border-warning-color, #EA9018);\n color: var(--emw--warning-color, #6D460A);\n font-weight: 700;\n}\n\n.info-item {\n line-height: 24px;\n font-size: var(--emw--font-size-small, 14px);\n font-weight: var(--emw--font-weight-bold, 700);\n color: var(--emw--color-primary, #1dbf51);\n}\n@container challenges-container (min-width: 576px) {\n .info-item {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n vertical-align: bottom;\n }\n}\n.info-item.grayed {\n color: var(--emw--disabled-color, #727672);\n}\n.info-item__label {\n font-weight: var(--emw--font-weight-medium, 500);\n margin-right: 3px;\n color: var(--emw--color-gray-150, #C8D6CE);\n}\n.info-item__tooltip {\n position: absolute;\n line-height: 22px;\n padding: 8px 12px;\n border-radius: 8px;\n opacity: 1;\n z-index: 200;\n white-space: nowrap;\n font-size: var(--emw--font-size-x-small, 12px);\n font-weight: var(--emw--font-weight-medium, 500);\n color: var(--emw--color-white, #FFFFFF);\n background-color: var(--emw--color-background-secondary, #1B1C2B);\n}\n.info-item__tooltip::before {\n content: \"\";\n position: absolute;\n top: -5px;\n left: 50%;\n transform: translateX(-50%);\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-bottom: 6px solid var(--emw--color-background-secondary, #1B1C2B);\n width: 0;\n height: 0;\n z-index: 201;\n}\n\n.progress {\n background-color: var(--emw--progress-background, rgba(188, 252, 177, 0.1019607843));\n border-radius: 100px;\n height: 20px;\n margin-bottom: 10px;\n position: relative;\n align-content: center;\n padding: 0 2px;\n box-sizing: border-box;\n}\n.progress.paused {\n opacity: 0.5;\n}\n.progress.grayed {\n mix-blend-mode: luminosity;\n}\n.progress__placeholder {\n height: 20px;\n}\n.progress__icon {\n padding-top: 4px;\n}\n.progress__point {\n position: absolute;\n text-align: center;\n font-size: 12px;\n color: var(--emw--color-gray-150, #C8D6CE);\n font-weight: 700;\n line-height: 19px;\n top: 0;\n height: 19px;\n width: 19px;\n border-radius: 50%;\n}\n.progress__point.start {\n left: 0;\n border: 2px solid var(--emw--button-background-primary-color, #18CE51);\n background: linear-gradient(90deg, var(--emw--progress-active-level, #24AA4D) 0%, var(--emw--progress-active-level-secondary, #113F21) 100%);\n}\n.progress__point.end {\n right: 0;\n border: 2px solid var(--emw--dark-green, #1C8D56);\n background: var(--emw--color-gray-300, #083B17);\n opacity: 0.7;\n}\n.progress__point.finished {\n opacity: 1;\n}\n.progress__point.hidden {\n opacity: 0;\n}\n.progress__bar {\n border-radius: 73px;\n height: 16px;\n background: linear-gradient(90deg, var(--emw--secondary-green, #1E654F) 0%, var(--emw--dark-green, #1C8D56) 100%);\n text-align: end;\n color: var(--emw--color-gray-50, #E2E2E2);\n font-size: 11px;\n font-weight: 700;\n line-height: 16px;\n padding-right: 6px;\n box-sizing: border-box;\n}\n.progress__bar.finished {\n text-align: center;\n}";
215
+ const CasinoChallengeCardStyle0 = casinoChallengeCardCss;
216
+
217
+ const CasinoChallengeCard = class {
218
+ constructor(hostRef) {
219
+ registerInstance(this, hostRef);
220
+ this.timerExpired = createEvent(this, "timerExpired", 7);
221
+ this.calculateTargetValue = (level, currencySymbol) => {
222
+ var _a;
223
+ if (!level)
224
+ return '';
225
+ const minbet = ((_a = level.BetRange) === null || _a === void 0 ? void 0 : _a.MinBet)
226
+ ? `, ${translate$1('minBet', this.language)} ${currencySymbol + level.BetRange.MinBet}`
227
+ : '';
228
+ switch (level.LevelTargetType) {
229
+ case EChallengeLevelTargetType.Accumulative:
230
+ return `${translate$1('placeBetsOf', this.language)} ${currencySymbol + level.DisplayCurrencyTargetTurnover + minbet}`;
231
+ case EChallengeLevelTargetType.SingleBet:
232
+ return `${translate$1('place', this.language)} ${currencySymbol + level.TargetTurnover} ${translate$1('bet', this.language)}`;
233
+ case EChallengeLevelTargetType.MultipleOneBetSize:
234
+ return `${translate$1('place', this.language)} ${level.TargetBetCount} ${translate$1('bets', this.language) + minbet}`;
235
+ }
236
+ };
237
+ this.onMouseEnterHandler = (index, el) => {
238
+ if (el.scrollWidth > el.clientWidth) {
239
+ this.tooltipIndex = index;
240
+ }
241
+ };
242
+ this.onMouseLeaveHandler = () => {
243
+ this.tooltipIndex = null;
244
+ };
245
+ this.getBadgeContent = () => {
246
+ switch (this.challenge.Status) {
247
+ case EChallengeStatus.Expired:
248
+ return translate$1('expired', this.language);
249
+ case EChallengeStatus.Forfeited:
250
+ return translate$1('forfeited', this.language);
251
+ case EChallengeStatus.Completed:
252
+ return translate$1('finished', this.language);
253
+ case EChallengeStatus.Paused:
254
+ return translate$1('suspended', this.language);
255
+ default:
256
+ return this.timeLeft
257
+ ? [translate$1('endsIn', this.language), ' - ', h("span", null, this.timeLeft)]
258
+ : translate$1('expired', this.language);
259
+ }
260
+ };
261
+ this.goToDetailsPage = (challengeId) => () => {
262
+ window.postMessage({ type: 'GoToDetailsPage', info: { challengeId, activeTabIndex: this.activeTabIndex } }, window.location.href);
263
+ };
264
+ this.checkAttrs = () => {
265
+ if (!this.endpoint) {
266
+ this.error = 'Endpoint is missing! Please provide a valid endpointURL.';
267
+ this.hasError = true;
268
+ console.error(this.error);
269
+ }
270
+ return this.hasError;
271
+ };
272
+ this.mbSource = undefined;
273
+ this.clientStyling = undefined;
274
+ this.clientStylingUrl = undefined;
275
+ this.translationUrl = '';
276
+ this.language = 'en';
277
+ this.endpoint = '';
278
+ this.domain = '';
279
+ this.session = '';
280
+ this.challenge = undefined;
281
+ this.isUserAuthorized = true;
282
+ this.activeTabIndex = 0;
283
+ this.tooltipIndex = null;
284
+ this.timeLeft = undefined;
285
+ this.error = '';
286
+ this.hasError = false;
287
+ this.actionLoading = false;
288
+ }
289
+ get infoItems() {
290
+ var _a, _b, _c, _d, _e;
291
+ const level = this.isUserAuthorized
292
+ ? (_a = this.challenge) === null || _a === void 0 ? void 0 : _a.LevelProgresses.find((x) => x.ProgressStatus === EChallengeProgressStatus.InProgress)
293
+ : (_b = this.challenge) === null || _b === void 0 ? void 0 : _b.LevelProgresses.find((x) => x.OrderNumber === 0);
294
+ if (level) {
295
+ const rewardValue = (_c = level.Rewards) === null || _c === void 0 ? void 0 : _c.slice(0, 2).map((r) => r.RewardDescription).join(' + ');
296
+ return [
297
+ {
298
+ lable: translate$1('totalLevels', this.language),
299
+ value: (_d = this.challenge.LevelProgresses) === null || _d === void 0 ? void 0 : _d.length
300
+ },
301
+ {
302
+ lable: translate$1('level1', this.language),
303
+ value: this.calculateTargetValue(level, (_e = this.challenge) === null || _e === void 0 ? void 0 : _e.CurrencySymbol)
304
+ },
305
+ {
306
+ lable: translate$1('get', this.language),
307
+ value: rewardValue
308
+ }
309
+ ];
310
+ }
311
+ return [];
312
+ }
313
+ handleClientStylingChange(newValue, oldValue) {
314
+ if (newValue != oldValue) {
315
+ setClientStyling(this.stylingContainer, this.clientStyling);
316
+ }
317
+ }
318
+ handleClientStylingUrlChange(newValue, oldValue) {
319
+ if (newValue != oldValue) {
320
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
321
+ }
322
+ }
323
+ handleMbSourceChange(newValue, oldValue) {
324
+ if (newValue != oldValue) {
325
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
326
+ }
327
+ }
328
+ connectedCallback() {
329
+ this.timerId = setInterval(() => {
330
+ this.updateTime();
331
+ }, 1000);
332
+ }
333
+ componentWillLoad() {
334
+ if (this.translationUrl) {
335
+ resolveTranslationUrl$1(this.translationUrl);
336
+ }
337
+ this.updateTime();
338
+ }
339
+ componentDidLoad() {
340
+ if (this.stylingContainer) {
341
+ if (this.mbSource)
342
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
343
+ if (this.clientStyling)
344
+ setClientStyling(this.stylingContainer, this.clientStyling);
345
+ if (this.clientStylingUrl)
346
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
347
+ }
348
+ }
349
+ disconnectedCallback() {
350
+ if (this.stylingSubscription) {
351
+ this.stylingSubscription.unsubscribe();
352
+ }
353
+ clearInterval(this.timerId);
354
+ }
355
+ updateTime() {
356
+ var _a;
357
+ this.timeLeft = getTimeLeft((_a = this.challenge) === null || _a === void 0 ? void 0 : _a.ExpirationTime);
358
+ if (!this.timeLeft && this.timerExpired) {
359
+ clearInterval(this.timerId);
360
+ this.timerExpired.emit(this.challenge.Id);
361
+ }
362
+ }
363
+ renderInfoItem(item, index) {
364
+ return (h("div", { class: `info-item ${this.isChallengeGrayed}`, onMouseEnter: (e) => this.onMouseEnterHandler(index, e.currentTarget), onMouseLeave: this.onMouseLeaveHandler }, h("span", { class: "info-item__label" }, item.lable), item.value, this.tooltipIndex === index && h("div", { class: "info-item__tooltip" }, item.value)));
365
+ }
366
+ get getCardBadge() {
367
+ return (h("div", { class: `card__badge ${ChallengeStatusDictionary[this.challenge.Status]}` }, this.getBadgeContent()));
368
+ }
369
+ get isChallengeGrayed() {
370
+ return [EChallengeStatus.Expired, EChallengeStatus.Forfeited, EChallengeStatus.Completed].includes(this.challenge.Status)
371
+ ? 'grayed'
372
+ : '';
373
+ }
374
+ get getChallengeProgress() {
375
+ var _a;
376
+ const currLevel = (_a = this.challenge) === null || _a === void 0 ? void 0 : _a.LevelProgresses.find((x) => x.ProgressStatus === EChallengeProgressStatus.InProgress);
377
+ if (!this.isUserAuthorized || !currLevel)
378
+ return null;
379
+ const { Status, LevelProgresses } = this.challenge;
380
+ if (Status === EChallengeStatus.Expired || Status === EChallengeStatus.Started) {
381
+ return h("div", { class: "progress__placeholder" });
382
+ }
383
+ const barValue = Status === EChallengeStatus.Paused
384
+ ? translate$1('suspended', this.language)
385
+ : Status === EChallengeStatus.Completed
386
+ ? translate$1('finished', this.language)
387
+ : `${currLevel.ProgressPercentage}%`;
388
+ const isLastLevel = !LevelProgresses.some((x) => x.OrderNumber > currLevel.OrderNumber);
389
+ const secondImgSrc = Status === EChallengeStatus.Completed ? trophySvg : isLastLevel ? finishSvg : '';
390
+ return (h("div", { class: {
391
+ progress: true,
392
+ paused: Status === EChallengeStatus.Paused,
393
+ grayed: Status === EChallengeStatus.Forfeited
394
+ } }, h("div", { class: {
395
+ progress__point: true,
396
+ start: true,
397
+ hidden: Status === EChallengeStatus.Completed
398
+ } }, currLevel.OrderNumber + 1), h("div", { class: {
399
+ progress__bar: true,
400
+ finished: Status === EChallengeStatus.Completed
401
+ }, style: { width: `${currLevel.ProgressPercentage}%` } }, barValue), h("div", { class: {
402
+ progress__point: true,
403
+ end: true,
404
+ finished: Status === EChallengeStatus.Completed
405
+ } }, secondImgSrc ? h("img", { class: "progress__icon", src: secondImgSrc }) : currLevel.OrderNumber + 2)));
406
+ }
407
+ get getCardButton() {
408
+ if (this.isUserAuthorized) {
409
+ if (this.challenge.Status === EChallengeStatus.Started) {
410
+ return (h("button", { class: "card__button filled", disabled: this.actionLoading, onClick: () => this.joinUnjoinProgress(true) }, translate$1('start', this.language)));
411
+ }
412
+ if (this.challenge.Status === EChallengeStatus.Paused) {
413
+ return (h("button", { class: "card__button grayed", disabled: this.actionLoading, onClick: () => this.joinUnjoinProgress(true) }, translate$1('resume', this.language)));
414
+ }
415
+ if (this.challenge.Status === EChallengeStatus.InProgress ||
416
+ this.challenge.Status === EChallengeStatus.PendingLevelReward) {
417
+ return (h("button", { class: "card__button grayed", disabled: this.actionLoading, onClick: () => this.joinUnjoinProgress(false) }, translate$1('pause', this.language)));
418
+ }
419
+ }
420
+ return (h("button", { class: "card__button", onClick: this.goToDetailsPage(this.challenge.ChallengeId) }, translate$1('viewDetails', this.language)));
421
+ }
422
+ async joinUnjoinProgress(join) {
423
+ var _a;
424
+ const progress = (_a = this.challenge) === null || _a === void 0 ? void 0 : _a.LevelProgresses.find((x) => x.ProgressStatus === EChallengeProgressStatus.InProgress);
425
+ if (!this.checkAttrs()) {
426
+ const url = `${this.endpoint}/challenge/ChangeProgressStatus`;
427
+ const body = Object.assign(Object.assign({ DomainId: this.domain }, (this.session && { PlayerSessionId: this.session })), (join ? { ProgressToActivate: progress.LevelId } : { ProgressToDeactivate: progress.LevelId }));
428
+ this.actionLoading = true;
429
+ return fetch(url, {
430
+ method: 'POST',
431
+ headers: {
432
+ 'Content-Type': 'application/json'
433
+ },
434
+ body: JSON.stringify(body)
435
+ })
436
+ .then((res) => res.json())
437
+ .finally(() => (this.actionLoading = false));
438
+ }
439
+ }
440
+ render() {
441
+ var _a, _b, _c, _d;
442
+ return (h("div", { key: '7d075d85a754e70a62910c2b3994ee10f4e289f6', ref: (el) => (this.stylingContainer = el) }, h("div", { key: '0d8b0c19b9cfd582588d3a8f62364753ddb6c391', class: "card" }, h("img", { key: '1547104e52b2f755bbe4f9b7acedc949990d5df8', class: `card__image ${this.isChallengeGrayed}`, src: (_b = (_a = this.challenge) === null || _a === void 0 ? void 0 : _a.ChallengePresentation) === null || _b === void 0 ? void 0 : _b.Url }), this.getCardBadge, h("div", { key: '34474831cd774f48f2730d77c82e46252b857f75', class: "card__content" }, h("h1", { key: 'a3ea4dab06b090c96961f7fa3e958a1a577100ef', class: "card__title" }, (_d = (_c = this.challenge) === null || _c === void 0 ? void 0 : _c.ChallengePresentation) === null || _d === void 0 ? void 0 : _d.PresentationName), this.getChallengeProgress, this.infoItems.map((x, index) => this.renderInfoItem(x, index)), this.getCardButton))));
443
+ }
444
+ static get watchers() { return {
445
+ "clientStyling": ["handleClientStylingChange"],
446
+ "clientStylingUrl": ["handleClientStylingUrlChange"],
447
+ "mbSource": ["handleMbSourceChange"]
448
+ }; }
449
+ };
450
+ CasinoChallengeCard.style = CasinoChallengeCardStyle0;
451
+
452
+ const casinoChallengesListCss = ".challenges-list {\n display: flex;\n flex-wrap: wrap;\n gap: 30px;\n width: 100%;\n}\n\n.loader {\n width: 308px;\n border-radius: 16px;\n border: 2px solid var(--emw--button-border-color, rgba(221, 255, 207, 0.1019607843));\n background-color: var(--emw--color-background, #141515);\n box-sizing: border-box;\n position: relative;\n}\n@container challenge-list (max-width: 576px) {\n .loader {\n width: 100%;\n }\n}\n.loader:hover {\n background: linear-gradient(90deg, rgb(0, 62, 92) 0%, rgb(17, 59, 33) 100%);\n cursor: pointer;\n}\n.loader .SkeletonRows .SkeletonContainer {\n padding: 0 20px 0 20px;\n}\n.loader .SkeletonButton .Skeleton.Text {\n margin: 0;\n height: 28px;\n margin: 0 20px 20px 20px;\n border-radius: var(--emw--button-border-radius, 99px);\n width: auto;\n}\n.loader .Skeleton.Image {\n border-radius: 16px 16px 0 0;\n}\n.loader .Skeleton.Text {\n margin: 20px 0;\n}";
453
+ const CasinoChallengesListStyle0 = casinoChallengesListCss;
454
+
455
+ const skeletons$1 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
456
+ const CasinoChallengeList = class {
457
+ constructor(hostRef) {
458
+ registerInstance(this, hostRef);
459
+ this.loadMore = createEvent(this, "loadMore", 7);
460
+ this.timerExpired = createEvent(this, "timerExpired", 7);
461
+ this.setLastItemRef = (el) => {
462
+ if (this.lastItemRef && this.observer) {
463
+ this.observer.unobserve(this.lastItemRef);
464
+ }
465
+ this.lastItemRef = el;
466
+ if (el && this.observer && !this.loading) {
467
+ this.observer.observe(el);
468
+ }
469
+ };
470
+ this.mbSource = undefined;
471
+ this.clientStyling = undefined;
472
+ this.clientStylingUrl = undefined;
473
+ this.language = 'en';
474
+ this.translationUrl = undefined;
475
+ this.challenges = [];
476
+ this.loading = false;
477
+ this.hasMore = false;
478
+ this.activeTabIndex = 0;
479
+ }
480
+ handleClientStylingChange(newValue, oldValue) {
481
+ if (newValue != oldValue) {
482
+ setClientStyling(this.stylingContainer, this.clientStyling);
483
+ }
484
+ }
485
+ handleClientStylingUrlChange(newValue, oldValue) {
486
+ if (newValue != oldValue) {
487
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
488
+ }
489
+ }
490
+ handleMbSourceChange(newValue, oldValue) {
491
+ if (newValue != oldValue) {
492
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
493
+ }
494
+ }
495
+ setupObserver() {
496
+ if (!this.lastItemRef || this.loading || !this.hasMore)
497
+ return;
498
+ if (!this.observer) {
499
+ this.observer = new IntersectionObserver(([entry]) => {
500
+ if (entry.isIntersecting && !this.loading && this.hasMore) {
501
+ this.observer.unobserve(entry.target);
502
+ this.loadMore.emit();
503
+ }
504
+ }, {
505
+ root: null,
506
+ rootMargin: '0px',
507
+ threshold: 0.1
508
+ });
509
+ }
510
+ this.observer.disconnect();
511
+ this.observer.observe(this.lastItemRef);
512
+ }
513
+ componentDidRender() {
514
+ this.setupObserver();
515
+ }
516
+ disconnectedCallback() {
517
+ var _a;
518
+ (_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
519
+ this.observer = undefined;
520
+ }
521
+ componentDidLoad() {
522
+ if (this.stylingContainer) {
523
+ if (this.mbSource)
524
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
525
+ if (this.clientStyling)
526
+ setClientStyling(this.stylingContainer, this.clientStyling);
527
+ if (this.clientStylingUrl)
528
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
529
+ }
530
+ }
531
+ renderSkeletons() {
532
+ return skeletons$1.map((skeleton) => (h("div", { class: "loader", key: skeleton }, h("ui-skeleton", { structure: "image", height: "200px", "border-radius": "16px 16px 0 0" }), h("ui-skeleton", { class: "SkeletonRows", structure: "text", width: "220px", height: "16px", rows: "3" }), h("ui-skeleton", { class: "SkeletonButton", structure: "text", width: "100%" }))));
533
+ }
534
+ onTimerExpired(e) {
535
+ if (this.timerExpired) {
536
+ this.timerExpired.emit(e.detail);
537
+ }
538
+ }
539
+ render() {
540
+ return (h("div", { key: 'a86f75428a1ada59409164e3c83582794d186c5c', ref: (el) => (this.stylingContainer = el), class: "challenges-list" }, this.challenges.map((challenge, index) => (h("div", { key: challenge.Id, ref: index === this.challenges.length - 1 ? this.setLastItemRef : null }, h("casino-challenge-card", { challenge: challenge, language: this.language, mbSource: this.mbSource, clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, translationUrl: this.translationUrl, onTimerExpired: this.onTimerExpired, activeTabIndex: this.activeTabIndex })))), this.loading && this.renderSkeletons()));
541
+ }
542
+ get el() { return getElement(this); }
543
+ static get watchers() { return {
544
+ "clientStyling": ["handleClientStylingChange"],
545
+ "clientStylingUrl": ["handleClientStylingUrlChange"],
546
+ "mbSource": ["handleMbSourceChange"]
547
+ }; }
548
+ };
549
+ CasinoChallengeList.style = CasinoChallengesListStyle0;
550
+
551
+ var EHistoryItemLevelStatus;
552
+ (function (EHistoryItemLevelStatus) {
553
+ EHistoryItemLevelStatus[EHistoryItemLevelStatus["Completed"] = 0] = "Completed";
554
+ EHistoryItemLevelStatus[EHistoryItemLevelStatus["Expired"] = 1] = "Expired";
555
+ EHistoryItemLevelStatus[EHistoryItemLevelStatus["Forfeited"] = 2] = "Forfeited";
556
+ })(EHistoryItemLevelStatus || (EHistoryItemLevelStatus = {}));
557
+ const HistoryItemLevelStatusDictionary = ['Completed', 'Expired', 'Forfeited'];
558
+
559
+ const DEFAULT_LANGUAGE = 'en';
560
+ const TRANSLATIONS = {
561
+ en: {
562
+ level: 'Level',
563
+ status: 'Status',
564
+ time: 'Time'
565
+ },
566
+ ro: {
567
+ level: 'Nivel',
568
+ status: 'Stare',
569
+ time: 'Timp'
570
+ },
571
+ fr: {
572
+ level: 'Niveau',
573
+ status: 'Statut',
574
+ time: 'Temps'
575
+ },
576
+ ar: {
577
+ level: 'المستوى',
578
+ status: 'الحالة',
579
+ time: 'الوقت'
580
+ },
581
+ hr: {
582
+ level: 'Razina',
583
+ status: 'Status',
584
+ time: 'Vrijeme'
585
+ }
586
+ };
587
+ const translate = (key, customLang) => {
588
+ const lang = customLang;
589
+ return TRANSLATIONS[lang !== undefined && lang in TRANSLATIONS ? lang : DEFAULT_LANGUAGE][key];
590
+ };
591
+ const getTranslations = (data) => {
592
+ Object.keys(data).forEach((item) => {
593
+ for (let key in data[item]) {
594
+ TRANSLATIONS[item][key] = data[item][key];
595
+ }
596
+ });
597
+ };
598
+ const resolveTranslationUrl = async (translationUrl) => {
599
+ if (translationUrl) {
600
+ try {
601
+ const response = await fetch(translationUrl);
602
+ if (!response.ok) {
603
+ throw new Error(`HTTP error! status: ${response.status}`);
604
+ }
605
+ const translations = await response.json();
606
+ getTranslations(translations);
607
+ }
608
+ catch (error) {
609
+ console.error('Failed to fetch or parse translations from URL:', error);
610
+ }
611
+ }
612
+ };
613
+
614
+ const arrowUpSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iOCIgdmlld0JveD0iMCAwIDEyIDgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNS40MTEwNyAwLjkxMDgyNkM1LjczNjUxIDAuNTg1Mzg5IDYuMjY0MTQgMC41ODUzODkgNi41ODk1OCAwLjkxMDgyNkwxMS41ODk2IDUuOTEwODNDMTEuOTE1IDYuMjM2MjYgMTEuOTE1IDYuNzYzOSAxMS41ODk2IDc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zNTMgMy41ODkyNkMxMi4xNjczIDMuNTgzNzEgMTIuMDcyNyAzLjU4MzI1IDExLjg5OTcgMy41ODMyNUg3LjU4MzAxVjUuMzMzMjVIMTEuODk5N1pNOS4wNjIxOCAyLjQxNjU5QzkuMjA3OTQgMi40MTY1OSA5LjM0OTg5IDIuMzU3NzMgOS40NTYyMyAyLjI0OTQ2QzkuNTYyOTEgMi4xNDA4NCA5LjYyNDY4IDEuOTkxMzIgOS42MjQ2OCAxLjgzMzI1QzkuNjI0NjggMS42NzUxOCA5LjU2MjkxIDEuNTI1NjYgOS40NTYyMyAxLjQxNzA0QzkuMzQ5ODkgMS4zMDg3OCA5LjIwNzk0IDEuMjQ5OTIgOS4wNjIxOCAxLjI0OTkyQzguNTg5ODYgMS4yNDk5MiA4LjIyNjAzIDEuNTg1ODEgNy45NDI2MSAyLjExMDQ5QzcuODg3MTggMi4yMTMxIDcuODM4NTkgMi4zMTY2MyA3Ljc5NjM3IDIuNDE2NTlIOS4wNjIxOFoiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl8xNTIwXzI5ODEpIi8+CjxkZWZzPgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MF9saW5lYXJfMTUyMF8yOTgxIiB4MT0iNi45OTk2OCIgeTE9IjAuMDgzMjUyIiB4Mj0iNi45OTk2OCIgeTI9IjEyLjkxNjYiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0iI0VBOTAxOCIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNFMEE4NEUiLz4KPC9saW5lYXJHcmFkaWVudD4KPC9kZWZzPgo8L3N2Zz4K';
619
+
620
+ function _typeof(o) {
621
+ "@babel/helpers - typeof";
622
+
623
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
624
+ return typeof o;
625
+ } : function (o) {
626
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
627
+ }, _typeof(o);
628
+ }
629
+
630
+ function toInteger(dirtyNumber) {
631
+ if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
632
+ return NaN;
633
+ }
634
+ var number = Number(dirtyNumber);
635
+ if (isNaN(number)) {
636
+ return number;
637
+ }
638
+ return number < 0 ? Math.ceil(number) : Math.floor(number);
639
+ }
640
+
641
+ function requiredArgs(required, args) {
642
+ if (args.length < required) {
643
+ throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
644
+ }
645
+ }
646
+
647
+ /**
648
+ * @name toDate
649
+ * @category Common Helpers
650
+ * @summary Convert the given argument to an instance of Date.
651
+ *
652
+ * @description
653
+ * Convert the given argument to an instance of Date.
654
+ *
655
+ * If the argument is an instance of Date, the function returns its clone.
656
+ *
657
+ * If the argument is a number, it is treated as a timestamp.
658
+ *
659
+ * If the argument is none of the above, the function returns Invalid Date.
660
+ *
661
+ * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
662
+ *
663
+ * @param {Date|Number} argument - the value to convert
664
+ * @returns {Date} the parsed date in the local time zone
665
+ * @throws {TypeError} 1 argument required
666
+ *
667
+ * @example
668
+ * // Clone the date:
669
+ * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
670
+ * //=> Tue Feb 11 2014 11:30:30
671
+ *
672
+ * @example
673
+ * // Convert the timestamp to date:
674
+ * const result = toDate(1392098430000)
675
+ * //=> Tue Feb 11 2014 11:30:30
676
+ */
677
+ function toDate(argument) {
678
+ requiredArgs(1, arguments);
679
+ var argStr = Object.prototype.toString.call(argument);
680
+
681
+ // Clone the date
682
+ if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
683
+ // Prevent the date to lose the milliseconds when passed to new Date() in IE10
684
+ return new Date(argument.getTime());
685
+ } else if (typeof argument === 'number' || argStr === '[object Number]') {
686
+ return new Date(argument);
687
+ } else {
688
+ if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
689
+ // eslint-disable-next-line no-console
690
+ console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
691
+ // eslint-disable-next-line no-console
692
+ console.warn(new Error().stack);
693
+ }
694
+ return new Date(NaN);
695
+ }
696
+ }
697
+
698
+ /**
699
+ * @name addMilliseconds
700
+ * @category Millisecond Helpers
701
+ * @summary Add the specified number of milliseconds to the given date.
702
+ *
703
+ * @description
704
+ * Add the specified number of milliseconds to the given date.
705
+ *
706
+ * @param {Date|Number} date - the date to be changed
707
+ * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
708
+ * @returns {Date} the new date with the milliseconds added
709
+ * @throws {TypeError} 2 arguments required
710
+ *
711
+ * @example
712
+ * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
713
+ * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
714
+ * //=> Thu Jul 10 2014 12:45:30.750
715
+ */
716
+ function addMilliseconds(dirtyDate, dirtyAmount) {
717
+ requiredArgs(2, arguments);
718
+ var timestamp = toDate(dirtyDate).getTime();
719
+ var amount = toInteger(dirtyAmount);
720
+ return new Date(timestamp + amount);
721
+ }
722
+
723
+ var defaultOptions = {};
724
+ function getDefaultOptions() {
725
+ return defaultOptions;
726
+ }
727
+
728
+ /**
729
+ * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
730
+ * They usually appear for dates that denote time before the timezones were introduced
731
+ * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
732
+ * and GMT+01:00:00 after that date)
733
+ *
734
+ * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
735
+ * which would lead to incorrect calculations.
736
+ *
737
+ * This function returns the timezone offset in milliseconds that takes seconds in account.
738
+ */
739
+ function getTimezoneOffsetInMilliseconds(date) {
740
+ var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
741
+ utcDate.setUTCFullYear(date.getFullYear());
742
+ return date.getTime() - utcDate.getTime();
743
+ }
744
+
745
+ /**
746
+ * @name isDate
747
+ * @category Common Helpers
748
+ * @summary Is the given value a date?
749
+ *
750
+ * @description
751
+ * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
752
+ *
753
+ * @param {*} value - the value to check
754
+ * @returns {boolean} true if the given value is a date
755
+ * @throws {TypeError} 1 arguments required
756
+ *
757
+ * @example
758
+ * // For a valid date:
759
+ * const result = isDate(new Date())
760
+ * //=> true
761
+ *
762
+ * @example
763
+ * // For an invalid date:
764
+ * const result = isDate(new Date(NaN))
765
+ * //=> true
766
+ *
767
+ * @example
768
+ * // For some value:
769
+ * const result = isDate('2014-02-31')
770
+ * //=> false
771
+ *
772
+ * @example
773
+ * // For an object:
774
+ * const result = isDate({})
775
+ * //=> false
776
+ */
777
+ function isDate(value) {
778
+ requiredArgs(1, arguments);
779
+ return value instanceof Date || _typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]';
780
+ }
781
+
782
+ /**
783
+ * @name isValid
784
+ * @category Common Helpers
785
+ * @summary Is the given date valid?
786
+ *
787
+ * @description
788
+ * Returns false if argument is Invalid Date and true otherwise.
789
+ * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
790
+ * Invalid Date is a Date, whose time value is NaN.
791
+ *
792
+ * Time value of Date: http://es5.github.io/#x15.9.1.1
793
+ *
794
+ * @param {*} date - the date to check
795
+ * @returns {Boolean} the date is valid
796
+ * @throws {TypeError} 1 argument required
797
+ *
798
+ * @example
799
+ * // For the valid date:
800
+ * const result = isValid(new Date(2014, 1, 31))
801
+ * //=> true
802
+ *
803
+ * @example
804
+ * // For the value, convertable into a date:
805
+ * const result = isValid(1393804800000)
806
+ * //=> true
807
+ *
808
+ * @example
809
+ * // For the invalid date:
810
+ * const result = isValid(new Date(''))
811
+ * //=> false
812
+ */
813
+ function isValid(dirtyDate) {
814
+ requiredArgs(1, arguments);
815
+ if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
816
+ return false;
817
+ }
818
+ var date = toDate(dirtyDate);
819
+ return !isNaN(Number(date));
820
+ }
821
+
822
+ /**
823
+ * @name subMilliseconds
824
+ * @category Millisecond Helpers
825
+ * @summary Subtract the specified number of milliseconds from the given date.
826
+ *
827
+ * @description
828
+ * Subtract the specified number of milliseconds from the given date.
829
+ *
830
+ * @param {Date|Number} date - the date to be changed
831
+ * @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
832
+ * @returns {Date} the new date with the milliseconds subtracted
833
+ * @throws {TypeError} 2 arguments required
834
+ *
835
+ * @example
836
+ * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
837
+ * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
838
+ * //=> Thu Jul 10 2014 12:45:29.250
839
+ */
840
+ function subMilliseconds(dirtyDate, dirtyAmount) {
841
+ requiredArgs(2, arguments);
842
+ var amount = toInteger(dirtyAmount);
843
+ return addMilliseconds(dirtyDate, -amount);
844
+ }
845
+
846
+ var MILLISECONDS_IN_DAY = 86400000;
847
+ function getUTCDayOfYear(dirtyDate) {
848
+ requiredArgs(1, arguments);
849
+ var date = toDate(dirtyDate);
850
+ var timestamp = date.getTime();
851
+ date.setUTCMonth(0, 1);
852
+ date.setUTCHours(0, 0, 0, 0);
853
+ var startOfYearTimestamp = date.getTime();
854
+ var difference = timestamp - startOfYearTimestamp;
855
+ return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
856
+ }
857
+
858
+ function startOfUTCISOWeek(dirtyDate) {
859
+ requiredArgs(1, arguments);
860
+ var weekStartsOn = 1;
861
+ var date = toDate(dirtyDate);
862
+ var day = date.getUTCDay();
863
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
864
+ date.setUTCDate(date.getUTCDate() - diff);
865
+ date.setUTCHours(0, 0, 0, 0);
866
+ return date;
867
+ }
868
+
869
+ function getUTCISOWeekYear(dirtyDate) {
870
+ requiredArgs(1, arguments);
871
+ var date = toDate(dirtyDate);
872
+ var year = date.getUTCFullYear();
873
+ var fourthOfJanuaryOfNextYear = new Date(0);
874
+ fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
875
+ fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
876
+ var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
877
+ var fourthOfJanuaryOfThisYear = new Date(0);
878
+ fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
879
+ fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
880
+ var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
881
+ if (date.getTime() >= startOfNextYear.getTime()) {
882
+ return year + 1;
883
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
884
+ return year;
885
+ } else {
886
+ return year - 1;
887
+ }
888
+ }
889
+
890
+ function startOfUTCISOWeekYear(dirtyDate) {
891
+ requiredArgs(1, arguments);
892
+ var year = getUTCISOWeekYear(dirtyDate);
893
+ var fourthOfJanuary = new Date(0);
894
+ fourthOfJanuary.setUTCFullYear(year, 0, 4);
895
+ fourthOfJanuary.setUTCHours(0, 0, 0, 0);
896
+ var date = startOfUTCISOWeek(fourthOfJanuary);
897
+ return date;
898
+ }
899
+
900
+ var MILLISECONDS_IN_WEEK$1 = 604800000;
901
+ function getUTCISOWeek(dirtyDate) {
902
+ requiredArgs(1, arguments);
903
+ var date = toDate(dirtyDate);
904
+ var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime();
905
+
906
+ // Round the number of days to the nearest integer
907
+ // because the number of milliseconds in a week is not constant
908
+ // (e.g. it's different in the week of the daylight saving time clock shift)
909
+ return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
910
+ }
911
+
912
+ function startOfUTCWeek(dirtyDate, options) {
913
+ var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
914
+ requiredArgs(1, arguments);
915
+ var defaultOptions = getDefaultOptions();
916
+ var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
917
+
918
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
919
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
920
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
921
+ }
922
+ var date = toDate(dirtyDate);
923
+ var day = date.getUTCDay();
924
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
925
+ date.setUTCDate(date.getUTCDate() - diff);
926
+ date.setUTCHours(0, 0, 0, 0);
927
+ return date;
928
+ }
929
+
930
+ function getUTCWeekYear(dirtyDate, options) {
931
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
932
+ requiredArgs(1, arguments);
933
+ var date = toDate(dirtyDate);
934
+ var year = date.getUTCFullYear();
935
+ var defaultOptions = getDefaultOptions();
936
+ var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
937
+
938
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
939
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
940
+ throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
941
+ }
942
+ var firstWeekOfNextYear = new Date(0);
943
+ firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
944
+ firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
945
+ var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, options);
946
+ var firstWeekOfThisYear = new Date(0);
947
+ firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
948
+ firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
949
+ var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);
950
+ if (date.getTime() >= startOfNextYear.getTime()) {
951
+ return year + 1;
952
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
953
+ return year;
954
+ } else {
955
+ return year - 1;
956
+ }
957
+ }
958
+
959
+ function startOfUTCWeekYear(dirtyDate, options) {
960
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
961
+ requiredArgs(1, arguments);
962
+ var defaultOptions = getDefaultOptions();
963
+ var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
964
+ var year = getUTCWeekYear(dirtyDate, options);
965
+ var firstWeek = new Date(0);
966
+ firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
967
+ firstWeek.setUTCHours(0, 0, 0, 0);
968
+ var date = startOfUTCWeek(firstWeek, options);
969
+ return date;
970
+ }
971
+
972
+ var MILLISECONDS_IN_WEEK = 604800000;
973
+ function getUTCWeek(dirtyDate, options) {
974
+ requiredArgs(1, arguments);
975
+ var date = toDate(dirtyDate);
976
+ var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime();
977
+
978
+ // Round the number of days to the nearest integer
979
+ // because the number of milliseconds in a week is not constant
980
+ // (e.g. it's different in the week of the daylight saving time clock shift)
981
+ return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
982
+ }
983
+
984
+ function addLeadingZeros(number, targetLength) {
985
+ var sign = number < 0 ? '-' : '';
986
+ var output = Math.abs(number).toString();
987
+ while (output.length < targetLength) {
988
+ output = '0' + output;
989
+ }
990
+ return sign + output;
991
+ }
992
+
993
+ /*
994
+ * | | Unit | | Unit |
995
+ * |-----|--------------------------------|-----|--------------------------------|
996
+ * | a | AM, PM | A* | |
997
+ * | d | Day of month | D | |
998
+ * | h | Hour [1-12] | H | Hour [0-23] |
999
+ * | m | Minute | M | Month |
1000
+ * | s | Second | S | Fraction of second |
1001
+ * | y | Year (abs) | Y | |
1002
+ *
1003
+ * Letters marked by * are not implemented but reserved by Unicode standard.
1004
+ */
1005
+ var formatters$2 = {
1006
+ // Year
1007
+ y: function y(date, token) {
1008
+ // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
1009
+ // | Year | y | yy | yyy | yyyy | yyyyy |
1010
+ // |----------|-------|----|-------|-------|-------|
1011
+ // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
1012
+ // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
1013
+ // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
1014
+ // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
1015
+ // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
1016
+
1017
+ var signedYear = date.getUTCFullYear();
1018
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
1019
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
1020
+ return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
1021
+ },
1022
+ // Month
1023
+ M: function M(date, token) {
1024
+ var month = date.getUTCMonth();
1025
+ return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
1026
+ },
1027
+ // Day of the month
1028
+ d: function d(date, token) {
1029
+ return addLeadingZeros(date.getUTCDate(), token.length);
1030
+ },
1031
+ // AM or PM
1032
+ a: function a(date, token) {
1033
+ var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
1034
+ switch (token) {
1035
+ case 'a':
1036
+ case 'aa':
1037
+ return dayPeriodEnumValue.toUpperCase();
1038
+ case 'aaa':
1039
+ return dayPeriodEnumValue;
1040
+ case 'aaaaa':
1041
+ return dayPeriodEnumValue[0];
1042
+ case 'aaaa':
1043
+ default:
1044
+ return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
1045
+ }
1046
+ },
1047
+ // Hour [1-12]
1048
+ h: function h(date, token) {
1049
+ return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
1050
+ },
1051
+ // Hour [0-23]
1052
+ H: function H(date, token) {
1053
+ return addLeadingZeros(date.getUTCHours(), token.length);
1054
+ },
1055
+ // Minute
1056
+ m: function m(date, token) {
1057
+ return addLeadingZeros(date.getUTCMinutes(), token.length);
1058
+ },
1059
+ // Second
1060
+ s: function s(date, token) {
1061
+ return addLeadingZeros(date.getUTCSeconds(), token.length);
1062
+ },
1063
+ // Fraction of second
1064
+ S: function S(date, token) {
1065
+ var numberOfDigits = token.length;
1066
+ var milliseconds = date.getUTCMilliseconds();
1067
+ var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
1068
+ return addLeadingZeros(fractionalSeconds, token.length);
1069
+ }
1070
+ };
1071
+ const formatters$3 = formatters$2;
1072
+
1073
+ var dayPeriodEnum = {
1074
+ am: 'am',
1075
+ pm: 'pm',
1076
+ midnight: 'midnight',
1077
+ noon: 'noon',
1078
+ morning: 'morning',
1079
+ afternoon: 'afternoon',
1080
+ evening: 'evening',
1081
+ night: 'night'
1082
+ };
1083
+ /*
1084
+ * | | Unit | | Unit |
1085
+ * |-----|--------------------------------|-----|--------------------------------|
1086
+ * | a | AM, PM | A* | Milliseconds in day |
1087
+ * | b | AM, PM, noon, midnight | B | Flexible day period |
1088
+ * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
1089
+ * | d | Day of month | D | Day of year |
1090
+ * | e | Local day of week | E | Day of week |
1091
+ * | f | | F* | Day of week in month |
1092
+ * | g* | Modified Julian day | G | Era |
1093
+ * | h | Hour [1-12] | H | Hour [0-23] |
1094
+ * | i! | ISO day of week | I! | ISO week of year |
1095
+ * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
1096
+ * | k | Hour [1-24] | K | Hour [0-11] |
1097
+ * | l* | (deprecated) | L | Stand-alone month |
1098
+ * | m | Minute | M | Month |
1099
+ * | n | | N | |
1100
+ * | o! | Ordinal number modifier | O | Timezone (GMT) |
1101
+ * | p! | Long localized time | P! | Long localized date |
1102
+ * | q | Stand-alone quarter | Q | Quarter |
1103
+ * | r* | Related Gregorian year | R! | ISO week-numbering year |
1104
+ * | s | Second | S | Fraction of second |
1105
+ * | t! | Seconds timestamp | T! | Milliseconds timestamp |
1106
+ * | u | Extended year | U* | Cyclic year |
1107
+ * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
1108
+ * | w | Local week of year | W* | Week of month |
1109
+ * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
1110
+ * | y | Year (abs) | Y | Local week-numbering year |
1111
+ * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
1112
+ *
1113
+ * Letters marked by * are not implemented but reserved by Unicode standard.
1114
+ *
1115
+ * Letters marked by ! are non-standard, but implemented by date-fns:
1116
+ * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
1117
+ * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
1118
+ * i.e. 7 for Sunday, 1 for Monday, etc.
1119
+ * - `I` is ISO week of year, as opposed to `w` which is local week of year.
1120
+ * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
1121
+ * `R` is supposed to be used in conjunction with `I` and `i`
1122
+ * for universal ISO week-numbering date, whereas
1123
+ * `Y` is supposed to be used in conjunction with `w` and `e`
1124
+ * for week-numbering date specific to the locale.
1125
+ * - `P` is long localized date format
1126
+ * - `p` is long localized time format
1127
+ */
1128
+
1129
+ var formatters = {
1130
+ // Era
1131
+ G: function G(date, token, localize) {
1132
+ var era = date.getUTCFullYear() > 0 ? 1 : 0;
1133
+ switch (token) {
1134
+ // AD, BC
1135
+ case 'G':
1136
+ case 'GG':
1137
+ case 'GGG':
1138
+ return localize.era(era, {
1139
+ width: 'abbreviated'
1140
+ });
1141
+ // A, B
1142
+ case 'GGGGG':
1143
+ return localize.era(era, {
1144
+ width: 'narrow'
1145
+ });
1146
+ // Anno Domini, Before Christ
1147
+ case 'GGGG':
1148
+ default:
1149
+ return localize.era(era, {
1150
+ width: 'wide'
1151
+ });
1152
+ }
1153
+ },
1154
+ // Year
1155
+ y: function y(date, token, localize) {
1156
+ // Ordinal number
1157
+ if (token === 'yo') {
1158
+ var signedYear = date.getUTCFullYear();
1159
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
1160
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
1161
+ return localize.ordinalNumber(year, {
1162
+ unit: 'year'
1163
+ });
1164
+ }
1165
+ return formatters$3.y(date, token);
1166
+ },
1167
+ // Local week-numbering year
1168
+ Y: function Y(date, token, localize, options) {
1169
+ var signedWeekYear = getUTCWeekYear(date, options);
1170
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
1171
+ var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
1172
+
1173
+ // Two digit year
1174
+ if (token === 'YY') {
1175
+ var twoDigitYear = weekYear % 100;
1176
+ return addLeadingZeros(twoDigitYear, 2);
1177
+ }
1178
+
1179
+ // Ordinal number
1180
+ if (token === 'Yo') {
1181
+ return localize.ordinalNumber(weekYear, {
1182
+ unit: 'year'
1183
+ });
1184
+ }
1185
+
1186
+ // Padding
1187
+ return addLeadingZeros(weekYear, token.length);
1188
+ },
1189
+ // ISO week-numbering year
1190
+ R: function R(date, token) {
1191
+ var isoWeekYear = getUTCISOWeekYear(date);
1192
+
1193
+ // Padding
1194
+ return addLeadingZeros(isoWeekYear, token.length);
1195
+ },
1196
+ // Extended year. This is a single number designating the year of this calendar system.
1197
+ // The main difference between `y` and `u` localizers are B.C. years:
1198
+ // | Year | `y` | `u` |
1199
+ // |------|-----|-----|
1200
+ // | AC 1 | 1 | 1 |
1201
+ // | BC 1 | 1 | 0 |
1202
+ // | BC 2 | 2 | -1 |
1203
+ // Also `yy` always returns the last two digits of a year,
1204
+ // while `uu` pads single digit years to 2 characters and returns other years unchanged.
1205
+ u: function u(date, token) {
1206
+ var year = date.getUTCFullYear();
1207
+ return addLeadingZeros(year, token.length);
1208
+ },
1209
+ // Quarter
1210
+ Q: function Q(date, token, localize) {
1211
+ var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
1212
+ switch (token) {
1213
+ // 1, 2, 3, 4
1214
+ case 'Q':
1215
+ return String(quarter);
1216
+ // 01, 02, 03, 04
1217
+ case 'QQ':
1218
+ return addLeadingZeros(quarter, 2);
1219
+ // 1st, 2nd, 3rd, 4th
1220
+ case 'Qo':
1221
+ return localize.ordinalNumber(quarter, {
1222
+ unit: 'quarter'
1223
+ });
1224
+ // Q1, Q2, Q3, Q4
1225
+ case 'QQQ':
1226
+ return localize.quarter(quarter, {
1227
+ width: 'abbreviated',
1228
+ context: 'formatting'
1229
+ });
1230
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
1231
+ case 'QQQQQ':
1232
+ return localize.quarter(quarter, {
1233
+ width: 'narrow',
1234
+ context: 'formatting'
1235
+ });
1236
+ // 1st quarter, 2nd quarter, ...
1237
+ case 'QQQQ':
1238
+ default:
1239
+ return localize.quarter(quarter, {
1240
+ width: 'wide',
1241
+ context: 'formatting'
1242
+ });
1243
+ }
1244
+ },
1245
+ // Stand-alone quarter
1246
+ q: function q(date, token, localize) {
1247
+ var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
1248
+ switch (token) {
1249
+ // 1, 2, 3, 4
1250
+ case 'q':
1251
+ return String(quarter);
1252
+ // 01, 02, 03, 04
1253
+ case 'qq':
1254
+ return addLeadingZeros(quarter, 2);
1255
+ // 1st, 2nd, 3rd, 4th
1256
+ case 'qo':
1257
+ return localize.ordinalNumber(quarter, {
1258
+ unit: 'quarter'
1259
+ });
1260
+ // Q1, Q2, Q3, Q4
1261
+ case 'qqq':
1262
+ return localize.quarter(quarter, {
1263
+ width: 'abbreviated',
1264
+ context: 'standalone'
1265
+ });
1266
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
1267
+ case 'qqqqq':
1268
+ return localize.quarter(quarter, {
1269
+ width: 'narrow',
1270
+ context: 'standalone'
1271
+ });
1272
+ // 1st quarter, 2nd quarter, ...
1273
+ case 'qqqq':
1274
+ default:
1275
+ return localize.quarter(quarter, {
1276
+ width: 'wide',
1277
+ context: 'standalone'
1278
+ });
1279
+ }
1280
+ },
1281
+ // Month
1282
+ M: function M(date, token, localize) {
1283
+ var month = date.getUTCMonth();
1284
+ switch (token) {
1285
+ case 'M':
1286
+ case 'MM':
1287
+ return formatters$3.M(date, token);
1288
+ // 1st, 2nd, ..., 12th
1289
+ case 'Mo':
1290
+ return localize.ordinalNumber(month + 1, {
1291
+ unit: 'month'
1292
+ });
1293
+ // Jan, Feb, ..., Dec
1294
+ case 'MMM':
1295
+ return localize.month(month, {
1296
+ width: 'abbreviated',
1297
+ context: 'formatting'
1298
+ });
1299
+ // J, F, ..., D
1300
+ case 'MMMMM':
1301
+ return localize.month(month, {
1302
+ width: 'narrow',
1303
+ context: 'formatting'
1304
+ });
1305
+ // January, February, ..., December
1306
+ case 'MMMM':
1307
+ default:
1308
+ return localize.month(month, {
1309
+ width: 'wide',
1310
+ context: 'formatting'
1311
+ });
1312
+ }
1313
+ },
1314
+ // Stand-alone month
1315
+ L: function L(date, token, localize) {
1316
+ var month = date.getUTCMonth();
1317
+ switch (token) {
1318
+ // 1, 2, ..., 12
1319
+ case 'L':
1320
+ return String(month + 1);
1321
+ // 01, 02, ..., 12
1322
+ case 'LL':
1323
+ return addLeadingZeros(month + 1, 2);
1324
+ // 1st, 2nd, ..., 12th
1325
+ case 'Lo':
1326
+ return localize.ordinalNumber(month + 1, {
1327
+ unit: 'month'
1328
+ });
1329
+ // Jan, Feb, ..., Dec
1330
+ case 'LLL':
1331
+ return localize.month(month, {
1332
+ width: 'abbreviated',
1333
+ context: 'standalone'
1334
+ });
1335
+ // J, F, ..., D
1336
+ case 'LLLLL':
1337
+ return localize.month(month, {
1338
+ width: 'narrow',
1339
+ context: 'standalone'
1340
+ });
1341
+ // January, February, ..., December
1342
+ case 'LLLL':
1343
+ default:
1344
+ return localize.month(month, {
1345
+ width: 'wide',
1346
+ context: 'standalone'
1347
+ });
1348
+ }
1349
+ },
1350
+ // Local week of year
1351
+ w: function w(date, token, localize, options) {
1352
+ var week = getUTCWeek(date, options);
1353
+ if (token === 'wo') {
1354
+ return localize.ordinalNumber(week, {
1355
+ unit: 'week'
1356
+ });
1357
+ }
1358
+ return addLeadingZeros(week, token.length);
1359
+ },
1360
+ // ISO week of year
1361
+ I: function I(date, token, localize) {
1362
+ var isoWeek = getUTCISOWeek(date);
1363
+ if (token === 'Io') {
1364
+ return localize.ordinalNumber(isoWeek, {
1365
+ unit: 'week'
1366
+ });
1367
+ }
1368
+ return addLeadingZeros(isoWeek, token.length);
1369
+ },
1370
+ // Day of the month
1371
+ d: function d(date, token, localize) {
1372
+ if (token === 'do') {
1373
+ return localize.ordinalNumber(date.getUTCDate(), {
1374
+ unit: 'date'
1375
+ });
1376
+ }
1377
+ return formatters$3.d(date, token);
1378
+ },
1379
+ // Day of year
1380
+ D: function D(date, token, localize) {
1381
+ var dayOfYear = getUTCDayOfYear(date);
1382
+ if (token === 'Do') {
1383
+ return localize.ordinalNumber(dayOfYear, {
1384
+ unit: 'dayOfYear'
1385
+ });
1386
+ }
1387
+ return addLeadingZeros(dayOfYear, token.length);
1388
+ },
1389
+ // Day of week
1390
+ E: function E(date, token, localize) {
1391
+ var dayOfWeek = date.getUTCDay();
1392
+ switch (token) {
1393
+ // Tue
1394
+ case 'E':
1395
+ case 'EE':
1396
+ case 'EEE':
1397
+ return localize.day(dayOfWeek, {
1398
+ width: 'abbreviated',
1399
+ context: 'formatting'
1400
+ });
1401
+ // T
1402
+ case 'EEEEE':
1403
+ return localize.day(dayOfWeek, {
1404
+ width: 'narrow',
1405
+ context: 'formatting'
1406
+ });
1407
+ // Tu
1408
+ case 'EEEEEE':
1409
+ return localize.day(dayOfWeek, {
1410
+ width: 'short',
1411
+ context: 'formatting'
1412
+ });
1413
+ // Tuesday
1414
+ case 'EEEE':
1415
+ default:
1416
+ return localize.day(dayOfWeek, {
1417
+ width: 'wide',
1418
+ context: 'formatting'
1419
+ });
1420
+ }
1421
+ },
1422
+ // Local day of week
1423
+ e: function e(date, token, localize, options) {
1424
+ var dayOfWeek = date.getUTCDay();
1425
+ var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
1426
+ switch (token) {
1427
+ // Numerical value (Nth day of week with current locale or weekStartsOn)
1428
+ case 'e':
1429
+ return String(localDayOfWeek);
1430
+ // Padded numerical value
1431
+ case 'ee':
1432
+ return addLeadingZeros(localDayOfWeek, 2);
1433
+ // 1st, 2nd, ..., 7th
1434
+ case 'eo':
1435
+ return localize.ordinalNumber(localDayOfWeek, {
1436
+ unit: 'day'
1437
+ });
1438
+ case 'eee':
1439
+ return localize.day(dayOfWeek, {
1440
+ width: 'abbreviated',
1441
+ context: 'formatting'
1442
+ });
1443
+ // T
1444
+ case 'eeeee':
1445
+ return localize.day(dayOfWeek, {
1446
+ width: 'narrow',
1447
+ context: 'formatting'
1448
+ });
1449
+ // Tu
1450
+ case 'eeeeee':
1451
+ return localize.day(dayOfWeek, {
1452
+ width: 'short',
1453
+ context: 'formatting'
1454
+ });
1455
+ // Tuesday
1456
+ case 'eeee':
1457
+ default:
1458
+ return localize.day(dayOfWeek, {
1459
+ width: 'wide',
1460
+ context: 'formatting'
1461
+ });
1462
+ }
1463
+ },
1464
+ // Stand-alone local day of week
1465
+ c: function c(date, token, localize, options) {
1466
+ var dayOfWeek = date.getUTCDay();
1467
+ var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
1468
+ switch (token) {
1469
+ // Numerical value (same as in `e`)
1470
+ case 'c':
1471
+ return String(localDayOfWeek);
1472
+ // Padded numerical value
1473
+ case 'cc':
1474
+ return addLeadingZeros(localDayOfWeek, token.length);
1475
+ // 1st, 2nd, ..., 7th
1476
+ case 'co':
1477
+ return localize.ordinalNumber(localDayOfWeek, {
1478
+ unit: 'day'
1479
+ });
1480
+ case 'ccc':
1481
+ return localize.day(dayOfWeek, {
1482
+ width: 'abbreviated',
1483
+ context: 'standalone'
1484
+ });
1485
+ // T
1486
+ case 'ccccc':
1487
+ return localize.day(dayOfWeek, {
1488
+ width: 'narrow',
1489
+ context: 'standalone'
1490
+ });
1491
+ // Tu
1492
+ case 'cccccc':
1493
+ return localize.day(dayOfWeek, {
1494
+ width: 'short',
1495
+ context: 'standalone'
1496
+ });
1497
+ // Tuesday
1498
+ case 'cccc':
1499
+ default:
1500
+ return localize.day(dayOfWeek, {
1501
+ width: 'wide',
1502
+ context: 'standalone'
1503
+ });
1504
+ }
1505
+ },
1506
+ // ISO day of week
1507
+ i: function i(date, token, localize) {
1508
+ var dayOfWeek = date.getUTCDay();
1509
+ var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
1510
+ switch (token) {
1511
+ // 2
1512
+ case 'i':
1513
+ return String(isoDayOfWeek);
1514
+ // 02
1515
+ case 'ii':
1516
+ return addLeadingZeros(isoDayOfWeek, token.length);
1517
+ // 2nd
1518
+ case 'io':
1519
+ return localize.ordinalNumber(isoDayOfWeek, {
1520
+ unit: 'day'
1521
+ });
1522
+ // Tue
1523
+ case 'iii':
1524
+ return localize.day(dayOfWeek, {
1525
+ width: 'abbreviated',
1526
+ context: 'formatting'
1527
+ });
1528
+ // T
1529
+ case 'iiiii':
1530
+ return localize.day(dayOfWeek, {
1531
+ width: 'narrow',
1532
+ context: 'formatting'
1533
+ });
1534
+ // Tu
1535
+ case 'iiiiii':
1536
+ return localize.day(dayOfWeek, {
1537
+ width: 'short',
1538
+ context: 'formatting'
1539
+ });
1540
+ // Tuesday
1541
+ case 'iiii':
1542
+ default:
1543
+ return localize.day(dayOfWeek, {
1544
+ width: 'wide',
1545
+ context: 'formatting'
1546
+ });
1547
+ }
1548
+ },
1549
+ // AM or PM
1550
+ a: function a(date, token, localize) {
1551
+ var hours = date.getUTCHours();
1552
+ var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
1553
+ switch (token) {
1554
+ case 'a':
1555
+ case 'aa':
1556
+ return localize.dayPeriod(dayPeriodEnumValue, {
1557
+ width: 'abbreviated',
1558
+ context: 'formatting'
1559
+ });
1560
+ case 'aaa':
1561
+ return localize.dayPeriod(dayPeriodEnumValue, {
1562
+ width: 'abbreviated',
1563
+ context: 'formatting'
1564
+ }).toLowerCase();
1565
+ case 'aaaaa':
1566
+ return localize.dayPeriod(dayPeriodEnumValue, {
1567
+ width: 'narrow',
1568
+ context: 'formatting'
1569
+ });
1570
+ case 'aaaa':
1571
+ default:
1572
+ return localize.dayPeriod(dayPeriodEnumValue, {
1573
+ width: 'wide',
1574
+ context: 'formatting'
1575
+ });
1576
+ }
1577
+ },
1578
+ // AM, PM, midnight, noon
1579
+ b: function b(date, token, localize) {
1580
+ var hours = date.getUTCHours();
1581
+ var dayPeriodEnumValue;
1582
+ if (hours === 12) {
1583
+ dayPeriodEnumValue = dayPeriodEnum.noon;
1584
+ } else if (hours === 0) {
1585
+ dayPeriodEnumValue = dayPeriodEnum.midnight;
1586
+ } else {
1587
+ dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
1588
+ }
1589
+ switch (token) {
1590
+ case 'b':
1591
+ case 'bb':
1592
+ return localize.dayPeriod(dayPeriodEnumValue, {
1593
+ width: 'abbreviated',
1594
+ context: 'formatting'
1595
+ });
1596
+ case 'bbb':
1597
+ return localize.dayPeriod(dayPeriodEnumValue, {
1598
+ width: 'abbreviated',
1599
+ context: 'formatting'
1600
+ }).toLowerCase();
1601
+ case 'bbbbb':
1602
+ return localize.dayPeriod(dayPeriodEnumValue, {
1603
+ width: 'narrow',
1604
+ context: 'formatting'
1605
+ });
1606
+ case 'bbbb':
1607
+ default:
1608
+ return localize.dayPeriod(dayPeriodEnumValue, {
1609
+ width: 'wide',
1610
+ context: 'formatting'
1611
+ });
1612
+ }
1613
+ },
1614
+ // in the morning, in the afternoon, in the evening, at night
1615
+ B: function B(date, token, localize) {
1616
+ var hours = date.getUTCHours();
1617
+ var dayPeriodEnumValue;
1618
+ if (hours >= 17) {
1619
+ dayPeriodEnumValue = dayPeriodEnum.evening;
1620
+ } else if (hours >= 12) {
1621
+ dayPeriodEnumValue = dayPeriodEnum.afternoon;
1622
+ } else if (hours >= 4) {
1623
+ dayPeriodEnumValue = dayPeriodEnum.morning;
1624
+ } else {
1625
+ dayPeriodEnumValue = dayPeriodEnum.night;
1626
+ }
1627
+ switch (token) {
1628
+ case 'B':
1629
+ case 'BB':
1630
+ case 'BBB':
1631
+ return localize.dayPeriod(dayPeriodEnumValue, {
1632
+ width: 'abbreviated',
1633
+ context: 'formatting'
1634
+ });
1635
+ case 'BBBBB':
1636
+ return localize.dayPeriod(dayPeriodEnumValue, {
1637
+ width: 'narrow',
1638
+ context: 'formatting'
1639
+ });
1640
+ case 'BBBB':
1641
+ default:
1642
+ return localize.dayPeriod(dayPeriodEnumValue, {
1643
+ width: 'wide',
1644
+ context: 'formatting'
1645
+ });
1646
+ }
1647
+ },
1648
+ // Hour [1-12]
1649
+ h: function h(date, token, localize) {
1650
+ if (token === 'ho') {
1651
+ var hours = date.getUTCHours() % 12;
1652
+ if (hours === 0) hours = 12;
1653
+ return localize.ordinalNumber(hours, {
1654
+ unit: 'hour'
1655
+ });
1656
+ }
1657
+ return formatters$3.h(date, token);
1658
+ },
1659
+ // Hour [0-23]
1660
+ H: function H(date, token, localize) {
1661
+ if (token === 'Ho') {
1662
+ return localize.ordinalNumber(date.getUTCHours(), {
1663
+ unit: 'hour'
1664
+ });
1665
+ }
1666
+ return formatters$3.H(date, token);
1667
+ },
1668
+ // Hour [0-11]
1669
+ K: function K(date, token, localize) {
1670
+ var hours = date.getUTCHours() % 12;
1671
+ if (token === 'Ko') {
1672
+ return localize.ordinalNumber(hours, {
1673
+ unit: 'hour'
1674
+ });
1675
+ }
1676
+ return addLeadingZeros(hours, token.length);
1677
+ },
1678
+ // Hour [1-24]
1679
+ k: function k(date, token, localize) {
1680
+ var hours = date.getUTCHours();
1681
+ if (hours === 0) hours = 24;
1682
+ if (token === 'ko') {
1683
+ return localize.ordinalNumber(hours, {
1684
+ unit: 'hour'
1685
+ });
1686
+ }
1687
+ return addLeadingZeros(hours, token.length);
1688
+ },
1689
+ // Minute
1690
+ m: function m(date, token, localize) {
1691
+ if (token === 'mo') {
1692
+ return localize.ordinalNumber(date.getUTCMinutes(), {
1693
+ unit: 'minute'
1694
+ });
1695
+ }
1696
+ return formatters$3.m(date, token);
1697
+ },
1698
+ // Second
1699
+ s: function s(date, token, localize) {
1700
+ if (token === 'so') {
1701
+ return localize.ordinalNumber(date.getUTCSeconds(), {
1702
+ unit: 'second'
1703
+ });
1704
+ }
1705
+ return formatters$3.s(date, token);
1706
+ },
1707
+ // Fraction of second
1708
+ S: function S(date, token) {
1709
+ return formatters$3.S(date, token);
1710
+ },
1711
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1712
+ X: function X(date, token, _localize, options) {
1713
+ var originalDate = options._originalDate || date;
1714
+ var timezoneOffset = originalDate.getTimezoneOffset();
1715
+ if (timezoneOffset === 0) {
1716
+ return 'Z';
1717
+ }
1718
+ switch (token) {
1719
+ // Hours and optional minutes
1720
+ case 'X':
1721
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
1722
+
1723
+ // Hours, minutes and optional seconds without `:` delimiter
1724
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1725
+ // so this token always has the same output as `XX`
1726
+ case 'XXXX':
1727
+ case 'XX':
1728
+ // Hours and minutes without `:` delimiter
1729
+ return formatTimezone(timezoneOffset);
1730
+
1731
+ // Hours, minutes and optional seconds with `:` delimiter
1732
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1733
+ // so this token always has the same output as `XXX`
1734
+ case 'XXXXX':
1735
+ case 'XXX': // Hours and minutes with `:` delimiter
1736
+ default:
1737
+ return formatTimezone(timezoneOffset, ':');
1738
+ }
1739
+ },
1740
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1741
+ x: function x(date, token, _localize, options) {
1742
+ var originalDate = options._originalDate || date;
1743
+ var timezoneOffset = originalDate.getTimezoneOffset();
1744
+ switch (token) {
1745
+ // Hours and optional minutes
1746
+ case 'x':
1747
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
1748
+
1749
+ // Hours, minutes and optional seconds without `:` delimiter
1750
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1751
+ // so this token always has the same output as `xx`
1752
+ case 'xxxx':
1753
+ case 'xx':
1754
+ // Hours and minutes without `:` delimiter
1755
+ return formatTimezone(timezoneOffset);
1756
+
1757
+ // Hours, minutes and optional seconds with `:` delimiter
1758
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1759
+ // so this token always has the same output as `xxx`
1760
+ case 'xxxxx':
1761
+ case 'xxx': // Hours and minutes with `:` delimiter
1762
+ default:
1763
+ return formatTimezone(timezoneOffset, ':');
1764
+ }
1765
+ },
1766
+ // Timezone (GMT)
1767
+ O: function O(date, token, _localize, options) {
1768
+ var originalDate = options._originalDate || date;
1769
+ var timezoneOffset = originalDate.getTimezoneOffset();
1770
+ switch (token) {
1771
+ // Short
1772
+ case 'O':
1773
+ case 'OO':
1774
+ case 'OOO':
1775
+ return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
1776
+ // Long
1777
+ case 'OOOO':
1778
+ default:
1779
+ return 'GMT' + formatTimezone(timezoneOffset, ':');
1780
+ }
1781
+ },
1782
+ // Timezone (specific non-location)
1783
+ z: function z(date, token, _localize, options) {
1784
+ var originalDate = options._originalDate || date;
1785
+ var timezoneOffset = originalDate.getTimezoneOffset();
1786
+ switch (token) {
1787
+ // Short
1788
+ case 'z':
1789
+ case 'zz':
1790
+ case 'zzz':
1791
+ return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
1792
+ // Long
1793
+ case 'zzzz':
1794
+ default:
1795
+ return 'GMT' + formatTimezone(timezoneOffset, ':');
1796
+ }
1797
+ },
1798
+ // Seconds timestamp
1799
+ t: function t(date, token, _localize, options) {
1800
+ var originalDate = options._originalDate || date;
1801
+ var timestamp = Math.floor(originalDate.getTime() / 1000);
1802
+ return addLeadingZeros(timestamp, token.length);
1803
+ },
1804
+ // Milliseconds timestamp
1805
+ T: function T(date, token, _localize, options) {
1806
+ var originalDate = options._originalDate || date;
1807
+ var timestamp = originalDate.getTime();
1808
+ return addLeadingZeros(timestamp, token.length);
1809
+ }
1810
+ };
1811
+ function formatTimezoneShort(offset, dirtyDelimiter) {
1812
+ var sign = offset > 0 ? '-' : '+';
1813
+ var absOffset = Math.abs(offset);
1814
+ var hours = Math.floor(absOffset / 60);
1815
+ var minutes = absOffset % 60;
1816
+ if (minutes === 0) {
1817
+ return sign + String(hours);
1818
+ }
1819
+ var delimiter = dirtyDelimiter || '';
1820
+ return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
1821
+ }
1822
+ function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
1823
+ if (offset % 60 === 0) {
1824
+ var sign = offset > 0 ? '-' : '+';
1825
+ return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
1826
+ }
1827
+ return formatTimezone(offset, dirtyDelimiter);
1828
+ }
1829
+ function formatTimezone(offset, dirtyDelimiter) {
1830
+ var delimiter = dirtyDelimiter || '';
1831
+ var sign = offset > 0 ? '-' : '+';
1832
+ var absOffset = Math.abs(offset);
1833
+ var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
1834
+ var minutes = addLeadingZeros(absOffset % 60, 2);
1835
+ return sign + hours + delimiter + minutes;
1836
+ }
1837
+ const formatters$1 = formatters;
1838
+
1839
+ var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
1840
+ switch (pattern) {
1841
+ case 'P':
1842
+ return formatLong.date({
1843
+ width: 'short'
1844
+ });
1845
+ case 'PP':
1846
+ return formatLong.date({
1847
+ width: 'medium'
1848
+ });
1849
+ case 'PPP':
1850
+ return formatLong.date({
1851
+ width: 'long'
1852
+ });
1853
+ case 'PPPP':
1854
+ default:
1855
+ return formatLong.date({
1856
+ width: 'full'
1857
+ });
1858
+ }
1859
+ };
1860
+ var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
1861
+ switch (pattern) {
1862
+ case 'p':
1863
+ return formatLong.time({
1864
+ width: 'short'
1865
+ });
1866
+ case 'pp':
1867
+ return formatLong.time({
1868
+ width: 'medium'
1869
+ });
1870
+ case 'ppp':
1871
+ return formatLong.time({
1872
+ width: 'long'
1873
+ });
1874
+ case 'pppp':
1875
+ default:
1876
+ return formatLong.time({
1877
+ width: 'full'
1878
+ });
1879
+ }
1880
+ };
1881
+ var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong) {
1882
+ var matchResult = pattern.match(/(P+)(p+)?/) || [];
1883
+ var datePattern = matchResult[1];
1884
+ var timePattern = matchResult[2];
1885
+ if (!timePattern) {
1886
+ return dateLongFormatter(pattern, formatLong);
1887
+ }
1888
+ var dateTimeFormat;
1889
+ switch (datePattern) {
1890
+ case 'P':
1891
+ dateTimeFormat = formatLong.dateTime({
1892
+ width: 'short'
1893
+ });
1894
+ break;
1895
+ case 'PP':
1896
+ dateTimeFormat = formatLong.dateTime({
1897
+ width: 'medium'
1898
+ });
1899
+ break;
1900
+ case 'PPP':
1901
+ dateTimeFormat = formatLong.dateTime({
1902
+ width: 'long'
1903
+ });
1904
+ break;
1905
+ case 'PPPP':
1906
+ default:
1907
+ dateTimeFormat = formatLong.dateTime({
1908
+ width: 'full'
1909
+ });
1910
+ break;
1911
+ }
1912
+ return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
1913
+ };
1914
+ var longFormatters = {
1915
+ p: timeLongFormatter,
1916
+ P: dateTimeLongFormatter
1917
+ };
1918
+ const longFormatters$1 = longFormatters;
1919
+
1920
+ var protectedDayOfYearTokens = ['D', 'DD'];
1921
+ var protectedWeekYearTokens = ['YY', 'YYYY'];
1922
+ function isProtectedDayOfYearToken(token) {
1923
+ return protectedDayOfYearTokens.indexOf(token) !== -1;
1924
+ }
1925
+ function isProtectedWeekYearToken(token) {
1926
+ return protectedWeekYearTokens.indexOf(token) !== -1;
1927
+ }
1928
+ function throwProtectedError(token, format, input) {
1929
+ if (token === 'YYYY') {
1930
+ throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1931
+ } else if (token === 'YY') {
1932
+ throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1933
+ } else if (token === 'D') {
1934
+ throw new RangeError("Use `d` instead of `D` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1935
+ } else if (token === 'DD') {
1936
+ throw new RangeError("Use `dd` instead of `DD` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1937
+ }
1938
+ }
1939
+
1940
+ var formatDistanceLocale = {
1941
+ lessThanXSeconds: {
1942
+ one: 'less than a second',
1943
+ other: 'less than {{count}} seconds'
1944
+ },
1945
+ xSeconds: {
1946
+ one: '1 second',
1947
+ other: '{{count}} seconds'
1948
+ },
1949
+ halfAMinute: 'half a minute',
1950
+ lessThanXMinutes: {
1951
+ one: 'less than a minute',
1952
+ other: 'less than {{count}} minutes'
1953
+ },
1954
+ xMinutes: {
1955
+ one: '1 minute',
1956
+ other: '{{count}} minutes'
1957
+ },
1958
+ aboutXHours: {
1959
+ one: 'about 1 hour',
1960
+ other: 'about {{count}} hours'
1961
+ },
1962
+ xHours: {
1963
+ one: '1 hour',
1964
+ other: '{{count}} hours'
1965
+ },
1966
+ xDays: {
1967
+ one: '1 day',
1968
+ other: '{{count}} days'
1969
+ },
1970
+ aboutXWeeks: {
1971
+ one: 'about 1 week',
1972
+ other: 'about {{count}} weeks'
1973
+ },
1974
+ xWeeks: {
1975
+ one: '1 week',
1976
+ other: '{{count}} weeks'
1977
+ },
1978
+ aboutXMonths: {
1979
+ one: 'about 1 month',
1980
+ other: 'about {{count}} months'
1981
+ },
1982
+ xMonths: {
1983
+ one: '1 month',
1984
+ other: '{{count}} months'
1985
+ },
1986
+ aboutXYears: {
1987
+ one: 'about 1 year',
1988
+ other: 'about {{count}} years'
1989
+ },
1990
+ xYears: {
1991
+ one: '1 year',
1992
+ other: '{{count}} years'
1993
+ },
1994
+ overXYears: {
1995
+ one: 'over 1 year',
1996
+ other: 'over {{count}} years'
1997
+ },
1998
+ almostXYears: {
1999
+ one: 'almost 1 year',
2000
+ other: 'almost {{count}} years'
2001
+ }
2002
+ };
2003
+ var formatDistance = function formatDistance(token, count, options) {
2004
+ var result;
2005
+ var tokenValue = formatDistanceLocale[token];
2006
+ if (typeof tokenValue === 'string') {
2007
+ result = tokenValue;
2008
+ } else if (count === 1) {
2009
+ result = tokenValue.one;
2010
+ } else {
2011
+ result = tokenValue.other.replace('{{count}}', count.toString());
2012
+ }
2013
+ if (options !== null && options !== void 0 && options.addSuffix) {
2014
+ if (options.comparison && options.comparison > 0) {
2015
+ return 'in ' + result;
2016
+ } else {
2017
+ return result + ' ago';
2018
+ }
2019
+ }
2020
+ return result;
2021
+ };
2022
+ const formatDistance$1 = formatDistance;
2023
+
2024
+ function buildFormatLongFn(args) {
2025
+ return function () {
2026
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2027
+ // TODO: Remove String()
2028
+ var width = options.width ? String(options.width) : args.defaultWidth;
2029
+ var format = args.formats[width] || args.formats[args.defaultWidth];
2030
+ return format;
2031
+ };
2032
+ }
2033
+
2034
+ var dateFormats = {
2035
+ full: 'EEEE, MMMM do, y',
2036
+ long: 'MMMM do, y',
2037
+ medium: 'MMM d, y',
2038
+ short: 'MM/dd/yyyy'
2039
+ };
2040
+ var timeFormats = {
2041
+ full: 'h:mm:ss a zzzz',
2042
+ long: 'h:mm:ss a z',
2043
+ medium: 'h:mm:ss a',
2044
+ short: 'h:mm a'
2045
+ };
2046
+ var dateTimeFormats = {
2047
+ full: "{{date}} 'at' {{time}}",
2048
+ long: "{{date}} 'at' {{time}}",
2049
+ medium: '{{date}}, {{time}}',
2050
+ short: '{{date}}, {{time}}'
2051
+ };
2052
+ var formatLong = {
2053
+ date: buildFormatLongFn({
2054
+ formats: dateFormats,
2055
+ defaultWidth: 'full'
2056
+ }),
2057
+ time: buildFormatLongFn({
2058
+ formats: timeFormats,
2059
+ defaultWidth: 'full'
2060
+ }),
2061
+ dateTime: buildFormatLongFn({
2062
+ formats: dateTimeFormats,
2063
+ defaultWidth: 'full'
2064
+ })
2065
+ };
2066
+ const formatLong$1 = formatLong;
2067
+
2068
+ var formatRelativeLocale = {
2069
+ lastWeek: "'last' eeee 'at' p",
2070
+ yesterday: "'yesterday at' p",
2071
+ today: "'today at' p",
2072
+ tomorrow: "'tomorrow at' p",
2073
+ nextWeek: "eeee 'at' p",
2074
+ other: 'P'
2075
+ };
2076
+ var formatRelative = function formatRelative(token, _date, _baseDate, _options) {
2077
+ return formatRelativeLocale[token];
2078
+ };
2079
+ const formatRelative$1 = formatRelative;
2080
+
2081
+ function buildLocalizeFn(args) {
2082
+ return function (dirtyIndex, options) {
2083
+ var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';
2084
+ var valuesArray;
2085
+ if (context === 'formatting' && args.formattingValues) {
2086
+ var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
2087
+ var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
2088
+ valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
2089
+ } else {
2090
+ var _defaultWidth = args.defaultWidth;
2091
+ var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
2092
+ valuesArray = args.values[_width] || args.values[_defaultWidth];
2093
+ }
2094
+ var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
2095
+ // @ts-ignore: 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!
2096
+ return valuesArray[index];
2097
+ };
2098
+ }
2099
+
2100
+ var eraValues = {
2101
+ narrow: ['B', 'A'],
2102
+ abbreviated: ['BC', 'AD'],
2103
+ wide: ['Before Christ', 'Anno Domini']
2104
+ };
2105
+ var quarterValues = {
2106
+ narrow: ['1', '2', '3', '4'],
2107
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
2108
+ wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
2109
+ };
2110
+
2111
+ // Note: in English, the names of days of the week and months are capitalized.
2112
+ // If you are making a new locale based on this one, check if the same is true for the language you're working on.
2113
+ // Generally, formatted dates should look like they are in the middle of a sentence,
2114
+ // e.g. in Spanish language the weekdays and months should be in the lowercase.
2115
+ var monthValues = {
2116
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
2117
+ abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
2118
+ wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
2119
+ };
2120
+ var dayValues = {
2121
+ narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
2122
+ short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
2123
+ abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
2124
+ wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
2125
+ };
2126
+ var dayPeriodValues = {
2127
+ narrow: {
2128
+ am: 'a',
2129
+ pm: 'p',
2130
+ midnight: 'mi',
2131
+ noon: 'n',
2132
+ morning: 'morning',
2133
+ afternoon: 'afternoon',
2134
+ evening: 'evening',
2135
+ night: 'night'
2136
+ },
2137
+ abbreviated: {
2138
+ am: 'AM',
2139
+ pm: 'PM',
2140
+ midnight: 'midnight',
2141
+ noon: 'noon',
2142
+ morning: 'morning',
2143
+ afternoon: 'afternoon',
2144
+ evening: 'evening',
2145
+ night: 'night'
2146
+ },
2147
+ wide: {
2148
+ am: 'a.m.',
2149
+ pm: 'p.m.',
2150
+ midnight: 'midnight',
2151
+ noon: 'noon',
2152
+ morning: 'morning',
2153
+ afternoon: 'afternoon',
2154
+ evening: 'evening',
2155
+ night: 'night'
2156
+ }
2157
+ };
2158
+ var formattingDayPeriodValues = {
2159
+ narrow: {
2160
+ am: 'a',
2161
+ pm: 'p',
2162
+ midnight: 'mi',
2163
+ noon: 'n',
2164
+ morning: 'in the morning',
2165
+ afternoon: 'in the afternoon',
2166
+ evening: 'in the evening',
2167
+ night: 'at night'
2168
+ },
2169
+ abbreviated: {
2170
+ am: 'AM',
2171
+ pm: 'PM',
2172
+ midnight: 'midnight',
2173
+ noon: 'noon',
2174
+ morning: 'in the morning',
2175
+ afternoon: 'in the afternoon',
2176
+ evening: 'in the evening',
2177
+ night: 'at night'
2178
+ },
2179
+ wide: {
2180
+ am: 'a.m.',
2181
+ pm: 'p.m.',
2182
+ midnight: 'midnight',
2183
+ noon: 'noon',
2184
+ morning: 'in the morning',
2185
+ afternoon: 'in the afternoon',
2186
+ evening: 'in the evening',
2187
+ night: 'at night'
2188
+ }
2189
+ };
2190
+ var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
2191
+ var number = Number(dirtyNumber);
2192
+
2193
+ // If ordinal numbers depend on context, for example,
2194
+ // if they are different for different grammatical genders,
2195
+ // use `options.unit`.
2196
+ //
2197
+ // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
2198
+ // 'day', 'hour', 'minute', 'second'.
2199
+
2200
+ var rem100 = number % 100;
2201
+ if (rem100 > 20 || rem100 < 10) {
2202
+ switch (rem100 % 10) {
2203
+ case 1:
2204
+ return number + 'st';
2205
+ case 2:
2206
+ return number + 'nd';
2207
+ case 3:
2208
+ return number + 'rd';
2209
+ }
2210
+ }
2211
+ return number + 'th';
2212
+ };
2213
+ var localize = {
2214
+ ordinalNumber: ordinalNumber,
2215
+ era: buildLocalizeFn({
2216
+ values: eraValues,
2217
+ defaultWidth: 'wide'
2218
+ }),
2219
+ quarter: buildLocalizeFn({
2220
+ values: quarterValues,
2221
+ defaultWidth: 'wide',
2222
+ argumentCallback: function argumentCallback(quarter) {
2223
+ return quarter - 1;
2224
+ }
2225
+ }),
2226
+ month: buildLocalizeFn({
2227
+ values: monthValues,
2228
+ defaultWidth: 'wide'
2229
+ }),
2230
+ day: buildLocalizeFn({
2231
+ values: dayValues,
2232
+ defaultWidth: 'wide'
2233
+ }),
2234
+ dayPeriod: buildLocalizeFn({
2235
+ values: dayPeriodValues,
2236
+ defaultWidth: 'wide',
2237
+ formattingValues: formattingDayPeriodValues,
2238
+ defaultFormattingWidth: 'wide'
2239
+ })
2240
+ };
2241
+ const localize$1 = localize;
2242
+
2243
+ function buildMatchFn(args) {
2244
+ return function (string) {
2245
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2246
+ var width = options.width;
2247
+ var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
2248
+ var matchResult = string.match(matchPattern);
2249
+ if (!matchResult) {
2250
+ return null;
2251
+ }
2252
+ var matchedString = matchResult[0];
2253
+ var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
2254
+ var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
2255
+ return pattern.test(matchedString);
2256
+ }) : findKey(parsePatterns, function (pattern) {
2257
+ return pattern.test(matchedString);
2258
+ });
2259
+ var value;
2260
+ value = args.valueCallback ? args.valueCallback(key) : key;
2261
+ value = options.valueCallback ? options.valueCallback(value) : value;
2262
+ var rest = string.slice(matchedString.length);
2263
+ return {
2264
+ value: value,
2265
+ rest: rest
2266
+ };
2267
+ };
2268
+ }
2269
+ function findKey(object, predicate) {
2270
+ for (var key in object) {
2271
+ if (object.hasOwnProperty(key) && predicate(object[key])) {
2272
+ return key;
2273
+ }
2274
+ }
2275
+ return undefined;
2276
+ }
2277
+ function findIndex(array, predicate) {
2278
+ for (var key = 0; key < array.length; key++) {
2279
+ if (predicate(array[key])) {
2280
+ return key;
2281
+ }
2282
+ }
2283
+ return undefined;
2284
+ }
2285
+
2286
+ function buildMatchPatternFn(args) {
2287
+ return function (string) {
2288
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2289
+ var matchResult = string.match(args.matchPattern);
2290
+ if (!matchResult) return null;
2291
+ var matchedString = matchResult[0];
2292
+ var parseResult = string.match(args.parsePattern);
2293
+ if (!parseResult) return null;
2294
+ var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
2295
+ value = options.valueCallback ? options.valueCallback(value) : value;
2296
+ var rest = string.slice(matchedString.length);
2297
+ return {
2298
+ value: value,
2299
+ rest: rest
2300
+ };
2301
+ };
2302
+ }
2303
+
2304
+ var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
2305
+ var parseOrdinalNumberPattern = /\d+/i;
2306
+ var matchEraPatterns = {
2307
+ narrow: /^(b|a)/i,
2308
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
2309
+ wide: /^(before christ|before common era|anno domini|common era)/i
2310
+ };
2311
+ var parseEraPatterns = {
2312
+ any: [/^b/i, /^(a|c)/i]
2313
+ };
2314
+ var matchQuarterPatterns = {
2315
+ narrow: /^[1234]/i,
2316
+ abbreviated: /^q[1234]/i,
2317
+ wide: /^[1234](th|st|nd|rd)? quarter/i
2318
+ };
2319
+ var parseQuarterPatterns = {
2320
+ any: [/1/i, /2/i, /3/i, /4/i]
2321
+ };
2322
+ var matchMonthPatterns = {
2323
+ narrow: /^[jfmasond]/i,
2324
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
2325
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
2326
+ };
2327
+ var parseMonthPatterns = {
2328
+ 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],
2329
+ 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]
2330
+ };
2331
+ var matchDayPatterns = {
2332
+ narrow: /^[smtwf]/i,
2333
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
2334
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
2335
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
2336
+ };
2337
+ var parseDayPatterns = {
2338
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
2339
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
2340
+ };
2341
+ var matchDayPeriodPatterns = {
2342
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
2343
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
2344
+ };
2345
+ var parseDayPeriodPatterns = {
2346
+ any: {
2347
+ am: /^a/i,
2348
+ pm: /^p/i,
2349
+ midnight: /^mi/i,
2350
+ noon: /^no/i,
2351
+ morning: /morning/i,
2352
+ afternoon: /afternoon/i,
2353
+ evening: /evening/i,
2354
+ night: /night/i
2355
+ }
2356
+ };
2357
+ var match = {
2358
+ ordinalNumber: buildMatchPatternFn({
2359
+ matchPattern: matchOrdinalNumberPattern,
2360
+ parsePattern: parseOrdinalNumberPattern,
2361
+ valueCallback: function valueCallback(value) {
2362
+ return parseInt(value, 10);
2363
+ }
2364
+ }),
2365
+ era: buildMatchFn({
2366
+ matchPatterns: matchEraPatterns,
2367
+ defaultMatchWidth: 'wide',
2368
+ parsePatterns: parseEraPatterns,
2369
+ defaultParseWidth: 'any'
2370
+ }),
2371
+ quarter: buildMatchFn({
2372
+ matchPatterns: matchQuarterPatterns,
2373
+ defaultMatchWidth: 'wide',
2374
+ parsePatterns: parseQuarterPatterns,
2375
+ defaultParseWidth: 'any',
2376
+ valueCallback: function valueCallback(index) {
2377
+ return index + 1;
2378
+ }
2379
+ }),
2380
+ month: buildMatchFn({
2381
+ matchPatterns: matchMonthPatterns,
2382
+ defaultMatchWidth: 'wide',
2383
+ parsePatterns: parseMonthPatterns,
2384
+ defaultParseWidth: 'any'
2385
+ }),
2386
+ day: buildMatchFn({
2387
+ matchPatterns: matchDayPatterns,
2388
+ defaultMatchWidth: 'wide',
2389
+ parsePatterns: parseDayPatterns,
2390
+ defaultParseWidth: 'any'
2391
+ }),
2392
+ dayPeriod: buildMatchFn({
2393
+ matchPatterns: matchDayPeriodPatterns,
2394
+ defaultMatchWidth: 'any',
2395
+ parsePatterns: parseDayPeriodPatterns,
2396
+ defaultParseWidth: 'any'
2397
+ })
2398
+ };
2399
+ const match$1 = match;
2400
+
2401
+ /**
2402
+ * @type {Locale}
2403
+ * @category Locales
2404
+ * @summary English locale (United States).
2405
+ * @language English
2406
+ * @iso-639-2 eng
2407
+ * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
2408
+ * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
2409
+ */
2410
+ var locale = {
2411
+ code: 'en-US',
2412
+ formatDistance: formatDistance$1,
2413
+ formatLong: formatLong$1,
2414
+ formatRelative: formatRelative$1,
2415
+ localize: localize$1,
2416
+ match: match$1,
2417
+ options: {
2418
+ weekStartsOn: 0 /* Sunday */,
2419
+ firstWeekContainsDate: 1
2420
+ }
2421
+ };
2422
+ const defaultLocale = locale;
2423
+
2424
+ // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
2425
+ // (one of the certain letters followed by `o`)
2426
+ // - (\w)\1* matches any sequences of the same letter
2427
+ // - '' matches two quote characters in a row
2428
+ // - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
2429
+ // except a single quote symbol, which ends the sequence.
2430
+ // Two quote characters do not end the sequence.
2431
+ // If there is no matching single quote
2432
+ // then the sequence will continue until the end of the string.
2433
+ // - . matches any single character unmatched by previous parts of the RegExps
2434
+ var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
2435
+
2436
+ // This RegExp catches symbols escaped by quotes, and also
2437
+ // sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
2438
+ var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
2439
+ var escapedStringRegExp = /^'([^]*?)'?$/;
2440
+ var doubleQuoteRegExp = /''/g;
2441
+ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
2442
+
2443
+ /**
2444
+ * @name format
2445
+ * @category Common Helpers
2446
+ * @summary Format the date.
2447
+ *
2448
+ * @description
2449
+ * Return the formatted date string in the given format. The result may vary by locale.
2450
+ *
2451
+ * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
2452
+ * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2453
+ *
2454
+ * The characters wrapped between two single quotes characters (') are escaped.
2455
+ * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
2456
+ * (see the last example)
2457
+ *
2458
+ * Format of the string is based on Unicode Technical Standard #35:
2459
+ * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
2460
+ * with a few additions (see note 7 below the table).
2461
+ *
2462
+ * Accepted patterns:
2463
+ * | Unit | Pattern | Result examples | Notes |
2464
+ * |---------------------------------|---------|-----------------------------------|-------|
2465
+ * | Era | G..GGG | AD, BC | |
2466
+ * | | GGGG | Anno Domini, Before Christ | 2 |
2467
+ * | | GGGGG | A, B | |
2468
+ * | Calendar year | y | 44, 1, 1900, 2017 | 5 |
2469
+ * | | yo | 44th, 1st, 0th, 17th | 5,7 |
2470
+ * | | yy | 44, 01, 00, 17 | 5 |
2471
+ * | | yyy | 044, 001, 1900, 2017 | 5 |
2472
+ * | | yyyy | 0044, 0001, 1900, 2017 | 5 |
2473
+ * | | yyyyy | ... | 3,5 |
2474
+ * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
2475
+ * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
2476
+ * | | YY | 44, 01, 00, 17 | 5,8 |
2477
+ * | | YYY | 044, 001, 1900, 2017 | 5 |
2478
+ * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
2479
+ * | | YYYYY | ... | 3,5 |
2480
+ * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
2481
+ * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
2482
+ * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
2483
+ * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
2484
+ * | | RRRRR | ... | 3,5,7 |
2485
+ * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
2486
+ * | | uu | -43, 01, 1900, 2017 | 5 |
2487
+ * | | uuu | -043, 001, 1900, 2017 | 5 |
2488
+ * | | uuuu | -0043, 0001, 1900, 2017 | 5 |
2489
+ * | | uuuuu | ... | 3,5 |
2490
+ * | Quarter (formatting) | Q | 1, 2, 3, 4 | |
2491
+ * | | Qo | 1st, 2nd, 3rd, 4th | 7 |
2492
+ * | | QQ | 01, 02, 03, 04 | |
2493
+ * | | QQQ | Q1, Q2, Q3, Q4 | |
2494
+ * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
2495
+ * | | QQQQQ | 1, 2, 3, 4 | 4 |
2496
+ * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
2497
+ * | | qo | 1st, 2nd, 3rd, 4th | 7 |
2498
+ * | | qq | 01, 02, 03, 04 | |
2499
+ * | | qqq | Q1, Q2, Q3, Q4 | |
2500
+ * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
2501
+ * | | qqqqq | 1, 2, 3, 4 | 4 |
2502
+ * | Month (formatting) | M | 1, 2, ..., 12 | |
2503
+ * | | Mo | 1st, 2nd, ..., 12th | 7 |
2504
+ * | | MM | 01, 02, ..., 12 | |
2505
+ * | | MMM | Jan, Feb, ..., Dec | |
2506
+ * | | MMMM | January, February, ..., December | 2 |
2507
+ * | | MMMMM | J, F, ..., D | |
2508
+ * | Month (stand-alone) | L | 1, 2, ..., 12 | |
2509
+ * | | Lo | 1st, 2nd, ..., 12th | 7 |
2510
+ * | | LL | 01, 02, ..., 12 | |
2511
+ * | | LLL | Jan, Feb, ..., Dec | |
2512
+ * | | LLLL | January, February, ..., December | 2 |
2513
+ * | | LLLLL | J, F, ..., D | |
2514
+ * | Local week of year | w | 1, 2, ..., 53 | |
2515
+ * | | wo | 1st, 2nd, ..., 53th | 7 |
2516
+ * | | ww | 01, 02, ..., 53 | |
2517
+ * | ISO week of year | I | 1, 2, ..., 53 | 7 |
2518
+ * | | Io | 1st, 2nd, ..., 53th | 7 |
2519
+ * | | II | 01, 02, ..., 53 | 7 |
2520
+ * | Day of month | d | 1, 2, ..., 31 | |
2521
+ * | | do | 1st, 2nd, ..., 31st | 7 |
2522
+ * | | dd | 01, 02, ..., 31 | |
2523
+ * | Day of year | D | 1, 2, ..., 365, 366 | 9 |
2524
+ * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
2525
+ * | | DD | 01, 02, ..., 365, 366 | 9 |
2526
+ * | | DDD | 001, 002, ..., 365, 366 | |
2527
+ * | | DDDD | ... | 3 |
2528
+ * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
2529
+ * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
2530
+ * | | EEEEE | M, T, W, T, F, S, S | |
2531
+ * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
2532
+ * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
2533
+ * | | io | 1st, 2nd, ..., 7th | 7 |
2534
+ * | | ii | 01, 02, ..., 07 | 7 |
2535
+ * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
2536
+ * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
2537
+ * | | iiiii | M, T, W, T, F, S, S | 7 |
2538
+ * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
2539
+ * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
2540
+ * | | eo | 2nd, 3rd, ..., 1st | 7 |
2541
+ * | | ee | 02, 03, ..., 01 | |
2542
+ * | | eee | Mon, Tue, Wed, ..., Sun | |
2543
+ * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
2544
+ * | | eeeee | M, T, W, T, F, S, S | |
2545
+ * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
2546
+ * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
2547
+ * | | co | 2nd, 3rd, ..., 1st | 7 |
2548
+ * | | cc | 02, 03, ..., 01 | |
2549
+ * | | ccc | Mon, Tue, Wed, ..., Sun | |
2550
+ * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
2551
+ * | | ccccc | M, T, W, T, F, S, S | |
2552
+ * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
2553
+ * | AM, PM | a..aa | AM, PM | |
2554
+ * | | aaa | am, pm | |
2555
+ * | | aaaa | a.m., p.m. | 2 |
2556
+ * | | aaaaa | a, p | |
2557
+ * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
2558
+ * | | bbb | am, pm, noon, midnight | |
2559
+ * | | bbbb | a.m., p.m., noon, midnight | 2 |
2560
+ * | | bbbbb | a, p, n, mi | |
2561
+ * | Flexible day period | B..BBB | at night, in the morning, ... | |
2562
+ * | | BBBB | at night, in the morning, ... | 2 |
2563
+ * | | BBBBB | at night, in the morning, ... | |
2564
+ * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
2565
+ * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
2566
+ * | | hh | 01, 02, ..., 11, 12 | |
2567
+ * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
2568
+ * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
2569
+ * | | HH | 00, 01, 02, ..., 23 | |
2570
+ * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
2571
+ * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
2572
+ * | | KK | 01, 02, ..., 11, 00 | |
2573
+ * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
2574
+ * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
2575
+ * | | kk | 24, 01, 02, ..., 23 | |
2576
+ * | Minute | m | 0, 1, ..., 59 | |
2577
+ * | | mo | 0th, 1st, ..., 59th | 7 |
2578
+ * | | mm | 00, 01, ..., 59 | |
2579
+ * | Second | s | 0, 1, ..., 59 | |
2580
+ * | | so | 0th, 1st, ..., 59th | 7 |
2581
+ * | | ss | 00, 01, ..., 59 | |
2582
+ * | Fraction of second | S | 0, 1, ..., 9 | |
2583
+ * | | SS | 00, 01, ..., 99 | |
2584
+ * | | SSS | 000, 001, ..., 999 | |
2585
+ * | | SSSS | ... | 3 |
2586
+ * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
2587
+ * | | XX | -0800, +0530, Z | |
2588
+ * | | XXX | -08:00, +05:30, Z | |
2589
+ * | | XXXX | -0800, +0530, Z, +123456 | 2 |
2590
+ * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
2591
+ * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
2592
+ * | | xx | -0800, +0530, +0000 | |
2593
+ * | | xxx | -08:00, +05:30, +00:00 | 2 |
2594
+ * | | xxxx | -0800, +0530, +0000, +123456 | |
2595
+ * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
2596
+ * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
2597
+ * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
2598
+ * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
2599
+ * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
2600
+ * | Seconds timestamp | t | 512969520 | 7 |
2601
+ * | | tt | ... | 3,7 |
2602
+ * | Milliseconds timestamp | T | 512969520900 | 7 |
2603
+ * | | TT | ... | 3,7 |
2604
+ * | Long localized date | P | 04/29/1453 | 7 |
2605
+ * | | PP | Apr 29, 1453 | 7 |
2606
+ * | | PPP | April 29th, 1453 | 7 |
2607
+ * | | PPPP | Friday, April 29th, 1453 | 2,7 |
2608
+ * | Long localized time | p | 12:00 AM | 7 |
2609
+ * | | pp | 12:00:00 AM | 7 |
2610
+ * | | ppp | 12:00:00 AM GMT+2 | 7 |
2611
+ * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
2612
+ * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
2613
+ * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
2614
+ * | | PPPppp | April 29th, 1453 at ... | 7 |
2615
+ * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
2616
+ * Notes:
2617
+ * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
2618
+ * are the same as "stand-alone" units, but are different in some languages.
2619
+ * "Formatting" units are declined according to the rules of the language
2620
+ * in the context of a date. "Stand-alone" units are always nominative singular:
2621
+ *
2622
+ * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
2623
+ *
2624
+ * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
2625
+ *
2626
+ * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
2627
+ * the single quote characters (see below).
2628
+ * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
2629
+ * the output will be the same as default pattern for this unit, usually
2630
+ * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
2631
+ * are marked with "2" in the last column of the table.
2632
+ *
2633
+ * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
2634
+ *
2635
+ * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
2636
+ *
2637
+ * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
2638
+ *
2639
+ * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
2640
+ *
2641
+ * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
2642
+ *
2643
+ * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
2644
+ * The output will be padded with zeros to match the length of the pattern.
2645
+ *
2646
+ * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
2647
+ *
2648
+ * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
2649
+ * These tokens represent the shortest form of the quarter.
2650
+ *
2651
+ * 5. The main difference between `y` and `u` patterns are B.C. years:
2652
+ *
2653
+ * | Year | `y` | `u` |
2654
+ * |------|-----|-----|
2655
+ * | AC 1 | 1 | 1 |
2656
+ * | BC 1 | 1 | 0 |
2657
+ * | BC 2 | 2 | -1 |
2658
+ *
2659
+ * Also `yy` always returns the last two digits of a year,
2660
+ * while `uu` pads single digit years to 2 characters and returns other years unchanged:
2661
+ *
2662
+ * | Year | `yy` | `uu` |
2663
+ * |------|------|------|
2664
+ * | 1 | 01 | 01 |
2665
+ * | 14 | 14 | 14 |
2666
+ * | 376 | 76 | 376 |
2667
+ * | 1453 | 53 | 1453 |
2668
+ *
2669
+ * The same difference is true for local and ISO week-numbering years (`Y` and `R`),
2670
+ * except local week-numbering years are dependent on `options.weekStartsOn`
2671
+ * and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}
2672
+ * and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).
2673
+ *
2674
+ * 6. Specific non-location timezones are currently unavailable in `date-fns`,
2675
+ * so right now these tokens fall back to GMT timezones.
2676
+ *
2677
+ * 7. These patterns are not in the Unicode Technical Standard #35:
2678
+ * - `i`: ISO day of week
2679
+ * - `I`: ISO week of year
2680
+ * - `R`: ISO week-numbering year
2681
+ * - `t`: seconds timestamp
2682
+ * - `T`: milliseconds timestamp
2683
+ * - `o`: ordinal number modifier
2684
+ * - `P`: long localized date
2685
+ * - `p`: long localized time
2686
+ *
2687
+ * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
2688
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2689
+ *
2690
+ * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
2691
+ * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2692
+ *
2693
+ * @param {Date|Number} date - the original date
2694
+ * @param {String} format - the string of tokens
2695
+ * @param {Object} [options] - an object with options.
2696
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
2697
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
2698
+ * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
2699
+ * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
2700
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2701
+ * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
2702
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2703
+ * @returns {String} the formatted date string
2704
+ * @throws {TypeError} 2 arguments required
2705
+ * @throws {RangeError} `date` must not be Invalid Date
2706
+ * @throws {RangeError} `options.locale` must contain `localize` property
2707
+ * @throws {RangeError} `options.locale` must contain `formatLong` property
2708
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
2709
+ * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
2710
+ * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2711
+ * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2712
+ * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2713
+ * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2714
+ * @throws {RangeError} format string contains an unescaped latin alphabet character
2715
+ *
2716
+ * @example
2717
+ * // Represent 11 February 2014 in middle-endian format:
2718
+ * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
2719
+ * //=> '02/11/2014'
2720
+ *
2721
+ * @example
2722
+ * // Represent 2 July 2014 in Esperanto:
2723
+ * import { eoLocale } from 'date-fns/locale/eo'
2724
+ * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
2725
+ * locale: eoLocale
2726
+ * })
2727
+ * //=> '2-a de julio 2014'
2728
+ *
2729
+ * @example
2730
+ * // Escape string by single quote characters:
2731
+ * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
2732
+ * //=> "3 o'clock"
2733
+ */
2734
+
2735
+ function format(dirtyDate, dirtyFormatStr, options) {
2736
+ var _ref, _options$locale, _ref2, _ref3, _ref4, _options$firstWeekCon, _options$locale2, _options$locale2$opti, _defaultOptions$local, _defaultOptions$local2, _ref5, _ref6, _ref7, _options$weekStartsOn, _options$locale3, _options$locale3$opti, _defaultOptions$local3, _defaultOptions$local4;
2737
+ requiredArgs(2, arguments);
2738
+ var formatStr = String(dirtyFormatStr);
2739
+ var defaultOptions = getDefaultOptions();
2740
+ var locale = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : defaultLocale;
2741
+ var firstWeekContainsDate = toInteger((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1);
2742
+
2743
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
2744
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
2745
+ throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
2746
+ }
2747
+ var weekStartsOn = toInteger((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0);
2748
+
2749
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
2750
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
2751
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
2752
+ }
2753
+ if (!locale.localize) {
2754
+ throw new RangeError('locale must contain localize property');
2755
+ }
2756
+ if (!locale.formatLong) {
2757
+ throw new RangeError('locale must contain formatLong property');
2758
+ }
2759
+ var originalDate = toDate(dirtyDate);
2760
+ if (!isValid(originalDate)) {
2761
+ throw new RangeError('Invalid time value');
2762
+ }
2763
+
2764
+ // Convert the date in system timezone to the same date in UTC+00:00 timezone.
2765
+ // This ensures that when UTC functions will be implemented, locales will be compatible with them.
2766
+ // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
2767
+ var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
2768
+ var utcDate = subMilliseconds(originalDate, timezoneOffset);
2769
+ var formatterOptions = {
2770
+ firstWeekContainsDate: firstWeekContainsDate,
2771
+ weekStartsOn: weekStartsOn,
2772
+ locale: locale,
2773
+ _originalDate: originalDate
2774
+ };
2775
+ var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {
2776
+ var firstCharacter = substring[0];
2777
+ if (firstCharacter === 'p' || firstCharacter === 'P') {
2778
+ var longFormatter = longFormatters$1[firstCharacter];
2779
+ return longFormatter(substring, locale.formatLong);
2780
+ }
2781
+ return substring;
2782
+ }).join('').match(formattingTokensRegExp).map(function (substring) {
2783
+ // Replace two single quote characters with one single quote character
2784
+ if (substring === "''") {
2785
+ return "'";
2786
+ }
2787
+ var firstCharacter = substring[0];
2788
+ if (firstCharacter === "'") {
2789
+ return cleanEscapedString(substring);
2790
+ }
2791
+ var formatter = formatters$1[firstCharacter];
2792
+ if (formatter) {
2793
+ if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) {
2794
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
2795
+ }
2796
+ if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) {
2797
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
2798
+ }
2799
+ return formatter(utcDate, substring, locale.localize, formatterOptions);
2800
+ }
2801
+ if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
2802
+ throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');
2803
+ }
2804
+ return substring;
2805
+ }).join('');
2806
+ return result;
2807
+ }
2808
+ function cleanEscapedString(input) {
2809
+ var matched = input.match(escapedStringRegExp);
2810
+ if (!matched) {
2811
+ return input;
2812
+ }
2813
+ return matched[1].replace(doubleQuoteRegExp, "'");
2814
+ }
2815
+
2816
+ const casinoChallengesPlayerHistoryCss = ".history {\n width: 100%;\n padding: 0 10%;\n box-sizing: border-box;\n display: flex;\n gap: 16px;\n flex-direction: column;\n}\n@container challenges-container (max-width: 800px) {\n .history {\n padding: 0;\n }\n}\n\n.item {\n background-color: var(--emw--history-item-background, rgba(114, 118, 114, 0.2));\n border-radius: 12px;\n padding: 20px;\n}\n\n.header {\n cursor: pointer;\n border: none;\n width: 100%;\n text-align: left;\n background: transparent;\n color: var(--emw--color-white, white);\n font-size: var(--emw--font-size-medium, 16px);\n font-weight: var(--emw--font-weight-bold, 700);\n display: flex;\n justify-content: space-between;\n padding: 0;\n}\n@container challenges-container (max-width: 800px) {\n .header {\n line-height: var(--emw--font-size-medium, 14px);\n }\n}\n\n.content {\n max-height: 0;\n overflow: auto;\n transition: max-height 0.3s ease;\n background: transparent;\n color: var(--emw--color-white, white);\n}\n.content.open {\n max-height: 400px;\n}\n.content .row {\n display: flex;\n font-size: var(--emw--font-size-medium, 14px);\n font-weight: var(--emw--font-weight-medium, 500);\n line-height: 24px;\n padding: 10px 12px 4px;\n box-sizing: border-box;\n color: var(--emw--color-gray-150, #c8d6ce);\n}\n.content .row .col-1 {\n flex-grow: 1;\n}\n.content .row .col-2 {\n width: 120px;\n}\n.content .row .col-2.errored {\n color: var(--emw--color-error, #D6421E);\n}\n@container challenges-container (max-width: 800px) {\n .content .row {\n font-size: var(--emw--font-size-small, 12px);\n line-height: 22px;\n }\n}\n@container challenges-container (max-width: 620px) {\n .content .row .col-1,\n .content .row .col-2 {\n width: 91px;\n }\n}\n.content .reward {\n margin: 0;\n padding: 0 12px 10px;\n box-sizing: border-box;\n font-size: var(--emw--font-size-small, 12px);\n font-weight: var(--emw--font-weight-medium, 500);\n line-height: 19px;\n color: var(--emw--color-valid, #03873e);\n border-bottom: 1px solid var(--emw--button-border-color, rgba(200, 214, 206, 0.1019607843));\n display: flex;\n gap: 8px;\n}\n.content .reward.grayed {\n color: var(--emw--color-gray-300, #555a57);\n}\n@container challenges-container (max-width: 800px) {\n .content .reward {\n font-size: var(--emw--font-size-small, 12px);\n line-height: 14px;\n }\n .content .reward img {\n width: 12px;\n height: 12px;\n }\n}\n.content .list-header {\n padding: 0 12px;\n margin-top: 20px;\n border-radius: 6px 6px 0 0;\n color: var(--emw--history-header-color, #727672);\n background: var(--emw--history-item-header-background, #202120);\n}\n.content .list-header span {\n font-size: var(--emw--font-size-small, 12px);\n font-weight: var(--emw--font-weight-bold, 700);\n line-height: 28px;\n}\n@container challenges-container (max-width: 800px) {\n .content .list-header span {\n font-size: var(--emw--font-size-x-small, 10px);\n line-height: 20px;\n }\n}";
2817
+ const CasinoChallengesPlayerHistoryStyle0 = casinoChallengesPlayerHistoryCss;
2818
+
2819
+ const skeletons = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
2820
+ const CasinoChallengesPlayerHistory = class {
2821
+ constructor(hostRef) {
2822
+ registerInstance(this, hostRef);
2823
+ this.loadMore = createEvent(this, "loadMore", 7);
2824
+ this.setLastItemRef = (el) => {
2825
+ if (this.lastItemRef && this.observer) {
2826
+ this.observer.unobserve(this.lastItemRef);
2827
+ }
2828
+ this.lastItemRef = el;
2829
+ if (el && this.observer && !this.loading) {
2830
+ this.observer.observe(el);
2831
+ }
2832
+ };
2833
+ this.mbSource = undefined;
2834
+ this.clientStyling = undefined;
2835
+ this.clientStylingUrl = undefined;
2836
+ this.translationUrl = '';
2837
+ this.language = 'en';
2838
+ this.playerHistory = [];
2839
+ this.loading = false;
2840
+ this.hasMore = false;
2841
+ this.openItems = [];
2842
+ }
2843
+ handleClientStylingChange(newValue, oldValue) {
2844
+ if (newValue != oldValue) {
2845
+ setClientStyling(this.stylingContainer, this.clientStyling);
2846
+ }
2847
+ }
2848
+ handleClientStylingUrlChange(newValue, oldValue) {
2849
+ if (newValue != oldValue) {
2850
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
2851
+ }
2852
+ }
2853
+ handleMbSourceChange(newValue, oldValue) {
2854
+ if (newValue != oldValue) {
2855
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
2856
+ }
2857
+ }
2858
+ handlePlayerHistoryChange() {
2859
+ this.openItems = this.playerHistory.map(() => false);
2860
+ }
2861
+ setupObserver() {
2862
+ if (!this.lastItemRef || this.loading || !this.hasMore)
2863
+ return;
2864
+ if (!this.observer) {
2865
+ this.observer = new IntersectionObserver(([entry]) => {
2866
+ if (entry.isIntersecting && !this.loading && this.hasMore) {
2867
+ this.observer.unobserve(entry.target);
2868
+ this.loadMore.emit();
2869
+ }
2870
+ }, {
2871
+ root: null,
2872
+ rootMargin: '0px',
2873
+ threshold: 0.1
2874
+ });
2875
+ }
2876
+ this.observer.disconnect();
2877
+ this.observer.observe(this.lastItemRef);
2878
+ }
2879
+ componentDidLoad() {
2880
+ if (this.stylingContainer) {
2881
+ if (this.mbSource)
2882
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
2883
+ if (this.clientStyling)
2884
+ setClientStyling(this.stylingContainer, this.clientStyling);
2885
+ if (this.clientStylingUrl)
2886
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
2887
+ }
2888
+ }
2889
+ componentWillLoad() {
2890
+ if (this.translationUrl) {
2891
+ resolveTranslationUrl(this.translationUrl);
2892
+ }
2893
+ }
2894
+ componentDidRender() {
2895
+ this.setupObserver();
2896
+ }
2897
+ disconnectedCallback() {
2898
+ var _a;
2899
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
2900
+ (_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
2901
+ this.observer = undefined;
2902
+ }
2903
+ toggle(index) {
2904
+ this.openItems = this.openItems.map((open, i) => (i === index ? !open : open));
2905
+ }
2906
+ renderLevel(level) {
2907
+ const rewards = Object.values(level.Rewards)
2908
+ .map((r) => r.RewardDescription)
2909
+ .join(', ');
2910
+ return (h("div", null, h("div", { class: "row" }, h("span", { class: "col-1" }, `${translate('level', this.language)} ${level.OrderNumber + 1}`), h("span", { class: `col-2 ${level.Status === EHistoryItemLevelStatus.Forfeited ? 'errored' : ''}` }, HistoryItemLevelStatusDictionary[level.Status]), h("span", { class: "col-2" }, format(new Date(level.Time), 'dd/MM/yy HH:mm'))), h("p", { class: `reward ${level.Status === EHistoryItemLevelStatus.Completed ? '' : 'grayed'}` }, h("img", { src: giftSvg }), rewards)));
2911
+ }
2912
+ renderSkeletons() {
2913
+ return skeletons.map((skeleton) => (h("div", { class: "loader", key: skeleton }, h("ui-skeleton", { structure: "title", width: "auto", height: "60px", marginBottom: 0 }))));
2914
+ }
2915
+ render() {
2916
+ return (h("div", { key: '0781f3ee74b3f3b8b5b09e3269974e876ece82ef', ref: (el) => (this.stylingContainer = el) }, h("div", { key: '78108ee5c86b0e87363e9ed980c242890f2453b1', class: "history" }, this.playerHistory.map((item, index) => (h("div", { class: "item", ref: index === this.playerHistory.length - 1 ? this.setLastItemRef : null }, h("button", { class: "header", onClick: () => this.toggle(index) }, h("span", null, item.Name), h("img", { src: this.openItems[index] ? arrowUpSvg : arrowDownSvg })), h("div", { class: `content ${this.openItems[index] ? 'open' : ''}` }, h("div", { class: "row list-header" }, h("span", { class: "col-1", style: { textTransform: 'uppercase' } }, translate('level', this.language)), h("span", { class: "col-2", style: { textTransform: 'uppercase' } }, translate('status', this.language)), h("span", { class: "col-2", style: { textTransform: 'uppercase' } }, translate('time', this.language))), item.Levels.map((level) => this.renderLevel(level)))))), this.loading && this.renderSkeletons())));
2917
+ }
2918
+ static get watchers() { return {
2919
+ "clientStyling": ["handleClientStylingChange"],
2920
+ "clientStylingUrl": ["handleClientStylingUrlChange"],
2921
+ "mbSource": ["handleMbSourceChange"],
2922
+ "playerHistory": ["handlePlayerHistoryChange"]
2923
+ }; }
2924
+ };
2925
+ CasinoChallengesPlayerHistory.style = CasinoChallengesPlayerHistoryStyle0;
2926
+
2927
+ const uiSkeletonCss = ":host{display:block}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 10px)}.Circle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.Text{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 10px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.Text:last-child{width:calc(var(--emw-skeleton-text-width, 400px) - 100px)}.Title{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 10px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.Image{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, unset)}.Logo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 10px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, #e0e0e0)}100%{background-color:var(--emw-skeleton-secondary-color, #f0f0f0)}}";
2928
+ const UiSkeletonStyle0 = uiSkeletonCss;
2929
+
2930
+ const UiSkeleton = class {
2931
+ constructor(hostRef) {
2932
+ registerInstance(this, hostRef);
2933
+ this.stylingValue = {
2934
+ width: this.handleStylingProps(this.width),
2935
+ height: this.handleStylingProps(this.height),
2936
+ borderRadius: this.handleStylingProps(this.borderRadius),
2937
+ marginBottom: this.handleStylingProps(this.marginBottom),
2938
+ marginTop: this.handleStylingProps(this.marginTop),
2939
+ marginLeft: this.handleStylingProps(this.marginLeft),
2940
+ marginRight: this.handleStylingProps(this.marginRight),
2941
+ size: this.handleStylingProps(this.size)
2942
+ };
2943
+ this.structure = undefined;
2944
+ this.width = 'unset';
2945
+ this.height = 'unset';
2946
+ this.borderRadius = 'unset';
2947
+ this.marginBottom = 'unset';
2948
+ this.marginTop = 'unset';
2949
+ this.marginLeft = 'unset';
2950
+ this.marginRight = 'unset';
2951
+ this.animation = true;
2952
+ this.rows = 0;
2953
+ this.size = '100%';
2954
+ }
2955
+ handleStructureChange(newValue, oldValue) {
2956
+ if (oldValue !== newValue) {
2957
+ this.handleStructure(newValue);
2958
+ }
2959
+ }
2960
+ handleStylingProps(value) {
2961
+ switch (typeof value) {
2962
+ case 'number':
2963
+ return value === 0 ? 0 : `${value}px`;
2964
+ case 'undefined':
2965
+ return 'unset';
2966
+ case 'string':
2967
+ if (['auto', 'unset', 'none', 'inherit', 'initial'].includes(value) ||
2968
+ value.endsWith('px') ||
2969
+ value.endsWith('%')) {
2970
+ return value;
2971
+ }
2972
+ else {
2973
+ return 'unset';
2974
+ }
2975
+ default:
2976
+ return 'unset';
2977
+ }
2978
+ }
2979
+ handleStructure(structure) {
2980
+ switch (structure) {
2981
+ case 'logo':
2982
+ return this.renderLogo();
2983
+ case 'image':
2984
+ return this.renderImage();
2985
+ case 'title':
2986
+ return this.renderTitle();
2987
+ case 'text':
2988
+ return this.renderText();
2989
+ case 'rectangle':
2990
+ return this.renderRectangle();
2991
+ case 'circle':
2992
+ return this.renderCircle();
2993
+ default:
2994
+ return null;
2995
+ }
2996
+ }
2997
+ renderLogo() {
2998
+ return (h("div", { class: "SkeletonContainer" }, h("div", { class: 'Logo ' + (this.animation ? 'Skeleton' : '') })));
2999
+ }
3000
+ renderImage() {
3001
+ return h("div", { class: 'Image ' + (this.animation ? 'Skeleton' : '') });
3002
+ }
3003
+ renderTitle() {
3004
+ return (h("div", { class: "SkeletonContainer" }, h("div", { class: 'Title ' + (this.animation ? 'Skeleton' : '') })));
3005
+ }
3006
+ renderText() {
3007
+ return (h("div", { class: "SkeletonContainer" }, Array.from({ length: this.rows > 0 ? this.rows : 1 }).map((_, index) => (h("div", { key: index, class: 'Text ' + (this.animation ? 'Skeleton' : '') })))));
3008
+ }
3009
+ renderRectangle() {
3010
+ return (h("div", { class: "SkeletonContainer" }, h("div", { class: 'Rectangle ' + (this.animation ? 'Skeleton' : '') })));
3011
+ }
3012
+ renderCircle() {
3013
+ return (h("div", { class: "SkeletonContainer" }, h("div", { class: 'Circle ' + (this.animation ? 'Skeleton' : '') })));
3014
+ }
3015
+ render() {
3016
+ let styleBlock = '';
3017
+ switch (this.structure) {
3018
+ case 'logo':
3019
+ styleBlock = `
3020
+ :host {
3021
+ --emw-skeleton-logo-width: ${this.stylingValue.width};
3022
+ --emw-skeleton-logo-height: ${this.stylingValue.height};
3023
+ --emw-skeleton-logo-border-radius: ${this.stylingValue.borderRadius};
3024
+ --emw-skeleton-logo-margin-bottom: ${this.stylingValue.marginBottom};
3025
+ --emw-skeleton-logo-margin-top: ${this.stylingValue.marginTop};
3026
+ --emw-skeleton-logo-margin-left: ${this.stylingValue.marginLeft};
3027
+ --emw-skeleton-logo-margin-right: ${this.stylingValue.marginRight};
3028
+ }
3029
+ `;
3030
+ break;
3031
+ case 'image':
3032
+ styleBlock = `
3033
+ :host {
3034
+ --emw-skeleton-image-width: ${this.stylingValue.width};
3035
+ --emw-skeleton-image-height: ${this.stylingValue.height};
3036
+ --emw-skeleton-image-border-radius: ${this.stylingValue.borderRadius};
3037
+ --emw-skeleton-image-margin-bottom: ${this.stylingValue.marginBottom};
3038
+ --emw-skeleton-image-margin-top: ${this.stylingValue.marginTop};
3039
+ --emw-skeleton-image-margin-left: ${this.stylingValue.marginLeft};
3040
+ --emw-skeleton-image-margin-right: ${this.stylingValue.marginRight};
3041
+ }
3042
+ `;
3043
+ break;
3044
+ case 'title':
3045
+ styleBlock = `
3046
+ :host {
3047
+ --emw-skeleton-title-width: ${this.stylingValue.width};
3048
+ --emw-skeleton-title-height: ${this.stylingValue.height};
3049
+ --emw-skeleton-title-border-radius: ${this.stylingValue.borderRadius};
3050
+ --emw-skeleton-title-margin-bottom: ${this.stylingValue.marginBottom};
3051
+ --emw-skeleton-title-margin-top: ${this.stylingValue.marginTop};
3052
+ --emw-skeleton-title-margin-left: ${this.stylingValue.marginLeft};
3053
+ --emw-skeleton-title-margin-right: ${this.stylingValue.marginRight};
3054
+ }
3055
+ `;
3056
+ break;
3057
+ case 'text':
3058
+ styleBlock = `
3059
+ :host {
3060
+ --emw-skeleton-text-width: ${this.stylingValue.width};
3061
+ --emw-skeleton-text-height: ${this.stylingValue.height};
3062
+ --emw-skeleton-text-border-radius: ${this.stylingValue.borderRadius};
3063
+ --emw-skeleton-text-margin-bottom: ${this.stylingValue.marginBottom};
3064
+ --emw-skeleton-text-margin-top: ${this.stylingValue.marginTop};
3065
+ --emw-skeleton-text-margin-left: ${this.stylingValue.marginLeft};
3066
+ --emw-skeleton-text-margin-right: ${this.stylingValue.marginRight};
3067
+ }
3068
+ `;
3069
+ break;
3070
+ case 'rectangle':
3071
+ styleBlock = `
3072
+ :host {
3073
+ --emw-skeleton-rectangle-width: ${this.stylingValue.width};
3074
+ --emw-skeleton-rectangle-height: ${this.stylingValue.height};
3075
+ --emw-skeleton-rectangle-border-radius: ${this.stylingValue.borderRadius};
3076
+ --emw-skeleton-rectangle-margin-bottom: ${this.stylingValue.marginBottom};
3077
+ --emw-skeleton-rectangle-margin-top: ${this.stylingValue.marginTop};
3078
+ --emw-skeleton-rectangle-margin-left: ${this.stylingValue.marginLeft};
3079
+ --emw-skeleton-rectangle-margin-right: ${this.stylingValue.marginRight};
3080
+ }
3081
+ `;
3082
+ break;
3083
+ case 'circle':
3084
+ styleBlock = `
3085
+ :host {
3086
+ --emw-skeleton-circle-size: ${this.stylingValue.size};
3087
+ }
3088
+ `;
3089
+ break;
3090
+ default:
3091
+ styleBlock = '';
3092
+ }
3093
+ return (h(Host, { key: 'e6b885bfd985ce7663d990756fe9101e25eb97f0' }, h("style", { key: '06ae24c7bb74f4dacfc12ae58085333f9dc89da5' }, styleBlock), this.handleStructure(this.structure)));
3094
+ }
3095
+ static get watchers() { return {
3096
+ "structure": ["handleStructureChange"]
3097
+ }; }
3098
+ };
3099
+ UiSkeleton.style = UiSkeletonStyle0;
3100
+
3101
+ export { CasinoChallengeCard as casino_challenge_card, CasinoChallengeList as casino_challenges_list, CasinoChallengesPlayerHistory as casino_challenges_player_history, UiSkeleton as ui_skeleton };