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AACiB,EAAAC,aAAY,CAACC,YAAY,sC","sources":["src/DirectRental/CreditCheckMaintenanceWarning.tsx"],"sourcesContent":["import * as React from 'react';\nimport { IUseResourceTexts, ResourceText, withResourceTextSupport } from '../Components/ResourceText';\n\nexport interface ICreditCheckMaintenanceWarningProps {\n\twrapInAtomCard?: boolean;\n}\n\ntype Props = IUseResourceTexts & ICreditCheckMaintenanceWarningProps;\n\nfunction CreditCheckMaintenanceWarning(props: Props) {\n\tconst manualWarning = props.getResourceText(`CreditCheck_MaintenanceNotice_Manual`, undefined, {\n\t\toptional: true,\n\t});\n\tconst shouldShowManualWarning = !!manualWarning;\n\n\tif (!shouldShowAutomaticWarning() && !shouldShowManualWarning) {\n\t\treturn null;\n\t}\n\n\tif (props.wrapInAtomCard) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<br />\n\t\t\t\t<br />\n\t\t\t\t<div className=\"atom-card -noGrid -alignCenter -lessPadding\">{innerRender()}</div>\n\t\t\t</>\n\t\t);\n\t} else {\n\t\treturn innerRender();\n\t}\n\n\tfunction innerRender() {\n\t\treturn (\n\t\t\t<div className=\"atom-infoBox -alignCenter -bordered\">\n\t\t\t\t<svg\n\t\t\t\t\tclassName=\"atom-infoBox__icon\"\n\t\t\t\t\twidth=\"30\"\n\t\t\t\t\theight=\"30\"\n\t\t\t\t\tviewBox=\"0 0 30 30\"\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t>\n\t\t\t\t\t<g transform=\"translate(1 1)\" fill=\"none\" fillRule=\"evenodd\">\n\t\t\t\t\t\t<circle stroke=\"#CF3F6C\" strokeWidth=\"2\" strokeLinecap=\"square\" cx=\"14\" cy=\"14\" r=\"14\" />\n\t\t\t\t\t\t<path d=\"M13.5 6v11\" stroke=\"#CF3F6C\" strokeWidth=\"2\" strokeLinecap=\"square\" />\n\t\t\t\t\t\t<circle fill=\"#CF3F6C\" fillRule=\"nonzero\" cx=\"13.5\" cy=\"21.5\" r=\"1.5\" />\n\t\t\t\t\t</g>\n\t\t\t\t</svg>\n\t\t\t\t<p className=\"atom-infoBox__text\">\n\t\t\t\t\t{shouldShowManualWarning ? (\n\t\t\t\t\t\tmanualWarning\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<ResourceText resourceKey=\"CreditCheck_MaintenanceNotice\" />\n\t\t\t\t\t)}\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tfunction shouldShowAutomaticWarning() {\n\t\tconst now = new Date();\n\t\tif (now.getDay() !== 1) {\n\t\t\t// not monday? no maintenance\n\t\t\treturn false;\n\t\t}\n\t\tconst time = new Intl.DateTimeFormat('fi-FI', { timeZone: 'Europe/Helsinki', hour: 'numeric' }).format(now);\n\t\tconst hour = parseInt(time);\n\t\treturn hour >= 4 && hour < 7;\n\t}\n}\n\nexport default withResourceTextSupport(CreditCheckMaintenanceWarning);\n"],"names":["$ed3kz","parcelRequire","$fc0cc794ce8562e7$export$2e2bcd8739ae039","withResourceTextSupport","props","manualWarning","getResourceText","undefined","optional","shouldShowManualWarning","now","Date","getDay","time","Intl","DateTimeFormat","timeZone","hour","format","parseInt","shouldShowAutomaticWarning","wrapInAtomCard","jsxs","Fragment","jsx","className","innerRender","width","height","viewBox","xmlns","transform","fill","fillRule","stroke","strokeWidth","strokeLinecap","cx","cy","r","d","$jjuiK","ResourceText","resourceKey"],"version":3,"file":"DirectRental.1fd0426e.js.map"}