children such as `TableCell`.\n */\n children: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object.isRequired,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes\n /* @typescript-to-proptypes-ignore */\n .elementType,\n\n /**\n * If `true`, the table row will shade on hover.\n */\n hover: PropTypes.bool,\n\n /**\n * If `true`, the table row will have the selected shading.\n */\n selected: PropTypes.bool\n} : void 0;\nexport default withStyles(styles, {\n name: 'MuiTableRow'\n})(TableRow);","import _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { chainPropTypes } from '@material-ui/utils';\nimport withStyles from '../styles/withStyles';\nimport capitalize from '../utils/capitalize';\nimport { darken, alpha, lighten } from '../styles/colorManipulator';\nimport TableContext from '../Table/TableContext';\nimport Tablelvl2Context from '../Table/Tablelvl2Context';\nexport var styles = function styles(theme) {\n return {\n /* Styles applied to the root element. */\n root: _extends({}, theme.typography.body2, {\n display: 'table-cell',\n verticalAlign: 'inherit',\n // Workaround for a rendering bug with spanned columns in Chrome 62.0.\n // Removes the alpha (sets it to 1), and lightens or darkens the theme color.\n borderBottom: \"1px solid\\n \".concat(theme.palette.type === 'light' ? lighten(alpha(theme.palette.divider, 1), 0.88) : darken(alpha(theme.palette.divider, 1), 0.68)),\n textAlign: 'left',\n padding: 16\n }),\n\n /* Styles applied to the root element if `variant=\"head\"` or `context.table.head`. */\n head: {\n color: theme.palette.text.primary,\n lineHeight: theme.typography.pxToRem(24),\n fontWeight: theme.typography.fontWeightMedium\n },\n\n /* Styles applied to the root element if `variant=\"body\"` or `context.table.body`. */\n body: {\n color: theme.palette.text.primary\n },\n\n /* Styles applied to the root element if `variant=\"footer\"` or `context.table.footer`. */\n footer: {\n color: theme.palette.text.secondary,\n lineHeight: theme.typography.pxToRem(21),\n fontSize: theme.typography.pxToRem(12)\n },\n\n /* Styles applied to the root element if `size=\"small\"`. */\n sizeSmall: {\n padding: '6px 24px 6px 16px',\n '&:last-child': {\n paddingRight: 16\n },\n '&$paddingCheckbox': {\n width: 24,\n // prevent the checkbox column from growing\n padding: '0 12px 0 16px',\n '&:last-child': {\n paddingLeft: 12,\n paddingRight: 16\n },\n '& > *': {\n padding: 0\n }\n }\n },\n\n /* Styles applied to the root element if `padding=\"checkbox\"`. */\n paddingCheckbox: {\n width: 48,\n // prevent the checkbox column from growing\n padding: '0 0 0 4px',\n '&:last-child': {\n paddingLeft: 0,\n paddingRight: 4\n }\n },\n\n /* Styles applied to the root element if `padding=\"none\"`. */\n paddingNone: {\n padding: 0,\n '&:last-child': {\n padding: 0\n }\n },\n\n /* Styles applied to the root element if `align=\"left\"`. */\n alignLeft: {\n textAlign: 'left'\n },\n\n /* Styles applied to the root element if `align=\"center\"`. */\n alignCenter: {\n textAlign: 'center'\n },\n\n /* Styles applied to the root element if `align=\"right\"`. */\n alignRight: {\n textAlign: 'right',\n flexDirection: 'row-reverse'\n },\n\n /* Styles applied to the root element if `align=\"justify\"`. */\n alignJustify: {\n textAlign: 'justify'\n },\n\n /* Styles applied to the root element if `context.table.stickyHeader={true}`. */\n stickyHeader: {\n position: 'sticky',\n top: 0,\n left: 0,\n zIndex: 2,\n backgroundColor: theme.palette.background.default\n }\n };\n};\n/**\n * The component renders a `` element when the parent context is a header\n * or otherwise a ` | ` element.\n */\n\nvar TableCell = /*#__PURE__*/React.forwardRef(function TableCell(props, ref) {\n var _props$align = props.align,\n align = _props$align === void 0 ? 'inherit' : _props$align,\n classes = props.classes,\n className = props.className,\n component = props.component,\n paddingProp = props.padding,\n scopeProp = props.scope,\n sizeProp = props.size,\n sortDirection = props.sortDirection,\n variantProp = props.variant,\n other = _objectWithoutProperties(props, [\"align\", \"classes\", \"className\", \"component\", \"padding\", \"scope\", \"size\", \"sortDirection\", \"variant\"]);\n\n var table = React.useContext(TableContext);\n var tablelvl2 = React.useContext(Tablelvl2Context);\n var isHeadCell = tablelvl2 && tablelvl2.variant === 'head';\n var role;\n var Component;\n\n if (component) {\n Component = component;\n role = isHeadCell ? 'columnheader' : 'cell';\n } else {\n Component = isHeadCell ? 'th' : 'td';\n }\n\n var scope = scopeProp;\n\n if (!scope && isHeadCell) {\n scope = 'col';\n }\n\n var padding = paddingProp || (table && table.padding ? table.padding : 'normal');\n var size = sizeProp || (table && table.size ? table.size : 'medium');\n var variant = variantProp || tablelvl2 && tablelvl2.variant;\n var ariaSort = null;\n\n if (sortDirection) {\n ariaSort = sortDirection === 'asc' ? 'ascending' : 'descending';\n }\n\n return /*#__PURE__*/React.createElement(Component, _extends({\n ref: ref,\n className: clsx(classes.root, classes[variant], className, align !== 'inherit' && classes[\"align\".concat(capitalize(align))], padding !== 'normal' && classes[\"padding\".concat(capitalize(padding))], size !== 'medium' && classes[\"size\".concat(capitalize(size))], variant === 'head' && table && table.stickyHeader && classes.stickyHeader),\n \"aria-sort\": ariaSort,\n role: role,\n scope: scope\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? TableCell.propTypes = {\n /**\n * Set the text-align on the table cell content.\n *\n * Monetary or generally number fields **should be right aligned** as that allows\n * you to add them up quickly in your head without having to worry about decimals.\n */\n align: PropTypes.oneOf(['center', 'inherit', 'justify', 'left', 'right']),\n\n /**\n * The table cell contents.\n */\n children: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes\n /* @typescript-to-proptypes-ignore */\n .elementType,\n\n /**\n * Sets the padding applied to the cell.\n * By default, the Table parent component set the value (`normal`).\n * `default` is deprecated, use `normal` instead.\n */\n padding: chainPropTypes(PropTypes.oneOf(['normal', 'checkbox', 'none', 'default']), function (props) {\n if (props.padding === 'default') {\n return new Error('Material-UI: padding=\"default\" was renamed to padding=\"normal\" for consistency.');\n }\n\n return null;\n }),\n\n /**\n * Set scope attribute.\n */\n scope: PropTypes.string,\n\n /**\n * Specify the size of the cell.\n * By default, the Table parent component set the value (`medium`).\n */\n size: PropTypes.oneOf(['medium', 'small']),\n\n /**\n * Set aria-sort direction.\n */\n sortDirection: PropTypes.oneOf(['asc', 'desc', false]),\n\n /**\n * Specify the cell type.\n * By default, the TableHead, TableBody or TableFooter parent component set the value.\n */\n variant: PropTypes.oneOf(['body', 'footer', 'head'])\n} : void 0;\nexport default withStyles(styles, {\n name: 'MuiTableCell'\n})(TableCell);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport withStyles from '../styles/withStyles';\nimport Tablelvl2Context from '../Table/Tablelvl2Context';\nexport var styles = {\n /* Styles applied to the root element. */\n root: {\n display: 'table-row-group'\n }\n};\nvar tablelvl2 = {\n variant: 'body'\n};\nvar defaultComponent = 'tbody';\nvar TableBody = /*#__PURE__*/React.forwardRef(function TableBody(props, ref) {\n var classes = props.classes,\n className = props.className,\n _props$component = props.component,\n Component = _props$component === void 0 ? defaultComponent : _props$component,\n other = _objectWithoutProperties(props, [\"classes\", \"className\", \"component\"]);\n\n return /*#__PURE__*/React.createElement(Tablelvl2Context.Provider, {\n value: tablelvl2\n }, /*#__PURE__*/React.createElement(Component, _extends({\n className: clsx(classes.root, className),\n ref: ref,\n role: Component === defaultComponent ? null : 'rowgroup'\n }, other)));\n});\nprocess.env.NODE_ENV !== \"production\" ? TableBody.propTypes = {\n /**\n * The content of the component, normally `TableRow`.\n */\n children: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object.isRequired,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes\n /* @typescript-to-proptypes-ignore */\n .elementType\n} : void 0;\nexport default withStyles(styles, {\n name: 'MuiTableBody'\n})(TableBody);","import * as React from 'react';\nimport createSvgIcon from '../../utils/createSvgIcon';\n/**\n * @ignore - internal component.\n */\n\nexport default createSvgIcon( /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z\"\n}), 'Cancel');","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport CancelIcon from '../internal/svg-icons/Cancel';\nimport withStyles from '../styles/withStyles';\nimport { emphasize, alpha } from '../styles/colorManipulator';\nimport useForkRef from '../utils/useForkRef';\nimport unsupportedProp from '../utils/unsupportedProp';\nimport capitalize from '../utils/capitalize';\nimport ButtonBase from '../ButtonBase';\nexport var styles = function styles(theme) {\n var backgroundColor = theme.palette.type === 'light' ? theme.palette.grey[300] : theme.palette.grey[700];\n var deleteIconColor = alpha(theme.palette.text.primary, 0.26);\n return {\n /* Styles applied to the root element. */\n root: {\n fontFamily: theme.typography.fontFamily,\n fontSize: theme.typography.pxToRem(13),\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n height: 32,\n color: theme.palette.getContrastText(backgroundColor),\n backgroundColor: backgroundColor,\n borderRadius: 32 / 2,\n whiteSpace: 'nowrap',\n transition: theme.transitions.create(['background-color', 'box-shadow']),\n // label will inherit this from root, then `clickable` class overrides this for both\n cursor: 'default',\n // We disable the focus ring for mouse, touch and keyboard users.\n outline: 0,\n textDecoration: 'none',\n border: 'none',\n // Remove `button` border\n padding: 0,\n // Remove `button` padding\n verticalAlign: 'middle',\n boxSizing: 'border-box',\n '&$disabled': {\n opacity: 0.5,\n pointerEvents: 'none'\n },\n '& $avatar': {\n marginLeft: 5,\n marginRight: -6,\n width: 24,\n height: 24,\n color: theme.palette.type === 'light' ? theme.palette.grey[700] : theme.palette.grey[300],\n fontSize: theme.typography.pxToRem(12)\n },\n '& $avatarColorPrimary': {\n color: theme.palette.primary.contrastText,\n backgroundColor: theme.palette.primary.dark\n },\n '& $avatarColorSecondary': {\n color: theme.palette.secondary.contrastText,\n backgroundColor: theme.palette.secondary.dark\n },\n '& $avatarSmall': {\n marginLeft: 4,\n marginRight: -4,\n width: 18,\n height: 18,\n fontSize: theme.typography.pxToRem(10)\n }\n },\n\n /* Styles applied to the root element if `size=\"small\"`. */\n sizeSmall: {\n height: 24\n },\n\n /* Styles applied to the root element if `color=\"primary\"`. */\n colorPrimary: {\n backgroundColor: theme.palette.primary.main,\n color: theme.palette.primary.contrastText\n },\n\n /* Styles applied to the root element if `color=\"secondary\"`. */\n colorSecondary: {\n backgroundColor: theme.palette.secondary.main,\n color: theme.palette.secondary.contrastText\n },\n\n /* Pseudo-class applied to the root element if `disabled={true}`. */\n disabled: {},\n\n /* Styles applied to the root element if `onClick` is defined or `clickable={true}`. */\n clickable: {\n userSelect: 'none',\n WebkitTapHighlightColor: 'transparent',\n cursor: 'pointer',\n '&:hover, &:focus': {\n backgroundColor: emphasize(backgroundColor, 0.08)\n },\n '&:active': {\n boxShadow: theme.shadows[1]\n }\n },\n\n /* Styles applied to the root element if `onClick` and `color=\"primary\"` is defined or `clickable={true}`. */\n clickableColorPrimary: {\n '&:hover, &:focus': {\n backgroundColor: emphasize(theme.palette.primary.main, 0.08)\n }\n },\n\n /* Styles applied to the root element if `onClick` and `color=\"secondary\"` is defined or `clickable={true}`. */\n clickableColorSecondary: {\n '&:hover, &:focus': {\n backgroundColor: emphasize(theme.palette.secondary.main, 0.08)\n }\n },\n\n /* Styles applied to the root element if `onDelete` is defined. */\n deletable: {\n '&:focus': {\n backgroundColor: emphasize(backgroundColor, 0.08)\n }\n },\n\n /* Styles applied to the root element if `onDelete` and `color=\"primary\"` is defined. */\n deletableColorPrimary: {\n '&:focus': {\n backgroundColor: emphasize(theme.palette.primary.main, 0.2)\n }\n },\n\n /* Styles applied to the root element if `onDelete` and `color=\"secondary\"` is defined. */\n deletableColorSecondary: {\n '&:focus': {\n backgroundColor: emphasize(theme.palette.secondary.main, 0.2)\n }\n },\n\n /* Styles applied to the root element if `variant=\"outlined\"`. */\n outlined: {\n backgroundColor: 'transparent',\n border: \"1px solid \".concat(theme.palette.type === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'),\n '$clickable&:hover, $clickable&:focus, $deletable&:focus': {\n backgroundColor: alpha(theme.palette.text.primary, theme.palette.action.hoverOpacity)\n },\n '& $avatar': {\n marginLeft: 4\n },\n '& $avatarSmall': {\n marginLeft: 2\n },\n '& $icon': {\n marginLeft: 4\n },\n '& $iconSmall': {\n marginLeft: 2\n },\n '& $deleteIcon': {\n marginRight: 5\n },\n '& $deleteIconSmall': {\n marginRight: 3\n }\n },\n\n /* Styles applied to the root element if `variant=\"outlined\"` and `color=\"primary\"`. */\n outlinedPrimary: {\n color: theme.palette.primary.main,\n border: \"1px solid \".concat(theme.palette.primary.main),\n '$clickable&:hover, $clickable&:focus, $deletable&:focus': {\n backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.hoverOpacity)\n }\n },\n\n /* Styles applied to the root element if `variant=\"outlined\"` and `color=\"secondary\"`. */\n outlinedSecondary: {\n color: theme.palette.secondary.main,\n border: \"1px solid \".concat(theme.palette.secondary.main),\n '$clickable&:hover, $clickable&:focus, $deletable&:focus': {\n backgroundColor: alpha(theme.palette.secondary.main, theme.palette.action.hoverOpacity)\n }\n },\n // TODO v5: remove\n\n /* Styles applied to the `avatar` element. */\n avatar: {},\n\n /* Styles applied to the `avatar` element if `size=\"small\"`. */\n avatarSmall: {},\n\n /* Styles applied to the `avatar` element if `color=\"primary\"`. */\n avatarColorPrimary: {},\n\n /* Styles applied to the `avatar` element if `color=\"secondary\"`. */\n avatarColorSecondary: {},\n\n /* Styles applied to the `icon` element. */\n icon: {\n color: theme.palette.type === 'light' ? theme.palette.grey[700] : theme.palette.grey[300],\n marginLeft: 5,\n marginRight: -6\n },\n\n /* Styles applied to the `icon` element if `size=\"small\"`. */\n iconSmall: {\n width: 18,\n height: 18,\n marginLeft: 4,\n marginRight: -4\n },\n\n /* Styles applied to the `icon` element if `color=\"primary\"`. */\n iconColorPrimary: {\n color: 'inherit'\n },\n\n /* Styles applied to the `icon` element if `color=\"secondary\"`. */\n iconColorSecondary: {\n color: 'inherit'\n },\n\n /* Styles applied to the label `span` element. */\n label: {\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n paddingLeft: 12,\n paddingRight: 12,\n whiteSpace: 'nowrap'\n },\n\n /* Styles applied to the label `span` element if `size=\"small\"`. */\n labelSmall: {\n paddingLeft: 8,\n paddingRight: 8\n },\n\n /* Styles applied to the `deleteIcon` element. */\n deleteIcon: {\n WebkitTapHighlightColor: 'transparent',\n color: deleteIconColor,\n height: 22,\n width: 22,\n cursor: 'pointer',\n margin: '0 5px 0 -6px',\n '&:hover': {\n color: alpha(deleteIconColor, 0.4)\n }\n },\n\n /* Styles applied to the `deleteIcon` element if `size=\"small\"`. */\n deleteIconSmall: {\n height: 16,\n width: 16,\n marginRight: 4,\n marginLeft: -4\n },\n\n /* Styles applied to the deleteIcon element if `color=\"primary\"` and `variant=\"default\"`. */\n deleteIconColorPrimary: {\n color: alpha(theme.palette.primary.contrastText, 0.7),\n '&:hover, &:active': {\n color: theme.palette.primary.contrastText\n }\n },\n\n /* Styles applied to the deleteIcon element if `color=\"secondary\"` and `variant=\"default\"`. */\n deleteIconColorSecondary: {\n color: alpha(theme.palette.secondary.contrastText, 0.7),\n '&:hover, &:active': {\n color: theme.palette.secondary.contrastText\n }\n },\n\n /* Styles applied to the deleteIcon element if `color=\"primary\"` and `variant=\"outlined\"`. */\n deleteIconOutlinedColorPrimary: {\n color: alpha(theme.palette.primary.main, 0.7),\n '&:hover, &:active': {\n color: theme.palette.primary.main\n }\n },\n\n /* Styles applied to the deleteIcon element if `color=\"secondary\"` and `variant=\"outlined\"`. */\n deleteIconOutlinedColorSecondary: {\n color: alpha(theme.palette.secondary.main, 0.7),\n '&:hover, &:active': {\n color: theme.palette.secondary.main\n }\n }\n };\n};\n\nfunction isDeleteKeyboardEvent(keyboardEvent) {\n return keyboardEvent.key === 'Backspace' || keyboardEvent.key === 'Delete';\n}\n/**\n * Chips represent complex entities in small blocks, such as a contact.\n */\n\n\nvar Chip = /*#__PURE__*/React.forwardRef(function Chip(props, ref) {\n var avatarProp = props.avatar,\n classes = props.classes,\n className = props.className,\n clickableProp = props.clickable,\n _props$color = props.color,\n color = _props$color === void 0 ? 'default' : _props$color,\n ComponentProp = props.component,\n deleteIconProp = props.deleteIcon,\n _props$disabled = props.disabled,\n disabled = _props$disabled === void 0 ? false : _props$disabled,\n iconProp = props.icon,\n label = props.label,\n onClick = props.onClick,\n onDelete = props.onDelete,\n onKeyDown = props.onKeyDown,\n onKeyUp = props.onKeyUp,\n _props$size = props.size,\n size = _props$size === void 0 ? 'medium' : _props$size,\n _props$variant = props.variant,\n variant = _props$variant === void 0 ? 'default' : _props$variant,\n other = _objectWithoutProperties(props, [\"avatar\", \"classes\", \"className\", \"clickable\", \"color\", \"component\", \"deleteIcon\", \"disabled\", \"icon\", \"label\", \"onClick\", \"onDelete\", \"onKeyDown\", \"onKeyUp\", \"size\", \"variant\"]);\n\n var chipRef = React.useRef(null);\n var handleRef = useForkRef(chipRef, ref);\n\n var handleDeleteIconClick = function handleDeleteIconClick(event) {\n // Stop the event from bubbling up to the `Chip`\n event.stopPropagation();\n\n if (onDelete) {\n onDelete(event);\n }\n };\n\n var handleKeyDown = function handleKeyDown(event) {\n // Ignore events from children of `Chip`.\n if (event.currentTarget === event.target && isDeleteKeyboardEvent(event)) {\n // will be handled in keyUp, otherwise some browsers\n // might init navigation\n event.preventDefault();\n }\n\n if (onKeyDown) {\n onKeyDown(event);\n }\n };\n\n var handleKeyUp = function handleKeyUp(event) {\n // Ignore events from children of `Chip`.\n if (event.currentTarget === event.target) {\n if (onDelete && isDeleteKeyboardEvent(event)) {\n onDelete(event);\n } else if (event.key === 'Escape' && chipRef.current) {\n chipRef.current.blur();\n }\n }\n\n if (onKeyUp) {\n onKeyUp(event);\n }\n };\n\n var clickable = clickableProp !== false && onClick ? true : clickableProp;\n var small = size === 'small';\n var Component = ComponentProp || (clickable ? ButtonBase : 'div');\n var moreProps = Component === ButtonBase ? {\n component: 'div'\n } : {};\n var deleteIcon = null;\n\n if (onDelete) {\n var customClasses = clsx(color !== 'default' && (variant === \"default\" ? classes[\"deleteIconColor\".concat(capitalize(color))] : classes[\"deleteIconOutlinedColor\".concat(capitalize(color))]), small && classes.deleteIconSmall);\n deleteIcon = deleteIconProp && /*#__PURE__*/React.isValidElement(deleteIconProp) ? /*#__PURE__*/React.cloneElement(deleteIconProp, {\n className: clsx(deleteIconProp.props.className, classes.deleteIcon, customClasses),\n onClick: handleDeleteIconClick\n }) : /*#__PURE__*/React.createElement(CancelIcon, {\n className: clsx(classes.deleteIcon, customClasses),\n onClick: handleDeleteIconClick\n });\n }\n\n var avatar = null;\n\n if (avatarProp && /*#__PURE__*/React.isValidElement(avatarProp)) {\n avatar = /*#__PURE__*/React.cloneElement(avatarProp, {\n className: clsx(classes.avatar, avatarProp.props.className, small && classes.avatarSmall, color !== 'default' && classes[\"avatarColor\".concat(capitalize(color))])\n });\n }\n\n var icon = null;\n\n if (iconProp && /*#__PURE__*/React.isValidElement(iconProp)) {\n icon = /*#__PURE__*/React.cloneElement(iconProp, {\n className: clsx(classes.icon, iconProp.props.className, small && classes.iconSmall, color !== 'default' && classes[\"iconColor\".concat(capitalize(color))])\n });\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (avatar && icon) {\n console.error('Material-UI: The Chip component can not handle the avatar ' + 'and the icon prop at the same time. Pick one.');\n }\n }\n\n return /*#__PURE__*/React.createElement(Component, _extends({\n role: clickable || onDelete ? 'button' : undefined,\n className: clsx(classes.root, className, color !== 'default' && [classes[\"color\".concat(capitalize(color))], clickable && classes[\"clickableColor\".concat(capitalize(color))], onDelete && classes[\"deletableColor\".concat(capitalize(color))]], variant !== \"default\" && [classes.outlined, {\n 'primary': classes.outlinedPrimary,\n 'secondary': classes.outlinedSecondary\n }[color]], disabled && classes.disabled, small && classes.sizeSmall, clickable && classes.clickable, onDelete && classes.deletable),\n \"aria-disabled\": disabled ? true : undefined,\n tabIndex: clickable || onDelete ? 0 : undefined,\n onClick: onClick,\n onKeyDown: handleKeyDown,\n onKeyUp: handleKeyUp,\n ref: handleRef\n }, moreProps, other), avatar || icon, /*#__PURE__*/React.createElement(\"span\", {\n className: clsx(classes.label, small && classes.labelSmall)\n }, label), deleteIcon);\n});\nprocess.env.NODE_ENV !== \"production\" ? Chip.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * Avatar element.\n */\n avatar: PropTypes.element,\n\n /**\n * This prop isn't supported.\n * Use the `component` prop if you need to change the children structure.\n */\n children: unsupportedProp,\n\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * If `true`, the chip will appear clickable, and will raise when pressed,\n * even if the onClick prop is not defined.\n * If false, the chip will not be clickable, even if onClick prop is defined.\n * This can be used, for example,\n * along with the component prop to indicate an anchor Chip is clickable.\n */\n clickable: PropTypes.bool,\n\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n */\n color: PropTypes.oneOf(['default', 'primary', 'secondary']),\n\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes\n /* @typescript-to-proptypes-ignore */\n .elementType,\n\n /**\n * Override the default delete icon element. Shown only if `onDelete` is set.\n */\n deleteIcon: PropTypes.element,\n\n /**\n * If `true`, the chip should be displayed in a disabled state.\n */\n disabled: PropTypes.bool,\n\n /**\n * Icon element.\n */\n icon: PropTypes.element,\n\n /**\n * The content of the label.\n */\n label: PropTypes.node,\n\n /**\n * @ignore\n */\n onClick: PropTypes.func,\n\n /**\n * Callback function fired when the delete icon is clicked.\n * If set, the delete icon will be shown.\n */\n onDelete: PropTypes.func,\n\n /**\n * @ignore\n */\n onKeyDown: PropTypes.func,\n\n /**\n * @ignore\n */\n onKeyUp: PropTypes.func,\n\n /**\n * The size of the chip.\n */\n size: PropTypes.oneOf(['medium', 'small']),\n\n /**\n * The variant to use.\n */\n variant: PropTypes.oneOf(['default', 'outlined'])\n} : void 0;\nexport default withStyles(styles, {\n name: 'MuiChip'\n})(Chip);","import * as React from 'react';\nimport createSvgIcon from './utils/createSvgIcon';\nexport default createSvgIcon( /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13 5v6h1.17L12 13.17 9.83 11H11V5h2m2-2H9v6H5l7 7 7-7h-4V3zm4 15H5v2h14v-2z\"\n}), 'GetAppOutlined');","import * as React from 'react';\nimport createSvgIcon from './utils/createSvgIcon';\nexport default createSvgIcon( /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6.05 8.05c-2.73 2.73-2.73 7.17 0 9.9C7.42 19.32 9.21 20 11 20s3.58-.68 4.95-2.05C19.43 14.47 20 4 20 4S9.53 4.57 6.05 8.05zm8.49 8.49c-.95.94-2.2 1.46-3.54 1.46-.89 0-1.73-.25-2.48-.68.92-2.88 2.62-5.41 4.88-7.32-2.63 1.36-4.84 3.46-6.37 6-1.48-1.96-1.35-4.75.44-6.54C9.21 7.72 14.04 6.65 17.8 6.2c-.45 3.76-1.52 8.59-3.26 10.34z\"\n}), 'EcoOutlined');","\r\nimport LogoDefault from '../images/Logos/logo_default.png';\r\n\r\n\r\n\r\nexport const EnumCompany = {\r\n companies: {\r\n aegean: 'A3',\r\n aeroLines: 'AR',\r\n aeroflot: 'SU',\r\n aeroMexico: 'AM',\r\n airCanada: 'AC',\r\n airChina: 'CA',\r\n airEuropa: 'UX',\r\n airFrance: 'AF',\r\n alaskaAirlines: 'AS',\r\n amaszonas: 'Z8',\r\n americanAirlines: 'AA',\r\n ana: 'NH',\r\n austrian: 'OS',\r\n avianca: 'AV',\r\n azul: 'AD',\r\n boa: 'OB',\r\n britishAirways: 'BA',\r\n brusselsAirlines: 'SN',\r\n cathayPacific: 'CX',\r\n chinaSouthern: 'CZ',\r\n condor: 'DE',\r\n copaAirlines: 'CM',\r\n delta: 'DL',\r\n emirates: 'EK',\r\n etihad: 'EY',\r\n finnair: 'AY',\r\n gol: 'G3',\r\n hawaiin: 'HA',\r\n iberia: 'IB',\r\n itapemirim: '8I',\r\n japanAirlines: 'JL',\r\n jetBlue: 'B6',\r\n kenyaAirways: 'KQ',\r\n klm: 'KL',\r\n koreanAir: 'KE',\r\n latam: 'LA',\r\n latamJJ: 'JJ',\r\n lot: 'LO',\r\n lufthansa: 'LH',\r\n luxair: 'LG',\r\n map: '7M',\r\n qantas: 'QF',\r\n qatar: 'QR',\r\n singapore: 'SQ',\r\n skyAirline: 'H2',\r\n swiss: 'LX',\r\n taag: 'DT',\r\n tapPortugal: 'TP',\r\n turkishAirlines: 'TK',\r\n united: 'UA',\r\n voePass: '2Z',\r\n vueling: 'VY',\r\n },\r\n\r\n companiesLogo: {\r\n aegean: LogoDefault,\r\n aeroLines: LogoDefault,\r\n aeroflot: LogoDefault,\r\n aeroMexico: LogoDefault,\r\n airCanada: LogoDefault,\r\n airChina: LogoDefault,\r\n airEuropa: LogoDefault,\r\n airFrance: LogoDefault,\r\n alaskaAirlines: LogoDefault,\r\n amaszonas: LogoDefault,\r\n americanAirlines: LogoDefault,\r\n ana: LogoDefault,\r\n austrian: LogoDefault,\r\n avianca: LogoDefault,\r\n azul: LogoDefault,\r\n boa: LogoDefault,\r\n britishAirways: LogoDefault,\r\n brusselsAirlines: LogoDefault,\r\n cathayPacific: LogoDefault,\r\n chinaSouthern: LogoDefault,\r\n condor: LogoDefault,\r\n copaAirlines: LogoDefault,\r\n delta: LogoDefault,\r\n emirates: LogoDefault,\r\n etihad: LogoDefault,\r\n finnair: LogoDefault,\r\n gol: LogoDefault,\r\n hawaiin: LogoDefault,\r\n iberia: LogoDefault,\r\n ietBlue: LogoDefault,\r\n itapemirim: LogoDefault,\r\n japanAirlines: LogoDefault,\r\n kenyaAirways: LogoDefault,\r\n klm: LogoDefault,\r\n koreanAir: LogoDefault,\r\n latam: LogoDefault,\r\n lot: LogoDefault,\r\n lufthansa: LogoDefault,\r\n luxair: LogoDefault,\r\n map: LogoDefault,\r\n qantas: LogoDefault,\r\n qatar: LogoDefault,\r\n singapore: LogoDefault,\r\n skyAirline: LogoDefault,\r\n swiss: LogoDefault,\r\n taag: LogoDefault,\r\n tapPortugal: LogoDefault,\r\n turkishAirlines: LogoDefault,\r\n united: LogoDefault,\r\n voePass: LogoDefault,\r\n vueling: LogoDefault,\r\n },\r\n\r\n companiesNome: {\r\n aegean: 'Aegean Airlines',\r\n aeroLines: 'Aerolíneas Argentinas',\r\n aeroflot: 'Aeroflot',\r\n aeroMexico: 'Aeromexico',\r\n airCanada: 'Air Canada',\r\n airChina: 'Air China',\r\n airEuropa: 'Air Europa',\r\n airFrance: 'Air France',\r\n alaskaAirlines: 'Alaska Airlines',\r\n amaszonas: 'Amaszonas',\r\n americanAirlines: 'American Airlines',\r\n ana: 'All Nippon Airways',\r\n austrian: 'Austrian Airlines',\r\n avianca: 'Avianca',\r\n azul: 'Azul',\r\n boa: 'Boliviana de Aviacion',\r\n britishAirways: 'British Airways',\r\n brusselsAirlines: 'Brussels Airlines',\r\n cathayPacific: 'Cathay Pacific Airways',\r\n chinaSouthern: 'China Southern Airlines',\r\n condor: 'Condor',\r\n copaAirlines: 'Copa Airlines',\r\n delta: 'Delta Airlines',\r\n emirates: 'Emirates',\r\n etihad: 'Etihad Airways',\r\n finnair: 'Finnair',\r\n gol: 'Gol',\r\n hawaiin: 'Hawaiian Airlines',\r\n iberia: 'Iberia Lineas Aereas',\r\n itapemirim: 'Itapemirim',\r\n japanAirlines: 'Japan Airlines',\r\n jetBlue: 'Jetblue Airways',\r\n kenyaAirways: 'Kenya Airways',\r\n klm: 'KLM',\r\n koreanAir: 'Korean Air Lines',\r\n latam: 'Latam',\r\n lot: 'LOT Polish Airlines',\r\n lufthansa: 'Lufthansa',\r\n luxair: 'Luxair',\r\n map: 'Map',\r\n qantas: 'Qantas Airways',\r\n qatar: 'Qatar Airways',\r\n singapore: 'Singapore Airlines',\r\n skyAirline: 'Sky Airline',\r\n swiss: 'SWISS',\r\n taag: 'Linhas Aereas de Angola',\r\n tapPortugal: 'TAP Portugal',\r\n turkishAirlines: 'Turkish Airlines',\r\n united: 'United',\r\n voePass: 'VoePass',\r\n vueling: 'Vueling Airlines',\r\n },\r\n\r\n companiesUrlLOW: {\r\n aegean: 'https://linesturdiag.blob.core.windows.net/logo-companhia/A3%20(Aegean)/A3_low.png',\r\n aeroLines: 'https://linesturdiag.blob.core.windows.net/logo-companhia/AR%20(Aero%20Lineas)/AR_low.png',\r\n aeroflot: 'https://linesturdiag.blob.core.windows.net/logo-companhia/SU%20(Aeroflot)/SU_low.png',\r\n aeroMexico: 'https://linesturdiag.blob.core.windows.net/logo-companhia/AM%20(Aero%20Mexico)/AM_low.png',\r\n airCanada: 'https://linesturdiag.blob.core.windows.net/logo-companhia/AC%20(Air%20Canada)/AC_low.png',\r\n airChina: 'https://linesturdiag.blob.core.windows.net/logo-companhia/CA%20(Air%20China)/CA_low.png',\r\n airEuropa: 'https://linesturdiag.blob.core.windows.net/logo-companhia/UX%20(Air%20Europa)/UX_low.png',\r\n airFrance: 'https://linesturdiag.blob.core.windows.net/logo-companhia/AF%20(Air%20France)/AF_low.png',\r\n alaskaAirlines: 'https://linesturdiag.blob.core.windows.net/logo-companhia/AS%20(Alaska%20Airlines)/AS_low.png',\r\n // amaszonas: '',\r\n americanAirlines: 'https://linesturdiag.blob.core.windows.net/logo-companhia/AA%20(American%20Airlines)/AA_low.png',\r\n ana: 'https://linesturdiag.blob.core.windows.net/logo-companhia/NH%20(Ana)/NH_low.png',\r\n austrian: 'https://linesturdiag.blob.core.windows.net/logo-companhia/OS%20(Austrian)/OS_low.png',\r\n avianca: 'https://linesturdiag.blob.core.windows.net/logo-companhia/AV%20(Avianca)/AV_low.png',\r\n azul: 'https://linesturdiag.blob.core.windows.net/logo-companhia/AD%20(Azul)/AD_low.png',\r\n boa: 'https://linesturdiag.blob.core.windows.net/logo-companhia/OB%20(BoA)/OB_low.png',\r\n britishAirways: 'https://linesturdiag.blob.core.windows.net/logo-companhia/BA%20(British%20Airways)/BA_low.png',\r\n brusselsAirlines: 'https://linesturdiag.blob.core.windows.net/logo-companhia/SN%20(Brussels%20airlines)/SN_low.png',\r\n cathayPacific: 'https://linesturdiag.blob.core.windows.net/logo-companhia/CX%20(Cathay%20Pacific)/CX_low.png',\r\n chinaSouthern: 'https://linesturdiag.blob.core.windows.net/logo-companhia/CZ%20(China%20Southern)/CZ_low.png',\r\n condor: 'https://linesturdiag.blob.core.windows.net/logo-companhia/DE%20(Condor)/DE_low.png',\r\n copaAirlines: 'https://linesturdiag.blob.core.windows.net/logo-companhia/CM%20(Copa%20Airlines)/CM_low.png',\r\n delta: 'https://linesturdiag.blob.core.windows.net/logo-companhia/DL%20(Delta%20Airlines)/DL_low.png',\r\n emirates: 'https://linesturdiag.blob.core.windows.net/logo-companhia/EK%20(Emirates)/EK_low.png',\r\n etihad: 'https://linesturdiag.blob.core.windows.net/logo-companhia/EY%20(Etihad)/EY_low.png',\r\n finnair: 'https://linesturdiag.blob.core.windows.net/logo-companhia/AY%20(Finnair)/AY_low.png',\r\n gol: 'https://linesturdiag.blob.core.windows.net/logo-companhia/G3%20(Gol)/G3_low.png',\r\n hawaiin: 'https://linesturdiag.blob.core.windows.net/logo-companhia/HA%20(Hawaiin)/HA_low.png',\r\n iberia: 'https://linesturdiag.blob.core.windows.net/logo-companhia/IB%20(Iberia)/IB_low.png',\r\n itapemirim: 'https://linesturdiag.blob.core.windows.net/logo-companhia/8I%20(Itapemirim)/8I_low.png',\r\n japanAirlines: 'https://linesturdiag.blob.core.windows.net/logo-companhia/JL%20(Japan%20Airlines)/JL_low.png',\r\n jetBlue: 'https://linesturdiag.blob.core.windows.net/logo-companhia/B6%20(JetBlue)/B6_low.png',\r\n kenyaAirways: 'https://linesturdiag.blob.core.windows.net/logo-companhia/KQ%20(Kenya%20Airways)/KQ_low.png',\r\n klm: 'https://linesturdiag.blob.core.windows.net/logo-companhia/KL%20(Klm)/KL_low.png',\r\n koreanAir: 'https://linesturdiag.blob.core.windows.net/logo-companhia/KE%20(Korean%20Air)/KE_low.png',\r\n latam: 'https://linesturdiag.blob.core.windows.net/logo-companhia/LA%20(Latam)/LA_low.png',\r\n lot: 'https://linesturdiag.blob.core.windows.net/logo-companhia/LO%20(LOT)/LO_low.png',\r\n lufthansa: 'https://linesturdiag.blob.core.windows.net/logo-companhia/LH%20(Lufthansa)/LH_low.png',\r\n luxair: 'https://linesturdiag.blob.core.windows.net/logo-companhia/LG%20(Luxair)/LG_low.png',\r\n map: 'https://linesturdiag.blob.core.windows.net/logo-companhia/7M%20(Map)/7M_low.png',\r\n qantas: 'https://linesturdiag.blob.core.windows.net/logo-companhia/QF%20(Qantas)/QF_low.png',\r\n qatar: 'https://linesturdiag.blob.core.windows.net/logo-companhia/QR%20(Qatar)/QR_low.png',\r\n singapore: 'https://linesturdiag.blob.core.windows.net/logo-companhia/SQ%20(Singapore)/SQ_low.png',\r\n skyAirline: 'https://linesturdiag.blob.core.windows.net/logo-companhia/H2%20(Sky%20Airline)/H2_low.png',\r\n swiss: 'https://linesturdiag.blob.core.windows.net/logo-companhia/LX%20(Swiss)/LX_low.png',\r\n taag: 'https://linesturdiag.blob.core.windows.net/logo-companhia/DT%20(Taag)/DT_low.png',\r\n tapPortugal: 'https://linesturdiag.blob.core.windows.net/logo-companhia/TP%20(%20Tap%20Portugal)/TP_low.png',\r\n turkishAirlines: 'https://linesturdiag.blob.core.windows.net/logo-companhia/UX%20(Air%20Europa)/UX_low.png',\r\n united: 'https://linesturdiag.blob.core.windows.net/logo-companhia/UA%20(United)/UA_low.png',\r\n voePass: 'https://linesturdiag.blob.core.windows.net/logo-companhia/2Z%20(Voepass)/2Z_low.png',\r\n vueling: 'https://linesturdiag.blob.core.windows.net/logo-companhia/VY%20(Vueling)/VY_low.png',\r\n },\r\n companiesUrlHIGH: {\r\n aegean: 'https://linesturdiag.blob.core.windows.net/logo-companhia/A3%20(Aegean)/A3_high.png',\r\n aeroLines: 'https://linesturdiag.blob.core.windows.net/logo-companhia/AR%20(Aero%20Lineas)/AR_high.png',\r\n aeroflot: 'https://linesturdiag.blob.core.windows.net/logo-companhia/SU%20(Aeroflot)/SU_high.png',\r\n aeroMexico: 'https://linesturdiag.blob.core.windows.net/logo-companhia/AM%20(Aero%20Mexico)/AM_high.png',\r\n airCanada: 'https://linesturdiag.blob.core.windows.net/logo-companhia/AC%20(Air%20Canada)/AC_high.png',\r\n airChina: 'https://linesturdiag.blob.core.windows.net/logo-companhia/CA%20(Air%20China)/CA_high.png',\r\n airEuropa: 'https://linesturdiag.blob.core.windows.net/logo-companhia/UX%20(Air%20Europa)/UX_high.png',\r\n airFrance: 'https://linesturdiag.blob.core.windows.net/logo-companhia/AF%20(Air%20France)/AF_high.png',\r\n alaskaAirlines: 'https://linesturdiag.blob.core.windows.net/logo-companhia/AS%20(Alaska%20Airlines)/AS_high.png',\r\n // amaszonas: '',\r\n americanAirlines: 'https://linesturdiag.blob.core.windows.net/logo-companhia/AA%20(American%20Airlines)/AA_high.png',\r\n ana: 'https://linesturdiag.blob.core.windows.net/logo-companhia/NH%20(Ana)/NH_high.png',\r\n austrian: 'https://linesturdiag.blob.core.windows.net/logo-companhia/OS%20(Austrian)/OS_high.png',\r\n avianca: 'https://linesturdiag.blob.core.windows.net/logo-companhia/AV%20(Avianca)/AV_high.png',\r\n azul: 'https://linesturdiag.blob.core.windows.net/logo-companhia/AD%20(Azul)/AD_high.png',\r\n boa: 'https://linesturdiag.blob.core.windows.net/logo-companhia/OB%20(BoA)/OB_high.png',\r\n britishAirways: 'https://linesturdiag.blob.core.windows.net/logo-companhia/BA%20(British%20Airways)/BA_high.png',\r\n brusselsAirlines: 'https://linesturdiag.blob.core.windows.net/logo-companhia/SN%20(Brussels%20airlines)/SN_low.png',\r\n cathayPacific: 'https://linesturdiag.blob.core.windows.net/logo-companhia/CX%20(Cathay%20Pacific)/CX_high.png',\r\n chinaSouthern: 'https://linesturdiag.blob.core.windows.net/logo-companhia/CZ%20(China%20Southern)/CZ_high.png',\r\n condor: 'https://linesturdiag.blob.core.windows.net/logo-companhia/DE%20(Condor)/DE_high.png',\r\n copaAirlines: 'https://linesturdiag.blob.core.windows.net/logo-companhia/CM%20(Copa%20Airlines)/CM_high.png',\r\n delta: 'https://linesturdiag.blob.core.windows.net/logo-companhia/DL%20(Delta%20Airlines)/DL_high.png',\r\n emirates: 'https://linesturdiag.blob.core.windows.net/logo-companhia/EK%20(Emirates)/EK_high.png',\r\n etihad: 'https://linesturdiag.blob.core.windows.net/logo-companhia/EY%20(Etihad)/EY_high.png',\r\n finnair: 'https://linesturdiag.blob.core.windows.net/logo-companhia/AY%20(Finnair)/AY_high.png',\r\n gol: 'https://linesturdiag.blob.core.windows.net/logo-companhia/G3%20(Gol)/G3_high.png',\r\n hawaiin: 'https://linesturdiag.blob.core.windows.net/logo-companhia/HA%20(Hawaiin)/HA_high.png',\r\n iberia: 'https://linesturdiag.blob.core.windows.net/logo-companhia/IB%20(Iberia)/IB_high.png',\r\n itapemirim: 'https://linesturdiag.blob.core.windows.net/logo-companhia/8I%20(Itapemirim)/8I_high.png',\r\n japanAirlines: 'https://linesturdiag.blob.core.windows.net/logo-companhia/JL%20(Japan%20Airlines)/JL_high.png',\r\n jetBlue: 'https://linesturdiag.blob.core.windows.net/logo-companhia/B6%20(JetBlue)/B6_high.png',\r\n kenyaAirways: 'https://linesturdiag.blob.core.windows.net/logo-companhia/KQ%20(Kenya%20Airways)/KQ_high.png',\r\n klm: 'https://linesturdiag.blob.core.windows.net/logo-companhia/KL%20(Klm)/KL_high.png',\r\n koreanAir: 'https://linesturdiag.blob.core.windows.net/logo-companhia/KE%20(Korean%20Air)/KE_high.png',\r\n latam: 'https://linesturdiag.blob.core.windows.net/logo-companhia/LA%20(Latam)/LA_high.png',\r\n latamJJ: 'https://linesturdiag.blob.core.windows.net/logo-companhia/LA%20(Latam)/LA_high.png',\r\n lot: 'https://linesturdiag.blob.core.windows.net/logo-companhia/LO%20(LOT)/LO_low.png',\r\n lufthansa: 'https://linesturdiag.blob.core.windows.net/logo-companhia/LH%20(Lufthansa)/LH_high.png',\r\n luxair: 'https://linesturdiag.blob.core.windows.net/logo-companhia/LG%20(Luxair)/LG_low.png',\r\n map: 'https://linesturdiag.blob.core.windows.net/logo-companhia/7M%20(Map)/7M_high.png',\r\n qantas: 'https://linesturdiag.blob.core.windows.net/logo-companhia/QF%20(Qantas)/QF_high.png',\r\n qatar: 'https://linesturdiag.blob.core.windows.net/logo-companhia/QR%20(Qatar)/QR_high.png',\r\n singapore: 'https://linesturdiag.blob.core.windows.net/logo-companhia/SQ%20(Singapore)/SQ_high.png',\r\n skyAirline: 'https://linesturdiag.blob.core.windows.net/logo-companhia/H2%20(Sky%20Airline)/H2_high.png',\r\n swiss: 'https://linesturdiag.blob.core.windows.net/logo-companhia/LX%20(Swiss)/LX_high.png',\r\n taag: 'https://linesturdiag.blob.core.windows.net/logo-companhia/DT%20(Taag)/DT_high.png',\r\n tapPortugal: 'https://linesturdiag.blob.core.windows.net/logo-companhia/TP%20(%20Tap%20Portugal)/TP_high.png',\r\n turkishAirlines: 'https://linesturdiag.blob.core.windows.net/logo-companhia/TK%20(Turkish%20Airlines)/TK_high.png',\r\n united: 'https://linesturdiag.blob.core.windows.net/logo-companhia/UA%20(United)/UA_high.png',\r\n voePass: 'https://linesturdiag.blob.core.windows.net/logo-companhia/2Z%20(Voepass)/2Z_high.png',\r\n vueling: 'https://linesturdiag.blob.core.windows.net/logo-companhia/VY%20(Vueling)/VY_high.png',\r\n },\r\n companiesUrlMINI: {\r\n azul: 'https://linesturdiag.blob.core.windows.net/logo-companhia/AD%20(Azul)/AD_mini.png',\r\n latam: 'https://linesturdiag.blob.core.windows.net/logo-companhia/LA%20(Latam)/LA_mini.png',\r\n latamJJ: 'https://linesturdiag.blob.core.windows.net/logo-companhia/LA%20(Latam)/LA_mini.png',\r\n gol: 'https://linesturdiag.blob.core.windows.net/logo-companhia/G3%20(Gol)/G3_mini.png',\r\n },\r\n\r\n getLogoCompanhiaAereaEnum: function (value) {\r\n let dto = {\r\n logo: null,\r\n nome: null,\r\n url_low: null,\r\n url_high: null,\r\n url_mini: null,\r\n };\r\n switch (value) {\r\n case this.companies.aegean:\r\n return dto = {\r\n nome: this.companiesNome.aegean,\r\n logo: this.companiesLogo.aegean,\r\n url_low: this.companiesUrlLOW.aegean,\r\n url_high: this.companiesUrlHIGH.aegean\r\n }\r\n case this.companies.aeroLines:\r\n return dto = {\r\n nome: this.companiesNome.aeroLines,\r\n logo: this.companiesLogo.aeroLines,\r\n url_low: this.companiesUrlLOW.aeroLines,\r\n url_high: this.companiesUrlHIGH.aeroLines,\r\n }\r\n case this.companies.aeroflot:\r\n return dto = {\r\n nome: this.companiesNome.aeroflot,\r\n logo: this.companiesLogo.aeroflot,\r\n url_low: this.companiesUrlLOW.aeroflot,\r\n url_high: this.companiesUrlHIGH.aeroflot,\r\n }\r\n case this.companies.aeroMexico:\r\n return dto = {\r\n nome: this.companiesNome.aeroMexico,\r\n logo: this.companiesLogo.aeroMexico,\r\n url_low: this.companiesUrlLOW.aeroMexico,\r\n url_high: this.companiesUrlHIGH.aeroMexico,\r\n }\r\n case this.companies.airCanada:\r\n return dto = {\r\n nome: this.companiesNome.airCanada,\r\n logo: this.companiesLogo.airCanada,\r\n url_low: this.companiesUrlLOW.airCanada,\r\n url_high: this.companiesUrlHIGH.airCanada,\r\n }\r\n case this.companies.airChina:\r\n return dto = {\r\n nome: this.companiesNome.airChina,\r\n logo: this.companiesLogo.airChina,\r\n url_low: this.companiesUrlLOW.airChina,\r\n url_high: this.companiesUrlHIGH.airChina,\r\n }\r\n case this.companies.airEuropa:\r\n return dto = {\r\n nome: this.companiesNome.airEuropa,\r\n logo: this.companiesLogo.airEuropa,\r\n url_low: this.companiesUrlLOW.airEuropa,\r\n url_high: this.companiesUrlHIGH.airEuropa,\r\n }\r\n case this.companies.airFrance:\r\n return dto = {\r\n nome: this.companiesNome.airFrance,\r\n logo: this.companiesLogo.airFrance,\r\n url_low: this.companiesUrlLOW.airFrance,\r\n url_high: this.companiesUrlHIGH.airFrance,\r\n }\r\n case this.companies.alaskaAirlines:\r\n return dto = {\r\n nome: this.companiesNome.alaskaAirlines,\r\n logo: this.companiesLogo.alaskaAirlines,\r\n url_low: this.companiesUrlLOW.alaskaAirlines,\r\n url_high: this.companiesUrlHIGH.alaskaAirlines,\r\n }\r\n // case this.companies.amaszonas:\r\n // return dto = {\r\n // nome: this.companiesNome.amaszonas,\r\n // logo: this.companiesLogo.amaszonas,\r\n // url_low: this.companiesUrlLOW.amaszonas,\r\n // url_high: this.companiesUrlHIGH.amaszonas,\r\n // }\r\n case this.companies.americanAirlines:\r\n return dto = {\r\n nome: this.companiesNome.americanAirlines,\r\n logo: this.companiesLogo.americanAirlines,\r\n url_low: this.companiesUrlLOW.americanAirlines,\r\n url_high: this.companiesUrlHIGH.americanAirlines,\r\n }\r\n case this.companies.ana:\r\n return dto = {\r\n nome: this.companiesNome.ana,\r\n logo: this.companiesLogo.ana,\r\n url_low: this.companiesUrlLOW.ana,\r\n url_high: this.companiesUrlHIGH.ana,\r\n }\r\n case this.companies.austrian:\r\n return dto = {\r\n nome: this.companiesNome.austrian,\r\n logo: this.companiesLogo.austrian,\r\n url_low: this.companiesUrlLOW.austrian,\r\n url_high: this.companiesUrlHIGH.austrian,\r\n }\r\n case this.companies.avianca:\r\n return dto = {\r\n nome: this.companiesNome.avianca,\r\n logo: this.companiesLogo.avianca,\r\n url_low: this.companiesUrlLOW.avianca,\r\n url_high: this.companiesUrlHIGH.avianca,\r\n }\r\n case this.companies.azul:\r\n return dto = {\r\n nome: this.companiesNome.azul,\r\n logo: this.companiesLogo.azul,\r\n url_low: this.companiesUrlLOW.azul,\r\n url_high: this.companiesUrlHIGH.azul,\r\n url_mini: this.companiesUrlMINI.azul,\r\n }\r\n case this.companies.boa:\r\n return dto = {\r\n nome: this.companiesNome.boa,\r\n logo: this.companiesLogo.boa,\r\n url_low: this.companiesUrlLOW.boa,\r\n url_high: this.companiesUrlHIGH.boa,\r\n }\r\n case this.companies.britishAirways:\r\n return dto = {\r\n nome: this.companiesNome.britishAirways,\r\n logo: this.companiesLogo.britishAirways,\r\n url_low: this.companiesUrlLOW.britishAirways,\r\n url_high: this.companiesUrlHIGH.britishAirways,\r\n }\r\n case this.companies.brusselsAirlines:\r\n return dto = {\r\n nome: this.companiesNome.brusselsAirlines,\r\n logo: this.companiesLogo.brusselsAirlines,\r\n url_low: this.companiesUrlLOW.brusselsAirlines,\r\n url_high: this.companiesUrlHIGH.brusselsAirlines,\r\n }\r\n case this.companies.cathayPacific:\r\n return dto = {\r\n nome: this.companiesNome.cathayPacific,\r\n logo: this.companiesLogo.cathayPacific,\r\n url_low: this.companiesUrlLOW.cathayPacific,\r\n url_high: this.companiesUrlHIGH.cathayPacific,\r\n }\r\n case this.companies.chinaSouthern:\r\n return dto = {\r\n nome: this.companiesNome.chinaSouthern,\r\n logo: this.companiesLogo.chinaSouthern,\r\n url_low: this.companiesUrlLOW.chinaSouthern,\r\n url_high: this.companiesUrlHIGH.chinaSouthern,\r\n }\r\n case this.companies.condor:\r\n return dto = {\r\n nome: this.companiesNome.condor,\r\n logo: this.companiesLogo.condor,\r\n url_low: this.companiesUrlLOW.condor,\r\n url_high: this.companiesUrlHIGH.condor,\r\n }\r\n case this.companies.copaAirlines:\r\n return dto = {\r\n nome: this.companiesNome.copaAirlines,\r\n logo: this.companiesLogo.copaAirlines,\r\n url_low: this.companiesUrlLOW.copaAirlines,\r\n url_high: this.companiesUrlHIGH.copaAirlines,\r\n }\r\n case this.companies.delta:\r\n return dto = {\r\n nome: this.companiesNome.delta,\r\n logo: this.companiesLogo.delta,\r\n url_low: this.companiesUrlLOW.delta,\r\n url_high: this.companiesUrlHIGH.delta,\r\n }\r\n case this.companies.emirates:\r\n return dto = {\r\n nome: this.companiesNome.emirates,\r\n logo: this.companiesLogo.emirates,\r\n url_low: this.companiesUrlLOW.emirates,\r\n url_high: this.companiesUrlHIGH.emirates,\r\n }\r\n case this.companies.etihad:\r\n return dto = {\r\n nome: this.companiesNome.etihad,\r\n logo: this.companiesLogo.etihad,\r\n url_low: this.companiesUrlLOW.etihad,\r\n url_high: this.companiesUrlHIGH.etihad,\r\n }\r\n case this.companies.finnair:\r\n return dto = {\r\n nome: this.companiesNome.finnair,\r\n logo: this.companiesLogo.finnair,\r\n url_low: this.companiesUrlLOW.finnair,\r\n url_high: this.companiesUrlHIGH.finnair,\r\n }\r\n case this.companies.gol:\r\n return dto = {\r\n nome: this.companiesNome.gol,\r\n logo: this.companiesLogo.gol,\r\n url_low: this.companiesUrlLOW.gol,\r\n url_high: this.companiesUrlHIGH.gol,\r\n url_mini: this.companiesUrlMINI.gol,\r\n }\r\n case this.companies.hawaiin:\r\n return dto = {\r\n nome: this.companiesNome.hawaiin,\r\n logo: this.companiesLogo.hawaiin,\r\n url_low: this.companiesUrlLOW.hawaiin,\r\n url_high: this.companiesUrlHIGH.hawaiin,\r\n }\r\n case this.companies.iberia:\r\n return dto = {\r\n nome: this.companiesNome.iberia,\r\n logo: this.companiesLogo.iberia,\r\n url_low: this.companiesUrlLOW.iberia,\r\n url_high: this.companiesUrlHIGH.iberia,\r\n }\r\n case this.companies.itapemirim:\r\n return dto = {\r\n nome: this.companiesNome.itapemirim,\r\n logo: this.companiesLogo.itapemirim,\r\n url_low: this.companiesUrlLOW.itapemirim,\r\n url_high: this.companiesUrlHIGH.itapemirim,\r\n }\r\n case this.companies.japanAirlines:\r\n return dto = {\r\n nome: this.companiesNome.japanAirlines,\r\n logo: this.companiesLogo.japanAirlines,\r\n url_low: this.companiesUrlLOW.japanAirlines,\r\n url_high: this.companiesUrlHIGH.japanAirlines,\r\n }\r\n case this.companies.jetBlue:\r\n return dto = {\r\n nome: this.companiesNome.jetBlue,\r\n logo: this.companiesLogo.jetBlue,\r\n url_low: this.companiesUrlLOW.jetBlue,\r\n url_high: this.companiesUrlHIGH.jetBlue,\r\n }\r\n case this.companies.kenyaAirways:\r\n return dto = {\r\n nome: this.companiesNome.kenyaAirways,\r\n logo: this.companiesLogo.kenyaAirways,\r\n url_low: this.companiesUrlLOW.kenyaAirways,\r\n url_high: this.companiesUrlHIGH.kenyaAirways,\r\n }\r\n case this.companies.klm:\r\n return dto = {\r\n nome: this.companiesNome.klm,\r\n logo: this.companiesLogo.klm,\r\n url_low: this.companiesUrlLOW.klm,\r\n url_high: this.companiesUrlHIGH.klm,\r\n }\r\n case this.companies.koreanAir:\r\n return dto = {\r\n nome: this.companiesNome.koreanAir,\r\n logo: this.companiesLogo.koreanAir,\r\n url_low: this.companiesUrlLOW.koreanAir,\r\n url_high: this.companiesUrlHIGH.koreanAir,\r\n }\r\n case this.companies.latam:\r\n return dto = {\r\n nome: this.companiesNome.latam,\r\n logo: this.companiesLogo.latam,\r\n url_low: this.companiesUrlLOW.latam,\r\n url_high: this.companiesUrlHIGH.latam,\r\n url_mini: this.companiesUrlMINI.latam,\r\n }\r\n case this.companies.latamJJ:\r\n return dto = {\r\n nome: this.companiesNome.latam,\r\n logo: this.companiesLogo.latam,\r\n url_low: this.companiesUrlLOW.latam,\r\n url_high: this.companiesUrlHIGH.latam,\r\n url_mini: this.companiesUrlMINI.latam,\r\n }\r\n case this.companies.lot:\r\n return dto = {\r\n nome: this.companiesNome.lot,\r\n logo: this.companiesLogo.lot,\r\n url_low: this.companiesUrlLOW.lot,\r\n url_high: this.companiesUrlHIGH.lot,\r\n }\r\n case this.companies.lufthansa:\r\n return dto = {\r\n nome: this.companiesNome.lufthansa,\r\n logo: this.companiesLogo.lufthansa,\r\n url_low: this.companiesUrlLOW.lufthansa,\r\n url_high: this.companiesUrlHIGH.lufthansa,\r\n }\r\n case this.companies.luxair:\r\n return dto = {\r\n nome: this.companiesNome.luxair,\r\n logo: this.companiesLogo.luxair,\r\n url_low: this.companiesUrlLOW.luxair,\r\n url_high: this.companiesUrlHIGH.luxair,\r\n }\r\n case this.companies.map:\r\n return dto = {\r\n nome: this.companiesNome.map,\r\n logo: this.companiesLogo.map,\r\n url_low: this.companiesUrlLOW.map,\r\n url_high: this.companiesUrlHIGH.map,\r\n }\r\n case this.companies.qantas:\r\n return dto = {\r\n nome: this.companiesNome.qantas,\r\n logo: this.companiesLogo.qantas,\r\n url_low: this.companiesUrlLOW.qantas,\r\n url_high: this.companiesUrlHIGH.qantas,\r\n }\r\n case this.companies.qatar:\r\n return dto = {\r\n nome: this.companiesNome.qatar,\r\n logo: this.companiesLogo.qatar,\r\n url_low: this.companiesUrlLOW.qatar,\r\n url_high: this.companiesUrlHIGH.qatar,\r\n }\r\n case this.companies.singapore:\r\n return dto = {\r\n nome: this.companiesNome.singapore,\r\n logo: this.companiesLogo.singapore,\r\n url_low: this.companiesUrlLOW.singapore,\r\n url_high: this.companiesUrlHIGH.singapore,\r\n }\r\n case this.companies.skyAirline:\r\n return dto = {\r\n nome: this.companiesNome.skyAirline,\r\n logo: this.companiesLogo.skyAirline,\r\n url_low: this.companiesUrlLOW.skyAirline,\r\n url_high: this.companiesUrlHIGH.skyAirline,\r\n }\r\n case this.companies.swiss:\r\n return dto = {\r\n nome: this.companiesNome.swiss,\r\n logo: this.companiesLogo.swiss,\r\n url_low: this.companiesUrlLOW.swiss,\r\n url_high: this.companiesUrlHIGH.swiss,\r\n }\r\n case this.companies.taag:\r\n return dto = {\r\n nome: this.companiesNome.taag,\r\n logo: this.companiesLogo.taag,\r\n url_low: this.companiesUrlLOW.taag,\r\n url_high: this.companiesUrlHIGH.taag,\r\n }\r\n case this.companies.tapPortugal:\r\n return dto = {\r\n nome: this.companiesNome.tapPortugal,\r\n logo: this.companiesLogo.tapPortugal,\r\n url_low: this.companiesUrlLOW.tapPortugal,\r\n url_high: this.companiesUrlHIGH.tapPortugal,\r\n }\r\n case this.companies.turkishAirlines:\r\n return dto = {\r\n nome: this.companiesNome.turkishAirlines,\r\n logo: this.companiesLogo.turkishAirlines,\r\n url_low: this.companiesUrlLOW.turkishAirlines,\r\n url_high: this.companiesUrlHIGH.turkishAirlines,\r\n }\r\n case this.companies.united:\r\n return dto = {\r\n nome: this.companiesNome.united,\r\n logo: this.companiesLogo.united,\r\n url_low: this.companiesUrlLOW.united,\r\n url_high: this.companiesUrlHIGH.united,\r\n }\r\n case this.companies.voePass:\r\n return dto = {\r\n nome: this.companiesNome.voePass,\r\n logo: this.companiesLogo.voePass,\r\n url_low: this.companiesUrlLOW.voePass,\r\n url_high: this.companiesUrlHIGH.voePass,\r\n }\r\n case this.companies.vueling:\r\n return dto = {\r\n nome: this.companiesNome.vueling,\r\n logo: this.companiesLogo.vueling,\r\n url_low: this.companiesUrlLOW.vueling,\r\n url_high: this.companiesUrlHIGH.vueling,\r\n }\r\n\r\n default:\r\n return dto = {\r\n nome: 'Linestur',\r\n logo: LogoDefault,\r\n url_low: 'https://linesturdiag.blob.core.windows.net/logo-companhia/Default%20(Linestur)/default_low.png',\r\n url_high: 'https://linesturdiag.blob.core.windows.net/logo-companhia/Default%20(Linestur)/default_low.png'\r\n }\r\n }\r\n },\r\n}\r\n\r\nexport default EnumCompany;\r\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport capitalize from '../utils/capitalize';\nimport withStyles from '../styles/withStyles';\nimport { darken, lighten } from '../styles/colorManipulator';\nimport useTheme from '../styles/useTheme';\nvar TRANSITION_DURATION = 4; // seconds\n\nexport var styles = function styles(theme) {\n var getColor = function getColor(color) {\n return theme.palette.type === 'light' ? lighten(color, 0.62) : darken(color, 0.5);\n };\n\n var backgroundPrimary = getColor(theme.palette.primary.main);\n var backgroundSecondary = getColor(theme.palette.secondary.main);\n return {\n /* Styles applied to the root element. */\n root: {\n position: 'relative',\n overflow: 'hidden',\n height: 4,\n '@media print': {\n colorAdjust: 'exact'\n }\n },\n\n /* Styles applied to the root and bar2 element if `color=\"primary\"`; bar2 if `variant=\"buffer\"`. */\n colorPrimary: {\n backgroundColor: backgroundPrimary\n },\n\n /* Styles applied to the root and bar2 elements if `color=\"secondary\"`; bar2 if `variant=\"buffer\"`. */\n colorSecondary: {\n backgroundColor: backgroundSecondary\n },\n\n /* Styles applied to the root element if `variant=\"determinate\"`. */\n determinate: {},\n\n /* Styles applied to the root element if `variant=\"indeterminate\"`. */\n indeterminate: {},\n\n /* Styles applied to the root element if `variant=\"buffer\"`. */\n buffer: {\n backgroundColor: 'transparent'\n },\n\n /* Styles applied to the root element if `variant=\"query\"`. */\n query: {\n transform: 'rotate(180deg)'\n },\n\n /* Styles applied to the additional bar element if `variant=\"buffer\"`. */\n dashed: {\n position: 'absolute',\n marginTop: 0,\n height: '100%',\n width: '100%',\n animation: '$buffer 3s infinite linear'\n },\n\n /* Styles applied to the additional bar element if `variant=\"buffer\"` and `color=\"primary\"`. */\n dashedColorPrimary: {\n backgroundImage: \"radial-gradient(\".concat(backgroundPrimary, \" 0%, \").concat(backgroundPrimary, \" 16%, transparent 42%)\"),\n backgroundSize: '10px 10px',\n backgroundPosition: '0 -23px'\n },\n\n /* Styles applied to the additional bar element if `variant=\"buffer\"` and `color=\"secondary\"`. */\n dashedColorSecondary: {\n backgroundImage: \"radial-gradient(\".concat(backgroundSecondary, \" 0%, \").concat(backgroundSecondary, \" 16%, transparent 42%)\"),\n backgroundSize: '10px 10px',\n backgroundPosition: '0 -23px'\n },\n\n /* Styles applied to the layered bar1 and bar2 elements. */\n bar: {\n width: '100%',\n position: 'absolute',\n left: 0,\n bottom: 0,\n top: 0,\n transition: 'transform 0.2s linear',\n transformOrigin: 'left'\n },\n\n /* Styles applied to the bar elements if `color=\"primary\"`; bar2 if `variant` not \"buffer\". */\n barColorPrimary: {\n backgroundColor: theme.palette.primary.main\n },\n\n /* Styles applied to the bar elements if `color=\"secondary\"`; bar2 if `variant` not \"buffer\". */\n barColorSecondary: {\n backgroundColor: theme.palette.secondary.main\n },\n\n /* Styles applied to the bar1 element if `variant=\"indeterminate or query\"`. */\n bar1Indeterminate: {\n width: 'auto',\n animation: '$indeterminate1 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite'\n },\n\n /* Styles applied to the bar1 element if `variant=\"determinate\"`. */\n bar1Determinate: {\n transition: \"transform .\".concat(TRANSITION_DURATION, \"s linear\")\n },\n\n /* Styles applied to the bar1 element if `variant=\"buffer\"`. */\n bar1Buffer: {\n zIndex: 1,\n transition: \"transform .\".concat(TRANSITION_DURATION, \"s linear\")\n },\n\n /* Styles applied to the bar2 element if `variant=\"indeterminate or query\"`. */\n bar2Indeterminate: {\n width: 'auto',\n animation: '$indeterminate2 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite'\n },\n\n /* Styles applied to the bar2 element if `variant=\"buffer\"`. */\n bar2Buffer: {\n transition: \"transform .\".concat(TRANSITION_DURATION, \"s linear\")\n },\n // Legends:\n // || represents the viewport\n // - represents a light background\n // x represents a dark background\n '@keyframes indeterminate1': {\n // |-----|---x-||-----||-----|\n '0%': {\n left: '-35%',\n right: '100%'\n },\n // |-----|-----||-----||xxxx-|\n '60%': {\n left: '100%',\n right: '-90%'\n },\n '100%': {\n left: '100%',\n right: '-90%'\n }\n },\n '@keyframes indeterminate2': {\n // |xxxxx|xxxxx||-----||-----|\n '0%': {\n left: '-200%',\n right: '100%'\n },\n // |-----|-----||-----||-x----|\n '60%': {\n left: '107%',\n right: '-8%'\n },\n '100%': {\n left: '107%',\n right: '-8%'\n }\n },\n '@keyframes buffer': {\n '0%': {\n opacity: 1,\n backgroundPosition: '0 -23px'\n },\n '50%': {\n opacity: 0,\n backgroundPosition: '0 -23px'\n },\n '100%': {\n opacity: 1,\n backgroundPosition: '-200px -23px'\n }\n }\n };\n};\n/**\n * ## ARIA\n *\n * If the progress bar is describing the loading progress of a particular region of a page,\n * you should use `aria-describedby` to point to the progress bar, and set the `aria-busy`\n * attribute to `true` on that region until it has finished loading.\n */\n\nvar LinearProgress = /*#__PURE__*/React.forwardRef(function LinearProgress(props, ref) {\n var classes = props.classes,\n className = props.className,\n _props$color = props.color,\n color = _props$color === void 0 ? 'primary' : _props$color,\n value = props.value,\n valueBuffer = props.valueBuffer,\n _props$variant = props.variant,\n variant = _props$variant === void 0 ? 'indeterminate' : _props$variant,\n other = _objectWithoutProperties(props, [\"classes\", \"className\", \"color\", \"value\", \"valueBuffer\", \"variant\"]);\n\n var theme = useTheme();\n var rootProps = {};\n var inlineStyles = {\n bar1: {},\n bar2: {}\n };\n\n if (variant === 'determinate' || variant === 'buffer') {\n if (value !== undefined) {\n rootProps['aria-valuenow'] = Math.round(value);\n rootProps['aria-valuemin'] = 0;\n rootProps['aria-valuemax'] = 100;\n var transform = value - 100;\n\n if (theme.direction === 'rtl') {\n transform = -transform;\n }\n\n inlineStyles.bar1.transform = \"translateX(\".concat(transform, \"%)\");\n } else if (process.env.NODE_ENV !== 'production') {\n console.error('Material-UI: You need to provide a value prop ' + 'when using the determinate or buffer variant of LinearProgress .');\n }\n }\n\n if (variant === 'buffer') {\n if (valueBuffer !== undefined) {\n var _transform = (valueBuffer || 0) - 100;\n\n if (theme.direction === 'rtl') {\n _transform = -_transform;\n }\n\n inlineStyles.bar2.transform = \"translateX(\".concat(_transform, \"%)\");\n } else if (process.env.NODE_ENV !== 'production') {\n console.error('Material-UI: You need to provide a valueBuffer prop ' + 'when using the buffer variant of LinearProgress.');\n }\n }\n\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n className: clsx(classes.root, classes[\"color\".concat(capitalize(color))], className, {\n 'determinate': classes.determinate,\n 'indeterminate': classes.indeterminate,\n 'buffer': classes.buffer,\n 'query': classes.query\n }[variant]),\n role: \"progressbar\"\n }, rootProps, {\n ref: ref\n }, other), variant === 'buffer' ? /*#__PURE__*/React.createElement(\"div\", {\n className: clsx(classes.dashed, classes[\"dashedColor\".concat(capitalize(color))])\n }) : null, /*#__PURE__*/React.createElement(\"div\", {\n className: clsx(classes.bar, classes[\"barColor\".concat(capitalize(color))], (variant === 'indeterminate' || variant === 'query') && classes.bar1Indeterminate, {\n 'determinate': classes.bar1Determinate,\n 'buffer': classes.bar1Buffer\n }[variant]),\n style: inlineStyles.bar1\n }), variant === 'determinate' ? null : /*#__PURE__*/React.createElement(\"div\", {\n className: clsx(classes.bar, (variant === 'indeterminate' || variant === 'query') && classes.bar2Indeterminate, variant === 'buffer' ? [classes[\"color\".concat(capitalize(color))], classes.bar2Buffer] : classes[\"barColor\".concat(capitalize(color))]),\n style: inlineStyles.bar2\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? LinearProgress.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n */\n color: PropTypes.oneOf(['primary', 'secondary']),\n\n /**\n * The value of the progress indicator for the determinate and buffer variants.\n * Value between 0 and 100.\n */\n value: PropTypes.number,\n\n /**\n * The value for the buffer variant.\n * Value between 0 and 100.\n */\n valueBuffer: PropTypes.number,\n\n /**\n * The variant to use.\n * Use indeterminate or query when there is no progress value.\n */\n variant: PropTypes.oneOf(['buffer', 'determinate', 'indeterminate', 'query'])\n} : void 0;\nexport default withStyles(styles, {\n name: 'MuiLinearProgress'\n})(LinearProgress);","import { LinearProgress, withStyles } from \"@material-ui/core\";\r\n\r\nexport const CustomProgressBar = withStyles((theme) => ({\r\n root: {\r\n height: 10,\r\n borderRadius: 5\r\n },\r\n colorPrimary: {\r\n backgroundColor:\r\n theme.palette.grey[theme.palette.type === \"light\" ? 200 : 700]\r\n },\r\n bar: {\r\n borderRadius: 5,\r\n backgroundColor: \"#008000\"\r\n }\r\n}))(LinearProgress);\r\n","import { makeStyles } from \"@material-ui/core/styles\";\r\n\r\nexport const useStyles = makeStyles((theme) => ({\r\n dados: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n justifyContent: 'space-evenly',\r\n alignItems: 'center',\r\n width: '100%'\r\n },\r\n titulos: {\r\n background: 'DimGray',\r\n color: 'white',\r\n justifyContent: 'space-evenly',\r\n alignItems: 'center',\r\n },\r\n info: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n justifyContent: 'left',\r\n alignItems: 'left',\r\n fontFamily: 'arial',\r\n fontSize: '1%',\r\n marginTop: theme.spacing(2)\r\n },\r\n titulo: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n justifyContent: 'left',\r\n alignItems: 'left',\r\n marginTop: theme.spacing(3)\r\n },\r\n buttonContract: {\r\n background: '#FF7500',\r\n color: '#ffffff',\r\n '&:hover': {\r\n background: 'rgba(255, 117, 0, 0.8)',\r\n },\r\n }\r\n}));\r\n","import { Box, Button, Chip, Dialog, DialogContent, DialogContentText, DialogTitle, Grid, IconButton, Slide, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Tooltip, Typography, useMediaQuery, useTheme } from '@material-ui/core';\r\nimport { CloseOutlined, EcoOutlined, GetAppOutlined } from '@material-ui/icons';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { EnumCompany } from '../../Enums/enum_FlightCompany';\r\nimport CustomLoader from '../../components/CustomLoader';\r\nimport { CustomProgressBar } from '../../components/CustomProgressBar';\r\nimport bookingService from '../../services/Bookings';\r\nimport { useStyles } from './styles';\r\nimport CustomizedSnackbars from '../../components/CustomSnackBar';\r\nimport { useHistory } from 'react-router';\r\n\r\nconst Transition = React.forwardRef(function Transition(props, ref) {\r\n return ;\r\n});\r\n\r\nexport const TicketDialog = (props) => {\r\n const classes = useStyles();\r\n const theme = useTheme();\r\n const history = useHistory();\r\n const responsive = useMediaQuery(theme.breakpoints.down('sm'));\r\n const [progress, setProgress] = useState(props.data.status === \"Emitido\" ? 100 : props.data.percentInitial);\r\n const [reducoes, setReducoes] = useState(props.data.reductionAttempts);\r\n const [snackVariant, setSnackVariant] = useState(\"error\");\r\n const [snackMessage, setSnackMessage] = useState(\"\");\r\n const [snackVisible, setSnackVisible] = useState({ visible: false });\r\n const [isLoading, setIsLoading] = useState(false);\r\n const data = props.data;\r\n\r\n const handleClose = () => {\r\n if (props.isBuying === true) {\r\n history.push(\"/\")\r\n }\r\n props.setOpen(false)\r\n };\r\n\r\n const getDocumentDownload = async () => {\r\n try {\r\n setIsLoading(true)\r\n let response = await bookingService.getDownloadContract(data.id_Booking)\r\n const linkSource = response.data.results;\r\n const link = document.createElement('a');\r\n link.href = linkSource;\r\n link.target = '_blank'\r\n link.download = 'contrato.pdf';\r\n link.click();\r\n } catch (error) {\r\n setSnackVariant(\"error\");\r\n setSnackMessage(\"Falha ao buscar contrato.\");\r\n setSnackVisible({ visible: true });\r\n } finally {\r\n setIsLoading(false)\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n if (progress < 100) {\r\n const timer = setInterval(() => {\r\n setProgress((prevProgress) => (prevProgress >= 100 ? 100 : prevProgress + data.oneUnity));\r\n setReducoes((prevReducoes) => (prevReducoes <= 0 ? 0 : prevReducoes - 1));\r\n }, 1764.7);\r\n\r\n return () => {\r\n clearInterval(timer);\r\n };\r\n }\r\n }, []);\r\n\r\n return (\r\n <>\r\n \r\n >\r\n )\r\n}\r\n","import { makeStyles } from \"@material-ui/core/styles\";\r\n\r\nexport const useStyles = makeStyles((theme) => ({\r\n dados: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n justifyContent: 'space-evenly',\r\n alignItems: 'center',\r\n width: '100%'\r\n },\r\n titulos: {\r\n background: 'DimGray',\r\n color: 'white',\r\n justifyContent: 'space-evenly',\r\n alignItems: 'center',\r\n },\r\n info: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n justifyContent: 'left',\r\n alignItems: 'left',\r\n fontFamily: 'arial',\r\n fontSize: '1%',\r\n marginTop: theme.spacing(2)\r\n },\r\n titulo: {\r\n display: 'flex',\r\n flexDirection: 'row',\r\n justifyContent: 'left',\r\n alignItems: 'left',\r\n marginTop: theme.spacing(3)\r\n },\r\n buttonContract: {\r\n background: '#FF7500',\r\n color: '#ffffff',\r\n '&:hover': {\r\n background: 'rgba(255, 117, 0, 0.8)',\r\n },\r\n }\r\n\r\n}));\r\n","import { Accordion, AccordionDetails, AccordionSummary, Box, Button, Chip, CircularProgress, Dialog, DialogContent, DialogContentText, DialogTitle, Divider, Grid, IconButton, Slide, Tooltip, Typography, useMediaQuery, useTheme } from '@material-ui/core';\r\nimport { CloseOutlined, EcoOutlined, ExpandMoreOutlined, GetAppOutlined } from '@material-ui/icons';\r\nimport React, { useEffect, useState } from 'react';\r\nimport EnumCompany from '../../Enums/enum_FlightCompany';\r\nimport CustomLoader from '../../components/CustomLoader';\r\nimport CustomizedSnackbars from '../../components/CustomSnackBar';\r\nimport bookingService from '../../services/Bookings';\r\nimport { useStyles } from './styles';\r\nimport { useHistory } from 'react-router';\r\n\r\nconst Transition = React.forwardRef(function Transition(props, ref) {\r\n return ;\r\n});\r\n\r\nfunction CircularProgressWithLabel(props) {\r\n\r\n return (\r\n \r\n \r\n \r\n {props.reducoes.toLocaleString(\"pt-BR\", { maximumFractionDigits: 0 })}\r\n tentativas\r\n \r\n \r\n );\r\n}\r\n\r\nexport const TicketDialogMobi = (props) => {\r\n const classes = useStyles();\r\n const history = useHistory();\r\n const theme = useTheme();\r\n const responsive = useMediaQuery(theme.breakpoints.down('sm'));\r\n const [progress, setProgress] = useState(props.data.status === \"Emitido\" ? 100 : props.data.percentInitial);\r\n const [reducoes, setReducoes] = useState(props.data.reductionAttempts);\r\n const [snackVariant, setSnackVariant] = useState(\"error\");\r\n const [snackMessage, setSnackMessage] = useState(\"\");\r\n const [snackVisible, setSnackVisible] = useState({ visible: false });\r\n const [isLoading, setIsLoading] = useState(false);\r\n const data = props.data;\r\n\r\n const handleClose = () => {\r\n if (props.isBuying === true) {\r\n history.push(\"/\")\r\n }\r\n props.setOpen(false)\r\n };\r\n\r\n const getDocumentDownload = async () => {\r\n try {\r\n setIsLoading(true)\r\n let response = await bookingService.getDownloadContract(data.id_Booking)\r\n const linkSource = response.data.results;\r\n const link = document.createElement('a');\r\n link.href = linkSource;\r\n link.target = '_blank'\r\n link.download = 'contrato.pdf';\r\n link.click();\r\n } catch (error) {\r\n setSnackVariant(\"error\");\r\n setSnackMessage(\"Falha ao buscar contrato.\");\r\n setSnackVisible({ visible: true });\r\n } finally {\r\n setIsLoading(false)\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n if (progress < 100) {\r\n const timer = setInterval(() => {\r\n setProgress((prevProgress) => (prevProgress >= 100 ? 100 : prevProgress + data.oneUnity));\r\n setReducoes((prevReducoes) => (prevReducoes <= 0 ? 0 : prevReducoes - 1));\r\n }, 1764.7);\r\n\r\n return () => {\r\n clearInterval(timer);\r\n };\r\n }\r\n }, []);\r\n\r\n return (\r\n <>\r\n \r\n >\r\n )\r\n}\r\n","import { makeStyles } from \"@material-ui/core/styles\";\r\n\r\nconst drawerWidth = 240;\r\n\r\nexport const useStyles = makeStyles((theme) => ({\r\n gridCenter: {\r\n display: 'flex',\r\n justifyContent: 'center'\r\n },\r\n grid: {\r\n maxWidth: '-webkit-fill-available',\r\n display: 'grid',\r\n gridTemplateColumns: '15% 70% 15%'\r\n },\r\n tableContainer: {\r\n maxWidth: '70vw'\r\n },\r\n img: {\r\n height: '55px',\r\n width: 'auto'\r\n },\r\n tableCellCentralized: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'center'\r\n },\r\n gridCellCustom: {\r\n padding: '8px',\r\n }\r\n}));\r\n","import { Box, Button, Chip, Grow, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Typography } from \"@material-ui/core\";\r\nimport React, { useState } from \"react\";\r\nimport { useStyles } from \"./styles\";\r\nimport { IconsSource } from \"../../../images/Icons\";\r\n\r\nexport const DeskListHistoric = (props) => {\r\n const classes = useStyles();\r\n const [grow, setGrow] = useState(true);\r\n\r\n return (\r\n \r\n <>\r\n \r\n Histórico\r\n \r\n \r\n \r\n \r\n \r\n Cia\r\n Data do voo\r\n Trechos\r\n Status\r\n \r\n \r\n \r\n {props.data.length !== 0 ? null : (\r\n \r\n \r\n Não há histórico disponível\r\n \r\n \r\n )}\r\n {props.data.map((item) => (\r\n <>\r\n props.handleOpenTicket(true, item.id_Booking)} style={{ cursor: 'pointer' }}>\r\n \r\n \r\n \r\n \r\n {item.departureDate}\r\n \r\n \r\n {item.route}\r\n \r\n \r\n \r\n \r\n \r\n \r\n {item.pix != null ? (\r\n <>\r\n \r\n \r\n \r\n \r\n Há pix disponível para pagamento\r\n \r\n \r\n \r\n \r\n >\r\n ) : (\r\n null\r\n )}\r\n \r\n >\r\n ))}\r\n \r\n \r\n \r\n >\r\n \r\n )\r\n}\r\n","import { makeStyles } from \"@material-ui/core/styles\";\r\n\r\nconst drawerWidth = 240;\r\n\r\nexport const useStyles = makeStyles((theme) => ({\r\n gridCenter: {\r\n display: 'flex',\r\n justifyContent: 'center'\r\n },\r\n grid: {\r\n maxWidth: '-webkit-fill-available',\r\n display: 'grid',\r\n gridTemplateColumns: '15% 70% 15%'\r\n },\r\n tableContainer: {\r\n maxWidth: '70vw'\r\n },\r\n\r\n}));\r\n","import { Box, Button, Chip, Grid, Grow, List, ListItem, Typography } from \"@material-ui/core\";\r\nimport React, { useState } from \"react\";\r\nimport EnumCompany from \"../../../Enums/enum_FlightCompany\";\r\nimport { useStyles } from \"./styles\";\r\nimport { IconsSource } from \"../../../images/Icons\";\r\n\r\nexport const MobiListHistoric = (props) => {\r\n const classes = useStyles();\r\n const [grow, setGrow] = useState(true);\r\n\r\n return (\r\n \r\n <>\r\n \r\n Histórico\r\n \r\n {props.data.length !== 0 ? null : (\r\n Não há histórico disponível\r\n )}\r\n \r\n {props.data.map((item) => (\r\n \r\n \r\n props.handleOpenTicket(true, item.id_Booking)} item xs={12} style={{ display: 'grid', justifyContent: 'center' }}>\r\n \r\n \r\n props.handleOpenTicket(true, item.id_Booking)} item xs={12} style={{ display: 'grid', justifyContent: 'center' }}>\r\n \r\n \r\n props.handleOpenTicket(true, item.id_Booking)} item xs={12} style={{ display: 'grid', justifyContent: 'center' }}>\r\n \r\n Data de partida: {item.departureDate}\r\n \r\n \r\n props.handleOpenTicket(true, item.id_Booking)} item xs={12} style={{ display: 'grid', justifyContent: 'center' }}>\r\n \r\n {item.route}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Há pix disponível para pagamento\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ))}\r\n \r\n >\r\n \r\n )\r\n}\r\n","import { makeStyles } from \"@material-ui/core/styles\";\r\n\r\nexport const useStyles = makeStyles((theme) => ({\r\n gridCenter: {\r\n display: 'flex',\r\n justifyContent: 'center'\r\n },\r\n grid: {\r\n maxWidth: '-webkit-fill-available',\r\n display: 'grid',\r\n gridTemplateColumns: '15% 70% 15%'\r\n },\r\n gridWithNoPromo: {\r\n maxWidth: '1100px',\r\n minHeight: '450px'\r\n },\r\n img: {\r\n maxWidth: '-webkit-fill-available',\r\n },\r\n divCentral: {\r\n paddingLeft: '10px',\r\n paddingRight: '10px'\r\n },\r\n divPromo: {\r\n padding: '10px',\r\n }\r\n\r\n}));\r\n","import * as React from 'react';\nimport createSvgIcon from './utils/createSvgIcon';\nexport default createSvgIcon( /*#__PURE__*/React.createElement(\"path\", {\n d: \"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4H8c-1.1 0-1.99.9-1.99 2L6 21c0 1.1.89 2 1.99 2H19c1.1 0 2-.9 2-2V11l-6-6zM8 21V7h6v5h5v9H8z\"\n}), 'FileCopyOutlined');","import { makeStyles } from \"@material-ui/core/styles\";\r\n\r\nexport const useStyles = makeStyles((theme) => ({\r\n dialogPaper: {\r\n minHeight: \"90vh\",\r\n maxHeight: \"90vh\",\r\n },\r\n\r\n dialogTitle: {\r\n background: \"#612F74\",\r\n display: 'flex',\r\n flexDirection: 'row',\r\n justifyContent: 'space-between',\r\n alignItems: 'center',\r\n color: '#fafafa',\r\n },\r\n\r\n buttonNext: {\r\n background: \"#ff7500\",\r\n color: \"white\",\r\n \"&:hover\": {\r\n background: \"rgba(255, 117, 0, 0.8)\"\r\n },\r\n borderRadius: \"5px\",\r\n },\r\n\r\n button: {\r\n border: 0,\r\n color: \"white\",\r\n padding: \"5px 10px 5px 10px\",\r\n borderRadius: \"5px\",\r\n cursor: \"pointer\",\r\n background:\r\n \"linear-gradient( 136deg, rgb(242,113,33) 0%, rgb(233,64,87) 50%, rgb(138,35,135) 100%);\",\r\n \"&:hover\": {\r\n background:\r\n \"linear-gradient( 136deg, rgb(222,93,13) 0%, rgb(213,44,67) 50%, rgb(118,15,115) 100%);\",\r\n },\r\n fontSize: \"1rem\",\r\n fontFamily: \"Open Sans\",\r\n fontWeight: \"400\",\r\n lineHeight: \"1.5\",\r\n margin: 0,\r\n },\r\n textFieldCopy: {\r\n // width: \"25ch\"\r\n }\r\n}));\r\n","import React from 'react';\r\nimport QRCode from 'react-qr-code';\r\nimport { Grid, Typography } from '@material-ui/core';\r\n\r\nconst QRCodeComponent = ({ data }) => {\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default QRCodeComponent;","\r\nimport { Box, Button, Dialog, DialogActions, DialogContent, DialogTitle, Grid, IconButton, InputAdornment, Paper, Slide, Snackbar, TextField, Tooltip, Typography, useMediaQuery, useTheme } from \"@material-ui/core\"\r\nimport { CloseOutlined, ContentCopy, FileCopyOutlined } from \"@material-ui/icons\"\r\nimport CheckCircleIcon from '@material-ui/icons/CheckCircle';\r\nimport { useStyles } from \"./styles.jsx\";\r\nimport React from \"react\";\r\nimport QRCodeComponent from \"../../../components/01_Rename-QRCodeComponent/index.jsx\";\r\nimport PixPaymentService from \"../../../services/01_PixPayment/index.jsx\";\r\nimport { useState } from \"react\";\r\nimport { useEffect } from \"react\";\r\nimport bookingService from \"../../../services/Bookings/index.js\";\r\nimport { Alert, Skeleton } from \"@material-ui/lab\";\r\nimport { IconsSource } from \"../../../images/Icons/index.js\";\r\n\r\nexport const PixPaymentDialog = (props) => {\r\n const classes = useStyles();\r\n const theme = useTheme();\r\n const responsive = useMediaQuery(theme.breakpoints.down(\"sm\"));\r\n const [pixPayment, setPixPayment] = useState([]);\r\n const [copy, setCopy] = useState(false);\r\n\r\n const Transition = React.forwardRef(function Transition(props, ref) {\r\n return ;\r\n });\r\n\r\n const handleClose = () => {\r\n props.setOpen(false)\r\n }\r\n\r\n const PixPaymentCheck = async () => {\r\n try {\r\n let response = await bookingService.getListPixActives(props.id);\r\n setPixPayment(response.data.results)\r\n } catch {\r\n } finally {\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n PixPaymentCheck();\r\n }, [props.id])\r\n\r\n return (\r\n \r\n )\r\n}\r\n","import api from '../../Api';\r\n\r\nconst PixPaymentService = {\r\n CreatePixPayment: async (dto) => {\r\n const response = await api.post('/Air/test-connection', dto);\r\n return response;\r\n },\r\n}\r\n\r\nexport default PixPaymentService;\r\n","import { Grid, useMediaQuery, useTheme } from \"@material-ui/core\";\r\nimport React, { useLayoutEffect, useState } from \"react\";\r\nimport CustomLoader from \"../../components/CustomLoader\";\r\nimport CustomizedSnackbars from \"../../components/CustomSnackBar\";\r\nimport bookingService from \"../../services/Bookings\";\r\nimport { TicketDialog } from \"../../templates/TicketDialog\";\r\nimport { TicketDialogMobi } from \"../../templates/TicketDialogMobi\";\r\nimport { Dashboard } from \"../Dashboard\";\r\nimport { DeskListHistoric } from \"./DeskListHistoric\";\r\nimport { MobiListHistoric } from \"./MobiListHistoric\";\r\nimport { useStyles } from \"./styles\";\r\nimport { PixPaymentDialog } from \"../../templates/BuyingDialog/PixPaymentFinally\";\r\n\r\nconst MyHistoric = (props) => {\r\n const classes = useStyles();\r\n const [isLoading, setIsLoading] = useState(false);\r\n const [bookings, setBookings] = useState([]);\r\n const [pixs, setPixs] = useState([]);\r\n const theme = useTheme();\r\n const responsive = useMediaQuery(theme.breakpoints.down('sm'));\r\n const [openTicketDialog, setOpenTicketDialog] = useState(false);\r\n const [dataTicket, setDataTicket] = useState([]);\r\n const [idTicket, setIdTicket] = useState(0);\r\n const [snackVariant, setSnackVariant] = useState(\"error\");\r\n const [snackMessage, setSnackMessage] = useState(\"\");\r\n const [snackVisible, setSnackVisible] = useState({ visible: false });\r\n const [openPix, setOpenPix] = useState(false)\r\n const [idBookingSelected, setIdBookingSelected] = useState(null)\r\n\r\n const SearchBookings = async () => {\r\n let response = null;\r\n try {\r\n setIsLoading(true)\r\n response = await bookingService.getListBooking()\r\n setBookings(response.data.results)\r\n } catch (e) {\r\n if (e.response.data.message) {\r\n setSnackVariant(e.response.data.variant);\r\n setSnackMessage(e.response.data.message);\r\n setSnackVisible({ visible: true });\r\n } else {\r\n setSnackVariant(\"error\");\r\n setSnackMessage(\"Falha ao consultar histórico.\");\r\n setSnackVisible({ visible: true });\r\n }\r\n } finally {\r\n setIsLoading(false)\r\n }\r\n }\r\n\r\n const handleOpenTicket = async (open, id_Booking) => {\r\n setIsLoading(true)\r\n try {\r\n let response = await bookingService.getById(id_Booking);\r\n setDataTicket(response.data.results)\r\n setOpenTicketDialog(open)\r\n setIdTicket(id_Booking)\r\n } catch (error) {\r\n setSnackVariant(\"erro\");\r\n setSnackMessage(\"Falha ao consultar bilhete.\");\r\n setSnackVisible({ visible: true });\r\n } finally {\r\n setIsLoading(false)\r\n }\r\n }\r\n\r\n useLayoutEffect(() => {\r\n SearchBookings()\r\n }, [])\r\n\r\n return (\r\n <>\r\n {openPix && (\r\n \r\n )}\r\n \r\n \r\n \r\n {openTicketDialog ?\r\n responsive ? (\r\n \r\n ) : (\r\n \r\n )\r\n : (\r\n null\r\n )}\r\n \r\n {responsive ? (\r\n \r\n \r\n \r\n ) : (\r\n // \r\n \r\n {/* \r\n  \r\n */}\r\n \r\n \r\n \r\n {/* \r\n  \r\n */}\r\n \r\n )}\r\n \r\n \r\n >\r\n )\r\n}\r\n\r\nexport const DashMyHistoric = (props) => {\r\n\r\n return (\r\n \r\n \r\n\r\n \r\n )\r\n};\r\nexport default DashMyHistoric;\r\n","import * as React from 'react';\nimport createSvgIcon from './utils/createSvgIcon';\nexport default createSvgIcon( /*#__PURE__*/React.createElement(\"path\", {\n d: \"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z\"\n}), 'AddOutlined');","import * as React from 'react';\nimport createSvgIcon from './utils/createSvgIcon';\nexport default createSvgIcon( /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14.06 9.02l.92.92L5.92 19H5v-.92l9.06-9.06M17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29zm-3.6 3.19L3 17.25V21h3.75L17.81 9.94l-3.75-3.75z\"\n}), 'EditOutlined');","import { makeStyles } from \"@material-ui/core/styles\";\r\n\r\nexport const useStyles = makeStyles((theme) => ({\r\n root: {\r\n maxWidth: 345,\r\n },\r\n dialogContentCustom: {\r\n padding: '0px',\r\n margin: '0px 20px 0px 20px',\r\n overflowX: 'hidden'\r\n },\r\n buttonSearch: {\r\n width: '100%',\r\n background:\r\n \"linear-gradient(90deg, rgba(255,165,0,1) 0%, rgba(255,174,25,1) 100%);\",\r\n color: 'white',\r\n '&:hover': {\r\n background:\r\n \"linear-gradient(90deg, rgba(97,47,116,1) 0%, rgba(112,67,129,1) 100%);\",\r\n },\r\n borderRadius: '25px'\r\n },\r\n dialogActions: {\r\n padding: '8px 24px',\r\n },\r\n\r\n}));\r\n","import { Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Slide, Typography, useMediaQuery, useTheme } from \"@material-ui/core\";\r\nimport React from \"react\";\r\nimport personService from \"../../services/Person\";\r\nimport { useStyles } from './styles';\r\n\r\nconst Transition = React.forwardRef(function Transition(props, ref) {\r\n return ;\r\n});\r\n\r\nexport const DeletePersonDialog = (props) => {\r\n const classes = useStyles();\r\n const theme = useTheme();\r\n const responsive = useMediaQuery(theme.breakpoints.down('sm'));\r\n\r\n const handleClose = () => {\r\n props.setOpen(false)\r\n };\r\n\r\n const handleClickConfirm = async () => {\r\n props.setIsLoading(true)\r\n try {\r\n await personService.deletePerson(props.idpax)\r\n props.setSnackMessage(\"Passageiro excluído.\");\r\n props.setSnackVariant(\"success\");\r\n props.setSnackVisible({ visible: true });\r\n props.searchListPerson()\r\n handleClose()\r\n } catch (error) {\r\n props.setSnackMessage(\"Falha ao excluir passageiro.\");\r\n props.setSnackVariant(\"error\");\r\n props.setSnackVisible({ visible: true });\r\n } finally {\r\n props.setIsLoading(false)\r\n }\r\n }\r\n\r\n return (\r\n <>\r\n \r\n >\r\n )\r\n\r\n\r\n}\r\n","import { makeStyles } from \"@material-ui/core/styles\";\r\n\r\nexport const useStyles = makeStyles((theme) => ({\r\n\r\n}));\r\n","import { Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Slide, Typography } from '@material-ui/core';\r\nimport React from 'react';\r\nimport { useLayoutEffect } from 'react';\r\nimport { useStyles } from './styles';\r\n\r\nconst Transition = React.forwardRef(function Transition(props, ref) {\r\n return ;\r\n});\r\n\r\nexport default function DialogMessage(props) {\r\n const classes = useStyles();\r\n\r\n const handleClose = () => {\r\n props.setOpen(false)\r\n };\r\n\r\n return (\r\n <>\r\n \r\n >\r\n )\r\n}\r\n","import * as React from 'react';\nimport createSvgIcon from './utils/createSvgIcon';\nexport default createSvgIcon( /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\"\n}), 'SearchOutlined');","\r\nexport const EnumGenre = {\r\n\r\n types: [\r\n {\r\n value: 1,\r\n label: \"MASCULINO\"\r\n },\r\n {\r\n value: 2,\r\n label: \"FEMININO\"\r\n },\r\n {\r\n value: 3,\r\n label: \"PREFIRO NÃO INFORMAR\"\r\n }\r\n ],\r\n\r\n getGenreList: function () {\r\n return this.types;\r\n }\r\n\r\n}\r\n","export default function toInteger(dirtyNumber) {\n if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {\n return NaN;\n }\n\n var number = Number(dirtyNumber);\n\n if (isNaN(number)) {\n return number;\n }\n\n return number < 0 ? Math.ceil(number) : Math.floor(number);\n}","export default function requiredArgs(required, args) {\n if (args.length < required) {\n throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');\n }\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @param {Date|Number} argument - the value to convert\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\n\nexport default function toDate(argument) {\n requiredArgs(1, arguments);\n var argStr = Object.prototype.toString.call(argument); // Clone the date\n\n if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime());\n } else if (typeof argument === 'number' || argStr === '[object Number]') {\n return new Date(argument);\n } else {\n if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {\n // eslint-disable-next-line no-console\n 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\n\n console.warn(new Error().stack);\n }\n\n return new Date(NaN);\n }\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addDays\n * @category Day Helpers\n * @summary Add the specified number of days to the given date.\n *\n * @description\n * Add the specified number of days to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of days to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} - the new date with the days added\n * @throws {TypeError} - 2 arguments required\n *\n * @example\n * // Add 10 days to 1 September 2014:\n * const result = addDays(new Date(2014, 8, 1), 10)\n * //=> Thu Sep 11 2014 00:00:00\n */\n\nexport default function addDays(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var amount = toInteger(dirtyAmount);\n\n if (isNaN(amount)) {\n return new Date(NaN);\n }\n\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return date;\n }\n\n date.setDate(date.getDate() + amount);\n return date;\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addMonths\n * @category Month Helpers\n * @summary Add the specified number of months to the given date.\n *\n * @description\n * Add the specified number of months to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of months to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the months added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 5 months to 1 September 2014:\n * const result = addMonths(new Date(2014, 8, 1), 5)\n * //=> Sun Feb 01 2015 00:00:00\n */\n\nexport default function addMonths(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var amount = toInteger(dirtyAmount);\n\n if (isNaN(amount)) {\n return new Date(NaN);\n }\n\n if (!amount) {\n // If 0 months, no-op to avoid changing times in the hour before end of DST\n return date;\n }\n\n var dayOfMonth = date.getDate(); // The JS Date object supports date math by accepting out-of-bounds values for\n // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and\n // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we\n // want except that dates will wrap around the end of a month, meaning that\n // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So\n // we'll default to the end of the desired month by adding 1 to the desired\n // month and using a date of 0 to back up one day to the end of the desired\n // month.\n\n var endOfDesiredMonth = new Date(date.getTime());\n endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0);\n var daysInMonth = endOfDesiredMonth.getDate();\n\n if (dayOfMonth >= daysInMonth) {\n // If we're already at the end of the month, then this is the correct date\n // and we're done.\n return endOfDesiredMonth;\n } else {\n // Otherwise, we now know that setting the original day-of-month value won't\n // cause an overflow, so set the desired day-of-month. Note that we can't\n // just set the date of `endOfDesiredMonth` because that object may have had\n // its time changed in the unusual case where where a DST transition was on\n // the last day of the month and its local time was in the hour skipped or\n // repeated next to a DST transition. So we use `date` instead which is\n // guaranteed to still have the original time.\n date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);\n return date;\n }\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMonths from \"../addMonths/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addYears\n * @category Year Helpers\n * @summary Add the specified number of years to the given date.\n *\n * @description\n * Add the specified number of years to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of years to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the years added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 5 years to 1 September 2014:\n * const result = addYears(new Date(2014, 8, 1), 5)\n * //=> Sun Sep 01 2019 00:00:00\n */\n\nexport default function addYears(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMonths(dirtyDate, amount * 12);\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfDay\n * @category Day Helpers\n * @summary Return the end of a day for the given date.\n *\n * @description\n * Return the end of a day for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a day\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a day for 2 September 2014 11:55:00:\n * const result = endOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 23:59:59.999\n */\n\nexport default function endOfDay(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n\n/**\n * @name endOfWeek\n * @category Week Helpers\n * @summary Return the end of a week for the given date.\n *\n * @description\n * Return the end of a week for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Date} the end of a week\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n *\n * @example\n * // The end of a week for 2 September 2014 11:55:00:\n * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sat Sep 06 2014 23:59:59.999\n *\n * @example\n * // If the week starts on Monday, the end of the week for 2 September 2014 11:55:00:\n * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 23:59:59.999\n */\nexport default function endOfWeek(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = date.getDay();\n var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);\n date.setDate(date.getDate() + diff);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfYear\n * @category Year Helpers\n * @summary Return the end of a year for the given date.\n *\n * @description\n * Return the end of a year for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a year for 2 September 2014 11:55:00:\n * var result = endOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Dec 31 2014 23:59:59.999\n */\n\nexport default function endOfYear(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n date.setFullYear(year + 1, 0, 0);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {*} value - the value to check\n * @returns {boolean} true if the given value is a date\n * @throws {TypeError} 1 arguments required\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\n\nexport default function isDate(value) {\n requiredArgs(1, arguments);\n return value instanceof Date || typeof value === 'object' && Object.prototype.toString.call(value) === '[object Date]';\n}","import isDate from \"../isDate/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - Now `isValid` doesn't throw an exception\n * if the first argument is not an instance of Date.\n * Instead, argument is converted beforehand using `toDate`.\n *\n * Examples:\n *\n * | `isValid` argument | Before v2.0.0 | v2.0.0 onward |\n * |---------------------------|---------------|---------------|\n * | `new Date()` | `true` | `true` |\n * | `new Date('2016-01-01')` | `true` | `true` |\n * | `new Date('')` | `false` | `false` |\n * | `new Date(1488370835081)` | `true` | `true` |\n * | `new Date(NaN)` | `false` | `false` |\n * | `'2016-01-01'` | `TypeError` | `false` |\n * | `''` | `TypeError` | `false` |\n * | `1488370835081` | `TypeError` | `true` |\n * | `NaN` | `TypeError` | `false` |\n *\n * We introduce this change to make *date-fns* consistent with ECMAScript behavior\n * that try to coerce arguments to the expected type\n * (which is also the case with other *date-fns* functions).\n *\n * @param {*} date - the date to check\n * @returns {Boolean} the date is valid\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertable into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\n\nexport default function isValid(dirtyDate) {\n requiredArgs(1, arguments);\n\n if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {\n return false;\n }\n\n var date = toDate(dirtyDate);\n return !isNaN(Number(date));\n}","var formatDistanceLocale = {\n lessThanXSeconds: {\n one: 'less than a second',\n other: 'less than {{count}} seconds'\n },\n xSeconds: {\n one: '1 second',\n other: '{{count}} seconds'\n },\n halfAMinute: 'half a minute',\n lessThanXMinutes: {\n one: 'less than a minute',\n other: 'less than {{count}} minutes'\n },\n xMinutes: {\n one: '1 minute',\n other: '{{count}} minutes'\n },\n aboutXHours: {\n one: 'about 1 hour',\n other: 'about {{count}} hours'\n },\n xHours: {\n one: '1 hour',\n other: '{{count}} hours'\n },\n xDays: {\n one: '1 day',\n other: '{{count}} days'\n },\n aboutXWeeks: {\n one: 'about 1 week',\n other: 'about {{count}} weeks'\n },\n xWeeks: {\n one: '1 week',\n other: '{{count}} weeks'\n },\n aboutXMonths: {\n one: 'about 1 month',\n other: 'about {{count}} months'\n },\n xMonths: {\n one: '1 month',\n other: '{{count}} months'\n },\n aboutXYears: {\n one: 'about 1 year',\n other: 'about {{count}} years'\n },\n xYears: {\n one: '1 year',\n other: '{{count}} years'\n },\n overXYears: {\n one: 'over 1 year',\n other: 'over {{count}} years'\n },\n almostXYears: {\n one: 'almost 1 year',\n other: 'almost {{count}} years'\n }\n};\n\nvar formatDistance = function (token, count, options) {\n var result;\n var tokenValue = formatDistanceLocale[token];\n\n if (typeof tokenValue === 'string') {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace('{{count}}', count.toString());\n }\n\n if (options !== null && options !== void 0 && options.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return 'in ' + result;\n } else {\n return result + ' ago';\n }\n }\n\n return result;\n};\n\nexport default formatDistance;","export default function buildFormatLongFn(args) {\n return function () {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n // TODO: Remove String()\n var width = options.width ? String(options.width) : args.defaultWidth;\n var format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}","import buildFormatLongFn from \"../../../_lib/buildFormatLongFn/index.js\";\nvar dateFormats = {\n full: 'EEEE, MMMM do, y',\n long: 'MMMM do, y',\n medium: 'MMM d, y',\n short: 'MM/dd/yyyy'\n};\nvar timeFormats = {\n full: 'h:mm:ss a zzzz',\n long: 'h:mm:ss a z',\n medium: 'h:mm:ss a',\n short: 'h:mm a'\n};\nvar dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: '{{date}}, {{time}}',\n short: '{{date}}, {{time}}'\n};\nvar formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: 'full'\n }),\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: 'full'\n }),\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: 'full'\n })\n};\nexport default formatLong;","var formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: 'P'\n};\n\nvar formatRelative = function (token, _date, _baseDate, _options) {\n return formatRelativeLocale[token];\n};\n\nexport default formatRelative;","export default function buildLocalizeFn(args) {\n return function (dirtyIndex, dirtyOptions) {\n var options = dirtyOptions || {};\n var context = options.context ? String(options.context) : 'standalone';\n var valuesArray;\n\n if (context === 'formatting' && args.formattingValues) {\n var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n var width = options.width ? String(options.width) : defaultWidth;\n valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n var _defaultWidth = args.defaultWidth;\n\n var _width = options.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[_width] || args.values[_defaultWidth];\n }\n\n var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; // @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!\n\n return valuesArray[index];\n };\n}","import buildLocalizeFn from \"../../../_lib/buildLocalizeFn/index.js\";\nvar eraValues = {\n narrow: ['B', 'A'],\n abbreviated: ['BC', 'AD'],\n wide: ['Before Christ', 'Anno Domini']\n};\nvar quarterValues = {\n narrow: ['1', '2', '3', '4'],\n abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],\n wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']\n}; // Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\n\nvar monthValues = {\n narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],\n abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']\n};\nvar dayValues = {\n narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],\n short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']\n};\nvar dayPeriodValues = {\n narrow: {\n am: 'a',\n pm: 'p',\n midnight: 'mi',\n noon: 'n',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n },\n abbreviated: {\n am: 'AM',\n pm: 'PM',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n },\n wide: {\n am: 'a.m.',\n pm: 'p.m.',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n }\n};\nvar formattingDayPeriodValues = {\n narrow: {\n am: 'a',\n pm: 'p',\n midnight: 'mi',\n noon: 'n',\n morning: 'in the morning',\n afternoon: 'in the afternoon',\n evening: 'in the evening',\n night: 'at night'\n },\n abbreviated: {\n am: 'AM',\n pm: 'PM',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'in the morning',\n afternoon: 'in the afternoon',\n evening: 'in the evening',\n night: 'at night'\n },\n wide: {\n am: 'a.m.',\n pm: 'p.m.',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'in the morning',\n afternoon: 'in the afternoon',\n evening: 'in the evening',\n night: 'at night'\n }\n};\n\nvar ordinalNumber = function (dirtyNumber, _options) {\n var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n var rem100 = number % 100;\n\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + 'st';\n\n case 2:\n return number + 'nd';\n\n case 3:\n return number + 'rd';\n }\n }\n\n return number + 'th';\n};\n\nvar localize = {\n ordinalNumber: ordinalNumber,\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: 'wide'\n }),\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: 'wide',\n argumentCallback: function (quarter) {\n return quarter - 1;\n }\n }),\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: 'wide'\n }),\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: 'wide'\n }),\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: 'wide',\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: 'wide'\n })\n};\nexport default localize;","export default function buildMatchFn(args) {\n return function (string) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var width = options.width;\n var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];\n var matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n\n var matchedString = matchResult[0];\n var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];\n var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {\n return pattern.test(matchedString);\n }) : findKey(parsePatterns, function (pattern) {\n return pattern.test(matchedString);\n });\n var value;\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback ? options.valueCallback(value) : value;\n var rest = string.slice(matchedString.length);\n return {\n value: value,\n rest: rest\n };\n };\n}\n\nfunction findKey(object, predicate) {\n for (var key in object) {\n if (object.hasOwnProperty(key) && predicate(object[key])) {\n return key;\n }\n }\n\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (var key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n\n return undefined;\n}","export default function buildMatchPatternFn(args) {\n return function (string) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n var matchedString = matchResult[0];\n var parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];\n value = options.valueCallback ? options.valueCallback(value) : value;\n var rest = string.slice(matchedString.length);\n return {\n value: value,\n rest: rest\n };\n };\n}","import buildMatchFn from \"../../../_lib/buildMatchFn/index.js\";\nimport buildMatchPatternFn from \"../../../_lib/buildMatchPatternFn/index.js\";\nvar matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nvar parseOrdinalNumberPattern = /\\d+/i;\nvar matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i\n};\nvar parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i]\n};\nvar matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i\n};\nvar parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i]\n};\nvar matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i\n};\nvar parseMonthPatterns = {\n 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],\n 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]\n};\nvar matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i\n};\nvar parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]\n};\nvar matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i\n};\nvar parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i\n }\n};\nvar match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: function (value) {\n return parseInt(value, 10);\n }\n }),\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseEraPatterns,\n defaultParseWidth: 'any'\n }),\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: 'any',\n valueCallback: function (index) {\n return index + 1;\n }\n }),\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: 'any'\n }),\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseDayPatterns,\n defaultParseWidth: 'any'\n }),\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: 'any',\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: 'any'\n })\n};\nexport default match;","import formatDistance from \"./_lib/formatDistance/index.js\";\nimport formatLong from \"./_lib/formatLong/index.js\";\nimport formatRelative from \"./_lib/formatRelative/index.js\";\nimport localize from \"./_lib/localize/index.js\";\nimport match from \"./_lib/match/index.js\";\n\n/**\n * @type {Locale}\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}\n * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}\n */\nvar locale = {\n code: 'en-US',\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0\n /* Sunday */\n ,\n firstWeekContainsDate: 1\n }\n};\nexport default locale;","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addMilliseconds\n * @category Millisecond Helpers\n * @summary Add the specified number of milliseconds to the given date.\n *\n * @description\n * Add the specified number of milliseconds to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @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`.\n * @returns {Date} the new date with the milliseconds added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 750 milliseconds to 10 July 2014 12:45:30.000:\n * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:30.750\n */\n\nexport default function addMilliseconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var timestamp = toDate(dirtyDate).getTime();\n var amount = toInteger(dirtyAmount);\n return new Date(timestamp + amount);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMilliseconds from \"../addMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name subMilliseconds\n * @category Millisecond Helpers\n * @summary Subtract the specified number of milliseconds from the given date.\n *\n * @description\n * Subtract the specified number of milliseconds from the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @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`.\n * @returns {Date} the new date with the milliseconds subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:\n * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:29.250\n */\n\nexport default function subMilliseconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMilliseconds(dirtyDate, -amount);\n}","import toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCDayOfYear(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var timestamp = date.getTime();\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n var startOfYearTimestamp = date.getTime();\n var difference = timestamp - startOfYearTimestamp;\n return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;\n}","import toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n var weekStartsOn = 1;\n var date = toDate(dirtyDate);\n var day = date.getUTCDay();\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n date.setUTCDate(date.getUTCDate() - diff);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCISOWeekYear(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getUTCFullYear();\n var fourthOfJanuaryOfNextYear = new Date(0);\n fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);\n var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);\n var fourthOfJanuaryOfThisYear = new Date(0);\n fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);\n var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);\n\n if (date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}","import getUTCISOWeekYear from \"../getUTCISOWeekYear/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCISOWeekYear(dirtyDate) {\n requiredArgs(1, arguments);\n var year = getUTCISOWeekYear(dirtyDate);\n var fourthOfJanuary = new Date(0);\n fourthOfJanuary.setUTCFullYear(year, 0, 4);\n fourthOfJanuary.setUTCHours(0, 0, 0, 0);\n var date = startOfUTCISOWeek(fourthOfJanuary);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nimport startOfUTCISOWeekYear from \"../startOfUTCISOWeekYear/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}","import toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nimport toInteger from \"../toInteger/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCWeek(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = date.getUTCDay();\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n date.setUTCDate(date.getUTCDate() - diff);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport toInteger from \"../toInteger/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCWeekYear(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getUTCFullYear();\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var firstWeekOfNextYear = new Date(0);\n firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);\n var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions);\n var firstWeekOfThisYear = new Date(0);\n firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);\n var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions);\n\n if (date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}","import getUTCWeekYear from \"../getUTCWeekYear/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport toInteger from \"../toInteger/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCWeekYear(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);\n var year = getUTCWeekYear(dirtyDate, dirtyOptions);\n var firstWeek = new Date(0);\n firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setUTCHours(0, 0, 0, 0);\n var date = startOfUTCWeek(firstWeek, dirtyOptions);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport startOfUTCWeekYear from \"../startOfUTCWeekYear/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCWeek(dirtyDate, options) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}","export default function addLeadingZeros(number, targetLength) {\n var sign = number < 0 ? '-' : '';\n var output = Math.abs(number).toString();\n\n while (output.length < targetLength) {\n output = '0' + output;\n }\n\n return sign + output;\n}","import addLeadingZeros from \"../../addLeadingZeros/index.js\";\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nvar formatters = {\n // Year\n y: function (date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);\n },\n // Month\n M: function (date, token) {\n var month = date.getUTCMonth();\n return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n // Day of the month\n d: function (date, token) {\n return addLeadingZeros(date.getUTCDate(), token.length);\n },\n // AM or PM\n a: function (date, token) {\n var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';\n\n switch (token) {\n case 'a':\n case 'aa':\n return dayPeriodEnumValue.toUpperCase();\n\n case 'aaa':\n return dayPeriodEnumValue;\n\n case 'aaaaa':\n return dayPeriodEnumValue[0];\n\n case 'aaaa':\n default:\n return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';\n }\n },\n // Hour [1-12]\n h: function (date, token) {\n return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);\n },\n // Hour [0-23]\n H: function (date, token) {\n return addLeadingZeros(date.getUTCHours(), token.length);\n },\n // Minute\n m: function (date, token) {\n return addLeadingZeros(date.getUTCMinutes(), token.length);\n },\n // Second\n s: function (date, token) {\n return addLeadingZeros(date.getUTCSeconds(), token.length);\n },\n // Fraction of second\n S: function (date, token) {\n var numberOfDigits = token.length;\n var milliseconds = date.getUTCMilliseconds();\n var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));\n return addLeadingZeros(fractionalSeconds, token.length);\n }\n};\nexport default formatters;","import getUTCDayOfYear from \"../../../_lib/getUTCDayOfYear/index.js\";\nimport getUTCISOWeek from \"../../../_lib/getUTCISOWeek/index.js\";\nimport getUTCISOWeekYear from \"../../../_lib/getUTCISOWeekYear/index.js\";\nimport getUTCWeek from \"../../../_lib/getUTCWeek/index.js\";\nimport getUTCWeekYear from \"../../../_lib/getUTCWeekYear/index.js\";\nimport addLeadingZeros from \"../../addLeadingZeros/index.js\";\nimport lightFormatters from \"../lightFormatters/index.js\";\nvar dayPeriodEnum = {\n am: 'am',\n pm: 'pm',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n};\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nvar formatters = {\n // Era\n G: function (date, token, localize) {\n var era = date.getUTCFullYear() > 0 ? 1 : 0;\n\n switch (token) {\n // AD, BC\n case 'G':\n case 'GG':\n case 'GGG':\n return localize.era(era, {\n width: 'abbreviated'\n });\n // A, B\n\n case 'GGGGG':\n return localize.era(era, {\n width: 'narrow'\n });\n // Anno Domini, Before Christ\n\n case 'GGGG':\n default:\n return localize.era(era, {\n width: 'wide'\n });\n }\n },\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === 'yo') {\n var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, {\n unit: 'year'\n });\n }\n\n return lightFormatters.y(date, token);\n },\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year\n\n if (token === 'YY') {\n var twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n } // Ordinal number\n\n\n if (token === 'Yo') {\n return localize.ordinalNumber(weekYear, {\n unit: 'year'\n });\n } // Padding\n\n\n return addLeadingZeros(weekYear, token.length);\n },\n // ISO week-numbering year\n R: function (date, token) {\n var isoWeekYear = getUTCISOWeekYear(date); // Padding\n\n return addLeadingZeros(isoWeekYear, token.length);\n },\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n var year = date.getUTCFullYear();\n return addLeadingZeros(year, token.length);\n },\n // Quarter\n Q: function (date, token, localize) {\n var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);\n\n switch (token) {\n // 1, 2, 3, 4\n case 'Q':\n return String(quarter);\n // 01, 02, 03, 04\n\n case 'QQ':\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n\n case 'Qo':\n return localize.ordinalNumber(quarter, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'QQQ':\n return localize.quarter(quarter, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'QQQQQ':\n return localize.quarter(quarter, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'QQQQ':\n default:\n return localize.quarter(quarter, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone quarter\n q: function (date, token, localize) {\n var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);\n\n switch (token) {\n // 1, 2, 3, 4\n case 'q':\n return String(quarter);\n // 01, 02, 03, 04\n\n case 'qq':\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n\n case 'qo':\n return localize.ordinalNumber(quarter, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'qqq':\n return localize.quarter(quarter, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'qqqqq':\n return localize.quarter(quarter, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'qqqq':\n default:\n return localize.quarter(quarter, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // Month\n M: function (date, token, localize) {\n var month = date.getUTCMonth();\n\n switch (token) {\n case 'M':\n case 'MM':\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n\n case 'Mo':\n return localize.ordinalNumber(month + 1, {\n unit: 'month'\n });\n // Jan, Feb, ..., Dec\n\n case 'MMM':\n return localize.month(month, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // J, F, ..., D\n\n case 'MMMMM':\n return localize.month(month, {\n width: 'narrow',\n context: 'formatting'\n });\n // January, February, ..., December\n\n case 'MMMM':\n default:\n return localize.month(month, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone month\n L: function (date, token, localize) {\n var month = date.getUTCMonth();\n\n switch (token) {\n // 1, 2, ..., 12\n case 'L':\n return String(month + 1);\n // 01, 02, ..., 12\n\n case 'LL':\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n\n case 'Lo':\n return localize.ordinalNumber(month + 1, {\n unit: 'month'\n });\n // Jan, Feb, ..., Dec\n\n case 'LLL':\n return localize.month(month, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // J, F, ..., D\n\n case 'LLLLL':\n return localize.month(month, {\n width: 'narrow',\n context: 'standalone'\n });\n // January, February, ..., December\n\n case 'LLLL':\n default:\n return localize.month(month, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // Local week of year\n w: function (date, token, localize, options) {\n var week = getUTCWeek(date, options);\n\n if (token === 'wo') {\n return localize.ordinalNumber(week, {\n unit: 'week'\n });\n }\n\n return addLeadingZeros(week, token.length);\n },\n // ISO week of year\n I: function (date, token, localize) {\n var isoWeek = getUTCISOWeek(date);\n\n if (token === 'Io') {\n return localize.ordinalNumber(isoWeek, {\n unit: 'week'\n });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n // Day of the month\n d: function (date, token, localize) {\n if (token === 'do') {\n return localize.ordinalNumber(date.getUTCDate(), {\n unit: 'date'\n });\n }\n\n return lightFormatters.d(date, token);\n },\n // Day of year\n D: function (date, token, localize) {\n var dayOfYear = getUTCDayOfYear(date);\n\n if (token === 'Do') {\n return localize.ordinalNumber(dayOfYear, {\n unit: 'dayOfYear'\n });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n // Day of week\n E: function (date, token, localize) {\n var dayOfWeek = date.getUTCDay();\n\n switch (token) {\n // Tue\n case 'E':\n case 'EE':\n case 'EEE':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'EEEEE':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'EEEEEE':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'EEEE':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Local day of week\n e: function (date, token, localize, options) {\n var dayOfWeek = date.getUTCDay();\n var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case 'e':\n return String(localDayOfWeek);\n // Padded numerical value\n\n case 'ee':\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n\n case 'eo':\n return localize.ordinalNumber(localDayOfWeek, {\n unit: 'day'\n });\n\n case 'eee':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'eeeee':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'eeeeee':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'eeee':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n var dayOfWeek = date.getUTCDay();\n var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n\n switch (token) {\n // Numerical value (same as in `e`)\n case 'c':\n return String(localDayOfWeek);\n // Padded numerical value\n\n case 'cc':\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n\n case 'co':\n return localize.ordinalNumber(localDayOfWeek, {\n unit: 'day'\n });\n\n case 'ccc':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // T\n\n case 'ccccc':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tu\n\n case 'cccccc':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'standalone'\n });\n // Tuesday\n\n case 'cccc':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // ISO day of week\n i: function (date, token, localize) {\n var dayOfWeek = date.getUTCDay();\n var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n\n switch (token) {\n // 2\n case 'i':\n return String(isoDayOfWeek);\n // 02\n\n case 'ii':\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n\n case 'io':\n return localize.ordinalNumber(isoDayOfWeek, {\n unit: 'day'\n });\n // Tue\n\n case 'iii':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'iiiii':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'iiiiii':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'iiii':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // AM or PM\n a: function (date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';\n\n switch (token) {\n case 'a':\n case 'aa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n });\n\n case 'aaa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n }).toLowerCase();\n\n case 'aaaaa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaa':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue;\n\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';\n }\n\n switch (token) {\n case 'b':\n case 'bb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n });\n\n case 'bbb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n }).toLowerCase();\n\n case 'bbbbb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbb':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue;\n\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case 'B':\n case 'BB':\n case 'BBB':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n });\n\n case 'BBBBB':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBB':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === 'ho') {\n var hours = date.getUTCHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return lightFormatters.h(date, token);\n },\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === 'Ho') {\n return localize.ordinalNumber(date.getUTCHours(), {\n unit: 'hour'\n });\n }\n\n return lightFormatters.H(date, token);\n },\n // Hour [0-11]\n K: function (date, token, localize) {\n var hours = date.getUTCHours() % 12;\n\n if (token === 'Ko') {\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n // Hour [1-24]\n k: function (date, token, localize) {\n var hours = date.getUTCHours();\n if (hours === 0) hours = 24;\n\n if (token === 'ko') {\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n // Minute\n m: function (date, token, localize) {\n if (token === 'mo') {\n return localize.ordinalNumber(date.getUTCMinutes(), {\n unit: 'minute'\n });\n }\n\n return lightFormatters.m(date, token);\n },\n // Second\n s: function (date, token, localize) {\n if (token === 'so') {\n return localize.ordinalNumber(date.getUTCSeconds(), {\n unit: 'second'\n });\n }\n\n return lightFormatters.s(date, token);\n },\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return 'Z';\n }\n\n switch (token) {\n // Hours and optional minutes\n case 'X':\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n\n case 'XXXX':\n case 'XX':\n // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n\n case 'XXXXX':\n case 'XXX': // Hours and minutes with `:` delimiter\n\n default:\n return formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case 'x':\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n\n case 'xxxx':\n case 'xx':\n // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n\n case 'xxxxx':\n case 'xxx': // Hours and minutes with `:` delimiter\n\n default:\n return formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (GMT)\n O: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case 'O':\n case 'OO':\n case 'OOO':\n return 'GMT' + formatTimezoneShort(timezoneOffset, ':');\n // Long\n\n case 'OOOO':\n default:\n return 'GMT' + formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (specific non-location)\n z: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case 'z':\n case 'zz':\n case 'zzz':\n return 'GMT' + formatTimezoneShort(timezoneOffset, ':');\n // Long\n\n case 'zzzz':\n default:\n return 'GMT' + formatTimezone(timezoneOffset, ':');\n }\n },\n // Seconds timestamp\n t: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timestamp = Math.floor(originalDate.getTime() / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n // Milliseconds timestamp\n T: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timestamp = originalDate.getTime();\n return addLeadingZeros(timestamp, token.length);\n }\n};\n\nfunction formatTimezoneShort(offset, dirtyDelimiter) {\n var sign = offset > 0 ? '-' : '+';\n var absOffset = Math.abs(offset);\n var hours = Math.floor(absOffset / 60);\n var minutes = absOffset % 60;\n\n if (minutes === 0) {\n return sign + String(hours);\n }\n\n var delimiter = dirtyDelimiter || '';\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {\n if (offset % 60 === 0) {\n var sign = offset > 0 ? '-' : '+';\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n\n return formatTimezone(offset, dirtyDelimiter);\n}\n\nfunction formatTimezone(offset, dirtyDelimiter) {\n var delimiter = dirtyDelimiter || '';\n var sign = offset > 0 ? '-' : '+';\n var absOffset = Math.abs(offset);\n var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);\n var minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n\nexport default formatters;","function dateLongFormatter(pattern, formatLong) {\n switch (pattern) {\n case 'P':\n return formatLong.date({\n width: 'short'\n });\n\n case 'PP':\n return formatLong.date({\n width: 'medium'\n });\n\n case 'PPP':\n return formatLong.date({\n width: 'long'\n });\n\n case 'PPPP':\n default:\n return formatLong.date({\n width: 'full'\n });\n }\n}\n\nfunction timeLongFormatter(pattern, formatLong) {\n switch (pattern) {\n case 'p':\n return formatLong.time({\n width: 'short'\n });\n\n case 'pp':\n return formatLong.time({\n width: 'medium'\n });\n\n case 'ppp':\n return formatLong.time({\n width: 'long'\n });\n\n case 'pppp':\n default:\n return formatLong.time({\n width: 'full'\n });\n }\n}\n\nfunction dateTimeLongFormatter(pattern, formatLong) {\n var matchResult = pattern.match(/(P+)(p+)?/) || [];\n var datePattern = matchResult[1];\n var timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n var dateTimeFormat;\n\n switch (datePattern) {\n case 'P':\n dateTimeFormat = formatLong.dateTime({\n width: 'short'\n });\n break;\n\n case 'PP':\n dateTimeFormat = formatLong.dateTime({\n width: 'medium'\n });\n break;\n\n case 'PPP':\n dateTimeFormat = formatLong.dateTime({\n width: 'long'\n });\n break;\n\n case 'PPPP':\n default:\n dateTimeFormat = formatLong.dateTime({\n width: 'full'\n });\n break;\n }\n\n return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));\n}\n\nvar longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter\n};\nexport default longFormatters;","/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport default function getTimezoneOffsetInMilliseconds(date) {\n var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}","var protectedDayOfYearTokens = ['D', 'DD'];\nvar protectedWeekYearTokens = ['YY', 'YYYY'];\nexport function isProtectedDayOfYearToken(token) {\n return protectedDayOfYearTokens.indexOf(token) !== -1;\n}\nexport function isProtectedWeekYearToken(token) {\n return protectedWeekYearTokens.indexOf(token) !== -1;\n}\nexport function throwProtectedError(token, format, input) {\n if (token === 'YYYY') {\n throw new RangeError(\"Use `yyyy` instead of `YYYY` (in `\".concat(format, \"`) for formatting years to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n } else if (token === 'YY') {\n throw new RangeError(\"Use `yy` instead of `YY` (in `\".concat(format, \"`) for formatting years to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n } else if (token === 'D') {\n 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\"));\n } else if (token === 'DD') {\n 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\"));\n }\n}","import isValid from \"../isValid/index.js\";\nimport defaultLocale from \"../locale/en-US/index.js\";\nimport subMilliseconds from \"../subMilliseconds/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport formatters from \"../_lib/format/formatters/index.js\";\nimport longFormatters from \"../_lib/format/longFormatters/index.js\";\nimport getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport { isProtectedDayOfYearToken, isProtectedWeekYearToken, throwProtectedError } from \"../_lib/protectedTokens/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\"; // This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\n\nvar formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\n\nvar longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\nvar escapedStringRegExp = /^'([^]*?)'?$/;\nvar doubleQuoteRegExp = /''/g;\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n/**\n * @name format\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://git.io/fxCyr\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}\n * and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr\n *\n * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The second argument is now required for the sake of explicitness.\n *\n * ```javascript\n * // Before v2.0.0\n * format(new Date(2016, 0, 1))\n *\n * // v2.0.0 onward\n * format(new Date(2016, 0, 1), \"yyyy-MM-dd'T'HH:mm:ss.SSSxxx\")\n * ```\n *\n * - New format string API for `format` function\n * which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).\n * See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.\n *\n * - Characters are now escaped using single quote symbols (`'`) instead of square brackets.\n *\n * @param {Date|Number} date - the original date\n * @param {String} format - the string of tokens\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is\n * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;\n * see: https://git.io/fxCyr\n * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;\n * see: https://git.io/fxCyr\n * @returns {String} the formatted date string\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `options.locale` must contain `localize` property\n * @throws {RangeError} `options.locale` must contain `formatLong` property\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @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\n * @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\n * @throws {RangeError} format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * var result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * var result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * var result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\n\nexport default function format(dirtyDate, dirtyFormatStr, dirtyOptions) {\n requiredArgs(2, arguments);\n var formatStr = String(dirtyFormatStr);\n var options = dirtyOptions || {};\n var locale = options.locale || defaultLocale;\n var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n if (!locale.localize) {\n throw new RangeError('locale must contain localize property');\n }\n\n if (!locale.formatLong) {\n throw new RangeError('locale must contain formatLong property');\n }\n\n var originalDate = toDate(dirtyDate);\n\n if (!isValid(originalDate)) {\n throw new RangeError('Invalid time value');\n } // Convert the date in system timezone to the same date in UTC+00:00 timezone.\n // This ensures that when UTC functions will be implemented, locales will be compatible with them.\n // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376\n\n\n var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);\n var utcDate = subMilliseconds(originalDate, timezoneOffset);\n var formatterOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale,\n _originalDate: originalDate\n };\n var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {\n var firstCharacter = substring[0];\n\n if (firstCharacter === 'p' || firstCharacter === 'P') {\n var longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong, formatterOptions);\n }\n\n return substring;\n }).join('').match(formattingTokensRegExp).map(function (substring) {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return \"'\";\n }\n\n var firstCharacter = substring[0];\n\n if (firstCharacter === \"'\") {\n return cleanEscapedString(substring);\n }\n\n var formatter = formatters[firstCharacter];\n\n if (formatter) {\n if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {\n throwProtectedError(substring, dirtyFormatStr, dirtyDate);\n }\n\n if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {\n throwProtectedError(substring, dirtyFormatStr, dirtyDate);\n }\n\n return formatter(utcDate, substring, locale.localize, formatterOptions);\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');\n }\n\n return substring;\n }).join('');\n return result;\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isAfter\n * @category Common Helpers\n * @summary Is the first date after the second one?\n *\n * @description\n * Is the first date after the second one?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date that should be after the other one to return true\n * @param {Date|Number} dateToCompare - the date to compare with\n * @returns {Boolean} the first date is after the second date\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Is 10 July 1989 after 11 February 1987?\n * var result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> true\n */\n\nexport default function isAfter(dirtyDate, dirtyDateToCompare) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var dateToCompare = toDate(dirtyDateToCompare);\n return date.getTime() > dateToCompare.getTime();\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isBefore\n * @category Common Helpers\n * @summary Is the first date before the second one?\n *\n * @description\n * Is the first date before the second one?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date that should be before the other one to return true\n * @param {Date|Number} dateToCompare - the date to compare with\n * @returns {Boolean} the first date is before the second date\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Is 10 July 1989 before 11 February 1987?\n * var result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> false\n */\n\nexport default function isBefore(dirtyDate, dirtyDateToCompare) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var dateToCompare = toDate(dirtyDateToCompare);\n return date.getTime() < dateToCompare.getTime();\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of a day\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\n\nexport default function startOfDay(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name startOfHour\n * @category Hour Helpers\n * @summary Return the start of an hour for the given date.\n *\n * @description\n * Return the start of an hour for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of an hour\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of an hour for 2 September 2014 11:55:00:\n * const result = startOfHour(new Date(2014, 8, 2, 11, 55))\n * //=> Tue Sep 02 2014 11:00:00\n */\n\nexport default function startOfHour(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n date.setMinutes(0, 0, 0);\n return date;\n}","export default function assign(target, dirtyObject) {\n if (target == null) {\n throw new TypeError('assign requires that input parameter not be null or undefined');\n }\n\n dirtyObject = dirtyObject || {};\n\n for (var property in dirtyObject) {\n if (Object.prototype.hasOwnProperty.call(dirtyObject, property)) {\n target[property] = dirtyObject[property];\n }\n }\n\n return target;\n}","import toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nimport toInteger from \"../toInteger/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCDay(dirtyDate, dirtyDay, dirtyOptions) {\n requiredArgs(2, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = toInteger(dirtyDay);\n var currentDay = date.getUTCDay();\n var remainder = day % 7;\n var dayIndex = (remainder + 7) % 7;\n var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}","import getUTCWeekYear from \"../../../_lib/getUTCWeekYear/index.js\";\nimport setUTCDay from \"../../../_lib/setUTCDay/index.js\";\nimport setUTCISODay from \"../../../_lib/setUTCISODay/index.js\";\nimport setUTCISOWeek from \"../../../_lib/setUTCISOWeek/index.js\";\nimport setUTCWeek from \"../../../_lib/setUTCWeek/index.js\";\nimport startOfUTCISOWeek from \"../../../_lib/startOfUTCISOWeek/index.js\";\nimport startOfUTCWeek from \"../../../_lib/startOfUTCWeek/index.js\";\nvar MILLISECONDS_IN_HOUR = 3600000;\nvar MILLISECONDS_IN_MINUTE = 60000;\nvar MILLISECONDS_IN_SECOND = 1000;\nvar numericPatterns = {\n month: /^(1[0-2]|0?\\d)/,\n // 0 to 12\n date: /^(3[0-1]|[0-2]?\\d)/,\n // 0 to 31\n dayOfYear: /^(36[0-6]|3[0-5]\\d|[0-2]?\\d?\\d)/,\n // 0 to 366\n week: /^(5[0-3]|[0-4]?\\d)/,\n // 0 to 53\n hour23h: /^(2[0-3]|[0-1]?\\d)/,\n // 0 to 23\n hour24h: /^(2[0-4]|[0-1]?\\d)/,\n // 0 to 24\n hour11h: /^(1[0-1]|0?\\d)/,\n // 0 to 11\n hour12h: /^(1[0-2]|0?\\d)/,\n // 0 to 12\n minute: /^[0-5]?\\d/,\n // 0 to 59\n second: /^[0-5]?\\d/,\n // 0 to 59\n singleDigit: /^\\d/,\n // 0 to 9\n twoDigits: /^\\d{1,2}/,\n // 0 to 99\n threeDigits: /^\\d{1,3}/,\n // 0 to 999\n fourDigits: /^\\d{1,4}/,\n // 0 to 9999\n anyDigitsSigned: /^-?\\d+/,\n singleDigitSigned: /^-?\\d/,\n // 0 to 9, -0 to -9\n twoDigitsSigned: /^-?\\d{1,2}/,\n // 0 to 99, -0 to -99\n threeDigitsSigned: /^-?\\d{1,3}/,\n // 0 to 999, -0 to -999\n fourDigitsSigned: /^-?\\d{1,4}/ // 0 to 9999, -0 to -9999\n\n};\nvar timezonePatterns = {\n basicOptionalMinutes: /^([+-])(\\d{2})(\\d{2})?|Z/,\n basic: /^([+-])(\\d{2})(\\d{2})|Z/,\n basicOptionalSeconds: /^([+-])(\\d{2})(\\d{2})((\\d{2}))?|Z/,\n extended: /^([+-])(\\d{2}):(\\d{2})|Z/,\n extendedOptionalSeconds: /^([+-])(\\d{2}):(\\d{2})(:(\\d{2}))?|Z/\n};\n\nfunction parseNumericPattern(pattern, string, valueCallback) {\n var matchResult = string.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n var value = parseInt(matchResult[0], 10);\n return {\n value: valueCallback ? valueCallback(value) : value,\n rest: string.slice(matchResult[0].length)\n };\n}\n\nfunction parseTimezonePattern(pattern, string) {\n var matchResult = string.match(pattern);\n\n if (!matchResult) {\n return null;\n } // Input is 'Z'\n\n\n if (matchResult[0] === 'Z') {\n return {\n value: 0,\n rest: string.slice(1)\n };\n }\n\n var sign = matchResult[1] === '+' ? 1 : -1;\n var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;\n var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;\n var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;\n return {\n value: sign * (hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * MILLISECONDS_IN_SECOND),\n rest: string.slice(matchResult[0].length)\n };\n}\n\nfunction parseAnyDigitsSigned(string, valueCallback) {\n return parseNumericPattern(numericPatterns.anyDigitsSigned, string, valueCallback);\n}\n\nfunction parseNDigits(n, string, valueCallback) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigit, string, valueCallback);\n\n case 2:\n return parseNumericPattern(numericPatterns.twoDigits, string, valueCallback);\n\n case 3:\n return parseNumericPattern(numericPatterns.threeDigits, string, valueCallback);\n\n case 4:\n return parseNumericPattern(numericPatterns.fourDigits, string, valueCallback);\n\n default:\n return parseNumericPattern(new RegExp('^\\\\d{1,' + n + '}'), string, valueCallback);\n }\n}\n\nfunction parseNDigitsSigned(n, string, valueCallback) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigitSigned, string, valueCallback);\n\n case 2:\n return parseNumericPattern(numericPatterns.twoDigitsSigned, string, valueCallback);\n\n case 3:\n return parseNumericPattern(numericPatterns.threeDigitsSigned, string, valueCallback);\n\n case 4:\n return parseNumericPattern(numericPatterns.fourDigitsSigned, string, valueCallback);\n\n default:\n return parseNumericPattern(new RegExp('^-?\\\\d{1,' + n + '}'), string, valueCallback);\n }\n}\n\nfunction dayPeriodEnumToHours(enumValue) {\n switch (enumValue) {\n case 'morning':\n return 4;\n\n case 'evening':\n return 17;\n\n case 'pm':\n case 'noon':\n case 'afternoon':\n return 12;\n\n case 'am':\n case 'midnight':\n case 'night':\n default:\n return 0;\n }\n}\n\nfunction normalizeTwoDigitYear(twoDigitYear, currentYear) {\n var isCommonEra = currentYear > 0; // Absolute number of the current year:\n // 1 -> 1 AC\n // 0 -> 1 BC\n // -1 -> 2 BC\n\n var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;\n var result;\n\n if (absCurrentYear <= 50) {\n result = twoDigitYear || 100;\n } else {\n var rangeEnd = absCurrentYear + 50;\n var rangeEndCentury = Math.floor(rangeEnd / 100) * 100;\n var isPreviousCentury = twoDigitYear >= rangeEnd % 100;\n result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);\n }\n\n return isCommonEra ? result : 1 - result;\n}\n\nvar DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nvar DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; // User for validation\n\nfunction isLeapYearIndex(year) {\n return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;\n}\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O* | Timezone (GMT) |\n * | p | | P | |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n */\n\n\nvar parsers = {\n // Era\n G: {\n priority: 140,\n parse: function (string, token, match, _options) {\n switch (token) {\n // AD, BC\n case 'G':\n case 'GG':\n case 'GGG':\n return match.era(string, {\n width: 'abbreviated'\n }) || match.era(string, {\n width: 'narrow'\n });\n // A, B\n\n case 'GGGGG':\n return match.era(string, {\n width: 'narrow'\n });\n // Anno Domini, Before Christ\n\n case 'GGGG':\n default:\n return match.era(string, {\n width: 'wide'\n }) || match.era(string, {\n width: 'abbreviated'\n }) || match.era(string, {\n width: 'narrow'\n });\n }\n },\n set: function (date, flags, value, _options) {\n flags.era = value;\n date.setUTCFullYear(value, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['R', 'u', 't', 'T']\n },\n // Year\n y: {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n priority: 130,\n parse: function (string, token, match, _options) {\n var valueCallback = function (year) {\n return {\n year: year,\n isTwoDigitYear: token === 'yy'\n };\n };\n\n switch (token) {\n case 'y':\n return parseNDigits(4, string, valueCallback);\n\n case 'yo':\n return match.ordinalNumber(string, {\n unit: 'year',\n valueCallback: valueCallback\n });\n\n default:\n return parseNDigits(token.length, string, valueCallback);\n }\n },\n validate: function (_date, value, _options) {\n return value.isTwoDigitYear || value.year > 0;\n },\n set: function (date, flags, value, _options) {\n var currentYear = date.getUTCFullYear();\n\n if (value.isTwoDigitYear) {\n var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);\n date.setUTCFullYear(normalizedTwoDigitYear, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n }\n\n var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setUTCFullYear(year, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T']\n },\n // Local week-numbering year\n Y: {\n priority: 130,\n parse: function (string, token, match, _options) {\n var valueCallback = function (year) {\n return {\n year: year,\n isTwoDigitYear: token === 'YY'\n };\n };\n\n switch (token) {\n case 'Y':\n return parseNDigits(4, string, valueCallback);\n\n case 'Yo':\n return match.ordinalNumber(string, {\n unit: 'year',\n valueCallback: valueCallback\n });\n\n default:\n return parseNDigits(token.length, string, valueCallback);\n }\n },\n validate: function (_date, value, _options) {\n return value.isTwoDigitYear || value.year > 0;\n },\n set: function (date, flags, value, options) {\n var currentYear = getUTCWeekYear(date, options);\n\n if (value.isTwoDigitYear) {\n var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);\n date.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);\n date.setUTCHours(0, 0, 0, 0);\n return startOfUTCWeek(date, options);\n }\n\n var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setUTCFullYear(year, 0, options.firstWeekContainsDate);\n date.setUTCHours(0, 0, 0, 0);\n return startOfUTCWeek(date, options);\n },\n incompatibleTokens: ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']\n },\n // ISO week-numbering year\n R: {\n priority: 130,\n parse: function (string, token, _match, _options) {\n if (token === 'R') {\n return parseNDigitsSigned(4, string);\n }\n\n return parseNDigitsSigned(token.length, string);\n },\n set: function (_date, _flags, value, _options) {\n var firstWeekOfYear = new Date(0);\n firstWeekOfYear.setUTCFullYear(value, 0, 4);\n firstWeekOfYear.setUTCHours(0, 0, 0, 0);\n return startOfUTCISOWeek(firstWeekOfYear);\n },\n incompatibleTokens: ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']\n },\n // Extended year\n u: {\n priority: 130,\n parse: function (string, token, _match, _options) {\n if (token === 'u') {\n return parseNDigitsSigned(4, string);\n }\n\n return parseNDigitsSigned(token.length, string);\n },\n set: function (date, _flags, value, _options) {\n date.setUTCFullYear(value, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T']\n },\n // Quarter\n Q: {\n priority: 120,\n parse: function (string, token, match, _options) {\n switch (token) {\n // 1, 2, 3, 4\n case 'Q':\n case 'QQ':\n // 01, 02, 03, 04\n return parseNDigits(token.length, string);\n // 1st, 2nd, 3rd, 4th\n\n case 'Qo':\n return match.ordinalNumber(string, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'QQQ':\n return match.quarter(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'QQQQQ':\n return match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'QQQQ':\n default:\n return match.quarter(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 4;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth((value - 1) * 3, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Stand-alone quarter\n q: {\n priority: 120,\n parse: function (string, token, match, _options) {\n switch (token) {\n // 1, 2, 3, 4\n case 'q':\n case 'qq':\n // 01, 02, 03, 04\n return parseNDigits(token.length, string);\n // 1st, 2nd, 3rd, 4th\n\n case 'qo':\n return match.ordinalNumber(string, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'qqq':\n return match.quarter(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'qqqqq':\n return match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'qqqq':\n default:\n return match.quarter(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 4;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth((value - 1) * 3, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'Q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Month\n M: {\n priority: 110,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n return value - 1;\n };\n\n switch (token) {\n // 1, 2, ..., 12\n case 'M':\n return parseNumericPattern(numericPatterns.month, string, valueCallback);\n // 01, 02, ..., 12\n\n case 'MM':\n return parseNDigits(2, string, valueCallback);\n // 1st, 2nd, ..., 12th\n\n case 'Mo':\n return match.ordinalNumber(string, {\n unit: 'month',\n valueCallback: valueCallback\n });\n // Jan, Feb, ..., Dec\n\n case 'MMM':\n return match.month(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // J, F, ..., D\n\n case 'MMMMM':\n return match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // January, February, ..., December\n\n case 'MMMM':\n default:\n return match.month(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.month(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(value, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Stand-alone month\n L: {\n priority: 110,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n return value - 1;\n };\n\n switch (token) {\n // 1, 2, ..., 12\n case 'L':\n return parseNumericPattern(numericPatterns.month, string, valueCallback);\n // 01, 02, ..., 12\n\n case 'LL':\n return parseNDigits(2, string, valueCallback);\n // 1st, 2nd, ..., 12th\n\n case 'Lo':\n return match.ordinalNumber(string, {\n unit: 'month',\n valueCallback: valueCallback\n });\n // Jan, Feb, ..., Dec\n\n case 'LLL':\n return match.month(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // J, F, ..., D\n\n case 'LLLLL':\n return match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // January, February, ..., December\n\n case 'LLLL':\n default:\n return match.month(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.month(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(value, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Local week of year\n w: {\n priority: 100,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'w':\n return parseNumericPattern(numericPatterns.week, string);\n\n case 'wo':\n return match.ordinalNumber(string, {\n unit: 'week'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 53;\n },\n set: function (date, _flags, value, options) {\n return startOfUTCWeek(setUTCWeek(date, value, options), options);\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']\n },\n // ISO week of year\n I: {\n priority: 100,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'I':\n return parseNumericPattern(numericPatterns.week, string);\n\n case 'Io':\n return match.ordinalNumber(string, {\n unit: 'week'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 53;\n },\n set: function (date, _flags, value, options) {\n return startOfUTCISOWeek(setUTCISOWeek(date, value, options), options);\n },\n incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']\n },\n // Day of the month\n d: {\n priority: 90,\n subPriority: 1,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'd':\n return parseNumericPattern(numericPatterns.date, string);\n\n case 'do':\n return match.ordinalNumber(string, {\n unit: 'date'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (date, value, _options) {\n var year = date.getUTCFullYear();\n var isLeapYear = isLeapYearIndex(year);\n var month = date.getUTCMonth();\n\n if (isLeapYear) {\n return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];\n } else {\n return value >= 1 && value <= DAYS_IN_MONTH[month];\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCDate(value);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Day of year\n D: {\n priority: 90,\n subPriority: 1,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'D':\n case 'DD':\n return parseNumericPattern(numericPatterns.dayOfYear, string);\n\n case 'Do':\n return match.ordinalNumber(string, {\n unit: 'date'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (date, value, _options) {\n var year = date.getUTCFullYear();\n var isLeapYear = isLeapYearIndex(year);\n\n if (isLeapYear) {\n return value >= 1 && value <= 366;\n } else {\n return value >= 1 && value <= 365;\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(0, value);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'L', 'w', 'I', 'd', 'E', 'i', 'e', 'c', 't', 'T']\n },\n // Day of week\n E: {\n priority: 90,\n parse: function (string, token, match, _options) {\n switch (token) {\n // Tue\n case 'E':\n case 'EE':\n case 'EEE':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // T\n\n case 'EEEEE':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'EEEEEE':\n return match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tuesday\n\n case 'EEEE':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['D', 'i', 'e', 'c', 't', 'T']\n },\n // Local day of week\n e: {\n priority: 90,\n parse: function (string, token, match, options) {\n var valueCallback = function (value) {\n var wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case 'e':\n case 'ee':\n // 03\n return parseNDigits(token.length, string, valueCallback);\n // 3rd\n\n case 'eo':\n return match.ordinalNumber(string, {\n unit: 'day',\n valueCallback: valueCallback\n });\n // Tue\n\n case 'eee':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // T\n\n case 'eeeee':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'eeeeee':\n return match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tuesday\n\n case 'eeee':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T']\n },\n // Stand-alone local day of week\n c: {\n priority: 90,\n parse: function (string, token, match, options) {\n var valueCallback = function (value) {\n var wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case 'c':\n case 'cc':\n // 03\n return parseNDigits(token.length, string, valueCallback);\n // 3rd\n\n case 'co':\n return match.ordinalNumber(string, {\n unit: 'day',\n valueCallback: valueCallback\n });\n // Tue\n\n case 'ccc':\n return match.day(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // T\n\n case 'ccccc':\n return match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tu\n\n case 'cccccc':\n return match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tuesday\n\n case 'cccc':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'e', 't', 'T']\n },\n // ISO day of week\n i: {\n priority: 90,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n if (value === 0) {\n return 7;\n }\n\n return value;\n };\n\n switch (token) {\n // 2\n case 'i':\n case 'ii':\n // 02\n return parseNDigits(token.length, string);\n // 2nd\n\n case 'io':\n return match.ordinalNumber(string, {\n unit: 'day'\n });\n // Tue\n\n case 'iii':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // T\n\n case 'iiiii':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // Tu\n\n case 'iiiiii':\n return match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // Tuesday\n\n case 'iiii':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 7;\n },\n set: function (date, _flags, value, options) {\n date = setUTCISODay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T']\n },\n // AM or PM\n a: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'a':\n case 'aa':\n case 'aaa':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaaa':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaa':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['b', 'B', 'H', 'k', 't', 'T']\n },\n // AM, PM, midnight\n b: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'b':\n case 'bb':\n case 'bbb':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbbb':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbb':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'B', 'H', 'k', 't', 'T']\n },\n // in the morning, in the afternoon, in the evening, at night\n B: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'B':\n case 'BB':\n case 'BBB':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBBB':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBB':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 't', 'T']\n },\n // Hour [1-12]\n h: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'h':\n return parseNumericPattern(numericPatterns.hour12h, string);\n\n case 'ho':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 12;\n },\n set: function (date, _flags, value, _options) {\n var isPM = date.getUTCHours() >= 12;\n\n if (isPM && value < 12) {\n date.setUTCHours(value + 12, 0, 0, 0);\n } else if (!isPM && value === 12) {\n date.setUTCHours(0, 0, 0, 0);\n } else {\n date.setUTCHours(value, 0, 0, 0);\n }\n\n return date;\n },\n incompatibleTokens: ['H', 'K', 'k', 't', 'T']\n },\n // Hour [0-23]\n H: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'H':\n return parseNumericPattern(numericPatterns.hour23h, string);\n\n case 'Ho':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 23;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(value, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'K', 'k', 't', 'T']\n },\n // Hour [0-11]\n K: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'K':\n return parseNumericPattern(numericPatterns.hour11h, string);\n\n case 'Ko':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n var isPM = date.getUTCHours() >= 12;\n\n if (isPM && value < 12) {\n date.setUTCHours(value + 12, 0, 0, 0);\n } else {\n date.setUTCHours(value, 0, 0, 0);\n }\n\n return date;\n },\n incompatibleTokens: ['h', 'H', 'k', 't', 'T']\n },\n // Hour [1-24]\n k: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'k':\n return parseNumericPattern(numericPatterns.hour24h, string);\n\n case 'ko':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 24;\n },\n set: function (date, _flags, value, _options) {\n var hours = value <= 24 ? value % 24 : value;\n date.setUTCHours(hours, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'H', 'K', 't', 'T']\n },\n // Minute\n m: {\n priority: 60,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'm':\n return parseNumericPattern(numericPatterns.minute, string);\n\n case 'mo':\n return match.ordinalNumber(string, {\n unit: 'minute'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 59;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMinutes(value, 0, 0);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Second\n s: {\n priority: 50,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 's':\n return parseNumericPattern(numericPatterns.second, string);\n\n case 'so':\n return match.ordinalNumber(string, {\n unit: 'second'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 59;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCSeconds(value, 0);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Fraction of second\n S: {\n priority: 30,\n parse: function (string, token, _match, _options) {\n var valueCallback = function (value) {\n return Math.floor(value * Math.pow(10, -token.length + 3));\n };\n\n return parseNDigits(token.length, string, valueCallback);\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMilliseconds(value);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Timezone (ISO-8601. +00:00 is `'Z'`)\n X: {\n priority: 10,\n parse: function (string, token, _match, _options) {\n switch (token) {\n case 'X':\n return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);\n\n case 'XX':\n return parseTimezonePattern(timezonePatterns.basic, string);\n\n case 'XXXX':\n return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);\n\n case 'XXXXX':\n return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);\n\n case 'XXX':\n default:\n return parseTimezonePattern(timezonePatterns.extended, string);\n }\n },\n set: function (date, flags, value, _options) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n return new Date(date.getTime() - value);\n },\n incompatibleTokens: ['t', 'T', 'x']\n },\n // Timezone (ISO-8601)\n x: {\n priority: 10,\n parse: function (string, token, _match, _options) {\n switch (token) {\n case 'x':\n return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);\n\n case 'xx':\n return parseTimezonePattern(timezonePatterns.basic, string);\n\n case 'xxxx':\n return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);\n\n case 'xxxxx':\n return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);\n\n case 'xxx':\n default:\n return parseTimezonePattern(timezonePatterns.extended, string);\n }\n },\n set: function (date, flags, value, _options) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n return new Date(date.getTime() - value);\n },\n incompatibleTokens: ['t', 'T', 'X']\n },\n // Seconds timestamp\n t: {\n priority: 40,\n parse: function (string, _token, _match, _options) {\n return parseAnyDigitsSigned(string);\n },\n set: function (_date, _flags, value, _options) {\n return [new Date(value * 1000), {\n timestampIsSet: true\n }];\n },\n incompatibleTokens: '*'\n },\n // Milliseconds timestamp\n T: {\n priority: 20,\n parse: function (string, _token, _match, _options) {\n return parseAnyDigitsSigned(string);\n },\n set: function (_date, _flags, value, _options) {\n return [new Date(value), {\n timestampIsSet: true\n }];\n },\n incompatibleTokens: '*'\n }\n};\nexport default parsers;","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport getUTCWeek from \"../getUTCWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCWeek(dirtyDate, dirtyWeek, options) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var week = toInteger(dirtyWeek);\n var diff = getUTCWeek(date, options) - week;\n date.setUTCDate(date.getUTCDate() - diff * 7);\n return date;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport getUTCISOWeek from \"../getUTCISOWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCISOWeek(dirtyDate, dirtyISOWeek) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var isoWeek = toInteger(dirtyISOWeek);\n var diff = getUTCISOWeek(date) - isoWeek;\n date.setUTCDate(date.getUTCDate() - diff * 7);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nimport toInteger from \"../toInteger/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCISODay(dirtyDate, dirtyDay) {\n requiredArgs(2, arguments);\n var day = toInteger(dirtyDay);\n\n if (day % 7 === 0) {\n day = day - 7;\n }\n\n var weekStartsOn = 1;\n var date = toDate(dirtyDate);\n var currentDay = date.getUTCDay();\n var remainder = day % 7;\n var dayIndex = (remainder + 7) % 7;\n var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}","import defaultLocale from \"../locale/en-US/index.js\";\nimport subMilliseconds from \"../subMilliseconds/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport assign from \"../_lib/assign/index.js\";\nimport longFormatters from \"../_lib/format/longFormatters/index.js\";\nimport getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport { isProtectedDayOfYearToken, isProtectedWeekYearToken, throwProtectedError } from \"../_lib/protectedTokens/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport parsers from \"./_lib/parsers/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar TIMEZONE_UNIT_PRIORITY = 10; // This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\n\nvar formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\n\nvar longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\nvar escapedStringRegExp = /^'([^]*?)'?$/;\nvar doubleQuoteRegExp = /''/g;\nvar notWhitespaceRegExp = /\\S/;\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n/**\n * @name parse\n * @category Common Helpers\n * @summary Parse the date.\n *\n * @description\n * Return the date parsed from string using the given format string.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://git.io/fxCyr\n *\n * The characters in the format string wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n *\n * Format of the format string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 5 below the table).\n *\n * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited\n * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:\n *\n * ```javascript\n * parse('23 AM', 'HH a', new Date())\n * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time\n * ```\n *\n * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true\n *\n * Accepted format string patterns:\n * | Unit |Prior| Pattern | Result examples | Notes |\n * |---------------------------------|-----|---------|-----------------------------------|-------|\n * | Era | 140 | G..GGG | AD, BC | |\n * | | | GGGG | Anno Domini, Before Christ | 2 |\n * | | | GGGGG | A, B | |\n * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |\n * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | yy | 44, 01, 00, 17 | 4 |\n * | | | yyy | 044, 001, 123, 999 | 4 |\n * | | | yyyy | 0044, 0001, 1900, 2017 | 4 |\n * | | | yyyyy | ... | 2,4 |\n * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |\n * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | YY | 44, 01, 00, 17 | 4,6 |\n * | | | YYY | 044, 001, 123, 999 | 4 |\n * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |\n * | | | YYYYY | ... | 2,4 |\n * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |\n * | | | RR | -43, 01, 00, 17 | 4,5 |\n * | | | RRR | -043, 001, 123, 999, -999 | 4,5 |\n * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |\n * | | | RRRRR | ... | 2,4,5 |\n * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |\n * | | | uu | -43, 01, 99, -99 | 4 |\n * | | | uuu | -043, 001, 123, 999, -999 | 4 |\n * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |\n * | | | uuuuu | ... | 2,4 |\n * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |\n * | | | Qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | QQ | 01, 02, 03, 04 | |\n * | | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |\n * | | | qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | qq | 01, 02, 03, 04 | |\n * | | | qqq | Q1, Q2, Q3, Q4 | |\n * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | | qqqqq | 1, 2, 3, 4 | 3 |\n * | Month (formatting) | 110 | M | 1, 2, ..., 12 | |\n * | | | Mo | 1st, 2nd, ..., 12th | 5 |\n * | | | MM | 01, 02, ..., 12 | |\n * | | | MMM | Jan, Feb, ..., Dec | |\n * | | | MMMM | January, February, ..., December | 2 |\n * | | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |\n * | | | Lo | 1st, 2nd, ..., 12th | 5 |\n * | | | LL | 01, 02, ..., 12 | |\n * | | | LLL | Jan, Feb, ..., Dec | |\n * | | | LLLL | January, February, ..., December | 2 |\n * | | | LLLLL | J, F, ..., D | |\n * | Local week of year | 100 | w | 1, 2, ..., 53 | |\n * | | | wo | 1st, 2nd, ..., 53th | 5 |\n * | | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |\n * | | | Io | 1st, 2nd, ..., 53th | 5 |\n * | | | II | 01, 02, ..., 53 | 5 |\n * | Day of month | 90 | d | 1, 2, ..., 31 | |\n * | | | do | 1st, 2nd, ..., 31st | 5 |\n * | | | dd | 01, 02, ..., 31 | |\n * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |\n * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |\n * | | | DD | 01, 02, ..., 365, 366 | 7 |\n * | | | DDD | 001, 002, ..., 365, 366 | |\n * | | | DDDD | ... | 2 |\n * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | | EEEEE | M, T, W, T, F, S, S | |\n * | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |\n * | | | io | 1st, 2nd, ..., 7th | 5 |\n * | | | ii | 01, 02, ..., 07 | 5 |\n * | | | iii | Mon, Tue, Wed, ..., Sun | 5 |\n * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |\n * | | | iiiii | M, T, W, T, F, S, S | 5 |\n * | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |\n * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |\n * | | | eo | 2nd, 3rd, ..., 1st | 5 |\n * | | | ee | 02, 03, ..., 01 | |\n * | | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | | eeeee | M, T, W, T, F, S, S | |\n * | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |\n * | | | co | 2nd, 3rd, ..., 1st | 5 |\n * | | | cc | 02, 03, ..., 01 | |\n * | | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | | ccccc | M, T, W, T, F, S, S | |\n * | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | 80 | a..aaa | AM, PM | |\n * | | | aaaa | a.m., p.m. | 2 |\n * | | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |\n * | | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | | bbbbb | a, p, n, mi | |\n * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |\n * | | | BBBB | at night, in the morning, ... | 2 |\n * | | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |\n * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |\n * | | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |\n * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |\n * | | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |\n * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |\n * | | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |\n * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |\n * | | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | 60 | m | 0, 1, ..., 59 | |\n * | | | mo | 0th, 1st, ..., 59th | 5 |\n * | | | mm | 00, 01, ..., 59 | |\n * | Second | 50 | s | 0, 1, ..., 59 | |\n * | | | so | 0th, 1st, ..., 59th | 5 |\n * | | | ss | 00, 01, ..., 59 | |\n * | Seconds timestamp | 40 | t | 512969520 | |\n * | | | tt | ... | 2 |\n * | Fraction of second | 30 | S | 0, 1, ..., 9 | |\n * | | | SS | 00, 01, ..., 99 | |\n * | | | SSS | 000, 001, ..., 999 | |\n * | | | SSSS | ... | 2 |\n * | Milliseconds timestamp | 20 | T | 512969520900 | |\n * | | | TT | ... | 2 |\n * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |\n * | | | XX | -0800, +0530, Z | |\n * | | | XXX | -08:00, +05:30, Z | |\n * | | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |\n * | | | xx | -0800, +0530, +0000 | |\n * | | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Long localized date | NA | P | 05/29/1453 | 5,8 |\n * | | | PP | May 29, 1453 | |\n * | | | PPP | May 29th, 1453 | |\n * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |\n * | Long localized time | NA | p | 12:00 AM | 5,8 |\n * | | | pp | 12:00:00 AM | |\n * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |\n * | | | PPpp | May 29, 1453, 12:00:00 AM | |\n * | | | PPPpp | May 29th, 1453 at ... | |\n * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular.\n * In `format` function, they will produce different result:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * `parse` will try to match both formatting and stand-alone units interchangably.\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table:\n * - for numerical units (`yyyyyyyy`) `parse` will try to match a number\n * as wide as the sequence\n * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.\n * These variations are marked with \"2\" in the last column of the table.\n *\n * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 4. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:\n *\n * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`\n *\n * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`\n *\n * while `uu` will just assign the year as is:\n *\n * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`\n *\n * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [setISOWeekYear]{@link https://date-fns.org/docs/setISOWeekYear}\n * and [setWeekYear]{@link https://date-fns.org/docs/setWeekYear}).\n *\n * 5. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr\n *\n * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr\n *\n * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based\n * on the given locale.\n *\n * using `en-US` locale: `P` => `MM/dd/yyyy`\n * using `en-US` locale: `p` => `hh:mm a`\n * using `pt-BR` locale: `P` => `dd/MM/yyyy`\n * using `pt-BR` locale: `p` => `HH:mm`\n *\n * Values will be assigned to the date in the descending order of its unit's priority.\n * Units of an equal priority overwrite each other in the order of appearance.\n *\n * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),\n * the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.\n *\n * `referenceDate` must be passed for correct work of the function.\n * If you're not sure which `referenceDate` to supply, create a new instance of Date:\n * `parse('02/11/2014', 'MM/dd/yyyy', new Date())`\n * In this case parsing will be done in the context of the current date.\n * If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,\n * then `Invalid Date` will be returned.\n *\n * The result may vary by locale.\n *\n * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.\n *\n * If parsing failed, `Invalid Date` will be returned.\n * Invalid Date is a Date, whose time value is NaN.\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - Old `parse` was renamed to `toDate`.\n * Now `parse` is a new function which parses a string using a provided format.\n *\n * ```javascript\n * // Before v2.0.0\n * parse('2016-01-01')\n *\n * // v2.0.0 onward (toDate no longer accepts a string)\n * toDate(1392098430000) // Unix to timestamp\n * toDate(new Date(2014, 1, 11, 11, 30, 30)) // Cloning the date\n * parse('2016-01-01', 'yyyy-MM-dd', new Date())\n * ```\n *\n * @param {String} dateString - the string to parse\n * @param {String} formatString - the string of tokens\n * @param {Date|Number} referenceDate - defines values missing from the parsed dateString\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year\n * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;\n * see: https://git.io/fxCyr\n * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;\n * see: https://git.io/fxCyr\n * @returns {Date} the parsed date\n * @throws {TypeError} 3 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n * @throws {RangeError} `options.locale` must contain `match` property\n * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @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\n * @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\n * @throws {RangeError} format string contains an unescaped latin alphabet character\n *\n * @example\n * // Parse 11 February 2014 from middle-endian format:\n * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())\n * //=> Tue Feb 11 2014 00:00:00\n *\n * @example\n * // Parse 28th of February in Esperanto locale in the context of 2010 year:\n * import eo from 'date-fns/locale/eo'\n * var result = parse('28-a de februaro', \"do 'de' MMMM\", new Date(2010, 0, 1), {\n * locale: eo\n * })\n * //=> Sun Feb 28 2010 00:00:00\n */\n\nexport default function parse(dirtyDateString, dirtyFormatString, dirtyReferenceDate, dirtyOptions) {\n requiredArgs(3, arguments);\n var dateString = String(dirtyDateString);\n var formatString = String(dirtyFormatString);\n var options = dirtyOptions || {};\n var locale = options.locale || defaultLocale;\n\n if (!locale.match) {\n throw new RangeError('locale must contain match property');\n }\n\n var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n if (formatString === '') {\n if (dateString === '') {\n return toDate(dirtyReferenceDate);\n } else {\n return new Date(NaN);\n }\n }\n\n var subFnOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale\n }; // If timezone isn't specified, it will be set to the system timezone\n\n var setters = [{\n priority: TIMEZONE_UNIT_PRIORITY,\n subPriority: -1,\n set: dateToSystemTimezone,\n index: 0\n }];\n var i;\n var tokens = formatString.match(longFormattingTokensRegExp).map(function (substring) {\n var firstCharacter = substring[0];\n\n if (firstCharacter === 'p' || firstCharacter === 'P') {\n var longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong, subFnOptions);\n }\n\n return substring;\n }).join('').match(formattingTokensRegExp);\n var usedTokens = [];\n\n for (i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token)) {\n throwProtectedError(token, formatString, dirtyDateString);\n }\n\n if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) {\n throwProtectedError(token, formatString, dirtyDateString);\n }\n\n var firstCharacter = token[0];\n var parser = parsers[firstCharacter];\n\n if (parser) {\n var incompatibleTokens = parser.incompatibleTokens;\n\n if (Array.isArray(incompatibleTokens)) {\n var incompatibleToken = void 0;\n\n for (var _i = 0; _i < usedTokens.length; _i++) {\n var usedToken = usedTokens[_i].token;\n\n if (incompatibleTokens.indexOf(usedToken) !== -1 || usedToken === firstCharacter) {\n incompatibleToken = usedTokens[_i];\n break;\n }\n }\n\n if (incompatibleToken) {\n throw new RangeError(\"The format string mustn't contain `\".concat(incompatibleToken.fullToken, \"` and `\").concat(token, \"` at the same time\"));\n }\n } else if (parser.incompatibleTokens === '*' && usedTokens.length) {\n throw new RangeError(\"The format string mustn't contain `\".concat(token, \"` and any other token at the same time\"));\n }\n\n usedTokens.push({\n token: firstCharacter,\n fullToken: token\n });\n var parseResult = parser.parse(dateString, token, locale.match, subFnOptions);\n\n if (!parseResult) {\n return new Date(NaN);\n }\n\n setters.push({\n priority: parser.priority,\n subPriority: parser.subPriority || 0,\n set: parser.set,\n validate: parser.validate,\n value: parseResult.value,\n index: setters.length\n });\n dateString = parseResult.rest;\n } else {\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');\n } // Replace two single quote characters with one single quote character\n\n\n if (token === \"''\") {\n token = \"'\";\n } else if (firstCharacter === \"'\") {\n token = cleanEscapedString(token);\n } // Cut token from string, or, if string doesn't match the token, return Invalid Date\n\n\n if (dateString.indexOf(token) === 0) {\n dateString = dateString.slice(token.length);\n } else {\n return new Date(NaN);\n }\n }\n } // Check if the remaining input contains something other than whitespace\n\n\n if (dateString.length > 0 && notWhitespaceRegExp.test(dateString)) {\n return new Date(NaN);\n }\n\n var uniquePrioritySetters = setters.map(function (setter) {\n return setter.priority;\n }).sort(function (a, b) {\n return b - a;\n }).filter(function (priority, index, array) {\n return array.indexOf(priority) === index;\n }).map(function (priority) {\n return setters.filter(function (setter) {\n return setter.priority === priority;\n }).sort(function (a, b) {\n return b.subPriority - a.subPriority;\n });\n }).map(function (setterArray) {\n return setterArray[0];\n });\n var date = toDate(dirtyReferenceDate);\n\n if (isNaN(date)) {\n return new Date(NaN);\n } // Convert the date in system timezone to the same date in UTC+00:00 timezone.\n // This ensures that when UTC functions will be implemented, locales will be compatible with them.\n // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/37\n\n\n var utcDate = subMilliseconds(date, getTimezoneOffsetInMilliseconds(date));\n var flags = {};\n\n for (i = 0; i < uniquePrioritySetters.length; i++) {\n var setter = uniquePrioritySetters[i];\n\n if (setter.validate && !setter.validate(utcDate, setter.value, subFnOptions)) {\n return new Date(NaN);\n }\n\n var result = setter.set(utcDate, flags, setter.value, subFnOptions); // Result is tuple (date, flags)\n\n if (result[0]) {\n utcDate = result[0];\n assign(flags, result[1]); // Result is date\n } else {\n utcDate = result;\n }\n }\n\n return utcDate;\n}\n\nfunction dateToSystemTimezone(date, flags) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n var convertedDate = new Date(0);\n convertedDate.setFullYear(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());\n convertedDate.setHours(date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());\n return convertedDate;\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getDaysInMonth\n * @category Month Helpers\n * @summary Get the number of days in a month of the given date.\n *\n * @description\n * Get the number of days in a month of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the number of days in a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // How many days are in February 2000?\n * const result = getDaysInMonth(new Date(2000, 1))\n * //=> 29\n */\n\nexport default function getDaysInMonth(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n var monthIndex = date.getMonth();\n var lastDayOfMonth = new Date(0);\n lastDayOfMonth.setFullYear(year, monthIndex + 1, 0);\n lastDayOfMonth.setHours(0, 0, 0, 0);\n return lastDayOfMonth.getDate();\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name startOfMonth\n * @category Month Helpers\n * @summary Return the start of a month for the given date.\n *\n * @description\n * Return the start of a month for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of a month for 2 September 2014 11:55:00:\n * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\n\nexport default function startOfMonth(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfMonth\n * @category Month Helpers\n * @summary Return the end of a month for the given date.\n *\n * @description\n * Return the end of a month for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a month for 2 September 2014 11:55:00:\n * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\n\nexport default function endOfMonth(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var month = date.getMonth();\n date.setFullYear(date.getFullYear(), month + 1, 0);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Date} the start of a week\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\n\nexport default function startOfWeek(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = date.getDay();\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n date.setDate(date.getDate() - diff);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name startOfYear\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of a year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\n\nexport default function startOfYear(dirtyDate) {\n requiredArgs(1, arguments);\n var cleanDate = toDate(dirtyDate);\n var date = new Date(0);\n date.setFullYear(cleanDate.getFullYear(), 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import addDays from 'date-fns/addDays';\nimport addMonths from 'date-fns/addMonths';\nimport addYears from 'date-fns/addYears';\nimport differenceInMilliseconds from 'date-fns/differenceInMilliseconds';\nimport eachDayOfInterval from 'date-fns/eachDayOfInterval';\nimport endOfDay from 'date-fns/endOfDay';\nimport endOfWeek from 'date-fns/endOfWeek';\nimport endOfYear from 'date-fns/endOfYear';\nimport format from 'date-fns/format';\nimport getHours from 'date-fns/getHours';\nimport getSeconds from 'date-fns/getSeconds';\nimport getYear from 'date-fns/getYear';\nimport isAfter from 'date-fns/isAfter';\nimport isBefore from 'date-fns/isBefore';\nimport isEqual from 'date-fns/isEqual';\nimport isSameDay from 'date-fns/isSameDay';\nimport isSameYear from 'date-fns/isSameYear';\nimport isSameMonth from 'date-fns/isSameMonth';\nimport isSameHour from 'date-fns/isSameHour';\nimport isValid from 'date-fns/isValid';\nimport dateFnsParse from 'date-fns/parse';\nimport setHours from 'date-fns/setHours';\nimport setMinutes from 'date-fns/setMinutes';\nimport setMonth from 'date-fns/setMonth';\nimport setSeconds from 'date-fns/setSeconds';\nimport setYear from 'date-fns/setYear';\nimport startOfDay from 'date-fns/startOfDay';\nimport startOfMonth from 'date-fns/startOfMonth';\nimport endOfMonth from 'date-fns/endOfMonth';\nimport startOfWeek from 'date-fns/startOfWeek';\nimport startOfYear from 'date-fns/startOfYear';\n\nvar DateFnsUtils = /** @class */ (function () {\n function DateFnsUtils(_a) {\n var locale = (_a === void 0 ? {} : _a).locale;\n this.yearFormat = \"yyyy\";\n this.yearMonthFormat = \"MMMM yyyy\";\n this.dateTime12hFormat = \"MMMM do hh:mm aaaa\";\n this.dateTime24hFormat = \"MMMM do HH:mm\";\n this.time12hFormat = \"hh:mm a\";\n this.time24hFormat = \"HH:mm\";\n this.dateFormat = \"MMMM do\";\n this.locale = locale;\n }\n // Note: date-fns input types are more lenient than this adapter, so we need to expose our more\n // strict signature and delegate to the more lenient signature. Otherwise, we have downstream type errors upon usage.\n DateFnsUtils.prototype.addDays = function (value, count) {\n return addDays(value, count);\n };\n DateFnsUtils.prototype.isValid = function (value) {\n return isValid(this.date(value));\n };\n DateFnsUtils.prototype.getDiff = function (value, comparing) {\n return differenceInMilliseconds(value, this.date(comparing));\n };\n DateFnsUtils.prototype.isAfter = function (value, comparing) {\n return isAfter(value, comparing);\n };\n DateFnsUtils.prototype.isBefore = function (value, comparing) {\n return isBefore(value, comparing);\n };\n DateFnsUtils.prototype.startOfDay = function (value) {\n return startOfDay(value);\n };\n DateFnsUtils.prototype.endOfDay = function (value) {\n return endOfDay(value);\n };\n DateFnsUtils.prototype.getHours = function (value) {\n return getHours(value);\n };\n DateFnsUtils.prototype.setHours = function (value, count) {\n return setHours(value, count);\n };\n DateFnsUtils.prototype.setMinutes = function (value, count) {\n return setMinutes(value, count);\n };\n DateFnsUtils.prototype.getSeconds = function (value) {\n return getSeconds(value);\n };\n DateFnsUtils.prototype.setSeconds = function (value, count) {\n return setSeconds(value, count);\n };\n DateFnsUtils.prototype.isSameDay = function (value, comparing) {\n return isSameDay(value, comparing);\n };\n DateFnsUtils.prototype.isSameMonth = function (value, comparing) {\n return isSameMonth(value, comparing);\n };\n DateFnsUtils.prototype.isSameYear = function (value, comparing) {\n return isSameYear(value, comparing);\n };\n DateFnsUtils.prototype.isSameHour = function (value, comparing) {\n return isSameHour(value, comparing);\n };\n DateFnsUtils.prototype.startOfMonth = function (value) {\n return startOfMonth(value);\n };\n DateFnsUtils.prototype.endOfMonth = function (value) {\n return endOfMonth(value);\n };\n DateFnsUtils.prototype.getYear = function (value) {\n return getYear(value);\n };\n DateFnsUtils.prototype.setYear = function (value, count) {\n return setYear(value, count);\n };\n DateFnsUtils.prototype.date = function (value) {\n if (typeof value === \"undefined\") {\n return new Date();\n }\n if (value === null) {\n return null;\n }\n return new Date(value);\n };\n DateFnsUtils.prototype.parse = function (value, formatString) {\n if (value === \"\") {\n return null;\n }\n return dateFnsParse(value, formatString, new Date(), { locale: this.locale });\n };\n DateFnsUtils.prototype.format = function (date, formatString) {\n return format(date, formatString, { locale: this.locale });\n };\n DateFnsUtils.prototype.isEqual = function (date, comparing) {\n if (date === null && comparing === null) {\n return true;\n }\n return isEqual(date, comparing);\n };\n DateFnsUtils.prototype.isNull = function (date) {\n return date === null;\n };\n DateFnsUtils.prototype.isAfterDay = function (date, value) {\n return isAfter(date, endOfDay(value));\n };\n DateFnsUtils.prototype.isBeforeDay = function (date, value) {\n return isBefore(date, startOfDay(value));\n };\n DateFnsUtils.prototype.isBeforeYear = function (date, value) {\n return isBefore(date, startOfYear(value));\n };\n DateFnsUtils.prototype.isAfterYear = function (date, value) {\n return isAfter(date, endOfYear(value));\n };\n DateFnsUtils.prototype.formatNumber = function (numberToFormat) {\n return numberToFormat;\n };\n DateFnsUtils.prototype.getMinutes = function (date) {\n return date.getMinutes();\n };\n DateFnsUtils.prototype.getMonth = function (date) {\n return date.getMonth();\n };\n DateFnsUtils.prototype.setMonth = function (date, count) {\n return setMonth(date, count);\n };\n DateFnsUtils.prototype.getMeridiemText = function (ampm) {\n return ampm === \"am\" ? \"AM\" : \"PM\";\n };\n DateFnsUtils.prototype.getNextMonth = function (date) {\n return addMonths(date, 1);\n };\n DateFnsUtils.prototype.getPreviousMonth = function (date) {\n return addMonths(date, -1);\n };\n DateFnsUtils.prototype.getMonthArray = function (date) {\n var firstMonth = startOfYear(date);\n var monthArray = [firstMonth];\n while (monthArray.length < 12) {\n var prevMonth = monthArray[monthArray.length - 1];\n monthArray.push(this.getNextMonth(prevMonth));\n }\n return monthArray;\n };\n DateFnsUtils.prototype.mergeDateAndTime = function (date, time) {\n return this.setMinutes(this.setHours(date, this.getHours(time)), this.getMinutes(time));\n };\n DateFnsUtils.prototype.getWeekdays = function () {\n var _this = this;\n var now = new Date();\n return eachDayOfInterval({\n start: startOfWeek(now, { locale: this.locale }),\n end: endOfWeek(now, { locale: this.locale })\n }).map(function (day) { return _this.format(day, \"EEEEEE\"); });\n };\n DateFnsUtils.prototype.getWeekArray = function (date) {\n var start = startOfWeek(startOfMonth(date), { locale: this.locale });\n var end = endOfWeek(endOfMonth(date), { locale: this.locale });\n var count = 0;\n var current = start;\n var nestedWeeks = [];\n while (isBefore(current, end)) {\n var weekNumber = Math.floor(count / 7);\n nestedWeeks[weekNumber] = nestedWeeks[weekNumber] || [];\n nestedWeeks[weekNumber].push(current);\n current = addDays(current, 1);\n count += 1;\n }\n return nestedWeeks;\n };\n DateFnsUtils.prototype.getYearRange = function (start, end) {\n var startDate = startOfYear(start);\n var endDate = endOfYear(end);\n var years = [];\n var current = startDate;\n while (isBefore(current, endDate)) {\n years.push(current);\n current = addYears(current, 1);\n }\n return years;\n };\n // displaying methpds\n DateFnsUtils.prototype.getCalendarHeaderText = function (date) {\n return this.format(date, this.yearMonthFormat);\n };\n DateFnsUtils.prototype.getYearText = function (date) {\n return this.format(date, \"yyyy\");\n };\n DateFnsUtils.prototype.getDatePickerHeaderText = function (date) {\n return this.format(date, \"EEE, MMM d\");\n };\n DateFnsUtils.prototype.getDateTimePickerHeaderText = function (date) {\n return this.format(date, \"MMM d\");\n };\n DateFnsUtils.prototype.getMonthText = function (date) {\n return this.format(date, \"MMMM\");\n };\n DateFnsUtils.prototype.getDayText = function (date) {\n return this.format(date, \"d\");\n };\n DateFnsUtils.prototype.getHourText = function (date, ampm) {\n return this.format(date, ampm ? \"hh\" : \"HH\");\n };\n DateFnsUtils.prototype.getMinuteText = function (date) {\n return this.format(date, \"mm\");\n };\n DateFnsUtils.prototype.getSecondText = function (date) {\n return this.format(date, \"ss\");\n };\n return DateFnsUtils;\n}());\n\nexport default DateFnsUtils;\n","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInMilliseconds\n * @category Millisecond Helpers\n * @summary Get the number of milliseconds between the given dates.\n *\n * @description\n * Get the number of milliseconds between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of milliseconds\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many milliseconds are between\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n * const result = differenceInMilliseconds(\n * new Date(2014, 6, 2, 12, 30, 21, 700),\n * new Date(2014, 6, 2, 12, 30, 20, 600)\n * )\n * //=> 1100\n */\n\nexport default function differenceInMilliseconds(dateLeft, dateRight) {\n requiredArgs(2, arguments);\n return toDate(dateLeft).getTime() - toDate(dateRight).getTime();\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getHours\n * @category Hour Helpers\n * @summary Get the hours of the given date.\n *\n * @description\n * Get the hours of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the hours\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Get the hours of 29 February 2012 11:45:00:\n * const result = getHours(new Date(2012, 1, 29, 11, 45))\n * //=> 11\n */\n\nexport default function getHours(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var hours = date.getHours();\n return hours;\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name setHours\n * @category Hour Helpers\n * @summary Set the hours to the given date.\n *\n * @description\n * Set the hours to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} hours - the hours of the new date\n * @returns {Date} the new date with the hours set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set 4 hours to 1 September 2014 11:30:00:\n * var result = setHours(new Date(2014, 8, 1, 11, 30), 4)\n * //=> Mon Sep 01 2014 04:30:00\n */\n\nexport default function setHours(dirtyDate, dirtyHours) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var hours = toInteger(dirtyHours);\n date.setHours(hours);\n return date;\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name setMinutes\n * @category Minute Helpers\n * @summary Set the minutes to the given date.\n *\n * @description\n * Set the minutes to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} minutes - the minutes of the new date\n * @returns {Date} the new date with the minutes set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set 45 minutes to 1 September 2014 11:30:40:\n * const result = setMinutes(new Date(2014, 8, 1, 11, 30, 40), 45)\n * //=> Mon Sep 01 2014 11:45:40\n */\n\nexport default function setMinutes(dirtyDate, dirtyMinutes) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var minutes = toInteger(dirtyMinutes);\n date.setMinutes(minutes);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getSeconds\n * @category Second Helpers\n * @summary Get the seconds of the given date.\n *\n * @description\n * Get the seconds of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the seconds\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Get the seconds of 29 February 2012 11:45:05.123:\n * const result = getSeconds(new Date(2012, 1, 29, 11, 45, 5, 123))\n * //=> 5\n */\n\nexport default function getSeconds(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var seconds = date.getSeconds();\n return seconds;\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name setSeconds\n * @category Second Helpers\n * @summary Set the seconds to the given date.\n *\n * @description\n * Set the seconds to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} seconds - the seconds of the new date\n * @returns {Date} the new date with the seconds set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set 45 seconds to 1 September 2014 11:30:40:\n * const result = setSeconds(new Date(2014, 8, 1, 11, 30, 40), 45)\n * //=> Mon Sep 01 2014 11:30:45\n */\n\nexport default function setSeconds(dirtyDate, dirtySeconds) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var seconds = toInteger(dirtySeconds);\n date.setSeconds(seconds);\n return date;\n}","import startOfDay from \"../startOfDay/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isSameDay\n * @category Day Helpers\n * @summary Are the given dates in the same day (and year and month)?\n *\n * @description\n * Are the given dates in the same day (and year and month)?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same day (and year and month)\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?\n * var result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))\n * //=> true\n * \n * @example\n * // Are 4 September and 4 October in the same day?\n * var result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4))\n * //=> false\n * \n * @example\n * // Are 4 September, 2014 and 4 September, 2015 in the same day?\n * var result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4))\n * //=> false\n */\n\nexport default function isSameDay(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeftStartOfDay = startOfDay(dirtyDateLeft);\n var dateRightStartOfDay = startOfDay(dirtyDateRight);\n return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime();\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isSameMonth\n * @category Month Helpers\n * @summary Are the given dates in the same month (and year)?\n *\n * @description\n * Are the given dates in the same month (and year)?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same month (and year)\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 2 September 2014 and 25 September 2014 in the same month?\n * var result = isSameMonth(new Date(2014, 8, 2), new Date(2014, 8, 25))\n * //=> true\n *\n * @example\n * // Are 2 September 2014 and 25 September 2015 in the same month?\n * var result = isSameMonth(new Date(2014, 8, 2), new Date(2015, 8, 25))\n * //=> false\n */\n\nexport default function isSameMonth(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n return dateLeft.getFullYear() === dateRight.getFullYear() && dateLeft.getMonth() === dateRight.getMonth();\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isSameYear\n * @category Year Helpers\n * @summary Are the given dates in the same year?\n *\n * @description\n * Are the given dates in the same year?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same year\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 2 September 2014 and 25 September 2014 in the same year?\n * var result = isSameYear(new Date(2014, 8, 2), new Date(2014, 8, 25))\n * //=> true\n */\n\nexport default function isSameYear(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n return dateLeft.getFullYear() === dateRight.getFullYear();\n}","import startOfHour from \"../startOfHour/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isSameHour\n * @category Hour Helpers\n * @summary Are the given dates in the same hour (and same day)?\n *\n * @description\n * Are the given dates in the same hour (and same day)?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same hour (and same day)\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 4 September 2014 06:00:00 and 4 September 06:30:00 in the same hour?\n * var result = isSameHour(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 6, 30))\n * //=> true\n * \n * @example\n * // Are 4 September 2014 06:00:00 and 5 September 06:00:00 in the same hour?\n * var result = isSameHour(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 5, 6, 0))\n * //=> false\n */\n\nexport default function isSameHour(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeftStartOfHour = startOfHour(dirtyDateLeft);\n var dateRightStartOfHour = startOfHour(dirtyDateRight);\n return dateLeftStartOfHour.getTime() === dateRightStartOfHour.getTime();\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getYear\n * @category Year Helpers\n * @summary Get the year of the given date.\n *\n * @description\n * Get the year of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which year is 2 July 2014?\n * const result = getYear(new Date(2014, 6, 2))\n * //=> 2014\n */\n\nexport default function getYear(dirtyDate) {\n requiredArgs(1, arguments);\n return toDate(dirtyDate).getFullYear();\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name setYear\n * @category Year Helpers\n * @summary Set the year to the given date.\n *\n * @description\n * Set the year to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} year - the year of the new date\n * @returns {Date} the new date with the year set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set year 2013 to 1 September 2014:\n * const result = setYear(new Date(2014, 8, 1), 2013)\n * //=> Sun Sep 01 2013 00:00:00\n */\n\nexport default function setYear(dirtyDate, dirtyYear) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var year = toInteger(dirtyYear); // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date\n\n if (isNaN(date.getTime())) {\n return new Date(NaN);\n }\n\n date.setFullYear(year);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isEqual\n * @category Common Helpers\n * @summary Are the given dates equal?\n *\n * @description\n * Are the given dates equal?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to compare\n * @param {Date|Number} dateRight - the second date to compare\n * @returns {Boolean} the dates are equal\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal?\n * var result = isEqual(\n * new Date(2014, 6, 2, 6, 30, 45, 0),\n * new Date(2014, 6, 2, 6, 30, 45, 500)\n * )\n * //=> false\n */\n\nexport default function isEqual(dirtyLeftDate, dirtyRightDate) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyLeftDate);\n var dateRight = toDate(dirtyRightDate);\n return dateLeft.getTime() === dateRight.getTime();\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport getDaysInMonth from \"../getDaysInMonth/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name setMonth\n * @category Month Helpers\n * @summary Set the month to the given date.\n *\n * @description\n * Set the month to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} month - the month of the new date\n * @returns {Date} the new date with the month set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set February to 1 September 2014:\n * const result = setMonth(new Date(2014, 8, 1), 1)\n * //=> Sat Feb 01 2014 00:00:00\n */\n\nexport default function setMonth(dirtyDate, dirtyMonth) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var month = toInteger(dirtyMonth);\n var year = date.getFullYear();\n var day = date.getDate();\n var dateWithDesiredMonth = new Date(0);\n dateWithDesiredMonth.setFullYear(year, month, 15);\n dateWithDesiredMonth.setHours(0, 0, 0, 0);\n var daysInMonth = getDaysInMonth(dateWithDesiredMonth); // Set the last day of the new month\n // if the original date was the last day of the longer month\n\n date.setMonth(month, Math.min(day, daysInMonth));\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name eachDayOfInterval\n * @category Interval Helpers\n * @summary Return the array of dates within the specified time interval.\n *\n * @description\n * Return the array of dates within the specified time interval.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `eachDay` to `eachDayOfInterval`.\n * This change was made to mirror the use of the word \"interval\" in standard ISO 8601:2004 terminology:\n *\n * ```\n * 2.1.3\n * time interval\n * part of the time axis limited by two instants\n * ```\n *\n * Also, this function now accepts an object with `start` and `end` properties\n * instead of two arguments as an interval.\n * This function now throws `RangeError` if the start of the interval is after its end\n * or if any date in the interval is `Invalid Date`.\n *\n * ```javascript\n * // Before v2.0.0\n *\n * eachDay(new Date(2014, 0, 10), new Date(2014, 0, 20))\n *\n * // v2.0.0 onward\n *\n * eachDayOfInterval(\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }\n * )\n * ```\n *\n * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval}\n * @param {Object} [options] - an object with options.\n * @param {Number} [options.step=1] - the step to increment by. The value should be more than 1.\n * @returns {Date[]} the array with starts of days from the day of the interval start to the day of the interval end\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.step` must be a number greater than 1\n * @throws {RangeError} The start of an interval cannot be after its end\n * @throws {RangeError} Date in interval cannot be `Invalid Date`\n *\n * @example\n * // Each day between 6 October 2014 and 10 October 2014:\n * const result = eachDayOfInterval({\n * start: new Date(2014, 9, 6),\n * end: new Date(2014, 9, 10)\n * })\n * //=> [\n * // Mon Oct 06 2014 00:00:00,\n * // Tue Oct 07 2014 00:00:00,\n * // Wed Oct 08 2014 00:00:00,\n * // Thu Oct 09 2014 00:00:00,\n * // Fri Oct 10 2014 00:00:00\n * // ]\n */\n\nexport default function eachDayOfInterval(dirtyInterval, options) {\n requiredArgs(1, arguments);\n var interval = dirtyInterval || {};\n var startDate = toDate(interval.start);\n var endDate = toDate(interval.end);\n var endTime = endDate.getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date`\n\n if (!(startDate.getTime() <= endTime)) {\n throw new RangeError('Invalid interval');\n }\n\n var dates = [];\n var currentDate = startDate;\n currentDate.setHours(0, 0, 0, 0);\n var step = options && 'step' in options ? Number(options.step) : 1;\n if (step < 1 || isNaN(step)) throw new RangeError('`options.step` must be a number greater than 1');\n\n while (currentDate.getTime() <= endTime) {\n dates.push(toDate(currentDate));\n currentDate.setDate(currentDate.getDate() + step);\n currentDate.setHours(0, 0, 0, 0);\n }\n\n return dates;\n}","import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { IUtils } from '@date-io/core/IUtils';\nimport { MaterialUiPickersDate } from './typings/date';\n\nexport const MuiPickersContext = React.createContext | null>(null);\n\nexport interface MuiPickersUtilsProviderProps {\n utils: any;\n children: React.ReactNode;\n locale?: any;\n libInstance?: any;\n}\n\nexport const MuiPickersUtilsProvider: React.FC = ({\n utils: Utils,\n children,\n locale,\n libInstance,\n}) => {\n const utils = React.useMemo(() => new Utils({ locale, instance: libInstance }), [\n Utils,\n libInstance,\n locale,\n ]);\n\n return ;\n};\n\nMuiPickersUtilsProvider.propTypes = {\n utils: PropTypes.func.isRequired,\n locale: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),\n children: PropTypes.oneOfType([\n PropTypes.element.isRequired,\n PropTypes.arrayOf(PropTypes.element.isRequired),\n ]).isRequired,\n};\n\nexport default MuiPickersUtilsProvider;\n","import { useContext } from 'react';\nimport { IUtils } from '@date-io/core/IUtils';\nimport { MaterialUiPickersDate } from '../../typings/date';\nimport { MuiPickersContext } from '../../MuiPickersUtilsProvider';\n\nexport const checkUtils = (utils: IUtils | null | undefined) => {\n if (!utils) {\n // tslint:disable-next-line\n throw new Error(\n 'Can not find utils in context. You either a) forgot to wrap your component tree in MuiPickersUtilsProvider; or b) mixed named and direct file imports. Recommendation: use named imports from the module index.'\n );\n }\n};\n\nexport function useUtils() {\n const utils = useContext(MuiPickersContext);\n checkUtils(utils);\n\n return utils!;\n}\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport withStyles from '../styles/withStyles';\nexport var styles = function styles(theme) {\n return {\n /* Styles applied to the root element. */\n root: {\n position: 'relative',\n display: 'flex',\n alignItems: 'center'\n },\n\n /* Styles applied to the root element if `disableGutters={false}`. */\n gutters: _defineProperty({\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2)\n }, theme.breakpoints.up('sm'), {\n paddingLeft: theme.spacing(3),\n paddingRight: theme.spacing(3)\n }),\n\n /* Styles applied to the root element if `variant=\"regular\"`. */\n regular: theme.mixins.toolbar,\n\n /* Styles applied to the root element if `variant=\"dense\"`. */\n dense: {\n minHeight: 48\n }\n };\n};\nvar Toolbar = /*#__PURE__*/React.forwardRef(function Toolbar(props, ref) {\n var classes = props.classes,\n className = props.className,\n _props$component = props.component,\n Component = _props$component === void 0 ? 'div' : _props$component,\n _props$disableGutters = props.disableGutters,\n disableGutters = _props$disableGutters === void 0 ? false : _props$disableGutters,\n _props$variant = props.variant,\n variant = _props$variant === void 0 ? 'regular' : _props$variant,\n other = _objectWithoutProperties(props, [\"classes\", \"className\", \"component\", \"disableGutters\", \"variant\"]);\n\n return /*#__PURE__*/React.createElement(Component, _extends({\n className: clsx(classes.root, classes[variant], className, !disableGutters && classes.gutters),\n ref: ref\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? Toolbar.propTypes = {\n /**\n * Toolbar children, usually a mixture of `IconButton`, `Button` and `Typography`.\n */\n children: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object.isRequired,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes\n /* @typescript-to-proptypes-ignore */\n .elementType,\n\n /**\n * If `true`, disables gutter padding.\n */\n disableGutters: PropTypes.bool,\n\n /**\n * The variant to use.\n */\n variant: PropTypes.oneOf(['regular', 'dense'])\n} : void 0;\nexport default withStyles(styles, {\n name: 'MuiToolbar'\n})(Toolbar);","/** Use it instead of .includes method for IE support */\nexport function arrayIncludes(array: T[], itemOrItems: T | T[]) {\n if (Array.isArray(itemOrItems)) {\n return itemOrItems.every(item => array.indexOf(item) !== -1);\n }\n\n return array.indexOf(itemOrItems) !== -1;\n}\n\nexport type Omit = Pick>;\n","import * as React from 'react';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { DIALOG_WIDTH } from '../constants/dimensions';\n\nconst useStyles = makeStyles(\n theme => ({\n staticWrapperRoot: {\n overflow: 'hidden',\n minWidth: DIALOG_WIDTH,\n display: 'flex',\n flexDirection: 'column',\n backgroundColor: theme.palette.background.paper,\n },\n }),\n { name: 'MuiPickersStaticWrapper' }\n);\n\nexport const StaticWrapper: React.FC = ({ children }) => {\n const classes = useStyles();\n\n return ;\n};\n","export const DIALOG_WIDTH = 310;\n\nexport const DIALOG_WIDTH_WIDER = 325;\n\nexport const VIEW_HEIGHT = 305;\n","import * as React from 'react';\nimport clsx from 'clsx';\nimport Button from '@material-ui/core/Button';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport Dialog, { DialogProps } from '@material-ui/core/Dialog';\nimport { DIALOG_WIDTH, DIALOG_WIDTH_WIDER } from '../constants/dimensions';\nimport { createStyles, WithStyles, withStyles } from '@material-ui/core/styles';\n\nexport interface ModalDialogProps extends DialogProps {\n onAccept: () => void;\n onDismiss: () => void;\n onClear: () => void;\n onSetToday: () => void;\n okLabel?: React.ReactNode;\n cancelLabel?: React.ReactNode;\n clearLabel?: React.ReactNode;\n todayLabel?: React.ReactNode;\n clearable?: boolean;\n showTodayButton?: boolean;\n showTabs?: boolean;\n wider?: boolean;\n}\n\nexport const ModalDialog: React.SFC> = ({\n children,\n classes,\n onAccept,\n onDismiss,\n onClear,\n onSetToday,\n okLabel,\n cancelLabel,\n clearLabel,\n todayLabel,\n clearable,\n showTodayButton,\n showTabs,\n wider,\n ...other\n}) => (\n \n);\n\nModalDialog.displayName = 'ModalDialog';\n\nexport const styles = createStyles({\n dialogRoot: {\n minWidth: DIALOG_WIDTH,\n },\n dialogRootWider: {\n minWidth: DIALOG_WIDTH_WIDER,\n },\n dialog: {\n '&:first-child': {\n padding: 0,\n },\n },\n withAdditionalAction: {\n // set justifyContent to default value to fix IE11 layout bug\n // see https://github.com/dmtrKovalenko/material-ui-pickers/pull/267\n justifyContent: 'flex-start',\n\n '& > *:first-child': {\n marginRight: 'auto',\n },\n },\n});\n\nexport default withStyles(styles, { name: 'MuiPickersModal' })(ModalDialog);\n","import * as React from 'react';\n\nexport const useIsomorphicEffect =\n typeof window === 'undefined' ? React.useEffect : React.useLayoutEffect;\n\ntype KeyHandlers = Record void>;\n\nexport function runKeyHandler(e: KeyboardEvent, keyHandlers: KeyHandlers) {\n const handler = keyHandlers[e.key];\n if (handler) {\n handler();\n // if event was handled prevent other side effects (e.g. page scroll)\n e.preventDefault();\n }\n}\n\nexport function useKeyDown(active: boolean, keyHandlers: KeyHandlers) {\n const keyHandlersRef = React.useRef(keyHandlers);\n keyHandlersRef.current = keyHandlers;\n\n useIsomorphicEffect(() => {\n if (active) {\n const handleKeyDown = (event: KeyboardEvent) => {\n runKeyHandler(event, keyHandlersRef.current);\n };\n window.addEventListener('keydown', handleKeyDown);\n return () => {\n window.removeEventListener('keydown', handleKeyDown);\n };\n }\n }, [active]);\n}\n","import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport ModalDialog from '../_shared/ModalDialog';\nimport { WrapperProps } from './Wrapper';\nimport { Omit } from '../_helpers/utils';\nimport { useKeyDown } from '../_shared/hooks/useKeyDown';\nimport { DialogProps as MuiDialogProps } from '@material-ui/core/Dialog';\n\nexport interface ModalWrapperProps extends WrapperProps {\n /**\n * \"OK\" label message\n * @default \"OK\"\n */\n okLabel?: React.ReactNode;\n /**\n * \"CANCEL\" label message\n * @default \"CANCEL\"\n */\n cancelLabel?: React.ReactNode;\n /**\n * \"CLEAR\" label message\n * @default \"CLEAR\"\n */\n clearLabel?: React.ReactNode;\n /**\n * \"TODAY\" label message\n * @default \"TODAY\"\n */\n todayLabel?: React.ReactNode;\n /**\n * If true today button will be displayed Note* that clear button has higher priority\n * @default false\n */\n showTodayButton?: boolean;\n /**\n * Show clear action in picker dialog\n * @default false\n */\n clearable?: boolean;\n /**\n * Props to be passed directly to material-ui Dialog\n * @type {Partial}\n */\n DialogProps?: Partial>;\n}\n\nexport const ModalWrapper: React.FC> = ({\n open,\n children,\n okLabel,\n cancelLabel,\n clearLabel,\n todayLabel,\n showTodayButton,\n clearable,\n DialogProps,\n showTabs,\n wider,\n InputComponent,\n DateInputProps,\n onClear,\n onAccept,\n onDismiss,\n onSetToday,\n ...other\n}) => {\n useKeyDown(open, {\n Enter: onAccept,\n });\n\n return (\n \n \n\n \n \n );\n};\n\nModalWrapper.propTypes = {\n okLabel: PropTypes.node,\n cancelLabel: PropTypes.node,\n clearLabel: PropTypes.node,\n clearable: PropTypes.bool,\n todayLabel: PropTypes.node,\n showTodayButton: PropTypes.bool,\n DialogProps: PropTypes.object,\n} as any;\n\nModalWrapper.defaultProps = {\n okLabel: 'OK',\n cancelLabel: 'Cancel',\n clearLabel: 'Clear',\n todayLabel: 'Today',\n clearable: false,\n showTodayButton: false,\n};\n","import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport Popover, { PopoverProps as PopoverPropsType } from '@material-ui/core/Popover';\nimport { WrapperProps } from './Wrapper';\nimport { useKeyDown } from '../_shared/hooks/useKeyDown';\nimport { TextFieldProps } from '@material-ui/core/TextField';\n\nexport interface InlineWrapperProps extends WrapperProps {\n /** Popover props passed to material-ui Popover (with variant=\"inline\") */\n PopoverProps?: Partial;\n}\n\nexport const InlineWrapper: React.FC = ({\n open,\n wider,\n children,\n PopoverProps,\n onClear,\n onDismiss,\n onSetToday,\n onAccept,\n showTabs,\n DateInputProps,\n InputComponent,\n ...other\n}) => {\n const ref = React.useRef();\n\n useKeyDown(open, {\n Enter: onAccept,\n });\n\n return (\n \n \n\n \n \n );\n};\n\nInlineWrapper.propTypes = {\n onOpen: PropTypes.func,\n onClose: PropTypes.func,\n PopoverProps: PropTypes.object,\n} as any;\n","import * as React from 'react';\nimport { Omit } from '../_helpers/utils';\nimport { StaticWrapper } from './StaticWrapper';\nimport { ModalWrapper, ModalWrapperProps } from './ModalWrapper';\nimport { InlineWrapper, InlineWrapperProps } from './InlineWrapper';\nimport { KeyboardDateInputProps } from '../_shared/KeyboardDateInput';\nimport { PureDateInputProps, NotOverridableProps } from '../_shared/PureDateInput';\n\nexport type WrapperVariant = 'dialog' | 'inline' | 'static';\n\nexport interface WrapperProps {\n open: boolean;\n onAccept: () => void;\n onDismiss: () => void;\n onClear: () => void;\n onSetToday: () => void;\n InputComponent: React.FC;\n DateInputProps: T;\n wider?: boolean;\n showTabs?: boolean;\n}\n\ntype OmitInnerWrapperProps> = Omit<\n T,\n keyof WrapperProps | 'showTabs'\n>;\n\nexport type ModalRoot = OmitInnerWrapperProps;\n\nexport type InlineRoot = OmitInnerWrapperProps;\n\n// prettier-ignore\nexport type ExtendWrapper = {\n /**\n * Picker container option\n * @default 'dialog'\n */\n variant?: WrapperVariant\n} & ModalRoot\n & InlineRoot\n & Omit\n\nexport function getWrapperFromVariant(\n variant?: WrapperVariant\n): React.ComponentType | ModalWrapperProps> {\n switch (variant) {\n case 'inline':\n return InlineWrapper as any;\n\n case 'static':\n return StaticWrapper as any;\n\n default:\n return ModalWrapper as any;\n }\n}\n\ntype Props = {\n variant?: WrapperVariant;\n children?: React.ReactChild;\n} & (ModalWrapperProps | InlineWrapperProps);\n\nexport const VariantContext = React.createContext(null);\n\nexport const Wrapper: (\n p: Props\n) => React.ReactElement> = ({ variant, ...props }) => {\n const Component = getWrapperFromVariant(variant);\n\n return (\n \n \n \n );\n};\n","import _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';\nimport { Component } from 'react';\n\nvar Rifm =\n/*#__PURE__*/\nfunction (_React$Component) {\n _inheritsLoose(Rifm, _React$Component);\n\n function Rifm(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n _this._state = null;\n _this._del = false;\n\n _this._handleChange = function (evt) {\n if (process.env.NODE_ENV !== 'production') {\n if (evt.target.type === 'number') {\n console.error('Rifm does not support input type=number, use type=tel instead.');\n return;\n }\n } // FUTURE: use evt.nativeEvent.inputType for del event, see comments at onkeydown\n\n\n var stateValue = _this.state.value;\n var value = evt.target.value;\n var input = evt.target;\n var op = value.length > stateValue.length;\n var del = _this._del;\n\n var noOp = stateValue === _this.props.format(value);\n\n _this.setState({\n value: value,\n local: true\n }, function () {\n var selectionStart = input.selectionStart;\n var refuse = _this.props.refuse || /[^\\d]+/g;\n var before = value.substr(0, selectionStart).replace(refuse, '');\n _this._state = {\n input: input,\n before: before,\n op: op,\n di: del && noOp,\n del: del\n };\n\n if (_this.props.replace && _this.props.replace(stateValue) && op && !noOp) {\n var start = -1;\n\n for (var i = 0; i !== before.length; ++i) {\n start = Math.max(start, value.toLowerCase().indexOf(before[i].toLowerCase(), start + 1));\n }\n\n var c = value.substr(start + 1).replace(refuse, '')[0];\n start = value.indexOf(c, start + 1);\n value = \"\" + value.substr(0, start) + value.substr(start + 1);\n }\n\n var fv = _this.props.format(value);\n\n if (stateValue === fv) {\n _this.setState({\n value: value\n });\n } else {\n _this.props.onChange(fv);\n }\n });\n };\n\n _this._hKD = function (evt) {\n if (evt.code === 'Delete') {\n _this._del = true;\n }\n };\n\n _this._hKU = function (evt) {\n if (evt.code === 'Delete') {\n _this._del = false;\n }\n };\n\n _this.state = {\n value: props.value,\n local: true\n };\n return _this;\n }\n\n Rifm.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {\n return {\n value: state.local ? state.value : props.value,\n local: false\n };\n };\n\n var _proto = Rifm.prototype;\n\n _proto.render = function render() {\n var _handleChange = this._handleChange,\n value = this.state.value,\n children = this.props.children;\n return children({\n value: value,\n onChange: _handleChange\n });\n } // delete when https://developer.mozilla.org/en-US/docs/Web/API/InputEvent/inputType will be supported by all major browsers\n ;\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n document.removeEventListener('keydown', this._hKD);\n document.removeEventListener('keyup', this._hKU);\n } // delete when https://developer.mozilla.org/en-US/docs/Web/API/InputEvent/inputType will be supported by all major browsers\n ;\n\n _proto.componentDidMount = function componentDidMount() {\n document.addEventListener('keydown', this._hKD);\n document.addEventListener('keyup', this._hKU);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate() {\n var _state = this._state;\n\n if (_state) {\n var value = this.state.value;\n var start = -1;\n\n for (var i = 0; i !== _state.before.length; ++i) {\n start = Math.max(start, value.toLowerCase().indexOf(_state.before[i].toLowerCase(), start + 1));\n } // format usually looks better without this\n\n\n if (this.props.replace && (_state.op || _state.del && !_state.di)) {\n while (value[start + 1] && (this.props.refuse || /[^\\d]+/).test(value[start + 1])) {\n start += 1;\n }\n }\n\n _state.input.selectionStart = _state.input.selectionEnd = start + 1 + (_state.di ? 1 : 0);\n }\n\n this._state = null;\n };\n\n return Rifm;\n}(Component);\n\nexport { Rifm };\n","import _typeof from \"./typeof.js\";\nimport assertThisInitialized from \"./assertThisInitialized.js\";\nexport default function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return assertThisInitialized(self);\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}","import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport IconButton from '@material-ui/core/IconButton';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles(\n theme => ({\n day: {\n width: 36,\n height: 36,\n fontSize: theme.typography.caption.fontSize,\n margin: '0 2px',\n color: theme.palette.text.primary,\n fontWeight: theme.typography.fontWeightMedium,\n padding: 0,\n },\n hidden: {\n opacity: 0,\n pointerEvents: 'none',\n },\n current: {\n color: theme.palette.primary.main,\n fontWeight: 600,\n },\n daySelected: {\n color: theme.palette.primary.contrastText,\n backgroundColor: theme.palette.primary.main,\n fontWeight: theme.typography.fontWeightMedium,\n '&:hover': {\n backgroundColor: theme.palette.primary.main,\n },\n },\n dayDisabled: {\n pointerEvents: 'none',\n color: theme.palette.text.hint,\n },\n }),\n { name: 'MuiPickersDay' }\n);\n\nexport interface DayProps {\n /** Day text */\n children: React.ReactNode;\n /** Is today */\n current?: boolean;\n /** Disabled? */\n disabled?: boolean;\n /** Hidden? */\n hidden?: boolean;\n /** Selected? */\n selected?: boolean;\n}\n\nexport const Day: React.FC = ({\n children,\n disabled,\n hidden,\n current,\n selected,\n ...other\n}) => {\n const classes = useStyles();\n\n const className = clsx(classes.day, {\n [classes.hidden]: hidden,\n [classes.current]: current,\n [classes.daySelected]: selected,\n [classes.dayDisabled]: disabled,\n });\n\n return (\n \n \n {children}\n \n \n );\n};\n\nDay.displayName = 'Day';\n\nDay.propTypes = {\n current: PropTypes.bool,\n disabled: PropTypes.bool,\n hidden: PropTypes.bool,\n selected: PropTypes.bool,\n};\n\nDay.defaultProps = {\n disabled: false,\n hidden: false,\n current: false,\n selected: false,\n};\n\nexport default Day;\n","function replaceClassName(origClass, classToRemove) {\n return origClass.replace(new RegExp(\"(^|\\\\s)\" + classToRemove + \"(?:\\\\s|$)\", 'g'), '$1').replace(/\\s+/g, ' ').replace(/^\\s*|\\s*$/g, '');\n}\n/**\n * Removes a CSS class from a given element.\n * \n * @param element the element\n * @param className the CSS class name\n */\n\n\nexport default function removeClass(element, className) {\n if (element.classList) {\n element.classList.remove(className);\n } else if (typeof element.className === 'string') {\n element.className = replaceClassName(element.className, className);\n } else {\n element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));\n }\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport addOneClass from 'dom-helpers/addClass';\nimport removeOneClass from 'dom-helpers/removeClass';\nimport React from 'react';\nimport Transition from './Transition';\nimport { classNamesShape } from './utils/PropTypes';\n\nvar _addClass = function addClass(node, classes) {\n return node && classes && classes.split(' ').forEach(function (c) {\n return addOneClass(node, c);\n });\n};\n\nvar removeClass = function removeClass(node, classes) {\n return node && classes && classes.split(' ').forEach(function (c) {\n return removeOneClass(node, c);\n });\n};\n/**\n * A transition component inspired by the excellent\n * [ng-animate](https://docs.angularjs.org/api/ngAnimate) library, you should\n * use it if you're using CSS transitions or animations. It's built upon the\n * [`Transition`](https://reactcommunity.org/react-transition-group/transition)\n * component, so it inherits all of its props.\n *\n * `CSSTransition` applies a pair of class names during the `appear`, `enter`,\n * and `exit` states of the transition. The first class is applied and then a\n * second `*-active` class in order to activate the CSS transition. After the\n * transition, matching `*-done` class names are applied to persist the\n * transition state.\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n * \n * \n * \n * {\"I'll receive my-node-* classes\"}\n * \n * \n * \n * \n * );\n * }\n * ```\n *\n * When the `in` prop is set to `true`, the child component will first receive\n * the class `example-enter`, then the `example-enter-active` will be added in\n * the next tick. `CSSTransition` [forces a\n * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)\n * between before adding the `example-enter-active`. This is an important trick\n * because it allows us to transition between `example-enter` and\n * `example-enter-active` even though they were added immediately one after\n * another. Most notably, this is what makes it possible for us to animate\n * _appearance_.\n *\n * ```css\n * .my-node-enter {\n * opacity: 0;\n * }\n * .my-node-enter-active {\n * opacity: 1;\n * transition: opacity 200ms;\n * }\n * .my-node-exit {\n * opacity: 1;\n * }\n * .my-node-exit-active {\n * opacity: 0;\n * transition: opacity 200ms;\n * }\n * ```\n *\n * `*-active` classes represent which styles you want to animate **to**, so it's\n * important to add `transition` declaration only to them, otherwise transitions\n * might not behave as intended! This might not be obvious when the transitions\n * are symmetrical, i.e. when `*-enter-active` is the same as `*-exit`, like in\n * the example above (minus `transition`), but it becomes apparent in more\n * complex transitions.\n *\n * **Note**: If you're using the\n * [`appear`](http://reactcommunity.org/react-transition-group/transition#Transition-prop-appear)\n * prop, make sure to define styles for `.appear-*` classes as well.\n */\n\n\nvar CSSTransition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(CSSTransition, _React$Component);\n\n function CSSTransition() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.appliedClasses = {\n appear: {},\n enter: {},\n exit: {}\n };\n\n _this.onEnter = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument[0],\n appearing = _this$resolveArgument[1];\n\n _this.removeClasses(node, 'exit');\n\n _this.addClass(node, appearing ? 'appear' : 'enter', 'base');\n\n if (_this.props.onEnter) {\n _this.props.onEnter(maybeNode, maybeAppearing);\n }\n };\n\n _this.onEntering = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument2[0],\n appearing = _this$resolveArgument2[1];\n\n var type = appearing ? 'appear' : 'enter';\n\n _this.addClass(node, type, 'active');\n\n if (_this.props.onEntering) {\n _this.props.onEntering(maybeNode, maybeAppearing);\n }\n };\n\n _this.onEntered = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument3[0],\n appearing = _this$resolveArgument3[1];\n\n var type = appearing ? 'appear' : 'enter';\n\n _this.removeClasses(node, type);\n\n _this.addClass(node, type, 'done');\n\n if (_this.props.onEntered) {\n _this.props.onEntered(maybeNode, maybeAppearing);\n }\n };\n\n _this.onExit = function (maybeNode) {\n var _this$resolveArgument4 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument4[0];\n\n _this.removeClasses(node, 'appear');\n\n _this.removeClasses(node, 'enter');\n\n _this.addClass(node, 'exit', 'base');\n\n if (_this.props.onExit) {\n _this.props.onExit(maybeNode);\n }\n };\n\n _this.onExiting = function (maybeNode) {\n var _this$resolveArgument5 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument5[0];\n\n _this.addClass(node, 'exit', 'active');\n\n if (_this.props.onExiting) {\n _this.props.onExiting(maybeNode);\n }\n };\n\n _this.onExited = function (maybeNode) {\n var _this$resolveArgument6 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument6[0];\n\n _this.removeClasses(node, 'exit');\n\n _this.addClass(node, 'exit', 'done');\n\n if (_this.props.onExited) {\n _this.props.onExited(maybeNode);\n }\n };\n\n _this.resolveArguments = function (maybeNode, maybeAppearing) {\n return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] // here `maybeNode` is actually `appearing`\n : [maybeNode, maybeAppearing];\n };\n\n _this.getClassNames = function (type) {\n var classNames = _this.props.classNames;\n var isStringClassNames = typeof classNames === 'string';\n var prefix = isStringClassNames && classNames ? classNames + \"-\" : '';\n var baseClassName = isStringClassNames ? \"\" + prefix + type : classNames[type];\n var activeClassName = isStringClassNames ? baseClassName + \"-active\" : classNames[type + \"Active\"];\n var doneClassName = isStringClassNames ? baseClassName + \"-done\" : classNames[type + \"Done\"];\n return {\n baseClassName: baseClassName,\n activeClassName: activeClassName,\n doneClassName: doneClassName\n };\n };\n\n return _this;\n }\n\n var _proto = CSSTransition.prototype;\n\n _proto.addClass = function addClass(node, type, phase) {\n var className = this.getClassNames(type)[phase + \"ClassName\"];\n\n var _this$getClassNames = this.getClassNames('enter'),\n doneClassName = _this$getClassNames.doneClassName;\n\n if (type === 'appear' && phase === 'done' && doneClassName) {\n className += \" \" + doneClassName;\n } // This is to force a repaint,\n // which is necessary in order to transition styles when adding a class name.\n\n\n if (phase === 'active') {\n /* eslint-disable no-unused-expressions */\n node && node.scrollTop;\n }\n\n if (className) {\n this.appliedClasses[type][phase] = className;\n\n _addClass(node, className);\n }\n };\n\n _proto.removeClasses = function removeClasses(node, type) {\n var _this$appliedClasses$ = this.appliedClasses[type],\n baseClassName = _this$appliedClasses$.base,\n activeClassName = _this$appliedClasses$.active,\n doneClassName = _this$appliedClasses$.done;\n this.appliedClasses[type] = {};\n\n if (baseClassName) {\n removeClass(node, baseClassName);\n }\n\n if (activeClassName) {\n removeClass(node, activeClassName);\n }\n\n if (doneClassName) {\n removeClass(node, doneClassName);\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n _ = _this$props.classNames,\n props = _objectWithoutPropertiesLoose(_this$props, [\"classNames\"]);\n\n return /*#__PURE__*/React.createElement(Transition, _extends({}, props, {\n onEnter: this.onEnter,\n onEntered: this.onEntered,\n onEntering: this.onEntering,\n onExit: this.onExit,\n onExiting: this.onExiting,\n onExited: this.onExited\n }));\n };\n\n return CSSTransition;\n}(React.Component);\n\nCSSTransition.defaultProps = {\n classNames: ''\n};\nCSSTransition.propTypes = process.env.NODE_ENV !== \"production\" ? _extends({}, Transition.propTypes, {\n /**\n * The animation classNames applied to the component as it appears, enters,\n * exits or has finished the transition. A single name can be provided, which\n * will be suffixed for each stage, e.g. `classNames=\"fade\"` applies:\n *\n * - `fade-appear`, `fade-appear-active`, `fade-appear-done`\n * - `fade-enter`, `fade-enter-active`, `fade-enter-done`\n * - `fade-exit`, `fade-exit-active`, `fade-exit-done`\n *\n * A few details to note about how these classes are applied:\n *\n * 1. They are _joined_ with the ones that are already defined on the child\n * component, so if you want to add some base styles, you can use\n * `className` without worrying that it will be overridden.\n *\n * 2. If the transition component mounts with `in={false}`, no classes are\n * applied yet. You might be expecting `*-exit-done`, but if you think\n * about it, a component cannot finish exiting if it hasn't entered yet.\n *\n * 2. `fade-appear-done` and `fade-enter-done` will _both_ be applied. This\n * allows you to define different behavior for when appearing is done and\n * when regular entering is done, using selectors like\n * `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply\n * an epic entrance animation when element first appears in the DOM using\n * [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can\n * simply use `fade-enter-done` for defining both cases.\n *\n * Each individual classNames can also be specified independently like:\n *\n * ```js\n * classNames={{\n * appear: 'my-appear',\n * appearActive: 'my-active-appear',\n * appearDone: 'my-done-appear',\n * enter: 'my-enter',\n * enterActive: 'my-active-enter',\n * enterDone: 'my-done-enter',\n * exit: 'my-exit',\n * exitActive: 'my-active-exit',\n * exitDone: 'my-done-exit',\n * }}\n * ```\n *\n * If you want to set these classes using CSS Modules:\n *\n * ```js\n * import styles from './styles.css';\n * ```\n *\n * you might want to use camelCase in your CSS file, that way could simply\n * spread them instead of listing them one by one:\n *\n * ```js\n * classNames={{ ...styles }}\n * ```\n *\n * @type {string | {\n * appear?: string,\n * appearActive?: string,\n * appearDone?: string,\n * enter?: string,\n * enterActive?: string,\n * enterDone?: string,\n * exit?: string,\n * exitActive?: string,\n * exitDone?: string,\n * }}\n */\n classNames: classNamesShape,\n\n /**\n * A `` callback fired immediately after the 'enter' or 'appear' class is\n * applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEnter: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'enter-active' or\n * 'appear-active' class is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'enter' or\n * 'appear' classes are **removed** and the `done` class is added to the DOM node.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntered: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'exit' class is\n * applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExit: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'exit-active' is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExiting: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'exit' classes\n * are **removed** and the `exit-done` class is added to the DOM node.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExited: PropTypes.func\n}) : {};\nexport default CSSTransition;","import hasClass from './hasClass';\n/**\n * Adds a CSS class to a given element.\n * \n * @param element the element\n * @param className the CSS class name\n */\n\nexport default function addClass(element, className) {\n if (element.classList) element.classList.add(className);else if (!hasClass(element, className)) if (typeof element.className === 'string') element.className = element.className + \" \" + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + \" \" + className);\n}","/**\n * Checks if a given element has a CSS class.\n * \n * @param element the element\n * @param className the CSS class name\n */\nexport default function hasClass(element, className) {\n if (element.classList) return !!className && element.classList.contains(className);\n return (\" \" + (element.className.baseVal || element.className) + \" \").indexOf(\" \" + className + \" \") !== -1;\n}","import { arrayIncludes } from './utils';\nimport { IUtils } from '@date-io/core/IUtils';\nimport { MaterialUiPickersDate } from '../typings/date';\nimport { DatePickerView } from '../DatePicker/DatePicker';\n\ninterface FindClosestDateParams {\n date: MaterialUiPickersDate;\n utils: IUtils;\n minDate: MaterialUiPickersDate;\n maxDate: MaterialUiPickersDate;\n disableFuture: boolean;\n disablePast: boolean;\n shouldDisableDate: (date: MaterialUiPickersDate) => boolean;\n}\n\nexport const findClosestEnabledDate = ({\n date,\n utils,\n minDate,\n maxDate,\n disableFuture,\n disablePast,\n shouldDisableDate,\n}: FindClosestDateParams) => {\n const today = utils.startOfDay(utils.date());\n\n if (disablePast && utils.isBefore(minDate!, today)) {\n minDate = today;\n }\n\n if (disableFuture && utils.isAfter(maxDate, today)) {\n maxDate = today;\n }\n\n let forward = date;\n let backward = date;\n if (utils.isBefore(date, minDate)) {\n forward = utils.date(minDate);\n backward = null;\n }\n\n if (utils.isAfter(date, maxDate)) {\n if (backward) {\n backward = utils.date(maxDate);\n }\n\n forward = null;\n }\n\n while (forward || backward) {\n if (forward && utils.isAfter(forward, maxDate)) {\n forward = null;\n }\n if (backward && utils.isBefore(backward, minDate)) {\n backward = null;\n }\n\n if (forward) {\n if (!shouldDisableDate(forward)) {\n return forward;\n }\n forward = utils.addDays(forward, 1);\n }\n\n if (backward) {\n if (!shouldDisableDate(backward)) {\n return backward;\n }\n backward = utils.addDays(backward, -1);\n }\n }\n\n // fallback to today if no enabled days\n return utils.date();\n};\n\nexport const isYearOnlyView = (views: DatePickerView[]) =>\n views.length === 1 && views[0] === 'year';\n\nexport const isYearAndMonthViews = (views: DatePickerView[]) =>\n views.length === 2 && arrayIncludes(views, 'month') && arrayIncludes(views, 'year');\n\nexport const getFormatByViews = (views: DatePickerView[], utils: IUtils) => {\n if (isYearOnlyView(views)) {\n return utils.yearFormat;\n }\n\n if (isYearAndMonthViews(views)) {\n return utils.yearMonthFormat;\n }\n\n return utils.dateFormat;\n};\n","import * as React from 'react';\n\nexport interface DayWrapperProps {\n value: any;\n children: React.ReactNode;\n dayInCurrentMonth?: boolean;\n disabled?: boolean;\n onSelect: (value: any) => void;\n}\n\nconst DayWrapper: React.FC = ({\n children,\n value,\n disabled,\n onSelect,\n dayInCurrentMonth,\n ...other\n}) => {\n const handleClick = React.useCallback(() => onSelect(value), [onSelect, value]);\n\n return (\n \n {children}\n \n );\n};\n\nexport default DayWrapper;\n","import * as React from 'react';\nimport clsx from 'clsx';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { CSSTransition, TransitionGroup } from 'react-transition-group';\n\nexport type SlideDirection = 'right' | 'left';\ninterface SlideTransitionProps {\n transKey: React.Key;\n className?: string;\n slideDirection: SlideDirection;\n children: React.ReactChild;\n}\n\nconst animationDuration = 350;\nexport const useStyles = makeStyles(\n theme => {\n const slideTransition = theme.transitions.create('transform', {\n duration: animationDuration,\n easing: 'cubic-bezier(0.35, 0.8, 0.4, 1)',\n });\n\n return {\n transitionContainer: {\n display: 'block',\n position: 'relative',\n '& > *': {\n position: 'absolute',\n top: 0,\n right: 0,\n left: 0,\n },\n },\n 'slideEnter-left': {\n willChange: 'transform',\n transform: 'translate(100%)',\n },\n 'slideEnter-right': {\n willChange: 'transform',\n transform: 'translate(-100%)',\n },\n slideEnterActive: {\n transform: 'translate(0%)',\n transition: slideTransition,\n },\n slideExit: {\n transform: 'translate(0%)',\n },\n 'slideExitActiveLeft-left': {\n willChange: 'transform',\n transform: 'translate(-200%)',\n transition: slideTransition,\n },\n 'slideExitActiveLeft-right': {\n willChange: 'transform',\n transform: 'translate(200%)',\n transition: slideTransition,\n },\n };\n },\n { name: 'MuiPickersSlideTransition' }\n);\n\nconst SlideTransition: React.SFC = ({\n children,\n transKey,\n slideDirection,\n className = null,\n}) => {\n const classes = useStyles();\n const transitionClasses = {\n exit: classes.slideExit,\n enterActive: classes.slideEnterActive,\n // @ts-ignore\n enter: classes['slideEnter-' + slideDirection],\n // @ts-ignore\n exitActive: classes['slideExitActiveLeft-' + slideDirection],\n };\n\n return (\n \n React.cloneElement(element, {\n classNames: transitionClasses,\n })\n }\n >\n \n \n );\n};\n\nexport default SlideTransition;\n","import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport Typography from '@material-ui/core/Typography';\nimport SlideTransition, { SlideDirection } from './SlideTransition';\nimport IconButton, { IconButtonProps } from '@material-ui/core/IconButton';\nimport { DateType } from '@date-io/type';\nimport { useUtils } from '../../_shared/hooks/useUtils';\nimport { MaterialUiPickersDate } from '../../typings/date';\nimport { makeStyles, useTheme } from '@material-ui/core/styles';\nimport { ArrowLeftIcon } from '../../_shared/icons/ArrowLeftIcon';\nimport { ArrowRightIcon } from '../../_shared/icons/ArrowRightIcon';\n\nexport interface CalendarHeaderProps {\n currentMonth: DateType;\n leftArrowIcon?: React.ReactNode;\n rightArrowIcon?: React.ReactNode;\n leftArrowButtonProps?: Partial;\n rightArrowButtonProps?: Partial;\n disablePrevMonth?: boolean;\n disableNextMonth?: boolean;\n slideDirection: SlideDirection;\n onMonthChange: (date: MaterialUiPickersDate, direction: SlideDirection) => void | Promise;\n}\n\nexport const useStyles = makeStyles(\n theme => ({\n switchHeader: {\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n marginTop: theme.spacing(0.5),\n marginBottom: theme.spacing(1),\n },\n transitionContainer: {\n width: '100%',\n overflow: 'hidden',\n height: 23,\n },\n iconButton: {\n zIndex: 1,\n backgroundColor: theme.palette.background.paper,\n },\n daysHeader: {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n maxHeight: 16,\n },\n dayLabel: {\n width: 36,\n margin: '0 2px',\n textAlign: 'center',\n color: theme.palette.text.hint,\n },\n }),\n { name: 'MuiPickersCalendarHeader' }\n);\n\nexport const CalendarHeader: React.SFC = ({\n currentMonth,\n onMonthChange,\n leftArrowIcon,\n rightArrowIcon,\n leftArrowButtonProps,\n rightArrowButtonProps,\n disablePrevMonth,\n disableNextMonth,\n slideDirection,\n}) => {\n const utils = useUtils();\n const classes = useStyles();\n const theme = useTheme();\n const rtl = theme.direction === 'rtl';\n\n const selectNextMonth = () => onMonthChange(utils.getNextMonth(currentMonth), 'left');\n const selectPreviousMonth = () => onMonthChange(utils.getPreviousMonth(currentMonth), 'right');\n\n return (\n \n \n \n {rtl ? rightArrowIcon : leftArrowIcon}\n \n\n \n \n {utils.getCalendarHeaderText(currentMonth)}\n \n \n\n \n {rtl ? leftArrowIcon : rightArrowIcon}\n \n \n\n \n {utils.getWeekdays().map((day, index) => (\n \n {day}\n \n ))}\n \n \n );\n};\n\nCalendarHeader.displayName = 'CalendarHeader';\n\nCalendarHeader.propTypes = {\n leftArrowIcon: PropTypes.node,\n rightArrowIcon: PropTypes.node,\n disablePrevMonth: PropTypes.bool,\n disableNextMonth: PropTypes.bool,\n};\n\nCalendarHeader.defaultProps = {\n leftArrowIcon: ,\n rightArrowIcon: ,\n disablePrevMonth: false,\n disableNextMonth: false,\n};\n\nexport default CalendarHeader;\n","import React from 'react';\nimport SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon';\n\nexport const ArrowLeftIcon: React.SFC = props => {\n return (\n \n \n \n \n );\n};\n","import React from 'react';\nimport SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon';\n\nexport const ArrowRightIcon: React.SFC = props => {\n return (\n \n \n \n \n );\n};\n","import * as React from 'react';\nimport { Omit } from '../_helpers/utils';\nimport { useUtils } from './hooks/useUtils';\nimport { IUtils } from '@date-io/core/IUtils';\nimport { MaterialUiPickersDate } from '../typings/date';\n\nexport interface WithUtilsProps {\n utils: IUtils;\n}\n\nexport const withUtils = () => (Component: React.ComponentType ) => {\n const WithUtils: React.SFC> = props => {\n const utils = useUtils();\n return ;\n };\n\n WithUtils.displayName = `WithUtils(${Component.displayName || Component.name})`;\n return WithUtils;\n};\n","import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport Day from './Day';\nimport DayWrapper from './DayWrapper';\nimport CalendarHeader from './CalendarHeader';\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport SlideTransition, { SlideDirection } from './SlideTransition';\nimport { Theme } from '@material-ui/core/styles';\nimport { VariantContext } from '../../wrappers/Wrapper';\nimport { MaterialUiPickersDate } from '../../typings/date';\nimport { runKeyHandler } from '../../_shared/hooks/useKeyDown';\nimport { IconButtonProps } from '@material-ui/core/IconButton';\nimport { withStyles, WithStyles } from '@material-ui/core/styles';\nimport { findClosestEnabledDate } from '../../_helpers/date-utils';\nimport { withUtils, WithUtilsProps } from '../../_shared/WithUtils';\n\nexport interface OutterCalendarProps {\n /** Left arrow icon */\n leftArrowIcon?: React.ReactNode;\n /** Right arrow icon */\n rightArrowIcon?: React.ReactNode;\n /** Custom renderer for day @DateIOType */\n renderDay?: (\n day: MaterialUiPickersDate,\n selectedDate: MaterialUiPickersDate,\n dayInCurrentMonth: boolean,\n dayComponent: JSX.Element\n ) => JSX.Element;\n /**\n * Enables keyboard listener for moving between days in calendar\n * @default true\n */\n allowKeyboardControl?: boolean;\n /**\n * Props to pass to left arrow button\n * @type {Partial}\n */\n leftArrowButtonProps?: Partial;\n /**\n * Props to pass to right arrow button\n * @type {Partial}\n */\n rightArrowButtonProps?: Partial;\n /** Disable specific date @DateIOType */\n shouldDisableDate?: (day: MaterialUiPickersDate) => boolean;\n /** Callback firing on month change. Return promise to render spinner till it will not be resolved @DateIOType */\n onMonthChange?: (date: MaterialUiPickersDate) => void | Promise;\n /** Custom loading indicator */\n loadingIndicator?: JSX.Element;\n}\n\nexport interface CalendarProps\n extends OutterCalendarProps,\n WithUtilsProps,\n WithStyles {\n /** Calendar Date @DateIOType */\n date: MaterialUiPickersDate;\n /** Calendar onChange */\n onChange: (date: MaterialUiPickersDate, isFinish?: boolean) => void;\n /** Min date @DateIOType */\n minDate?: MaterialUiPickersDate;\n /** Max date @DateIOType */\n maxDate?: MaterialUiPickersDate;\n /** Disable past dates */\n disablePast?: boolean;\n /** Disable future dates */\n disableFuture?: boolean;\n}\n\nexport interface CalendarState {\n slideDirection: SlideDirection;\n currentMonth: MaterialUiPickersDate;\n lastDate?: MaterialUiPickersDate;\n loadingQueue: number;\n}\n\nconst KeyDownListener = ({ onKeyDown }: { onKeyDown: (e: KeyboardEvent) => void }) => {\n React.useEffect(() => {\n window.addEventListener('keydown', onKeyDown);\n return () => {\n window.removeEventListener('keydown', onKeyDown);\n };\n }, [onKeyDown]);\n\n return null;\n};\n\nexport class Calendar extends React.Component {\n static contextType = VariantContext;\n static propTypes: any = {\n renderDay: PropTypes.func,\n shouldDisableDate: PropTypes.func,\n allowKeyboardControl: PropTypes.bool,\n };\n\n static defaultProps: Partial = {\n minDate: new Date('1900-01-01'),\n maxDate: new Date('2100-01-01'),\n disablePast: false,\n disableFuture: false,\n allowKeyboardControl: true,\n };\n\n static getDerivedStateFromProps(nextProps: CalendarProps, state: CalendarState) {\n const { utils, date: nextDate } = nextProps;\n\n if (!utils.isEqual(nextDate, state.lastDate)) {\n const nextMonth = utils.getMonth(nextDate);\n const lastDate = state.lastDate || nextDate;\n const lastMonth = utils.getMonth(lastDate);\n\n return {\n lastDate: nextDate,\n currentMonth: nextProps.utils.startOfMonth(nextDate),\n // prettier-ignore\n slideDirection: nextMonth === lastMonth\n ? state.slideDirection\n : utils.isAfterDay(nextDate, lastDate)\n ? 'left'\n : 'right'\n };\n }\n\n return null;\n }\n\n state: CalendarState = {\n slideDirection: 'left',\n currentMonth: this.props.utils.startOfMonth(this.props.date),\n loadingQueue: 0,\n };\n\n componentDidMount() {\n const { date, minDate, maxDate, utils, disablePast, disableFuture } = this.props;\n\n if (this.shouldDisableDate(date)) {\n const closestEnabledDate = findClosestEnabledDate({\n date,\n utils,\n minDate: utils.date(minDate),\n maxDate: utils.date(maxDate),\n disablePast: Boolean(disablePast),\n disableFuture: Boolean(disableFuture),\n shouldDisableDate: this.shouldDisableDate,\n });\n\n this.handleDaySelect(closestEnabledDate, false);\n }\n }\n\n private pushToLoadingQueue = () => {\n const loadingQueue = this.state.loadingQueue + 1;\n this.setState({ loadingQueue });\n };\n\n private popFromLoadingQueue = () => {\n let loadingQueue = this.state.loadingQueue;\n loadingQueue = loadingQueue <= 0 ? 0 : loadingQueue - 1;\n this.setState({ loadingQueue });\n };\n\n handleChangeMonth = (newMonth: MaterialUiPickersDate, slideDirection: SlideDirection) => {\n this.setState({ currentMonth: newMonth, slideDirection });\n\n if (this.props.onMonthChange) {\n const returnVal = this.props.onMonthChange(newMonth);\n if (returnVal) {\n this.pushToLoadingQueue();\n returnVal.then(() => {\n this.popFromLoadingQueue();\n });\n }\n }\n };\n\n validateMinMaxDate = (day: MaterialUiPickersDate) => {\n const { minDate, maxDate, utils, disableFuture, disablePast } = this.props;\n const now = utils.date();\n\n return Boolean(\n (disableFuture && utils.isAfterDay(day, now)) ||\n (disablePast && utils.isBeforeDay(day, now)) ||\n (minDate && utils.isBeforeDay(day, utils.date(minDate))) ||\n (maxDate && utils.isAfterDay(day, utils.date(maxDate)))\n );\n };\n\n shouldDisablePrevMonth = () => {\n const { utils, disablePast, minDate } = this.props;\n\n const now = utils.date();\n const firstEnabledMonth = utils.startOfMonth(\n disablePast && utils.isAfter(now, utils.date(minDate)) ? now : utils.date(minDate)\n );\n\n return !utils.isBefore(firstEnabledMonth, this.state.currentMonth);\n };\n\n shouldDisableNextMonth = () => {\n const { utils, disableFuture, maxDate } = this.props;\n\n const now = utils.date();\n const lastEnabledMonth = utils.startOfMonth(\n disableFuture && utils.isBefore(now, utils.date(maxDate)) ? now : utils.date(maxDate)\n );\n\n return !utils.isAfter(lastEnabledMonth, this.state.currentMonth);\n };\n\n shouldDisableDate = (day: MaterialUiPickersDate) => {\n const { shouldDisableDate } = this.props;\n\n return this.validateMinMaxDate(day) || Boolean(shouldDisableDate && shouldDisableDate(day));\n };\n\n handleDaySelect = (day: MaterialUiPickersDate, isFinish = true) => {\n const { date, utils } = this.props;\n\n this.props.onChange(utils.mergeDateAndTime(day, date), isFinish);\n };\n\n moveToDay = (day: MaterialUiPickersDate) => {\n const { utils } = this.props;\n\n if (day && !this.shouldDisableDate(day)) {\n if (utils.getMonth(day) !== utils.getMonth(this.state.currentMonth)) {\n this.handleChangeMonth(utils.startOfMonth(day), 'left');\n }\n\n this.handleDaySelect(day, false);\n }\n };\n\n handleKeyDown = (event: KeyboardEvent) => {\n const { theme, date, utils } = this.props;\n\n runKeyHandler(event, {\n ArrowUp: () => this.moveToDay(utils.addDays(date, -7)),\n ArrowDown: () => this.moveToDay(utils.addDays(date, 7)),\n ArrowLeft: () => this.moveToDay(utils.addDays(date, theme.direction === 'ltr' ? -1 : 1)),\n ArrowRight: () => this.moveToDay(utils.addDays(date, theme.direction === 'ltr' ? 1 : -1)),\n });\n };\n\n private renderWeeks = () => {\n const { utils, classes } = this.props;\n const weeks = utils.getWeekArray(this.state.currentMonth);\n\n return weeks.map(week => (\n \n {this.renderDays(week)}\n \n ));\n };\n\n private renderDays = (week: MaterialUiPickersDate[]) => {\n const { date, renderDay, utils } = this.props;\n\n const now = utils.date();\n const selectedDate = utils.startOfDay(date);\n const currentMonthNumber = utils.getMonth(this.state.currentMonth);\n\n return week.map(day => {\n const disabled = this.shouldDisableDate(day);\n const isDayInCurrentMonth = utils.getMonth(day) === currentMonthNumber;\n\n let dayComponent = (\n \n {utils.getDayText(day)}\n \n );\n\n if (renderDay) {\n dayComponent = renderDay(day, selectedDate, isDayInCurrentMonth, dayComponent);\n }\n\n return (\n \n {dayComponent}\n \n );\n });\n };\n\n render() {\n const { currentMonth, slideDirection } = this.state;\n const {\n classes,\n allowKeyboardControl,\n leftArrowButtonProps,\n leftArrowIcon,\n rightArrowButtonProps,\n rightArrowIcon,\n loadingIndicator,\n } = this.props;\n const loadingElement = loadingIndicator ? loadingIndicator : ;\n\n return (\n \n {allowKeyboardControl && this.context !== 'static' && (\n \n )}\n\n \n\n \n <>\n {(this.state.loadingQueue > 0 && (\n {loadingElement} \n )) || {this.renderWeeks()} }\n >\n \n \n );\n }\n}\n\nexport const styles = (theme: Theme) => ({\n transitionContainer: {\n minHeight: 36 * 6,\n marginTop: theme.spacing(1.5),\n },\n progressContainer: {\n width: '100%',\n height: '100%',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n },\n week: {\n display: 'flex',\n justifyContent: 'center',\n },\n});\n\nexport default withStyles(styles, {\n name: 'MuiPickersCalendar',\n withTheme: true,\n})(withUtils()(Calendar));\n","enum ClockType {\n HOURS = 'hours',\n\n MINUTES = 'minutes',\n\n SECONDS = 'seconds',\n}\n\nexport type ClockViewType = 'hours' | 'minutes' | 'seconds';\n\nexport default ClockType;\n","import * as React from 'react';\nimport clsx from 'clsx';\nimport ClockType, { ClockViewType } from '../../constants/ClockType';\nimport { Theme } from '@material-ui/core/styles';\nimport { withStyles, createStyles, WithStyles } from '@material-ui/core/styles';\n\nexport interface ClockPointerProps extends WithStyles {\n value: number;\n hasSelected: boolean;\n isInner: boolean;\n type: ClockViewType;\n}\n\nexport class ClockPointer extends React.Component {\n public static getDerivedStateFromProps = (\n nextProps: ClockPointerProps,\n state: ClockPointer['state']\n ) => {\n if (nextProps.type !== state.previousType) {\n return {\n toAnimateTransform: true,\n previousType: nextProps.type,\n };\n }\n\n return {\n toAnimateTransform: false,\n previousType: nextProps.type,\n };\n };\n\n public state = {\n toAnimateTransform: false,\n previousType: undefined,\n };\n\n public getAngleStyle = () => {\n const { value, isInner, type } = this.props;\n\n const max = type === ClockType.HOURS ? 12 : 60;\n let angle = (360 / max) * value;\n\n if (type === ClockType.HOURS && value > 12) {\n angle -= 360; // round up angle to max 360 degrees\n }\n\n return {\n height: isInner ? '26%' : '40%',\n transform: `rotateZ(${angle}deg)`,\n };\n };\n\n public render() {\n const { classes, hasSelected } = this.props;\n\n return (\n \n );\n }\n}\n\nexport const styles = (theme: Theme) =>\n createStyles({\n pointer: {\n width: 2,\n backgroundColor: theme.palette.primary.main,\n position: 'absolute',\n left: 'calc(50% - 1px)',\n bottom: '50%',\n transformOrigin: 'center bottom 0px',\n },\n animateTransform: {\n transition: theme.transitions.create(['transform', 'height']),\n },\n thumb: {\n width: 4,\n height: 4,\n backgroundColor: theme.palette.primary.contrastText,\n borderRadius: '100%',\n position: 'absolute',\n top: -21,\n left: -15,\n border: `14px solid ${theme.palette.primary.main}`,\n boxSizing: 'content-box',\n },\n noPoint: {\n backgroundColor: theme.palette.primary.main,\n },\n });\n\nexport default withStyles(styles, {\n name: 'MuiPickersClockPointer',\n})(ClockPointer as React.ComponentType);\n","import { IUtils } from '@date-io/core/IUtils';\nimport { MaterialUiPickersDate } from '../typings/date';\n\nconst center = {\n x: 260 / 2,\n y: 260 / 2,\n};\n\nconst basePoint = {\n x: center.x,\n y: 0,\n};\n\nconst cx = basePoint.x - center.x;\nconst cy = basePoint.y - center.y;\n\nconst rad2deg = (rad: number) => rad * 57.29577951308232;\n\nconst getAngleValue = (step: number, offsetX: number, offsetY: number) => {\n const x = offsetX - center.x;\n const y = offsetY - center.y;\n\n const atan = Math.atan2(cx, cy) - Math.atan2(x, y);\n\n let deg = rad2deg(atan);\n deg = Math.round(deg / step) * step;\n deg %= 360;\n\n const value = Math.floor(deg / step) || 0;\n const delta = Math.pow(x, 2) + Math.pow(y, 2);\n const distance = Math.sqrt(delta);\n\n return { value, distance };\n};\n\nexport const getHours = (offsetX: number, offsetY: number, ampm: boolean) => {\n let { value, distance } = getAngleValue(30, offsetX, offsetY);\n value = value || 12;\n\n if (!ampm) {\n if (distance < 90) {\n value += 12;\n value %= 24;\n }\n } else {\n value %= 12;\n }\n\n return value;\n};\n\nexport const getMinutes = (offsetX: number, offsetY: number, step = 1) => {\n const angleStep = step * 6;\n let { value } = getAngleValue(angleStep, offsetX, offsetY);\n value = (value * step) % 60;\n\n return value;\n};\n\nexport const getMeridiem = (\n date: MaterialUiPickersDate,\n utils: IUtils\n): 'am' | 'pm' => {\n return utils.getHours(date) >= 12 ? 'pm' : 'am';\n};\n\nexport const convertToMeridiem = (\n time: MaterialUiPickersDate,\n meridiem: 'am' | 'pm',\n ampm: boolean,\n utils: IUtils\n) => {\n if (ampm) {\n const currentMeridiem = utils.getHours(time) >= 12 ? 'pm' : 'am';\n if (currentMeridiem !== meridiem) {\n const hours = meridiem === 'am' ? utils.getHours(time) - 12 : utils.getHours(time) + 12;\n\n return utils.setHours(time, hours);\n }\n }\n\n return time;\n};\n","import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport ClockPointer from './ClockPointer';\nimport ClockType, { ClockViewType } from '../../constants/ClockType';\nimport { getHours, getMinutes } from '../../_helpers/time-utils';\nimport { withStyles, createStyles, WithStyles, Theme } from '@material-ui/core/styles';\n\nexport interface ClockProps extends WithStyles {\n type: ClockViewType;\n value: number;\n onChange: (value: number, isFinish?: boolean) => void;\n ampm?: boolean;\n minutesStep?: number;\n children: React.ReactElement[];\n}\n\nexport class Clock extends React.Component {\n public static propTypes: any = {\n type: PropTypes.oneOf(\n Object.keys(ClockType).map(key => ClockType[key as keyof typeof ClockType])\n ).isRequired,\n value: PropTypes.number.isRequired,\n onChange: PropTypes.func.isRequired,\n children: PropTypes.arrayOf(PropTypes.node).isRequired,\n ampm: PropTypes.bool,\n minutesStep: PropTypes.number,\n innerRef: PropTypes.any,\n };\n\n public static defaultProps = {\n ampm: false,\n minutesStep: 1,\n };\n\n public isMoving = false;\n\n public setTime(e: any, isFinish = false) {\n let { offsetX, offsetY } = e;\n\n if (typeof offsetX === 'undefined') {\n const rect = e.target.getBoundingClientRect();\n\n offsetX = e.changedTouches[0].clientX - rect.left;\n offsetY = e.changedTouches[0].clientY - rect.top;\n }\n\n const value =\n this.props.type === ClockType.SECONDS || this.props.type === ClockType.MINUTES\n ? getMinutes(offsetX, offsetY, this.props.minutesStep)\n : getHours(offsetX, offsetY, Boolean(this.props.ampm));\n\n this.props.onChange(value, isFinish);\n }\n\n public handleTouchMove = (e: React.TouchEvent) => {\n this.isMoving = true;\n this.setTime(e);\n };\n\n public handleTouchEnd = (e: React.TouchEvent) => {\n if (this.isMoving) {\n this.setTime(e, true);\n this.isMoving = false;\n }\n };\n\n public handleMove = (e: React.MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n // MouseEvent.which is deprecated, but MouseEvent.buttons is not supported in Safari\n const isButtonPressed =\n typeof e.buttons === 'undefined' ? e.nativeEvent.which === 1 : e.buttons === 1;\n\n if (isButtonPressed) {\n this.setTime(e.nativeEvent, false);\n }\n };\n\n public handleMouseUp = (e: React.MouseEvent) => {\n if (this.isMoving) {\n this.isMoving = false;\n }\n\n this.setTime(e.nativeEvent, true);\n };\n\n public hasSelected = () => {\n const { type, value } = this.props;\n\n if (type === ClockType.HOURS) {\n return true;\n }\n\n return value % 5 === 0;\n };\n\n public render() {\n const { classes, value, children, type, ampm } = this.props;\n\n const isPointerInner = !ampm && type === ClockType.HOURS && (value < 1 || value > 12);\n\n return (\n \n \n \n\n \n\n \n\n {children}\n \n \n );\n }\n}\n\nexport const styles = (theme: Theme) =>\n createStyles({\n container: {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'flex-end',\n margin: `${theme.spacing(2)}px 0 ${theme.spacing(1)}px`,\n },\n clock: {\n backgroundColor: 'rgba(0,0,0,.07)',\n borderRadius: '50%',\n height: 260,\n width: 260,\n position: 'relative',\n pointerEvents: 'none',\n },\n squareMask: {\n width: '100%',\n height: '100%',\n position: 'absolute',\n pointerEvents: 'auto',\n outline: 'none',\n touchActions: 'none',\n userSelect: 'none',\n '&:active': {\n cursor: 'move',\n },\n },\n pin: {\n width: 6,\n height: 6,\n borderRadius: '50%',\n backgroundColor: theme.palette.primary.main,\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n },\n });\n\nexport default withStyles(styles, {\n name: 'MuiPickersClock',\n})(Clock as React.ComponentType);\n","import * as React from 'react';\nimport clsx from 'clsx';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\n\nconst positions: Record = {\n 0: [0, 40],\n 1: [55, 19.6],\n 2: [94.4, 59.5],\n 3: [109, 114],\n 4: [94.4, 168.5],\n 5: [54.5, 208.4],\n 6: [0, 223],\n 7: [-54.5, 208.4],\n 8: [-94.4, 168.5],\n 9: [-109, 114],\n 10: [-94.4, 59.5],\n 11: [-54.5, 19.6],\n 12: [0, 5],\n 13: [36.9, 49.9],\n 14: [64, 77],\n 15: [74, 114],\n 16: [64, 151],\n 17: [37, 178],\n 18: [0, 188],\n 19: [-37, 178],\n 20: [-64, 151],\n 21: [-74, 114],\n 22: [-64, 77],\n 23: [-37, 50],\n};\n\nexport interface ClockNumberProps {\n index: number;\n label: string;\n selected: boolean;\n isInner?: boolean;\n}\n\nexport const useStyles = makeStyles(\n theme => {\n const size = theme.spacing(4);\n\n return {\n clockNumber: {\n width: size,\n height: 32,\n userSelect: 'none',\n position: 'absolute',\n left: `calc((100% - ${typeof size === 'number' ? `${size}px` : size}) / 2)`,\n display: 'inline-flex',\n justifyContent: 'center',\n alignItems: 'center',\n borderRadius: '50%',\n color:\n theme.palette.type === 'light' ? theme.palette.text.primary : theme.palette.text.hint,\n },\n clockNumberSelected: {\n color: theme.palette.primary.contrastText,\n },\n };\n },\n { name: 'MuiPickersClockNumber' }\n);\n\nexport const ClockNumber: React.FC = ({ selected, label, index, isInner }) => {\n const classes = useStyles();\n const className = clsx(classes.clockNumber, {\n [classes.clockNumberSelected]: selected,\n });\n\n const transformStyle = React.useMemo(() => {\n const position = positions[index];\n\n return {\n transform: `translate(${position[0]}px, ${position[1]}px`,\n };\n }, [index]);\n\n return (\n \n );\n};\n\nexport default ClockNumber;\n","import * as React from 'react';\nimport ClockNumber from './ClockNumber';\nimport { IUtils } from '@date-io/core/IUtils';\nimport { MaterialUiPickersDate } from '../../typings/date';\n\nexport const getHourNumbers = ({\n ampm,\n utils,\n date,\n}: {\n ampm: boolean;\n utils: IUtils;\n date: MaterialUiPickersDate;\n}) => {\n const currentHours = utils.getHours(date);\n\n const hourNumbers: JSX.Element[] = [];\n const startHour = ampm ? 1 : 0;\n const endHour = ampm ? 12 : 23;\n\n const isSelected = (hour: number) => {\n if (ampm) {\n if (hour === 12) {\n return currentHours === 12 || currentHours === 0;\n }\n\n return currentHours === hour || currentHours - 12 === hour;\n }\n\n return currentHours === hour;\n };\n\n for (let hour = startHour; hour <= endHour; hour += 1) {\n let label = hour.toString();\n\n if (hour === 0) {\n label = '00';\n }\n\n const props = {\n index: hour,\n label: utils.formatNumber(label),\n selected: isSelected(hour),\n isInner: !ampm && (hour === 0 || hour > 12),\n };\n\n hourNumbers.push();\n }\n\n return hourNumbers;\n};\n\nexport const getMinutesNumbers = ({\n value,\n utils,\n}: {\n value: number;\n utils: IUtils;\n}) => {\n const f = utils.formatNumber;\n\n return [\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ,\n ];\n};\n","import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport Clock from './Clock';\nimport ClockType from '../../constants/ClockType';\nimport { useUtils } from '../../_shared/hooks/useUtils';\nimport { MaterialUiPickersDate } from '../../typings/date';\nimport { getHourNumbers, getMinutesNumbers } from './ClockNumbers';\nimport { convertToMeridiem, getMeridiem } from '../../_helpers/time-utils';\n\nexport interface TimePickerViewProps {\n /** TimePicker value */\n date: MaterialUiPickersDate;\n /** Clock type */\n type: 'hours' | 'minutes' | 'seconds';\n /** 12h/24h clock mode */\n ampm?: boolean;\n /** Minutes step */\n minutesStep?: number;\n /** On hour change */\n onHourChange: (date: MaterialUiPickersDate, isFinish?: boolean) => void;\n /** On minutes change */\n onMinutesChange: (date: MaterialUiPickersDate, isFinish?: boolean) => void;\n /** On seconds change */\n onSecondsChange: (date: MaterialUiPickersDate, isFinish?: boolean) => void;\n}\n\nexport const ClockView: React.FC = ({\n type,\n onHourChange,\n onMinutesChange,\n onSecondsChange,\n ampm,\n date,\n minutesStep,\n}) => {\n const utils = useUtils();\n const viewProps = React.useMemo(() => {\n switch (type) {\n case ClockType.HOURS:\n return {\n value: utils.getHours(date),\n children: getHourNumbers({ date, utils, ampm: Boolean(ampm) }),\n onChange: (value: number, isFinish?: boolean) => {\n const currentMeridiem = getMeridiem(date, utils);\n const updatedTimeWithMeridiem = convertToMeridiem(\n utils.setHours(date, value),\n currentMeridiem,\n Boolean(ampm),\n utils\n );\n\n onHourChange(updatedTimeWithMeridiem, isFinish);\n },\n };\n\n case ClockType.MINUTES:\n const minutesValue = utils.getMinutes(date);\n return {\n value: minutesValue,\n children: getMinutesNumbers({ value: minutesValue, utils }),\n onChange: (value: number, isFinish?: boolean) => {\n const updatedTime = utils.setMinutes(date, value);\n\n onMinutesChange(updatedTime, isFinish);\n },\n };\n\n case ClockType.SECONDS:\n const secondsValue = utils.getSeconds(date);\n return {\n value: secondsValue,\n children: getMinutesNumbers({ value: secondsValue, utils }),\n onChange: (value: number, isFinish?: boolean) => {\n const updatedTime = utils.setSeconds(date, value);\n\n onSecondsChange(updatedTime, isFinish);\n },\n };\n\n default:\n throw new Error('You must provide the type for TimePickerView');\n }\n }, [ampm, date, onHourChange, onMinutesChange, onSecondsChange, type, utils]);\n\n return ;\n};\n\nClockView.displayName = 'TimePickerView';\n\nClockView.propTypes = {\n date: PropTypes.object.isRequired,\n onHourChange: PropTypes.func.isRequired,\n onMinutesChange: PropTypes.func.isRequired,\n onSecondsChange: PropTypes.func.isRequired,\n ampm: PropTypes.bool,\n minutesStep: PropTypes.number,\n type: PropTypes.oneOf(Object.keys(ClockType).map(key => ClockType[key as keyof typeof ClockType]))\n .isRequired,\n} as any;\n\nClockView.defaultProps = {\n ampm: true,\n minutesStep: 1,\n};\n\nexport default React.memo(ClockView);\n","import * as PropTypes from 'prop-types';\nimport { BaseTimePickerProps } from '../TimePicker/TimePicker';\nimport { BaseDatePickerProps } from '../DatePicker/DatePicker';\n\nconst date = PropTypes.oneOfType([\n PropTypes.object,\n PropTypes.string,\n PropTypes.number,\n PropTypes.instanceOf(Date),\n]);\n\nconst datePickerView = PropTypes.oneOf(['year', 'month', 'day']);\n\nexport type ParsableDate = object | string | number | Date | null | undefined;\n\nexport const DomainPropTypes = { date, datePickerView };\n\n/* eslint-disable @typescript-eslint/no-object-literal-type-assertion */\nexport const timePickerDefaultProps = {\n ampm: true,\n invalidDateMessage: 'Invalid Time Format',\n} as BaseTimePickerProps;\n\nexport const datePickerDefaultProps = {\n minDate: new Date('1900-01-01'),\n maxDate: new Date('2100-01-01'),\n invalidDateMessage: 'Invalid Date Format',\n minDateMessage: 'Date should not be before minimal date',\n maxDateMessage: 'Date should not be after maximal date',\n allowKeyboardControl: true,\n} as BaseDatePickerProps;\n\nexport const dateTimePickerDefaultProps = {\n ...timePickerDefaultProps,\n ...datePickerDefaultProps,\n showTabs: true,\n} as BaseTimePickerProps & BaseDatePickerProps;\n","import * as React from 'react';\nimport clsx from 'clsx';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\n\nexport interface YearProps {\n children: React.ReactNode;\n disabled?: boolean;\n onSelect: (value: any) => void;\n selected?: boolean;\n value: any;\n forwardedRef?: React.Ref;\n}\n\nexport const useStyles = makeStyles(\n theme => ({\n root: {\n height: 40,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n cursor: 'pointer',\n outline: 'none',\n '&:focus': {\n color: theme.palette.primary.main,\n fontWeight: theme.typography.fontWeightMedium,\n },\n },\n yearSelected: {\n margin: '10px 0',\n fontWeight: theme.typography.fontWeightMedium,\n },\n yearDisabled: {\n pointerEvents: 'none',\n color: theme.palette.text.hint,\n },\n }),\n { name: 'MuiPickersYear' }\n);\n\nexport const Year: React.FC = ({\n onSelect,\n forwardedRef,\n value,\n selected,\n disabled,\n children,\n ...other\n}) => {\n const classes = useStyles();\n const handleClick = React.useCallback(() => onSelect(value), [onSelect, value]);\n\n return (\n \n );\n};\n\nYear.displayName = 'Year';\n\nexport default React.forwardRef((props, ref) => (\n \n));\n","import * as React from 'react';\nimport Year from './Year';\nimport { DateType } from '@date-io/type';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useUtils } from '../../_shared/hooks/useUtils';\nimport { VariantContext } from '../../wrappers/Wrapper';\nimport { MaterialUiPickersDate } from '../../typings/date';\n\nexport interface YearSelectionProps {\n date: MaterialUiPickersDate;\n minDate: DateType;\n maxDate: DateType;\n onChange: (date: MaterialUiPickersDate, isFinish: boolean) => void;\n disablePast?: boolean | null | undefined;\n disableFuture?: boolean | null | undefined;\n animateYearScrolling?: boolean | null | undefined;\n onYearChange?: (date: MaterialUiPickersDate) => void;\n}\n\nexport const useStyles = makeStyles(\n {\n container: {\n height: 300,\n overflowY: 'auto',\n },\n },\n { name: 'MuiPickersYearSelection' }\n);\n\nexport const YearSelection: React.FC = ({\n date,\n onChange,\n onYearChange,\n minDate,\n maxDate,\n disablePast,\n disableFuture,\n animateYearScrolling,\n}) => {\n const utils = useUtils();\n const classes = useStyles();\n const currentVariant = React.useContext(VariantContext);\n const selectedYearRef = React.useRef(null);\n\n React.useEffect(() => {\n if (selectedYearRef.current && selectedYearRef.current.scrollIntoView) {\n try {\n selectedYearRef.current.scrollIntoView({\n block: currentVariant === 'static' ? 'nearest' : 'center',\n behavior: animateYearScrolling ? 'smooth' : 'auto',\n });\n } catch (e) {\n // call without arguments in case when scrollIntoView works improperly (e.g. Firefox 52-57)\n selectedYearRef.current.scrollIntoView();\n }\n }\n }, []); // eslint-disable-line\n\n const currentYear = utils.getYear(date);\n const onYearSelect = React.useCallback(\n (year: number) => {\n const newDate = utils.setYear(date, year);\n if (onYearChange) {\n onYearChange(newDate);\n }\n\n onChange(newDate, true);\n },\n [date, onChange, onYearChange, utils]\n );\n\n return (\n \n {utils.getYearRange(minDate, maxDate).map(year => {\n const yearNumber = utils.getYear(year);\n const selected = yearNumber === currentYear;\n\n return (\n \n {utils.getYearText(year)}\n \n );\n })}\n \n );\n};\n","import * as React from 'react';\nimport clsx from 'clsx';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\n\nexport interface MonthProps {\n children: React.ReactNode;\n disabled?: boolean;\n onSelect: (value: any) => void;\n selected?: boolean;\n value: any;\n}\n\nexport const useStyles = makeStyles(\n theme => ({\n root: {\n flex: '1 0 33.33%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n cursor: 'pointer',\n outline: 'none',\n height: 75,\n transition: theme.transitions.create('font-size', { duration: '100ms' }),\n '&:focus': {\n color: theme.palette.primary.main,\n fontWeight: theme.typography.fontWeightMedium,\n },\n },\n monthSelected: {\n color: theme.palette.primary.main,\n fontWeight: theme.typography.fontWeightMedium,\n },\n monthDisabled: {\n pointerEvents: 'none',\n color: theme.palette.text.hint,\n },\n }),\n { name: 'MuiPickersMonth' }\n);\n\nexport const Month: React.FC = ({\n selected,\n onSelect,\n disabled,\n value,\n children,\n ...other\n}) => {\n const classes = useStyles();\n const handleSelection = React.useCallback(() => {\n onSelect(value);\n }, [onSelect, value]);\n\n return (\n \n );\n};\n\nMonth.displayName = 'Month';\n\nexport default Month;\n","import * as React from 'react';\nimport Month from './Month';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useUtils } from '../../_shared/hooks/useUtils';\nimport { ParsableDate } from '../../constants/prop-types';\nimport { MaterialUiPickersDate } from '../../typings/date';\n\nexport interface MonthSelectionProps {\n date: MaterialUiPickersDate;\n minDate?: ParsableDate;\n maxDate?: ParsableDate;\n onChange: (date: MaterialUiPickersDate, isFinish: boolean) => void;\n disablePast?: boolean | null | undefined;\n disableFuture?: boolean | null | undefined;\n onMonthChange?: (date: MaterialUiPickersDate) => void | Promise;\n}\n\nexport const useStyles = makeStyles(\n {\n container: {\n width: 310,\n display: 'flex',\n flexWrap: 'wrap',\n alignContent: 'stretch',\n },\n },\n { name: 'MuiPickersMonthSelection' }\n);\n\nexport const MonthSelection: React.FC = ({\n disablePast,\n disableFuture,\n minDate,\n maxDate,\n date,\n onMonthChange,\n onChange,\n}) => {\n const utils = useUtils();\n const classes = useStyles();\n const currentMonth = utils.getMonth(date);\n\n const shouldDisableMonth = (month: MaterialUiPickersDate) => {\n const now = utils.date();\n const utilMinDate = utils.date(minDate);\n const utilMaxDate = utils.date(maxDate);\n\n const firstEnabledMonth = utils.startOfMonth(\n disablePast && utils.isAfter(now, utilMinDate) ? now : utilMinDate\n );\n\n const lastEnabledMonth = utils.startOfMonth(\n disableFuture && utils.isBefore(now, utilMaxDate) ? now : utilMaxDate\n );\n\n const isBeforeFirstEnabled = utils.isBefore(month, firstEnabledMonth);\n const isAfterLastEnabled = utils.isAfter(month, lastEnabledMonth);\n\n return isBeforeFirstEnabled || isAfterLastEnabled;\n };\n\n const onMonthSelect = React.useCallback(\n (month: number) => {\n const newDate = utils.setMonth(date, month);\n\n onChange(newDate, true);\n if (onMonthChange) {\n onMonthChange(newDate);\n }\n },\n [date, onChange, onMonthChange, utils]\n );\n\n return (\n \n {utils.getMonthArray(date).map(month => {\n const monthNumber = utils.getMonth(month);\n const monthText = utils.format(month, 'MMM');\n\n return (\n \n {monthText}\n \n );\n })}\n \n );\n};\n","import * as React from 'react';\nimport { useIsomorphicEffect } from './useKeyDown';\nimport { BasePickerProps } from '../../typings/BasePicker';\n\nconst getOrientation = () => {\n if (typeof window === 'undefined') {\n return 'portrait';\n }\n\n if (window.screen && window.screen.orientation && window.screen.orientation.angle) {\n return Math.abs(window.screen.orientation.angle) === 90 ? 'landscape' : 'portrait';\n }\n\n // Support IOS safari\n if (window.orientation) {\n return Math.abs(Number(window.orientation)) === 90 ? 'landscape' : 'portrait';\n }\n\n return 'portrait';\n};\n\nexport function useIsLandscape(customOrientation?: BasePickerProps['orientation']) {\n const [orientation, setOrientation] = React.useState(\n getOrientation()\n );\n\n const eventHandler = React.useCallback(() => setOrientation(getOrientation()), []);\n\n useIsomorphicEffect(() => {\n window.addEventListener('orientationchange', eventHandler);\n return () => window.removeEventListener('orientationchange', eventHandler);\n }, [eventHandler]);\n\n const orientationToUse = customOrientation || orientation;\n return orientationToUse === 'landscape';\n}\n","import * as React from 'react';\nimport clsx from 'clsx';\nimport Calendar from '../views/Calendar/Calendar';\nimport { useUtils } from '../_shared/hooks/useUtils';\nimport { useViews } from '../_shared/hooks/useViews';\nimport { ClockView } from '../views/Clock/ClockView';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { YearSelection } from '../views/Year/YearView';\nimport { BasePickerProps } from '../typings/BasePicker';\nimport { MaterialUiPickersDate } from '../typings/date';\nimport { MonthSelection } from '../views/Month/MonthView';\nimport { BaseTimePickerProps } from '../TimePicker/TimePicker';\nimport { BaseDatePickerProps } from '../DatePicker/DatePicker';\nimport { useIsLandscape } from '../_shared/hooks/useIsLandscape';\nimport { datePickerDefaultProps } from '../constants/prop-types';\nimport { DIALOG_WIDTH_WIDER, DIALOG_WIDTH, VIEW_HEIGHT } from '../constants/dimensions';\n\nconst viewsMap = {\n year: YearSelection,\n month: MonthSelection,\n date: Calendar,\n hours: ClockView,\n minutes: ClockView,\n seconds: ClockView,\n};\n\nexport type PickerView = keyof typeof viewsMap;\n\nexport type ToolbarComponentProps = BaseDatePickerProps &\n BaseTimePickerProps & {\n views: PickerView[];\n openView: PickerView;\n date: MaterialUiPickersDate;\n setOpenView: (view: PickerView) => void;\n onChange: (date: MaterialUiPickersDate, isFinish?: boolean) => void;\n // TODO move out, cause it is DateTimePickerOnly\n hideTabs?: boolean;\n dateRangeIcon?: React.ReactNode;\n timeIcon?: React.ReactNode;\n isLandscape: boolean;\n };\n\nexport interface PickerViewProps extends BaseDatePickerProps, BaseTimePickerProps {\n views: PickerView[];\n openTo: PickerView;\n disableToolbar?: boolean;\n ToolbarComponent: React.ComponentType;\n // TODO move out, cause it is DateTimePickerOnly\n hideTabs?: boolean;\n dateRangeIcon?: React.ReactNode;\n timeIcon?: React.ReactNode;\n}\n\ninterface PickerProps extends PickerViewProps {\n date: MaterialUiPickersDate;\n orientation?: BasePickerProps['orientation'];\n onChange: (date: MaterialUiPickersDate, isFinish?: boolean) => void;\n}\n\nconst useStyles = makeStyles(\n {\n container: {\n display: 'flex',\n flexDirection: 'column',\n },\n containerLandscape: {\n flexDirection: 'row',\n },\n pickerView: {\n overflowX: 'hidden',\n minHeight: VIEW_HEIGHT,\n minWidth: DIALOG_WIDTH,\n maxWidth: DIALOG_WIDTH_WIDER,\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center',\n },\n pickerViewLandscape: {\n padding: '0 8px',\n },\n },\n { name: 'MuiPickersBasePicker' }\n);\n\nexport const Picker: React.FunctionComponent = ({\n date,\n views,\n disableToolbar,\n onChange,\n openTo,\n minDate: unparsedMinDate,\n maxDate: unparsedMaxDate,\n ToolbarComponent,\n orientation,\n ...rest\n}) => {\n const utils = useUtils();\n const classes = useStyles();\n const isLandscape = useIsLandscape(orientation);\n const { openView, setOpenView, handleChangeAndOpenNext } = useViews(views, openTo, onChange);\n\n const minDate = React.useMemo(() => utils.date(unparsedMinDate)!, [unparsedMinDate, utils]);\n const maxDate = React.useMemo(() => utils.date(unparsedMaxDate)!, [unparsedMaxDate, utils]);\n\n return (\n \n {!disableToolbar && (\n \n )}\n\n \n {openView === 'year' && (\n \n )}\n\n {openView === 'month' && (\n \n )}\n\n {openView === 'date' && (\n \n )}\n\n {(openView === 'hours' || openView === 'minutes' || openView === 'seconds') && (\n \n )}\n \n \n );\n};\n\nPicker.defaultProps = {\n ...datePickerDefaultProps,\n views: Object.keys(viewsMap),\n} as any;\n","import * as React from 'react';\nimport { PickerView } from '../../Picker/Picker';\nimport { arrayIncludes } from '../../_helpers/utils';\nimport { MaterialUiPickersDate } from '../../typings/date';\n\nexport function useViews(\n views: PickerView[],\n openTo: PickerView,\n onChange: (date: MaterialUiPickersDate, isFinish?: boolean) => void\n) {\n const [openView, setOpenView] = React.useState(\n openTo && arrayIncludes(views, openTo) ? openTo : views[0]\n );\n\n const handleChangeAndOpenNext = React.useCallback(\n (date: MaterialUiPickersDate, isFinish?: boolean) => {\n const nextViewToOpen = views[views.indexOf(openView!) + 1];\n if (isFinish && nextViewToOpen) {\n // do not close picker if needs to show next view\n onChange(date, false);\n setOpenView(nextViewToOpen);\n return;\n }\n\n onChange(date, Boolean(isFinish));\n },\n [onChange, openView, views]\n );\n\n return { handleChangeAndOpenNext, openView, setOpenView };\n}\n","import * as React from 'react';\nimport clsx from 'clsx';\nimport Typography, { TypographyProps } from '@material-ui/core/Typography';\nimport { ExtendMui } from '../typings/extendMui';\nimport { makeStyles, fade } from '@material-ui/core/styles';\n\nexport interface ToolbarTextProps extends ExtendMui {\n selected?: boolean;\n label: string;\n}\n\nexport const useStyles = makeStyles(\n theme => {\n const textColor =\n theme.palette.type === 'light'\n ? theme.palette.primary.contrastText\n : theme.palette.getContrastText(theme.palette.background.default);\n\n return {\n toolbarTxt: {\n color: fade(textColor, 0.54),\n },\n toolbarBtnSelected: {\n color: textColor,\n },\n };\n },\n { name: 'MuiPickersToolbarText' }\n);\n\nconst ToolbarText: React.FunctionComponent = ({\n selected,\n label,\n className = null,\n ...other\n}) => {\n const classes = useStyles();\n return (\n \n );\n};\n\nexport default ToolbarText;\n","import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport ToolbarText from './ToolbarText';\nimport Button, { ButtonProps } from '@material-ui/core/Button';\nimport { ExtendMui } from '../typings/extendMui';\nimport { TypographyProps } from '@material-ui/core/Typography';\nimport { createStyles, withStyles, WithStyles } from '@material-ui/core/styles';\n\nexport interface ToolbarButtonProps\n extends ExtendMui,\n WithStyles {\n variant: TypographyProps['variant'];\n selected: boolean;\n label: string;\n align?: TypographyProps['align'];\n typographyClassName?: string;\n}\n\nconst ToolbarButton: React.FunctionComponent = ({\n classes,\n className = null,\n label,\n selected,\n variant,\n align,\n typographyClassName,\n ...other\n}) => {\n return (\n \n );\n};\n\n(ToolbarButton as any).propTypes = {\n selected: PropTypes.bool.isRequired,\n label: PropTypes.string.isRequired,\n classes: PropTypes.any.isRequired,\n className: PropTypes.string,\n innerRef: PropTypes.any,\n};\n\nToolbarButton.defaultProps = {\n className: '',\n};\n\nexport const styles = createStyles({\n toolbarBtn: {\n padding: 0,\n minWidth: '16px',\n textTransform: 'none',\n },\n});\n\nexport default withStyles(styles, { name: 'MuiPickersToolbarButton' })(ToolbarButton);\n","import * as React from 'react';\nimport clsx from 'clsx';\nimport Toolbar, { ToolbarProps } from '@material-ui/core/Toolbar';\nimport { ExtendMui } from '../typings/extendMui';\nimport { makeStyles } from '@material-ui/core/styles';\n\nexport const useStyles = makeStyles(\n theme => ({\n toolbar: {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n height: 100,\n backgroundColor:\n theme.palette.type === 'light'\n ? theme.palette.primary.main\n : theme.palette.background.default,\n },\n toolbarLandscape: {\n height: 'auto',\n maxWidth: 150,\n padding: 8,\n justifyContent: 'flex-start',\n },\n }),\n { name: 'MuiPickersToolbar' }\n);\n\ninterface PickerToolbarProps extends ExtendMui {\n isLandscape: boolean;\n}\n\nconst PickerToolbar: React.SFC = ({\n children,\n isLandscape,\n className = null,\n ...other\n}) => {\n const classes = useStyles();\n\n return (\n \n {children}\n \n );\n};\n\nexport default PickerToolbar;\n","import * as React from 'react';\nimport TextField, { BaseTextFieldProps, TextFieldProps } from '@material-ui/core/TextField';\nimport { ExtendMui } from '../typings/extendMui';\n\nexport type NotOverridableProps =\n | 'openPicker'\n | 'inputValue'\n | 'onChange'\n | 'format'\n | 'validationError'\n | 'format'\n | 'forwardedRef';\n\nexport interface PureDateInputProps\n extends ExtendMui {\n /** Pass material-ui text field variant down, bypass internal variant prop */\n inputVariant?: TextFieldProps['variant'];\n /** Override input component */\n TextFieldComponent?: React.ComponentType;\n InputProps?: TextFieldProps['InputProps'];\n inputProps?: TextFieldProps['inputProps'];\n onBlur?: TextFieldProps['onBlur'];\n onFocus?: TextFieldProps['onFocus'];\n inputValue: string;\n validationError?: React.ReactNode;\n openPicker: () => void;\n}\n\nexport const PureDateInput: React.FC = ({\n inputValue,\n inputVariant,\n validationError,\n InputProps,\n openPicker: onOpen,\n TextFieldComponent = TextField,\n ...other\n}) => {\n const PureDateInputProps = React.useMemo(\n () => ({\n ...InputProps,\n readOnly: true,\n }),\n [InputProps]\n );\n\n return (\n {\n // space\n if (e.keyCode === 32) {\n e.stopPropagation();\n onOpen();\n }\n }}\n />\n );\n};\n\nPureDateInput.displayName = 'PureDateInput';\n","import React from 'react';\nimport SvgIcon, { SvgIconProps } from '@material-ui/core/SvgIcon';\n\nexport const KeyboardIcon: React.SFC = props => {\n return (\n \n \n \n \n );\n};\n","import { Omit } from './utils';\nimport { DatePickerProps } from '..';\nimport { IUtils } from '@date-io/core/IUtils';\nimport { ParsableDate } from '../constants/prop-types';\nimport { BasePickerProps } from '../typings/BasePicker';\n\nexport const getDisplayDate = (\n value: ParsableDate,\n format: string,\n utils: IUtils,\n isEmpty: boolean,\n { invalidLabel, emptyLabel, labelFunc }: Omit\n) => {\n const date = utils.date(value);\n if (labelFunc) {\n return labelFunc(isEmpty ? null : date, invalidLabel!);\n }\n\n if (isEmpty) {\n return emptyLabel || '';\n }\n\n return utils.isValid(date) ? utils.format(date, format) : invalidLabel!;\n};\n\nexport interface BaseValidationProps {\n /**\n * Message, appearing when date cannot be parsed\n * @default 'Invalid Date Format'\n */\n invalidDateMessage?: React.ReactNode;\n}\n\nexport interface DateValidationProps extends BaseValidationProps {\n /**\n * Error message, shown if date is less then minimal date\n * @default 'Date should not be before minimal date'\n */\n minDateMessage?: React.ReactNode;\n /**\n * Error message, shown if date is more then maximal date\n * @default 'Date should not be after maximal date'\n */\n maxDateMessage?: React.ReactNode;\n}\n\nconst getComparisonMaxDate = (utils: IUtils, strictCompareDates: boolean, date: Date) => {\n if (strictCompareDates) {\n return date;\n }\n\n return utils.endOfDay(date);\n};\n\nconst getComparisonMinDate = (utils: IUtils, strictCompareDates: boolean, date: Date) => {\n if (strictCompareDates) {\n return date;\n }\n\n return utils.startOfDay(date);\n};\n\nexport const validate = (\n value: ParsableDate,\n utils: IUtils,\n {\n maxDate,\n minDate,\n disablePast,\n disableFuture,\n maxDateMessage,\n minDateMessage,\n invalidDateMessage,\n strictCompareDates,\n }: Omit // DateTimePicker doesn't support\n): React.ReactNode => {\n const parsedValue = utils.date(value);\n\n // if null - do not show error\n if (value === null) {\n return '';\n }\n\n if (!utils.isValid(value)) {\n return invalidDateMessage;\n }\n\n if (\n maxDate &&\n utils.isAfter(\n parsedValue,\n getComparisonMaxDate(utils, !!strictCompareDates, utils.date(maxDate))\n )\n ) {\n return maxDateMessage;\n }\n\n if (\n disableFuture &&\n utils.isAfter(parsedValue, getComparisonMaxDate(utils, !!strictCompareDates, utils.date()))\n ) {\n return maxDateMessage;\n }\n\n if (\n minDate &&\n utils.isBefore(\n parsedValue,\n getComparisonMinDate(utils, !!strictCompareDates, utils.date(minDate))\n )\n ) {\n return minDateMessage;\n }\n if (\n disablePast &&\n utils.isBefore(parsedValue, getComparisonMinDate(utils, !!strictCompareDates, utils.date()))\n ) {\n return minDateMessage;\n }\n\n return '';\n};\n\nexport function pick12hOr24hFormat(\n userFormat: string | undefined,\n ampm: boolean | undefined = true,\n formats: { '12h': string; '24h': string }\n) {\n if (userFormat) {\n return userFormat;\n }\n\n return ampm ? formats['12h'] : formats['24h'];\n}\n\nexport function makeMaskFromFormat(format: string, numberMaskChar: string) {\n return format.replace(/[a-z]/gi, numberMaskChar);\n}\n\nexport const maskedDateFormatter = (mask: string, numberMaskChar: string, refuse: RegExp) => (\n value: string\n) => {\n let result = '';\n const parsed = value.replace(refuse, '');\n\n if (parsed === '') {\n return parsed;\n }\n\n let i = 0;\n let n = 0;\n while (i < mask.length) {\n const maskChar = mask[i];\n if (maskChar === numberMaskChar && n < parsed.length) {\n const parsedChar = parsed[n];\n result += parsedChar;\n n += 1;\n } else {\n result += maskChar;\n }\n i += 1;\n }\n\n return result;\n};\n","import * as React from 'react';\nimport IconButton, { IconButtonProps } from '@material-ui/core/IconButton';\nimport InputAdornment, { InputAdornmentProps } from '@material-ui/core/InputAdornment';\nimport TextField, { BaseTextFieldProps, TextFieldProps } from '@material-ui/core/TextField';\nimport { Rifm } from 'rifm';\nimport { ExtendMui } from '../typings/extendMui';\nimport { KeyboardIcon } from './icons/KeyboardIcon';\nimport { makeMaskFromFormat, maskedDateFormatter } from '../_helpers/text-field-helper';\n\nexport interface KeyboardDateInputProps\n extends ExtendMui {\n format: string;\n onChange: (value: string | null) => void;\n openPicker: () => void;\n validationError?: React.ReactNode;\n inputValue: string;\n inputProps?: TextFieldProps['inputProps'];\n InputProps?: TextFieldProps['InputProps'];\n onBlur?: TextFieldProps['onBlur'];\n onFocus?: TextFieldProps['onFocus'];\n /** Override input component */\n TextFieldComponent?: React.ComponentType;\n /** Icon displaying for open picker button */\n keyboardIcon?: React.ReactNode;\n /** Pass material-ui text field variant down, bypass internal variant prop */\n inputVariant?: TextFieldProps['variant'];\n /**\n * Custom mask. Can be used to override generate from format. (e.g. __/__/____ __:__)\n */\n mask?: string;\n /**\n * Char string that will be replaced with number (for \"_\" mask will be \"__/__/____\")\n * @default '_'\n */\n maskChar?: string;\n /**\n * Refuse values regexp\n * @default /[^\\d]+/gi\n */\n refuse?: RegExp;\n /**\n * Props to pass to keyboard input adornment\n * @type {Partial}\n */\n InputAdornmentProps?: Partial;\n /**\n * Props to pass to keyboard adornment button\n * @type {Partial}\n */\n KeyboardButtonProps?: Partial;\n /** Custom formatter to be passed into Rifm component */\n rifmFormatter?: (str: string) => string;\n}\n\nexport const KeyboardDateInput: React.FunctionComponent = ({\n inputValue,\n inputVariant,\n validationError,\n KeyboardButtonProps,\n InputAdornmentProps,\n openPicker: onOpen,\n onChange,\n InputProps,\n mask,\n maskChar = '_',\n refuse = /[^\\d]+/gi,\n format,\n keyboardIcon,\n disabled,\n rifmFormatter,\n TextFieldComponent = TextField,\n ...other\n}) => {\n const inputMask = mask || makeMaskFromFormat(format, maskChar);\n // prettier-ignore\n const formatter = React.useMemo(\n () => maskedDateFormatter(inputMask, maskChar, refuse),\n [inputMask, maskChar, refuse]\n );\n\n const position =\n InputAdornmentProps && InputAdornmentProps.position ? InputAdornmentProps.position : 'end';\n\n const handleChange = (text: string) => {\n const finalString = text === '' || text === inputMask ? null : text;\n onChange(finalString);\n };\n\n return (\n \n {({ onChange, value }) => (\n \n \n {keyboardIcon}\n \n \n ),\n }}\n />\n )}\n \n );\n};\n\nKeyboardDateInput.defaultProps = {\n keyboardIcon: ,\n};\n\nexport default KeyboardDateInput;\n","import { useUtils } from './useUtils';\nimport { IUtils } from '@date-io/core/IUtils';\nimport { useOpenState } from './useOpenState';\nimport { MaterialUiPickersDate } from '../../typings/date';\nimport { BasePickerProps } from '../../typings/BasePicker';\nimport { getDisplayDate, validate } from '../../_helpers/text-field-helper';\nimport { useCallback, useDebugValue, useEffect, useMemo, useState, useRef } from 'react';\n\nexport interface StateHookOptions {\n getDefaultFormat: () => string;\n}\n\nconst useValueToDate = (\n utils: IUtils,\n { value, initialFocusedDate }: BasePickerProps\n) => {\n const nowRef = useRef(utils.date());\n const date = utils.date(value || initialFocusedDate || nowRef.current);\n\n return date && utils.isValid(date) ? date : nowRef.current;\n};\n\nfunction useDateValues(props: BasePickerProps, options: StateHookOptions) {\n const utils = useUtils();\n const date = useValueToDate(utils, props);\n const format = props.format || options.getDefaultFormat();\n\n return { date, format };\n}\n\nexport function usePickerState(props: BasePickerProps, options: StateHookOptions) {\n const { autoOk, disabled, readOnly, onAccept, onChange, onError, value, variant } = props;\n\n const utils = useUtils();\n const { isOpen, setIsOpen } = useOpenState(props);\n const { date, format } = useDateValues(props, options);\n const [pickerDate, setPickerDate] = useState(date);\n\n useEffect(() => {\n // if value was changed in closed state - treat it as accepted\n if (!isOpen && !utils.isEqual(pickerDate, date)) {\n setPickerDate(date);\n }\n }, [date, isOpen, pickerDate, utils]);\n\n const acceptDate = useCallback(\n (acceptedDate: MaterialUiPickersDate) => {\n onChange(acceptedDate);\n if (onAccept) {\n onAccept(acceptedDate);\n }\n\n setIsOpen(false);\n },\n [onAccept, onChange, setIsOpen]\n );\n\n const wrapperProps = useMemo(\n () => ({\n format,\n open: isOpen,\n onClear: () => acceptDate(null),\n onAccept: () => acceptDate(pickerDate),\n onSetToday: () => setPickerDate(utils.date()),\n onDismiss: () => {\n setIsOpen(false);\n },\n }),\n [acceptDate, format, isOpen, pickerDate, setIsOpen, utils]\n );\n\n const pickerProps = useMemo(\n () => ({\n date: pickerDate,\n onChange: (newDate: MaterialUiPickersDate, isFinish = true) => {\n setPickerDate(newDate);\n\n if (isFinish && autoOk) {\n acceptDate(newDate);\n return;\n }\n\n // simulate autoOk, but do not close the modal\n if (variant === 'inline' || variant === 'static') {\n onChange(newDate);\n onAccept && onAccept(newDate);\n }\n },\n }),\n [acceptDate, autoOk, onAccept, onChange, pickerDate, variant]\n );\n\n const validationError = validate(value, utils, props);\n useEffect(() => {\n if (onError) {\n onError(validationError, value);\n }\n }, [onError, validationError, value]);\n\n const inputValue = getDisplayDate(date, format, utils, value === null, props);\n const inputProps = useMemo(\n () => ({\n inputValue,\n validationError,\n openPicker: () => !readOnly && !disabled && setIsOpen(true),\n }),\n [disabled, inputValue, readOnly, setIsOpen, validationError]\n );\n\n const pickerState = { pickerProps, inputProps, wrapperProps };\n\n useDebugValue(pickerState);\n return pickerState;\n}\n","/* eslint-disable react-hooks/rules-of-hooks */\nimport { BasePickerProps } from '../../typings/BasePicker';\nimport { useCallback, useState, Dispatch, SetStateAction } from 'react';\n\nexport function useOpenState({ open, onOpen, onClose }: BasePickerProps) {\n let setIsOpenState: null | Dispatch> = null;\n if (open === undefined || open === null) {\n // The component is uncontrolled, so we need to give it its own state.\n [open, setIsOpenState] = useState(false);\n }\n\n // prettier-ignore\n const setIsOpen = useCallback((newIsOpen: boolean) => {\n setIsOpenState && setIsOpenState(newIsOpen);\n\n return newIsOpen\n ? onOpen && onOpen()\n : onClose && onClose();\n }, [onOpen, onClose, setIsOpenState]);\n\n return { isOpen: open, setIsOpen };\n}\n","import * as React from 'react';\nimport { BasePickerProps } from '../typings/BasePicker';\nimport { Picker, ToolbarComponentProps } from './Picker';\nimport { ExtendWrapper, Wrapper } from '../wrappers/Wrapper';\nimport { PureDateInputProps } from '../_shared/PureDateInput';\nimport { DateValidationProps } from '../_helpers/text-field-helper';\nimport { KeyboardDateInputProps } from '../_shared/KeyboardDateInput';\nimport { StateHookOptions, usePickerState } from '../_shared/hooks/usePickerState';\nimport {\n BaseKeyboardPickerProps,\n useKeyboardPickerState,\n} from '../_shared/hooks/useKeyboardPickerState';\n\nexport type WithKeyboardInputProps = DateValidationProps &\n BaseKeyboardPickerProps &\n ExtendWrapper;\n\nexport type WithPureInputProps = DateValidationProps &\n BasePickerProps &\n ExtendWrapper;\n\nexport interface MakePickerOptions {\n Input: any;\n useState: typeof usePickerState | typeof useKeyboardPickerState;\n useOptions: (props: any) => StateHookOptions;\n getCustomProps?: (props: T) => Partial;\n DefaultToolbarComponent: React.ComponentType;\n}\n\nexport function makePickerWithState({\n Input,\n useState,\n useOptions,\n getCustomProps,\n DefaultToolbarComponent,\n}: MakePickerOptions): React.FC {\n function PickerWithState(props: T) {\n const {\n allowKeyboardControl,\n ampm,\n animateYearScrolling,\n autoOk,\n dateRangeIcon,\n disableFuture,\n disablePast,\n disableToolbar,\n emptyLabel,\n format,\n forwardedRef,\n hideTabs,\n initialFocusedDate,\n invalidDateMessage,\n invalidLabel,\n labelFunc,\n leftArrowButtonProps,\n leftArrowIcon,\n loadingIndicator,\n maxDate,\n maxDateMessage,\n minDate,\n minDateMessage,\n minutesStep,\n onAccept,\n onChange,\n onClose,\n onMonthChange,\n onOpen,\n onYearChange,\n openTo,\n orientation,\n renderDay,\n rightArrowButtonProps,\n rightArrowIcon,\n shouldDisableDate,\n strictCompareDates,\n timeIcon,\n ToolbarComponent = DefaultToolbarComponent,\n value,\n variant,\n views,\n ...other\n } = props;\n\n const injectedProps = getCustomProps ? getCustomProps(props) : {};\n\n const options = useOptions(props);\n const { pickerProps, inputProps, wrapperProps } = useState(props as any, options);\n\n return (\n |