@hero-design/rn 8.62.0 → 8.63.1-alpha.0

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.
package/lib/index.js CHANGED
@@ -392,14 +392,14 @@ function _regeneratorRuntime() {
392
392
  }
393
393
  }, e;
394
394
  }
395
- function _typeof(o) {
395
+ function _typeof$1(o) {
396
396
  "@babel/helpers - typeof";
397
397
 
398
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
398
+ return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
399
399
  return typeof o;
400
400
  } : function (o) {
401
401
  return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
402
- }, _typeof(o);
402
+ }, _typeof$1(o);
403
403
  }
404
404
  function _classCallCheck(instance, Constructor) {
405
405
  if (!(instance instanceof Constructor)) {
@@ -1323,7 +1323,9 @@ var BASE_COLORS = {
1323
1323
  theatreGold: '#a56822',
1324
1324
  uniformGreen: '#4d4628',
1325
1325
  yellow: '#fadb14',
1326
- windsorGrey: '#606065'
1326
+ windsorGrey: '#606065',
1327
+ mist: '#e8e9f8',
1328
+ cloud: '#ccd9f5'
1327
1329
  };
1328
1330
  var colorScales = Object.entries(BASE_COLORS).reduce(function (acc, _ref16) {
1329
1331
  var _ref17 = _slicedToArray(_ref16, 2),
@@ -1332,15 +1334,17 @@ var colorScales = Object.entries(BASE_COLORS).reduce(function (acc, _ref16) {
1332
1334
  return Object.assign(Object.assign({}, acc), _defineProperty({}, key, createColorScales(value)));
1333
1335
  }, {});
1334
1336
  var blue$1 = colorScales.blue,
1335
- ultramarineBlue$2 = colorScales.ultramarineBlue,
1337
+ cloud = colorScales.cloud,
1338
+ deepSaffron$2 = colorScales.deepSaffron,
1336
1339
  green$1 = colorScales.green,
1337
1340
  grey$2 = colorScales.grey,
1338
1341
  grotesqueGreen = colorScales.grotesqueGreen,
1339
- deepSaffron$2 = colorScales.deepSaffron,
1342
+ mist = colorScales.mist,
1340
1343
  pink$1 = colorScales.pink,
1341
1344
  purple$1 = colorScales.purple,
1342
- vermilion$2 = colorScales.vermilion,
1343
1345
  smalt = colorScales.smalt,
1346
+ ultramarineBlue$2 = colorScales.ultramarineBlue,
1347
+ vermilion$2 = colorScales.vermilion,
1344
1348
  violet$1 = colorScales.violet,
1345
1349
  yellow$1 = colorScales.yellow;
1346
1350
  var palette$b = {
@@ -1359,9 +1363,11 @@ var palette$b = {
1359
1363
  blueLight60: blue$1.lighten60,
1360
1364
  blueLight75: blue$1.lighten75,
1361
1365
  blueLight90: blue$1.lighten90,
1366
+ cloudLight90: cloud.lighten90,
1362
1367
  dodgerBlue: ultramarineBlue$2.base,
1363
1368
  dodgerBlueDark15: ultramarineBlue$2.darken15,
1364
1369
  dodgerBlueDark30: ultramarineBlue$2.darken30,
1370
+ dodgerBlueDark60: ultramarineBlue$2.darken60,
1365
1371
  dodgerBlueLight30: ultramarineBlue$2.lighten30,
1366
1372
  dodgerBlueLight45: ultramarineBlue$2.lighten45,
1367
1373
  dodgerBlueLight60: ultramarineBlue$2.lighten60,
@@ -1370,6 +1376,7 @@ var palette$b = {
1370
1376
  green: green$1.base,
1371
1377
  greenDark15: green$1.darken15,
1372
1378
  greenDark30: green$1.darken30,
1379
+ greenDark60: green$1.darken60,
1373
1380
  greenDark75: green$1.darken75,
1374
1381
  greenLight30: green$1.lighten30,
1375
1382
  greenLight75: green$1.lighten75,
@@ -1380,6 +1387,7 @@ var palette$b = {
1380
1387
  greyDark45: grey$2.darken45,
1381
1388
  greyDark60: grey$2.darken60,
1382
1389
  greyDark75: grey$2.darken75,
1390
+ greyLight30: grey$2.lighten30,
1383
1391
  greyLight45: grey$2.lighten45,
1384
1392
  greyLight60: grey$2.lighten60,
1385
1393
  greyLight75: grey$2.lighten75,
@@ -1393,20 +1401,27 @@ var palette$b = {
1393
1401
  grotesqueGreenLight60: grotesqueGreen.lighten60,
1394
1402
  grotesqueGreenLight75: grotesqueGreen.lighten75,
1395
1403
  grotesqueGreenLight90: grotesqueGreen.lighten90,
1404
+ mistLight30: mist.lighten30,
1405
+ mistLight60: mist.lighten60,
1406
+ mistLight90: mist.lighten90,
1396
1407
  orange: deepSaffron$2.base,
1397
1408
  orangeDark15: deepSaffron$2.darken15,
1398
1409
  orangeDark30: deepSaffron$2.darken30,
1410
+ orangeDark60: deepSaffron$2.darken60,
1399
1411
  orangeDark75: deepSaffron$2.darken75,
1400
1412
  orangeLight30: deepSaffron$2.lighten30,
1413
+ orangeLight60: deepSaffron$2.lighten60,
1401
1414
  orangeLight75: deepSaffron$2.lighten75,
1402
1415
  orangeLight90: deepSaffron$2.lighten90,
1403
1416
  pink: pink$1.base,
1404
1417
  pinkDark15: pink$1.darken15,
1405
1418
  pinkDark30: pink$1.darken30,
1406
1419
  pinkDark45: pink$1.darken45,
1420
+ pinkDark60: pink$1.darken60,
1407
1421
  pinkDark75: pink$1.darken75,
1408
1422
  pinkLight30: pink$1.lighten30,
1409
1423
  pinkLight45: pink$1.lighten45,
1424
+ pinkLight60: pink$1.lighten60,
1410
1425
  pinkLight75: pink$1.lighten75,
1411
1426
  pinkLight90: pink$1.lighten90,
1412
1427
  purple: purple$1.base,
@@ -1449,6 +1464,7 @@ var palette$b = {
1449
1464
  yellow: yellow$1.base,
1450
1465
  yellowDark15: yellow$1.darken15,
1451
1466
  yellowDark30: yellow$1.darken30,
1467
+ yellowDark45: yellow$1.darken45,
1452
1468
  yellowDark75: yellow$1.darken75,
1453
1469
  yellowLight30: yellow$1.lighten30,
1454
1470
  yellowLight45: yellow$1.lighten45,
@@ -5366,8 +5382,8 @@ var camelize = function camelize(obj) {
5366
5382
  return walk(obj);
5367
5383
  };
5368
5384
  function walk(obj) {
5369
- if (!obj || _typeof(obj) !== 'object') return obj;
5370
- if (isDate(obj) || isRegex(obj)) return obj;
5385
+ if (!obj || _typeof$1(obj) !== 'object') return obj;
5386
+ if (isDate$1(obj) || isRegex(obj)) return obj;
5371
5387
  if (isArray(obj)) return map(obj, walk);
5372
5388
  return reduce(objectKeys(obj), function (acc, key) {
5373
5389
  var camel = camelCase(key);
@@ -5383,7 +5399,7 @@ function camelCase(str) {
5383
5399
  var isArray = Array.isArray || function (obj) {
5384
5400
  return Object.prototype.toString.call(obj) === '[object Array]';
5385
5401
  };
5386
- var isDate = function isDate(obj) {
5402
+ var isDate$1 = function isDate(obj) {
5387
5403
  return Object.prototype.toString.call(obj) === '[object Date]';
5388
5404
  };
5389
5405
  var isRegex = function isRegex(obj) {
@@ -5716,7 +5732,7 @@ var cssColorKeywords = require$$0;
5716
5732
  value: true
5717
5733
  });
5718
5734
  function _interopDefault(ex) {
5719
- return ex && _typeof(ex) === 'object' && 'default' in ex ? ex['default'] : ex;
5735
+ return ex && _typeof$1(ex) === 'object' && 'default' in ex ? ex['default'] : ex;
5720
5736
  }
5721
5737
  var parse = lib$1;
5722
5738
  var parse__default = _interopDefault(parse);
@@ -6436,7 +6452,7 @@ var generated = {};
6436
6452
  var buffer = '';
6437
6453
  var lastType;
6438
6454
  function handleInterpolation(interpolation, i, arr) {
6439
- var type = _typeof(interpolation);
6455
+ var type = _typeof$1(interpolation);
6440
6456
  if (type === 'string') {
6441
6457
  // strip comments
6442
6458
  interpolation = interpolation.replace(/\/\*[\s\S]*?\*\/|\/\/.*$/gm, '');
@@ -6942,7 +6958,7 @@ var Typography = {
6942
6958
  };
6943
6959
 
6944
6960
  // 🔴 DO NOT EDIT — This file is generated automatically.
6945
- var IconList = ['activate', 'add-emoji', 'add-person', 'adjustment', 'alignment', 'antenna', 'archive', 'assignment-warning', 'bank', 'bell', 'billing', 'bolt', 'bookmark-added', 'bookmark', 'box-check', 'box', 'bpay', 'buildings', 'cake', 'calendar-clock', 'calendar', 'candy-box-menu', 'caret-down-small', 'caret-down', 'caret-left-small', 'caret-left', 'caret-right-small', 'caret-right', 'caret-up-small', 'caret-up', 'check-radio', 'circle-add', 'circle-cancel', 'circle-check', 'circle-down', 'circle-info', 'circle-left', 'circle-ok', 'circle-pencil', 'circle-question', 'circle-remove', 'circle-right', 'circle-up', 'circle-warning', 'clock-3', 'clock', 'cloud-download', 'cloud-upload', 'cog', 'coin', 'contacts', 'credit-card', 'diamond', 'direction-arrows', 'directory', 'document', 'dollar-coin-shine', 'double-buildings', 'edit-template', 'envelope', 'exclude', 'expand-content', 'expense', 'explore_nearby', 'eye-circle', 'eye-invisible', 'eye', 'face-meh', 'face-sad', 'face-smiley', 'feed', 'feedbacks', 'file-certified', 'file-clone', 'file-copy', 'file-csv', 'file-dispose', 'file-doc', 'file-excel', 'file-export', 'file-lock', 'file-pdf', 'file-powerpoint', 'file-search', 'file-secured', 'file-sheets', 'file-slide', 'file-verified', 'file-word', 'file', 'filter', 'folder-user', 'folder', 'format-bold', 'format-heading1', 'format-heading2', 'format-italic', 'format-list-bulleted', 'format-list-numbered', 'format-underlined', 'funnel-filter', 'global-dollar', 'globe', 'graduation-cap', 'graph', 'happy-sun', 'health-bag', 'heart', 'hero-points', 'home', 'image', 'import', 'incident-siren', 'instapay-daily', 'instapay-now', 'instapay', 'list', 'loading-2', 'loading', 'location-on', 'location', 'lock', 'looks-one', 'looks-two', 'media-content', 'menu', 'money-notes', 'moneybag', 'moon', 'multiple-stars', 'multiple-users', 'near-me', 'node', 'open-folder', 'paperclip', 'payment-summary', 'pencil', 'phone', 'piggy-bank', 'plane-up', 'plane', 'play-circle', 'print', 'raising-hands', 'reply-arrow', 'reply', 'reschedule', 'rostering', 'salary-sacrifice', 'save', 'schedule-send', 'schedule', 'search-person', 'send', 'speaker-active', 'speaker', 'star-award', 'star-badge', 'star-circle', 'star-medal', 'star', 'steps-circle', 'stopwatch', 'suitcase', 'surfing', 'survey', 'swag-pillar-benefit', 'swag-pillar-career', 'swag-pillar-money', 'swag-pillar-work', 'swag', 'swipe-right', 'switch', 'tag', 'target', 'teams', 'timesheet', 'touch-id', 'trash-bin', 'unlock', 'user', 'video-1', 'video-2', 'wallet', 'warning', 'activate-outlined', 'add-credit-card-outlined', 'add-person-outlined', 'add-section-outlined', 'add-time-outlined', 'add', 'adjustment-outlined', 'ai-outlined', 'alignment-2-outlined', 'alignment-outlined', 'all-caps', 'application-outlined', 'arrow-down', 'arrow-downwards', 'arrow-left', 'arrow-leftwards', 'arrow-right', 'arrow-rightwards', 'arrow-up', 'arrow-upwards', 'article-outlined', 'at-sign', 'auto-graph-outlined', 'beer-outlined', 'bell-active-outlined', 'bell-outlined', 'bell-slash-outlined', 'bill-management-outlined', 'billing-outlined', 'body-outlined', 'bold', 'bolt-outlined', 'book-outlined', 'bookmark-added-outlined', 'bookmark-outlined', 'box-check-outlined', 'box-outlined', 'bullet-points', 'cake-outlined', 'calendar-dates-outlined', 'calendar-star-outlined', 'call-outlined', 'call-split-outlined', 'camera-outlined', 'cancel', 'car-forward-outlined', 'cashback-outlined', 'charging-station-outlined', 'chat-bubble-outlined', 'chat-unread-outlined', 'checkmark', 'circle-add-outlined', 'circle-cancel-outlined', 'circle-down-outlined', 'circle-info-outlined', 'circle-left-outlined', 'circle-ok-outlined', 'circle-question-outlined', 'circle-remove-outlined', 'circle-right-outlined', 'circle-up-outlined', 'circle-warning-outlined', 'clock-2-outlined', 'clock-outlined', 'cog-outlined', 'coin-outlined', 'coin-super-outlined', 'comment-outlined', 'contacts-outlined', 'contacts-user-outlined', 'credit-card-outlined', 'cup-outlined', 'dentistry-outlined', 'direction-arrows-outlined', 'directory-outlined', 'document-outlined', 'dollar-box-outlined', 'dollar-card-outlined', 'dollar-coin-shine-outlined', 'dollar-credit-card-outlined', 'dollar-sign', 'double-buildings-outlined', 'double-left-arrows', 'double-right-arrows', 'download-box-outlined', 'download-outlined', 'edit-template-outlined', 'email-outlined', 'enter-arrow', 'envelope-outlined', 'expense-approval-outlined', 'expense-outlined', 'explore-outlined', 'extension-outlined', 'external-link', 'eye-invisible-outlined', 'eye-outlined', 'face-id', 'face-meh-outlined', 'face-open-smiley-outlined', 'face-sad-outlined', 'face-smiley-outlined', 'fastfood-outlined', 'feed-outlined', 'file-certified-outlined', 'file-clone-outlined', 'file-copy-outlined', 'file-dispose-outlined', 'file-dollar-certified-outlined', 'file-dollar-outlined', 'file-download-outlined', 'file-export-outlined', 'file-lock-outlined', 'file-outlined', 'file-search-outlined', 'file-secured-outlined', 'file-statutory-outlined', 'file-verified-outlined', 'filter-outlined', 'folder-outlined', 'folder-user-outlined', 'form-outlined', 'funnel-filter-outline', 'goal-outlined', 'graph-outlined', 'hand-holding-user-outlined', 'happy-sun-outlined', 'health-bag-outlined', 'heart-outlined', 'home-active-outlined', 'home-outlined', 'id-card-outlined', 'image-outlined', 'import-outlined', 'instapay-outlined', 'italic', 'job-search-outlined', 'leave-approval-outlined', 'link-1', 'link-2', 'list-outlined', 'live-help-outlined', 'local_mall_outlined', 'location-on-outlined', 'location-outlined', 'lock-outlined', 'locked-file-outlined', 'log-out', 'mail-outlined', 'map-outlined', 'media-content-outlined', 'menu-close', 'menu-expand', 'menu-fold-outlined', 'menu-unfold-outlined', 'moneybag-outlined', 'moon-outlined', 'more-horizontal', 'more-vertical', 'multiple-folders-outlined', 'multiple-users-outlined', 'near-me-outlined', 'node-outlined', 'number-points', 'number', 'overview-outlined', 'payment-summary-outlined', 'payslip-outlined', 'pencil-outlined', 'percentage', 'phone-outlined', 'piggy-bank-outlined', 'plane-outlined', 'play-circle-outlined', 'print-outlined', 'propane-tank-outlined', 'qr-code-outlined', 'qualification-outlined', 're-assign', 'redeem', 'refresh', 'remove', 'reply-outlined', 'restart', 'resume-outlined', 'return-arrow', 'rostering-outlined', 'safety-outlined', 'save-outlined', 'schedule-outlined', 'search-outlined', 'search-secured-outlined', 'send-outlined', 'share-1', 'share-2', 'share-outlined-2', 'share-outlined', 'shopping_basket_outlined', 'show-chart-outlined', 'single-down-arrow', 'single-left-arrow', 'single-right-arrow', 'single-up-arrow', 'smart-match-outlined', 'sparkle-outlined', 'speaker-active-outlined', 'speaker-outlined', 'star-circle-outlined', 'star-outlined', 'stash-outlined', 'stopwatch-outlined', 'strikethrough', 'styler-outlined', 'suitcase-clock-outlined', 'suitcase-outlined', 'survey-outlined', 'switch-outlined', 'sync', 'tag-outlined', 'target-outlined', 'tennis-outlined', 'ticket-outlined', 'timesheet-outlined', 'timesheets-outlined', 'today-outlined', 'transfer', 'trash-bin-outlined', 'umbrela-outlined', 'unavailability-outlined', 'unavailable', 'underline', 'union-outlined', 'unlock-outlined', 'upload-outlined', 'user-circle-outlined', 'user-gear-outlined', 'user-outlined', 'user-rectangle-outlined', 'video-1-outlined', 'video-2-outlined', 'volunteer-outlined', 'wallet-outlined', 'wellness-outlined'];
6961
+ var IconList = ['activate', 'add-emoji', 'add-person', 'adjustment', 'alignment', 'antenna', 'archive', 'assignment-warning', 'bank', 'bell', 'billing', 'bolt', 'bookmark-added', 'bookmark', 'box-check', 'box', 'bpay', 'buildings', 'cake', 'calendar-clock', 'calendar', 'candy-box-menu', 'caret-down-small', 'caret-down', 'caret-left-small', 'caret-left', 'caret-right-small', 'caret-right', 'caret-up-small', 'caret-up', 'check-radio', 'circle-add', 'circle-cancel', 'circle-check', 'circle-down', 'circle-info', 'circle-left', 'circle-ok', 'circle-pencil', 'circle-question', 'circle-remove', 'circle-right', 'circle-up', 'circle-warning', 'clock-3', 'clock', 'cloud-download', 'cloud-upload', 'cog', 'coin', 'contacts', 'credit-card', 'diamond', 'direction-arrows', 'directory', 'document', 'dollar-coin-shine', 'double-buildings', 'edit-template', 'envelope', 'exclude', 'expand-content', 'expense', 'explore_nearby', 'eye-circle', 'eye-invisible', 'eye', 'face-meh', 'face-sad', 'face-smiley', 'feed', 'feedbacks', 'file-certified', 'file-clone', 'file-copy', 'file-csv', 'file-dispose', 'file-doc', 'file-excel', 'file-export', 'file-lock', 'file-pdf', 'file-powerpoint', 'file-search', 'file-secured', 'file-sheets', 'file-slide', 'file-verified', 'file-word', 'file', 'filter', 'folder-user', 'folder', 'format-bold', 'format-heading1', 'format-heading2', 'format-italic', 'format-list-bulleted', 'format-list-numbered', 'format-underlined', 'funnel-filter', 'global-dollar', 'globe', 'graduation-cap', 'graph', 'happy-sun', 'health-bag', 'heart', 'hero-points', 'home', 'image', 'import', 'incident-siren', 'instapay-daily', 'instapay-now', 'instapay', 'list', 'loading-2', 'loading', 'location-on', 'location', 'lock', 'looks-one', 'looks-two', 'media-content', 'menu', 'money-notes', 'moneybag', 'moon', 'multiple-stars', 'multiple-users', 'near-me', 'node', 'open-folder', 'paperclip', 'payment-summary', 'pencil', 'phone', 'piggy-bank', 'plane-up', 'plane', 'play-circle', 'print', 'raising-hands', 'reply-arrow', 'reply', 'reschedule', 'rostering', 'salary-sacrifice', 'save', 'schedule-send', 'schedule', 'search-person', 'send', 'speaker-active', 'speaker', 'star-award', 'star-badge', 'star-circle', 'star-medal', 'star', 'steps-circle', 'stopwatch', 'suitcase', 'surfing', 'survey', 'swag-pillar-benefit', 'swag-pillar-career', 'swag-pillar-money', 'swag-pillar-work', 'swag', 'swipe-right', 'switch', 'tag', 'target', 'teams', 'timesheet', 'touch-id', 'trash-bin', 'unlock', 'user', 'video-1', 'video-2', 'wallet', 'warning', 'activate-outlined', 'add-credit-card-outlined', 'add-person-outlined', 'add-section-outlined', 'add-time-outlined', 'add', 'adjustment-outlined', 'ai-outlined', 'alignment-2-outlined', 'alignment-outlined', 'all-caps', 'application-outlined', 'arrow-down', 'arrow-downwards', 'arrow-left', 'arrow-leftwards', 'arrow-right', 'arrow-rightwards', 'arrow-up', 'arrow-upwards', 'article-outlined', 'at-sign', 'auto-graph-outlined', 'beer-outlined', 'bell-active-outlined', 'bell-outlined', 'bell-slash-outlined', 'bill-management-outlined', 'billing-outlined', 'body-outlined', 'bold', 'bolt-outlined', 'book-outlined', 'bookmark-added-outlined', 'bookmark-outlined', 'box-check-outlined', 'box-outlined', 'bullet-points', 'cake-outlined', 'calendar-dates-outlined', 'calendar-star-outlined', 'call-outlined', 'call-split-outlined', 'camera-outlined', 'cancel', 'car-forward-outlined', 'cashback-outlined', 'charging-station-outlined', 'chat-bubble-outlined', 'chat-unread-outlined', 'checkmark', 'circle-add-outlined', 'circle-cancel-outlined', 'circle-down-outlined', 'circle-info-outlined', 'circle-left-outlined', 'circle-ok-outlined', 'circle-question-outlined', 'circle-remove-outlined', 'circle-right-outlined', 'circle-up-outlined', 'circle-warning-outlined', 'clock-2-outlined', 'clock-in-outlined', 'clock-out-outlined', 'clock-outlined', 'cog-outlined', 'coin-outlined', 'coin-super-outlined', 'comment-outlined', 'contacts-outlined', 'contacts-user-outlined', 'credit-card-outlined', 'cup-outlined', 'dentistry-outlined', 'direction-arrows-outlined', 'directory-outlined', 'document-outlined', 'dollar-box-outlined', 'dollar-card-outlined', 'dollar-coin-shine-outlined', 'dollar-credit-card-outlined', 'dollar-sign', 'double-buildings-outlined', 'double-left-arrows', 'double-right-arrows', 'download-box-outlined', 'download-outlined', 'edit-template-outlined', 'email-outlined', 'end-break-outlined', 'enter-arrow', 'envelope-outlined', 'expense-approval-outlined', 'expense-outlined', 'explore-outlined', 'extension-outlined', 'external-link', 'eye-invisible-outlined', 'eye-outlined', 'face-id', 'face-meh-outlined', 'face-open-smiley-outlined', 'face-sad-outlined', 'face-smiley-outlined', 'fastfood-outlined', 'feed-outlined', 'file-certified-outlined', 'file-clone-outlined', 'file-copy-outlined', 'file-dispose-outlined', 'file-dollar-certified-outlined', 'file-dollar-outlined', 'file-download-outlined', 'file-export-outlined', 'file-lock-outlined', 'file-outlined', 'file-search-outlined', 'file-secured-outlined', 'file-statutory-outlined', 'file-verified-outlined', 'filter-outlined', 'folder-outlined', 'folder-user-outlined', 'form-outlined', 'funnel-filter-outline', 'goal-outlined', 'graph-outlined', 'hand-holding-user-outlined', 'happy-sun-outlined', 'health-bag-outlined', 'heart-outlined', 'home-active-outlined', 'home-outlined', 'id-card-outlined', 'image-outlined', 'import-outlined', 'instapay-outlined', 'italic', 'job-search-outlined', 'leave-approval-outlined', 'link-1', 'link-2', 'list-outlined', 'live-help-outlined', 'local_mall_outlined', 'location-on-outlined', 'location-outlined', 'lock-outlined', 'locked-file-outlined', 'log-out', 'mail-outlined', 'map-outlined', 'media-content-outlined', 'menu-close', 'menu-expand', 'menu-fold-outlined', 'menu-unfold-outlined', 'moneybag-outlined', 'moon-outlined', 'more-horizontal', 'more-vertical', 'multiple-folders-outlined', 'multiple-users-outlined', 'near-me-outlined', 'node-outlined', 'number-points', 'number', 'overview-outlined', 'payment-summary-outlined', 'payslip-outlined', 'pencil-outlined', 'percentage', 'phone-outlined', 'piggy-bank-outlined', 'plane-outlined', 'play-circle-outlined', 'print-outlined', 'propane-tank-outlined', 'qr-code-outlined', 'qualification-outlined', 're-assign', 'redeem', 'refresh', 'remove', 'reply-outlined', 'restart', 'resume-outlined', 'return-arrow', 'rostering-outlined', 'safety-outlined', 'save-outlined', 'schedule-outlined', 'search-outlined', 'search-secured-outlined', 'send-outlined', 'share-1', 'share-2', 'share-outlined-2', 'share-outlined', 'shopping_basket_outlined', 'show-chart-outlined', 'single-down-arrow', 'single-left-arrow', 'single-right-arrow', 'single-up-arrow', 'smart-match-outlined', 'sparkle-outlined', 'speaker-active-outlined', 'speaker-outlined', 'star-circle-outlined', 'star-outlined', 'start-break-outlined', 'stash-outlined', 'stopwatch-outlined', 'strikethrough', 'styler-outlined', 'suitcase-clock-outlined', 'suitcase-outlined', 'survey-outlined', 'switch-outlined', 'sync', 'tag-outlined', 'target-outlined', 'tennis-outlined', 'ticket-outlined', 'timesheet-outlined', 'timesheets-outlined', 'today-outlined', 'transfer', 'trash-bin-outlined', 'umbrela-outlined', 'unavailability-outlined', 'unavailable', 'underline', 'union-outlined', 'unlock-outlined', 'upload-outlined', 'user-circle-outlined', 'user-gear-outlined', 'user-outlined', 'user-rectangle-outlined', 'video-1-outlined', 'video-2-outlined', 'volunteer-outlined', 'wallet-outlined', 'wellness-outlined'];
6946
6962
 
6947
6963
  var activate = 59000;
6948
6964
  var adjustment = 59003;
@@ -7020,20 +7036,20 @@ var add = 59190;
7020
7036
  var bold = 59215;
7021
7037
  var cancel = 59229;
7022
7038
  var checkmark = 59235;
7023
- var italic = 59320;
7024
- var local_mall_outlined = 59327;
7025
- var number = 59349;
7026
- var percentage = 59354;
7027
- var redeem = 59364;
7028
- var refresh = 59365;
7029
- var remove = 59366;
7030
- var restart = 59368;
7031
- var shopping_basket_outlined = 59382;
7032
- var strikethrough = 59396;
7033
- var sync = 59402;
7034
- var transfer = 59410;
7035
- var unavailable = 59414;
7036
- var underline = 59415;
7039
+ var italic = 59323;
7040
+ var local_mall_outlined = 59330;
7041
+ var number = 59352;
7042
+ var percentage = 59357;
7043
+ var redeem = 59367;
7044
+ var refresh = 59368;
7045
+ var remove = 59369;
7046
+ var restart = 59371;
7047
+ var shopping_basket_outlined = 59385;
7048
+ var strikethrough = 59400;
7049
+ var sync = 59406;
7050
+ var transfer = 59414;
7051
+ var unavailable = 59418;
7052
+ var underline = 59419;
7037
7053
  var glyphMap = {
7038
7054
  activate: activate,
7039
7055
  "add-emoji": 59001,
@@ -7283,186 +7299,190 @@ var glyphMap = {
7283
7299
  "circle-up-outlined": 59245,
7284
7300
  "circle-warning-outlined": 59246,
7285
7301
  "clock-2-outlined": 59247,
7286
- "clock-outlined": 59248,
7287
- "cog-outlined": 59249,
7288
- "coin-outlined": 59250,
7289
- "coin-super-outlined": 59251,
7290
- "comment-outlined": 59252,
7291
- "contacts-outlined": 59253,
7292
- "contacts-user-outlined": 59254,
7293
- "credit-card-outlined": 59255,
7294
- "cup-outlined": 59256,
7295
- "dentistry-outlined": 59257,
7296
- "direction-arrows-outlined": 59258,
7297
- "directory-outlined": 59259,
7298
- "document-outlined": 59260,
7299
- "dollar-box-outlined": 59261,
7300
- "dollar-card-outlined": 59262,
7301
- "dollar-coin-shine-outlined": 59263,
7302
- "dollar-credit-card-outlined": 59264,
7303
- "dollar-sign": 59265,
7304
- "double-buildings-outlined": 59266,
7305
- "double-left-arrows": 59267,
7306
- "double-right-arrows": 59268,
7307
- "download-box-outlined": 59269,
7308
- "download-outlined": 59270,
7309
- "edit-template-outlined": 59271,
7310
- "email-outlined": 59272,
7311
- "enter-arrow": 59273,
7312
- "envelope-outlined": 59274,
7313
- "expense-approval-outlined": 59275,
7314
- "expense-outlined": 59276,
7315
- "explore-outlined": 59277,
7316
- "extension-outlined": 59278,
7317
- "external-link": 59279,
7318
- "eye-invisible-outlined": 59280,
7319
- "eye-outlined": 59281,
7320
- "face-id": 59282,
7321
- "face-meh-outlined": 59283,
7322
- "face-open-smiley-outlined": 59284,
7323
- "face-sad-outlined": 59285,
7324
- "face-smiley-outlined": 59286,
7325
- "fastfood-outlined": 59287,
7326
- "feed-outlined": 59288,
7327
- "file-certified-outlined": 59289,
7328
- "file-clone-outlined": 59290,
7329
- "file-copy-outlined": 59291,
7330
- "file-dispose-outlined": 59292,
7331
- "file-dollar-certified-outlined": 59293,
7332
- "file-dollar-outlined": 59294,
7333
- "file-download-outlined": 59295,
7334
- "file-export-outlined": 59296,
7335
- "file-lock-outlined": 59297,
7336
- "file-outlined": 59298,
7337
- "file-search-outlined": 59299,
7338
- "file-secured-outlined": 59300,
7339
- "file-statutory-outlined": 59301,
7340
- "file-verified-outlined": 59302,
7341
- "filter-outlined": 59303,
7342
- "folder-outlined": 59304,
7343
- "folder-user-outlined": 59305,
7344
- "form-outlined": 59306,
7345
- "funnel-filter-outline": 59307,
7346
- "goal-outlined": 59308,
7347
- "graph-outlined": 59309,
7348
- "hand-holding-user-outlined": 59310,
7349
- "happy-sun-outlined": 59311,
7350
- "health-bag-outlined": 59312,
7351
- "heart-outlined": 59313,
7352
- "home-active-outlined": 59314,
7353
- "home-outlined": 59315,
7354
- "id-card-outlined": 59316,
7355
- "image-outlined": 59317,
7356
- "import-outlined": 59318,
7357
- "instapay-outlined": 59319,
7302
+ "clock-in-outlined": 59248,
7303
+ "clock-out-outlined": 59249,
7304
+ "clock-outlined": 59250,
7305
+ "cog-outlined": 59251,
7306
+ "coin-outlined": 59252,
7307
+ "coin-super-outlined": 59253,
7308
+ "comment-outlined": 59254,
7309
+ "contacts-outlined": 59255,
7310
+ "contacts-user-outlined": 59256,
7311
+ "credit-card-outlined": 59257,
7312
+ "cup-outlined": 59258,
7313
+ "dentistry-outlined": 59259,
7314
+ "direction-arrows-outlined": 59260,
7315
+ "directory-outlined": 59261,
7316
+ "document-outlined": 59262,
7317
+ "dollar-box-outlined": 59263,
7318
+ "dollar-card-outlined": 59264,
7319
+ "dollar-coin-shine-outlined": 59265,
7320
+ "dollar-credit-card-outlined": 59266,
7321
+ "dollar-sign": 59267,
7322
+ "double-buildings-outlined": 59268,
7323
+ "double-left-arrows": 59269,
7324
+ "double-right-arrows": 59270,
7325
+ "download-box-outlined": 59271,
7326
+ "download-outlined": 59272,
7327
+ "edit-template-outlined": 59273,
7328
+ "email-outlined": 59274,
7329
+ "end-break-outlined": 59275,
7330
+ "enter-arrow": 59276,
7331
+ "envelope-outlined": 59277,
7332
+ "expense-approval-outlined": 59278,
7333
+ "expense-outlined": 59279,
7334
+ "explore-outlined": 59280,
7335
+ "extension-outlined": 59281,
7336
+ "external-link": 59282,
7337
+ "eye-invisible-outlined": 59283,
7338
+ "eye-outlined": 59284,
7339
+ "face-id": 59285,
7340
+ "face-meh-outlined": 59286,
7341
+ "face-open-smiley-outlined": 59287,
7342
+ "face-sad-outlined": 59288,
7343
+ "face-smiley-outlined": 59289,
7344
+ "fastfood-outlined": 59290,
7345
+ "feed-outlined": 59291,
7346
+ "file-certified-outlined": 59292,
7347
+ "file-clone-outlined": 59293,
7348
+ "file-copy-outlined": 59294,
7349
+ "file-dispose-outlined": 59295,
7350
+ "file-dollar-certified-outlined": 59296,
7351
+ "file-dollar-outlined": 59297,
7352
+ "file-download-outlined": 59298,
7353
+ "file-export-outlined": 59299,
7354
+ "file-lock-outlined": 59300,
7355
+ "file-outlined": 59301,
7356
+ "file-search-outlined": 59302,
7357
+ "file-secured-outlined": 59303,
7358
+ "file-statutory-outlined": 59304,
7359
+ "file-verified-outlined": 59305,
7360
+ "filter-outlined": 59306,
7361
+ "folder-outlined": 59307,
7362
+ "folder-user-outlined": 59308,
7363
+ "form-outlined": 59309,
7364
+ "funnel-filter-outline": 59310,
7365
+ "goal-outlined": 59311,
7366
+ "graph-outlined": 59312,
7367
+ "hand-holding-user-outlined": 59313,
7368
+ "happy-sun-outlined": 59314,
7369
+ "health-bag-outlined": 59315,
7370
+ "heart-outlined": 59316,
7371
+ "home-active-outlined": 59317,
7372
+ "home-outlined": 59318,
7373
+ "id-card-outlined": 59319,
7374
+ "image-outlined": 59320,
7375
+ "import-outlined": 59321,
7376
+ "instapay-outlined": 59322,
7358
7377
  italic: italic,
7359
- "job-search-outlined": 59321,
7360
- "leave-approval-outlined": 59322,
7361
- "link-1": 59323,
7362
- "link-2": 59324,
7363
- "list-outlined": 59325,
7364
- "live-help-outlined": 59326,
7378
+ "job-search-outlined": 59324,
7379
+ "leave-approval-outlined": 59325,
7380
+ "link-1": 59326,
7381
+ "link-2": 59327,
7382
+ "list-outlined": 59328,
7383
+ "live-help-outlined": 59329,
7365
7384
  local_mall_outlined: local_mall_outlined,
7366
- "location-on-outlined": 59328,
7367
- "location-outlined": 59329,
7368
- "lock-outlined": 59330,
7369
- "locked-file-outlined": 59331,
7370
- "log-out": 59332,
7371
- "mail-outlined": 59333,
7372
- "map-outlined": 59334,
7373
- "media-content-outlined": 59335,
7374
- "menu-close": 59336,
7375
- "menu-expand": 59337,
7376
- "menu-fold-outlined": 59338,
7377
- "menu-unfold-outlined": 59339,
7378
- "moneybag-outlined": 59340,
7379
- "moon-outlined": 59341,
7380
- "more-horizontal": 59342,
7381
- "more-vertical": 59343,
7382
- "multiple-folders-outlined": 59344,
7383
- "multiple-users-outlined": 59345,
7384
- "near-me-outlined": 59346,
7385
- "node-outlined": 59347,
7386
- "number-points": 59348,
7385
+ "location-on-outlined": 59331,
7386
+ "location-outlined": 59332,
7387
+ "lock-outlined": 59333,
7388
+ "locked-file-outlined": 59334,
7389
+ "log-out": 59335,
7390
+ "mail-outlined": 59336,
7391
+ "map-outlined": 59337,
7392
+ "media-content-outlined": 59338,
7393
+ "menu-close": 59339,
7394
+ "menu-expand": 59340,
7395
+ "menu-fold-outlined": 59341,
7396
+ "menu-unfold-outlined": 59342,
7397
+ "moneybag-outlined": 59343,
7398
+ "moon-outlined": 59344,
7399
+ "more-horizontal": 59345,
7400
+ "more-vertical": 59346,
7401
+ "multiple-folders-outlined": 59347,
7402
+ "multiple-users-outlined": 59348,
7403
+ "near-me-outlined": 59349,
7404
+ "node-outlined": 59350,
7405
+ "number-points": 59351,
7387
7406
  number: number,
7388
- "overview-outlined": 59350,
7389
- "payment-summary-outlined": 59351,
7390
- "payslip-outlined": 59352,
7391
- "pencil-outlined": 59353,
7407
+ "overview-outlined": 59353,
7408
+ "payment-summary-outlined": 59354,
7409
+ "payslip-outlined": 59355,
7410
+ "pencil-outlined": 59356,
7392
7411
  percentage: percentage,
7393
- "phone-outlined": 59355,
7394
- "piggy-bank-outlined": 59356,
7395
- "plane-outlined": 59357,
7396
- "play-circle-outlined": 59358,
7397
- "print-outlined": 59359,
7398
- "propane-tank-outlined": 59360,
7399
- "qr-code-outlined": 59361,
7400
- "qualification-outlined": 59362,
7401
- "re-assign": 59363,
7412
+ "phone-outlined": 59358,
7413
+ "piggy-bank-outlined": 59359,
7414
+ "plane-outlined": 59360,
7415
+ "play-circle-outlined": 59361,
7416
+ "print-outlined": 59362,
7417
+ "propane-tank-outlined": 59363,
7418
+ "qr-code-outlined": 59364,
7419
+ "qualification-outlined": 59365,
7420
+ "re-assign": 59366,
7402
7421
  redeem: redeem,
7403
7422
  refresh: refresh,
7404
7423
  remove: remove,
7405
- "reply-outlined": 59367,
7424
+ "reply-outlined": 59370,
7406
7425
  restart: restart,
7407
- "resume-outlined": 59369,
7408
- "return-arrow": 59370,
7409
- "rostering-outlined": 59371,
7410
- "safety-outlined": 59372,
7411
- "save-outlined": 59373,
7412
- "schedule-outlined": 59374,
7413
- "search-outlined": 59375,
7414
- "search-secured-outlined": 59376,
7415
- "send-outlined": 59377,
7416
- "share-1": 59378,
7417
- "share-2": 59379,
7418
- "share-outlined-2": 59380,
7419
- "share-outlined": 59381,
7426
+ "resume-outlined": 59372,
7427
+ "return-arrow": 59373,
7428
+ "rostering-outlined": 59374,
7429
+ "safety-outlined": 59375,
7430
+ "save-outlined": 59376,
7431
+ "schedule-outlined": 59377,
7432
+ "search-outlined": 59378,
7433
+ "search-secured-outlined": 59379,
7434
+ "send-outlined": 59380,
7435
+ "share-1": 59381,
7436
+ "share-2": 59382,
7437
+ "share-outlined-2": 59383,
7438
+ "share-outlined": 59384,
7420
7439
  shopping_basket_outlined: shopping_basket_outlined,
7421
- "show-chart-outlined": 59383,
7422
- "single-down-arrow": 59384,
7423
- "single-left-arrow": 59385,
7424
- "single-right-arrow": 59386,
7425
- "single-up-arrow": 59387,
7426
- "smart-match-outlined": 59388,
7427
- "sparkle-outlined": 59389,
7428
- "speaker-active-outlined": 59390,
7429
- "speaker-outlined": 59391,
7430
- "star-circle-outlined": 59392,
7431
- "star-outlined": 59393,
7432
- "stash-outlined": 59394,
7433
- "stopwatch-outlined": 59395,
7440
+ "show-chart-outlined": 59386,
7441
+ "single-down-arrow": 59387,
7442
+ "single-left-arrow": 59388,
7443
+ "single-right-arrow": 59389,
7444
+ "single-up-arrow": 59390,
7445
+ "smart-match-outlined": 59391,
7446
+ "sparkle-outlined": 59392,
7447
+ "speaker-active-outlined": 59393,
7448
+ "speaker-outlined": 59394,
7449
+ "star-circle-outlined": 59395,
7450
+ "star-outlined": 59396,
7451
+ "start-break-outlined": 59397,
7452
+ "stash-outlined": 59398,
7453
+ "stopwatch-outlined": 59399,
7434
7454
  strikethrough: strikethrough,
7435
- "styler-outlined": 59397,
7436
- "suitcase-clock-outlined": 59398,
7437
- "suitcase-outlined": 59399,
7438
- "survey-outlined": 59400,
7439
- "switch-outlined": 59401,
7455
+ "styler-outlined": 59401,
7456
+ "suitcase-clock-outlined": 59402,
7457
+ "suitcase-outlined": 59403,
7458
+ "survey-outlined": 59404,
7459
+ "switch-outlined": 59405,
7440
7460
  sync: sync,
7441
- "tag-outlined": 59403,
7442
- "target-outlined": 59404,
7443
- "tennis-outlined": 59405,
7444
- "ticket-outlined": 59406,
7445
- "timesheet-outlined": 59407,
7446
- "timesheets-outlined": 59408,
7447
- "today-outlined": 59409,
7461
+ "tag-outlined": 59407,
7462
+ "target-outlined": 59408,
7463
+ "tennis-outlined": 59409,
7464
+ "ticket-outlined": 59410,
7465
+ "timesheet-outlined": 59411,
7466
+ "timesheets-outlined": 59412,
7467
+ "today-outlined": 59413,
7448
7468
  transfer: transfer,
7449
- "trash-bin-outlined": 59411,
7450
- "umbrela-outlined": 59412,
7451
- "unavailability-outlined": 59413,
7469
+ "trash-bin-outlined": 59415,
7470
+ "umbrela-outlined": 59416,
7471
+ "unavailability-outlined": 59417,
7452
7472
  unavailable: unavailable,
7453
7473
  underline: underline,
7454
- "union-outlined": 59416,
7455
- "unlock-outlined": 59417,
7456
- "upload-outlined": 59418,
7457
- "user-circle-outlined": 59419,
7458
- "user-gear-outlined": 59420,
7459
- "user-outlined": 59421,
7460
- "user-rectangle-outlined": 59422,
7461
- "video-1-outlined": 59423,
7462
- "video-2-outlined": 59424,
7463
- "volunteer-outlined": 59425,
7464
- "wallet-outlined": 59426,
7465
- "wellness-outlined": 59427
7474
+ "union-outlined": 59420,
7475
+ "unlock-outlined": 59421,
7476
+ "upload-outlined": 59422,
7477
+ "user-circle-outlined": 59423,
7478
+ "user-gear-outlined": 59424,
7479
+ "user-outlined": 59425,
7480
+ "user-rectangle-outlined": 59426,
7481
+ "video-1-outlined": 59427,
7482
+ "video-2-outlined": 59428,
7483
+ "volunteer-outlined": 59429,
7484
+ "wallet-outlined": 59430,
7485
+ "wellness-outlined": 59431
7466
7486
  };
7467
7487
 
7468
7488
  var HeroIcon = reactNativeVectorIcons.createIconSet(glyphMap, 'hero-icons-mobile', 'hero-icons-mobile.ttf');
@@ -7710,7 +7730,8 @@ var Alert = function Alert(_ref2) {
7710
7730
  _ref2$variant = _ref2.variant,
7711
7731
  variant = _ref2$variant === void 0 ? 'rounded' : _ref2$variant,
7712
7732
  style = _ref2.style,
7713
- testID = _ref2.testID;
7733
+ testID = _ref2.testID,
7734
+ actionLabel = _ref2.actionLabel;
7714
7735
  useDeprecation("Alert's notification intent is deprecated and will be removed in the next major release. Please use other intents instead.", intent === 'notification');
7715
7736
  return /*#__PURE__*/React__default["default"].createElement(Container$1, {
7716
7737
  themeVariant: variant,
@@ -7728,7 +7749,9 @@ var Alert = function Alert(_ref2) {
7728
7749
  }, content) : content)), onClose ? /*#__PURE__*/React__default["default"].createElement(CTAWrapper$1, {
7729
7750
  onPress: onClose,
7730
7751
  testID: "alert-close-icon"
7731
- }, /*#__PURE__*/React__default["default"].createElement(Icon, {
7752
+ }, typeof actionLabel === 'string' ? /*#__PURE__*/React__default["default"].createElement(Typography.Body, {
7753
+ variant: "small-bold"
7754
+ }, actionLabel) : /*#__PURE__*/React__default["default"].createElement(Icon, {
7732
7755
  icon: "cancel",
7733
7756
  size: "small"
7734
7757
  })) : null);
@@ -9321,12 +9344,59 @@ var BottomSheet$1 = Object.assign(BottomSheet, {
9321
9344
  ScrollView: BottomSheetScrollView
9322
9345
  });
9323
9346
 
9347
+ function _typeof(o) {
9348
+ "@babel/helpers - typeof";
9349
+
9350
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
9351
+ return typeof o;
9352
+ } : function (o) {
9353
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
9354
+ }, _typeof(o);
9355
+ }
9356
+
9324
9357
  function requiredArgs(required, args) {
9325
9358
  if (args.length < required) {
9326
9359
  throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
9327
9360
  }
9328
9361
  }
9329
9362
 
9363
+ /**
9364
+ * @name isDate
9365
+ * @category Common Helpers
9366
+ * @summary Is the given value a date?
9367
+ *
9368
+ * @description
9369
+ * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
9370
+ *
9371
+ * @param {*} value - the value to check
9372
+ * @returns {boolean} true if the given value is a date
9373
+ * @throws {TypeError} 1 arguments required
9374
+ *
9375
+ * @example
9376
+ * // For a valid date:
9377
+ * const result = isDate(new Date())
9378
+ * //=> true
9379
+ *
9380
+ * @example
9381
+ * // For an invalid date:
9382
+ * const result = isDate(new Date(NaN))
9383
+ * //=> true
9384
+ *
9385
+ * @example
9386
+ * // For some value:
9387
+ * const result = isDate('2014-02-31')
9388
+ * //=> false
9389
+ *
9390
+ * @example
9391
+ * // For an object:
9392
+ * const result = isDate({})
9393
+ * //=> false
9394
+ */
9395
+ function isDate(value) {
9396
+ requiredArgs(1, arguments);
9397
+ return value instanceof Date || _typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]';
9398
+ }
9399
+
9330
9400
  /**
9331
9401
  * @name toDate
9332
9402
  * @category Common Helpers
@@ -9357,11 +9427,11 @@ function requiredArgs(required, args) {
9357
9427
  * const result = toDate(1392098430000)
9358
9428
  * //=> Tue Feb 11 2014 11:30:30
9359
9429
  */
9360
-
9361
9430
  function toDate(argument) {
9362
9431
  requiredArgs(1, arguments);
9363
- var argStr = Object.prototype.toString.call(argument); // Clone the date
9432
+ var argStr = Object.prototype.toString.call(argument);
9364
9433
 
9434
+ // Clone the date
9365
9435
  if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
9366
9436
  // Prevent the date to lose the milliseconds when passed to new Date() in IE10
9367
9437
  return new Date(argument.getTime());
@@ -9370,8 +9440,8 @@ function toDate(argument) {
9370
9440
  } else {
9371
9441
  if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
9372
9442
  // eslint-disable-next-line no-console
9373
- console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"); // eslint-disable-next-line no-console
9374
-
9443
+ 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");
9444
+ // eslint-disable-next-line no-console
9375
9445
  console.warn(new Error().stack);
9376
9446
  }
9377
9447
  return new Date(NaN);
@@ -9390,616 +9460,235 @@ function toDate(argument) {
9390
9460
  *
9391
9461
  * Time value of Date: http://es5.github.io/#x15.9.1.1
9392
9462
  *
9393
- * ### v2.0.0 breaking changes:
9394
- *
9395
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
9396
- *
9397
- * - Now `isValid` doesn't throw an exception
9398
- * if the first argument is not an instance of Date.
9399
- * Instead, argument is converted beforehand using `toDate`.
9400
- *
9401
- * Examples:
9402
- *
9403
- * | `isValid` argument | Before v2.0.0 | v2.0.0 onward |
9404
- * |---------------------------|---------------|---------------|
9405
- * | `new Date()` | `true` | `true` |
9406
- * | `new Date('2016-01-01')` | `true` | `true` |
9407
- * | `new Date('')` | `false` | `false` |
9408
- * | `new Date(1488370835081)` | `true` | `true` |
9409
- * | `new Date(NaN)` | `false` | `false` |
9410
- * | `'2016-01-01'` | `TypeError` | `false` |
9411
- * | `''` | `TypeError` | `false` |
9412
- * | `1488370835081` | `TypeError` | `true` |
9413
- * | `NaN` | `TypeError` | `false` |
9414
- *
9415
- * We introduce this change to make *date-fns* consistent with ECMAScript behavior
9416
- * that try to coerce arguments to the expected type
9417
- * (which is also the case with other *date-fns* functions).
9418
- *
9419
9463
  * @param {*} date - the date to check
9420
9464
  * @returns {Boolean} the date is valid
9421
9465
  * @throws {TypeError} 1 argument required
9422
9466
  *
9423
9467
  * @example
9424
9468
  * // For the valid date:
9425
- * var result = isValid(new Date(2014, 1, 31))
9469
+ * const result = isValid(new Date(2014, 1, 31))
9426
9470
  * //=> true
9427
9471
  *
9428
9472
  * @example
9429
9473
  * // For the value, convertable into a date:
9430
- * var result = isValid(1393804800000)
9474
+ * const result = isValid(1393804800000)
9431
9475
  * //=> true
9432
9476
  *
9433
9477
  * @example
9434
9478
  * // For the invalid date:
9435
- * var result = isValid(new Date(''))
9479
+ * const result = isValid(new Date(''))
9436
9480
  * //=> false
9437
9481
  */
9438
-
9439
9482
  function isValid(dirtyDate) {
9440
9483
  requiredArgs(1, arguments);
9484
+ if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
9485
+ return false;
9486
+ }
9441
9487
  var date = toDate(dirtyDate);
9442
- return !isNaN(date);
9488
+ return !isNaN(Number(date));
9443
9489
  }
9444
9490
 
9445
- var formatDistanceLocale = {
9446
- lessThanXSeconds: {
9447
- one: 'less than a second',
9448
- other: 'less than {{count}} seconds'
9449
- },
9450
- xSeconds: {
9451
- one: '1 second',
9452
- other: '{{count}} seconds'
9453
- },
9454
- halfAMinute: 'half a minute',
9455
- lessThanXMinutes: {
9456
- one: 'less than a minute',
9457
- other: 'less than {{count}} minutes'
9458
- },
9459
- xMinutes: {
9460
- one: '1 minute',
9461
- other: '{{count}} minutes'
9462
- },
9463
- aboutXHours: {
9464
- one: 'about 1 hour',
9465
- other: 'about {{count}} hours'
9466
- },
9467
- xHours: {
9468
- one: '1 hour',
9469
- other: '{{count}} hours'
9470
- },
9471
- xDays: {
9472
- one: '1 day',
9473
- other: '{{count}} days'
9474
- },
9475
- aboutXWeeks: {
9476
- one: 'about 1 week',
9477
- other: 'about {{count}} weeks'
9478
- },
9479
- xWeeks: {
9480
- one: '1 week',
9481
- other: '{{count}} weeks'
9482
- },
9483
- aboutXMonths: {
9484
- one: 'about 1 month',
9485
- other: 'about {{count}} months'
9486
- },
9487
- xMonths: {
9488
- one: '1 month',
9489
- other: '{{count}} months'
9490
- },
9491
- aboutXYears: {
9492
- one: 'about 1 year',
9493
- other: 'about {{count}} years'
9494
- },
9495
- xYears: {
9496
- one: '1 year',
9497
- other: '{{count}} years'
9498
- },
9499
- overXYears: {
9500
- one: 'over 1 year',
9501
- other: 'over {{count}} years'
9502
- },
9503
- almostXYears: {
9504
- one: 'almost 1 year',
9505
- other: 'almost {{count}} years'
9506
- }
9507
- };
9508
- function formatDistance(token, count, options) {
9509
- options = options || {};
9510
- var result;
9511
- if (typeof formatDistanceLocale[token] === 'string') {
9512
- result = formatDistanceLocale[token];
9513
- } else if (count === 1) {
9514
- result = formatDistanceLocale[token].one;
9515
- } else {
9516
- result = formatDistanceLocale[token].other.replace('{{count}}', count);
9491
+ function toInteger(dirtyNumber) {
9492
+ if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
9493
+ return NaN;
9517
9494
  }
9518
- if (options.addSuffix) {
9519
- if (options.comparison > 0) {
9520
- return 'in ' + result;
9521
- } else {
9522
- return result + ' ago';
9523
- }
9495
+ var number = Number(dirtyNumber);
9496
+ if (isNaN(number)) {
9497
+ return number;
9524
9498
  }
9525
- return result;
9499
+ return number < 0 ? Math.ceil(number) : Math.floor(number);
9526
9500
  }
9527
9501
 
9528
- function buildFormatLongFn(args) {
9529
- return function (dirtyOptions) {
9530
- var options = dirtyOptions || {};
9531
- var width = options.width ? String(options.width) : args.defaultWidth;
9532
- var format = args.formats[width] || args.formats[args.defaultWidth];
9533
- return format;
9534
- };
9502
+ /**
9503
+ * @name addMilliseconds
9504
+ * @category Millisecond Helpers
9505
+ * @summary Add the specified number of milliseconds to the given date.
9506
+ *
9507
+ * @description
9508
+ * Add the specified number of milliseconds to the given date.
9509
+ *
9510
+ * @param {Date|Number} date - the date to be changed
9511
+ * @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`.
9512
+ * @returns {Date} the new date with the milliseconds added
9513
+ * @throws {TypeError} 2 arguments required
9514
+ *
9515
+ * @example
9516
+ * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
9517
+ * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
9518
+ * //=> Thu Jul 10 2014 12:45:30.750
9519
+ */
9520
+ function addMilliseconds(dirtyDate, dirtyAmount) {
9521
+ requiredArgs(2, arguments);
9522
+ var timestamp = toDate(dirtyDate).getTime();
9523
+ var amount = toInteger(dirtyAmount);
9524
+ return new Date(timestamp + amount);
9535
9525
  }
9536
9526
 
9537
- var dateFormats = {
9538
- full: 'EEEE, MMMM do, y',
9539
- "long": 'MMMM do, y',
9540
- medium: 'MMM d, y',
9541
- "short": 'MM/dd/yyyy'
9542
- };
9543
- var timeFormats = {
9544
- full: 'h:mm:ss a zzzz',
9545
- "long": 'h:mm:ss a z',
9546
- medium: 'h:mm:ss a',
9547
- "short": 'h:mm a'
9548
- };
9549
- var dateTimeFormats = {
9550
- full: "{{date}} 'at' {{time}}",
9551
- "long": "{{date}} 'at' {{time}}",
9552
- medium: '{{date}}, {{time}}',
9553
- "short": '{{date}}, {{time}}'
9554
- };
9555
- var formatLong = {
9556
- date: buildFormatLongFn({
9557
- formats: dateFormats,
9558
- defaultWidth: 'full'
9559
- }),
9560
- time: buildFormatLongFn({
9561
- formats: timeFormats,
9562
- defaultWidth: 'full'
9563
- }),
9564
- dateTime: buildFormatLongFn({
9565
- formats: dateTimeFormats,
9566
- defaultWidth: 'full'
9567
- })
9568
- };
9569
- var formatLong$1 = formatLong;
9527
+ /**
9528
+ * @name subMilliseconds
9529
+ * @category Millisecond Helpers
9530
+ * @summary Subtract the specified number of milliseconds from the given date.
9531
+ *
9532
+ * @description
9533
+ * Subtract the specified number of milliseconds from the given date.
9534
+ *
9535
+ * @param {Date|Number} date - the date to be changed
9536
+ * @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`.
9537
+ * @returns {Date} the new date with the milliseconds subtracted
9538
+ * @throws {TypeError} 2 arguments required
9539
+ *
9540
+ * @example
9541
+ * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
9542
+ * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
9543
+ * //=> Thu Jul 10 2014 12:45:29.250
9544
+ */
9545
+ function subMilliseconds(dirtyDate, dirtyAmount) {
9546
+ requiredArgs(2, arguments);
9547
+ var amount = toInteger(dirtyAmount);
9548
+ return addMilliseconds(dirtyDate, -amount);
9549
+ }
9570
9550
 
9571
- var formatRelativeLocale = {
9572
- lastWeek: "'last' eeee 'at' p",
9573
- yesterday: "'yesterday at' p",
9574
- today: "'today at' p",
9575
- tomorrow: "'tomorrow at' p",
9576
- nextWeek: "eeee 'at' p",
9577
- other: 'P'
9578
- };
9579
- function formatRelative(token, _date, _baseDate, _options) {
9580
- return formatRelativeLocale[token];
9551
+ var MILLISECONDS_IN_DAY = 86400000;
9552
+ function getUTCDayOfYear(dirtyDate) {
9553
+ requiredArgs(1, arguments);
9554
+ var date = toDate(dirtyDate);
9555
+ var timestamp = date.getTime();
9556
+ date.setUTCMonth(0, 1);
9557
+ date.setUTCHours(0, 0, 0, 0);
9558
+ var startOfYearTimestamp = date.getTime();
9559
+ var difference = timestamp - startOfYearTimestamp;
9560
+ return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
9581
9561
  }
9582
9562
 
9583
- function buildLocalizeFn(args) {
9584
- return function (dirtyIndex, dirtyOptions) {
9585
- var options = dirtyOptions || {};
9586
- var context = options.context ? String(options.context) : 'standalone';
9587
- var valuesArray;
9588
- if (context === 'formatting' && args.formattingValues) {
9589
- var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
9590
- var width = options.width ? String(options.width) : defaultWidth;
9591
- valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
9592
- } else {
9593
- var _defaultWidth = args.defaultWidth;
9594
- var _width = options.width ? String(options.width) : args.defaultWidth;
9595
- valuesArray = args.values[_width] || args.values[_defaultWidth];
9596
- }
9597
- var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
9598
- return valuesArray[index];
9599
- };
9563
+ function startOfUTCISOWeek(dirtyDate) {
9564
+ requiredArgs(1, arguments);
9565
+ var weekStartsOn = 1;
9566
+ var date = toDate(dirtyDate);
9567
+ var day = date.getUTCDay();
9568
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
9569
+ date.setUTCDate(date.getUTCDate() - diff);
9570
+ date.setUTCHours(0, 0, 0, 0);
9571
+ return date;
9600
9572
  }
9601
9573
 
9602
- var eraValues = {
9603
- narrow: ['B', 'A'],
9604
- abbreviated: ['BC', 'AD'],
9605
- wide: ['Before Christ', 'Anno Domini']
9606
- };
9607
- var quarterValues = {
9608
- narrow: ['1', '2', '3', '4'],
9609
- abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
9610
- wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter'] // Note: in English, the names of days of the week and months are capitalized.
9611
- // If you are making a new locale based on this one, check if the same is true for the language you're working on.
9612
- // Generally, formatted dates should look like they are in the middle of a sentence,
9613
- // e.g. in Spanish language the weekdays and months should be in the lowercase.
9614
- };
9615
-
9616
- var monthValues = {
9617
- narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
9618
- abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
9619
- wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
9620
- };
9621
- var dayValues = {
9622
- narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
9623
- "short": ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
9624
- abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
9625
- wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
9626
- };
9627
- var dayPeriodValues = {
9628
- narrow: {
9629
- am: 'a',
9630
- pm: 'p',
9631
- midnight: 'mi',
9632
- noon: 'n',
9633
- morning: 'morning',
9634
- afternoon: 'afternoon',
9635
- evening: 'evening',
9636
- night: 'night'
9637
- },
9638
- abbreviated: {
9639
- am: 'AM',
9640
- pm: 'PM',
9641
- midnight: 'midnight',
9642
- noon: 'noon',
9643
- morning: 'morning',
9644
- afternoon: 'afternoon',
9645
- evening: 'evening',
9646
- night: 'night'
9647
- },
9648
- wide: {
9649
- am: 'a.m.',
9650
- pm: 'p.m.',
9651
- midnight: 'midnight',
9652
- noon: 'noon',
9653
- morning: 'morning',
9654
- afternoon: 'afternoon',
9655
- evening: 'evening',
9656
- night: 'night'
9657
- }
9658
- };
9659
- var formattingDayPeriodValues = {
9660
- narrow: {
9661
- am: 'a',
9662
- pm: 'p',
9663
- midnight: 'mi',
9664
- noon: 'n',
9665
- morning: 'in the morning',
9666
- afternoon: 'in the afternoon',
9667
- evening: 'in the evening',
9668
- night: 'at night'
9669
- },
9670
- abbreviated: {
9671
- am: 'AM',
9672
- pm: 'PM',
9673
- midnight: 'midnight',
9674
- noon: 'noon',
9675
- morning: 'in the morning',
9676
- afternoon: 'in the afternoon',
9677
- evening: 'in the evening',
9678
- night: 'at night'
9679
- },
9680
- wide: {
9681
- am: 'a.m.',
9682
- pm: 'p.m.',
9683
- midnight: 'midnight',
9684
- noon: 'noon',
9685
- morning: 'in the morning',
9686
- afternoon: 'in the afternoon',
9687
- evening: 'in the evening',
9688
- night: 'at night'
9574
+ function getUTCISOWeekYear(dirtyDate) {
9575
+ requiredArgs(1, arguments);
9576
+ var date = toDate(dirtyDate);
9577
+ var year = date.getUTCFullYear();
9578
+ var fourthOfJanuaryOfNextYear = new Date(0);
9579
+ fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
9580
+ fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
9581
+ var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
9582
+ var fourthOfJanuaryOfThisYear = new Date(0);
9583
+ fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
9584
+ fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
9585
+ var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
9586
+ if (date.getTime() >= startOfNextYear.getTime()) {
9587
+ return year + 1;
9588
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
9589
+ return year;
9590
+ } else {
9591
+ return year - 1;
9689
9592
  }
9690
- };
9691
- function ordinalNumber(dirtyNumber, _dirtyOptions) {
9692
- var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,
9693
- // if they are different for different grammatical genders,
9694
- // use `options.unit`:
9695
- //
9696
- // var options = dirtyOptions || {}
9697
- // var unit = String(options.unit)
9698
- //
9699
- // where `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
9700
- // 'day', 'hour', 'minute', 'second'
9593
+ }
9701
9594
 
9702
- var rem100 = number % 100;
9703
- if (rem100 > 20 || rem100 < 10) {
9704
- switch (rem100 % 10) {
9705
- case 1:
9706
- return number + 'st';
9707
- case 2:
9708
- return number + 'nd';
9709
- case 3:
9710
- return number + 'rd';
9711
- }
9712
- }
9713
- return number + 'th';
9595
+ function startOfUTCISOWeekYear(dirtyDate) {
9596
+ requiredArgs(1, arguments);
9597
+ var year = getUTCISOWeekYear(dirtyDate);
9598
+ var fourthOfJanuary = new Date(0);
9599
+ fourthOfJanuary.setUTCFullYear(year, 0, 4);
9600
+ fourthOfJanuary.setUTCHours(0, 0, 0, 0);
9601
+ var date = startOfUTCISOWeek(fourthOfJanuary);
9602
+ return date;
9714
9603
  }
9715
- var localize = {
9716
- ordinalNumber: ordinalNumber,
9717
- era: buildLocalizeFn({
9718
- values: eraValues,
9719
- defaultWidth: 'wide'
9720
- }),
9721
- quarter: buildLocalizeFn({
9722
- values: quarterValues,
9723
- defaultWidth: 'wide',
9724
- argumentCallback: function argumentCallback(quarter) {
9725
- return Number(quarter) - 1;
9726
- }
9727
- }),
9728
- month: buildLocalizeFn({
9729
- values: monthValues,
9730
- defaultWidth: 'wide'
9731
- }),
9732
- day: buildLocalizeFn({
9733
- values: dayValues,
9734
- defaultWidth: 'wide'
9735
- }),
9736
- dayPeriod: buildLocalizeFn({
9737
- values: dayPeriodValues,
9738
- defaultWidth: 'wide',
9739
- formattingValues: formattingDayPeriodValues,
9740
- defaultFormattingWidth: 'wide'
9741
- })
9742
- };
9743
- var localize$1 = localize;
9744
9604
 
9745
- function buildMatchPatternFn(args) {
9746
- return function (dirtyString, dirtyOptions) {
9747
- var string = String(dirtyString);
9748
- var options = dirtyOptions || {};
9749
- var matchResult = string.match(args.matchPattern);
9750
- if (!matchResult) {
9751
- return null;
9752
- }
9753
- var matchedString = matchResult[0];
9754
- var parseResult = string.match(args.parsePattern);
9755
- if (!parseResult) {
9756
- return null;
9757
- }
9758
- var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
9759
- value = options.valueCallback ? options.valueCallback(value) : value;
9760
- return {
9761
- value: value,
9762
- rest: string.slice(matchedString.length)
9763
- };
9764
- };
9605
+ var MILLISECONDS_IN_WEEK$1 = 604800000;
9606
+ function getUTCISOWeek(dirtyDate) {
9607
+ requiredArgs(1, arguments);
9608
+ var date = toDate(dirtyDate);
9609
+ var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime();
9610
+
9611
+ // Round the number of days to the nearest integer
9612
+ // because the number of milliseconds in a week is not constant
9613
+ // (e.g. it's different in the week of the daylight saving time clock shift)
9614
+ return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
9765
9615
  }
9766
9616
 
9767
- function buildMatchFn(args) {
9768
- return function (dirtyString, dirtyOptions) {
9769
- var string = String(dirtyString);
9770
- var options = dirtyOptions || {};
9771
- var width = options.width;
9772
- var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
9773
- var matchResult = string.match(matchPattern);
9774
- if (!matchResult) {
9775
- return null;
9776
- }
9777
- var matchedString = matchResult[0];
9778
- var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
9779
- var value;
9780
- if (Object.prototype.toString.call(parsePatterns) === '[object Array]') {
9781
- value = findIndex(parsePatterns, function (pattern) {
9782
- return pattern.test(matchedString);
9783
- });
9784
- } else {
9785
- value = findKey(parsePatterns, function (pattern) {
9786
- return pattern.test(matchedString);
9787
- });
9788
- }
9789
- value = args.valueCallback ? args.valueCallback(value) : value;
9790
- value = options.valueCallback ? options.valueCallback(value) : value;
9791
- return {
9792
- value: value,
9793
- rest: string.slice(matchedString.length)
9794
- };
9795
- };
9617
+ var defaultOptions = {};
9618
+ function getDefaultOptions() {
9619
+ return defaultOptions;
9796
9620
  }
9797
- function findKey(object, predicate) {
9798
- for (var key in object) {
9799
- if (object.hasOwnProperty(key) && predicate(object[key])) {
9800
- return key;
9801
- }
9621
+
9622
+ function startOfUTCWeek(dirtyDate, options) {
9623
+ var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
9624
+ requiredArgs(1, arguments);
9625
+ var defaultOptions = getDefaultOptions();
9626
+ 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);
9627
+
9628
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
9629
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
9630
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
9802
9631
  }
9632
+ var date = toDate(dirtyDate);
9633
+ var day = date.getUTCDay();
9634
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
9635
+ date.setUTCDate(date.getUTCDate() - diff);
9636
+ date.setUTCHours(0, 0, 0, 0);
9637
+ return date;
9803
9638
  }
9804
- function findIndex(array, predicate) {
9805
- for (var key = 0; key < array.length; key++) {
9806
- if (predicate(array[key])) {
9807
- return key;
9808
- }
9639
+
9640
+ function getUTCWeekYear(dirtyDate, options) {
9641
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
9642
+ requiredArgs(1, arguments);
9643
+ var date = toDate(dirtyDate);
9644
+ var year = date.getUTCFullYear();
9645
+ var defaultOptions = getDefaultOptions();
9646
+ 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);
9647
+
9648
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
9649
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
9650
+ throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
9651
+ }
9652
+ var firstWeekOfNextYear = new Date(0);
9653
+ firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
9654
+ firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
9655
+ var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, options);
9656
+ var firstWeekOfThisYear = new Date(0);
9657
+ firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
9658
+ firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
9659
+ var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);
9660
+ if (date.getTime() >= startOfNextYear.getTime()) {
9661
+ return year + 1;
9662
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
9663
+ return year;
9664
+ } else {
9665
+ return year - 1;
9809
9666
  }
9810
9667
  }
9811
9668
 
9812
- var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
9813
- var parseOrdinalNumberPattern = /\d+/i;
9814
- var matchEraPatterns = {
9815
- narrow: /^(b|a)/i,
9816
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
9817
- wide: /^(before christ|before common era|anno domini|common era)/i
9818
- };
9819
- var parseEraPatterns = {
9820
- any: [/^b/i, /^(a|c)/i]
9821
- };
9822
- var matchQuarterPatterns = {
9823
- narrow: /^[1234]/i,
9824
- abbreviated: /^q[1234]/i,
9825
- wide: /^[1234](th|st|nd|rd)? quarter/i
9826
- };
9827
- var parseQuarterPatterns = {
9828
- any: [/1/i, /2/i, /3/i, /4/i]
9829
- };
9830
- var matchMonthPatterns = {
9831
- narrow: /^[jfmasond]/i,
9832
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
9833
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
9834
- };
9835
- var parseMonthPatterns = {
9836
- 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],
9837
- 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]
9838
- };
9839
- var matchDayPatterns = {
9840
- narrow: /^[smtwf]/i,
9841
- "short": /^(su|mo|tu|we|th|fr|sa)/i,
9842
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
9843
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
9844
- };
9845
- var parseDayPatterns = {
9846
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
9847
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
9848
- };
9849
- var matchDayPeriodPatterns = {
9850
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
9851
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
9852
- };
9853
- var parseDayPeriodPatterns = {
9854
- any: {
9855
- am: /^a/i,
9856
- pm: /^p/i,
9857
- midnight: /^mi/i,
9858
- noon: /^no/i,
9859
- morning: /morning/i,
9860
- afternoon: /afternoon/i,
9861
- evening: /evening/i,
9862
- night: /night/i
9863
- }
9864
- };
9865
- var match = {
9866
- ordinalNumber: buildMatchPatternFn({
9867
- matchPattern: matchOrdinalNumberPattern,
9868
- parsePattern: parseOrdinalNumberPattern,
9869
- valueCallback: function valueCallback(value) {
9870
- return parseInt(value, 10);
9871
- }
9872
- }),
9873
- era: buildMatchFn({
9874
- matchPatterns: matchEraPatterns,
9875
- defaultMatchWidth: 'wide',
9876
- parsePatterns: parseEraPatterns,
9877
- defaultParseWidth: 'any'
9878
- }),
9879
- quarter: buildMatchFn({
9880
- matchPatterns: matchQuarterPatterns,
9881
- defaultMatchWidth: 'wide',
9882
- parsePatterns: parseQuarterPatterns,
9883
- defaultParseWidth: 'any',
9884
- valueCallback: function valueCallback(index) {
9885
- return index + 1;
9886
- }
9887
- }),
9888
- month: buildMatchFn({
9889
- matchPatterns: matchMonthPatterns,
9890
- defaultMatchWidth: 'wide',
9891
- parsePatterns: parseMonthPatterns,
9892
- defaultParseWidth: 'any'
9893
- }),
9894
- day: buildMatchFn({
9895
- matchPatterns: matchDayPatterns,
9896
- defaultMatchWidth: 'wide',
9897
- parsePatterns: parseDayPatterns,
9898
- defaultParseWidth: 'any'
9899
- }),
9900
- dayPeriod: buildMatchFn({
9901
- matchPatterns: matchDayPeriodPatterns,
9902
- defaultMatchWidth: 'any',
9903
- parsePatterns: parseDayPeriodPatterns,
9904
- defaultParseWidth: 'any'
9905
- })
9906
- };
9907
- var match$1 = match;
9908
-
9909
- /**
9910
- * @type {Locale}
9911
- * @category Locales
9912
- * @summary English locale (United States).
9913
- * @language English
9914
- * @iso-639-2 eng
9915
- * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
9916
- * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
9917
- */
9918
-
9919
- var locale = {
9920
- code: 'en-US',
9921
- formatDistance: formatDistance,
9922
- formatLong: formatLong$1,
9923
- formatRelative: formatRelative,
9924
- localize: localize$1,
9925
- match: match$1,
9926
- options: {
9927
- weekStartsOn: 0
9928
- /* Sunday */,
9929
-
9930
- firstWeekContainsDate: 1
9931
- }
9932
- };
9933
- var defaultLocale = locale;
9934
-
9935
- function toInteger(dirtyNumber) {
9936
- if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
9937
- return NaN;
9938
- }
9939
- var number = Number(dirtyNumber);
9940
- if (isNaN(number)) {
9941
- return number;
9942
- }
9943
- return number < 0 ? Math.ceil(number) : Math.floor(number);
9944
- }
9945
-
9946
- /**
9947
- * @name addMilliseconds
9948
- * @category Millisecond Helpers
9949
- * @summary Add the specified number of milliseconds to the given date.
9950
- *
9951
- * @description
9952
- * Add the specified number of milliseconds to the given date.
9953
- *
9954
- * ### v2.0.0 breaking changes:
9955
- *
9956
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
9957
- *
9958
- * @param {Date|Number} date - the date to be changed
9959
- * @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`.
9960
- * @returns {Date} the new date with the milliseconds added
9961
- * @throws {TypeError} 2 arguments required
9962
- *
9963
- * @example
9964
- * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
9965
- * var result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
9966
- * //=> Thu Jul 10 2014 12:45:30.750
9967
- */
9968
-
9969
- function addMilliseconds(dirtyDate, dirtyAmount) {
9970
- requiredArgs(2, arguments);
9971
- var timestamp = toDate(dirtyDate).getTime();
9972
- var amount = toInteger(dirtyAmount);
9973
- return new Date(timestamp + amount);
9669
+ function startOfUTCWeekYear(dirtyDate, options) {
9670
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
9671
+ requiredArgs(1, arguments);
9672
+ var defaultOptions = getDefaultOptions();
9673
+ 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);
9674
+ var year = getUTCWeekYear(dirtyDate, options);
9675
+ var firstWeek = new Date(0);
9676
+ firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
9677
+ firstWeek.setUTCHours(0, 0, 0, 0);
9678
+ var date = startOfUTCWeek(firstWeek, options);
9679
+ return date;
9974
9680
  }
9975
9681
 
9976
- /**
9977
- * @name subMilliseconds
9978
- * @category Millisecond Helpers
9979
- * @summary Subtract the specified number of milliseconds from the given date.
9980
- *
9981
- * @description
9982
- * Subtract the specified number of milliseconds from the given date.
9983
- *
9984
- * ### v2.0.0 breaking changes:
9985
- *
9986
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
9987
- *
9988
- * @param {Date|Number} date - the date to be changed
9989
- * @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`.
9990
- * @returns {Date} the new date with the milliseconds subtracted
9991
- * @throws {TypeError} 2 arguments required
9992
- *
9993
- * @example
9994
- * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
9995
- * var result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
9996
- * //=> Thu Jul 10 2014 12:45:29.250
9997
- */
9682
+ var MILLISECONDS_IN_WEEK = 604800000;
9683
+ function getUTCWeek(dirtyDate, options) {
9684
+ requiredArgs(1, arguments);
9685
+ var date = toDate(dirtyDate);
9686
+ var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime();
9998
9687
 
9999
- function subMilliseconds(dirtyDate, dirtyAmount) {
10000
- requiredArgs(2, arguments);
10001
- var amount = toInteger(dirtyAmount);
10002
- return addMilliseconds(dirtyDate, -amount);
9688
+ // Round the number of days to the nearest integer
9689
+ // because the number of milliseconds in a week is not constant
9690
+ // (e.g. it's different in the week of the daylight saving time clock shift)
9691
+ return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
10003
9692
  }
10004
9693
 
10005
9694
  function addLeadingZeros(number, targetLength) {
@@ -10023,7 +9712,6 @@ function addLeadingZeros(number, targetLength) {
10023
9712
  *
10024
9713
  * Letters marked by * are not implemented but reserved by Unicode standard.
10025
9714
  */
10026
-
10027
9715
  var formatters$2 = {
10028
9716
  // Year
10029
9717
  y: function y(date, token) {
@@ -10035,8 +9723,9 @@ var formatters$2 = {
10035
9723
  // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
10036
9724
  // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
10037
9725
  // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
10038
- var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
10039
9726
 
9727
+ var signedYear = date.getUTCFullYear();
9728
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
10040
9729
  var year = signedYear > 0 ? signedYear : 1 - signedYear;
10041
9730
  return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
10042
9731
  },
@@ -10055,8 +9744,9 @@ var formatters$2 = {
10055
9744
  switch (token) {
10056
9745
  case 'a':
10057
9746
  case 'aa':
10058
- case 'aaa':
10059
9747
  return dayPeriodEnumValue.toUpperCase();
9748
+ case 'aaa':
9749
+ return dayPeriodEnumValue;
10060
9750
  case 'aaaaa':
10061
9751
  return dayPeriodEnumValue[0];
10062
9752
  case 'aaaa':
@@ -10090,283 +9780,127 @@ var formatters$2 = {
10090
9780
  };
10091
9781
  var lightFormatters = formatters$2;
10092
9782
 
10093
- var MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.
10094
- // See issue: https://github.com/date-fns/date-fns/issues/376
10095
-
10096
- function getUTCDayOfYear(dirtyDate) {
10097
- requiredArgs(1, arguments);
10098
- var date = toDate(dirtyDate);
10099
- var timestamp = date.getTime();
10100
- date.setUTCMonth(0, 1);
10101
- date.setUTCHours(0, 0, 0, 0);
10102
- var startOfYearTimestamp = date.getTime();
10103
- var difference = timestamp - startOfYearTimestamp;
10104
- return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
10105
- }
10106
-
10107
- // See issue: https://github.com/date-fns/date-fns/issues/376
9783
+ var dayPeriodEnum = {
9784
+ am: 'am',
9785
+ pm: 'pm',
9786
+ midnight: 'midnight',
9787
+ noon: 'noon',
9788
+ morning: 'morning',
9789
+ afternoon: 'afternoon',
9790
+ evening: 'evening',
9791
+ night: 'night'
9792
+ };
9793
+ /*
9794
+ * | | Unit | | Unit |
9795
+ * |-----|--------------------------------|-----|--------------------------------|
9796
+ * | a | AM, PM | A* | Milliseconds in day |
9797
+ * | b | AM, PM, noon, midnight | B | Flexible day period |
9798
+ * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
9799
+ * | d | Day of month | D | Day of year |
9800
+ * | e | Local day of week | E | Day of week |
9801
+ * | f | | F* | Day of week in month |
9802
+ * | g* | Modified Julian day | G | Era |
9803
+ * | h | Hour [1-12] | H | Hour [0-23] |
9804
+ * | i! | ISO day of week | I! | ISO week of year |
9805
+ * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
9806
+ * | k | Hour [1-24] | K | Hour [0-11] |
9807
+ * | l* | (deprecated) | L | Stand-alone month |
9808
+ * | m | Minute | M | Month |
9809
+ * | n | | N | |
9810
+ * | o! | Ordinal number modifier | O | Timezone (GMT) |
9811
+ * | p! | Long localized time | P! | Long localized date |
9812
+ * | q | Stand-alone quarter | Q | Quarter |
9813
+ * | r* | Related Gregorian year | R! | ISO week-numbering year |
9814
+ * | s | Second | S | Fraction of second |
9815
+ * | t! | Seconds timestamp | T! | Milliseconds timestamp |
9816
+ * | u | Extended year | U* | Cyclic year |
9817
+ * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
9818
+ * | w | Local week of year | W* | Week of month |
9819
+ * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
9820
+ * | y | Year (abs) | Y | Local week-numbering year |
9821
+ * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
9822
+ *
9823
+ * Letters marked by * are not implemented but reserved by Unicode standard.
9824
+ *
9825
+ * Letters marked by ! are non-standard, but implemented by date-fns:
9826
+ * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
9827
+ * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
9828
+ * i.e. 7 for Sunday, 1 for Monday, etc.
9829
+ * - `I` is ISO week of year, as opposed to `w` which is local week of year.
9830
+ * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
9831
+ * `R` is supposed to be used in conjunction with `I` and `i`
9832
+ * for universal ISO week-numbering date, whereas
9833
+ * `Y` is supposed to be used in conjunction with `w` and `e`
9834
+ * for week-numbering date specific to the locale.
9835
+ * - `P` is long localized date format
9836
+ * - `p` is long localized time format
9837
+ */
10108
9838
 
10109
- function startOfUTCISOWeek(dirtyDate) {
10110
- requiredArgs(1, arguments);
10111
- var weekStartsOn = 1;
10112
- var date = toDate(dirtyDate);
10113
- var day = date.getUTCDay();
10114
- var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
10115
- date.setUTCDate(date.getUTCDate() - diff);
10116
- date.setUTCHours(0, 0, 0, 0);
10117
- return date;
10118
- }
9839
+ var formatters = {
9840
+ // Era
9841
+ G: function G(date, token, localize) {
9842
+ var era = date.getUTCFullYear() > 0 ? 1 : 0;
9843
+ switch (token) {
9844
+ // AD, BC
9845
+ case 'G':
9846
+ case 'GG':
9847
+ case 'GGG':
9848
+ return localize.era(era, {
9849
+ width: 'abbreviated'
9850
+ });
9851
+ // A, B
9852
+ case 'GGGGG':
9853
+ return localize.era(era, {
9854
+ width: 'narrow'
9855
+ });
9856
+ // Anno Domini, Before Christ
9857
+ case 'GGGG':
9858
+ default:
9859
+ return localize.era(era, {
9860
+ width: 'wide'
9861
+ });
9862
+ }
9863
+ },
9864
+ // Year
9865
+ y: function y(date, token, localize) {
9866
+ // Ordinal number
9867
+ if (token === 'yo') {
9868
+ var signedYear = date.getUTCFullYear();
9869
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
9870
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
9871
+ return localize.ordinalNumber(year, {
9872
+ unit: 'year'
9873
+ });
9874
+ }
9875
+ return lightFormatters.y(date, token);
9876
+ },
9877
+ // Local week-numbering year
9878
+ Y: function Y(date, token, localize, options) {
9879
+ var signedWeekYear = getUTCWeekYear(date, options);
9880
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
9881
+ var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
10119
9882
 
10120
- // See issue: https://github.com/date-fns/date-fns/issues/376
9883
+ // Two digit year
9884
+ if (token === 'YY') {
9885
+ var twoDigitYear = weekYear % 100;
9886
+ return addLeadingZeros(twoDigitYear, 2);
9887
+ }
10121
9888
 
10122
- function getUTCISOWeekYear(dirtyDate) {
10123
- requiredArgs(1, arguments);
10124
- var date = toDate(dirtyDate);
10125
- var year = date.getUTCFullYear();
10126
- var fourthOfJanuaryOfNextYear = new Date(0);
10127
- fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
10128
- fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
10129
- var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
10130
- var fourthOfJanuaryOfThisYear = new Date(0);
10131
- fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
10132
- fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
10133
- var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
10134
- if (date.getTime() >= startOfNextYear.getTime()) {
10135
- return year + 1;
10136
- } else if (date.getTime() >= startOfThisYear.getTime()) {
10137
- return year;
10138
- } else {
10139
- return year - 1;
10140
- }
10141
- }
10142
-
10143
- // See issue: https://github.com/date-fns/date-fns/issues/376
10144
-
10145
- function startOfUTCISOWeekYear(dirtyDate) {
10146
- requiredArgs(1, arguments);
10147
- var year = getUTCISOWeekYear(dirtyDate);
10148
- var fourthOfJanuary = new Date(0);
10149
- fourthOfJanuary.setUTCFullYear(year, 0, 4);
10150
- fourthOfJanuary.setUTCHours(0, 0, 0, 0);
10151
- var date = startOfUTCISOWeek(fourthOfJanuary);
10152
- return date;
10153
- }
10154
-
10155
- var MILLISECONDS_IN_WEEK$1 = 604800000; // This function will be a part of public API when UTC function will be implemented.
10156
- // See issue: https://github.com/date-fns/date-fns/issues/376
10157
-
10158
- function getUTCISOWeek(dirtyDate) {
10159
- requiredArgs(1, arguments);
10160
- var date = toDate(dirtyDate);
10161
- var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer
10162
- // because the number of milliseconds in a week is not constant
10163
- // (e.g. it's different in the week of the daylight saving time clock shift)
10164
-
10165
- return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
10166
- }
10167
-
10168
- // See issue: https://github.com/date-fns/date-fns/issues/376
10169
-
10170
- function startOfUTCWeek(dirtyDate, dirtyOptions) {
10171
- requiredArgs(1, arguments);
10172
- var options = dirtyOptions || {};
10173
- var locale = options.locale;
10174
- var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;
10175
- var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
10176
- var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
10177
-
10178
- if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
10179
- throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
10180
- }
10181
- var date = toDate(dirtyDate);
10182
- var day = date.getUTCDay();
10183
- var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
10184
- date.setUTCDate(date.getUTCDate() - diff);
10185
- date.setUTCHours(0, 0, 0, 0);
10186
- return date;
10187
- }
10188
-
10189
- // See issue: https://github.com/date-fns/date-fns/issues/376
10190
-
10191
- function getUTCWeekYear(dirtyDate, dirtyOptions) {
10192
- requiredArgs(1, arguments);
10193
- var date = toDate(dirtyDate, dirtyOptions);
10194
- var year = date.getUTCFullYear();
10195
- var options = dirtyOptions || {};
10196
- var locale = options.locale;
10197
- var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
10198
- var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
10199
- var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
10200
-
10201
- if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
10202
- throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
10203
- }
10204
- var firstWeekOfNextYear = new Date(0);
10205
- firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
10206
- firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
10207
- var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions);
10208
- var firstWeekOfThisYear = new Date(0);
10209
- firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
10210
- firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
10211
- var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions);
10212
- if (date.getTime() >= startOfNextYear.getTime()) {
10213
- return year + 1;
10214
- } else if (date.getTime() >= startOfThisYear.getTime()) {
10215
- return year;
10216
- } else {
10217
- return year - 1;
10218
- }
10219
- }
10220
-
10221
- // See issue: https://github.com/date-fns/date-fns/issues/376
10222
-
10223
- function startOfUTCWeekYear(dirtyDate, dirtyOptions) {
10224
- requiredArgs(1, arguments);
10225
- var options = dirtyOptions || {};
10226
- var locale = options.locale;
10227
- var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
10228
- var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
10229
- var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);
10230
- var year = getUTCWeekYear(dirtyDate, dirtyOptions);
10231
- var firstWeek = new Date(0);
10232
- firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
10233
- firstWeek.setUTCHours(0, 0, 0, 0);
10234
- var date = startOfUTCWeek(firstWeek, dirtyOptions);
10235
- return date;
10236
- }
10237
-
10238
- var MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.
10239
- // See issue: https://github.com/date-fns/date-fns/issues/376
10240
-
10241
- function getUTCWeek(dirtyDate, options) {
10242
- requiredArgs(1, arguments);
10243
- var date = toDate(dirtyDate);
10244
- var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer
10245
- // because the number of milliseconds in a week is not constant
10246
- // (e.g. it's different in the week of the daylight saving time clock shift)
10247
-
10248
- return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
10249
- }
10250
-
10251
- var dayPeriodEnum = {
10252
- am: 'am',
10253
- pm: 'pm',
10254
- midnight: 'midnight',
10255
- noon: 'noon',
10256
- morning: 'morning',
10257
- afternoon: 'afternoon',
10258
- evening: 'evening',
10259
- night: 'night'
10260
- /*
10261
- * | | Unit | | Unit |
10262
- * |-----|--------------------------------|-----|--------------------------------|
10263
- * | a | AM, PM | A* | Milliseconds in day |
10264
- * | b | AM, PM, noon, midnight | B | Flexible day period |
10265
- * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
10266
- * | d | Day of month | D | Day of year |
10267
- * | e | Local day of week | E | Day of week |
10268
- * | f | | F* | Day of week in month |
10269
- * | g* | Modified Julian day | G | Era |
10270
- * | h | Hour [1-12] | H | Hour [0-23] |
10271
- * | i! | ISO day of week | I! | ISO week of year |
10272
- * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
10273
- * | k | Hour [1-24] | K | Hour [0-11] |
10274
- * | l* | (deprecated) | L | Stand-alone month |
10275
- * | m | Minute | M | Month |
10276
- * | n | | N | |
10277
- * | o! | Ordinal number modifier | O | Timezone (GMT) |
10278
- * | p! | Long localized time | P! | Long localized date |
10279
- * | q | Stand-alone quarter | Q | Quarter |
10280
- * | r* | Related Gregorian year | R! | ISO week-numbering year |
10281
- * | s | Second | S | Fraction of second |
10282
- * | t! | Seconds timestamp | T! | Milliseconds timestamp |
10283
- * | u | Extended year | U* | Cyclic year |
10284
- * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
10285
- * | w | Local week of year | W* | Week of month |
10286
- * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
10287
- * | y | Year (abs) | Y | Local week-numbering year |
10288
- * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
10289
- *
10290
- * Letters marked by * are not implemented but reserved by Unicode standard.
10291
- *
10292
- * Letters marked by ! are non-standard, but implemented by date-fns:
10293
- * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
10294
- * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
10295
- * i.e. 7 for Sunday, 1 for Monday, etc.
10296
- * - `I` is ISO week of year, as opposed to `w` which is local week of year.
10297
- * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
10298
- * `R` is supposed to be used in conjunction with `I` and `i`
10299
- * for universal ISO week-numbering date, whereas
10300
- * `Y` is supposed to be used in conjunction with `w` and `e`
10301
- * for week-numbering date specific to the locale.
10302
- * - `P` is long localized date format
10303
- * - `p` is long localized time format
10304
- */
10305
- };
10306
-
10307
- var formatters = {
10308
- // Era
10309
- G: function G(date, token, localize) {
10310
- var era = date.getUTCFullYear() > 0 ? 1 : 0;
10311
- switch (token) {
10312
- // AD, BC
10313
- case 'G':
10314
- case 'GG':
10315
- case 'GGG':
10316
- return localize.era(era, {
10317
- width: 'abbreviated'
10318
- });
10319
- // A, B
10320
-
10321
- case 'GGGGG':
10322
- return localize.era(era, {
10323
- width: 'narrow'
10324
- });
10325
- // Anno Domini, Before Christ
10326
-
10327
- case 'GGGG':
10328
- default:
10329
- return localize.era(era, {
10330
- width: 'wide'
10331
- });
10332
- }
10333
- },
10334
- // Year
10335
- y: function y(date, token, localize) {
10336
9889
  // Ordinal number
10337
- if (token === 'yo') {
10338
- var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
10339
-
10340
- var year = signedYear > 0 ? signedYear : 1 - signedYear;
10341
- return localize.ordinalNumber(year, {
10342
- unit: 'year'
10343
- });
10344
- }
10345
- return lightFormatters.y(date, token);
10346
- },
10347
- // Local week-numbering year
10348
- Y: function Y(date, token, localize, options) {
10349
- var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)
10350
-
10351
- var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year
10352
-
10353
- if (token === 'YY') {
10354
- var twoDigitYear = weekYear % 100;
10355
- return addLeadingZeros(twoDigitYear, 2);
10356
- } // Ordinal number
10357
-
10358
9890
  if (token === 'Yo') {
10359
9891
  return localize.ordinalNumber(weekYear, {
10360
9892
  unit: 'year'
10361
9893
  });
10362
- } // Padding
9894
+ }
10363
9895
 
9896
+ // Padding
10364
9897
  return addLeadingZeros(weekYear, token.length);
10365
9898
  },
10366
9899
  // ISO week-numbering year
10367
9900
  R: function R(date, token) {
10368
- var isoWeekYear = getUTCISOWeekYear(date); // Padding
9901
+ var isoWeekYear = getUTCISOWeekYear(date);
10369
9902
 
9903
+ // Padding
10370
9904
  return addLeadingZeros(isoWeekYear, token.length);
10371
9905
  },
10372
9906
  // Extended year. This is a single number designating the year of this calendar system.
@@ -10390,31 +9924,26 @@ var formatters = {
10390
9924
  case 'Q':
10391
9925
  return String(quarter);
10392
9926
  // 01, 02, 03, 04
10393
-
10394
9927
  case 'QQ':
10395
9928
  return addLeadingZeros(quarter, 2);
10396
9929
  // 1st, 2nd, 3rd, 4th
10397
-
10398
9930
  case 'Qo':
10399
9931
  return localize.ordinalNumber(quarter, {
10400
9932
  unit: 'quarter'
10401
9933
  });
10402
9934
  // Q1, Q2, Q3, Q4
10403
-
10404
9935
  case 'QQQ':
10405
9936
  return localize.quarter(quarter, {
10406
9937
  width: 'abbreviated',
10407
9938
  context: 'formatting'
10408
9939
  });
10409
9940
  // 1, 2, 3, 4 (narrow quarter; could be not numerical)
10410
-
10411
9941
  case 'QQQQQ':
10412
9942
  return localize.quarter(quarter, {
10413
9943
  width: 'narrow',
10414
9944
  context: 'formatting'
10415
9945
  });
10416
9946
  // 1st quarter, 2nd quarter, ...
10417
-
10418
9947
  case 'QQQQ':
10419
9948
  default:
10420
9949
  return localize.quarter(quarter, {
@@ -10431,31 +9960,26 @@ var formatters = {
10431
9960
  case 'q':
10432
9961
  return String(quarter);
10433
9962
  // 01, 02, 03, 04
10434
-
10435
9963
  case 'qq':
10436
9964
  return addLeadingZeros(quarter, 2);
10437
9965
  // 1st, 2nd, 3rd, 4th
10438
-
10439
9966
  case 'qo':
10440
9967
  return localize.ordinalNumber(quarter, {
10441
9968
  unit: 'quarter'
10442
9969
  });
10443
9970
  // Q1, Q2, Q3, Q4
10444
-
10445
9971
  case 'qqq':
10446
9972
  return localize.quarter(quarter, {
10447
9973
  width: 'abbreviated',
10448
9974
  context: 'standalone'
10449
9975
  });
10450
9976
  // 1, 2, 3, 4 (narrow quarter; could be not numerical)
10451
-
10452
9977
  case 'qqqqq':
10453
9978
  return localize.quarter(quarter, {
10454
9979
  width: 'narrow',
10455
9980
  context: 'standalone'
10456
9981
  });
10457
9982
  // 1st quarter, 2nd quarter, ...
10458
-
10459
9983
  case 'qqqq':
10460
9984
  default:
10461
9985
  return localize.quarter(quarter, {
@@ -10472,27 +9996,23 @@ var formatters = {
10472
9996
  case 'MM':
10473
9997
  return lightFormatters.M(date, token);
10474
9998
  // 1st, 2nd, ..., 12th
10475
-
10476
9999
  case 'Mo':
10477
10000
  return localize.ordinalNumber(month + 1, {
10478
10001
  unit: 'month'
10479
10002
  });
10480
10003
  // Jan, Feb, ..., Dec
10481
-
10482
10004
  case 'MMM':
10483
10005
  return localize.month(month, {
10484
10006
  width: 'abbreviated',
10485
10007
  context: 'formatting'
10486
10008
  });
10487
10009
  // J, F, ..., D
10488
-
10489
10010
  case 'MMMMM':
10490
10011
  return localize.month(month, {
10491
10012
  width: 'narrow',
10492
10013
  context: 'formatting'
10493
10014
  });
10494
10015
  // January, February, ..., December
10495
-
10496
10016
  case 'MMMM':
10497
10017
  default:
10498
10018
  return localize.month(month, {
@@ -10509,31 +10029,26 @@ var formatters = {
10509
10029
  case 'L':
10510
10030
  return String(month + 1);
10511
10031
  // 01, 02, ..., 12
10512
-
10513
10032
  case 'LL':
10514
10033
  return addLeadingZeros(month + 1, 2);
10515
10034
  // 1st, 2nd, ..., 12th
10516
-
10517
10035
  case 'Lo':
10518
10036
  return localize.ordinalNumber(month + 1, {
10519
10037
  unit: 'month'
10520
10038
  });
10521
10039
  // Jan, Feb, ..., Dec
10522
-
10523
10040
  case 'LLL':
10524
10041
  return localize.month(month, {
10525
10042
  width: 'abbreviated',
10526
10043
  context: 'standalone'
10527
10044
  });
10528
10045
  // J, F, ..., D
10529
-
10530
10046
  case 'LLLLL':
10531
10047
  return localize.month(month, {
10532
10048
  width: 'narrow',
10533
10049
  context: 'standalone'
10534
10050
  });
10535
10051
  // January, February, ..., December
10536
-
10537
10052
  case 'LLLL':
10538
10053
  default:
10539
10054
  return localize.month(month, {
@@ -10594,21 +10109,18 @@ var formatters = {
10594
10109
  context: 'formatting'
10595
10110
  });
10596
10111
  // T
10597
-
10598
10112
  case 'EEEEE':
10599
10113
  return localize.day(dayOfWeek, {
10600
10114
  width: 'narrow',
10601
10115
  context: 'formatting'
10602
10116
  });
10603
10117
  // Tu
10604
-
10605
10118
  case 'EEEEEE':
10606
10119
  return localize.day(dayOfWeek, {
10607
10120
  width: 'short',
10608
10121
  context: 'formatting'
10609
10122
  });
10610
10123
  // Tuesday
10611
-
10612
10124
  case 'EEEE':
10613
10125
  default:
10614
10126
  return localize.day(dayOfWeek, {
@@ -10626,11 +10138,9 @@ var formatters = {
10626
10138
  case 'e':
10627
10139
  return String(localDayOfWeek);
10628
10140
  // Padded numerical value
10629
-
10630
10141
  case 'ee':
10631
10142
  return addLeadingZeros(localDayOfWeek, 2);
10632
10143
  // 1st, 2nd, ..., 7th
10633
-
10634
10144
  case 'eo':
10635
10145
  return localize.ordinalNumber(localDayOfWeek, {
10636
10146
  unit: 'day'
@@ -10641,21 +10151,18 @@ var formatters = {
10641
10151
  context: 'formatting'
10642
10152
  });
10643
10153
  // T
10644
-
10645
10154
  case 'eeeee':
10646
10155
  return localize.day(dayOfWeek, {
10647
10156
  width: 'narrow',
10648
10157
  context: 'formatting'
10649
10158
  });
10650
10159
  // Tu
10651
-
10652
10160
  case 'eeeeee':
10653
10161
  return localize.day(dayOfWeek, {
10654
10162
  width: 'short',
10655
10163
  context: 'formatting'
10656
10164
  });
10657
10165
  // Tuesday
10658
-
10659
10166
  case 'eeee':
10660
10167
  default:
10661
10168
  return localize.day(dayOfWeek, {
@@ -10673,11 +10180,9 @@ var formatters = {
10673
10180
  case 'c':
10674
10181
  return String(localDayOfWeek);
10675
10182
  // Padded numerical value
10676
-
10677
10183
  case 'cc':
10678
10184
  return addLeadingZeros(localDayOfWeek, token.length);
10679
10185
  // 1st, 2nd, ..., 7th
10680
-
10681
10186
  case 'co':
10682
10187
  return localize.ordinalNumber(localDayOfWeek, {
10683
10188
  unit: 'day'
@@ -10688,21 +10193,18 @@ var formatters = {
10688
10193
  context: 'standalone'
10689
10194
  });
10690
10195
  // T
10691
-
10692
10196
  case 'ccccc':
10693
10197
  return localize.day(dayOfWeek, {
10694
10198
  width: 'narrow',
10695
10199
  context: 'standalone'
10696
10200
  });
10697
10201
  // Tu
10698
-
10699
10202
  case 'cccccc':
10700
10203
  return localize.day(dayOfWeek, {
10701
10204
  width: 'short',
10702
10205
  context: 'standalone'
10703
10206
  });
10704
10207
  // Tuesday
10705
-
10706
10208
  case 'cccc':
10707
10209
  default:
10708
10210
  return localize.day(dayOfWeek, {
@@ -10720,38 +10222,32 @@ var formatters = {
10720
10222
  case 'i':
10721
10223
  return String(isoDayOfWeek);
10722
10224
  // 02
10723
-
10724
10225
  case 'ii':
10725
10226
  return addLeadingZeros(isoDayOfWeek, token.length);
10726
10227
  // 2nd
10727
-
10728
10228
  case 'io':
10729
10229
  return localize.ordinalNumber(isoDayOfWeek, {
10730
10230
  unit: 'day'
10731
10231
  });
10732
10232
  // Tue
10733
-
10734
10233
  case 'iii':
10735
10234
  return localize.day(dayOfWeek, {
10736
10235
  width: 'abbreviated',
10737
10236
  context: 'formatting'
10738
10237
  });
10739
10238
  // T
10740
-
10741
10239
  case 'iiiii':
10742
10240
  return localize.day(dayOfWeek, {
10743
10241
  width: 'narrow',
10744
10242
  context: 'formatting'
10745
10243
  });
10746
10244
  // Tu
10747
-
10748
10245
  case 'iiiiii':
10749
10246
  return localize.day(dayOfWeek, {
10750
10247
  width: 'short',
10751
10248
  context: 'formatting'
10752
10249
  });
10753
10250
  // Tuesday
10754
-
10755
10251
  case 'iiii':
10756
10252
  default:
10757
10253
  return localize.day(dayOfWeek, {
@@ -10760,417 +10256,897 @@ var formatters = {
10760
10256
  });
10761
10257
  }
10762
10258
  },
10763
- // AM or PM
10764
- a: function a(date, token, localize) {
10765
- var hours = date.getUTCHours();
10766
- var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
10767
- switch (token) {
10768
- case 'a':
10769
- case 'aa':
10770
- case 'aaa':
10771
- return localize.dayPeriod(dayPeriodEnumValue, {
10772
- width: 'abbreviated',
10773
- context: 'formatting'
10774
- });
10775
- case 'aaaaa':
10776
- return localize.dayPeriod(dayPeriodEnumValue, {
10777
- width: 'narrow',
10778
- context: 'formatting'
10779
- });
10780
- case 'aaaa':
10781
- default:
10782
- return localize.dayPeriod(dayPeriodEnumValue, {
10783
- width: 'wide',
10784
- context: 'formatting'
10785
- });
10786
- }
10259
+ // AM or PM
10260
+ a: function a(date, token, localize) {
10261
+ var hours = date.getUTCHours();
10262
+ var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
10263
+ switch (token) {
10264
+ case 'a':
10265
+ case 'aa':
10266
+ return localize.dayPeriod(dayPeriodEnumValue, {
10267
+ width: 'abbreviated',
10268
+ context: 'formatting'
10269
+ });
10270
+ case 'aaa':
10271
+ return localize.dayPeriod(dayPeriodEnumValue, {
10272
+ width: 'abbreviated',
10273
+ context: 'formatting'
10274
+ }).toLowerCase();
10275
+ case 'aaaaa':
10276
+ return localize.dayPeriod(dayPeriodEnumValue, {
10277
+ width: 'narrow',
10278
+ context: 'formatting'
10279
+ });
10280
+ case 'aaaa':
10281
+ default:
10282
+ return localize.dayPeriod(dayPeriodEnumValue, {
10283
+ width: 'wide',
10284
+ context: 'formatting'
10285
+ });
10286
+ }
10287
+ },
10288
+ // AM, PM, midnight, noon
10289
+ b: function b(date, token, localize) {
10290
+ var hours = date.getUTCHours();
10291
+ var dayPeriodEnumValue;
10292
+ if (hours === 12) {
10293
+ dayPeriodEnumValue = dayPeriodEnum.noon;
10294
+ } else if (hours === 0) {
10295
+ dayPeriodEnumValue = dayPeriodEnum.midnight;
10296
+ } else {
10297
+ dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
10298
+ }
10299
+ switch (token) {
10300
+ case 'b':
10301
+ case 'bb':
10302
+ return localize.dayPeriod(dayPeriodEnumValue, {
10303
+ width: 'abbreviated',
10304
+ context: 'formatting'
10305
+ });
10306
+ case 'bbb':
10307
+ return localize.dayPeriod(dayPeriodEnumValue, {
10308
+ width: 'abbreviated',
10309
+ context: 'formatting'
10310
+ }).toLowerCase();
10311
+ case 'bbbbb':
10312
+ return localize.dayPeriod(dayPeriodEnumValue, {
10313
+ width: 'narrow',
10314
+ context: 'formatting'
10315
+ });
10316
+ case 'bbbb':
10317
+ default:
10318
+ return localize.dayPeriod(dayPeriodEnumValue, {
10319
+ width: 'wide',
10320
+ context: 'formatting'
10321
+ });
10322
+ }
10323
+ },
10324
+ // in the morning, in the afternoon, in the evening, at night
10325
+ B: function B(date, token, localize) {
10326
+ var hours = date.getUTCHours();
10327
+ var dayPeriodEnumValue;
10328
+ if (hours >= 17) {
10329
+ dayPeriodEnumValue = dayPeriodEnum.evening;
10330
+ } else if (hours >= 12) {
10331
+ dayPeriodEnumValue = dayPeriodEnum.afternoon;
10332
+ } else if (hours >= 4) {
10333
+ dayPeriodEnumValue = dayPeriodEnum.morning;
10334
+ } else {
10335
+ dayPeriodEnumValue = dayPeriodEnum.night;
10336
+ }
10337
+ switch (token) {
10338
+ case 'B':
10339
+ case 'BB':
10340
+ case 'BBB':
10341
+ return localize.dayPeriod(dayPeriodEnumValue, {
10342
+ width: 'abbreviated',
10343
+ context: 'formatting'
10344
+ });
10345
+ case 'BBBBB':
10346
+ return localize.dayPeriod(dayPeriodEnumValue, {
10347
+ width: 'narrow',
10348
+ context: 'formatting'
10349
+ });
10350
+ case 'BBBB':
10351
+ default:
10352
+ return localize.dayPeriod(dayPeriodEnumValue, {
10353
+ width: 'wide',
10354
+ context: 'formatting'
10355
+ });
10356
+ }
10357
+ },
10358
+ // Hour [1-12]
10359
+ h: function h(date, token, localize) {
10360
+ if (token === 'ho') {
10361
+ var hours = date.getUTCHours() % 12;
10362
+ if (hours === 0) hours = 12;
10363
+ return localize.ordinalNumber(hours, {
10364
+ unit: 'hour'
10365
+ });
10366
+ }
10367
+ return lightFormatters.h(date, token);
10368
+ },
10369
+ // Hour [0-23]
10370
+ H: function H(date, token, localize) {
10371
+ if (token === 'Ho') {
10372
+ return localize.ordinalNumber(date.getUTCHours(), {
10373
+ unit: 'hour'
10374
+ });
10375
+ }
10376
+ return lightFormatters.H(date, token);
10377
+ },
10378
+ // Hour [0-11]
10379
+ K: function K(date, token, localize) {
10380
+ var hours = date.getUTCHours() % 12;
10381
+ if (token === 'Ko') {
10382
+ return localize.ordinalNumber(hours, {
10383
+ unit: 'hour'
10384
+ });
10385
+ }
10386
+ return addLeadingZeros(hours, token.length);
10387
+ },
10388
+ // Hour [1-24]
10389
+ k: function k(date, token, localize) {
10390
+ var hours = date.getUTCHours();
10391
+ if (hours === 0) hours = 24;
10392
+ if (token === 'ko') {
10393
+ return localize.ordinalNumber(hours, {
10394
+ unit: 'hour'
10395
+ });
10396
+ }
10397
+ return addLeadingZeros(hours, token.length);
10398
+ },
10399
+ // Minute
10400
+ m: function m(date, token, localize) {
10401
+ if (token === 'mo') {
10402
+ return localize.ordinalNumber(date.getUTCMinutes(), {
10403
+ unit: 'minute'
10404
+ });
10405
+ }
10406
+ return lightFormatters.m(date, token);
10407
+ },
10408
+ // Second
10409
+ s: function s(date, token, localize) {
10410
+ if (token === 'so') {
10411
+ return localize.ordinalNumber(date.getUTCSeconds(), {
10412
+ unit: 'second'
10413
+ });
10414
+ }
10415
+ return lightFormatters.s(date, token);
10416
+ },
10417
+ // Fraction of second
10418
+ S: function S(date, token) {
10419
+ return lightFormatters.S(date, token);
10420
+ },
10421
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
10422
+ X: function X(date, token, _localize, options) {
10423
+ var originalDate = options._originalDate || date;
10424
+ var timezoneOffset = originalDate.getTimezoneOffset();
10425
+ if (timezoneOffset === 0) {
10426
+ return 'Z';
10427
+ }
10428
+ switch (token) {
10429
+ // Hours and optional minutes
10430
+ case 'X':
10431
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
10432
+
10433
+ // Hours, minutes and optional seconds without `:` delimiter
10434
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10435
+ // so this token always has the same output as `XX`
10436
+ case 'XXXX':
10437
+ case 'XX':
10438
+ // Hours and minutes without `:` delimiter
10439
+ return formatTimezone(timezoneOffset);
10440
+
10441
+ // Hours, minutes and optional seconds with `:` delimiter
10442
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10443
+ // so this token always has the same output as `XXX`
10444
+ case 'XXXXX':
10445
+ case 'XXX': // Hours and minutes with `:` delimiter
10446
+ default:
10447
+ return formatTimezone(timezoneOffset, ':');
10448
+ }
10449
+ },
10450
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
10451
+ x: function x(date, token, _localize, options) {
10452
+ var originalDate = options._originalDate || date;
10453
+ var timezoneOffset = originalDate.getTimezoneOffset();
10454
+ switch (token) {
10455
+ // Hours and optional minutes
10456
+ case 'x':
10457
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
10458
+
10459
+ // Hours, minutes and optional seconds without `:` delimiter
10460
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10461
+ // so this token always has the same output as `xx`
10462
+ case 'xxxx':
10463
+ case 'xx':
10464
+ // Hours and minutes without `:` delimiter
10465
+ return formatTimezone(timezoneOffset);
10466
+
10467
+ // Hours, minutes and optional seconds with `:` delimiter
10468
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10469
+ // so this token always has the same output as `xxx`
10470
+ case 'xxxxx':
10471
+ case 'xxx': // Hours and minutes with `:` delimiter
10472
+ default:
10473
+ return formatTimezone(timezoneOffset, ':');
10474
+ }
10475
+ },
10476
+ // Timezone (GMT)
10477
+ O: function O(date, token, _localize, options) {
10478
+ var originalDate = options._originalDate || date;
10479
+ var timezoneOffset = originalDate.getTimezoneOffset();
10480
+ switch (token) {
10481
+ // Short
10482
+ case 'O':
10483
+ case 'OO':
10484
+ case 'OOO':
10485
+ return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
10486
+ // Long
10487
+ case 'OOOO':
10488
+ default:
10489
+ return 'GMT' + formatTimezone(timezoneOffset, ':');
10490
+ }
10491
+ },
10492
+ // Timezone (specific non-location)
10493
+ z: function z(date, token, _localize, options) {
10494
+ var originalDate = options._originalDate || date;
10495
+ var timezoneOffset = originalDate.getTimezoneOffset();
10496
+ switch (token) {
10497
+ // Short
10498
+ case 'z':
10499
+ case 'zz':
10500
+ case 'zzz':
10501
+ return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
10502
+ // Long
10503
+ case 'zzzz':
10504
+ default:
10505
+ return 'GMT' + formatTimezone(timezoneOffset, ':');
10506
+ }
10507
+ },
10508
+ // Seconds timestamp
10509
+ t: function t(date, token, _localize, options) {
10510
+ var originalDate = options._originalDate || date;
10511
+ var timestamp = Math.floor(originalDate.getTime() / 1000);
10512
+ return addLeadingZeros(timestamp, token.length);
10513
+ },
10514
+ // Milliseconds timestamp
10515
+ T: function T(date, token, _localize, options) {
10516
+ var originalDate = options._originalDate || date;
10517
+ var timestamp = originalDate.getTime();
10518
+ return addLeadingZeros(timestamp, token.length);
10519
+ }
10520
+ };
10521
+ function formatTimezoneShort(offset, dirtyDelimiter) {
10522
+ var sign = offset > 0 ? '-' : '+';
10523
+ var absOffset = Math.abs(offset);
10524
+ var hours = Math.floor(absOffset / 60);
10525
+ var minutes = absOffset % 60;
10526
+ if (minutes === 0) {
10527
+ return sign + String(hours);
10528
+ }
10529
+ var delimiter = dirtyDelimiter || '';
10530
+ return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
10531
+ }
10532
+ function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
10533
+ if (offset % 60 === 0) {
10534
+ var sign = offset > 0 ? '-' : '+';
10535
+ return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
10536
+ }
10537
+ return formatTimezone(offset, dirtyDelimiter);
10538
+ }
10539
+ function formatTimezone(offset, dirtyDelimiter) {
10540
+ var delimiter = dirtyDelimiter || '';
10541
+ var sign = offset > 0 ? '-' : '+';
10542
+ var absOffset = Math.abs(offset);
10543
+ var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
10544
+ var minutes = addLeadingZeros(absOffset % 60, 2);
10545
+ return sign + hours + delimiter + minutes;
10546
+ }
10547
+ var formatters$1 = formatters;
10548
+
10549
+ var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
10550
+ switch (pattern) {
10551
+ case 'P':
10552
+ return formatLong.date({
10553
+ width: 'short'
10554
+ });
10555
+ case 'PP':
10556
+ return formatLong.date({
10557
+ width: 'medium'
10558
+ });
10559
+ case 'PPP':
10560
+ return formatLong.date({
10561
+ width: 'long'
10562
+ });
10563
+ case 'PPPP':
10564
+ default:
10565
+ return formatLong.date({
10566
+ width: 'full'
10567
+ });
10568
+ }
10569
+ };
10570
+ var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
10571
+ switch (pattern) {
10572
+ case 'p':
10573
+ return formatLong.time({
10574
+ width: 'short'
10575
+ });
10576
+ case 'pp':
10577
+ return formatLong.time({
10578
+ width: 'medium'
10579
+ });
10580
+ case 'ppp':
10581
+ return formatLong.time({
10582
+ width: 'long'
10583
+ });
10584
+ case 'pppp':
10585
+ default:
10586
+ return formatLong.time({
10587
+ width: 'full'
10588
+ });
10589
+ }
10590
+ };
10591
+ var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong) {
10592
+ var matchResult = pattern.match(/(P+)(p+)?/) || [];
10593
+ var datePattern = matchResult[1];
10594
+ var timePattern = matchResult[2];
10595
+ if (!timePattern) {
10596
+ return dateLongFormatter(pattern, formatLong);
10597
+ }
10598
+ var dateTimeFormat;
10599
+ switch (datePattern) {
10600
+ case 'P':
10601
+ dateTimeFormat = formatLong.dateTime({
10602
+ width: 'short'
10603
+ });
10604
+ break;
10605
+ case 'PP':
10606
+ dateTimeFormat = formatLong.dateTime({
10607
+ width: 'medium'
10608
+ });
10609
+ break;
10610
+ case 'PPP':
10611
+ dateTimeFormat = formatLong.dateTime({
10612
+ width: 'long'
10613
+ });
10614
+ break;
10615
+ case 'PPPP':
10616
+ default:
10617
+ dateTimeFormat = formatLong.dateTime({
10618
+ width: 'full'
10619
+ });
10620
+ break;
10621
+ }
10622
+ return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
10623
+ };
10624
+ var longFormatters = {
10625
+ p: timeLongFormatter,
10626
+ P: dateTimeLongFormatter
10627
+ };
10628
+ var longFormatters$1 = longFormatters;
10629
+
10630
+ /**
10631
+ * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
10632
+ * They usually appear for dates that denote time before the timezones were introduced
10633
+ * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
10634
+ * and GMT+01:00:00 after that date)
10635
+ *
10636
+ * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
10637
+ * which would lead to incorrect calculations.
10638
+ *
10639
+ * This function returns the timezone offset in milliseconds that takes seconds in account.
10640
+ */
10641
+ function getTimezoneOffsetInMilliseconds(date) {
10642
+ var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
10643
+ utcDate.setUTCFullYear(date.getFullYear());
10644
+ return date.getTime() - utcDate.getTime();
10645
+ }
10646
+
10647
+ var protectedDayOfYearTokens = ['D', 'DD'];
10648
+ var protectedWeekYearTokens = ['YY', 'YYYY'];
10649
+ function isProtectedDayOfYearToken(token) {
10650
+ return protectedDayOfYearTokens.indexOf(token) !== -1;
10651
+ }
10652
+ function isProtectedWeekYearToken(token) {
10653
+ return protectedWeekYearTokens.indexOf(token) !== -1;
10654
+ }
10655
+ function throwProtectedError(token, format, input) {
10656
+ if (token === 'YYYY') {
10657
+ 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"));
10658
+ } else if (token === 'YY') {
10659
+ 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"));
10660
+ } else if (token === 'D') {
10661
+ 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"));
10662
+ } else if (token === 'DD') {
10663
+ 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"));
10664
+ }
10665
+ }
10666
+
10667
+ var formatDistanceLocale = {
10668
+ lessThanXSeconds: {
10669
+ one: 'less than a second',
10670
+ other: 'less than {{count}} seconds'
10671
+ },
10672
+ xSeconds: {
10673
+ one: '1 second',
10674
+ other: '{{count}} seconds'
10675
+ },
10676
+ halfAMinute: 'half a minute',
10677
+ lessThanXMinutes: {
10678
+ one: 'less than a minute',
10679
+ other: 'less than {{count}} minutes'
10787
10680
  },
10788
- // AM, PM, midnight, noon
10789
- b: function b(date, token, localize) {
10790
- var hours = date.getUTCHours();
10791
- var dayPeriodEnumValue;
10792
- if (hours === 12) {
10793
- dayPeriodEnumValue = dayPeriodEnum.noon;
10794
- } else if (hours === 0) {
10795
- dayPeriodEnumValue = dayPeriodEnum.midnight;
10796
- } else {
10797
- dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
10798
- }
10799
- switch (token) {
10800
- case 'b':
10801
- case 'bb':
10802
- case 'bbb':
10803
- return localize.dayPeriod(dayPeriodEnumValue, {
10804
- width: 'abbreviated',
10805
- context: 'formatting'
10806
- });
10807
- case 'bbbbb':
10808
- return localize.dayPeriod(dayPeriodEnumValue, {
10809
- width: 'narrow',
10810
- context: 'formatting'
10811
- });
10812
- case 'bbbb':
10813
- default:
10814
- return localize.dayPeriod(dayPeriodEnumValue, {
10815
- width: 'wide',
10816
- context: 'formatting'
10817
- });
10818
- }
10681
+ xMinutes: {
10682
+ one: '1 minute',
10683
+ other: '{{count}} minutes'
10819
10684
  },
10820
- // in the morning, in the afternoon, in the evening, at night
10821
- B: function B(date, token, localize) {
10822
- var hours = date.getUTCHours();
10823
- var dayPeriodEnumValue;
10824
- if (hours >= 17) {
10825
- dayPeriodEnumValue = dayPeriodEnum.evening;
10826
- } else if (hours >= 12) {
10827
- dayPeriodEnumValue = dayPeriodEnum.afternoon;
10828
- } else if (hours >= 4) {
10829
- dayPeriodEnumValue = dayPeriodEnum.morning;
10830
- } else {
10831
- dayPeriodEnumValue = dayPeriodEnum.night;
10832
- }
10833
- switch (token) {
10834
- case 'B':
10835
- case 'BB':
10836
- case 'BBB':
10837
- return localize.dayPeriod(dayPeriodEnumValue, {
10838
- width: 'abbreviated',
10839
- context: 'formatting'
10840
- });
10841
- case 'BBBBB':
10842
- return localize.dayPeriod(dayPeriodEnumValue, {
10843
- width: 'narrow',
10844
- context: 'formatting'
10845
- });
10846
- case 'BBBB':
10847
- default:
10848
- return localize.dayPeriod(dayPeriodEnumValue, {
10849
- width: 'wide',
10850
- context: 'formatting'
10851
- });
10852
- }
10685
+ aboutXHours: {
10686
+ one: 'about 1 hour',
10687
+ other: 'about {{count}} hours'
10853
10688
  },
10854
- // Hour [1-12]
10855
- h: function h(date, token, localize) {
10856
- if (token === 'ho') {
10857
- var hours = date.getUTCHours() % 12;
10858
- if (hours === 0) hours = 12;
10859
- return localize.ordinalNumber(hours, {
10860
- unit: 'hour'
10861
- });
10862
- }
10863
- return lightFormatters.h(date, token);
10689
+ xHours: {
10690
+ one: '1 hour',
10691
+ other: '{{count}} hours'
10864
10692
  },
10865
- // Hour [0-23]
10866
- H: function H(date, token, localize) {
10867
- if (token === 'Ho') {
10868
- return localize.ordinalNumber(date.getUTCHours(), {
10869
- unit: 'hour'
10870
- });
10871
- }
10872
- return lightFormatters.H(date, token);
10693
+ xDays: {
10694
+ one: '1 day',
10695
+ other: '{{count}} days'
10873
10696
  },
10874
- // Hour [0-11]
10875
- K: function K(date, token, localize) {
10876
- var hours = date.getUTCHours() % 12;
10877
- if (token === 'Ko') {
10878
- return localize.ordinalNumber(hours, {
10879
- unit: 'hour'
10880
- });
10881
- }
10882
- return addLeadingZeros(hours, token.length);
10697
+ aboutXWeeks: {
10698
+ one: 'about 1 week',
10699
+ other: 'about {{count}} weeks'
10883
10700
  },
10884
- // Hour [1-24]
10885
- k: function k(date, token, localize) {
10886
- var hours = date.getUTCHours();
10887
- if (hours === 0) hours = 24;
10888
- if (token === 'ko') {
10889
- return localize.ordinalNumber(hours, {
10890
- unit: 'hour'
10891
- });
10892
- }
10893
- return addLeadingZeros(hours, token.length);
10701
+ xWeeks: {
10702
+ one: '1 week',
10703
+ other: '{{count}} weeks'
10894
10704
  },
10895
- // Minute
10896
- m: function m(date, token, localize) {
10897
- if (token === 'mo') {
10898
- return localize.ordinalNumber(date.getUTCMinutes(), {
10899
- unit: 'minute'
10900
- });
10901
- }
10902
- return lightFormatters.m(date, token);
10705
+ aboutXMonths: {
10706
+ one: 'about 1 month',
10707
+ other: 'about {{count}} months'
10903
10708
  },
10904
- // Second
10905
- s: function s(date, token, localize) {
10906
- if (token === 'so') {
10907
- return localize.ordinalNumber(date.getUTCSeconds(), {
10908
- unit: 'second'
10909
- });
10910
- }
10911
- return lightFormatters.s(date, token);
10709
+ xMonths: {
10710
+ one: '1 month',
10711
+ other: '{{count}} months'
10912
10712
  },
10913
- // Fraction of second
10914
- S: function S(date, token) {
10915
- return lightFormatters.S(date, token);
10713
+ aboutXYears: {
10714
+ one: 'about 1 year',
10715
+ other: 'about {{count}} years'
10916
10716
  },
10917
- // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
10918
- X: function X(date, token, _localize, options) {
10919
- var originalDate = options._originalDate || date;
10920
- var timezoneOffset = originalDate.getTimezoneOffset();
10921
- if (timezoneOffset === 0) {
10922
- return 'Z';
10717
+ xYears: {
10718
+ one: '1 year',
10719
+ other: '{{count}} years'
10720
+ },
10721
+ overXYears: {
10722
+ one: 'over 1 year',
10723
+ other: 'over {{count}} years'
10724
+ },
10725
+ almostXYears: {
10726
+ one: 'almost 1 year',
10727
+ other: 'almost {{count}} years'
10728
+ }
10729
+ };
10730
+ var formatDistance = function formatDistance(token, count, options) {
10731
+ var result;
10732
+ var tokenValue = formatDistanceLocale[token];
10733
+ if (typeof tokenValue === 'string') {
10734
+ result = tokenValue;
10735
+ } else if (count === 1) {
10736
+ result = tokenValue.one;
10737
+ } else {
10738
+ result = tokenValue.other.replace('{{count}}', count.toString());
10739
+ }
10740
+ if (options !== null && options !== void 0 && options.addSuffix) {
10741
+ if (options.comparison && options.comparison > 0) {
10742
+ return 'in ' + result;
10743
+ } else {
10744
+ return result + ' ago';
10923
10745
  }
10924
- switch (token) {
10925
- // Hours and optional minutes
10926
- case 'X':
10927
- return formatTimezoneWithOptionalMinutes(timezoneOffset);
10928
- // Hours, minutes and optional seconds without `:` delimiter
10929
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10930
- // so this token always has the same output as `XX`
10746
+ }
10747
+ return result;
10748
+ };
10749
+ var formatDistance$1 = formatDistance;
10931
10750
 
10932
- case 'XXXX':
10933
- case 'XX':
10934
- // Hours and minutes without `:` delimiter
10935
- return formatTimezone(timezoneOffset);
10936
- // Hours, minutes and optional seconds with `:` delimiter
10937
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10938
- // so this token always has the same output as `XXX`
10751
+ function buildFormatLongFn(args) {
10752
+ return function () {
10753
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
10754
+ // TODO: Remove String()
10755
+ var width = options.width ? String(options.width) : args.defaultWidth;
10756
+ var format = args.formats[width] || args.formats[args.defaultWidth];
10757
+ return format;
10758
+ };
10759
+ }
10760
+
10761
+ var dateFormats = {
10762
+ full: 'EEEE, MMMM do, y',
10763
+ "long": 'MMMM do, y',
10764
+ medium: 'MMM d, y',
10765
+ "short": 'MM/dd/yyyy'
10766
+ };
10767
+ var timeFormats = {
10768
+ full: 'h:mm:ss a zzzz',
10769
+ "long": 'h:mm:ss a z',
10770
+ medium: 'h:mm:ss a',
10771
+ "short": 'h:mm a'
10772
+ };
10773
+ var dateTimeFormats = {
10774
+ full: "{{date}} 'at' {{time}}",
10775
+ "long": "{{date}} 'at' {{time}}",
10776
+ medium: '{{date}}, {{time}}',
10777
+ "short": '{{date}}, {{time}}'
10778
+ };
10779
+ var formatLong = {
10780
+ date: buildFormatLongFn({
10781
+ formats: dateFormats,
10782
+ defaultWidth: 'full'
10783
+ }),
10784
+ time: buildFormatLongFn({
10785
+ formats: timeFormats,
10786
+ defaultWidth: 'full'
10787
+ }),
10788
+ dateTime: buildFormatLongFn({
10789
+ formats: dateTimeFormats,
10790
+ defaultWidth: 'full'
10791
+ })
10792
+ };
10793
+ var formatLong$1 = formatLong;
10939
10794
 
10940
- case 'XXXXX':
10941
- case 'XXX': // Hours and minutes with `:` delimiter
10795
+ var formatRelativeLocale = {
10796
+ lastWeek: "'last' eeee 'at' p",
10797
+ yesterday: "'yesterday at' p",
10798
+ today: "'today at' p",
10799
+ tomorrow: "'tomorrow at' p",
10800
+ nextWeek: "eeee 'at' p",
10801
+ other: 'P'
10802
+ };
10803
+ var formatRelative = function formatRelative(token, _date, _baseDate, _options) {
10804
+ return formatRelativeLocale[token];
10805
+ };
10806
+ var formatRelative$1 = formatRelative;
10942
10807
 
10943
- default:
10944
- return formatTimezone(timezoneOffset, ':');
10808
+ function buildLocalizeFn(args) {
10809
+ return function (dirtyIndex, options) {
10810
+ var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';
10811
+ var valuesArray;
10812
+ if (context === 'formatting' && args.formattingValues) {
10813
+ var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
10814
+ var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
10815
+ valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
10816
+ } else {
10817
+ var _defaultWidth = args.defaultWidth;
10818
+ var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
10819
+ valuesArray = args.values[_width] || args.values[_defaultWidth];
10945
10820
  }
10946
- },
10947
- // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
10948
- x: function x(date, token, _localize, options) {
10949
- var originalDate = options._originalDate || date;
10950
- var timezoneOffset = originalDate.getTimezoneOffset();
10951
- switch (token) {
10952
- // Hours and optional minutes
10953
- case 'x':
10954
- return formatTimezoneWithOptionalMinutes(timezoneOffset);
10955
- // Hours, minutes and optional seconds without `:` delimiter
10956
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10957
- // so this token always has the same output as `xx`
10958
-
10959
- case 'xxxx':
10960
- case 'xx':
10961
- // Hours and minutes without `:` delimiter
10962
- return formatTimezone(timezoneOffset);
10963
- // Hours, minutes and optional seconds with `:` delimiter
10964
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
10965
- // so this token always has the same output as `xxx`
10821
+ var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
10822
+ // @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!
10823
+ return valuesArray[index];
10824
+ };
10825
+ }
10966
10826
 
10967
- case 'xxxxx':
10968
- case 'xxx': // Hours and minutes with `:` delimiter
10827
+ var eraValues = {
10828
+ narrow: ['B', 'A'],
10829
+ abbreviated: ['BC', 'AD'],
10830
+ wide: ['Before Christ', 'Anno Domini']
10831
+ };
10832
+ var quarterValues = {
10833
+ narrow: ['1', '2', '3', '4'],
10834
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
10835
+ wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
10836
+ };
10969
10837
 
10970
- default:
10971
- return formatTimezone(timezoneOffset, ':');
10972
- }
10838
+ // Note: in English, the names of days of the week and months are capitalized.
10839
+ // If you are making a new locale based on this one, check if the same is true for the language you're working on.
10840
+ // Generally, formatted dates should look like they are in the middle of a sentence,
10841
+ // e.g. in Spanish language the weekdays and months should be in the lowercase.
10842
+ var monthValues = {
10843
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
10844
+ abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
10845
+ wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
10846
+ };
10847
+ var dayValues = {
10848
+ narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
10849
+ "short": ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
10850
+ abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
10851
+ wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
10852
+ };
10853
+ var dayPeriodValues = {
10854
+ narrow: {
10855
+ am: 'a',
10856
+ pm: 'p',
10857
+ midnight: 'mi',
10858
+ noon: 'n',
10859
+ morning: 'morning',
10860
+ afternoon: 'afternoon',
10861
+ evening: 'evening',
10862
+ night: 'night'
10973
10863
  },
10974
- // Timezone (GMT)
10975
- O: function O(date, token, _localize, options) {
10976
- var originalDate = options._originalDate || date;
10977
- var timezoneOffset = originalDate.getTimezoneOffset();
10978
- switch (token) {
10979
- // Short
10980
- case 'O':
10981
- case 'OO':
10982
- case 'OOO':
10983
- return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
10984
- // Long
10985
-
10986
- case 'OOOO':
10987
- default:
10988
- return 'GMT' + formatTimezone(timezoneOffset, ':');
10989
- }
10864
+ abbreviated: {
10865
+ am: 'AM',
10866
+ pm: 'PM',
10867
+ midnight: 'midnight',
10868
+ noon: 'noon',
10869
+ morning: 'morning',
10870
+ afternoon: 'afternoon',
10871
+ evening: 'evening',
10872
+ night: 'night'
10990
10873
  },
10991
- // Timezone (specific non-location)
10992
- z: function z(date, token, _localize, options) {
10993
- var originalDate = options._originalDate || date;
10994
- var timezoneOffset = originalDate.getTimezoneOffset();
10995
- switch (token) {
10996
- // Short
10997
- case 'z':
10998
- case 'zz':
10999
- case 'zzz':
11000
- return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
11001
- // Long
11002
-
11003
- case 'zzzz':
11004
- default:
11005
- return 'GMT' + formatTimezone(timezoneOffset, ':');
11006
- }
10874
+ wide: {
10875
+ am: 'a.m.',
10876
+ pm: 'p.m.',
10877
+ midnight: 'midnight',
10878
+ noon: 'noon',
10879
+ morning: 'morning',
10880
+ afternoon: 'afternoon',
10881
+ evening: 'evening',
10882
+ night: 'night'
10883
+ }
10884
+ };
10885
+ var formattingDayPeriodValues = {
10886
+ narrow: {
10887
+ am: 'a',
10888
+ pm: 'p',
10889
+ midnight: 'mi',
10890
+ noon: 'n',
10891
+ morning: 'in the morning',
10892
+ afternoon: 'in the afternoon',
10893
+ evening: 'in the evening',
10894
+ night: 'at night'
11007
10895
  },
11008
- // Seconds timestamp
11009
- t: function t(date, token, _localize, options) {
11010
- var originalDate = options._originalDate || date;
11011
- var timestamp = Math.floor(originalDate.getTime() / 1000);
11012
- return addLeadingZeros(timestamp, token.length);
10896
+ abbreviated: {
10897
+ am: 'AM',
10898
+ pm: 'PM',
10899
+ midnight: 'midnight',
10900
+ noon: 'noon',
10901
+ morning: 'in the morning',
10902
+ afternoon: 'in the afternoon',
10903
+ evening: 'in the evening',
10904
+ night: 'at night'
11013
10905
  },
11014
- // Milliseconds timestamp
11015
- T: function T(date, token, _localize, options) {
11016
- var originalDate = options._originalDate || date;
11017
- var timestamp = originalDate.getTime();
11018
- return addLeadingZeros(timestamp, token.length);
10906
+ wide: {
10907
+ am: 'a.m.',
10908
+ pm: 'p.m.',
10909
+ midnight: 'midnight',
10910
+ noon: 'noon',
10911
+ morning: 'in the morning',
10912
+ afternoon: 'in the afternoon',
10913
+ evening: 'in the evening',
10914
+ night: 'at night'
11019
10915
  }
11020
10916
  };
11021
- function formatTimezoneShort(offset, dirtyDelimiter) {
11022
- var sign = offset > 0 ? '-' : '+';
11023
- var absOffset = Math.abs(offset);
11024
- var hours = Math.floor(absOffset / 60);
11025
- var minutes = absOffset % 60;
11026
- if (minutes === 0) {
11027
- return sign + String(hours);
11028
- }
11029
- var delimiter = dirtyDelimiter || '';
11030
- return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
11031
- }
11032
- function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
11033
- if (offset % 60 === 0) {
11034
- var sign = offset > 0 ? '-' : '+';
11035
- return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
10917
+ var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
10918
+ var number = Number(dirtyNumber);
10919
+
10920
+ // If ordinal numbers depend on context, for example,
10921
+ // if they are different for different grammatical genders,
10922
+ // use `options.unit`.
10923
+ //
10924
+ // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
10925
+ // 'day', 'hour', 'minute', 'second'.
10926
+
10927
+ var rem100 = number % 100;
10928
+ if (rem100 > 20 || rem100 < 10) {
10929
+ switch (rem100 % 10) {
10930
+ case 1:
10931
+ return number + 'st';
10932
+ case 2:
10933
+ return number + 'nd';
10934
+ case 3:
10935
+ return number + 'rd';
10936
+ }
11036
10937
  }
11037
- return formatTimezone(offset, dirtyDelimiter);
11038
- }
11039
- function formatTimezone(offset, dirtyDelimiter) {
11040
- var delimiter = dirtyDelimiter || '';
11041
- var sign = offset > 0 ? '-' : '+';
11042
- var absOffset = Math.abs(offset);
11043
- var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
11044
- var minutes = addLeadingZeros(absOffset % 60, 2);
11045
- return sign + hours + delimiter + minutes;
10938
+ return number + 'th';
10939
+ };
10940
+ var localize = {
10941
+ ordinalNumber: ordinalNumber,
10942
+ era: buildLocalizeFn({
10943
+ values: eraValues,
10944
+ defaultWidth: 'wide'
10945
+ }),
10946
+ quarter: buildLocalizeFn({
10947
+ values: quarterValues,
10948
+ defaultWidth: 'wide',
10949
+ argumentCallback: function argumentCallback(quarter) {
10950
+ return quarter - 1;
10951
+ }
10952
+ }),
10953
+ month: buildLocalizeFn({
10954
+ values: monthValues,
10955
+ defaultWidth: 'wide'
10956
+ }),
10957
+ day: buildLocalizeFn({
10958
+ values: dayValues,
10959
+ defaultWidth: 'wide'
10960
+ }),
10961
+ dayPeriod: buildLocalizeFn({
10962
+ values: dayPeriodValues,
10963
+ defaultWidth: 'wide',
10964
+ formattingValues: formattingDayPeriodValues,
10965
+ defaultFormattingWidth: 'wide'
10966
+ })
10967
+ };
10968
+ var localize$1 = localize;
10969
+
10970
+ function buildMatchFn(args) {
10971
+ return function (string) {
10972
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
10973
+ var width = options.width;
10974
+ var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
10975
+ var matchResult = string.match(matchPattern);
10976
+ if (!matchResult) {
10977
+ return null;
10978
+ }
10979
+ var matchedString = matchResult[0];
10980
+ var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
10981
+ var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
10982
+ return pattern.test(matchedString);
10983
+ }) : findKey(parsePatterns, function (pattern) {
10984
+ return pattern.test(matchedString);
10985
+ });
10986
+ var value;
10987
+ value = args.valueCallback ? args.valueCallback(key) : key;
10988
+ value = options.valueCallback ? options.valueCallback(value) : value;
10989
+ var rest = string.slice(matchedString.length);
10990
+ return {
10991
+ value: value,
10992
+ rest: rest
10993
+ };
10994
+ };
11046
10995
  }
11047
- var formatters$1 = formatters;
11048
-
11049
- function dateLongFormatter(pattern, formatLong) {
11050
- switch (pattern) {
11051
- case 'P':
11052
- return formatLong.date({
11053
- width: 'short'
11054
- });
11055
- case 'PP':
11056
- return formatLong.date({
11057
- width: 'medium'
11058
- });
11059
- case 'PPP':
11060
- return formatLong.date({
11061
- width: 'long'
11062
- });
11063
- case 'PPPP':
11064
- default:
11065
- return formatLong.date({
11066
- width: 'full'
11067
- });
10996
+ function findKey(object, predicate) {
10997
+ for (var key in object) {
10998
+ if (object.hasOwnProperty(key) && predicate(object[key])) {
10999
+ return key;
11000
+ }
11068
11001
  }
11002
+ return undefined;
11069
11003
  }
11070
- function timeLongFormatter(pattern, formatLong) {
11071
- switch (pattern) {
11072
- case 'p':
11073
- return formatLong.time({
11074
- width: 'short'
11075
- });
11076
- case 'pp':
11077
- return formatLong.time({
11078
- width: 'medium'
11079
- });
11080
- case 'ppp':
11081
- return formatLong.time({
11082
- width: 'long'
11083
- });
11084
- case 'pppp':
11085
- default:
11086
- return formatLong.time({
11087
- width: 'full'
11088
- });
11004
+ function findIndex(array, predicate) {
11005
+ for (var key = 0; key < array.length; key++) {
11006
+ if (predicate(array[key])) {
11007
+ return key;
11008
+ }
11089
11009
  }
11010
+ return undefined;
11090
11011
  }
11091
- function dateTimeLongFormatter(pattern, formatLong) {
11092
- var matchResult = pattern.match(/(P+)(p+)?/);
11093
- var datePattern = matchResult[1];
11094
- var timePattern = matchResult[2];
11095
- if (!timePattern) {
11096
- return dateLongFormatter(pattern, formatLong);
11097
- }
11098
- var dateTimeFormat;
11099
- switch (datePattern) {
11100
- case 'P':
11101
- dateTimeFormat = formatLong.dateTime({
11102
- width: 'short'
11103
- });
11104
- break;
11105
- case 'PP':
11106
- dateTimeFormat = formatLong.dateTime({
11107
- width: 'medium'
11108
- });
11109
- break;
11110
- case 'PPP':
11111
- dateTimeFormat = formatLong.dateTime({
11112
- width: 'long'
11113
- });
11114
- break;
11115
- case 'PPPP':
11116
- default:
11117
- dateTimeFormat = formatLong.dateTime({
11118
- width: 'full'
11119
- });
11120
- break;
11121
- }
11122
- return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
11012
+
11013
+ function buildMatchPatternFn(args) {
11014
+ return function (string) {
11015
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
11016
+ var matchResult = string.match(args.matchPattern);
11017
+ if (!matchResult) return null;
11018
+ var matchedString = matchResult[0];
11019
+ var parseResult = string.match(args.parsePattern);
11020
+ if (!parseResult) return null;
11021
+ var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
11022
+ value = options.valueCallback ? options.valueCallback(value) : value;
11023
+ var rest = string.slice(matchedString.length);
11024
+ return {
11025
+ value: value,
11026
+ rest: rest
11027
+ };
11028
+ };
11123
11029
  }
11124
- var longFormatters = {
11125
- p: timeLongFormatter,
11126
- P: dateTimeLongFormatter
11030
+
11031
+ var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
11032
+ var parseOrdinalNumberPattern = /\d+/i;
11033
+ var matchEraPatterns = {
11034
+ narrow: /^(b|a)/i,
11035
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
11036
+ wide: /^(before christ|before common era|anno domini|common era)/i
11127
11037
  };
11128
- var longFormatters$1 = longFormatters;
11038
+ var parseEraPatterns = {
11039
+ any: [/^b/i, /^(a|c)/i]
11040
+ };
11041
+ var matchQuarterPatterns = {
11042
+ narrow: /^[1234]/i,
11043
+ abbreviated: /^q[1234]/i,
11044
+ wide: /^[1234](th|st|nd|rd)? quarter/i
11045
+ };
11046
+ var parseQuarterPatterns = {
11047
+ any: [/1/i, /2/i, /3/i, /4/i]
11048
+ };
11049
+ var matchMonthPatterns = {
11050
+ narrow: /^[jfmasond]/i,
11051
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
11052
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
11053
+ };
11054
+ var parseMonthPatterns = {
11055
+ 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],
11056
+ 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]
11057
+ };
11058
+ var matchDayPatterns = {
11059
+ narrow: /^[smtwf]/i,
11060
+ "short": /^(su|mo|tu|we|th|fr|sa)/i,
11061
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
11062
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
11063
+ };
11064
+ var parseDayPatterns = {
11065
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
11066
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
11067
+ };
11068
+ var matchDayPeriodPatterns = {
11069
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
11070
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
11071
+ };
11072
+ var parseDayPeriodPatterns = {
11073
+ any: {
11074
+ am: /^a/i,
11075
+ pm: /^p/i,
11076
+ midnight: /^mi/i,
11077
+ noon: /^no/i,
11078
+ morning: /morning/i,
11079
+ afternoon: /afternoon/i,
11080
+ evening: /evening/i,
11081
+ night: /night/i
11082
+ }
11083
+ };
11084
+ var match = {
11085
+ ordinalNumber: buildMatchPatternFn({
11086
+ matchPattern: matchOrdinalNumberPattern,
11087
+ parsePattern: parseOrdinalNumberPattern,
11088
+ valueCallback: function valueCallback(value) {
11089
+ return parseInt(value, 10);
11090
+ }
11091
+ }),
11092
+ era: buildMatchFn({
11093
+ matchPatterns: matchEraPatterns,
11094
+ defaultMatchWidth: 'wide',
11095
+ parsePatterns: parseEraPatterns,
11096
+ defaultParseWidth: 'any'
11097
+ }),
11098
+ quarter: buildMatchFn({
11099
+ matchPatterns: matchQuarterPatterns,
11100
+ defaultMatchWidth: 'wide',
11101
+ parsePatterns: parseQuarterPatterns,
11102
+ defaultParseWidth: 'any',
11103
+ valueCallback: function valueCallback(index) {
11104
+ return index + 1;
11105
+ }
11106
+ }),
11107
+ month: buildMatchFn({
11108
+ matchPatterns: matchMonthPatterns,
11109
+ defaultMatchWidth: 'wide',
11110
+ parsePatterns: parseMonthPatterns,
11111
+ defaultParseWidth: 'any'
11112
+ }),
11113
+ day: buildMatchFn({
11114
+ matchPatterns: matchDayPatterns,
11115
+ defaultMatchWidth: 'wide',
11116
+ parsePatterns: parseDayPatterns,
11117
+ defaultParseWidth: 'any'
11118
+ }),
11119
+ dayPeriod: buildMatchFn({
11120
+ matchPatterns: matchDayPeriodPatterns,
11121
+ defaultMatchWidth: 'any',
11122
+ parsePatterns: parseDayPeriodPatterns,
11123
+ defaultParseWidth: 'any'
11124
+ })
11125
+ };
11126
+ var match$1 = match;
11129
11127
 
11130
- var MILLISECONDS_IN_MINUTE = 60000;
11131
- function getDateMillisecondsPart(date) {
11132
- return date.getTime() % MILLISECONDS_IN_MINUTE;
11133
- }
11134
11128
  /**
11135
- * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
11136
- * They usually appear for dates that denote time before the timezones were introduced
11137
- * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
11138
- * and GMT+01:00:00 after that date)
11139
- *
11140
- * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
11141
- * which would lead to incorrect calculations.
11142
- *
11143
- * This function returns the timezone offset in milliseconds that takes seconds in account.
11129
+ * @type {Locale}
11130
+ * @category Locales
11131
+ * @summary English locale (United States).
11132
+ * @language English
11133
+ * @iso-639-2 eng
11134
+ * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
11135
+ * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
11144
11136
  */
11145
-
11146
- function getTimezoneOffsetInMilliseconds(dirtyDate) {
11147
- var date = new Date(dirtyDate.getTime());
11148
- var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());
11149
- date.setSeconds(0, 0);
11150
- var hasNegativeUTCOffset = baseTimezoneOffset > 0;
11151
- var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);
11152
- return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;
11153
- }
11154
-
11155
- var protectedDayOfYearTokens = ['D', 'DD'];
11156
- var protectedWeekYearTokens = ['YY', 'YYYY'];
11157
- function isProtectedDayOfYearToken(token) {
11158
- return protectedDayOfYearTokens.indexOf(token) !== -1;
11159
- }
11160
- function isProtectedWeekYearToken(token) {
11161
- return protectedWeekYearTokens.indexOf(token) !== -1;
11162
- }
11163
- function throwProtectedError(token, format, input) {
11164
- if (token === 'YYYY') {
11165
- throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
11166
- } else if (token === 'YY') {
11167
- throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
11168
- } else if (token === 'D') {
11169
- throw new RangeError("Use `d` instead of `D` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
11170
- } else if (token === 'DD') {
11171
- throw new RangeError("Use `dd` instead of `DD` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
11137
+ var locale = {
11138
+ code: 'en-US',
11139
+ formatDistance: formatDistance$1,
11140
+ formatLong: formatLong$1,
11141
+ formatRelative: formatRelative$1,
11142
+ localize: localize$1,
11143
+ match: match$1,
11144
+ options: {
11145
+ weekStartsOn: 0 /* Sunday */,
11146
+ firstWeekContainsDate: 1
11172
11147
  }
11173
- }
11148
+ };
11149
+ var defaultLocale = locale;
11174
11150
 
11175
11151
  // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
11176
11152
  // (one of the certain letters followed by `o`)
@@ -11182,14 +11158,15 @@ function throwProtectedError(token, format, input) {
11182
11158
  // If there is no matching single quote
11183
11159
  // then the sequence will continue until the end of the string.
11184
11160
  // - . matches any single character unmatched by previous parts of the RegExps
11161
+ var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
11185
11162
 
11186
- var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also
11163
+ // This RegExp catches symbols escaped by quotes, and also
11187
11164
  // sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
11188
-
11189
11165
  var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
11190
11166
  var escapedStringRegExp = /^'([^]*?)'?$/;
11191
11167
  var doubleQuoteRegExp = /''/g;
11192
11168
  var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11169
+
11193
11170
  /**
11194
11171
  * @name format
11195
11172
  * @category Common Helpers
@@ -11199,7 +11176,7 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11199
11176
  * Return the formatted date string in the given format. The result may vary by locale.
11200
11177
  *
11201
11178
  * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
11202
- * > See: https://git.io/fxCyr
11179
+ * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
11203
11180
  *
11204
11181
  * The characters wrapped between two single quotes characters (') are escaped.
11205
11182
  * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
@@ -11278,32 +11255,34 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11278
11255
  * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
11279
11256
  * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
11280
11257
  * | | EEEEE | M, T, W, T, F, S, S | |
11281
- * | | EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | |
11258
+ * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
11282
11259
  * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
11283
11260
  * | | io | 1st, 2nd, ..., 7th | 7 |
11284
11261
  * | | ii | 01, 02, ..., 07 | 7 |
11285
11262
  * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
11286
11263
  * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
11287
11264
  * | | iiiii | M, T, W, T, F, S, S | 7 |
11288
- * | | iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | 7 |
11265
+ * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
11289
11266
  * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
11290
11267
  * | | eo | 2nd, 3rd, ..., 1st | 7 |
11291
11268
  * | | ee | 02, 03, ..., 01 | |
11292
11269
  * | | eee | Mon, Tue, Wed, ..., Sun | |
11293
11270
  * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
11294
11271
  * | | eeeee | M, T, W, T, F, S, S | |
11295
- * | | eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | |
11272
+ * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
11296
11273
  * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
11297
11274
  * | | co | 2nd, 3rd, ..., 1st | 7 |
11298
11275
  * | | cc | 02, 03, ..., 01 | |
11299
11276
  * | | ccc | Mon, Tue, Wed, ..., Sun | |
11300
11277
  * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
11301
11278
  * | | ccccc | M, T, W, T, F, S, S | |
11302
- * | | cccccc | Mo, Tu, We, Th, Fr, Su, Sa | |
11303
- * | AM, PM | a..aaa | AM, PM | |
11279
+ * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
11280
+ * | AM, PM | a..aa | AM, PM | |
11281
+ * | | aaa | am, pm | |
11304
11282
  * | | aaaa | a.m., p.m. | 2 |
11305
11283
  * | | aaaaa | a, p | |
11306
- * | AM, PM, noon, midnight | b..bbb | AM, PM, noon, midnight | |
11284
+ * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
11285
+ * | | bbb | am, pm, noon, midnight | |
11307
11286
  * | | bbbb | a.m., p.m., noon, midnight | 2 |
11308
11287
  * | | bbbbb | a, p, n, mi | |
11309
11288
  * | Flexible day period | B..BBB | at night, in the morning, ... | |
@@ -11329,7 +11308,7 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11329
11308
  * | | ss | 00, 01, ..., 59 | |
11330
11309
  * | Fraction of second | S | 0, 1, ..., 9 | |
11331
11310
  * | | SS | 00, 01, ..., 99 | |
11332
- * | | SSS | 000, 0001, ..., 999 | |
11311
+ * | | SSS | 000, 001, ..., 999 | |
11333
11312
  * | | SSSS | ... | 3 |
11334
11313
  * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
11335
11314
  * | | XX | -0800, +0530, Z | |
@@ -11349,18 +11328,18 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11349
11328
  * | | tt | ... | 3,7 |
11350
11329
  * | Milliseconds timestamp | T | 512969520900 | 7 |
11351
11330
  * | | TT | ... | 3,7 |
11352
- * | Long localized date | P | 05/29/1453 | 7 |
11353
- * | | PP | May 29, 1453 | 7 |
11354
- * | | PPP | May 29th, 1453 | 7 |
11355
- * | | PPPP | Sunday, May 29th, 1453 | 2,7 |
11331
+ * | Long localized date | P | 04/29/1453 | 7 |
11332
+ * | | PP | Apr 29, 1453 | 7 |
11333
+ * | | PPP | April 29th, 1453 | 7 |
11334
+ * | | PPPP | Friday, April 29th, 1453 | 2,7 |
11356
11335
  * | Long localized time | p | 12:00 AM | 7 |
11357
11336
  * | | pp | 12:00:00 AM | 7 |
11358
11337
  * | | ppp | 12:00:00 AM GMT+2 | 7 |
11359
11338
  * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
11360
- * | Combination of date and time | Pp | 05/29/1453, 12:00 AM | 7 |
11361
- * | | PPpp | May 29, 1453, 12:00:00 AM | 7 |
11362
- * | | PPPppp | May 29th, 1453 at ... | 7 |
11363
- * | | PPPPpppp| Sunday, May 29th, 1453 at ... | 2,7 |
11339
+ * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
11340
+ * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
11341
+ * | | PPPppp | April 29th, 1453 at ... | 7 |
11342
+ * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
11364
11343
  * Notes:
11365
11344
  * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
11366
11345
  * are the same as "stand-alone" units, but are different in some languages.
@@ -11433,30 +11412,10 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11433
11412
  * - `p`: long localized time
11434
11413
  *
11435
11414
  * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
11436
- * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr
11437
- *
11438
- * 9. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.
11439
- * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr
11440
- *
11441
- * ### v2.0.0 breaking changes:
11442
- *
11443
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
11444
- *
11445
- * - The second argument is now required for the sake of explicitness.
11446
- *
11447
- * ```javascript
11448
- * // Before v2.0.0
11449
- * format(new Date(2016, 0, 1))
11450
- *
11451
- * // v2.0.0 onward
11452
- * format(new Date(2016, 0, 1), "yyyy-MM-dd'T'HH:mm:ss.SSSxxx")
11453
- * ```
11415
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
11454
11416
  *
11455
- * - New format string API for `format` function
11456
- * which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).
11457
- * See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.
11458
- *
11459
- * - Characters are now escaped using single quote symbols (`'`) instead of square brackets.
11417
+ * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
11418
+ * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
11460
11419
  *
11461
11420
  * @param {Date|Number} date - the original date
11462
11421
  * @param {String} format - the string of tokens
@@ -11465,9 +11424,9 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11465
11424
  * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
11466
11425
  * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
11467
11426
  * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
11468
- * see: https://git.io/fxCyr
11427
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
11469
11428
  * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
11470
- * see: https://git.io/fxCyr
11429
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
11471
11430
  * @returns {String} the formatted date string
11472
11431
  * @throws {TypeError} 2 arguments required
11473
11432
  * @throws {RangeError} `date` must not be Invalid Date
@@ -11475,47 +11434,46 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
11475
11434
  * @throws {RangeError} `options.locale` must contain `formatLong` property
11476
11435
  * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
11477
11436
  * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
11478
- * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
11479
- * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
11480
- * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr
11481
- * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr
11437
+ * @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
11438
+ * @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
11439
+ * @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
11440
+ * @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
11482
11441
  * @throws {RangeError} format string contains an unescaped latin alphabet character
11483
11442
  *
11484
11443
  * @example
11485
11444
  * // Represent 11 February 2014 in middle-endian format:
11486
- * var result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
11445
+ * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
11487
11446
  * //=> '02/11/2014'
11488
11447
  *
11489
11448
  * @example
11490
11449
  * // Represent 2 July 2014 in Esperanto:
11491
11450
  * import { eoLocale } from 'date-fns/locale/eo'
11492
- * var result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
11451
+ * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
11493
11452
  * locale: eoLocale
11494
11453
  * })
11495
11454
  * //=> '2-a de julio 2014'
11496
11455
  *
11497
11456
  * @example
11498
11457
  * // Escape string by single quote characters:
11499
- * var result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
11458
+ * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
11500
11459
  * //=> "3 o'clock"
11501
11460
  */
11502
11461
 
11503
- function format$1(dirtyDate, dirtyFormatStr, dirtyOptions) {
11462
+ function format(dirtyDate, dirtyFormatStr, options) {
11463
+ 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;
11504
11464
  requiredArgs(2, arguments);
11505
11465
  var formatStr = String(dirtyFormatStr);
11506
- var options = dirtyOptions || {};
11507
- var locale = options.locale || defaultLocale;
11508
- var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;
11509
- var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
11510
- var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
11466
+ var defaultOptions = getDefaultOptions();
11467
+ 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;
11468
+ 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);
11511
11469
 
11470
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
11512
11471
  if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
11513
11472
  throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
11514
11473
  }
11515
- var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;
11516
- var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
11517
- var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
11474
+ 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);
11518
11475
 
11476
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
11519
11477
  if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
11520
11478
  throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
11521
11479
  }
@@ -11528,10 +11486,11 @@ function format$1(dirtyDate, dirtyFormatStr, dirtyOptions) {
11528
11486
  var originalDate = toDate(dirtyDate);
11529
11487
  if (!isValid(originalDate)) {
11530
11488
  throw new RangeError('Invalid time value');
11531
- } // Convert the date in system timezone to the same date in UTC+00:00 timezone.
11489
+ }
11490
+
11491
+ // Convert the date in system timezone to the same date in UTC+00:00 timezone.
11532
11492
  // This ensures that when UTC functions will be implemented, locales will be compatible with them.
11533
11493
  // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
11534
-
11535
11494
  var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
11536
11495
  var utcDate = subMilliseconds(originalDate, timezoneOffset);
11537
11496
  var formatterOptions = {
@@ -11544,7 +11503,7 @@ function format$1(dirtyDate, dirtyFormatStr, dirtyOptions) {
11544
11503
  var firstCharacter = substring[0];
11545
11504
  if (firstCharacter === 'p' || firstCharacter === 'P') {
11546
11505
  var longFormatter = longFormatters$1[firstCharacter];
11547
- return longFormatter(substring, locale.formatLong, formatterOptions);
11506
+ return longFormatter(substring, locale.formatLong);
11548
11507
  }
11549
11508
  return substring;
11550
11509
  }).join('').match(formattingTokensRegExp).map(function (substring) {
@@ -11558,11 +11517,11 @@ function format$1(dirtyDate, dirtyFormatStr, dirtyOptions) {
11558
11517
  }
11559
11518
  var formatter = formatters$1[firstCharacter];
11560
11519
  if (formatter) {
11561
- if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {
11562
- throwProtectedError(substring, dirtyFormatStr, dirtyDate);
11520
+ if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) {
11521
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
11563
11522
  }
11564
- if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {
11565
- throwProtectedError(substring, dirtyFormatStr, dirtyDate);
11523
+ if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) {
11524
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
11566
11525
  }
11567
11526
  return formatter(utcDate, substring, locale.localize, formatterOptions);
11568
11527
  }
@@ -11574,23 +11533,28 @@ function format$1(dirtyDate, dirtyFormatStr, dirtyOptions) {
11574
11533
  return result;
11575
11534
  }
11576
11535
  function cleanEscapedString(input) {
11577
- return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
11536
+ var matched = input.match(escapedStringRegExp);
11537
+ if (!matched) {
11538
+ return input;
11539
+ }
11540
+ return matched[1].replace(doubleQuoteRegExp, "'");
11578
11541
  }
11579
11542
 
11580
- function convertToFP(fn, arity, a) {
11581
- a = a || [];
11543
+ function convertToFP(fn, arity) {
11544
+ var a = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
11582
11545
  if (a.length >= arity) {
11583
11546
  return fn.apply(null, a.slice(0, arity).reverse());
11584
11547
  }
11585
11548
  return function () {
11586
- var args = Array.prototype.slice.call(arguments);
11549
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
11550
+ args[_key] = arguments[_key];
11551
+ }
11587
11552
  return convertToFP(fn, arity, a.concat(args));
11588
11553
  };
11589
11554
  }
11590
11555
 
11591
- // This file is generated automatically by `scripts/build/fp.js`. Please, don't change it.
11592
- var format = convertToFP(format$1, 2);
11593
- var formatTime = format;
11556
+ // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
11557
+ var formatTime = convertToFP(format, 2);
11594
11558
 
11595
11559
  var Wrapper = index$9(reactNative.View)(function () {
11596
11560
  return {
@@ -12356,7 +12320,7 @@ var StyledPageControlWrapper = index$9(reactNative.View)(function (_ref7) {
12356
12320
  });
12357
12321
 
12358
12322
  function isCarouselImageProps(image) {
12359
- return _typeof(image) === 'object';
12323
+ return _typeof$1(image) === 'object';
12360
12324
  }
12361
12325
  var CarouselItem = function CarouselItem(_ref) {
12362
12326
  var width = _ref.width,
@@ -18817,7 +18781,7 @@ var scheduler_production_min = {};
18817
18781
  var c = a.sortIndex - b.sortIndex;
18818
18782
  return 0 !== c ? c : a.id - b.id;
18819
18783
  }
18820
- if ("object" === (typeof performance === "undefined" ? "undefined" : _typeof(performance)) && "function" === typeof performance.now) {
18784
+ if ("object" === (typeof performance === "undefined" ? "undefined" : _typeof$1(performance)) && "function" === typeof performance.now) {
18821
18785
  var l = performance;
18822
18786
  exports.unstable_now = function () {
18823
18787
  return l.now();
@@ -18988,7 +18952,7 @@ var scheduler_production_min = {};
18988
18952
  };
18989
18953
  exports.unstable_scheduleCallback = function (a, b, c) {
18990
18954
  var d = exports.unstable_now();
18991
- "object" === _typeof(c) && null !== c ? (c = c.delay, c = "number" === typeof c && 0 < c ? d + c : d) : c = d;
18955
+ "object" === _typeof$1(c) && null !== c ? (c = c.delay, c = "number" === typeof c && 0 < c ? d + c : d) : c = d;
18992
18956
  switch (a) {
18993
18957
  case 1:
18994
18958
  var e = -1;
@@ -19066,7 +19030,7 @@ function oa(a) {
19066
19030
  }
19067
19031
  function pa(a, b, c, d) {
19068
19032
  if (null !== c && 0 === c.type) return !1;
19069
- switch (_typeof(b)) {
19033
+ switch (_typeof$1(b)) {
19070
19034
  case "function":
19071
19035
  case "symbol":
19072
19036
  return !0;
@@ -19176,7 +19140,7 @@ var ua = aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
19176
19140
  var Ia = Symbol["for"]("react.offscreen");
19177
19141
  var Ja = Symbol.iterator;
19178
19142
  function Ka(a) {
19179
- if (null === a || "object" !== _typeof(a)) return null;
19143
+ if (null === a || "object" !== _typeof$1(a)) return null;
19180
19144
  a = Ja && a[Ja] || a["@@iterator"];
19181
19145
  return "function" === typeof a ? a : null;
19182
19146
  }
@@ -19205,7 +19169,7 @@ function Oa(a, b) {
19205
19169
  set: function set() {
19206
19170
  throw Error();
19207
19171
  }
19208
- }), "object" === (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && Reflect.construct) {
19172
+ }), "object" === (typeof Reflect === "undefined" ? "undefined" : _typeof$1(Reflect)) && Reflect.construct) {
19209
19173
  try {
19210
19174
  Reflect.construct(b, []);
19211
19175
  } catch (l) {
@@ -19287,7 +19251,7 @@ function Qa(a) {
19287
19251
  case Fa:
19288
19252
  return "SuspenseList";
19289
19253
  }
19290
- if ("object" === _typeof(a)) switch (a.$$typeof) {
19254
+ if ("object" === _typeof$1(a)) switch (a.$$typeof) {
19291
19255
  case Ca:
19292
19256
  return (a.displayName || "Context") + ".Consumer";
19293
19257
  case Ba:
@@ -19359,7 +19323,7 @@ function Ra(a) {
19359
19323
  return null;
19360
19324
  }
19361
19325
  function Sa(a) {
19362
- switch (_typeof(a)) {
19326
+ switch (_typeof$1(a)) {
19363
19327
  case "boolean":
19364
19328
  case "number":
19365
19329
  case "string":
@@ -19670,9 +19634,9 @@ function ub(a, b) {
19670
19634
  if (tb[a] && (null != b.children || null != b.dangerouslySetInnerHTML)) throw Error(p(137, a));
19671
19635
  if (null != b.dangerouslySetInnerHTML) {
19672
19636
  if (null != b.children) throw Error(p(60));
19673
- if ("object" !== _typeof(b.dangerouslySetInnerHTML) || !("__html" in b.dangerouslySetInnerHTML)) throw Error(p(61));
19637
+ if ("object" !== _typeof$1(b.dangerouslySetInnerHTML) || !("__html" in b.dangerouslySetInnerHTML)) throw Error(p(61));
19674
19638
  }
19675
- if (null != b.style && "object" !== _typeof(b.style)) throw Error(p(62));
19639
+ if (null != b.style && "object" !== _typeof$1(b.style)) throw Error(p(62));
19676
19640
  }
19677
19641
  }
19678
19642
  function vb(a, b) {
@@ -19758,7 +19722,7 @@ function Kb(a, b) {
19758
19722
  a = !1;
19759
19723
  }
19760
19724
  if (a) return null;
19761
- if (c && "function" !== typeof c) throw Error(p(231, b, _typeof(c)));
19725
+ if (c && "function" !== typeof c) throw Error(p(231, b, _typeof$1(c)));
19762
19726
  return c;
19763
19727
  }
19764
19728
  var Lb = !1;
@@ -20672,7 +20636,7 @@ function ge(a, b) {
20672
20636
  }
20673
20637
  function he(a) {
20674
20638
  a = a.detail;
20675
- return "object" === _typeof(a) && "data" in a ? a.data : null;
20639
+ return "object" === _typeof$1(a) && "data" in a ? a.data : null;
20676
20640
  }
20677
20641
  var ie = !1;
20678
20642
  function je(a, b) {
@@ -20789,7 +20753,7 @@ function Ge(a, b) {
20789
20753
  var He = "function" === typeof Object.is ? Object.is : Ge;
20790
20754
  function Ie(a, b) {
20791
20755
  if (He(a, b)) return !0;
20792
- if ("object" !== _typeof(a) || null === a || "object" !== _typeof(b) || null === b) return !1;
20756
+ if ("object" !== _typeof$1(a) || null === a || "object" !== _typeof$1(b) || null === b) return !1;
20793
20757
  var c = Object.keys(a),
20794
20758
  d = Object.keys(b);
20795
20759
  if (c.length !== d.length) return !1;
@@ -21316,7 +21280,7 @@ function Bf() {}
21316
21280
  var Cf = null,
21317
21281
  Df = null;
21318
21282
  function Ef(a, b) {
21319
- return "textarea" === a || "noscript" === a || "string" === typeof b.children || "number" === typeof b.children || "object" === _typeof(b.dangerouslySetInnerHTML) && null !== b.dangerouslySetInnerHTML && null != b.dangerouslySetInnerHTML.__html;
21283
+ return "textarea" === a || "noscript" === a || "string" === typeof b.children || "number" === typeof b.children || "object" === _typeof$1(b.dangerouslySetInnerHTML) && null !== b.dangerouslySetInnerHTML && null != b.dangerouslySetInnerHTML.__html;
21320
21284
  }
21321
21285
  var Ff = "function" === typeof setTimeout ? setTimeout : void 0,
21322
21286
  Gf = "function" === typeof clearTimeout ? clearTimeout : void 0,
@@ -21964,7 +21928,7 @@ function ph(a, b, c) {
21964
21928
  var d = !1,
21965
21929
  e = Vf;
21966
21930
  var f = b.contextType;
21967
- "object" === _typeof(f) && null !== f ? f = Vg(f) : (e = Zf(b) ? Xf : H.current, d = b.contextTypes, f = (d = null !== d && void 0 !== d) ? Yf(a, e) : Vf);
21931
+ "object" === _typeof$1(f) && null !== f ? f = Vg(f) : (e = Zf(b) ? Xf : H.current, d = b.contextTypes, f = (d = null !== d && void 0 !== d) ? Yf(a, e) : Vf);
21968
21932
  b = new b(c, f);
21969
21933
  a.memoizedState = null !== b.state && void 0 !== b.state ? b.state : null;
21970
21934
  b.updater = nh;
@@ -21986,7 +21950,7 @@ function rh(a, b, c, d) {
21986
21950
  e.refs = jh;
21987
21951
  ah(a);
21988
21952
  var f = b.contextType;
21989
- "object" === _typeof(f) && null !== f ? e.context = Vg(f) : (f = Zf(b) ? Xf : H.current, e.context = Yf(a, f));
21953
+ "object" === _typeof$1(f) && null !== f ? e.context = Vg(f) : (f = Zf(b) ? Xf : H.current, e.context = Yf(a, f));
21990
21954
  e.state = a.memoizedState;
21991
21955
  f = b.getDerivedStateFromProps;
21992
21956
  "function" === typeof f && (kh(a, b, f, c), e.state = a.memoizedState);
@@ -21995,7 +21959,7 @@ function rh(a, b, c, d) {
21995
21959
  }
21996
21960
  function sh(a, b, c) {
21997
21961
  a = c.ref;
21998
- if (null !== a && "function" !== typeof a && "object" !== _typeof(a)) {
21962
+ if (null !== a && "function" !== typeof a && "object" !== _typeof$1(a)) {
21999
21963
  if (c._owner) {
22000
21964
  c = c._owner;
22001
21965
  if (c) {
@@ -22070,7 +22034,7 @@ function vh(a) {
22070
22034
  function k(a, b, c, d) {
22071
22035
  var f = c.type;
22072
22036
  if (f === ya) return m(a, b, c.props.children, d, c.key);
22073
- if (null !== b && (b.elementType === f || "object" === _typeof(f) && null !== f && f.$$typeof === Ha && uh(f) === b.type)) return d = e(b, c.props), d.ref = sh(a, b, c), d["return"] = a, d;
22037
+ if (null !== b && (b.elementType === f || "object" === _typeof$1(f) && null !== f && f.$$typeof === Ha && uh(f) === b.type)) return d = e(b, c.props), d.ref = sh(a, b, c), d["return"] = a, d;
22074
22038
  d = yh(c.type, c.key, c.props, null, a.mode, d);
22075
22039
  d.ref = sh(a, b, c);
22076
22040
  d["return"] = a;
@@ -22090,7 +22054,7 @@ function vh(a) {
22090
22054
  }
22091
22055
  function q(a, b, c) {
22092
22056
  if ("string" === typeof b && "" !== b || "number" === typeof b) return b = xh("" + b, a.mode, c), b["return"] = a, b;
22093
- if ("object" === _typeof(b) && null !== b) {
22057
+ if ("object" === _typeof$1(b) && null !== b) {
22094
22058
  switch (b.$$typeof) {
22095
22059
  case va:
22096
22060
  return c = yh(b.type, b.key, b.props, null, a.mode, c), c.ref = sh(a, null, b), c["return"] = a, c;
@@ -22108,7 +22072,7 @@ function vh(a) {
22108
22072
  function r(a, b, c, d) {
22109
22073
  var e = null !== b ? b.key : null;
22110
22074
  if ("string" === typeof c && "" !== c || "number" === typeof c) return null !== e ? null : h(a, b, "" + c, d);
22111
- if ("object" === _typeof(c) && null !== c) {
22075
+ if ("object" === _typeof$1(c) && null !== c) {
22112
22076
  switch (c.$$typeof) {
22113
22077
  case va:
22114
22078
  return c.key === e ? k(a, b, c, d) : null;
@@ -22124,7 +22088,7 @@ function vh(a) {
22124
22088
  }
22125
22089
  function y(a, b, c, d, e) {
22126
22090
  if ("string" === typeof d && "" !== d || "number" === typeof d) return a = a.get(c) || null, h(b, a, "" + d, e);
22127
- if ("object" === _typeof(d) && null !== d) {
22091
+ if ("object" === _typeof$1(d) && null !== d) {
22128
22092
  switch (d.$$typeof) {
22129
22093
  case va:
22130
22094
  return a = a.get(null === d.key ? c : d.key) || null, k(b, a, d, e);
@@ -22198,8 +22162,8 @@ function vh(a) {
22198
22162
  return l;
22199
22163
  }
22200
22164
  function J(a, d, f, h) {
22201
- "object" === _typeof(f) && null !== f && f.type === ya && null === f.key && (f = f.props.children);
22202
- if ("object" === _typeof(f) && null !== f) {
22165
+ "object" === _typeof$1(f) && null !== f && f.type === ya && null === f.key && (f = f.props.children);
22166
+ if ("object" === _typeof$1(f) && null !== f) {
22203
22167
  switch (f.$$typeof) {
22204
22168
  case va:
22205
22169
  a: {
@@ -22214,7 +22178,7 @@ function vh(a) {
22214
22178
  a = d;
22215
22179
  break a;
22216
22180
  }
22217
- } else if (l.elementType === k || "object" === _typeof(k) && null !== k && k.$$typeof === Ha && uh(k) === l.type) {
22181
+ } else if (l.elementType === k || "object" === _typeof$1(k) && null !== k && k.$$typeof === Ha && uh(k) === l.type) {
22218
22182
  c(a, l.sibling);
22219
22183
  d = e(l, f.props);
22220
22184
  d.ref = sh(a, l, f);
@@ -23099,7 +23063,7 @@ function ij(a, b, c, d, e) {
23099
23063
  g.props = h;
23100
23064
  var k = g.context,
23101
23065
  l = c.contextType;
23102
- "object" === _typeof(l) && null !== l ? l = Vg(l) : (l = Zf(c) ? Xf : H.current, l = Yf(b, l));
23066
+ "object" === _typeof$1(l) && null !== l ? l = Vg(l) : (l = Zf(c) ? Xf : H.current, l = Yf(b, l));
23103
23067
  var m = c.getDerivedStateFromProps,
23104
23068
  q = "function" === typeof m || "function" === typeof g.getSnapshotBeforeUpdate;
23105
23069
  q || "function" !== typeof g.UNSAFE_componentWillReceiveProps && "function" !== typeof g.componentWillReceiveProps || (h !== d || k !== l) && qh(b, g, d, l);
@@ -23118,7 +23082,7 @@ function ij(a, b, c, d, e) {
23118
23082
  q = b.pendingProps;
23119
23083
  r = g.context;
23120
23084
  k = c.contextType;
23121
- "object" === _typeof(k) && null !== k ? k = Vg(k) : (k = Zf(c) ? Xf : H.current, k = Yf(b, k));
23085
+ "object" === _typeof$1(k) && null !== k ? k = Vg(k) : (k = Zf(c) ? Xf : H.current, k = Yf(b, k));
23122
23086
  var y = c.getDerivedStateFromProps;
23123
23087
  (m = "function" === typeof y || "function" === typeof g.getSnapshotBeforeUpdate) || "function" !== typeof g.UNSAFE_componentWillReceiveProps && "function" !== typeof g.componentWillReceiveProps || (h !== q || r !== k) && qh(b, g, d, k);
23124
23088
  $g = !1;
@@ -25031,7 +24995,7 @@ function Nk(a, b) {
25031
24995
  k = b;
25032
24996
  b = Z;
25033
24997
  h.flags |= 32768;
25034
- if (null !== k && "object" === _typeof(k) && "function" === typeof k.then) {
24998
+ if (null !== k && "object" === _typeof$1(k) && "function" === typeof k.then) {
25035
24999
  var l = k,
25036
25000
  m = h,
25037
25001
  q = m.tag;
@@ -25452,7 +25416,7 @@ Wk = function Wk(a, b, c) {
25452
25416
  e = Xh(null, b, d, a, e, c);
25453
25417
  var f = bi();
25454
25418
  b.flags |= 1;
25455
- "object" === _typeof(e) && null !== e && "function" === typeof e.render && void 0 === e.$$typeof ? (b.tag = 1, b.memoizedState = null, b.updateQueue = null, Zf(d) ? (f = !0, cg(b)) : f = !1, b.memoizedState = null !== e.state && void 0 !== e.state ? e.state : null, ah(b), e.updater = nh, b.stateNode = e, e._reactInternals = b, rh(b, d, a, c), b = kj(null, b, d, !0, f, c)) : (b.tag = 0, I && f && vg(b), Yi(null, b, e, c), b = b.child);
25419
+ "object" === _typeof$1(e) && null !== e && "function" === typeof e.render && void 0 === e.$$typeof ? (b.tag = 1, b.memoizedState = null, b.updateQueue = null, Zf(d) ? (f = !0, cg(b)) : f = !1, b.memoizedState = null !== e.state && void 0 !== e.state ? e.state : null, ah(b), e.updater = nh, b.stateNode = e, e._reactInternals = b, rh(b, d, a, c), b = kj(null, b, d, !0, f, c)) : (b.tag = 0, I && f && vg(b), Yi(null, b, e, c), b = b.child);
25456
25420
  return b;
25457
25421
  case 16:
25458
25422
  d = b.elementType;
@@ -25693,7 +25657,7 @@ function yh(a, b, c, d, e, f) {
25693
25657
  case Ia:
25694
25658
  return qj(c, e, f, b);
25695
25659
  default:
25696
- if ("object" === _typeof(a) && null !== a) switch (a.$$typeof) {
25660
+ if ("object" === _typeof$1(a) && null !== a) switch (a.$$typeof) {
25697
25661
  case Ba:
25698
25662
  g = 10;
25699
25663
  break a;
@@ -25711,7 +25675,7 @@ function yh(a, b, c, d, e, f) {
25711
25675
  d = null;
25712
25676
  break a;
25713
25677
  }
25714
- throw Error(p(130, null == a ? a : _typeof(a), ""));
25678
+ throw Error(p(130, null == a ? a : _typeof$1(a), ""));
25715
25679
  }
25716
25680
  b = Bg(g, c, b, e);
25717
25681
  b.elementType = a;
@@ -26205,7 +26169,7 @@ function checkDCE() {
26205
26169
  });
26206
26170
  }, r.t = function (e, t) {
26207
26171
  if (1 & t && (e = r(e)), 8 & t) return e;
26208
- if (4 & t && "object" == _typeof(e) && e && e.__esModule) return e;
26172
+ if (4 & t && "object" == _typeof$1(e) && e && e.__esModule) return e;
26209
26173
  var n = Object.create(null);
26210
26174
  if (r.r(n), Object.defineProperty(n, "default", {
26211
26175
  enumerable: !0,
@@ -26427,7 +26391,7 @@ function checkDCE() {
26427
26391
  }, t.parseHotkey = c, t.compareHotkey = l, t.toKeyCode = d, t.toKeyName = f;
26428
26392
  }, function (e, t) {
26429
26393
  e.exports = function (e) {
26430
- var t = _typeof(e);
26394
+ var t = _typeof$1(e);
26431
26395
  return null != e && ("object" == t || "function" == t);
26432
26396
  };
26433
26397
  }, function (e, t, r) {
@@ -26455,7 +26419,7 @@ function checkDCE() {
26455
26419
  };
26456
26420
  }, function (e, t, r) {
26457
26421
  var n = r(11),
26458
- u = "object" == (typeof self === "undefined" ? "undefined" : _typeof(self)) && self && self.Object === Object && self,
26422
+ u = "object" == (typeof self === "undefined" ? "undefined" : _typeof$1(self)) && self && self.Object === Object && self,
26459
26423
  o = n || u || Function("return this")();
26460
26424
  e.exports = o;
26461
26425
  }, function (e, t, r) {
@@ -26470,7 +26434,7 @@ function checkDCE() {
26470
26434
  };
26471
26435
  }, function (e, t, r) {
26472
26436
  (function (t) {
26473
- var r = "object" == _typeof(t) && t && t.Object === Object && t;
26437
+ var r = "object" == _typeof$1(t) && t && t.Object === Object && t;
26474
26438
  e.exports = r;
26475
26439
  }).call(this, r(12));
26476
26440
  }, function (e, t) {
@@ -26481,7 +26445,7 @@ function checkDCE() {
26481
26445
  try {
26482
26446
  r = r || new Function("return this")();
26483
26447
  } catch (e) {
26484
- "object" == (typeof window === "undefined" ? "undefined" : _typeof(window)) && (r = window);
26448
+ "object" == (typeof window === "undefined" ? "undefined" : _typeof$1(window)) && (r = window);
26485
26449
  }
26486
26450
  e.exports = r;
26487
26451
  }, function (e, t, r) {
@@ -26508,7 +26472,7 @@ function checkDCE() {
26508
26472
  var n = r(15),
26509
26473
  u = r(18);
26510
26474
  e.exports = function (e) {
26511
- return "symbol" == _typeof(e) || u(e) && "[object Symbol]" == n(e);
26475
+ return "symbol" == _typeof$1(e) || u(e) && "[object Symbol]" == n(e);
26512
26476
  };
26513
26477
  }, function (e, t, r) {
26514
26478
  var n = r(8),
@@ -26541,7 +26505,7 @@ function checkDCE() {
26541
26505
  };
26542
26506
  }, function (e, t) {
26543
26507
  e.exports = function (e) {
26544
- return null != e && "object" == _typeof(e);
26508
+ return null != e && "object" == _typeof$1(e);
26545
26509
  };
26546
26510
  }, function (e, t, r) {
26547
26511
 
@@ -26622,7 +26586,7 @@ function checkDCE() {
26622
26586
  }
26623
26587
  function c(e) {
26624
26588
  return !!e && (function (e) {
26625
- if (!e || "object" != _typeof(e)) return !1;
26589
+ if (!e || "object" != _typeof$1(e)) return !1;
26626
26590
  var t = Object.getPrototypeOf(e);
26627
26591
  if (null === t) return !0;
26628
26592
  var r = Object.hasOwnProperty.call(t, "constructor") && t.constructor;
@@ -26631,7 +26595,7 @@ function checkDCE() {
26631
26595
  }
26632
26596
  function l(e, t, r) {
26633
26597
  void 0 === r && (r = !1), 0 === d(e) ? (r ? Object.keys : Z)(e).forEach(function (n) {
26634
- r && "symbol" == _typeof(n) || t(n, e[n], e);
26598
+ r && "symbol" == _typeof$1(n) || t(n, e[n], e);
26635
26599
  }) : e.forEach(function (r, n) {
26636
26600
  return t(n, r, e);
26637
26601
  });
@@ -26687,7 +26651,7 @@ function checkDCE() {
26687
26651
  i(2);
26688
26652
  }
26689
26653
  function b(e) {
26690
- return null == e || "object" != _typeof(e) || Object.isFrozen(e);
26654
+ return null == e || "object" != _typeof$1(e) || Object.isFrozen(e);
26691
26655
  }
26692
26656
  function y(e) {
26693
26657
  var t = Q[e];
@@ -26824,7 +26788,7 @@ function checkDCE() {
26824
26788
  }
26825
26789
  var W,
26826
26790
  V,
26827
- q = "undefined" != typeof Symbol && "symbol" == _typeof(Symbol("x")),
26791
+ q = "undefined" != typeof Symbol && "symbol" == _typeof$1(Symbol("x")),
26828
26792
  H = "undefined" != typeof Map,
26829
26793
  U = "undefined" != typeof Set,
26830
26794
  K = "undefined" != typeof Proxy && void 0 !== Proxy.revocable && "undefined" != typeof Reflect,
@@ -26939,7 +26903,7 @@ function checkDCE() {
26939
26903
  throw w(s), e;
26940
26904
  }) : (F(s, n), k(a, s));
26941
26905
  }
26942
- if (!e || "object" != _typeof(e)) {
26906
+ if (!e || "object" != _typeof$1(e)) {
26943
26907
  if ((a = r(e)) === $) return;
26944
26908
  return void 0 === a && (a = e), t.F && m(a, !0), a;
26945
26909
  }
@@ -31174,7 +31138,7 @@ function checkDCE() {
31174
31138
  Ut = r(6),
31175
31139
  Kt = r.n(Ut);
31176
31140
  function $t(e) {
31177
- return null != e && "object" == _typeof(e) && 1 === e.nodeType;
31141
+ return null != e && "object" == _typeof$1(e) && 1 === e.nodeType;
31178
31142
  }
31179
31143
  function Jt(e, t) {
31180
31144
  return (!t || "hidden" !== e) && "visible" !== e && "clip" !== e;