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OAAAC,OAAA,GAAKtP,GACL,gBACAI,EACAE,GAEJb,EACAM,EACE,EAcX,EAX2E0P,IAAyE,IAAxE,YAAEpJ,EAAW,gBAAEC,EAAe,eAAEE,EAAc,SAAEP,EAAQ,UAAEE,GAAUsJ,EAC5I,OACI/P,EAAAA,cAACgQ,EAAAA,OAAML,OAAAC,OAAA,GAAKjJ,GACPC,GAAmB5G,EAAAA,cAACyP,EAAeE,OAAAC,OAAA,GAAKhJ,IACxCE,GAAkB9G,EAAAA,cAAC6P,EAAcF,OAAAC,OAAA,GAAK9I,IACtCP,EACAE,EACI,0FCpCjB,MAAMwJ,EAAyDvR,IAAA,IAAC,QAAE4N,EAAO,UAAEE,EAAS,KAAE/B,EAAI,UAAEyC,GAAWxO,EAAA,OACnGwO,EAEIlN,EAAAA,cAAA,OAAKF,UAAY,qDAAqD4K,IAAID,EAAM,qBAC/E6B,EACAY,EACDlN,EAAAA,cAAC0P,EAAAA,KAAIC,OAAAC,OAAA,GAAKpD,GAAY/B,IAItBzK,EAAAA,cAAAA,EAAAA,SAAA,KACCsM,EACDtM,EAAAA,cAAC0P,EAAAA,KAAIC,OAAAC,OAAA,GAAKpD,GAAY/B,GAExB,EAaN,EAXmFqF,IAAA,IAAC,4BAAE/D,EAA2B,MAAEP,EAAK,UAAC/E,EAAS,iBAAE4D,EAAgB,aAACG,GAAcsF,EAAA,OAC/J9P,EAAAA,cAACgQ,EAAAA,OAAML,OAAAC,OAAA,GAAK7D,GACPP,EAAMrC,KAAIsB,GACPzK,EAAAA,cAACiQ,EAAaN,OAAAC,OAAA,CAACM,IAAKzF,EAAKhK,IAAQgK,MAEpChE,EACA4D,EACAG,EACI","sources":["webpack://Citta2.0/./src/modules/checkout-guest-profile-emarsys/components/get-add-contact-info.tsx?233e","webpack://Citta2.0/./src/modules/checkout-guest-profile-emarsys/components/get-show-contact-info.tsx?4546","webpack://Citta2.0/./src/modules/checkout-guest-profile-emarsys/checkout-guest-profile-emarsys.tsx?1c34","webpack://Citta2.0/./src/modules/checkout-section-container/components/loading.tsx?edc6","webpack://Citta2.0/./src/modules/checkout-section-container/checkout-section-container.tsx?5c75","webpack://Citta2.0/./src/modules/checkout-guest-profile-emarsys/checkout-guest-profile-emarsys.view.tsx?9340","webpack://Citta2.0/./src/modules/checkout-section-container/checkout-section-container.view.tsx?de8f"],"sourcesContent":["/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { Button, INodeProps } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\n\r\nexport interface IAddContactInfoInput {\r\n inputRef?: React.RefObject;\r\n hasError: boolean;\r\n email: string;\r\n resources: {\r\n emailLabel: string;\r\n emailErrortext: string;\r\n saveBtnLabel: string;\r\n cancelBtnLabel: string;\r\n };\r\n canSubmit: boolean;\r\n canCancel: boolean;\r\n onChange(email: string): void;\r\n onSubmit(): void;\r\n onCancel(): void;\r\n}\r\n\r\nexport interface IAddContactInfo {\r\n addFormProps: INodeProps;\r\n submitButton: React.ReactNode;\r\n cancelButton: React.ReactNode;\r\n inputGroupProps: INodeProps;\r\n label: React.ReactNode;\r\n error: React.ReactNode;\r\n input: React.ReactNode;\r\n}\r\n\r\n/**\r\n * On Input change handler function.\r\n * @param onChange -On change input function.\r\n * @returns Call of onChange function.\r\n */\r\nconst onInputChangeHandler = (onChange: (email: string) => void) => (event: React.ChangeEvent): void => {\r\n onChange(event.target.value || '');\r\n};\r\n\r\nconst getAddContactInfo = ({\r\n hasError,\r\n inputRef,\r\n email,\r\n canSubmit,\r\n canCancel,\r\n onChange,\r\n onSubmit,\r\n onCancel,\r\n resources: { emailLabel, emailErrortext, saveBtnLabel, cancelBtnLabel }\r\n}: IAddContactInfoInput): IAddContactInfo => {\r\n const onInputChange = onInputChangeHandler(onChange);\r\n\r\n return {\r\n addFormProps: { className: 'ms-checkout-guest-profile__add-contact-info' },\r\n submitButton: canSubmit && (\r\n \r\n ),\r\n cancelButton: canCancel && (\r\n \r\n ),\r\n inputGroupProps: { className: classnames('ms-checkout-guest-profile__input', { 'is-invalid': hasError }) },\r\n label: (\r\n \r\n ),\r\n error: hasError && (\r\n \r\n {emailErrortext}\r\n \r\n ),\r\n input: (\r\n \r\n )\r\n };\r\n};\r\n\r\nexport default getAddContactInfo;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { Button, INodeProps } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nexport interface IShowContactInfoInput {\r\n canEdit: boolean;\r\n email: string;\r\n resources: {\r\n editBtnLabel: string;\r\n };\r\n onEdit(): void;\r\n}\r\n\r\nexport interface IShowContactInfo {\r\n showInfoProps: INodeProps;\r\n email: React.ReactNode;\r\n editButton?: React.ReactNode;\r\n}\r\n\r\nconst getContactInfo = ({ canEdit, email, resources: { editBtnLabel }, onEdit }: IShowContactInfoInput): IShowContactInfo => ({\r\n showInfoProps: { className: 'ms-checkout-guest-profile__selected-item' },\r\n email: {email},\r\n editButton: canEdit && (\r\n \r\n )\r\n});\r\n\r\nexport default getContactInfo;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\r\nimport { EmailRegex } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport ReCAPTCHA from 'react-google-recaptcha';\r\nimport { computed, reaction, when } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport * as MsDyn365 from '@msdyn365-commerce/core';\r\n\r\nimport { ICheckoutGuestProfileEmarsysData } from './checkout-guest-profile-emarsys.data';\r\nimport { ICheckoutGuestProfileEmarsysProps } from './checkout-guest-profile-emarsys.props.autogenerated';\r\nimport getAddContactInfo, { IAddContactInfo } from './components/get-add-contact-info';\r\nimport getShowContactInfo, { IShowContactInfo } from './components/get-show-contact-info';\r\n\r\nexport * from './components/get-add-contact-info';\r\nexport * from './components/get-show-contact-info';\r\n\r\ninterface ICheckoutGuestProfileState {\r\n email: string;\r\n TermsAndConditionsChecked: boolean;\r\n reCaptchaChecked: boolean;\r\n rCCError: boolean;\r\n\r\n}\r\n\r\nexport interface ICheckoutGuestProfileModuleProps extends ICheckoutGuestProfileEmarsysProps, IModuleStateProps { }\r\n\r\nexport interface ICheckoutGuestProfileViewProps extends ICheckoutGuestProfileEmarsysProps, ICheckoutGuestProfileState {\r\n moduleProps: IModuleProps;\r\n showContactInfo?: IShowContactInfo;\r\n addContactInfo?: IAddContactInfo;\r\n reCaptcha: React.ReactNode;\r\n checkBox: React.ReactNode;\r\n\r\n onChange?(email: string): void;\r\n onEdit?(): void;\r\n onSubmit?(): void;\r\n onCancel?(): void;\r\n}\r\n\r\n/**\r\n *\r\n * CheckoutGuestProfile component.\r\n * @extends {React.PureComponent, ICheckoutGuestProfileState>}\r\n */\r\n// @ts-expect-error\r\n@withModuleState\r\n@observer\r\nclass CheckoutGuestProfile extends React.Component {\r\n public state: ICheckoutGuestProfileState = {\r\n email:\r\n (this.props.context &&\r\n this.props.context.request &&\r\n this.props.context.request.user &&\r\n this.props.context.request.user.isAuthenticated &&\r\n this.props.context.request.user.emailAddress) ||\r\n '',\r\n TermsAndConditionsChecked: false,\r\n reCaptchaChecked: false,\r\n rCCError: false,\r\n };\r\n\r\n private readonly inputRef: React.RefObject = React.createRef();\r\n private _TermsAndConditionsRef: React.RefObject = React.createRef();\r\n private _recaptchaRef: React.RefObject = React.createRef();\r\n private recaptchaErrorMessage: string | undefined;\r\n // private responseMessage: string | undefined;\r\n\r\n\r\n @computed get isDataReady(): boolean {\r\n return (this.props.data.checkout.result && this.props.data.checkout.status) === 'SUCCESS';\r\n }\r\n\r\n public componentDidMount(): void {\r\n when(\r\n () => this.isDataReady,\r\n async () => {\r\n await this.init();\r\n }\r\n );\r\n\r\n reaction(\r\n () => this.props.data.checkout.result?.isExpressCheckoutApplied,\r\n async isExpressCheckoutApplied => {\r\n if (isExpressCheckoutApplied && !this.props.data.checkout.result?.isExpressAddressApplied) {\r\n const email = this.props.data.checkout.result?.emailAddressFromExpressCheckout ?? '';\r\n\r\n await this.submitEmail(email);\r\n }\r\n }\r\n );\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: ICheckoutGuestProfileModuleProps, nextState: ICheckoutGuestProfileState): boolean {\r\n if (this.state === nextState && this.props.data === nextProps.data) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n public render(): JSX.Element {\r\n const {\r\n config: { className },\r\n resources,\r\n moduleState: { isReady, hasError, hasExternalSubmitGroup }\r\n } = this.props;\r\n const email = this.props.data.checkout.result?.guestCheckoutEmail ?? '';\r\n // const checkBox : this._renderCheckbox();\r\n\r\n const viewProps: ICheckoutGuestProfileViewProps = {\r\n ...this.props,\r\n ...this.state,\r\n onChange: this.onChange,\r\n onEdit: this.onEdit,\r\n onCancel: this.onCancel,\r\n onSubmit: this.onSubmit,\r\n checkBox: this._renderCheckbox(),\r\n reCaptcha: this._renderReCaptcha(),\r\n\r\n\r\n moduleProps: {\r\n moduleProps: this.props,\r\n className: classnames('ms-checkout-guest-profile', className, isReady ? 'show' : 'add')\r\n },\r\n showContactInfo: isReady\r\n ? getShowContactInfo({\r\n canEdit: !hasExternalSubmitGroup,\r\n email,\r\n resources,\r\n onEdit: this.onEdit\r\n })\r\n : undefined,\r\n addContactInfo: !isReady\r\n ? getAddContactInfo({\r\n email: this.state.email,\r\n hasError,\r\n resources,\r\n inputRef: this.inputRef,\r\n onChange: this.onChange,\r\n canSubmit: !hasExternalSubmitGroup,\r\n onSubmit: this.onSubmit,\r\n canCancel: !hasExternalSubmitGroup && !!email,\r\n onCancel: this.onCancel\r\n })\r\n : undefined\r\n };\r\n\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n\r\n private _renderCheckbox(): React.ReactNode {\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 private _renderReCaptcha(): React.ReactNode {\r\n return (\r\n
\r\n
\r\n {this.state.rCCError ? this._renderRecaptchaAlert('recaptcha-error') : ''}\r\n this._submit()}\r\n />\r\n
\r\n
\r\n );\r\n }\r\n\r\n private _renderRecaptchaAlert(className: string): JSX.Element {\r\n\r\n if (this.props.config.reCaptchaOption) {\r\n if (!this.state.reCaptchaChecked) {\r\n this.recaptchaErrorMessage = this.props.resources.recaptchaErrorMessage;\r\n }\r\n }\r\n\r\n const rCCError = this.state.rCCError;\r\n return (\r\n <>\r\n {rCCError && (\r\n \r\n {\r\n this.recaptchaErrorMessage &&\r\n <>\r\n \r\n )}\r\n \r\n );\r\n }\r\n\r\n private readonly init = async (): Promise => {\r\n const checkoutState = this.props.data.checkout.result;\r\n\r\n const hasInvoiceLine = checkoutState?.checkoutCart.hasInvoiceLine;\r\n\r\n const emailOnCart = checkoutState?.checkoutCart.cart.ReceiptEmail;\r\n const email = hasInvoiceLine\r\n ? this.props.context.request.user.emailAddress ?? ''\r\n : emailOnCart ??\r\n (checkoutState?.isExpressCheckoutApplied ? checkoutState.emailAddressFromExpressCheckout : undefined) ??\r\n this.state.email;\r\n\r\n if (email) {\r\n await this.updateGuestProfile(email);\r\n checkoutState?.updateHasGuestCheckoutEmail({ newHasGuestCheckoutEmail: true });\r\n } else {\r\n checkoutState?.updateHasGuestCheckoutEmail({ newHasGuestCheckoutEmail: false });\r\n }\r\n\r\n const isEmailValid = this.isEmailValid(email);\r\n this.props.moduleState.init({\r\n onEdit: this.onEdit,\r\n onCancel: this.onCancel,\r\n onSubmit: this.onSubmit,\r\n status: hasInvoiceLine ? 'disabled' : email && isEmailValid ? 'ready' : 'updating',\r\n hasError: !!email && !isEmailValid\r\n });\r\n };\r\n\r\n private readonly onChange = (rowEmail: string): void => {\r\n const email = (rowEmail || '').replace(new RegExp('[<>]', 'gi'), '');\r\n this.setState({ email });\r\n if (this.props.moduleState.hasError) {\r\n // Clear error during user updating the email\r\n this.props.moduleState.setHasError(false);\r\n }\r\n };\r\n\r\n private _checkBoxOnChange = () => (e: React.ChangeEvent) => {\r\n const isChecked = this._TermsAndConditionsRef.current && this._TermsAndConditionsRef.current.checked ? this._TermsAndConditionsRef.current.checked : false;\r\n this.setState({TermsAndConditionsChecked: isChecked });\r\n }\r\n private readonly isEmailValid = (email: string): boolean => {\r\n return EmailRegex.defaultRegex.test(email);\r\n };\r\n\r\n private readonly updateGuestProfile = async (newGuestCheckoutEmail: string): Promise => {\r\n if (this.props.data.checkout.result) {\r\n await this.props.data.checkout.result.updateGuestCheckoutEmail({ newGuestCheckoutEmail });\r\n this.setState({ email: newGuestCheckoutEmail });\r\n }\r\n };\r\n\r\n private readonly onEdit = (): void => {\r\n this.props.telemetry.information('Guest profile onEdit is called.');\r\n this.props.moduleState.onUpdating();\r\n };\r\n\r\n private readonly onSubmit = async (): Promise => {\r\n this.props.telemetry.information('Guest profile onSubmit is called.');\r\n const { email } = this.state;\r\n await this.submitEmail(email);\r\n if(this.state.TermsAndConditionsChecked) {\r\n try {\r\n this._recaptchaRef.current?.execute()\r\n } catch(e) {\r\n console.log(e, 'Please fill the form!');\r\n }\r\n }\r\n };\r\n\r\n private async _submit(): Promise {\r\n let emarsysGroupId = this.props.config.emarsysGroup;\r\n const { email } = this.state;\r\n try {\r\n const response = await MsDyn365.commerceApiRequest(\r\n this.props.context.request,\r\n 'PostCheckoutGuestProfileEmarsys',\r\n 'post',\r\n {\r\n emailAddress: email,\r\n emarsysGroupId: emarsysGroupId,\r\n optIn:true\r\n }\r\n ) as any;\r\n\r\n if (response?.data.Result !== 'Error') {\r\n console.log('emasys success')\r\n } else {\r\n console.log('this is an emasys error')\r\n }\r\n this._recaptchaRef.current?.reset();\r\n } catch (e) {\r\n console.log('rechatcha error')\r\n }\r\n \r\n }\r\n /**\r\n * Submit the email address.\r\n * @param email - The email to be submitted.\r\n *\r\n */\r\n private readonly submitEmail = async (email: string): Promise => {\r\n const isValid = this.isEmailValid(email);\r\n if (!isValid) {\r\n this.props.moduleState.setHasError(true);\r\n\r\n const input = this.inputRef.current?.focus && (this.inputRef.current as HTMLElement);\r\n input?.focus();\r\n\r\n } else {\r\n this.props.moduleState.onReady();\r\n await this.updateGuestProfile(email);\r\n\r\n }\r\n };\r\n\r\n private readonly onCancel = (): void => {\r\n this.props.telemetry.information('Guest profile onCancel is called.');\r\n\r\n // Reset to the saved value\r\n if (!this.props.data.checkout.result) {\r\n return;\r\n }\r\n\r\n const email = this.props.data.checkout.result.guestCheckoutEmail;\r\n if (!email) {\r\n // It has no saved email, set to status updating and request user to fill the email form\r\n this.props.moduleState.onUpdating();\r\n } else {\r\n // It has saved email, set to status ready\r\n this.setState({\r\n email\r\n });\r\n this.props.moduleState.setHasError(false);\r\n this.props.moduleState.onReady();\r\n }\r\n };\r\n}\r\n\r\nexport default CheckoutGuestProfile;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as React from 'react';\r\n\r\nconst Loading: React.FC = () =>
;\r\n\r\nexport default Loading;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport { IModuleStateManager, IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\r\nimport { IModuleProps, INodeProps } from '@msdyn365-commerce-modules/utilities';\r\nimport classname from 'classnames';\r\nimport get from 'lodash/get';\r\nimport { reaction } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport { ICheckoutSectionContainerData } from './checkout-section-container.data';\r\nimport { ICheckoutSectionContainerProps } from './checkout-section-container.props.autogenerated';\r\nimport LoadingComponent from './components/loading';\r\nimport ReCAPTCHA from 'react-google-recaptcha';\r\nimport * as MsDyn365 from '@msdyn365-commerce/core';\r\nimport FingerprintJS, { Agent as PublicAgent } from '@fingerprintjs/fingerprintjs-pro';\r\n\r\nexport interface ICheckoutSectionContainerModuleProps extends ICheckoutSectionContainerProps, IModuleStateProps {\r\n enableControl: boolean;\r\n}\r\n\r\nexport enum PaymentType {\r\n Adyen = 'checkout-payment-instrument',\r\n PayByAccount = 'citta-checkout-customer-account-payment'\r\n}\r\nexport interface ICheckoutSectionContainerItem {\r\n id: string;\r\n loading?: React.ReactNode;\r\n itemProps: INodeProps;\r\n item: React.ReactNode;\r\n accordion: React.ReactNode\r\n}\r\n\r\nexport interface ICheckoutSectionContainerState {\r\n activeAccordion: string;\r\n}\r\n\r\nexport interface ICheckoutSectionContainerState {\r\n reCaptchaChecked: boolean;\r\n rCCError: boolean;\r\n activeAccordion: string;\r\n fingerPrintError: boolean;\r\n fpClient: PublicAgent | null;\r\n requestId:string,\r\n attemptError: boolean;\r\n}\r\n\r\nexport interface ICheckoutSectionContainerViewProps extends ICheckoutSectionContainerProps<{}> {\r\n className: string;\r\n checkoutPlainContainerProps: IModuleProps;\r\n items: ICheckoutSectionContainerItem[];\r\n reCaptcha: React.ReactNode;\r\n fingerPrintError: React.ReactNode;\r\n attemptError: React.ReactNode;\r\n\r\n}\r\n/**\r\n *\r\n * CheckoutPlainContainer component\r\n * @extends {React.Component>}\r\n */\r\n@observer\r\nexport class CheckoutPlainContainer extends React.Component {\r\n\r\n public constructor(props: ICheckoutSectionContainerModuleProps) {\r\n super(props);\r\n this.state = {\r\n activeAccordion: PaymentType.PayByAccount,\r\n reCaptchaChecked: false,\r\n rCCError: false,\r\n fingerPrintError: false,\r\n fpClient:null,\r\n requestId: '',\r\n attemptError: false,\r\n };\r\n\r\n }\r\n private _recaptchaRef: React.RefObject = React.createRef();\r\n private recaptchaErrorMessage: string | undefined;\r\n public async componentDidMount(): Promise {\r\n const items = this.getItems();\r\n const childIds = items.map((item: React.ReactNode) => get(item, 'props.id'));\r\n\r\n if(this.props.config.reCaptchaOption){\r\n FingerprintJS.load({\r\n apiKey: \"SavNfJLiPxQvtGc0eGD5\",\r\n endpoint: [\r\n \"https://fp.cittadesign.com\",\r\n FingerprintJS.defaultEndpoint\r\n ],\r\n scriptUrlPattern: [\r\n \"https://fp.cittadesign.com/web/v//loader_v.js\",\r\n FingerprintJS.defaultScriptUrlPattern\r\n ]\r\n })\r\n .then(fpClient => this.setState({ fpClient }))\r\n .catch(error => console.error('FingerprintJS initialization failed:', error));\r\n }\r\n this.props.moduleState.init({\r\n onEdit: this.onEdit,\r\n onCancel: this.onCancel,\r\n onSubmit: this.onSubmit,\r\n childIds,\r\n }\r\n );\r\n\r\n reaction(\r\n () => this.props.moduleState.isReady,\r\n () => {\r\n this.onContainerReady();\r\n }\r\n );\r\n\r\n reaction(\r\n () => this.props.moduleState.shouldSubmitContainer,\r\n () => {\r\n this.onSubmit();\r\n }\r\n );\r\n }\r\n\r\n public componentDidUpdate(): void {\r\n if (!this.props.moduleState.hasExternalSubmitGroup) {\r\n return;\r\n }\r\n /**\r\n * Review all modules to updating status if one of the modules has error\r\n */\r\n const { childIds, hasError, getModule } = this.props.moduleState;\r\n const hasReadyItems = childIds.some((childId: string) => {\r\n const state = getModule(childId);\r\n return !!state && state.isReady;\r\n });\r\n if (hasReadyItems && hasError) {\r\n this.onEdit();\r\n }\r\n }\r\n public render(): JSX.Element | null {\r\n const {\r\n enableControl,\r\n moduleState,\r\n config: { width, paymentAccordion, creditCardIcon }\r\n } = this.props;\r\n const items = this.getItems();\r\n if (!items.length) {\r\n this.props.context.telemetry.error('Checkout section content is empty, module wont render');\r\n return null;\r\n }\r\n\r\n const moduleClassName = classname(\r\n 'ms-checkout-section-container',\r\n {\r\n 'has-initialized': moduleState.hasInitialized,\r\n 'is-ready': moduleState.isReady,\r\n 'is-updating': !moduleState.isReady,\r\n container: width === 'container',\r\n 'col-12 fullwidth': width === 'fluid'\r\n },\r\n this.props.config.className\r\n );\r\n\r\n const viewProps: ICheckoutSectionContainerViewProps = {\r\n ...this.props,\r\n\r\n className: moduleClassName,\r\n reCaptcha: this._renderReCaptcha(),\r\n fingerPrintError: this._renderFingerPrintErrorMessage(),\r\n attemptError: this._renderAttemptError(),\r\n checkoutPlainContainerProps: {\r\n moduleProps: this.props,\r\n className: moduleClassName\r\n },\r\n items: items.map((item: React.ReactNode) => {\r\n const childId = get(item, 'props.id');\r\n const childTypeName = get(item, \"props.typeName\");\r\n const state = moduleState.getModule(childId);\r\n const customerInfo = get(this.props, 'data.customerInformation.result');\r\n const platform = get(this.props, 'context.request.app.platform');\r\n const isAllowOnAccountPayment = customerInfo && customerInfo.AllowOnAccountPayment && platform &&\r\n (platform.enableCustomerAccountPayment === 'all' ||\r\n (platform.enableCustomerAccountPayment === 'b2b' && customerInfo.IsB2b === true) ||\r\n (platform.enableCustomerAccountPayment === 'b2c' && customerInfo.IsB2b === false))\r\n // Modules has not completed initializing or it's disable \r\n\r\n // let isPayment = childTypeName ===PaymentType.PayByAccount || childTypeName ===PaymentType.Adyen\r\n const hidden = state.hasModuleState && (!state.hasInitialized || state.isDisabled || state.isSkipped) || (isAllowOnAccountPayment && paymentAccordion ? this.state.activeAccordion !== childTypeName : '');\r\n\r\n return {\r\n id: childId,\r\n loading: state.hasModuleState && !state.hasInitialized && ,\r\n itemProps: {\r\n 'data-type-name': state.typeName,\r\n className: classname('ms-checkout-section-container__item', {\r\n hidden: hidden,\r\n initialized: state.hasInitialized,\r\n disabled: state.isDisabled,\r\n skipped: state.isSkipped,\r\n ready: state.isReady,\r\n updating: state.isUpdating,\r\n pending: state.isPending\r\n })\r\n },\r\n accordion: isAllowOnAccountPayment && paymentAccordion ? this._renderAccordionItem(item, creditCardIcon) : null,\r\n item: React.cloneElement(item as React.ReactElement, { enableControl })\r\n };\r\n })\r\n };\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n private _renderReCaptcha(): React.ReactNode {\r\n if (this.props.config.reCaptchaOption) {\r\n return (\r\n
\r\n
\r\n {this.state.rCCError ? this._renderRecaptchaAlert('recaptcha-error') : ''}\r\n this._submit()}\r\n />\r\n
\r\n
\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n private _renderFingerPrintErrorMessage(): React.ReactNode {\r\n if (this.state.fingerPrintError) {\r\n return (\r\n
\r\n

Error message

\r\n

\r\n {this.props.config.fingerPrintErrorMessage}\r\n

\r\n
\r\n )\r\n }\r\n return null\r\n }\r\n\r\n private _renderAttemptError(): React.ReactNode {\r\n if (this.state.attemptError) {\r\n return (\r\n
\r\n

Error message

\r\n

\r\n {this.props.config.attemptErrorMessage}\r\n

\r\n
\r\n )\r\n }\r\n return null\r\n }\r\n\r\n private _renderRecaptchaAlert(className: string): JSX.Element {\r\n\r\n if (this.props.config.reCaptchaOption) {\r\n if (!this.state.reCaptchaChecked) {\r\n this.recaptchaErrorMessage = this.props.resources.recaptchaErrorMessage;\r\n }\r\n }\r\n\r\n const rCCError = this.state.rCCError;\r\n return (\r\n <>\r\n {rCCError && (\r\n \r\n {\r\n this.recaptchaErrorMessage &&\r\n <>\r\n \r\n )}\r\n \r\n );\r\n }\r\n\r\n private async _submit(): Promise {\r\n const MAX_ATTEMPTS = this.props.config.attemptThreshold || 5;\r\n const STORAGE_KEY = \"paymentAttempts\";\r\n const storedAttempts = localStorage.getItem(STORAGE_KEY);\r\n let attempts = storedAttempts ? JSON.parse(storedAttempts) : { count: 0, timestamp: Date.now() };\r\n\r\n const recaptchaValue = this._recaptchaRef.current?.getValue();\r\n\r\n const { fpClient } = this.state;\r\n if (!fpClient) {\r\n console.error('FingerprintJS client not initialized');\r\n return;\r\n }\r\n try {\r\n const result = await fpClient.get();\r\n this.setState({ requestId: result.requestId });\r\n } catch (error) {\r\n console.error('Fingerprint collection failed:', error);\r\n }\r\n\r\n const res = this.props.config.turnOnFingerPrint && await MsDyn365.commerceApiRequest(\r\n this.props.context.request,\r\n 'GetFingerprint',\r\n 'post',\r\n {\r\n myInputValue: this.state.requestId\r\n }\r\n ) as any;\r\n const suspectScore: number = this.props.config.turnOnFingerPrint && res.data.result && res.data.result.data.result || 0;\r\n const suspectScoreThreshold: number = this.props.config.suspectScoreThreshold || 90;\r\n const isBlocked: boolean = suspectScore > suspectScoreThreshold;\r\n\r\n if (!recaptchaValue) {\r\n this.setState({\r\n rCCError: true,\r\n reCaptchaChecked: false\r\n });\r\n this._recaptchaRef.current?.reset();\r\n }\r\n else if (this.props.config.turnOnFingerPrint && isBlocked) {\r\n this.setState({\r\n fingerPrintError: true\r\n })\r\n this._recaptchaRef.current?.reset();\r\n }\r\n else if (attempts.count >= MAX_ATTEMPTS) {\r\n const timeDiff = Date.now() - attempts.timestamp;\r\n if (timeDiff < 24 * 60 * 60 * 1000) {\r\n this.setState({\r\n attemptError: true\r\n });\r\n }\r\n attempts = { count: 0, timestamp: Date.now() };\r\n this._recaptchaRef.current?.reset();\r\n } else {\r\n this.clearError();\r\n this.getActiveChildModuleStates().forEach(state => {\r\n !state.isReady && state.onSubmit && state.onSubmit();\r\n if (state.typeName === PaymentType.Adyen && !state.isReady) {\r\n attempts.count++;\r\n localStorage.setItem(STORAGE_KEY, JSON.stringify(attempts));\r\n }\r\n else if (state.typeName === PaymentType.Adyen && state.isReady) {\r\n localStorage.removeItem(STORAGE_KEY);\r\n }\r\n });\r\n this._recaptchaRef.current?.reset();\r\n }\r\n }\r\n\r\n private getItems = (): React.ReactNode[] => {\r\n const { slots } = this.props;\r\n return (slots && slots.primary && slots.primary.length && slots.primary) || [];\r\n };\r\n\r\n private _renderAccordionItem(item: any, creditCardIcon: any): React.ReactNode {\r\n const childTypeName = get(item, 'props.typeName');\r\n let slotName: string = '';\r\n switch (childTypeName) {\r\n case PaymentType.PayByAccount:\r\n slotName = 'Charge to Account';\r\n break;\r\n case PaymentType.Adyen:\r\n slotName = 'Credit Card';\r\n break;\r\n default: null\r\n }\r\n return (\r\n
\r\n this.updateAccordion(childTypeName)} />\r\n
{slotName}
\r\n {childTypeName === PaymentType.Adyen ?
\"\"
: null}\r\n
\r\n )\r\n }\r\n\r\n public updateAccordion(newValue: string): void {\r\n if (this.state.activeAccordion === PaymentType.PayByAccount) {\r\n this.props.moduleState.getModuleByTypeName(this.state.activeAccordion).onSkip();\r\n }\r\n this.setState({ activeAccordion: newValue });\r\n this.props.moduleState.getModuleByTypeName(newValue).onUpdating();\r\n if (newValue === PaymentType.PayByAccount) {\r\n this.props.moduleState.getModuleByTypeName(PaymentType.Adyen).onDisable()\r\n } else {\r\n this.props.moduleState.getModuleByTypeName(PaymentType.PayByAccount).onDisable()\r\n }\r\n }\r\n\r\n private getActiveChildModuleStates = (): IModuleStateManager[] => {\r\n const { childIds, getModule } = this.props.moduleState;\r\n return childIds\r\n .map(getModule)\r\n .filter((state): state is IModuleStateManager => !!state && !state.isDisabled && state.hasModuleState);\r\n };\r\n\r\n private clearError = (): void => {\r\n // Clear error before action, otherwise it will rise conflict;\r\n this.getActiveChildModuleStates().forEach(state => {\r\n state.hasError && state.setHasError(false);\r\n });\r\n };\r\n\r\n private onSubmit = (): void => {\r\n if (this.props.config.reCaptchaOption) {\r\n this._recaptchaRef.current?.execute()\r\n } else {\r\n this.clearError();\r\n this.getActiveChildModuleStates().forEach(state => {\r\n !state.isReady && state.onSubmit && state.onSubmit();\r\n });\r\n }\r\n };\r\n\r\n private onCancel = (): void => {\r\n this.clearError();\r\n this.getActiveChildModuleStates().forEach(state => {\r\n !state.isReady && state.onCancel && state.onCancel();\r\n });\r\n };\r\n\r\n private onEdit = (): void => {\r\n const {\r\n config: { paymentAccordion }, data\r\n } = this.props;\r\n const isAllowOnAccountPayment = data.customerInformation.result?.AllowOnAccountPayment\r\n this.getActiveChildModuleStates().forEach(state => {\r\n (state.isReady || state.isSkipped) && state.onEdit && state.onEdit();\r\n });\r\n isAllowOnAccountPayment && paymentAccordion && this.props.moduleState.getModuleByTypeName(PaymentType.Adyen).onDisable()\r\n };\r\n\r\n private onContainerReady = (): void => {\r\n this.getActiveChildModuleStates().forEach(state => {\r\n state.isReady && state.onContainerReady && state.onContainerReady();\r\n });\r\n };\r\n}\r\n\r\nexport default withModuleState(CheckoutPlainContainer);\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IAddContactInfo, ICheckoutGuestProfileViewProps, IShowContactInfo } from './checkout-guest-profile-emarsys';\r\n\r\nexport const ShowContactInfo: React.FC = ({ showInfoProps, email, editButton }) => (\r\n \r\n {email}\r\n {editButton}\r\n \r\n);\r\n\r\nexport const AddContactInfo: React.FC = ({\r\n addFormProps,\r\n submitButton,\r\n cancelButton,\r\n inputGroupProps,\r\n label,\r\n error,\r\n input\r\n}) => (\r\n \r\n \r\n {'Email Address'}\r\n {error}\r\n {input}\r\n \r\n {submitButton}\r\n {cancelButton}\r\n \r\n);\r\n\r\nconst CheckoutGuestProfileView: React.FC = ({ moduleProps, showContactInfo, addContactInfo, checkBox, reCaptcha}) => {\r\n return (\r\n \r\n {showContactInfo && }\r\n {addContactInfo && }\r\n {checkBox}\r\n {reCaptcha}\r\n \r\n );\r\n};\r\n\r\nexport default CheckoutGuestProfileView;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport get from 'lodash/get';\r\nimport { ICheckoutSectionContainerItem, ICheckoutSectionContainerViewProps } from './checkout-section-container';\r\n\r\nconst ItemComponent: React.FC = ({ loading, itemProps, item, accordion }) =>\r\n accordion? \r\n (\r\n
\r\n {loading}\r\n {accordion}\r\n {item}\r\n
\r\n ) :\r\n (\r\n <>\r\n {loading}\r\n {item}\r\n \r\n );\r\n\r\nconst CheckoutSectionContainerView: React.FC = ({ checkoutPlainContainerProps, items,reCaptcha, fingerPrintError,attemptError }) => (\r\n \r\n {items.map(item => (\r\n \r\n ))}\r\n {reCaptcha}\r\n {fingerPrintError}\r\n {attemptError}\r\n \r\n);\r\n\r\nexport default CheckoutSectionContainerView;\r\n"],"names":["_ref","hasError","inputRef","email","canSubmit","canCancel","onChange","onSubmit","onCancel","resources","emailLabel","emailErrortext","saveBtnLabel","cancelBtnLabel","onInputChange","event","target","value","onInputChangeHandler","addFormProps","className","submitButton","React","Button","title","color","onClick","cancelButton","inputGroupProps","classnames","label","id","error","role","input","ref","type","canEdit","editBtnLabel","onEdit","showInfoProps","editButton","CheckoutGuestProfile","constructor","state","this","props","context","request","user","isAuthenticated","emailAddress","TermsAndConditionsChecked","reCaptchaChecked","rCCError","_TermsAndConditionsRef","_recaptchaRef","init","async","_this$props$context$r","checkoutState","data","checkout","result","hasInvoiceLine","checkoutCart","emailOnCart","cart","ReceiptEmail","isExpressCheckoutApplied","emailAddressFromExpressCheckout","undefined","updateGuestProfile","updateHasGuestCheckoutEmail","newHasGuestCheckoutEmail","isEmailValid","moduleState","status","rowEmail","replace","RegExp","setState","setHasError","_checkBoxOnChange","e","isChecked","current","checked","EmailRegex","defaultRegex","test","updateGuestCheckoutEmail","newGuestCheckoutEmail","telemetry","information","onUpdating","submitEmail","_this$_recaptchaRef$c","execute","console","log","onReady","_this$inputRef$curren","focus","guestCheckoutEmail","isDataReady","componentDidMount","when","reaction","_this$props$data$chec","_this$props$data$chec2","isExpressAddressApplied","_this$props$data$chec3","_this$props$data$chec4","shouldComponentUpdate","nextProps","nextState","render","_this$props$data$chec5","_this$props$data$chec6","config","isReady","hasExternalSubmitGroup","viewProps","_objectSpread","checkBox","_renderCheckbox","reCaptcha","_renderReCaptcha","moduleProps","showContactInfo","getShowContactInfo","addContactInfo","getAddContactInfo","renderView","termsAndConditionsText","href","termsAndConditionsLink","_renderRecaptchaAlert","ReCAPTCHA","sitekey","reCaptchaSiteKey","size","_submit","reCaptchaOption","recaptchaErrorMessage","emarsysGroupId","emarsysGroup","_this$_recaptchaRef$c2","response","MsDyn365","optIn","Result","reset","__decorate","computed","withModuleState","observer","Loading","PaymentType","CheckoutPlainContainer","super","getItems","slots","primary","length","getActiveChildModuleStates","childIds","getModule","map","filter","isDisabled","hasModuleState","clearError","forEach","_data$customerInforma","paymentAccordion","isAllowOnAccountPayment","customerInformation","AllowOnAccountPayment","isSkipped","getModuleByTypeName","Adyen","onDisable","onContainerReady","activeAccordion","PayByAccount","fingerPrintError","fpClient","requestId","attemptError","item","get","FingerprintJS","apiKey","endpoint","scriptUrlPattern","then","catch","shouldSubmitContainer","componentDidUpdate","some","childId","enableControl","width","creditCardIcon","items","moduleClassName","classname","hasInitialized","container","_renderFingerPrintErrorMessage","_renderAttemptError","checkoutPlainContainerProps","childTypeName","customerInfo","platform","enableCustomerAccountPayment","IsB2b","hidden","loading","LoadingComponent","itemProps","typeName","initialized","disabled","skipped","ready","updating","isUpdating","pending","isPending","accordion","_renderAccordionItem","fingerPrintErrorMessage","attemptErrorMessage","MAX_ATTEMPTS","attemptThreshold","STORAGE_KEY","storedAttempts","localStorage","getItem","attempts","JSON","parse","count","timestamp","Date","now","recaptchaValue","getValue","res","turnOnFingerPrint","myInputValue","isBlocked","suspectScoreThreshold","_this$_recaptchaRef$c3","_this$_recaptchaRef$c4","_this$_recaptchaRef$c5","_this$_recaptchaRef$c6","removeItem","setItem","stringify","slotName","style","name","updateAccordion","src","alt","newValue","onSkip","ShowContactInfo","Node","Object","assign","AddContactInfo","_ref2","_ref3","Module","ItemComponent","key"],"sourceRoot":""}