@digitransit-component/digitransit-component-datetimepicker 0.6.21 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("prop-types"),require("react"),require("moment-timezone"),require("lodash/debounce"),require("moment/locale/fi"),require("lodash/uniqueId"),require("i18next"),require("@digitransit-component/digitransit-component-icon"),require("react-select"),require("react-modal"),require("react-autosuggest")):"function"==typeof define&&define.amd?define(["exports","prop-types","react","moment-timezone","lodash/debounce","moment/locale/fi","lodash/uniqueId","i18next","@digitransit-component/digitransit-component-icon","react-select","react-modal","react-autosuggest"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@digitransit-component/digitransit-component-datetimepicker"]={},e.PropTypes,e.React,e.moment,e.debounce,null,e.uniqueId,e.i18next,e.Icon,e.Select,e.ReactModal,e.Autosuggest)}(this,(function(e,t,n,a,i,o,l,r,s,c,d,u){"use strict";function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var _=p(t),m=p(n),f=p(a),y=p(i),b=p(l),g=p(r),h=p(s),v=p(c),x=p(d),w=p(u);function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function E(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}function C(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],a=!0,i=!1,o=void 0;try{for(var l,r=e[Symbol.iterator]();!(a=(l=r.next()).done)&&(n.push(l.value),!t||n.length!==t);a=!0);}catch(e){i=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw o}}return n}}(e,t)||E(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(e){return function(e){if(Array.isArray(e))return k(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||E(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var F={parseTypedTime:function(e){var t=e;return 3===t.length&&t.split("").every((function(e){return Number.isInteger(Number(e))}))&&(t=Number(t.slice(0,2))<=23?"".concat(t.slice(0,2),":").concat(t[2]):"".concat(t[0],":").concat(t.slice(1))),t}};var N={"sr-only":"styles_sr-only__BrzYQ","dt-datetimepicker":"styles_dt-datetimepicker__PtoFG",hidden:"styles_hidden__6ySER","datetimepicker-open-container":"styles_datetimepicker-open-container__1dVr5","top-row-container":"styles_top-row-container__cXGjL",closed:"styles_closed__Fqe1r","time-icon":"styles_time-icon__ntgLZ","dropdown-icon":"styles_dropdown-icon__diYYB","close-icon":"styles_close-icon__-MzK5","label-open":"styles_label-open__Gmvov",textbutton:"styles_textbutton__T7wS2",active:"styles_active__4L82E","combobox-left":"styles_combobox-left__Sp4kh","combobox-right":"styles_combobox-right__Hg8kN","departure-or-arrival-container":"styles_departure-or-arrival-container__pJ-Iw","radio-textbutton-label":"styles_radio-textbutton-label__h-zfy","first-radio":"styles_first-radio__FWNoD","radio-textbutton":"styles_radio-textbutton__tsKET","departure-now-button":"styles_departure-now-button__VKMMK","open-button":"styles_open-button__c2B-6","close-button":"styles_close-button__2mfgI","right-edge":"styles_right-edge__29UYw","combobox-container":"styles_combobox-container__CLY9U","combobox-icon":"styles_combobox-icon__-0XPH","date-input-icon":"styles_date-input-icon__KMrj1","time-input-icon":"styles_time-input-icon__qkhC7","datetimepicker-select-container":"styles_datetimepicker-select-container__EVW1l","picker-container":"styles_picker-container__V02r4","combobox-mobile-container":"styles_combobox-mobile-container__u2DSO","mobile-modal-overlay":"styles_mobile-modal-overlay__8vF8L","mobile-modal-content":"styles_mobile-modal-content__fWRgy","top-row":"styles_top-row__h8xy1","modal-title":"styles_modal-title__EA3YD","tab-row":"styles_tab-row__orgwh","radio-tab-label":"styles_radio-tab-label__vIfup","input-row":"styles_input-row__2XXEY","input-container":"styles_input-container__USZlF","time-input-mobile":"styles_time-input-mobile__6e4A5","mobile-input-display":"styles_mobile-input-display__VUMd0","mobile-input-hidden":"styles_mobile-input-hidden__2KIuK",container:"styles_container__ihyhz",suggestion:"styles_suggestion__ZczJa",suggestionHighlighted:"styles_suggestionHighlighted__fzLiW",suggestionsContainerOpen:"styles_suggestionsContainerOpen__ISHXi",input:"styles_input__PAfbH","buttons-row":"styles_buttons-row__-3wsn","ready-button":"styles_ready-button__dH7Qc"};function S(e){var t=e.value,a=e.onChange,i=e.getDisplay,o=e.timeChoices,l=e.validate,r=e.id,s=e.label,c=e.icon,d=e.disableTyping,u=e.timeZone;f.default.tz.setDefault(u);var p=C(n.useState(i(t)),2),_=p[0],y=p[1],b=C(n.useState(!1),2),g=b[0],h=b[1];n.useEffect((function(){return y(i(t))}),[t]);var x=function(e){var t=Number(e);!Number.isNaN(t)&&f.default(t).isValid()&&f.default(t).valueOf()===t&&a(t)},w=o.map((function(e){return{value:e.toString(),label:i(e)}})),k=w.reduce((function(e,n){return Math.abs(t-e.value)<Math.abs(t-n.value)?e:n})),E="".concat(r,"-input"),R="".concat(r,"-label");return m.default.createElement(m.default.Fragment,null,m.default.createElement("label",{className:N["combobox-container"],htmlFor:E},m.default.createElement("span",{className:N["sr-only"],id:R},s," ",_),c,m.default.createElement(v.default,{"aria-labelledby":R,ariaLiveMessages:{guidance:function(){return"."},onChange:function(){return""},onFilter:function(){return""},onFocus:function(e){var t=e.context,n=e.label;return"menu"===t?n:""}},options:w,inputId:E,onChange:function(e){if(g){var n=l(_,t);null!==n?(x(n),h(!1)):(y(i(t)),h(!1))}else x(e.value)},components:{IndicatorsContainer:function(){return null}},className:N["datetimepicker-select-container"],classNamePrefix:"datetimepicker-select",onInputChange:function(e,t){var n=t.action;if(!d&&"input-change"===n){var a=F.parseTypedTime(e);y(a),h(!0)}},inputValue:!d&&_,value:k,filterOption:function(){return!0},controlShouldRenderValue:d,tabSelectsValue:!1,placeholder:"",onFocus:function(e){d||e.target.select()},onBlur:function(){if(g){var e=l(_,t);null!==e?(x(e),h(!1)):(y(i(t)),h(!1))}},onKeyDown:function(e){["ArrowDown","ArrowUp"].includes(e.key)&&h(!1)},isSearchable:!d})))}!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&a.firstChild?a.insertBefore(i,a.firstChild):a.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}(".styles_sr-only__BrzYQ:not(:focus):not(:active) {\n clip: rect(0 0 0 0);\n -webkit-clip-path: inset(50%);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px; }\n\n.styles_dt-datetimepicker__PtoFG {\n border: none;\n padding: 0;\n margin: 0;\n font-size: 15px;\n font-weight: var(--font-weight-medium); }\n .styles_dt-datetimepicker__PtoFG button, .styles_dt-datetimepicker__PtoFG label {\n font-size: 1em;\n font-weight: inherit; }\n .styles_dt-datetimepicker__PtoFG label button {\n cursor: pointer;\n font-family: 'Gotham Rounded A', 'Gotham Rounded B', 'Roboto', Arial, Georgia, Serif; }\n .styles_dt-datetimepicker__PtoFG .styles_hidden__6ySER {\n display: none; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-open-container__1dVr5 {\n background-color: #f4f4f5;\n border-radius: 5px;\n padding: 15px; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL {\n display: flex;\n flex-wrap: wrap; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL.styles_closed__Fqe1r {\n margin: 11px 0 6px 18px; }\n @media screen and (max-width: 319px) {\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL {\n margin-left: 14px; } }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL .styles_time-icon__ntgLZ svg {\n width: 18px;\n height: 19px; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL .styles_dropdown-icon__diYYB {\n margin-left: 9px;\n position: relative;\n top: 1px; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL .styles_dropdown-icon__diYYB svg {\n width: 14px;\n height: 10px; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL .styles_close-icon__-MzK5 svg {\n width: 12px;\n height: 12px;\n border-radius: 1px; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL .styles_close-icon__-MzK5 svg path {\n stroke-width: 30; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL label {\n cursor: pointer; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL label.styles_label-open__Gmvov {\n align-items: flex-start;\n display: flex; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL button, .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL label {\n font-size: 1em;\n letter-spacing: -0.5px;\n line-height: 1; }\n .styles_dt-datetimepicker__PtoFG .styles_textbutton__T7wS2 {\n margin-left: 9px;\n margin-top: 1px;\n background: none;\n border: none;\n color: #666666;\n padding: 0; }\n @media screen and (min-width: 768px) {\n .styles_dt-datetimepicker__PtoFG .styles_textbutton__T7wS2 {\n margin-left: 14px; } }\n .styles_dt-datetimepicker__PtoFG .styles_textbutton__T7wS2.styles_active__4L82E {\n color: var(--color); }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-left__Sp4kh {\n position: relative;\n margin-right: 4px;\n width: 63%; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-right__Hg8kN {\n position: relative;\n margin-left: 4px;\n width: 37%; }\n .styles_dt-datetimepicker__PtoFG .styles_departure-or-arrival-container__pJ-Iw {\n height: calc(1rem + 20px);\n background-color: #dddddd;\n border-radius: 8px;\n display: flex;\n width: calc(5px + 13em); }\n .styles_dt-datetimepicker__PtoFG .styles_radio-textbutton-label__h-zfy {\n color: #333333;\n margin: 2px;\n background: none;\n border-radius: 6px;\n padding: 9px 0;\n width: 50%;\n cursor: pointer;\n height: calc(1rem + 16px);\n text-align: center;\n font-weight: 400;\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.03em; }\n .styles_dt-datetimepicker__PtoFG .styles_radio-textbutton-label__h-zfy.styles_active__4L82E {\n font-weight: 500;\n background: white; }\n .styles_dt-datetimepicker__PtoFG .styles_radio-textbutton-label__h-zfy:focus-within {\n /* First apply outline that is used in Edge and Firefox */\n outline: 1px dotted #212121;\n /* Then override outline for webkit browsers like Chrome, this has no effect on other browsers */\n outline: 5px auto -webkit-focus-ring-color;\n /* stylelint-disable-line declaration-block-no-duplicate-properties */ }\n .styles_dt-datetimepicker__PtoFG .styles_radio-textbutton-label__h-zfy.styles_first-radio__FWNoD {\n margin: 0;\n display: flex;\n align-items: flex-start; }\n .styles_dt-datetimepicker__PtoFG .styles_radio-textbutton__tsKET {\n clip: rect(0 0 0 0);\n -webkit-clip-path: inset(50%);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px; }\n .styles_dt-datetimepicker__PtoFG .styles_departure-now-button__VKMMK {\n font-family: inherit;\n letter-spacing: -0.02em;\n height: calc(1rem + 18px);\n color: var(--color);\n padding: 8px 0;\n width: 6.6875rem;\n background: white;\n border: 1px solid #888888;\n border-radius: 30px;\n margin-left: 11px; }\n .styles_dt-datetimepicker__PtoFG .styles_open-button__c2B-6 {\n display: flex;\n margin-bottom: 0;\n margin-top: -1px;\n padding: 2px 0 2px 0; }\n .styles_dt-datetimepicker__PtoFG button.styles_close-button__2mfgI {\n transition: transform 0.2s;\n position: relative;\n top: -8px;\n right: -8px;\n border: 0;\n font-weight: normal;\n background: none;\n color: var(--color);\n padding: 0;\n line-height: normal; }\n .styles_dt-datetimepicker__PtoFG button.styles_close-button__2mfgI:hover {\n transform: scale(1.2); }\n .styles_dt-datetimepicker__PtoFG .styles_right-edge__29UYw {\n margin-left: auto;\n margin-right: 0;\n position: relative;\n top: -2px; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-container__CLY9U {\n cursor: pointer; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-icon__-0XPH {\n color: var(--color);\n height: 40px;\n position: absolute;\n z-index: 7;\n pointer-events: none; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-icon__-0XPH.styles_date-input-icon__KMrj1 {\n display: flex;\n align-items: center;\n padding: 0;\n margin-left: 14px; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-icon__-0XPH.styles_date-input-icon__KMrj1 svg {\n width: 20px;\n height: 18px; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-icon__-0XPH.styles_time-input-icon__qkhC7 {\n display: flex;\n align-items: center;\n padding: 0;\n margin-left: 8px; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-icon__-0XPH.styles_time-input-icon__qkhC7 svg {\n margin-top: 1px;\n width: 22px;\n height: 22px; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l {\n position: relative;\n height: 40px; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__control {\n cursor: inherit;\n height: 40px;\n border: 1px solid #888888; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__value-container {\n padding: 0; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__single-value {\n margin: 0 0 0 47px; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__input {\n background: inherit;\n position: relative;\n margin-left: 40px; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__input input {\n opacity: 1 !important;\n background: inherit;\n box-shadow: none;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.33;\n letter-spacing: -0.5px;\n color: #333333;\n font-family: inherit;\n font-size: 15px;\n font-weight: var(--font-weight-medium); }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__input input:focus {\n box-shadow: none;\n outline: none;\n border: none; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__menu {\n z-index: 19;\n padding: 0;\n background: #fff;\n max-height: 250px;\n border-radius: 5px;\n box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.06);\n border: 1px rgba(0, 0, 0, 0.1) solid; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__menu .datetimepicker-select__menu-list {\n max-height: 250px;\n padding: 0; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__menu .datetimepicker-select__menu-list .datetimepicker-select__option {\n height: 50px;\n border-top: 1px solid #dddddd;\n padding: 13px 0 0 12px;\n letter-spacing: -0.6px;\n color: #333333; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__menu .datetimepicker-select__menu-list .datetimepicker-select__option--is-selected {\n background: inherit; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__menu .datetimepicker-select__menu-list .datetimepicker-select__option--is-focused {\n background: #dfe5e8; }\n .styles_dt-datetimepicker__PtoFG .styles_picker-container__V02r4 {\n margin: 14px 0 0 0;\n display: flex; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-mobile-container__u2DSO {\n flex-grow: 1; }\n\n.styles_mobile-modal-overlay__8vF8L {\n position: fixed;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n background-color: rgba(0, 0, 0, 0.6);\n z-index: 1000; }\n\n.styles_mobile-modal-content__fWRgy {\n font-family: 'Gotham Rounded A', 'Gotham Rounded B', 'Roboto', Arial, Georgia, Serif;\n background: white;\n width: 89%;\n position: absolute;\n left: 5.5%;\n padding: 31px 20px 33px 20px;\n top: 80px;\n border-radius: 5px; }\n .styles_mobile-modal-content__fWRgy .styles_top-row__h8xy1 {\n display: flex;\n justify-content: space-between;\n margin-bottom: 21px; }\n .styles_mobile-modal-content__fWRgy .styles_top-row__h8xy1 .styles_modal-title__EA3YD {\n font-weight: var(--font-weight-medium);\n font-size: 20px;\n line-height: 18px;\n letter-spacing: -0.5px;\n color: #333333;\n padding: 6px 0 0 8px; }\n .styles_mobile-modal-content__fWRgy .styles_top-row__h8xy1 .styles_departure-now-button__VKMMK {\n background-color: white;\n font-family: inherit;\n padding: 5px 15px;\n border: 1px solid #888888;\n border-radius: 50px;\n font-weight: var(--font-weight-medium);\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.02em;\n color: var(--color); }\n .styles_mobile-modal-content__fWRgy .styles_tab-row__orgwh {\n display: flex;\n border: 2px solid #dddddd;\n border-radius: 5px;\n margin-bottom: 16px;\n background-color: #dddddd; }\n .styles_mobile-modal-content__fWRgy .styles_tab-row__orgwh .styles_radio-tab-label__vIfup {\n padding: 9px 0;\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.5px;\n border-radius: 3px;\n font-weight: normal;\n width: 50%;\n text-align: center;\n color: #333333; }\n .styles_mobile-modal-content__fWRgy .styles_tab-row__orgwh .styles_radio-tab-label__vIfup.styles_active__4L82E {\n font-weight: var(--font-weight-medium);\n background-color: #ffffff; }\n .styles_mobile-modal-content__fWRgy .styles_tab-row__orgwh .styles_radio-textbutton__tsKET {\n clip: rect(0 0 0 0);\n -webkit-clip-path: inset(50%);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY {\n display: flex;\n margin-bottom: 25px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY label:first-child {\n flex-basis: 60%;\n margin-right: 10px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY label:nth-child(2) {\n flex-basis: 40%; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF {\n border: 1px solid #888888;\n border-radius: 5px;\n display: flex;\n align-items: center;\n height: 40px;\n line-height: 1.5;\n font-size: 100%; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF:focus-within {\n background: rgba(0, 122, 201, 0.06);\n border: 2px solid var(--color); }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_combobox-icon__-0XPH {\n height: 18px;\n font-size: 18px;\n padding: 0 0 0 10px;\n border: none;\n position: relative;\n top: 3px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_combobox-icon__-0XPH.styles_time-input-icon__qkhC7 > svg {\n height: 20px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_time-input-mobile__6e4A5 {\n font-family: inherit;\n box-shadow: none;\n font-size: 18px;\n letter-spacing: -0.5px;\n line-height: 20px;\n font-weight: var(--font-weight-medium);\n border: none;\n outline: none;\n background: none;\n width: 50px;\n margin-left: 10px;\n color: #333333;\n height: 1.5265rem; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_mobile-input-display__VUMd0 {\n position: relative;\n left: 10px;\n border: none;\n background: inherit;\n box-shadow: none;\n font-family: inherit;\n font-weight: var(--font-weight-medium);\n font-stretch: normal;\n font-style: normal;\n font-size: 16px;\n line-height: 1.33;\n letter-spacing: -0.5px;\n color: #333333; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_mobile-input-display__VUMd0:focus {\n outline: none;\n box-shadow: none;\n background: none; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_mobile-input-hidden__2KIuK {\n font-size: 16px;\n margin-bottom: 12px;\n height: 0px;\n width: 0;\n background: inherit;\n color: transparent;\n outline: none;\n box-shadow: none;\n border: none; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_mobile-input-hidden__2KIuK:focus {\n outline: none;\n box-shadow: none; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz {\n position: absolute;\n width: calc((100% - 50px) * 0.6);\n height: 25px;\n font-size: 15px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz .styles_suggestion__ZczJa {\n list-style: none;\n font-size: 16px;\n font-style: normal;\n font-weight: normal;\n line-height: 49px;\n height: 50px;\n margin: 0;\n padding: 0 0 0 16px;\n color: rgba(0, 0, 0, 0.87);\n background: white; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz .styles_suggestionHighlighted__fzLiW {\n background: #dfe5e8; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz .styles_suggestionsContainerOpen__ISHXi {\n position: absolute;\n z-index: 19;\n max-height: 250px;\n overflow-x: hidden;\n overflow-y: scroll;\n border-radius: 5px;\n box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.06);\n border: 1px rgba(0, 0, 0, 0.1) solid;\n top: 42px;\n left: -2px;\n width: 100%;\n font-size: 16px;\n line-height: 1;\n color: rgba(0, 0, 0, 0.87); }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz .styles_suggestionsContainerOpen__ISHXi ul {\n padding: 0;\n margin: 0; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz .styles_input__PAfbH {\n box-shadow: none;\n border: none;\n background: none;\n font-size: 16px;\n font-weight: var(--font-weight-medium);\n height: 25px;\n display: inline-block;\n font-family: inherit;\n line-height: 1.33;\n color: #333333;\n padding-left: 46px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz .styles_input__PAfbH:focus {\n outline: none;\n border: none;\n background: none; }\n .styles_mobile-modal-content__fWRgy .styles_buttons-row__-3wsn {\n display: flex;\n flex-direction: column;\n font-size: 16px;\n font-weight: var(--font-weight-medium); }\n .styles_mobile-modal-content__fWRgy .styles_buttons-row__-3wsn button {\n background-color: white;\n font-family: inherit;\n font-weight: var(--font-weight-medium);\n font-size: 16px;\n letter-spacing: -0.02em;\n width: 100%;\n border-radius: 50px;\n height: 40px;\n color: var(--color);\n border: 1px solid #888888; }\n .styles_mobile-modal-content__fWRgy .styles_buttons-row__-3wsn button.styles_ready-button__dH7Qc {\n color: white;\n background-color: var(--color);\n border: none;\n margin-bottom: 10px; }\n"),"production"!==process.env.NODE_ENV&&(S.propTypes={value:_.default.number.isRequired,onChange:_.default.func.isRequired,getDisplay:_.default.func.isRequired,timeChoices:_.default.arrayOf(_.default.number).isRequired,validate:_.default.func.isRequired,id:_.default.string.isRequired,label:_.default.node.isRequired,icon:_.default.node.isRequired,disableTyping:_.default.bool,timeZone:_.default.string}),S.defaultProps={disableTyping:!1,timeZone:"Europe/Helsinki"};var P={de:{today:"Heute",tomorrow:"Morgen","accessible-close":"Schließe die Auswahl","accessible-closed":"Auswahl geschlossen","accessible-open":"Öffne die Auswahl","accessible-opened":"Auswahl geöffnet","accessible-title":"Datum und Uhrzeitauswahl",arrival:"Ankunft",date:"Datum",departure:"Abfahrt","departure-now":"Abfahrt jetzt","choose-time":"Zeit wählen",ready:"Fertig",time:"Zeit",cancel:"Abbrechen"},en:{today:"Today",tomorrow:"Tomorrow","accessible-close":"Close the picker","accessible-closed":"Timepicker closed","accessible-open":"Open the picker","accessible-opened":"Timepicker opened","accessible-title":"Date and timepicker","accessible-update-instructions":"Changing time parameters will trigger a new search.",arrival:"Arrival",date:"Date",departure:"Departure","departure-now":"Leaving now",time:"Time","choose-time":"Choose time",ready:"Ready",cancel:"Cancel"},fi:{today:"Tänään",tomorrow:"Huomenna","accessible-close":"Sulje valitsin","accessible-closed":"Valitsin suljettu","accessible-open":"Avaa valitsin","accessible-opened":"Valitsin avattu","accessible-title":"Aika- ja päivämäärävalitsin","accessible-update-instructions":"Aikavalintojen muuttaminen laukaisee uuden haun.",arrival:"Perillä",date:"Päivä",departure:"Lähtöaika","departure-now":"Lähtö nyt",time:"Aika","choose-time":"Valitse aika",ready:"Valmis",cancel:"Peruuta"},sv:{today:"I dag",tomorrow:"I morgon","accessible-close":"Stäng väljaren","accessible-closed":"Väljaren stängde","accessible-open":"Öppna väljaren","accessible-opened":"Väljaren öppnade","accessible-title":"Tid- och datumväljaren","accessible-update-instructions":"Om du ändrar tiderna, startas en ny sökning automatiskt.",arrival:"Anländer",date:"Datum",departure:"Avgångstid","departure-now":"Avgår nu",time:"Tid","choose-time":"Välj tid",ready:"Färdig",cancel:"Avbryt"}};function O(e,t){if(null==e)return{};var n,a,i=function(e,t){if(null==e)return{};var n,a,i={},o=Object.keys(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var G=["ref"];function T(e){var t=e.value,a=e.getDisplay,i=e.onChange,o=e.itemCount,l=e.startTime,r=e.id,s=e.label,c=e.icon,d=e.timeZone;f.default.tz.setDefault(d);var u=C(n.useState(!1),2),p=u[0],_=u[1],y=n.useRef(null),b=Array(o).fill().map((function(e,t){return f.default(l).add(t,"day").valueOf()})),g=b.map((function(e){return t-e})).findIndex((function(e){return e<6e4}));n.useLayoutEffect((function(){p&&y.current&&(y.current.scrollTop=50*g)}),[t,p]);var h=!(navigator.userAgent.toLowerCase().indexOf("android")>-1),v="".concat(r,"-input"),x="".concat(r,"-label");return m.default.createElement(m.default.Fragment,null,m.default.createElement("label",{className:N["input-container"],htmlFor:v},m.default.createElement("span",null,c),m.default.createElement("span",{className:N["sr-only"],id:x},s),h?m.default.createElement(m.default.Fragment,null,m.default.createElement("select",{className:N["mobile-input-display"],onChange:function(e){return i(Number(e.target.value))},value:t},b.map((function(e){return m.default.createElement("option",{key:e,value:e},a(e))})))):m.default.createElement(w.default,{id:r,suggestions:b,getSuggestionValue:function(e){return e.toString()},renderSuggestion:function(e){return a(e)},onSuggestionsFetchRequested:function(){return null},shouldRenderSuggestions:function(){return!0},inputProps:{value:a(t),onChange:function(e,t){var n=t.newValue;i(Number(n))},onFocus:function(){_(!0)},onBlur:function(){_(!1)},id:v,"aria-labelledby":x,"aria-autocomplete":"none",readOnly:!0},focusInputOnSuggestionClick:!1,onSuggestionsClearRequested:function(){return null},renderSuggestionsContainer:function(e){var t=e.containerProps,n=e.children,a=t.ref,i=O(t,G);return m.default.createElement("div",Object.assign({tabIndex:"-1"},i,{ref:function(e){e&&(y.current=e,a(e))}}),n)},theme:N})))}function q(e){var t=e.value,a=e.getDisplay,i=e.onChange,o=e.id,l=e.label,r=e.icon,s=e.timeZone,c=e.validate,d=C(n.useState(a(t)),2),u=d[0],p=d[1];f.default.tz.setDefault(s);var _="".concat(o,"-input"),y="".concat(o,"-label"),b=n.useRef(null);return n.useLayoutEffect((function(){b.current&&b.current.focus()}),[]),m.default.createElement(m.default.Fragment,null,m.default.createElement("label",{className:N["input-container"],htmlFor:_},m.default.createElement("span",null,r),m.default.createElement("span",{className:N["sr-only"],id:y},l),m.default.createElement("input",{id:_,inputMode:"numeric",type:"text",maxLength:"6",className:N["time-input-mobile"],value:u,onFocus:function(e){e.target.setSelectionRange(0,0)},onChange:function(e){var n=e.target.value;if(n.match(/[0-9]{3}:[0-9]{2}/)&&n.slice(1)===u&&(n=n.charAt(0)),!(n.length>5)){var a=F.parseTypedTime(n);p(a);var o=c(a,t);o&&i(o)}},ref:b})))}function W(e){var t=e.departureOrArrival,a=e.onNowClick,i=e.lang,o=e.color,l=e.timeZone,r=e.onSubmit,s=e.onCancel,c=e.timestamp,d=e.getTimeDisplay,u=e.dateSelectItemCount,p=e.getDateDisplay,_=e.validateTime,y=e.fontWeights;f.default.tz.setDefault(l);var v={lng:i},w=C(n.useState(c),2),k=w[0],E=w[1],R=C(n.useState(t),2),F=R[0],S=R[1];var P=C(n.useState(b.default("datetimepicker-")),1)[0],O=f.default().startOf("day").hour(f.default(k).hour()).minute(f.default(k).minute()).valueOf();return m.default.createElement(x.default,{appElement:document?document.querySelector("#app"):void 0,isOpen:!0,className:N["mobile-modal-content"],overlayClassName:N["mobile-modal-overlay"]},m.default.createElement("div",{style:{"--color":"".concat(o),"--font-weight-medium":y.medium}},m.default.createElement("div",{className:N["top-row"]},m.default.createElement("h3",{className:N["modal-title"]},g.default.t("choose-time",v)),m.default.createElement("button",{type:"button",className:N["departure-now-button"],onClick:a},g.default.t("departure-now",v))),m.default.createElement("div",{className:N["tab-row"]},m.default.createElement("label",{htmlFor:"".concat(P,"-modal-departure"),className:"".concat(N["radio-tab-label"],"\n ").concat(N["departure"===F?"active":void 0])},g.default.t("departure",v),m.default.createElement("input",{id:"".concat(P,"-modal-departure"),name:"departureOrArrival",type:"radio",value:"departure",className:N["radio-textbutton"],onChange:function(){S("departure")},checked:"departure"===F})),m.default.createElement("label",{htmlFor:"".concat(P,"-modal-arrival"),className:"".concat(N["radio-tab-label"],"\n ").concat(N["arrival"===F?"active":void 0])},g.default.t("arrival",v),m.default.createElement("input",{id:"".concat(P,"-modal-arrival"),name:"departureOrArrival",type:"radio",value:"arrival",className:N["radio-textbutton"],onChange:function(){S("arrival")},checked:"arrival"===F}))),m.default.createElement("div",{className:N["input-row"]},m.default.createElement(T,{value:k,getDisplay:p,onChange:function(e){E(e)},itemCount:u,startTime:O,id:"".concat(P,"-date"),label:g.default.t("date",v),icon:m.default.createElement("span",{className:"".concat(N["combobox-icon"]," ").concat(N["date-input-icon"])},m.default.createElement(h.default,{img:"calendar",color:o})),timeZone:l}),m.default.createElement(q,{value:k,getDisplay:d,onChange:function(e){E(e)},id:"".concat(P,"-time"),label:g.default.t("time",v),icon:m.default.createElement("span",{className:"".concat(N["combobox-icon"]," ").concat(N["time-input-icon"])},m.default.createElement(h.default,{img:"time",color:o})),timeZone:l,validate:_})),m.default.createElement("div",{className:N["buttons-row"]},m.default.createElement("button",{type:"button",className:N["ready-button"],onClick:function(){return r(k,F)}},g.default.t("ready",v)),m.default.createElement("button",{type:"button",className:N["cancel-button"],onClick:s},g.default.t("cancel",v)))))}function A(e){var t=e.timestamp,a=e.onTimeChange,i=e.onDateChange,o=e.departureOrArrival,l=e.onNowClick,r=e.onDepartureClick,s=e.onArrivalClick,c=e.embedWhenClosed,d=e.embedWhenOpen,u=e.lang,p=e.color,_=e.timeZone,y=e.onModalSubmit,v=e.fontWeights,x=e.serviceTimeRange,w=e.onOpen,k=e.onClose,E=e.openPicker;f.default.tz.setDefault(_);var F,O=C(n.useState(E||!1),2),G=O[0],T=O[1],q=C(n.useState(t||f.default().valueOf()),2),A=q[0],X=q[1],D=C(n.useState(null),2),z=D[0],Z=D[1],j=C(n.useState(b.default("datetimepicker-")),1)[0],V=C(n.useState((F=navigator.userAgent||navigator.vendor||window.opera,/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(F)&&function(){if("undefined"==typeof window||null===window)return!1;var e=document.createElement("input");return e.type="date","date"===e.type&&(e.type="time","time"===e.type)}())),1)[0],I=n.useRef(),L=n.useRef(),M=n.useRef(),H={lng:u};n.useEffect((function(){Object.keys(P).forEach((function(e){return g.default.addResourceBundle(e,"translation",P[u])}))}),[]),n.useEffect((function(){f.default.locale(u)}),[u]);var Y=null===t;n.useEffect((function(){Y?X(f.default().valueOf()):(z&&(clearInterval(z),Z(null)),X(t))}),[t]),n.useEffect((function(){if(Y){z&&clearInterval(z);var e=setInterval((function(){var t=f.default().valueOf();f.default(A).isSame(t,"minute")||(clearInterval(e),Z(null),X(t))}),5e3);return Z(e),function(){return clearInterval(e)}}}),[A]);var U=n.useRef();n.useEffect((function(){U.current=G}));var K=U.current;n.useLayoutEffect((function(){var e;if(!K===G)if(G)L&&(null===(e=L.current)||void 0===e||e.focus());else if(I){var t;null===(t=I.current)||void 0===t||t.focus()}}));for(var B=function(e){var t,n=f.default(e);return t=n.isSame(f.default(),"day")?g.default.t("today",H):n.isSame(f.default().add(1,"day"),"day")?g.default.t("tomorrow",H):n.format("dd D.M."),t="".concat(t.charAt(0).toUpperCase()).concat(t.slice(1))},J=function(e){return f.default(e).format("HH:mm")},Q=function(e,t){var n=e.trim();if(null!==n.match(/^[0-9]{1,2}(\.|:)[0-9]{2}$/)){var a=n.includes(".")?".":":",i=n.split(a),o=Number(i[0]),l=!Number.isNaN(o)&&o>=0&&o<=23,r=Number(i[1]);return!Number.isNaN(r)&&r>=0&&r<=59&&l?f.default(t).hours(o).minutes(r).valueOf():null}return null},$=f.default(A),ee=f.default(A).startOf("day").valueOf(),te=[],ne=f.default(ee);ne.isSame(ee,"day");)te.push(ne.valueOf()),ne.add(15,"minutes");if(null===t){var ae,ie=3e5,oe=Math.ceil(A/ie)*ie,le=Array(7).fill().map((function(e,t){return oe+t*ie})),re=te.map((function(e){return A-e})).findIndex((function(e){return e<=0}));(ae=te).splice.apply(ae,[re,0].concat(R(le))),te=Array.from(new Set(te))}var se=f.default().startOf("day").hour($.hour()).minute($.minute()).valueOf(),ce=Array(x).fill().map((function(e,t){return f.default(se).add(t,"day").valueOf()}));function de(){M.current&&(M.current.innerHTML=g.default.t("accessible-closed",H),setTimeout((function(){M.current.innerHTML=null}),100))}return m.default.createElement("fieldset",{className:N["dt-datetimepicker"],id:"".concat(j,"-root"),style:{"--color":"".concat(p),"--font-weight-medium":v.medium}},m.default.createElement("legend",{className:N["sr-only"]},g.default.t("accessible-title",H)),m.default.createElement("span",{className:N["sr-only"]},g.default.t("accessible-update-instructions",H)),m.default.createElement(m.default.Fragment,null,m.default.createElement("div",{className:G?"".concat(N.hidden," datetimepicker-top-row"):"".concat(N["top-row-container"]," ").concat(N.closed," datetimepicker-top-row")},m.default.createElement("label",{className:N["label-open"],htmlFor:"".concat(j,"-open")},m.default.createElement("span",{className:N["time-icon"]},m.default.createElement(h.default,{img:"time",color:p})),m.default.createElement("span",{className:N["sr-only"]},g.default.t("accessible-open",H)),m.default.createElement("span",{role:"alert",className:N["sr-only"],ref:M}),m.default.createElement("button",{id:"".concat(j,"-open"),type:"button",className:"".concat(N.textbutton," ").concat(N.active," ").concat(N["open-button"]),"aria-controls":"".concat(j,"-root"),"aria-expanded":"false",onClick:function(){T(!0),M.current&&(M.current.innerHTML=g.default.t("accessible-opened",H),setTimeout((function(){M.current.innerHTML=null}),100)),w&&w()},ref:I},m.default.createElement("span",null,Y&&"departure"===o?g.default.t("departure-now",H):m.default.createElement(m.default.Fragment,null,g.default.t("departure"===o?"departure":"arrival",H)," ".concat(f.default().isSame(f.default(A),"day")?"":B(A).toLowerCase()," ").concat(J(A)))),m.default.createElement("span",{className:N["dropdown-icon"]},m.default.createElement(h.default,{img:"arrow-dropdown",color:p})))),m.default.createElement("span",{className:N["right-edge"]},c)),m.default.createElement("div",null)),V?G&&m.default.createElement(W,{departureOrArrival:o,onNowClick:function(){T(!1),de(),l()},lang:u,color:p,onSubmit:function(e,t){y(e,t),T(!1),de()},onCancel:function(){T(!1),de(),k&&k()},getTimeDisplay:J,timeZone:_,timestamp:A,getDateDisplay:B,dateSelectItemCount:x,getDisplay:J,validateTime:Q,fontWeights:v}):m.default.createElement(m.default.Fragment,null,m.default.createElement("div",{className:"".concat(N["datetimepicker-open-container"]," ").concat(G?"":N.hidden)},m.default.createElement("div",{className:"".concat(G?N["top-row-container"]:N.hidden," datetimepicker-top-row")}," ",m.default.createElement("span",{role:"alert",className:N["sr-only"],ref:M}),m.default.createElement("span",null),m.default.createElement("span",{className:N["departure-or-arrival-container"]},m.default.createElement("label",{htmlFor:"".concat(j,"-departure"),className:"".concat(N["radio-textbutton-label"],"\n ").concat(N["departure"===o?"active":void 0])},g.default.t("departure",H),m.default.createElement("input",{id:"".concat(j,"-departure"),name:"departureOrArrival",type:"radio",value:"departure",className:N["radio-textbutton"],onChange:function(){r()},checked:"departure"===o})),m.default.createElement("label",{htmlFor:"".concat(j,"-arrival"),className:"".concat(N["radio-textbutton-label"],"\n ").concat(N["arrival"===o?"active":void 0])},g.default.t("arrival",H),m.default.createElement("input",{id:"".concat(j,"-arrival"),name:"departureOrArrival",type:"radio",value:"arrival",className:N["radio-textbutton"],onChange:function(){s()},checked:"arrival"===o}))),m.default.createElement("button",{id:"".concat(j,"-now"),type:"button",className:N["departure-now-button"],onClick:function(){T(!1),de(),k&&k(),l()},ref:L},g.default.t("departure-now",H)),m.default.createElement("span",{className:N["right-edge"]},m.default.createElement("button",{type:"button",className:N["close-button"],"aria-controls":"".concat(j,"-root"),"aria-expanded":"true",onClick:function(){T(!1),de(),k&&k()}},m.default.createElement("span",{className:N["close-icon"]},m.default.createElement(h.default,{img:"close",color:p})),m.default.createElement("span",{className:N["sr-only"]},g.default.t("accessible-close",H))))),m.default.createElement("div",{className:G?"".concat(N["picker-container"]):"".concat(N.hidden," datetimepicker-top-row")},m.default.createElement(m.default.Fragment,null,m.default.createElement("span",{className:N["combobox-left"]},m.default.createElement(S,{value:A,onChange:function(e){i(e)},getDisplay:B,timeChoices:ce,validate:function(){return null},icon:m.default.createElement("span",{className:"".concat(N["combobox-icon"]," ").concat(N["date-input-icon"])},m.default.createElement(h.default,{img:"calendar",color:p})),id:"".concat(j,"-date"),label:g.default.t("date",H),disableTyping:!0,timeZone:_})),m.default.createElement("span",{className:N["combobox-right"]},m.default.createElement(S,{value:A,onChange:function(e){a(e)},getDisplay:J,timeChoices:te,validate:Q,icon:m.default.createElement("span",{className:"".concat(N["combobox-icon"]," ").concat(N["time-input-icon"])},m.default.createElement(h.default,{img:"time",color:p})),id:"".concat(j,"-time"),label:g.default.t("time",H),timeZone:_}))))),m.default.createElement("span",{className:G?"":N.hidden},d),m.default.createElement("div",{className:G?"datetimepicker-bottom-row-open":""})))}function X(e){var t=e.realtime,a=e.initialArriveBy,i=e.initialTimestamp,o=e.onDepartureClick,l=e.onArrivalClick,r=e.onTimeChange,s=e.onDateChange,c=e.onNowClick,d=e.embedWhenClosed,u=e.embedWhenOpen,p=e.lang,_=e.color,b=e.timeZone,g=e.fontWeights,h=e.serviceTimeRange,v=e.onOpen,x=e.onClose,w=e.openPicker;f.default.locale(p),f.default.tz.setDefault(b);var k=t?null:f.default().valueOf(),E=C(n.useState(i?1e3*i:k),2),R=E[0],F=E[1],N=C(n.useState(!0===a?"arrival":"departure"),2),S=N[0],P=N[1];n.useEffect((function(){var e=null===R&&void 0===i,t=null===R||void 0===i,n=Math.round(R/1e3)===i;!e&&(t||!n)&&F(void 0===i?null:1e3*i),!a==("arrival"===S)&&P(!0===a?"arrival":"departure")}),[i,a]);var O=y.default((function(e){if(null===e)return F(f.default().valueOf()),void r(Math.round(f.default().valueOf()/1e3),"arrival"===S);F(e),r(Math.round(e/1e3),"arrival"===S)}),10),G=y.default((function(e){if(null===e)return F(f.default().valueOf()),void s(Math.round(f.default().valueOf()/1e3),"arrival"===S);F(e),s(Math.round(e/1e3),"arrival"===S)}),10);return m.default.createElement(A,{timestamp:R,onTimeChange:O,onDateChange:G,departureOrArrival:S,onNowClick:function(){P("departure");var e=t?null:f.default().valueOf();F(e),c(Math.round(e/1e3))},onDepartureClick:function(){var e=!1,t=R;if(null===R){var n=f.default().valueOf();F(n),t=n,e=!0}"departure"!==S&&(P("departure"),e=!0),e&&o(Math.round(t/1e3))},onArrivalClick:function(){var e=!1,t=R;if(null===R){var n=f.default().valueOf();F(n),t=n,e=!0}"arrival"!==S&&(P("arrival"),e=!0),e&&l(Math.round(t/1e3))},embedWhenClosed:d,embedWhenOpen:u,lang:p,color:_,timeZone:b,onModalSubmit:function(e,t){F(e),P(t),r(e/1e3,"arrival"===t,!0)},fontWeights:g,serviceTimeRange:h,onOpen:v,onClose:x,openPicker:w})}"production"!==process.env.NODE_ENV&&(T.propTypes={value:_.default.number.isRequired,getDisplay:_.default.func.isRequired,onChange:_.default.func.isRequired,itemCount:_.default.number.isRequired,startTime:_.default.number.isRequired,id:_.default.string.isRequired,label:_.default.string.isRequired,icon:_.default.node,dateTimeCombined:_.default.bool,timeZone:_.default.string}),T.defaultProps={icon:null,dateTimeCombined:!1,timeZone:"Europe/Helsinki"},"production"!==process.env.NODE_ENV&&(q.propTypes={value:_.default.number.isRequired,getDisplay:_.default.func.isRequired,onChange:_.default.func.isRequired,id:_.default.string.isRequired,label:_.default.string.isRequired,icon:_.default.node,timeZone:_.default.string,validate:_.default.func.isRequired}),q.defaultProps={icon:null,timeZone:"Europe/Helsinki"},f.default.locale("en"),g.default.init({lng:"en",resources:{}}),Object.keys(P).forEach((function(e){return g.default.addResourceBundle(e,"translation",P[e])})),"production"!==process.env.NODE_ENV&&(W.propTypes={timeZone:_.default.string,departureOrArrival:_.default.oneOf(["departure","arrival"]).isRequired,onNowClick:_.default.func.isRequired,lang:_.default.string.isRequired,color:_.default.string,onSubmit:_.default.func.isRequired,onCancel:_.default.func.isRequired,timestamp:_.default.number.isRequired,getTimeDisplay:_.default.func.isRequired,dateSelectItemCount:_.default.number.isRequired,getDateDisplay:_.default.func.isRequired,validateTime:_.default.func.isRequired,fontWeights:_.default.shape({medium:_.default.number.isRequired}).isRequired}),W.defaultProps={color:"#007ac9",timeZone:"Europe/Helsinki"},f.default.locale("en"),g.default.init({lng:"fi",fallbackLng:"fi",defaultNS:"translation",interpolation:{escapeValue:!1}}),"production"!==process.env.NODE_ENV&&(A.propTypes={timestamp:_.default.number,timeZone:_.default.string,onTimeChange:_.default.func.isRequired,onDateChange:_.default.func.isRequired,departureOrArrival:_.default.oneOf(["departure","arrival"]).isRequired,onNowClick:_.default.func.isRequired,onDepartureClick:_.default.func.isRequired,onArrivalClick:_.default.func.isRequired,embedWhenClosed:_.default.node,embedWhenOpen:_.default.node,lang:_.default.string.isRequired,color:_.default.string,onModalSubmit:_.default.func.isRequired,fontWeights:_.default.shape({medium:_.default.number.isRequired}).isRequired,serviceTimeRange:_.default.number,onOpen:_.default.func,onClose:_.default.func,openPicker:_.default.bool}),A.defaultProps={timestamp:null,embedWhenClosed:null,embedWhenOpen:null,color:"#007ac9",timeZone:"Europe/Helsinki",serviceTimeRange:30,onOpen:null,onClose:null,openPicker:void 0},"production"!==process.env.NODE_ENV&&(X.propTypes={realtime:_.default.bool,initialTimestamp:_.default.number,initialArriveBy:_.default.bool,onDepartureClick:_.default.func.isRequired,onArrivalClick:_.default.func.isRequired,onTimeChange:_.default.func.isRequired,onDateChange:_.default.func.isRequired,onNowClick:_.default.func.isRequired,embedWhenClosed:_.default.node,embedWhenOpen:_.default.node,lang:_.default.string,color:_.default.string,timeZone:_.default.string,fontWeights:_.default.shape({medium:_.default.number}),serviceTimeRange:_.default.number,onOpen:_.default.func,onClose:_.default.func,openPicker:_.default.bool}),X.defaultProps={realtime:!1,initialArriveBy:void 0,initialTimestamp:void 0,embedWhenClosed:null,embedWhenOpen:null,lang:"en",color:"#007ac9",timeZone:"Europe/Helsinki",fontWeights:{medium:500},onOpen:null,onClose:null,openPicker:void 0},e.default=X,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("prop-types"),require("react"),require("moment-timezone"),require("lodash/debounce"),require("moment/locale/fi"),require("lodash/uniqueId"),require("i18next"),require("@digitransit-component/digitransit-component-icon"),require("react-select"),require("react-modal"),require("react-autosuggest")):"function"==typeof define&&define.amd?define(["exports","prop-types","react","moment-timezone","lodash/debounce","moment/locale/fi","lodash/uniqueId","i18next","@digitransit-component/digitransit-component-icon","react-select","react-modal","react-autosuggest"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@digitransit-component/digitransit-component-datetimepicker"]={},e.PropTypes,e.React,e.moment,e.debounce,null,e.uniqueId,e.i18next,e.Icon,e.Select,e.ReactModal,e.Autosuggest)}(this,(function(e,t,n,i,a,l,o,r,s,d,u,c){"use strict";function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=_(t),m=_(n),f=_(i),y=_(a),b=_(o),g=_(r),h=_(s),x=_(d),v=_(u),w=_(c);var k={parseTypedTime:function(e){let t=e;return 3===t.length&&t.split("").every((e=>Number.isInteger(Number(e))))&&(t=Number(t.slice(0,2))<=23?`${t.slice(0,2)}:${t[2]}`:`${t[0]}:${t.slice(1)}`),t}};var E={"sr-only":"styles_sr-only__BrzYQ","dt-datetimepicker":"styles_dt-datetimepicker__PtoFG",hidden:"styles_hidden__6ySER","datetimepicker-open-container":"styles_datetimepicker-open-container__1dVr5","top-row-container":"styles_top-row-container__cXGjL",closed:"styles_closed__Fqe1r","time-icon":"styles_time-icon__ntgLZ","dropdown-icon":"styles_dropdown-icon__diYYB","close-icon":"styles_close-icon__-MzK5","label-open":"styles_label-open__Gmvov",textbutton:"styles_textbutton__T7wS2",active:"styles_active__4L82E","combobox-left":"styles_combobox-left__Sp4kh","combobox-right":"styles_combobox-right__Hg8kN","departure-or-arrival-container":"styles_departure-or-arrival-container__pJ-Iw","radio-textbutton-label":"styles_radio-textbutton-label__h-zfy","first-radio":"styles_first-radio__FWNoD","radio-textbutton":"styles_radio-textbutton__tsKET","departure-now-button":"styles_departure-now-button__VKMMK","open-button":"styles_open-button__c2B-6","close-button":"styles_close-button__2mfgI","right-edge":"styles_right-edge__29UYw","combobox-container":"styles_combobox-container__CLY9U","combobox-icon":"styles_combobox-icon__-0XPH","date-input-icon":"styles_date-input-icon__KMrj1","time-input-icon":"styles_time-input-icon__qkhC7","datetimepicker-select-container":"styles_datetimepicker-select-container__EVW1l","picker-container":"styles_picker-container__V02r4","combobox-mobile-container":"styles_combobox-mobile-container__u2DSO","mobile-modal-overlay":"styles_mobile-modal-overlay__8vF8L","mobile-modal-content":"styles_mobile-modal-content__fWRgy","top-row":"styles_top-row__h8xy1","modal-title":"styles_modal-title__EA3YD","tab-row":"styles_tab-row__orgwh","radio-tab-label":"styles_radio-tab-label__vIfup","input-row":"styles_input-row__2XXEY","input-container":"styles_input-container__USZlF","time-input-mobile":"styles_time-input-mobile__6e4A5","mobile-input-display":"styles_mobile-input-display__VUMd0","mobile-input-hidden":"styles_mobile-input-hidden__2KIuK",container:"styles_container__ihyhz",suggestion:"styles_suggestion__ZczJa",suggestionHighlighted:"styles_suggestionHighlighted__fzLiW",suggestionsContainerOpen:"styles_suggestionsContainerOpen__ISHXi",input:"styles_input__PAfbH","buttons-row":"styles_buttons-row__-3wsn","ready-button":"styles_ready-button__dH7Qc"};function C({value:e,onChange:t,getDisplay:i,timeChoices:a,validate:l,id:o,label:r,icon:s,disableTyping:d,timeZone:u}){f.default.tz.setDefault(u);const[c,_]=n.useState(i(e)),[p,y]=n.useState(!1);n.useEffect((()=>_(i(e))),[e]);const b=e=>{const n=Number(e);!Number.isNaN(n)&&f.default(n).isValid()&&f.default(n).valueOf()===n&&t(n)},g=a.map((e=>({value:e.toString(),label:i(e)}))),h=g.reduce(((t,n)=>Math.abs(e-t.value)<Math.abs(e-n.value)?t:n)),v=`${o}-input`,w=`${o}-label`;return m.default.createElement(m.default.Fragment,null,m.default.createElement("label",{className:E["combobox-container"],htmlFor:v},m.default.createElement("span",{className:E["sr-only"],id:w},r," ",c),s,m.default.createElement(x.default,{"aria-labelledby":w,ariaLiveMessages:{guidance:()=>".",onChange:()=>"",onFilter:()=>"",onFocus:({context:e,label:t})=>"menu"===e?t:""},options:g,inputId:v,onChange:t=>{if(p){const t=l(c,e);null!==t?(b(t),y(!1)):(_(i(e)),y(!1))}else b(t.value)},components:{IndicatorsContainer:()=>null},className:E["datetimepicker-select-container"],classNamePrefix:"datetimepicker-select",onInputChange:(e,{action:t})=>{if(!d&&"input-change"===t){const t=k.parseTypedTime(e);_(t),y(!0)}},inputValue:!d&&c,value:h,filterOption:()=>!0,controlShouldRenderValue:d,tabSelectsValue:!1,placeholder:"",onFocus:e=>{d||e.target.select()},onBlur:()=>{if(p){const t=l(c,e);null!==t?(b(t),y(!1)):(_(i(e)),y(!1))}},onKeyDown:e=>{["ArrowDown","ArrowUp"].includes(e.key)&&y(!1)},isSearchable:!d})))}!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===n&&i.firstChild?i.insertBefore(a,i.firstChild):i.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}(".styles_sr-only__BrzYQ:not(:focus):not(:active) {\n clip: rect(0 0 0 0);\n -webkit-clip-path: inset(50%);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px; }\n\n.styles_dt-datetimepicker__PtoFG {\n border: none;\n padding: 0;\n margin: 0;\n font-size: 15px;\n font-weight: var(--font-weight-medium); }\n .styles_dt-datetimepicker__PtoFG button, .styles_dt-datetimepicker__PtoFG label {\n font-size: 1em;\n font-weight: inherit; }\n .styles_dt-datetimepicker__PtoFG label button {\n cursor: pointer;\n font-family: 'Gotham Rounded A', 'Gotham Rounded B', 'Roboto', Arial, Georgia, Serif; }\n .styles_dt-datetimepicker__PtoFG .styles_hidden__6ySER {\n display: none; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-open-container__1dVr5 {\n background-color: #f4f4f5;\n border-radius: 5px;\n padding: 15px; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL {\n display: flex;\n flex-wrap: wrap; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL.styles_closed__Fqe1r {\n margin: 11px 0 6px 18px; }\n @media screen and (max-width: 319px) {\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL {\n margin-left: 14px; } }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL .styles_time-icon__ntgLZ svg {\n width: 18px;\n height: 19px; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL .styles_dropdown-icon__diYYB {\n margin-left: 9px;\n position: relative;\n top: 1px; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL .styles_dropdown-icon__diYYB svg {\n width: 14px;\n height: 10px; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL .styles_close-icon__-MzK5 svg {\n width: 12px;\n height: 12px;\n border-radius: 1px; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL .styles_close-icon__-MzK5 svg path {\n stroke-width: 30; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL label {\n cursor: pointer; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL label.styles_label-open__Gmvov {\n align-items: flex-start;\n display: flex; }\n .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL button, .styles_dt-datetimepicker__PtoFG .styles_top-row-container__cXGjL label {\n font-size: 1em;\n letter-spacing: -0.5px;\n line-height: 1; }\n .styles_dt-datetimepicker__PtoFG .styles_textbutton__T7wS2 {\n margin-left: 9px;\n margin-top: 1px;\n background: none;\n border: none;\n color: #666666;\n padding: 0; }\n @media screen and (min-width: 768px) {\n .styles_dt-datetimepicker__PtoFG .styles_textbutton__T7wS2 {\n margin-left: 14px; } }\n .styles_dt-datetimepicker__PtoFG .styles_textbutton__T7wS2.styles_active__4L82E {\n color: var(--color); }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-left__Sp4kh {\n position: relative;\n margin-right: 4px;\n width: 63%; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-right__Hg8kN {\n position: relative;\n margin-left: 4px;\n width: 37%; }\n .styles_dt-datetimepicker__PtoFG .styles_departure-or-arrival-container__pJ-Iw {\n height: calc(1rem + 20px);\n background-color: #dddddd;\n border-radius: 8px;\n display: flex;\n width: calc(5px + 13em); }\n .styles_dt-datetimepicker__PtoFG .styles_radio-textbutton-label__h-zfy {\n color: #333333;\n margin: 2px;\n background: none;\n border-radius: 6px;\n padding: 9px 0;\n width: 50%;\n cursor: pointer;\n height: calc(1rem + 16px);\n text-align: center;\n font-weight: 400;\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.03em; }\n .styles_dt-datetimepicker__PtoFG .styles_radio-textbutton-label__h-zfy.styles_active__4L82E {\n font-weight: 500;\n background: white; }\n .styles_dt-datetimepicker__PtoFG .styles_radio-textbutton-label__h-zfy:focus-within {\n /* First apply outline that is used in Edge and Firefox */\n outline: 1px dotted #212121;\n /* Then override outline for webkit browsers like Chrome, this has no effect on other browsers */\n outline: 5px auto -webkit-focus-ring-color;\n /* stylelint-disable-line declaration-block-no-duplicate-properties */ }\n .styles_dt-datetimepicker__PtoFG .styles_radio-textbutton-label__h-zfy.styles_first-radio__FWNoD {\n margin: 0;\n display: flex;\n align-items: flex-start; }\n .styles_dt-datetimepicker__PtoFG .styles_radio-textbutton__tsKET {\n clip: rect(0 0 0 0);\n -webkit-clip-path: inset(50%);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px; }\n .styles_dt-datetimepicker__PtoFG .styles_departure-now-button__VKMMK {\n font-family: inherit;\n letter-spacing: -0.02em;\n height: calc(1rem + 18px);\n color: var(--color);\n padding: 8px 0;\n width: 6.6875rem;\n background: white;\n border: 1px solid #888888;\n border-radius: 30px;\n margin-left: 11px; }\n .styles_dt-datetimepicker__PtoFG .styles_open-button__c2B-6 {\n display: flex;\n margin-bottom: 0;\n margin-top: -1px;\n padding: 2px 0 2px 0; }\n .styles_dt-datetimepicker__PtoFG button.styles_close-button__2mfgI {\n transition: transform 0.2s;\n position: relative;\n top: -8px;\n right: -8px;\n border: 0;\n font-weight: normal;\n background: none;\n color: var(--color);\n padding: 0;\n line-height: normal; }\n .styles_dt-datetimepicker__PtoFG button.styles_close-button__2mfgI:hover {\n transform: scale(1.2); }\n .styles_dt-datetimepicker__PtoFG .styles_right-edge__29UYw {\n margin-left: auto;\n margin-right: 0;\n position: relative;\n top: -2px; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-container__CLY9U {\n cursor: pointer; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-icon__-0XPH {\n color: var(--color);\n height: 40px;\n position: absolute;\n z-index: 7;\n pointer-events: none; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-icon__-0XPH.styles_date-input-icon__KMrj1 {\n display: flex;\n align-items: center;\n padding: 0;\n margin-left: 14px; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-icon__-0XPH.styles_date-input-icon__KMrj1 svg {\n width: 20px;\n height: 18px; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-icon__-0XPH.styles_time-input-icon__qkhC7 {\n display: flex;\n align-items: center;\n padding: 0;\n margin-left: 8px; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-icon__-0XPH.styles_time-input-icon__qkhC7 svg {\n margin-top: 1px;\n width: 22px;\n height: 22px; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l {\n position: relative;\n height: 40px; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__control {\n cursor: inherit;\n height: 40px;\n border: 1px solid #888888; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__value-container {\n padding: 0; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__single-value {\n margin: 0 0 0 47px; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__input {\n background: inherit;\n position: relative;\n margin-left: 40px; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__input input {\n opacity: 1 !important;\n background: inherit;\n box-shadow: none;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.33;\n letter-spacing: -0.5px;\n color: #333333;\n font-family: inherit;\n font-size: 15px;\n font-weight: var(--font-weight-medium); }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__input input:focus {\n box-shadow: none;\n outline: none;\n border: none; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__menu {\n z-index: 19;\n padding: 0;\n background: #fff;\n max-height: 250px;\n border-radius: 5px;\n box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.06);\n border: 1px rgba(0, 0, 0, 0.1) solid; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__menu .datetimepicker-select__menu-list {\n max-height: 250px;\n padding: 0; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__menu .datetimepicker-select__menu-list .datetimepicker-select__option {\n height: 50px;\n border-top: 1px solid #dddddd;\n padding: 13px 0 0 12px;\n letter-spacing: -0.6px;\n color: #333333; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__menu .datetimepicker-select__menu-list .datetimepicker-select__option--is-selected {\n background: inherit; }\n .styles_dt-datetimepicker__PtoFG .styles_datetimepicker-select-container__EVW1l .datetimepicker-select__menu .datetimepicker-select__menu-list .datetimepicker-select__option--is-focused {\n background: #dfe5e8; }\n .styles_dt-datetimepicker__PtoFG .styles_picker-container__V02r4 {\n margin: 14px 0 0 0;\n display: flex; }\n .styles_dt-datetimepicker__PtoFG .styles_combobox-mobile-container__u2DSO {\n flex-grow: 1; }\n\n.styles_mobile-modal-overlay__8vF8L {\n position: fixed;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n background-color: rgba(0, 0, 0, 0.6);\n z-index: 1000; }\n\n.styles_mobile-modal-content__fWRgy {\n font-family: 'Gotham Rounded A', 'Gotham Rounded B', 'Roboto', Arial, Georgia, Serif;\n background: white;\n width: 89%;\n position: absolute;\n left: 5.5%;\n padding: 31px 20px 33px 20px;\n top: 80px;\n border-radius: 5px; }\n .styles_mobile-modal-content__fWRgy .styles_top-row__h8xy1 {\n display: flex;\n justify-content: space-between;\n margin-bottom: 21px; }\n .styles_mobile-modal-content__fWRgy .styles_top-row__h8xy1 .styles_modal-title__EA3YD {\n font-weight: var(--font-weight-medium);\n font-size: 20px;\n line-height: 18px;\n letter-spacing: -0.5px;\n color: #333333;\n padding: 6px 0 0 8px; }\n .styles_mobile-modal-content__fWRgy .styles_top-row__h8xy1 .styles_departure-now-button__VKMMK {\n background-color: white;\n font-family: inherit;\n padding: 5px 15px;\n border: 1px solid #888888;\n border-radius: 50px;\n font-weight: var(--font-weight-medium);\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.02em;\n color: var(--color); }\n .styles_mobile-modal-content__fWRgy .styles_tab-row__orgwh {\n display: flex;\n border: 2px solid #dddddd;\n border-radius: 5px;\n margin-bottom: 16px;\n background-color: #dddddd; }\n .styles_mobile-modal-content__fWRgy .styles_tab-row__orgwh .styles_radio-tab-label__vIfup {\n padding: 9px 0;\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.5px;\n border-radius: 3px;\n font-weight: normal;\n width: 50%;\n text-align: center;\n color: #333333; }\n .styles_mobile-modal-content__fWRgy .styles_tab-row__orgwh .styles_radio-tab-label__vIfup.styles_active__4L82E {\n font-weight: var(--font-weight-medium);\n background-color: #ffffff; }\n .styles_mobile-modal-content__fWRgy .styles_tab-row__orgwh .styles_radio-textbutton__tsKET {\n clip: rect(0 0 0 0);\n -webkit-clip-path: inset(50%);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY {\n display: flex;\n margin-bottom: 25px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY label:first-child {\n flex-basis: 60%;\n margin-right: 10px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY label:nth-child(2) {\n flex-basis: 40%; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF {\n border: 1px solid #888888;\n border-radius: 5px;\n display: flex;\n align-items: center;\n height: 40px;\n line-height: 1.5;\n font-size: 100%; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF:focus-within {\n background: rgba(0, 122, 201, 0.06);\n border: 2px solid var(--color); }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_combobox-icon__-0XPH {\n height: 18px;\n font-size: 18px;\n padding: 0 0 0 10px;\n border: none;\n position: relative;\n top: 3px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_combobox-icon__-0XPH.styles_time-input-icon__qkhC7 > svg {\n height: 20px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_time-input-mobile__6e4A5 {\n font-family: inherit;\n box-shadow: none;\n font-size: 18px;\n letter-spacing: -0.5px;\n line-height: 20px;\n font-weight: var(--font-weight-medium);\n border: none;\n outline: none;\n background: none;\n width: 50px;\n margin-left: 10px;\n color: #333333;\n height: 1.5265rem; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_mobile-input-display__VUMd0 {\n position: relative;\n left: 10px;\n border: none;\n background: inherit;\n box-shadow: none;\n font-family: inherit;\n font-weight: var(--font-weight-medium);\n font-stretch: normal;\n font-style: normal;\n font-size: 16px;\n line-height: 1.33;\n letter-spacing: -0.5px;\n color: #333333; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_mobile-input-display__VUMd0:focus {\n outline: none;\n box-shadow: none;\n background: none; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_mobile-input-hidden__2KIuK {\n font-size: 16px;\n margin-bottom: 12px;\n height: 0px;\n width: 0;\n background: inherit;\n color: transparent;\n outline: none;\n box-shadow: none;\n border: none; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_mobile-input-hidden__2KIuK:focus {\n outline: none;\n box-shadow: none; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz {\n position: absolute;\n width: calc((100% - 50px) * 0.6);\n height: 25px;\n font-size: 15px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz .styles_suggestion__ZczJa {\n list-style: none;\n font-size: 16px;\n font-style: normal;\n font-weight: normal;\n line-height: 49px;\n height: 50px;\n margin: 0;\n padding: 0 0 0 16px;\n color: rgba(0, 0, 0, 0.87);\n background: white; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz .styles_suggestionHighlighted__fzLiW {\n background: #dfe5e8; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz .styles_suggestionsContainerOpen__ISHXi {\n position: absolute;\n z-index: 19;\n max-height: 250px;\n overflow-x: hidden;\n overflow-y: scroll;\n border-radius: 5px;\n box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.06);\n border: 1px rgba(0, 0, 0, 0.1) solid;\n top: 42px;\n left: -2px;\n width: 100%;\n font-size: 16px;\n line-height: 1;\n color: rgba(0, 0, 0, 0.87); }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz .styles_suggestionsContainerOpen__ISHXi ul {\n padding: 0;\n margin: 0; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz .styles_input__PAfbH {\n box-shadow: none;\n border: none;\n background: none;\n font-size: 16px;\n font-weight: var(--font-weight-medium);\n height: 25px;\n display: inline-block;\n font-family: inherit;\n line-height: 1.33;\n color: #333333;\n padding-left: 46px; }\n .styles_mobile-modal-content__fWRgy .styles_input-row__2XXEY .styles_input-container__USZlF .styles_container__ihyhz .styles_input__PAfbH:focus {\n outline: none;\n border: none;\n background: none; }\n .styles_mobile-modal-content__fWRgy .styles_buttons-row__-3wsn {\n display: flex;\n flex-direction: column;\n font-size: 16px;\n font-weight: var(--font-weight-medium); }\n .styles_mobile-modal-content__fWRgy .styles_buttons-row__-3wsn button {\n background-color: white;\n font-family: inherit;\n font-weight: var(--font-weight-medium);\n font-size: 16px;\n letter-spacing: -0.02em;\n width: 100%;\n border-radius: 50px;\n height: 40px;\n color: var(--color);\n border: 1px solid #888888; }\n .styles_mobile-modal-content__fWRgy .styles_buttons-row__-3wsn button.styles_ready-button__dH7Qc {\n color: white;\n background-color: var(--color);\n border: none;\n margin-bottom: 10px; }\n"),"production"!==process.env.NODE_ENV&&(C.propTypes={value:p.default.number.isRequired,onChange:p.default.func.isRequired,getDisplay:p.default.func.isRequired,timeChoices:p.default.arrayOf(p.default.number).isRequired,validate:p.default.func.isRequired,id:p.default.string.isRequired,label:p.default.node.isRequired,icon:p.default.node.isRequired,disableTyping:p.default.bool,timeZone:p.default.string}),C.defaultProps={disableTyping:!1,timeZone:"Europe/Helsinki"};const R={de:{today:"Heute",tomorrow:"Morgen","accessible-close":"Schließe die Auswahl","accessible-closed":"Auswahl geschlossen","accessible-open":"Öffne die Auswahl","accessible-opened":"Auswahl geöffnet","accessible-title":"Datum und Uhrzeitauswahl",arrival:"Ankunft",date:"Datum",departure:"Abfahrt","departure-now":"Abfahrt jetzt","choose-time":"Zeit wählen",ready:"Fertig",time:"Zeit",cancel:"Abbrechen"},en:{today:"Today",tomorrow:"Tomorrow","accessible-close":"Close the picker","accessible-closed":"Timepicker closed","accessible-open":"Open the picker","accessible-opened":"Timepicker opened","accessible-title":"Date and timepicker","accessible-update-instructions":"Changing time parameters will trigger a new search.",arrival:"Arrival",date:"Date",departure:"Departure","departure-now":"Leaving now",time:"Time","choose-time":"Choose time",ready:"Ready",cancel:"Cancel"},fi:{today:"Tänään",tomorrow:"Huomenna","accessible-close":"Sulje valitsin","accessible-closed":"Valitsin suljettu","accessible-open":"Avaa valitsin","accessible-opened":"Valitsin avattu","accessible-title":"Aika- ja päivämäärävalitsin","accessible-update-instructions":"Aikavalintojen muuttaminen laukaisee uuden haun.",arrival:"Perillä",date:"Päivä",departure:"Lähtöaika","departure-now":"Lähtö nyt",time:"Aika","choose-time":"Valitse aika",ready:"Valmis",cancel:"Peruuta"},sv:{today:"I dag",tomorrow:"I morgon","accessible-close":"Stäng väljaren","accessible-closed":"Väljaren stängde","accessible-open":"Öppna väljaren","accessible-opened":"Väljaren öppnade","accessible-title":"Tid- och datumväljaren","accessible-update-instructions":"Om du ändrar tiderna, startas en ny sökning automatiskt.",arrival:"Anländer",date:"Datum",departure:"Avgångstid","departure-now":"Avgår nu",time:"Tid","choose-time":"Välj tid",ready:"Färdig",cancel:"Avbryt"}};const F=["ref"];function N({value:e,getDisplay:t,onChange:i,itemCount:a,startTime:l,id:o,label:r,icon:s,timeZone:d}){f.default.tz.setDefault(d);const[u,c]=n.useState(!1),_=n.useRef(null),p=Array(a).fill().map(((e,t)=>f.default(l).add(t,"day").valueOf())),y=p.map((t=>e-t)).findIndex((e=>e<6e4));n.useLayoutEffect((()=>{u&&_.current&&(_.current.scrollTop=50*y)}),[e,u]);const b=!(navigator.userAgent.toLowerCase().indexOf("android")>-1),g=`${o}-input`,h=`${o}-label`;return m.default.createElement(m.default.Fragment,null,m.default.createElement("label",{className:E["input-container"],htmlFor:g},m.default.createElement("span",null,s),m.default.createElement("span",{className:E["sr-only"],id:h},r),b?m.default.createElement(m.default.Fragment,null,m.default.createElement("select",{className:E["mobile-input-display"],onChange:e=>i(Number(e.target.value)),value:e},p.map((e=>m.default.createElement("option",{key:e,value:e},t(e)))))):m.default.createElement(w.default,{id:o,suggestions:p,getSuggestionValue:e=>e.toString(),renderSuggestion:e=>t(e),onSuggestionsFetchRequested:()=>null,shouldRenderSuggestions:()=>!0,inputProps:{value:t(e),onChange:(e,{newValue:t})=>{i(Number(t))},onFocus:()=>{c(!0)},onBlur:()=>{c(!1)},id:g,"aria-labelledby":h,"aria-autocomplete":"none",readOnly:!0},focusInputOnSuggestionClick:!1,onSuggestionsClearRequested:()=>null,renderSuggestionsContainer:({containerProps:e,children:t})=>{const{ref:n}=e,i=function(e,t){if(null==e)return{};var n,i,a={},l=Object.keys(e);for(i=0;i<l.length;i++)n=l[i],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,F);return m.default.createElement("div",Object.assign({tabIndex:"-1"},i,{ref:e=>{e&&(_.current=e,n(e))}}),t)},theme:E})))}function P({value:e,getDisplay:t,onChange:i,id:a,label:l,icon:o,timeZone:r,validate:s}){const[d,u]=n.useState(t(e));f.default.tz.setDefault(r);const c=`${a}-input`,_=`${a}-label`,p=n.useRef(null);return n.useLayoutEffect((()=>{p.current&&p.current.focus()}),[]),m.default.createElement(m.default.Fragment,null,m.default.createElement("label",{className:E["input-container"],htmlFor:c},m.default.createElement("span",null,o),m.default.createElement("span",{className:E["sr-only"],id:_},l),m.default.createElement("input",{id:c,inputMode:"numeric",type:"text",maxLength:"6",className:E["time-input-mobile"],value:d,onFocus:e=>{e.target.setSelectionRange(0,0)},onChange:t=>{let n=t.target.value;if(n.match(/[0-9]{3}:[0-9]{2}/)&&n.slice(1)===d&&(n=n.charAt(0)),n.length>5)return;const a=k.parseTypedTime(n);u(a);const l=s(a,e);l&&i(l)},ref:p})))}function S({departureOrArrival:e,onNowClick:t,lang:i,color:a,timeZone:l,onSubmit:o,onCancel:r,timestamp:s,getTimeDisplay:d,dateSelectItemCount:u,getDateDisplay:c,validateTime:_,fontWeights:p}){f.default.tz.setDefault(l);const y={lng:i},[x,w]=n.useState(s),[k,C]=n.useState(e);const[R]=n.useState(b.default("datetimepicker-")),F=f.default().startOf("day").hour(f.default(x).hour()).minute(f.default(x).minute()).valueOf();return m.default.createElement(v.default,{appElement:document?document.querySelector("#app"):void 0,isOpen:!0,className:E["mobile-modal-content"],overlayClassName:E["mobile-modal-overlay"]},m.default.createElement("div",{style:{"--color":`${a}`,"--font-weight-medium":p.medium}},m.default.createElement("div",{className:E["top-row"]},m.default.createElement("h3",{className:E["modal-title"]},g.default.t("choose-time",y)),m.default.createElement("button",{type:"button",className:E["departure-now-button"],onClick:t},g.default.t("departure-now",y))),m.default.createElement("div",{className:E["tab-row"]},m.default.createElement("label",{htmlFor:`${R}-modal-departure`,className:`${E["radio-tab-label"]}\n ${E["departure"===k?"active":void 0]}`},g.default.t("departure",y),m.default.createElement("input",{id:`${R}-modal-departure`,name:"departureOrArrival",type:"radio",value:"departure",className:E["radio-textbutton"],onChange:()=>{C("departure")},checked:"departure"===k})),m.default.createElement("label",{htmlFor:`${R}-modal-arrival`,className:`${E["radio-tab-label"]}\n ${E["arrival"===k?"active":void 0]}`},g.default.t("arrival",y),m.default.createElement("input",{id:`${R}-modal-arrival`,name:"departureOrArrival",type:"radio",value:"arrival",className:E["radio-textbutton"],onChange:()=>{C("arrival")},checked:"arrival"===k}))),m.default.createElement("div",{className:E["input-row"]},m.default.createElement(N,{value:x,getDisplay:c,onChange:function(e){w(e)},itemCount:u,startTime:F,id:`${R}-date`,label:g.default.t("date",y),icon:m.default.createElement("span",{className:`${E["combobox-icon"]} ${E["date-input-icon"]}`},m.default.createElement(h.default,{img:"calendar",color:a})),timeZone:l}),m.default.createElement(P,{value:x,getDisplay:d,onChange:function(e){w(e)},id:`${R}-time`,label:g.default.t("time",y),icon:m.default.createElement("span",{className:`${E["combobox-icon"]} ${E["time-input-icon"]}`},m.default.createElement(h.default,{img:"time",color:a})),timeZone:l,validate:_})),m.default.createElement("div",{className:E["buttons-row"]},m.default.createElement("button",{type:"button",className:E["ready-button"],onClick:()=>o(x,k)},g.default.t("ready",y)),m.default.createElement("button",{type:"button",className:E["cancel-button"],onClick:r},g.default.t("cancel",y)))))}function G({timestamp:e,onTimeChange:t,onDateChange:i,departureOrArrival:a,onNowClick:l,onDepartureClick:o,onArrivalClick:r,embedWhenClosed:s,embedWhenOpen:d,lang:u,color:c,timeZone:_,onModalSubmit:p,fontWeights:y,serviceTimeRange:x,onOpen:v,onClose:w,openPicker:k}){f.default.tz.setDefault(_);const[F,N]=n.useState(k||!1),[P,G]=n.useState(e||f.default().valueOf()),[O,q]=n.useState(null),[W]=n.useState(b.default("datetimepicker-")),[T]=n.useState(function(){const e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)}()&&function(){if("undefined"==typeof window||null===window)return!1;const e=document.createElement("input");return e.type="date","date"===e.type&&(e.type="time","time"===e.type)}()),X=n.useRef(),$=n.useRef(),A=n.useRef(),D={lng:u};n.useEffect((()=>{Object.keys(R).forEach((e=>g.default.addResourceBundle(e,"translation",R[u])))}),[]),n.useEffect((()=>{f.default.locale(u)}),[u]);const z=null===e;n.useEffect((()=>{z?G(f.default().valueOf()):(O&&(clearInterval(O),q(null)),G(e))}),[e]),n.useEffect((()=>{if(!z)return;O&&clearInterval(O);const e=setInterval((()=>{const t=f.default().valueOf();f.default(P).isSame(t,"minute")||(clearInterval(e),q(null),G(t))}),5e3);return q(e),()=>clearInterval(e)}),[P]);const Z=n.useRef();n.useEffect((()=>{Z.current=F}));const V=e=>{const t=f.default(e);let n;return n=t.isSame(f.default(),"day")?g.default.t("today",D):t.isSame(f.default().add(1,"day"),"day")?g.default.t("tomorrow",D):t.format("dd D.M."),n=`${n.charAt(0).toUpperCase()}${n.slice(1)}`,n},L=e=>f.default(e).format("HH:mm"),M=(e,t)=>{const n=e.trim();if(null!==n.match(/^[0-9]{1,2}(\.|:)[0-9]{2}$/)){const e=n.includes(".")?".":":",i=n.split(e),a=Number(i[0]),l=!Number.isNaN(a)&&a>=0&&a<=23,o=Number(i[1]);if(!(!Number.isNaN(o)&&o>=0&&o<=59)||!l)return null;return f.default(t).hours(a).minutes(o).valueOf()}return null},I=f.default(P),j=f.default(P).startOf("day").valueOf();let H=[];const Y=f.default(j);for(;Y.isSame(j,"day");)H.push(Y.valueOf()),Y.add(15,"minutes");if(null===e){const e=3e5,t=Math.ceil(P/e)*e,n=Array(7).fill().map(((n,i)=>t+i*e)),i=H.map((e=>P-e)).findIndex((e=>e<=0));H.splice(i,0,...n),H=Array.from(new Set(H))}const U=f.default().startOf("day").hour(I.hour()).minute(I.minute()).valueOf(),K=Array(x).fill().map(((e,t)=>f.default(U).add(t,"day").valueOf()));function B(){A.current&&(A.current.innerHTML=g.default.t("accessible-closed",D),setTimeout((()=>{A.current.innerHTML=null}),100))}return m.default.createElement("fieldset",{className:E["dt-datetimepicker"],id:`${W}-root`,style:{"--color":`${c}`,"--font-weight-medium":y.medium}},m.default.createElement("legend",{className:E["sr-only"]},g.default.t("accessible-title",D)),m.default.createElement("span",{className:E["sr-only"]},g.default.t("accessible-update-instructions",D)),m.default.createElement(m.default.Fragment,null,m.default.createElement("div",{className:F?`${E.hidden} datetimepicker-top-row`:`${E["top-row-container"]} ${E.closed} datetimepicker-top-row`},m.default.createElement("label",{className:E["label-open"],htmlFor:`${W}-open`},m.default.createElement("span",{className:E["time-icon"]},m.default.createElement(h.default,{img:"time",color:c})),m.default.createElement("span",{className:E["sr-only"]},g.default.t("accessible-open",D)),m.default.createElement("span",{role:"alert",className:E["sr-only"],ref:A}),m.default.createElement("button",{id:`${W}-open`,type:"button",className:`${E.textbutton} ${E.active} ${E["open-button"]}`,"aria-controls":`${W}-root`,"aria-expanded":"false",onClick:()=>{N(!0),A.current&&(A.current.innerHTML=g.default.t("accessible-opened",D),setTimeout((()=>{A.current.innerHTML=null}),100)),v&&v()},ref:X},m.default.createElement("span",null,z&&"departure"===a?g.default.t("departure-now",D):m.default.createElement(m.default.Fragment,null,g.default.t("departure"===a?"departure":"arrival",D),` ${f.default().isSame(f.default(P),"day")?"":V(P).toLowerCase()} ${L(P)}`)),m.default.createElement("span",{className:E["dropdown-icon"]},m.default.createElement(h.default,{img:"arrow-dropdown",color:c})))),m.default.createElement("span",{className:E["right-edge"]},s)),m.default.createElement("div",null)),T?F&&m.default.createElement(S,{departureOrArrival:a,onNowClick:()=>{N(!1),B(),l()},lang:u,color:c,onSubmit:(e,t)=>{p(e,t),N(!1),B()},onCancel:()=>{N(!1),B(),w&&w()},getTimeDisplay:L,timeZone:_,timestamp:P,getDateDisplay:V,dateSelectItemCount:x,getDisplay:L,validateTime:M,fontWeights:y}):m.default.createElement(m.default.Fragment,null,m.default.createElement("div",{className:`${E["datetimepicker-open-container"]} ${F?"":E.hidden}`},m.default.createElement("div",{className:F?`${E["top-row-container"]} datetimepicker-top-row`:`${E.hidden} datetimepicker-top-row`}," ",m.default.createElement("span",{role:"alert",className:E["sr-only"],ref:A}),m.default.createElement("span",null),m.default.createElement("span",{className:E["departure-or-arrival-container"]},m.default.createElement("label",{htmlFor:`${W}-departure`,className:`${E["radio-textbutton-label"]}\n ${E["departure"===a?"active":void 0]}`},g.default.t("departure",D),m.default.createElement("input",{id:`${W}-departure`,name:"departureOrArrival",type:"radio",value:"departure",className:E["radio-textbutton"],onChange:()=>{o()},checked:"departure"===a})),m.default.createElement("label",{htmlFor:`${W}-arrival`,className:`${E["radio-textbutton-label"]}\n ${E["arrival"===a?"active":void 0]}`},g.default.t("arrival",D),m.default.createElement("input",{id:`${W}-arrival`,name:"departureOrArrival",type:"radio",value:"arrival",className:E["radio-textbutton"],onChange:()=>{r()},checked:"arrival"===a}))),m.default.createElement("button",{id:`${W}-now`,type:"button",className:E["departure-now-button"],onClick:()=>{N(!1),B(),w&&w(),l()},ref:$},g.default.t("departure-now",D)),m.default.createElement("span",{className:E["right-edge"]},m.default.createElement("button",{type:"button",className:E["close-button"],"aria-controls":`${W}-root`,"aria-expanded":"true",onClick:()=>{N(!1),B(),w&&w()}},m.default.createElement("span",{className:E["close-icon"]},m.default.createElement(h.default,{img:"close",color:c})),m.default.createElement("span",{className:E["sr-only"]},g.default.t("accessible-close",D))))),m.default.createElement("div",{className:F?`${E["picker-container"]}`:`${E.hidden} datetimepicker-top-row`},m.default.createElement(m.default.Fragment,null,m.default.createElement("span",{className:E["combobox-left"]},m.default.createElement(C,{value:P,onChange:e=>{i(e)},getDisplay:V,timeChoices:K,validate:()=>null,icon:m.default.createElement("span",{className:`${E["combobox-icon"]} ${E["date-input-icon"]}`},m.default.createElement(h.default,{img:"calendar",color:c})),id:`${W}-date`,label:g.default.t("date",D),disableTyping:!0,timeZone:_})),m.default.createElement("span",{className:E["combobox-right"]},m.default.createElement(C,{value:P,onChange:e=>{t(e)},getDisplay:L,timeChoices:H,validate:M,icon:m.default.createElement("span",{className:`${E["combobox-icon"]} ${E["time-input-icon"]}`},m.default.createElement(h.default,{img:"time",color:c})),id:`${W}-time`,label:g.default.t("time",D),timeZone:_}))))),m.default.createElement("span",{className:F?"":E.hidden},d),m.default.createElement("div",{className:F?"datetimepicker-bottom-row-open":""})))}function O({realtime:e,initialArriveBy:t,initialTimestamp:i,onDepartureClick:a,onArrivalClick:l,onTimeChange:o,onDateChange:r,onNowClick:s,embedWhenClosed:d,embedWhenOpen:u,lang:c,color:_,timeZone:p,fontWeights:b,serviceTimeRange:g,onOpen:h,onClose:x,openPicker:v}){f.default.locale(c),f.default.tz.setDefault(p);const w=e?null:f.default().valueOf(),[k,E]=n.useState(i?1e3*i:w),[C,R]=n.useState(!0===t?"arrival":"departure");n.useEffect((()=>{const e=null===k&&void 0===i,n=null===k||void 0===i,a=Math.round(k/1e3)===i;!e&&(n||!a)&&E(void 0===i?null:1e3*i),!t==("arrival"===C)&&R(!0===t?"arrival":"departure")}),[i,t]);const F=y.default((e=>{if(null===e)return E(f.default().valueOf()),void o(Math.round(f.default().valueOf()/1e3),"arrival"===C);E(e),o(Math.round(e/1e3),"arrival"===C)}),10),N=y.default((e=>{if(null===e)return E(f.default().valueOf()),void r(Math.round(f.default().valueOf()/1e3),"arrival"===C);E(e),r(Math.round(e/1e3),"arrival"===C)}),10);return m.default.createElement(G,{timestamp:k,onTimeChange:F,onDateChange:N,departureOrArrival:C,onNowClick:()=>{R("departure");const t=e?null:f.default().valueOf();E(t),s(Math.round(t/1e3))},onDepartureClick:()=>{let e=!1,t=k;if(null===k){const n=f.default().valueOf();E(n),t=n,e=!0}"departure"!==C&&(R("departure"),e=!0),e&&a(Math.round(t/1e3))},onArrivalClick:()=>{let e=!1,t=k;if(null===k){const n=f.default().valueOf();E(n),t=n,e=!0}"arrival"!==C&&(R("arrival"),e=!0),e&&l(Math.round(t/1e3))},embedWhenClosed:d,embedWhenOpen:u,lang:c,color:_,timeZone:p,onModalSubmit:(e,t)=>{E(e),R(t),o(e/1e3,"arrival"===t,!0)},fontWeights:b,serviceTimeRange:g,onOpen:h,onClose:x,openPicker:v})}"production"!==process.env.NODE_ENV&&(N.propTypes={value:p.default.number.isRequired,getDisplay:p.default.func.isRequired,onChange:p.default.func.isRequired,itemCount:p.default.number.isRequired,startTime:p.default.number.isRequired,id:p.default.string.isRequired,label:p.default.string.isRequired,icon:p.default.node,dateTimeCombined:p.default.bool,timeZone:p.default.string}),N.defaultProps={icon:null,dateTimeCombined:!1,timeZone:"Europe/Helsinki"},"production"!==process.env.NODE_ENV&&(P.propTypes={value:p.default.number.isRequired,getDisplay:p.default.func.isRequired,onChange:p.default.func.isRequired,id:p.default.string.isRequired,label:p.default.string.isRequired,icon:p.default.node,timeZone:p.default.string,validate:p.default.func.isRequired}),P.defaultProps={icon:null,timeZone:"Europe/Helsinki"},f.default.locale("en"),g.default.init({lng:"en",resources:{}}),Object.keys(R).forEach((e=>g.default.addResourceBundle(e,"translation",R[e]))),"production"!==process.env.NODE_ENV&&(S.propTypes={timeZone:p.default.string,departureOrArrival:p.default.oneOf(["departure","arrival"]).isRequired,onNowClick:p.default.func.isRequired,lang:p.default.string.isRequired,color:p.default.string,onSubmit:p.default.func.isRequired,onCancel:p.default.func.isRequired,timestamp:p.default.number.isRequired,getTimeDisplay:p.default.func.isRequired,dateSelectItemCount:p.default.number.isRequired,getDateDisplay:p.default.func.isRequired,validateTime:p.default.func.isRequired,fontWeights:p.default.shape({medium:p.default.number.isRequired}).isRequired}),S.defaultProps={color:"#007ac9",timeZone:"Europe/Helsinki"},f.default.locale("en"),g.default.init({lng:"fi",fallbackLng:"fi",defaultNS:"translation",interpolation:{escapeValue:!1}}),"production"!==process.env.NODE_ENV&&(G.propTypes={timestamp:p.default.number,timeZone:p.default.string,onTimeChange:p.default.func.isRequired,onDateChange:p.default.func.isRequired,departureOrArrival:p.default.oneOf(["departure","arrival"]).isRequired,onNowClick:p.default.func.isRequired,onDepartureClick:p.default.func.isRequired,onArrivalClick:p.default.func.isRequired,embedWhenClosed:p.default.node,embedWhenOpen:p.default.node,lang:p.default.string.isRequired,color:p.default.string,onModalSubmit:p.default.func.isRequired,fontWeights:p.default.shape({medium:p.default.number.isRequired}).isRequired,serviceTimeRange:p.default.number,onOpen:p.default.func,onClose:p.default.func,openPicker:p.default.bool}),G.defaultProps={timestamp:null,embedWhenClosed:null,embedWhenOpen:null,color:"#007ac9",timeZone:"Europe/Helsinki",serviceTimeRange:30,onOpen:null,onClose:null,openPicker:void 0},"production"!==process.env.NODE_ENV&&(O.propTypes={realtime:p.default.bool,initialTimestamp:p.default.number,initialArriveBy:p.default.bool,onDepartureClick:p.default.func.isRequired,onArrivalClick:p.default.func.isRequired,onTimeChange:p.default.func.isRequired,onDateChange:p.default.func.isRequired,onNowClick:p.default.func.isRequired,embedWhenClosed:p.default.node,embedWhenOpen:p.default.node,lang:p.default.string,color:p.default.string,timeZone:p.default.string,fontWeights:p.default.shape({medium:p.default.number}),serviceTimeRange:p.default.number,onOpen:p.default.func,onClose:p.default.func,openPicker:p.default.bool}),O.defaultProps={realtime:!1,initialArriveBy:void 0,initialTimestamp:void 0,embedWhenClosed:null,embedWhenOpen:null,lang:"en",color:"#007ac9",timeZone:"Europe/Helsinki",fontWeights:{medium:500},onOpen:null,onClose:null,openPicker:void 0},e.default=O,Object.defineProperty(e,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=index.js.map