{"version":3,"sources":["containers/RexelLogin/LoginForm.js","_platform/src/components/MessageBox/MessageBox.js","_platform/src/components/FormHint/FormHint.js","_platform/src/components/FormPlaceholder/FormPlaceholder.js","_platform/src/components/FormHelpText/FormHelpText.js","_platform/src/components/FormLabel/FormLabel.js","_platform/src/components/Button/Button.js","_platform/src/utils/formValidation.js","_platform/src/utils/sanitiseHTML.js","../node_modules/final-form-focus/dist/final-form-focus.es.js","_platform/src/components/FormInput/FormInput.js","_platform/src/components/FormSelect/FormSelect.js","_platform/src/components/StatusMessage/StatusMessage.js"],"names":["defaultFormLabels","labelUserName","labelPassword","webStores","value","label","forgotUsernameUrl","forgotPasswordUrl","registrationUrl","notifyWebstore","toast","autoClose","closeOnClick","position","handleEnter","submitButton","document","getElementById","focus","focusOnError","createDecorator","LoginForm","props","initialValues","onSubmitForm","status","labels","Object","_codebuild_output_src3729189661_src_Rexel_Online_Advantage_Lori_FED_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__","formLabels","react__WEBPACK_IMPORTED_MODULE_1___default","a","createElement","className","react_final_form__WEBPACK_IMPORTED_MODULE_3__","onSubmit","decorators","subscription","submitting","values","validate","errors","map","field","render","_ref","handleSubmit","method","name","component","FormSelect","required","placeholder","disabled","options","onKeyPress","e","key","assign","target","rel","selectedStore","webstore","find","store","href","onClick","window","open","FormInput","type","usernameUrl","passwordUrl","_platform_src_components_StatusMessage_StatusMessage__WEBPACK_IMPORTED_MODULE_9__","variant","statusDetails","_platform_src_components_Button_Button__WEBPACK_IMPORTED_MODULE_6__","id","defaultProps","theme","settingsApp","withTheme","StyledAlert","styled","Alert","_templateObject","Title","div","_templateObject2","Multiline","_templateObject3","MessageBox","children","_ref$title","title","undefined","_ref$variant","Hint","concat","StyledHint","customInputHintColor","gray600","customInputHintFontSize","react__WEBPACK_IMPORTED_MODULE_0__","__webpack_require__","react__WEBPACK_IMPORTED_MODULE_0___default","n","_smooth_ui_core_sc__WEBPACK_IMPORTED_MODULE_1__","FormPlaceholder","inline","py","pl","FormHelpText","StyledFormHelpText","htmlValue","dangerouslySetInnerHTML","__html","sanitiseHTML","Indicator","span","withConfig","displayName","componentId","formPreferOptionalIndicator","CustomLabel","react__WEBPACK_IMPORTED_MODULE_2___default","_StyledLabel","htmlFor","isRequiredIndicator","isRequired","preferOptional","optionalText","formIndicatorOptionalText","requiredText","formIndicatorRequiredText","ButtonBlock","Box","buttonBlockSpacerTop","buttonBlockSpacerBottom","buttonBlockHasSeparator","buttonBlockSpacerInner","buttonSeparatorColor","StyledButton","Button","customInputBtnFontWeight","minWidth","inputBtnMinWidth","p","controlFocus","th","propTypes","PropTypes","bool","string","object","d","__webpack_exports__","isValid","touched","valid","dompurify__WEBPACK_IMPORTED_MODULE_0__","dompurify__WEBPACK_IMPORTED_MODULE_0___default","dompurify","addHook","node","setAttribute","hasAttribute","final_form__WEBPACK_IMPORTED_MODULE_0__","isFocusableInput","wtf","getAllInputs","Array","prototype","slice","call","forms","reduce","accumulator","form","filter","findInput","inputs","input","noop","getInputs","findInput$$1","focusOnFirstError","firstInput","originalSubmit","submit","state","unsubscribe","subscribe","nextState","submitErrors","afterSubmit","_state","keys","length","result","then","StyledInput","inputInline","_codebuild_output_src3729189661_src_Rexel_Online_Advantage_Lori_FED_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_5__","react__WEBPACK_IMPORTED_MODULE_7___default","_smooth_ui_core_sc__WEBPACK_IMPORTED_MODULE_9__","css","primary","_this$props","this","immutable","meta","helpText","hint","iHaveSuppliedAnExternalLabel","rest","_components_FormHelpText_FormHelpText__WEBPACK_IMPORTED_MODULE_10__","_components_FormLabel_FormLabel__WEBPACK_IMPORTED_MODULE_12__","_components_FormHint_FormHint__WEBPACK_IMPORTED_MODULE_11__","_components_FormPlaceholder_FormPlaceholder__WEBPACK_IMPORTED_MODULE_13__","control","error","Component","StyledSelect","Select","danger","success","selectIfOnlyOption","_codebuild_output_src3729189661_src_Rexel_Online_Advantage_Lori_FED_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__","multi","onChange","currentValue","isArray","item","indexOf","option","_smooth_ui_core_sc__WEBPACK_IMPORTED_MODULE_5__","_components_FormHelpText_FormHelpText__WEBPACK_IMPORTED_MODULE_6__","_components_FormLabel_FormLabel__WEBPACK_IMPORTED_MODULE_8__","_components_FormHint_FormHint__WEBPACK_IMPORTED_MODULE_7__","_components_FormPlaceholder_FormPlaceholder__WEBPACK_IMPORTED_MODULE_9__","classNamePrefix","isClearable","isDisabled","isMulti","o","_components_MessageBox_MessageBox__WEBPACK_IMPORTED_MODULE_1__","StatusMessage"],"mappings":"4MAqCMA,EAAoB,CACxBC,cAAe,WACfC,cAAe,YAGXC,EAAY,CAChB,CACEC,MAAO,MACPC,MAAO,QACPC,kBAAmB,wDACnBC,kBAAmB,gDACnBC,gBAAiB,yCAEnB,CACEJ,MAAO,MACPC,MAAO,eACPC,kBAAmB,sDACnBC,kBAAmB,8CACnBC,gBAAiB,uCAEnB,CACEJ,MAAO,MACPC,MAAO,mBACPC,kBACE,+DACFC,kBAAmB,uDACnBC,gBAAiB,gDAEnB,CACEJ,MAAO,MACPC,MAAO,eACPC,kBACE,4DACFC,kBAAmB,oDACnBC,gBAAiB,8CAYfC,EAAiB,WACrBC,YAAM,QAAS,2BAA4B,CACzCC,UAAW,IACXC,cAAc,EACdC,SAAU,mBAoBRC,EAAc,WAClB,IAAMC,EAAeC,SAASC,eAAe,gBAEzCF,GACFA,EAAaG,SAIXC,EAAeC,cAEfC,EAAY,SAAAC,GAAS,IACjBC,EAAwCD,EAAxCC,cAAeC,EAAyBF,EAAzBE,aAAcC,EAAWH,EAAXG,OAC/BC,EAAMC,OAAAC,EAAA,EAAAD,CAAA,GAAQ3B,EAAsBsB,EAAMO,YACxC5B,EAAiCyB,EAAjCzB,cAAeC,EAAkB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AAW4B,aAAe,CACxBsI,cAAUrH,EACVsH,KAAM,GACNH,WAAW,EACXlF,yBAAqBjC,EACrB1F,WAAO0F,EACPzC,aAASyC,EACToI,oBAAoB,GAGPjL,wCC9Nf,IAAAqD,EAAAC,EAAA,GAAAC,EAAAD,EAAAE,EAAAH,GAAA+I,EAAA9I,EAAA,KAIM+I,EAAgB,SAAAjO,GACpB,OAAKA,EAAMsE,WAEc,YAAlBtE,EAAMoD,SAA2C,UAAlBpD,EAAMoD,SAC1C+B,EAAA1E,EAAAC,cAACsN,EAAA,EAAehO,GAHU,MAW9BiO,EAAczK,aAAe,CAC3BJ,aAASqB,GAGIwJ","file":"static/js/loginForm.fb18cb2c.chunk.js","sourcesContent":["/* eslint-disable jsx-a11y/click-events-have-key-events */\n/**\n * LoginForm\n *\n * This component relies on a LoginProvider-like component to supply data and\n * the submit methods via props.\n *\n * Usage:\n *\n * \n * \n * \n *\n * disableMeta on the LoginProvider, and formLabels on this component are optional props\n */\n\n// Core imports\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\n// Style, SEO and settings\nimport { withTheme } from '@smooth-ui/core-sc';\n\n// Component features\nimport { Form, Field } from 'react-final-form';\nimport createDecorator from 'final-form-focus';\nimport { required } from '_platform/src/utils/formValidation'; // _platform\nimport Button from '_platform/src/components/Button/Button'; // _platform\nimport FormSelect from '_platform/src/components/FormSelect/FormSelect'; // _platform\nimport FormInput from '_platform/src/components/FormInput/FormInput'; // _platform\nimport StatusMessage from '_platform/src/components/StatusMessage/StatusMessage'; // _platform\nimport toast from '_platform/src/utils/toast';\n\n// Default form labels\n// These will be _shallow merged_ with props.formLabels (if provided)\n// Usage (from parent component):\n// \nconst defaultFormLabels = {\n labelUserName: 'Username',\n labelPassword: 'Password',\n};\n\nconst webStores = [\n {\n value: 'are',\n label: 'Rexel',\n forgotUsernameUrl: 'https://www.rexel.com.au/are/login/forgotten-username',\n forgotPasswordUrl: 'https://www.rexel.com.au/are/login/pw/request',\n registrationUrl: 'https://www.rexel.com.au/are/register',\n },\n {\n value: 'ajt',\n label: 'John R. Turk',\n forgotUsernameUrl: 'https://www.jrt.com.au/ajt/login/forgotten-username',\n forgotPasswordUrl: 'https://www.jrt.com.au/ajt/login/pw/request',\n registrationUrl: 'https://www.jrt.com.au/ajt/register',\n },\n {\n value: 'aie',\n label: 'Ideal Electrical',\n forgotUsernameUrl:\n 'https://www.idealelectrical.com/aie/login/forgotten-username',\n forgotPasswordUrl: 'https://www.idealelectrical.com/aie/login/pw/request',\n registrationUrl: 'https://www.idealelectrical.com/aie/register',\n },\n {\n value: 'als',\n label: 'Lear & Smith',\n forgotUsernameUrl:\n 'https://www.learsmith.com.au/als/login/forgotten-username',\n forgotPasswordUrl: 'https://www.learsmith.com.au/als/login/pw/request',\n registrationUrl: 'https://www.learsmith.com.au/als/register',\n },\n];\n\nconst registrationUrl = values => {\n const selectedStore =\n values &&\n values.webstore &&\n webStores.find(store => store.value === values.webstore);\n return selectedStore ? { href: selectedStore.registrationUrl } : {};\n};\n\nconst notifyWebstore = () => {\n toast('error', 'Please select a Webstore', {\n autoClose: 2000,\n closeOnClick: true,\n position: 'bottom-center',\n });\n};\n\nconst usernameUrl = values => {\n const selectedStore =\n values &&\n values.webstore &&\n webStores.find(store => store.value === values.webstore);\n return selectedStore ? { href: selectedStore.forgotUsernameUrl } : {};\n};\n\nconst passwordUrl = values => {\n const selectedStore =\n values &&\n values.webstore &&\n webStores.find(store => store.value === values.webstore);\n return selectedStore ? { href: selectedStore.forgotPasswordUrl } : {};\n};\n\nconst handleEnter = () => {\n const submitButton = document.getElementById('submitButton');\n\n if (submitButton) {\n submitButton.focus();\n }\n};\n\nconst focusOnError = createDecorator();\n\nconst LoginForm = props => {\n const { initialValues, onSubmitForm, status } = props;\n const labels = { ...defaultFormLabels, ...props.formLabels }; // Merge props with default values\n const { labelUserName, labelPassword } = labels;\n // We could avoid merging into the labels const, then destructuring it, however leaving as 2 steps for legibility\n\n return (\n
\n {\n const errors = {};\n const requiredFields = ['webstore', 'username', 'password'];\n\n requiredFields.map(field =>\n !values[field] ? (errors[field] = 'Required') : false\n );\n\n return errors;\n }}\n render={({ handleSubmit, submitting, values }) => (\n
\n {\n if (e.key === 'Enter') handleEnter();\n }}\n />\n
\n {\n values && values.webstore\n ? window.open(\n webStores.find(store => store.value === values.webstore)\n .registrationUrl,\n '_blank'\n )\n : notifyWebstore();\n }}\n >\n No Webstore account? Register here\n \n
\n {\n if (e.key === 'Enter') handleEnter();\n }}\n />\n
\n {\n values && values.webstore\n ? window.open(\n webStores.find(store => store.value === values.webstore)\n .forgotUsernameUrl,\n '_blank'\n )\n : notifyWebstore();\n }}\n >\n Forgot Username\n \n
\n {\n if (e.key === 'Enter') handleEnter();\n }}\n />\n
\n {\n values && values.webstore\n ? window.open(\n webStores.find(store => store.value === values.webstore)\n .forgotPasswordUrl,\n '_blank'\n )\n : notifyWebstore();\n }}\n >\n Forgot Password\n \n
\n \n {status.statusDetails ||\n (status.status === 'error' &&

{status.statusDetails}

)}\n
\n \n \n )}\n />\n
\n );\n};\nLoginForm.propTypes = {\n formLabels: PropTypes.shape({\n labelUserName: PropTypes.string,\n labelPassword: PropTypes.string,\n labelRememberMe: PropTypes.string,\n }),\n initialValues: PropTypes.object,\n onSubmitForm: PropTypes.func.isRequired,\n status: PropTypes.object.isRequired,\n theme: PropTypes.object,\n};\n\nLoginForm.defaultProps = {\n formLabels: defaultFormLabels,\n initialValues: {},\n theme: { settingsApp: {} },\n};\n\nexport default withTheme(LoginForm);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Alert, styled } from '@smooth-ui/core-sc';\n\nconst StyledAlert = styled(Alert)`\n margin-top: 1rem;\n`;\n\nexport const Title = styled.div`\n font-weight: bold;\n`;\n\nexport const Multiline = styled.div`\n white-space: pre-line;\n`;\n\nconst MessageBox = ({ children, title = undefined, variant = 'primary' }) => {\n return (\n \n {title ? {title} : null}\n {children}\n \n );\n};\n\nMessageBox.propTypes = {\n children: PropTypes.node.isRequired,\n title: PropTypes.string,\n variant: PropTypes.string,\n};\n\nMessageBox.defaultProps = {\n title: undefined,\n variant: 'primary',\n};\n\nexport default MessageBox;\n","/**\n * FormInput Hint\n *\n * Used to display a hint above the input box\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@smooth-ui/core-sc';\n\nconst Hint = props => (\n
{props.children}
\n);\n\nHint.propTypes = {\n children: PropTypes.node.isRequired,\n className: PropTypes.string,\n};\n\nHint.defaultProps = {\n className: '',\n};\n\nconst StyledHint = styled(Hint)`\n color: ${props => props.theme.customInputHintColor || props.theme.gray600};\n font-size: ${props => props.theme.customInputHintFontSize || '0.875em'};\n margin-bottom: 0.5em;\n`;\n\nexport default StyledHint;\n","/**\n * FormPlaceholder\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { Box } from '@smooth-ui/core-sc';\n\nconst FormPlaceholder = ({ children, inline }) => (\n \n {children}\n \n);\n\nFormPlaceholder.propTypes = {\n children: PropTypes.node,\n inline: PropTypes.bool,\n};\n\nFormPlaceholder.defaultProps = {\n children: undefined,\n inline: undefined,\n};\n\nexport default FormPlaceholder;\n","/**\n * Form Fields Help Text\n *\n * Used to display a help text above the input label\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@smooth-ui/core-sc';\nimport sanitiseHTML from '_platform/src/utils/sanitiseHTML';\n\nconst FormHelpText = props => (\n \n {props.htmlValue && (\n \n )}\n {props.children}\n \n);\n\nFormHelpText.propTypes = {\n children: PropTypes.node,\n className: PropTypes.string,\n htmlValue: PropTypes.string,\n};\n\nFormHelpText.defaultProps = {\n children: undefined,\n className: '',\n htmlValue: undefined,\n};\n\nconst StyledFormHelpText = styled.div`\n &.helptext-as-label {\n display: inline;\n\n > div {\n display: inline;\n }\n }\n\n :not(.helptext-as-label) {\n margin-bottom: 0.5em;\n margin-top: 1.5em;\n }\n`;\n\nexport default FormHelpText;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Label, styled, withTheme } from '@smooth-ui/core-sc';\nimport 'styled-components/macro'; // For the CSS prop on elements\n\nconst Indicator = styled.span`\n ${props =>\n props.theme.settingsApp.formPreferOptionalIndicator\n ? `\n font-weight: normal;\n padding-left: 0.25em;\n `\n : 'color: red;'}\n`;\n\nconst whichIndicator = (\n isRequired,\n preferOptional,\n optionalText,\n requiredText\n) => {\n if (isRequired === undefined) return null;\n\n if (isRequired && !preferOptional) {\n return requiredText;\n }\n if (!isRequired && preferOptional) {\n return optionalText;\n }\n return null;\n};\n\nconst CustomLabel = props => {\n return (\n \n {props.children}:\n \n {whichIndicator(\n props.isRequiredIndicator,\n props.theme.settingsApp.formPreferOptionalIndicator,\n props.theme.settingsApp.formIndicatorOptionalText,\n props.theme.settingsApp.formIndicatorRequiredText\n )}\n \n \n );\n};\n\nCustomLabel.propTypes = {\n children: PropTypes.node.isRequired,\n htmlFor: PropTypes.string.isRequired,\n isRequiredIndicator: PropTypes.bool,\n theme: PropTypes.object.isRequired,\n};\n\nCustomLabel.defaultProps = {\n isRequiredIndicator: undefined,\n};\n\nexport default withTheme(CustomLabel);\n","/**\n * Button\n */\nimport PropTypes from 'prop-types';\nimport { Box, Button, controlFocus, styled, th } from '@smooth-ui/core-sc';\n\n// Button Block\nexport const ButtonBlock = styled(Box)`\n margin-top: ${props => props.theme.buttonBlockSpacerTop || '2rem'};\n margin-bottom: ${props => props.theme.buttonBlockSpacerBottom || '1rem'};\n\n ${props =>\n !!props.theme.buttonBlockHasSeparator\n ? `\n padding-top: ${props.theme.buttonBlockSpacerInner || '1.5rem'};\n border-top: 1px solid ${props.theme.buttonSeparatorColor || '#dee2e6'};\n `\n : null};\n`;\n\nconst StyledButton = styled(Button)`\n ${props => props.disabled && `cursor: not-allowed;`}\n ${props =>\n props.theme.customInputBtnFontWeight &&\n `font-weight: ${props.theme.customInputBtnFontWeight};`}\n margin-top: 1px;\n min-width: ${props => props.minWidth || props.theme.inputBtnMinWidth};\n text-align: center;\n\n &:focus {\n ${p => controlFocus(th(p.variant)(p))(p)}\n }\n`;\n\nStyledButton.propTypes = {\n disabled: PropTypes.bool,\n minWidth: PropTypes.string,\n theme: PropTypes.object,\n};\nexport default StyledButton;\n","/**\n * Form Validation utilities\n */\n\n// Return `valid` value as expected by control inputs Smooth-UI\nexport const isValid = (touched, valid) => {\n if (!touched) return undefined;\n if (valid) return true;\n if (!valid) return false;\n};\n\n// Required\nexport const required = value => (value ? undefined : 'Required');\n\n// Required with custom message\n// Usage: field.required && requiredWithMessage(field.requiredMessage || 'Required')\n// Check if the field is required, if so issue requiredWithMessage.\n// IMPORTANT: Must provide fallback message, otherwise the method won't run\nexport const requiredWithMessage = message => value =>\n value ? undefined : message;\n\n// Email address - matching the API\nexport const validEmail = value =>\n /\\b[a-zA-Z0-9._%\\-+NULL]+@[a-zA-Z0-9.\\-]+\\.[a-zA-Z]{2,6}\\b/.test(value) // eslint-disable-line no-useless-escape\n ? undefined\n : 'Please enter a valid email address';\n\n// Numbers only\nexport const validNumber = value =>\n isNaN(value) ? 'Must be a number' : undefined;\n\n// Minimum value\n// Usage: minValue(20)\nexport const minValue = min => value =>\n isNaN(value) || value >= min ? undefined : `Must be greater than ${min}`;\n\n// Compose validators\n// Usage: composeValidators(required, validNumber, minValue(20))\nexport const composeValidators = (...validators) => value =>\n validators.reduce((error, validator) => error || validator(value), undefined);\n","import dompurify from 'dompurify';\n\n// Add a hook to make all links open a new window\ndompurify.addHook('afterSanitizeAttributes', function(node) {\n // set all elements owning target to target=_blank\n if ('target' in node) {\n node.setAttribute('target', '_blank');\n // prevent https://www.owasp.org/index.php/Reverse_Tabnabbing\n node.setAttribute('rel', 'noopener noreferrer');\n }\n // set non-HTML/MathML links to xlink:show=new\n if (\n !node.hasAttribute('target') &&\n (node.hasAttribute('xlink:href') || node.hasAttribute('href'))\n ) {\n node.setAttribute('xlink:show', 'new');\n }\n});\n\nexport default dompurify.sanitize;\n","import { getIn } from 'final-form'; // \n\n/**\n * Predicate to identify inputs that can have focus() called on them\n */\n\nvar isFocusableInput = function isFocusableInput(wtf) {\n return !!(wtf && typeof wtf.focus === 'function');\n}; // \n\n/**\n * Gets all the inputs inside all forms on the page\n */\n\n\nvar getAllInputs = function getAllInputs() {\n if (typeof document === 'undefined') {\n return [];\n }\n\n return Array.prototype.slice.call(document.forms).reduce(function (accumulator, form) {\n return accumulator.concat(Array.prototype.slice.call(form).filter(isFocusableInput));\n }, []);\n}; // \n\n/**\n * Finds the input by looking if the name attribute path is existing in the errors object\n */\n\n\nvar findInput = function findInput(inputs, errors) {\n return inputs.find(function (input) {\n return input.name && getIn(errors, input.name);\n });\n}; // \n\n\nvar noop = function noop() {};\n\nvar createDecorator = function createDecorator(getInputs, findInput$$1) {\n return function (form) {\n var focusOnFirstError = function focusOnFirstError(errors) {\n if (!getInputs) {\n getInputs = getAllInputs;\n }\n\n if (!findInput$$1) {\n findInput$$1 = findInput;\n }\n\n var firstInput = findInput$$1(getInputs(), errors);\n\n if (firstInput) {\n firstInput.focus();\n }\n }; // Save original submit function\n\n\n var originalSubmit = form.submit; // Subscribe to errors, and keep a local copy of them\n\n var state = {};\n var unsubscribe = form.subscribe(function (nextState) {\n state = nextState;\n }, {\n errors: true,\n submitErrors: true\n }); // What to do after submit\n\n var afterSubmit = function afterSubmit() {\n var _state = state,\n errors = _state.errors,\n submitErrors = _state.submitErrors;\n\n if (errors && Object.keys(errors).length) {\n focusOnFirstError(errors);\n } else if (submitErrors && Object.keys(submitErrors).length) {\n focusOnFirstError(submitErrors);\n }\n }; // Rewrite submit function\n\n\n form.submit = function () {\n var result = originalSubmit.call(form);\n\n if (result && typeof result.then === 'function') {\n // async\n result.then(afterSubmit, noop);\n } else {\n // sync\n afterSubmit();\n }\n\n return result;\n };\n\n return function () {\n unsubscribe();\n form.submit = originalSubmit;\n };\n };\n}; // \n\n/**\n * Generates a function to get all the inputs in a form with the specified name\n */\n\n\nvar getFormInputs = function getFormInputs(name) {\n return function () {\n if (typeof document === 'undefined') {\n return [];\n } // $FlowFixMe\n\n\n var form = document.forms[name];\n return form && form.length ? Array.prototype.slice.call(form).filter(isFocusableInput) : []; // cast cheat to get from HTMLFormElement children to FocusableInput\n };\n}; //\n\n\nexport default createDecorator;\nexport { getFormInputs };","/**\n * FormInput\n */\n\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport {\n ControlFeedback,\n css,\n FormGroup,\n Input,\n styled,\n} from '@smooth-ui/core-sc';\nimport FormHelpText from '../../components/FormHelpText/FormHelpText'; // _platform\nimport FormHint from '../../components/FormHint/FormHint'; // _platform\nimport FormLabel from '../../components/FormLabel/FormLabel'; // _platform\nimport FormPlaceholder from '../../components/FormPlaceholder/FormPlaceholder'; // _platform\nimport { isValid } from '../../utils/formValidation'; // _platform\n\n// Prevent inputInline from being passed through to DOM\nconst StyledInput = styled(({ inputInline, ...p }) => )`\n ${props =>\n props.inputInline\n ? css`\n display: inline-block;\n width: auto;\n `\n : null}\n\n :hover {\n border-color: ${props =>\n props.valid === undefined ? props.theme.primary : undefined};\n }\n`;\n\nclass FormInput extends Component {\n render() {\n const {\n input,\n inputInline,\n immutable,\n meta,\n helpText,\n label,\n hint,\n iHaveSuppliedAnExternalLabel,\n isRequiredIndicator,\n ...rest\n } = this.props;\n\n if (\n process.env.NODE_ENV === 'development' &&\n !label &&\n !iHaveSuppliedAnExternalLabel\n ) {\n // eslint-disable-next-line no-console\n console.warn(\n `Dev: FormInput '${input && input.name}' does not have label specified`\n );\n }\n\n return (\n \n {helpText && }\n {label ? (\n \n {label}\n \n ) : null}\n {hint ? {hint} : null}\n {immutable && {input.value}}\n {!immutable && (\n \n )}\n\n {meta.touched && !meta.valid ? (\n {meta.error}\n ) : null}\n \n );\n }\n}\n\nFormInput.propTypes = {\n helpText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n hint: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n iHaveSuppliedAnExternalLabel: PropTypes.bool,\n immutable: PropTypes.bool,\n input: PropTypes.object.isRequired,\n inputInline: PropTypes.bool,\n isRequiredIndicator: PropTypes.bool,\n label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n meta: PropTypes.object.isRequired,\n};\n\nFormInput.defaultProps = {\n helpText: undefined,\n hint: '',\n iHaveSuppliedAnExternalLabel: undefined,\n immutable: false,\n inputInline: false,\n isRequiredIndicator: undefined,\n label: undefined,\n};\n\nexport default FormInput;\n","/**\n * FormSelect\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport Select from 'react-select';\nimport {\n ControlFeedback,\n controlFocus,\n css,\n danger,\n FormGroup,\n primary,\n success,\n styled,\n th,\n} from '@smooth-ui/core-sc';\nimport FormHelpText from '../../components/FormHelpText/FormHelpText'; // _platform\nimport FormHint from '../../components/FormHint/FormHint'; // _platform\nimport FormLabel from '../../components/FormLabel/FormLabel'; // _platform\nimport FormPlaceholder from '../../components/FormPlaceholder/FormPlaceholder'; // _platform\n\nconst StyledSelect = styled(Select)`\n .rs__control {\n background-color: ${th('inputBgColor')};\n border-width: ${th('inputBorderWidth')};\n border-color: ${th('inputBorderColor')};\n border-style: solid;\n border-radius: ${th('borderRadius')};\n color: ${th('inputTextColor')};\n padding: 0;\n }\n\n .rs__control:hover {\n border-color: ${th('primary')};\n }\n\n &.rs-invalid .rs__control {\n border-color: ${th('danger')};\n }\n\n .rs__control--is-disabled {\n background-color: ${th('inputDisabledBgColor')};\n color: ${th('inputDisabledText')};\n cursor: default;\n }\n\n .rs__control--is-focused:not(.rs__control--is-disabled) {\n ${p => controlFocus(primary(p))(p)}\n border-color: ${p => primary(p)};\n\n input:focus {\n box-shadow: none;\n }\n }\n\n &.rs-invalid .rs__control--is-focused {\n ${p => controlFocus(danger(p))(p)}\n border-color: ${p => danger(p)};\n }\n\n .rs__placeholder {\n color: ${th('inputPlaceholderText')};\n opacity: 0.54;\n }\n\n &:not(.rs--is-disabled) {\n .rs__input,\n .rs__single-value,\n .rs__menu {\n background-color: ${th('inputBgColor')};\n border-radius: ${th('borderRadius')};\n color: ${th('inputTextColor')};\n }\n }\n\n .rs__menu {\n z-index: 20;\n }\n\n /* Match padding to other inputs */\n .rs__value-container {\n padding: 0.125rem 0.5rem;\n\n .rs__single-value {\n margin-left: 0.25rem;\n }\n }\n\n ${p =>\n p.meta &&\n p.meta.touched &&\n p.meta.valid &&\n css`\n .rs__control {\n border-color: ${success(p)} !important;\n }\n .rs__control--is-focused:not(.rs__control--is-disabled) {\n ${p => controlFocus(success(p))(p)}\n }\n `}\n`;\n\nconst FormSelect = ({\n input,\n meta,\n immutable,\n helpText,\n label,\n hint,\n isRequiredIndicator,\n options,\n selectIfOnlyOption,\n ...rest\n}) => {\n // Select if only option - Auto-select the option if there is only one\n // Use only on required fields, as it forces the value\n if (selectIfOnlyOption && !input.value && options && options.length === 1) {\n if (rest.multi) {\n input.onChange([options[0].value]);\n } else {\n input.onChange(options[0].value);\n }\n }\n\n let currentValue = null;\n\n if (input.value && options && options.length > 0) {\n if (!Array.isArray(input.value)) {\n currentValue = options.find(option => option.value === input.value);\n } else {\n currentValue = options.filter(\n item => input.value.indexOf(item.value) !== -1\n );\n }\n }\n\n if (process.env.NODE_ENV === 'development' && !label) {\n // eslint-disable-next-line no-console\n console.warn(\n `Dev: FormSelect '${input && input.name}' does not have label specified`\n );\n }\n\n return (\n \n {helpText && }\n {label ? (\n \n {label}\n \n ) : null}\n {hint ? {hint} : null}\n {immutable && (\n {currentValue && currentValue.label}\n )}\n {!immutable && (\n 0}\n // value and onChange are needed in order to normalise the values with\n // what is expected at the API endpoints\n // https://github.com/JedWatson/react-select/issues/2920\n value={currentValue}\n onChange={option => {\n if (option) {\n if (Array.isArray(option)) {\n input.onChange(option.map(o => o.value));\n } else {\n input.onChange(option.value);\n }\n } else {\n input.onChange(null);\n }\n }}\n {...rest}\n />\n )}\n {meta.touched && !meta.valid ? (\n {meta.error}\n ) : null}\n \n );\n};\n\nFormSelect.propTypes = {\n helpText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n hint: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n immutable: PropTypes.bool,\n isRequiredIndicator: PropTypes.bool,\n input: PropTypes.object.isRequired,\n label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n meta: PropTypes.object.isRequired,\n options: PropTypes.array,\n selectIfOnlyOption: PropTypes.bool,\n};\n\nFormSelect.defaultProps = {\n helpText: undefined,\n hint: '',\n immutable: false,\n isRequiredIndicator: undefined,\n label: undefined,\n options: undefined,\n selectIfOnlyOption: false,\n};\n\nexport default FormSelect;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport MessageBox from '../../components/MessageBox/MessageBox'; // _platform\n\nconst StatusMessage = props => {\n if (!props.children) return null;\n\n return props.variant === 'success' || props.variant === 'error' ? (\n \n ) : null;\n};\n\nStatusMessage.propTypes = {\n variant: PropTypes.string,\n};\n\nStatusMessage.defaultProps = {\n variant: undefined,\n};\n\nexport default StatusMessage;\n"],"sourceRoot":""}