';\n }\n }\n\n let alertId;\n if (replyMessageStatus) {\n switch (replyMessageStatus.ResponseStatus) {\n case 'Success':\n alertId = 'messaging-twoway-reply-successful';\n break;\n case 'Failed':\n alertId = 'messaging-twoway-reply-request-error';\n break;\n default:\n alertId = 'messaging-twoway-reply-unknown-error';\n break;\n }\n }\n\n return (\n <>\n \n \n {replyMessageStatus &&\n replyMessageStatus.ResponseStatus === 'Success' ? (\n <>\n {' '}\n {messages.length > 1 ? (\n \n ) : (\n ''\n )}{' '}\n {messagingUtility.stripEndQuotes(\n Conversation.Reason.replace(/\\\\/g, ''),\n )}\n >\n ) : (\n ''\n )}\n {replyMessageStatus &&\n replyMessageStatus.ResponseStatus === 'Failed' ? (\n <>\n \n >\n ) : (\n ''\n )}\n \n {replyMessageStatus && (\n \n \"\n defaultText=\"An unknown error occured please check your accounts befor retrying.\"\n contents={{\n Success: {\n defaultValue:\n 'Your message has been sent. Please see details below',\n },\n Failed: {\n defaultValue:\n 'Unfortunately we were unable to send this message at this time.',\n },\n }}\n />\n \n )}\n \n {Conversation.AccountNumber !== 'XXXXXXXXXable' &&\n Conversation.AccountNumber !== '' &&\n Conversation.AccountNumber !== 'Not available' ? (\n <>\n \n \n \n \n {Conversation.AccountNumber + accountSuffix}\n \n >\n ) : (\n ''\n )}\n \n \n \n \n {Conversation.Reference}\n \n
\n \n {messages.map((item, index) => {\n return (\n
\n
\n {item.Sender.SenderType !== 'User'\n ? `${item.Sender.SenderType}`\n : ''}{' '}\n \n \n \n \n {FormatBody(item.Body)}\n \n );\n })}\n
\n \n \n \n \n
\n >\n );\n }\n}\n\nReplyConfirmation.propTypes = {\n accounts: PropTypes.object,\n fetchAccountsIfNeeded: PropTypes.func,\n replyMessageStatus: PropTypes.any,\n transactionData: PropTypes.any,\n transfer: PropTypes.any,\n};\n\nconst mapStateToProps = state => {\n const { messagingTwowayDefinition, accountsDefinition } = state;\n return {\n ...messagingTwowayDefinition,\n ...accountsDefinition,\n };\n};\n\nexport default connect(\n mapStateToProps,\n { ...mapDispatchToPropsMessaging, ...mapDispatchToPropsAccounts },\n)(ReplyConfirmation);\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport { Alert } from 'reactstrap';\nimport {\n mapStateToProps,\n mapDispatchToProps,\n} from '@myie/interact-messaging-twoway';\nimport ReplyConversation from './Reply';\nimport { Utility } from '@myie/interact';\nimport ReplyConfirmation from './Confirmation';\n\nimport PropTypes from 'prop-types';\n\nclass ReplyIndex extends React.Component {\n constructor(props) {\n super(props);\n const {\n match,\n allMessages,\n history,\n viewMessage,\n viewConversation,\n } = this.props;\n let conversation;\n this.state = {\n stage: 'Reply',\n message: null,\n data: {},\n };\n if (allMessages) {\n if (!viewMessage) {\n conversation = allMessages.Conversations.find(function(element) {\n if (element) {\n return (\n Utility.hexEncode(element.ConversationKey.Key) === match.params.id\n );\n }\n return false;\n });\n\n let request = {\n ConversationKey: conversation.ConversationKey,\n ProductType: 'string',\n ExtendedProperties: {},\n };\n viewConversation(request);\n }\n } else {\n const newUrl = '/messaging-twoway/view';\n history.push(newUrl);\n }\n }\n\n static getDerivedStateFromProps(nextProps, prevState) {\n if (nextProps.replyMessageStatus && prevState.stage === 'Reply') {\n return { ...prevState, stage: 'Confirmation' };\n } else return null;\n }\n\n // save the data for the request from several forms\n saveReplyData = (name, value) => {\n const { data } = this.state;\n data[name] = value;\n this.setState({ ...this.state, data, message: null });\n };\n\n // change the stage of the form\n setReplyStage = stage => {\n const { data } = this.state;\n this.setState({ ...this.state, stage, data, message: null });\n };\n\n // select current stage\n currentStage = () => {\n const { stage } = this.state;\n const { match } = this.props;\n\n switch (stage) {\n case 'Reply':\n return (\n \n );\n case 'Confirmation':\n return (\n \n );\n default:\n }\n };\n\n render() {\n const { error } = this.props;\n let alert;\n\n const { message } = this.state;\n if (message || error) {\n alert = (\n \n {message || error}\n \n );\n }\n\n return (\n \n {alert ? { alert } : ''}\n {this.currentStage()}\n
\n );\n }\n}\n\nReplyIndex.propTypes = {\n accounts: PropTypes.any,\n allMessages: PropTypes.any,\n error: PropTypes.any,\n fetchAccountsIfNeeded: PropTypes.any,\n history: PropTypes.any,\n initializeMoveMoney: PropTypes.any,\n match: PropTypes.any,\n replyMessageStatus: PropTypes.any,\n retrivedUserName: PropTypes.object,\n transfer: PropTypes.any,\n viewConversation: PropTypes.any,\n viewMessage: PropTypes.any,\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(ReplyIndex);\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport { Row, Col, Button } from 'reactstrap';\nimport { Link } from 'react-router-dom';\nimport {\n mapStateToProps,\n mapDispatchToProps,\n} from '@myie/interact-messaging-twoway';\nimport { Content } from '@myie/interact-dom';\nimport PropTypes from 'prop-types';\n\nclass DeleteConversation extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n stage: 'View',\n message: null,\n };\n }\n\n confirmDelete = () => {\n const { deleteConversation, viewMessage } = this.props;\n const request = {\n ConversationKey: viewMessage.Conversation.ConversationKey,\n ProductType: 'string',\n ConversationProperties: [\n {\n Name: 'Deleted',\n Value: true,\n },\n ],\n ExtendedProperties: {},\n };\n deleteConversation(request);\n };\n\n // select current stag\n render() {\n const { viewMessage, match } = this.props;\n\n let Conversation;\n\n if (!viewMessage) {\n return null;\n } else {\n Conversation = viewMessage.Conversation;\n }\n\n return (\n \n
\n \n \n
\n \n \n
\n \n \n \n \n \n {Conversation.Reason}\n \n \n \n \n \n {`${Conversation.AccountNumber}${Conversation.SortCode}`}\n \n \n \n \n \n {Conversation.Reference}\n \n
\n
\n \n \n \n \n \n \n
\n
\n );\n }\n}\n\nDeleteConversation.propTypes = {\n baseUrl: PropTypes.any,\n deleteConversation: PropTypes.any,\n history: PropTypes.any,\n match: PropTypes.any,\n setReplyStage: PropTypes.any,\n viewMessage: PropTypes.any,\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(DeleteConversation);\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport PropTypes from 'prop-types';\nimport { Row, Col, Alert } from 'reactstrap';\nimport { Link } from 'react-router-dom';\nimport {\n mapStateToProps,\n mapDispatchToProps,\n} from '@myie/interact-messaging-twoway';\nimport { Content, Switch } from '@myie/interact-dom';\n\nclass DeleteConfirmation extends React.Component {\n render() {\n const { deleteMessageStatus, viewMessage } = this.props;\n let Conversation;\n\n if (!deleteMessageStatus) {\n return null;\n }\n if (viewMessage) {\n Conversation = viewMessage.Conversation;\n }\n\n let alertId;\n if (deleteMessageStatus) {\n switch (deleteMessageStatus.ResponseStatus) {\n case 'Success':\n alertId = 'messaging-twoway-delete-successful';\n break;\n case 'Failed':\n alertId = 'messaging-twoway-delete-request-error';\n break;\n default:\n alertId = 'messaging-twoway-delete-unknown-error';\n break;\n }\n }\n\n return (\n <>\n \n \n \n {deleteMessageStatus && (\n \n \"\n value={deleteMessageStatus.ResponseStatus}\n defaultText=\"An unknown error occured please check your accounts befor retrying.\"\n contents={{\n Success: {\n defaultValue:\n 'Your message has been deleted. See details below',\n },\n Failed: {\n defaultValue:\n 'An error occured while trying to process your request.',\n },\n }}\n />\n \n )}\n {Conversation && (\n \n \n \n \n \n \n {Conversation.Reason}\n \n \n \n \n \n {`${Conversation.AccountNumber}${Conversation.SortCode}`}\n \n \n \n \n \n {Conversation.Reference}\n \n
\n )}\n \n \n \n \n
\n >\n );\n }\n}\n\nDeleteConfirmation.propTypes = {\n deleteMessageStatus: PropTypes.any,\n transactionData: PropTypes.any,\n transfer: PropTypes.any,\n viewMessage: PropTypes.any,\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(DeleteConfirmation);\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport { Row, Col, Alert } from 'reactstrap';\nimport {\n mapStateToProps,\n mapDispatchToProps,\n} from '@myie/interact-messaging-twoway';\nimport DeleteConversation from './Delete';\nimport ReplyConfirmation from './Confirmation';\nimport { Utility } from '@myie/interact';\nimport PropTypes from 'prop-types';\n\nclass DeleteIndex extends React.Component {\n constructor(props) {\n super(props);\n const {\n viewConversation,\n viewMessage,\n history,\n match,\n allMessages,\n } = this.props;\n let conversation;\n this.state = {\n stage: 'Delete',\n message: null,\n data: {},\n };\n\n if (allMessages) {\n if (!viewMessage) {\n conversation = allMessages.Conversations.find(function(element) {\n if (element) {\n return (\n Utility.hexEncode(element.ConversationKey.Key) === match.params.id\n );\n }\n return false;\n });\n\n let request = {\n ConversationKey: conversation.ConversationKey,\n ProductType: 'string',\n ExtendedProperties: {},\n };\n viewConversation(request);\n }\n } else {\n const newUrl = '/messaging-twoway/view';\n history.push(newUrl);\n }\n }\n\n static getDerivedStateFromProps(nextProps, prevState) {\n if (nextProps.deleteMessageStatus && prevState.stage === 'Delete') {\n return { ...prevState, stage: 'Confirmation' };\n } else return null;\n }\n\n // save the data for the request from several forms\n saveReplyData = (name, value) => {\n const { data } = this.state;\n data[name] = value;\n this.setState({ ...this.state, data, message: null });\n };\n\n // change the stage of the form\n setReplyStage = stage => {\n const { data } = this.state;\n this.setState({ ...this.state, stage, data, message: null });\n };\n\n // select current stage\n currentStage = () => {\n const { stage } = this.state;\n const { match } = this.props;\n\n switch (stage) {\n case 'Delete':\n return (\n \n );\n case 'Confirmation':\n return (\n \n );\n default:\n }\n };\n\n render() {\n const { error } = this.props;\n let alert;\n\n const { message } = this.state;\n if (message || error) {\n alert = (\n \n {message || error}\n \n );\n }\n\n return (\n \n \n {alert ? {alert} : ''}\n {this.currentStage()}\n
\n
\n );\n }\n}\n\nDeleteIndex.propTypes = {\n accounts: PropTypes.any,\n allMessages: PropTypes.any,\n deleteMessageStatus: PropTypes.any,\n error: PropTypes.any,\n fetchAccountsIfNeeded: PropTypes.any,\n history: PropTypes.any,\n initializeMoveMoney: PropTypes.any,\n match: PropTypes.any,\n retrivedUserName: PropTypes.object,\n transfer: PropTypes.any,\n viewConversation: PropTypes.any,\n viewMessage: PropTypes.any,\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(DeleteIndex);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport View from './View';\nimport ReplyIndex from './Reply';\nimport DeleteIndex from './Delete';\nimport { Alert } from 'reactstrap';\nimport { Route, Switch } from 'react-router-dom';\nimport { connect } from 'react-redux';\nimport { mapDispatchToProps as mapDispatchToPropsAccounts } from '@myie/interact-accounts';\nimport { mapDispatchToProps as mapDispatchToPropsMessaging } from '@myie/interact-messaging-twoway';\nimport { NoMatch } from '@myie/interact-dom';\n\nclass Conversation extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n stage: 'View',\n message: null,\n data: {},\n };\n }\n\n componentDidMount() {\n const { fetchAccountsIfNeeded } = this.props;\n fetchAccountsIfNeeded();\n }\n\n componentWillUnmount() {\n const { resetReply } = this.props;\n resetReply();\n }\n\n render() {\n const { error } = this.props;\n\n return (\n \n {error ? (\n
\n {error}\n \n ) : (\n ''\n )}\n
\n }\n />\n }\n />\n }\n />\n \n \n
\n );\n }\n}\n\nConversation.propTypes = {\n error: PropTypes.any,\n location: PropTypes.any,\n resetAccountPayees: PropTypes.any,\n resetReply: PropTypes.any,\n accounts: PropTypes.any,\n fetchAccountsIfNeeded: PropTypes.any,\n};\n\nconst mapStateToProps = state => {\n const { messagingTwowayDefinition, accountsDefinition } = state;\n return {\n ...messagingTwowayDefinition,\n ...accountsDefinition,\n };\n};\n\nexport default connect(\n mapStateToProps,\n { ...mapDispatchToPropsMessaging, ...mapDispatchToPropsAccounts },\n)(Conversation);\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { Switch, Redirect } from 'react-router-dom';\nimport { PrivateRoute } from '@myie/interact-dom';\nimport View from './View';\nimport New from './New';\nimport Conversation from './Conversation';\nimport { connect } from 'react-redux';\nimport { mapDispatchToProps } from '@myie/interact-messaging-twoway';\n\nclass MessagingTwoway extends Component {\n componentWillUnmount() {\n const { resetMessages } = this.props;\n resetMessages();\n }\n\n render() {\n if (\n this.props.location.pathname.match(\n new RegExp('^/messaging-twoway[/]{0,1}$'),\n )\n ) {\n return ;\n }\n\n return (\n \n );\n }\n}\n\nMessagingTwoway.propTypes = {\n location: PropTypes.object,\n resetMessages: PropTypes.any,\n};\n\nexport default connect(\n null,\n mapDispatchToProps,\n)(MessagingTwoway);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Link } from 'react-router-dom';\nimport { connect } from 'react-redux';\nimport { Badge } from 'reactstrap';\nimport { Content } from '@myie/interact-dom';\nimport {\n mapStateToProps,\n mapDispatchToProps,\n} from '@myie/interact-messaging-twoway';\nimport { Session } from '@myie/interact';\n\nclass SummaryMenuItems extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n newMessageCount: 0,\n };\n }\n timeoutID = null;\n\n static getDerivedStateFromProps(nextProps, prevState) {\n const { newMessageCount } = nextProps;\n\n if (\n newMessageCount &&\n newMessageCount.Count !== prevState.newMessageCount\n ) {\n return {\n ...prevState,\n newMessageCount: newMessageCount.Count,\n };\n } else {\n return null;\n }\n }\n\n componentDidMount() {\n const { getNewMessageCount } = this.props;\n let request = {\n Type: 'New',\n ExtendedProperties: {},\n };\n getNewMessageCount(request);\n }\n\n componentWillUnmount() {\n clearInterval(this.timeoutID);\n }\n\n startTimer = () => {\n this.timeoutID = setInterval(this.updateCount, 120000);\n };\n\n clearTimer = () => {\n clearInterval(this.timeoutID);\n };\n\n updateCount = () => {\n const { getNewMessageCount } = this.props;\n if (!Session.isAuthenticated()) {\n this.clearTimer();\n } else {\n let request = {\n Type: 'New',\n ExtendedProperties: {},\n };\n getNewMessageCount(request);\n }\n };\n\n render() {\n const { newMessageCount } = this.state;\n return (\n \n \n {newMessageCount ? (\n <>\n \n {newMessageCount}\n \n >\n ) : (\n ''\n )}\n \n );\n }\n}\n\nSummaryMenuItems.propTypes = {\n getNewMessageCount: PropTypes.any,\n newMessageCount: PropTypes.any,\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(SummaryMenuItems);\n","import SummaryMenuItems from './SummaryMenuItems';\n\nconst MessagingTwowayMenuItems = [\n {\n url: '/messaging-twoway',\n menuItem: SummaryMenuItems,\n },\n];\n\nexport default MessagingTwowayMenuItems;\n","import React from 'react';\nimport { Route } from 'react-router-dom';\nimport MessagingTwoway from './MessagingTwoway';\n\nconst Routes = [\n ,\n];\n\nexport default Routes;\n","import ConversationSidebar from './Conversation/Sidebar';\nimport NewMessageSidebar from './New/Sidebar';\nimport ViewMessageSidebar from './View/Sidebar';\nimport ReplyMessageSidebar from './Conversation/Delete/Sidebar';\nimport DeleteMessageSidebar from './Conversation/Reply/Sidebar';\n\nconst MessagingTwowaySidebars = [\n { url: '/messaging-twoway/message/view/', Sidebar: ConversationSidebar },\n { url: '/messaging-twoway/new', Sidebar: NewMessageSidebar },\n { url: '/messaging-twoway/view', Sidebar: ViewMessageSidebar },\n { url: '/messaging-twoway/message/reply/', Sidebar: ReplyMessageSidebar },\n {\n url: '/messaging-twoway/message/delete/',\n Sidebar: DeleteMessageSidebar,\n },\n];\n\nexport default MessagingTwowaySidebars;\n","import React from 'react';\nimport { HelpContactSidebar } from '@myie/interact-dom';\n\nclass ConversationSidebar extends React.Component {\n render() {\n return (\n \n );\n }\n}\n\nexport default ConversationSidebar;\n","import React from 'react';\nimport { HelpContactSidebar } from '@myie/interact-dom';\n\nclass NewMessageSidebar extends React.Component {\n render() {\n return (\n \n );\n }\n}\n\nexport default NewMessageSidebar;\n","import React from 'react';\nimport { HelpContactSidebar } from '@myie/interact-dom';\n\nclass ViewMessageSidebar extends React.Component {\n render() {\n return (\n \n );\n }\n}\n\nexport default ViewMessageSidebar;\n","import React from 'react';\nimport { HelpContactSidebar } from '@myie/interact-dom';\n\nclass DeleteMessageSidebar extends React.Component {\n render() {\n return (\n \n );\n }\n}\n\nexport default DeleteMessageSidebar;\n","import React from 'react';\nimport { HelpContactSidebar } from '@myie/interact-dom';\n\nclass ReplyMessageSidebar extends React.Component {\n render() {\n return (\n \n );\n }\n}\n\nexport default ReplyMessageSidebar;\n","import MessagingTwoway from './MessagingTwoway';\nimport MessagingTwowayMenuItems from './MenuItems';\nimport Routes from './Routes';\nimport MessagingTwowaySidebars from './Sidebars';\n\nexport {\n MessagingTwoway,\n Routes,\n MessagingTwowayMenuItems,\n MessagingTwowaySidebars,\n};\n","export const RULES = {\n //Account Details\n ammountFormat: /^\\d+(,\\d{3})*\\.?\\d*$/,\n ammountFormat2: /^\\d*(,\\d+)*\\.?\\d*$/,\n dateFormat: /^[^\\s].{9}$/,\n activationCode2: /^[0-9]{6}$/,\n};\n","import React from 'react';\nimport { Link } from 'react-router-dom';\nimport { Row, Col, Form, Button } from 'reactstrap';\nimport PropTypes from 'prop-types';\nimport { Text, Errors, Currency, Mask } from '@myie/interact-dom';\nimport { RedirectByAccountDropdown } from '@myie/interact-accounts-dom';\nimport { Content } from '@myie/interact-dom';\n\nclass MakePayment extends React.Component {\n render() {\n const {\n account,\n accounts,\n form,\n updateStage,\n onChangeAccount,\n onChange,\n onBlur,\n error,\n referrer = '/accounts',\n } = this.props;\n return (\n \n );\n }\n}\n\nMakePayment.propTypes = {\n account: PropTypes.any,\n accounts: PropTypes.any,\n error: PropTypes.any,\n form: PropTypes.any,\n info: PropTypes.any,\n isFetching: PropTypes.any,\n match: PropTypes.any,\n onBlur: PropTypes.any,\n onChange: PropTypes.any,\n onChangeAccount: PropTypes.any,\n referrer: PropTypes.any,\n updateStage: PropTypes.any,\n};\n\nexport default MakePayment;\n","import React from 'react';\nimport { Row, Col, Form, Button } from 'reactstrap';\nimport { FormattedCurrency, Content } from '@myie/interact-dom';\nimport { Alert } from 'reactstrap';\nimport PropTypes from 'prop-types';\nimport { Link } from 'react-router-dom';\n\nconst ReviewPayment = props => {\n const {\n form,\n updateStage,\n error,\n submit,\n account,\n referrer = '/accounts',\n } = props;\n\n return (\n \n
\n \n \n
\n \n
\n {error ? (\n
\n {error}\n \n ) : (\n ''\n )}\n
\n
\n );\n};\n\nReviewPayment.propTypes = {\n account: PropTypes.any,\n error: PropTypes.any,\n form: PropTypes.any,\n info: PropTypes.any,\n referrer: PropTypes.any,\n submit: PropTypes.any,\n updateStage: PropTypes.any,\n};\n\nexport default ReviewPayment;\n","import React from 'react';\nimport { Button, Form } from 'reactstrap';\nimport PropTypes from 'prop-types';\nimport { Link } from 'react-router-dom';\nimport { Content } from '@myie/interact-dom';\nconst url = require('url');\n\nclass CompletePayment extends React.Component {\n constructor(props) {\n super(props);\n this.formRef = React.createRef();\n this.iframeRef = React.createRef();\n }\n\n componentDidMount() {\n // use this for posting to iframe\n try {\n this.formRef.current.submit();\n } catch (e) {\n // add code here to trap issues\n }\n }\n\n iframeLoaded = e => {\n const { submit, referrer, history } = this.props;\n try {\n const href = this.iframeRef.current.contentWindow.location.href;\n const search = this.iframeRef.current.contentWindow.location.search;\n if (href.indexOf('3ds-success.html') >= 0) {\n submit(e, search);\n } else if (href.indexOf('3ds-cancel.html') >= 0) {\n history.push(referrer);\n }\n } catch (e) {\n // usually means it iframe is cross-domain, so not our site\n }\n };\n\n render() {\n const { props } = this;\n const {\n updateStage,\n //submit,\n error,\n referrer = '/accounts',\n payment,\n } = props;\n let urlParsed = null;\n let params = null;\n if (payment.ThreeDSecureUrl) {\n urlParsed = url.parse(payment.ThreeDSecureUrl);\n params = urlParsed.query.split(',');\n }\n\n return (\n \n {error}\n\n <>\n {/* used for post method */}\n {urlParsed && (\n
\n )}\n {payment.ResponseStatus === 'PerformThreeDSecure' ? (\n
\n ) : (\n ''\n )}\n >\n
\n
\n );\n }\n}\n\nCompletePayment.propTypes = {\n error: PropTypes.any,\n history: PropTypes.any,\n payment: PropTypes.any,\n referrer: PropTypes.string,\n submit: PropTypes.any,\n updateStage: PropTypes.any,\n};\n\nexport default CompletePayment;\n","import React from 'react';\nimport { Link } from 'react-router-dom';\nimport { Row, Col, Alert } from 'reactstrap';\nimport { FormattedCurrency, Content } from '@myie/interact-dom';\nimport PropTypes from 'prop-types';\n\nconst SuccessfulPayment = props => {\n const { account, form, referrer = '/accounts', payment } = props;\n return (\n \n
\n \n \n
\n \n \n \n \n \n \n \n To\n \n \n {account.AccountName}{' '}\n \n \n \n \n \n \n \n \n \n \n \n \n {payment.PaymentReference}\n \n
\n
\n \n \n \n
\n
\n );\n};\n\nSuccessfulPayment.propTypes = {\n account: PropTypes.any,\n form: PropTypes.any,\n info: PropTypes.any,\n payment: PropTypes.any,\n referrer: PropTypes.any,\n};\n\nexport default SuccessfulPayment;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Breadcrumb, BreadcrumbItem } from 'reactstrap';\nimport { Content } from '@myie/interact-dom';\n\nclass PaymentBreadcrumbs extends React.Component {\n render() {\n const { stage } = this.props;\n\n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n >\n );\n }\n}\n\nPaymentBreadcrumbs.propTypes = {\n stage: PropTypes.any,\n};\n\nexport default PaymentBreadcrumbs;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport update from 'immutability-helper';\nimport MakePayment from './MakePayment';\nimport ReviewPayment from './ReviewPayment';\nimport CompletePayment from './CompletePayment';\nimport SuccessfulPayment from './SuccessfulPayment';\nimport PaymentBreadcrumbs from './PaymentBreadcrumbs';\nimport { Validate, Utility } from '@myie/interact';\nimport { mapDispatchToProps as mapDispatchToPropsPayment } from '@myie/interact-pay-by-card';\nimport { mapDispatchToProps as mapDispatchToPropsAccounts } from '@myie/interact-accounts';\nimport { Content, Switch } from '@myie/interact-dom';\n\nclass PayByCard extends React.Component {\n constructor(props) {\n super(props);\n this.state = this.initialState();\n }\n\n initialState = () => {\n const { accounts, match } = this.props;\n let account;\n if (accounts) {\n account = accounts.Accounts.find(function(element) {\n return Utility.hexEncode(element.AccountKey.Key) === match.params.id;\n });\n } else {\n account = null;\n }\n return {\n account: account,\n stage: 'MakePayment',\n form: {\n amount: {\n rules: {\n title: 'Amount',\n stop: true,\n required: true,\n currency: true,\n },\n },\n cardNumber: {\n rules: {\n title: 'Card number',\n stop: true,\n required: true,\n cc: {\n message: 'Please enter a valid credit card number',\n },\n },\n },\n expiryDate: {\n rules: {\n title: 'Expiry date',\n stop: true,\n required: true,\n cardExpiryDate: {\n message: 'must be in MM/YY format',\n },\n expiryDate: {},\n },\n },\n securityCode: {\n rules: {\n title: 'CVV',\n stop: true,\n required: true,\n securityCode: {\n message: 'must be 3 digits',\n },\n },\n },\n paymentType: {\n value: 'specific',\n rules: {\n title: 'Payment selection',\n required: true,\n },\n },\n },\n };\n };\n\n // initialise when component umounts\n componentDidMount() {\n const { resetPayByCard, fetchAccountsIfNeeded } = this.props;\n fetchAccountsIfNeeded();\n resetPayByCard();\n }\n\n componentDidUpdate(prevProps) {\n const { match, accounts } = this.props;\n if (accounts && prevProps.accounts !== accounts) {\n const account = accounts.Accounts.find(function(element) {\n return Utility.hexEncode(element.AccountKey.Key) === match.params.id;\n });\n this.setState({ ...this.state, account });\n }\n }\n\n // reset payment detail when component unmounts\n componentWillUnmount() {\n const { resetPayByCard } = this.props;\n this.setState({ ...this.state, stage: 'MakePayment' });\n resetPayByCard();\n }\n\n // common onChangeAccount function\n onChangeAccount = e => {\n const { resetPayByCard, fetchAccountsIfNeeded } = this.props;\n fetchAccountsIfNeeded();\n resetPayByCard();\n const { value } = e.target;\n if (this.props && this.props.accounts && this.props.accounts.Accounts) {\n const account = this.props.accounts.Accounts.find(function(element) {\n return element.AccountKey.Key === value;\n });\n this.setState({ ...this.initialState(), account });\n }\n };\n\n // common onChange function\n onChange = e => {\n const { name, value } = e.target;\n var { form } = this.state;\n form = Validate.input(name, value, form);\n\n this.setState({ ...this.state, form });\n };\n\n // common onBlur function\n onBlur = e => {\n const { name, value } = e.target;\n var { form } = this.state;\n form = Validate.input(name, value, form, true);\n this.setState({ ...this.state, form });\n };\n\n // update the stage in state\n updateStage = (e, stageId) => {\n e.preventDefault();\n\n if (stageId === 'MakePayment') {\n const { resetPayByCard } = this.props;\n resetPayByCard();\n }\n const state = this.state;\n const stage = update(this.state.stage, { $set: stageId });\n this.setState({ ...state, stage });\n };\n\n // validation for payment entry form in state\n validateStage = (e, stageId) => {\n e.preventDefault();\n var { form } = this.state;\n form = Validate.form(form);\n\n if (!form.approved) {\n this.setState({ ...this.state, form });\n return;\n }\n\n if (stageId === 'MakePayment') {\n const { resetPayByCard } = this.props;\n resetPayByCard();\n }\n const stage = update(this.state.stage, { $set: stageId });\n this.setState({ ...this.state, stage, form });\n };\n\n // submit from review page\n submitMake = e => {\n e.preventDefault();\n const { makePayByCard } = this.props;\n var { form, account } = this.state;\n var request = {\n AccountKey: account.AccountKey,\n Amount: form.amount.value - 0,\n CurrencyCode: account.CurrencyCode,\n CardNumber: form.cardNumber.value,\n CardHoldersName: null,\n ExpiryDate: form.expiryDate.value,\n Address: {},\n PostCode: null,\n SecurityCode: form.securityCode.value,\n PaymentType: form.paymentType.value,\n ProductType: account.ProductType,\n SaveCardDetails: false,\n ExtendedProperties: null,\n };\n makePayByCard(request);\n };\n\n // get error text for payment ResponseStatus\n errorText = () => {\n const { payment } = this.props;\n let error = payment ? (\n \n ) : null;\n return error;\n };\n\n // render page for current stage\n renderStage = stage => {\n const {\n error,\n accounts = {},\n isFetching,\n referrer = '/accounts',\n payment,\n history,\n } = this.props;\n const errorText = error || this.errorText();\n\n var { form, account, formState } = this.state;\n if (stage === 'MakePayment') {\n return (\n <>\n \n >\n );\n }\n\n if (stage === 'ReviewPayment') {\n return (\n \n );\n }\n\n if (stage === 'CompletePayment') {\n return (\n \n );\n }\n\n if (stage === 'SuccessfulPayment') {\n return (\n \n );\n }\n };\n\n // submit from 3D Secure page\n submitComplete = (e, acknowledgement) => {\n e.preventDefault();\n const { completePayByCard, payment } = this.props;\n var { form, account } = this.state;\n var request = {\n PaymentKey: payment.PaymentKey,\n AccountKey: account.AccountKey,\n Amount: parseFloat(form.amount.value),\n CurrencyCode: account.CurrencyCode,\n CardNumber: form.cardNumber.value,\n CardHoldersName: null,\n ExpiryDate: form.expiryDate.value,\n Address: {},\n PostCode: null,\n SecurityCode: form.securityCode.value,\n PaymentType: form.paymentType.value,\n ProductType: account.ProductType,\n ThreeDSecureResult: acknowledgement,\n SaveCardDetails: false,\n ExtendedProperties: null,\n };\n completePayByCard(request);\n };\n\n // set stage depending on payment response\n static getDerivedStateFromProps(nextProps, prevState) {\n const { payment } = nextProps;\n if (payment) {\n switch (payment.ResponseStatus) {\n case 'PerformThreeDSecure':\n return { ...prevState, stage: 'CompletePayment' };\n case 'Completed':\n return { ...prevState, stage: 'SuccessfulPayment' };\n\n default:\n }\n } else if (\n prevState.stage === 'SuccessfulPayment' ||\n prevState.stage === 'CompletePayment'\n ) {\n return { ...prevState, stage: 'MakePayment' };\n }\n return null;\n }\n\n render() {\n const { accounts = {} } = this.props;\n const { stage, account } = this.state;\n let { error } = this.props;\n\n if (!accounts.Accounts) {\n return null;\n } else if (!account) {\n return (\n \n \n
\n );\n }\n\n return (\n <>\n \n \n \n \n
\n {this.renderStage(stage, error)}\n >\n );\n }\n}\n\nPayByCard.propTypes = {\n accounts: PropTypes.object,\n completePayByCard: PropTypes.any,\n error: PropTypes.any,\n fetchAccountsIfNeeded: PropTypes.any,\n history: PropTypes.any,\n isFetching: PropTypes.any,\n makePayByCard: PropTypes.any,\n match: PropTypes.any,\n payment: PropTypes.any,\n referrer: PropTypes.string,\n resetPayByCard: PropTypes.any,\n};\n\nconst mapStateToProps = state => {\n const { payByCardDefinition, accountsDefinition } = state;\n return {\n ...payByCardDefinition,\n ...accountsDefinition,\n };\n};\n\nexport default connect(\n mapStateToProps,\n {\n ...mapDispatchToPropsPayment,\n ...mapDispatchToPropsAccounts,\n },\n)(PayByCard);\n","import React from 'react';\nimport { Route, Switch } from 'react-router-dom';\nimport { PrivateRoute, NoMatch } from '@myie/interact-dom';\nimport PayByCard from './PayByCard';\n\nclass Savings extends React.Component {\n render() {\n return (\n \n );\n }\n}\nexport default Savings;\n","import React from 'react';\nimport { Col, Row } from 'reactstrap';\nimport { Content, FormattedCurrency, FormattedDate } from '@myie/interact-dom';\nimport PropTypes from 'prop-types';\n\nconst WithdrawalAccount = ({ account, withdrawDate }) => {\n const { ExtendedProperties: { NoticePeriodInDays } = {} } = account;\n\n const noticePeriod = NoticePeriodInDays ? `${NoticePeriodInDays} Days` : '';\n\n return (\n \n \n \n \n \n \n {account.AccountNumber}\n \n \n \n \n \n \n \n {account.brandProductType === 'NOTICE_ACCOUNT' ? (\n <>\n \n \n \n \n {noticePeriod}\n \n >\n ) : null}\n \n \n \n \n \n \n
\n
\n );\n};\n\nWithdrawalAccount.propTypes = {\n account: PropTypes.object,\n withdrawDate: PropTypes.any,\n};\n\nexport default WithdrawalAccount;\n","import React from 'react';\nimport { Col, Row } from 'reactstrap';\nimport { Content } from '@myie/interact-dom';\nimport PropTypes from 'prop-types';\n\nconst NominatedAccount = ({ account }) => {\n const {\n ExtendedProperties: { NominatedAccountNumber, NominatedSortCode } = {},\n } = account;\n\n return (\n \n \n \n \n \n \n {NominatedAccountNumber}\n \n \n \n \n \n {NominatedSortCode}\n \n
\n
\n );\n};\n\nNominatedAccount.propTypes = {\n account: PropTypes.object,\n};\n\nexport default NominatedAccount;\n","import React, { Component } from 'react';\nimport { Form, Button, Row, Col } from 'reactstrap';\nimport {\n Content,\n Text,\n Markdown,\n Currency as CurrencyInput,\n Check,\n} from '@myie/interact-dom';\nimport PropTypes from 'prop-types';\nimport { Validate } from '@myie/interact';\n\nclass WithdrawalWithClose extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n form: {\n amount: {\n rules: {\n title: 'Amount',\n stop: true,\n required: {\n message: 'Please enter an amount',\n },\n format: {\n regex: /^\\d+(,\\d{3})*\\.?\\d*$/,\n message: 'Please enter a valid amount',\n },\n minAmountCheck: {\n message: 'Please enter an amount greater than zero',\n comparison: () => {\n return 0.01;\n },\n },\n compareWithAvailableBalance: {\n message: 'Please enter an amount less than available balance',\n comparison: () => {\n const { account: { RemainingAllowance = 0 } = {} } = this.props;\n return RemainingAllowance;\n },\n },\n },\n value: '',\n },\n reference: {\n rules: {\n title: 'Reference',\n stop: true,\n format: {\n regex: /^[a-zA-Z- .\\d/&]{0,18}$/,\n message: 'Please enter a valid reference',\n },\n },\n value: '',\n },\n closeAccount: {\n rules: {\n title: 'Close Account',\n },\n },\n },\n };\n }\n\n onChange = e => {\n this.updateForm(e);\n };\n\n onBlur = e => {\n this.updateForm(e);\n };\n\n updateForm = e => {\n const { name, value } = e.target;\n var { form } = this.state;\n form = Validate.input(name, value, form, true);\n this.setState({ ...this.state, form });\n };\n\n updatCurrency = e => {\n let { name, value } = e.target;\n let newValue = value;\n\n if (newValue !== '') {\n newValue = new Intl.NumberFormat().format(value.replace(/,/g, ''));\n }\n // Deal with trailing . or .0 or .n0\n if (value.charAt(value.length - 1) === '.') {\n newValue += '.';\n }\n if (value.slice(value.length - 2) === '.0') {\n newValue += '.0';\n }\n if (\n value.charAt(value.length - 3) === '.' &&\n value.charAt(value.length - 1) === '0'\n ) {\n if (value.charAt(value.length - 2) === '0') {\n newValue += '.0';\n }\n newValue += '0';\n }\n var { form } = this.state;\n form = Validate.input(name, newValue, form, true);\n this.setState({ ...this.state, form });\n };\n\n onSubmitHandler = e => {\n e.preventDefault();\n const { onSubmit } = this.props;\n let { form } = this.state;\n if (!form.closeAccount.value) {\n form = Validate.form(form);\n this.setState({ ...this.state, form });\n\n if (!form.approved) {\n return;\n }\n if (typeof onSubmit === 'function') {\n onSubmit(form);\n }\n }\n onSubmit(form);\n };\n\n onClick = e => {\n const { name, checked } = e.target;\n var { form } = this.state;\n form = Validate.input(name, checked ? 'true' : null, form);\n if (checked) {\n form.amount.value = '';\n form.reference.value = '';\n }\n this.setState({ ...this.state, form });\n };\n\n render() {\n const { onCancelled, account = {} } = this.props;\n const { form } = this.state;\n\n return (\n \n );\n }\n}\n\nWithdrawalWithClose.propTypes = {\n account: PropTypes.object,\n onCancelled: PropTypes.func,\n onSubmit: PropTypes.func,\n};\n\nexport default WithdrawalWithClose;\n","import React, { Component } from 'react';\nimport { withRouter } from 'react-router-dom';\nimport { Content } from '@myie/interact-dom';\nimport PropTypes from 'prop-types';\nimport WithdrawalAccount from '../../shared/WithdrawalAccount';\nimport NominatedAccount from '../../shared/NominatedAccount';\nimport { RedirectByAccountDropdown } from '@myie/interact-accounts-dom';\nimport { connect } from 'react-redux';\nimport { mapDispatchToProps } from '@myie/interact-accounts';\nimport { mapDispatchToProps as mapSavingsServicingDispatchToProps } from '@myie/interact-ccb-savings-servicing';\nimport WithdrawalWithClose from '../../shared/WithdrawalWithClose';\n\nclass Create extends Component {\n submitForm = form => {\n const { submitForm } = this.props;\n submitForm('ReviewNotice', form);\n };\n\n render() {\n const {\n account,\n accounts = {},\n onChangeAccount,\n onCancelled,\n actionDate,\n isFetching,\n } = this.props;\n\n return (\n <>\n \n\n \n \n \n \n\n \n \n \n\n \n {!isFetching && Object.keys(account).length ? (\n \n ) : null}\n >\n );\n }\n}\n\nCreate.propTypes = {\n accounts: PropTypes.any,\n withdrawalAccount: PropTypes.object,\n isFetching: PropTypes.bool,\n history: PropTypes.any,\n onCreate: PropTypes.func,\n match: PropTypes.any,\n actionDate: PropTypes.any,\n onChangeAccount: PropTypes.func,\n onCancelled: PropTypes.func,\n fetchAccountsIfNeeded: PropTypes.func,\n resetMakeWithdrawal: PropTypes.func,\n makeaWithdraw: PropTypes.func,\n account: PropTypes.any,\n submitForm: PropTypes.any,\n};\n\nconst mapStateToProps = state => {\n const { accountsDefinition, customccbSavingsServicingDefinition } = state;\n return {\n ...accountsDefinition,\n ...customccbSavingsServicingDefinition,\n };\n};\n\nexport default connect(\n mapStateToProps,\n { ...mapDispatchToProps, ...mapSavingsServicingDispatchToProps },\n)(withRouter(Create));\n","import React, { Component } from 'react';\nimport {\n Content,\n FormattedCurrency,\n FormattedDate,\n Switch,\n} from '@myie/interact-dom';\nimport { Button } from 'reactstrap';\nimport { withRouter } from 'react-router-dom';\nimport { Col, Row } from 'reactstrap';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport moment from 'moment';\nimport {\n mapStateToProps,\n mapDispatchToProps,\n} from '@myie/interact-ccb-savings-servicing';\nimport Currency from 'react-currency-formatter';\n\nclass Confirmation extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n date: moment(new Date())\n .utc()\n .format('YYYY-MM-DD'),\n message: '',\n disabled: false,\n };\n }\n submit = () => {\n const { onSubmitWithdrawal } = this.props;\n if (this.state.disabled) {\n return;\n }\n this.setState({ disabled: true });\n onSubmitWithdrawal();\n };\n\n cancelWithdrawal = () => {\n const { setStage } = this.props;\n setStage('createNotice');\n };\n\n // these response status force the form to be reset and switched back to the first page\n static getDerivedStateFromProps = nextProps => {\n const { makeWithdrawResponse = {} } = nextProps;\n\n if (\n makeWithdrawResponse &&\n makeWithdrawResponse.ResponseStatus === 'Failed'\n ) {\n return {\n message: 'failed',\n disabled: false,\n };\n }\n\n return null;\n };\n\n render() {\n const { form = {}, account = {}, actionDate } = this.props;\n let amount =\n form && form.amount && form.amount.value ? form.amount.value : '';\n const closeOption = form.closeAccount ? form.closeAccount.value : false;\n let reference =\n form && form.reference && form.reference.value\n ? form.reference.value\n : '';\n\n const {\n CurrencyCode,\n RemainingAllowance,\n ExtendedProperties: {\n NominatedAccountNumber,\n NominatedAccountName,\n NominatedSortCode,\n } = {},\n } = account;\n return (\n <>\n \n \n \n
\n\n \n \n \n \n \n \n {account.AccountName}{' '}\n {Currency({\n quantity: RemainingAllowance,\n currency: CurrencyCode,\n })}\n \n {account.SortCode} - {account.AccountNumber}\n \n \n \n \n \n \n {NominatedAccountName}\n \n {NominatedSortCode} - {NominatedAccountNumber}\n \n \n \n \n \n \n {!closeOption ? (\n \n ) : (\n \n )}\n \n \n \n \n \n \n \n {!closeOption ? (\n <>\n {' '}\n {reference ? (\n <>\n \n \n \n \n {reference}\n \n >\n ) : (\n ''\n )}\n >\n ) : (\n \n \n \n )}\n
\n
\n \n \n \n \n \n \n \n
\n >\n );\n }\n}\n\nConfirmation.propTypes = {\n match: PropTypes.any,\n history: PropTypes.any,\n createNoticeParam: PropTypes.any,\n error: PropTypes.any,\n isFetching: PropTypes.any,\n createResponse: PropTypes.any,\n onSubmitWithdrawal: PropTypes.any,\n createNoticeToWithdraw: PropTypes.func,\n account: PropTypes.any,\n setStage: PropTypes.any,\n form: PropTypes.any,\n actionDate: PropTypes.any,\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(withRouter(Confirmation));\n","import React, { Component } from 'react';\nimport { mapDispatchToProps } from '@myie/interact-ccb-savings-servicing';\nimport { connect } from 'react-redux';\nimport PropTypes from 'prop-types';\nimport { Content } from '@myie/interact-dom';\nimport { Link } from 'react-router-dom';\nimport { Utility } from '@myie/interact';\n\nclass CreationSuccess extends Component {\n componentDidMount() {\n const { resetCreateNoticeToWithdraw } = this.props;\n resetCreateNoticeToWithdraw();\n }\n\n render() {\n const { account = {} } = this.props;\n if (!account) {\n return null;\n }\n\n return (\n <>\n \n \n
\n \n \n \n \n
\n >\n );\n }\n}\n\nCreationSuccess.propTypes = {\n resetCreateNoticeToWithdraw: PropTypes.func,\n match: PropTypes.any,\n account: PropTypes.any,\n};\n\nexport default connect(\n null,\n mapDispatchToProps,\n)(CreationSuccess);\n","import moment from 'moment';\nconst dateValidation = (function() {\n const isWeekEnd = date => {\n let day = moment(date).day();\n if (day === 6 || day === 0) {\n return true;\n }\n return false;\n };\n\n const isHoliday = (date, days) => {\n const found = days.find(element => element === date);\n if (found) {\n return true;\n }\n return false;\n };\n\n return {\n isWeekEnd: isWeekEnd,\n isHoliday: isHoliday,\n };\n})();\n\nexport default dateValidation;\n","import React, { Component } from 'react';\nimport { BreadcrumbItem, Breadcrumb } from 'reactstrap';\nimport { withRouter } from 'react-router-dom';\nimport { Content } from '@myie/interact-dom';\nimport PropTypes from 'prop-types';\nimport { Utility } from '@myie/interact';\nimport moment from 'moment';\nimport { AppMeta } from '@myie/interact-dom';\nimport { connect } from 'react-redux';\nimport { mapDispatchToProps } from '@myie/interact-accounts';\nimport { mapDispatchToProps as mapSavingsServicingDispatchToProps } from '@myie/interact-ccb-savings-servicing';\nimport Create from './Create';\nimport Confirmation from './Confirmation';\nimport CreationSuccess from './CreationSuccess';\nimport dateValidation from './../../utility';\n\nclass CreateNotice extends Component {\n constructor(props) {\n super(props);\n this.state = this.initialState();\n }\n\n initialState = () => {\n const { accounts, match } = this.props;\n let account;\n if (accounts) {\n account = accounts.Accounts.find(function(element) {\n return Utility.hexEncode(element.AccountKey.Key) === match.params.id;\n });\n } else {\n account = null;\n }\n return {\n account: account,\n stage: 'createNotice',\n withdrawDate: moment(),\n form: {},\n };\n };\n\n componentWillUnmount() {\n const { resetMakeWithdrawal } = this.props;\n resetMakeWithdrawal();\n }\n\n componentDidMount() {\n const { resetMakeWithdrawal, fetchAccountsIfNeeded } = this.props;\n fetchAccountsIfNeeded();\n resetMakeWithdrawal();\n }\n\n // these response status force the form to be reset and switched back to the first page\n static getDerivedStateFromProps = nextProps => {\n const { makeWithdrawResponse = {} } = nextProps;\n\n if (\n makeWithdrawResponse &&\n makeWithdrawResponse.ResponseStatus === 'Success'\n ) {\n return {\n stage: 'CompleteNotice',\n };\n }\n\n return null;\n };\n\n componentDidUpdate(prevProps) {\n const { match, accounts } = this.props;\n if (accounts && prevProps.accounts !== accounts) {\n const account = accounts.Accounts.find(function(element) {\n return Utility.hexEncode(element.AccountKey.Key) === match.params.id;\n });\n this.setState({ ...this.state, account });\n }\n }\n\n // change the stage of the form\n setStage = stage => {\n this.setState({ ...this.state, stage, message: null });\n };\n\n setForm = form => {\n this.setState({ ...this.state, form, message: null });\n };\n\n //update the stage in state\n submitForm = (stage, form) => {\n if (stage === 'createNotice') {\n const { resetMakeWithdrawal } = this.props;\n resetMakeWithdrawal();\n }\n\n this.setState({ ...this.state, stage, form, message: null });\n };\n\n getActionDate = account => {\n const { holidays } = this.props;\n const { ExtendedProperties: { NoticePeriodInDays } = {} } = account;\n const NumberOfDays = NoticePeriodInDays === 0 ? 0 : NoticePeriodInDays;\n let days = [];\n if (holidays) {\n days = holidays.split(',');\n }\n let date = moment(new Date())\n .utc()\n .add(NumberOfDays, 'days')\n .format('YYYY-MM-DD');\n\n while (\n dateValidation.isWeekEnd(date) ||\n dateValidation.isHoliday(date, days)\n ) {\n let createdDate = moment(date).format('YYYY-MM-DD');\n date = moment(createdDate)\n .add(1, 'days')\n .format('YYYY-MM-DD');\n }\n\n return date;\n };\n\n onSubmitWithdrawal = () => {\n const { account, form } = this.state;\n const { makeaWithdraw } = this.props;\n let formCloseAccount = form.closeAccount.value;\n let request = {\n AccountKey: account.AccountKey,\n WithdrawalInformation: {\n ActionDate: this.getActionDate(account),\n Amount: form.amount.value.replace(/,/g, ''),\n CloseAccount: false,\n PaymentReference: form.reference.value ? form.reference.value : null,\n },\n };\n if (formCloseAccount) {\n request = {\n AccountKey: account.AccountKey,\n WithdrawalInformation: {\n ActionDate: this.getActionDate(account),\n CloseAccount: true,\n },\n };\n }\n\n makeaWithdraw(request);\n };\n\n // common onChangeAccount function\n onChangeAccount = e => {\n const { resetMakeWithdrawal, fetchAccountsIfNeeded, accounts } = this.props;\n fetchAccountsIfNeeded();\n resetMakeWithdrawal();\n const { value } = e.target;\n if (accounts && accounts.Accounts) {\n const account = accounts.Accounts.find(function(element) {\n return element.AccountKey.Key === value;\n });\n this.setState({ ...this.initialState(), account });\n }\n };\n // select current stage\n currentStage = account => {\n const { accounts = {} } = this.props;\n const actionDate = this.getActionDate(account);\n switch (this.state.stage) {\n case 'createNotice':\n return (\n \n );\n case 'ReviewNotice':\n return (\n \n );\n case 'CompleteNotice':\n return (\n \n );\n\n default:\n }\n };\n\n onCancelleWithdrawal = () => {\n const { history } = this.props;\n const { account } = this.state;\n const key =\n (account.AccountKey &&\n account.AccountKey.Key &&\n Utility.hexEncode(account.AccountKey.Key)) ||\n '';\n history.push(`/notice-to-withdraw/${key}`);\n };\n\n render() {\n const { stage, account } = this.state;\n if (!account) {\n return null;\n }\n\n return (\n \n {stage === 'createNotice' ? (\n <>\n
\n
\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n
\n >\n ) : (\n ''\n )}\n\n {stage === 'ReviewNotice' ? (\n <>\n
\n
\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n
\n >\n ) : (\n ''\n )}\n\n {stage === 'CompleteNotice' ? (\n <>\n
\n
\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n
\n >\n ) : (\n ''\n )}\n\n {this.currentStage(account)}\n
\n );\n }\n}\n\nCreateNotice.propTypes = {\n accounts: PropTypes.any,\n withdrawalAccount: PropTypes.object,\n isFetching: PropTypes.bool,\n history: PropTypes.any,\n onCreate: PropTypes.func,\n match: PropTypes.any,\n fetchAccountsIfNeeded: PropTypes.func,\n resetMakeWithdrawal: PropTypes.func,\n makeaWithdraw: PropTypes.func,\n holidays: PropTypes.any,\n account: PropTypes.any,\n};\n\nconst mapStateToProps = state => {\n const { accountsDefinition, customccbSavingsServicingDefinition } = state;\n return {\n ...accountsDefinition,\n ...customccbSavingsServicingDefinition,\n };\n};\n\nexport default connect(\n mapStateToProps,\n { ...mapDispatchToProps, ...mapSavingsServicingDispatchToProps },\n)(withRouter(CreateNotice));\n","import React, { Component } from 'react';\nimport { Row, Col } from 'reactstrap';\nimport { Content, FormattedDate, FormattedCurrency } from '@myie/interact-dom';\nimport PropTypes from 'prop-types';\nimport { Link } from 'react-router-dom';\n\nclass NoticeToWithdraw extends Component {\n onCancelHandler = () => {\n const { onCancel, loopIndex } = this.props;\n onCancel(loopIndex);\n };\n\n render() {\n const {\n withdrawal,\n index,\n accountKey,\n account: {\n CurrencyCode,\n ExtendedProperties: {\n NominatedAccountNumber,\n NominatedSortCode,\n NominatedAccountName,\n } = {},\n } = {},\n loopIndex,\n } = this.props;\n\n const { ExtendedProperties: { Cancellable } = {} } = withdrawal;\n\n return (\n \n \n \n \n \n \n \n \n {NominatedAccountName}\n {`${NominatedSortCode} ${NominatedAccountNumber} `} \n \n \n \n \n \n {withdrawal.Amount !== 0 ? (\n \n ) : (\n \n )}\n \n \n \n \n \n \n \n
\n \n \n {Cancellable && (\n \n \n {loopIndex} \n \n )}\n \n
\n
\n \n );\n }\n}\n\nNoticeToWithdraw.propTypes = {\n withdrawal: PropTypes.any,\n account: PropTypes.any,\n onCancel: PropTypes.func,\n loopIndex: PropTypes.any,\n index: PropTypes.any,\n accountKey: PropTypes.any,\n};\n\nexport default NoticeToWithdraw;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Fade } from 'reactstrap';\nimport { Link, withRouter } from 'react-router-dom';\nimport { Content } from '@myie/interact-dom';\nimport NoticeToWithdraw from './NoticeToWithdraw';\nimport { Utility } from '@myie/interact';\nimport { RedirectByAccountDropdown } from '@myie/interact-accounts-dom';\nimport { mapStateToProps, mapDispatchToProps } from '@myie/interact-accounts';\nimport { mapDispatchToProps as savingsMapDispatchToProps } from '@myie/interact-account-type-savings';\nimport { connect } from 'react-redux';\nimport moment from 'moment';\n\nclass NoticeToWithdrawList extends React.Component {\n constructor(props) {\n super(props);\n\n this.state = this.initialState();\n }\n\n initialState = () => {\n const { accounts, match } = this.props;\n let account;\n if (accounts) {\n account = accounts.Accounts.find(function(element) {\n return Utility.hexEncode(element.AccountKey.Key) === match.params.id;\n });\n } else {\n account = null;\n }\n return {\n account: account,\n range: this.setInitialRange(this.props),\n };\n };\n\n setInitialRange = props => {\n if (props.range) {\n return props.range;\n }\n const to = moment\n .utc()\n .startOf('day')\n .toISOString();\n const from = moment\n .utc()\n .subtract(12, 'months')\n .add(1, 'day')\n .startOf('day')\n .toISOString();\n return {\n To: to,\n From: from,\n Latest: true,\n };\n };\n\n componentDidMount() {\n const { fetchAccountsIfNeeded } = this.props;\n fetchAccountsIfNeeded();\n }\n\n componentDidUpdate(prevProps, prevState) {\n const { match, accounts } = this.props;\n const { fetchSavingsAccountTransactionsIfNeeded, isFetching } = this.props;\n if (\n this.state.account &&\n prevState.account !== this.state.account &&\n !isFetching\n ) {\n fetchSavingsAccountTransactionsIfNeeded({\n AccountKey: this.state.account.AccountKey,\n Range: this.state.range,\n });\n }\n if (accounts && prevProps.accounts !== accounts) {\n const account = accounts.Accounts.find(function(element) {\n return Utility.hexEncode(element.AccountKey.Key) === match.params.id;\n });\n this.setState({ ...this.state, account });\n }\n }\n\n onChangeAccount = e => {\n const { fetchAccountsIfNeeded, accounts } = this.props;\n fetchAccountsIfNeeded();\n const { value } = e.target;\n if (accounts && accounts.Accounts) {\n const account = accounts.Accounts.find(function(element) {\n return element.AccountKey.Key === value;\n });\n this.setState({ ...this.initialState(), account });\n }\n };\n\n getTransactions = (transactions, account, accountKey) => {\n let list = [];\n if (\n transactions &&\n transactions.Transactions &&\n transactions.Transactions.length > 0\n ) {\n transactions.Transactions.forEach((transaction, index) => {\n if (transaction.ExtendedProperties.Type === 'PendingTransaction') {\n list.push(\n ,\n );\n }\n });\n }\n\n return list;\n };\n\n render() {\n const { isFetching, accounts = {} } = this.props;\n const { account } = this.state;\n if (!account) {\n return null;\n }\n\n const { AccountKey: { Key } = {}, transactions = {} } = account;\n const accountKey = Key && Utility.hexEncode(Key);\n const pendingTransactions = this.getTransactions(\n transactions,\n account,\n accountKey,\n );\n\n const allNotices = isFetching ? (\n \n ) : (\n pendingTransactions\n );\n\n return (\n \n
\n \n \n\n
\n {!isFetching ? (\n pendingTransactions.length > 0 ? (\n <>\n
\n \n
\n
\n \n \n >\n ) : (\n
\n )\n ) : null}\n
{allNotices} \n
\n \n \n \n \n \n \n
\n
\n );\n }\n}\n\nNoticeToWithdrawList.propTypes = {\n accounts: PropTypes.any,\n isFetching: PropTypes.bool,\n selectedAccount: PropTypes.object,\n history: PropTypes.any,\n withdrawalNotices: PropTypes.any,\n match: PropTypes.any,\n fetchAccountsIfNeeded: PropTypes.any,\n fetchSavingsAccountTransactionsIfNeeded: PropTypes.any,\n};\n\nexport default connect(\n mapStateToProps,\n { ...mapDispatchToProps, ...savingsMapDispatchToProps },\n)(withRouter(NoticeToWithdrawList));\n","import React, { Component } from 'react';\nimport { mapDispatchToProps } from '@myie/interact-ccb-savings-servicing';\nimport { connect } from 'react-redux';\nimport PropTypes from 'prop-types';\nimport { Content } from '@myie/interact-dom';\nimport { Link } from 'react-router-dom';\n\nclass CancellationSuccess extends Component {\n componentDidMount() {\n const { resetCancellation } = this.props;\n resetCancellation();\n }\n render() {\n const { accountKey } = this.props;\n\n return (\n <>\n \n \n
\n \n \n \n \n
\n >\n );\n }\n}\n\nCancellationSuccess.propTypes = {\n resetCancellation: PropTypes.func,\n accountKey: PropTypes.any,\n};\n\nexport default connect(\n null,\n mapDispatchToProps,\n)(CancellationSuccess);\n","import React, { Component } from 'react';\nimport { Content, FormattedCurrency, FormattedDate } from '@myie/interact-dom';\nimport { Col, Row } from 'reactstrap';\nimport { Button } from 'reactstrap';\nimport { Link, withRouter } from 'react-router-dom';\nimport PropTypes from 'prop-types';\nimport { mapDispatchToProps } from '@myie/interact-accounts';\nimport { mapDispatchToProps as mapSavingsServicingDispatchToProps } from '@myie/interact-ccb-savings-servicing';\nimport { connect } from 'react-redux';\nimport { Utility } from '@myie/interact';\nimport Currency from 'react-currency-formatter';\n\nclass Cancel extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n accounts: [],\n selectedAccountKey: null,\n selectedAccount: {},\n selectedTransaction: {},\n disabled: false,\n };\n }\n\n onConfirmCancellation = () => {\n if (this.state.disabled) {\n return;\n }\n this.setState({ disabled: true });\n const { cancelNoticeToWithdraw, identifier, account = {} } = this.props;\n const { transactions: { Transactions = [] } = {} } = account;\n let transaction = Transactions.find(\n element => element.TransactionIdentifier === identifier,\n );\n cancelNoticeToWithdraw({\n AccountKey: account && account.AccountKey,\n TransactionIdentifier: transaction.TransactionIdentifier,\n });\n };\n\n render() {\n const { AccountKey: { Key } = {} } = this.props.account;\n const accountKey = Key && Utility.hexEncode(Key);\n\n const { account = {}, identifier } = this.props;\n const {\n CurrencyCode,\n RemainingAllowance,\n ExtendedProperties: {\n NominatedAccountNumber,\n NominatedSortCode,\n NominatedAccountName,\n } = {},\n } = account;\n let transaction = {};\n\n const { transactions: { Transactions = [] } = {} } = account;\n\n transaction = Transactions.find(\n element => element.TransactionIdentifier === identifier,\n );\n\n return (\n <>\n \n\n \n \n \n \n \n \n {' '}\n {Currency({\n quantity: RemainingAllowance,\n currency: CurrencyCode,\n })}\n \n {account.SortCode} - {account.AccountNumber}\n \n \n \n \n \n \n {NominatedAccountName}\n \n {NominatedSortCode}-{NominatedAccountNumber}\n \n \n \n \n \n \n {transaction.Amount !== 0 ? (\n \n ) : (\n \n )}\n \n \n \n \n \n \n \n
\n
\n\n \n \n \n \n \n \n \n
\n >\n );\n }\n}\n\nCancel.propTypes = {\n match: PropTypes.any,\n accounts: PropTypes.any,\n cancellationResponse: PropTypes.any,\n message: PropTypes.any,\n history: PropTypes.any,\n account: PropTypes.any,\n identifier: PropTypes.any,\n fetchAccountsIfNeeded: PropTypes.func,\n cancelNoticeToWithdraw: PropTypes.func,\n};\n\nconst mapStateToProps = state => {\n const { accountsDefinition, customccbSavingsServicingDefinition } = state;\n return {\n ...accountsDefinition,\n ...customccbSavingsServicingDefinition,\n };\n};\n\nexport default connect(\n mapStateToProps,\n { ...mapDispatchToProps, ...mapSavingsServicingDispatchToProps },\n)(withRouter(Cancel));\n","import React, { Component } from 'react';\nimport { AppMeta, Content } from '@myie/interact-dom';\nimport { BreadcrumbItem, Breadcrumb } from 'reactstrap';\nimport { withRouter } from 'react-router-dom';\nimport { Utility } from '@myie/interact';\nimport PropTypes from 'prop-types';\nimport { mapDispatchToProps } from '@myie/interact-accounts';\nimport { mapDispatchToProps as mapSavingsServicingDispatchToProps } from '@myie/interact-ccb-savings-servicing';\nimport { connect } from 'react-redux';\nimport CancellationSuccess from './CancellationSuccess';\nimport Cancel from './Cancel';\nimport moment from 'moment';\n\nclass CancelNoticeToWithdrawView extends Component {\n constructor(props) {\n super(props);\n\n this.state = this.initialState();\n }\n\n initialState = () => {\n const { accounts, match } = this.props;\n let account;\n if (accounts) {\n account = accounts.Accounts.find(function(element) {\n return Utility.hexEncode(element.AccountKey.Key) === match.params.id;\n });\n } else {\n account = null;\n }\n return {\n account: account,\n stage: 'ConfirmCancel',\n withdrawDate: moment(),\n form: {},\n identifier: match.params.referenceNo,\n };\n };\n\n // these response status force the form to be reset and switched back to the first page\n static getDerivedStateFromProps = (nextProps, state) => {\n const {\n cancellationResponse = {},\n accounts = {},\n fetchSavingsAccountTransactions,\n isFetching,\n } = nextProps;\n\n const setInitialRange = props => {\n if (props.range) {\n return props.range;\n }\n const to = moment\n .utc()\n .startOf('day')\n .toISOString();\n const from = moment\n .utc()\n .subtract(12, 'months')\n .add(1, 'day')\n .startOf('day')\n .toISOString();\n return {\n To: to,\n From: from,\n Latest: true,\n };\n };\n if (\n accounts &&\n state.account &&\n !state.account.transactions &&\n !isFetching\n ) {\n fetchSavingsAccountTransactions({\n AccountKey: state.account.AccountKey,\n Range: setInitialRange(nextProps),\n });\n }\n\n if (cancellationResponse && cancellationResponse.Success) {\n return {\n stage: 'Success',\n };\n }\n\n return null;\n };\n\n componentDidMount() {\n const { fetchAccountsIfNeeded } = this.props;\n fetchAccountsIfNeeded();\n }\n\n onConfirmCancellation = () => {\n const { cancelNoticeToWithdraw } = this.props;\n const { selectedAccount, selectedTransaction } = this.state;\n cancelNoticeToWithdraw({\n AccountKey: selectedAccount && selectedAccount.AccountKey,\n TransactionIdentifier: selectedTransaction.TransactionIdentifier,\n });\n };\n\n // select current stage\n currentStage = account => {\n const { accounts = {} } = this.props;\n const { AccountKey: { Key } = {} } = account;\n const accountKey = Key && Utility.hexEncode(Key);\n\n switch (this.state.stage) {\n case 'ConfirmCancel':\n return (\n \n );\n case 'Success':\n return ;\n\n default:\n }\n };\n\n render() {\n const { stage, account } = this.state;\n if (!account) {\n return null;\n }\n\n return (\n <>\n {stage === 'ConfirmCancel' ? (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n >\n ) : (\n ''\n )}\n {stage === 'Success' ? (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n >\n ) : (\n ''\n )}\n\n {this.currentStage(account)}\n >\n );\n }\n}\n\nCancelNoticeToWithdrawView.propTypes = {\n match: PropTypes.any,\n accounts: PropTypes.any,\n cancellationResponse: PropTypes.any,\n message: PropTypes.any,\n history: PropTypes.any,\n fetchAccountsIfNeeded: PropTypes.func,\n cancelNoticeToWithdraw: PropTypes.func,\n fetchSavingsAccountTransactionsIfNeeded: PropTypes.func,\n isFetching: PropTypes.any,\n referenceNo: PropTypes.any,\n range: PropTypes.any,\n};\n\nconst mapStateToProps = state => {\n const { accountsDefinition, customccbSavingsServicingDefinition } = state;\n return {\n ...accountsDefinition,\n ...customccbSavingsServicingDefinition,\n };\n};\n\nexport default connect(\n mapStateToProps,\n { ...mapDispatchToProps, ...mapSavingsServicingDispatchToProps },\n)(withRouter(CancelNoticeToWithdrawView));\n","import React, { Component } from 'react';\nimport { PrivateRoute, NoMatch } from '@myie/interact-dom';\nimport { Switch, Route } from 'react-router-dom';\nimport CreateNotice from './CreateNoticeToWithdraw/CreateNotice';\nimport NoticeToWithdrawList from './ListNoticeToWithdraws';\nimport CancelNoticeToWithdrawView from './CancelNoticeToWithdraw';\n\nclass NoticeToWithdrawals extends Component {\n render() {\n return (\n \n );\n }\n}\n\nexport { NoticeToWithdrawals };\n","import React from 'react';\nimport { Markdown, Content } from '@myie/interact-dom';\nimport PropTypes from 'prop-types';\nimport NominatedAccount from '../shared/NominatedAccount';\nimport WithdrawalWithClose from '../shared/WithdrawalWithClose';\nimport WithdrawalAccount from '../shared/WithdrawalAccount';\nimport { RedirectByAccountDropdown } from '@myie/interact-accounts-dom';\n\nclass MakePayment extends React.Component {\n constructor(props) {\n super(props);\n const { account = {} } = props;\n this.state = {\n account: account,\n };\n }\n\n submitForm = form => {\n const { submitForm } = this.props;\n submitForm('ReviewPayment', form);\n };\n\n render() {\n const { account } = this.state;\n const {\n accounts = {},\n onChangeAccount,\n onCancelled,\n actionDate,\n } = this.props;\n if (!account) {\n return null;\n }\n return (\n <>\n \n \n\n \n \n \n \n\n \n \n \n \n \n
\n\n \n \n >\n );\n }\n}\n\nMakePayment.propTypes = {\n withdrawalAccount: PropTypes.object,\n history: PropTypes.object,\n resetMakeWithdrawal: PropTypes.func,\n accounts: PropTypes.object,\n fetchAccountsIfNeeded: PropTypes.func,\n account: PropTypes.object,\n makeaWithdraw: PropTypes.func,\n onChangeAccount: PropTypes.func,\n match: PropTypes.any,\n actionDate: PropTypes.any,\n submitForm: PropTypes.func,\n onCancelled: PropTypes.func,\n};\n\nexport default MakePayment;\n","import React, { Component } from 'react';\nimport { Content, FormattedCurrency, Switch } from '@myie/interact-dom';\nimport { Button } from 'reactstrap';\nimport { withRouter } from 'react-router-dom';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { Col, Row } from 'reactstrap';\nimport moment from 'moment';\nimport { mapDispatchToProps } from '@myie/interact-ccb-savings-servicing';\nimport Currency from 'react-currency-formatter';\n\nclass Confirmation extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n date: moment(new Date())\n .utc()\n .format('YYYY-MM-DD'),\n message: '',\n disabled: false,\n };\n }\n\n // these response status force the form to be reset and switched back to the first page\n static getDerivedStateFromProps = nextProps => {\n const { makeWithdrawResponse = {} } = nextProps;\n\n if (\n makeWithdrawResponse &&\n makeWithdrawResponse.ResponseStatus === 'Failed'\n ) {\n return {\n message: 'failed',\n disabled: false,\n };\n }\n\n return null;\n };\n\n submit = () => {\n if (this.state.disabled) {\n return;\n }\n this.setState({ disabled: true });\n const { onSubmitWithdrawal } = this.props;\n onSubmitWithdrawal();\n };\n\n cancelWithdrawal = () => {\n const { setStage } = this.props;\n setStage('MakePayment');\n };\n render() {\n const { form = {}, account = {} } = this.props;\n let amount =\n form && form.amount && form.amount.value ? form.amount.value : '';\n let reference =\n form && form.reference && form.reference.value\n ? form.reference.value\n : '';\n const closeOption = form.closeAccount ? form.closeAccount.value : false;\n const {\n CurrencyCode,\n RemainingAllowance,\n ExtendedProperties: {\n NominatedAccountNumber,\n NominatedSortCode,\n NominatedAccountName,\n } = {},\n } = account;\n return (\n <>\n \n \n \n
\n\n \n \n \n \n \n \n {account.AccountName}{' '}\n {Currency({\n quantity: RemainingAllowance,\n currency: CurrencyCode,\n })}\n \n {account.SortCode} - {account.AccountNumber}\n \n \n \n \n \n \n {NominatedAccountName}\n \n {NominatedSortCode} - {NominatedAccountNumber}\n \n \n {!closeOption ? (\n <>\n {' '}\n \n \n \n \n \n \n {reference ? (\n <>\n {' '}\n \n \n \n \n {reference}\n \n >\n ) : (\n ''\n )}\n >\n ) : (\n \n \n \n )}\n
\n
\n \n \n \n \n \n \n \n
\n >\n );\n }\n}\n\nConfirmation.propTypes = {\n history: PropTypes.any,\n withdrawalParam: PropTypes.any,\n error: PropTypes.any,\n isFetching: PropTypes.any,\n makeWithdrawResponse: PropTypes.any,\n makeaWithdraw: PropTypes.func,\n account: PropTypes.any,\n form: PropTypes.any,\n setStage: PropTypes.any,\n onSubmitWithdrawal: PropTypes.any,\n};\n\nconst mapStateToProps = state => {\n const { customccbSavingsServicingDefinition } = state;\n return {\n ...customccbSavingsServicingDefinition,\n };\n};\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(withRouter(Confirmation));\n","import React, { Component } from 'react';\nimport { mapDispatchToProps } from '@myie/interact-ccb-savings-servicing';\nimport { connect } from 'react-redux';\nimport PropTypes from 'prop-types';\nimport { Content, FormattedCurrency } from '@myie/interact-dom';\nimport { Col, Row } from 'reactstrap';\nimport { Link } from 'react-router-dom';\nimport Currency from 'react-currency-formatter';\n\nclass WithdrawalSuccess extends Component {\n componentDidMount() {\n const { resetMakeWithdrawal } = this.props;\n resetMakeWithdrawal();\n }\n render() {\n const { form = {}, account = {} } = this.props;\n let amount =\n form && form.amount && form.amount.value ? form.amount.value : '';\n const closeOption = form.closeAccount.value;\n const {\n CurrencyCode,\n Balance,\n ExtendedProperties: {\n NominatedAccountNumber,\n NominatedSortCode,\n NominatedAccountName,\n } = {},\n } = account;\n return (\n <>\n \n \n
\n \n \n \n \n \n \n {account.AccountName}{' '}\n {Currency({\n quantity: Balance,\n currency: CurrencyCode,\n })}\n \n {account.SortCode} - {account.AccountNumber}\n \n \n \n \n \n \n {NominatedAccountName}\n \n {NominatedSortCode} - {NominatedAccountNumber}\n \n \n {!closeOption ? (\n <>\n \n \n \n \n \n \n >\n ) : (\n ''\n )}\n
\n \n \n \n
\n >\n );\n }\n}\n\nWithdrawalSuccess.propTypes = {\n match: PropTypes.any,\n resetMakeWithdrawal: PropTypes.func,\n account: PropTypes.any,\n form: PropTypes.any,\n};\n\nconst mapStateToProps = state => {\n const { customccbSavingsServicingDefinition } = state;\n return {\n ...customccbSavingsServicingDefinition,\n };\n};\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(WithdrawalSuccess);\n","import React from 'react';\nimport { BreadcrumbItem, Breadcrumb, Alert } from 'reactstrap';\nimport { Content, AppMeta } from '@myie/interact-dom';\nimport PropTypes from 'prop-types';\nimport { withRouter } from 'react-router-dom';\nimport { mapDispatchToProps } from '@myie/interact-accounts';\nimport { mapDispatchToProps as mapSavingsServicingDispatchToProps } from '@myie/interact-ccb-savings-servicing';\nimport { connect } from 'react-redux';\nimport { Utility } from '@myie/interact';\nimport moment from 'moment';\nimport MakePayment from './MakePayment';\nimport Confirmation from './Confirmation';\nimport WithdrawalSuccess from './WithdrawalSuccess';\n\nclass MakeWithdrawal extends React.Component {\n constructor(props) {\n super(props);\n\n this.state = this.initialState();\n }\n\n initialState = () => {\n const { accounts, match } = this.props;\n let account;\n if (accounts) {\n account = accounts.Accounts.find(function(element) {\n return Utility.hexEncode(element.AccountKey.Key) === match.params.id;\n });\n } else {\n account = null;\n }\n return {\n account: account,\n stage: 'MakePayment',\n actionDate: moment(new Date())\n .utc()\n .format('YYYY-MM-DD'),\n form: {},\n };\n };\n\n // these response status force the form to be reset and switched back to the first page\n static getDerivedStateFromProps = nextProps => {\n const { makeWithdrawResponse = {} } = nextProps;\n\n if (\n makeWithdrawResponse &&\n makeWithdrawResponse.ResponseStatus === 'Success'\n ) {\n return {\n stage: 'CompletePayment',\n };\n }\n\n return null;\n };\n\n componentDidMount() {\n const { resetMakeWithdrawal, fetchAccountsIfNeeded } = this.props;\n fetchAccountsIfNeeded();\n resetMakeWithdrawal();\n }\n\n componentWillUnmount() {\n const { resetMakeWithdrawal } = this.props;\n resetMakeWithdrawal();\n }\n\n componentDidUpdate(prevProps) {\n const { match, accounts } = this.props;\n if (accounts && prevProps.accounts !== accounts) {\n const account = accounts.Accounts.find(function(element) {\n return Utility.hexEncode(element.AccountKey.Key) === match.params.id;\n });\n this.setState({ ...this.state, account });\n }\n }\n\n // common onChangeAccount function\n onChangeAccount = e => {\n const { resetMakeWithdrawal, fetchAccountsIfNeeded, accounts } = this.props;\n fetchAccountsIfNeeded();\n resetMakeWithdrawal();\n const { value } = e.target;\n if (accounts && accounts.Accounts) {\n const account = accounts.Accounts.find(function(element) {\n return element.AccountKey.Key === value;\n });\n this.setState({ ...this.initialState(), account });\n }\n };\n\n // change the stage of the form\n setStage = stage => {\n this.setState({ ...this.state, stage, message: null });\n };\n\n setForm = form => {\n this.setState({ ...this.state, form, message: null });\n };\n\n onCancelleWithdrawal = () => {\n const { history } = this.props;\n history.push('/accounts/list');\n };\n\n //update the stage in state\n submitForm = (stage, form) => {\n if (stage === 'MakePayment') {\n const { resetMakeWithdrawal } = this.props;\n resetMakeWithdrawal();\n }\n\n this.setState({ ...this.state, stage, form, message: null });\n };\n\n onCancelleWithdrawal = () => {\n const { history } = this.props;\n history.push('/accounts/list');\n };\n\n onSubmitWithdrawal = () => {\n const { account, form } = this.state;\n const { makeaWithdraw } = this.props;\n let formCloseAccount = form.closeAccount.value;\n let request = {\n AccountKey: account.AccountKey,\n WithdrawalInformation: {\n ActionDate: this.state.actionDate,\n Amount: form.amount.value.replace(/,/g, ''),\n CloseAccount: false,\n PaymentReference: form.reference.value ? form.reference.value : null,\n },\n };\n if (formCloseAccount) {\n request = {\n AccountKey: account.AccountKey,\n WithdrawalInformation: {\n ActionDate: this.state.actionDate,\n CloseAccount: true,\n },\n };\n }\n\n makeaWithdraw(request);\n };\n\n // select current stage\n currentStage = () => {\n const { accounts = {} } = this.props;\n const { account = {} } = this.state;\n switch (this.state.stage) {\n case 'MakePayment':\n return (\n \n );\n case 'ReviewPayment':\n return (\n \n );\n case 'CompletePayment':\n return (\n \n );\n\n default:\n }\n };\n\n render() {\n const { account, stage } = this.state;\n const { error, isFetching } = this.props;\n if (!account) {\n return null;\n }\n return (\n <>\n {stage === 'MakePayment' ? (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n >\n ) : (\n ''\n )}\n\n {stage === 'ReviewPayment' ? (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n >\n ) : (\n ''\n )}\n\n {stage === 'CompletePayment' ? (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n >\n ) : (\n ''\n )}\n {!isFetching && error ? (\n \n {error}\n \n ) : null}\n {this.currentStage()}\n >\n );\n }\n}\n\nMakeWithdrawal.propTypes = {\n withdrawalAccount: PropTypes.object,\n history: PropTypes.object,\n resetMakeWithdrawal: PropTypes.func,\n accounts: PropTypes.object,\n fetchAccountsIfNeeded: PropTypes.func,\n makeaWithdraw: PropTypes.func,\n match: PropTypes.any,\n error: PropTypes.any,\n holidays: PropTypes.any,\n isFetching: PropTypes.any,\n};\n\nconst mapStateToProps = state => {\n const { accountsDefinition, customccbSavingsServicingDefinition } = state;\n return {\n ...accountsDefinition,\n ...customccbSavingsServicingDefinition,\n };\n};\n\nexport default connect(\n mapStateToProps,\n { ...mapDispatchToProps, ...mapSavingsServicingDispatchToProps },\n)(withRouter(MakeWithdrawal));\n","import React, { Component } from 'react';\nimport { Switch, Route } from 'react-router-dom';\nimport { PrivateRoute, NoMatch } from '@myie/interact-dom';\nimport MakeWithdrawal from './MakeWithdrawal';\n\nclass MakeWithdrawalRoute extends Component {\n render() {\n return (\n \n );\n }\n}\n\nexport default MakeWithdrawalRoute;\n","export const storage = {\n name: 'shortApply',\n};\n","import React, { Fragment } from 'react';\nimport { Link } from 'react-router-dom';\nimport { connect } from 'react-redux';\nimport { Content, AppMeta } from '@myie/interact-dom';\nimport { mapDispatchToProps as mapSavingsServicingDispatchToProps } from '@myie/interact-ccb-savings-servicing';\nimport { ApplyAccountSummaryComponent } from '@myie/interact-savings-servicing-dom';\nimport PropTypes from 'prop-types';\nimport { CONTACTS } from '@myie/interact-local-dom';\n\nclass ShortApplyList extends React.Component {\n componentDidMount() {\n window.scrollTo(0, 0);\n }\n\n renderOutput = () => {\n const { allProducts } = this.props;\n let output = [];\n let shortApplyAvailable = false;\n if (allProducts) {\n allProducts.forEach(product => {\n if (product.Display_For_Short_Apply === 'Y') {\n shortApplyAvailable = true;\n }\n });\n }\n if (shortApplyAvailable) {\n output.push(\n \n \n \n \n \n ,\n );\n }\n\n if (output.length === 0) {\n if (!this.props.isFetching && allProducts) {\n output.push(\n \n \n \n \n \n \n
\n ,\n );\n } else {\n output.push(\n \n \n
,\n );\n }\n }\n return output;\n };\n\n render() {\n return (\n \n
\n
\n {this.renderOutput()}\n
\n );\n }\n}\n\nShortApplyList.propTypes = {\n accounts: PropTypes.any,\n fetchAccountsIfNeeded: PropTypes.any,\n updateUrl: PropTypes.func,\n getAllProducts: PropTypes.any,\n allProducts: PropTypes.any,\n setStage: PropTypes.func,\n setStateDynamic: PropTypes.func,\n isFetching: PropTypes.any,\n};\nconst mapStateToProps = state => {\n const { accountsDefinition, customccbSavingsServicingDefinition } = state;\n return {\n ...accountsDefinition,\n ...customccbSavingsServicingDefinition,\n };\n};\n\nexport default connect(\n mapStateToProps,\n {\n ...mapSavingsServicingDispatchToProps,\n },\n)(ShortApplyList);\n","import React, { Component } from 'react';\nimport { withRouter } from 'react-router-dom';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { storage } from './storageName';\nimport ShortApplyList from './ShortApplyList';\nimport { mapDispatchToProps as userManagementDispatches } from '@myie/interact-user-management';\nimport { mapDispatchToProps } from '@myie/interact-ccb-savings-servicing';\nimport loadStateHOC from '../../shared/stateManager/loadStateHOC';\nimport { mapDispatchToProps as ccbOrganisationDispatches } from '@myie/interact-ccb-organisation';\n\nclass OptionOneAndThree extends Component {\n constructor(props) {\n super(props);\n this.timeoutID = null;\n this.state = {\n message: '',\n disabled: false,\n };\n }\n\n componentDidMount() {\n const { getAllProducts, allProducts } = this.props;\n if (!allProducts) {\n getAllProducts({\n checkLimitExceeded: true,\n isShortApply: true,\n });\n }\n }\n\n componentWillUnmount() {\n const { resetShortapply } = this.props;\n resetShortapply();\n }\n\n render() {\n return (\n \n );\n }\n}\n\nOptionOneAndThree.propTypes = {\n submit: PropTypes.func,\n account: PropTypes.any,\n getAllProducts: PropTypes.any,\n form: PropTypes.any,\n reviewPaymentHeader: PropTypes.string,\n showMaturity: PropTypes.any,\n cancelWithdrawal: PropTypes.func,\n changeHeader: PropTypes.func,\n setStateDynamic: PropTypes.func,\n getAccountDetails: PropTypes.func,\n userDetails: PropTypes.any,\n accounts: PropTypes.object,\n fetchAccountsIfNeeded: PropTypes.func,\n resetShortapply: PropTypes.func,\n fetchUserDetailsIfNeeded: PropTypes.func,\n savingshortapply: PropTypes.object,\n stateData: PropTypes.any,\n refreshUrl: PropTypes.func,\n updateUrl: PropTypes.any,\n urlParams: PropTypes.any,\n allProducts: PropTypes.any,\n};\n\nconst mapStateToProps = state => {\n const {\n userManagementDefinition,\n accountsDefinition,\n customccbSavingsServicingDefinition,\n customccbOrganisationDefinition,\n } = state;\n return {\n ...customccbSavingsServicingDefinition,\n ...userManagementDefinition,\n ...accountsDefinition,\n ...customccbOrganisationDefinition,\n };\n};\nexport default loadStateHOC(\n connect(\n mapStateToProps,\n {\n ...userManagementDispatches,\n ...mapDispatchToProps,\n ...ccbOrganisationDispatches,\n },\n )(withRouter(OptionOneAndThree)),\n storage.name,\n);\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport { mapDispatchToProps } from '@myie/interact-accounts';\nimport { Validate } from '@myie/interact';\nimport { Row, Col, Form, Button, BreadcrumbItem } from 'reactstrap';\nimport {\n Content,\n RadioGroup,\n Radio,\n FormErrorList,\n CONSTANTS,\n RULES,\n DropDown,\n Currency,\n TextArea,\n AppMeta,\n} from '@myie/interact-dom';\nimport { Link } from 'react-router-dom';\nimport { mapDispatchToProps as mapSavingsServicingDispatchToProps } from '@myie/interact-ccb-savings-servicing';\nimport { mapDispatchToProps as ccbOrganisationDispatches } from '@myie/interact-ccb-organisation';\nimport { Session } from '@myie/interact';\n\nimport PropTypes from 'prop-types';\n\nclass ShortApplyApplication extends React.Component {\n constructor(props) {\n super(props);\n this.state = this.initialState(props);\n }\n\n initialState = props => {\n const { formData, selectedProduct, selectedOrganisationDetails } = props;\n let data = formData ? formData : null;\n const organisationDetailsChangedInputRules = {\n rules: {\n stop: true,\n required: {\n message:\n 'Please confirm which details about the organisation have changed.',\n },\n format: {\n regex: /^[^\\s](.|[\\r\\n]){1,750}$/,\n message: 'Please enter a valid message.',\n },\n },\n };\n const formItems = {\n organisationSource: {\n rules: {\n stop: true,\n required: {\n message:\n 'Please confirm which organisation you are opening the account on behalf of',\n },\n },\n value: data ? data.organisationSource : '',\n },\n orgDetailsChanged: {\n rules: {\n required: {\n message:\n 'Please confirm if your organisation details have changed.',\n },\n },\n value: data ? data.orgDetailsChanged : '',\n },\n organisationDetailsChangedInput: {\n rules:\n data?.orgDetailsChanged === CONSTANTS.YES\n ? { ...organisationDetailsChangedInputRules.rules }\n : {},\n value: data ? data.organisationDetailsChangedInput : '',\n },\n depositAmount: {\n rules: {\n stop: true,\n required: {\n message: 'Please enter the amount you would like to invest.',\n },\n format: {\n regex: RULES.ammountFormat,\n message: 'Please enter a valid amount.',\n },\n minAmountCheckWithInputValue: {\n message: `Please enter a value that is above the minimum investment amount.`,\n comparison: () => {\n return selectedProduct.Minimum_investment;\n },\n },\n maxAmountCheckWithInputValue: {\n message: `Please enter a value that is below the maximum investment amount`,\n comparison: () => {\n return selectedProduct.Maximum_investment;\n },\n },\n },\n value: data ? data.depositAmount : '',\n },\n depositSource: {\n rules: {\n stop: true,\n required: {\n message: 'Please select where the deposit has come from.',\n },\n },\n value: data ? data.depositSource : '',\n },\n depositMethod: {\n rules: {\n stop: true,\n required: {\n message: 'Please confirm how you will make your deposit.',\n },\n },\n value: data ? data.depositMethod : '',\n },\n };\n\n return {\n data: data ? data : {},\n form: formItems,\n organisationDetailsChangedInputRules:\n organisationDetailsChangedInputRules.rules,\n selectedOrganisationDetails: selectedOrganisationDetails,\n };\n };\n\n componentDidUpdate() {\n this.initialState(this.props);\n const { organisation } = this.props;\n if (organisation && Array.isArray(organisation.codes)) {\n const { organisationDetailsFetch, isFetching } = this.props;\n let detailsCount = organisation.details?.length;\n if (!isFetching && organisation.codes?.length > detailsCount) {\n const request = {\n CustomerId: organisation.codes[detailsCount].Id,\n };\n organisationDetailsFetch(request);\n }\n }\n }\n\n componentDidMount() {\n window.scrollTo(0, 0);\n const { organisation } = this.props;\n if (!organisation) {\n const customer = Session.customer();\n const request = {\n PersonId: customer.UserId,\n };\n const { organisationfetch } = this.props;\n organisationfetch(request);\n }\n }\n\n updateCurrency = e => {\n let { name, value } = e.target;\n const { data } = this.state;\n let newValue = value;\n newValue = new Intl.NumberFormat().format(value.replace(/,/g, ''));\n\n // Deal with trailing . or .0 or .n0\n if (value.charAt(value.length - 1) === '.') {\n newValue += '.';\n }\n if (value.slice(value.length - 2) === '.0') {\n newValue += '.0';\n }\n if (\n value.charAt(value.length - 3) === '.' &&\n value.charAt(value.length - 1) === '0'\n ) {\n if (value.charAt(value.length - 2) === '0') {\n newValue += '.0';\n }\n newValue += '0';\n }\n if (newValue === '0') {\n newValue = '';\n }\n let { form } = this.state;\n form = Validate.input(name, newValue, form, true);\n data[name] = value;\n\n this.setState({ ...this.state, form });\n };\n\n onChange = e => {\n this.updateForm(e);\n };\n\n onBlur = e => {\n this.updateForm(e);\n };\n\n updateForm = e => {\n const { name, value } = e.target;\n let { form, data } = this.state;\n form = Validate.input(name, value, form, true);\n data[name] = value;\n this.setState({ ...this.state, form, data }, () => {\n if (name === 'organisationSource') {\n this.updateOrganisationDetails(form.organisationSource.value);\n }\n });\n };\n\n updateOrganisationDetails = orgId => {\n const { organisationDetails } = this.props;\n let selectedOrgDetails = organisationDetails.find(\n item => item.CustomerId === orgId,\n );\n this.setState({ selectedOrganisationDetails: selectedOrgDetails });\n };\n\n onEvent = e => {\n const { name, value } = e.target;\n let { form, organisationDetailsChangedInputRules, data } = this.state;\n form = Validate.input(name, value, form, true);\n if (name === 'orgDetailsChanged' && value === CONSTANTS.YES) {\n form.organisationDetailsChangedInput.rules = {\n ...organisationDetailsChangedInputRules,\n };\n }\n if (name === 'orgDetailsChanged' && value === CONSTANTS.NO) {\n form.organisationDetailsChangedInput.rules = {};\n form = Validate.input('organisationDetailsChangedInput', '', form, true);\n data['organisationDetailsChangedInput'] = '';\n }\n data[name] = value;\n this.setState({ ...this.state, form, data });\n };\n\n onSubmitHandler = e => {\n e.preventDefault();\n\n let { form, data, selectedOrganisationDetails } = this.state;\n let { updateUrl, setStateDynamic } = this.props;\n let actualForm;\n if (form.depositAmount.value === '0') {\n form.depositAmount.value = '';\n }\n actualForm = Validate.form(form);\n this.setState({ ...this.state, form: actualForm });\n\n if (!actualForm.approved) {\n window.scrollTo(0, 0);\n return;\n }\n setStateDynamic({\n stage: 'review',\n });\n\n let stateData = {\n formData: data,\n selectedOrganisationDetails,\n url: {\n pageStage: 'review',\n },\n };\n updateUrl(stateData);\n //setShortapply(request);\n };\n\n onClick = e => {\n const { name, checked } = e.target;\n let { form, data } = this.state;\n\n form = Validate.input(name, checked ? 'true' : null, form);\n data[name] = checked ? 'true' : null;\n\n this.setState({ ...this.state, form, data });\n };\n\n dropdownOptions(item, index) {\n let keys = Object.keys(item);\n return (\n \n {item[keys[0]]}\n \n );\n }\n\n organisationDropdownOption(item, index, name) {\n let keys = Object.keys(item);\n return (\n \n {item.FullName}\n \n );\n }\n\n onBlur = e => {\n this.updateForm(e);\n };\n\n changeStage = () => {\n const { setStateDynamic } = this.props;\n setStateDynamic({ stage: 'list' });\n };\n\n valueToCurrencyFormat = (number, code) => {\n const formatter = new Intl.NumberFormat('en-us', {\n style: 'currency',\n currency: code,\n });\n return formatter.format(number);\n };\n\n render() {\n const currencyCode = 'GBP';\n const { selectedProduct, organisation } = this.props;\n const organisationList = organisation?.codes;\n const { form, selectedOrganisationDetails } = this.state;\n if (!selectedProduct) {\n return null;\n }\n let { CorrespondenceAddress = null, RegisteredAddress = null } =\n selectedOrganisationDetails || {};\n\n return (\n \n
\n
\n
\n
\n \n \n \n \n \n \n 2: \n \n \n \n \n \n \n \n \n \n 2: \n \n \n \n \n
\n
\n
\n
\n
\n );\n }\n}\n\nShortApplyApplication.propTypes = {\n accounts: PropTypes.any,\n fetchAccountsIfNeeded: PropTypes.any,\n onSubmit: PropTypes.func,\n setStage: PropTypes.func,\n userDetails: PropTypes.any,\n updateUrl: PropTypes.func,\n setStateDynamic: PropTypes.any,\n formData: PropTypes.any,\n selectedProduct: PropTypes.any,\n data: PropTypes.any,\n setShortapply: PropTypes.func,\n organisationDetails: PropTypes.any,\n organisation: PropTypes.any,\n organisationDetailsFetch: PropTypes.func,\n organisationfetch: PropTypes.func,\n isFetching: PropTypes.bool,\n};\nconst mapStateToProps = state => {\n const {\n accountsDefinition,\n customccbSavingsServicingDefinition,\n customccbOrganisationDefinition,\n } = state;\n return {\n ...accountsDefinition,\n ...customccbSavingsServicingDefinition,\n ...customccbOrganisationDefinition,\n };\n};\n\nexport default connect(\n mapStateToProps,\n {\n ...mapDispatchToProps,\n ...mapSavingsServicingDispatchToProps,\n ...ccbOrganisationDispatches,\n },\n)(ShortApplyApplication);\n","const appUtility = (function() {\n const getPayload = (\n formData,\n reviewForm,\n selectedProduct,\n userDetails,\n selectedOrganisationDetails,\n ) => {\n let accountDetails = null;\n const details = selectedOrganisationDetails;\n const obj = {\n Application: {\n DepositFundsOption: formData?.depositSource ?? '',\n ProductTypeCode: selectedProduct?.Product_Code,\n DepositAmount: {\n Amount: formData?.depositAmount.toString().replace(/,/g, ''),\n ExtendedProperties: [{}, {}, {}],\n },\n PayInterestIntoAnotherAccount: accountDetails?.interestPaymentLocation,\n InterestPaymentFrequency: selectedProduct?.Interest_Frequency,\n DOB: userDetails?.ExtendedProperties?.DateOfBirth,\n ExtendedProperties: [\n { Name: 'FirstName', Value: userDetails.FirstName },\n { Name: 'LastName', Value: userDetails.Surname },\n {\n Name: 'ChangedDetails',\n Value: formData.organisationDetailsChangedInput ?? '',\n },\n {\n Name: 'OrganisationDetailsChanged',\n Value: formData.orgDetailsChanged === 'yes' ? 'true' : 'false',\n },\n {\n Name: 'OrganisationName',\n Value: details?.FullName ?? '',\n },\n {\n Name: 'OrganisationEmail',\n Value: details?.ContactDetails?.Email ?? '',\n },\n {\n Name: 'CustomerId',\n Value: formData?.organisationSource ?? '',\n },\n {\n Name: 'DepositMeans',\n Value: formData?.depositMethod ?? '',\n },\n {\n Name: 'FCSCConfirmation',\n Value: reviewForm?.informationConfirm.value ? 'true' : 'false',\n },\n ],\n },\n ExtendedProperties: [\n {\n Name: 'ApplicationType',\n Value: 'ShortApply',\n },\n ],\n };\n\n return obj;\n };\n\n return {\n getPayload: getPayload,\n };\n})();\n\nexport default appUtility;\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport { mapDispatchToProps } from '@myie/interact-accounts';\nimport { Validate } from '@myie/interact';\nimport { Row, Col, Form, Button, BreadcrumbItem, Spinner } from 'reactstrap';\nimport {\n Content,\n FormErrorList,\n FormattedCurrency,\n Check,\n Markdown,\n} from '@myie/interact-dom';\nimport { mapDispatchToProps as mapSavingsServicingDispatchToProps } from '@myie/interact-ccb-savings-servicing';\nimport PropTypes from 'prop-types';\nimport requestPayload from '../shortApply/requestPayload';\nimport { mapDispatchToProps as ccbOrganisationDispatches } from '@myie/interact-ccb-organisation';\nimport { mapDispatchToProps as userManagementDispatches } from '@myie/interact-user-management';\nclass ShortApplyApplication extends React.Component {\n constructor(props) {\n super(props);\n this.state = this.initialState(props);\n }\n\n initialState = props => {\n const { selectedProduct } = props;\n let data = null;\n const formItems = {\n accuracyConfirm: {\n rules: {\n required: {\n message:\n 'You cannot proceed without opening and reading the Account Terms & Conditions, Summary Box & Tariff of Charges. Please tick the box to authorise the application.',\n },\n },\n value: false,\n },\n informationConfirm: {\n rules: {\n required: {\n message:\n 'You cannot proceed without opening and reading the Information Sheet & Exclusions List. Please tick the box to authorise the application.',\n },\n },\n value: false,\n },\n };\n\n if (\n selectedProduct &&\n selectedProduct.InterestPaymentFrequency &&\n selectedProduct.InterestPaymentFrequency === 'both'\n ) {\n formItems.interestPaymentFrequency = {\n rules: {\n stop: true,\n required: {\n message:\n 'Please tell us when you would like us to pay your interest.',\n },\n },\n value: data ? data.interestPaymentFrequency : '',\n };\n }\n return {\n data: data ? data : {},\n form: formItems,\n };\n };\n\n dropdownOptionValue(item, value) {\n let keys = Object.keys(item);\n if (keys[0] === value) {\n return item[keys[0]];\n }\n }\n\n componentDidUpdate() {\n this.initialState(this.props);\n }\n\n componentDidMount() {\n window.scrollTo(0, 0);\n const { fetchUserDetailsIfNeeded } = this.props;\n let request = {\n ExtendedProperties: {},\n };\n fetchUserDetailsIfNeeded(request);\n }\n\n updateCurrency = e => {\n let { name, value } = e.target;\n const { data } = this.state;\n let newValue = value;\n newValue = new Intl.NumberFormat().format(value.replace(/,/g, ''));\n\n // Deal with trailing . or .0 or .n0\n if (value.charAt(value.length - 1) === '.') {\n newValue += '.';\n }\n if (value.slice(value.length - 2) === '.0') {\n newValue += '.0';\n }\n if (\n value.charAt(value.length - 3) === '.' &&\n value.charAt(value.length - 1) === '0'\n ) {\n if (value.charAt(value.length - 2) === '0') {\n newValue += '.0';\n }\n newValue += '0';\n }\n if (newValue === '0') {\n newValue = '';\n }\n let { form } = this.state;\n form = Validate.input(name, newValue, form, true);\n data[name] = value;\n\n this.setState({ ...this.state, form });\n };\n\n onChange = e => {\n this.updateForm(e);\n };\n\n onBlur = e => {\n this.updateForm(e);\n };\n\n updateForm = e => {\n const { name, checked } = e.target;\n let { form } = this.state;\n form = Validate.input(name, checked, form);\n this.setState({ ...this.state, form });\n };\n\n onSubmitHandler = e => {\n e.preventDefault();\n const { userDetails } = this.props;\n let {\n saveShortApply,\n selectedProduct,\n formData,\n updateUrl,\n selectedOrganisationDetails,\n } = this.props;\n let { form } = this.state;\n\n form = Validate.form(form);\n if (form.approved) {\n let request = requestPayload.getPayload(\n formData,\n form,\n selectedProduct,\n userDetails,\n selectedOrganisationDetails,\n );\n saveShortApply(request);\n let stateData = {\n formData: formData,\n };\n updateUrl(stateData);\n } else {\n window.scrollTo(0, 0);\n this.setState({ form });\n }\n };\n\n onClick = e => {\n const { name, checked } = e.target;\n let { form, data } = this.state;\n\n form = Validate.input(name, checked ? 'true' : null, form);\n data[name] = checked ? 'true' : null;\n\n this.setState({ ...this.state, form, data });\n };\n\n dropdownOptions(item, index, name) {\n let keys = Object.keys(item);\n return (\n \n {item[keys[0]]}\n \n );\n }\n\n changeDetails = () => {\n const { formData, updateUrl, setStateDynamic } = this.props;\n setStateDynamic({\n stage: 'apply',\n });\n let stateData = {\n formData: formData,\n url: {\n pageStage: 'apply',\n },\n };\n setStateDynamic({ stage: 'apply' });\n updateUrl(stateData);\n };\n\n onBlur = e => {\n this.updateForm(e);\n };\n\n changeStage = () => {\n const { setStateDynamic } = this.props;\n setStateDynamic({ stage: 'list' });\n };\n\n render() {\n const {\n selectedProduct,\n formData,\n userDetails,\n selectedOrganisationDetails,\n isFetching,\n } = this.props;\n const details = selectedOrganisationDetails;\n let { CorrespondenceAddress = null, RegisteredAddress = null } =\n details || {};\n if (!userDetails) {\n return (\n \n \n {`...`}\n
\n );\n }\n const { Title, FirstName, MiddleName, Surname } = userDetails;\n const { form } = this.state;\n\n return (\n \n
\n\n
\n
\n \n \n \n \n \n \n 2: \n \n \n \n \n \n \n \n \n \n 2: \n \n \n \n \n
\n
\n
\n
\n {isFetching && (\n <>\n \n \n
\n \n >\n )}\n {!isFetching && (\n <>\n \n \n \n \n \n \n {selectedProduct.Product_Name}\n \n \n \n \n \n {details?.FullName}\n \n
\n \n \n \n \n \n \n {CorrespondenceAddress?.Street ? (\n \n {CorrespondenceAddress?.Street}\n \n \n ) : null}\n {CorrespondenceAddress?.District ? (\n \n {CorrespondenceAddress?.District}\n \n \n ) : null}\n {CorrespondenceAddress?.Town ? (\n \n {CorrespondenceAddress?.Town}\n \n \n ) : null}\n {CorrespondenceAddress?.County ? (\n \n {CorrespondenceAddress?.County}\n \n \n ) : null}\n {CorrespondenceAddress?.Postcode ? (\n \n {CorrespondenceAddress?.Postcode}\n \n \n ) : null}\n \n \n \n \n \n \n \n {RegisteredAddress?.Street ? (\n \n {RegisteredAddress?.Street}\n \n \n ) : null}\n {RegisteredAddress?.District ? (\n \n {RegisteredAddress?.District}\n \n \n ) : null}\n {RegisteredAddress?.Town ? (\n \n {RegisteredAddress?.Town}\n \n \n ) : null}\n {RegisteredAddress?.County ? (\n \n {RegisteredAddress?.County}\n \n \n ) : null}\n {RegisteredAddress?.Postcode ? (\n \n {RegisteredAddress?.Postcode}\n \n \n ) : null}\n \n \n \n \n \n \n {formData.orgDetailsChanged === 'yes' ? 'Yes' : 'No'}\n \n {formData.orgDetailsChanged === 'yes' && (\n <>\n \n \n \n \n {formData.organisationDetailsChangedInput}\n \n >\n )}\n
\n \n \n \n \n \n \n \n \n \n \n \n \n {formData.depositSource}\n \n \n \n \n \n {formData.depositMethod}\n \n
\n \n }\n id={`accuracyConfirm`}\n field=\"accuracyConfirm\"\n value={false}\n onChange={this.onChange}\n validation={form.accuracyConfirm}\n showErrors={true}\n />\n Account Terms & Conditions, the Summary Box and the Tariff of Charges (together the Agreement) being presented to me electronically. That I have full legal authority to enter into the Agreement on behalf of the organisation I represent, and I have read and understand the Agreement and agree to be bound by its terms.\\n\\nI agree that the savings product will be provided subject to the Agreement, as specified and amended from time to time.\\n\\nI understand that the Agreement is legally binding and is enforceable under the laws of England and Wales.\\n\\nI confirm that I am eligible to apply for this savings account and that the information provided as part of the account opening is true and accurate.\\n\\nI confirm that the organisation I represent authorise you to act on the instructions of the signatories (as set out to you in the Terms & Conditions) and you will not be responsible if the organisation suffers a loss as a result of you acting on the authority and instructions of the signatories. I confirm that the signatories are authorised to act on behalf of the organisation and will tell you immediately in writing if the signatories are to be changed or removed;\\n\\nWe are covered by the Financial Services Compensation Scheme (FSCS). The FSCS can pay compensation to depositors if a bank is unable to meet its financial obligations.\\n\\nFor the current level of cover, further details and to view/download the Information Sheet & Exclusions list, please visit our site at www.ccbank.co.uk/fscs .`}\n />\n \n 0344 225 3939 or email savings@ccbank.co.uk .`}\n />\n \n\n 0800 678 1100 or visit www.fscs.org.uk .`}\n />\n\n \n >\n )}\n \n \n \n \n \n \n \n
\n \n
\n );\n }\n}\n\nShortApplyApplication.propTypes = {\n accounts: PropTypes.any,\n fetchAccountsIfNeeded: PropTypes.any,\n onSubmit: PropTypes.func,\n setStage: PropTypes.func,\n userDetails: PropTypes.any,\n setStateDynamic: PropTypes.any,\n formData: PropTypes.any,\n selectedProduct: PropTypes.any,\n data: PropTypes.any,\n saveShortApply: PropTypes.func,\n updateUrl: PropTypes.func,\n organisation: PropTypes.any,\n fetchUserDetailsIfNeeded: PropTypes.func,\n selectedOrganisationDetails: PropTypes.object,\n isFetching: PropTypes.bool,\n};\nconst mapStateToProps = state => {\n const {\n accountsDefinition,\n customccbSavingsServicingDefinition,\n customccbOrganisationDefinition,\n userManagementDefinition,\n } = state;\n return {\n ...accountsDefinition,\n ...customccbOrganisationDefinition,\n ...userManagementDefinition,\n ...customccbSavingsServicingDefinition,\n };\n};\n\nexport default connect(\n mapStateToProps,\n {\n ...mapDispatchToProps,\n ...mapSavingsServicingDispatchToProps,\n ...ccbOrganisationDispatches,\n ...userManagementDispatches,\n },\n)(ShortApplyApplication);\n","import React, { Component } from 'react';\nimport { mapDispatchToProps } from '@myie/interact-ccb-savings-servicing';\nimport { connect } from 'react-redux';\nimport PropTypes from 'prop-types';\nimport { Link } from 'react-router-dom';\nimport { AppMeta, Content, Markdown } from '@myie/interact-dom';\nimport { CONTACTS } from '@myie/interact-local-dom';\nimport { Row, Col } from 'reactstrap';\n\nclass ApplicationSuccess extends Component {\n componentDidMount() {\n window.scrollTo(0, 0);\n }\n\n render() {\n return (\n \n \n \n \n \n \n \n \n \n \n {this.props?.saveShortApplyData?.Reference\n ? this.props.saveShortApplyData.Reference\n : ''}\n \n
\n
\n \n \n \n \n
\n \n );\n }\n}\n\nApplicationSuccess.propTypes = {\n saveShortApplyData: PropTypes.object,\n selectedProduct: PropTypes.object,\n};\n\nexport default connect(\n null,\n mapDispatchToProps,\n)(ApplicationSuccess);\n","import React, { Component } from 'react';\nimport { withRouter, Redirect } from 'react-router-dom';\nimport { stateUtility } from '@myie/interact-dom';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { Utility } from '@myie/interact';\nimport { storage } from './storageName';\nimport ShortApplyApplication from '../shared/ShortApplyApplication';\nimport ShortApplyReview from '../shared/ShortApplyReview';\nimport ApplicationSuccess from './ApplicationSuccess';\nimport { mapDispatchToProps as accountsDispatchToProps } from '@myie/interact-accounts';\nimport { mapDispatchToProps as userManagementDispatches } from '@myie/interact-user-management';\nimport { mapDispatchToProps } from '@myie/interact-ccb-savings-servicing';\nimport loadStateHOC from '../../shared/stateManager/loadStateHOC';\n\nclass ShortApplyProduct extends Component {\n constructor(props) {\n super(props);\n const { urlParams, stateData, resetSaveShortApply } = this.props;\n const stateList = ['apply', 'review', 'applySuccess'];\n\n const hasStage = stateList.find(element => element === urlParams.pageStage);\n let stage =\n stateData &&\n stateData.url &&\n stateData.url.pageStage &&\n this.props.urlParams &&\n this.props.urlParams.pageStage\n ? this.props.urlParams.pageStage\n : 'apply';\n if (!hasStage) {\n stage = 'apply';\n resetSaveShortApply();\n }\n\n stateUtility.setGlobalValue({ storage: storage.name });\n this.timeoutID = null;\n this.state = {\n message: '',\n selectedProduct: null,\n stage: stage,\n disabled: false,\n };\n }\n\n componentWillUnmount() {\n const { resetSaveShortApply } = this.props;\n resetSaveShortApply();\n }\n static getDerivedStateFromProps = (nextProps, thisState) => {\n const {\n allProducts,\n match,\n saveShortApplyResponse,\n stateData,\n updateUrl,\n } = nextProps;\n const { selectedProduct, stage } = thisState;\n\n let product = null;\n\n if (allProducts && !selectedProduct) {\n allProducts.forEach(element => {\n if (\n match.params &&\n match.params.id === Utility.hexEncode(element.Product_Code)\n ) {\n product = element;\n }\n });\n\n return {\n selectedProduct: product,\n };\n }\n\n if (\n saveShortApplyResponse &&\n saveShortApplyResponse.Status === 'Success' &&\n stage !== 'applySuccess'\n ) {\n let data = {\n formData: {\n ...stateData.formData,\n },\n url: {\n pageStage: 'applySuccess',\n },\n };\n\n updateUrl(data);\n return {\n stage: 'applySuccess',\n };\n }\n\n return null;\n };\n // change the stage of the form\n setStage = stage => {\n this.setState({ ...this.state, stage, message: null });\n };\n\n setStateDynamic = list => {\n this.setState({ ...this.state, ...list });\n };\n\n selectProduct = product => {\n const { setStateDynamic, form } = this.props;\n this.setState({ ...this.state, selectedProduct: product });\n setStateDynamic({\n reviewPaymentHeader:\n form && form.destination && form.destination.value === 'new'\n ? 'review'\n : 'optionThree',\n selectedProduct: product,\n });\n };\n\n render() {\n const { stage } = this.state;\n const { userDetails, accounts = {}, organisation } = this.props;\n\n if (!this.state.selectedProduct) {\n return ;\n }\n\n if (stage === 'applySuccess') {\n return (\n \n );\n }\n\n switch (stage) {\n case 'apply':\n return (\n \n );\n case 'review':\n return (\n \n );\n\n default:\n }\n\n return null;\n }\n}\n\nShortApplyProduct.propTypes = {\n submit: PropTypes.func,\n account: PropTypes.any,\n getAllProducts: PropTypes.any,\n form: PropTypes.any,\n reviewPaymentHeader: PropTypes.string,\n showMaturity: PropTypes.any,\n cancelWithdrawal: PropTypes.func,\n changeHeader: PropTypes.func,\n saveShortApplyResponse: PropTypes.object,\n setStateDynamic: PropTypes.func,\n getAccountDetails: PropTypes.func,\n userDetails: PropTypes.any,\n accounts: PropTypes.object,\n fetchAccountsIfNeeded: PropTypes.func,\n resetSaveShortApply: PropTypes.func,\n fetchUserDetailsIfNeeded: PropTypes.func,\n savingshortapply: PropTypes.object,\n stateData: PropTypes.any,\n getDepositProduct: PropTypes.func,\n match: PropTypes.any,\n updateUrl: PropTypes.any,\n depositProduct: PropTypes.object,\n urlParams: PropTypes.any,\n organisation: PropTypes.any,\n};\n\nconst mapStateToProps = state => {\n const {\n customccbSavingsServicingDefinition,\n userManagementDefinition,\n accountsDefinition,\n customccbOrganisationDefinition,\n } = state;\n return {\n ...customccbSavingsServicingDefinition,\n ...userManagementDefinition,\n ...accountsDefinition,\n ...customccbOrganisationDefinition,\n };\n};\nexport default loadStateHOC(\n connect(\n mapStateToProps,\n {\n ...userManagementDispatches,\n ...mapDispatchToProps,\n ...accountsDispatchToProps,\n },\n )(withRouter(ShortApplyProduct)),\n storage.name,\n);\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport { Redirect, Route, Switch } from 'react-router-dom';\nimport { PrivateRoute, NoMatch } from '@myie/interact-dom';\nimport ShortApplyIndex from './ShortApplyIndex';\nimport ShortApplyProduct from './ShortApplyProduct';\nimport { mapStateToProps, mapDispatchToProps } from '@myie/interact-accounts';\nimport { Alert } from 'reactstrap';\nimport PropTypes from 'prop-types';\n\nclass ShortApply extends React.Component {\n render() {\n const { error } = this.props;\n let re = new RegExp('^/short-apply[/]{0,1}$');\n if (this.props.location.pathname.match(re)) {\n return ;\n }\n return (\n \n {error ?
{error} : ''}\n
\n \n \n \n \n
\n );\n }\n}\n\nShortApply.propTypes = {\n error: PropTypes.any,\n location: PropTypes.any,\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(ShortApply);\n","import React from 'react';\nimport Savings from './Savings';\nimport { NoticeToWithdrawals } from './NoticeToWithdrawal/Routes';\nimport MakeWithdrawalRoute from './MakeWithdrawal/Routes';\nimport { Route } from 'react-router-dom';\nimport ShortApply from './shortApply/ShortApply';\n\nconst Routes = [\n ,\n ,\n ,\n ,\n];\n\nexport default Routes;\n","import React, { Component, Fragment } from 'react';\nimport { mapDispatchToProps } from '@myie/interact-ccb-savings-servicing';\nimport { connect } from 'react-redux';\nimport PropTypes from 'prop-types';\nimport { Content, LinkTag } from '@myie/interact-dom';\nimport { Utility } from '@myie/interact';\nimport { Card, CardHeader, CardBody, CardFooter, Row, Col } from 'reactstrap';\nimport { Link } from 'react-router-dom';\nimport orderBy from 'lodash/orderBy';\nclass ApplyAccountSummaryComponent extends Component {\n constructor(props) {\n super(props);\n this.state = {};\n }\n\n getProducts = products => {\n let list = [];\n if (products && products.length > 0) {\n const sortedProductsList = this.sortProducts(products);\n sortedProductsList.forEach((product, index) => {\n if (\n product.Display_For_Short_Apply === 'Y' &&\n product.Product_Status === 'A'\n )\n list.push(\n \n \n \n \n \n {index + 1}:{' '}\n \n {product.Product_Name}\n \n \n \n \n \n \n \n \n \n {product?.To_apply_you_must_list.map((item, index) => {\n if (item) {\n return {item} ;\n }\n })}\n \n \n \n \n \n \n \n {product?.Key_facts_list.map((item, index) => {\n if (item) {\n return {item} ;\n }\n })}\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ,\n );\n });\n }\n\n return list;\n };\n\n sortProducts(list = []) {\n let sortedList = orderBy(list, 'Sort_order', 'asc');\n return sortedList;\n }\n\n render() {\n const { DepositProducts = [] } = this.props;\n\n return {this.getProducts(DepositProducts)} ;\n }\n}\n\nApplyAccountSummaryComponent.propTypes = {\n match: PropTypes.any,\n DepositProducts: PropTypes.any,\n page: PropTypes.string,\n};\n\nconst mapStateToProps = state => {\n const { customccbSavingsServicingDefinition } = state;\n return {\n ...customccbSavingsServicingDefinition,\n };\n};\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(ApplyAccountSummaryComponent);\n","import React from 'react';\nimport { Link } from 'react-router-dom';\nimport { Content } from '@myie/interact-dom';\n\nclass SummaryMenuItems extends React.Component {\n constructor(props) {\n super(props);\n this.state = { removeClass: false };\n }\n\n hideMenu = () => {\n this.setState({ removeClass: !this.state?.removeClass });\n };\n render() {\n return (\n \n \n \n );\n }\n}\n\nexport default SummaryMenuItems;\n","import SummaryMenuItems from './SummaryMenuItems';\nimport { URLS } from '@myie/interact-local-dom';\n\nconst SavingsServicingMenuItems = [\n {\n url: URLS.ShortApply,\n menuItem: SummaryMenuItems,\n },\n];\n\nexport default SavingsServicingMenuItems;\n","import React from 'react';\nimport { HelpContactSidebar } from '@myie/interact-dom';\nimport { CONTACTS } from '@myie/interact-local-dom';\n\nclass ShortApplySidebar extends React.Component {\n render() {\n return (\n \n );\n }\n}\n\nexport default ShortApplySidebar;\n","import Routes from './Routes';\nimport Savings from './Savings';\nimport ApplyAccountSummaryComponent from './shared/ApplyAccountSummaryComponent';\nimport SavingsServicingMenuItems from './MenuItems';\nimport SavingsServicingSidebars from './Sidebars';\n\nexport {\n Savings,\n Routes,\n ApplyAccountSummaryComponent,\n SavingsServicingMenuItems,\n SavingsServicingSidebars,\n};\n","import React from 'react';\nimport { Row, Col } from 'reactstrap';\nimport PropTypes from 'prop-types';\nimport { Content } from '@myie/interact-dom';\n\nclass AboutYou extends React.Component {\n render() {\n const { userDetails } = this.props;\n\n let yourTitle = '';\n let firstName = '';\n let middleNames = '';\n let lastName = '';\n let emailAddress = '';\n //let homeNumber = '';\n let workNumber = '';\n let mobileNumber = '';\n\n if (userDetails) {\n yourTitle = userDetails.Title;\n firstName = userDetails.FirstName;\n middleNames = userDetails.MiddleName;\n lastName = userDetails.Surname;\n emailAddress = userDetails.EmailAddress;\n //homeNumber = userDetails.HomeNumber;\n workNumber = userDetails.WorkNumber;\n mobileNumber = userDetails.MobileNumber;\n }\n\n return (\n \n
\n \n \n \n \n \n \n \n {yourTitle}\n \n \n \n \n \n {firstName}\n \n \n \n \n \n {middleNames}\n \n \n \n \n \n {lastName}\n \n \n \n \n \n {emailAddress}\n \n \n \n \n \n {workNumber}\n \n \n \n \n \n {mobileNumber}\n \n
\n \n );\n }\n}\n\nAboutYou.propTypes = {\n userDetails: PropTypes.object,\n};\n\nexport default AboutYou;\n","import React from 'react';\nimport { Row, Col } from 'reactstrap';\nimport PropTypes from 'prop-types';\nimport { Content } from '@myie/interact-dom';\n\nclass YourAddress extends React.Component {\n render() {\n const { userDetails } = this.props;\n\n let houseNameFlatNumber = '';\n let houseNumber = '';\n let addressLine1 = '';\n let addressLine2 = '';\n let townCity = '';\n let county = '';\n let postcode = '';\n\n if (userDetails && userDetails.CorrespondenceAddress) {\n houseNameFlatNumber = userDetails.CorrespondenceAddress.BuildingName;\n houseNumber = userDetails.CorrespondenceAddress.BuildingNumber;\n addressLine1 = userDetails.CorrespondenceAddress.Street;\n addressLine2 = userDetails.CorrespondenceAddress.AddressLine2;\n townCity = userDetails.CorrespondenceAddress.PostTown;\n county = userDetails.CorrespondenceAddress.County;\n postcode = userDetails.CorrespondenceAddress.PostCode;\n }\n\n return (\n \n
\n \n \n \n \n \n \n \n {houseNameFlatNumber} {houseNumber} {addressLine1}\n \n \n \n \n \n {addressLine2}\n \n \n \n \n \n {townCity}\n \n \n \n \n \n {county}\n \n \n \n \n \n {postcode}\n \n
\n \n );\n }\n}\n\nYourAddress.propTypes = {\n userDetails: PropTypes.object,\n};\n\nexport default YourAddress;\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport PropTypes from 'prop-types';\nimport { Link } from 'react-router-dom';\n\nimport {\n mapStateToProps,\n mapDispatchToProps,\n} from '@myie/interact-user-management';\n\nimport AboutYou from './AboutYou';\nimport YourAddress from './YourAddress';\n//import CorrespondenceAddress from './CorrespondenceAddress';\n//import ContactPreferences from './ContactPreferences';\nimport { Content } from '@myie/interact-dom';\n\nclass View extends React.Component {\n constructor(props) {\n super(props);\n const { resetUserDetails, resetContactOptions } = this.props;\n resetUserDetails();\n resetContactOptions();\n }\n\n componentDidMount() {\n const {\n fetchUserDetailsIfNeeded,\n fetchContactOptionsIfNeeded,\n } = this.props;\n let request = {\n ExtendedProperties: {},\n };\n fetchUserDetailsIfNeeded(request);\n fetchContactOptionsIfNeeded(request);\n }\n\n render() {\n const { userDetails /* contactOptions */ } = this.props;\n\n return (\n \n
\n \n \n
\n \n
\n {
}\n {
}\n {/*\n {
}\n
\n */}\n\n
\n {/* \n \n {' '} */}\n \n \n \n
\n
\n );\n }\n}\n\nView.propTypes = {\n contactOptions: PropTypes.object,\n fetchContactOptionsIfNeeded: PropTypes.func,\n fetchUserDetailsIfNeeded: PropTypes.func,\n resetContactOptions: PropTypes.any,\n resetUserDetails: PropTypes.any,\n userDetails: PropTypes.object,\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(View);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Row, Col } from 'reactstrap';\n\nimport { Text, Content, Markdown } from '@myie/interact-dom';\n\nclass AboutYou extends React.Component {\n constructor(props) {\n super(props);\n const { setForm } = this.props;\n this.state = {\n message: null,\n submitForm: {},\n userDetails: null,\n yourTitle: null,\n firstName: null,\n middleNames: null,\n lastName: null,\n aboutYouForm: {\n EmailAddress: {\n rules: {\n title: 'EmailAddress',\n stop: true,\n required: {\n message: 'Please enter a email.',\n },\n email: {\n message: 'Please enter a valid email.',\n },\n },\n },\n ConfirmEmailAddress: {\n rules: {\n title: 'ConfirmEmailAddress',\n stop: true,\n required: {\n message: 'Please enter a email.',\n },\n email: {\n message: 'Please enter a valid email.',\n },\n compare: {\n message: \"Email address doesn't match\",\n field: 'EmailAddress',\n comparison: () => {\n return this.state.aboutYouForm.EmailAddress.value;\n },\n },\n },\n },\n HomeNumber: {\n rules: {\n title: 'HomeNumber',\n stop: true,\n required: {\n message: 'Please enter a home number.',\n },\n phone: {\n message: 'Please enter a valid home number.',\n },\n },\n },\n WorkNumber: {\n rules: {\n title: 'WorkNumber',\n stop: true,\n required: {\n message: 'Please enter a work number.',\n },\n phone: {\n message: 'Please enter a valid work number.',\n },\n },\n },\n MobileNumber: {\n rules: {\n title: 'MobileNumber',\n stop: true,\n required: {\n message: 'Please enter a mobile number.',\n },\n phone: {\n message: 'Please enter a valid mobile number.',\n },\n },\n },\n },\n };\n setForm('aboutYouForm', this.state.aboutYouForm);\n }\n\n static getDerivedStateFromProps(nextProps, prevState) {\n const { aboutYouForm, userDetails } = nextProps;\n\n if (aboutYouForm && aboutYouForm !== prevState.aboutYouForm) {\n return {\n ...prevState,\n aboutYouForm,\n };\n }\n\n //Set userDetails\n\n if (aboutYouForm && userDetails !== prevState.userDetails) {\n aboutYouForm.EmailAddress.value = userDetails.EmailAddress;\n aboutYouForm.ConfirmEmailAddress.value = userDetails.EmailAddress;\n aboutYouForm.HomeNumber.value = userDetails.HomeNumber;\n aboutYouForm.WorkNumber.value = userDetails.WorkNumber;\n aboutYouForm.MobileNumber.value = userDetails.MobileNumber;\n return {\n ...prevState,\n yourTitle: userDetails.Title,\n firstName: userDetails.FirstName,\n middleNames: userDetails.MiddleName,\n lastName: userDetails.Surname,\n aboutYouForm,\n userDetails,\n };\n } else {\n return null;\n }\n }\n\n //Override OnEvent if needed\n onChange = e => {\n const { onEvent } = this.props;\n onEvent('aboutYouForm', e);\n };\n\n //Override OnEvent if needed\n onBlur = e => {\n const { onEvent } = this.props;\n onEvent('aboutYouForm', e);\n };\n\n render() {\n let {\n aboutYouForm,\n yourTitle,\n firstName,\n middleNames,\n lastName,\n } = this.state;\n\n return (\n \n \n \n \n \n \n \n \n \n \n {yourTitle}\n \n\n \n \n \n \n {firstName}\n \n\n \n \n \n \n {middleNames}\n \n\n \n \n \n \n {lastName}\n \n
\n \n \n \n \n \n \n \n \n
\n \n );\n }\n}\n\nAboutYou.propTypes = {\n onEvent: PropTypes.any,\n saveData: PropTypes.any,\n setForm: PropTypes.any,\n userDetails: PropTypes.any,\n aboutYouForm: PropTypes.any,\n};\n\nexport default AboutYou;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Row, Col } from 'reactstrap';\nimport { Text, Content } from '@myie/interact-dom';\n\nclass YourAddress extends React.Component {\n constructor(props) {\n super(props);\n const { setForm } = this.props;\n this.state = {\n userDetails: null,\n message: null,\n submitForm: {},\n yourAddressForm: {\n BuildingName: {\n rules: {\n title: 'BuildingName',\n stop: true,\n buildingNameNumberValidate: {\n message: 'Please enter a house name or flat number.',\n field: 'BuildingNumber',\n comparison: () => {\n return this.state.yourAddressForm.BuildingNumber.value;\n },\n },\n },\n },\n BuildingNumber: {\n rules: {\n title: 'BuildingNumber',\n stop: true,\n buildingNameNumberValidate: {\n message: 'Please enter a house number.',\n field: 'BuildingName',\n comparison: () => {\n return this.state.yourAddressForm.BuildingName.value;\n },\n },\n },\n },\n AddressLine1: {\n rules: {\n title: 'AddressLine1',\n stop: true,\n required: {\n message: 'Please enter address line 1.',\n },\n },\n },\n AddressLine2: {\n rules: {\n title: 'AddressLine2',\n stop: true,\n },\n },\n PostTown: {\n rules: {\n title: 'townCity',\n stop: true,\n required: {\n message: 'Please enter town/city.',\n },\n },\n },\n County: {\n rules: {\n title: 'country',\n stop: true,\n required: {\n message: 'Please enter country.',\n },\n country: {\n message: 'Please enter a valid country name.',\n },\n },\n },\n PostCode: {\n rules: {\n title: 'postCode',\n stop: true,\n required: {\n message: 'Please enter postcode.',\n },\n postcode: {\n message:\n 'Please enter your postcode in a valid UK postcode format.',\n },\n },\n },\n },\n };\n setForm('yourAddressForm', this.state.yourAddressForm);\n }\n\n static getDerivedStateFromProps(nextProps, prevState) {\n const { yourAddressForm, userDetails } = nextProps;\n\n if (yourAddressForm && yourAddressForm !== prevState.yourAddressForm) {\n return {\n ...prevState,\n yourAddressForm,\n };\n }\n\n //Set userDetails\n if (\n yourAddressForm &&\n userDetails !== prevState.userDetails &&\n userDetails.Address\n ) {\n yourAddressForm.BuildingName.value = userDetails.Address.BuildingName;\n yourAddressForm.BuildingNumber.value = userDetails.Address.BuildingNumber;\n yourAddressForm.AddressLine1.value = userDetails.Address.AddressLine1;\n yourAddressForm.AddressLine2.value = userDetails.Address.AddressLine2;\n yourAddressForm.PostTown.value = userDetails.Address.PostTown;\n yourAddressForm.County.value = userDetails.Address.County;\n yourAddressForm.PostCode.value = userDetails.Address.PostCode;\n return {\n ...prevState,\n yourAddressForm,\n userDetails,\n };\n } else {\n return null;\n }\n }\n\n onChange = e => {\n const { onEvent } = this.props;\n onEvent('yourAddressForm', e);\n };\n\n onChangeNameNumber = e => {\n const { addressOnEvent } = this.props;\n addressOnEvent('yourAddressForm', e);\n };\n\n onBlur = e => {\n const { onEvent } = this.props;\n onEvent('yourAddressForm', e);\n };\n\n submit = e => {\n e.preventDefault();\n };\n\n render() {\n let { yourAddressForm } = this.state;\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n
\n \n );\n }\n}\n\nYourAddress.propTypes = {\n addressOnEvent: PropTypes.any,\n onEvent: PropTypes.any,\n saveData: PropTypes.any,\n saveDataAddress: PropTypes.any,\n setForm: PropTypes.any,\n setFormValidations: PropTypes.any,\n userDetails: PropTypes.any,\n yourAddressForm: PropTypes.any,\n};\n\nexport default YourAddress;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Row, Col } from 'reactstrap';\nimport { Text, Content, Markdown } from '@myie/interact-dom';\n\nclass CorrespondenceAddress extends React.Component {\n constructor(props) {\n super(props);\n const { setForm } = this.props;\n this.state = {\n message: null,\n submitForm: {},\n correspondenceAddressForm: {\n BuildingName: {\n rules: {\n title: 'BuildingName',\n stop: true,\n buildingNameNumberValidate: {\n message: 'Please enter a house name or flat number.',\n field: 'BuildingNumber',\n comparison: () => {\n return this.state.correspondenceAddressForm.BuildingNumber\n .value;\n },\n },\n },\n },\n BuildingNumber: {\n rules: {\n title: 'BuildingNumber',\n stop: true,\n buildingNameNumberValidate: {\n message: 'Please enter a house number.',\n field: 'BuildingName',\n comparison: () => {\n return this.state.correspondenceAddressForm.BuildingName.value;\n },\n },\n },\n },\n AddressLine1: {\n rules: {\n title: 'AddressLine1',\n stop: true,\n required: {\n message: 'Please enter address line 1.',\n },\n },\n },\n AddressLine2: {\n rules: {\n title: 'AddressLine2',\n stop: true,\n },\n },\n PostTown: {\n rules: {\n title: 'townCity',\n stop: true,\n required: {\n message: 'Please enter town/city.',\n },\n },\n },\n County: {\n rules: {\n title: 'County',\n stop: true,\n required: {\n message: 'Please enter County.',\n },\n country: {\n message: 'Please enter a valid County name.',\n },\n },\n },\n PostCode: {\n rules: {\n title: 'postCode',\n stop: true,\n required: {\n message: 'Please enter postcode.',\n },\n postcode: {\n message:\n 'Please enter your postcode in a valid UK postcode format.',\n },\n },\n },\n },\n };\n setForm('correspondenceAddressForm', this.state.correspondenceAddressForm);\n }\n\n static getDerivedStateFromProps(nextProps, prevState) {\n const { correspondenceAddressForm, userDetails } = nextProps;\n\n if (\n correspondenceAddressForm &&\n correspondenceAddressForm !== prevState.correspondenceAddressForm\n ) {\n return {\n ...prevState,\n correspondenceAddressForm,\n };\n }\n\n //Set userDetails\n if (\n correspondenceAddressForm &&\n userDetails !== prevState.userDetails &&\n userDetails.Address\n ) {\n correspondenceAddressForm.BuildingName.value =\n userDetails.Address.BuildingName;\n correspondenceAddressForm.BuildingNumber.value =\n userDetails.Address.BuildingNumber;\n correspondenceAddressForm.AddressLine1.value =\n userDetails.Address.AddressLine1;\n correspondenceAddressForm.AddressLine2.value =\n userDetails.Address.AddressLine2;\n correspondenceAddressForm.PostTown.value = userDetails.Address.PostTown;\n correspondenceAddressForm.County.value = userDetails.Address.County;\n correspondenceAddressForm.PostCode.value = userDetails.Address.PostCode;\n return {\n ...prevState,\n correspondenceAddressForm,\n userDetails,\n };\n } else {\n return null;\n }\n }\n\n onChange = e => {\n const { onEvent } = this.props;\n onEvent('correspondenceAddressForm', e);\n };\n\n onChangeNameNumber = e => {\n const { addressOnEvent } = this.props;\n addressOnEvent('correspondenceAddressForm', e);\n };\n\n onBlur = e => {\n const { onEvent } = this.props;\n onEvent('correspondenceAddressForm', e);\n };\n\n submit = e => {\n e.preventDefault();\n };\n\n render() {\n let { correspondenceAddressForm } = this.state;\n return (\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n
\n \n );\n }\n}\n\nCorrespondenceAddress.propTypes = {\n addressOnEvent: PropTypes.any,\n correspondenceAddressForm: PropTypes.any,\n onEvent: PropTypes.any,\n saveDataAddressC: PropTypes.any,\n setForm: PropTypes.any,\n userDetails: PropTypes.any,\n};\n\nexport default CorrespondenceAddress;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Check, Content } from '@myie/interact-dom';\nimport { Validate } from '@myie/interact';\n\nclass ContactPreferences extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n message: null,\n contactOptions: null,\n submitForm: {},\n form: {},\n };\n }\n\n static getDerivedStateFromProps(nextProps, prevState) {\n return {\n ...prevState,\n contactOptions: nextProps.contactOptions\n ? nextProps.contactOptions.Options\n : null,\n };\n }\n\n onChange = e => {\n const { name, value } = e.target;\n let { form } = this.state;\n if (Object.hasOwnProperty.call(form, name)) {\n form = Validate.input(name, value, form);\n }\n this.setState({\n ...this.state,\n form,\n });\n };\n\n componentDidMount() {\n this.setState({ contactOptions: null });\n }\n\n onChangeContactOptions = e => {\n const { name, value } = e.target;\n const { contactOptions } = this.state;\n const { saveDataContactOptions } = this.props;\n let newContactOptions = contactOptions;\n newContactOptions.forEach(Option => {\n if (Option.Type === name) {\n Option.Value = !Option.Value;\n }\n });\n saveDataContactOptions(name, value);\n this.setState({ contactOptions: newContactOptions });\n };\n\n onBlur = e => {\n const { name, value } = e.target;\n let { form } = this.state;\n if (Object.hasOwnProperty.call(form, name) && e.target.value) {\n form = Validate.input(name, value, form, true);\n }\n this.setState({\n ...this.state,\n form,\n });\n };\n\n submit = e => {\n e.preventDefault();\n };\n\n getContactOptionLabels = contactOptions => {\n const label = [\n {\n Type: 'Email',\n name: 'Email',\n },\n {\n Type: 'Mobile',\n name: 'Mobile',\n },\n {\n Type: 'TextMessage',\n name: 'Text Messages (SMS)',\n },\n {\n Type: 'Post',\n name: 'Post',\n },\n {\n Type: 'OffersFromTheBank',\n name: 'Bank related offers',\n },\n {\n Type: 'OffersFromSelectedPartners',\n name: 'Third party offers',\n },\n ];\n\n let contactListOption = [];\n let otherOptions = [];\n contactOptions.forEach(item => {\n let lebelItem = label.find(label => label.Type === item.Type);\n item.name = lebelItem.name;\n if (\n item.Type === 'OffersFromTheBank' ||\n item.Type === 'OffersFromSelectedPartners'\n ) {\n otherOptions.push(item);\n } else {\n contactListOption.push(item);\n }\n });\n\n return {\n contactListOption: contactListOption,\n otherOptions: otherOptions,\n };\n };\n\n render() {\n const { contactOptions } = this.state;\n if (!contactOptions) {\n return null;\n }\n const newOptions = this.getContactOptionLabels(contactOptions);\n return (\n <>\n \n \n \n\n \n \n \n \n {newOptions.otherOptions.map(item => {\n return (\n \n \n
\n );\n })}\n \n \n \n {newOptions.contactListOption.map(item => {\n return (\n \n \n
\n );\n })}\n \n \n
\n \n >\n );\n }\n}\n\nContactPreferences.propTypes = {\n contactOptions: PropTypes.any,\n saveDataContactOptions: PropTypes.any,\n};\n\nexport default ContactPreferences;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Alert } from 'reactstrap';\nimport { Link } from 'react-router-dom';\nimport { Content, Switch } from '@myie/interact-dom';\n\nclass Confirmation extends React.Component {\n renderDoneButton = () => {\n return (\n \n \n \n );\n };\n\n render() {\n const { updateUserDetailSuccess } = this.props;\n let title = null;\n let id;\n if (updateUserDetailSuccess) {\n switch (updateUserDetailSuccess.ResponseStatus) {\n case 'Success':\n id = 'update-personal-detail-success';\n title = (\n \n );\n break;\n case 'Failed':\n id = 'update-personal-detail-failure';\n title = (\n \n );\n break;\n default:\n id = 'update-personal-detail-unknown';\n title = (\n \n );\n }\n }\n return (\n \n
\n
{title} \n \n {updateUserDetailSuccess ? (\n
\n \"\n value={updateUserDetailSuccess.ResponseStatus}\n defaultText=\"An unknown error occured please check your accounts before retrying.\"\n contents={{\n Success: {\n defaultValue: 'You have updated your personal details',\n },\n Failed: {\n defaultValue:\n 'An error occured while trying to process your request',\n },\n }}\n />\n \n ) : null}\n {this.renderDoneButton()}\n
\n );\n }\n}\n\nConfirmation.propTypes = {\n resetContactOptions: PropTypes.any,\n resetUserDetails: PropTypes.any,\n setStage: PropTypes.any,\n updateUserDetailSuccess: PropTypes.any,\n};\n\nexport default Confirmation;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { Alert, Form, Button } from 'reactstrap';\nimport { Link } from 'react-router-dom';\nimport { Validate } from '@myie/interact';\nimport {\n mapStateToProps,\n mapDispatchToProps,\n} from '@myie/interact-user-management';\nimport AboutYou from './AboutYou';\nimport YourAddress from './YourAddress';\nimport CorrespondenceAddress from './CorrespondenceAddress';\nimport ContactPreferences from './ContactPreferences';\nimport Confirmation from './Confirmation';\nimport approve from 'approvejs';\nimport { Content } from '@myie/interact-dom';\n\nconst buildingNameNumberValidate = {\n expects: ['comparison', 'field'],\n message: 'Please enter a date greater than payment start date',\n validate: function(value, pars) {\n const { comparison } = pars;\n\n if (typeof comparison === 'function') {\n if (value.length > 0) {\n return true;\n } else {\n return comparison().length > 0;\n }\n }\n\n if (value.length > 0) {\n return true;\n } else {\n return comparison().length > 0;\n }\n },\n};\n\napprove.addTest(buildingNameNumberValidate, 'buildingNameNumberValidate');\n\nclass Edit extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n userDetails: null,\n contactOptions: null,\n message: null,\n stage: 'Edit',\n aboutYouForm: null, // Form is defined by child component\n yourAddressForm: null, // Form is defined by child component\n correspondenceAddressForm: null, // Form is defined by child component\n };\n }\n\n static getDerivedStateFromProps(nextProps, prevState) {\n const { userDetails, contactOptions, updateUserDetailSuccess } = nextProps;\n\n if (updateUserDetailSuccess && updateUserDetailSuccess.ResponseStatus) {\n return {\n ...prevState,\n stage: 'Success',\n };\n }\n\n if (userDetails && contactOptions) {\n return {\n ...prevState,\n userDetails,\n contactOptions,\n };\n } else {\n return null;\n }\n }\n\n componentDidMount() {\n const {\n fetchUserDetailsIfNeeded,\n fetchContactOptionsIfNeeded,\n } = this.props;\n let request = {\n ExtendedProperties: {},\n };\n fetchUserDetailsIfNeeded(request);\n fetchContactOptionsIfNeeded(request);\n }\n\n setForm = (form, data) => {\n this.setState({ [form]: data });\n };\n\n onEvent = (form, e) => {\n const { name, value } = e.target;\n let childForm = this.state[form];\n childForm = Validate.input(name, value, childForm, true);\n this.setState({\n ...this.state,\n [form]: childForm,\n });\n };\n\n addressOnEvent = (form, e) => {\n const { name, value } = e.target;\n let childForm = this.state[form];\n childForm = Validate.input(name, value, childForm, true);\n if (name === 'BuildingNumber') {\n childForm = Validate.input(\n 'BuildingName',\n childForm.BuildingName.value,\n childForm,\n true,\n );\n }\n if (name === 'BuildingName') {\n childForm = Validate.input(\n 'BuildingNumber',\n childForm.BuildingNumber.value,\n childForm,\n true,\n );\n }\n\n this.setState({\n ...this.state,\n [form]: childForm,\n });\n };\n\n saveDataContactOptions = (name, value) => {\n const { contactOptions } = this.state;\n contactOptions[name] = value;\n this.setState({ ...this.state, contactOptions, message: null });\n };\n\n submitData = () => {\n let {\n userDetails,\n aboutYouForm,\n yourAddressForm,\n correspondenceAddressForm,\n contactOptions,\n } = this.state;\n const { updateUserDetails } = this.props;\n let userDetailsRequest = {\n Title: userDetails.Title,\n MiddleName: userDetails.MiddleName,\n Surname: userDetails.Surname,\n EmailAddress: aboutYouForm.EmailAddress.value,\n PrimaryContactNumber: userDetails.PrimaryContactNumber,\n Postcode: userDetails.Postcode,\n LastUpdated: userDetails.Surname,\n HomeNumber: userDetails.HomeNumber,\n WorkNumber: userDetails.WorkNumber,\n MobileNumber: userDetails.MobileNumber,\n Address: {\n Organisation: 'userDetails.Address.Organisation',\n PoBox: 'userDetails.Address.PoBox',\n SuiteNumber: 'userDetails.Address.SuiteNumber',\n FlatNumber: 'userDetails.Address.FlatNumber',\n BuildingNumber: yourAddressForm.BuildingNumber.value,\n BuildingName: yourAddressForm.BuildingName.value,\n AddressLine1: yourAddressForm.AddressLine1.value,\n AddressLine2: yourAddressForm.AddressLine2.value,\n Street: 'userDetails.Address.Street',\n VillageOrDistrict: 'userDetails.Address.VillageOrDistrict',\n TownOrCity: 'userDetails.Address.TownOrCity',\n PostTown: yourAddressForm.PostTown.value,\n Country: yourAddressForm.County.Country,\n PostCode: yourAddressForm.County.PostCode,\n CheckedPostCode: 'userDetails.Address.CheckedPostCode',\n HomeStatus: 'userDetails.Address.HomeStatus',\n },\n CorrespondenceAddress: {\n Organisation: 'userDetails.Address.Organisation',\n PoBox: 'userDetails.Address.PoBox',\n SuiteNumber: 'userDetails.Address.SuiteNumber',\n FlatNumber: 'userDetails.Address.FlatNumber',\n BuildingNumber: correspondenceAddressForm.BuildingNumber.value,\n BuildingName: correspondenceAddressForm.BuildingName.value,\n AddressLine1: correspondenceAddressForm.AddressLine1.value,\n AddressLine2: correspondenceAddressForm.AddressLine2.value,\n Street: 'userDetails.Address.Street',\n VillageOrDistrict: 'userDetails.Address.VillageOrDistrict',\n TownOrCity: 'userDetails.Address.TownOrCity',\n PostTown: correspondenceAddressForm.PostTown.value,\n Country: correspondenceAddressForm.County.Country,\n PostCode: correspondenceAddressForm.County.PostCode,\n CheckedPostCode: 'userDetails.Address.CheckedPostCode',\n HomeStatus: 'userDetails.Address.HomeStatus',\n },\n ExtendedProperties: {},\n };\n let contactOptionsRequest = {\n Options: contactOptions.Options,\n ExtendedProperties: {},\n };\n updateUserDetails(userDetailsRequest, contactOptionsRequest);\n };\n\n submit = e => {\n e.preventDefault();\n let {\n aboutYouForm,\n yourAddressForm,\n correspondenceAddressForm,\n } = this.state;\n aboutYouForm = Validate.form(aboutYouForm);\n yourAddressForm = Validate.form(yourAddressForm);\n correspondenceAddressForm = Validate.form(correspondenceAddressForm);\n this.setState({\n ...this.state,\n aboutYouForm,\n yourAddressForm,\n correspondenceAddressForm,\n });\n if (\n !aboutYouForm.approved ||\n !yourAddressForm.approved ||\n !correspondenceAddressForm.approved\n ) {\n return;\n }\n this.submitData();\n };\n\n render() {\n let {\n message,\n userDetails,\n contactOptions,\n aboutYouForm,\n yourAddressForm,\n correspondenceAddressForm,\n } = this.state;\n const { updateUserDetailSuccess } = this.props;\n const { stage } = this.state;\n let alert;\n if (!userDetails) {\n return null;\n }\n if (message) {\n alert = (\n \n {message}\n \n );\n } else {\n alert = '';\n }\n if (stage === 'Success') {\n return ;\n } else {\n return (\n \n
\n \n \n {alert ? alert : ''}\n
\n \n \n \n
\n
\n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n );\n }\n }\n}\n\nEdit.propTypes = {\n contactOptions: PropTypes.any,\n fetchContactOptionsIfNeeded: PropTypes.any,\n fetchUserDetailsIfNeeded: PropTypes.any,\n history: PropTypes.any,\n resetContactOptions: PropTypes.any,\n resetUserDetails: PropTypes.any,\n setContactOptions: PropTypes.any,\n setUserDetails: PropTypes.any,\n updateUserDetails: PropTypes.any,\n userDetails: PropTypes.any,\n updateUserDetailSuccess: PropTypes.any,\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(Edit);\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { Switch, Redirect } from 'react-router-dom';\nimport { PrivateRoute } from '@myie/interact-dom';\nimport View from './View';\nimport Edit from './Edit';\n\nclass PersonalDetails extends Component {\n render() {\n if (\n this.props.location.pathname.match(\n new RegExp('^/personal-details[/]{0,1}$'),\n )\n ) {\n return ;\n }\n\n return (\n \n );\n }\n}\n\nPersonalDetails.propTypes = {\n location: PropTypes.object,\n};\n\nexport default PersonalDetails;\n","import React from 'react';\nimport { Route } from 'react-router-dom';\nimport PersonalDetails from './PersonalDetails';\n//import ManageStatementsIndex from './ManageStatements';\n\nconst Routes = [\n ,\n];\n\nexport default Routes;\n","import PersonalDetailsServiceItems from './PersonalDetails/PersonalDetailsServiceItems';\n\nconst UserManagementServiceItems = [\n {\n name: 'PersonalDetailsServiceItems',\n serviceItem: PersonalDetailsServiceItems,\n },\n];\n\nexport default UserManagementServiceItems;\n","import React from 'react';\nimport { Link } from 'react-router-dom';\nimport { Media } from 'reactstrap';\nimport { Markdown, Icon } from '@myie/interact-dom';\n\nclass PersonalDetailsServiceItems extends React.Component {\n render() {\n return (\n \n \n \n \n \n \n \n \n \n \n );\n }\n}\n\nexport default PersonalDetailsServiceItems;\n","import PersonalDetails from './PersonalDetails';\nimport Routes from './Routes';\nimport UserManagementServiceItems from './ServiceItems';\n\nexport { PersonalDetails, Routes, UserManagementServiceItems };\n","/* eslint-disable no-mixed-spaces-and-tabs, prettier/prettier */\n\nimport { AuthenticationServiceItems } from '@myie/interact-authentication-dom'\nimport { UserManagementServiceItems } from '@myie/interact-user-management-dom'\n\n\nconst RegisteredServiceItems = []\n\nAuthenticationServiceItems.forEach(sb => {\n\tRegisteredServiceItems.push(sb)\n}); \n\nUserManagementServiceItems.forEach(sb => {\n\tRegisteredServiceItems.push(sb)\n}); \n\n\n\nexport default RegisteredServiceItems\n","import React from 'react';\nimport { CardColumns, Card } from 'reactstrap';\nimport PropTypes from 'prop-types';\nimport { Content, AppMeta } from '@myie/interact-dom';\nimport RegisteredServiceItems from './RegisteredServiceItems';\n\nclass ServicesIndex extends React.Component {\n render() {\n return (\n \n
\n
\n \n \n
\n {RegisteredServiceItems.map(sb => (\n \n { }\n \n ))}\n \n
\n );\n }\n}\n\nServicesIndex.propTypes = {\n accounts: PropTypes.any,\n fetchAccountsIfNeeded: PropTypes.any,\n};\n\nexport default ServicesIndex;\n","import React from 'react';\nimport { Redirect, Route, Switch } from 'react-router-dom';\nimport { PrivateRoute, NoMatch } from '@myie/interact-dom';\nimport ServicesIndex from './ServicesIndex';\nimport { Alert } from 'reactstrap';\nimport PropTypes from 'prop-types';\n\nclass Services extends React.Component {\n render() {\n const { error } = this.props;\n var re = new RegExp('^/services[/]{0,1}$');\n if (this.props.location.pathname.match(re)) {\n return ;\n }\n return (\n \n {error ? (\n
\n {error}\n \n ) : (\n ''\n )}\n
\n \n \n \n
\n );\n }\n}\n\nServices.propTypes = {\n error: PropTypes.any,\n location: PropTypes.any,\n};\n\nexport default Services;\n","import React from 'react';\nimport Services from './Services';\nimport { Route } from 'react-router-dom';\n\nconst Routes = [\n ,\n];\n\nexport default Routes;\n","import SummaryMenuItems from './SummaryMenuItems';\n\nconst MoveMoneyMenuItems = [\n {\n url: '/services',\n menuItem: SummaryMenuItems,\n },\n];\n\nexport default MoveMoneyMenuItems;\n","import React from 'react';\nimport { Link } from 'react-router-dom';\nimport { Content } from '@myie/interact-dom';\n\nclass SummaryMenuItems extends React.Component {\n render() {\n return (\n \n \n \n );\n }\n}\n\nexport default SummaryMenuItems;\n","import Services from './Services';\nimport Routes from './Routes';\nimport ServicesMenuItems from './MenuItems';\n\nexport { Services, Routes, ServicesMenuItems };\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport PropTypes from 'prop-types';\nimport { mapDispatchToProps as mapDispatchToPropsAccounts } from '@myie/interact-accounts';\n\nimport { Markdown, FormattedCurrency } from '@myie/interact-dom';\nimport { Utility } from '@myie/interact';\nimport { Link } from 'react-router-dom';\nimport { withRouter } from 'react-router-dom';\n\nclass SelectAccounts extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n stage: 'Details',\n message: null,\n data: {},\n };\n }\n\n static getDerivedStateFromProps = nextProps => {\n const { accounts = {}, fetchAccountsIfNeeded, isFetching } = nextProps;\n\n if (!accounts && !isFetching) {\n fetchAccountsIfNeeded();\n }\n\n return null;\n };\n\n generateAccountInfo(account) {\n switch (account.ProductType) {\n case 'Loan':\n return (\n <>\n {account.AccountNumber} {account.SortCode}\n >\n );\n case 'Savings':\n return (\n <>\n {account.AccountNumber} {account.SortCode}\n >\n );\n case 'Current':\n case 'LoyaltyCard':\n case 'MotorLoan':\n return <>{account.AccountNumber}>;\n\n case 'CreditCard':\n return (\n \n );\n default:\n return null;\n }\n }\n\n render() {\n const { accounts, location = { pathname: '' } } = this.props;\n var currentAccount = null;\n\n if (accounts && accounts.Accounts) {\n currentAccount = accounts.Accounts.find(function(element) {\n if (element) {\n return (\n Utility.hexEncode(element.AccountKey.Key) ===\n location.pathname.split('/').pop()\n );\n }\n return false;\n });\n }\n return (\n \n {accounts && accounts.Accounts && accounts.Accounts.length > 0\n ? accounts.Accounts.map((account, index) => {\n // status === 1 means only show closed accounts\n if (\n account.AccountStatus !== 'Closed' &&\n this.props.status === 1\n ) {\n return null;\n }\n // Ccb have asked not to see closed accounts in sidebar\n if (\n account.AccountStatus === 'Closed' /*&& !this.props.status*/\n ) {\n return null;\n }\n\n return (\n \n \n {account.AccountName}\n \n \n \n \n \n {this.generateAccountInfo(account)}\n \n \n );\n })\n : ''}\n
\n );\n }\n}\n\nSelectAccounts.propTypes = {\n accounts: PropTypes.any,\n error: PropTypes.any,\n fetchAccountsIfNeeded: PropTypes.any,\n i18n: PropTypes.any,\n isFetching: PropTypes.any,\n location: PropTypes.any,\n status: PropTypes.any,\n};\n\nconst mapStateToProps = state => {\n const { accountsDefinition } = state;\n return {\n ...accountsDefinition,\n };\n};\n\nexport default withRouter(\n connect(\n mapStateToProps,\n { ...mapDispatchToPropsAccounts },\n )(SelectAccounts),\n);\n","import React from 'react';\nimport SelectAccounts from './SelectAccounts';\n\nclass SelectAccountsTest extends React.Component {\n render() {\n return (\n <>\n Test Widget: \n \n >\n );\n }\n}\n\nexport default SelectAccountsTest;\n","import React from 'react';\nimport SelectAccountsTest from './SelectAccountsTest';\nimport { PrivateRoute } from '@myie/interact-dom';\n\nconst Routes = [\n ,\n];\n\nexport default Routes;\n","import SelectAccounts from './SelectAccounts';\nimport Routes from './Routes';\n\nexport { SelectAccounts, Routes };\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Alert } from 'reactstrap';\n\nclass CustomAlert extends React.Component {\n onDismiss = () => {\n const { closeAlert, index } = this.props;\n closeAlert(index);\n };\n\n render() {\n const { message, index, alertVisibleArray } = this.props;\n return (\n <>\n \n {message}\n \n \n {message}\n
\n >\n );\n }\n}\n\nCustomAlert.propTypes = {\n alertVisibleArray: PropTypes.any,\n closeAlert: PropTypes.any,\n index: PropTypes.any,\n message: PropTypes.any,\n};\n\nexport default CustomAlert;\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport PropTypes from 'prop-types';\nimport CustomAlert from './CustomAlert';\nimport { mapDispatchToProps as mapDispatchToPropsAccounts } from '@myie/interact-messaging-system';\n\nclass SystemMessage extends React.Component {\n constructor(props) {\n super(props);\n const {\n fetchSystemMessagesIfNeeded,\n alertVisibleArray,\n messageArray,\n } = this.props;\n const request = { ExtendedProperties: {} };\n fetchSystemMessagesIfNeeded(request);\n this.state = {\n alertVisibleArray:\n alertVisibleArray && alertVisibleArray.length ? alertVisibleArray : [],\n messages: messageArray && messageArray.length ? messageArray : [],\n };\n }\n\n static getDerivedStateFromProps(nextProps, prevState) {\n const { systemMessages, saveSytemMessageArray } = nextProps;\n let { alertVisibleArray, messages } = prevState;\n if (systemMessages && !alertVisibleArray.length && !messages.length) {\n return systemMessages.SystemMessages.map((message, index) => {\n alertVisibleArray[index] = true;\n messages[index] = message.Body;\n saveSytemMessageArray(alertVisibleArray, messages);\n return {\n ...prevState,\n ...alertVisibleArray,\n ...messages,\n };\n });\n } else {\n return null;\n }\n }\n\n closeAlert = index => {\n let { alertVisibleArray, messages } = this.state;\n let { saveSytemMessageArray } = this.props;\n alertVisibleArray[index] = false;\n saveSytemMessageArray(alertVisibleArray, messages);\n this.setState({ ...this.state, alertVisibleArray: alertVisibleArray });\n };\n\n renderAlerts = (alertVisibleArray, messages) => {\n return messages.map((message, index) => {\n return (\n \n );\n });\n };\n\n render() {\n const { alertVisibleArray, messages } = this.state;\n if (alertVisibleArray.length && messages.length) {\n return this.renderAlerts(alertVisibleArray, messages);\n } else {\n return null;\n }\n }\n}\n\nSystemMessage.propTypes = {\n alertVisibleArray: PropTypes.any,\n fetchSystemMessagesIfNeeded: PropTypes.any,\n messageArray: PropTypes.any,\n saveSytemMessageArray: PropTypes.any,\n systemMessages: PropTypes.any,\n};\n\nconst mapStateToProps = state => {\n const { messagingSystemDefinition } = state;\n return {\n ...messagingSystemDefinition,\n };\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToPropsAccounts,\n)(SystemMessage);\n","import SystemMessage from './SystemMessage';\n\nexport { SystemMessage };\n","/* eslint-disable no-mixed-spaces-and-tabs, prettier/prettier */module.exports = [{\"name\":\"AddressLookup.js\",\"description\":\"AddressLookup component\",\"props\":{\"callback\":{\"type\":{\"name\":\"func\"},\"required\":false,\"description\":\"Callback function\"},\"children\":{\"type\":{\"name\":\"element\"},\"required\":true,\"description\":\"Children of the component\"},\"description\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Description text\"},\"groupClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Group style class name\"},\"id\":{\"type\":{\"name\":\"number\"},\"required\":true,\"description\":\"The address ID\"},\"label\":{\"type\":{\"name\":\"string\"},\"required\":true,\"description\":\"The address label\"},\"labelClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Label style class name\"},\"subLabel\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"The address sub label\"}},\"code\":\"import React from 'react';\\r\\nimport PropTypes from 'prop-types';\\r\\nimport {\\r\\n Card,\\r\\n Input,\\r\\n Label,\\r\\n InputGroupAddon,\\r\\n InputGroupText,\\r\\n InputGroup,\\r\\n ListGroup,\\r\\n ListGroupItem,\\r\\n Alert,\\r\\n} from 'reactstrap';\\r\\nimport i18n from 'i18next';\\r\\nimport { Form as FormUpdater, Connection } from '@myie/interact';\\r\\n\\r\\n/**\\r\\n * AddressLookup component\\r\\n */\\r\\nclass AddressLookup extends React.Component {\\r\\n constructor(props) {\\r\\n super(props);\\r\\n this.state = {\\r\\n error: {},\\r\\n response: {},\\r\\n form: {\\r\\n address: {\\r\\n rules: {\\r\\n required: true,\\r\\n },\\r\\n },\\r\\n },\\r\\n };\\r\\n }\\r\\n\\r\\n selectAddress = (e, address, callback) => {\\r\\n if (typeof callback === 'function') {\\r\\n callback(address);\\r\\n }\\r\\n this.setState({ ...this.state, error: {}, response: {} });\\r\\n };\\r\\n\\r\\n processAddresses = (json, callback) => {\\r\\n if (json.ResponseStatus === 'Success') {\\r\\n this.setState({ ...this.state, response: json, error: null });\\r\\n if (json.Addresses.length === 1 && typeof callback === 'function') {\\r\\n callback(json.Addresses[0]);\\r\\n }\\r\\n } else {\\r\\n this.setState({ ...this.state, error: {}, response: json });\\r\\n }\\r\\n };\\r\\n\\r\\n onChange = e => {\\r\\n const form = FormUpdater.update(this.state.form, e.target);\\r\\n this.setState({ ...this.state, form });\\r\\n };\\r\\n\\r\\n onClick = (e, callback) => {\\r\\n const { value = '' } = this.state.form.address;\\r\\n\\r\\n const request = {\\r\\n Postcode: value,\\r\\n HouseNumber: '',\\r\\n };\\r\\n return fetch(Connection.baseUrl() + `/addresslookup/v1.0/addresses/find`, {\\r\\n method: 'post',\\r\\n headers: Connection.headers(),\\r\\n body: JSON.stringify(request),\\r\\n })\\r\\n .then(response => Connection.errored(response))\\r\\n .then(response => response.json())\\r\\n .then(json => this.processAddresses(json, callback))\\r\\n .catch(error => this.setState({ ...this.state, error, response: {} }));\\r\\n };\\r\\n\\r\\n render() {\\r\\n const {\\r\\n children,\\r\\n labelClassName = '',\\r\\n groupClassName = '',\\r\\n id,\\r\\n label,\\r\\n subLabel = '',\\r\\n description = '',\\r\\n callback,\\r\\n ...rest\\r\\n } = this.props;\\r\\n const { value = '' } = this.state.form.address;\\r\\n const { response = {}, error = {} } = this.state;\\r\\n const addressComponents = [];\\r\\n if (Array.isArray(response.Addresses)) {\\r\\n response.Addresses.forEach(address => {\\r\\n addressComponents.push(\\r\\n this.selectAddress(e, address, callback)}\\r\\n >\\r\\n {address.BuildingName} {address.BuildingNumber}{' '}\\r\\n {address.AddressLine1} {address.Postcode}\\r\\n ,\\r\\n );\\r\\n });\\r\\n }\\r\\n return (\\r\\n \\r\\n
\\r\\n {label} {subLabel.length > 0 ? {subLabel} : ''}\\r\\n {description.length > 0 ? (\\r\\n {description} \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n this.onClick(e, callback)}\\r\\n />\\r\\n \\r\\n \\r\\n \\r\\n {children}\\r\\n\\r\\n {error && error.message ? (\\r\\n
\\r\\n {error.message}\\r\\n \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n {response.ResponseStatus === 'InvalidPostcodeFormat' ? (\\r\\n
\\r\\n {i18n.t('common:AddressLookup.invalidPostcodeFormat', {\\r\\n defaultValue: `You have entered an invalide postcode format.`,\\r\\n })}\\r\\n \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n {response.ResponseStatus === 'NotFound' ? (\\r\\n
\\r\\n {i18n.t('common:AddressLookup.notFound', {\\r\\n defaultValue: `No Address has been found for entered Postcode.`,\\r\\n })}\\r\\n \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n {response.ResponseStatus === 'Failed' ? (\\r\\n
\\r\\n {i18n.t('common:AddressLookup.failed', {\\r\\n defaultValue: `Postcode lookup is currently unavailable.`,\\r\\n })}\\r\\n \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n {addressComponents.length === 1 ? (\\r\\n
\\r\\n {i18n.t('common:AddressLookup.singleAddress', {\\r\\n defaultValue: `A single Address has been found.`,\\r\\n })}\\r\\n \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n {addressComponents.length > 1 ? (\\r\\n
\\r\\n
\\r\\n {i18n.t('common:AddressLookup.multipleAddresses', {\\r\\n defaultValue: `Multiple Addresses have been found please select your address.`,\\r\\n })}\\r\\n \\r\\n
\\r\\n {addressComponents} \\r\\n \\r\\n
\\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nAddressLookup.propTypes = {\\r\\n /**\\r\\n * Callback function\\r\\n */\\r\\n callback: PropTypes.func,\\r\\n /**\\r\\n * Children of the component\\r\\n */\\r\\n children: PropTypes.element.isRequired,\\r\\n /**\\r\\n * Description text\\r\\n */\\r\\n description: PropTypes.string,\\r\\n /**\\r\\n * Group style class name\\r\\n */\\r\\n groupClassName: PropTypes.string,\\r\\n /**\\r\\n * The address ID\\r\\n */\\r\\n id: PropTypes.number.isRequired,\\r\\n /**\\r\\n * The address label\\r\\n */\\r\\n label: PropTypes.string.isRequired,\\r\\n /**\\r\\n * Label style class name\\r\\n */\\r\\n labelClassName: PropTypes.string,\\r\\n /**\\r\\n * The address sub label\\r\\n */\\r\\n subLabel: PropTypes.string,\\r\\n};\\r\\n\\r\\nexport default AddressLookup;\\r\\n\",\"examples\":[]},{\"name\":\"AuthButton.js\",\"description\":\"AuthButton component\",\"props\":{\"history\":{\"type\":{\"name\":\"object\"},\"required\":false,\"description\":\"Used for routing\"},\"url\":{\"type\":{\"name\":\"string\"},\"required\":true,\"description\":\"Used for redirecting\"},\"userLogout\":{\"type\":{\"name\":\"func\"},\"required\":true,\"description\":\"Used to logout current session\"}},\"code\":\"import React from 'react';\\r\\nimport PropTypes from 'prop-types';\\r\\nimport { connect } from 'react-redux';\\r\\nimport { Button } from 'reactstrap';\\r\\nimport { withRouter } from 'react-router-dom';\\r\\nimport { mapDispatchToProps } from '@myie/interact-shared';\\r\\nimport { FormattedDate, Value } from '@myie/interact-dom';\\r\\nimport { Trans } from 'react-i18next';\\r\\nimport i18n from 'i18next';\\r\\nimport { Session } from '@myie/interact';\\r\\n\\r\\n/**\\r\\n * AuthButton component\\r\\n */\\r\\nclass AuthIndicator extends React.Component {\\r\\n render() {\\r\\n const { history, userLogout, url } = this.props;\\r\\n const customer = Session.customer();\\r\\n return Session.isAuthenticated() ? (\\r\\n \\r\\n \\r\\n Hi . You last logged in{' '}\\r\\n \\r\\n \\r\\n {\\r\\n clearInterval(window.sessionStorage.getItem('timeoutID'));\\r\\n Session.abandon();\\r\\n userLogout();\\r\\n history.push(url);\\r\\n }}\\r\\n >\\r\\n {i18n.t('common:welcome.signOut', {\\r\\n defaultValue: 'Sign out',\\r\\n })}\\r\\n \\r\\n
\\r\\n ) : (\\r\\n ''\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nAuthIndicator.propTypes = {\\r\\n /**\\r\\n * Used for routing\\r\\n */\\r\\n history: PropTypes.object,\\r\\n /**\\r\\n * Used for redirecting\\r\\n */\\r\\n url: PropTypes.string.isRequired,\\r\\n /**\\r\\n * Used to logout current session\\r\\n */\\r\\n userLogout: PropTypes.func.isRequired,\\r\\n};\\r\\n\\r\\nconst AuthButton = withRouter(\\r\\n connect(\\r\\n null,\\r\\n mapDispatchToProps,\\r\\n )(AuthIndicator),\\r\\n);\\r\\n\\r\\nexport default AuthButton;\\r\\n\",\"examples\":[]},{\"name\":\"Check.js\",\"description\":\"Check box component\",\"props\":{\"checked\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"if check box is ticked\"},\"children\":{\"type\":{\"name\":\"union\",\"value\":[{\"name\":\"element\"},{\"name\":\"array\"}]},\"required\":false,\"description\":\"Any children of the component\"},\"className\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"\"},\"description\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"checkbox description\"},\"disabled\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"is checkbox disabled?\"},\"field\":{\"type\":{\"name\":\"any\"},\"required\":false,\"description\":\"input field\"},\"groupClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"\"},\"id\":{\"type\":{\"name\":\"any\"},\"required\":false,\"description\":\"checkbox id?\"},\"label\":{\"type\":{\"name\":\"any\"},\"required\":false,\"description\":\"\"},\"labelClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"\"},\"required\":{\"type\":{\"name\":\"any\"},\"required\":false,\"description\":\"should show errors\"},\"showErrors\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"Should show errors?\"},\"subLabel\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"\"},\"suffix\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"\"},\"validation\":{\"type\":{\"name\":\"object\"},\"required\":false,\"description\":\"Validation\"}},\"code\":\"import React from 'react';\\r\\nimport PropTypes from 'prop-types';\\r\\nimport { Input, Label } from 'reactstrap';\\r\\nimport Errors, { HasErrors } from './Errors';\\r\\nimport { Validate } from '@myie/interact';\\r\\n\\r\\n/**\\r\\n * Check box component\\r\\n */\\r\\nclass Check extends React.Component {\\r\\n render() {\\r\\n const { props } = this;\\r\\n\\r\\n const {\\r\\n showErrors = true,\\r\\n validation = {},\\r\\n children,\\r\\n id,\\r\\n disabled,\\r\\n required,\\r\\n checked,\\r\\n field,\\r\\n className = '',\\r\\n labelClassName = '',\\r\\n groupClassName = '',\\r\\n label,\\r\\n subLabel = '',\\r\\n description = '',\\r\\n suffix = '',\\r\\n ...rest\\r\\n } = props;\\r\\n const { value = '', state = {} } = validation;\\r\\n var fieldName =\\r\\n typeof field === 'string' ? field : `${field[0]}[${field[1]}]`;\\r\\n return (\\r\\n \\r\\n
\\r\\n
\\r\\n {label} {subLabel.length > 0 ? {subLabel} : ''}\\r\\n {description.length > 0 ? (\\r\\n {description} \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n \\r\\n {children}\\r\\n {suffix.length > 0 ?
{suffix}
: ''}\\r\\n {showErrors ?
: ''}\\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nCheck.propTypes = {\\r\\n /**\\r\\n * if check box is ticked\\r\\n */\\r\\n checked: PropTypes.bool,\\r\\n /**\\r\\n * Any children of the component\\r\\n */\\r\\n children: PropTypes.oneOfType([PropTypes.element, PropTypes.array]),\\r\\n className: PropTypes.string,\\r\\n /**\\r\\n * checkbox description\\r\\n */\\r\\n description: PropTypes.string,\\r\\n /**\\r\\n * is checkbox disabled?\\r\\n */\\r\\n disabled: PropTypes.bool,\\r\\n /**\\r\\n * input field\\r\\n */\\r\\n field: PropTypes.any,\\r\\n groupClassName: PropTypes.string,\\r\\n /**\\r\\n * checkbox id?\\r\\n */\\r\\n id: PropTypes.any,\\r\\n label: PropTypes.any,\\r\\n labelClassName: PropTypes.string,\\r\\n /**\\r\\n * should show errors\\r\\n */\\r\\n required: PropTypes.any,\\r\\n /**\\r\\n * Should show errors?\\r\\n */\\r\\n showErrors: PropTypes.bool,\\r\\n subLabel: PropTypes.string,\\r\\n suffix: PropTypes.string,\\r\\n /**\\r\\n * Validation\\r\\n */\\r\\n validation: PropTypes.object,\\r\\n};\\r\\n\\r\\nexport default Check;\\r\\n\",\"examples\":[{\"name\":\"CheckExample\",\"description\":\"Check example\",\"code\":\"import React from 'react';\\r\\nimport { Check } from '@myie/interact-dom';\\r\\nimport { Row, Col, FormGroup } from 'reactstrap';\\r\\n\\r\\n/** Check example */\\r\\nclass CheckExample extends React.Component {\\r\\n constructor(props) {\\r\\n super(props);\\r\\n this.state = {\\r\\n value: false,\\r\\n };\\r\\n }\\r\\n\\r\\n onChange = () => {\\r\\n const { value } = this.state;\\r\\n this.setState({ value: !value });\\r\\n };\\r\\n\\r\\n render() {\\r\\n return (\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nexport default CheckExample;\\r\\n\"}]},{\"name\":\"Currency.js\",\"description\":\"Currency component\\r\\nwill display an input field\\r\\nwith decimal places according to the currency,\\r\\nif no currency is given, no decimal places will be added\",\"props\":{\"children\":{\"type\":{\"name\":\"element\"},\"required\":false,\"description\":\"Any children of the component\"},\"code\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Currency code\"},\"description\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Currency description\"},\"disabled\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"Input disabled or not\"},\"dp\":{\"type\":{\"name\":\"number\"},\"required\":false,\"description\":\"decimal places\"},\"maxDigits\":{\"type\":{\"name\":\"number\"},\"required\":false,\"description\":\"Maximum number of digits\"},\"field\":{\"type\":{\"name\":\"union\",\"value\":[{\"name\":\"string\"},{\"name\":\"array\"}]},\"required\":true,\"description\":\"Input field names\"},\"groupClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Style class name for group\"},\"id\":{\"type\":{\"name\":\"string\"},\"required\":true,\"description\":\"Currency ID\"},\"inputGroupClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Style class name for input group\"},\"label\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Label text\"},\"labelClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Style class name for label\"},\"onBlur\":{\"type\":{\"name\":\"func\"},\"required\":true,\"description\":\"onBlur function\"},\"onChange\":{\"type\":{\"name\":\"func\"},\"required\":true,\"description\":\"onChange function\"},\"required\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"Input required or not\"},\"showErrors\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"Show errors or not\"},\"subLabel\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Sub label text\"},\"suffix\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Suffix text\"},\"validation\":{\"type\":{\"name\":\"object\"},\"required\":false,\"description\":\"Input validation\"}},\"code\":\"import React from 'react';\\r\\nimport PropTypes from 'prop-types';\\r\\nimport {\\r\\n Input,\\r\\n Label,\\r\\n InputGroup,\\r\\n InputGroupAddon,\\r\\n InputGroupText,\\r\\n} from 'reactstrap';\\r\\nimport Errors, { HasErrors } from './Errors';\\r\\nimport { Validate } from '@myie/interact';\\r\\nimport currency from 'react-currency-formatter';\\r\\nimport symbols from './symbols';\\r\\n\\r\\n/**\\r\\n * Currency component\\r\\n * will display an input field\\r\\n * with decimal places according to the currency,\\r\\n * if no currency is given, no decimal places will be added\\r\\n */\\r\\nclass Currency extends React.Component {\\r\\n render() {\\r\\n const { props } = this;\\r\\n\\r\\n const {\\r\\n dp: dpProp = null,\\r\\n code,\\r\\n children,\\r\\n validation = {},\\r\\n inputGroupClassName = '',\\r\\n labelClassName = '',\\r\\n groupClassName = '',\\r\\n showErrors = true,\\r\\n id,\\r\\n field,\\r\\n label,\\r\\n subLabel = '',\\r\\n description = '',\\r\\n disabled,\\r\\n required,\\r\\n suffix = '',\\r\\n onChange,\\r\\n onBlur,\\r\\n maxDigits = 10, //Currency Default restricted to 10 digits, make this - false to remove the restriction\\r\\n ...rest\\r\\n } = props;\\r\\n const { value = '', state = {} } = validation;\\r\\n\\r\\n // added this cludge to find position of symbol and decimal places (when not specified) as I didn't want to duplicate the react-currency-formatter code\\r\\n // there may be a better way to do this in the future\\r\\n let position = null;\\r\\n let dp = dpProp;\\r\\n if (code) {\\r\\n position = currency({\\r\\n quantity: 0,\\r\\n currency: code,\\r\\n symbol: '!',\\r\\n decimal: '.',\\r\\n });\\r\\n if (!dp) {\\r\\n //If dp not specified, use decimal places related to the currency\\r\\n let tempExtract =\\r\\n position.replace(' ', '').length - position.indexOf('.') - 1;\\r\\n dp = position.endsWith('!') ? tempExtract - 1 : tempExtract;\\r\\n }\\r\\n }\\r\\n const dpPat = !dp || dp === 0 ? '' : `([.]{1}[0-9]{0,${dp}})?`;\\r\\n const digitPat = !maxDigits ? '*' : `{0,${maxDigits}}`;\\r\\n const pattern = `^[0-9]${digitPat}${dpPat}$`;\\r\\n const inputOverride = (e, dp, func) => {\\r\\n const { target = {} } = e;\\r\\n const { value = '' } = target;\\r\\n if (\\r\\n dp > 0 &&\\r\\n value.indexOf('.') !== -1 &&\\r\\n value.length - value.indexOf('.') > dp + 1\\r\\n ) {\\r\\n return;\\r\\n }\\r\\n const found = value.match(new RegExp(pattern));\\r\\n if (value && !found) {\\r\\n return;\\r\\n }\\r\\n\\r\\n if (value && target.validity && !target.validity.valid) {\\r\\n return;\\r\\n }\\r\\n if (!value || !isNaN(parseFloat(value))) {\\r\\n if (func) {\\r\\n func(e);\\r\\n }\\r\\n }\\r\\n };\\r\\n\\r\\n var fieldName =\\r\\n typeof field === 'string' ? field : `${field[0]}[${field[1]}]`;\\r\\n const symbol = symbols[code] || code;\\r\\n return (\\r\\n \\r\\n {label || subLabel || description ? (\\r\\n
\\r\\n {label} {subLabel.length > 0 ? {subLabel} : ''}\\r\\n {description.length > 0 ? (\\r\\n {description} \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n
\\r\\n {position && position.startsWith('!') ? (\\r\\n \\r\\n {symbol} \\r\\n \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n inputOverride(event, dp, onBlur)}\\r\\n onChange={event => inputOverride(event, dp, onChange)}\\r\\n invalid={Validate.isInvalid(state)}\\r\\n valid={Validate.isValid(state)}\\r\\n id={id}\\r\\n name={fieldName}\\r\\n value={value}\\r\\n type=\\\"text\\\"\\r\\n inputMode={dp === 0 ? 'numeric' : 'decimal'}\\r\\n pattern={pattern}\\r\\n required={required}\\r\\n disabled={disabled}\\r\\n {...rest}\\r\\n />\\r\\n {position && position.endsWith('!') ? (\\r\\n \\r\\n {symbol} \\r\\n \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n \\r\\n {suffix.length > 0 ?
{suffix}
: ''}\\r\\n {children}\\r\\n {showErrors ?
: ''}\\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nCurrency.propTypes = {\\r\\n /**\\r\\n * Any children of the component\\r\\n */\\r\\n children: PropTypes.element,\\r\\n /**\\r\\n * Currency code\\r\\n */\\r\\n code: PropTypes.string,\\r\\n /**\\r\\n * Currency description\\r\\n */\\r\\n description: PropTypes.string,\\r\\n /**\\r\\n * Input disabled or not\\r\\n */\\r\\n disabled: PropTypes.bool,\\r\\n /**\\r\\n * decimal places\\r\\n */\\r\\n dp: PropTypes.number,\\r\\n /**\\r\\n * Maximum number of digits\\r\\n */\\r\\n maxDigits: PropTypes.number,\\r\\n /**\\r\\n * Input field names\\r\\n */\\r\\n field: PropTypes.oneOfType([PropTypes.string, PropTypes.array]).isRequired,\\r\\n /**\\r\\n * Style class name for group\\r\\n */\\r\\n groupClassName: PropTypes.string,\\r\\n /**\\r\\n * Currency ID\\r\\n */\\r\\n id: PropTypes.string.isRequired,\\r\\n /**\\r\\n * Style class name for input group\\r\\n */\\r\\n inputGroupClassName: PropTypes.string,\\r\\n /**\\r\\n * Label text\\r\\n */\\r\\n label: PropTypes.string,\\r\\n /**\\r\\n * Style class name for label\\r\\n */\\r\\n labelClassName: PropTypes.string,\\r\\n /**\\r\\n * onBlur function\\r\\n */\\r\\n onBlur: PropTypes.func.isRequired,\\r\\n /**\\r\\n * onChange function\\r\\n */\\r\\n onChange: PropTypes.func.isRequired,\\r\\n /**\\r\\n * Input required or not\\r\\n */\\r\\n required: PropTypes.bool,\\r\\n /**\\r\\n * Show errors or not\\r\\n */\\r\\n showErrors: PropTypes.bool,\\r\\n /**\\r\\n * Sub label text\\r\\n */\\r\\n subLabel: PropTypes.string,\\r\\n /**\\r\\n * Suffix text\\r\\n */\\r\\n suffix: PropTypes.string,\\r\\n /**\\r\\n * Input validation\\r\\n */\\r\\n validation: PropTypes.object,\\r\\n};\\r\\n\\r\\nexport default Currency;\\r\\n\",\"examples\":[{\"name\":\"CurrencyExampleGBP\",\"description\":\"Currency GBP example\",\"code\":\"import React from 'react';\\r\\nimport { Currency } from '@myie/interact-dom';\\r\\nimport { Row, Col, FormGroup } from 'reactstrap';\\r\\n\\r\\n/** Currency GBP example */\\r\\nclass CurrencyExampleGBP extends React.Component {\\r\\n constructor(props) {\\r\\n super(props);\\r\\n this.state = {\\r\\n form: {\\r\\n amount: {\\r\\n value: 1500,\\r\\n },\\r\\n },\\r\\n };\\r\\n }\\r\\n\\r\\n onChange = e => {\\r\\n const { form } = this.state;\\r\\n const value = e.target.value;\\r\\n form.amount.value = value;\\r\\n this.setState({ form });\\r\\n };\\r\\n\\r\\n render() {\\r\\n const currencyCode = 'GBP';\\r\\n const { form } = this.state;\\r\\n return (\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nexport default CurrencyExampleGBP;\\r\\n\"},{\"name\":\"CurrencyExampleLKR\",\"description\":\"Currency LKR example\",\"code\":\"import React from 'react';\\r\\nimport { Currency } from '@myie/interact-dom';\\r\\nimport { Row, Col, FormGroup } from 'reactstrap';\\r\\n\\r\\n/** Currency LKR example */\\r\\nclass CurrencyExampleLKR extends React.Component {\\r\\n constructor(props) {\\r\\n super(props);\\r\\n this.state = {\\r\\n form: {\\r\\n amount: {\\r\\n value: 1500,\\r\\n },\\r\\n },\\r\\n };\\r\\n }\\r\\n\\r\\n onChange = e => {\\r\\n const { form } = this.state;\\r\\n const value = e.target.value;\\r\\n form.amount.value = value;\\r\\n this.setState({ form });\\r\\n };\\r\\n\\r\\n render() {\\r\\n const currencyCode = 'LKR';\\r\\n const { form } = this.state;\\r\\n return (\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nexport default CurrencyExampleLKR;\\r\\n\"}]},{\"name\":\"Date.js\",\"description\":\"Date component (calendar date picker)\\r\\nwill display an input field with the calendar icon\",\"props\":{\"children\":{\"type\":{\"name\":\"element\"},\"required\":false,\"description\":\"Any children of the component\"},\"className\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Style class name for InputGroup\"},\"description\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Date description text\"},\"disabled\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"Input disabled or not\"},\"field\":{\"type\":{\"name\":\"union\",\"value\":[{\"name\":\"string\"},{\"name\":\"array\"}]},\"required\":true,\"description\":\"Input field names\"},\"groupClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Style class name for group\"},\"id\":{\"type\":{\"name\":\"string\"},\"required\":true,\"description\":\"Date ID\"},\"label\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Label text\"},\"labelClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Style class name for label\"},\"onBlur\":{\"type\":{\"name\":\"func\"},\"required\":true,\"description\":\"onBlur function\"},\"onChange\":{\"type\":{\"name\":\"func\"},\"required\":true,\"description\":\"onChange function\"},\"required\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"Input required or not\"},\"showErrors\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"Show errors or not\"},\"subLabel\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Sub label text\"},\"suffix\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Suffix text\"},\"validation\":{\"type\":{\"name\":\"object\"},\"required\":false,\"description\":\"Input validation\"}},\"code\":\"import React from 'react';\\r\\nimport PropTypes from 'prop-types';\\r\\nimport {\\r\\n Input,\\r\\n Label,\\r\\n InputGroup,\\r\\n InputGroupAddon,\\r\\n InputGroupText,\\r\\n} from 'reactstrap';\\r\\nimport i18n from 'i18next';\\r\\nimport Errors, { HasErrors } from './Errors';\\r\\nimport { Validate } from '@myie/interact';\\r\\nimport Datetime from 'react-datetime';\\r\\n\\r\\n/**\\r\\n * Date component (calendar date picker)\\r\\n * will display an input field with the calendar icon\\r\\n */\\r\\nclass Date extends React.Component {\\r\\n render() {\\r\\n const {\\r\\n children,\\r\\n validation = {},\\r\\n className = '',\\r\\n labelClassName = '',\\r\\n groupClassName = '',\\r\\n showErrors = true,\\r\\n id,\\r\\n field,\\r\\n label,\\r\\n subLabel = '',\\r\\n description = '',\\r\\n suffix = '',\\r\\n disabled,\\r\\n required,\\r\\n onChange,\\r\\n onBlur,\\r\\n ...rest\\r\\n } = this.props;\\r\\n const { value = '', state = {} } = validation;\\r\\n let fieldName =\\r\\n typeof field === 'string' ? field : `${field[0]}[${field[1]}]`;\\r\\n\\r\\n const icon =\\r\\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA7CAAAOwgEVKEqAAAAAGHRFWHRTb2Z0d2FyZQBwYWludC5uZXQgNC4xLjb9TgnoAAAJqUlEQVR4Xu3U3Yqd1xEEUD+MLTFgIXyhR3SIDcEhL6ykLxo2K3VmTs/3Yw1sw/JFU1WfjrbxT9+/f//b/e+f+tf/MXeWn3/++V/pe8XsWfxOM3e3eLyLfxmP2Huvl5eX/6T9xO57ufuIvbvE4x38C3jLly9f/pl2nuXeM9yYcu8t9u8Qj1fzhz/LnWe5M+HWs9x5ljtXi8cr+YOn3HuGGxNfv379d9p8jRtT7l0pHq/kj109kymde4bd1Xtyb7GrZ3KduUM8XsUf2sw1c83ca+w2c8VMM/cau81cM9fMXSUer+KPbOZWZouZR+w1cyuzzdwj9oqZldlm7irxeBV/ZDEj8+WXX375I2Vlr5lbmW3mHrFXzMh8MXOVeLyKP7KYkflmLrFTzCR2ipnk8+fPf7yna76YuUo8XsUfWczIfDOX2ClmEjvFTFL/Z3pP13wxc5V4vIo/spiR+WYusVPMJHaKmWT/B/AGf2QxI/PNXGKnmEnsFDPJ/g/gDf7IYkbmm7nETjGT2ClmEjvNnMwXM1eJxyn/8BNuyfxR7id2jnJf5p/lznvE47P8A72HmzJ/lPuJnaPcl/kp9ybi8S3+AY5wW+aPcj+xc5T7Mv9e7j4jHl/jR49yX+aPcj+xc5T7Mn+E22+Jx0f82Bn8hswf5X5i5yj3Zf4o918Tj4kfOYvfkfmj3E/sHOW+zJ/BbzwSj3L8TH5L5o9yP7FzlPsyfxa/k8SjHD6T35L5o9xP7Bzlvsyfxe8k8bhy9Gx+T+aPcj+xc5T7Mn8mv6V4XDl4Nr8n80e5n9g5yn2ZP5PfUjy2T58+/Z5Gz+Q3Zf4o9xM7R7kv82f69ddff0/fbPHYHLuC35T5o9xP7Bzlvsyfze+t4rE5dAW/KfNHuZ/YOcp9mT+b31vFY3PoCn5T5s/gN2T+KPdl/mx+bxWPzaEr+E2ZP4PfWJk9g9+Q+bP5vVU8Noeu4nebubP4nZXZs/idZu4KfnMVj82hK939bb9XzJzt7u81v7uKx+bQ9jH5rqt4bA5tH5PvuorH5tD2Mfmuq3hsDm0fk++6isfm0PYx+a6reGwOJXa2e/keiZ1VPDaHEjvbvXyPxM4qHptDiZ3tXr5HYmcVj82hxM52L98jsbOKx+ZQYme7l++R2FnFY3MosbPdy/dI7KzisTmU2Nnu5Xskdlbx2BxK7Gz38j0SO6t4bA4ldrZ7+R6JnVU8NocSO9u9fI/Ezioem0OJne1evkdiZxWPzaHEznYv3yOxs4rH5lBiZ7uX75HYWcVjcyixs93L90jsrOKxOZTY2e7leyR2VvHYHErsyPzEy8vLX2dvFveauSn3ipkp92Q+sbOKx+ZQYkfmp9wrZqbca+am3CtmptyT+cTOKh6bQ4kdmZ9yr5iZcq+Zm3KvmJlyT+YTO6t4bA4ldmR+yr1iZsq9Zm7KvWJmyj2ZT+ys4rE5lNiR+Sn3ipkp95q5KfeKmSn3ZD6xs4rH5lBiR+an3Ctmptxr5qbcK2am3JP5xM4qHptDiR2Zn3KvmJlyr5mbcq+YmXJP5hM7q3hsDiV2ZH7KvWJmyr1mbsq9YmbKPZlP7KzisTmU2JH5KfeKmSn3mrkp94qZKfdkPrGzisfmUGJH5qfcK2am3GvmptwrZqbck/nEzioem0OJHZmfcq+YmXKvmZtyr5iZck/mEzureGwOJXZkfsq9YmbKvWZuyr1iZso9mU/srOKxOZTYkfkp94qZKfeauSn3ipkp92Q+sbOKx+ZQYkfmp9wrZqbca+am3CtmptyT+cTOKh6bQ4kdmZ9yr5iZcq+Zm3KvmJlyT+YTO6t4bA4ldrZ7+R6JnVU8NocSO9u9fI/Ezioem0OJne1evkdiZxWPzaHEznYv3yOxs4rH5lBiZ7uX75HYWcVjcyixI/NT7hUzU+41c1PuFTNT7sl8YmcVj82hxI7MT7lXzEy518xNuVfMTLkn84mdVTw2hxI7Mj/lXjEz5V4zN+VeMTPlnswndlbx2BxK7Mj8lHvFzJR7zdyUe8XMlHsyn9hZxWNzKLEj81PuFTNT7jVzU+4VM1PuyXxiZxWPzaHEjsxPuVfMTLnXzE25V8xMuSfziZ1VPDaHEjsyP+VeMTPlXjM35V4xM+WezCd2VvHYHErsyPyUe8XMlHvN3JR7xcyUezKf2FnFY3MosSPzU+4VM1PuNXNT7hUzU+7JfGJnFY/NocSOzE+5V8xMudfMTblXzEy5J/OJnVU8NocSOzI/5V4xM+VeMzflXjEz5Z7MJ3ZW8dgcSuzI/JR7xcyUe83clHvFzJR7Mp/YWcVjcyixI/NT7hUzU+41c1PuFTNT7sl8YmcVj82hxI7MT7lXzEy518xNuVfMTLkn84mdVTw2hxI72718j8TOKh6bQ4md7V6+R2JnFY/NocTOdi/fI7GzisfmUGJnu5fvkdhZxWNzKLGz3cv3SOys4rE5lNiR+Sn3ipkp95q5KfeKmSn3ZD6xs4rH5lBiR+an3Ctmptxr5qbcK2am3JP5xM4qHptDiR2Zn3KvmJlyr5mbcq+YmXJP5hM7q3hsDiV2ZH7KvWJmyr1mbsq9YmbKPZlP7KzisTmU2JH5KfeKmSn3mrkp94qZKfdkPrGzisfmUGJH5qfcK2am3GvmptwrZqbck/nEzioem0OJHZmfcq+YmXKvmZtyr5iZck/mEzureGwOJXZkfsq9YmbKvWZuyr1iZso9mU/srOKxOZTYkfkp94qZKfeauSn3ipkp92Q+sbOKx+ZQYkfmp9wrZqbca+am3CtmptyT+cTOKh6bQ4kdmZ9yr5iZcq+Zm3KvmJlyT+YTO6t4bA4ldmR+yr1iZsq9Zm7KvWJmyj2ZT+ys4rE5lNiR+Sn3ipkp95q5KfeKmSn3ZD6xs4rH5lBiR+an3Ctmptxr5qbcK2am3JP5xM4qHptDiZ3tXr5HYmcVj82hxM52L98jsbOKx+ZQYme7l++R2FnFY3MosbPdy/dI7KzisTmU2Nnu5Xskdlbx2BxK7Gz38j0SO6t4bA4ldrZ7+R6JnVU8NocSO9u9fI/Ezioem0OJne1evkdiZxWPzaHEznYv3yOxs4rH5lBiZ7uX75HYWcVjcyixs93L90jsrOKxOfSIve0evsMj9lbxuHLsEXvbtfz7f8Se4nHl4Gvsbtfw7/01dhWPKwe3j8X3VDzK0e1j8B2TeNRvv/32V/rA9uN6eXn5R3pLxWPiB7Yfm+/3SDw+4ke2H5Pv9pp4fI0f234svtdb4vEt3759+zN9fPv7+EbPisdn+YfY/h6+y0Q8vod/qO1a/v2/z/ef/gt7g1pNDFMnQAAAAABJRU5ErkJggg==';\\r\\n const renderInput = function(props, openCalendar) {\\r\\n return (\\r\\n \\r\\n \\r\\n \\r\\n );\\r\\n };\\r\\n\\r\\n const dateChange = e => {\\r\\n const val = typeof e !== 'string' ? e.format('DD/MM/YYYY') : e;\\r\\n onBlur({\\r\\n target: {\\r\\n name: fieldName,\\r\\n value: val,\\r\\n },\\r\\n });\\r\\n };\\r\\n\\r\\n return (\\r\\n \\r\\n {label || subLabel || description ? (\\r\\n
\\r\\n {label} {subLabel.length > 0 ? {subLabel} : ''}\\r\\n {description.length > 0 ? (\\r\\n {description} \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n {suffix.length > 0 ?
{suffix}
: ''}\\r\\n {children}\\r\\n {showErrors ?
: ''}\\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nDate.propTypes = {\\r\\n /**\\r\\n * Any children of the component\\r\\n */\\r\\n children: PropTypes.element,\\r\\n /**\\r\\n * Style class name for InputGroup\\r\\n */\\r\\n className: PropTypes.string,\\r\\n /**\\r\\n * Date description text\\r\\n */\\r\\n description: PropTypes.string,\\r\\n /**\\r\\n * Input disabled or not\\r\\n */\\r\\n disabled: PropTypes.bool,\\r\\n /**\\r\\n * Input field names\\r\\n */\\r\\n field: PropTypes.oneOfType([PropTypes.string, PropTypes.array]).isRequired,\\r\\n /**\\r\\n * Style class name for group\\r\\n */\\r\\n groupClassName: PropTypes.string,\\r\\n /**\\r\\n * Date ID\\r\\n */\\r\\n id: PropTypes.string.isRequired,\\r\\n /**\\r\\n * Label text\\r\\n */\\r\\n label: PropTypes.string,\\r\\n /**\\r\\n * Style class name for label\\r\\n */\\r\\n labelClassName: PropTypes.string,\\r\\n /**\\r\\n * onBlur function\\r\\n */\\r\\n onBlur: PropTypes.func.isRequired,\\r\\n /**\\r\\n * onChange function\\r\\n */\\r\\n onChange: PropTypes.func.isRequired,\\r\\n /**\\r\\n * Input required or not\\r\\n */\\r\\n required: PropTypes.bool,\\r\\n /**\\r\\n * Show errors or not\\r\\n */\\r\\n showErrors: PropTypes.bool,\\r\\n /**\\r\\n * Sub label text\\r\\n */\\r\\n subLabel: PropTypes.string,\\r\\n /**\\r\\n * Suffix text\\r\\n */\\r\\n suffix: PropTypes.string,\\r\\n /**\\r\\n * Input validation\\r\\n */\\r\\n validation: PropTypes.object,\\r\\n};\\r\\n\\r\\nexport default Date;\\r\\n\",\"examples\":[{\"name\":\"DateExample\",\"description\":\"Date example\",\"code\":\"import React from 'react';\\r\\nimport { Date } from '@myie/interact-dom';\\r\\nimport { FormGroup, Row, Col } from 'reactstrap';\\r\\n\\r\\n/** Date example */\\r\\nclass DateExample extends React.Component {\\r\\n constructor(props) {\\r\\n super(props);\\r\\n this.state = {\\r\\n value: '',\\r\\n };\\r\\n }\\r\\n\\r\\n onChangeDate = e => {\\r\\n const { value } = e.target;\\r\\n this.setState({ value });\\r\\n };\\r\\n\\r\\n render() {\\r\\n return (\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nexport default DateExample;\\r\\n\"}]},{\"name\":\"DatePicker.js\",\"description\":\"Datepicker component\\r\\nwill display Day Month Year dropdowns\",\"props\":{\"description\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Datepicker description text\"},\"disabled\":{\"type\":{\"name\":\"any\"},\"required\":false,\"description\":\"pickers disabled or not\"},\"field\":{\"type\":{\"name\":\"union\",\"value\":[{\"name\":\"string\"},{\"name\":\"array\"}]},\"required\":true,\"description\":\"Input field names\"},\"groupClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Style class name for group\"},\"id\":{\"type\":{\"name\":\"string\"},\"required\":true,\"description\":\"Datepicker ID\"},\"label\":{\"type\":{\"name\":\"string\"},\"required\":true,\"description\":\"Label text\"},\"labelClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Style class name for label\"},\"onBlur\":{\"type\":{\"name\":\"func\"},\"required\":true,\"description\":\"onBlur function\"},\"onChange\":{\"type\":{\"name\":\"func\"},\"required\":true,\"description\":\"onChange function\"},\"required\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"Input required or not\"},\"selectedDate\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Selected date value\"},\"showErrors\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"Show errors or not\"},\"showFutureDate\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"Will show future dates\"},\"subLabel\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Sub label text\"},\"suffix\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Suffix text\"},\"validation\":{\"type\":{\"name\":\"object\"},\"required\":false,\"description\":\"Input validation\"}},\"code\":\"import React from 'react';\\r\\nimport PropTypes from 'prop-types';\\r\\nimport i18n from 'i18next';\\r\\nimport { InputGroup, Input, Label } from 'reactstrap';\\r\\nimport { Validate } from '@myie/interact';\\r\\nimport moment from 'moment';\\r\\nimport Errors, { HasErrors } from './Errors';\\r\\n\\r\\n/**\\r\\n * Datepicker component\\r\\n * will display Day Month Year dropdowns\\r\\n */\\r\\nclass DatePicker extends React.Component {\\r\\n constructor(props) {\\r\\n super(props);\\r\\n this.state = {\\r\\n daysInMonth: 31,\\r\\n day: false,\\r\\n month: false,\\r\\n year: false,\\r\\n };\\r\\n }\\r\\n\\r\\n componentDidMount() {\\r\\n if (this.props.selectedDate) {\\r\\n let dateArr = this.props.selectedDate.split('-');\\r\\n this.setState({\\r\\n year: dateArr[0],\\r\\n month: dateArr[1],\\r\\n day: dateArr[2],\\r\\n });\\r\\n }\\r\\n }\\r\\n\\r\\n getDaysInMonth = (year, month) => {\\r\\n return moment(year + '-' + month, 'YYYY-MM').daysInMonth();\\r\\n };\\r\\n\\r\\n changeDate = (e, f) => {\\r\\n const { name, value } = e.target;\\r\\n const { field } = this.props;\\r\\n const data = { ...this.state };\\r\\n data[name] = value;\\r\\n if (data.year && data.month) {\\r\\n data.daysInMonth = this.getDaysInMonth(data.year, data.month);\\r\\n data.day = data.day > data.daysInMonth ? null : data.day;\\r\\n }\\r\\n const date = data.year + '-' + data.month + '-' + data.day;\\r\\n f({ target: { name: field, value: date } });\\r\\n this.setState({\\r\\n ...this.state,\\r\\n [name]: data[name],\\r\\n daysInMonth: data.daysInMonth,\\r\\n });\\r\\n };\\r\\n\\r\\n dateOnChange = e => {\\r\\n const { onChange } = this.props;\\r\\n this.renderMonths();\\r\\n this.renderDays();\\r\\n this.renderYears();\\r\\n this.changeDate(e, onChange);\\r\\n };\\r\\n\\r\\n dateOnBlur = e => {\\r\\n const { onBlur, onChange } = this.props;\\r\\n const data = { ...this.state };\\r\\n if (data.day && data.month && data.year) {\\r\\n this.changeDate(e, onBlur);\\r\\n } else {\\r\\n this.changeDate(e, onChange);\\r\\n }\\r\\n };\\r\\n\\r\\n renderDays = () => {\\r\\n let startFrom = moment().format('DD') - 0;\\r\\n let days = [];\\r\\n if (this.props.showFutureDate) {\\r\\n for (let i = startFrom; i <= this.state.daysInMonth; i++) {\\r\\n days.push(\\r\\n \\r\\n {i}\\r\\n ,\\r\\n );\\r\\n }\\r\\n } else {\\r\\n Array.from(Array(this.state.daysInMonth).keys()).map(counter => {\\r\\n let day = counter + 1;\\r\\n days.push(\\r\\n \\r\\n {day}\\r\\n ,\\r\\n );\\r\\n return true;\\r\\n });\\r\\n }\\r\\n return days;\\r\\n };\\r\\n\\r\\n renderMonths = () => {\\r\\n let startFrom = moment().format('MM') - 0;\\r\\n let year = moment().format('YYYY') - 0;\\r\\n let options = [];\\r\\n if (\\r\\n this.props.showFutureDate &&\\r\\n (!this.state.year || year === this.state.year - 0)\\r\\n ) {\\r\\n for (let i = startFrom; i <= moment.months().length - 0; i++) {\\r\\n options.push(\\r\\n \\r\\n {moment.months()[i - 1]}\\r\\n ,\\r\\n );\\r\\n }\\r\\n } else {\\r\\n moment.months().map(month => {\\r\\n options.push(\\r\\n \\r\\n {month}\\r\\n ,\\r\\n );\\r\\n return true;\\r\\n });\\r\\n }\\r\\n this.renderDays();\\r\\n return options;\\r\\n };\\r\\n\\r\\n renderYears = () => {\\r\\n let years = [];\\r\\n const thisYear = new Date().getFullYear();\\r\\n if (this.props.showFutureDate) {\\r\\n Array.from(Array(2).keys()).map(counter => {\\r\\n let year = thisYear + counter;\\r\\n years.push(\\r\\n \\r\\n {year}\\r\\n ,\\r\\n );\\r\\n return true;\\r\\n });\\r\\n } else {\\r\\n Array.from(Array(120).keys()).map(counter => {\\r\\n let year = thisYear - counter - 18;\\r\\n years.push(\\r\\n \\r\\n {year}\\r\\n ,\\r\\n );\\r\\n return true;\\r\\n });\\r\\n }\\r\\n return years;\\r\\n };\\r\\n\\r\\n render() {\\r\\n const {\\r\\n showErrors = true,\\r\\n field,\\r\\n id,\\r\\n validation = {},\\r\\n groupClassName,\\r\\n label,\\r\\n labelClassName,\\r\\n subLabel = '',\\r\\n description = '',\\r\\n disabled,\\r\\n required,\\r\\n suffix = '',\\r\\n } = this.props;\\r\\n const { state = {} } = validation;\\r\\n var fieldName =\\r\\n typeof field === 'string' ? field : `${field[0]}[${field[1]}]`;\\r\\n return (\\r\\n \\r\\n \\r\\n {label} {subLabel.length > 0 ? {subLabel} : ''}\\r\\n {description.length > 0 ? (\\r\\n {description} \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n \\r\\n \\r\\n \\r\\n {i18n.t('common:datePicker.dayLabel', {\\r\\n defaultValue: 'Day',\\r\\n })}\\r\\n \\r\\n \\r\\n \\r\\n {i18n.t('common:datePicker.dayOption', {\\r\\n defaultValue: 'Day',\\r\\n })}\\r\\n \\r\\n {this.renderDays()}\\r\\n \\r\\n \\r\\n {i18n.t('common:datePicker.monthLabel', {\\r\\n defaultValue: 'Month',\\r\\n })}\\r\\n \\r\\n \\r\\n \\r\\n {i18n.t('common:datePicker.monthOption', {\\r\\n defaultValue: 'Month',\\r\\n })}\\r\\n \\r\\n {this.renderMonths()}\\r\\n \\r\\n \\r\\n {i18n.t('common:datePicker.yearLabel', {\\r\\n defaultValue: 'Year',\\r\\n })}\\r\\n \\r\\n \\r\\n \\r\\n {i18n.t('common:datePicker.yearOption', {\\r\\n defaultValue: 'Year',\\r\\n })}\\r\\n \\r\\n {this.renderYears()}\\r\\n \\r\\n \\r\\n {suffix.length > 0 ? {suffix}
: ''}\\r\\n {showErrors ? : ''}\\r\\n \\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nDatePicker.propTypes = {\\r\\n /**\\r\\n * Datepicker description text\\r\\n */\\r\\n description: PropTypes.string,\\r\\n /**\\r\\n * pickers disabled or not\\r\\n */\\r\\n disabled: PropTypes.any,\\r\\n /**\\r\\n * Input field names\\r\\n */\\r\\n field: PropTypes.oneOfType([PropTypes.string, PropTypes.array]).isRequired,\\r\\n /**\\r\\n * Style class name for group\\r\\n */\\r\\n groupClassName: PropTypes.string,\\r\\n /**\\r\\n * Datepicker ID\\r\\n */\\r\\n id: PropTypes.string.isRequired,\\r\\n /**\\r\\n * Label text\\r\\n */\\r\\n label: PropTypes.string.isRequired,\\r\\n /**\\r\\n * Style class name for label\\r\\n */\\r\\n labelClassName: PropTypes.string,\\r\\n /**\\r\\n * onBlur function\\r\\n */\\r\\n onBlur: PropTypes.func.isRequired,\\r\\n /**\\r\\n * onChange function\\r\\n */\\r\\n onChange: PropTypes.func.isRequired,\\r\\n /**\\r\\n * Input required or not\\r\\n */\\r\\n required: PropTypes.bool,\\r\\n /**\\r\\n * Selected date value\\r\\n */\\r\\n selectedDate: PropTypes.string,\\r\\n /**\\r\\n * Show errors or not\\r\\n */\\r\\n showErrors: PropTypes.bool,\\r\\n /**\\r\\n * Will show future dates\\r\\n */\\r\\n showFutureDate: PropTypes.bool,\\r\\n /**\\r\\n * Sub label text\\r\\n */\\r\\n subLabel: PropTypes.string,\\r\\n /**\\r\\n * Suffix text\\r\\n */\\r\\n suffix: PropTypes.string,\\r\\n /**\\r\\n * Input validation\\r\\n */\\r\\n validation: PropTypes.object,\\r\\n};\\r\\n\\r\\nexport default DatePicker;\\r\\n\",\"examples\":[{\"name\":\"DatePicker\",\"description\":\"DatePicker example\",\"code\":\"import React from 'react';\\r\\nimport { DatePicker } from '@myie/interact-dom';\\r\\nimport { Row, Col, FormGroup } from 'reactstrap';\\r\\n\\r\\n/** DatePicker example */\\r\\nclass DateExample extends React.Component {\\r\\n constructor(props) {\\r\\n super(props);\\r\\n this.state = {\\r\\n value: '',\\r\\n };\\r\\n }\\r\\n\\r\\n onChange = e => {\\r\\n const { value } = e.target;\\r\\n this.setState({ value });\\r\\n };\\r\\n\\r\\n render() {\\r\\n return (\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nexport default DateExample;\\r\\n\"}]},{\"name\":\"Dialog.js\",\"description\":\"Dialog component\\r\\nwill display a modal\",\"props\":{\"children\":{\"type\":{\"name\":\"element\"},\"required\":false,\"description\":\"Any children of the component\"},\"isOpen\":{\"type\":{\"name\":\"bool\"},\"required\":true,\"description\":\"Modal is shown or not\"},\"id\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Dialog ID\"},\"title\":{\"type\":{\"name\":\"string\"},\"required\":true,\"description\":\"Title text\"}},\"code\":\"import React from 'react';\\r\\nimport PropTypes from 'prop-types';\\r\\nimport { Modal, ModalHeader, ModalBody } from 'reactstrap';\\r\\n\\r\\n/**\\r\\n * Dialog component\\r\\n * will display a modal\\r\\n */\\r\\nclass Dialog extends React.Component {\\r\\n render() {\\r\\n const { props } = this;\\r\\n\\r\\n const { isOpen, children, id, title, ...rest } = props;\\r\\n //Accessibility - Role: Dialog and tabindex is set from \\r\\n return (\\r\\n \\r\\n {title} \\r\\n {children} \\r\\n \\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nDialog.propTypes = {\\r\\n /**\\r\\n * Any children of the component\\r\\n */\\r\\n children: PropTypes.element,\\r\\n /**\\r\\n * Modal is shown or not\\r\\n */\\r\\n isOpen: PropTypes.bool.isRequired,\\r\\n /**\\r\\n * Dialog ID\\r\\n */\\r\\n id: PropTypes.string,\\r\\n /**\\r\\n * Title text\\r\\n */\\r\\n title: PropTypes.string.isRequired,\\r\\n};\\r\\n\\r\\nexport default Dialog;\\r\\n\",\"examples\":[{\"name\":\"DialogExample\",\"description\":\"Dialog example\",\"code\":\"import React from 'react';\\r\\nimport { Dialog } from '@myie/interact-dom';\\r\\nimport { Row, Col, FormGroup } from 'reactstrap';\\r\\n\\r\\n/** Dialog example */\\r\\nclass DialogExample extends React.Component {\\r\\n constructor(props) {\\r\\n super(props);\\r\\n this.state = {\\r\\n value: true,\\r\\n };\\r\\n }\\r\\n\\r\\n onClick = () => {\\r\\n const { value } = this.state;\\r\\n this.setState({ value: !value });\\r\\n };\\r\\n\\r\\n render() {\\r\\n const { value } = this.state;\\r\\n return (\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n click Here to close the modal \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nexport default DialogExample;\\r\\n\"}]},{\"name\":\"DropDown.js\",\"description\":\"DropDown component\\r\\nwill display a dropdown\",\"props\":{\"children\":{\"type\":{\"name\":\"array\"},\"required\":true,\"description\":\"Any children of the component\"},\"description\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Date description text\"},\"disabled\":{\"type\":{\"name\":\"any\"},\"required\":false,\"description\":\"DropDown disabled or not\"},\"field\":{\"type\":{\"name\":\"union\",\"value\":[{\"name\":\"string\"},{\"name\":\"array\"}]},\"required\":true,\"description\":\"Input field names\"},\"groupClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Style class name for group\"},\"id\":{\"type\":{\"name\":\"string\"},\"required\":true,\"description\":\"DropDown ID\"},\"label\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Label text\"},\"labelClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Style class name for label\"},\"required\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"DropDown required or not\"},\"showErrors\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"Show errors or not\"},\"subLabel\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Sub label text\"},\"suffix\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Suffix text\"},\"validation\":{\"type\":{\"name\":\"object\"},\"required\":false,\"description\":\"Input validation\"}},\"code\":\"import React from 'react';\\r\\nimport PropTypes from 'prop-types';\\r\\nimport { Label, Input } from 'reactstrap';\\r\\nimport Errors, { HasErrors } from './Errors';\\r\\nimport { Validate } from '@myie/interact';\\r\\n\\r\\n/**\\r\\n * DropDown component\\r\\n * will display a dropdown\\r\\n */\\r\\nclass DropDown extends React.Component {\\r\\n render() {\\r\\n const { props } = this;\\r\\n\\r\\n const {\\r\\n children,\\r\\n validation = {},\\r\\n labelClassName = '',\\r\\n groupClassName = '',\\r\\n showErrors = true,\\r\\n disabled,\\r\\n required,\\r\\n id,\\r\\n field,\\r\\n label,\\r\\n subLabel = '',\\r\\n description = '',\\r\\n suffix = '',\\r\\n ...rest\\r\\n } = props;\\r\\n const { value = '', state = {} } = validation;\\r\\n var fieldName =\\r\\n typeof field === 'string' ? field : `${field[0]}[${field[1]}]`;\\r\\n return (\\r\\n \\r\\n {label || subLabel || description ? (\\r\\n
\\r\\n {label} {subLabel.length > 0 ? {subLabel} : ''}\\r\\n {description.length > 0 ? (\\r\\n {description} \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n
\\r\\n {children}\\r\\n \\r\\n {suffix.length > 0 ?
{suffix}
: ''}\\r\\n {showErrors ?
: ''}\\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nDropDown.propTypes = {\\r\\n /**\\r\\n * Any children of the component\\r\\n */\\r\\n children: PropTypes.array.isRequired,\\r\\n /**\\r\\n * Date description text\\r\\n */\\r\\n description: PropTypes.string,\\r\\n /**\\r\\n * DropDown disabled or not\\r\\n */\\r\\n disabled: PropTypes.any,\\r\\n /**\\r\\n * Input field names\\r\\n */\\r\\n field: PropTypes.oneOfType([PropTypes.string, PropTypes.array]).isRequired,\\r\\n /**\\r\\n * Style class name for group\\r\\n */\\r\\n groupClassName: PropTypes.string,\\r\\n /**\\r\\n * DropDown ID\\r\\n */\\r\\n id: PropTypes.string.isRequired,\\r\\n /**\\r\\n * Label text\\r\\n */\\r\\n label: PropTypes.string,\\r\\n /**\\r\\n * Style class name for label\\r\\n */\\r\\n labelClassName: PropTypes.string,\\r\\n /**\\r\\n * DropDown required or not\\r\\n */\\r\\n required: PropTypes.bool,\\r\\n /**\\r\\n * Show errors or not\\r\\n */\\r\\n showErrors: PropTypes.bool,\\r\\n /**\\r\\n * Sub label text\\r\\n */\\r\\n subLabel: PropTypes.string,\\r\\n /**\\r\\n * Suffix text\\r\\n */\\r\\n suffix: PropTypes.string,\\r\\n /**\\r\\n * Input validation\\r\\n */\\r\\n validation: PropTypes.object,\\r\\n};\\r\\n\\r\\nexport default DropDown;\\r\\n\",\"examples\":[{\"name\":\"DropDownExample\",\"description\":\"Dropdown example\",\"code\":\"import React from 'react';\\r\\nimport { DropDown } from '@myie/interact-dom';\\r\\nimport { FormGroup, Row, Col } from 'reactstrap';\\r\\n\\r\\n/** Dropdown example */\\r\\nclass DropDownExample extends React.Component {\\r\\n constructor(props) {\\r\\n super(props);\\r\\n this.state = {\\r\\n value: '',\\r\\n };\\r\\n }\\r\\n\\r\\n onChange = e => {\\r\\n const { value } = e.target;\\r\\n this.setState({ value });\\r\\n };\\r\\n\\r\\n render() {\\r\\n return (\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n Item 1\\r\\n \\r\\n \\r\\n Item 2\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nexport default DropDownExample;\\r\\n\"}]},{\"name\":\"Errors.js\",\"description\":\"Errors component\\r\\nwill display error message\",\"props\":{\"field\":{\"type\":{\"name\":\"union\",\"value\":[{\"name\":\"string\"},{\"name\":\"array\"}]},\"required\":true,\"description\":\"Field names\"},\"validation\":{\"type\":{\"name\":\"object\"},\"required\":false,\"description\":\"Input validation\"}},\"code\":\"import React from 'react';\\r\\nimport PropTypes from 'prop-types';\\r\\nimport { FormFeedback } from 'reactstrap';\\r\\nimport { Validate } from '@myie/interact';\\r\\n\\r\\n/**\\r\\n * HasErrors function\\r\\n * check the given object and\\r\\n * will return true or false\\r\\n */\\r\\nconst HasErrors = validation => {\\r\\n const { state = {} } = validation;\\r\\n const { approval = {}, dirty } = state;\\r\\n if (approval.approved || !approval.failed || !dirty) {\\r\\n return true;\\r\\n }\\r\\n return false;\\r\\n};\\r\\n\\r\\n/**\\r\\n * Errors component\\r\\n * will display error message\\r\\n */\\r\\nclass Errors extends React.Component {\\r\\n render() {\\r\\n const { props } = this;\\r\\n\\r\\n const { validation = {}, field, ...rest } = props;\\r\\n const { state = {} } = validation;\\r\\n var fieldName =\\r\\n typeof field === 'string' ? field : `${field[0]}-${field[1]}`;\\r\\n const { approval = {}, dirty } = state;\\r\\n const children = [];\\r\\n if (!approval.failed || !dirty) {\\r\\n return '';\\r\\n }\\r\\n const errors = Validate.errors(validation);\\r\\n errors.forEach(error => {\\r\\n var i = 0;\\r\\n children.push(\\r\\n \\r\\n {error.message}\\r\\n
,\\r\\n );\\r\\n });\\r\\n return children.length ? (\\r\\n \\r\\n {children}\\r\\n \\r\\n ) : (\\r\\n ''\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nErrors.propTypes = {\\r\\n /**\\r\\n * Field names\\r\\n */\\r\\n field: PropTypes.oneOfType([PropTypes.string, PropTypes.array]).isRequired,\\r\\n /**\\r\\n * Input validation\\r\\n */\\r\\n validation: PropTypes.object,\\r\\n};\\r\\n\\r\\nexport default Errors;\\r\\nexport { HasErrors };\\r\\n\",\"examples\":[{\"name\":\"ErrorsExample\",\"description\":\"Errors example\",\"code\":\"import React from 'react';\\r\\nimport { Errors } from '@myie/interact-dom';\\r\\nimport { Validate } from '@myie/interact';\\r\\nimport { Input, FormGroup, Row, Col } from 'reactstrap';\\r\\n\\r\\n/** Errors example */\\r\\nclass ErrorsExample extends React.Component {\\r\\n constructor(props) {\\r\\n super(props);\\r\\n this.state = {\\r\\n form: {\\r\\n name: {\\r\\n value: '',\\r\\n state: {},\\r\\n rules: {\\r\\n title: 'Name',\\r\\n required: 'Name is required',\\r\\n },\\r\\n },\\r\\n },\\r\\n };\\r\\n }\\r\\n\\r\\n onChange = e => {\\r\\n const { name, value } = e.target;\\r\\n var { form } = this.state;\\r\\n form = Validate.input(name, value, form);\\r\\n this.setState({ ...this.state, form });\\r\\n };\\r\\n\\r\\n onBlur = e => {\\r\\n const { name, value } = e.target;\\r\\n var { form } = this.state;\\r\\n form = Validate.input(name, value, form, true);\\r\\n this.setState({ ...this.state, form });\\r\\n };\\r\\n\\r\\n render() {\\r\\n return (\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nexport default ErrorsExample;\\r\\n\"}]},{\"name\":\"FormattedCurrency.js\",\"description\":\"FormattedCurrency component\\r\\nwill format and return currency\",\"props\":{\"fallback\":{\"type\":{\"name\":\"any\"},\"required\":false,\"description\":\"\"},\"quantity\":{\"type\":{\"name\":\"union\",\"value\":[{\"name\":\"string\"},{\"name\":\"number\"}]},\"required\":false,\"description\":\"Value to format\"}},\"code\":\"import React from 'react';\\r\\nimport PropTypes from 'prop-types';\\r\\nimport Currency from 'react-currency-formatter';\\r\\n\\r\\n/**\\r\\n * FormattedCurrency component\\r\\n * will format and return currency\\r\\n */\\r\\nclass FormattedCurrency extends React.Component {\\r\\n render() {\\r\\n const { props } = this;\\r\\n\\r\\n const { quantity, ...rest } = props;\\r\\n const qty = parseFloat(quantity);\\r\\n if ((!qty || isNaN(qty)) && !(qty === 0))\\r\\n return {props.fallback || ''} ;\\r\\n return ;\\r\\n }\\r\\n}\\r\\n\\r\\nFormattedCurrency.propTypes = {\\r\\n fallback: PropTypes.any,\\r\\n /**\\r\\n * Value to format\\r\\n */\\r\\n quantity: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\\r\\n};\\r\\n\\r\\nexport default FormattedCurrency;\\r\\n\",\"examples\":[{\"name\":\"FormattedCurrencyGBP\",\"description\":\"FormattedCurrency example for GBP\",\"code\":\"import React from 'react';\\r\\nimport { FormattedCurrency } from '@myie/interact-dom';\\r\\nimport { Row, Col, FormGroup } from 'reactstrap';\\r\\n\\r\\n/** FormattedCurrency example for GBP */\\r\\nexport default function TextExample() {\\r\\n const currencyCode = 'GBP';\\r\\n const currencyQuantity = 1500;\\r\\n return (\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n );\\r\\n}\\r\\n\"},{\"name\":\"FormattedCurrencyLKR\",\"description\":\"FormattedCurrency example for LKR\",\"code\":\"import React from 'react';\\r\\nimport { FormattedCurrency } from '@myie/interact-dom';\\r\\nimport { Row, Col, FormGroup } from 'reactstrap';\\r\\n\\r\\n/** FormattedCurrency example for LKR */\\r\\nexport default function TextExample() {\\r\\n const currencyCode = 'LKR';\\r\\n const currencyQuantity = 1500;\\r\\n return (\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n );\\r\\n}\\r\\n\"}]},{\"name\":\"FormattedDate.js\",\"description\":\"FormattedDate component\\r\\nwill format and return date\",\"props\":{\"date\":{\"type\":{\"name\":\"union\",\"value\":[{\"name\":\"string\"},{\"name\":\"instanceOf\",\"value\":\"Date\"}]},\"required\":false,\"description\":\"Date to format\"},\"format\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"A format\"}},\"code\":\"import React from 'react';\\r\\nimport PropTypes from 'prop-types';\\r\\nimport moment from 'moment';\\r\\nimport { Settings } from '@myie/interact';\\r\\n\\r\\n/**\\r\\n * FormattedDate component\\r\\n * will format and return date\\r\\n */\\r\\nclass FormattedDate extends React.Component {\\r\\n render() {\\r\\n const { format = Settings.dateFormat, date } = this.props;\\r\\n const dateStr = moment(date).format(format);\\r\\n return <>{dateStr}>;\\r\\n }\\r\\n}\\r\\n\\r\\nFormattedDate.propTypes = {\\r\\n /**\\r\\n * Date to format\\r\\n */\\r\\n date: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]),\\r\\n /**\\r\\n * A format\\r\\n */\\r\\n format: PropTypes.string,\\r\\n};\\r\\n\\r\\nexport default FormattedDate;\\r\\n\",\"examples\":[{\"name\":\"FormattedDateExample\",\"description\":\"FormattedDate example\",\"code\":\"import React from 'react';\\r\\nimport { FormattedDate } from '@myie/interact-dom';\\r\\n\\r\\n/** FormattedDate example */\\r\\nclass FormattedDateExample extends React.Component {\\r\\n constructor(props) {\\r\\n super(props);\\r\\n this.state = {\\r\\n value: '',\\r\\n };\\r\\n }\\r\\n\\r\\n onChange = e => {\\r\\n const { value } = e.target;\\r\\n this.setState({ value });\\r\\n };\\r\\n\\r\\n render() {\\r\\n return ;\\r\\n }\\r\\n}\\r\\n\\r\\nexport default FormattedDateExample;\\r\\n\"},{\"name\":\"FormattedDateExampleWithFormat\",\"description\":\"FormattedDate example with given format\",\"code\":\"import React from 'react';\\r\\nimport { FormattedDate } from '@myie/interact-dom';\\r\\n\\r\\n/** FormattedDate example with given format*/\\r\\nclass FormattedDateExample extends React.Component {\\r\\n constructor(props) {\\r\\n super(props);\\r\\n this.state = {\\r\\n value: '',\\r\\n };\\r\\n }\\r\\n\\r\\n onChange = e => {\\r\\n const { value } = e.target;\\r\\n this.setState({ value });\\r\\n };\\r\\n\\r\\n render() {\\r\\n return ;\\r\\n }\\r\\n}\\r\\n\\r\\nexport default FormattedDateExample;\\r\\n\"}]},{\"name\":\"GoogleTagManager.js\",\"description\":\"GoogleTagManager component\",\"props\":{\"additionalEvents\":{\"type\":{\"name\":\"object\"},\"required\":false,\"description\":\"\"},\"dataLayerName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"\"},\"gtmId\":{\"type\":{\"name\":\"string\"},\"required\":true,\"description\":\"\"},\"previewVariables\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"\"},\"scheme\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"\"},\"scriptId\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"\"}},\"code\":\"import React from 'react';\\r\\nimport gtmParts from 'react-google-tag-manager';\\r\\nimport PropTypes from 'prop-types';\\r\\n\\r\\n/**\\r\\n * GoogleTagManager component\\r\\n */\\r\\nclass GoogleTagManager extends React.Component {\\r\\n componentDidMount() {\\r\\n const dataLayerName = this.props.dataLayerName || 'dataLayer';\\r\\n const scriptId = this.props.scriptId || 'react-google-tag-manager-gtm';\\r\\n\\r\\n if (!window[dataLayerName]) {\\r\\n const script = document.createElement('script');\\r\\n const gtmScriptNode = document.getElementById(scriptId);\\r\\n const scriptText = document.createTextNode(gtmScriptNode.textContent);\\r\\n\\r\\n script.appendChild(scriptText);\\r\\n document.head.appendChild(script);\\r\\n }\\r\\n }\\r\\n\\r\\n render() {\\r\\n const gtm = gtmParts({\\r\\n id: this.props.gtmId,\\r\\n dataLayerName: this.props.dataLayerName || 'dataLayer',\\r\\n additionalEvents: this.props.additionalEvents || {},\\r\\n previewVariables: this.props.previewVariables || false,\\r\\n scheme: this.props.scheme || 'https:',\\r\\n });\\r\\n\\r\\n return (\\r\\n \\r\\n
{gtm.noScriptAsReact()}
\\r\\n
\\r\\n {gtm.scriptAsReact()}\\r\\n
\\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nGoogleTagManager.propTypes = {\\r\\n additionalEvents: PropTypes.object,\\r\\n dataLayerName: PropTypes.string,\\r\\n gtmId: PropTypes.string.isRequired,\\r\\n previewVariables: PropTypes.string,\\r\\n scheme: PropTypes.string,\\r\\n scriptId: PropTypes.string,\\r\\n};\\r\\n\\r\\nexport default GoogleTagManager;\\r\\n\",\"examples\":[]},{\"name\":\"IfAuthenticated.js\",\"description\":\"IfAuthenticated component\\r\\nwill display the content only if the session is authenticated\",\"props\":{\"children\":{\"type\":{\"name\":\"element\"},\"required\":false,\"description\":\"Any children of the component\"}},\"code\":\"import React from 'react';\\r\\nimport PropTypes from 'prop-types';\\r\\nimport { Session } from '@myie/interact';\\r\\n\\r\\n/**\\r\\n * IfAuthenticated component\\r\\n * will display the content only if the session is authenticated\\r\\n */\\r\\nclass IfAuthenticated extends React.Component {\\r\\n render() {\\r\\n const { children } = this.props;\\r\\n if (Session.isAuthenticated()) {\\r\\n return <>{children}>;\\r\\n } else return null;\\r\\n }\\r\\n}\\r\\n\\r\\nIfAuthenticated.propTypes = {\\r\\n /**\\r\\n * Any children of the component\\r\\n */\\r\\n children: PropTypes.element,\\r\\n};\\r\\n\\r\\nexport default IfAuthenticated;\\r\\n\",\"examples\":[]},{\"name\":\"InputMask.js\",\"description\":\"Date component\\r\\nwill display an input field\\r\\ninput will be formatted with the passing mask\",\"props\":{\"children\":{\"type\":{\"name\":\"element\"},\"required\":false,\"description\":\"Any children of the component\"},\"description\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Date description text\"},\"disabled\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"Is input disabled?\"},\"field\":{\"type\":{\"name\":\"union\",\"value\":[{\"name\":\"string\"},{\"name\":\"array\"}]},\"required\":true,\"description\":\"Input field names\"},\"groupClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Style class name for group\"},\"id\":{\"type\":{\"name\":\"string\"},\"required\":true,\"description\":\"Date ID\"},\"label\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Label text\"},\"labelClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Style class name for label\"},\"mask\":{\"type\":{\"name\":\"string\"},\"required\":true,\"description\":\"Any character can be escaped with a backslash\"},\"maskChar\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Character to cover unfilled parts of the mask\"},\"onBlur\":{\"type\":{\"name\":\"func\"},\"required\":true,\"description\":\"onBlur function\"},\"onChange\":{\"type\":{\"name\":\"func\"},\"required\":true,\"description\":\"onChange function\"},\"required\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"Input required or not\"},\"showErrors\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"Show errors or not\"},\"subLabel\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Sub label text\"},\"suffix\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Suffix text\"},\"validation\":{\"type\":{\"name\":\"object\"},\"required\":false,\"description\":\"Input validation\"}},\"code\":\"import React from 'react';\\r\\nimport PropTypes from 'prop-types';\\r\\nimport { Input, Label } from 'reactstrap';\\r\\nimport Errors, { HasErrors } from './Errors';\\r\\nimport { Validate } from '@myie/interact';\\r\\nimport InputMask from 'react-input-mask';\\r\\n\\r\\n/**\\r\\n * Date component\\r\\n * will display an input field\\r\\n * input will be formatted with the passing mask\\r\\n */\\r\\nclass Mask extends React.Component {\\r\\n render() {\\r\\n const { props } = this;\\r\\n\\r\\n const {\\r\\n id,\\r\\n children,\\r\\n disabled,\\r\\n required,\\r\\n validation = {},\\r\\n labelClassName = '',\\r\\n groupClassName = '',\\r\\n mask,\\r\\n field,\\r\\n label,\\r\\n maskChar,\\r\\n showErrors = true,\\r\\n subLabel = '',\\r\\n description = '',\\r\\n suffix = '',\\r\\n ...rest\\r\\n } = props;\\r\\n const { value = '', state = {} } = validation;\\r\\n var fieldName =\\r\\n typeof field === 'string' ? field : `${field[0]}[${field[1]}]`;\\r\\n return (\\r\\n \\r\\n {label || subLabel || description ? (\\r\\n
\\r\\n {label} {subLabel.length > 0 ? {subLabel} : ''}\\r\\n {description.length > 0 ? (\\r\\n {description} \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n
\\r\\n {() => (\\r\\n \\r\\n )}\\r\\n \\r\\n {suffix.length > 0 ?
{suffix}
: ''}\\r\\n {children}\\r\\n {showErrors ?
: ''}\\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nMask.propTypes = {\\r\\n /**\\r\\n * Any children of the component\\r\\n */\\r\\n children: PropTypes.element,\\r\\n /**\\r\\n * Date description text\\r\\n */\\r\\n description: PropTypes.string,\\r\\n /**\\r\\n * Is input disabled?\\r\\n */\\r\\n disabled: PropTypes.bool,\\r\\n /**\\r\\n * Input field names\\r\\n */\\r\\n field: PropTypes.oneOfType([PropTypes.string, PropTypes.array]).isRequired,\\r\\n /**\\r\\n * Style class name for group\\r\\n */\\r\\n groupClassName: PropTypes.string,\\r\\n /**\\r\\n * Date ID\\r\\n */\\r\\n id: PropTypes.string.isRequired,\\r\\n /**\\r\\n * Label text\\r\\n */\\r\\n label: PropTypes.string,\\r\\n /**\\r\\n * Style class name for label\\r\\n */\\r\\n labelClassName: PropTypes.string,\\r\\n /**\\r\\n * Any character can be escaped with a backslash\\r\\n */\\r\\n mask: PropTypes.string.isRequired,\\r\\n /**\\r\\n * Character to cover unfilled parts of the mask\\r\\n */\\r\\n maskChar: PropTypes.string,\\r\\n /**\\r\\n * onBlur function\\r\\n */\\r\\n onBlur: PropTypes.func.isRequired,\\r\\n /**\\r\\n * onChange function\\r\\n */\\r\\n onChange: PropTypes.func.isRequired,\\r\\n /**\\r\\n * Input required or not\\r\\n */\\r\\n required: PropTypes.bool,\\r\\n /**\\r\\n * Show errors or not\\r\\n */\\r\\n showErrors: PropTypes.bool,\\r\\n /**\\r\\n * Sub label text\\r\\n */\\r\\n subLabel: PropTypes.string,\\r\\n /**\\r\\n * Suffix text\\r\\n */\\r\\n suffix: PropTypes.string,\\r\\n /**\\r\\n * Input validation\\r\\n */\\r\\n validation: PropTypes.object,\\r\\n};\\r\\n\\r\\nexport default Mask;\\r\\n\",\"examples\":[{\"name\":\"CheckExample\",\"description\":\"Mask example\",\"code\":\"import React from 'react';\\r\\nimport { Mask } from '@myie/interact-dom';\\r\\nimport { FormGroup, Row, Col } from 'reactstrap';\\r\\n\\r\\n/** Mask example */\\r\\nclass MaskExample extends React.Component {\\r\\n constructor(props) {\\r\\n super(props);\\r\\n this.state = {\\r\\n value: '',\\r\\n form: {\\r\\n sortcode: {},\\r\\n },\\r\\n };\\r\\n }\\r\\n\\r\\n onChange = e => {\\r\\n const { value } = e.target;\\r\\n const { form } = this.state;\\r\\n form.sortcode.value = value;\\r\\n this.setState({ ...this.state, form });\\r\\n };\\r\\n\\r\\n render() {\\r\\n const { form } = this.state;\\r\\n return (\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nexport default MaskExample;\\r\\n\"}]},{\"name\":\"Numeric.js\",\"description\":\"Numeric component\\r\\nwill display a numeric input feild\",\"props\":{\"children\":{\"type\":{\"name\":\"union\",\"value\":[{\"name\":\"element\"},{\"name\":\"array\"}]},\"required\":false,\"description\":\"Any children of the component\"},\"description\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Numeric description text\"},\"disabled\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"Input disabled or not\"},\"dp\":{\"type\":{\"name\":\"number\"},\"required\":false,\"description\":\"decimal places\"},\"field\":{\"type\":{\"name\":\"union\",\"value\":[{\"name\":\"string\"},{\"name\":\"array\"}]},\"required\":true,\"description\":\"Input field names\"},\"groupClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Style class name for group\"},\"id\":{\"type\":{\"name\":\"string\"},\"required\":true,\"description\":\"Numeric ID\"},\"label\":{\"type\":{\"name\":\"string\"},\"required\":true,\"description\":\"Label text\"},\"labelClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Style class name for label\"},\"onBlur\":{\"type\":{\"name\":\"func\"},\"required\":true,\"description\":\"onBlur function\"},\"onChange\":{\"type\":{\"name\":\"func\"},\"required\":true,\"description\":\"onChange function\"},\"required\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"Input required or not\"},\"showErrors\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"Show errors or not\"},\"subLabel\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Sub label text\"},\"suffix\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Suffix text\"},\"validation\":{\"type\":{\"name\":\"object\"},\"required\":false,\"description\":\"Input validation\"}},\"code\":\"import React from 'react';\\r\\nimport PropTypes from 'prop-types';\\r\\nimport { Input, Label } from 'reactstrap';\\r\\nimport Errors, { HasErrors } from './Errors';\\r\\nimport { Validate } from '@myie/interact';\\r\\n\\r\\n/**\\r\\n * Numeric component\\r\\n * will display a numeric input feild\\r\\n */\\r\\nclass Numeric extends React.Component {\\r\\n render() {\\r\\n const { props } = this;\\r\\n\\r\\n const {\\r\\n dp = 0,\\r\\n children,\\r\\n validation = {},\\r\\n disabled,\\r\\n required,\\r\\n labelClassName = '',\\r\\n groupClassName = '',\\r\\n showErrors = true,\\r\\n id,\\r\\n field,\\r\\n label,\\r\\n subLabel = '',\\r\\n description = '',\\r\\n suffix = '',\\r\\n onChange,\\r\\n onBlur,\\r\\n ...rest\\r\\n } = props;\\r\\n const { value = '', state = {} } = validation;\\r\\n const dpPat = !dp || dp === 0 ? '' : `[.]{0,1}[0-9]{0,${dp}}`;\\r\\n const pattern = `^[0-9]*${dpPat}$`;\\r\\n\\r\\n const inputOverride = (e, dp, func) => {\\r\\n const { target = {} } = e;\\r\\n const { value = '' } = target;\\r\\n if (\\r\\n dp > 0 &&\\r\\n value.indexOf('.') !== -1 &&\\r\\n value.length - value.indexOf('.') > dp + 1\\r\\n ) {\\r\\n return;\\r\\n }\\r\\n const found = value.toString().match(new RegExp(pattern));\\r\\n if (value && !found) {\\r\\n return;\\r\\n }\\r\\n\\r\\n if (value && target.validity && !target.validity.valid) {\\r\\n return;\\r\\n }\\r\\n if (!value || !isNaN(parseFloat(value))) {\\r\\n if (func) {\\r\\n func(e);\\r\\n }\\r\\n }\\r\\n };\\r\\n\\r\\n var fieldName =\\r\\n typeof field === 'string' ? field : `${field[0]}[${field[1]}]`;\\r\\n return (\\r\\n \\r\\n {label || subLabel || description ? (\\r\\n
\\r\\n {label} {subLabel.length > 0 ? {subLabel} : ''}\\r\\n {description.length > 0 ? (\\r\\n {description} \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n
inputOverride(event, dp, onBlur)}\\r\\n onChange={event => inputOverride(event, dp, onChange)}\\r\\n invalid={Validate.isInvalid(state)}\\r\\n valid={Validate.isValid(state)}\\r\\n id={id}\\r\\n name={fieldName}\\r\\n value={value}\\r\\n disabled={disabled}\\r\\n required={required}\\r\\n type=\\\"text\\\"\\r\\n inputMode={dp === 0 ? 'numeric' : 'decimal'}\\r\\n pattern={pattern}\\r\\n {...rest}\\r\\n />\\r\\n {suffix.length > 0 ?
{suffix}
: ''}\\r\\n {children}\\r\\n {showErrors ?
: ''}\\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nNumeric.propTypes = {\\r\\n /**\\r\\n * Any children of the component\\r\\n */\\r\\n children: PropTypes.oneOfType([PropTypes.element, PropTypes.array]),\\r\\n /**\\r\\n * Numeric description text\\r\\n */\\r\\n description: PropTypes.string,\\r\\n /**\\r\\n * Input disabled or not\\r\\n */\\r\\n disabled: PropTypes.bool,\\r\\n /**\\r\\n * decimal places\\r\\n */\\r\\n dp: PropTypes.number,\\r\\n /**\\r\\n * Input field names\\r\\n */\\r\\n field: PropTypes.oneOfType([PropTypes.string, PropTypes.array]).isRequired,\\r\\n /**\\r\\n * Style class name for group\\r\\n */\\r\\n groupClassName: PropTypes.string,\\r\\n /**\\r\\n * Numeric ID\\r\\n */\\r\\n id: PropTypes.string.isRequired,\\r\\n /**\\r\\n * Label text\\r\\n */\\r\\n label: PropTypes.string.isRequired,\\r\\n /**\\r\\n * Style class name for label\\r\\n */\\r\\n labelClassName: PropTypes.string,\\r\\n /**\\r\\n * onBlur function\\r\\n */\\r\\n onBlur: PropTypes.func.isRequired,\\r\\n /**\\r\\n * onChange function\\r\\n */\\r\\n onChange: PropTypes.func.isRequired,\\r\\n /**\\r\\n * Input required or not\\r\\n */\\r\\n required: PropTypes.bool,\\r\\n /**\\r\\n * Show errors or not\\r\\n */\\r\\n showErrors: PropTypes.bool,\\r\\n /**\\r\\n * Sub label text\\r\\n */\\r\\n subLabel: PropTypes.string,\\r\\n /**\\r\\n * Suffix text\\r\\n */\\r\\n suffix: PropTypes.string,\\r\\n /**\\r\\n * Input validation\\r\\n */\\r\\n validation: PropTypes.object,\\r\\n};\\r\\n\\r\\nexport default Numeric;\\r\\n\",\"examples\":[{\"name\":\"NumericExample\",\"description\":\"Numeric example\",\"code\":\"import React from 'react';\\r\\nimport { Numeric } from '@myie/interact-dom';\\r\\nimport { FormGroup, Row, Col } from 'reactstrap';\\r\\n\\r\\n/** Numeric example */\\r\\nclass NumericExample extends React.Component {\\r\\n constructor(props) {\\r\\n super(props);\\r\\n this.state = {\\r\\n value: '',\\r\\n };\\r\\n }\\r\\n\\r\\n onChange = e => {\\r\\n const { value } = e.target;\\r\\n this.setState({ value });\\r\\n };\\r\\n\\r\\n render() {\\r\\n return (\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nexport default NumericExample;\\r\\n\"},{\"name\":\"NumericExample2\",\"description\":\"Numeric example with Decimal\",\"code\":\"import React from 'react';\\r\\nimport { Numeric } from '@myie/interact-dom';\\r\\nimport { FormGroup, Row, Col } from 'reactstrap';\\r\\n\\r\\n/** Numeric example with Decimal */\\r\\nclass NumericExample extends React.Component {\\r\\n constructor(props) {\\r\\n super(props);\\r\\n this.state = {\\r\\n value: '',\\r\\n };\\r\\n }\\r\\n\\r\\n onChange = e => {\\r\\n const { value } = e.target;\\r\\n this.setState({ value });\\r\\n };\\r\\n\\r\\n render() {\\r\\n return (\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nexport default NumericExample;\\r\\n\"}]},{\"name\":\"Pagination.js\",\"description\":\"Pagination component\\r\\nwill display a pagination bar\",\"props\":{\"Total\":{\"type\":{\"name\":\"number\"},\"required\":true,\"description\":\"Total number of items\"},\"Offset\":{\"type\":{\"name\":\"number\"},\"required\":true,\"description\":\"Offset number\"},\"Size\":{\"type\":{\"name\":\"number\"},\"required\":true,\"description\":\"Number of items per page\"},\"getNextPage\":{\"type\":{\"name\":\"func\"},\"required\":true,\"description\":\"Function to get next data\"},\"getPreviousPage\":{\"type\":{\"name\":\"func\"},\"required\":true,\"description\":\"Function to get previous data\"}},\"code\":\"import React from 'react';\\r\\nimport PropTypes from 'prop-types';\\r\\nimport i18n from 'i18next';\\r\\nimport { Row, Col, Button } from 'reactstrap';\\r\\n\\r\\n/**\\r\\n * Pagination component\\r\\n * will display a pagination bar\\r\\n */\\r\\nclass Pagination extends React.Component {\\r\\n render() {\\r\\n const { Total, Offset, Size, getNextPage, getPreviousPage } = this.props;\\r\\n\\r\\n const totalPages = Math.ceil(Total / Size);\\r\\n const currentPage = Math.ceil(Offset / Size) + 1;\\r\\n return (\\r\\n \\r\\n \\r\\n getPreviousPage(Offset, Size)}\\r\\n disabled={currentPage === 1 ? true : false}\\r\\n >\\r\\n {i18n.t('common:pagination.previousPageBtn', {\\r\\n defaultValue: 'Previous',\\r\\n })}\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n Page {currentPage} of {totalPages}\\r\\n
\\r\\n \\r\\n \\r\\n getNextPage(Offset, Size, Total)}\\r\\n disabled={currentPage === totalPages ? true : false}\\r\\n >\\r\\n {i18n.t('common:pagination.nextPageBtn', {\\r\\n defaultValue: 'Next',\\r\\n })}\\r\\n \\r\\n \\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nPagination.propTypes = {\\r\\n /**\\r\\n * Total number of items\\r\\n */\\r\\n Total: PropTypes.number.isRequired,\\r\\n /**\\r\\n * Offset number\\r\\n */\\r\\n Offset: PropTypes.number.isRequired,\\r\\n /**\\r\\n * Number of items per page\\r\\n */\\r\\n Size: PropTypes.number.isRequired,\\r\\n /**\\r\\n * Function to get next data\\r\\n */\\r\\n getNextPage: PropTypes.func.isRequired,\\r\\n /**\\r\\n * Function to get previous data\\r\\n */\\r\\n getPreviousPage: PropTypes.func.isRequired,\\r\\n};\\r\\n\\r\\nexport default Pagination;\\r\\n\",\"examples\":[{\"name\":\"PaginationExample\",\"description\":\"Pagination example\",\"code\":\"import React from 'react';\\r\\nimport { Pagination } from '@myie/interact-dom';\\r\\n\\r\\n/** Pagination example */\\r\\nclass PaginationExample extends React.Component {\\r\\n constructor(props) {\\r\\n super(props);\\r\\n this.state = {\\r\\n Offset: 0,\\r\\n Size: 8,\\r\\n };\\r\\n }\\r\\n\\r\\n getPreviousPage = (Offset, Size) => {\\r\\n const previousOffset = Offset - Size;\\r\\n if (previousOffset >= 0) {\\r\\n this.setState({ ...this.state, Offset: previousOffset });\\r\\n }\\r\\n };\\r\\n\\r\\n getNextPage = (Offset, Size, TotalConversationsCount) => {\\r\\n const nextOffset = Offset + Size;\\r\\n if (nextOffset <= TotalConversationsCount) {\\r\\n this.setState({ ...this.state, Offset: nextOffset });\\r\\n }\\r\\n };\\r\\n\\r\\n render() {\\r\\n const TotalConversationsCount = 17;\\r\\n const { Offset, Size } = this.state;\\r\\n return (\\r\\n \\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nexport default PaginationExample;\\r\\n\"}]},{\"name\":\"Radio.js\",\"description\":\"Radio component\",\"props\":{\"children\":{\"type\":{\"name\":\"any\"},\"required\":false,\"description\":\"Any children of the component\"},\"className\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Class name\"},\"description\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Description for radio\"},\"disabled\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"Boolean flag whether radio is disabled or not\"},\"field\":{\"type\":{\"name\":\"union\",\"value\":[{\"name\":\"string\"},{\"name\":\"array\"}]},\"required\":true,\"description\":\"Field name\"},\"groupClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Class name\"},\"id\":{\"type\":{\"name\":\"any\"},\"required\":true,\"description\":\"Radio id\"},\"label\":{\"type\":{\"name\":\"any\"},\"required\":true,\"description\":\"Radio label\"},\"labelClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Class name for the label\"},\"required\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"Whether radio is required or not\"},\"setValue\":{\"type\":{\"name\":\"any\"},\"required\":false,\"description\":\"Set value for radio\"},\"value\":{\"type\":{\"name\":\"union\",\"value\":[{\"name\":\"bool\"},{\"name\":\"string\"}]},\"required\":true,\"description\":\"Value for radio\"},\"subLabel\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Sub label for radio\"},\"suffix\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Suffix for radio\"},\"validation\":{\"type\":{\"name\":\"object\"},\"required\":false,\"description\":\"Validation object\"}},\"code\":\"import React from 'react';\\r\\nimport PropTypes from 'prop-types';\\r\\nimport { Input, Label } from 'reactstrap';\\r\\nimport { Validate } from '@myie/interact';\\r\\n\\r\\n/**\\r\\n * Radio component\\r\\n */\\r\\nclass Radio extends React.Component {\\r\\n render() {\\r\\n const { props } = this;\\r\\n\\r\\n const {\\r\\n validation = {},\\r\\n value: setValue,\\r\\n children,\\r\\n disabled,\\r\\n required,\\r\\n id,\\r\\n field,\\r\\n className = '',\\r\\n labelClassName = '',\\r\\n groupClassName = '',\\r\\n label,\\r\\n subLabel = '',\\r\\n description = '',\\r\\n suffix = '',\\r\\n ...rest\\r\\n } = props;\\r\\n const { value = '', state = {} } = validation;\\r\\n var fieldName =\\r\\n typeof field === 'string' ? field : `${field[0]}[${field[1]}]`;\\r\\n return (\\r\\n \\r\\n
\\r\\n
\\r\\n {label} {subLabel.length > 0 ? {subLabel} : ''}\\r\\n {description.length > 0 ? (\\r\\n {description} \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n \\r\\n {children}\\r\\n {suffix.length > 0 ?
{suffix}
: ''}\\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nRadio.propTypes = {\\r\\n /**\\r\\n * Any children of the component\\r\\n */\\r\\n children: PropTypes.any,\\r\\n /**\\r\\n * Class name\\r\\n */\\r\\n className: PropTypes.string,\\r\\n /**\\r\\n * Description for radio\\r\\n */\\r\\n description: PropTypes.string,\\r\\n /**\\r\\n * Boolean flag whether radio is disabled or not\\r\\n */\\r\\n disabled: PropTypes.bool,\\r\\n /**\\r\\n * Field name\\r\\n */\\r\\n field: PropTypes.oneOfType([PropTypes.string, PropTypes.array]).isRequired,\\r\\n /**\\r\\n * Class name\\r\\n */\\r\\n groupClassName: PropTypes.string,\\r\\n /**\\r\\n * Radio id\\r\\n */\\r\\n id: PropTypes.any.isRequired,\\r\\n /**\\r\\n * Radio label\\r\\n */\\r\\n label: PropTypes.any.isRequired,\\r\\n /**\\r\\n * Class name for the label\\r\\n */\\r\\n labelClassName: PropTypes.string,\\r\\n /**\\r\\n * Whether radio is required or not\\r\\n */\\r\\n required: PropTypes.bool,\\r\\n /**\\r\\n * Set value for radio\\r\\n */\\r\\n setValue: PropTypes.any,\\r\\n /**\\r\\n * Value for radio\\r\\n */\\r\\n value: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]).isRequired,\\r\\n /**\\r\\n * Sub label for radio\\r\\n */\\r\\n subLabel: PropTypes.string,\\r\\n /**\\r\\n * Suffix for radio\\r\\n */\\r\\n suffix: PropTypes.string,\\r\\n /**\\r\\n * Validation object\\r\\n */\\r\\n validation: PropTypes.object,\\r\\n};\\r\\n\\r\\nexport default Radio;\\r\\n\",\"examples\":[{\"name\":\"RadioExample\",\"description\":\"Radio Button example\",\"code\":\"import React from 'react';\\r\\nimport { Radio } from '@myie/interact-dom';\\r\\nimport { FormGroup, Row, Col } from 'reactstrap';\\r\\n\\r\\n/** Radio Button example */\\r\\nclass RadioExample extends React.Component {\\r\\n constructor(props) {\\r\\n super(props);\\r\\n this.state = {\\r\\n value: '',\\r\\n };\\r\\n }\\r\\n\\r\\n onChangeRadioButton = e => {\\r\\n const { value } = e.target;\\r\\n this.setState({ value });\\r\\n };\\r\\n\\r\\n render() {\\r\\n return (\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nexport default RadioExample;\\r\\n\"}]},{\"name\":\"RadioButton.js\",\"description\":\"RadioButton component\",\"props\":{\"children\":{\"type\":{\"name\":\"element\"},\"required\":false,\"description\":\"Any children of the component\"},\"field\":{\"type\":{\"name\":\"union\",\"value\":[{\"name\":\"string\"},{\"name\":\"array\"}]},\"required\":true,\"description\":\"Input field names\"},\"id\":{\"type\":{\"name\":\"string\"},\"required\":true,\"description\":\"RadioButton ID\"},\"label\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Label text\"},\"value\":{\"type\":{\"name\":\"any\"},\"required\":false,\"description\":\"\"},\"setValue\":{\"type\":{\"name\":\"any\"},\"required\":false,\"description\":\"\"},\"validation\":{\"type\":{\"name\":\"object\"},\"required\":false,\"description\":\"Input validation\"}},\"code\":\"import React from 'react';\\r\\nimport PropTypes from 'prop-types';\\r\\nimport { Button } from 'reactstrap';\\r\\nimport { HasErrors } from './Errors';\\r\\n\\r\\n/**\\r\\n * RadioButton component\\r\\n */\\r\\nclass RadioButton extends React.Component {\\r\\n render() {\\r\\n const { props } = this;\\r\\n\\r\\n const {\\r\\n validation = {},\\r\\n value: setValue,\\r\\n children,\\r\\n id,\\r\\n field,\\r\\n label,\\r\\n ...rest\\r\\n } = props;\\r\\n const { value = '' } = validation;\\r\\n var fieldName =\\r\\n typeof field === 'string' ? field : `${field[0]}[${field[1]}]`;\\r\\n return (\\r\\n \\r\\n {label}\\r\\n {children}\\r\\n \\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nRadioButton.propTypes = {\\r\\n /**\\r\\n * Any children of the component\\r\\n */\\r\\n children: PropTypes.element,\\r\\n /**\\r\\n * Input field names\\r\\n */\\r\\n field: PropTypes.oneOfType([PropTypes.string, PropTypes.array]).isRequired,\\r\\n /**\\r\\n * RadioButton ID\\r\\n */\\r\\n id: PropTypes.string.isRequired,\\r\\n /**\\r\\n * Label text\\r\\n */\\r\\n label: PropTypes.string,\\r\\n value: PropTypes.any,\\r\\n setValue: PropTypes.any,\\r\\n /**\\r\\n * Input validation\\r\\n */\\r\\n validation: PropTypes.object,\\r\\n};\\r\\n\\r\\nexport default RadioButton;\\r\\n\",\"examples\":[{\"name\":\"RadioButtonExample\",\"description\":\"RadioButton example\",\"code\":\"import React from 'react';\\r\\nimport { RadioButton } from '@myie/interact-dom';\\r\\nimport { Row, Col, FormGroup } from 'reactstrap';\\r\\n\\r\\n/** RadioButton example */\\r\\nclass RadioButtonExample extends React.Component {\\r\\n constructor(props) {\\r\\n super(props);\\r\\n }\\r\\n\\r\\n render() {\\r\\n return (\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nexport default RadioButtonExample;\\r\\n\"}]},{\"name\":\"RadioGroup.js\",\"description\":\"RadioGroup component\",\"props\":{\"children\":{\"type\":{\"name\":\"element\"},\"required\":false,\"description\":\"Any children of the component\"},\"description\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Date description text\"},\"groupClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Style class name for group\"},\"labelClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Style class name for label\"},\"legend\":{\"type\":{\"name\":\"any\"},\"required\":false,\"description\":\"\"},\"subLabel\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Sub label text\"},\"suffix\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Suffix text\"}},\"code\":\"import React from 'react';\\r\\nimport PropTypes from 'prop-types';\\r\\nimport { FormGroup } from 'reactstrap';\\r\\n\\r\\n/**\\r\\n * RadioGroup component\\r\\n */\\r\\nclass RadioGroup extends React.Component {\\r\\n render() {\\r\\n const { props } = this;\\r\\n\\r\\n const {\\r\\n legend,\\r\\n children,\\r\\n groupClassName = '',\\r\\n labelClassName = '',\\r\\n subLabel = '',\\r\\n description = '',\\r\\n suffix = '',\\r\\n ...rest\\r\\n } = props;\\r\\n\\r\\n return (\\r\\n \\r\\n \\r\\n {legend} {subLabel.length > 0 ? {subLabel} : ''}\\r\\n {description.length > 0 ? (\\r\\n {description} \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n \\r\\n \\r\\n {children}\\r\\n \\r\\n {suffix.length > 0 ? {suffix}
: ''}\\r\\n \\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nRadioGroup.propTypes = {\\r\\n /**\\r\\n * Any children of the component\\r\\n */\\r\\n children: PropTypes.element,\\r\\n /**\\r\\n * Date description text\\r\\n */\\r\\n description: PropTypes.string,\\r\\n /**\\r\\n * Style class name for group\\r\\n */\\r\\n groupClassName: PropTypes.string,\\r\\n /**\\r\\n * Style class name for label\\r\\n */\\r\\n labelClassName: PropTypes.string,\\r\\n legend: PropTypes.any,\\r\\n /**\\r\\n * Sub label text\\r\\n */\\r\\n subLabel: PropTypes.string,\\r\\n /**\\r\\n * Suffix text\\r\\n */\\r\\n suffix: PropTypes.string,\\r\\n};\\r\\n\\r\\nexport default RadioGroup;\\r\\n\",\"examples\":[]},{\"name\":\"RoundBadge.js\",\"description\":\"RoundBadge component\\r\\nwill display a rounded badge\",\"props\":{\"children\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Text to display on the badge\"}},\"code\":\"import React from 'react';\\r\\nimport PropTypes from 'prop-types';\\r\\nimport { Badge } from 'reactstrap';\\r\\n\\r\\n/**\\r\\n * RoundBadge component\\r\\n * will display a rounded badge\\r\\n */\\r\\nclass RoundBadge extends React.Component {\\r\\n render() {\\r\\n const { children, ...rest } = this.props;\\r\\n return (\\r\\n \\r\\n {children}\\r\\n \\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nRoundBadge.propTypes = {\\r\\n /**\\r\\n * Text to display on the badge\\r\\n */\\r\\n children: PropTypes.string,\\r\\n};\\r\\n\\r\\nexport default RoundBadge;\\r\\n\",\"examples\":[{\"name\":\"RoundBadgeExample\",\"description\":\"RoundBadge example\",\"code\":\"import React from 'react';\\r\\nimport { RoundBadge } from '@myie/interact-dom';\\r\\n\\r\\n/** RoundBadge example */\\r\\nclass RoundBadgeExample extends React.Component {\\r\\n constructor(props) {\\r\\n super(props);\\r\\n }\\r\\n\\r\\n render() {\\r\\n return 10 ;\\r\\n }\\r\\n}\\r\\n\\r\\nexport default RoundBadgeExample;\\r\\n\"}]},{\"name\":\"ScrollToTop.js\",\"description\":\"ScrollToTop component\\r\\nThe given content will be scrolled to the top\",\"props\":{\"children\":{\"type\":{\"name\":\"element\"},\"required\":true,\"description\":\"Any children of the component\"},\"refreshMe\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"If true the content will be forcefully scrolled to the top\"},\"location\":{\"type\":{\"name\":\"shape\",\"value\":{\"pathname\":{\"name\":\"string\",\"required\":true}}},\"required\":true,\"description\":\"Browser address\"}},\"code\":\"import { PureComponent } from 'react';\\r\\nimport { withRouter } from 'react-router';\\r\\nimport PropTypes from 'prop-types';\\r\\n\\r\\n/**\\r\\n * ScrollToTop component\\r\\n * The given content will be scrolled to the top\\r\\n */\\r\\nclass ScrollToTop extends PureComponent {\\r\\n componentDidUpdate(prevProps) {\\r\\n const { location } = this.props;\\r\\n\\r\\n if (location.pathname !== prevProps.location.pathname) {\\r\\n window.scrollTo(0, 0);\\r\\n }\\r\\n }\\r\\n\\r\\n componentDidMount() {\\r\\n if (this.props.refreshMe) {\\r\\n window.scrollTo(0, 0);\\r\\n }\\r\\n }\\r\\n\\r\\n render() {\\r\\n const { children } = this.props;\\r\\n\\r\\n return children;\\r\\n }\\r\\n}\\r\\n\\r\\nScrollToTop.propTypes = {\\r\\n /**\\r\\n * Any children of the component\\r\\n */\\r\\n children: PropTypes.element.isRequired,\\r\\n /**\\r\\n * If true the content will be forcefully scrolled to the top\\r\\n */\\r\\n refreshMe: PropTypes.bool,\\r\\n /**\\r\\n * Browser address\\r\\n */\\r\\n location: PropTypes.shape({\\r\\n pathname: PropTypes.string.isRequired,\\r\\n }).isRequired,\\r\\n};\\r\\n\\r\\nexport default withRouter(ScrollToTop);\\r\\n\",\"examples\":[]},{\"name\":\"Slider.js\",\"description\":\"Slider component\",\"props\":{\"children\":{\"type\":{\"name\":\"element\"},\"required\":false,\"description\":\"Any children of the component\"},\"description\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Date description text\"},\"disabled\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"Input disabled or not\"},\"dp\":{\"type\":{\"name\":\"number\"},\"required\":false,\"description\":\"decimal places\"},\"field\":{\"type\":{\"name\":\"union\",\"value\":[{\"name\":\"string\"},{\"name\":\"array\"}]},\"required\":true,\"description\":\"Input field names\"},\"groupClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Style class name for group\"},\"id\":{\"type\":{\"name\":\"string\"},\"required\":true,\"description\":\"Slider ID\"},\"inputClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Style class name for input\"},\"label\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Label text\"},\"labelClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Style class name for label\"},\"onBlur\":{\"type\":{\"name\":\"func\"},\"required\":true,\"description\":\"onBlur function\"},\"onChange\":{\"type\":{\"name\":\"func\"},\"required\":true,\"description\":\"onChange function\"},\"required\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"Input required or not\"},\"showErrors\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"Show errors or not\"},\"subLabel\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Sub label text\"},\"suffix\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Suffix text\"},\"validation\":{\"type\":{\"name\":\"object\"},\"required\":false,\"description\":\"Input validation\"},\"withInput\":{\"type\":{\"name\":\"any\"},\"required\":false,\"description\":\"\"}},\"code\":\"import React from 'react';\\r\\nimport PropTypes from 'prop-types';\\r\\nimport { Input, Label, Col, Row } from 'reactstrap';\\r\\nimport Errors, { HasErrors } from './Errors';\\r\\nimport { Validate } from '@myie/interact';\\r\\n\\r\\n/**\\r\\n * Slider component\\r\\n */\\r\\nclass Slider extends React.Component {\\r\\n render() {\\r\\n const { props } = this;\\r\\n\\r\\n const {\\r\\n withInput,\\r\\n dp,\\r\\n children,\\r\\n validation = {},\\r\\n labelClassName = '',\\r\\n inputClassName = '',\\r\\n groupClassName = '',\\r\\n showErrors = true,\\r\\n id,\\r\\n field,\\r\\n label,\\r\\n subLabel = '',\\r\\n description = '',\\r\\n onChange,\\r\\n onBlur,\\r\\n disabled,\\r\\n required,\\r\\n suffix = '',\\r\\n ...rest\\r\\n } = props;\\r\\n const { value = '', state = {} } = validation;\\r\\n\\r\\n const inputOverride = (e, dp, func) => {\\r\\n const { target = {} } = e;\\r\\n const { value = '' } = target;\\r\\n if (\\r\\n dp > 0 &&\\r\\n value.indexOf('.') !== -1 &&\\r\\n value.length - value.indexOf('.') > dp + 1\\r\\n ) {\\r\\n return;\\r\\n }\\r\\n if (!target.validity.valid) {\\r\\n return;\\r\\n }\\r\\n if (!value || !isNaN(parseFloat(value))) {\\r\\n func(e);\\r\\n }\\r\\n };\\r\\n var step = dp <= 0 ? '1' : '.' + '0'.repeat(dp - 1) + '1';\\r\\n var fieldName =\\r\\n typeof field === 'string' ? field : `${field[0]}[${field[1]}]`;\\r\\n return (\\r\\n \\r\\n
\\r\\n {label} {subLabel.length > 0 ? {subLabel} : ''}\\r\\n {description.length > 0 ? (\\r\\n {description} \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n \\r\\n
\\r\\n \\r\\n inputOverride(event, dp, onBlur)}\\r\\n onChange={event => inputOverride(event, dp, onChange)}\\r\\n id={id}\\r\\n name={fieldName}\\r\\n value={value}\\r\\n type=\\\"range\\\"\\r\\n step={step}\\r\\n {...rest}\\r\\n />\\r\\n \\r\\n {withInput ? (\\r\\n \\r\\n inputOverride(event, dp, onBlur)}\\r\\n onChange={event => inputOverride(event, dp, onChange)}\\r\\n invalid={Validate.isInvalid(state)}\\r\\n valid={Validate.isValid(state)}\\r\\n id={`${id}-input`}\\r\\n name={fieldName}\\r\\n value={value}\\r\\n disabled={disabled}\\r\\n required={required}\\r\\n type=\\\"number\\\"\\r\\n step={step}\\r\\n {...rest}\\r\\n />\\r\\n \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n
\\r\\n {suffix.length > 0 ?
{suffix}
: ''}\\r\\n {children}\\r\\n {showErrors ?
: ''}\\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nSlider.propTypes = {\\r\\n /**\\r\\n * Any children of the component\\r\\n */\\r\\n children: PropTypes.element,\\r\\n /**\\r\\n * Date description text\\r\\n */\\r\\n description: PropTypes.string,\\r\\n /**\\r\\n * Input disabled or not\\r\\n */\\r\\n disabled: PropTypes.bool,\\r\\n /**\\r\\n * decimal places\\r\\n */\\r\\n dp: PropTypes.number,\\r\\n /**\\r\\n * Input field names\\r\\n */\\r\\n field: PropTypes.oneOfType([PropTypes.string, PropTypes.array]).isRequired,\\r\\n /**\\r\\n * Style class name for group\\r\\n */\\r\\n groupClassName: PropTypes.string,\\r\\n /**\\r\\n * Slider ID\\r\\n */\\r\\n id: PropTypes.string.isRequired,\\r\\n /**\\r\\n * Style class name for input\\r\\n */\\r\\n inputClassName: PropTypes.string,\\r\\n /**\\r\\n * Label text\\r\\n */\\r\\n label: PropTypes.string,\\r\\n /**\\r\\n * Style class name for label\\r\\n */\\r\\n labelClassName: PropTypes.string,\\r\\n /**\\r\\n * onBlur function\\r\\n */\\r\\n onBlur: PropTypes.func.isRequired,\\r\\n /**\\r\\n * onChange function\\r\\n */\\r\\n onChange: PropTypes.func.isRequired,\\r\\n /**\\r\\n * Input required or not\\r\\n */\\r\\n required: PropTypes.bool,\\r\\n /**\\r\\n * Show errors or not\\r\\n */\\r\\n showErrors: PropTypes.bool,\\r\\n /**\\r\\n * Sub label text\\r\\n */\\r\\n subLabel: PropTypes.string,\\r\\n /**\\r\\n * Suffix text\\r\\n */\\r\\n suffix: PropTypes.string,\\r\\n /**\\r\\n * Input validation\\r\\n */\\r\\n validation: PropTypes.object,\\r\\n withInput: PropTypes.any,\\r\\n};\\r\\n\\r\\nexport default Slider;\\r\\n\",\"examples\":[]},{\"name\":\"Text.js\",\"description\":\"\",\"props\":{\"children\":{\"type\":{\"name\":\"element\"},\"required\":false,\"description\":\"Any children of the component\"},\"description\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Text description text\"},\"disabled\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"Text input disabled or not\"},\"field\":{\"type\":{\"name\":\"union\",\"value\":[{\"name\":\"string\"},{\"name\":\"array\"}]},\"required\":true,\"description\":\"Input field names\"},\"groupClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Style class name for group\"},\"id\":{\"type\":{\"name\":\"string\"},\"required\":true,\"description\":\"Date ID\"},\"inputGroupClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Style class name for input group\"},\"inputPrefix\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"A prefix for the input\"},\"inputSuffix\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"A suffix for the input\"},\"label\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Label text\"},\"labelClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Style class name for label\"},\"maxLength\":{\"type\":{\"name\":\"any\"},\"required\":false,\"description\":\"Maximum character limit\"},\"required\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"Input required or not\"},\"showErrors\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"Show errors or not\"},\"subLabel\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Sub label text\"},\"suffix\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Suffix text\"},\"validation\":{\"type\":{\"name\":\"object\"},\"required\":false,\"description\":\"Input validation\"}},\"code\":\"import React from 'react';\\r\\nimport PropTypes from 'prop-types';\\r\\nimport {\\r\\n Input,\\r\\n Label,\\r\\n InputGroup,\\r\\n InputGroupAddon,\\r\\n InputGroupText,\\r\\n} from 'reactstrap';\\r\\nimport Errors, { HasErrors } from './Errors';\\r\\nimport { Validate } from '@myie/interact';\\r\\n\\r\\nclass Text extends React.Component {\\r\\n attachAddons(input, inputPrefix, inputSuffix, inputGroupClassName, id) {\\r\\n const items = [];\\r\\n if (inputPrefix || inputSuffix) {\\r\\n if (inputPrefix) {\\r\\n items.push(\\r\\n \\r\\n \\r\\n {inputPrefix}\\r\\n \\r\\n ,\\r\\n );\\r\\n }\\r\\n items.push(input);\\r\\n if (inputSuffix) {\\r\\n items.push(\\r\\n \\r\\n \\r\\n {inputSuffix}\\r\\n \\r\\n ,\\r\\n );\\r\\n }\\r\\n return {items} ;\\r\\n }\\r\\n return input;\\r\\n }\\r\\n\\r\\n render() {\\r\\n const { props } = this;\\r\\n\\r\\n const {\\r\\n inputPrefix,\\r\\n inputSuffix,\\r\\n children,\\r\\n validation = {},\\r\\n disabled,\\r\\n required,\\r\\n labelClassName = '',\\r\\n groupClassName = '',\\r\\n inputGroupClassName,\\r\\n showErrors = true,\\r\\n id,\\r\\n field,\\r\\n label,\\r\\n subLabel = '',\\r\\n description = '',\\r\\n suffix = '',\\r\\n ...rest\\r\\n } = props;\\r\\n const { value = '', state = {} } = validation;\\r\\n var fieldName =\\r\\n typeof field === 'string' ? field : `${field[0]}[${field[1]}]`;\\r\\n return (\\r\\n \\r\\n {label || subLabel || description ? (\\r\\n
\\r\\n {label} {subLabel.length > 0 ? {subLabel} : ''}\\r\\n {description.length > 0 ? (\\r\\n {description} \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n {this.attachAddons(\\r\\n
,\\r\\n inputPrefix,\\r\\n inputSuffix,\\r\\n inputGroupClassName,\\r\\n id,\\r\\n )}\\r\\n\\r\\n {suffix.length > 0 ?
{suffix}
: ''}\\r\\n {children}\\r\\n {showErrors ?
: ''}\\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nText.propTypes = {\\r\\n /**\\r\\n * Any children of the component\\r\\n */\\r\\n children: PropTypes.element,\\r\\n /**\\r\\n * Text description text\\r\\n */\\r\\n description: PropTypes.string,\\r\\n /**\\r\\n * Text input disabled or not\\r\\n */\\r\\n disabled: PropTypes.bool,\\r\\n /**\\r\\n * Input field names\\r\\n */\\r\\n field: PropTypes.oneOfType([PropTypes.string, PropTypes.array]).isRequired,\\r\\n /**\\r\\n * Style class name for group\\r\\n */\\r\\n groupClassName: PropTypes.string,\\r\\n /**\\r\\n * Date ID\\r\\n */\\r\\n id: PropTypes.string.isRequired,\\r\\n /**\\r\\n * Style class name for input group\\r\\n */\\r\\n inputGroupClassName: PropTypes.string,\\r\\n /**\\r\\n * A prefix for the input\\r\\n */\\r\\n inputPrefix: PropTypes.string,\\r\\n /**\\r\\n * A suffix for the input\\r\\n */\\r\\n inputSuffix: PropTypes.string,\\r\\n /**\\r\\n * Label text\\r\\n */\\r\\n label: PropTypes.string,\\r\\n /**\\r\\n * Style class name for label\\r\\n */\\r\\n labelClassName: PropTypes.string,\\r\\n /**\\r\\n * Maximum character limit\\r\\n */\\r\\n maxLength: PropTypes.any,\\r\\n /**\\r\\n * Input required or not\\r\\n */\\r\\n required: PropTypes.bool,\\r\\n /**\\r\\n * Show errors or not\\r\\n */\\r\\n showErrors: PropTypes.bool,\\r\\n /**\\r\\n * Sub label text\\r\\n */\\r\\n subLabel: PropTypes.string,\\r\\n /**\\r\\n * Suffix text\\r\\n */\\r\\n suffix: PropTypes.string,\\r\\n /**\\r\\n * Input validation\\r\\n */\\r\\n validation: PropTypes.object,\\r\\n};\\r\\n\\r\\nexport default Text;\\r\\n\",\"examples\":[{\"name\":\"TextExample\",\"description\":\"Text example 1\",\"code\":\"import React from 'react';\\r\\nimport { Text } from '@myie/interact-dom';\\r\\nimport { FormGroup, Row, Col } from 'reactstrap';\\r\\n\\r\\n/** Text example 1 */\\r\\nclass TextExample extends React.Component {\\r\\n constructor(props) {\\r\\n super(props);\\r\\n this.state = {\\r\\n value: '',\\r\\n };\\r\\n }\\r\\n\\r\\n onChange = e => {\\r\\n const { value } = e.target;\\r\\n this.setState({ value });\\r\\n };\\r\\n\\r\\n render() {\\r\\n return (\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nexport default TextExample;\\r\\n\"},{\"name\":\"Textsample\",\"description\":\"Text example 2\",\"code\":\"import React from 'react';\\r\\nimport { Text } from '@myie/interact-dom';\\r\\nimport { FormGroup, Row, Col } from 'reactstrap';\\r\\n\\r\\n/** Text example 2 */\\r\\nclass Textsample extends React.Component {\\r\\n constructor(props) {\\r\\n super(props);\\r\\n this.state = {\\r\\n value: '',\\r\\n };\\r\\n }\\r\\n\\r\\n onChange = e => {\\r\\n const { value } = e.target;\\r\\n this.setState({ value });\\r\\n };\\r\\n\\r\\n render() {\\r\\n return (\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nexport default Textsample;\\r\\n\"}]},{\"name\":\"TextArea.js\",\"description\":\"TextArea component\\r\\nwill display a text area\",\"props\":{\"children\":{\"type\":{\"name\":\"element\"},\"required\":false,\"description\":\"Any children of the component\"},\"description\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"TextArea description text\"},\"disabled\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"TextArea disabled or not\"},\"field\":{\"type\":{\"name\":\"union\",\"value\":[{\"name\":\"string\"},{\"name\":\"array\"}]},\"required\":true,\"description\":\"Input field names\"},\"groupClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Style class name for group\"},\"id\":{\"type\":{\"name\":\"string\"},\"required\":true,\"description\":\"TextArea ID\"},\"label\":{\"type\":{\"name\":\"string\"},\"required\":true,\"description\":\"Label text\"},\"labelClassName\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Style class name for label\"},\"required\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"TextArea required or not\"},\"showErrors\":{\"type\":{\"name\":\"bool\"},\"required\":false,\"description\":\"Show errors or not\"},\"subLabel\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Sub label text\"},\"suffix\":{\"type\":{\"name\":\"string\"},\"required\":false,\"description\":\"Suffix text\"},\"validation\":{\"type\":{\"name\":\"object\"},\"required\":false,\"description\":\"Input validation\"}},\"code\":\"import React from 'react';\\r\\nimport PropTypes from 'prop-types';\\r\\nimport { Input, Label } from 'reactstrap';\\r\\nimport Errors, { HasErrors } from './Errors';\\r\\nimport { Validate } from '@myie/interact';\\r\\n\\r\\n/**\\r\\n * TextArea component\\r\\n * will display a text area\\r\\n */\\r\\nclass TextArea extends React.Component {\\r\\n render() {\\r\\n const { props } = this;\\r\\n\\r\\n const {\\r\\n children,\\r\\n validation = {},\\r\\n labelClassName = '',\\r\\n groupClassName = '',\\r\\n showErrors = true,\\r\\n id,\\r\\n field,\\r\\n label,\\r\\n subLabel = '',\\r\\n description = '',\\r\\n disabled,\\r\\n required,\\r\\n suffix = '',\\r\\n ...rest\\r\\n } = props;\\r\\n const { value = '', state = {} } = validation;\\r\\n var fieldName =\\r\\n typeof field === 'string' ? field : `${field[0]}[${field[1]}]`;\\r\\n return (\\r\\n \\r\\n {label || subLabel || description ? (\\r\\n
\\r\\n {label} {subLabel.length > 0 ? {subLabel} : ''}\\r\\n {description.length > 0 ? (\\r\\n {description} \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n \\r\\n ) : (\\r\\n ''\\r\\n )}\\r\\n
\\r\\n {suffix.length > 0 ?
{suffix}
: ''}\\r\\n {children}\\r\\n {showErrors ?
: ''}\\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nTextArea.propTypes = {\\r\\n /**\\r\\n * Any children of the component\\r\\n */\\r\\n children: PropTypes.element,\\r\\n /**\\r\\n * TextArea description text\\r\\n */\\r\\n description: PropTypes.string,\\r\\n /**\\r\\n * TextArea disabled or not\\r\\n */\\r\\n disabled: PropTypes.bool,\\r\\n /**\\r\\n * Input field names\\r\\n */\\r\\n field: PropTypes.oneOfType([PropTypes.string, PropTypes.array]).isRequired,\\r\\n /**\\r\\n * Style class name for group\\r\\n */\\r\\n groupClassName: PropTypes.string,\\r\\n /**\\r\\n * TextArea ID\\r\\n */\\r\\n id: PropTypes.string.isRequired,\\r\\n /**\\r\\n * Label text\\r\\n */\\r\\n label: PropTypes.string.isRequired,\\r\\n /**\\r\\n * Style class name for label\\r\\n */\\r\\n labelClassName: PropTypes.string,\\r\\n /**\\r\\n * TextArea required or not\\r\\n */\\r\\n required: PropTypes.bool,\\r\\n /**\\r\\n * Show errors or not\\r\\n */\\r\\n showErrors: PropTypes.bool,\\r\\n /**\\r\\n * Sub label text\\r\\n */\\r\\n subLabel: PropTypes.string,\\r\\n /**\\r\\n * Suffix text\\r\\n */\\r\\n suffix: PropTypes.string,\\r\\n /**\\r\\n * Input validation\\r\\n */\\r\\n validation: PropTypes.object,\\r\\n};\\r\\n\\r\\nexport default TextArea;\\r\\n\",\"examples\":[{\"name\":\"TextAreaExample\",\"description\":\"Text Area Example\",\"code\":\"import React from 'react';\\r\\nimport { TextArea } from '@myie/interact-dom';\\r\\nimport { FormGroup, Row, Col } from 'reactstrap';\\r\\n\\r\\n/** Text Area Example */\\r\\nclass TextAreaExample extends React.Component {\\r\\n constructor(props) {\\r\\n super(props);\\r\\n this.state = {\\r\\n value: '',\\r\\n };\\r\\n }\\r\\n\\r\\n onChange = e => {\\r\\n const { value } = e.target;\\r\\n this.setState({ value });\\r\\n };\\r\\n\\r\\n render() {\\r\\n return (\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\nexport default TextAreaExample;\\r\\n\"}]},{\"name\":\"Value.js\",\"description\":\"Value component\\r\\nwill display given values\",\"props\":{\"value\":{\"type\":{\"name\":\"union\",\"value\":[{\"name\":\"string\"},{\"name\":\"number\"}]},\"required\":false,\"description\":\"Value to display\"}},\"code\":\"import React from 'react';\\r\\nimport PropTypes from 'prop-types';\\r\\n\\r\\n/**\\r\\n * Value component\\r\\n * will display given values\\r\\n */\\r\\nclass Value extends React.Component {\\r\\n render() {\\r\\n const { props } = this;\\r\\n\\r\\n const { value, ...rest } = props;\\r\\n if (rest && Object.keys(rest).length) {\\r\\n return {value} ;\\r\\n }\\r\\n return <>{value}>;\\r\\n }\\r\\n}\\r\\n\\r\\nValue.propTypes = {\\r\\n /**\\r\\n * Value to display\\r\\n */\\r\\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\\r\\n};\\r\\n\\r\\nexport default Value;\\r\\n\",\"examples\":[]}]","import {\n FORGOTTEN_UN_REQUEST,\n FORGOTTEN_UN_SUCCESS,\n FORGOTTEN_UN_FAILURE,\n RESET_FORGOTTEN_UN,\n} from '../actions/forgottenUserNameTypes';\n\nconst forgottenUserNameDefinition = (state = {}, action) => {\n switch (action.type) {\n case RESET_FORGOTTEN_UN:\n return {\n ...state,\n retrivedUserName: {},\n };\n case FORGOTTEN_UN_SUCCESS:\n return {\n ...state,\n retrivedUserName: action.forgottenUN,\n isFetching: action.isFetching,\n };\n case FORGOTTEN_UN_REQUEST:\n case FORGOTTEN_UN_FAILURE:\n return {\n ...state,\n isFetching: action.isFetching,\n error: action.error,\n };\n default:\n return state;\n }\n};\n\nexport default forgottenUserNameDefinition;\n","export const RESET_FORGOTTEN_UN = 'RESET_FORGOTTEN_UN';\n\nexport const FORGOTTEN_UN_REQUEST = 'FORGOTTEN_UN_REQUEST';\nexport const FORGOTTEN_UN_SUCCESS = 'FORGOTTEN_UN_SUCCESS';\nexport const FORGOTTEN_UN_FAILURE = 'FORGOTTEN_UN_FAILURE';\n","import {\n SET_CREDENTIALS_REQUEST,\n SET_CREDENTIALS_SUCCESS,\n SET_CREDENTIALS_FAILURE,\n} from '../actions/registrationTypes';\nimport {\n REGISTER_REQUEST,\n REGISTER_SUCCESS,\n REGISTER_FAILURE,\n} from '../actions/registrationTypes';\nimport { RESET_REGISTRATION } from '../actions/registrationTypes';\n\nconst registrationDefinition = (state = {}, action) => {\n switch (action.type) {\n case RESET_REGISTRATION:\n return {\n ...state,\n registration: {},\n credentialsSetup: {},\n };\n case REGISTER_SUCCESS:\n return {\n ...state,\n registration: action.registration,\n isFetching: action.isFetching,\n };\n case SET_CREDENTIALS_SUCCESS:\n return {\n ...state,\n credentialsSetup: action.credentialsSetup,\n isFetching: action.isFetching,\n };\n case SET_CREDENTIALS_REQUEST:\n case SET_CREDENTIALS_FAILURE:\n case REGISTER_REQUEST:\n case REGISTER_FAILURE:\n return {\n ...state,\n isFetching: action.isFetching,\n error: action.error,\n };\n default:\n return state;\n }\n};\n\nexport default registrationDefinition;\n","export const RESET_REGISTRATION = 'RESET_REGISTRATION';\n\nexport const SET_CREDENTIALS_REQUEST = 'SET_CREDENTIALS_REQUEST';\nexport const SET_CREDENTIALS_SUCCESS = 'SET_CREDENTIALS_SUCCESS';\nexport const SET_CREDENTIALS_FAILURE = 'SET_CREDENTIALS_FAILURE';\n\nexport const REGISTER_REQUEST = 'REGISTER_REQUEST';\nexport const REGISTER_SUCCESS = 'REGISTER_SUCCESS';\nexport const REGISTER_FAILURE = 'REGISTER_FAILURE';\n","import {\n CREATE_LOGIN_REQUEST,\n CREATE_LOGIN_SUCCESS,\n CREATE_LOGIN_FAILURE,\n} from '../actions/loginTypes';\nimport {\n UPDATE_LOGIN_REQUEST,\n UPDATE_LOGIN_SUCCESS,\n UPDATE_LOGIN_FAILURE,\n} from '../actions/loginTypes';\nimport { SET_LOGIN_REFERRER, RESET_LOGIN } from '../actions/loginTypes';\nimport update from 'immutability-helper';\n\nconst loginDefinition = (state = {}, action) => {\n switch (action.type) {\n case SET_LOGIN_REFERRER:\n return {\n ...state,\n referrer: action.referrer,\n login: null,\n };\n case RESET_LOGIN:\n return {\n ...state,\n login: null,\n };\n case UPDATE_LOGIN_SUCCESS: {\n const oldLogin = state.login;\n let newLogin = action.login;\n if (newLogin.Status === 'RequireActivation') {\n newLogin = update(oldLogin, {\n Status: { $set: newLogin.Status },\n RequireActivationTicket: { $set: newLogin.RequireActivationTicket },\n });\n } else {\n if (newLogin.Status !== 'Success' && newLogin.Status !== 'Incomplete') {\n if (oldLogin.statusCount) {\n if (newLogin.Status === oldLogin.Status) {\n newLogin = update(oldLogin, {\n statusCount: { $set: oldLogin.statusCount + 1 },\n Status: { $set: newLogin.Status },\n });\n } else {\n newLogin = update(oldLogin, {\n $merge: { statusCount: 1 },\n Status: { $set: newLogin.Status },\n });\n }\n } else {\n newLogin = update(oldLogin, {\n $merge: { statusCount: 1 },\n Status: { $set: newLogin.Status },\n });\n }\n }\n }\n return {\n ...state,\n login: newLogin,\n isFetching: action.isFetching,\n };\n }\n case CREATE_LOGIN_SUCCESS:\n return {\n ...state,\n login: action.login,\n isFetching: action.isFetching,\n };\n case CREATE_LOGIN_REQUEST:\n case CREATE_LOGIN_FAILURE:\n case UPDATE_LOGIN_REQUEST:\n case UPDATE_LOGIN_FAILURE:\n return {\n ...state,\n isFetching: action.isFetching,\n error: action.error,\n };\n default:\n return state;\n }\n};\n\nexport default loginDefinition;\n","export const SET_LOGIN_REFERRER = 'SET_LOGIN_REFERRER';\nexport const RESET_LOGIN = 'RESET_LOGIN';\n\nexport const CREATE_LOGIN_REQUEST = 'CREATE_LOGIN_REQUEST';\nexport const CREATE_LOGIN_SUCCESS = 'CREATE_LOGIN_SUCCESS';\nexport const CREATE_LOGIN_FAILURE = 'CREATE_LOGIN_FAILURE';\n\nexport const UPDATE_LOGIN_REQUEST = 'UPDATE_LOGIN_REQUEST';\nexport const UPDATE_LOGIN_SUCCESS = 'UPDATE_LOGIN_SUCCESS';\nexport const UPDATE_LOGIN_FAILURE = 'UPDATE_LOGIN_FAILURE';\n","import {\n UPDATE_FORGOTTEN_REQUEST,\n UPDATE_FORGOTTEN_SUCCESS,\n UPDATE_FORGOTTEN_FAILURE,\n} from '../actions/forgottenPasswordTypes';\nimport {\n FORGOTTEN_PW_REQUEST,\n FORGOTTEN_PW_SUCCESS,\n FORGOTTEN_PW_FAILURE,\n} from '../actions/forgottenPasswordTypes';\nimport { RESET_FORGOTTEN_PW } from '../actions/forgottenPasswordTypes';\n\nconst forgottenPasswordDefinition = (state = {}, action) => {\n switch (action.type) {\n case RESET_FORGOTTEN_PW:\n return {\n ...state,\n forgottenPasswordDetails: {},\n updateForgottenDetails: {},\n };\n case FORGOTTEN_PW_SUCCESS:\n return {\n ...state,\n forgottenPasswordDetails: action.forgottenPassword,\n isFetching: action.isFetching,\n };\n case UPDATE_FORGOTTEN_SUCCESS:\n return {\n ...state,\n updateForgottenDetails: action.updateForgotten,\n isFetching: action.isFetching,\n };\n case UPDATE_FORGOTTEN_REQUEST:\n case UPDATE_FORGOTTEN_FAILURE:\n case FORGOTTEN_PW_REQUEST:\n case FORGOTTEN_PW_FAILURE:\n return {\n ...state,\n isFetching: action.isFetching,\n error: action.error,\n };\n default:\n return state;\n }\n};\n\nexport default forgottenPasswordDefinition;\n","export const UPDATE_FORGOTTEN_REQUEST = 'UPDATE_FORGOTTEN_REQUEST';\n\nexport const UPDATE_FORGOTTEN_FAILURE = 'UPDATE_FORGOTTEN_FAILURE';\nexport const UPDATE_FORGOTTEN_SUCCESS = 'UPDATE_FORGOTTEN_SUCCESS';\nexport const FORGOTTEN_PW_REQUEST = 'FORGOTTEN_PW_REQUEST';\nexport const FORGOTTEN_PW_FAILURE = 'FORGOTTEN_PW_FAILURE';\nexport const FORGOTTEN_PW_SUCCESS = 'FORGOTTEN_PW_SUCCESS';\nexport const RESET_FORGOTTEN_PW = 'RESET_FORGOTTEN_PW';\n","import {\n UPDATE_SECURITY_DETAILS_REQUEST,\n UPDATE_SECURITY_DETAILS_SUCCESS,\n UPDATE_SECURITY_DETAILS_FAILURE,\n RESET_UPDATE_SECURITY_DETAILS,\n} from '../actions/updateSecurityDetailsTypes';\n\nconst updateSecurityDetailsDefinition = (state = {}, action) => {\n switch (action.type) {\n case RESET_UPDATE_SECURITY_DETAILS:\n return {\n ...state,\n updateSecurityDetails: {},\n };\n case UPDATE_SECURITY_DETAILS_SUCCESS:\n return {\n ...state,\n updateSecurityDetails: action.updateSecurityDetails,\n isFetching: action.isFetching,\n };\n case UPDATE_SECURITY_DETAILS_REQUEST:\n case UPDATE_SECURITY_DETAILS_FAILURE:\n return {\n ...state,\n isFetching: action.isFetching,\n error: action.error,\n };\n default:\n return state;\n }\n};\n\nexport default updateSecurityDetailsDefinition;\n","export const RESET_UPDATE_SECURITY_DETAILS = 'RESET_UPDATE_SECURITY_DETAILS';\n\nexport const UPDATE_SECURITY_DETAILS_REQUEST =\n 'UPDATE_SECURITY_DETAILS_REQUEST';\nexport const UPDATE_SECURITY_DETAILS_SUCCESS =\n 'UPDATE_SECURITY_DETAILS_SUCCESS';\nexport const UPDATE_SECURITY_DETAILS_FAILURE =\n 'UPDATE_SECURITY_DETAILS_FAILURE';\n","import forgottenUserNameDefinition from './reducers/forgottenUserNameDefinition';\nimport registrationDefinition from './reducers/registrationDefinition';\nimport loginDefinition from './reducers/loginDefinition';\nimport forgottenPasswordDefinition from './reducers/forgottenPasswordDefinition';\nimport updateSecurityDetailsDefinition from './reducers/updateSecurityDetailsDefinition';\n\nconst authenticationDefinition = (state = {}, action) => {\n var newState = state;\n newState = forgottenUserNameDefinition(newState, action);\n newState = registrationDefinition(newState, action);\n newState = loginDefinition(newState, action);\n newState = forgottenPasswordDefinition(newState, action);\n newState = updateSecurityDetailsDefinition(newState, action);\n return newState;\n};\n\nexport default authenticationDefinition;\n","const mapStateToProps = state => {\n const { authenticationDefinition = {} } = state;\n const {\n login,\n credentialsSetup,\n registration,\n retrivedUserName,\n forgottenPasswordDetails,\n updateSecurityDetails,\n updateForgottenDetails,\n referrer,\n isFetching,\n error = null,\n } = authenticationDefinition;\n return {\n login,\n credentialsSetup,\n registration,\n referrer,\n isFetching,\n retrivedUserName,\n forgottenPasswordDetails,\n updateSecurityDetails,\n updateForgottenDetails,\n error,\n };\n};\n\nexport default mapStateToProps;\n","import { Connection, Settings } from '@myie/interact';\nimport {\n CREATE_LOGIN_REQUEST,\n CREATE_LOGIN_SUCCESS,\n CREATE_LOGIN_FAILURE,\n} from './loginTypes';\nimport {\n UPDATE_LOGIN_REQUEST,\n UPDATE_LOGIN_SUCCESS,\n UPDATE_LOGIN_FAILURE,\n} from './loginTypes';\nimport { SET_LOGIN_REFERRER, RESET_LOGIN } from './loginTypes';\n\nexport const resetLogin = () => ({\n type: RESET_LOGIN,\n});\n\nexport const setReferrer = (\n referrer = Settings.loggedInPage || { pathname: '/accounts' },\n) => ({\n type: SET_LOGIN_REFERRER,\n referrer: referrer,\n});\n\nexport const createLoginRequest = () => ({\n type: CREATE_LOGIN_REQUEST,\n isFetching: true,\n error: null,\n});\n\nexport const createLoginFailed = error => ({\n type: CREATE_LOGIN_FAILURE,\n isFetching: false,\n error: error.message,\n});\n\nexport const createLoginReceive = json => ({\n type: CREATE_LOGIN_SUCCESS,\n login: json,\n isFetching: false,\n error: null,\n});\n\nexport const updateLoginRequest = () => ({\n type: UPDATE_LOGIN_REQUEST,\n isFetching: true,\n error: null,\n});\n\nexport const updateLoginFailed = error => ({\n type: UPDATE_LOGIN_FAILURE,\n isFetching: false,\n error: error.message,\n});\n\nexport const updateLoginReceive = json => ({\n type: UPDATE_LOGIN_SUCCESS,\n login: json,\n isFetching: false,\n error: null,\n});\n\nexport const createLogin = request => dispatch => {\n dispatch(createLoginRequest());\n return fetch(\n Connection.baseUrl('webauthentication') + `v2.0/user/sign-in/create`,\n {\n method: 'post',\n headers: Connection.headers(),\n body: JSON.stringify(request),\n },\n )\n .then(response => Connection.errored(response))\n .then(response => response.json())\n .then(json => dispatch(createLoginReceive(json)))\n .catch(error => dispatch(createLoginFailed(error)));\n};\n\nexport const updateLogin = request => dispatch => {\n dispatch(updateLoginRequest());\n return fetch(\n Connection.baseUrl('webauthentication') + `v2.0/user/sign-in/update`,\n {\n method: 'post',\n headers: Connection.headers(),\n body: JSON.stringify(request),\n },\n )\n .then(response => Connection.errored(response))\n .then(response => response.json())\n .then(json => dispatch(updateLoginReceive(json)))\n .catch(error => dispatch(updateLoginFailed(error)));\n};\n","import { Connection } from '@myie/interact';\n\nimport {\n SET_CREDENTIALS_REQUEST,\n SET_CREDENTIALS_SUCCESS,\n SET_CREDENTIALS_FAILURE,\n} from './registrationTypes';\nimport {\n REGISTER_REQUEST,\n REGISTER_SUCCESS,\n REGISTER_FAILURE,\n} from './registrationTypes';\nimport { RESET_REGISTRATION } from './registrationTypes';\n\nexport const resetRegistration = () => ({\n type: RESET_REGISTRATION,\n});\n\nexport const setCredentialsRequest = () => ({\n type: SET_CREDENTIALS_REQUEST,\n isFetching: true,\n error: null,\n});\n\nexport const setCredentialsFailed = error => ({\n type: SET_CREDENTIALS_FAILURE,\n isFetching: false,\n error: error.message,\n});\n\nexport const setCredentialsReceive = json => ({\n type: SET_CREDENTIALS_SUCCESS,\n credentialsSetup: json,\n isFetching: false,\n error: null,\n});\n\nexport const registerRequest = () => ({\n type: REGISTER_REQUEST,\n isFetching: true,\n error: null,\n});\n\nexport const registerFailed = error => ({\n type: REGISTER_FAILURE,\n isFetching: false,\n error: error.message,\n});\n\nexport const registerReceive = json => ({\n type: REGISTER_SUCCESS,\n registration: json,\n isFetching: false,\n error: null,\n});\n\nexport const setCredentials = request => dispatch => {\n dispatch(setCredentialsRequest());\n return fetch(\n Connection.baseUrl('webauthentication') + `v2.0/user/credentials/setup`,\n {\n method: 'post',\n headers: Connection.headers(),\n body: JSON.stringify(request),\n },\n )\n .then(response => Connection.errored(response))\n .then(response => response.json())\n .then(json => dispatch(setCredentialsReceive(json)))\n .catch(error => dispatch(setCredentialsFailed(error)));\n};\n\nexport const register = request => dispatch => {\n dispatch(registerRequest());\n return fetch(Connection.baseUrl('webauthentication') + `v2.0/user/register`, {\n method: 'post',\n headers: Connection.headers(),\n body: JSON.stringify(request),\n })\n .then(response => Connection.errored(response))\n .then(response => response.json())\n .then(json => dispatch(registerReceive(json)))\n .catch(error => dispatch(registerFailed(error)));\n};\n","import { Connection } from '@myie/interact';\n\nimport {\n FORGOTTEN_UN_REQUEST,\n FORGOTTEN_UN_SUCCESS,\n FORGOTTEN_UN_FAILURE,\n RESET_FORGOTTEN_UN,\n} from './forgottenUserNameTypes.js';\n\nexport const resetForgottenUN = () => ({\n type: RESET_FORGOTTEN_UN,\n});\n\nexport const forgottenUNRequest = () => ({\n type: FORGOTTEN_UN_REQUEST,\n isFetching: true,\n error: null,\n});\n\nexport const forgottenUNFailed = error => ({\n type: FORGOTTEN_UN_FAILURE,\n isFetching: false,\n error: error.message,\n});\n\nexport const forgottenUNReceive = json => ({\n type: FORGOTTEN_UN_SUCCESS,\n forgottenUN: json,\n isFetching: false,\n error: null,\n});\n\nexport const retrieveUserName = request => dispatch => {\n dispatch(forgottenUNRequest());\n return fetch(\n Connection.baseUrl('webauthentication') +\n `v2.0/user/credentials/forgotten-username`,\n {\n method: 'post',\n headers: Connection.headers(),\n body: JSON.stringify(request),\n },\n )\n .then(response => Connection.errored(response))\n .then(response => response.json())\n .then(json => dispatch(forgottenUNReceive(json)))\n .catch(error => dispatch(forgottenUNFailed(error)));\n};\n","import { Connection } from '@myie/interact';\n\nimport {\n UPDATE_FORGOTTEN_REQUEST,\n UPDATE_FORGOTTEN_SUCCESS,\n UPDATE_FORGOTTEN_FAILURE,\n} from './forgottenPasswordTypes';\nimport {\n FORGOTTEN_PW_REQUEST,\n FORGOTTEN_PW_SUCCESS,\n FORGOTTEN_PW_FAILURE,\n} from './forgottenPasswordTypes';\nimport { RESET_FORGOTTEN_PW } from './forgottenPasswordTypes';\n\nexport const resetForgottenPassword = () => ({\n type: RESET_FORGOTTEN_PW,\n});\n\nexport const updateForgottenRequest = () => ({\n type: UPDATE_FORGOTTEN_REQUEST,\n isFetching: true,\n error: null,\n});\n\nexport const updateForgottenReceiveFailed = error => ({\n type: UPDATE_FORGOTTEN_FAILURE,\n isFetching: false,\n error: error.message,\n});\n\nexport const updateForgottenReceive = json => ({\n type: UPDATE_FORGOTTEN_SUCCESS,\n updateForgotten: json,\n isFetching: false,\n error: null,\n});\n\nexport const forgottenPasswordRequest = () => ({\n type: FORGOTTEN_PW_REQUEST,\n isFetching: true,\n error: null,\n});\n\nexport const forgottenPasswordFailed = error => ({\n type: FORGOTTEN_PW_FAILURE,\n isFetching: false,\n error: error.message,\n});\n\nexport const forgottenPasswordReceive = json => ({\n type: FORGOTTEN_PW_SUCCESS,\n forgottenPassword: json,\n isFetching: false,\n error: null,\n});\n\nexport const updateForgotten = credentials => dispatch => {\n dispatch(updateForgottenRequest());\n return fetch(\n Connection.baseUrl('webauthentication') +\n `v2.0/user/credentials/update-forgotten`,\n {\n method: 'post',\n headers: Connection.headers(),\n body: JSON.stringify(credentials),\n },\n )\n .then(response => Connection.errored(response))\n .then(response => response.json())\n .then(json => dispatch(updateForgottenReceive(json)))\n .catch(error => dispatch(updateForgottenReceiveFailed(error)));\n};\n\nexport const resetForgotten = request => dispatch => {\n dispatch(forgottenPasswordRequest());\n return fetch(\n Connection.baseUrl('webauthentication') +\n `v2.0/user/credentials/reset-forgotten`,\n {\n method: 'post',\n headers: Connection.headers(),\n body: JSON.stringify(request),\n },\n )\n .then(response => Connection.errored(response))\n .then(response => response.json())\n .then(json => dispatch(forgottenPasswordReceive(json)))\n .catch(error => dispatch(forgottenPasswordFailed(error)));\n};\n","import { Connection, TwoFactor } from '@myie/interact';\n\nimport {\n UPDATE_SECURITY_DETAILS_REQUEST,\n UPDATE_SECURITY_DETAILS_SUCCESS,\n UPDATE_SECURITY_DETAILS_FAILURE,\n RESET_UPDATE_SECURITY_DETAILS,\n} from './updateSecurityDetailsTypes.js';\n\nexport const resetUpdateSecurityDetails = () => ({\n type: RESET_UPDATE_SECURITY_DETAILS,\n});\n\nexport const updateSecurityDetailsRequest = () => ({\n type: UPDATE_SECURITY_DETAILS_REQUEST,\n isFetching: true,\n error: null,\n});\n\nexport const updateSecurityDetailsFailed = error => ({\n type: UPDATE_SECURITY_DETAILS_FAILURE,\n isFetching: false,\n error: error.message,\n});\n\nexport const updateSecurityDetailsReceive = json => ({\n type: UPDATE_SECURITY_DETAILS_SUCCESS,\n updateSecurityDetails: json,\n isFetching: false,\n error: null,\n});\n\nexport const updateCredentials = request => dispatch => {\n return TwoFactor.run(() => {\n dispatch(updateSecurityDetailsRequest());\n return fetch(\n Connection.baseUrl('webauthentication') + `v2.0/user/credentials/change`,\n {\n method: 'post',\n headers: Connection.headers(),\n body: JSON.stringify(request),\n },\n )\n .then(response => Connection.errored(response))\n .then(response => response.json())\n .then(json => dispatch(updateSecurityDetailsReceive(json)))\n .catch(error => dispatch(updateSecurityDetailsFailed(error)));\n });\n};\n","import * as loginActions from './actions/loginActions';\nimport * as registrationActions from './actions/registrationActions';\nimport * as forgottenUserNameActions from './actions/forgottenUserNameActions';\nimport * as forgottenPasswordActions from './actions/forgottenPasswordActions';\nimport * as updateSecurityDetailsActions from './actions/updateSecurityDetailsActions';\n\nconst mapDispatchToProps = {\n ...loginActions,\n ...registrationActions,\n ...forgottenUserNameActions,\n ...forgottenPasswordActions,\n ...updateSecurityDetailsActions,\n};\n\nexport default mapDispatchToProps;\n","import authenticationDefinition from './reducer';\nimport mapStateToProps from './mapStateToProps';\nimport mapDispatchToProps from './mapDispatchToProps';\n\nexport { authenticationDefinition, mapStateToProps, mapDispatchToProps };\n","import {\n CANCEL_NOTICE_TO_WITHDRAWAL_FAILURE,\n CANCEL_NOTICE_TO_WITHDRAWAL_REQUEST,\n CANCEL_NOTICE_TO_WITHDRAWAL_SUCCESS,\n RESET_CANCEL_NOTICE_TO_WITHDRAWAL,\n SET_CREATE_NOTICE_TO_WITHDRAWAL_PARAMS,\n RESET_CREATE_NOTICE_TO_WITHDRAWAL,\n SET_MAKE_A_WITHDRAW_PARAM,\n MAKE_A_WITHDRAW_SUCCESS,\n MAKE_A_WITHDRAW_FALIURE,\n MAKE_A_WITHDRAW_REQUEST,\n RESET_MAKE_A_WITHDRAW,\n BANK_HOLIDAYS,\n} from '../actions/withdrawalTypes';\n\nconst ccbWithdrawalDefinition = (state = {}, action) => {\n switch (action.type) {\n case CANCEL_NOTICE_TO_WITHDRAWAL_REQUEST:\n case MAKE_A_WITHDRAW_REQUEST:\n return {\n ...state,\n isFetching: action.isFetching,\n };\n case BANK_HOLIDAYS:\n return {\n ...state,\n holidays: action.holidays,\n isFetching: action.isFetching,\n };\n case CANCEL_NOTICE_TO_WITHDRAWAL_SUCCESS:\n return {\n ...state,\n cancellationResponse: action.cancellationResponse,\n isFetching: action.isFetching,\n };\n case CANCEL_NOTICE_TO_WITHDRAWAL_FAILURE:\n return {\n ...state,\n isFetching: action.isFetching,\n error: action.error,\n };\n case RESET_CANCEL_NOTICE_TO_WITHDRAWAL:\n return {\n ...state,\n cancellationResponse: null,\n isFetching: false,\n error: null,\n };\n case SET_CREATE_NOTICE_TO_WITHDRAWAL_PARAMS:\n return {\n ...state,\n createNoticeParam: action.createNoticeParam,\n error: null,\n };\n case SET_MAKE_A_WITHDRAW_PARAM:\n return {\n ...state,\n withdrawalParam: action.withdrawalParam,\n error: null,\n };\n case RESET_CREATE_NOTICE_TO_WITHDRAWAL:\n return {\n ...state,\n createNoticeParam: null,\n createResponse: null,\n error: null,\n };\n case MAKE_A_WITHDRAW_SUCCESS: {\n return {\n ...state,\n makeWithdrawResponse: action.makeWithdrawResponse,\n isFetching: false,\n error: null,\n };\n }\n case MAKE_A_WITHDRAW_FALIURE: {\n return {\n ...state,\n makeWithdrawResponse: null,\n isFetching: false,\n error: action.error,\n };\n }\n case RESET_MAKE_A_WITHDRAW:\n return {\n ...state,\n makeWithdrawResponse: null,\n isFetching: false,\n error: null,\n };\n default:\n return state;\n }\n};\n\nexport default ccbWithdrawalDefinition;\n","export const CANCEL_NOTICE_TO_WITHDRAWAL_REQUEST =\n 'CANCEL_NOTICE_TO_WITHDRAWAL_REQUEST';\nexport const CANCEL_NOTICE_TO_WITHDRAWAL_SUCCESS =\n 'CANCEL_NOTICE_TO_WITHDRAWAL_SUCCESS';\nexport const CANCEL_NOTICE_TO_WITHDRAWAL_FAILURE =\n 'CANCEL_NOTICE_TO_WITHDRAWAL_FAILURE';\nexport const RESET_CANCEL_NOTICE_TO_WITHDRAWAL =\n 'RESET_CANCEL_NOTICE_TO_WITHDRAWAL';\n\nexport const SET_CREATE_NOTICE_TO_WITHDRAWAL_PARAMS =\n 'SET_CREATE_NOTICE_TO_WITHDRAWAL_PARAMS';\n\nexport const CREATE_NOTICE_TO_WITHDRAWAL_REQUEST =\n 'CREATE_NOTICE_TO_WITHDRAWAL_REQUEST';\nexport const CREATE_NOTICE_TO_WITHDRAWAL_SUCCESS =\n 'CREATE_NOTICE_TO_WITHDRAWAL_SUCCESS';\nexport const CREATE_NOTICE_TO_WITHDRAWAL_FAILURE =\n 'CREATE_NOTICE_TO_WITHDRAWAL_FAILURE';\nexport const RESET_CREATE_NOTICE_TO_WITHDRAWAL =\n 'RESET_CREATE_NOTICE_TO_WITHDRAWAL';\n\nexport const SET_MAKE_A_WITHDRAW_PARAM = 'SET_MAKE_A_WITHDRAW_PARAM';\nexport const MAKE_A_WITHDRAW_REQUEST = 'MAKE_A_WITHDRAW_REQUEST';\nexport const MAKE_A_WITHDRAW_SUCCESS = 'MAKE_A_WITHDRAW_SUCCESS';\nexport const MAKE_A_WITHDRAW_FALIURE = 'MAKE_A_WITHDRAW_FALIURE';\nexport const RESET_MAKE_A_WITHDRAW = 'RESET_MAKE_A_WITHDRAW';\nexport const BANK_HOLIDAYS = 'BANK_HOLIDAYS';\n","import {\n RESET_SET_SHORT_APPLY,\n SET_SHORT_APPLY_REQUEST,\n SET_SHORT_APPLY_SUCCESS,\n SET_SHORT_APPLY_FALIURE,\n RESET_SHORT_APPLY_OPTIONS,\n GET_ALL_PRODUCTS_REQUEST,\n GET_ALL_PRODUCTS_SUCCESS,\n GET_ALL_PRODUCTS_FALIURE,\n RESET_SAVE_SHORT_APPLY,\n SAVE_SHORT_APPLY_REQUEST,\n SAVE_SHORT_APPLY_SUCCESS,\n SAVE_SHORT_APPLY_FALIURE,\n} from '../actions/shortApplyTypes';\n\nconst ccbShortApplyDefinition = (state = {}, action) => {\n switch (action.type) {\n case SET_SHORT_APPLY_REQUEST:\n return {\n ...state,\n isFetching: action.isFetching,\n };\n\n case SET_SHORT_APPLY_SUCCESS:\n return {\n ...state,\n savingshortapply: action.setShortApplyResponse,\n isFetching: action.isFetching,\n };\n case SET_SHORT_APPLY_FALIURE:\n return {\n ...state,\n isFetching: action.isFetching,\n error: action.error,\n };\n case RESET_SET_SHORT_APPLY:\n return {\n ...state,\n savingshortapply: null,\n isFetching: false,\n error: null,\n };\n case GET_ALL_PRODUCTS_REQUEST:\n return {\n ...state,\n isFetching: action.isFetching,\n };\n\n case GET_ALL_PRODUCTS_SUCCESS:\n return {\n ...state,\n allProducts: action.getAllProductsResponse,\n isFetching: action.isFetching,\n };\n case GET_ALL_PRODUCTS_FALIURE:\n return {\n ...state,\n isFetching: action.isFetching,\n error: action.error,\n };\n case RESET_SHORT_APPLY_OPTIONS:\n return {\n ...state,\n allProducts: null,\n isFetching: false,\n error: null,\n };\n //\n case RESET_SAVE_SHORT_APPLY:\n return {\n ...state,\n saveShortApplyResponse: null,\n isFetching: false,\n error: null,\n };\n case SAVE_SHORT_APPLY_REQUEST:\n return {\n ...state,\n isFetching: action.isFetching,\n };\n\n case SAVE_SHORT_APPLY_SUCCESS:\n return {\n ...state,\n saveShortApplyResponse: action.saveShortApplyResponse,\n isFetching: action.isFetching,\n };\n case SAVE_SHORT_APPLY_FALIURE:\n return {\n ...state,\n isFetching: action.isFetching,\n error: action.error,\n };\n default:\n return state;\n }\n};\n\nexport default ccbShortApplyDefinition;\n","export const RESET_SET_SHORT_APPLY = 'RESET_SET_SHORT_APPLY';\nexport const SET_SHORT_APPLY_REQUEST = 'SET_SHORT_APPLY_REQUEST';\nexport const SET_SHORT_APPLY_SUCCESS = 'SET_SHORT_APPLY_SUCCESS';\nexport const SET_SHORT_APPLY_FALIURE = 'SET_SHORT_APPLY_FALIURE';\nexport const RESET_SHORT_APPLY_OPTIONS = 'RESET_SHORT_APPLY_OPTIONS';\nexport const GET_ALL_PRODUCTS_REQUEST = 'GET_ALL_PRODUCTS_REQUEST';\nexport const GET_ALL_PRODUCTS_SUCCESS = 'GET_ALL_PRODUCTS_SUCCESS';\nexport const GET_ALL_PRODUCTS_FALIURE = 'GET_ALL_PRODUCTS_FALIURE';\nexport const RESET_SAVE_SHORT_APPLY = 'RESET_SAVE_SHORT_APPLY';\nexport const SAVE_SHORT_APPLY_REQUEST = 'SAVE_SHORT_APPLY_REQUEST';\nexport const SAVE_SHORT_APPLY_SUCCESS = 'SAVE_SHORT_APPLY_SUCCESS';\nexport const SAVE_SHORT_APPLY_FALIURE = 'SAVE_SHORT_APPLY_FALIURE';\n","import ccbWithdrawalDefinition from './reducers/withdrawalDefinition';\nimport ccbShortApplyDefinition from './reducers/shortApplyDefinition';\nconst customccbSavingsServicingDefinition = (state = {}, action) => {\n var newState = state;\n newState = ccbWithdrawalDefinition(newState, action);\n newState = ccbShortApplyDefinition(newState, action);\n return newState;\n};\n\nexport default customccbSavingsServicingDefinition;\n","const mapStateToProps = state => {\n const { customccbSavingsServicingDefinition = {} } = state;\n const {\n cancellationResponse,\n createNoticeParam,\n makeWithdrawResponse,\n withdrawalParam,\n createResponse,\n isFetching,\n savingshortapply,\n saveShortApplyResponse,\n error = null,\n } = customccbSavingsServicingDefinition;\n\n return {\n cancellationResponse,\n createNoticeParam,\n withdrawalParam,\n makeWithdrawResponse,\n isFetching,\n createResponse,\n savingshortapply,\n saveShortApplyResponse,\n error,\n };\n};\n\nexport default mapStateToProps;\n","import { Connection } from '@myie/interact';\n\nimport {\n CANCEL_NOTICE_TO_WITHDRAWAL_FAILURE,\n CANCEL_NOTICE_TO_WITHDRAWAL_SUCCESS,\n CANCEL_NOTICE_TO_WITHDRAWAL_REQUEST,\n RESET_CANCEL_NOTICE_TO_WITHDRAWAL,\n SET_CREATE_NOTICE_TO_WITHDRAWAL_PARAMS,\n RESET_CREATE_NOTICE_TO_WITHDRAWAL,\n SET_MAKE_A_WITHDRAW_PARAM,\n MAKE_A_WITHDRAW_REQUEST,\n MAKE_A_WITHDRAW_SUCCESS,\n MAKE_A_WITHDRAW_FALIURE,\n RESET_MAKE_A_WITHDRAW,\n BANK_HOLIDAYS,\n} from './withdrawalTypes';\n\nexport const cancellationRequest = () => ({\n type: CANCEL_NOTICE_TO_WITHDRAWAL_REQUEST,\n isFetching: true,\n error: null,\n});\n\nexport const cancellationFailed = error => ({\n type: CANCEL_NOTICE_TO_WITHDRAWAL_FAILURE,\n isFetching: false,\n error: error.message,\n});\n\nexport const cancellationSuccess = json => ({\n type: CANCEL_NOTICE_TO_WITHDRAWAL_SUCCESS,\n cancellationResponse: json,\n isFetching: false,\n error: null,\n});\n\nexport const resetCancellation = () => ({\n type: RESET_CANCEL_NOTICE_TO_WITHDRAWAL,\n});\n\nexport const setCreateNoticeToWithdrawParam = data => ({\n type: SET_CREATE_NOTICE_TO_WITHDRAWAL_PARAMS,\n createNoticeParam: data,\n});\n\nexport const resetCreateNoticeToWithdraw = () => ({\n type: RESET_CREATE_NOTICE_TO_WITHDRAWAL,\n});\n\nexport const setBankHolidays = json => ({\n type: BANK_HOLIDAYS,\n holidays: json,\n isFetching: false,\n error: null,\n});\n\nexport const createWithdrawalRequest = () => ({\n type: MAKE_A_WITHDRAW_REQUEST,\n isFetching: true,\n error: null,\n});\n\nexport const makeaWithdrawSuccess = json => ({\n type: MAKE_A_WITHDRAW_SUCCESS,\n makeWithdrawResponse: json,\n isFetching: false,\n error: null,\n});\n\nexport const makeaWithdrawFaliure = error => ({\n type: MAKE_A_WITHDRAW_FALIURE,\n makeWithdrawResponse: null,\n isFetching: false,\n error: error.message,\n});\n\nexport const setWithdrawalParam = data => ({\n type: SET_MAKE_A_WITHDRAW_PARAM,\n withdrawalParam: data,\n});\n\nexport const resetMakeWithdrawal = () => ({\n type: RESET_MAKE_A_WITHDRAW,\n});\n\nexport const cancelNoticeToWithdraw = request => dispatch => {\n dispatch(cancellationRequest());\n return fetch(\n Connection.baseUrl('customccb') + `v1.0/cancelpendingtransaction`,\n {\n method: 'post',\n headers: Connection.headers(),\n body: JSON.stringify(request),\n },\n )\n .then(response => Connection.errored(response))\n .then(response => response.json())\n .then(json => dispatch(cancellationSuccess(json)))\n .catch(error => {\n dispatch(cancellationFailed(error));\n });\n};\n\nexport const makeaWithdraw = request => dispatch => {\n dispatch(createWithdrawalRequest());\n return fetch(Connection.baseUrl('customccb') + `v1.0/setupwithdrawal`, {\n method: 'post',\n headers: Connection.headers(),\n body: JSON.stringify(request),\n })\n .then(response => Connection.errored(response))\n .then(response => response.json())\n .then(json => dispatch(makeaWithdrawSuccess(json)))\n .catch(error => dispatch(makeaWithdrawFaliure(error)));\n};\n","import { Connection } from '@myie/interact';\n\nimport {\n RESET_SET_SHORT_APPLY,\n SET_SHORT_APPLY_REQUEST,\n SET_SHORT_APPLY_SUCCESS,\n SET_SHORT_APPLY_FALIURE,\n RESET_SHORT_APPLY_OPTIONS,\n GET_ALL_PRODUCTS_REQUEST,\n GET_ALL_PRODUCTS_SUCCESS,\n GET_ALL_PRODUCTS_FALIURE,\n RESET_SAVE_SHORT_APPLY,\n SAVE_SHORT_APPLY_REQUEST,\n SAVE_SHORT_APPLY_SUCCESS,\n SAVE_SHORT_APPLY_FALIURE,\n} from './shortApplyTypes';\n\nexport const resetShortapply = () => ({\n type: RESET_SET_SHORT_APPLY,\n});\n\nexport const setShortapplyRequest = () => ({\n type: SET_SHORT_APPLY_REQUEST,\n isFetching: true,\n error: null,\n});\n\nexport const setShortapplySuccess = json => ({\n type: SET_SHORT_APPLY_SUCCESS,\n setShortApplyResponse: json,\n isFetching: false,\n error: null,\n});\n\nexport const setShortapplyFaliure = error => ({\n type: SET_SHORT_APPLY_FALIURE,\n isFetching: false,\n error: error.message,\n});\n\nexport const setShortapply = request => dispatch => {\n dispatch(setShortapplyRequest());\n return fetch(\n Connection.baseUrl('accounts') + `v3.0/savings/savingshortapplymarketpref`,\n {\n method: 'post',\n headers: Connection.headers(),\n body: JSON.stringify(request),\n },\n )\n .then(response => Connection.errored(response))\n .then(response => response.json())\n .then(json => dispatch(setShortapplySuccess(json)))\n .catch(error => dispatch(setShortapplyFaliure(error)));\n};\n\nexport const resetGetShowMaturity = () => ({\n type: RESET_SHORT_APPLY_OPTIONS,\n});\n\nexport const getAllProductsRequest = () => ({\n type: GET_ALL_PRODUCTS_REQUEST,\n isFetching: true,\n error: null,\n});\n\nexport const getAllProductsSuccess = json => ({\n type: GET_ALL_PRODUCTS_SUCCESS,\n getAllProductsResponse: json,\n isFetching: false,\n error: null,\n});\n\nexport const getAllProductsFaliure = error => ({\n type: GET_ALL_PRODUCTS_FALIURE,\n getAllProductsResponse: null,\n isFetching: false,\n error: error.message,\n});\n\nexport const getAllProducts = request => dispatch => {\n dispatch(getAllProductsRequest());\n return fetch(Connection.baseUrl('customccb') + 'v1.0/getallproducts', {\n method: 'post',\n headers: Connection.headers(),\n body: JSON.stringify(request),\n })\n .then(response => Connection.errored(response))\n .then(response => response.json())\n .then(json => dispatch(getAllProductsSuccess(json)))\n .catch(error => dispatch(getAllProductsFaliure(error)));\n};\n\nexport const resetSaveShortApply = () => ({\n type: RESET_SAVE_SHORT_APPLY,\n});\n\nexport const saveShortApplyRequest = () => ({\n type: SAVE_SHORT_APPLY_REQUEST,\n isFetching: true,\n error: null,\n});\n\nexport const saveShortApplySuccess = json => ({\n type: SAVE_SHORT_APPLY_SUCCESS,\n saveShortApplyResponse: json,\n isFetching: false,\n error: null,\n});\n\nexport const saveShortApplyFaliure = error => ({\n type: SAVE_SHORT_APPLY_FALIURE,\n isFetching: false,\n error: error.message,\n});\n\nexport const saveShortApply = request => dispatch => {\n dispatch(saveShortApplyRequest());\n return fetch(Connection.baseUrl('customccb') + 'v1.0/savings', {\n method: 'post',\n headers: Connection.headers(),\n body: JSON.stringify(request),\n })\n .then(response => Connection.errored(response))\n .then(response => response.json())\n .then(json => dispatch(saveShortApplySuccess(json)))\n .catch(error => dispatch(saveShortApplyFaliure(error)));\n};\n","import * as withdrawalActions from './actions/withdrawalActions';\nimport * as shortApply from './actions/shortApply';\nconst mapDispatchToProps = {\n ...withdrawalActions,\n ...shortApply,\n};\n\nexport default mapDispatchToProps;\n","import customccbSavingsServicingDefinition from './reducer';\nimport mapStateToProps from './mapStateToProps';\nimport mapDispatchToProps from './mapDispatchToProps';\n\nexport {\n customccbSavingsServicingDefinition,\n mapStateToProps,\n mapDispatchToProps,\n};\n","import React from 'react';\nimport { Check } from '@myie/interact-dom';\nimport { Row, Col, FormGroup } from 'reactstrap';\n\n/** Check example */\nclass CheckExample extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n value: false,\n };\n }\n\n onChange = () => {\n const { value } = this.state;\n this.setState({ value: !value });\n };\n\n render() {\n return (\n \n \n \n \n \n \n
\n );\n }\n}\n\nexport default CheckExample;\n","import React from 'react';\nimport { Currency } from '@myie/interact-dom';\nimport { Row, Col, FormGroup } from 'reactstrap';\n\n/** Currency GBP example */\nclass CurrencyExampleGBP extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n form: {\n amount: {\n value: 1500,\n },\n },\n };\n }\n\n onChange = e => {\n const { form } = this.state;\n const value = e.target.value;\n form.amount.value = value;\n this.setState({ form });\n };\n\n render() {\n const currencyCode = 'GBP';\n const { form } = this.state;\n return (\n \n \n \n \n \n \n
\n );\n }\n}\n\nexport default CurrencyExampleGBP;\n","import React from 'react';\nimport { Currency } from '@myie/interact-dom';\nimport { Row, Col, FormGroup } from 'reactstrap';\n\n/** Currency LKR example */\nclass CurrencyExampleLKR extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n form: {\n amount: {\n value: 1500,\n },\n },\n };\n }\n\n onChange = e => {\n const { form } = this.state;\n const value = e.target.value;\n form.amount.value = value;\n this.setState({ form });\n };\n\n render() {\n const currencyCode = 'LKR';\n const { form } = this.state;\n return (\n \n \n \n \n \n \n
\n );\n }\n}\n\nexport default CurrencyExampleLKR;\n","import React from 'react';\nimport { Date } from '@myie/interact-dom';\nimport { FormGroup, Row, Col } from 'reactstrap';\n\n/** Date example */\nclass DateExample extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n value: '',\n };\n }\n\n onChangeDate = e => {\n const { value } = e.target;\n this.setState({ value });\n };\n\n render() {\n return (\n \n \n \n \n \n \n
\n );\n }\n}\n\nexport default DateExample;\n","import React from 'react';\nimport { DatePicker } from '@myie/interact-dom';\nimport { Row, Col, FormGroup } from 'reactstrap';\n\n/** DatePicker example */\nclass DateExample extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n value: '',\n };\n }\n\n onChange = e => {\n const { value } = e.target;\n this.setState({ value });\n };\n\n render() {\n return (\n \n \n \n \n \n \n
\n );\n }\n}\n\nexport default DateExample;\n","import React from 'react';\nimport { Dialog } from '@myie/interact-dom';\nimport { Row, Col, FormGroup } from 'reactstrap';\n\n/** Dialog example */\nclass DialogExample extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n value: true,\n };\n }\n\n onClick = () => {\n const { value } = this.state;\n this.setState({ value: !value });\n };\n\n render() {\n const { value } = this.state;\n return (\n \n \n \n \n click Here to close the modal \n \n \n \n
\n );\n }\n}\n\nexport default DialogExample;\n","import React from 'react';\nimport { DropDown } from '@myie/interact-dom';\nimport { FormGroup, Row, Col } from 'reactstrap';\n\n/** Dropdown example */\nclass DropDownExample extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n value: '',\n };\n }\n\n onChange = e => {\n const { value } = e.target;\n this.setState({ value });\n };\n\n render() {\n return (\n \n \n \n \n \n Item 1\n \n \n Item 2\n \n \n \n \n
\n );\n }\n}\n\nexport default DropDownExample;\n","import React from 'react';\nimport { Errors } from '@myie/interact-dom';\nimport { Validate } from '@myie/interact';\nimport { Input, FormGroup, Row, Col } from 'reactstrap';\n\n/** Errors example */\nclass ErrorsExample extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n form: {\n name: {\n value: '',\n state: {},\n rules: {\n title: 'Name',\n required: 'Name is required',\n },\n },\n },\n };\n }\n\n onChange = e => {\n const { name, value } = e.target;\n var { form } = this.state;\n form = Validate.input(name, value, form);\n this.setState({ ...this.state, form });\n };\n\n onBlur = e => {\n const { name, value } = e.target;\n var { form } = this.state;\n form = Validate.input(name, value, form, true);\n this.setState({ ...this.state, form });\n };\n\n render() {\n return (\n \n \n \n \n \n \n \n
\n );\n }\n}\n\nexport default ErrorsExample;\n","import React from 'react';\nimport { FormattedCurrency } from '@myie/interact-dom';\nimport { Row, Col, FormGroup } from 'reactstrap';\n\n/** FormattedCurrency example for GBP */\nexport default function TextExample() {\n const currencyCode = 'GBP';\n const currencyQuantity = 1500;\n return (\n \n \n \n \n \n \n
\n );\n}\n","import React from 'react';\nimport { FormattedCurrency } from '@myie/interact-dom';\nimport { Row, Col, FormGroup } from 'reactstrap';\n\n/** FormattedCurrency example for LKR */\nexport default function TextExample() {\n const currencyCode = 'LKR';\n const currencyQuantity = 1500;\n return (\n \n \n \n \n \n \n
\n );\n}\n","export const CONTACTS = {\n phone: '0344 225 3939',\n phoneLink: '03442253939',\n email: 'savings@ccbank.co.uk',\n openTimes: 'Monday to Friday, 9.00am to 5.00pm',\n companyName: 'Cambridge & Counties Bank',\n companySiteName: '',\n companyFormattedAddress: '',\n cashISAFormURL: '',\n minimumAge: '18',\n sortcode: '',\n accountNumber: '',\n};\n","export const URLS = {\n ShortApply: '/short-apply',\n};\n","import { CONTACTS, URLS } from './constants/';\n\nexport { CONTACTS, URLS };\n","import React from 'react';\nimport { FormattedDate } from '@myie/interact-dom';\n\n/** FormattedDate example */\nclass FormattedDateExample extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n value: '',\n };\n }\n\n onChange = e => {\n const { value } = e.target;\n this.setState({ value });\n };\n\n render() {\n return ;\n }\n}\n\nexport default FormattedDateExample;\n","import React from 'react';\nimport { FormattedDate } from '@myie/interact-dom';\n\n/** FormattedDate example with given format*/\nclass FormattedDateExample extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n value: '',\n };\n }\n\n onChange = e => {\n const { value } = e.target;\n this.setState({ value });\n };\n\n render() {\n return ;\n }\n}\n\nexport default FormattedDateExample;\n","import React from 'react';\nimport { Mask } from '@myie/interact-dom';\nimport { FormGroup, Row, Col } from 'reactstrap';\n\n/** Mask example */\nclass MaskExample extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n value: '',\n form: {\n sortcode: {},\n },\n };\n }\n\n onChange = e => {\n const { value } = e.target;\n const { form } = this.state;\n form.sortcode.value = value;\n this.setState({ ...this.state, form });\n };\n\n render() {\n const { form } = this.state;\n return (\n \n \n \n \n \n \n
\n );\n }\n}\n\nexport default MaskExample;\n","import React from 'react';\nimport { Numeric } from '@myie/interact-dom';\nimport { FormGroup, Row, Col } from 'reactstrap';\n\n/** Numeric example */\nclass NumericExample extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n value: '',\n };\n }\n\n onChange = e => {\n const { value } = e.target;\n this.setState({ value });\n };\n\n render() {\n return (\n \n \n \n \n \n \n
\n );\n }\n}\n\nexport default NumericExample;\n","import React from 'react';\nimport { Numeric } from '@myie/interact-dom';\nimport { FormGroup, Row, Col } from 'reactstrap';\n\n/** Numeric example with Decimal */\nclass NumericExample extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n value: '',\n };\n }\n\n onChange = e => {\n const { value } = e.target;\n this.setState({ value });\n };\n\n render() {\n return (\n \n \n \n \n \n \n
\n );\n }\n}\n\nexport default NumericExample;\n","import React from 'react';\nimport { Pagination } from '@myie/interact-dom';\n\n/** Pagination example */\nclass PaginationExample extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n Offset: 0,\n Size: 8,\n };\n }\n\n getPreviousPage = (Offset, Size) => {\n const previousOffset = Offset - Size;\n if (previousOffset >= 0) {\n this.setState({ ...this.state, Offset: previousOffset });\n }\n };\n\n getNextPage = (Offset, Size, TotalConversationsCount) => {\n const nextOffset = Offset + Size;\n if (nextOffset <= TotalConversationsCount) {\n this.setState({ ...this.state, Offset: nextOffset });\n }\n };\n\n render() {\n const TotalConversationsCount = 17;\n const { Offset, Size } = this.state;\n return (\n \n );\n }\n}\n\nexport default PaginationExample;\n","import React from 'react';\nimport { Radio } from '@myie/interact-dom';\nimport { FormGroup, Row, Col } from 'reactstrap';\n\n/** Radio Button example */\nclass RadioExample extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n value: '',\n };\n }\n\n onChangeRadioButton = e => {\n const { value } = e.target;\n this.setState({ value });\n };\n\n render() {\n return (\n \n \n \n \n \n \n
\n );\n }\n}\n\nexport default RadioExample;\n","import React from 'react';\nimport { RadioButton } from '@myie/interact-dom';\nimport { Row, Col, FormGroup } from 'reactstrap';\n\n/** RadioButton example */\nclass RadioButtonExample extends React.Component {\n render() {\n return (\n \n \n \n \n \n \n
\n );\n }\n}\n\nexport default RadioButtonExample;\n","import React from 'react';\nimport { RoundBadge } from '@myie/interact-dom';\n\n/** RoundBadge example */\nclass RoundBadgeExample extends React.Component {\n render() {\n return 10 ;\n }\n}\n\nexport default RoundBadgeExample;\n","import React from 'react';\nimport { Text } from '@myie/interact-dom';\nimport { FormGroup, Row, Col } from 'reactstrap';\n\n/** Text example 1 */\nclass TextExample extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n value: '',\n };\n }\n\n onChange = e => {\n const { value } = e.target;\n this.setState({ value });\n };\n\n render() {\n return (\n \n \n \n \n \n \n
\n );\n }\n}\n\nexport default TextExample;\n","import React from 'react';\nimport { Text } from '@myie/interact-dom';\nimport { FormGroup, Row, Col } from 'reactstrap';\n\n/** Text example 2 */\nclass Textsample extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n value: '',\n };\n }\n\n onChange = e => {\n const { value } = e.target;\n this.setState({ value });\n };\n\n render() {\n return (\n \n \n \n \n \n \n
\n );\n }\n}\n\nexport default Textsample;\n","import React from 'react';\nimport { TextArea } from '@myie/interact-dom';\nimport { FormGroup, Row, Col } from 'reactstrap';\n\n/** Text Area Example */\nclass TextAreaExample extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n value: '',\n };\n }\n\n onChange = e => {\n const { value } = e.target;\n this.setState({ value });\n };\n\n render() {\n return (\n \n \n \n \n \n \n
\n );\n }\n}\n\nexport default TextAreaExample;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Row, Col, Card } from 'reactstrap';\nimport { FormattedCurrency, Content, Value } from '@myie/interact-dom';\n\nclass Balance extends React.Component {\n render() {\n const { props } = this;\n const { account, loopIndex } = props;\n const { ExtendedProperties: { InterestPaymentFrequency } = {} } = account;\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {'%'}\n \n {InterestPaymentFrequency}\n \n
\n \n \n \n
\n );\n }\n}\n\nBalance.propTypes = {\n account: PropTypes.any,\n loopIndex: PropTypes.any,\n};\n\nexport default Balance;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Content } from '@myie/interact-dom';\nimport { MaturityAlert } from '@myie/interact-accounts-dom';\nimport moment from 'moment';\n\nclass MaturityDetails extends React.Component {\n render() {\n const { loopIndex, account } = this.props;\n const { ExtendedProperties: { MaturityDate } = {} } = account;\n\n return (\n \n );\n }\n}\n\nMaturityDetails.propTypes = {\n account: PropTypes.any,\n loopIndex: PropTypes.any,\n mode: PropTypes.any,\n};\n\nexport default MaturityDetails;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Row, Col } from 'reactstrap';\nimport { FormattedCurrency } from '@myie/interact-dom';\nimport {\n mapStateToProps,\n mapDispatchToProps,\n} from '@myie/interact-account-type-savings';\nimport { connect } from 'react-redux';\nimport moment from 'moment';\nimport { Content, FormattedDate } from '@myie/interact-dom';\n\nclass Transactions extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n isComponentLoaded: false,\n };\n }\n\n static getDerivedStateFromProps = nextProps => {\n const {\n accounts = {},\n fetchSavingsAccountTransactionsIfNeeded,\n isFetching,\n account,\n } = nextProps;\n const to = moment().startOf('day');\n const from = moment()\n .subtract(40, 'years')\n .add(1, 'day')\n .startOf('day');\n const range = {\n To: to.toISOString(),\n From: from.toISOString(),\n Latest: true,\n };\n\n if (accounts && !account.transactions && !isFetching) {\n fetchSavingsAccountTransactionsIfNeeded({\n AccountKey: account.AccountKey,\n Range: range,\n ExtendedProperties: {\n FromDate: moment(from).format(moment.HTML5_FMT.DATE),\n ToDate: moment(to)\n .add(1, 'day')\n .format(moment.HTML5_FMT.DATE),\n },\n });\n }\n\n return null;\n };\n\n setInitialRange() {}\n\n componentDidMount() {\n this.setState({ ...this.state, isComponentLoaded: true });\n }\n\n shouldComponentUpdate(nextProps, nextState) {\n if (\n this.props.account === nextProps.account &&\n this.state.isComponentLoaded === nextState.isComponentLoaded\n ) {\n return false;\n } else {\n return true;\n }\n }\n\n render() {\n const { props } = this;\n\n const { account, loopIndex = 0 } = props;\n\n if (account.transactions && account.transactions.Transactions.length > 0) {\n let transactions = [...account.transactions.Transactions];\n //Transactions available - show latest 3 transactions\n return (\n \n
\n \n \n \n {transactions\n .filter((i, index) => index < 3)\n .map((transaction, index) => (\n \n \n \n \n \n \n \n \n ))}\n
\n \n );\n } else {\n if (\n account.transactions &&\n account.transactions.Transactions.length === 0\n ) {\n //No Transaction\n return (\n \n );\n } else {\n return null;\n }\n }\n }\n}\n\nTransactions.propTypes = {\n account: PropTypes.any,\n fetchSavingsAccountTransactionsIfNeeded: PropTypes.func,\n loopIndex: PropTypes.number,\n isFetching: PropTypes.bool,\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(Transactions);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { mapDispatchToProps } from '@myie/interact-account-type-savings';\nimport MaturityDetails from './MaturityDetails';\nimport Transactions from './Transactions';\nimport moment from 'moment';\n\nclass Overview extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n range: this.setInitialRange(props),\n };\n }\n\n setInitialRange(props) {\n if (props.range) {\n return props.range;\n }\n const to = moment\n .utc()\n .startOf('day')\n .toISOString();\n const from = moment\n .utc()\n .subtract(40, 'years')\n .add(1, 'day')\n .startOf('day')\n .toISOString();\n return {\n To: to,\n From: from,\n Latest: true,\n };\n }\n\n accountType = () => {\n let { account, loopIndex } = this.props;\n switch (account.BrandProductType) {\n case 'EASY_ACCESS':\n return ;\n case 'FIXED_TERM':\n return ;\n default:\n }\n };\n\n render() {\n return <>{this.accountType()}>;\n }\n}\n\nOverview.propTypes = {\n account: PropTypes.any,\n fetchSavingsAccountTransactionsIfNeeded: PropTypes.func,\n loopIndex: PropTypes.any,\n range: PropTypes.any,\n};\n\nexport default connect(\n null,\n mapDispatchToProps,\n)(Overview);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Link } from 'react-router-dom';\nimport { Utility } from '@myie/interact';\nimport { Content } from '@myie/interact-dom';\n\nclass Links extends React.Component {\n getLinks = () => {\n const {\n BrandProductType,\n loopIndex,\n accountKey,\n accountStatus,\n } = this.props;\n switch (BrandProductType) {\n case 'NOTICE_ACCOUNT':\n if (accountStatus === 'Active') {\n return (\n \n \n \n );\n }\n break;\n case 'EASY_ACCESS':\n if (accountStatus === 'Active') {\n return (\n \n \n \n );\n }\n break;\n default:\n }\n };\n\n render() {\n const { props } = this;\n const { loopIndex } = props;\n\n return (\n \n \n \n \n {this.getLinks()}\n
\n );\n }\n}\n\nLinks.propTypes = {\n accountKey: PropTypes.any,\n loopIndex: PropTypes.any,\n BrandProductType: PropTypes.string,\n accountStatus: PropTypes.string,\n};\n\nexport default Links;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Card, Row, Col } from 'reactstrap';\nimport Balance from './Balance';\nimport Overview from './Overview';\nimport Links from './Links';\nimport { Content } from '@myie/interact-dom';\nimport moment from 'moment';\n\nclass SavingsSummary extends React.Component {\n render() {\n var colSize = this.props.mode === 1 ? 12 : 6;\n\n const { account, loopIndex, status } = this.props;\n return (\n \n <>\n {account.AccountStatus === 'Closed' ? (\n ''\n ) : (\n {account.AccountName} \n )}\n \n \n \n \n
\n {account.AccountStatus === 'Closed' ? (\n <>\n \n \n
\n \n \n
\n >\n ) : (\n ''\n )}\n \n {account.ExtendedProperties.CompanyName\n ? account.ExtendedProperties.CompanyName\n : ''}\n
\n {account.AccountStatus !== 'Closed' ? (\n \n ) : (\n ''\n )}\n \n {account.AccountStatus !== 'Closed' ? (\n \n \n \n ) : (\n ''\n )}\n
\n\n \n >\n \n );\n }\n}\n\nSavingsSummary.propTypes = {\n account: PropTypes.any,\n loopIndex: PropTypes.any,\n mode: PropTypes.any,\n status: PropTypes.number,\n};\n\nexport default SavingsSummary;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport {\n Content,\n FormattedCurrency,\n Value,\n FormattedDate,\n} from '@myie/interact-dom';\nimport { Row, Col } from 'reactstrap';\nimport { connect } from 'react-redux';\nimport { mapDispatchToProps } from '@myie/interact-account-type-savings';\nimport { mapStateToProps } from '@myie/interact-accounts';\nimport moment from 'moment';\n\nclass SavingsDetailSummary extends React.Component {\n constructor(props) {\n super(props);\n this.state = {};\n }\n static getDerivedStateFromProps = nextProps => {\n const {\n accounts = {},\n fetchSavingsAccountTransactions,\n account,\n isFetching,\n } = nextProps;\n const to = moment().startOf('day');\n const from = moment()\n .subtract(40, 'years')\n .add(1, 'day')\n .startOf('day');\n const range = {\n To: to.toISOString(),\n From: from.toISOString(),\n Latest: true,\n };\n if (accounts && !account.transactions && !isFetching) {\n fetchSavingsAccountTransactions({\n AccountKey: account.AccountKey,\n Range: range,\n ExtendedProperties: {\n FromDate: moment(from).format(moment.HTML5_FMT.DATE),\n ToDate: moment(to).format(moment.HTML5_FMT.DATE),\n },\n });\n }\n\n return null;\n };\n\n render() {\n const { account } = this.props;\n let pendingTransactions = [];\n if (\n account &&\n account.transactions &&\n account.transactions.Transactions.length > 0\n ) {\n pendingTransactions = account.transactions.Transactions.filter(\n element => element.ExtendedProperties.Type === 'PendingTransaction',\n );\n }\n const { ExtendedProperties: { InterestPaymentFrequency } = {} } = account;\n return (\n <>\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n %\n \n {InterestPaymentFrequency}\n \n \n \n \n \n \n \n \n \n \n \n {account.ExtendedProperties.StatementMethod}\n \n\n {this.props.brandProductType === 'NOTICE_ACCOUNT' ? (\n <>\n \n \n \n \n {account.ExtendedProperties.NoticePeriodInDays}\n \n \n \n \n \n \n {pendingTransactions.length}\n \n >\n ) : null}\n {this.props.brandProductType === 'EASY_ACCESS' ? (\n <>\n \n \n \n \n {pendingTransactions.length}\n \n >\n ) : null}\n {this.props.brandProductType === 'FIXED_TERM' ? (\n <>\n \n \n \n \n \n \n >\n ) : null}\n
\n >\n );\n }\n}\n\nSavingsDetailSummary.propTypes = {\n account: PropTypes.any,\n loopIndex: PropTypes.any,\n mode: PropTypes.any,\n brandProductType: PropTypes.any,\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(SavingsDetailSummary);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { Utility } from '@myie/interact';\nimport SavingsDetailSummary from './SavingsDetailSummary';\nimport { Row, Col, Nav, TabContent } from 'reactstrap';\n//import { AppMeta } from '@myie/interact-dom';\nimport {\n TabNavItem,\n TabTransaction,\n TabDocument,\n AccountSupportDropdown,\n TabSummary,\n} from '@myie/interact-accounts-dom';\nimport Balance from './Balance';\nimport { mapDispatchToProps as mapAccountsDispatchToProps } from '@myie/interact-accounts';\nimport { mapDispatchToProps } from '@myie/interact-account-type-savings';\nimport { mapDispatchToProps as ccbAccountsMapDispatch } from '@myie/interact-ccb-accounts';\nimport { TabNavigation, Content } from '@myie/interact-dom';\nimport moment from 'moment';\nimport { withRouter } from 'react-router-dom';\n\nclass SavingsDetails extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n tablist: TabNavigation.init(['transactions', 'downloads']),\n reversed: false,\n activeTab: 'summary',\n AccountKey: props.account.AccountKey.Key,\n count: 0,\n range: this.setInitialRange(props),\n downloadTypes: [],\n };\n }\n\n setInitialRange(props) {\n if (props.range) {\n return props.range;\n }\n const to = moment\n .utc()\n .startOf('day')\n .toISOString();\n const from = moment\n .utc()\n .subtract(1, 'months')\n .add(1, 'day')\n .startOf('day')\n .toISOString();\n return {\n To: to,\n From: from,\n Latest: true,\n };\n }\n\n static getDerivedStateFromProps(props, state) {\n let { AccountKey, ...rest } = state;\n const { account, fetchSavingsAccountTransactions } = props;\n if (\n account &&\n account.AccountKey &&\n account.AccountKey.Key &&\n AccountKey !== account.AccountKey.Key &&\n state.activeTab === 'transactions'\n ) {\n let rangeLocal = state.range;\n const from = moment\n .utc()\n .subtract(2, 'years')\n .add(1, 'day')\n .startOf('day')\n .toISOString();\n rangeLocal.From = from;\n fetchSavingsAccountTransactions({\n AccountKey: account.AccountKey,\n Range: rangeLocal,\n });\n }\n\n if (\n account &&\n account.AccountKey &&\n account.AccountKey.Key &&\n AccountKey !== account.AccountKey.Key\n ) {\n return { ...rest, AccountKey: account.AccountKey.Key, count: 0 };\n }\n\n return null;\n }\n\n setCount = count => {\n this.setState({ ...this.state, count });\n };\n\n componentDidMount() {\n const { fetchSavingsAccountIfNeeded, account } = this.props;\n\n fetchSavingsAccountIfNeeded({\n AccountKey: account.AccountKey,\n });\n }\n componentWillUnmount() {\n //For the selected account, transaction tab on detail page might call reverse() function in the props (when click sort by date).\n //This changes the order of transactions in account list in redux\n //When the same account is used on account list to show latest transactions the above call can change the expected result.\n //This call will reset transactions to correct the order for account list page.\n let { account, fetchSavingsAccountTransactions } = this.props;\n let rangeLocal = this.state.range;\n const from = moment\n .utc()\n .subtract(40, 'years')\n .add(1, 'day')\n .startOf('day')\n .toISOString();\n rangeLocal.From = from;\n fetchSavingsAccountTransactions({\n AccountKey: account.AccountKey,\n Range: this.state.range,\n });\n }\n\n setTab(e) {\n e.preventDefault();\n const current = e.target.href.substring(e.target.href.indexOf('#') + 1);\n let { account, fetchSavingsAccountTransactions } = this.props;\n switch (current) {\n case 'transactions': {\n let rangeLocal = this.state.range;\n this.setCount(0);\n const from = moment\n .utc()\n .subtract(2, 'years')\n .add(1, 'day')\n .startOf('day')\n .toISOString();\n rangeLocal.From = from;\n this.setState({ ...this.state, range: rangeLocal });\n fetchSavingsAccountTransactions({\n AccountKey: account.AccountKey,\n Range: rangeLocal,\n });\n break;\n }\n\n case 'summary': {\n let rangeLocal = this.state.range;\n const from = moment\n .utc()\n .subtract(40, 'years')\n .add(1, 'day')\n .startOf('day')\n .toISOString();\n rangeLocal.From = from;\n fetchSavingsAccountTransactions({\n AccountKey: account.AccountKey,\n Range: rangeLocal,\n });\n break;\n }\n default:\n }\n this.setState({ ...this.state, activeTab: current });\n }\n\n render() {\n const { activeTab, tablist, range } = this.state;\n const { props } = this;\n let {\n account,\n accounts,\n location = { pathname: '' },\n fetchSavingsAccountTransactionsIfNeeded,\n loopIndex = 0,\n } = props;\n\n var currentAccount = null;\n if (accounts && accounts.Accounts) {\n currentAccount = accounts.Accounts.find(function(element) {\n if (element) {\n return (\n Utility.hexEncode(element.AccountKey.Key) ===\n location.pathname.split('/').pop()\n );\n }\n return false;\n });\n }\n\n if (!currentAccount) {\n currentAccount = account;\n }\n\n let activeTabOverride = activeTab;\n if (currentAccount.AccountStatus === 'Closed') {\n // Set the activetab to be 'Statements' for closed accounts\n activeTabOverride = 'statements';\n }\n\n return (\n \n {account.AccountStatus === 'Closed' ? (\n ''\n ) : (\n <>\n
{account.AccountName} \n >\n )}\n
\n {`${account.AccountNumber} ${account.SortCode}`}\n
\n
\n {account.ExtendedProperties.CompanyName\n ? account.ExtendedProperties.CompanyName\n : ''}\n
\n
\n {account.AccountStatus !== 'Closed' ? (\n \n \n \n ) : (\n \n )}\n \n \n \n
\n \n
\n {account.AccountStatus !== 'Closed' ? (\n <>\n this.setTab(e)}\n />\n this.setTab(e)}\n />\n >\n ) : (\n ''\n )}\n this.setTab(e)}\n />\n \n
\n \n \n \n \n \n \n
\n );\n }\n}\n\nSavingsDetails.propTypes = {\n account: PropTypes.any,\n accounts: PropTypes.object,\n documents: PropTypes.object,\n fetchSavingsAccountIfNeeded: PropTypes.any,\n fetchSavingsAccountTransactions: PropTypes.any,\n fetchSavingsAccountTransactionsIfNeeded: PropTypes.any,\n fetchDocumentsIfNeeded: PropTypes.func,\n loopIndex: PropTypes.number,\n getInterestHistory: PropTypes.any,\n interestHistory: PropTypes.any,\n location: PropTypes.any,\n range: PropTypes.any,\n};\n\nconst mapStateToProps = state => {\n const { accountsDefinition, customccbAccountsDefinition } = state;\n return {\n ...accountsDefinition,\n ...customccbAccountsDefinition,\n };\n};\n\nexport default withRouter(\n connect(\n mapStateToProps,\n {\n ...mapDispatchToProps,\n ...mapAccountsDispatchToProps,\n ...ccbAccountsMapDispatch,\n },\n )(SavingsDetails),\n);\n","/* eslint-disable no-mixed-spaces-and-tabs, prettier/prettier */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { Alert } from 'reactstrap';\nimport { Markdown } from '@myie/interact-dom';\nimport { SavingsSummary } from '@myie/interact-account-type-savings-dom';\n\n\nclass AccountSummary extends React.Component {\nrender() {\n// eslint-disable-next-line no-unused-vars\nconst { account, loopIndex, mode } = this.props\nswitch (account.ProductType) {\n\t\tcase \"Savings\": return (); \n\ndefault: return (\n\n \n \n
\n \n)\n}\n}\n}\n\nAccountSummary.propTypes = {\naccount: PropTypes.any,\nloopIndex: PropTypes.any,\nmode: PropTypes.any\n}\n\nexport default AccountSummary","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { CardColumns, Button, ButtonGroup, Fade, Col, Row } from 'reactstrap';\nimport AccountSummary from './AccountSummary';\nimport { mapStateToProps, mapDispatchToProps } from '@myie/interact-accounts';\nimport { Markdown, AppMeta, Content, DropDown } from '@myie/interact-dom';\nimport { Validate } from '@myie/interact';\n\nclass AccountsList extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n companyList: [],\n shown: true,\n form: {\n company: {\n rules: {\n title: 'Filter by company',\n stop: true,\n },\n value: '',\n },\n },\n };\n }\n\n static getDerivedStateFromProps = (nextProps, prevState) => {\n const elements = [];\n const keyValues = [];\n const { accounts = {}, status } = nextProps;\n let { Accounts: list = [] } = accounts;\n if (list.length > 0) {\n // status === 1 means show only closed accounts\n list.forEach(account => {\n if (\n (account.AccountStatus !== 'Closed') === !status &&\n account.ExtendedProperties.CompanyName\n ) {\n if (\n !keyValues.find(function(key) {\n return account.ExtendedProperties.CompanyName === key;\n })\n ) {\n elements.push(\n \n {account.ExtendedProperties.CompanyName}\n ,\n );\n }\n keyValues.push(account.ExtendedProperties.CompanyName);\n } else {\n // status === 1 means show only closed accounts\n if (status === 1 && account.ExtendedProperties.CompanyName) {\n if (\n !keyValues.find(function(key) {\n return account.ExtendedProperties.CompanyName === key;\n })\n ) {\n elements.push(\n \n {account.ExtendedProperties.CompanyName}\n ,\n );\n }\n keyValues.push(account.ExtendedProperties.CompanyName);\n }\n }\n });\n\n return {\n companyList: elements,\n };\n }\n\n return null;\n };\n\n setMode = mode => {\n const props = this.props;\n if (mode === props.mode) {\n return;\n }\n const { setListMode } = props;\n this.setState({ shown: false });\n setTimeout(\n function() {\n setListMode(mode);\n this.setState({ shown: true });\n }.bind(this),\n 250,\n );\n };\n\n onChangeAccount = e => {\n const { value, name } = e.target;\n\n let { form } = this.state;\n form = Validate.input(name, value, form);\n this.setState({ ...this.state, form });\n };\n\n setStatus = status => {\n const props = this.props;\n if (status === props.status) {\n return;\n }\n let { form } = this.state;\n let companyName = form.company.value;\n if (status === 0) {\n // If now show open accounts\n // and current company doesn't have any\n // clear it out\n if (\n this.props.accounts.Accounts.filter(a => {\n return (\n a.ExtendedProperties.CompanyName === companyName &&\n a.AccountStatus !== 'Closed'\n );\n }).length === 0\n ) {\n form.company.value = '';\n }\n }\n const { setStatusMode } = props;\n this.setState({ shown: false, form });\n setTimeout(\n function() {\n setStatusMode(status);\n this.setState({ shown: true });\n }.bind(this),\n 250,\n );\n };\n\n render() {\n let { accounts = {}, isFetching, mode, status } = this.props;\n let { Accounts: list = [] } = accounts;\n let children = [];\n let gridToggle = null;\n let statusToggle = null;\n let accountsToList = [];\n const { shown, form, companyList } = this.state;\n list.forEach(account => {\n if ((account.AccountStatus !== 'Closed') === !status) {\n accountsToList.push(account);\n }\n });\n if (accountsToList.length > 0 && form.company.value !== '') {\n accountsToList = accountsToList.filter(function(account) {\n return account.ExtendedProperties.CompanyName === form.company.value;\n });\n }\n\n if (accountsToList.length > 1) {\n gridToggle = (\n \n this.setMode(0)}\n >\n \n \n this.setMode(1)}\n >\n \n \n \n );\n } else {\n mode = 0;\n }\n\n if (accountsToList.length !== list.length || status === 1) {\n statusToggle = (\n \n this.setStatus(0)}\n >\n \n \n this.setStatus(1)}\n >\n \n \n \n );\n } else {\n status = 0;\n }\n\n accountsToList.forEach((account, index) => {\n children.push(\n ,\n );\n });\n\n if (children.length === 0) {\n if (!isFetching) {\n const state = !status ? 'Active' : 'Closed';\n children.push(\n \n \n
,\n );\n } else {\n children.push(\n \n \n {`...`}\n
,\n );\n }\n }\n\n return (\n \n
\n
\n \n \n
\n \n \n \n \n\n {companyList.sort((a, b) => a.props.value > b.props.value)}\n \n {statusToggle} {gridToggle}\n
\n \n
\n\n
\n \n {children}\n \n \n
\n );\n }\n}\n\nAccountsList.propTypes = {\n acc: PropTypes.object,\n accounts: PropTypes.object,\n history: PropTypes.any,\n isFetching: PropTypes.any,\n mode: PropTypes.any,\n setListMode: PropTypes.any,\n setStatusMode: PropTypes.any,\n status: PropTypes.any,\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(AccountsList);\n","/* eslint-disable no-mixed-spaces-and-tabs, prettier/prettier */\n\nimport React from 'react';\nimport PropTypes from 'prop-types'\nimport { Alert } from 'reactstrap'\nimport { Markdown } from '@myie/interact-dom';\nimport { SavingsDetails } from '@myie/interact-account-type-savings-dom';\n\n\nclass AccountDetails extends React.Component {\nrender() {\n// eslint-disable-next-line no-unused-vars\nconst { account, loopIndex, mode } = this.props\nswitch (account.ProductType) {\n\t\tcase \"Savings\": return (); \n\ndefault: return (\n\n \n \n
\n \n)\n}\n}\n}\n\nAccountDetails.propTypes = {\naccount: PropTypes.any,\nloopIndex: PropTypes.any,\nmode: PropTypes.any\n}\n\nexport default AccountDetails","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { mapStateToProps } from '@myie/interact-accounts';\nimport { connect } from 'react-redux';\nimport { NoMatch, AppMeta, Content } from '@myie/interact-dom';\nimport { Utility } from '@myie/interact';\nimport AccountDetails from './AccountDetails';\n\nclass AccountDetailsTemplate extends React.Component {\n render() {\n const { accounts } = this.props;\n\n let account = {};\n const thisProps = this.props;\n if (accounts && accounts.Accounts) {\n account = accounts.Accounts.find(function(element) {\n if (element) {\n return (\n Utility.hexEncode(element.AccountKey.Key) ===\n thisProps.match.params.id\n );\n }\n return false;\n });\n if (!account) {\n return ;\n }\n } else {\n return (\n \n \n
\n );\n }\n\n return (\n <>\n \n \n >\n );\n }\n}\n\nAccountDetailsTemplate.propTypes = {\n match: PropTypes.object,\n accounts: PropTypes.any,\n};\nexport default connect(mapStateToProps)(AccountDetailsTemplate);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { Link } from 'react-router-dom';\nimport { mapStateToProps, mapDispatchToProps } from '@myie/interact-accounts';\nimport { Utility } from '@myie/interact';\nimport { Content, NoMatch } from '@myie/interact-dom';\nimport { Row, Col } from 'reactstrap';\n\nclass NominatedAccount extends React.Component {\n componentDidMount() {\n const { fetchAccountsIfNeeded } = this.props;\n fetchAccountsIfNeeded();\n }\n\n render() {\n const { accounts } = this.props;\n\n let account = {};\n const thisProps = this.props;\n if (accounts && accounts.Accounts) {\n account = accounts.Accounts.find(function(element) {\n if (element) {\n return (\n Utility.hexEncode(element.AccountKey.Key) ===\n thisProps.match.params.id\n );\n }\n return false;\n });\n if (!account) {\n return ;\n }\n } else {\n return (\n \n \n
\n );\n }\n\n return (\n \n
\n \n \n
\n \n
\n
\n \n \n \n \n
\n
\n \n \n
\n \n \n \n \n {account &&\n account.ExtendedProperties &&\n account.ExtendedProperties.NominatedAccountNumber\n ? account.ExtendedProperties.NominatedAccountNumber\n : ''}\n \n \n \n \n \n {account &&\n account.ExtendedProperties &&\n account.ExtendedProperties.NominatedSortCode\n ? account.ExtendedProperties.NominatedSortCode\n : ''}\n \n
\n\n
\n \n \n \n
\n
\n );\n }\n}\n\nNominatedAccount.propTypes = {\n fetchAccountsIfNeeded: PropTypes.any,\n accounts: PropTypes.any,\n match: PropTypes.any,\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(NominatedAccount);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { Redirect, Route, Switch } from 'react-router-dom';\nimport { PrivateRoute, NoMatch } from '@myie/interact-dom';\nimport AccountsList from './AccountsList';\nimport AccountDetailsTemplate from './AccountDetailsTemplate';\nimport { mapStateToProps, mapDispatchToProps } from '@myie/interact-accounts';\nimport { Alert } from 'reactstrap';\nimport NominatedAccount from './NominatedAccount';\n\nclass Accounts extends React.Component {\n componentDidMount() {\n const { fetchAccountsIfNeeded } = this.props;\n fetchAccountsIfNeeded();\n }\n\n render() {\n const { error } = this.props;\n const re = new RegExp('^/accounts[/]{0,1}$');\n if (this.props.location.pathname.match(re)) {\n return ;\n }\n return (\n \n {error ? (\n
\n {error}\n \n ) : (\n ''\n )}\n
\n }\n />\n \n \n \n \n
\n );\n }\n}\n\nAccounts.propTypes = {\n error: PropTypes.any,\n fetchAccountsIfNeeded: PropTypes.any,\n location: PropTypes.any,\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(Accounts);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Markdown, SideLink } from '@myie/interact-dom';\nimport { connect } from 'react-redux';\nimport { mapStateToProps } from '@myie/interact-messaging-twoway';\nimport { HelpContactSidebar } from '@myie/interact-dom';\nimport { Session } from '@myie/interact';\nimport { SystemMessage } from '@myie/interact-widget-system-message-dom';\n\nclass SummarySideBar extends React.Component {\n render() {\n return (\n \n \n {Session.isAuthenticated() ? : null}\n \n \n }\n linkDescription={\n \n }\n linkURL=\"/messaging-twoway/\"\n linkID=\"missing-account-sidebar-link\"\n iconImage=\"Warning2\"\n />\n
\n \n );\n }\n}\n\nSummarySideBar.propTypes = {\n i18n: PropTypes.any,\n newMessageCount: PropTypes.object,\n};\n\nexport default connect(mapStateToProps)(SummarySideBar);\n\n/*export default ('accounts')(\n connect(mapStateToProps)(SummarySideBar),\n); */\n","import SummarySidebar from './SummarySideBar';\nimport DetailSidebar from './DetailSideBar';\n\nconst AccountsSidebars = [\n {\n url: '/accounts/list',\n Sidebar: SummarySidebar,\n },\n {\n url: '/accounts/details/',\n Sidebar: DetailSidebar,\n },\n];\n\nexport default AccountsSidebars;\n","import React from 'react';\nimport { SelectAccounts } from '@myie/interact-widget-select-account-dom';\nimport { Session } from '@myie/interact';\n\nconst DetailSideBar = () => {\n return (\n \n {Session.isAuthenticated() ? : null}\n \n );\n};\n\nexport default DetailSideBar;\n","import SummaryMenuItems from './SummaryMenuItems';\n\nconst AccountsMenuItems = [\n {\n url: '/accounts',\n menuItem: SummaryMenuItems,\n },\n];\n\nexport default AccountsMenuItems;\n","import React from 'react';\nimport { Link } from 'react-router-dom';\nimport { Content } from '@myie/interact-dom';\n\nclass SummaryMenuItems extends React.Component {\n render() {\n return (\n \n \n \n );\n }\n}\n\nexport default SummaryMenuItems;\n","import React from 'react';\nimport Accounts from './Accounts';\nimport { Route } from 'react-router-dom';\n\nconst Routes = [\n ,\n];\n\nexport default Routes;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { CSVLink } from 'react-csv';\nimport moment from 'moment';\nimport { Content, Icon } from '@myie/interact-dom';\n\nclass ExportAccountCSV extends React.Component {\n render() {\n const { account } = this.props;\n\n const csvTransactions = [];\n let csvTransactionsFilename = '';\n const transactions = account.transactions;\n\n if (\n account.transactions &&\n transactions.Transactions &&\n transactions.Transactions.length\n ) {\n csvTransactions.push([\n account.AccountName +\n ' Transactions exported on ' +\n moment(new Date()).format('YYYY-MM-DD h:mm'),\n ]);\n if (transactions.Range) {\n const fromDate = transactions.Range.From\n ? moment(transactions.Range.From).format('YYYY-MM-DD')\n : '';\n const toDate = transactions.Range.To\n ? moment(transactions.Range.To).format('YYYY-MM-DD')\n : '';\n csvTransactions.push(['Start', fromDate, 'End', toDate]);\n csvTransactionsFilename =\n account.AccountName + '_' + fromDate + '_' + toDate + '.csv';\n } else {\n csvTransactions.push(['Latest transactions']);\n csvTransactionsFilename =\n account.AccountName + '_Latest transactions.csv';\n }\n csvTransactions.push(['Date', 'Description', 'Amount', 'Balance']);\n\n transactions.Transactions.forEach(transaction => {\n if (\n transaction &&\n transaction.ExtendedProperties &&\n transaction.ExtendedProperties.Type &&\n transaction.ExtendedProperties.Type !== 'PendingTransaction'\n ) {\n csvTransactions.push([\n moment(transaction.Date)\n .utc()\n .format('YYYY-MM-DD'),\n transaction.Description,\n transaction.Amount,\n transaction.Balance ? transaction.Balance : 0,\n ]);\n }\n });\n\n return (\n \n \n \n \n \n \n );\n } else {\n return '';\n }\n }\n}\n\nExportAccountCSV.propTypes = {\n account: PropTypes.any,\n};\n\nexport default ExportAccountCSV;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { NavLink, NavItem } from 'reactstrap';\nimport { Content } from '@myie/interact-dom';\n\nclass TabNavItem extends React.Component {\n render() {\n const { name, caption, activeTab, tablist, ...rest } = this.props;\n return (\n \n tablist.tabKeyDown(e, name, tablist.refs)}\n {...rest}\n >\n \n \n \n );\n }\n}\nTabNavItem.propTypes = {\n activeTab: PropTypes.string,\n caption: PropTypes.string,\n name: PropTypes.string,\n onClick: PropTypes.func,\n tablist: PropTypes.object,\n};\n\nexport default TabNavItem;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Button, Form, Col, Navbar, Row } from 'reactstrap';\nimport { Date, Content } from '@myie/interact-dom';\nimport { Validate } from '@myie/interact';\n\nimport moment from 'moment';\n\nclass TransactionDateRange extends React.Component {\n constructor(props) {\n super(props);\n const { range } = this.props;\n\n this.state = {\n form: {\n startDate: {\n rules: {\n title: 'start date',\n stop: true,\n required: {\n message: 'Please select a start date',\n },\n date: {\n format: 'dmy',\n message: 'Please select a valid start date',\n },\n compareStartDate: {\n message: 'Start date must be less than or equal to the end date',\n field: 'endDate',\n comparison: () => {\n return this.state.form.endDate.value;\n },\n },\n },\n\n value: this.subtractDate(range.From),\n },\n endDate: {\n rules: {\n title: 'end date',\n stop: true,\n required: {\n message: 'Please select an end date',\n },\n date: {\n format: 'dmy',\n message: 'Please select a valid end date',\n },\n compareEndDate: {\n message:\n 'End date must be greater than or equal to the start date.',\n field: 'startDate',\n comparison: () => {\n return this.state.form.startDate.value;\n },\n },\n },\n\n value: this.subtractDate(range.From),\n },\n },\n };\n }\n\n subtractDate = date => {\n return moment(date).format('DD/MM/YYYY');\n };\n\n onChange = e => {\n let { name, value } = e.target;\n //value = moment(value).format(\"DD/MM/YYYY\");\n var { form } = this.state;\n form = Validate.input(name, value, form, true);\n this.setState({\n ...this.state,\n form,\n });\n };\n\n onBlur = e => {\n let { name, value } = e.target;\n //value = moment(value).format(\"DD/MM/YYYY\");\n var { form } = this.state;\n form = Validate.input(name, value, form, true);\n this.setState({\n ...this.state,\n form,\n });\n };\n\n submit = e => {\n e.preventDefault();\n const { fetchTransactions, toggle, account, setUpdateButton } = this.props;\n let { form } = this.state;\n const from = moment(form.startDate.value, 'DD/MM/YYYY');\n const to = moment(form.endDate.value, 'DD/MM/YYYY');\n const range = {\n To: to,\n From: from,\n };\n\n form = Validate.form(form);\n\n this.setState({\n ...this.state,\n form,\n });\n\n if (!form.approved) {\n return;\n }\n\n let request = {\n AccountKey: account.AccountKey,\n Range: range,\n ExtendedProperties: {\n FromDate: moment(from).format(moment.HTML5_FMT.DATE),\n ToDate: moment(to).format(moment.HTML5_FMT.DATE),\n },\n };\n setUpdateButton();\n fetchTransactions(request);\n toggle(range);\n\n form.endDate.value = this.subtractDate(range.To);\n form.startDate.value = this.subtractDate(range.From);\n this.setState({\n ...this.state,\n form,\n });\n };\n\n render() {\n const { form } = this.state;\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n );\n }\n}\n\nTransactionDateRange.propTypes = {\n className: PropTypes.string,\n account: PropTypes.any,\n fetchTransactions: PropTypes.any,\n range: PropTypes.any,\n toggle: PropTypes.any,\n setUpdateButton: PropTypes.any,\n};\n\nexport default TransactionDateRange;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Col } from 'reactstrap';\nimport moment from 'moment';\n\nclass TransactionDate extends React.Component {\n render() {\n const { props } = this;\n\n const getDateStr = date => {\n const thisDate = moment(date)\n .startOf('day')\n .toString();\n const today = moment()\n .startOf('day')\n .toString();\n const yesterday = moment()\n .subtract(1, 'days')\n .startOf('day')\n .toString();\n\n if (thisDate === today) {\n return 'Today';\n }\n if (thisDate === yesterday) {\n return 'Yesterday';\n }\n\n return moment(date)\n .format('DD MMM YYYY')\n .toString();\n };\n return (\n \n {getDateStr(props.transactionDate)}\n \n );\n }\n}\n\nTransactionDate.propTypes = {\n transactionDate: PropTypes.any,\n position: PropTypes.any,\n};\n\nexport default TransactionDate;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Row, Col } from 'reactstrap';\nimport { Content, RoundBadge, FormattedCurrency } from '@myie/interact-dom';\n\nclass Transaction extends React.Component {\n render() {\n const { props } = this;\n\n const { transaction, AccountCurrencyCode } = props;\n const { position } = props;\n const imgBackground = function() {\n var imgColours = ['blue'];\n var coloursCount = imgColours.length;\n var color = imgColours[position % coloursCount];\n return color + '-badge align-self-center';\n };\n\n const character = transaction.Description.substring(0, 1).toUpperCase();\n\n return (\n \n \n \n \n {character}\n \n \n \n \n {transaction.Description}\n
\n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n
\n \n
\n \n );\n }\n}\n\nTransaction.propTypes = {\n AccountCurrencyCode: PropTypes.any,\n position: PropTypes.any,\n transaction: PropTypes.any,\n accountType: PropTypes.any,\n};\n\nexport default Transaction;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport {\n Fade,\n Navbar,\n Nav,\n NavItem,\n Button,\n TabPane,\n Row,\n Col,\n} from 'reactstrap';\nimport ExportAccountCSV from './ExportAccountCSV.js';\nimport TransactionDateRange from './TransactionDateRange';\nimport TransactionDate from './TransactionDate';\nimport Transaction from './Transaction';\nimport { connect } from 'react-redux';\nimport { FormattedDate, Content, Icon, Markdown } from '@myie/interact-dom';\nimport { mapDispatchToProps } from '@myie/interact-accounts';\nimport { mapDispatchToProps as ccbAccountsMapDispatch } from '@myie/interact-ccb-accounts';\nimport moment from 'moment';\n\nclass TabTransaction extends React.Component {\n constructor(props) {\n super(props);\n this.toggleTransactions = this.toggleTransactions.bind(this);\n this.state = {\n range: props.range ? props.range : null,\n transactions: [],\n updateButton: false,\n };\n }\n\n setUpdateButton = () => {\n this.setState({ ...this.state, updateButton: true });\n };\n\n static getDerivedStateFromProps(props, state) {\n const {\n range,\n activeTab,\n accounts,\n account,\n isFetching,\n getInterestHistoryIfNeeded,\n } = props;\n if (\n activeTab === 'transactions' &&\n accounts &&\n !account.interestHistory &&\n !isFetching\n ) {\n getInterestHistoryIfNeeded({\n AccountKey: account.AccountKey,\n });\n }\n if (range && state.range == null) {\n if (range.Latest) {\n var latestDates = { ...range };\n delete latestDates.Latest;\n return { range, latestDates };\n }\n return { range };\n }\n\n return null;\n }\n\n sortTransactions = () => {\n if (\n this.props.account &&\n this.props.account.transactions &&\n this.props.account.transactions.Transactions\n ) {\n this.props.account.transactions.Transactions.reverse();\n this.setState({\n reverse: !this.state.reverse,\n });\n }\n //this.setState({ ...this.state });\n };\n\n toggleTransactions(range) {\n if (range) {\n this.setState({ collapse: !this.state.collapse, range: range });\n } else {\n this.setState({ collapse: !this.state.collapse });\n }\n }\n\n shouldComponentUpdate() {\n const { range } = this.props;\n if (!range) {\n return false;\n } else {\n return true;\n }\n }\n\n olderTransactions = () => {\n const { fetchTransactions, account, setCount, count } = this.props;\n let months = (count + 1) * 6 + 24;\n setCount(count + 1);\n const to = moment().startOf('day');\n const from = moment()\n .subtract(months, 'months')\n .add(1, 'day')\n .startOf('day');\n const range = {\n To: to.toISOString(),\n From: from.toISOString(),\n };\n let request = {\n AccountKey: account.AccountKey,\n Range: range,\n ExtendedProperties: {\n FromDate: moment(from).format(moment.HTML5_FMT.DATE),\n ToDate: moment(to).format(moment.HTML5_FMT.DATE),\n },\n };\n this.setState({ ...this.state, updateButton: false });\n fetchTransactions(request);\n this.toggleTransactions(range);\n };\n\n getRates(account) {\n let Rates = [];\n if (\n account.interestHistory.InterestRateHistory &&\n account.interestHistory.InterestRateHistory.InterestHistories\n ) {\n let InterestRates = [\n ...account.interestHistory.InterestRateHistory.InterestHistories,\n ];\n\n InterestRates.reverse().forEach((element, index) => {\n let today = moment(new Date()).format('YYYY-MM-DD');\n let toDate = moment(element.DateTo).format('YYYY-MM-DD');\n Rates.push(\n \n \n \n {' - '}\n {moment(toDate).isSame(today, 'day') ? (\n \n ) : (\n \n )}\n \n\n \n {element.AnnualInterestRate}\n {'%'}\n \n ,\n );\n });\n }\n\n return Rates;\n }\n\n render() {\n const {\n name,\n fetchTransactions,\n account,\n activeTab,\n tablist,\n count,\n } = this.props;\n const { range, updateButton } = this.state;\n const transactions = [];\n if (account.transactions && account.transactions.Transactions) {\n let index = 0;\n const listCount = (count + 1) * 20;\n let previousDate = null;\n\n account.transactions.Transactions.forEach(transaction => {\n if (\n transaction &&\n transaction.ExtendedProperties &&\n transaction.ExtendedProperties.Type &&\n transaction.ExtendedProperties.Type !== 'PendingTransaction'\n ) {\n if (index < listCount || updateButton) {\n let thisDate = moment(transaction.Date)\n .startOf('day')\n .toString();\n if (previousDate !== thisDate) {\n transactions.push(\n ,\n );\n previousDate = moment(transaction.Date)\n .startOf('day')\n .toString();\n }\n transactions.push(\n ,\n );\n index++;\n }\n }\n });\n }\n\n return (\n \n \n tablist.panelKeyDown(e, name, tablist.refs)}\n >\n
\n \n \n
\n \n \n \n \n \n {'>'}\n \n \n {this.state.reverse\n ? 'you are sorting by date ascending'\n : 'you are sorting by date descending'}\n . Click here to reverse this.\n \n \n \n \n {\n window.print();\n }}\n size=\"sm\"\n className=\"btn-nav float-right mr-0\"\n color=\"link\"\n >\n \n \n \n \n * \n \n \n \n \n \n \n * Please note re printing: formatting in some browsers may not\n fully work – please contact us if you need help.\n
\n \n\n
\n {transactions.length > 0 ? (\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
\n ) : (\n
\n \n
\n )}\n
{transactions} \n\n
\n \n {\n this.olderTransactions();\n }}\n size=\"sm\"\n className=\"btn-nav float-left mr-0\"\n color=\"link\"\n >\n \n \n \n\n \n {\n window.scrollTo(0, 0);\n }}\n size=\"sm\"\n className=\"btn-nav float-right mr-0\"\n color=\"link\"\n >\n \n \n \n
\n {account.interestHistory &&\n account.interestHistory.InterestRateHistory &&\n account.interestHistory.InterestRateHistory.InterestHistories &&\n account.interestHistory.InterestRateHistory.InterestHistories\n .length > 0 ? (\n <>\n
\n \n \n
\n
\n \n \n {this.getRates(account)}\n
\n \n
\n >\n ) : (\n ''\n )}\n
\n
\n \n \n );\n }\n}\nTabTransaction.propTypes = {\n account: PropTypes.object,\n activeTab: PropTypes.string,\n fetchTransactions: PropTypes.func,\n range: PropTypes.object,\n tablist: PropTypes.object,\n name: PropTypes.any,\n getInterestHistoryIfNeeded: PropTypes.any,\n isFetching: PropTypes.any,\n interestRates: PropTypes.any,\n accounts: PropTypes.any,\n count: PropTypes.any,\n setCount: PropTypes.any,\n transRange: PropTypes.any,\n};\nconst mapStateToProps = state => {\n const { accountsDefinition, customccbAccountsDefinition } = state;\n return {\n ...accountsDefinition,\n ...customccbAccountsDefinition,\n };\n};\n\nexport default connect(\n mapStateToProps,\n { ...mapDispatchToProps, ...ccbAccountsMapDispatch },\n)(TabTransaction);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Fade, TabPane } from 'reactstrap';\n\nclass TabSummary extends React.Component {\n render() {\n const { activeTab, tablist, children, name } = this.props;\n\n return (\n \n \n tablist.panelKeyDown(e, name, tablist.refs)}\n >\n {children}\n
\n \n \n );\n }\n}\nTabSummary.propTypes = {\n activeTab: PropTypes.string,\n children: PropTypes.node,\n tablist: PropTypes.object,\n name: PropTypes.any,\n};\n\nexport default TabSummary;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { NavLink } from 'reactstrap';\nimport { mapDispatchToProps } from '@myie/interact-accounts';\nimport { mapDispatchToProps as ccbAccountsMapDispatch } from '@myie/interact-ccb-accounts';\nimport { Content } from '@myie/interact-dom';\nimport moment from 'moment';\n\nclass DownloadDocument extends React.PureComponent {\n constructor(props) {\n super(props);\n\n this.state = {\n date: moment(new Date())\n .utc()\n .format('YYYY-MM-DD'),\n message: '',\n };\n }\n\n componentDidUpdate() {\n const { downloadedDocument, document, documentIdData } = this.props;\n if (\n downloadedDocument &&\n documentIdData &&\n document.DocumentKey.Key === downloadedDocument.documentKey.Key &&\n downloadedDocument.documentKey.Key !== documentIdData.id\n ) {\n this.download(downloadedDocument, document);\n }\n }\n\n download = (downloadedDocument, docInfo) => {\n const { ccbResetDocumentDownload } = this.props;\n if (window.navigator && window.navigator.msSaveOrOpenBlob) {\n //For IE and the legacy version of Microsoft Edge, use atob convert base64 encoded data to byte array\n var byteCharacters = window.atob(downloadedDocument.document.Document); // Convert from base64\n var byteNumbers = new Array(byteCharacters.length);\n for (var i = 0; i < byteCharacters.length; i++) {\n byteNumbers[i] = byteCharacters.charCodeAt(i);\n }\n var byteArray = new Uint8Array(byteNumbers);\n var blob = new Blob([byteArray], { type: 'application/pdf' });\n window.navigator.msSaveOrOpenBlob(\n blob,\n `${docInfo.Name + docInfo.FileExtension}`,\n );\n } else {\n const downloadLink = document.createElement('a');\n downloadLink.href =\n 'data:' +\n downloadedDocument.document.Mime +\n ';base64,' +\n downloadedDocument.document.Document;\n downloadLink.download = `${docInfo.Name + docInfo.FileExtension}`;\n ccbResetDocumentDownload();\n downloadLink.click();\n }\n };\n\n downloadFileRequest = () => {\n const { ccbFetchDocumentDownload, document, selectedAccount } = this.props;\n const request = {\n DocumentKey: document.DocumentKey,\n ExtendedProperties: {\n Date: this.state.date,\n Type: document.Type,\n AccountKey: selectedAccount.AccountKey,\n },\n };\n ccbFetchDocumentDownload(request);\n };\n\n render() {\n return (\n this.downloadFileRequest()}\n href=\"#\"\n >\n \n {document.Name}\n \n );\n }\n}\n\nDownloadDocument.propTypes = {\n ccbFetchDocumentDownload: PropTypes.func,\n ccbResetDocumentDownload: PropTypes.func,\n downloadedDocument: PropTypes.object,\n document: PropTypes.object,\n selectedAccount: PropTypes.any,\n DocumentKey: PropTypes.object,\n index: PropTypes.number,\n setDocument: PropTypes.any,\n documentIdData: PropTypes.object,\n};\nconst mapStateToProps = state => {\n const { accountsDefinition, customccbAccountsDefinition } = state;\n return {\n ...accountsDefinition,\n ...customccbAccountsDefinition,\n };\n};\nexport default connect(\n mapStateToProps,\n { ...mapDispatchToProps, ...ccbAccountsMapDispatch },\n)(DownloadDocument);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Row, Col } from 'reactstrap';\nimport { connect } from 'react-redux';\nimport { mapDispatchToProps } from '@myie/interact-accounts';\nimport { FormattedDate } from '@myie/interact-dom';\nimport DownloadDocument from './DownloadDocument';\n\nclass Document extends React.PureComponent {\n render() {\n const { props } = this;\n\n const {\n document,\n index,\n selectedAccount,\n setDocument,\n documentIdData,\n } = props;\n\n if (!document) {\n return null;\n }\n\n return (\n \n \n \n \n \n \n {document.Name}\n \n \n {document.ExtendedProperties.DisplayType}\n \n \n \n \n
\n \n );\n }\n}\n\nDocument.propTypes = {\n AccountCurrencyCode: PropTypes.any,\n position: PropTypes.any,\n transaction: PropTypes.any,\n selectedAccount: PropTypes.any,\n document: PropTypes.object,\n index: PropTypes.number,\n setDocument: PropTypes.any,\n documentIdData: PropTypes.object,\n};\n\nexport default connect(\n null,\n mapDispatchToProps,\n)(Document);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Fade, Navbar, Nav, NavItem, TabPane, Row, Col } from 'reactstrap';\nimport { Check, Content, Markdown } from '@myie/interact-dom';\nimport Document from './Document';\nimport { connect } from 'react-redux';\nimport { mapDispatchToProps } from '@myie/interact-accounts';\nimport { mapDispatchToProps as ccbAccountsMapDispatch } from '@myie/interact-ccb-accounts';\n\nclass TabDocument extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n downloadTypes: [],\n documentIdData: {\n id: '',\n count: 0,\n },\n };\n }\n\n static getDerivedStateFromProps(props, state) {\n const {\n documents,\n account,\n activeTab,\n ccbFetchDocumentsIfNeeded,\n accounts,\n isFetching,\n } = props;\n const { downloadTypes, documentIdData } = state;\n\n if (\n activeTab === 'statements' &&\n accounts &&\n !account.documents &&\n !isFetching\n ) {\n ccbFetchDocumentsIfNeeded({\n AccountKey: account.AccountKey,\n });\n }\n if (documents && documents.Documents) {\n documents.Documents.forEach(document => {\n if (\n !downloadTypes.some(\n doc => doc.label === document.ExtendedProperties.DisplayType,\n )\n ) {\n const docType = {\n id: document.ExtendedProperties.DisplayType.replace(/\\s+/g, ''),\n label: document.ExtendedProperties.DisplayType,\n checked: true,\n };\n downloadTypes.push(docType);\n }\n });\n\n return {\n downloadTypes,\n documentIdData,\n };\n } else return null;\n }\n\n onDocTypesChange = e => {\n const { downloadTypes } = this.state;\n let docTypeIndex = 0;\n downloadTypes.forEach(docType => {\n if (docType.id === e.target.id) {\n downloadTypes[docTypeIndex].checked = !docType.checked;\n }\n docTypeIndex++;\n });\n this.setState({ ...this.state, downloadTypes });\n };\n\n setDocumentId = id => {\n const { documentIdData } = this.state;\n documentIdData.count = 1;\n documentIdData.id = id;\n this.setState({ ...this.state, documentIdData });\n };\n\n getDocTypes = documentTypes => {\n const docTypeButtons = [];\n if (documentTypes) {\n documentTypes.forEach((docType, index) => {\n const id = docType.id;\n docTypeButtons.push(\n \n \n ,\n );\n });\n }\n\n return docTypeButtons;\n };\n render() {\n const { activeTab, tablist, name, account } = this.props;\n const { downloadTypes } = this.state;\n const documentList = [];\n\n if (account && account.documents && account.documents.Documents) {\n let index = 0;\n account.documents.Documents.forEach(document => {\n if (\n downloadTypes.some(\n doc =>\n doc.label === document.ExtendedProperties.DisplayType &&\n doc.checked,\n )\n ) {\n documentList.push(\n ,\n );\n }\n index++;\n });\n }\n\n return (\n \n \n tablist.panelKeyDown(e, name, tablist.refs)}\n >\n
\n \n {this.getDocTypes(downloadTypes)} \n \n\n
\n\n {documentList.length > 0 ? (\n <>\n
\n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n >\n ) : (\n ''\n )}\n
\n \n \n );\n }\n}\nTabDocument.propTypes = {\n account: PropTypes.object,\n activeTab: PropTypes.string,\n documents: PropTypes.object,\n ccbFetchDocumentsIfNeeded: PropTypes.func,\n isFetching: PropTypes.bool,\n tablist: PropTypes.object,\n name: PropTypes.any,\n accounts: PropTypes.any,\n};\n\nconst mapStateToProps = state => {\n const { accountsDefinition, customccbAccountsDefinition } = state;\n return {\n ...accountsDefinition,\n ...customccbAccountsDefinition,\n };\n};\n\nexport default connect(\n mapStateToProps,\n { ...mapDispatchToProps, ...ccbAccountsMapDispatch },\n)(TabDocument);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Row, Col } from 'reactstrap';\nimport { FormattedDate, FormattedCurrency } from '@myie/interact-dom';\n\nclass ListPageTransaction extends React.Component {\n render() {\n const { props } = this;\n\n const { account, transaction } = props;\n\n return (\n \n \n \n {transaction.Description.charAt(0).toUpperCase() +\n transaction.Description.slice(1).toLowerCase()}\n
\n \n \n \n \n \n \n \n
\n );\n }\n}\n\nListPageTransaction.propTypes = {\n account: PropTypes.object,\n position: PropTypes.any,\n transaction: PropTypes.any,\n};\n\nexport default ListPageTransaction;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { DropDown } from '@myie/interact-dom';\nimport { withRouter } from 'react-router-dom';\nimport { Validate, Utility } from '@myie/interact';\nimport Currency from 'react-currency-formatter';\n\nclass RedirectByAccountDropdown extends React.Component {\n constructor(props) {\n super(props);\n const { defaultSelect } = this.props;\n this.state = {\n form: {\n accountType: {\n value: defaultSelect,\n rules: {\n title: 'Source Account',\n stop: true,\n required: {\n message: 'Please select your account',\n },\n },\n },\n },\n };\n }\n\n withdrawalFilter = accounts => {\n if (accounts) {\n return accounts.filter(\n account =>\n account.AccountStatus !== 'Closed' &&\n account.BrandProductType === 'EASY_ACCESS',\n );\n }\n return [];\n };\n\n noticeFilter = accounts => {\n if (accounts) {\n return accounts.filter(\n account =>\n account.AccountStatus !== 'Closed' &&\n account.BrandProductType === 'NOTICE_ACCOUNT',\n );\n }\n return [];\n };\n\n onChangeTarget = e => {\n const { name, value } = e.target;\n if (value === '') {\n return;\n }\n let { form } = this.state;\n const { baseUrl, accounts, history, onChangeAccount } = this.props;\n form = Validate.input(name, value, form);\n if (accounts && accounts.Accounts) {\n const account = accounts.Accounts.find(function(element) {\n return element.AccountKey.Key === value;\n });\n\n this.setState({ ...this.state, form });\n onChangeAccount(e);\n const newUrl = baseUrl + Utility.hexEncode(account.AccountKey.Key);\n history.push(newUrl);\n }\n };\n\n accountOptions(prefix, item, index) {\n return (\n \n {item.AccountNumber} -{' '}\n {Currency({ quantity: item.Balance, currency: item.CurrencyCode })}\n \n );\n }\n\n render() {\n const { accounts, defaultSelect, filter } = this.props;\n\n const { form } = this.state;\n if (form.accountType.value === undefined) {\n form.accountType.value = defaultSelect;\n }\n\n let accOptions = [];\n switch (filter) {\n case 'withdrawal':\n accOptions = accounts ? this.withdrawalFilter(accounts.Accounts) : [];\n break;\n case 'notice':\n accOptions = accounts ? this.noticeFilter(accounts.Accounts) : [];\n break;\n default:\n }\n\n return (\n \n \n {accOptions.map((item, index) => {\n return this.accountOptions('accountType', item, index);\n })}\n \n );\n }\n}\n\nRedirectByAccountDropdown.propTypes = {\n accounts: PropTypes.any,\n baseUrl: PropTypes.any,\n defaultSelect: PropTypes.any,\n filterAccounts: PropTypes.any,\n history: PropTypes.any,\n onChangeAccount: PropTypes.any,\n filter: PropTypes.any,\n};\n\nexport default withRouter(RedirectByAccountDropdown);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { DropDown } from '@myie/interact-dom';\nimport { withRouter } from 'react-router-dom';\n\nclass AccountSupportDropdown extends React.Component {\n constructor(props) {\n super(props);\n const { actions } = props;\n const defaultActions = {\n Alerts: {\n redirectURL: '/alerts',\n optionName: 'Manage account alerts',\n },\n Messaging: {\n redirectURL: '/messaging-twoway/view',\n optionName: 'Send a message',\n },\n };\n const allActions = Object.assign({}, actions, defaultActions);\n this.state = {\n allActions,\n form: {\n accountOptions: {\n value: '',\n rules: {},\n },\n },\n };\n }\n\n onChangeTarget = e => {\n const { history } = this.props;\n const { allActions } = this.state;\n const { value } = e.target;\n if (value === '') {\n return;\n }\n\n history.push(allActions[value].redirectURL);\n };\n\n accountOptions() {\n const { account } = this.props;\n const { allActions } = this.state;\n const elements = [];\n if (allActions) {\n const keys = Object.keys(allActions);\n keys.forEach(key => {\n if (allActions[key].optionName && account.Supports.includes(key)) {\n elements.push(\n ,\n );\n }\n });\n }\n return elements;\n }\n\n render() {\n const { form } = this.state;\n const options = this.accountOptions();\n return options.length !== 0 ? (\n \n \n {options}\n \n ) : null;\n }\n}\n\nAccountSupportDropdown.propTypes = {\n account: PropTypes.any,\n actions: PropTypes.any,\n history: PropTypes.any,\n};\n\nexport default withRouter(AccountSupportDropdown);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Alert } from 'reactstrap';\nimport moment from 'moment';\nimport { Content } from '@myie/interact-dom';\n\nclass MaturityAlert extends React.Component {\n onDismiss = () => {\n const { closeAlert, accountKey } = this.props;\n closeAlert(accountKey);\n };\n\n getMessage = MaturityDate => {\n let today = moment();\n let maturity = moment(MaturityDate);\n\n if (maturity.isSame(today, 'day')) {\n return (\n \n );\n } else {\n if (maturity.diff(today, 'day') < 14) {\n return (\n \n );\n } else {\n return (\n \n );\n }\n }\n };\n\n render() {\n const { index, visibility, MaturityDate, alert } = this.props;\n return (\n <>\n {alert ? (\n \n {this.getMessage(MaturityDate)}\n \n ) : (\n this.getMessage(MaturityDate)\n )}\n >\n );\n }\n}\n\nMaturityAlert.propTypes = {\n alertVisibleArray: PropTypes.any,\n closeAlert: PropTypes.any,\n accountKey: PropTypes.any,\n message: PropTypes.any,\n index: PropTypes.any,\n MaturityDate: PropTypes.any,\n visibility: PropTypes.any,\n alert: PropTypes.any,\n};\n\nexport default MaturityAlert;\n","import Accounts from './Accounts';\nimport AccountsSidebars from './Sidebars';\nimport AccountsMenuItems from './MenuItems';\nimport Routes from './Routes';\n/* Components */\nimport ExportAccountCSV from './Components/DetailPage/Tabs/Transaction/ExportAccountCSV';\nimport TabNavItem from './Components/DetailPage/Tabs/TabNavItem';\n/* Detail Page */\nimport TransactionDateRange from './Components/DetailPage/Tabs/Transaction/TransactionDateRange'; /* To be removed */\nimport TransactionDate from './Components/DetailPage/Tabs/Transaction/TransactionDate'; /* To be removed */\nimport Transaction from './Components/DetailPage/Tabs/Transaction/Transaction'; /* To be removed */\nimport TabTransaction from './Components/DetailPage/Tabs/Transaction/TabTransaction';\nimport TabSummary from './Components/DetailPage/Tabs/Summary/TabSummary';\nimport TabDocument from './Components/DetailPage/Tabs/Document/TabDocument';\n/* List Page */\nimport ListPageTransaction from './Components/ListPage/ListPageTransaction';\nimport RedirectByAccountDropdown from './Components/RedirectByAccountDropdown';\nimport AccountSupportDropdown from './Components/DetailPage/Tabs/Transaction/AccountSupportDropdown';\nimport Document from './Components/DetailPage/Tabs/Document/Document';\nimport MaturityAlert from './MaturityMessages/MaturityAlert';\n\nexport {\n Accounts,\n AccountsSidebars,\n AccountsMenuItems,\n Routes,\n MaturityAlert,\n ExportAccountCSV,\n TabNavItem,\n Transaction /* To be removed */,\n TransactionDate /* To be removed */,\n TransactionDateRange /* To be removed */,\n RedirectByAccountDropdown,\n ListPageTransaction,\n AccountSupportDropdown,\n Document,\n TabTransaction,\n TabSummary,\n TabDocument,\n};\n","import {\n ACTIVATION_REQUEST,\n ACTIVATION_SUCCESS,\n ACTIVATION_FAILURE,\n RESET_ACTIVATION,\n} from '../actions/registrationTypes';\n\nconst ccbRegistrationDefinition = (state = {}, action) => {\n switch (action.type) {\n case RESET_ACTIVATION:\n return {\n ...state,\n activationCheck: {},\n };\n case ACTIVATION_SUCCESS:\n return {\n ...state,\n activationCheck: action.activationCheck,\n isFetching: action.isFetching,\n };\n case ACTIVATION_FAILURE:\n return {\n ...state,\n isFetching: action.isFetching,\n error: action.error,\n };\n case ACTIVATION_REQUEST:\n default:\n return state;\n }\n};\n\nexport default ccbRegistrationDefinition;\n","export const ACTIVATION_REQUEST = 'ACTIVATION_REQUEST';\nexport const ACTIVATION_SUCCESS = 'ACTIVATION_SUCCESS';\nexport const ACTIVATION_FAILURE = 'ACTIVATION_FAILURE';\nexport const RESET_ACTIVATION = 'RESET_ACTIVATION';\n\nexport const SETUP_CREDENTIALS_REQUEST = 'SETUP_CREDENTIALS_REQUEST';\nexport const SETUP_CREDENTIALS_SUCCESS = 'SETUP_CREDENTIALS_SUCCESS';\nexport const SETUP_CREDENTIALS_FAILURE = 'SETUP_CREDENTIALS_FAILURE';\nexport const RESET_SETUP_CREDENTIALS = 'RESET_SETUP_CREDENTIALS';\n\nexport const TOKEN_ACCOUNT_REQUEST = 'TOKEN_ACCOUNT_REQUEST';\nexport const TOKEN_ACCOUNT_SUCCESS = 'TOKEN_ACCOUNT_SUCCESS';\nexport const TOKEN_ACCOUNT_FAILURE = 'TOKEN_ACCOUNT_FAILURE';\nexport const RESET_TOKEN_ACCOUNT = 'RESET_TOKEN_ACCOUNT';\n\nexport const SETUP_CREDENTIALS_ACTIVATE_REQUEST =\n 'SETUP_CREDENTIALS_ACTIVATE_REQUEST';\nexport const SETUP_CREDENTIALS_ACTIVATE_SUCCESS =\n 'SETUP_CREDENTIALS_ACTIVATE_SUCCESS';\nexport const SETUP_CREDENTIALS_ACTIVATE_FAILURE =\n 'SETUP_CREDENTIALS_ACTIVATE_FAILURE';\nexport const RESET_SETUP_CREDENTIALS_ACTIVATE =\n 'RESET_SETUP_CREDENTIALS_ACTIVATE';\n","import {\n SETUP_CREDENTIALS_REQUEST,\n SETUP_CREDENTIALS_SUCCESS,\n SETUP_CREDENTIALS_FAILURE,\n RESET_SETUP_CREDENTIALS,\n SETUP_CREDENTIALS_ACTIVATE_REQUEST,\n SETUP_CREDENTIALS_ACTIVATE_SUCCESS,\n SETUP_CREDENTIALS_ACTIVATE_FAILURE,\n RESET_SETUP_CREDENTIALS_ACTIVATE,\n} from '../actions/registrationTypes';\n\nconst ccbSetupCredentialsDefinition = (state = {}, action) => {\n switch (action.type) {\n case RESET_SETUP_CREDENTIALS_ACTIVATE:\n return {\n ...state,\n credentialsActivate: {},\n };\n case SETUP_CREDENTIALS_ACTIVATE_SUCCESS:\n return {\n ...state,\n credentialsActivate: action.setupcredentials,\n isFetching: action.isFetching,\n };\n case SETUP_CREDENTIALS_ACTIVATE_FAILURE:\n return {\n ...state,\n isFetching: action.isFetching,\n error: action.error,\n };\n case SETUP_CREDENTIALS_ACTIVATE_REQUEST:\n case RESET_SETUP_CREDENTIALS:\n return {\n ...state,\n setupCredentialsActivate: {},\n };\n case SETUP_CREDENTIALS_SUCCESS:\n return {\n ...state,\n setupCredentialsActivate: action.setupCredentialsActivate,\n isFetching: action.isFetching,\n };\n case SETUP_CREDENTIALS_FAILURE:\n return {\n ...state,\n isFetching: action.isFetching,\n error: action.error,\n };\n case SETUP_CREDENTIALS_REQUEST:\n default:\n return state;\n }\n};\n\nexport default ccbSetupCredentialsDefinition;\n","import {\n TOKEN_ACCOUNT_REQUEST,\n TOKEN_ACCOUNT_SUCCESS,\n TOKEN_ACCOUNT_FAILURE,\n RESET_TOKEN_ACCOUNT,\n} from '../actions/registrationTypes';\n\nconst ccbRegistrationTokenDefinition = (state = {}, action) => {\n switch (action.type) {\n case RESET_TOKEN_ACCOUNT:\n return {\n ...state,\n tokenAccountDetails: {},\n };\n case TOKEN_ACCOUNT_SUCCESS:\n return {\n ...state,\n tokenAccountDetails: action.tokenAccountDetails,\n isFetching: action.isFetching,\n };\n case TOKEN_ACCOUNT_FAILURE:\n return {\n ...state,\n isFetching: action.isFetching,\n error: action.error,\n };\n case TOKEN_ACCOUNT_REQUEST:\n default:\n return state;\n }\n};\n\nexport default ccbRegistrationTokenDefinition;\n","import ccbRegistrationDefinition from './reducers/registrationDefinition';\nimport ccbSetupCredentialsDefinition from './reducers/setupCredentialsDefinition';\nimport ccbRegistrationTokenDefinition from './reducers/tokenAccountDefinition';\n\nconst customccbAuthenticationDefinition = (state = {}, action) => {\n var newState = state;\n newState = ccbRegistrationDefinition(newState, action);\n newState = ccbSetupCredentialsDefinition(newState, action);\n newState = ccbRegistrationTokenDefinition(newState, action);\n return newState;\n};\n\nexport default customccbAuthenticationDefinition;\n","import { Connection } from '@myie/interact';\n\nimport {\n ACTIVATION_REQUEST,\n ACTIVATION_SUCCESS,\n ACTIVATION_FAILURE,\n RESET_ACTIVATION,\n} from './registrationTypes';\n\nexport const resetActivation = () => ({\n type: RESET_ACTIVATION,\n});\nexport const activationRequest = () => ({\n type: ACTIVATION_REQUEST,\n isFetching: true,\n error: null,\n});\n\nexport const activationFailed = error => ({\n type: ACTIVATION_FAILURE,\n isFetching: false,\n error: error.message,\n});\n\nexport const activationReceive = json => ({\n type: ACTIVATION_SUCCESS,\n activationCheck: json,\n isFetching: false,\n error: null,\n});\n\nexport const registrationcheck = request => dispatch => {\n dispatch(activationRequest());\n return fetch(Connection.baseUrl('customccb') + `v1.0/registrationcheck`, {\n method: 'post',\n headers: Connection.headers(),\n body: JSON.stringify(request),\n })\n .then(response => Connection.errored(response))\n .then(response => response.json())\n .then(json => dispatch(activationReceive(json)))\n .catch(error => dispatch(activationFailed(error)));\n};\n","import { Connection, TwoFactor } from '@myie/interact';\n\nimport {\n SETUP_CREDENTIALS_REQUEST,\n SETUP_CREDENTIALS_SUCCESS,\n SETUP_CREDENTIALS_FAILURE,\n RESET_SETUP_CREDENTIALS,\n} from './registrationTypes';\n\nexport const resetSetupCredentials = () => ({\n type: RESET_SETUP_CREDENTIALS,\n});\nexport const setupCredentialsRequest = () => ({\n type: SETUP_CREDENTIALS_REQUEST,\n isFetching: true,\n error: null,\n});\n\nexport const setupCredentialsFailed = error => ({\n type: SETUP_CREDENTIALS_FAILURE,\n isFetching: false,\n error: error.message,\n});\n\nexport const setupCredentialsReceive = json => ({\n type: SETUP_CREDENTIALS_SUCCESS,\n setupCredentialsActivate: json,\n isFetching: false,\n error: null,\n});\n\nexport const setupCredentials = request => dispatch => {\n return TwoFactor.run(() => {\n dispatch(setupCredentialsRequest());\n return fetch(\n Connection.baseUrl('webauthentication') +\n `v2.0/user/forgottencredentials/activate`,\n {\n method: 'post',\n headers: Connection.headers(),\n body: JSON.stringify(request),\n },\n )\n .then(response => Connection.errored(response))\n .then(response => response.json())\n .then(json => dispatch(setupCredentialsReceive(json)))\n .catch(error => dispatch(setupCredentialsFailed(error)));\n });\n};\n","import { Connection } from '@myie/interact';\n\nimport {\n TOKEN_ACCOUNT_REQUEST,\n TOKEN_ACCOUNT_SUCCESS,\n TOKEN_ACCOUNT_FAILURE,\n RESET_TOKEN_ACCOUNT,\n} from './registrationTypes';\n\nexport const resetTokenAccount = () => ({\n type: RESET_TOKEN_ACCOUNT,\n});\nexport const tokenAccountRequest = () => ({\n type: TOKEN_ACCOUNT_REQUEST,\n isFetching: true,\n error: null,\n});\n\nexport const tokenAccountFailed = error => ({\n type: TOKEN_ACCOUNT_FAILURE,\n isFetching: false,\n error: error.message,\n});\n\nexport const tokenAccountReceive = json => ({\n type: TOKEN_ACCOUNT_SUCCESS,\n tokenAccountDetails: json,\n isFetching: false,\n error: null,\n});\n\nexport const getTokenAccount = request => dispatch => {\n dispatch(tokenAccountRequest());\n return fetch(Connection.baseUrl('customccb') + `v1.0/token`, {\n method: 'post',\n headers: Connection.headers(),\n body: JSON.stringify(request),\n })\n .then(response => Connection.errored(response))\n .then(response => response.json())\n .then(json => dispatch(tokenAccountReceive(json)))\n .catch(error => dispatch(tokenAccountFailed(error)));\n};\n","import { Connection, TwoFactor } from '@myie/interact';\n\nimport {\n SETUP_CREDENTIALS_ACTIVATE_REQUEST,\n SETUP_CREDENTIALS_ACTIVATE_SUCCESS,\n SETUP_CREDENTIALS_ACTIVATE_FAILURE,\n RESET_SETUP_CREDENTIALS_ACTIVATE,\n} from './registrationTypes';\n\nexport const resetActivation = () => ({\n type: RESET_SETUP_CREDENTIALS_ACTIVATE,\n});\nexport const setupCredentialsRequest = () => ({\n type: SETUP_CREDENTIALS_ACTIVATE_REQUEST,\n isFetching: true,\n error: null,\n});\n\nexport const failedSetupCredentials = error => ({\n type: SETUP_CREDENTIALS_ACTIVATE_FAILURE,\n isFetching: false,\n error: error.message,\n});\n\nexport const activationSetupCredentials = json => ({\n type: SETUP_CREDENTIALS_ACTIVATE_SUCCESS,\n setupcredentials: json,\n isFetching: false,\n error: null,\n});\n\nexport const setupcredentialsActivate = request => dispatch => {\n return TwoFactor.run(() => {\n dispatch(setupCredentialsRequest());\n return fetch(\n Connection.baseUrl('webauthentication') +\n `v2.0/user/setupcredentials/activate`,\n {\n method: 'post',\n headers: Connection.headers(),\n body: JSON.stringify(request),\n },\n )\n .then(response => Connection.errored(response))\n .then(response => response.json())\n .then(json => dispatch(activationSetupCredentials(json)))\n .catch(error => dispatch(failedSetupCredentials(error)));\n });\n};\n","import * as registrationActions from './actions/registrationActions';\nimport * as setupCredentialsActions from './actions/setupCredentialsActions';\nimport * as registrationTokenAction from './actions/registrationTokenAction';\nimport * as credentialsActions from './actions/activation';\n\nconst mapDispatchToProps = {\n ...registrationActions,\n ...setupCredentialsActions,\n ...registrationTokenAction,\n ...credentialsActions,\n};\n\nexport default mapDispatchToProps;\n","import customccbAuthenticationDefinition from './reducer';\nimport mapStateToProps from './mapStateToProps';\nimport mapDispatchToProps from './mapDispatchToProps';\n\nexport {\n customccbAuthenticationDefinition,\n mapStateToProps,\n mapDispatchToProps,\n};\n","import _ from 'lodash';\nimport queryString from 'query-string';\n\nconst stateUtility = (function() {\n // const addOtherParamsToUrl = passedParams => {\n // const params = Object.keys(passedParams);\n // let strings = '/';\n // params.forEach(param => {\n // if (\n // passedParams[param] &&\n // passedParams[param].search('propState') === -1\n // ) {\n // strings = `${strings}/${passedParams[param]}`;\n // }\n // });\n\n // return strings;\n // };\n\n // const updateFormData = (data, formData) => {\n // let newFormData = formData;\n // const keys = Object.keys(data);\n // keys.forEach(key => {\n // if (newFormData[key]) {\n // newFormData[key] = data[key];\n // } else {\n // newFormData[`${key}`] = data[key];\n // }\n // });\n\n // return newFormData;\n // };\n\n const setPageState = (storageName, obj, formData) => {\n let currenObj = {};\n currenObj = JSON.parse(window.sessionStorage.getItem('pageState'));\n if (!currenObj) {\n currenObj = {};\n }\n if (currenObj && currenObj[storageName]) {\n currenObj[storageName][`${formData}`] = obj;\n } else {\n currenObj[`${storageName}`] = {};\n let thisObj = currenObj;\n thisObj[storageName][`${formData}`] = obj;\n }\n window.sessionStorage.setItem('pageState', JSON.stringify(currenObj));\n };\n\n const setGlobalValue = data => {\n let currenObj = JSON.parse(window.sessionStorage.getItem('pageState'));\n if (!currenObj) {\n currenObj = {};\n }\n if (currenObj['global']) {\n let currentValues = currenObj['global'];\n const keys = Object.keys(data);\n keys.forEach(key => {\n if (currentValues[key]) {\n currentValues[key] = data[key];\n } else {\n currentValues[`${key}`] = data[key];\n }\n });\n currenObj['global'] = currentValues;\n } else {\n currenObj['global'] = data;\n }\n window.sessionStorage.setItem('pageState', JSON.stringify(currenObj));\n };\n\n const directlyUpdateUrl = (data, storage, history) => {\n if (!storage) {\n return null;\n }\n\n if (!data && !_.isEmpty(data.url)) {\n data.url = {};\n }\n\n const keys = Object.keys(data);\n keys.forEach(key => {\n setPageState(storage, data[key], key);\n });\n const newUrl = queryString.stringifyUrl({\n url: history.location.pathname,\n query: data.url,\n });\n history.push(newUrl);\n };\n\n const getPageState = () => {\n const data = JSON.parse(window.sessionStorage.getItem('pageState'));\n return data;\n };\n\n const getComponentState = storageName => {\n let currenObj = {};\n const Obj = JSON.parse(window.sessionStorage.getItem('pageState'));\n if (!Obj) {\n currenObj = {};\n }\n if (Obj && storageName && Obj[storageName]) {\n currenObj = Obj[storageName];\n }\n return currenObj;\n };\n\n const resetComponentState = storageName => {\n const Obj = JSON.parse(window.sessionStorage.getItem('pageState'));\n\n if (Obj && Obj[storageName]) {\n delete Obj[storageName];\n }\n window.sessionStorage.setItem('pageState', JSON.stringify(Obj));\n };\n\n // const generateUrl = (path, strings, urlData) => {\n // let newUrlString = '';\n // let splitedUrl = path.split(':');\n // let removeLastString = splitedUrl[0].slice(0, -1);\n // let urlParam = urlData;\n // urlParam.propState = true;\n // newUrlString = `${removeLastString}${strings}${JSON.stringify(urlParam)}`;\n // return newUrlString;\n // };\n\n return {\n //addOtherParamsToUrl: addOtherParamsToUrl,\n directlyUpdateUrl: directlyUpdateUrl,\n //updateFormData: updateFormData,\n setGlobalValue: setGlobalValue,\n //generateUrl: generateUrl,\n setPageState: setPageState,\n getPageState: getPageState,\n getComponentState: getComponentState,\n resetComponentState: resetComponentState,\n };\n})();\n\nexport default stateUtility;\n","var map = {\n\t\"./Check/CheckExample\": 310,\n\t\"./Check/CheckExample.js\": 310,\n\t\"./Currency/CurrencyExampleGBP\": 311,\n\t\"./Currency/CurrencyExampleGBP.js\": 311,\n\t\"./Currency/CurrencyExampleLKR\": 312,\n\t\"./Currency/CurrencyExampleLKR.js\": 312,\n\t\"./Date/DateExample\": 313,\n\t\"./Date/DateExample.js\": 313,\n\t\"./DatePicker/DatePicker\": 314,\n\t\"./DatePicker/DatePicker.js\": 314,\n\t\"./Dialog/DialogExample\": 315,\n\t\"./Dialog/DialogExample.js\": 315,\n\t\"./DropDown/DropDownExample\": 316,\n\t\"./DropDown/DropDownExample.js\": 316,\n\t\"./Errors/ErrorsExample\": 317,\n\t\"./Errors/ErrorsExample.js\": 317,\n\t\"./FormattedCurrency/FormattedCurrencyGBP\": 318,\n\t\"./FormattedCurrency/FormattedCurrencyGBP.js\": 318,\n\t\"./FormattedCurrency/FormattedCurrencyLKR\": 319,\n\t\"./FormattedCurrency/FormattedCurrencyLKR.js\": 319,\n\t\"./FormattedDate/FormattedDateExample\": 320,\n\t\"./FormattedDate/FormattedDateExample.js\": 320,\n\t\"./FormattedDate/FormattedDateExampleWithFormat\": 321,\n\t\"./FormattedDate/FormattedDateExampleWithFormat.js\": 321,\n\t\"./InputMask/CheckExample\": 322,\n\t\"./InputMask/CheckExample.js\": 322,\n\t\"./Numeric/NumericExample\": 323,\n\t\"./Numeric/NumericExample.js\": 323,\n\t\"./Numeric/NumericExample2\": 324,\n\t\"./Numeric/NumericExample2.js\": 324,\n\t\"./Pagination/PaginationExample\": 325,\n\t\"./Pagination/PaginationExample.js\": 325,\n\t\"./Radio/RadioExample\": 326,\n\t\"./Radio/RadioExample.js\": 326,\n\t\"./RadioButton/RadioButtonExample\": 327,\n\t\"./RadioButton/RadioButtonExample.js\": 327,\n\t\"./RoundBadge/RoundBadgeExample\": 328,\n\t\"./RoundBadge/RoundBadgeExample.js\": 328,\n\t\"./Text/TextExample\": 329,\n\t\"./Text/TextExample.js\": 329,\n\t\"./Text/Textsample\": 330,\n\t\"./Text/Textsample.js\": 330,\n\t\"./TextArea/TextAreaExample\": 331,\n\t\"./TextArea/TextAreaExample.js\": 331\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 704;","/* eslint-disable no-mixed-spaces-and-tabs, prettier/prettier */\n\nimport { cmsDefinition } from '@myie/interact-cms'\nimport { sharedDefinition } from '@myie/interact-shared'\nimport { twoFactorDefinition } from '@myie/interact-two-factor'\nimport { accountsDefinition as accountsSharedDefinition } from '@myie/interact-accounts'\nimport { authenticationDefinition } from '@myie/interact-authentication'\nimport { payByCardDefinition } from '@myie/interact-pay-by-card'\nimport { messagingTwowayDefinition } from '@myie/interact-messaging-twoway'\nimport { messagingSystemDefinition } from '@myie/interact-messaging-system'\nimport { customccbAccountsDefinition } from '@myie/interact-ccb-accounts';\nimport { userManagementDefinition } from '@myie/interact-user-management'\n\nimport { accountsDefinition as accountsSavingsDefinition } from '@myie/interact-account-type-savings'\n\nconst accountsDefinition = (state = {}, action) => {\n let newState = state\n newState = accountsSharedDefinition(newState, action)\n newState = accountsSavingsDefinition(newState, action)\n newState = customccbAccountsDefinition(newState, action)\n return newState\n}\n\nconst interactReducers = { cmsDefinition, sharedDefinition, twoFactorDefinition, accountsDefinition, authenticationDefinition, payByCardDefinition, messagingTwowayDefinition, messagingSystemDefinition, userManagementDefinition }\n\nexport default interactReducers\n","import { combineReducers } from 'redux';\nimport interactReducers from './interactCCbReducers';\nimport { customccbAuthenticationDefinition } from '@myie/interact-ccb-authentication';\nimport { customccbOrganisationDefinition } from '@myie/interact-ccb-organisation';\nimport { customccbSavingsServicingDefinition } from '@myie/interact-ccb-savings-servicing';\n\nconst includeCustomccbReducers = {\n ...interactReducers,\n customccbAuthenticationDefinition,\n customccbOrganisationDefinition,\n customccbSavingsServicingDefinition,\n};\n\nconst appReducer = combineReducers({ ...includeCustomccbReducers });\n\nconst rootReducer = (state, action) => {\n if (action.type === 'USER_LOGOUT') {\n state = { cmsDefinition: state.cmsDefinition };\n }\n return appReducer(state, action);\n};\nexport default rootReducer;\n","import { Session } from '@myie/interact';\n\nconst NO_SESSION = 'no session';\nconst getSessionTicket = session => {\n try {\n if (session && session.ticket && session.ticket()) {\n return session.ticket();\n }\n } catch (error) {\n // assume no session\n }\n return NO_SESSION;\n};\n\nconst secureFetch = previousFetch => {\n return (url, options) => {\n const savedSession = getSessionTicket(Session);\n\n try {\n return Promise.resolve(\n previousFetch(url, options).then(response => {\n const currentSession = getSessionTicket(Session);\n if (savedSession === NO_SESSION || savedSession === currentSession) {\n return Promise.resolve(response);\n } else {\n return Promise.resolve({});\n }\n }),\n );\n } catch (err) {\n return Promise.reject(err);\n }\n };\n};\n\nexport default secureFetch;\n","import React, { Component } from 'react';\nimport { HelpContactSidebar } from '@myie/interact-dom';\n\nclass DefaultSidebar extends Component {\n render() {\n return (\n \n );\n }\n}\n\nexport default DefaultSidebar;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { mapStateToProps, mapDispatchToProps } from '@myie/interact-two-factor';\nimport { Content, Markdown } from '@myie/interact-dom';\nimport { Link } from 'react-router-dom';\nimport { CONTACTS } from '@myie/interact-local-dom';\nclass NoDestinations extends React.Component {\n back = e => {\n const { finishTwoFactor } = this.props;\n e.preventDefault();\n finishTwoFactor();\n };\n\n render() {\n return (\n <>\n \n \n\n $[phone] so that we can help.`}\n />\n\n \n \n \n \n
\n >\n );\n }\n}\n\nNoDestinations.propTypes = {\n error: PropTypes.any,\n finishTwoFactor: PropTypes.any,\n resetChallenge: PropTypes.any,\n resetDestinations: PropTypes.any,\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(NoDestinations);\n","export const returnPath = origin => {\n switch (origin) {\n case 'editUserDetails':\n return '/personal-details/edit';\n case 'editSecurityDetails':\n return '/details/index';\n case 'transferIntoNewAccount':\n return '/transfer-to-another/create/moveMoney';\n case 'accountsList':\n return '/accounts/list';\n case 'EditnominatedAccountDetails':\n case 'nominatedAccountDetails':\n return '/nominated-account-for-withdrawals';\n default:\n return '';\n }\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Validate, Session } from '@myie/interact';\nimport { connect } from 'react-redux';\nimport { Button } from 'reactstrap';\nimport { Radio, RadioGroup, Content, Markdown } from '@myie/interact-dom';\nimport { stateUtility } from '../shared';\nimport { CONTACTS } from '@myie/interact-local-dom';\nimport { TwoFactor } from '@myie/interact';\nimport { mapDispatchToProps } from '@myie/interact-two-factor';\nimport { Link, withRouter } from 'react-router-dom';\n//import _ from 'lodash';\nimport NoDestinations from './NoDestinations';\nimport { returnPath } from './ReturnPages';\nclass Destinations extends React.Component {\n constructor(props) {\n super(props);\n this.state = this.initiateState(props);\n }\n\n initiateState = props => {\n const { setDestination, page, setResend } = props;\n\n const storage = stateUtility.getPageState();\n const storageName =\n storage && storage.global && storage.global.storage\n ? storage.global.storage\n : '';\n\n let stateData = stateUtility.getComponentState(storageName);\n if (\n stateData &&\n stateData.url &&\n stateData.url.twoFa &&\n stateData.url.twoFa === 'active'\n ) {\n if (stateData.destination) {\n setDestination(stateData.destination);\n }\n if (page === 'resend') {\n setResend();\n }\n }\n return {\n storageName,\n form: {\n destination: {\n rules: {\n required: true,\n },\n },\n },\n disabled: false,\n };\n };\n\n componentDidMount() {\n const { getDestinations, destinations } = this.props;\n if (!destinations || !destinations.Destinations) {\n getDestinations({\n ChallengeKey: TwoFactor.getKey(),\n });\n }\n }\n\n componentWillUnmount() {\n const { resetDestinations } = this.props;\n resetDestinations();\n }\n\n continue = e => {\n e.preventDefault();\n this.setState({ disabled: true });\n const {\n sendChallenge,\n setDestination,\n page,\n setResend,\n history,\n } = this.props;\n\n let { form } = this.state;\n form = Validate.form(form);\n this.setState({\n ...this.state,\n form,\n });\n if (!form.approved) {\n this.setState({ disabled: false });\n return;\n }\n if (page === 'resend') {\n setResend();\n }\n const selectedDestination = form.destination.value;\n setDestination(selectedDestination);\n const request = {\n Destination: selectedDestination,\n ChallengeKey: TwoFactor.getKey(),\n };\n sendChallenge(request);\n this.setState({ disabled: false });\n const storage = stateUtility.getPageState();\n\n let stateData = {\n destination: selectedDestination,\n twoFapage: page,\n destinationReq: request,\n url: {\n twoFa: 'active',\n twoFaDestination: 'active',\n },\n };\n\n if (storage && storage.global && storage.global.storage) {\n let page = storage[storage.global.storage];\n if (page && page.url && page.url.pageStage) {\n stateData.url.pageStage = page.url.pageStage;\n }\n }\n\n stateUtility.directlyUpdateUrl(\n stateData,\n storage && storage.global && storage.global.storage\n ? storage.global.storage\n : '',\n history,\n );\n };\n\n cancel = () => {\n if (localStorage.getItem('firstLogin')) {\n window.location.href = CONTACTS.externalHomeURL;\n return null;\n }\n\n const { finishTwoFactor, history } = this.props;\n const { storageName } = this.state;\n const returnTo = returnPath(storageName);\n finishTwoFactor({});\n if (Session.isAuthenticated() && returnTo) {\n stateUtility.resetComponentState(storageName);\n history.push(returnTo);\n }\n };\n\n onChange = e => {\n const { name, value } = e.target;\n let { form } = this.state;\n form = Validate.input(name, value, form, true);\n this.setState({ ...this.state, form });\n };\n isDestinationValid = number => {\n return /^\\d+$/.test(number.substring(number.length - 3));\n };\n\n getErrorMessage = () => {\n const { form } = this.state;\n\n let message = null;\n if (form.destination.state && Validate.isInvalid(form.destination.state)) {\n message = (\n \n \n
\n );\n }\n return message;\n };\n\n render() {\n const { destinations, error, page, mobNumberNotFound } = this.props;\n const { form } = this.state;\n const numbers = [];\n if (error) {\n return ;\n }\n if (!destinations) {\n return (\n \n \n
\n );\n }\n if (\n mobNumberNotFound ||\n !destinations.Destinations ||\n destinations.Destinations.length === 0\n ) {\n return ;\n }\n destinations.Destinations.forEach((d, i) => {\n if (this.isDestinationValid(d)) {\n numbers.push(\n ,\n );\n }\n });\n\n return (\n \n \n \n {numbers}\n {this.getErrorMessage()}\n \n\n $[email] or on $[phone] .`}\n />\n {page === 'activate' ? (\n \n \n \n \n \n \n \n \n {Session.isAuthenticated() ? (\n \n \n \n ) : (\n \n \n \n )}\n
\n \n ) : (\n ''\n )}\n \n \n );\n }\n}\n\nDestinations.propTypes = {\n destinations: PropTypes.any,\n history: PropTypes.any,\n error: PropTypes.any,\n finishTwoFactor: PropTypes.any,\n getDestinations: PropTypes.any,\n resetDestinations: PropTypes.any,\n sendChallenge: PropTypes.any,\n page: PropTypes.any,\n mobNumberNotFound: PropTypes.any,\n setMobNumberNotFound: PropTypes.any,\n setDestination: PropTypes.func,\n setResend: PropTypes.any,\n resetActivation: PropTypes.func,\n location: PropTypes.any,\n pathname: PropTypes.any,\n};\n\nconst mapStateToProps = state => {\n const { twoFactorDefinition, customUserManagementDefinition } = state;\n return {\n ...twoFactorDefinition,\n ...customUserManagementDefinition,\n };\n};\n\nexport default withRouter(\n connect(\n mapStateToProps,\n { ...mapDispatchToProps },\n )(Destinations),\n);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { BreadcrumbItem } from 'reactstrap';\nimport { Validate } from '@myie/interact';\nimport { connect } from 'react-redux';\nimport { Content, AppMeta, Markdown } from '@myie/interact-dom';\nimport { TwoFactor } from '@myie/interact';\nimport { mapStateToProps, mapDispatchToProps } from '@myie/interact-two-factor';\nimport { CONTACTS } from '@myie/interact-local-dom';\nimport NoDestinations from './NoDestinations';\nimport Destinations from './Destinations';\n\nclass SelectDestination extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n mobNumberNotFound: false,\n };\n }\n\n componentDidMount() {\n const { getDestinations } = this.props;\n getDestinations({\n ChallengeKey: TwoFactor.getKey(),\n });\n }\n\n componentWillUnmount() {\n const { resetDestinations } = this.props;\n resetDestinations();\n }\n\n setMobNumberNotFound = () => {\n this.setState({ ...this.state, mobNumberNotFound: true });\n };\n\n cancel = () => {\n const { finishTwoFactor } = this.props;\n finishTwoFactor({});\n };\n\n onChange = e => {\n const { name, value } = e.target;\n let { form } = this.state;\n form = Validate.input(name, value, form, true);\n this.setState({ ...this.state, form });\n };\n\n getErrorMessage = () => {\n const { form } = this.state;\n\n let message = null;\n if (form.destination.state && Validate.isInvalid(form.destination.state)) {\n message = (\n \n \n
\n );\n }\n\n return message;\n };\n\n render() {\n const { destinations, error } = this.props;\n const { mobNumberNotFound } = this.state;\n\n if (error) {\n return ;\n }\n if (!destinations) {\n return (\n \n \n
\n );\n }\n if (\n mobNumberNotFound ||\n !destinations.Destinations ||\n destinations.Destinations.length === 0\n ) {\n return ;\n }\n\n return (\n \n \n \n \n
\n \n \n \n \n \n \n \n
\n OTP that we will send to your mobile phone.`}\n />\n \n \n );\n }\n}\n\nSelectDestination.propTypes = {\n destinations: PropTypes.any,\n error: PropTypes.any,\n finishTwoFactor: PropTypes.any,\n getDestinations: PropTypes.any,\n resetDestinations: PropTypes.any,\n sendChallenge: PropTypes.any,\n setDestination: PropTypes.func,\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(SelectDestination);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { mapStateToProps, mapDispatchToProps } from '@myie/interact-two-factor';\nimport { Button, Alert } from 'reactstrap';\nimport { Content, AppMeta } from '@myie/interact-dom';\nimport { CONTACTS } from '@myie/interact-local-dom';\n\nclass Failed extends React.Component {\n retry = e => {\n const { retry } = this.props;\n e.preventDefault();\n retry();\n };\n\n render() {\n return (\n <>\n \n \n \n \n \n \n \n \n \n
\n >\n );\n }\n}\n\nFailed.propTypes = {\n finishTwoFactor: PropTypes.any,\n resetChallenge: PropTypes.any,\n resetDestinations: PropTypes.any,\n retry: PropTypes.func,\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(Failed);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { mapStateToProps, mapDispatchToProps } from '@myie/interact-two-factor';\nimport { Content, Markdown } from '@myie/interact-dom';\nimport { Link } from 'react-router-dom';\nclass ExpiredCode extends React.Component {\n cancel = e => {\n const { finishTwoFactor } = this.props;\n e.preventDefault();\n finishTwoFactor();\n };\n\n render() {\n return (\n <>\n \n OTP you entered has expired. Please start the session again by clicking the button below.`}\n />\n \n \n \n \n
\n >\n );\n }\n}\n\nExpiredCode.propTypes = {\n error: PropTypes.any,\n finishTwoFactor: PropTypes.any,\n reSet: PropTypes.any,\n failed: PropTypes.any,\n challenge: PropTypes.any,\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(ExpiredCode);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { mapStateToProps, mapDispatchToProps } from '@myie/interact-two-factor';\nimport { Content, Markdown } from '@myie/interact-dom';\nimport { Link } from 'react-router-dom';\n\nclass ExpiredChallenge extends React.Component {\n render() {\n return (\n <>\n \n OTP you entered has expired. Please start the session again by clicking the button below.`}\n />\n \n \n \n \n
\n >\n );\n }\n}\n\nExpiredChallenge.propTypes = {\n error: PropTypes.any,\n finishTwoFactor: PropTypes.any,\n resetChallenge: PropTypes.any,\n resetDestinations: PropTypes.any,\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(ExpiredChallenge);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { mapStateToProps, mapDispatchToProps } from '@myie/interact-two-factor';\nimport { Alert } from 'reactstrap';\nimport { Content, Markdown } from '@myie/interact-dom';\nimport { Link } from 'react-router-dom';\nimport { CONTACTS } from '@myie/interact-local-dom';\n\nclass ExceededAttempts extends React.Component {\n goBackHome = e => {\n const { finishTwoFactor } = this.props;\n e.preventDefault();\n finishTwoFactor();\n };\n\n render() {\n return (\n <>\n \n \n OTP too many times.\n \\nFor security reasons we have cancelled your request.`}\n />\n $[phone] so we can help you.`}\n />\n \n \n \n \n \n
\n >\n );\n }\n}\n\nExceededAttempts.propTypes = {\n finishTwoFactor: PropTypes.any,\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(ExceededAttempts);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { mapStateToProps, mapDispatchToProps } from '@myie/interact-two-factor';\nimport { Content } from '@myie/interact-dom';\nimport { Button } from 'reactstrap';\n\nclass Error extends React.Component {\n cancel = e => {\n const { finishTwoFactor } = this.props;\n e.preventDefault();\n finishTwoFactor();\n };\n\n render() {\n const { status } = this.props;\n return (\n \n );\n }\n}\n\nError.propTypes = {\n finishTwoFactor: PropTypes.any,\n status: PropTypes.any,\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(Error);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { TwoFactor } from '@myie/interact';\nimport { Validate, Session } from '@myie/interact';\nimport { Alert, Button } from 'reactstrap';\nimport { Text, Content, Markdown } from '@myie/interact-dom';\nimport { stateUtility, FormErrorList } from '../shared';\nimport { connect } from 'react-redux';\nimport { Link, withRouter } from 'react-router-dom';\nimport { mapDispatchToProps } from '@myie/interact-two-factor';\nimport { returnPath } from './ReturnPages';\nimport { RULES } from '../shared/constants/rules';\nimport { CONTACTS } from '@myie/interact-local-dom';\nclass CodeForm extends React.Component {\n constructor(props) {\n super(props);\n const storage = stateUtility.getPageState();\n const storageName =\n storage && storage.global && storage.global.storage\n ? storage.global.storage\n : '';\n this.state = {\n storageName,\n count: 0,\n form: {\n code: {\n rules: {\n title: 'Code',\n stop: true,\n required: {\n message: 'Please enter your One Time Passcode.',\n },\n format: {\n regex: RULES.activationCode2,\n message: 'Please enter a valid One Time Passcode.',\n },\n },\n },\n },\n };\n }\n\n getInitialState = () => {\n let state = {\n code: {\n rules: {\n title: 'Code',\n stop: true,\n required: {\n message: 'Please enter your One Time Passcode.',\n },\n format: {\n regex: RULES.activationCode2,\n message: 'Please enter a valid One Time Passcode.',\n },\n },\n },\n };\n\n return state;\n };\n\n onChange = e => {\n const { name, value } = e.target;\n let { form } = this.state;\n form = Validate.input(name, value, form);\n this.setState({ ...this.state, form });\n };\n\n removeCode = () => {\n let { form } = this.state;\n form.code.value = '';\n form.code.state.dirty = false;\n form.code.state.approval = {};\n this.setState({ ...this.state, form });\n };\n\n sendAnothercode = () => {\n const {\n sendChallenge,\n selectedDestination,\n setCodeResendStatus,\n } = this.props;\n const initialFormState = this.getInitialState();\n setCodeResendStatus(true);\n const request = {\n Destination: selectedDestination,\n ChallengeKey: TwoFactor.getKey(),\n };\n sendChallenge(request);\n this.setState({ ...this.state, form: initialFormState });\n };\n\n onBlur = e => {\n const { name, value } = e.target;\n let { form } = this.state;\n form = Validate.input(name, value, form, true);\n this.setState({ ...this.state, form });\n };\n\n cancel = () => {\n if (localStorage.getItem('firstLogin')) {\n window.location.href = CONTACTS.externalHomeURL;\n return null;\n }\n\n const { finishTwoFactor, history } = this.props;\n const { storageName } = this.state;\n const returnTo = returnPath(storageName);\n finishTwoFactor({});\n if (Session.isAuthenticated() && returnTo) {\n stateUtility.resetComponentState(storageName);\n history.push(returnTo);\n }\n };\n\n continue = e => {\n e.preventDefault();\n const { addCount, history } = this.props;\n let { form } = this.state;\n form = Validate.form(form);\n this.setState({\n ...this.state,\n form,\n });\n\n if (!form.approved) {\n return;\n }\n TwoFactor.setStatus('');\n addCount();\n TwoFactor.replay(form.code.value);\n const storage = stateUtility.getPageState();\n\n let stateData = {\n url: { twoFaStatus: 'finished' },\n };\n if (storage && storage.global && storage.global.storage) {\n let page = storage[storage.global.storage];\n if (page && page.url && page.url.pageStage) {\n stateData.url.pageStage = page.url.pageStage;\n }\n }\n\n stateUtility.directlyUpdateUrl(\n stateData,\n storage && storage.global && storage.global.storage\n ? storage.global.storage\n : '',\n history,\n );\n stateUtility.setPageState(\n storage && storage.global && storage.global.storage\n ? storage.global.storage\n : '',\n 'twoFaStatus',\n 'finished',\n );\n this.removeCode();\n };\n\n modfiyDestination = destination => {\n return destination.substring(destination.length - 3).toString();\n };\n\n render() {\n const { form } = this.state;\n const { failed, selectedDestination, count, isFetching } = this.props;\n return (\n \n {count === 1 && failed ? (\n
\n \n \n ) : (\n ''\n )}\n {failed && count !== 1 ? (\n
\n OTP. Please check and try again.\"\n />\n \n ) : (\n ''\n )}\n
\n\n
\n Please enter the OTP we have sent to the mobile phone number\n ending $[destination].`}\n />\n }\n id=\"otp-code\"\n autoFocus\n field=\"code\"\n validation={form.code}\n onChange={this.onChange}\n onBlur={this.onBlur}\n maxLength={'6'}\n />\n \n
\n
\n \n this.sendAnothercode(0)}\n className=\"btn btn-link\"\n type={'button'}\n disabled={isFetching}\n >\n \n \n
\n
\n \n \n \n \n {Session.isAuthenticated() ? (\n \n \n \n ) : (\n \n \n \n )}\n
\n \n
\n );\n }\n}\n\nCodeForm.propTypes = {\n failed: PropTypes.any,\n finishTwoFactor: PropTypes.any,\n sendChallenge: PropTypes.any,\n count: PropTypes.any,\n selectedDestination: PropTypes.string,\n retry: PropTypes.func,\n setCodeResendStatus: PropTypes.func,\n setRequestCount: PropTypes.any,\n resetActivation: PropTypes.func,\n history: PropTypes.any,\n addCount: PropTypes.func,\n location: PropTypes.any,\n pathname: PropTypes.any,\n isFetching: PropTypes.bool,\n};\n\nconst mapStateToProps = state => {\n const { twoFactorDefinition, customUserManagementDefinition } = state;\n return {\n ...twoFactorDefinition,\n ...customUserManagementDefinition,\n };\n};\n\nexport default withRouter(\n connect(\n mapStateToProps,\n { ...mapDispatchToProps },\n )(CodeForm),\n);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { BreadcrumbItem } from 'reactstrap';\nimport { Content, AppMeta } from '@myie/interact-dom';\nimport { connect } from 'react-redux';\nimport { mapDispatchToProps } from '@myie/interact-two-factor';\nimport { CONTACTS } from '@myie/interact-local-dom';\nimport CodeForm from './CodeForm';\n\nclass Code extends React.Component {\n render() {\n const { setCodeResendStatus, addCount, count } = this.props;\n return (\n \n
\n
\n
\n
\n \n \n \n \n \n \n \n
\n
\n
\n );\n }\n}\n\nCode.propTypes = {\n failed: PropTypes.any,\n finishTwoFactor: PropTypes.any,\n sendChallenge: PropTypes.any,\n selectedDestination: PropTypes.string,\n retry: PropTypes.func,\n setCodeResendStatus: PropTypes.func,\n reSet: PropTypes.any,\n addCount: PropTypes.any,\n count: PropTypes.any,\n};\n\nconst mapStateToProps = state => {\n const { twoFactorDefinition, custombrandAuthenticationDefinition } = state;\n return {\n ...twoFactorDefinition,\n ...custombrandAuthenticationDefinition,\n };\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(Code);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { mapStateToProps, mapDispatchToProps } from '@myie/interact-two-factor';\nimport { Content, Markdown } from '@myie/interact-dom';\nimport { Link } from 'react-router-dom';\n\nclass ExceededRequests extends React.Component {\n retry = e => {\n const { resetDestinations, resetChallenge } = this.props;\n e.preventDefault();\n resetDestinations();\n resetChallenge();\n };\n\n cancel = e => {\n const { finishTwoFactor } = this.props;\n e.preventDefault();\n finishTwoFactor();\n };\n\n render() {\n return (\n <>\n \n OTP requests. For security reasons please wait for 24 hours before you try again.`}\n />\n \n \n \n \n
\n >\n );\n }\n}\n\nExceededRequests.propTypes = {\n finishTwoFactor: PropTypes.any,\n resetChallenge: PropTypes.any,\n resetDestinations: PropTypes.any,\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(ExceededRequests);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Validate } from '@myie/interact';\nimport { connect } from 'react-redux';\nimport { Button } from 'reactstrap';\nimport { Radio, RadioGroup, Content } from '@myie/interact-dom';\nimport { TwoFactor } from '@myie/interact';\nimport { mapStateToProps, mapDispatchToProps } from '@myie/interact-two-factor';\nimport { mapDispatchToProps as mapDispatchToProps_auth } from '@myie/interact-authentication';\nimport { Link } from 'react-router-dom';\nimport NoDestinations from './NoDestinations';\n\nclass DestinationAuth extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n form: {\n destination: {\n rules: {\n required: true,\n },\n },\n },\n disabled: false,\n };\n }\n\n componentDidMount() {\n const { getDestinations, destinations } = this.props;\n if (!destinations || !destinations.Destinations) {\n getDestinations({\n ChallengeKey: TwoFactor.getKey(),\n });\n }\n }\n\n componentWillUnmount() {\n const { resetDestinations } = this.props;\n resetDestinations();\n }\n\n continue = e => {\n e.preventDefault();\n this.setState({ disabled: true });\n const { sendChallenge, setDestination, page, setResend } = this.props;\n if (page === 'resend') {\n setResend();\n }\n var { form } = this.state;\n form = Validate.form(form);\n this.setState({\n ...this.state,\n form,\n });\n if (!form.approved) {\n this.setState({ disabled: false });\n return;\n }\n const selectedDestination = form.destination.value;\n setDestination(selectedDestination);\n const request = {\n Destination: selectedDestination,\n ChallengeKey: TwoFactor.getKey(),\n };\n sendChallenge(request);\n this.setState({ disabled: false });\n };\n\n cancel = () => {\n const { finishTwoFactor } = this.props;\n finishTwoFactor({});\n };\n\n onChange = e => {\n const { name, value } = e.target;\n var { form } = this.state;\n form = Validate.input(name, value, form, true);\n this.setState({ ...this.state, form });\n };\n\n getErrorMessage = () => {\n const { form } = this.state;\n\n let message = null;\n if (form.destination.state && Validate.isInvalid(form.destination.state)) {\n message = (\n \n );\n }\n\n return message;\n };\n\n render() {\n const { destinations, error, page, mobNumberNotFound } = this.props;\n const { form } = this.state;\n const numbers = [];\n if (error) {\n return ;\n }\n if (!destinations) {\n return ;\n }\n if (\n mobNumberNotFound ||\n !destinations.Destinations ||\n destinations.Destinations.length === 0\n ) {\n return ;\n }\n destinations.Destinations.forEach((d, i) => {\n if (d.includes('@')) {\n numbers.push(\n ,\n );\n } else {\n numbers.push(\n ,\n );\n }\n });\n\n return (\n <>\n \n \n {numbers}\n \n {this.getErrorMessage()}\n {page === 'activate' ? (\n <>\n \n \n \n \n \n \n \n
\n >\n ) : (\n ''\n )}\n {page === 'resend' ? (\n <>\n \n \n \n \n \n \n \n
\n >\n ) : (\n ''\n )}\n \n >\n );\n }\n}\n\nDestinationAuth.propTypes = {\n destinations: PropTypes.any,\n error: PropTypes.any,\n finishTwoFactor: PropTypes.any,\n getDestinations: PropTypes.any,\n resetDestinations: PropTypes.any,\n sendChallenge: PropTypes.any,\n page: PropTypes.any,\n mobNumberNotFound: PropTypes.any,\n setMobNumberNotFound: PropTypes.any,\n setDestination: PropTypes.func,\n setResend: PropTypes.any,\n};\n\nexport default connect(\n mapStateToProps,\n {\n ...mapDispatchToProps,\n ...mapDispatchToProps_auth,\n },\n)(DestinationAuth);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Validate } from '@myie/interact';\nimport { connect } from 'react-redux';\nimport { Content, ContactNumber, AppMeta } from '@myie/interact-dom';\nimport { TwoFactor } from '@myie/interact';\nimport { mapStateToProps, mapDispatchToProps } from '@myie/interact-two-factor';\nimport NoDestinations from './NoDestinations';\nimport DestinationAuth from './DestinationAuth';\nimport { CONTACTS } from '@myie/interact-local-dom';\nclass SelectDestinationAuth extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n mobNumberNotFound: false,\n };\n }\n\n componentDidMount() {\n const { getDestinations } = this.props;\n getDestinations({\n ChallengeKey: TwoFactor.getKey(),\n });\n }\n\n componentWillUnmount() {\n const { resetDestinations } = this.props;\n resetDestinations();\n }\n\n setMobNumberNotFound = () => {\n this.setState({ ...this.state, mobNumberNotFound: true });\n };\n\n cancel = () => {\n const { finishTwoFactor } = this.props;\n finishTwoFactor({});\n };\n\n onChange = e => {\n const { name, value } = e.target;\n var { form } = this.state;\n form = Validate.input(name, value, form, true);\n this.setState({ ...this.state, form });\n };\n\n getErrorMessage = () => {\n const { form } = this.state;\n\n let message = null;\n if (form.destination.state && Validate.isInvalid(form.destination.state)) {\n message = (\n \n );\n }\n\n return message;\n };\n\n render() {\n const { destinations, error } = this.props;\n const { mobNumberNotFound } = this.state;\n\n if (error) {\n return ;\n }\n if (!destinations) {\n return ;\n }\n if (\n mobNumberNotFound ||\n !destinations.Destinations ||\n destinations.Destinations.length === 0\n ) {\n return ;\n }\n\n return (\n <>\n \n \n \n \n \n \n
\n\n \n >\n );\n }\n}\n\nSelectDestinationAuth.propTypes = {\n destinations: PropTypes.any,\n error: PropTypes.any,\n finishTwoFactor: PropTypes.any,\n getDestinations: PropTypes.any,\n resetDestinations: PropTypes.any,\n sendChallenge: PropTypes.any,\n setDestination: PropTypes.func,\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(SelectDestinationAuth);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { TwoFactor } from '@myie/interact';\nimport { Validate } from '@myie/interact';\nimport { Row, Col, Alert, Button } from 'reactstrap';\nimport { Text, Content } from '@myie/interact-dom';\nimport { connect } from 'react-redux';\nimport { Link } from 'react-router-dom';\nimport { mapStateToProps, mapDispatchToProps } from '@myie/interact-two-factor';\n\nclass CodeFormAuth extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n form: {\n code: {\n rules: {\n title: 'Code',\n stop: true,\n required: {\n message: 'Please enter your one time passcode',\n },\n format: {\n regex: /^.{6}$/,\n message: 'Please enter a valid one time passcode',\n },\n },\n },\n },\n };\n }\n\n onChange = e => {\n const { name, value } = e.target;\n var { form } = this.state;\n form = Validate.input(name, value, form);\n this.setState({ ...this.state, form });\n };\n\n removeCode = () => {\n var { form } = this.state;\n form.code.value = '';\n form.code.state.dirty = false;\n form.code.state.approval = {};\n this.setState({ ...this.state, form });\n };\n\n onBlur = e => {\n const { name, value } = e.target;\n var { form } = this.state;\n form = Validate.input(name, value, form, true);\n this.setState({ ...this.state, form });\n };\n\n continue = e => {\n e.preventDefault();\n var { form } = this.state;\n form = Validate.form(form);\n this.setState({\n ...this.state,\n form,\n });\n if (!form.approved) {\n return;\n }\n TwoFactor.setStatus('');\n TwoFactor.replay(form.code.value);\n this.removeCode();\n };\n\n render() {\n const { form } = this.state;\n const { failed } = this.props;\n return (\n \n );\n }\n}\n\nCodeFormAuth.propTypes = {\n failed: PropTypes.any,\n finishTwoFactor: PropTypes.any,\n sendChallenge: PropTypes.any,\n selectedDestination: PropTypes.string,\n retry: PropTypes.func,\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(CodeFormAuth);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Content } from '@myie/interact-dom';\nimport { connect } from 'react-redux';\nimport { mapStateToProps, mapDispatchToProps } from '@myie/interact-two-factor';\nimport CodeFormAuth from './CodeFormAuth';\n\nclass CodeAuth extends React.Component {\n constructor(props) {\n super(props);\n this.state = {};\n }\n\n render() {\n return (\n \n \n \n
\n );\n }\n}\n\nCodeAuth.propTypes = {\n failed: PropTypes.any,\n finishTwoFactor: PropTypes.any,\n sendChallenge: PropTypes.any,\n selectedDestination: PropTypes.string,\n retry: PropTypes.func,\n reSet: PropTypes.any,\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(CodeAuth);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { Session } from '@myie/interact';\nimport { mapDispatchToProps } from '@myie/interact-two-factor';\nimport SelectDestination from './SelectDestination';\nimport Failed from './Failed';\nimport ExpiredCode from './ExpiredCode';\nimport ExpiredChallenge from './ExpiredChallenge';\nimport ExceededAttempts from './ExceededAttempts';\nimport Error from './Error';\nimport Code from './Code';\nimport ExceededRequests from './ExceededRequests';\nimport { mapDispatchToProps as mapDispatchToProps_auth } from '@myie/interact-authentication';\nimport SelectForgotttenDestination from './SelectDestinationAuth';\nimport CodeAuth from './CodeAuth';\n\nclass TwoFactorFlow extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n selectedDestination: null,\n newCodeRequested: false,\n localStatus: false,\n count: 0,\n isForgottenPasswordDetails: false,\n };\n this.reSetTwoFactor();\n }\n\n static getDerivedStateFromProps = nextProps => {\n const { status } = nextProps;\n\n if (status === 'FAILED') {\n return {\n localStatus: 'FAILED',\n };\n }\n\n return null;\n };\n\n componentDidMount() {\n const { forgottenPasswordDetails, resetForgottenPassword } = this.props;\n if (forgottenPasswordDetails) {\n this.setState({ ...this.state, isForgottenPasswordDetails: true }, () => {\n resetForgottenPassword();\n });\n }\n }\n\n addCount = () => {\n let { count } = this.state;\n const { status } = this.props;\n if (status !== 'FAILED') {\n return {\n count: 1,\n };\n } else {\n this.setState({\n ...this.state,\n count: count + 1,\n });\n }\n };\n\n setDestination = selectedDestination => {\n this.setState({ ...this.state, selectedDestination });\n };\n\n setCodeResendStatus = newCodeRequested => {\n this.setState({ ...this.state, newCodeRequested });\n };\n reSetTwoFactor = () => {\n const { resetDestinations, resetChallenge } = this.props;\n resetDestinations();\n resetChallenge();\n };\n\n reSet = () => {\n this.setState({ ...this.state, selectedDestination: null });\n this.reSetTwoFactor();\n };\n\n render() {\n const { status, challenge = {} } = this.props;\n const {\n selectedDestination,\n newCodeRequested,\n localStatus,\n time,\n count,\n addCounter,\n } = this.state;\n const isAuthenticated = Session.isAuthenticated();\n\n if (localStatus === 'FAILED' && status !== 'EXCEEDED') {\n if (this.state.isForgottenPasswordDetails) {\n return (\n \n );\n } else {\n return (\n
\n );\n }\n }\n switch (status) {\n case 'EXPIRED_CODE':\n return (\n \n );\n case 'EXPIRED_CHALLENGE':\n return (\n \n );\n case 'EXCEEDED':\n return ;\n default:\n }\n if (challenge) {\n switch (challenge.ResponseStatus) {\n case 'Success':\n if (this.state.isForgottenPasswordDetails) {\n return (\n \n );\n } else {\n return (\n
\n );\n }\n case 'Failed':\n return ;\n case 'ExceededMaximumActivationCodeRequests':\n return ;\n default:\n }\n }\n if (!newCodeRequested) {\n switch (status) {\n case 'ISSUED':\n if (this.state.isForgottenPasswordDetails) {\n return (\n \n );\n } else {\n return ;\n }\n default:\n return ;\n }\n } else {\n if (this.state.isForgottenPasswordDetails) {\n return (\n \n );\n } else {\n return (\n
\n );\n }\n }\n }\n}\n\nTwoFactorFlow.propTypes = {\n challenge: PropTypes.object,\n destinations: PropTypes.any,\n resetChallenge: PropTypes.any,\n resetDestinations: PropTypes.any,\n status: PropTypes.any,\n forgottenPasswordDetails: PropTypes.any,\n resetForgottenPassword: PropTypes.any,\n};\n\nconst mapStateToProps = state => {\n const { twoFactorDefinition, authenticationDefinition } = state;\n return {\n ...twoFactorDefinition,\n ...authenticationDefinition,\n };\n};\n\nexport default connect(\n mapStateToProps,\n {\n ...mapDispatchToProps,\n ...mapDispatchToProps_auth,\n },\n)(TwoFactorFlow);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { mapStateToProps, mapDispatchToProps } from '@myie/interact-two-factor';\nimport { Dialog, Content } from '@myie/interact-dom';\nimport TwoFactorFlow from './TwoFactorFlow';\n\nclass TwoFactorModal extends React.Component {\n render() {\n const { inProgress, children } = this.props;\n const title = (\n \n );\n return (\n \n {inProgress ? (\n \n \n \n ) : null}\n {children} \n \n );\n }\n}\n\nTwoFactorModal.propTypes = {\n children: PropTypes.any,\n finishTwoFactor: PropTypes.any,\n inProgress: PropTypes.any,\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(TwoFactorModal);\n","import React from 'react';\nimport { HelpContactSidebar } from '@myie/interact-dom';\nimport { CONTACTS } from '@myie/interact-local-dom';\n\nclass TwoFactorSideBar extends React.Component {\n render() {\n return (\n \n );\n }\n}\n\nexport default TwoFactorSideBar;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport TwoFactorFlow from './TwoFactorFlow';\nimport { connect } from 'react-redux';\nimport { mapStateToProps, mapDispatchToProps } from '@myie/interact-two-factor';\nimport { withRouter } from 'react-router-dom';\nimport TwoFactorSidebar from './TwoFactorSidebar';\n\nclass TwoFactorPages extends React.Component {\n constructor(props) {\n super(props);\n\n this.state = {\n location: '',\n };\n }\n componentDidMount() {\n this.updateLocation();\n }\n\n componentDidUpdate() {\n this.updateLocation();\n }\n\n updateLocation = () => {\n this.unlisten = this.props.history.listen(location => {\n this.event = { eventupdate: location, test: 'test' };\n });\n const location = this.props.location;\n if (location !== this.state.location) {\n this.setState({ location });\n }\n };\n\n render() {\n const { inProgress, children } = this.props;\n //TwoFactorFlow is displayed overlapping the main content. So it's categorized as a dialog rather than the page content in terms of accessibility.\n return (\n \n {inProgress ? (\n \n \n \n \n \n
\n ) : null}\n \n {children}\n
\n \n );\n }\n}\n\nTwoFactorPages.propTypes = {\n children: PropTypes.any,\n finishTwoFactor: PropTypes.any,\n inProgress: PropTypes.any,\n history: PropTypes.any,\n location: PropTypes.any,\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps,\n)(withRouter(TwoFactorPages));\n","import TwoFactorSidebar from './TwoFactorSidebar';\n\nconst TwoFactorSidebars = [{ url: '2fa', Sidebar: TwoFactorSidebar }];\n\nexport default TwoFactorSidebars;\n","/* eslint-disable no-mixed-spaces-and-tabs, prettier/prettier */\n\nimport { AccountsSidebars } from '@myie/interact-accounts-dom'\nimport { AuthenticationSidebars } from '@myie/interact-authentication-dom'\nimport { TwoFactorSidebars } from '@myie/interact-two-factor-dom'\nimport { MessagingTwowaySidebars } from '@myie/interact-messaging-twoway-dom'\n\n\nconst RegisteredSidebars = []\n\nAccountsSidebars.forEach(sb => {\n\tRegisteredSidebars.push(sb)\n}); \n\nAuthenticationSidebars.forEach(sb => {\n\tRegisteredSidebars.push(sb)\n}); \n\nTwoFactorSidebars.forEach(sb => {\n\tRegisteredSidebars.push(sb)\n}); \n\nMessagingTwowaySidebars.forEach(sb => {\n\tRegisteredSidebars.push(sb)\n}); \n\n\n\nexport default RegisteredSidebars\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport DefaultSidebar from './DefaultSidebar';\nimport RegisteredSidebars from './Registered';\nimport { TwoFactorSidebars } from '@myie/interact-two-factor-dom';\n\nTwoFactorSidebars.forEach(sb => {\n RegisteredSidebars.push(sb);\n});\n\nconst HasSidebar = props => {\n const pathname = props.location.pathname;\n let Sidebar = DefaultSidebar;\n\n RegisteredSidebars.forEach(sb => {\n if (pathname && pathname.startsWith(sb.url)) {\n Sidebar = sb.Sidebar;\n }\n });\n\n if (Sidebar) {\n return true;\n } else {\n return false;\n }\n};\n\nclass Sidebar extends Component {\n render() {\n const pathname = this.props.location.pathname;\n let Sidebar = DefaultSidebar;\n\n RegisteredSidebars.forEach(sb => {\n if (pathname && pathname.startsWith(sb.url)) {\n Sidebar = sb.Sidebar;\n }\n });\n\n if (Sidebar != null) {\n return ;\n } else {\n return null;\n }\n }\n}\n\nSidebar.propTypes = {\n location: PropTypes.any,\n};\n\nexport default Sidebar;\nexport { HasSidebar };\n","/* eslint-disable no-mixed-spaces-and-tabs, prettier/prettier */\n\nimport { AccountsMenuItems } from '@myie/interact-accounts-dom'\nimport { ServicesMenuItems } from '@myie/interact-services-dom'\nimport { MessagingTwowayMenuItems } from '@myie/interact-messaging-twoway-dom'\nimport { SavingsServicingMenuItems } from '@myie/interact-savings-servicing-dom'\n\n\nconst RegisteredMenus = []\n\nAccountsMenuItems.forEach(sb => {\n\tRegisteredMenus.push(sb)\n}); \n\nServicesMenuItems.forEach(sb => {\n\tRegisteredMenus.push(sb)\n}); \n\nMessagingTwowayMenuItems.forEach(sb => {\n\tRegisteredMenus.push(sb)\n}); \n\nSavingsServicingMenuItems.forEach(sb => {\n\tRegisteredMenus.push(sb)\n}); \n\n\n\nexport default RegisteredMenus\n","import React, { Component } from 'react';\nimport {\n Navbar,\n Container,\n Collapse,\n Nav,\n NavItem,\n NavbarToggler,\n} from 'reactstrap';\nimport { Session } from '@myie/interact';\nimport RegisteredMenus from './Registered';\n\nclass Menu extends Component {\n constructor(props) {\n super(props);\n\n this.toggle = this.toggle.bind(this);\n this.state = {\n isOpen: false,\n };\n }\n\n isActive(route, exact) {\n if (exact) {\n return window.location.pathname === route;\n }\n var re = new RegExp(`^${route}[/]{0,1}`);\n return window.location.pathname.match(re) !== null;\n }\n\n toggle() {\n this.setState({\n ...this.state,\n isOpen: !this.state.isOpen,\n });\n }\n\n render() {\n // don't show menu if not logged in\n if (!Session.isAuthenticated()) {\n return <>>;\n } else {\n return (\n \n \n \n \n \n \n \n \n \n {RegisteredMenus.map(sb => (\n \n { }\n \n ))}\n \n \n \n \n );\n }\n }\n}\n\nexport default Menu;\n","import React from 'react';\nimport { Redirect } from 'react-router-dom';\nimport { Session } from '@myie/interact';\n\nconst Home = () => {\n return (\n <>\n {Session.isAuthenticated() ? (\n \n ) : (\n \n )}\n >\n );\n};\n\nexport default Home;\n","import React from 'react';\nimport { Settings } from '@myie/interact';\nimport PropTypes from 'prop-types';\n\nclass SignIn extends React.Component {\n constructor(props) {\n super(props);\n const { state } = this.props.location;\n this.state = { referer: state && state.referer ? state.referer : null };\n }\n\n signinRedirect = () => {\n localStorage.setItem('redirectUri', this.state.referer);\n Settings.userManager.signinRedirect({});\n };\n\n render() {\n this.signinRedirect();\n return Loading... ;\n }\n}\n\nSignIn.propTypes = {\n location: PropTypes.any,\n};\n\nexport default SignIn;\n","import * as React from 'react';\nimport { Settings } from '@myie/interact';\n\nclass SignOut extends React.Component {\n logout = () => {\n Settings.userManager.signoutRedirect({\n id_token_hint: localStorage.getItem('id_token'),\n });\n Settings.userManager.signoutRedirectCallback().then(() => {\n localStorage.clear();\n window.sessionStorage.clear();\n window.location.replace('/');\n });\n window.localStorage.clear();\n window.sessionStorage.clear();\n Settings.userManager.clearStaleState();\n };\n render() {\n this.logout();\n return loading ;\n }\n}\n\nexport default SignOut;\n","import React from 'react';\nimport { Settings } from '@myie/interact';\n\nclass Callback extends React.Component {\n signinRedirectCallback = () => {\n Settings.userManager\n .signinRedirectCallback()\n .then(user => {\n this.user = user;\n //Session.set(user.id_token, user.profile);\n window.sessionStorage.setItem('mgr_id_token', user.id_token);\n window.sessionStorage.setItem('mgr_access_token', user.access_token);\n window.sessionStorage.setItem('mgr_refresh_token', user.refresh_token);\n\n this.navigateToScreen();\n })\n .catch(err => {\n //console.log(err);\n if (err.message === 'No state in response') {\n Settings.userManager.signinRedirect({}); //TODO: If the sign in process start from Oauth provider web site then getting state error then need to be call authorise again because of client secret\n }\n });\n };\n\n navigateToScreen = () => {\n const redirectUri = localStorage.getItem('redirectUri')\n ? localStorage.getItem('redirectUri')\n : '/';\n\n window.location.replace(redirectUri);\n };\n\n render() {\n this.signinRedirectCallback();\n return Loading... ;\n }\n}\n\nexport default Callback;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { Session, Connection } from '@myie/interact';\nimport { Route, Redirect, withRouter } from 'react-router-dom';\nimport { sessionTimer } from '@myie/interact-dom';\nimport { mapDispatchToProps } from '@myie/interact-shared';\nimport { mapDispatchToProps as mapDispatchToProps2FA } from '@myie/interact-two-factor';\n\nclass PrivateRoute extends React.Component {\n constructor(props) {\n super(props);\n const { location } = props;\n this.state = { pathname: location.pathname };\n }\n\n componentWillUnmount() {}\n\n componentDidMount() {\n if (Session.isAuthenticated()) {\n sessionTimer(this.props, true);\n }\n }\n\n static getDerivedStateFromProps(nextProps, prevState) {\n if (\n Session.isAuthenticated() &&\n prevState.pathname !== nextProps.location.pathname &&\n nextProps.computedMatch.url === nextProps.location.pathname\n ) {\n const lastRequestTime = new Date().getTime();\n window.sessionStorage.setItem('lastRequestTime', lastRequestTime);\n fetch(Connection.baseUrl('utility') + `v1.0/ping`, {\n method: 'get',\n headers: Connection.headers(),\n });\n return { ...prevState, pathname: nextProps.location.pathname };\n }\n return null;\n }\n\n render() {\n const { component: Component, render, ...rest } = this.props;\n if (Session.isAuthenticated()) {\n if (render) {\n return ;\n } else {\n return } />;\n }\n }\n\n return (\n (\n \n )}\n />\n );\n }\n}\n\nPrivateRoute.propTypes = {\n Component: PropTypes.any,\n component: PropTypes.any,\n computedMatch: PropTypes.any,\n location: PropTypes.any,\n render: PropTypes.any,\n};\n\nexport default withRouter(\n connect(\n null,\n { ...mapDispatchToProps2FA, ...mapDispatchToProps },\n )(PrivateRoute),\n);\n","import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { Settings } from '@myie/interact';\n\nclass SignOutCallback extends React.Component {\n signoutRedirectCallback = () => {\n Settings.userManager.signoutRedirectCallback();\n };\n render() {\n this.signoutRedirectCallback();\n return loading ;\n }\n}\n\nSignOutCallback.propTypes = {\n userManager: PropTypes.any,\n};\n\nexport default SignOutCallback;\n","import React from 'react';\nimport { Route } from 'react-router-dom';\n\nimport {\n SignOut,\n Callback,\n SignOutCallback,\n SignIn,\n} from '@myie/interact-manager-dom';\n\nconst Routes = [\n ,\n ,\n ,\n ,\n];\n\nexport default Routes;\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { Session, Settings } from '@myie/interact';\nimport { Switch, Route, withRouter } from 'react-router-dom';\nimport {\n Switch as MessageSwitch,\n Content,\n Markdown,\n NoMatch,\n NetworkError,\n GoogleTagManager,\n TimeOutModal,\n AvailableRoutes,\n AuthButton,\n Interceptor,\n BankHolidays,\n} from '@myie/interact-dom';\nimport { Sidebar, HasSidebar } from '@myie/interact-widget-sidebar-dom';\nimport { Media, Container, Row, Col } from 'reactstrap';\nimport { Menu } from '@myie/interact-widget-menu-dom';\nimport Home from './Home';\nimport moment from 'moment';\nimport { AppMeta, ScrollToTop } from '@myie/interact-dom';\nimport { TwoFactorPages } from '@myie/interact-two-factor-dom';\nimport { HelmetProvider } from 'react-helmet-async';\nimport { Routes as cmuRoutes } from '@myie/interact-manager-dom';\n\nclass Connect extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n location: '',\n };\n }\n\n componentDidMount() {\n this.updateLocation();\n }\n\n componentDidUpdate() {\n this.updateLocation();\n }\n\n updateLocation = () => {\n this.unlisten = this.props.history.listen(location => {\n this.event = { eventupdate: location, test: 'test' };\n });\n const location = this.props.location;\n if (location !== this.state.location) {\n this.setState({ location });\n }\n };\n\n render() {\n return (\n \n \n\n \n \n
\n \n
\n
\n
\n
\n
\n \n {Session.isAuthenticated() ? (\n \n \n \n \n \n ) : null}\n \n \n \n \n \n \n\n \n \n \n
\n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n {AvailableRoutes}\n {cmuRoutes}\n \n \n \n \n \n \n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n {\n return moment().format('YYYY');\n },\n },\n }}\n id=\"connect-version\"\n markdown={`Cambridge & Counties Bank Ltd is authorised by the Prudential Regulation Authority and regulated by the Financial Conduct Authority and the Prudential Regulation Authority under firm registration number 579415. Our authorisation can be checked at the Financial Services Register at [www.fca.org.uk](https://www.fca.org.uk).\n \\n Cambridge & Counties Bank Ltd Registered Office: Charnwood Court, 5b New Walk, Leicester England, LE1 6TE. Registered in England and Wales No. 07972522.\n \\n VAT Registration Number GB 208354420.\n \\n © Cambridge & Counties Bank Limited\n `}\n />\n
\n
\n
\n \n \n
\n
\n \n \n );\n }\n}\n\nConnect.propTypes = {\n history: PropTypes.any,\n location: PropTypes.any,\n};\n\nexport default withRouter(Connect);\n","import React, { Component } from 'react';\nimport { contentContainer } from '@myie/interact-dom';\nimport { Connect } from '@myie/interact-connect-dom';\nimport { withRouter } from 'react-router-dom';\n\nclass App extends Component {\n render() {\n return (\n \n \n
\n );\n }\n}\n\nexport default withRouter(contentContainer(App));\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.0/8 are considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl, {\n headers: { 'Service-Worker': 'script' }\n })\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","/* eslint-disable no-mixed-spaces-and-tabs, prettier/prettier */\n\nimport Config from './config.env.js';\n\nexport default Config;","/* eslint-disable no-mixed-spaces-and-tabs, prettier/prettier */\nimport {\n Session,\n Connection,\n Settings,\n TwoFactor,\n Utility,\n} from '@myie/interact';\nimport uuid from 'uuid';\nimport { createUserManager } from 'redux-oidc';\n\n// set global local to current browser language\n\nconst Config = async function() {\n // update with google tag manager id\n Settings.gtmId = 'GTM-53BH7TB';\n Settings.ticketExpiry = 20;\n Settings.sessionExpiry = 20;\n // using a common root as default\n let root = 'https://ccb-qa-app.ccbank-dev.co.uk';\n let site = `${window.location.protocol}//${window.location.hostname}${\n window.location.hostname.toLowerCase() !== 'localhost'\n ? ''\n : ':' + window.location.port\n }`;\n\n const client_id = '';\n const client_secret = '';\n\n const REACT_APP_AUTH_URL = 'https://auth.ccbank-dev.co.uk';\n const IDENTITY_ISSUER_URL = 'https://cognito-idp.eu-west-2.amazonaws.com/eu-west-2_P7V3VUMUD';\n\n let cms = \"https://qa-content.ccbank-dev.co.uk\";\n let auth_url = REACT_APP_AUTH_URL;\n let identity_url = IDENTITY_ISSUER_URL;\n\n // Check which environment\n let envname = window.location.hostname;\n let env = '.prod';\n \n if (envname.includes('.qa.cam')) {\n env = '.qanew';\n } else if (envname.includes('.uat.cam')) {\n env = '.uatnew';\n }\n\n if (envname.includes('editor')) {\n env = '-cmu' + env;\n }\n \n let response = await fetch('/DeploymentConfig/config' + env + '.json'); // fetch file from website location, fixed random name\n \n if (response) {\n try {\n const configuration = await response.json(); // extract json\n cms = configuration.cms || cms;\n root = configuration.root || root;\n auth_url = configuration.auth_url || auth_url;\n identity_url = configuration.identity_url || identity_url;\n Settings.gtmId = configuration.gtmId || Settings.gtmId;\n Settings.ticketExpiry =\n configuration.ticketExpiry || Settings.ticketExpiry;\n Settings.sessionExpiry =\n configuration.sessionExpiry || Settings.sessionExpiry;\n Settings.client_id =\n configuration.client_id || client_id;\n Settings.client_secret =\n configuration.client_secret || client_secret;\n } catch (e) {\n //Ignore error but fetch another filename to indicate error to the observant user!\n response = await fetch('/static/no-config-error.txt');\n }\n }\n\n const IDENTITY_CONFIG = {\n authority: auth_url,\n client_id: Settings.client_id,\n redirect_uri: `${site}/signin-oidc`,\n silent_redirect_uri: `${site}/silentrenew`,\n post_logout_redirect_uri: `${site}/logout/callback`,\n audience: '',\n response_type: 'code', //\"id_token token\",\n automaticSilentRenew: false,\n loadUserInfo: false,\n scope: 'openid profile email aws.cognito.signin.user.admin',\n acr_values: 'Level3',\n ui_locales: 'nb',\n filterProtocolClaims: false,\n revokeAccessTokenOnSignout: false,\n userInfoJwtIssuer: 'RS256',\n client_secret: Settings.client_secret,\n metadata: {\n issuer: identity_url,\n jwks_uri: identity_url + '/.well-known/jwks.json',\n authorization_endpoint: auth_url + '/oauth2/authorize',\n token_endpoint: auth_url + '/oauth2/token',\n userinfo_endpoint: auth_url + '/oauth2/userInfo',\n end_session_endpoint:\n auth_url +\n `/logout?client_id=${Settings.client_id}&redirect_uri=${site}/signin-oidc&response_type=code`,\n check_session_iframe: auth_url + '/connect/checksession',\n revocation_endpoint: auth_url + '/connect/revocation',\n introspection_endpoint: auth_url + '/connect/introspect',\n },\n };\n \n Settings.userManager = createUserManager(\n IDENTITY_CONFIG,\n () => true,\n false,\n '/callback',\n );\n\n // using common set of services\n\n Settings.cmsAvailable = true;\n\n Connection.config(\n {\n cmscontent: `${cms}/content/`,\n utility: `${root}/utility/`,\n accounts: `${root}/accounts/`,\n movemoney: `${root}/movemoney/`,\n usermanagement: `${root}/usermanagement/`,\n webauthentication: `${root}/webauthentication/`,\n cardservicing: `${root}/cardservicing/`,\n paybycard: `${root}/paybycard/`,\n loanservicing: `${root}/loanservicing/`,\n '2fa': `${root}/2fa/`,\n alerts: `${root}/alerts/`,\n messaging: `${root}/messaging/`,\n customccb: `${root}/customccb/`,\n },\n {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'x-brand-code': 'ccb',\n 'x-channel-type': 'WEB',\n 'x-device-type': 'WEB',\n 'x-client-version': '5.2',\n 'x-device-language': 'en-gb',\n 'x-request-id': function() {\n return uuid.v4();\n },\n 'x-session-ticket': function() {\n return Session.ticket();\n },\n 'x-challenge-key': function() {\n var key = TwoFactor.getKey();\n var value = TwoFactor.getValue();\n if (key && value) {\n return key;\n }\n return null;\n },\n 'x-challenge-code': function() {\n var key = TwoFactor.getKey();\n var value = TwoFactor.getValue();\n if (key && value) {\n return value;\n }\n return null;\n },\n },\n );\n\n Connection.cmuHeaders = function() {\n return {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n authorization: window.sessionStorage.getItem('mgr_access_token')\n ? window.sessionStorage.getItem('mgr_access_token')\n : null,\n };\n };\n\n Session.config(\n function(ticket, customer) {\n if (!ticket || !customer) {\n window.sessionStorage.removeItem('ticket');\n } else {\n window.sessionStorage.setItem(\n 'ticket',\n Utility.hexEncode(JSON.stringify({ ticket, customer })),\n );\n }\n },\n function() {\n const ticket = window.sessionStorage.getItem('ticket');\n if (ticket) {\n return JSON.parse(Utility.hexDecode(ticket)).customer;\n }\n return null;\n },\n function() {\n const ticket = window.sessionStorage.getItem('ticket');\n if (ticket) {\n return JSON.parse(Utility.hexDecode(ticket)).ticket;\n }\n return null;\n },\n );\n};\n\nexport default Config;","import 'react-app-polyfill/ie11';\nimport 'react-app-polyfill/stable';\nimport React from 'react';\nimport { render } from 'react-dom';\nimport { BrowserRouter as Router } from 'react-router-dom';\nimport { createStore, applyMiddleware, compose } from 'redux';\nimport { Provider } from 'react-redux';\nimport thunk from 'redux-thunk';\nimport { createLogger } from 'redux-logger';\nimport reducer from './reducers';\nimport { Settings } from '@myie/interact';\nimport secureFetch from './lib/secure-fetch/secureFetch';\nimport App from './App';\n//import registerServiceWorker from './registerServiceWorker';\nimport * as serviceWorker from './serviceWorker';\nimport './styling.css';\nimport { loadUser, OidcProvider } from 'redux-oidc';\n\n// apply configuration\nimport Config from './config.js';\n\n// Wrap global fetch function with a check to ensure the original\n// session is the same when the response returns.\n// eslint-disable-next-line no-global-assign\nfetch = secureFetch(fetch);\n\nconst middleware = [thunk];\nif (process.env.NODE_ENV === 'notset') {\n // Set to development to enable logging in dev\n middleware.push(createLogger());\n}\n\nconst composeEnhancers =\n typeof window === 'object' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__\n ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({\n // Specify extension’s options like name, actionsBlacklist, actionsCreators, serialize...\n })\n : compose;\n\nconst enhancer = composeEnhancers(\n applyMiddleware(...middleware),\n // other store enhancers if any\n);\n\n(async () => {\n await Config();\n const store = createStore(reducer, enhancer);\n loadUser(store, Settings.userManager);\n render(\n \n \n \n \n \n \n ,\n document.getElementById('root'),\n );\n})();\n\n//registerServiceWorker();\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: http://bit.ly/CRA-PWA\nserviceWorker.unregister();\n","import {\n ORGANISATION_REQUEST,\n ORGANISATION_PROGRESS,\n ORGANISATION_SUCCESS,\n ORGANISATION_FAILURE,\n} from '../actions/organisationTypes';\nimport { uniqBy } from 'lodash';\n\nconst ccbOrganisationDefinition = (state = {}, action) => {\n switch (action.type) {\n case ORGANISATION_SUCCESS:\n return {\n ...state,\n organisation: action.organisation,\n isFetching: action.isFetching,\n };\n case ORGANISATION_PROGRESS: {\n let allDetails = uniqBy(\n [...state.organisation.details, { ...action.detail }],\n 'CustomerId',\n );\n return {\n ...state,\n organisation: {\n ...state.organisation,\n details: allDetails,\n },\n isFetching: action.isFetching,\n };\n }\n case ORGANISATION_FAILURE:\n return {\n ...state,\n isFetching: action.isFetching,\n error: action.error,\n };\n case ORGANISATION_REQUEST:\n default:\n return state;\n }\n};\n\nexport default ccbOrganisationDefinition;\n","// start fetch process - get list of \"customers\" for person\nexport const ORGANISATION_REQUEST = 'ORGANISATION_REQUEST';\n\n// get details of a \"customer\"\nexport const ORGANISATION_PROGRESS = 'ORGANISATION_PROGRESS';\n\n// show details of each customer on list\nexport const ORGANISATION_SUCCESS = 'ORGANISATION_SUCCESS';\n\n// we failed to fetch list or we failed to fetch details - show error\nexport const ORGANISATION_FAILURE = 'ORGANISATION_FAILURE';\n\n// clear the organisation details - how is this different from ORGANISATION_REQUEST?\nexport const RESET_ORGANISATION = 'RESET_ORGANISATION';\n\n//Reset organisation details\nexport const RESET_ORGANISATION_DETAILS = 'RESET_ORGANISATION_DETAILS';\n\n//Get Organisation details\nexport const ORGANISATION_DETAILS_REQUEST = 'ORGANISATION_DETAILS_REQUEST';\n","import ccbOrganisationDefinition from './reducers/organisationDefinition';\n\nconst customccbOrganisationDefinition = (state = {}, action) => {\n var newState = state;\n newState = ccbOrganisationDefinition(newState, action);\n\n return newState;\n};\n\nexport default customccbOrganisationDefinition;\n","const mapStateToProps = state => {\n const { customccbOrganisationDefinition = {} } = state;\n const {\n organisation,\n error = null,\n isFetching,\n } = customccbOrganisationDefinition;\n // const newOrg = {\n // ...organisation,\n // login: state.authenticationDefinition.login,\n // };\n return {\n organisation,\n error,\n isFetching,\n };\n};\n\nexport default mapStateToProps;\n","import { Connection } from '@myie/interact';\n\nimport {\n ORGANISATION_REQUEST,\n ORGANISATION_DETAILS_REQUEST,\n ORGANISATION_PROGRESS,\n ORGANISATION_SUCCESS,\n ORGANISATION_FAILURE,\n} from './organisationTypes';\n\nexport const organisationRequest = () => ({\n type: ORGANISATION_REQUEST,\n organisation: { state: 'REQUEST', codes: [], details: [], detail: {} },\n isFetching: true,\n error: null,\n});\n\nexport const organisationDetailsRequest = () => ({\n type: ORGANISATION_DETAILS_REQUEST,\n organisation: { state: 'REQUEST', details: [], codes: [], detail: {} },\n isFetching: true,\n error: null,\n});\n\nexport const organisationFailed = error => ({\n type: ORGANISATION_FAILURE,\n isFetching: false,\n error: error.message,\n});\n\nexport const organisationDetailsReceive = json => ({\n type: ORGANISATION_PROGRESS,\n detail: json,\n isFetching: false,\n error: null,\n});\n\nexport const organisationReceive = json => ({\n type: ORGANISATION_SUCCESS,\n organisation: {\n codes: [...json.CustomerCollection.Customers],\n details: [],\n },\n isFetching: false,\n error: null,\n});\n\nexport const organisationfetch = request => dispatch => {\n //console.log('In organisationfetch ' + JSON.stringify(request));\n dispatch(organisationRequest());\n\n return fetch(Connection.baseUrl('customccb') + `v1.0/getcustomersforperson`, {\n method: 'post',\n headers: Connection.headers(),\n body: JSON.stringify(request),\n })\n .then(response => Connection.errored(response))\n .then(response => response.json())\n .then(json => dispatch(organisationReceive(json)))\n .catch(error => dispatch(organisationFailed(error)));\n};\n\nexport const organisationDetailsFetch = request => dispatch => {\n //console.log('In organisationDetailsFetch ' + JSON.stringify(request));\n dispatch(organisationDetailsRequest());\n return fetch(Connection.baseUrl('customccb') + `v1.0/getcustomer`, {\n method: 'post',\n headers: Connection.headers(),\n body: JSON.stringify(request),\n })\n .then(response => Connection.errored(response))\n .then(response => response.json())\n .then(json =>\n dispatch(\n organisationDetailsReceive({\n ...json.Customer,\n CustomerId: request.CustomerId,\n }),\n ),\n )\n .catch(error => dispatch(organisationFailed(error)));\n};\n","import * as organisationActions from './actions/organisationActions';\n\nconst mapDispatchToProps = {\n ...organisationActions,\n};\n\nexport default mapDispatchToProps;\n","import customccbOrganisationDefinition from './reducer';\nimport mapStateToProps from './mapStateToProps';\nimport mapDispatchToProps from './mapDispatchToProps';\n\nexport { customccbOrganisationDefinition, mapStateToProps, mapDispatchToProps };\n","import {\n INTERESTHISTORY_REQUEST,\n INTERESTHISTORY_SUCCESS,\n INTERESTHISTORY_FAILURE,\n RESET_INTERESTHISTORY,\n} from '../actions/interestRateTypes';\nimport update from 'immutability-helper';\n\nconst ccbInterestRateDefinition = (state = {}, action) => {\n let oldAccounts;\n let index;\n let account;\n switch (action.type) {\n case RESET_INTERESTHISTORY:\n return {\n ...state,\n interestHistory: {},\n };\n case INTERESTHISTORY_SUCCESS: {\n oldAccounts = state.accounts;\n index = oldAccounts.Accounts.findIndex(\n x => x.AccountKey.Key === action.accountkey.Key,\n );\n account = oldAccounts.Accounts[index];\n const interestHistory = action.interestHistory;\n\n const accountWithDocuments = update(account, {\n interestHistory: { $set: interestHistory },\n });\n const updatedAccounts = update(oldAccounts, {\n Accounts: { [index]: { $set: accountWithDocuments } },\n });\n return {\n ...state,\n accounts: updatedAccounts,\n isFetching: action.isFetching,\n };\n }\n case INTERESTHISTORY_FAILURE:\n return {\n ...state,\n isFetching: action.isFetching,\n error: action.error,\n };\n case INTERESTHISTORY_REQUEST:\n default:\n return state;\n }\n};\n\nexport default ccbInterestRateDefinition;\n","export const INTERESTHISTORY_REQUEST = 'INTERESTHISTORY_REQUEST';\nexport const INTERESTHISTORY_SUCCESS = 'INTERESTHISTORY_SUCCESS';\nexport const INTERESTHISTORY_FAILURE = 'INTERESTHISTORY_FAILURE';\nexport const RESET_INTERESTHISTORY = 'RESET_INTERESTHISTORY';\n","import {\n FETCH_DOCUMENTS_SUCCESS,\n FETCH_DOCUMENTS_FAILURE,\n FETCH_DOCUMENTS_REQUEST,\n RESET_DOCUMENT_DOWNLOAD,\n FETCH_DOCUMENT_DOWNLOAD_SUCCESS,\n FETCH_DOCUMENT_DOWNLOAD_FAILURE,\n FETCH_DOCUMENT_DOWNLOAD_REQUEST,\n} from '../actions/documentTypes';\nimport update from 'immutability-helper';\n\nconst ccbDocumentsDefinition = (state = {}, action) => {\n let oldAccounts;\n let index;\n let account;\n switch (action.type) {\n case RESET_DOCUMENT_DOWNLOAD:\n return {\n ...state,\n downloadedDocument: null,\n };\n case FETCH_DOCUMENTS_SUCCESS: {\n oldAccounts = state.accounts;\n index = oldAccounts.Accounts.findIndex(\n x => x.AccountKey.Key === action.accountkey.Key,\n );\n account = oldAccounts.Accounts[index];\n const documents = action.documents;\n\n const accountWithDocuments = update(account, {\n documents: { $set: documents },\n });\n const updatedAccounts = update(oldAccounts, {\n Accounts: { [index]: { $set: accountWithDocuments } },\n });\n return {\n ...state,\n accounts: updatedAccounts,\n isFetching: action.isFetching,\n };\n }\n\n case FETCH_DOCUMENTS_FAILURE:\n case FETCH_DOCUMENTS_REQUEST:\n return {\n ...state,\n isFetching: action.isFetching,\n error: action.error,\n };\n case FETCH_DOCUMENT_DOWNLOAD_SUCCESS:\n return {\n ...state,\n downloadedDocument: {\n document: action.downloadedDocument,\n documentKey: action.documentKey,\n },\n isFetching: action.isFetching,\n };\n case FETCH_DOCUMENT_DOWNLOAD_FAILURE:\n case FETCH_DOCUMENT_DOWNLOAD_REQUEST:\n return {\n ...state,\n isFetching: action.isFetching,\n error: action.error,\n };\n default:\n return state;\n }\n};\n\nexport default ccbDocumentsDefinition;\n","export const SET_LIST_MODE = 'SET_LIST_MODE';\nexport const SET_STATUS_MODE = 'SET_STATUS_MODE';\n\nexport const FETCH_DOCUMENTS_SUCCESS = 'FETCH_DOCUMENTS_SUCCESS';\nexport const FETCH_DOCUMENTS_FAILURE = 'FETCH_DOCUMENTS_FAILURE';\nexport const FETCH_DOCUMENTS_REQUEST = 'FETCH_DOCUMENTS_REQUEST';\nexport const RESET_DOCUMENT_DOWNLOAD = 'RESET_DOCUMENT_DOWNLOAD';\nexport const FETCH_DOCUMENT_DOWNLOAD_SUCCESS =\n 'FETCH_DOCUMENT_DOWNLOAD_SUCCESS';\nexport const FETCH_DOCUMENT_DOWNLOAD_FAILURE =\n 'FETCH_DOCUMENT_DOWNLOAD_FAILURE';\nexport const FETCH_DOCUMENT_DOWNLOAD_REQUEST =\n 'FETCH_DOCUMENT_DOWNLOAD_REQUEST';\n","export const SAVE_MATURITY_ARRAY = 'SAVE_MATURITY_ARRAY';\n\nexport const saveMaturityMessageArray = maturityAlertVisibleArray => ({\n type: SAVE_MATURITY_ARRAY,\n maturityAlertVisibleArray: maturityAlertVisibleArray,\n});\n","import { SAVE_MATURITY_ARRAY } from '../actions/MaturityActions';\n\nconst maturityDefinition = (state = {}, action) => {\n switch (action.type) {\n case SAVE_MATURITY_ARRAY:\n return {\n ...state,\n maturityAlertVisibleArray: action.maturityAlertVisibleArray,\n };\n default:\n return state;\n }\n};\n\nexport default maturityDefinition;\n","import ccbInterestRateDefinition from './reducers/interestRateDefinition';\nimport ccbDocumentsDefinition from './reducers/documentsDefinition';\nimport maturityDefinition from './reducers/maturityDefinition';\n\nconst accountsDefinition = (state = {}, action) => {\n var newState = state;\n newState = ccbInterestRateDefinition(newState, action);\n newState = ccbDocumentsDefinition(newState, action);\n newState = maturityDefinition(newState, action);\n return newState;\n};\n\nexport default accountsDefinition;\n","import { Connection } from '@myie/interact';\n\nimport {\n INTERESTHISTORY_REQUEST,\n INTERESTHISTORY_SUCCESS,\n INTERESTHISTORY_FAILURE,\n RESET_INTERESTHISTORY,\n} from './interestRateTypes';\n\nexport const resetInterestHistory = () => ({\n type: RESET_INTERESTHISTORY,\n});\nexport const interestHistoryRequest = () => ({\n type: INTERESTHISTORY_REQUEST,\n isFetching: true,\n error: null,\n});\n\nexport const interestHistoryFailed = error => ({\n type: INTERESTHISTORY_FAILURE,\n isFetching: false,\n error: error.message,\n});\n\nexport const interestHistoryReceive = (json, accountkey) => ({\n type: INTERESTHISTORY_SUCCESS,\n interestHistory: json,\n accountkey: accountkey,\n isFetching: false,\n error: null,\n});\n\nexport const getInterestHistory = request => dispatch => {\n dispatch(interestHistoryRequest());\n return fetch(Connection.baseUrl('customccb') + `v1.0/getinteresthistory`, {\n method: 'post',\n headers: Connection.headers(),\n body: JSON.stringify(request),\n })\n .then(response => Connection.errored(response))\n .then(response => response.json())\n .then(json => dispatch(interestHistoryReceive(json, request.AccountKey)))\n .catch(error => dispatch(interestHistoryFailed(error)));\n};\nexport const ccbShouldFetchInterestHistory = (state, request) => {\n if (!state.accounts || !state.accounts.Accounts) {\n return false;\n }\n const index = state.accounts.Accounts.findIndex(\n x => x.AccountKey.Key === request.AccountKey.Key,\n );\n if (index === -1) {\n return false;\n }\n if (!state.accounts.Accounts[index].InterestHistory) {\n return true;\n }\n\n return false;\n};\n\nexport const getInterestHistoryIfNeeded = request => (dispatch, getState) => {\n if (ccbShouldFetchInterestHistory(getState().accountsDefinition, request)) {\n return dispatch(getInterestHistory(request));\n }\n};\n","import { Connection } from '@myie/interact';\nimport {\n FETCH_DOCUMENTS_SUCCESS,\n FETCH_DOCUMENTS_FAILURE,\n FETCH_DOCUMENTS_REQUEST,\n RESET_DOCUMENT_DOWNLOAD,\n FETCH_DOCUMENT_DOWNLOAD_SUCCESS,\n FETCH_DOCUMENT_DOWNLOAD_FAILURE,\n FETCH_DOCUMENT_DOWNLOAD_REQUEST,\n} from './documentTypes';\n\nexport const ccbRequestDocuments = () => ({\n type: FETCH_DOCUMENTS_REQUEST,\n isFetching: true,\n error: null,\n});\n\nexport const ccbFailedDocuments = error => ({\n type: FETCH_DOCUMENTS_FAILURE,\n isFetching: false,\n error: error.message,\n});\n\nexport const ccbReceiveDocuments = (json, accountkey) => ({\n type: FETCH_DOCUMENTS_SUCCESS,\n documents: json,\n accountkey: accountkey,\n isFetching: false,\n error: null,\n});\n\nexport const ccbFetchDocuments = request => dispatch => {\n dispatch(ccbRequestDocuments());\n return fetch(Connection.baseUrl('accounts') + `v3.0/documents/getdocuments`, {\n method: 'post',\n headers: Connection.headers(),\n body: JSON.stringify(request),\n })\n .then(response => Connection.errored(response))\n .then(response => response.json())\n .then(json => dispatch(ccbReceiveDocuments(json, request.AccountKey)))\n .catch(error => dispatch(ccbFailedDocuments(error)));\n};\n\nexport const ccbShouldFetchDocuments = (state, request) => {\n if (!state.accounts || !state.accounts.Accounts) {\n return false;\n }\n const index = state.accounts.Accounts.findIndex(\n x => x.AccountKey.Key === request.AccountKey.Key,\n );\n if (index === -1) {\n return false;\n }\n if (!state.accounts.Accounts[index].documents) {\n return true;\n }\n\n return false;\n};\n\nexport const ccbFetchDocumentsIfNeeded = request => (dispatch, getState) => {\n if (ccbShouldFetchDocuments(getState().accountsDefinition, request)) {\n return dispatch(ccbFetchDocuments(request));\n }\n};\n\nexport const ccbRequestDocumentDownload = () => ({\n type: FETCH_DOCUMENT_DOWNLOAD_REQUEST,\n isFetching: true,\n error: null,\n});\n\nexport const ccbFailedDocumentDownload = error => ({\n type: FETCH_DOCUMENT_DOWNLOAD_FAILURE,\n isFetching: false,\n error: error.message,\n});\n\nexport const ccbReceiveDocumentDownload = (json, documentKey) => ({\n type: FETCH_DOCUMENT_DOWNLOAD_SUCCESS,\n downloadedDocument: json,\n documentKey: documentKey,\n isFetching: false,\n error: null,\n});\n\nexport const ccbFetchDocumentDownload = request => dispatch => {\n dispatch(ccbRequestDocumentDownload());\n return fetch(Connection.baseUrl('accounts') + `v3.0/documents/getdocument`, {\n method: 'post',\n headers: Connection.headers(),\n body: JSON.stringify(request),\n })\n .then(response => Connection.errored(response))\n .then(response => response.json())\n .then(json =>\n dispatch(ccbReceiveDocumentDownload(json, request.DocumentKey)),\n )\n .catch(error => dispatch(ccbFailedDocumentDownload(error)));\n};\n\nexport const ccbResetDocumentDownload = () => ({\n type: RESET_DOCUMENT_DOWNLOAD,\n});\n","import * as interestRateActions from './actions/interestRateActions';\nimport * as ccbDocumentActions from './actions/documentActions';\nimport * as MaturityActions from './actions/MaturityActions';\n\nconst mapDispatchToProps = {\n ...interestRateActions,\n ...ccbDocumentActions,\n ...MaturityActions,\n};\n\nexport default mapDispatchToProps;\n","import customccbAccountsDefinition from './reducer';\nimport mapStateToProps from './mapStateToProps';\nimport mapDispatchToProps from './mapDispatchToProps';\n\nexport { customccbAccountsDefinition, mapStateToProps, mapDispatchToProps };\n"],"sourceRoot":""}