@arc-ui/community-components 12.0.0-beta.5 → 12.0.0-beta7

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 (69) hide show
  1. package/dist/Accordion/Accordion.cjs.js +48 -0
  2. package/dist/Accordion/Accordion.esm.js +40 -0
  3. package/dist/Accordion/package.json +7 -0
  4. package/dist/Accordion/styles.css +1 -0
  5. package/dist/Author/Author.cjs.js +16 -0
  6. package/dist/Author/Author.esm.js +8 -0
  7. package/dist/Author/package.json +7 -0
  8. package/dist/Author/styles.css +1 -0
  9. package/dist/CopyLead/CopyLead.cjs.js +39 -46
  10. package/dist/CopyLead/CopyLead.esm.js +26 -33
  11. package/dist/CopyLead/styles.css +1 -0
  12. package/dist/FeaturePost/FeaturePost.cjs.js +2220 -26
  13. package/dist/FeaturePost/FeaturePost.esm.js +2213 -19
  14. package/dist/FeaturePost/styles.css +1 -0
  15. package/dist/Highlights/Highlights.cjs.js +64 -0
  16. package/dist/Highlights/Highlights.esm.js +56 -0
  17. package/dist/Highlights/package.json +7 -0
  18. package/dist/Highlights/styles.css +1 -0
  19. package/dist/PromoListing/PromoListing.cjs.js +66 -0
  20. package/dist/PromoListing/PromoListing.esm.js +58 -0
  21. package/dist/PromoListing/package.json +7 -0
  22. package/dist/PromoListing/styles.css +1 -0
  23. package/dist/Quote/Quote.cjs.js +33 -0
  24. package/dist/Quote/Quote.esm.js +25 -0
  25. package/dist/Quote/package.json +7 -0
  26. package/dist/Quote/styles.css +1 -0
  27. package/dist/_shared/cjs/Author-cd166353.js +30 -0
  28. package/dist/_shared/cjs/index-9947ac13.js +64 -0
  29. package/dist/_shared/cjs/index.es-875b2756.js +13 -0
  30. package/dist/_shared/cjs/index.es-a9e01247.js +129 -0
  31. package/dist/_shared/cjs/tslib.es6-ec509cfc.js +46 -0
  32. package/dist/_shared/esm/Author-9c7cb4f2.js +24 -0
  33. package/dist/_shared/esm/index-2e73c2e9.js +62 -0
  34. package/dist/_shared/esm/index.es-33860780.js +127 -0
  35. package/dist/_shared/esm/index.es-a1591fd3.js +9 -0
  36. package/dist/_shared/esm/tslib.es6-2bdcff75.js +44 -0
  37. package/dist/index.es.js +2528 -63
  38. package/dist/index.es.js.map +1 -1
  39. package/dist/index.js +2532 -62
  40. package/dist/index.js.map +1 -1
  41. package/dist/styles.css +1 -1
  42. package/dist/types/components/Accordion/Accordion.d.ts +10 -0
  43. package/dist/types/components/Accordion/components/AccordionDisclosureList/AccordionDisclosureList.d.ts +9 -0
  44. package/dist/types/components/Accordion/components/AccordionHeader/AccordionHeader.d.ts +20 -0
  45. package/dist/types/components/Accordion/index.d.ts +1 -0
  46. package/dist/types/components/Author/Author.d.ts +17 -0
  47. package/dist/types/components/Author/index.d.ts +1 -0
  48. package/dist/types/components/CopyLead/CopyLead.d.ts +8 -3
  49. package/dist/types/components/CopyLead/components/MediaContent/MediaContent.d.ts +2 -0
  50. package/dist/types/components/CopyLead/templates/Content/Content.d.ts +3 -1
  51. package/dist/types/components/CopyLead/templates/Media/Media.d.ts +4 -2
  52. package/dist/types/components/FeaturePost/FeaturePost.d.ts +27 -1
  53. package/dist/types/components/FeaturePost/types/feature-post-cta-footer.d.ts +2 -6
  54. package/dist/types/components/Highlights/Highlights.d.ts +30 -0
  55. package/dist/types/components/Highlights/components/HighlightHeader/HighlightHeader.d.ts +21 -0
  56. package/dist/types/components/Highlights/components/HighlightItem/HighlightItem.d.ts +14 -0
  57. package/dist/types/components/Highlights/components/HighlightList/HighlightList.d.ts +9 -0
  58. package/dist/types/components/Highlights/index.d.ts +1 -0
  59. package/dist/types/components/Highlights/types/highlight-list-item.d.ts +10 -0
  60. package/dist/types/components/Highlights/types/index.d.ts +1 -0
  61. package/dist/types/components/PromoListing/PromoListing.d.ts +38 -0
  62. package/dist/types/components/PromoListing/components/PromoListingHeader/PromoListingHeader.d.ts +17 -0
  63. package/dist/types/components/PromoListing/index.d.ts +1 -0
  64. package/dist/types/components/Quote/Quote.d.ts +11 -0
  65. package/dist/types/components/Quote/index.d.ts +1 -0
  66. package/dist/types/components/index.d.ts +5 -0
  67. package/package.json +20 -16
  68. package/dist/_shared/cjs/index-0524fde2.js +0 -119
  69. package/dist/_shared/esm/index-8c73b64b.js +0 -113
package/dist/index.js CHANGED
@@ -3,17 +3,24 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
- var Columns = require('@arc-ui/components/dist/Columns');
7
- var useMediaQuery = require('@arc-ui/components/dist/use-media-query');
8
6
  var Heading = require('@arc-ui/components/dist/Heading');
9
- var Text = require('@arc-ui/components/dist/Text');
10
7
  var VerticalSpace = require('@arc-ui/components/dist/VerticalSpace');
8
+ var Disclosure = require('@arc-ui/components/dist/Disclosure');
9
+ var Grid = require('@arc-ui/components/dist/Grid');
10
+ var Avatar = require('@arc-ui/components/dist/Avatar');
11
+ var Text = require('@arc-ui/components/dist/Text');
12
+ var Columns = require('@arc-ui/components/dist/Columns');
13
+ var useMediaQuery = require('@arc-ui/components/dist/use-media-query');
11
14
  var Image$2 = require('@arc-ui/components/dist/Image');
12
15
  var Icon = require('@arc-ui/components/dist/Icon');
13
16
  var ButtonV2 = require('@arc-ui/components/dist/ButtonV2');
14
17
  var AppButton = require('@arc-ui/components/dist/AppButton');
15
- var Grid = require('@arc-ui/components/dist/Grid');
16
- var Avatar = require('@arc-ui/components/dist/Avatar');
18
+ var Link = require('@arc-ui/components/dist/Link');
19
+ var Carousel = require('@arc-ui/components/dist/Carousel');
20
+ var MediaCard = require('@arc-ui/components/dist/MediaCard');
21
+ var ImpactCard = require('@arc-ui/components/dist/ImpactCard');
22
+ var InformationCard = require('@arc-ui/components/dist/InformationCard');
23
+ var TypographyCard = require('@arc-ui/components/dist/TypographyCard');
17
24
 
18
25
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
19
26
 
@@ -80,36 +87,205 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
80
87
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
81
88
  };
82
89
 
90
+ var dataAttrRe = /^(data-.*)$/;
91
+ var filterDataAttrs = function (props) {
92
+ var filteredProps = {};
93
+ for (var prop in props) {
94
+ if (Object.prototype.hasOwnProperty.call(props, prop) &&
95
+ dataAttrRe.test(prop)) {
96
+ filteredProps[prop] = props[prop];
97
+ }
98
+ }
99
+ return filteredProps;
100
+ };
101
+
102
+ var camelcase = {exports: {}};
103
+
104
+ const UPPERCASE = /[\p{Lu}]/u;
105
+ const LOWERCASE = /[\p{Ll}]/u;
106
+ const LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu;
107
+ const IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u;
108
+ const SEPARATORS = /[_.\- ]+/;
109
+
110
+ const LEADING_SEPARATORS = new RegExp('^' + SEPARATORS.source);
111
+ const SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, 'gu');
112
+ const NUMBERS_AND_IDENTIFIER = new RegExp('\\d+' + IDENTIFIER.source, 'gu');
113
+
114
+ const preserveCamelCase = (string, toLowerCase, toUpperCase) => {
115
+ let isLastCharLower = false;
116
+ let isLastCharUpper = false;
117
+ let isLastLastCharUpper = false;
118
+
119
+ for (let i = 0; i < string.length; i++) {
120
+ const character = string[i];
121
+
122
+ if (isLastCharLower && UPPERCASE.test(character)) {
123
+ string = string.slice(0, i) + '-' + string.slice(i);
124
+ isLastCharLower = false;
125
+ isLastLastCharUpper = isLastCharUpper;
126
+ isLastCharUpper = true;
127
+ i++;
128
+ } else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character)) {
129
+ string = string.slice(0, i - 1) + '-' + string.slice(i - 1);
130
+ isLastLastCharUpper = isLastCharUpper;
131
+ isLastCharUpper = false;
132
+ isLastCharLower = true;
133
+ } else {
134
+ isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character;
135
+ isLastLastCharUpper = isLastCharUpper;
136
+ isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character;
137
+ }
138
+ }
139
+
140
+ return string;
141
+ };
142
+
143
+ const preserveConsecutiveUppercase = (input, toLowerCase) => {
144
+ LEADING_CAPITAL.lastIndex = 0;
145
+
146
+ return input.replace(LEADING_CAPITAL, m1 => toLowerCase(m1));
147
+ };
148
+
149
+ const postProcess = (input, toUpperCase) => {
150
+ SEPARATORS_AND_IDENTIFIER.lastIndex = 0;
151
+ NUMBERS_AND_IDENTIFIER.lastIndex = 0;
152
+
153
+ return input.replace(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier))
154
+ .replace(NUMBERS_AND_IDENTIFIER, m => toUpperCase(m));
155
+ };
156
+
157
+ const camelCase = (input, options) => {
158
+ if (!(typeof input === 'string' || Array.isArray(input))) {
159
+ throw new TypeError('Expected the input to be `string | string[]`');
160
+ }
161
+
162
+ options = {
163
+ pascalCase: false,
164
+ preserveConsecutiveUppercase: false,
165
+ ...options
166
+ };
167
+
168
+ if (Array.isArray(input)) {
169
+ input = input.map(x => x.trim())
170
+ .filter(x => x.length)
171
+ .join('-');
172
+ } else {
173
+ input = input.trim();
174
+ }
175
+
176
+ if (input.length === 0) {
177
+ return '';
178
+ }
179
+
180
+ const toLowerCase = options.locale === false ?
181
+ string => string.toLowerCase() :
182
+ string => string.toLocaleLowerCase(options.locale);
183
+ const toUpperCase = options.locale === false ?
184
+ string => string.toUpperCase() :
185
+ string => string.toLocaleUpperCase(options.locale);
186
+
187
+ if (input.length === 1) {
188
+ return options.pascalCase ? toUpperCase(input) : toLowerCase(input);
189
+ }
190
+
191
+ const hasUpperCase = input !== toLowerCase(input);
192
+
193
+ if (hasUpperCase) {
194
+ input = preserveCamelCase(input, toLowerCase, toUpperCase);
195
+ }
196
+
197
+ input = input.replace(LEADING_SEPARATORS, '');
198
+
199
+ if (options.preserveConsecutiveUppercase) {
200
+ input = preserveConsecutiveUppercase(input, toLowerCase);
201
+ } else {
202
+ input = toLowerCase(input);
203
+ }
204
+
205
+ if (options.pascalCase) {
206
+ input = toUpperCase(input.charAt(0)) + input.slice(1);
207
+ }
208
+
209
+ return postProcess(input, toUpperCase);
210
+ };
211
+
212
+ camelcase.exports = camelCase;
213
+ // TODO: Remove this for the next major release
214
+ camelcase.exports.default = camelCase;
215
+
216
+ var styles$6 = {"header":"Accordion-module_header__WaTdJ","headerContent":"Accordion-module_headerContent__pjddt"};
217
+
218
+ /**
219
+ * Use `Accordion` to give supporting information about a page or proposition. It can be used to call out key benefits in bullet points, or link to a supporting explanatory video. An optional CTA can be used to link to further information or trigger a sales or enquiry journey.
220
+ */
221
+ var AccordionHeader = function (_a) {
222
+ var heading = _a.heading, _b = _a.headingLevel, headingLevel = _b === void 0 ? "2" : _b, content = _a.content;
223
+ return (React__default["default"].createElement("div", { "data-testid": "Accordion-header", className: styles$6.header },
224
+ React__default["default"].createElement(Heading.Heading, { level: headingLevel, size: "xl" }, heading),
225
+ content && (React__default["default"].createElement(React__default["default"].Fragment, null,
226
+ React__default["default"].createElement(VerticalSpace.VerticalSpace, { size: "24" }),
227
+ React__default["default"].createElement("p", { className: styles$6.headerContent }, content)))));
228
+ };
229
+
230
+ var AccordionDisclosureList = function (_a) {
231
+ var disclosureList = _a.disclosureList;
232
+ return (React__default["default"].createElement(React__default["default"].Fragment, null, disclosureList.map(function (_a, index) {
233
+ var children = _a.children, summary = _a.summary, _b = _a.isOpen, isOpen = _b === void 0 ? false : _b, _c = _a.indentDetails, indentDetails = _c === void 0 ? false : _c, headingLevel = _a.headingLevel;
234
+ return (React__default["default"].createElement(Disclosure.Disclosure, { key: index, summary: summary, isOpen: isOpen, indentDetails: indentDetails, headingLevel: headingLevel }, children));
235
+ })));
236
+ };
237
+
238
+ /**
239
+ * Use the `Accordion` component to package together a title, content and a number of disclosure components into one section (maximum 10).
240
+ */
241
+ var Accordion = function (_a) {
242
+ var heading = _a.heading, _b = _a.headingLevel, headingLevel = _b === void 0 ? "2" : _b, content = _a.content, disclosureList = _a.disclosureList, props = __rest(_a, ["heading", "headingLevel", "content", "disclosureList"]);
243
+ return (React__default["default"].createElement("div", __assign({}, filterDataAttrs(props)),
244
+ React__default["default"].createElement(AccordionHeader, { heading: heading, headingLevel: headingLevel, content: content }),
245
+ React__default["default"].createElement(AccordionDisclosureList, { disclosureList: disclosureList })));
246
+ };
247
+
248
+ var styles$5 = {"authorContent":"Author-module_authorContent__TBY7b"};
249
+
250
+ var Author = function (_a) {
251
+ var name = _a.name, title = _a.title, avatar = _a.avatar, props = __rest(_a, ["name", "title", "avatar"]);
252
+ return (React__default["default"].createElement("div", __assign({}, filterDataAttrs(props)),
253
+ React__default["default"].createElement(Grid.Grid, { isFluid: true, isGutterless: true },
254
+ React__default["default"].createElement(Grid.Grid.Row, { align: "center" },
255
+ React__default["default"].createElement(Grid.Grid.Col, { xs: "auto" },
256
+ React__default["default"].createElement(Avatar.Avatar, __assign({ size: "m" }, avatar, { "data-testid": "authorAvatar" }))),
257
+ React__default["default"].createElement(Grid.Grid.Col, null,
258
+ React__default["default"].createElement("div", { className: styles$5.authorContent, "data-testid": "authorContent" },
259
+ React__default["default"].createElement(Heading.Heading, { size: "xs" }, name),
260
+ React__default["default"].createElement(Text.Text, { size: "s" }, title)))))));
261
+ };
262
+
83
263
  /**
84
264
  * Do not edit directly
85
- * Generated on Thu, 29 Aug 2024 08:40:27 GMT
265
+ * Generated on Fri, 25 Oct 2024 08:31:41 GMT
86
266
  */
87
267
  var SemSizeBreakpointsM = "768px"; // Medium (MD) - 768px to 991px: This is commonly used for larger tablets and smaller desktop screens.
88
268
  var SemSizeBreakpointsL = "1024px"; // Large (LG) - 1024px - 1279px: This breakpoint is often applied to larger desktop screens and some laptops.
89
269
  var SemSizeBreakpointsXl = "1280px"; // Extra Large (XL) - 1280px and above: This breakpoint is used for very large desktop screens.
90
270
 
91
- var styles$7 = {"container":"MediaContent-module_container__zJvhV","content":"MediaContent-module_content__3VTWr"};
271
+ var styles$4 = {"buttonContainer":"CopyLead-module_buttonContainer__3OaRG","col":"CopyLead-module_col__0Da5H","container":"CopyLead-module_container__I91ym","container--content":"CopyLead-module_container--content__e8LxG","container--media":"CopyLead-module_container--media__QcMWi","container--align-center":"CopyLead-module_container--align-center__Fh1Sd","container--align-top":"CopyLead-module_container--align-top__UIXOZ","list":"CopyLead-module_list__arnJd","listItem":"CopyLead-module_listItem__NscHE","listItemCentered":"CopyLead-module_listItemCentered__Kwdab","listItemIconContainer":"CopyLead-module_listItemIconContainer__dgnhJ","listItemTextContainer":"CopyLead-module_listItemTextContainer__Dl9lw","imgWrapper":"CopyLead-module_imgWrapper__HYP3w","mediaContainer":"CopyLead-module_mediaContainer__PxTnm","content":"CopyLead-module_content__Bja1D","container--reverse":"CopyLead-module_container--reverse__Gq9u8"};
92
272
 
93
273
  var MediaContent = function (_a) {
94
- var heading = _a.heading, children = _a.children;
95
- return (React__default["default"].createElement("div", { className: styles$7.container },
96
- React__default["default"].createElement(Heading.Heading, { level: "2", size: "xl" }, heading),
97
- children && (React__default["default"].createElement("div", { className: styles$7.content },
274
+ var heading = _a.heading, headingLevel = _a.headingLevel, children = _a.children;
275
+ return (React__default["default"].createElement("div", { className: styles$4.mediaContainer },
276
+ React__default["default"].createElement(Heading.Heading, { level: headingLevel, size: "xl" }, heading),
277
+ children && (React__default["default"].createElement("div", { className: styles$4.content },
98
278
  React__default["default"].createElement(VerticalSpace.VerticalSpace, { size: "24" }),
99
279
  React__default["default"].createElement(Text.Text, { size: "l" }, children)))));
100
280
  };
101
281
 
102
- var styles$6 = {"imgWrapper":"Image-module_imgWrapper__8IEXh"};
103
-
104
282
  var Image$1 = function (_a) {
105
283
  var sources = _a.sources, props = __rest(_a, ["sources"]);
106
- return (React__default["default"].createElement("div", { className: styles$6.imgWrapper },
284
+ return (React__default["default"].createElement("div", { className: styles$4.imgWrapper },
107
285
  React__default["default"].createElement(Image$2.Image, __assign({ fadeOnLoad: true }, props), sources &&
108
286
  sources.map(function (source) { return (React__default["default"].createElement(Image$2.Image.Source, __assign({ key: source.srcSet }, source))); }))));
109
287
  };
110
288
 
111
- var styles$5 = {"list":"IconList-module_list__J9ei6","listItem":"IconList-module_listItem__gNx5-","listItemCentered":"IconList-module_listItemCentered__0HGoP","listItemIconContainer":"IconList-module_listItemIconContainer__4SYoW","listItemTextContainer":"IconList-module_listItemTextContainer__PfFZS"};
112
-
113
289
  var classnames = {exports: {}};
114
290
 
115
291
  /*!
@@ -173,15 +349,15 @@ var classNames = classnames.exports;
173
349
 
174
350
  var IconList = function (_a) {
175
351
  var listItems = _a.listItems, isLgScreen = _a.isLgScreen;
176
- return (React__default["default"].createElement("ul", { className: styles$5.list }, listItems.map(function (_a) {
352
+ return (React__default["default"].createElement("ul", { className: styles$4.list }, listItems.map(function (_a) {
177
353
  var _b;
178
354
  var icon = _a.icon, heading = _a.heading, text = _a.text;
179
- return (React__default["default"].createElement("li", { key: heading, className: classNames(styles$5.listItem, (_b = {},
180
- _b[styles$5.listItemCentered] = !text,
355
+ return (React__default["default"].createElement("li", { key: heading, className: classNames(styles$4.listItem, (_b = {},
356
+ _b[styles$4.listItemCentered] = !text,
181
357
  _b)) },
182
- React__default["default"].createElement("div", { className: styles$5.listItemIconContainer },
358
+ React__default["default"].createElement("div", { className: styles$4.listItemIconContainer },
183
359
  React__default["default"].createElement(Icon.Icon, { color: "brand", icon: icon, size: isLgScreen ? 64 : 48 })),
184
- React__default["default"].createElement("div", { className: styles$5.listItemTextContainer },
360
+ React__default["default"].createElement("div", { className: styles$4.listItemTextContainer },
185
361
  React__default["default"].createElement(Heading.Heading, { level: "3", size: "s" }, heading),
186
362
  text && (React__default["default"].createElement(React__default["default"].Fragment, null,
187
363
  React__default["default"].createElement(VerticalSpace.VerticalSpace, { size: "8", sizeL: "16" }),
@@ -189,26 +365,20 @@ var IconList = function (_a) {
189
365
  })));
190
366
  };
191
367
 
192
- var styles$4 = {"buttonContainer":"Button-module_buttonContainer__o8TSz"};
193
-
194
368
  var Button = function (props) { return (React__default["default"].createElement("div", { className: styles$4.buttonContainer },
195
369
  React__default["default"].createElement(ButtonV2.ButtonV2, __assign({ isFullWidth: true, buttonStyle: "secondary" }, props)))); };
196
370
 
197
- var styles$3 = {"container":"Container-module_container__JZgGy","container--content":"Container-module_container--content__ScwIb","container--media":"Container-module_container--media__KIzMa","container--reverse":"Container-module_container--reverse__-B82g","container--align-center":"Container-module_container--align-center__qneG2","container--align-top":"Container-module_container--align-top__TE6Ah"};
198
-
199
371
  var Container = function (_a) {
200
372
  var _b;
201
373
  var children = _a.children, isReverseOrder = _a.isReverseOrder, type = _a.type, alignment = _a.alignment;
202
- return (React__default["default"].createElement("div", { "data-testid": "copy-lead-container", className: classNames(styles$3.container, styles$3["container--".concat(type)], styles$3["container--align-".concat(alignment)], (_b = {},
203
- _b[styles$3["container--reverse"]] = isReverseOrder,
374
+ return (React__default["default"].createElement("div", { "data-testid": "copy-lead-container", className: classNames(styles$4.container, styles$4["container--".concat(type)], styles$4["container--align-".concat(alignment)], (_b = {},
375
+ _b[styles$4["container--reverse"]] = isReverseOrder,
204
376
  _b)) }, children));
205
377
  };
206
378
 
207
- var styles$2 = {"col":"Column-module_col__9bKZy"};
208
-
209
379
  var Column = function (_a) {
210
380
  var children = _a.children;
211
- return (React__default["default"].createElement("div", { className: styles$2.col }, children));
381
+ return (React__default["default"].createElement("div", { className: styles$4.col }, children));
212
382
  };
213
383
 
214
384
  var VideoPlayer = React__default["default"].lazy(function () {
@@ -220,7 +390,7 @@ var VideoPlayer = React__default["default"].lazy(function () {
220
390
  });
221
391
  });
222
392
  var MediaTemplate = function (_a) {
223
- var button = _a.button, title = _a.title, listItems = _a.listItems, video = _a.video, image = _a.image, content = _a.content, _b = _a.isReverseOrder, isReverseOrder = _b === void 0 ? false : _b;
393
+ var button = _a.button, heading = _a.heading, headingLevel = _a.headingLevel, listItems = _a.listItems, video = _a.video, image = _a.image, content = _a.content, _b = _a.isReverseOrder, isReverseOrder = _b === void 0 ? false : _b;
224
394
  var _c = React.useState(false), isClient = _c[0], setIsClient = _c[1];
225
395
  var isMinWidthArcBreakpointL = useMediaQuery.useMediaQuery("(min-width: ".concat(SemSizeBreakpointsL, ")"));
226
396
  var isMinWidthArcBreakpointXl = useMediaQuery.useMediaQuery("(min-width: ".concat(SemSizeBreakpointsXl, ")"));
@@ -230,10 +400,10 @@ var MediaTemplate = function (_a) {
230
400
  return (React__default["default"].createElement("div", null,
231
401
  !isMinWidthArcBreakpointXl && (React__default["default"].createElement(Columns.Columns, null,
232
402
  React__default["default"].createElement(Columns.Columns.Col, { span: 12, spanM: 9 },
233
- React__default["default"].createElement(MediaContent, { heading: title }, content)))),
403
+ React__default["default"].createElement(MediaContent, { heading: heading, headingLevel: headingLevel }, content)))),
234
404
  React__default["default"].createElement(Container, { type: "media", isReverseOrder: isReverseOrder, alignment: !isMinWidthArcBreakpointXl ? "top" : "center" },
235
405
  React__default["default"].createElement(Column, null,
236
- isMinWidthArcBreakpointXl && (React__default["default"].createElement(MediaContent, { heading: title }, content)),
406
+ isMinWidthArcBreakpointXl && (React__default["default"].createElement(MediaContent, { heading: heading }, content)),
237
407
  React__default["default"].createElement(IconList, { listItems: listItems, isLgScreen: isMinWidthArcBreakpointL }),
238
408
  button && React__default["default"].createElement(Button, __assign({}, button))),
239
409
  React__default["default"].createElement(Column, null,
@@ -243,12 +413,12 @@ var MediaTemplate = function (_a) {
243
413
  };
244
414
 
245
415
  var ContentTemplate = function (_a) {
246
- var button = _a.button, title = _a.title, listItems = _a.listItems, content = _a.content;
416
+ var button = _a.button, heading = _a.heading, headingLevel = _a.headingLevel, listItems = _a.listItems, content = _a.content;
247
417
  var isMinWidthArcBreakpointM = useMediaQuery.useMediaQuery("(min-width: ".concat(SemSizeBreakpointsM, ")"));
248
418
  var isMinWidthArcBreakpointL = useMediaQuery.useMediaQuery("(min-width: ".concat(SemSizeBreakpointsL, ")"));
249
419
  return (React__default["default"].createElement(Container, { type: "content", alignment: "top" },
250
420
  React__default["default"].createElement(Column, null,
251
- React__default["default"].createElement(Heading.Heading, { level: "2", size: "xl" }, title),
421
+ React__default["default"].createElement(Heading.Heading, { level: headingLevel, size: "xl" }, heading),
252
422
  React__default["default"].createElement(VerticalSpace.VerticalSpace, { size: "24" }),
253
423
  React__default["default"].createElement(Text.Text, { size: "l" }, content),
254
424
  button && isMinWidthArcBreakpointM && React__default["default"].createElement(Button, __assign({}, button))),
@@ -261,45 +431,2242 @@ var ContentTemplate = function (_a) {
261
431
  * Use `CopyLead` to give supporting information about a page or proposition. It can be used to call out key benefits in bullet points, or link to a supporting explanatory video. An optional CTA can be used to link to further information or trigger a sales or enquiry journey.
262
432
  */
263
433
  var CopyLead = function (_a) {
264
- var button = _a.button, title = _a.title, listItems = _a.listItems, video = _a.video, image = _a.image, content = _a.content, _b = _a.isReverseOrder, isReverseOrder = _b === void 0 ? false : _b;
434
+ var button = _a.button, heading = _a.heading, _b = _a.headingLevel, headingLevel = _b === void 0 ? "2" : _b, listItems = _a.listItems, video = _a.video, image = _a.image, content = _a.content, _c = _a.isReverseOrder, isReverseOrder = _c === void 0 ? false : _c, props = __rest(_a, ["button", "heading", "headingLevel", "listItems", "video", "image", "content", "isReverseOrder"]);
265
435
  if (video || image) {
266
- return (React__default["default"].createElement(MediaTemplate, { content: content, video: video, image: image, listItems: listItems, title: title, button: button, isReverseOrder: isReverseOrder }));
436
+ return (React__default["default"].createElement(MediaTemplate, __assign({ content: content, video: video, image: image, listItems: listItems, heading: heading, headingLevel: headingLevel, button: button, isReverseOrder: isReverseOrder }, filterDataAttrs(props))));
267
437
  }
268
438
  if (content) {
269
- return (React__default["default"].createElement(ContentTemplate, { listItems: listItems, title: title, button: button, content: content }));
439
+ return (React__default["default"].createElement(ContentTemplate, { listItems: listItems, heading: heading, headingLevel: headingLevel, button: button, content: content }));
270
440
  }
271
441
  return null;
272
442
  };
273
443
 
274
- var styles$1 = {"imgWrapper":"Image-module_imgWrapper__flS1n"};
444
+ function _typeof(o) {
445
+ "@babel/helpers - typeof";
446
+
447
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
448
+ return typeof o;
449
+ } : function (o) {
450
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
451
+ }, _typeof(o);
452
+ }
453
+
454
+ function toInteger(dirtyNumber) {
455
+ if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
456
+ return NaN;
457
+ }
458
+ var number = Number(dirtyNumber);
459
+ if (isNaN(number)) {
460
+ return number;
461
+ }
462
+ return number < 0 ? Math.ceil(number) : Math.floor(number);
463
+ }
464
+
465
+ function requiredArgs(required, args) {
466
+ if (args.length < required) {
467
+ throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
468
+ }
469
+ }
470
+
471
+ /**
472
+ * @name toDate
473
+ * @category Common Helpers
474
+ * @summary Convert the given argument to an instance of Date.
475
+ *
476
+ * @description
477
+ * Convert the given argument to an instance of Date.
478
+ *
479
+ * If the argument is an instance of Date, the function returns its clone.
480
+ *
481
+ * If the argument is a number, it is treated as a timestamp.
482
+ *
483
+ * If the argument is none of the above, the function returns Invalid Date.
484
+ *
485
+ * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
486
+ *
487
+ * @param {Date|Number} argument - the value to convert
488
+ * @returns {Date} the parsed date in the local time zone
489
+ * @throws {TypeError} 1 argument required
490
+ *
491
+ * @example
492
+ * // Clone the date:
493
+ * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
494
+ * //=> Tue Feb 11 2014 11:30:30
495
+ *
496
+ * @example
497
+ * // Convert the timestamp to date:
498
+ * const result = toDate(1392098430000)
499
+ * //=> Tue Feb 11 2014 11:30:30
500
+ */
501
+ function toDate(argument) {
502
+ requiredArgs(1, arguments);
503
+ var argStr = Object.prototype.toString.call(argument);
504
+
505
+ // Clone the date
506
+ if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
507
+ // Prevent the date to lose the milliseconds when passed to new Date() in IE10
508
+ return new Date(argument.getTime());
509
+ } else if (typeof argument === 'number' || argStr === '[object Number]') {
510
+ return new Date(argument);
511
+ } else {
512
+ if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
513
+ // eslint-disable-next-line no-console
514
+ 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");
515
+ // eslint-disable-next-line no-console
516
+ console.warn(new Error().stack);
517
+ }
518
+ return new Date(NaN);
519
+ }
520
+ }
521
+
522
+ /**
523
+ * @name addMilliseconds
524
+ * @category Millisecond Helpers
525
+ * @summary Add the specified number of milliseconds to the given date.
526
+ *
527
+ * @description
528
+ * Add the specified number of milliseconds to the given date.
529
+ *
530
+ * @param {Date|Number} date - the date to be changed
531
+ * @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`.
532
+ * @returns {Date} the new date with the milliseconds added
533
+ * @throws {TypeError} 2 arguments required
534
+ *
535
+ * @example
536
+ * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
537
+ * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
538
+ * //=> Thu Jul 10 2014 12:45:30.750
539
+ */
540
+ function addMilliseconds(dirtyDate, dirtyAmount) {
541
+ requiredArgs(2, arguments);
542
+ var timestamp = toDate(dirtyDate).getTime();
543
+ var amount = toInteger(dirtyAmount);
544
+ return new Date(timestamp + amount);
545
+ }
546
+
547
+ var defaultOptions = {};
548
+ function getDefaultOptions() {
549
+ return defaultOptions;
550
+ }
551
+
552
+ /**
553
+ * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
554
+ * They usually appear for dates that denote time before the timezones were introduced
555
+ * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
556
+ * and GMT+01:00:00 after that date)
557
+ *
558
+ * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
559
+ * which would lead to incorrect calculations.
560
+ *
561
+ * This function returns the timezone offset in milliseconds that takes seconds in account.
562
+ */
563
+ function getTimezoneOffsetInMilliseconds(date) {
564
+ var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
565
+ utcDate.setUTCFullYear(date.getFullYear());
566
+ return date.getTime() - utcDate.getTime();
567
+ }
568
+
569
+ /**
570
+ * @name isDate
571
+ * @category Common Helpers
572
+ * @summary Is the given value a date?
573
+ *
574
+ * @description
575
+ * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
576
+ *
577
+ * @param {*} value - the value to check
578
+ * @returns {boolean} true if the given value is a date
579
+ * @throws {TypeError} 1 arguments required
580
+ *
581
+ * @example
582
+ * // For a valid date:
583
+ * const result = isDate(new Date())
584
+ * //=> true
585
+ *
586
+ * @example
587
+ * // For an invalid date:
588
+ * const result = isDate(new Date(NaN))
589
+ * //=> true
590
+ *
591
+ * @example
592
+ * // For some value:
593
+ * const result = isDate('2014-02-31')
594
+ * //=> false
595
+ *
596
+ * @example
597
+ * // For an object:
598
+ * const result = isDate({})
599
+ * //=> false
600
+ */
601
+ function isDate(value) {
602
+ requiredArgs(1, arguments);
603
+ return value instanceof Date || _typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]';
604
+ }
605
+
606
+ /**
607
+ * @name isValid
608
+ * @category Common Helpers
609
+ * @summary Is the given date valid?
610
+ *
611
+ * @description
612
+ * Returns false if argument is Invalid Date and true otherwise.
613
+ * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
614
+ * Invalid Date is a Date, whose time value is NaN.
615
+ *
616
+ * Time value of Date: http://es5.github.io/#x15.9.1.1
617
+ *
618
+ * @param {*} date - the date to check
619
+ * @returns {Boolean} the date is valid
620
+ * @throws {TypeError} 1 argument required
621
+ *
622
+ * @example
623
+ * // For the valid date:
624
+ * const result = isValid(new Date(2014, 1, 31))
625
+ * //=> true
626
+ *
627
+ * @example
628
+ * // For the value, convertable into a date:
629
+ * const result = isValid(1393804800000)
630
+ * //=> true
631
+ *
632
+ * @example
633
+ * // For the invalid date:
634
+ * const result = isValid(new Date(''))
635
+ * //=> false
636
+ */
637
+ function isValid(dirtyDate) {
638
+ requiredArgs(1, arguments);
639
+ if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
640
+ return false;
641
+ }
642
+ var date = toDate(dirtyDate);
643
+ return !isNaN(Number(date));
644
+ }
645
+
646
+ /**
647
+ * @name subMilliseconds
648
+ * @category Millisecond Helpers
649
+ * @summary Subtract the specified number of milliseconds from the given date.
650
+ *
651
+ * @description
652
+ * Subtract the specified number of milliseconds from the given date.
653
+ *
654
+ * @param {Date|Number} date - the date to be changed
655
+ * @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`.
656
+ * @returns {Date} the new date with the milliseconds subtracted
657
+ * @throws {TypeError} 2 arguments required
658
+ *
659
+ * @example
660
+ * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
661
+ * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
662
+ * //=> Thu Jul 10 2014 12:45:29.250
663
+ */
664
+ function subMilliseconds(dirtyDate, dirtyAmount) {
665
+ requiredArgs(2, arguments);
666
+ var amount = toInteger(dirtyAmount);
667
+ return addMilliseconds(dirtyDate, -amount);
668
+ }
669
+
670
+ var MILLISECONDS_IN_DAY = 86400000;
671
+ function getUTCDayOfYear(dirtyDate) {
672
+ requiredArgs(1, arguments);
673
+ var date = toDate(dirtyDate);
674
+ var timestamp = date.getTime();
675
+ date.setUTCMonth(0, 1);
676
+ date.setUTCHours(0, 0, 0, 0);
677
+ var startOfYearTimestamp = date.getTime();
678
+ var difference = timestamp - startOfYearTimestamp;
679
+ return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
680
+ }
681
+
682
+ function startOfUTCISOWeek(dirtyDate) {
683
+ requiredArgs(1, arguments);
684
+ var weekStartsOn = 1;
685
+ var date = toDate(dirtyDate);
686
+ var day = date.getUTCDay();
687
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
688
+ date.setUTCDate(date.getUTCDate() - diff);
689
+ date.setUTCHours(0, 0, 0, 0);
690
+ return date;
691
+ }
692
+
693
+ function getUTCISOWeekYear(dirtyDate) {
694
+ requiredArgs(1, arguments);
695
+ var date = toDate(dirtyDate);
696
+ var year = date.getUTCFullYear();
697
+ var fourthOfJanuaryOfNextYear = new Date(0);
698
+ fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
699
+ fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
700
+ var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
701
+ var fourthOfJanuaryOfThisYear = new Date(0);
702
+ fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
703
+ fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
704
+ var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
705
+ if (date.getTime() >= startOfNextYear.getTime()) {
706
+ return year + 1;
707
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
708
+ return year;
709
+ } else {
710
+ return year - 1;
711
+ }
712
+ }
713
+
714
+ function startOfUTCISOWeekYear(dirtyDate) {
715
+ requiredArgs(1, arguments);
716
+ var year = getUTCISOWeekYear(dirtyDate);
717
+ var fourthOfJanuary = new Date(0);
718
+ fourthOfJanuary.setUTCFullYear(year, 0, 4);
719
+ fourthOfJanuary.setUTCHours(0, 0, 0, 0);
720
+ var date = startOfUTCISOWeek(fourthOfJanuary);
721
+ return date;
722
+ }
723
+
724
+ var MILLISECONDS_IN_WEEK$1 = 604800000;
725
+ function getUTCISOWeek(dirtyDate) {
726
+ requiredArgs(1, arguments);
727
+ var date = toDate(dirtyDate);
728
+ var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime();
729
+
730
+ // Round the number of days to the nearest integer
731
+ // because the number of milliseconds in a week is not constant
732
+ // (e.g. it's different in the week of the daylight saving time clock shift)
733
+ return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
734
+ }
735
+
736
+ function startOfUTCWeek(dirtyDate, options) {
737
+ var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
738
+ requiredArgs(1, arguments);
739
+ var defaultOptions = getDefaultOptions();
740
+ 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);
741
+
742
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
743
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
744
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
745
+ }
746
+ var date = toDate(dirtyDate);
747
+ var day = date.getUTCDay();
748
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
749
+ date.setUTCDate(date.getUTCDate() - diff);
750
+ date.setUTCHours(0, 0, 0, 0);
751
+ return date;
752
+ }
753
+
754
+ function getUTCWeekYear(dirtyDate, options) {
755
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
756
+ requiredArgs(1, arguments);
757
+ var date = toDate(dirtyDate);
758
+ var year = date.getUTCFullYear();
759
+ var defaultOptions = getDefaultOptions();
760
+ 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);
761
+
762
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
763
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
764
+ throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
765
+ }
766
+ var firstWeekOfNextYear = new Date(0);
767
+ firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
768
+ firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
769
+ var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, options);
770
+ var firstWeekOfThisYear = new Date(0);
771
+ firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
772
+ firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
773
+ var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);
774
+ if (date.getTime() >= startOfNextYear.getTime()) {
775
+ return year + 1;
776
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
777
+ return year;
778
+ } else {
779
+ return year - 1;
780
+ }
781
+ }
782
+
783
+ function startOfUTCWeekYear(dirtyDate, options) {
784
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
785
+ requiredArgs(1, arguments);
786
+ var defaultOptions = getDefaultOptions();
787
+ 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);
788
+ var year = getUTCWeekYear(dirtyDate, options);
789
+ var firstWeek = new Date(0);
790
+ firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
791
+ firstWeek.setUTCHours(0, 0, 0, 0);
792
+ var date = startOfUTCWeek(firstWeek, options);
793
+ return date;
794
+ }
795
+
796
+ var MILLISECONDS_IN_WEEK = 604800000;
797
+ function getUTCWeek(dirtyDate, options) {
798
+ requiredArgs(1, arguments);
799
+ var date = toDate(dirtyDate);
800
+ var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime();
801
+
802
+ // Round the number of days to the nearest integer
803
+ // because the number of milliseconds in a week is not constant
804
+ // (e.g. it's different in the week of the daylight saving time clock shift)
805
+ return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
806
+ }
807
+
808
+ function addLeadingZeros(number, targetLength) {
809
+ var sign = number < 0 ? '-' : '';
810
+ var output = Math.abs(number).toString();
811
+ while (output.length < targetLength) {
812
+ output = '0' + output;
813
+ }
814
+ return sign + output;
815
+ }
816
+
817
+ /*
818
+ * | | Unit | | Unit |
819
+ * |-----|--------------------------------|-----|--------------------------------|
820
+ * | a | AM, PM | A* | |
821
+ * | d | Day of month | D | |
822
+ * | h | Hour [1-12] | H | Hour [0-23] |
823
+ * | m | Minute | M | Month |
824
+ * | s | Second | S | Fraction of second |
825
+ * | y | Year (abs) | Y | |
826
+ *
827
+ * Letters marked by * are not implemented but reserved by Unicode standard.
828
+ */
829
+ var formatters$2 = {
830
+ // Year
831
+ y: function y(date, token) {
832
+ // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
833
+ // | Year | y | yy | yyy | yyyy | yyyyy |
834
+ // |----------|-------|----|-------|-------|-------|
835
+ // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
836
+ // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
837
+ // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
838
+ // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
839
+ // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
840
+
841
+ var signedYear = date.getUTCFullYear();
842
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
843
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
844
+ return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
845
+ },
846
+ // Month
847
+ M: function M(date, token) {
848
+ var month = date.getUTCMonth();
849
+ return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
850
+ },
851
+ // Day of the month
852
+ d: function d(date, token) {
853
+ return addLeadingZeros(date.getUTCDate(), token.length);
854
+ },
855
+ // AM or PM
856
+ a: function a(date, token) {
857
+ var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
858
+ switch (token) {
859
+ case 'a':
860
+ case 'aa':
861
+ return dayPeriodEnumValue.toUpperCase();
862
+ case 'aaa':
863
+ return dayPeriodEnumValue;
864
+ case 'aaaaa':
865
+ return dayPeriodEnumValue[0];
866
+ case 'aaaa':
867
+ default:
868
+ return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
869
+ }
870
+ },
871
+ // Hour [1-12]
872
+ h: function h(date, token) {
873
+ return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
874
+ },
875
+ // Hour [0-23]
876
+ H: function H(date, token) {
877
+ return addLeadingZeros(date.getUTCHours(), token.length);
878
+ },
879
+ // Minute
880
+ m: function m(date, token) {
881
+ return addLeadingZeros(date.getUTCMinutes(), token.length);
882
+ },
883
+ // Second
884
+ s: function s(date, token) {
885
+ return addLeadingZeros(date.getUTCSeconds(), token.length);
886
+ },
887
+ // Fraction of second
888
+ S: function S(date, token) {
889
+ var numberOfDigits = token.length;
890
+ var milliseconds = date.getUTCMilliseconds();
891
+ var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
892
+ return addLeadingZeros(fractionalSeconds, token.length);
893
+ }
894
+ };
895
+ var formatters$3 = formatters$2;
896
+
897
+ var dayPeriodEnum = {
898
+ am: 'am',
899
+ pm: 'pm',
900
+ midnight: 'midnight',
901
+ noon: 'noon',
902
+ morning: 'morning',
903
+ afternoon: 'afternoon',
904
+ evening: 'evening',
905
+ night: 'night'
906
+ };
907
+ /*
908
+ * | | Unit | | Unit |
909
+ * |-----|--------------------------------|-----|--------------------------------|
910
+ * | a | AM, PM | A* | Milliseconds in day |
911
+ * | b | AM, PM, noon, midnight | B | Flexible day period |
912
+ * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
913
+ * | d | Day of month | D | Day of year |
914
+ * | e | Local day of week | E | Day of week |
915
+ * | f | | F* | Day of week in month |
916
+ * | g* | Modified Julian day | G | Era |
917
+ * | h | Hour [1-12] | H | Hour [0-23] |
918
+ * | i! | ISO day of week | I! | ISO week of year |
919
+ * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
920
+ * | k | Hour [1-24] | K | Hour [0-11] |
921
+ * | l* | (deprecated) | L | Stand-alone month |
922
+ * | m | Minute | M | Month |
923
+ * | n | | N | |
924
+ * | o! | Ordinal number modifier | O | Timezone (GMT) |
925
+ * | p! | Long localized time | P! | Long localized date |
926
+ * | q | Stand-alone quarter | Q | Quarter |
927
+ * | r* | Related Gregorian year | R! | ISO week-numbering year |
928
+ * | s | Second | S | Fraction of second |
929
+ * | t! | Seconds timestamp | T! | Milliseconds timestamp |
930
+ * | u | Extended year | U* | Cyclic year |
931
+ * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
932
+ * | w | Local week of year | W* | Week of month |
933
+ * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
934
+ * | y | Year (abs) | Y | Local week-numbering year |
935
+ * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
936
+ *
937
+ * Letters marked by * are not implemented but reserved by Unicode standard.
938
+ *
939
+ * Letters marked by ! are non-standard, but implemented by date-fns:
940
+ * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
941
+ * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
942
+ * i.e. 7 for Sunday, 1 for Monday, etc.
943
+ * - `I` is ISO week of year, as opposed to `w` which is local week of year.
944
+ * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
945
+ * `R` is supposed to be used in conjunction with `I` and `i`
946
+ * for universal ISO week-numbering date, whereas
947
+ * `Y` is supposed to be used in conjunction with `w` and `e`
948
+ * for week-numbering date specific to the locale.
949
+ * - `P` is long localized date format
950
+ * - `p` is long localized time format
951
+ */
952
+
953
+ var formatters = {
954
+ // Era
955
+ G: function G(date, token, localize) {
956
+ var era = date.getUTCFullYear() > 0 ? 1 : 0;
957
+ switch (token) {
958
+ // AD, BC
959
+ case 'G':
960
+ case 'GG':
961
+ case 'GGG':
962
+ return localize.era(era, {
963
+ width: 'abbreviated'
964
+ });
965
+ // A, B
966
+ case 'GGGGG':
967
+ return localize.era(era, {
968
+ width: 'narrow'
969
+ });
970
+ // Anno Domini, Before Christ
971
+ case 'GGGG':
972
+ default:
973
+ return localize.era(era, {
974
+ width: 'wide'
975
+ });
976
+ }
977
+ },
978
+ // Year
979
+ y: function y(date, token, localize) {
980
+ // Ordinal number
981
+ if (token === 'yo') {
982
+ var signedYear = date.getUTCFullYear();
983
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
984
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
985
+ return localize.ordinalNumber(year, {
986
+ unit: 'year'
987
+ });
988
+ }
989
+ return formatters$3.y(date, token);
990
+ },
991
+ // Local week-numbering year
992
+ Y: function Y(date, token, localize, options) {
993
+ var signedWeekYear = getUTCWeekYear(date, options);
994
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
995
+ var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
996
+
997
+ // Two digit year
998
+ if (token === 'YY') {
999
+ var twoDigitYear = weekYear % 100;
1000
+ return addLeadingZeros(twoDigitYear, 2);
1001
+ }
1002
+
1003
+ // Ordinal number
1004
+ if (token === 'Yo') {
1005
+ return localize.ordinalNumber(weekYear, {
1006
+ unit: 'year'
1007
+ });
1008
+ }
1009
+
1010
+ // Padding
1011
+ return addLeadingZeros(weekYear, token.length);
1012
+ },
1013
+ // ISO week-numbering year
1014
+ R: function R(date, token) {
1015
+ var isoWeekYear = getUTCISOWeekYear(date);
1016
+
1017
+ // Padding
1018
+ return addLeadingZeros(isoWeekYear, token.length);
1019
+ },
1020
+ // Extended year. This is a single number designating the year of this calendar system.
1021
+ // The main difference between `y` and `u` localizers are B.C. years:
1022
+ // | Year | `y` | `u` |
1023
+ // |------|-----|-----|
1024
+ // | AC 1 | 1 | 1 |
1025
+ // | BC 1 | 1 | 0 |
1026
+ // | BC 2 | 2 | -1 |
1027
+ // Also `yy` always returns the last two digits of a year,
1028
+ // while `uu` pads single digit years to 2 characters and returns other years unchanged.
1029
+ u: function u(date, token) {
1030
+ var year = date.getUTCFullYear();
1031
+ return addLeadingZeros(year, token.length);
1032
+ },
1033
+ // Quarter
1034
+ Q: function Q(date, token, localize) {
1035
+ var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
1036
+ switch (token) {
1037
+ // 1, 2, 3, 4
1038
+ case 'Q':
1039
+ return String(quarter);
1040
+ // 01, 02, 03, 04
1041
+ case 'QQ':
1042
+ return addLeadingZeros(quarter, 2);
1043
+ // 1st, 2nd, 3rd, 4th
1044
+ case 'Qo':
1045
+ return localize.ordinalNumber(quarter, {
1046
+ unit: 'quarter'
1047
+ });
1048
+ // Q1, Q2, Q3, Q4
1049
+ case 'QQQ':
1050
+ return localize.quarter(quarter, {
1051
+ width: 'abbreviated',
1052
+ context: 'formatting'
1053
+ });
1054
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
1055
+ case 'QQQQQ':
1056
+ return localize.quarter(quarter, {
1057
+ width: 'narrow',
1058
+ context: 'formatting'
1059
+ });
1060
+ // 1st quarter, 2nd quarter, ...
1061
+ case 'QQQQ':
1062
+ default:
1063
+ return localize.quarter(quarter, {
1064
+ width: 'wide',
1065
+ context: 'formatting'
1066
+ });
1067
+ }
1068
+ },
1069
+ // Stand-alone quarter
1070
+ q: function q(date, token, localize) {
1071
+ var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
1072
+ switch (token) {
1073
+ // 1, 2, 3, 4
1074
+ case 'q':
1075
+ return String(quarter);
1076
+ // 01, 02, 03, 04
1077
+ case 'qq':
1078
+ return addLeadingZeros(quarter, 2);
1079
+ // 1st, 2nd, 3rd, 4th
1080
+ case 'qo':
1081
+ return localize.ordinalNumber(quarter, {
1082
+ unit: 'quarter'
1083
+ });
1084
+ // Q1, Q2, Q3, Q4
1085
+ case 'qqq':
1086
+ return localize.quarter(quarter, {
1087
+ width: 'abbreviated',
1088
+ context: 'standalone'
1089
+ });
1090
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
1091
+ case 'qqqqq':
1092
+ return localize.quarter(quarter, {
1093
+ width: 'narrow',
1094
+ context: 'standalone'
1095
+ });
1096
+ // 1st quarter, 2nd quarter, ...
1097
+ case 'qqqq':
1098
+ default:
1099
+ return localize.quarter(quarter, {
1100
+ width: 'wide',
1101
+ context: 'standalone'
1102
+ });
1103
+ }
1104
+ },
1105
+ // Month
1106
+ M: function M(date, token, localize) {
1107
+ var month = date.getUTCMonth();
1108
+ switch (token) {
1109
+ case 'M':
1110
+ case 'MM':
1111
+ return formatters$3.M(date, token);
1112
+ // 1st, 2nd, ..., 12th
1113
+ case 'Mo':
1114
+ return localize.ordinalNumber(month + 1, {
1115
+ unit: 'month'
1116
+ });
1117
+ // Jan, Feb, ..., Dec
1118
+ case 'MMM':
1119
+ return localize.month(month, {
1120
+ width: 'abbreviated',
1121
+ context: 'formatting'
1122
+ });
1123
+ // J, F, ..., D
1124
+ case 'MMMMM':
1125
+ return localize.month(month, {
1126
+ width: 'narrow',
1127
+ context: 'formatting'
1128
+ });
1129
+ // January, February, ..., December
1130
+ case 'MMMM':
1131
+ default:
1132
+ return localize.month(month, {
1133
+ width: 'wide',
1134
+ context: 'formatting'
1135
+ });
1136
+ }
1137
+ },
1138
+ // Stand-alone month
1139
+ L: function L(date, token, localize) {
1140
+ var month = date.getUTCMonth();
1141
+ switch (token) {
1142
+ // 1, 2, ..., 12
1143
+ case 'L':
1144
+ return String(month + 1);
1145
+ // 01, 02, ..., 12
1146
+ case 'LL':
1147
+ return addLeadingZeros(month + 1, 2);
1148
+ // 1st, 2nd, ..., 12th
1149
+ case 'Lo':
1150
+ return localize.ordinalNumber(month + 1, {
1151
+ unit: 'month'
1152
+ });
1153
+ // Jan, Feb, ..., Dec
1154
+ case 'LLL':
1155
+ return localize.month(month, {
1156
+ width: 'abbreviated',
1157
+ context: 'standalone'
1158
+ });
1159
+ // J, F, ..., D
1160
+ case 'LLLLL':
1161
+ return localize.month(month, {
1162
+ width: 'narrow',
1163
+ context: 'standalone'
1164
+ });
1165
+ // January, February, ..., December
1166
+ case 'LLLL':
1167
+ default:
1168
+ return localize.month(month, {
1169
+ width: 'wide',
1170
+ context: 'standalone'
1171
+ });
1172
+ }
1173
+ },
1174
+ // Local week of year
1175
+ w: function w(date, token, localize, options) {
1176
+ var week = getUTCWeek(date, options);
1177
+ if (token === 'wo') {
1178
+ return localize.ordinalNumber(week, {
1179
+ unit: 'week'
1180
+ });
1181
+ }
1182
+ return addLeadingZeros(week, token.length);
1183
+ },
1184
+ // ISO week of year
1185
+ I: function I(date, token, localize) {
1186
+ var isoWeek = getUTCISOWeek(date);
1187
+ if (token === 'Io') {
1188
+ return localize.ordinalNumber(isoWeek, {
1189
+ unit: 'week'
1190
+ });
1191
+ }
1192
+ return addLeadingZeros(isoWeek, token.length);
1193
+ },
1194
+ // Day of the month
1195
+ d: function d(date, token, localize) {
1196
+ if (token === 'do') {
1197
+ return localize.ordinalNumber(date.getUTCDate(), {
1198
+ unit: 'date'
1199
+ });
1200
+ }
1201
+ return formatters$3.d(date, token);
1202
+ },
1203
+ // Day of year
1204
+ D: function D(date, token, localize) {
1205
+ var dayOfYear = getUTCDayOfYear(date);
1206
+ if (token === 'Do') {
1207
+ return localize.ordinalNumber(dayOfYear, {
1208
+ unit: 'dayOfYear'
1209
+ });
1210
+ }
1211
+ return addLeadingZeros(dayOfYear, token.length);
1212
+ },
1213
+ // Day of week
1214
+ E: function E(date, token, localize) {
1215
+ var dayOfWeek = date.getUTCDay();
1216
+ switch (token) {
1217
+ // Tue
1218
+ case 'E':
1219
+ case 'EE':
1220
+ case 'EEE':
1221
+ return localize.day(dayOfWeek, {
1222
+ width: 'abbreviated',
1223
+ context: 'formatting'
1224
+ });
1225
+ // T
1226
+ case 'EEEEE':
1227
+ return localize.day(dayOfWeek, {
1228
+ width: 'narrow',
1229
+ context: 'formatting'
1230
+ });
1231
+ // Tu
1232
+ case 'EEEEEE':
1233
+ return localize.day(dayOfWeek, {
1234
+ width: 'short',
1235
+ context: 'formatting'
1236
+ });
1237
+ // Tuesday
1238
+ case 'EEEE':
1239
+ default:
1240
+ return localize.day(dayOfWeek, {
1241
+ width: 'wide',
1242
+ context: 'formatting'
1243
+ });
1244
+ }
1245
+ },
1246
+ // Local day of week
1247
+ e: function e(date, token, localize, options) {
1248
+ var dayOfWeek = date.getUTCDay();
1249
+ var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
1250
+ switch (token) {
1251
+ // Numerical value (Nth day of week with current locale or weekStartsOn)
1252
+ case 'e':
1253
+ return String(localDayOfWeek);
1254
+ // Padded numerical value
1255
+ case 'ee':
1256
+ return addLeadingZeros(localDayOfWeek, 2);
1257
+ // 1st, 2nd, ..., 7th
1258
+ case 'eo':
1259
+ return localize.ordinalNumber(localDayOfWeek, {
1260
+ unit: 'day'
1261
+ });
1262
+ case 'eee':
1263
+ return localize.day(dayOfWeek, {
1264
+ width: 'abbreviated',
1265
+ context: 'formatting'
1266
+ });
1267
+ // T
1268
+ case 'eeeee':
1269
+ return localize.day(dayOfWeek, {
1270
+ width: 'narrow',
1271
+ context: 'formatting'
1272
+ });
1273
+ // Tu
1274
+ case 'eeeeee':
1275
+ return localize.day(dayOfWeek, {
1276
+ width: 'short',
1277
+ context: 'formatting'
1278
+ });
1279
+ // Tuesday
1280
+ case 'eeee':
1281
+ default:
1282
+ return localize.day(dayOfWeek, {
1283
+ width: 'wide',
1284
+ context: 'formatting'
1285
+ });
1286
+ }
1287
+ },
1288
+ // Stand-alone local day of week
1289
+ c: function c(date, token, localize, options) {
1290
+ var dayOfWeek = date.getUTCDay();
1291
+ var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
1292
+ switch (token) {
1293
+ // Numerical value (same as in `e`)
1294
+ case 'c':
1295
+ return String(localDayOfWeek);
1296
+ // Padded numerical value
1297
+ case 'cc':
1298
+ return addLeadingZeros(localDayOfWeek, token.length);
1299
+ // 1st, 2nd, ..., 7th
1300
+ case 'co':
1301
+ return localize.ordinalNumber(localDayOfWeek, {
1302
+ unit: 'day'
1303
+ });
1304
+ case 'ccc':
1305
+ return localize.day(dayOfWeek, {
1306
+ width: 'abbreviated',
1307
+ context: 'standalone'
1308
+ });
1309
+ // T
1310
+ case 'ccccc':
1311
+ return localize.day(dayOfWeek, {
1312
+ width: 'narrow',
1313
+ context: 'standalone'
1314
+ });
1315
+ // Tu
1316
+ case 'cccccc':
1317
+ return localize.day(dayOfWeek, {
1318
+ width: 'short',
1319
+ context: 'standalone'
1320
+ });
1321
+ // Tuesday
1322
+ case 'cccc':
1323
+ default:
1324
+ return localize.day(dayOfWeek, {
1325
+ width: 'wide',
1326
+ context: 'standalone'
1327
+ });
1328
+ }
1329
+ },
1330
+ // ISO day of week
1331
+ i: function i(date, token, localize) {
1332
+ var dayOfWeek = date.getUTCDay();
1333
+ var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
1334
+ switch (token) {
1335
+ // 2
1336
+ case 'i':
1337
+ return String(isoDayOfWeek);
1338
+ // 02
1339
+ case 'ii':
1340
+ return addLeadingZeros(isoDayOfWeek, token.length);
1341
+ // 2nd
1342
+ case 'io':
1343
+ return localize.ordinalNumber(isoDayOfWeek, {
1344
+ unit: 'day'
1345
+ });
1346
+ // Tue
1347
+ case 'iii':
1348
+ return localize.day(dayOfWeek, {
1349
+ width: 'abbreviated',
1350
+ context: 'formatting'
1351
+ });
1352
+ // T
1353
+ case 'iiiii':
1354
+ return localize.day(dayOfWeek, {
1355
+ width: 'narrow',
1356
+ context: 'formatting'
1357
+ });
1358
+ // Tu
1359
+ case 'iiiiii':
1360
+ return localize.day(dayOfWeek, {
1361
+ width: 'short',
1362
+ context: 'formatting'
1363
+ });
1364
+ // Tuesday
1365
+ case 'iiii':
1366
+ default:
1367
+ return localize.day(dayOfWeek, {
1368
+ width: 'wide',
1369
+ context: 'formatting'
1370
+ });
1371
+ }
1372
+ },
1373
+ // AM or PM
1374
+ a: function a(date, token, localize) {
1375
+ var hours = date.getUTCHours();
1376
+ var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
1377
+ switch (token) {
1378
+ case 'a':
1379
+ case 'aa':
1380
+ return localize.dayPeriod(dayPeriodEnumValue, {
1381
+ width: 'abbreviated',
1382
+ context: 'formatting'
1383
+ });
1384
+ case 'aaa':
1385
+ return localize.dayPeriod(dayPeriodEnumValue, {
1386
+ width: 'abbreviated',
1387
+ context: 'formatting'
1388
+ }).toLowerCase();
1389
+ case 'aaaaa':
1390
+ return localize.dayPeriod(dayPeriodEnumValue, {
1391
+ width: 'narrow',
1392
+ context: 'formatting'
1393
+ });
1394
+ case 'aaaa':
1395
+ default:
1396
+ return localize.dayPeriod(dayPeriodEnumValue, {
1397
+ width: 'wide',
1398
+ context: 'formatting'
1399
+ });
1400
+ }
1401
+ },
1402
+ // AM, PM, midnight, noon
1403
+ b: function b(date, token, localize) {
1404
+ var hours = date.getUTCHours();
1405
+ var dayPeriodEnumValue;
1406
+ if (hours === 12) {
1407
+ dayPeriodEnumValue = dayPeriodEnum.noon;
1408
+ } else if (hours === 0) {
1409
+ dayPeriodEnumValue = dayPeriodEnum.midnight;
1410
+ } else {
1411
+ dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
1412
+ }
1413
+ switch (token) {
1414
+ case 'b':
1415
+ case 'bb':
1416
+ return localize.dayPeriod(dayPeriodEnumValue, {
1417
+ width: 'abbreviated',
1418
+ context: 'formatting'
1419
+ });
1420
+ case 'bbb':
1421
+ return localize.dayPeriod(dayPeriodEnumValue, {
1422
+ width: 'abbreviated',
1423
+ context: 'formatting'
1424
+ }).toLowerCase();
1425
+ case 'bbbbb':
1426
+ return localize.dayPeriod(dayPeriodEnumValue, {
1427
+ width: 'narrow',
1428
+ context: 'formatting'
1429
+ });
1430
+ case 'bbbb':
1431
+ default:
1432
+ return localize.dayPeriod(dayPeriodEnumValue, {
1433
+ width: 'wide',
1434
+ context: 'formatting'
1435
+ });
1436
+ }
1437
+ },
1438
+ // in the morning, in the afternoon, in the evening, at night
1439
+ B: function B(date, token, localize) {
1440
+ var hours = date.getUTCHours();
1441
+ var dayPeriodEnumValue;
1442
+ if (hours >= 17) {
1443
+ dayPeriodEnumValue = dayPeriodEnum.evening;
1444
+ } else if (hours >= 12) {
1445
+ dayPeriodEnumValue = dayPeriodEnum.afternoon;
1446
+ } else if (hours >= 4) {
1447
+ dayPeriodEnumValue = dayPeriodEnum.morning;
1448
+ } else {
1449
+ dayPeriodEnumValue = dayPeriodEnum.night;
1450
+ }
1451
+ switch (token) {
1452
+ case 'B':
1453
+ case 'BB':
1454
+ case 'BBB':
1455
+ return localize.dayPeriod(dayPeriodEnumValue, {
1456
+ width: 'abbreviated',
1457
+ context: 'formatting'
1458
+ });
1459
+ case 'BBBBB':
1460
+ return localize.dayPeriod(dayPeriodEnumValue, {
1461
+ width: 'narrow',
1462
+ context: 'formatting'
1463
+ });
1464
+ case 'BBBB':
1465
+ default:
1466
+ return localize.dayPeriod(dayPeriodEnumValue, {
1467
+ width: 'wide',
1468
+ context: 'formatting'
1469
+ });
1470
+ }
1471
+ },
1472
+ // Hour [1-12]
1473
+ h: function h(date, token, localize) {
1474
+ if (token === 'ho') {
1475
+ var hours = date.getUTCHours() % 12;
1476
+ if (hours === 0) hours = 12;
1477
+ return localize.ordinalNumber(hours, {
1478
+ unit: 'hour'
1479
+ });
1480
+ }
1481
+ return formatters$3.h(date, token);
1482
+ },
1483
+ // Hour [0-23]
1484
+ H: function H(date, token, localize) {
1485
+ if (token === 'Ho') {
1486
+ return localize.ordinalNumber(date.getUTCHours(), {
1487
+ unit: 'hour'
1488
+ });
1489
+ }
1490
+ return formatters$3.H(date, token);
1491
+ },
1492
+ // Hour [0-11]
1493
+ K: function K(date, token, localize) {
1494
+ var hours = date.getUTCHours() % 12;
1495
+ if (token === 'Ko') {
1496
+ return localize.ordinalNumber(hours, {
1497
+ unit: 'hour'
1498
+ });
1499
+ }
1500
+ return addLeadingZeros(hours, token.length);
1501
+ },
1502
+ // Hour [1-24]
1503
+ k: function k(date, token, localize) {
1504
+ var hours = date.getUTCHours();
1505
+ if (hours === 0) hours = 24;
1506
+ if (token === 'ko') {
1507
+ return localize.ordinalNumber(hours, {
1508
+ unit: 'hour'
1509
+ });
1510
+ }
1511
+ return addLeadingZeros(hours, token.length);
1512
+ },
1513
+ // Minute
1514
+ m: function m(date, token, localize) {
1515
+ if (token === 'mo') {
1516
+ return localize.ordinalNumber(date.getUTCMinutes(), {
1517
+ unit: 'minute'
1518
+ });
1519
+ }
1520
+ return formatters$3.m(date, token);
1521
+ },
1522
+ // Second
1523
+ s: function s(date, token, localize) {
1524
+ if (token === 'so') {
1525
+ return localize.ordinalNumber(date.getUTCSeconds(), {
1526
+ unit: 'second'
1527
+ });
1528
+ }
1529
+ return formatters$3.s(date, token);
1530
+ },
1531
+ // Fraction of second
1532
+ S: function S(date, token) {
1533
+ return formatters$3.S(date, token);
1534
+ },
1535
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1536
+ X: function X(date, token, _localize, options) {
1537
+ var originalDate = options._originalDate || date;
1538
+ var timezoneOffset = originalDate.getTimezoneOffset();
1539
+ if (timezoneOffset === 0) {
1540
+ return 'Z';
1541
+ }
1542
+ switch (token) {
1543
+ // Hours and optional minutes
1544
+ case 'X':
1545
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
1546
+
1547
+ // Hours, minutes and optional seconds without `:` delimiter
1548
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1549
+ // so this token always has the same output as `XX`
1550
+ case 'XXXX':
1551
+ case 'XX':
1552
+ // Hours and minutes without `:` delimiter
1553
+ return formatTimezone(timezoneOffset);
1554
+
1555
+ // Hours, minutes and optional seconds with `:` delimiter
1556
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1557
+ // so this token always has the same output as `XXX`
1558
+ case 'XXXXX':
1559
+ case 'XXX': // Hours and minutes with `:` delimiter
1560
+ default:
1561
+ return formatTimezone(timezoneOffset, ':');
1562
+ }
1563
+ },
1564
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1565
+ x: function x(date, token, _localize, options) {
1566
+ var originalDate = options._originalDate || date;
1567
+ var timezoneOffset = originalDate.getTimezoneOffset();
1568
+ switch (token) {
1569
+ // Hours and optional minutes
1570
+ case 'x':
1571
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
1572
+
1573
+ // Hours, minutes and optional seconds without `:` delimiter
1574
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1575
+ // so this token always has the same output as `xx`
1576
+ case 'xxxx':
1577
+ case 'xx':
1578
+ // Hours and minutes without `:` delimiter
1579
+ return formatTimezone(timezoneOffset);
1580
+
1581
+ // Hours, minutes and optional seconds with `:` delimiter
1582
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1583
+ // so this token always has the same output as `xxx`
1584
+ case 'xxxxx':
1585
+ case 'xxx': // Hours and minutes with `:` delimiter
1586
+ default:
1587
+ return formatTimezone(timezoneOffset, ':');
1588
+ }
1589
+ },
1590
+ // Timezone (GMT)
1591
+ O: function O(date, token, _localize, options) {
1592
+ var originalDate = options._originalDate || date;
1593
+ var timezoneOffset = originalDate.getTimezoneOffset();
1594
+ switch (token) {
1595
+ // Short
1596
+ case 'O':
1597
+ case 'OO':
1598
+ case 'OOO':
1599
+ return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
1600
+ // Long
1601
+ case 'OOOO':
1602
+ default:
1603
+ return 'GMT' + formatTimezone(timezoneOffset, ':');
1604
+ }
1605
+ },
1606
+ // Timezone (specific non-location)
1607
+ z: function z(date, token, _localize, options) {
1608
+ var originalDate = options._originalDate || date;
1609
+ var timezoneOffset = originalDate.getTimezoneOffset();
1610
+ switch (token) {
1611
+ // Short
1612
+ case 'z':
1613
+ case 'zz':
1614
+ case 'zzz':
1615
+ return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
1616
+ // Long
1617
+ case 'zzzz':
1618
+ default:
1619
+ return 'GMT' + formatTimezone(timezoneOffset, ':');
1620
+ }
1621
+ },
1622
+ // Seconds timestamp
1623
+ t: function t(date, token, _localize, options) {
1624
+ var originalDate = options._originalDate || date;
1625
+ var timestamp = Math.floor(originalDate.getTime() / 1000);
1626
+ return addLeadingZeros(timestamp, token.length);
1627
+ },
1628
+ // Milliseconds timestamp
1629
+ T: function T(date, token, _localize, options) {
1630
+ var originalDate = options._originalDate || date;
1631
+ var timestamp = originalDate.getTime();
1632
+ return addLeadingZeros(timestamp, token.length);
1633
+ }
1634
+ };
1635
+ function formatTimezoneShort(offset, dirtyDelimiter) {
1636
+ var sign = offset > 0 ? '-' : '+';
1637
+ var absOffset = Math.abs(offset);
1638
+ var hours = Math.floor(absOffset / 60);
1639
+ var minutes = absOffset % 60;
1640
+ if (minutes === 0) {
1641
+ return sign + String(hours);
1642
+ }
1643
+ var delimiter = dirtyDelimiter || '';
1644
+ return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
1645
+ }
1646
+ function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
1647
+ if (offset % 60 === 0) {
1648
+ var sign = offset > 0 ? '-' : '+';
1649
+ return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
1650
+ }
1651
+ return formatTimezone(offset, dirtyDelimiter);
1652
+ }
1653
+ function formatTimezone(offset, dirtyDelimiter) {
1654
+ var delimiter = dirtyDelimiter || '';
1655
+ var sign = offset > 0 ? '-' : '+';
1656
+ var absOffset = Math.abs(offset);
1657
+ var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
1658
+ var minutes = addLeadingZeros(absOffset % 60, 2);
1659
+ return sign + hours + delimiter + minutes;
1660
+ }
1661
+ var formatters$1 = formatters;
1662
+
1663
+ var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
1664
+ switch (pattern) {
1665
+ case 'P':
1666
+ return formatLong.date({
1667
+ width: 'short'
1668
+ });
1669
+ case 'PP':
1670
+ return formatLong.date({
1671
+ width: 'medium'
1672
+ });
1673
+ case 'PPP':
1674
+ return formatLong.date({
1675
+ width: 'long'
1676
+ });
1677
+ case 'PPPP':
1678
+ default:
1679
+ return formatLong.date({
1680
+ width: 'full'
1681
+ });
1682
+ }
1683
+ };
1684
+ var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
1685
+ switch (pattern) {
1686
+ case 'p':
1687
+ return formatLong.time({
1688
+ width: 'short'
1689
+ });
1690
+ case 'pp':
1691
+ return formatLong.time({
1692
+ width: 'medium'
1693
+ });
1694
+ case 'ppp':
1695
+ return formatLong.time({
1696
+ width: 'long'
1697
+ });
1698
+ case 'pppp':
1699
+ default:
1700
+ return formatLong.time({
1701
+ width: 'full'
1702
+ });
1703
+ }
1704
+ };
1705
+ var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong) {
1706
+ var matchResult = pattern.match(/(P+)(p+)?/) || [];
1707
+ var datePattern = matchResult[1];
1708
+ var timePattern = matchResult[2];
1709
+ if (!timePattern) {
1710
+ return dateLongFormatter(pattern, formatLong);
1711
+ }
1712
+ var dateTimeFormat;
1713
+ switch (datePattern) {
1714
+ case 'P':
1715
+ dateTimeFormat = formatLong.dateTime({
1716
+ width: 'short'
1717
+ });
1718
+ break;
1719
+ case 'PP':
1720
+ dateTimeFormat = formatLong.dateTime({
1721
+ width: 'medium'
1722
+ });
1723
+ break;
1724
+ case 'PPP':
1725
+ dateTimeFormat = formatLong.dateTime({
1726
+ width: 'long'
1727
+ });
1728
+ break;
1729
+ case 'PPPP':
1730
+ default:
1731
+ dateTimeFormat = formatLong.dateTime({
1732
+ width: 'full'
1733
+ });
1734
+ break;
1735
+ }
1736
+ return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
1737
+ };
1738
+ var longFormatters = {
1739
+ p: timeLongFormatter,
1740
+ P: dateTimeLongFormatter
1741
+ };
1742
+ var longFormatters$1 = longFormatters;
1743
+
1744
+ var protectedDayOfYearTokens = ['D', 'DD'];
1745
+ var protectedWeekYearTokens = ['YY', 'YYYY'];
1746
+ function isProtectedDayOfYearToken(token) {
1747
+ return protectedDayOfYearTokens.indexOf(token) !== -1;
1748
+ }
1749
+ function isProtectedWeekYearToken(token) {
1750
+ return protectedWeekYearTokens.indexOf(token) !== -1;
1751
+ }
1752
+ function throwProtectedError(token, format, input) {
1753
+ if (token === 'YYYY') {
1754
+ 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"));
1755
+ } else if (token === 'YY') {
1756
+ 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"));
1757
+ } else if (token === 'D') {
1758
+ 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"));
1759
+ } else if (token === 'DD') {
1760
+ 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"));
1761
+ }
1762
+ }
1763
+
1764
+ var formatDistanceLocale = {
1765
+ lessThanXSeconds: {
1766
+ one: 'less than a second',
1767
+ other: 'less than {{count}} seconds'
1768
+ },
1769
+ xSeconds: {
1770
+ one: '1 second',
1771
+ other: '{{count}} seconds'
1772
+ },
1773
+ halfAMinute: 'half a minute',
1774
+ lessThanXMinutes: {
1775
+ one: 'less than a minute',
1776
+ other: 'less than {{count}} minutes'
1777
+ },
1778
+ xMinutes: {
1779
+ one: '1 minute',
1780
+ other: '{{count}} minutes'
1781
+ },
1782
+ aboutXHours: {
1783
+ one: 'about 1 hour',
1784
+ other: 'about {{count}} hours'
1785
+ },
1786
+ xHours: {
1787
+ one: '1 hour',
1788
+ other: '{{count}} hours'
1789
+ },
1790
+ xDays: {
1791
+ one: '1 day',
1792
+ other: '{{count}} days'
1793
+ },
1794
+ aboutXWeeks: {
1795
+ one: 'about 1 week',
1796
+ other: 'about {{count}} weeks'
1797
+ },
1798
+ xWeeks: {
1799
+ one: '1 week',
1800
+ other: '{{count}} weeks'
1801
+ },
1802
+ aboutXMonths: {
1803
+ one: 'about 1 month',
1804
+ other: 'about {{count}} months'
1805
+ },
1806
+ xMonths: {
1807
+ one: '1 month',
1808
+ other: '{{count}} months'
1809
+ },
1810
+ aboutXYears: {
1811
+ one: 'about 1 year',
1812
+ other: 'about {{count}} years'
1813
+ },
1814
+ xYears: {
1815
+ one: '1 year',
1816
+ other: '{{count}} years'
1817
+ },
1818
+ overXYears: {
1819
+ one: 'over 1 year',
1820
+ other: 'over {{count}} years'
1821
+ },
1822
+ almostXYears: {
1823
+ one: 'almost 1 year',
1824
+ other: 'almost {{count}} years'
1825
+ }
1826
+ };
1827
+ var formatDistance = function formatDistance(token, count, options) {
1828
+ var result;
1829
+ var tokenValue = formatDistanceLocale[token];
1830
+ if (typeof tokenValue === 'string') {
1831
+ result = tokenValue;
1832
+ } else if (count === 1) {
1833
+ result = tokenValue.one;
1834
+ } else {
1835
+ result = tokenValue.other.replace('{{count}}', count.toString());
1836
+ }
1837
+ if (options !== null && options !== void 0 && options.addSuffix) {
1838
+ if (options.comparison && options.comparison > 0) {
1839
+ return 'in ' + result;
1840
+ } else {
1841
+ return result + ' ago';
1842
+ }
1843
+ }
1844
+ return result;
1845
+ };
1846
+ var formatDistance$1 = formatDistance;
1847
+
1848
+ function buildFormatLongFn(args) {
1849
+ return function () {
1850
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1851
+ // TODO: Remove String()
1852
+ var width = options.width ? String(options.width) : args.defaultWidth;
1853
+ var format = args.formats[width] || args.formats[args.defaultWidth];
1854
+ return format;
1855
+ };
1856
+ }
1857
+
1858
+ var dateFormats = {
1859
+ full: 'EEEE, MMMM do, y',
1860
+ long: 'MMMM do, y',
1861
+ medium: 'MMM d, y',
1862
+ short: 'MM/dd/yyyy'
1863
+ };
1864
+ var timeFormats = {
1865
+ full: 'h:mm:ss a zzzz',
1866
+ long: 'h:mm:ss a z',
1867
+ medium: 'h:mm:ss a',
1868
+ short: 'h:mm a'
1869
+ };
1870
+ var dateTimeFormats = {
1871
+ full: "{{date}} 'at' {{time}}",
1872
+ long: "{{date}} 'at' {{time}}",
1873
+ medium: '{{date}}, {{time}}',
1874
+ short: '{{date}}, {{time}}'
1875
+ };
1876
+ var formatLong = {
1877
+ date: buildFormatLongFn({
1878
+ formats: dateFormats,
1879
+ defaultWidth: 'full'
1880
+ }),
1881
+ time: buildFormatLongFn({
1882
+ formats: timeFormats,
1883
+ defaultWidth: 'full'
1884
+ }),
1885
+ dateTime: buildFormatLongFn({
1886
+ formats: dateTimeFormats,
1887
+ defaultWidth: 'full'
1888
+ })
1889
+ };
1890
+ var formatLong$1 = formatLong;
1891
+
1892
+ var formatRelativeLocale = {
1893
+ lastWeek: "'last' eeee 'at' p",
1894
+ yesterday: "'yesterday at' p",
1895
+ today: "'today at' p",
1896
+ tomorrow: "'tomorrow at' p",
1897
+ nextWeek: "eeee 'at' p",
1898
+ other: 'P'
1899
+ };
1900
+ var formatRelative = function formatRelative(token, _date, _baseDate, _options) {
1901
+ return formatRelativeLocale[token];
1902
+ };
1903
+ var formatRelative$1 = formatRelative;
1904
+
1905
+ function buildLocalizeFn(args) {
1906
+ return function (dirtyIndex, options) {
1907
+ var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';
1908
+ var valuesArray;
1909
+ if (context === 'formatting' && args.formattingValues) {
1910
+ var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
1911
+ var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
1912
+ valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
1913
+ } else {
1914
+ var _defaultWidth = args.defaultWidth;
1915
+ var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
1916
+ valuesArray = args.values[_width] || args.values[_defaultWidth];
1917
+ }
1918
+ var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
1919
+ // @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!
1920
+ return valuesArray[index];
1921
+ };
1922
+ }
1923
+
1924
+ var eraValues = {
1925
+ narrow: ['B', 'A'],
1926
+ abbreviated: ['BC', 'AD'],
1927
+ wide: ['Before Christ', 'Anno Domini']
1928
+ };
1929
+ var quarterValues = {
1930
+ narrow: ['1', '2', '3', '4'],
1931
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
1932
+ wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
1933
+ };
1934
+
1935
+ // Note: in English, the names of days of the week and months are capitalized.
1936
+ // If you are making a new locale based on this one, check if the same is true for the language you're working on.
1937
+ // Generally, formatted dates should look like they are in the middle of a sentence,
1938
+ // e.g. in Spanish language the weekdays and months should be in the lowercase.
1939
+ var monthValues = {
1940
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
1941
+ abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
1942
+ wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
1943
+ };
1944
+ var dayValues = {
1945
+ narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
1946
+ short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
1947
+ abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
1948
+ wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
1949
+ };
1950
+ var dayPeriodValues = {
1951
+ narrow: {
1952
+ am: 'a',
1953
+ pm: 'p',
1954
+ midnight: 'mi',
1955
+ noon: 'n',
1956
+ morning: 'morning',
1957
+ afternoon: 'afternoon',
1958
+ evening: 'evening',
1959
+ night: 'night'
1960
+ },
1961
+ abbreviated: {
1962
+ am: 'AM',
1963
+ pm: 'PM',
1964
+ midnight: 'midnight',
1965
+ noon: 'noon',
1966
+ morning: 'morning',
1967
+ afternoon: 'afternoon',
1968
+ evening: 'evening',
1969
+ night: 'night'
1970
+ },
1971
+ wide: {
1972
+ am: 'a.m.',
1973
+ pm: 'p.m.',
1974
+ midnight: 'midnight',
1975
+ noon: 'noon',
1976
+ morning: 'morning',
1977
+ afternoon: 'afternoon',
1978
+ evening: 'evening',
1979
+ night: 'night'
1980
+ }
1981
+ };
1982
+ var formattingDayPeriodValues = {
1983
+ narrow: {
1984
+ am: 'a',
1985
+ pm: 'p',
1986
+ midnight: 'mi',
1987
+ noon: 'n',
1988
+ morning: 'in the morning',
1989
+ afternoon: 'in the afternoon',
1990
+ evening: 'in the evening',
1991
+ night: 'at night'
1992
+ },
1993
+ abbreviated: {
1994
+ am: 'AM',
1995
+ pm: 'PM',
1996
+ midnight: 'midnight',
1997
+ noon: 'noon',
1998
+ morning: 'in the morning',
1999
+ afternoon: 'in the afternoon',
2000
+ evening: 'in the evening',
2001
+ night: 'at night'
2002
+ },
2003
+ wide: {
2004
+ am: 'a.m.',
2005
+ pm: 'p.m.',
2006
+ midnight: 'midnight',
2007
+ noon: 'noon',
2008
+ morning: 'in the morning',
2009
+ afternoon: 'in the afternoon',
2010
+ evening: 'in the evening',
2011
+ night: 'at night'
2012
+ }
2013
+ };
2014
+ var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
2015
+ var number = Number(dirtyNumber);
2016
+
2017
+ // If ordinal numbers depend on context, for example,
2018
+ // if they are different for different grammatical genders,
2019
+ // use `options.unit`.
2020
+ //
2021
+ // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
2022
+ // 'day', 'hour', 'minute', 'second'.
2023
+
2024
+ var rem100 = number % 100;
2025
+ if (rem100 > 20 || rem100 < 10) {
2026
+ switch (rem100 % 10) {
2027
+ case 1:
2028
+ return number + 'st';
2029
+ case 2:
2030
+ return number + 'nd';
2031
+ case 3:
2032
+ return number + 'rd';
2033
+ }
2034
+ }
2035
+ return number + 'th';
2036
+ };
2037
+ var localize = {
2038
+ ordinalNumber: ordinalNumber,
2039
+ era: buildLocalizeFn({
2040
+ values: eraValues,
2041
+ defaultWidth: 'wide'
2042
+ }),
2043
+ quarter: buildLocalizeFn({
2044
+ values: quarterValues,
2045
+ defaultWidth: 'wide',
2046
+ argumentCallback: function argumentCallback(quarter) {
2047
+ return quarter - 1;
2048
+ }
2049
+ }),
2050
+ month: buildLocalizeFn({
2051
+ values: monthValues,
2052
+ defaultWidth: 'wide'
2053
+ }),
2054
+ day: buildLocalizeFn({
2055
+ values: dayValues,
2056
+ defaultWidth: 'wide'
2057
+ }),
2058
+ dayPeriod: buildLocalizeFn({
2059
+ values: dayPeriodValues,
2060
+ defaultWidth: 'wide',
2061
+ formattingValues: formattingDayPeriodValues,
2062
+ defaultFormattingWidth: 'wide'
2063
+ })
2064
+ };
2065
+ var localize$1 = localize;
2066
+
2067
+ function buildMatchFn(args) {
2068
+ return function (string) {
2069
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2070
+ var width = options.width;
2071
+ var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
2072
+ var matchResult = string.match(matchPattern);
2073
+ if (!matchResult) {
2074
+ return null;
2075
+ }
2076
+ var matchedString = matchResult[0];
2077
+ var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
2078
+ var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
2079
+ return pattern.test(matchedString);
2080
+ }) : findKey(parsePatterns, function (pattern) {
2081
+ return pattern.test(matchedString);
2082
+ });
2083
+ var value;
2084
+ value = args.valueCallback ? args.valueCallback(key) : key;
2085
+ value = options.valueCallback ? options.valueCallback(value) : value;
2086
+ var rest = string.slice(matchedString.length);
2087
+ return {
2088
+ value: value,
2089
+ rest: rest
2090
+ };
2091
+ };
2092
+ }
2093
+ function findKey(object, predicate) {
2094
+ for (var key in object) {
2095
+ if (object.hasOwnProperty(key) && predicate(object[key])) {
2096
+ return key;
2097
+ }
2098
+ }
2099
+ return undefined;
2100
+ }
2101
+ function findIndex(array, predicate) {
2102
+ for (var key = 0; key < array.length; key++) {
2103
+ if (predicate(array[key])) {
2104
+ return key;
2105
+ }
2106
+ }
2107
+ return undefined;
2108
+ }
2109
+
2110
+ function buildMatchPatternFn(args) {
2111
+ return function (string) {
2112
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2113
+ var matchResult = string.match(args.matchPattern);
2114
+ if (!matchResult) return null;
2115
+ var matchedString = matchResult[0];
2116
+ var parseResult = string.match(args.parsePattern);
2117
+ if (!parseResult) return null;
2118
+ var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
2119
+ value = options.valueCallback ? options.valueCallback(value) : value;
2120
+ var rest = string.slice(matchedString.length);
2121
+ return {
2122
+ value: value,
2123
+ rest: rest
2124
+ };
2125
+ };
2126
+ }
2127
+
2128
+ var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
2129
+ var parseOrdinalNumberPattern = /\d+/i;
2130
+ var matchEraPatterns = {
2131
+ narrow: /^(b|a)/i,
2132
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
2133
+ wide: /^(before christ|before common era|anno domini|common era)/i
2134
+ };
2135
+ var parseEraPatterns = {
2136
+ any: [/^b/i, /^(a|c)/i]
2137
+ };
2138
+ var matchQuarterPatterns = {
2139
+ narrow: /^[1234]/i,
2140
+ abbreviated: /^q[1234]/i,
2141
+ wide: /^[1234](th|st|nd|rd)? quarter/i
2142
+ };
2143
+ var parseQuarterPatterns = {
2144
+ any: [/1/i, /2/i, /3/i, /4/i]
2145
+ };
2146
+ var matchMonthPatterns = {
2147
+ narrow: /^[jfmasond]/i,
2148
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
2149
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
2150
+ };
2151
+ var parseMonthPatterns = {
2152
+ 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],
2153
+ 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]
2154
+ };
2155
+ var matchDayPatterns = {
2156
+ narrow: /^[smtwf]/i,
2157
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
2158
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
2159
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
2160
+ };
2161
+ var parseDayPatterns = {
2162
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
2163
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
2164
+ };
2165
+ var matchDayPeriodPatterns = {
2166
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
2167
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
2168
+ };
2169
+ var parseDayPeriodPatterns = {
2170
+ any: {
2171
+ am: /^a/i,
2172
+ pm: /^p/i,
2173
+ midnight: /^mi/i,
2174
+ noon: /^no/i,
2175
+ morning: /morning/i,
2176
+ afternoon: /afternoon/i,
2177
+ evening: /evening/i,
2178
+ night: /night/i
2179
+ }
2180
+ };
2181
+ var match = {
2182
+ ordinalNumber: buildMatchPatternFn({
2183
+ matchPattern: matchOrdinalNumberPattern,
2184
+ parsePattern: parseOrdinalNumberPattern,
2185
+ valueCallback: function valueCallback(value) {
2186
+ return parseInt(value, 10);
2187
+ }
2188
+ }),
2189
+ era: buildMatchFn({
2190
+ matchPatterns: matchEraPatterns,
2191
+ defaultMatchWidth: 'wide',
2192
+ parsePatterns: parseEraPatterns,
2193
+ defaultParseWidth: 'any'
2194
+ }),
2195
+ quarter: buildMatchFn({
2196
+ matchPatterns: matchQuarterPatterns,
2197
+ defaultMatchWidth: 'wide',
2198
+ parsePatterns: parseQuarterPatterns,
2199
+ defaultParseWidth: 'any',
2200
+ valueCallback: function valueCallback(index) {
2201
+ return index + 1;
2202
+ }
2203
+ }),
2204
+ month: buildMatchFn({
2205
+ matchPatterns: matchMonthPatterns,
2206
+ defaultMatchWidth: 'wide',
2207
+ parsePatterns: parseMonthPatterns,
2208
+ defaultParseWidth: 'any'
2209
+ }),
2210
+ day: buildMatchFn({
2211
+ matchPatterns: matchDayPatterns,
2212
+ defaultMatchWidth: 'wide',
2213
+ parsePatterns: parseDayPatterns,
2214
+ defaultParseWidth: 'any'
2215
+ }),
2216
+ dayPeriod: buildMatchFn({
2217
+ matchPatterns: matchDayPeriodPatterns,
2218
+ defaultMatchWidth: 'any',
2219
+ parsePatterns: parseDayPeriodPatterns,
2220
+ defaultParseWidth: 'any'
2221
+ })
2222
+ };
2223
+ var match$1 = match;
2224
+
2225
+ /**
2226
+ * @type {Locale}
2227
+ * @category Locales
2228
+ * @summary English locale (United States).
2229
+ * @language English
2230
+ * @iso-639-2 eng
2231
+ * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
2232
+ * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
2233
+ */
2234
+ var locale = {
2235
+ code: 'en-US',
2236
+ formatDistance: formatDistance$1,
2237
+ formatLong: formatLong$1,
2238
+ formatRelative: formatRelative$1,
2239
+ localize: localize$1,
2240
+ match: match$1,
2241
+ options: {
2242
+ weekStartsOn: 0 /* Sunday */,
2243
+ firstWeekContainsDate: 1
2244
+ }
2245
+ };
2246
+ var defaultLocale = locale;
2247
+
2248
+ // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
2249
+ // (one of the certain letters followed by `o`)
2250
+ // - (\w)\1* matches any sequences of the same letter
2251
+ // - '' matches two quote characters in a row
2252
+ // - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
2253
+ // except a single quote symbol, which ends the sequence.
2254
+ // Two quote characters do not end the sequence.
2255
+ // If there is no matching single quote
2256
+ // then the sequence will continue until the end of the string.
2257
+ // - . matches any single character unmatched by previous parts of the RegExps
2258
+ var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
2259
+
2260
+ // This RegExp catches symbols escaped by quotes, and also
2261
+ // sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
2262
+ var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
2263
+ var escapedStringRegExp = /^'([^]*?)'?$/;
2264
+ var doubleQuoteRegExp = /''/g;
2265
+ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
2266
+
2267
+ /**
2268
+ * @name format
2269
+ * @category Common Helpers
2270
+ * @summary Format the date.
2271
+ *
2272
+ * @description
2273
+ * Return the formatted date string in the given format. The result may vary by locale.
2274
+ *
2275
+ * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
2276
+ * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2277
+ *
2278
+ * The characters wrapped between two single quotes characters (') are escaped.
2279
+ * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
2280
+ * (see the last example)
2281
+ *
2282
+ * Format of the string is based on Unicode Technical Standard #35:
2283
+ * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
2284
+ * with a few additions (see note 7 below the table).
2285
+ *
2286
+ * Accepted patterns:
2287
+ * | Unit | Pattern | Result examples | Notes |
2288
+ * |---------------------------------|---------|-----------------------------------|-------|
2289
+ * | Era | G..GGG | AD, BC | |
2290
+ * | | GGGG | Anno Domini, Before Christ | 2 |
2291
+ * | | GGGGG | A, B | |
2292
+ * | Calendar year | y | 44, 1, 1900, 2017 | 5 |
2293
+ * | | yo | 44th, 1st, 0th, 17th | 5,7 |
2294
+ * | | yy | 44, 01, 00, 17 | 5 |
2295
+ * | | yyy | 044, 001, 1900, 2017 | 5 |
2296
+ * | | yyyy | 0044, 0001, 1900, 2017 | 5 |
2297
+ * | | yyyyy | ... | 3,5 |
2298
+ * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
2299
+ * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
2300
+ * | | YY | 44, 01, 00, 17 | 5,8 |
2301
+ * | | YYY | 044, 001, 1900, 2017 | 5 |
2302
+ * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
2303
+ * | | YYYYY | ... | 3,5 |
2304
+ * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
2305
+ * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
2306
+ * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
2307
+ * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
2308
+ * | | RRRRR | ... | 3,5,7 |
2309
+ * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
2310
+ * | | uu | -43, 01, 1900, 2017 | 5 |
2311
+ * | | uuu | -043, 001, 1900, 2017 | 5 |
2312
+ * | | uuuu | -0043, 0001, 1900, 2017 | 5 |
2313
+ * | | uuuuu | ... | 3,5 |
2314
+ * | Quarter (formatting) | Q | 1, 2, 3, 4 | |
2315
+ * | | Qo | 1st, 2nd, 3rd, 4th | 7 |
2316
+ * | | QQ | 01, 02, 03, 04 | |
2317
+ * | | QQQ | Q1, Q2, Q3, Q4 | |
2318
+ * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
2319
+ * | | QQQQQ | 1, 2, 3, 4 | 4 |
2320
+ * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
2321
+ * | | qo | 1st, 2nd, 3rd, 4th | 7 |
2322
+ * | | qq | 01, 02, 03, 04 | |
2323
+ * | | qqq | Q1, Q2, Q3, Q4 | |
2324
+ * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
2325
+ * | | qqqqq | 1, 2, 3, 4 | 4 |
2326
+ * | Month (formatting) | M | 1, 2, ..., 12 | |
2327
+ * | | Mo | 1st, 2nd, ..., 12th | 7 |
2328
+ * | | MM | 01, 02, ..., 12 | |
2329
+ * | | MMM | Jan, Feb, ..., Dec | |
2330
+ * | | MMMM | January, February, ..., December | 2 |
2331
+ * | | MMMMM | J, F, ..., D | |
2332
+ * | Month (stand-alone) | L | 1, 2, ..., 12 | |
2333
+ * | | Lo | 1st, 2nd, ..., 12th | 7 |
2334
+ * | | LL | 01, 02, ..., 12 | |
2335
+ * | | LLL | Jan, Feb, ..., Dec | |
2336
+ * | | LLLL | January, February, ..., December | 2 |
2337
+ * | | LLLLL | J, F, ..., D | |
2338
+ * | Local week of year | w | 1, 2, ..., 53 | |
2339
+ * | | wo | 1st, 2nd, ..., 53th | 7 |
2340
+ * | | ww | 01, 02, ..., 53 | |
2341
+ * | ISO week of year | I | 1, 2, ..., 53 | 7 |
2342
+ * | | Io | 1st, 2nd, ..., 53th | 7 |
2343
+ * | | II | 01, 02, ..., 53 | 7 |
2344
+ * | Day of month | d | 1, 2, ..., 31 | |
2345
+ * | | do | 1st, 2nd, ..., 31st | 7 |
2346
+ * | | dd | 01, 02, ..., 31 | |
2347
+ * | Day of year | D | 1, 2, ..., 365, 366 | 9 |
2348
+ * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
2349
+ * | | DD | 01, 02, ..., 365, 366 | 9 |
2350
+ * | | DDD | 001, 002, ..., 365, 366 | |
2351
+ * | | DDDD | ... | 3 |
2352
+ * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
2353
+ * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
2354
+ * | | EEEEE | M, T, W, T, F, S, S | |
2355
+ * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
2356
+ * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
2357
+ * | | io | 1st, 2nd, ..., 7th | 7 |
2358
+ * | | ii | 01, 02, ..., 07 | 7 |
2359
+ * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
2360
+ * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
2361
+ * | | iiiii | M, T, W, T, F, S, S | 7 |
2362
+ * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
2363
+ * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
2364
+ * | | eo | 2nd, 3rd, ..., 1st | 7 |
2365
+ * | | ee | 02, 03, ..., 01 | |
2366
+ * | | eee | Mon, Tue, Wed, ..., Sun | |
2367
+ * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
2368
+ * | | eeeee | M, T, W, T, F, S, S | |
2369
+ * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
2370
+ * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
2371
+ * | | co | 2nd, 3rd, ..., 1st | 7 |
2372
+ * | | cc | 02, 03, ..., 01 | |
2373
+ * | | ccc | Mon, Tue, Wed, ..., Sun | |
2374
+ * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
2375
+ * | | ccccc | M, T, W, T, F, S, S | |
2376
+ * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
2377
+ * | AM, PM | a..aa | AM, PM | |
2378
+ * | | aaa | am, pm | |
2379
+ * | | aaaa | a.m., p.m. | 2 |
2380
+ * | | aaaaa | a, p | |
2381
+ * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
2382
+ * | | bbb | am, pm, noon, midnight | |
2383
+ * | | bbbb | a.m., p.m., noon, midnight | 2 |
2384
+ * | | bbbbb | a, p, n, mi | |
2385
+ * | Flexible day period | B..BBB | at night, in the morning, ... | |
2386
+ * | | BBBB | at night, in the morning, ... | 2 |
2387
+ * | | BBBBB | at night, in the morning, ... | |
2388
+ * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
2389
+ * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
2390
+ * | | hh | 01, 02, ..., 11, 12 | |
2391
+ * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
2392
+ * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
2393
+ * | | HH | 00, 01, 02, ..., 23 | |
2394
+ * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
2395
+ * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
2396
+ * | | KK | 01, 02, ..., 11, 00 | |
2397
+ * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
2398
+ * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
2399
+ * | | kk | 24, 01, 02, ..., 23 | |
2400
+ * | Minute | m | 0, 1, ..., 59 | |
2401
+ * | | mo | 0th, 1st, ..., 59th | 7 |
2402
+ * | | mm | 00, 01, ..., 59 | |
2403
+ * | Second | s | 0, 1, ..., 59 | |
2404
+ * | | so | 0th, 1st, ..., 59th | 7 |
2405
+ * | | ss | 00, 01, ..., 59 | |
2406
+ * | Fraction of second | S | 0, 1, ..., 9 | |
2407
+ * | | SS | 00, 01, ..., 99 | |
2408
+ * | | SSS | 000, 001, ..., 999 | |
2409
+ * | | SSSS | ... | 3 |
2410
+ * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
2411
+ * | | XX | -0800, +0530, Z | |
2412
+ * | | XXX | -08:00, +05:30, Z | |
2413
+ * | | XXXX | -0800, +0530, Z, +123456 | 2 |
2414
+ * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
2415
+ * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
2416
+ * | | xx | -0800, +0530, +0000 | |
2417
+ * | | xxx | -08:00, +05:30, +00:00 | 2 |
2418
+ * | | xxxx | -0800, +0530, +0000, +123456 | |
2419
+ * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
2420
+ * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
2421
+ * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
2422
+ * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
2423
+ * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
2424
+ * | Seconds timestamp | t | 512969520 | 7 |
2425
+ * | | tt | ... | 3,7 |
2426
+ * | Milliseconds timestamp | T | 512969520900 | 7 |
2427
+ * | | TT | ... | 3,7 |
2428
+ * | Long localized date | P | 04/29/1453 | 7 |
2429
+ * | | PP | Apr 29, 1453 | 7 |
2430
+ * | | PPP | April 29th, 1453 | 7 |
2431
+ * | | PPPP | Friday, April 29th, 1453 | 2,7 |
2432
+ * | Long localized time | p | 12:00 AM | 7 |
2433
+ * | | pp | 12:00:00 AM | 7 |
2434
+ * | | ppp | 12:00:00 AM GMT+2 | 7 |
2435
+ * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
2436
+ * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
2437
+ * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
2438
+ * | | PPPppp | April 29th, 1453 at ... | 7 |
2439
+ * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
2440
+ * Notes:
2441
+ * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
2442
+ * are the same as "stand-alone" units, but are different in some languages.
2443
+ * "Formatting" units are declined according to the rules of the language
2444
+ * in the context of a date. "Stand-alone" units are always nominative singular:
2445
+ *
2446
+ * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
2447
+ *
2448
+ * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
2449
+ *
2450
+ * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
2451
+ * the single quote characters (see below).
2452
+ * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
2453
+ * the output will be the same as default pattern for this unit, usually
2454
+ * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
2455
+ * are marked with "2" in the last column of the table.
2456
+ *
2457
+ * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
2458
+ *
2459
+ * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
2460
+ *
2461
+ * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
2462
+ *
2463
+ * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
2464
+ *
2465
+ * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
2466
+ *
2467
+ * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
2468
+ * The output will be padded with zeros to match the length of the pattern.
2469
+ *
2470
+ * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
2471
+ *
2472
+ * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
2473
+ * These tokens represent the shortest form of the quarter.
2474
+ *
2475
+ * 5. The main difference between `y` and `u` patterns are B.C. years:
2476
+ *
2477
+ * | Year | `y` | `u` |
2478
+ * |------|-----|-----|
2479
+ * | AC 1 | 1 | 1 |
2480
+ * | BC 1 | 1 | 0 |
2481
+ * | BC 2 | 2 | -1 |
2482
+ *
2483
+ * Also `yy` always returns the last two digits of a year,
2484
+ * while `uu` pads single digit years to 2 characters and returns other years unchanged:
2485
+ *
2486
+ * | Year | `yy` | `uu` |
2487
+ * |------|------|------|
2488
+ * | 1 | 01 | 01 |
2489
+ * | 14 | 14 | 14 |
2490
+ * | 376 | 76 | 376 |
2491
+ * | 1453 | 53 | 1453 |
2492
+ *
2493
+ * The same difference is true for local and ISO week-numbering years (`Y` and `R`),
2494
+ * except local week-numbering years are dependent on `options.weekStartsOn`
2495
+ * and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}
2496
+ * and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).
2497
+ *
2498
+ * 6. Specific non-location timezones are currently unavailable in `date-fns`,
2499
+ * so right now these tokens fall back to GMT timezones.
2500
+ *
2501
+ * 7. These patterns are not in the Unicode Technical Standard #35:
2502
+ * - `i`: ISO day of week
2503
+ * - `I`: ISO week of year
2504
+ * - `R`: ISO week-numbering year
2505
+ * - `t`: seconds timestamp
2506
+ * - `T`: milliseconds timestamp
2507
+ * - `o`: ordinal number modifier
2508
+ * - `P`: long localized date
2509
+ * - `p`: long localized time
2510
+ *
2511
+ * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
2512
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2513
+ *
2514
+ * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
2515
+ * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2516
+ *
2517
+ * @param {Date|Number} date - the original date
2518
+ * @param {String} format - the string of tokens
2519
+ * @param {Object} [options] - an object with options.
2520
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
2521
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
2522
+ * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
2523
+ * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
2524
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2525
+ * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
2526
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2527
+ * @returns {String} the formatted date string
2528
+ * @throws {TypeError} 2 arguments required
2529
+ * @throws {RangeError} `date` must not be Invalid Date
2530
+ * @throws {RangeError} `options.locale` must contain `localize` property
2531
+ * @throws {RangeError} `options.locale` must contain `formatLong` property
2532
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
2533
+ * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
2534
+ * @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
2535
+ * @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
2536
+ * @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
2537
+ * @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
2538
+ * @throws {RangeError} format string contains an unescaped latin alphabet character
2539
+ *
2540
+ * @example
2541
+ * // Represent 11 February 2014 in middle-endian format:
2542
+ * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
2543
+ * //=> '02/11/2014'
2544
+ *
2545
+ * @example
2546
+ * // Represent 2 July 2014 in Esperanto:
2547
+ * import { eoLocale } from 'date-fns/locale/eo'
2548
+ * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
2549
+ * locale: eoLocale
2550
+ * })
2551
+ * //=> '2-a de julio 2014'
2552
+ *
2553
+ * @example
2554
+ * // Escape string by single quote characters:
2555
+ * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
2556
+ * //=> "3 o'clock"
2557
+ */
2558
+
2559
+ function format(dirtyDate, dirtyFormatStr, options) {
2560
+ 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;
2561
+ requiredArgs(2, arguments);
2562
+ var formatStr = String(dirtyFormatStr);
2563
+ var defaultOptions = getDefaultOptions();
2564
+ 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;
2565
+ 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);
2566
+
2567
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
2568
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
2569
+ throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
2570
+ }
2571
+ 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);
2572
+
2573
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
2574
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
2575
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
2576
+ }
2577
+ if (!locale.localize) {
2578
+ throw new RangeError('locale must contain localize property');
2579
+ }
2580
+ if (!locale.formatLong) {
2581
+ throw new RangeError('locale must contain formatLong property');
2582
+ }
2583
+ var originalDate = toDate(dirtyDate);
2584
+ if (!isValid(originalDate)) {
2585
+ throw new RangeError('Invalid time value');
2586
+ }
2587
+
2588
+ // Convert the date in system timezone to the same date in UTC+00:00 timezone.
2589
+ // This ensures that when UTC functions will be implemented, locales will be compatible with them.
2590
+ // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
2591
+ var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
2592
+ var utcDate = subMilliseconds(originalDate, timezoneOffset);
2593
+ var formatterOptions = {
2594
+ firstWeekContainsDate: firstWeekContainsDate,
2595
+ weekStartsOn: weekStartsOn,
2596
+ locale: locale,
2597
+ _originalDate: originalDate
2598
+ };
2599
+ var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {
2600
+ var firstCharacter = substring[0];
2601
+ if (firstCharacter === 'p' || firstCharacter === 'P') {
2602
+ var longFormatter = longFormatters$1[firstCharacter];
2603
+ return longFormatter(substring, locale.formatLong);
2604
+ }
2605
+ return substring;
2606
+ }).join('').match(formattingTokensRegExp).map(function (substring) {
2607
+ // Replace two single quote characters with one single quote character
2608
+ if (substring === "''") {
2609
+ return "'";
2610
+ }
2611
+ var firstCharacter = substring[0];
2612
+ if (firstCharacter === "'") {
2613
+ return cleanEscapedString(substring);
2614
+ }
2615
+ var formatter = formatters$1[firstCharacter];
2616
+ if (formatter) {
2617
+ if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) {
2618
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
2619
+ }
2620
+ if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) {
2621
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
2622
+ }
2623
+ return formatter(utcDate, substring, locale.localize, formatterOptions);
2624
+ }
2625
+ if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
2626
+ throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');
2627
+ }
2628
+ return substring;
2629
+ }).join('');
2630
+ return result;
2631
+ }
2632
+ function cleanEscapedString(input) {
2633
+ var matched = input.match(escapedStringRegExp);
2634
+ if (!matched) {
2635
+ return input;
2636
+ }
2637
+ return matched[1].replace(doubleQuoteRegExp, "'");
2638
+ }
2639
+
2640
+ var styles$3 = {"labelDate":"FeaturePost-module_labelDate__NXOgY","authorContent":"FeaturePost-module_authorContent__FEuRO","googlePlayButtonWrapper":"FeaturePost-module_googlePlayButtonWrapper__GI-ag","imgWrapper":"FeaturePost-module_imgWrapper__r6omd","featurePost":"FeaturePost-module_featurePost__9jY21","featurePostReversed":"FeaturePost-module_featurePostReversed__WQRXm","contentContainer":"FeaturePost-module_contentContainer__kdus7","col":"FeaturePost-module_col__eW8gY"};
275
2641
 
276
2642
  var Image = function (_a) {
277
2643
  var sources = _a.sources, props = __rest(_a, ["sources"]);
278
- return (React__default["default"].createElement("div", { className: styles$1.imgWrapper },
2644
+ return (React__default["default"].createElement("div", { className: styles$3.imgWrapper },
279
2645
  React__default["default"].createElement(Image$2.Image, __assign({ fadeOnLoad: true }, props), sources &&
280
2646
  sources.map(function (source) { return (React__default["default"].createElement(Image$2.Image.Source, __assign({ key: source.srcSet }, source))); }))));
281
2647
  };
282
2648
 
283
- var styles = {"featurePost":"FeaturePost-module_featurePost__PDoVH","featurePostReversed":"FeaturePost-module_featurePostReversed__tQZSX","col":"FeaturePost-module_col__x2s9L","labelDate":"FeaturePost-module_labelDate__eiCmw","contentContainer":"FeaturePost-module_contentContainer__dqJOS","authorContent":"FeaturePost-module_authorContent__QD4Nv","googlePlayButtonWrapper":"FeaturePost-module_googlePlayButtonWrapper__nGdyh"};
284
-
2649
+ /**
2650
+ * Use `FeaturePost` to direct traffic towards an article, case study, or product information page, or to a 3rd part App Store provider. Where the component links to an article page, the author attribution can be given here. The `FeaturePost` must be supported by an image, and in future, the component will support embedded video as well.
2651
+ * */
285
2652
  var FeaturePost = function (_a) {
286
2653
  var _b;
287
- var heading = _a.heading, label = _a.label, image = _a.image, content = _a.content, footer = _a.footer, _c = _a.isReverseOrder, isReverseOrder = _c === void 0 ? false : _c;
2654
+ var heading = _a.heading, _c = _a.headingLevel, headingLevel = _c === void 0 ? "2" : _c, label = _a.label, image = _a.image, content = _a.content, footer = _a.footer, _d = _a.isReverseOrder, isReverseOrder = _d === void 0 ? false : _d, props = __rest(_a, ["heading", "headingLevel", "label", "image", "content", "footer", "isReverseOrder"]);
288
2655
  var isMinWidthArcBreakpointM = useMediaQuery.useMediaQuery("(min-width: ".concat(SemSizeBreakpointsM, ")"));
289
- return (React__default["default"].createElement("div", { "data-testid": "feature-post", className: classNames(styles.featurePost, (_b = {},
290
- _b[styles.featurePostReversed] = isReverseOrder,
291
- _b)) },
292
- React__default["default"].createElement("div", { className: styles.col },
293
- React__default["default"].createElement("div", { className: styles.contentContainer },
2656
+ return (React__default["default"].createElement("div", __assign({ "data-testid": "feature-post", className: classNames(styles$3.featurePost, (_b = {},
2657
+ _b[styles$3.featurePostReversed] = isReverseOrder,
2658
+ _b)) }, filterDataAttrs(props)),
2659
+ React__default["default"].createElement("div", { className: styles$3.col },
2660
+ React__default["default"].createElement("div", { className: styles$3.contentContainer },
294
2661
  label && (React__default["default"].createElement(Grid.Grid, { isGutterless: true, isFluid: true },
295
2662
  React__default["default"].createElement(Grid.Grid.Row, { align: "baseline" },
296
2663
  React__default["default"].createElement(Grid.Grid.Col, { xs: 12, m: "auto" },
297
2664
  React__default["default"].createElement(Heading.Heading, { size: "xxs" }, label.text.toUpperCase())),
298
2665
  React__default["default"].createElement(Grid.Grid.Col, { xs: 12, m: "auto" },
299
- React__default["default"].createElement("div", { className: styles.labelDate },
300
- React__default["default"].createElement(Text.Text, { size: "xs", tone: "muted" }, label.date)))),
2666
+ React__default["default"].createElement("div", { className: styles$3.labelDate },
2667
+ React__default["default"].createElement(Text.Text, { size: "xs", tone: "muted" }, isDate(label.date) ? (React__default["default"].createElement("time", { dateTime: format(label.date, "yyyy-MM-dd") }, format(label.date, "LLLL d, yyyy"))) : (React__default["default"].createElement("span", null, label.date)))))),
301
2668
  React__default["default"].createElement(VerticalSpace.VerticalSpace, { size: "24" }))),
302
- React__default["default"].createElement(Heading.Heading, { level: "2", size: "xl" }, heading),
2669
+ React__default["default"].createElement(Heading.Heading, { level: headingLevel, size: "xl" }, heading),
303
2670
  !isMinWidthArcBreakpointM && (React__default["default"].createElement("div", { "data-testid": "mobile-img" },
304
2671
  React__default["default"].createElement(VerticalSpace.VerticalSpace, { size: "40" }),
305
2672
  React__default["default"].createElement(Image, __assign({}, image)))),
@@ -308,14 +2675,7 @@ var FeaturePost = function (_a) {
308
2675
  (footer === null || footer === void 0 ? void 0 : footer.type) === "cta" && (React__default["default"].createElement(React__default["default"].Fragment, null,
309
2676
  footer.author && (React__default["default"].createElement(React__default["default"].Fragment, null,
310
2677
  React__default["default"].createElement(VerticalSpace.VerticalSpace, { size: "24" }),
311
- React__default["default"].createElement(Grid.Grid, { isFluid: true, isGutterless: true },
312
- React__default["default"].createElement(Grid.Grid.Row, { align: "center" },
313
- React__default["default"].createElement(Grid.Grid.Col, { xs: "auto" },
314
- React__default["default"].createElement(Avatar.Avatar, __assign({ size: "m" }, footer.author.avatar))),
315
- React__default["default"].createElement(Grid.Grid.Col, null,
316
- React__default["default"].createElement("div", { className: styles.authorContent },
317
- React__default["default"].createElement(Heading.Heading, { size: "xs" }, footer.author.name),
318
- React__default["default"].createElement(Text.Text, { size: "s" }, footer.author.title))))))),
2678
+ React__default["default"].createElement(Author, { name: footer.author.name, title: footer.author.title, avatar: footer.author.avatar }))),
319
2679
  React__default["default"].createElement(VerticalSpace.VerticalSpace, { size: "40" }),
320
2680
  React__default["default"].createElement(ButtonV2.ButtonV2, __assign({ buttonStyle: "secondary" }, footer.button)))),
321
2681
  (footer === null || footer === void 0 ? void 0 : footer.type) === "appButton" && (React__default["default"].createElement(React__default["default"].Fragment, null,
@@ -325,13 +2685,123 @@ var FeaturePost = function (_a) {
325
2685
  footer.appStore && (React__default["default"].createElement(Grid.Grid.Col, { xs: 12, s: "auto" },
326
2686
  React__default["default"].createElement(AppButton.AppButton, { type: "apple-app-store", screenReaderText: footer.appStore.screenReaderText, url: footer.appStore.url }))),
327
2687
  footer.googlePlay && (React__default["default"].createElement(Grid.Grid.Col, { xs: 12, s: "auto" },
328
- React__default["default"].createElement("div", { className: styles.googlePlayButtonWrapper },
2688
+ React__default["default"].createElement("div", { className: styles$3.googlePlayButtonWrapper },
329
2689
  React__default["default"].createElement(AppButton.AppButton, { type: "google-play", screenReaderText: footer.googlePlay.screenReaderText, url: footer.googlePlay.url })))))))))),
330
- isMinWidthArcBreakpointM && (React__default["default"].createElement("div", { className: styles.col },
331
- React__default["default"].createElement("div", { "data-testid": "desktop-img", className: styles.imgContainer },
2690
+ isMinWidthArcBreakpointM && (React__default["default"].createElement("div", { className: styles$3.col },
2691
+ React__default["default"].createElement("div", { "data-testid": "desktop-img", className: styles$3.imgContainer },
332
2692
  React__default["default"].createElement(Image, __assign({}, image)))))));
333
2693
  };
334
2694
 
2695
+ var styles$2 = {"highlights":"Highlights-module_highlights__Hf7Zq","header":"Highlights-module_header__hIdDj","highlightItem":"Highlights-module_highlightItem__-N6le","headerContent":"Highlights-module_headerContent__rt-Oj","highlights2Column":"Highlights-module_highlights2Column__6qIuI","highlights3Column":"Highlights-module_highlights3Column__qsCMP"};
2696
+
2697
+ var HighlightItem = function (_a) {
2698
+ var icon = _a.icon, heading = _a.heading, text = _a.text, link = _a.link, isSmallIcon = _a.isSmallIcon;
2699
+ return (React__default["default"].createElement("div", { "data-testid": "highlight-item-container", className: styles$2.highlightItem },
2700
+ icon && (React__default["default"].createElement("div", { className: styles$2.Icon },
2701
+ React__default["default"].createElement(Icon.Icon, { "data-testid": "highlight-icon", color: "brand", icon: icon, size: isSmallIcon ? 64 : 76 }))),
2702
+ React__default["default"].createElement(VerticalSpace.VerticalSpace, { size: "16" }),
2703
+ React__default["default"].createElement(Heading.Heading, { level: "3", size: "m" }, heading),
2704
+ React__default["default"].createElement(VerticalSpace.VerticalSpace, { size: "16" }),
2705
+ React__default["default"].createElement(Text.Text, null, text),
2706
+ React__default["default"].createElement(VerticalSpace.VerticalSpace, { size: "16" }),
2707
+ link && (React__default["default"].createElement(Link.Link, { href: link.url, id: link.url, onClick: function noRefCheck() { }, rel: "", size: "m", target: "_self", title: link.textLink }, link.textLink))));
2708
+ };
2709
+
2710
+ var HighlightList = function (_a) {
2711
+ var listItems = _a.listItems, columns = _a.columns, isSmallIcon = _a.isSmallIcon;
2712
+ return (React__default["default"].createElement("div", { "data-testid": "highlights-list", className: classNames(styles$2.highlights, styles$2["highlights".concat(columns, "Column")]) }, listItems.map(function (_a) {
2713
+ var icon = _a.icon, heading = _a.heading, text = _a.text, link = _a.link;
2714
+ return (React__default["default"].createElement(HighlightItem, { icon: icon, heading: heading, text: text, link: link, isSmallIcon: isSmallIcon }));
2715
+ })));
2716
+ };
2717
+
2718
+ /**
2719
+ * Use `Highlights` to give supporting information about a page or proposition. It can be used to call out key benefits in bullet points, or link to a supporting explanatory video. An optional CTA can be used to link to further information or trigger a sales or enquiry journey.
2720
+ */
2721
+ var HighlightHeader = function (_a) {
2722
+ var heading = _a.heading, headingLevel = _a.headingLevel, content = _a.content;
2723
+ return (React__default["default"].createElement("div", { "data-testid": "highlights-header", className: styles$2.header },
2724
+ React__default["default"].createElement(Heading.Heading, { level: headingLevel, size: "xl" }, heading),
2725
+ content && (React__default["default"].createElement(React__default["default"].Fragment, null,
2726
+ React__default["default"].createElement(VerticalSpace.VerticalSpace, { size: "24" }),
2727
+ React__default["default"].createElement("p", { className: styles$2.headerContent }, content)))));
2728
+ };
2729
+
2730
+ /**
2731
+ * Use `Highlights` to give supporting information about a page or proposition. It can be used to call out key benefits in bullet points, or link. Both two and three column options are available.
2732
+ */
2733
+ var Highlights = function (_a) {
2734
+ var heading = _a.heading, _b = _a.headingLevel, headingLevel = _b === void 0 ? "2" : _b, content = _a.content, listItems = _a.listItems, _c = _a.columns, columns = _c === void 0 ? "2" : _c;
2735
+ var isMaxWidthArcBreakpointXs = useMediaQuery.useMediaQuery("(max-width: 767px)");
2736
+ return (React__default["default"].createElement("div", null,
2737
+ React__default["default"].createElement(HighlightHeader, { heading: heading, headingLevel: headingLevel, content: content }),
2738
+ React__default["default"].createElement(HighlightList, { "data-testid": "highlights-list-container", listItems: listItems, columns: columns, isSmallIcon: isMaxWidthArcBreakpointXs })));
2739
+ };
2740
+
2741
+ /**
2742
+ * Do not edit directly
2743
+ * Generated on Fri, 25 Oct 2024 08:31:13 GMT
2744
+ */
2745
+ var ArcSizeBreakpointsL = "1024px";
2746
+
2747
+ var styles$1 = {"PromoListing":"PromoListing-module_PromoListing__6ensv","headerContent":"PromoListing-module_headerContent__rMt1t","header":"PromoListing-module_header__PDGdP","promoListingContainer":"PromoListing-module_promoListingContainer__vwez-","cardGrid":"PromoListing-module_cardGrid__llf73","cardGrid2Columns":"PromoListing-module_cardGrid2Columns__qPLQk","cardGrid3Cards":"PromoListing-module_cardGrid3Cards__VKWMs","cardGrid5Cards":"PromoListing-module_cardGrid5Cards__ywl5k","cardGrid3Columns":"PromoListing-module_cardGrid3Columns__g0Xru","cardGrid4Cards":"PromoListing-module_cardGrid4Cards__5Bv5u","cardGrid2Cards":"PromoListing-module_cardGrid2Cards__wDc4S"};
2748
+
2749
+ var PromoListingHeader = function (_a) {
2750
+ var heading = _a.heading, headingLevel = _a.headingLevel, content = _a.content;
2751
+ return (React__default["default"].createElement("div", { "data-testid": "PromoListing-header", className: styles$1.header },
2752
+ React__default["default"].createElement(Heading.Heading, { level: headingLevel, size: "xl" }, heading),
2753
+ content && (React__default["default"].createElement(React__default["default"].Fragment, null,
2754
+ React__default["default"].createElement(VerticalSpace.VerticalSpace, { size: "24" }),
2755
+ React__default["default"].createElement("p", { className: styles$1.headerContent }, content)))));
2756
+ };
2757
+
2758
+ /**
2759
+ * Use `PromoListing` to give supporting information about a page or proposition in the form of the card components (`ImpactCard`, `InformationCard`, `MediaCard` and `TypographyCard`).
2760
+ */
2761
+ var PromoListing = function (_a) {
2762
+ var heading = _a.heading, content = _a.content, isCarousel = _a.isCarousel, cards = _a.cards, _b = _a.headingLevel, headingLevel = _b === void 0 ? "2" : _b, _c = _a.columns, columns = _c === void 0 ? "2" : _c;
2763
+ var isMinWidthArcBreakpointL = useMediaQuery.useMediaQuery("(min-width: ".concat(ArcSizeBreakpointsL, ")"));
2764
+ var columnCount = isMinWidthArcBreakpointL ? columns : 2;
2765
+ var getCard = function (card) { return (React__default["default"].createElement(React__default["default"].Fragment, null,
2766
+ card.type === "media-card" && React__default["default"].createElement(MediaCard.MediaCard, __assign({}, card)),
2767
+ card.type === "impact-card" && React__default["default"].createElement(ImpactCard.ImpactCard, __assign({}, card)),
2768
+ card.type === "information-card" && React__default["default"].createElement(InformationCard.InformationCard, __assign({}, card)),
2769
+ card.type === "typography-card" && React__default["default"].createElement(TypographyCard.TypographyCard, __assign({}, card)))); };
2770
+ return (React__default["default"].createElement("div", { className: styles$1.PromoListing },
2771
+ React__default["default"].createElement(PromoListingHeader, { heading: heading, headingLevel: headingLevel, content: content }),
2772
+ isCarousel && !isMinWidthArcBreakpointL ? (React__default["default"].createElement(Carousel.Carousel, { itemsPerSlide: 1, responsive: {
2773
+ s: {
2774
+ slideAmount: 1,
2775
+ partialVisible: false,
2776
+ itemsPerSlide: 2
2777
+ },
2778
+ m: {
2779
+ slideAmount: 1,
2780
+ partialVisible: true,
2781
+ itemsPerSlide: 2
2782
+ }
2783
+ } }, cards === null || cards === void 0 ? void 0 : cards.map(function (card) { return getCard(card); }))) : (React__default["default"].createElement("div", { className: classNames(styles$1.cardGrid, styles$1["cardGrid".concat(columnCount, "Columns")], styles$1["cardGrid".concat(cards.length, "Cards")]) }, cards === null || cards === void 0 ? void 0 : cards.map(function (card, index) { return (React__default["default"].createElement("div", { "data-testid": "promoList-card".concat(index), className: classNames(styles$1.promoListingContainer), key: index }, getCard(card))); })))));
2784
+ };
2785
+
2786
+ var styles = {"blockQuote":"Quote-module_blockQuote__STj-z","quoteContent":"Quote-module_quoteContent__kWc51","quoteDefault":"Quote-module_quoteDefault__tU5db","quoteSecondary":"Quote-module_quoteSecondary__3Rk3f","quoteIcon":"Quote-module_quoteIcon__HK1TV"};
2787
+
2788
+ /**
2789
+ * Use `Quote` where a quote or testimonial from an existing customer or stakeholder would help build trust and credibility with potential new customers. It's commonly used on product pages where customers would learn about a product or service that we offer.*/
2790
+ var Quote = function (_a) {
2791
+ var author = _a.author, _b = _a.styling, styling = _b === void 0 ? "Default" : _b, content = _a.content, citeUrl = _a.citeUrl, props = __rest(_a, ["author", "styling", "content", "citeUrl"]);
2792
+ return (React__default["default"].createElement("div", __assign({ className: "community-component--quote", "data-testid": "quote-test" }, filterDataAttrs(props)),
2793
+ React__default["default"].createElement("blockquote", { "data-testid": "style-test", className: classNames(styles.blockQuote, styles["quote".concat(styling)]), cite: citeUrl },
2794
+ React__default["default"].createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 100 77", className: styles.quoteIcon, "aria-hidden": "true" },
2795
+ React__default["default"].createElement("path", { d: "M21.8085 76.4706C15.9574 76.4706 10.8156 74.2732 6.38298 69.8783C2.12766 65.4834 0 58.979 0 50.3651C0 40.5206 3.10284 31.1156 9.30851 22.1501C15.6915 13.1846 25.3546 5.80122 38.2979 0L44.1489 11.3387C37.4113 14.3272 31.7376 18.0189 27.1277 22.4138C22.5177 26.6329 19.6809 31.4672 18.617 36.9168C19.8582 36.741 21.0106 36.6531 22.0745 36.6531C27.7482 36.6531 32.4468 38.499 36.1702 42.1907C40.0709 45.8824 42.0213 50.7167 42.0213 56.6937C42.0213 62.4949 39.9823 67.2414 35.9043 70.9331C32.0035 74.6247 27.305 76.4706 21.8085 76.4706ZM77.6596 76.4706C71.8085 76.4706 66.6667 74.2732 62.234 69.8783C57.9787 65.4834 55.8511 58.979 55.8511 50.3651C55.8511 40.5206 58.9539 31.1156 65.1596 22.1501C71.5425 13.1846 81.2057 5.80122 94.1489 0L100 11.3387C93.2624 14.3272 87.5886 18.0189 82.9787 22.4138C78.3688 26.6329 75.5319 31.4672 74.4681 36.9168C75.7092 36.741 76.8617 36.6531 77.9255 36.6531C83.5993 36.6531 88.2979 38.499 92.0213 42.1907C95.922 45.8824 97.8723 50.7167 97.8723 56.6937C97.8723 62.4949 95.8333 67.2414 91.7553 70.9331C87.8546 74.6247 83.156 76.4706 77.6596 76.4706Z" })),
2796
+ React__default["default"].createElement("p", { className: styles.quoteContent }, content)),
2797
+ author && (React__default["default"].createElement(Author, { name: author.name, title: author.title, avatar: author.avatar }))));
2798
+ };
2799
+
2800
+ exports.Accordion = Accordion;
2801
+ exports.Author = Author;
335
2802
  exports.CopyLead = CopyLead;
336
2803
  exports.FeaturePost = FeaturePost;
2804
+ exports.Highlights = Highlights;
2805
+ exports.PromoListing = PromoListing;
2806
+ exports.Quote = Quote;
337
2807
  //# sourceMappingURL=index.js.map