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,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJ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AI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,MACJC,GAAI,OAQKv4C,EAA6BC,GAC/B8oC,EAAkB9oC,IAAgB","sources":["webpack://lds-commerce/./src/modules/checkout-express-payment-container/checkout-express-payment-container.tsx?1d63","webpack://lds-commerce/./src/modules/checkout-guest-profile/checkout-guest-profile.tsx?c2ce","webpack://lds-commerce/./src/modules/checkout-section-container/checkout-section-container.tsx?c853","webpack://lds-commerce/./src/modules/checkout-terms-and-conditions/checkout-terms-and-conditions.tsx?9243","webpack://lds-commerce/./src/modules/checkout-guest-profile/checkout-guest-profile.view.tsx?2e47","webpack://lds-commerce/./src/modules/checkout-section-container/checkout-section-container.view.tsx?b4ab","webpack://lds-commerce/./src/modules/checkout-terms-and-conditions/checkout-terms-and-conditions.view.tsx?26e8","webpack://lds-commerce/./src/modules/checkout-express-payment-container/checkout-express-payment-container.view.tsx?4299","webpack://lds-commerce/./src/modules/checkout-apple-pay/checkout-apple-pay.data.ts?c986","webpack://lds-commerce/./src/modules/checkout-apple-pay/checkout-apple-pay.tsx?f243","webpack://lds-commerce/./src/modules/checkout-customer-account-payment/checkout-customer-account-payment.tsx?de67","webpack://lds-commerce/./src/modules/checkout-express/checkout-express.tsx?cc8c","webpack://lds-commerce/./src/modules/checkout-google-pay/checkout-google-pay.tsx?5941","webpack://lds-commerce/./src/modules/checkout-pickup/checkout-pickup.tsx?28aa","webpack://lds-commerce/./src/modules/checkout-pickup/checkout-pickup.view.tsx?d64e","webpack://lds-commerce/./src/modules/checkout-payment-instrument/checkout-payment-instrument.tsx?17da","webpack://lds-commerce/./src/modules/checkout-payment-instrument/checkout-payment-instrument.view.tsx?cb45","webpack://lds-commerce/./src/checkout-errors/checkout-errors.ts?a9e0","webpack://lds-commerce/../../src/checkout-state-data-action.ts?8344","webpack://lds-commerce/../../src/checkout-state.ts?acd8","webpack://lds-commerce/../../../src/module-state-manager/with-module-state.tsx?61ca","webpack://lds-commerce/../../../src/module-state-manager/module-state.ts?7579","webpack://lds-commerce/../../src/checkout-utilities.data.ts?b2cc","webpack://lds-commerce/./src/common/index.ts?f3e7","webpack://lds-commerce/./src/common/error.tsx?096f","webpack://lds-commerce/./src/common/waiting.tsx?8095","webpack://lds-commerce/./src/modules/checkout-pickup/components/checkout-pickup-group.tsx?9de7","webpack://lds-commerce/./src/common/empty-active-cart-invoice.tsx?0df8","webpack://lds-commerce/./src/common/place-order.tsx?8526","webpack://lds-commerce/./src/common/payment-instrument.dropin.style.ts?5102","webpack://lds-commerce/./src/common/add-payment-form.tsx?1cf5","webpack://lds-commerce/./src/common/payment-instrument-message.ts?53ea","webpack://lds-commerce/./src/common/checkout.tsx?29a4","webpack://lds-commerce/./src/common/empty-active-cart.tsx?dc76","webpack://lds-commerce/./src/common/with-visibility-observer.tsx?95e4","webpack://lds-commerce/./src/common/get-checkout-return-url.tsx?1758","webpack://lds-commerce/./src/modules/checkout-customer-account-payment/components/get-account-payment-form-edit-mode.tsx?83e6","webpack://lds-commerce/./src/modules/checkout-customer-account-payment/components/get-account-payment-form-summary-mode.tsx?5675","webpack://lds-commerce/./src/modules/checkout-payment-instrument/components/payment-information.tsx?213f","webpack://lds-commerce/./src/modules/checkout-guest-profile/components/get-add-contact-info.tsx?c9f6","webpack://lds-commerce/./src/modules/checkout-guest-profile/components/get-add-customer-reference-info.tsx?dda7","webpack://lds-commerce/./src/modules/checkout-guest-profile/components/get-add-customer-requisition-info.tsx?b5a7","webpack://lds-commerce/./src/modules/checkout-guest-profile/components/get-show-contact-info.tsx?e9b5","webpack://lds-commerce/./src/modules/checkout-guest-profile/components/get-show-note-info.tsx?44a0","webpack://lds-commerce/./src/modules/checkout-guest-profile/components/get-show-customer-reference-info.tsx?025f","webpack://lds-commerce/./src/modules/checkout-guest-profile/components/get-show-customer-requisition-info.tsx?85d3","webpack://lds-commerce/./src/modules/checkout-guest-profile/components/get-add-note-info.tsx?7024","webpack://lds-commerce/./src/modules/checkout-pickup/components/checkout-pickup-utility.ts?b7eb","webpack://lds-commerce/./src/modules/checkout-pickup/components/checkout-pickup-date-dropdown.tsx?e5a3","webpack://lds-commerce/./src/modules/checkout-pickup/components/checkout-pickup-timeslot-dropdown.tsx?aef8","webpack://lds-commerce/./src/modules/checkout-section-container/components/loading.tsx?2e57","webpack://lds-commerce/./src/modules/checkout-terms-and-conditions/components/checkout-terms-and-conditions.check-box.tsx?3b17","webpack://lds-commerce/./src/modules/checkout-terms-and-conditions/components/checkout-terms-and-conditions.error-message.tsx?c6a5","webpack://lds-commerce/./src/modules/checkout-terms-and-conditions/components/checkout-terms-and-conditions.error-title.tsx?f908","webpack://lds-commerce/./src/common/iframe.tsx?feca","webpack://lds-commerce/./src/common/country-codes.tsx?befd"],"sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { IModuleStateProps, EnabledPaymentsForOBO } from '@msdyn365-commerce-modules/checkout-utilities';\nimport { IModuleProps, INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\nimport classname from 'classnames';\n\nimport { reaction } from 'mobx';\nimport { ICheckoutExpressPaymentContainerData } from './checkout-express-payment-container.data';\nimport {\n ICheckoutExpressPaymentContainerProps,\n ICheckoutExpressPaymentContainerHeadingData\n} from './checkout-express-payment-container.props.autogenerated';\nimport { WaitingComponent } from '../../common/waiting';\n\n/**\n * ICheckoutExpressPaymentContainerModuleProps interface.\n */\nexport interface ICheckoutExpressPaymentContainerModuleProps\n extends ICheckoutExpressPaymentContainerProps<ICheckoutExpressPaymentContainerData>,\n IModuleStateProps {}\n\nexport interface ICheckoutExpressPaymentContainerViewProps\n extends ICheckoutExpressPaymentContainerProps<{}>,\n ICheckoutExpressPaymentContainerState {\n checkoutPlainContainerProps: IModuleProps;\n items: React.ReactNode[];\n isReady?: boolean;\n waiting?: React.ReactNode;\n title?: React.ReactNode;\n headerProps: INodeProps;\n}\n\n/**\n * Checkout Express Payment Container State.\n */\nexport interface ICheckoutExpressPaymentContainerState {\n isReady?: boolean;\n shouldHideExpressPaymentContainer?: boolean;\n}\n\n/**\n *\n * CheckoutExpressPaymentContainer component\n * @extends {React.PureComponent<ICheckoutExpressPaymentContainerModuleProps<ICheckoutExpressPaymentContainerData>>}\n */\n@observer\nexport class CheckoutExpressPaymentContainer extends React.PureComponent<\n ICheckoutExpressPaymentContainerProps<ICheckoutExpressPaymentContainerData>,\n ICheckoutExpressPaymentContainerState\n> {\n private readonly moduleClassName: string = 'ms-checkout-express-section-container';\n\n public constructor(props: ICheckoutExpressPaymentContainerModuleProps) {\n super(props);\n this.state = {\n isReady: false,\n shouldHideExpressPaymentContainer: this.props.data.checkout.result?.shippingAddressFromExpressCheckout ? true : false\n };\n }\n\n public componentDidMount(): void {\n reaction(\n () => this.props.data.checkout.result?.isExpressPaymentModulesReady,\n () => {\n const items = this._getItems();\n if (items.length === 0) {\n this.props.context.telemetry.error('Checkout express payment container content is empty, module wont render');\n } else {\n let isReady = true;\n\n for (const item of items) {\n // @ts-ignore\n if (item.key.includes('checkout-express')) {\n // @ts-ignore\n const extensionPropertyKey = `is${item.props.config.paymentTenderType}ExpressModuleReady`;\n\n const isModuleReady =\n this.props.data.checkout.result?.isExpressPaymentModulesReady?.find(\n property => property.Key === extensionPropertyKey\n )?.Value?.BooleanValue ?? false;\n isReady = isReady && isModuleReady;\n }\n }\n this.setState({ isReady });\n }\n }\n );\n\n reaction(\n () => this.props.data.checkout.result?.isExpressCheckoutApplied,\n isExpressCheckoutApplied => {\n this.setState({ shouldHideExpressPaymentContainer: isExpressCheckoutApplied });\n }\n );\n }\n\n public render(): JSX.Element | null {\n const {\n config: { checkoutExpressPaymentContainerHeading },\n resources: { checkoutExpressPaymentSectionLoadingMessage },\n data: { checkout }\n } = this.props;\n\n if (!checkout.result || checkout.result?.isExpressCheckoutApplied || checkout.result?.isPaymentVerificationRedirection) {\n this.props.context.telemetry.information('Other payment is applied, checkout express payment container module wont render');\n return null;\n }\n\n if (this.props.context.request.user.isOBORequest && EnabledPaymentsForOBO.ExpressPayment === 0) {\n this.props.context.telemetry.information('isOBORequest is enabled, Checkout express payment container module wont render');\n return null;\n }\n\n const items = this._getItems();\n if (items.length === 0) {\n this.props.context.telemetry.error('Checkout express payment container content is empty, module wont render');\n return null;\n }\n\n const shouldHideExpressPaymentContainerClassName: string = this.state.shouldHideExpressPaymentContainer ? 'hide' : '';\n\n const moduleClassName = classname(\n 'ms-checkout-express-payment-container',\n this.props.config.className,\n shouldHideExpressPaymentContainerClassName\n );\n\n const viewProps: ICheckoutExpressPaymentContainerViewProps = {\n ...this.props,\n\n checkoutPlainContainerProps: {\n moduleProps: this.props,\n className: moduleClassName\n },\n items: items,\n isReady: this.state.isReady,\n waiting: <WaitingComponent {...{ message: checkoutExpressPaymentSectionLoadingMessage, className: this.moduleClassName }} />,\n title: checkoutExpressPaymentContainerHeading && this._renderMsdyn365Text(checkoutExpressPaymentContainerHeading),\n headerProps: { className: 'ms-checkout-express-payment-container__head' }\n };\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private readonly _getItems = (): React.ReactNode[] => {\n const { slots } = this.props;\n return (slots && slots.primary && slots.primary.length && slots.primary) || [];\n };\n\n /**\n * Renders heading.\n * @param checkoutExpressPaymentContainerHeading - The checkout express container heading.\n * @returns React node.\n */\n private _renderMsdyn365Text(checkoutExpressPaymentContainerHeading: ICheckoutExpressPaymentContainerHeadingData): React.ReactNode {\n return (\n <Msdyn365.Text\n {...checkoutExpressPaymentContainerHeading}\n tag={checkoutExpressPaymentContainerHeading.tag || 'h2'}\n className='ms-checkout-express-payment-container__title'\n text={checkoutExpressPaymentContainerHeading.text}\n editProps={{ onEdit: this._handleCheckoutExpressContainerHeadingChange, requestContext: this.props.context.request }}\n />\n );\n }\n\n /**\n * Event handler for heading change event.\n * @param event - The content change event in heading element.\n * @returns The new heading value.\n */\n private _handleCheckoutExpressContainerHeadingChange = (event: Msdyn365.ContentEditableEvent) =>\n (this.props.config.checkoutExpressPaymentContainerHeading!.text = event.target.value);\n}\n\nexport default CheckoutExpressPaymentContainer;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\nimport { EmailRegex, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\nimport { CheckoutModule, ErrorLocation } from '@msdyn365-commerce/global-state';\nimport classnames from 'classnames';\nimport { action, computed, reaction, when } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\nimport { Note } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { focusOnCheckoutError } from '../../checkout-errors';\nimport { ErrorComponent } from '../../common';\n\nimport { ICheckoutGuestProfileData } from './checkout-guest-profile.data';\nimport { ICheckoutGuestProfileProps } from './checkout-guest-profile.props.autogenerated';\nimport getAddContactInfo, { IAddContactInfo } from './components/get-add-contact-info';\nimport getAddCustomerRefInfo, { IAddCustomerRefInfo } from './components/get-add-customer-reference-info';\nimport getAddPurchaseOrderInfo, { IAddPurchaseOrderInfo } from './components/get-add-customer-requisition-info';\nimport getShowContactInfo, { IShowContactInfo } from './components/get-show-contact-info';\nimport getNoteInfo, { IShowNoteInfo } from './components/get-show-note-info';\nimport getCustomerRefInfo, { IShowCustomerRefInfo } from './components/get-show-customer-reference-info';\nimport getPurchaseOrderInfo, { IShowPurchaseOrderInfo } from './components/get-show-customer-requisition-info';\nimport getAddNoteInfo, { IAddNoteInfo } from './components/get-add-note-info';\n\ninterface ICheckoutGuestProfileState {\n email: string;\n customerRequisition?: string;\n customerReference?: string;\n note?: Note;\n hasCheckoutError?: boolean;\n errorMessage?: string;\n}\n\nexport interface ICheckoutGuestProfileModuleProps extends ICheckoutGuestProfileProps<ICheckoutGuestProfileData>, IModuleStateProps {}\n\nexport interface ICheckoutGuestProfileViewProps extends ICheckoutGuestProfileProps<ICheckoutGuestProfileData>, ICheckoutGuestProfileState {\n moduleProps: IModuleProps;\n showContactInfo?: IShowContactInfo;\n showCustomerRefInfo?: IShowCustomerRefInfo;\n showPurchaseOrderInfo?: IShowPurchaseOrderInfo;\n showNoteInfo?: IShowNoteInfo;\n addPurchaseOrderInfo?: IAddPurchaseOrderInfo;\n addCustomerRefInfo?: IAddCustomerRefInfo;\n addNoteInfo?: IAddNoteInfo;\n addContactInfo?: IAddContactInfo;\n alert?: React.ReactNode;\n checkoutErrorRef?: React.RefObject<HTMLElement>;\n\n onChange?(email: string, customerRequisition?: string, customerReference?: string, note?: Note): void;\n onEdit?(): void;\n onSubmit?(): void;\n onCancel?(): void;\n}\n\n/**\n *\n * CheckoutGuestProfile component.\n * @extends {React.PureComponent<ICheckoutGuestProfileProps<ICheckoutGuestProfileData>, ICheckoutGuestProfileState>}\n */\n// @ts-expect-error\n@withModuleState\n@observer\nclass CheckoutGuestProfile extends React.Component<ICheckoutGuestProfileModuleProps, ICheckoutGuestProfileState> {\n public state: ICheckoutGuestProfileState = {\n email:\n (this.props.context &&\n this.props.context.request &&\n this.props.context.request.user &&\n this.props.context.request.user.isAuthenticated &&\n this.props.context.request.user.emailAddress) ||\n ''\n };\n\n private readonly inputRef: React.RefObject<HTMLInputElement> = React.createRef();\n\n private readonly checkoutErrorRef: React.RefObject<HTMLElement> = React.createRef();\n\n private readonly customerReferenceRef: React.RefObject<HTMLInputElement> = React.createRef();\n\n private readonly customerRequisitionRef: React.RefObject<HTMLInputElement> = React.createRef();\n\n private readonly noteRef: React.RefObject<HTMLInputElement> = React.createRef();\n\n @computed get isDataReady(): boolean {\n return (this.props.data.checkout.result && this.props.data.checkout.status) === 'SUCCESS';\n }\n\n @computed get hasEmailError(): boolean {\n return this.props.moduleState.hasError && !this.state.hasCheckoutError;\n }\n\n public componentDidMount(): void {\n when(\n () => this.isDataReady,\n async () => {\n await this.init();\n }\n );\n\n reaction(\n () => this.props.data.checkout.result?.isExpressCheckoutApplied,\n async isExpressCheckoutApplied => {\n const emailAddressFromExpressCheckout = this.props.data.checkout.result?.emailAddressFromExpressCheckout ?? '';\n const isEmailFromExpressCheckoutDifferent =\n !StringExtensions.isNullOrEmpty(emailAddressFromExpressCheckout) &&\n emailAddressFromExpressCheckout !== this.state.email;\n\n if (\n isExpressCheckoutApplied &&\n (!this.props.data.checkout.result?.isExpressAddressApplied || isEmailFromExpressCheckoutDifferent)\n ) {\n await this.submitEmail(emailAddressFromExpressCheckout);\n }\n }\n );\n\n if (this.props.data.checkout.result?.shouldEnableCheckoutErrorDisplayMessaging) {\n reaction(\n () => this.props.data.checkout.result?.checkoutError,\n checkoutError => {\n if (checkoutError && checkoutError.errorLocation === ErrorLocation.CheckoutGuestProfile && checkoutError.errorMessage) {\n this._setErrorMessage(checkoutError.errorMessage);\n }\n }\n );\n\n reaction(\n () => this.props.data.checkout.result?.checkoutErrorFocus,\n checkoutErrorFocus => {\n if (checkoutErrorFocus === CheckoutModule.CheckoutGuestProfile) {\n focusOnCheckoutError(this.checkoutErrorRef, this.props.context.actionContext);\n }\n }\n );\n }\n }\n\n public shouldComponentUpdate(nextProps: ICheckoutGuestProfileModuleProps, nextState: ICheckoutGuestProfileState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element {\n const {\n config: { className },\n resources,\n moduleState: { isReady, hasExternalSubmitGroup }\n } = this.props;\n const { hasCheckoutError, errorMessage } = this.state;\n const email = this.props.data.checkout.result?.guestCheckoutEmail ?? '';\n const customerRef = this.props.data.checkout.result?.checkoutCart?.cart?.Comment ?? '';\n const customerRequisition = this.props.data.checkout.result?.checkoutCart?.cart?.CustomerRequisition ?? '';\n const note = this.props.data.checkout.result?.checkoutCart?.cart?.Notes ?? [];\n\n const viewProps: ICheckoutGuestProfileViewProps = {\n ...this.props,\n ...this.state,\n checkoutErrorRef: this.checkoutErrorRef,\n onChange: this.onChange,\n onEdit: this.onEdit,\n onCancel: this.onCancel,\n onSubmit: this.onSubmit,\n\n moduleProps: {\n moduleProps: this.props,\n className: classnames('ms-checkout-guest-profile', className, isReady ? 'show' : 'add')\n },\n alert: hasCheckoutError && errorMessage && (\n <ErrorComponent {...{ title: resources.errorMessageTitle, message: errorMessage }} />\n ),\n showContactInfo: isReady\n ? getShowContactInfo({\n canEdit: !hasExternalSubmitGroup,\n email,\n resources,\n onEdit: this.onEdit\n })\n : undefined,\n showCustomerRefInfo:\n isReady && this.props.config.enableCustomerReference\n ? getCustomerRefInfo({\n canEdit: !hasExternalSubmitGroup,\n customerRef,\n resources,\n onEdit: this.onEdit\n })\n : undefined,\n showPurchaseOrderInfo:\n isReady && this.props.config.enableCustomerRequisition\n ? getPurchaseOrderInfo({\n canEdit: !hasExternalSubmitGroup,\n purchaseOrder: customerRequisition,\n resources,\n onEdit: this.onEdit\n })\n : undefined,\n showNoteInfo:\n isReady && this.props.config.enableCartNote\n ? getNoteInfo({\n noteDescription: note !== undefined ? note[0]?.Description : ''\n })\n : undefined,\n addContactInfo: !isReady\n ? getAddContactInfo({\n email: this.state.email,\n hasError: this.hasEmailError,\n resources,\n inputRef: this.inputRef,\n onChange: this.onChange,\n canSubmit: !hasExternalSubmitGroup,\n onSubmit: this.onSubmit,\n canCancel: !hasExternalSubmitGroup && !!email,\n onCancel: this.onCancel\n })\n : undefined,\n addPurchaseOrderInfo:\n !isReady && this.props.config.enableCustomerRequisition\n ? getAddPurchaseOrderInfo({\n purchaseOrderNumber: this.state.customerRequisition,\n resources,\n inputRef: this.customerRequisitionRef,\n onChange: this.onChangeCustomerRequisition,\n canSubmit: !hasExternalSubmitGroup,\n onSubmit: this.onSubmit,\n canCancel: !hasExternalSubmitGroup && !!email,\n onCancel: this.onCancel,\n hasError: this.hasEmailError\n })\n : undefined,\n addCustomerRefInfo:\n !isReady && this.props.config.enableCustomerReference\n ? getAddCustomerRefInfo({\n customerRef: this.state.customerReference,\n resources,\n inputRef: this.customerReferenceRef,\n onChange: this.onChangeCustomerRef,\n canSubmit: !hasExternalSubmitGroup,\n onSubmit: this.onSubmit,\n canCancel: !hasExternalSubmitGroup && !!email,\n onCancel: this.onCancel,\n hasError: this.hasEmailError\n })\n : undefined,\n addNoteInfo:\n !isReady && this.props.config.enableCartNote\n ? getAddNoteInfo({\n note: this.state.note,\n resources,\n inputRef: this.noteRef,\n onChange: this.onChangeNote,\n canSubmit: !hasExternalSubmitGroup,\n onSubmit: this.onSubmit,\n canCancel: !hasExternalSubmitGroup && !!email,\n onCancel: this.onCancel,\n hasError: this.hasEmailError\n })\n : undefined\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private readonly init = async (): Promise<void> => {\n const checkoutState = this.props.data.checkout.result;\n const customerAccountInformation = this.props.data.accountInformation?.result;\n const checkoutCart = checkoutState?.checkoutCart.cart;\n\n const hasInvoiceLine = checkoutState?.checkoutCart.hasInvoiceLine;\n let updateEmail: string = '';\n\n // if obo enabled and profile selected, we need to send the order status to obo user not store manager.\n if (Msdyn365.isOboRequest(this.props.context.request)) {\n updateEmail =\n customerAccountInformation && customerAccountInformation.Email !== undefined\n ? customerAccountInformation.Email\n : this.setErrorMsgOboUserEmailEmpty();\n } else {\n updateEmail = this.state.email;\n }\n\n const emailOnCart = checkoutCart?.ReceiptEmail;\n const notes = checkoutCart?.Notes !== undefined && checkoutState?.checkoutCart.cart.Notes;\n const customerRequisition = checkoutCart?.CustomerRequisition;\n const customerReference = checkoutCart?.Comment;\n\n const email = hasInvoiceLine\n ? this.props.context.request.user.emailAddress ?? ''\n : emailOnCart ??\n (checkoutState?.isExpressCheckoutApplied && !StringExtensions.isNullOrEmpty(checkoutState.emailAddressFromExpressCheckout)\n ? checkoutState.emailAddressFromExpressCheckout\n : undefined) ??\n updateEmail;\n\n const isEmailValid = this.isEmailValid(email);\n this.props.moduleState.init({\n onEdit: this.onEdit,\n onCancel: this.onCancel,\n onSubmit: this.onSubmit,\n status: hasInvoiceLine ? 'disabled' : email && isEmailValid ? 'ready' : 'updating',\n hasError: !!email && !isEmailValid\n });\n\n if (email) {\n notes !== undefined\n ? await this.updateGuestProfile(email, customerReference, customerRequisition, notes[0])\n : await this.updateGuestProfile(email, customerReference, customerRequisition);\n checkoutState?.updateHasGuestCheckoutEmail({ newHasGuestCheckoutEmail: true });\n } else {\n checkoutState?.updateHasGuestCheckoutEmail({ newHasGuestCheckoutEmail: false });\n }\n };\n\n private readonly onChange = (rowEmail: string): void => {\n const email = (rowEmail || '').replace(new RegExp('[<>]', 'gi'), '');\n this.setState({ email });\n if (this.props.moduleState.hasError) {\n // Clear error during user updating the email\n this.props.moduleState.setHasError(false);\n this.setState({\n hasCheckoutError: false\n });\n }\n };\n\n private readonly onChangeCustomerRef = (customerRef: string): void => {\n this.setState({ customerReference: customerRef });\n };\n\n private readonly onChangeCustomerRequisition = (customerRequisition: string): void => {\n this.setState({ customerRequisition: customerRequisition });\n };\n\n private readonly onChangeNote = (note: string): void => {\n if (note === '') {\n this.setState({ note: undefined });\n } else {\n const defaultNote = this.props.config.defaultNoteTitle;\n this.setState({ note: { Description: note, Title: defaultNote, RestrictionValue: 1 } });\n }\n };\n\n private readonly setErrorMsgOboUserEmailEmpty = (): string => {\n // Clear prior error\n this.props.moduleState.setHasError(false);\n this.setState({\n hasCheckoutError: false\n });\n return '';\n };\n\n private readonly isEmailValid = (email: string): boolean => {\n return EmailRegex.defaultRegex.test(email);\n };\n\n private readonly updateGuestProfile = async (\n newGuestCheckoutEmail: string,\n customerReference?: string,\n customerRequisition?: string,\n note?: Note\n ): Promise<void> => {\n if (this.props.data.checkout.result) {\n await this.props.data.checkout.result.updateGuestCheckoutEmail({\n newGuestCheckoutEmail,\n customerReference,\n customerRequisition,\n note\n });\n this.setState({ email: newGuestCheckoutEmail });\n this.setState({ note: note });\n this.setState({ customerReference: customerReference });\n this.setState({ customerRequisition: customerRequisition });\n }\n };\n\n private readonly onEdit = (): void => {\n this.props.telemetry.information('Guest profile onEdit is called.');\n\n this.props.moduleState.onUpdating();\n };\n\n private readonly onSubmit = async (): Promise<void> => {\n this.props.telemetry.information('Guest profile onSubmit is called.');\n\n const { email } = this.state;\n const { customerReference, customerRequisition, note } = this.state;\n await this.submitEmail(email, customerReference, customerRequisition, note);\n };\n\n /**\n * Submit the email address.\n * @param email - The email to be submitted.\n *\n */\n private readonly submitEmail = async (\n email: string,\n customerReference?: string,\n customerRequisition?: string,\n note?: Note\n ): Promise<void> => {\n const isValid = this.isEmailValid(email);\n if (!isValid) {\n this.props.moduleState.setHasError(true);\n\n const input = this.inputRef.current?.focus && (this.inputRef.current as HTMLElement);\n input?.focus();\n } else {\n this.props.moduleState.onReady();\n await this.updateGuestProfile(email, customerReference, customerRequisition, note);\n }\n };\n\n private readonly onCancel = (): void => {\n this.props.telemetry.information('Guest profile onCancel is called.');\n\n // Reset to the saved value\n if (!this.props.data.checkout.result) {\n return;\n }\n\n const checkoutState = this.props.data.checkout.result;\n const checkoutCart = checkoutState?.checkoutCart.cart;\n const email = checkoutState.guestCheckoutEmail;\n const notes = checkoutCart?.Notes !== undefined && checkoutState?.checkoutCart.cart.Notes;\n const customerRequisition = checkoutCart?.CustomerRequisition;\n const customerReference = checkoutCart?.Comment;\n if (!email) {\n // It has no saved email, set to status updating and request user to fill the email form\n this.props.moduleState.onUpdating();\n } else {\n // It has saved email, set to status ready\n this.setState({\n email\n });\n if (notes !== undefined) {\n this.setState({ note: notes[0] });\n }\n this.setState({ customerReference: customerReference });\n this.setState({ customerRequisition: customerRequisition });\n this.props.moduleState.setHasError(false);\n this.setState({\n hasCheckoutError: false\n });\n this.props.moduleState.onReady();\n }\n };\n\n @action\n private readonly _setErrorMessage = (errorMessage: string): void => {\n this.props.telemetry.error(errorMessage);\n this.props.moduleState.setHasError(true);\n this.props.moduleState.onUpdating();\n this.setState({\n hasCheckoutError: true,\n errorMessage\n });\n };\n}\n\nexport default CheckoutGuestProfile;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IModuleStateManager, IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { IModuleProps, INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport classname from 'classnames';\nimport get from 'lodash/get';\nimport { computed, reaction } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { ICheckoutSectionContainerData } from './checkout-section-container.data';\nimport { ICheckoutSectionContainerProps } from './checkout-section-container.props.autogenerated';\nimport LoadingComponent from './components/loading';\n\n/**\n * ICheckoutSectionContainerModuleProps interface.\n */\nexport interface ICheckoutSectionContainerModuleProps\n extends ICheckoutSectionContainerProps<ICheckoutSectionContainerData>,\n IModuleStateProps {\n enableControl: boolean;\n}\n\ninterface ICheckoutSectionContainerState {\n isCollapse?: boolean;\n}\n\nexport interface ICheckoutSectionContainerItem {\n id: string;\n loading?: React.ReactNode;\n itemProps: INodeProps;\n item: React.ReactNode;\n}\n\nexport interface ICheckoutSectionContainerViewProps extends ICheckoutSectionContainerProps<{}> {\n className: string;\n checkoutPlainContainerProps: IModuleProps;\n items: ICheckoutSectionContainerItem[];\n}\n\nconst paymentInstrumentModuleId = 'payment-instrument';\n\nconst zeroAmount = 0;\n\n/**\n *\n * CheckoutPlainContainer component.\n * @extends {React.Component<ICheckoutSectionContainerModuleProps<ICheckoutSectionContainerData>>}\n */\n@observer\nexport class CheckoutPlainContainer extends React.Component<ICheckoutSectionContainerModuleProps, ICheckoutSectionContainerState> {\n @computed public get amountDue(): number {\n const {\n data: { checkout }\n } = this.props;\n if (!checkout?.result) {\n return 0;\n }\n\n const checkoutResult = checkout.result;\n const cart = checkoutResult.checkoutCart?.cart;\n if (!cart || !cart.CartLines || !ArrayExtensions.hasElements(cart.CartLines)) {\n return 0;\n }\n\n return cart.TotalAmount ?? zeroAmount;\n }\n\n public constructor(props: ICheckoutSectionContainerModuleProps) {\n super(props);\n this.state = { isCollapse: false };\n }\n\n public componentDidMount(): void {\n const items = this.getItems();\n const childIds = items.map((item: React.ReactNode) => get(item, 'props.id'));\n const shouldEnableSinglePaymentAuthorizationCheckout: boolean =\n this.props.data.checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout ?? false;\n\n this.props.moduleState.init({\n onEdit: this.onEdit,\n onCancel: shouldEnableSinglePaymentAuthorizationCheckout ? undefined : this.onCancel,\n onSubmit: shouldEnableSinglePaymentAuthorizationCheckout ? undefined : this.onSubmit,\n childIds\n });\n\n reaction(\n () => this.props.moduleState.isReady,\n () => {\n this.onContainerReady();\n }\n );\n\n reaction(\n () => this.props.moduleState.shouldSubmitContainer,\n () => {\n this.onSubmit();\n }\n );\n\n // Reaction to collapse the payment section for new checkout flow.\n reaction(\n () => this.props.data.checkout.result?.shouldCollapsePaymentSection,\n shouldCollapsePaymentSection => {\n const isPaymentSectionContainer = ArrayExtensions.hasElements(\n this.props.moduleState.childIds.filter(childId => childId.includes(paymentInstrumentModuleId))\n );\n\n if (shouldEnableSinglePaymentAuthorizationCheckout && isPaymentSectionContainer) {\n this.setState({ isCollapse: shouldCollapsePaymentSection });\n }\n }\n );\n\n // Reaction to submit section container for new checkout flow\n reaction(\n () => this.props.data.checkout.result?.shouldTriggerPaymentWithPlaceOrder,\n () => {\n const isPaymentSectionContainer = ArrayExtensions.hasElements(\n this.props.moduleState.childIds.filter(childId => childId.includes(paymentInstrumentModuleId))\n );\n\n if (shouldEnableSinglePaymentAuthorizationCheckout && isPaymentSectionContainer) {\n this.onSubmit();\n }\n }\n );\n\n // Reaction to set isPaymentSectionContainerReady for new checkout flow.\n reaction(\n () => this.props.moduleState.isReady,\n async isReady => {\n const isPaymentSectionContainer = ArrayExtensions.hasElements(\n this.props.moduleState.childIds.filter(childId => childId.includes(paymentInstrumentModuleId))\n );\n\n if (shouldEnableSinglePaymentAuthorizationCheckout && isPaymentSectionContainer && this.amountDue > zeroAmount) {\n await this.props.data.checkout.result?.updateIsPaymentSectionContainerReady({\n newIsPaymentSectionContainerReady: isReady\n });\n }\n }\n );\n\n // Reaction to set isPaymentSectionContainerHasError for new checkout flow.\n reaction(\n () => this.props.moduleState.hasError,\n async hasError => {\n const isPaymentSectionContainer = ArrayExtensions.hasElements(\n this.props.moduleState.childIds.filter(childId => childId.includes(paymentInstrumentModuleId))\n );\n\n if (shouldEnableSinglePaymentAuthorizationCheckout && isPaymentSectionContainer) {\n await this.props.data.checkout.result?.updateIsPaymentSectionContainerHasError({\n newIsPaymentSectionContainerHasError: hasError\n });\n }\n }\n );\n\n reaction(\n () => this.props.data.checkout.result?.isCheckoutCallFailed,\n async () => {\n const isPaymentSectionContainer = ArrayExtensions.hasElements(\n this.props.moduleState.childIds.filter(childId => childId.includes(paymentInstrumentModuleId))\n );\n\n if (isPaymentSectionContainer && this.props.data.checkout.result?.isCheckoutCallFailed) {\n this.onEdit();\n await this.props.data.checkout.result.updateIsCheckoutCallFailed({ newIsCheckoutCallFailed: true });\n }\n }\n );\n }\n\n public componentDidUpdate(): void {\n if (!this.props.moduleState.hasExternalSubmitGroup) {\n return;\n }\n\n /**\n * Review all modules to updating status if one of the modules has error.\n */\n const { childIds, hasError, getModule } = this.props.moduleState;\n const hasReadyOrSkippedItems = childIds.some((childId: string) => {\n const state = getModule(childId);\n return !!state && (state.isReady || state.isSkipped);\n });\n if (hasReadyOrSkippedItems && hasError) {\n this.onEdit();\n }\n }\n\n public shouldComponentUpdate(nextProps: ICheckoutSectionContainerModuleProps, nextState: ICheckoutSectionContainerState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | null {\n const {\n enableControl,\n moduleState,\n config: { width }\n } = this.props;\n\n const items = this.getItems();\n if (items.length === 0) {\n this.props.context.telemetry.error('Checkout section content is empty, module wont render');\n return null;\n }\n\n const moduleClassName = classname(\n 'ms-checkout-section-container',\n {\n 'has-initialized': moduleState.hasInitialized,\n 'is-ready': moduleState.isReady,\n 'is-updating': !moduleState.isReady,\n container: width === 'container',\n 'col-12 fullwidth': width === 'fluid'\n },\n this.props.config.className\n );\n\n const viewProps: ICheckoutSectionContainerViewProps = {\n ...this.props,\n\n className: moduleClassName,\n checkoutPlainContainerProps: {\n moduleProps: this.props,\n className: moduleClassName\n },\n items: items.map((item: React.ReactNode) => {\n const childId = get(item, 'props.id');\n const state = moduleState.getModule(childId);\n\n // Modules has not completed initializing or it's disable\n const hidden =\n this.state.isCollapse || (state.hasModuleState && (!state.hasInitialized || state.isDisabled || state.isSkipped));\n return {\n id: childId,\n loading: state.hasModuleState && !state.hasInitialized && <LoadingComponent />,\n itemProps: {\n 'data-type-name': state.typeName,\n className: classname('ms-checkout-section-container__item', {\n hidden,\n initialized: state.hasInitialized,\n disabled: state.isDisabled,\n skipped: state.isSkipped,\n ready: state.isReady,\n updating: state.isUpdating,\n pending: state.isPending\n })\n },\n item: React.cloneElement(item as React.ReactElement, { enableControl })\n };\n })\n };\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private readonly getItems = (): React.ReactNode[] => {\n const { slots } = this.props;\n return (slots && slots.primary && slots.primary.length && slots.primary) || [];\n };\n\n private readonly getActiveChildModuleStates = (): IModuleStateManager[] => {\n const { childIds, getModule } = this.props.moduleState;\n return childIds\n .map(getModule)\n .filter((state): state is IModuleStateManager => !!state && !state.isDisabled && state.hasModuleState);\n };\n\n private readonly clearError = (): void => {\n // Clear error before action, otherwise it will rise conflict;\n this.getActiveChildModuleStates().forEach(state => {\n state.hasError && state.setHasError(false);\n });\n };\n\n private readonly onSubmit = (): void => {\n const isPaymentSectionContainer = ArrayExtensions.hasElements(\n this.props.moduleState.childIds.filter(childId => childId.includes(paymentInstrumentModuleId))\n );\n\n this.props.telemetry.information('Section container onSubmit is called.');\n\n this.clearError();\n this.getActiveChildModuleStates().forEach(state => {\n !state.isReady && state.onSubmit && state.onSubmit();\n });\n\n // Handle when the amount due is zero\n if (\n this.props.data.checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout &&\n isPaymentSectionContainer &&\n this.amountDue === zeroAmount\n ) {\n this.props.data.checkout.result?.updateIsPaymentSectionContainerReady({\n newIsPaymentSectionContainerReady: true\n });\n }\n };\n\n private readonly onCancel = (): void => {\n this.props.telemetry.information('Section container onCancel is called.');\n\n this.clearError();\n this.getActiveChildModuleStates().forEach(state => {\n !state.isReady && state.onCancel && state.onCancel();\n });\n };\n\n private readonly onEdit = (): void => {\n this.props.telemetry.information('Section container onEdit is called.');\n\n this.getActiveChildModuleStates().forEach(state => {\n (state.isReady || state.isSkipped) && state.onEdit && state.onEdit();\n });\n };\n\n private readonly onContainerReady = (): void => {\n this.props.telemetry.information('Section container onContainerReady is called.');\n\n this.getActiveChildModuleStates().forEach(state => {\n state.isReady && state.onContainerReady && state.onContainerReady();\n });\n };\n}\n\nexport default withModuleState(CheckoutPlainContainer);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as MsDyn365 from '@msdyn365-commerce/core';\nimport { IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\nimport { Button, getTelemetryObject, IModuleProps, INodeProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport { CheckoutModule, ErrorLocation } from '@msdyn365-commerce/global-state';\nimport classname from 'classnames';\nimport { action, computed, observable, reaction, when } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { ICheckoutTermsAndConditionsData } from './checkout-terms-and-conditions.data';\nimport { ICheckoutTermsAndConditionsProps } from './checkout-terms-and-conditions.props.autogenerated';\nimport CheckboxComponent from './components/checkout-terms-and-conditions.check-box';\nimport ErrorMessageComponent from './components/checkout-terms-and-conditions.error-message';\nimport ErrorTitleComponent from './components/checkout-terms-and-conditions.error-title';\nimport { focusOnCheckoutError } from '../../checkout-errors';\n\nexport interface ICheckoutTermsAndConditionsModuleProps\n extends ICheckoutTermsAndConditionsProps<ICheckoutTermsAndConditionsData>,\n IModuleStateProps {}\n\nexport interface ICheckoutTermsAndConditions {\n termsAndConditionAcceptance: INodeProps;\n checkBox: React.ReactNode;\n description: React.ReactNode;\n}\n\nexport interface ICheckoutTermsAndConditionsError {\n error: INodeProps;\n title: React.ReactNode;\n message: React.ReactNode;\n}\n\nexport interface ICheckoutTermsAndConditionsViewState {\n isError: boolean;\n isShowSaveButton: boolean;\n isShowEditButton: boolean;\n isShowCancelButton: boolean;\n}\n\nexport interface ICheckoutTermsAndConditionsViewProps extends ICheckoutTermsAndConditionsProps<{}> {\n checkoutTermsAndConditions: IModuleProps;\n isTermsAccepted: boolean;\n errorMessageData: string;\n viewState: ICheckoutTermsAndConditionsViewState;\n termsAndConditionsContent: ICheckoutTermsAndConditions;\n errorMessage?: ICheckoutTermsAndConditionsError;\n saveButton?: React.ReactNode;\n editButton?: React.ReactNode;\n cancelButton?: React.ReactNode;\n checkoutErrorRef?: React.RefObject<HTMLElement>;\n onChange(event: React.ChangeEvent<HTMLInputElement>): void;\n onSave(): void;\n onEdit(): void;\n onCancel(): void;\n}\n\n/**\n *\n * CheckoutTermsAndConditions component.\n * @extends {React.Component<ICheckoutTermsAndConditionsProps<ICheckoutTermsAndConditionsData>>}\n */\n// @ts-expect-error\n@withModuleState\n@observer\nclass CheckoutTermsAndConditions extends React.Component<ICheckoutTermsAndConditionsModuleProps> {\n private readonly telemetryContent: ITelemetryContent;\n\n private readonly checkoutErrorRef: React.RefObject<HTMLElement> = React.createRef();\n\n @observable private isTermsAccepted: boolean = true;\n\n @observable private errorMessage?: string;\n\n constructor(props: ICheckoutTermsAndConditionsModuleProps) {\n super(props);\n this.telemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\n }\n\n @computed get isDataReady(): boolean {\n return (this.props.data.checkout.result && this.props.data.checkout.status) === 'SUCCESS';\n }\n\n @computed get isShowButtons(): boolean {\n const { showControlButtons } = this.props.config;\n return !this.props.moduleState.hasExternalSubmitGroup && (showControlButtons || false);\n }\n\n @computed get isAutoSave(): boolean {\n const { showControlButtons } = this.props.config;\n return !this.props.moduleState.hasExternalSubmitGroup && !showControlButtons;\n }\n\n @computed get defaultTermsAndConditionAcceptedValue(): boolean {\n const { showCheckbox } = this.props.config;\n return !showCheckbox;\n }\n\n public async componentDidMount(): Promise<void> {\n when(\n () => this.isDataReady,\n async () => {\n await this.init();\n }\n );\n\n reaction(\n () => this.props.data.checkout.result && this.props.data.checkout.result.isTermsAndConditionAccepted,\n async () => {\n this.isTermsAccepted =\n this.props.data.checkout.result?.isTermsAndConditionAccepted || this.defaultTermsAndConditionAcceptedValue;\n }\n );\n\n if (this.props.data.checkout.result?.shouldEnableCheckoutErrorDisplayMessaging) {\n reaction(\n () => this.props.data.checkout.result?.checkoutError,\n checkoutError => {\n if (\n checkoutError &&\n checkoutError.errorLocation === ErrorLocation.CheckoutTermsAndConditions &&\n checkoutError.errorMessage\n ) {\n this.setError(checkoutError.errorMessage);\n }\n }\n );\n\n reaction(\n () => this.props.data.checkout.result?.checkoutErrorFocus,\n checkoutErrorFocus => {\n if (checkoutErrorFocus === CheckoutModule.CheckoutTermsAndConditions) {\n focusOnCheckoutError(this.checkoutErrorRef, this.props.context.actionContext);\n }\n }\n );\n }\n }\n\n public shouldComponentUpdate(\n nextProps: ICheckoutTermsAndConditionsModuleProps,\n nextState: ICheckoutTermsAndConditionsViewState\n ): boolean {\n if (this.state === nextState && this.props === nextProps) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | null {\n const {\n moduleState: { isReady, hasError },\n config: { className }\n } = this.props;\n const isTermsAndConditionAccepted = this.props.data.checkout.result?.isTermsAndConditionAccepted;\n const isError = hasError;\n const isShowContent = !isReady;\n const isShowSelected = !hasError && isReady;\n\n const viewProps = {\n ...this.props,\n ...this.state,\n isTermsAccepted: this.isTermsAccepted,\n errorMessageData: this.errorMessage,\n checkoutErrorRef: this.checkoutErrorRef,\n viewState: {\n isError,\n isShowSaveButton: isShowContent && this.isShowButtons,\n isShowEditButton: isShowSelected && this.isShowButtons,\n isShowCancelButton: isShowContent && this.isShowButtons && isTermsAndConditionAccepted\n },\n checkoutTermsAndConditions: {\n moduleProps: this.props,\n className: classname('ms-checkout-terms-and-conditions', className)\n },\n termsAndConditionsContent: this.getTermsAndConditions(),\n errorMessage: this.getErrorMessage(),\n saveButton: this.getSaveButton(),\n editButton: this.getEditButton(),\n cancelButton: this.getCancelButton(),\n onSave: this.onSubmit,\n onEdit: this.onEdit,\n onCancel: this.onCancel,\n onChange: this.onChange\n };\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n public handleTextChange = (event: MsDyn365.ContentEditableEvent) => (this.props.config.description = event.target.value);\n\n private readonly getTermsAndConditions = (): ICheckoutTermsAndConditions => {\n const {\n moduleState: { isReady },\n config: { showCheckbox, description }\n } = this.props;\n const isDisabled = isReady && !this.isAutoSave;\n const isTermsAndConditionAccepted = this.isTermsAccepted;\n const { checkboxAriaLabel } = this.props.resources;\n return {\n termsAndConditionAcceptance: { className: 'ms-checkout-terms-and-conditions__container' },\n checkBox: showCheckbox && (\n <CheckboxComponent\n {...{\n isChecked: isTermsAndConditionAccepted,\n ariaLabel: checkboxAriaLabel,\n disabled: isDisabled,\n onChange: this.onChange,\n id: this.props.id,\n telemetryContent: this.telemetryContent\n }}\n />\n ),\n description: (\n <MsDyn365.RichTextComponent\n text={description}\n editProps={{ onEdit: this.handleTextChange, requestContext: this.props.context.request }}\n />\n )\n };\n };\n\n @action\n private readonly init = async (): Promise<void> => {\n const {\n data,\n config: { showCheckbox }\n } = this.props;\n\n const hasInvoiceLine = this.props.data.checkout.result?.checkoutCart.hasInvoiceLine;\n\n // If hasInvoiceLine is true, this is for b2b and isTermsAccepted should be true\n if (hasInvoiceLine || data.checkout.result?.isTermsAndConditionAccepted || !showCheckbox) {\n await this.updateTermsAndConditionsAcceptance(true);\n this.isTermsAccepted = true;\n } else if (showCheckbox) {\n await this.updateTermsAndConditionsAcceptance(false);\n this.isTermsAccepted = false;\n }\n\n this.props.moduleState.init({\n onEdit: this.onEdit,\n onCancel: this.onCancel,\n onSubmit: this.onSubmit,\n status: hasInvoiceLine ? 'disabled' : this.isTermsAccepted ? 'ready' : 'updating'\n });\n\n if (this.props.data.checkout.result?.isPaymentVerificationRedirection) {\n this.isTermsAccepted = true;\n this.props.moduleState.setHasError(false);\n this.props.moduleState.onReady();\n }\n };\n\n private readonly getErrorMessage = (): ICheckoutTermsAndConditionsError => {\n const { errorMessageTitle } = this.props.resources;\n return {\n error: { tag: 'div', className: 'ms-checkout-terms-and-conditions__error', role: 'alert', 'aria-live': 'assertive' },\n title: <ErrorTitleComponent {...{ title: errorMessageTitle }} />,\n message: <ErrorMessageComponent {...{ message: this.errorMessage }} />\n };\n };\n\n private readonly getCancelButton = (): React.ReactNode => {\n const { cancelBtnLabel = 'Cancel', cancelBtnAriaLabel } = this.props.resources;\n return (\n <Button\n className='ms-checkout-terms-and-conditions__button-cancel'\n title={cancelBtnLabel}\n aria-label={cancelBtnAriaLabel}\n color='secondary'\n onClick={this.onCancel}\n >\n {cancelBtnLabel}\n </Button>\n );\n };\n\n private readonly getSaveButton = (): React.ReactNode => {\n const { saveBtnLabel = 'Save', saveBtnAriaLabel } = this.props.resources;\n return (\n <Button\n className='ms-checkout-terms-and-conditions__button-save'\n title={saveBtnLabel}\n aria-label={saveBtnAriaLabel}\n color='primary'\n onClick={this.onSubmit}\n >\n {saveBtnLabel}\n </Button>\n );\n };\n\n private readonly getEditButton = (): React.ReactNode => {\n const { editBtnLabel = 'Change', editBtnAriaLabel } = this.props.resources;\n return (\n <Button\n className='ms-checkout-terms-and-conditions__button-edit'\n title={editBtnLabel}\n aria-label={editBtnAriaLabel}\n color='primary'\n onClick={this.onEdit}\n >\n {editBtnLabel}\n </Button>\n );\n };\n\n private readonly onEdit = (): void => {\n this.props.telemetry.information('Terms and conditions onEdit is called.');\n\n this.onUpdating();\n };\n\n private readonly onSubmit = async (): Promise<void> => {\n this.props.telemetry.information('Terms and conditions onSubmit is called.');\n\n if (!this.isTermsAccepted) {\n if (this.isAutoSave) {\n await this.updateTermsAndConditionsAcceptance(this.isTermsAccepted);\n } else {\n this.setError(this.props.resources.errorMessage);\n this.props.moduleState.setHasError(true);\n }\n } else {\n this.clearError();\n await this.updateTermsAndConditionsAcceptance(this.isTermsAccepted);\n this.props.moduleState.onReady();\n }\n };\n\n private readonly onUpdating = () => {\n this.props.moduleState.onUpdating();\n };\n\n private readonly setError = (errorMessage: string): void => {\n this.props.telemetry.error(errorMessage);\n this.props.moduleState.setHasError(true);\n this.props.moduleState.onUpdating();\n this.errorMessage = errorMessage;\n };\n\n private readonly onCancel = (): void => {\n this.props.telemetry.information('Terms and conditions onCancel is called.');\n\n // Reset to the saved value\n if (!this.props.data.checkout.result) {\n return;\n }\n\n const isTermsAccepted = this.props.data.checkout.result.isTermsAndConditionAccepted;\n if (!isTermsAccepted) {\n // It has no saved email, set to status updating and request user to fill the email form\n this.props.moduleState.onUpdating();\n } else {\n // It has saved email, set to status ready\n this.isTermsAccepted = true;\n this.props.moduleState.setHasError(false);\n this.props.moduleState.onReady();\n }\n };\n\n private readonly updateTermsAndConditionsAcceptance = async (isTermsAccepted: boolean): Promise<void> => {\n if (this.props.data.checkout.result) {\n await this.props.data.checkout.result.updateTermsAndConditionsAcceptance({ newIsTermsAndConditionAccepted: isTermsAccepted });\n }\n };\n\n private readonly clearError = (): void => {\n this.props.moduleState.setHasError(false);\n this.errorMessage = undefined;\n };\n\n private readonly onChange = async (event: React.ChangeEvent<HTMLInputElement>) => {\n const checked = event.target.checked;\n this.isTermsAccepted = checked;\n\n if (this.props.data.checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout) {\n await this.props.data.checkout.result.updateIsTermsAndConditionsChecked({ newIsTermsAndConditionChecked: checked });\n }\n\n if (this.isAutoSave) {\n await this.onSubmit();\n }\n };\n}\n\nexport default CheckoutTermsAndConditions;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IAddContactInfo } from './components/get-add-contact-info';\nimport { IAddCustomerRefInfo } from './components/get-add-customer-reference-info';\nimport { IAddPurchaseOrderInfo } from './components/get-add-customer-requisition-info';\nimport { IShowContactInfo } from './components/get-show-contact-info';\nimport { IShowNoteInfo } from './components/get-show-note-info';\nimport { IShowCustomerRefInfo } from './components/get-show-customer-reference-info';\nimport { IShowPurchaseOrderInfo } from './components/get-show-customer-requisition-info';\nimport { IAddNoteInfo } from './components/get-add-note-info';\nimport { ICheckoutGuestProfileViewProps } from './checkout-guest-profile';\n\nexport const ShowContactInfo: React.FC<IShowContactInfo> = ({ showInfoProps, email, editButton }) => (\n <Node {...showInfoProps}>\n {email}\n {editButton}\n </Node>\n);\n\nexport const ShowCustomerRefInfo: React.FC<IShowCustomerRefInfo> = ({ showInfoProps, customerRef }) => (\n <Node {...showInfoProps}>{customerRef}</Node>\n);\n\nexport const ShowPurchaseOrderInfo: React.FC<IShowPurchaseOrderInfo> = ({ showInfoProps, purchaseOrder }) => (\n <Node {...showInfoProps}>{purchaseOrder}</Node>\n);\n\nexport const ShowNoteInfo: React.FC<IShowNoteInfo> = ({ showInfoProps, noteDescription }) => (\n <Node {...showInfoProps}>{noteDescription}</Node>\n);\n\nexport const AddContactInfo: React.FC<IAddContactInfo> = ({\n addFormProps,\n submitButton,\n cancelButton,\n inputGroupProps,\n label,\n error,\n input\n}) => (\n <Node {...addFormProps}>\n <Node {...inputGroupProps}>\n {label}\n {error}\n {input}\n </Node>\n {submitButton}\n {cancelButton}\n </Node>\n);\n\nexport const AddPurchaseOrderInfo: React.FC<IAddPurchaseOrderInfo> = ({\n addFormProps,\n submitButton,\n cancelButton,\n inputGroupProps,\n label,\n input\n}) => (\n <Node {...addFormProps}>\n <Node {...inputGroupProps}>\n {label}\n {input}\n </Node>\n {submitButton}\n {cancelButton}\n </Node>\n);\n\nexport const AddNoteInfo: React.FC<IAddNoteInfo> = ({ addFormProps, submitButton, cancelButton, inputGroupProps, label, input }) => (\n <Node {...addFormProps}>\n <Node {...inputGroupProps}>\n {label}\n {input}\n </Node>\n {submitButton}\n {cancelButton}\n </Node>\n);\n\nexport const AddCustomerRefInfo: React.FC<IAddCustomerRefInfo> = ({\n addFormProps,\n submitButton,\n cancelButton,\n inputGroupProps,\n label,\n input\n}) => (\n <Node {...addFormProps}>\n <Node {...inputGroupProps}>\n {label}\n {input}\n </Node>\n {submitButton}\n {cancelButton}\n </Node>\n);\n\nconst CheckoutGuestProfileView: React.FC<ICheckoutGuestProfileViewProps> = ({\n moduleProps,\n checkoutErrorRef,\n alert,\n showContactInfo,\n showPurchaseOrderInfo,\n showCustomerRefInfo,\n showNoteInfo,\n addContactInfo,\n addPurchaseOrderInfo,\n addCustomerRefInfo,\n addNoteInfo\n}) => {\n return (\n <Module {...moduleProps} ref={checkoutErrorRef}>\n {alert}\n {showContactInfo && <ShowContactInfo {...showContactInfo} />}\n {showCustomerRefInfo && <ShowCustomerRefInfo {...showCustomerRefInfo} />}\n {showPurchaseOrderInfo && <ShowPurchaseOrderInfo {...showPurchaseOrderInfo} />}\n {showNoteInfo && <ShowNoteInfo {...showNoteInfo} />}\n {addContactInfo && <AddContactInfo {...addContactInfo} />}\n {addCustomerRefInfo && <AddCustomerRefInfo {...addCustomerRefInfo} />}\n {addPurchaseOrderInfo && <AddPurchaseOrderInfo {...addPurchaseOrderInfo} />}\n {addNoteInfo && <AddNoteInfo {...addNoteInfo} />}\n </Module>\n );\n};\n\nexport default CheckoutGuestProfileView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ICheckoutSectionContainerItem, ICheckoutSectionContainerViewProps } from './checkout-section-container';\n\nconst ItemComponent: React.FC<ICheckoutSectionContainerItem> = ({ loading, itemProps, item }) => (\n <>\n {loading}\n <Node {...itemProps}>{item}</Node>\n </>\n);\n\nconst CheckoutSectionContainerView: React.FC<ICheckoutSectionContainerViewProps> = ({ checkoutPlainContainerProps, items }) => (\n <Module {...checkoutPlainContainerProps}>\n {items.map(item => (\n <ItemComponent key={item.id} {...item} />\n ))}\n </Module>\n);\n\nexport default CheckoutSectionContainerView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport {\n ICheckoutTermsAndConditions,\n ICheckoutTermsAndConditionsError,\n ICheckoutTermsAndConditionsViewProps\n} from './checkout-terms-and-conditions';\n\nconst TermsAndCondition: React.FC<ICheckoutTermsAndConditions> = ({ termsAndConditionAcceptance, checkBox, description }) => {\n return (\n <Node {...termsAndConditionAcceptance}>\n {checkBox}\n {description}\n </Node>\n );\n};\n\nconst ErrorMessage: React.FC<ICheckoutTermsAndConditionsError> = ({ error, title, message }) => {\n return (\n <Node {...error}>\n {title}\n {message}\n </Node>\n );\n};\n\nconst CheckoutTermsAndConditionsView: React.FC<ICheckoutTermsAndConditionsViewProps> = props => {\n const {\n checkoutTermsAndConditions,\n checkoutErrorRef,\n viewState,\n termsAndConditionsContent,\n errorMessage,\n saveButton,\n editButton,\n cancelButton\n } = props;\n\n return (\n // TODO: All wrapper div should be provided by viewProps. Once SDK provide the sln, update markup.\n <Module {...checkoutTermsAndConditions} ref={checkoutErrorRef}>\n {viewState.isError && errorMessage && <ErrorMessage {...errorMessage} />}\n <TermsAndCondition {...termsAndConditionsContent} />\n {viewState.isShowSaveButton && saveButton}\n {viewState.isShowEditButton && editButton}\n {viewState.isShowCancelButton && cancelButton}\n </Module>\n );\n};\n\nexport default CheckoutTermsAndConditionsView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ICheckoutExpressPaymentContainerViewProps } from './checkout-express-payment-container';\n\ninterface IContainerItemsComponent {\n isLoadingClassName: string;\n items: React.ReactNode[];\n}\n\nconst ContainerItemsComponent: React.FC<IContainerItemsComponent> = ({ isLoadingClassName, items }) => (\n <div className={isLoadingClassName}>{items}</div>\n);\n\nconst CheckoutExpressPaymentContainerView: React.FC<ICheckoutExpressPaymentContainerViewProps> = ({\n checkoutPlainContainerProps,\n items,\n isReady,\n waiting,\n title,\n headerProps\n}) => {\n const isLoadingClassName: string = isReady ? 'showContainer' : 'notShowContainer';\n return (\n <Module {...checkoutPlainContainerProps}>\n <Node {...headerProps}>{title}</Node>\n {!isReady && waiting}\n <ContainerItemsComponent isLoadingClassName={isLoadingClassName} items={items} />\n </Module>\n );\n};\n\nexport default CheckoutExpressPaymentContainerView;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { ICheckoutState } from '@msdyn365-commerce/global-state';\nimport {\n AsyncResult, CardPaymentAcceptPoint\n} from '@msdyn365-commerce/retail-proxy';\n\nexport enum ApplePayButtonState {\n Unknown,\n NotAvailable,\n Available\n};\n\n/**\n * Interface for checkout apple pay data.\n */\nexport interface ICheckoutApplePayData {\n checkout?: AsyncResult<ICheckoutState>;\n cardPaymentAcceptPoint?: AsyncResult<CardPaymentAcceptPoint>;\n}","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\nimport { getCheckoutState, IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport {\n getDeliveryOptionsAsync,\n retrieveCardPaymentAcceptResultAsync\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport {\n Address,\n CardPaymentAcceptResult,\n Cart,\n FilterDeliveryModeOption\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport classNames from 'classnames';\nimport * as React from 'react';\n\nimport { CardPaymentAcceptPoint } from '@msdyn365-commerce/retail-proxy';\nimport { EnabledPaymentsForOBO } from '@msdyn365-commerce-modules/checkout-utilities';\nimport { computed } from 'mobx';\nimport { ObjectExtensions, QueryResultSettingsProxy, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { ApplePayButtonState, ICheckoutApplePayData } from './checkout-apple-pay.data';\nimport { ICheckoutApplePayProps } from './checkout-apple-pay.props.autogenerated';\nimport { PlaceOrder } from '../../common/place-order';\nimport { ErrorComponent } from '../../common';\nimport { getThreeLetterCountryCode } from '../../common/country-codes';\n\nenum ApplePayPaymentAuthorizationResult {\n STATUS_SUCCESS = 0,\n STATUS_FAILURE = 1\n}\n\ninterface IApplePayLine {\n label: string;\n type: string;\n amount: string;\n}\n\ninterface IValidationEvent {\n validationUrl: string;\n}\n\ninterface IResult {\n newTotal: IApplePayLine;\n}\n\ninterface IAuthorizeEvent {\n paymentToken: string;\n shippingContact?: IShippingContactSelectedEvent;\n}\n\ninterface IAuthorizeResult {\n resultCode: ApplePayPaymentAuthorizationResult;\n}\n\ninterface IPaymentMethodEvent {\n type?: string;\n}\n\n/**\n * An interface that describes the shipping method for delivering physical goods.\n * Link to Apple doc - https://developer.apple.com/documentation/apple_pay_on_the_web/applepayshippingmethod\n */\ninterface IApplePayShippingMethod {\n /**\n * A short description of the shipping method.\n */\n label?: string;\n\n /**\n * The nonnegative cost associated with this shipping method.\n */\n amount?: string;\n\n /**\n * Additional description of the shipping method.\n */\n detail?: string;\n\n /**\n * A client-defined value used to identify this shipping method.\n */\n identifier?: string;\n}\n\n/**\n * Contact information fields to use for billing and shipping contact information.\n * Link to Apple doc - https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentcontact\n */\ninterface IShippingContactSelectedEvent {\n /**\n * A phone number for the contact.\n */\n phoneNumber?: string;\n\n /**\n * An email address for the contact.\n */\n emailAddress?: string;\n\n /**\n * The contact’s given name.\n */\n givenName?: string;\n\n /**\n * The contact’s family name.\n */\n familyName?: string;\n\n /**\n * The street portion of the address for the contact.\n */\n addressLines?: string[];\n\n /**\n * Additional information associated with the location, typically defined at the city or town level (such as district or neighborhood), in a postal address.\n */\n subLocality?: string;\n\n /**\n * The city for the contact.\n */\n locality?: string;\n\n /**\n * The zip code or postal code, where applicable, for the contact.\n */\n postalCode?: string;\n\n /**\n * The subAdministrative area (such as a county or other region) in a postal address.\n */\n subAdministrativeArea?: string;\n\n /**\n * The state for the contact.\n */\n administrativeArea?: string;\n\n /**\n * The name of the country or region for the contact.\n */\n country?: string;\n\n /**\n * The contact’s two-letter ISO 3166 country code.\n */\n countryCode?: string;\n}\n\ninterface IShippingMethodSelectedEvent {\n /**\n * The identifier of selected shipping method.\n */\n id: string;\n}\n\ninterface IAppleSessionHandler {\n onAuthorize(authorizeEvent: IAuthorizeEvent): Promise<IAuthorizeResult>;\n onCancel(): void;\n onPaymentMethodUpdate(paymentMethodEvent: IPaymentMethodEvent): Promise<IResult>;\n onValidation(validationEvent: IValidationEvent): Promise<string>;\n\n onShippingContactSelected?(shippingContactSelectedEvent: IShippingContactSelectedEvent): Promise<IResult>;\n onShippingMethodSelected?(shippingMethodSelectedEvent: IShippingMethodSelectedEvent): Promise<IResult>;\n}\n\nexport interface ICheckoutApplePayViewProps extends ICheckoutApplePayProps<{}> {\n className?: string;\n checkoutApplePay: IModuleProps;\n applePayButton?: React.ReactNode;\n alert?: React.ReactNode;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ndeclare const window: any;\n\nexport interface ICheckoutApplePayModuleProps extends ICheckoutApplePayProps<ICheckoutApplePayData> {}\n\ninterface ICheckoutApplePayState {\n applePayButtonState: ApplePayButtonState;\n paymentConnectorId?: string;\n lineDisplayName?: string;\n errorMessage?: string;\n shippingContact?: Address;\n shippingMethodId?: string;\n}\n/**\n *\n * CheckoutApplePay component\n * @extends {React.Component<ICheckoutApplePayModuleProps, ICheckoutApplePayState>}\n */\nexport class CheckoutApplePay extends React.Component<ICheckoutApplePayModuleProps, ICheckoutApplePayState> {\n private readonly moduleClassName: string = 'ms-checkout-apple-pay';\n private readonly applePaySdkId = 'd365-apple-pay-sdk';\n private readonly zeroAmount: number = 0;\n\n @computed private get getLoyaltyAmount(): number {\n const {\n data: { checkout }\n } = this.props;\n const checkoutState = checkout?.result;\n return checkoutState?.loyaltyAmount ? checkoutState.loyaltyAmount : this.zeroAmount;\n }\n\n @computed private get getGiftCardTotalAmount(): number {\n const {\n data: { checkout }\n } = this.props;\n const checkoutState = checkout?.result;\n if (!checkoutState || !checkoutState.giftCardExtends) {\n return this.zeroAmount;\n }\n return checkoutState.giftCardExtends.reduce((count: number, giftCard: IGiftCardExtend) => {\n return count + (giftCard.Balance || this.zeroAmount);\n }, 0);\n }\n\n @computed private get getCustomerAccountAmount(): number {\n const {\n data: { checkout }\n } = this.props;\n const checkoutState = checkout?.result;\n\n return checkoutState?.customerAccountAmount ?? this.zeroAmount;\n }\n\n @computed private get amountDue(): number {\n const {\n data: { checkout }\n } = this.props;\n\n const cart = checkout?.result?.checkoutCart.cart;\n if (!cart || !cart.AmountDue) {\n return this.zeroAmount;\n }\n\n return Math.max(\n this.zeroAmount,\n cart.AmountDue - this.getGiftCardTotalAmount - this.getLoyaltyAmount - this.getCustomerAccountAmount\n );\n }\n\n @computed private get merchantName(): string {\n return this.state.lineDisplayName || '';\n }\n\n public constructor(props: ICheckoutApplePayProps<ICheckoutApplePayData>) {\n super(props);\n this.state = {\n applePayButtonState: ApplePayButtonState.Unknown\n };\n }\n\n public async componentDidMount() {\n const {\n data: { cardPaymentAcceptPoint },\n telemetry\n } = this.props;\n\n // load JS portion of payment connector for ApplePay\n await cardPaymentAcceptPoint;\n\n if (cardPaymentAcceptPoint?.result !== undefined) {\n this.loadPaymentConnectorSdk(cardPaymentAcceptPoint.result);\n\n // load official ApplePay JS SDK.\n const script = document.createElement('script');\n script.onload = () => {\n let isApplePayAvailable = false;\n if (typeof window.isApplePayAvailable === 'function') {\n isApplePayAvailable = window.isApplePayAvailable();\n }\n\n telemetry.information(`is Apple Pay available: ${isApplePayAvailable}`);\n return this.setState({\n applePayButtonState: isApplePayAvailable ? ApplePayButtonState.Available : ApplePayButtonState.NotAvailable,\n paymentConnectorId: cardPaymentAcceptPoint.result?.PaymentConnectorId\n });\n };\n\n script.src = 'https://applepay.cdn-apple.com/jsapi/v1/apple-pay-sdk.js';\n script.async = false;\n script.onerror = () => telemetry.error('unable to load Apple Pay SDK');\n document.body.appendChild(script);\n } else {\n telemetry.error('unable to get Apple Pay connector SDK');\n }\n }\n\n public render(): JSX.Element | null {\n const {\n config: { className },\n resources,\n telemetry\n } = this.props;\n\n if (this.props.context.request.user.isOBORequest && EnabledPaymentsForOBO.ExpressPayment === 0) {\n telemetry.information('isOBORequest is enabled, apple pay module wont render');\n return null;\n }\n\n let applePayButton: React.ReactNode;\n switch (this.state.applePayButtonState) {\n case ApplePayButtonState.Available:\n applePayButton = (\n <div className='apple-pay-button apple-pay-button-black' id='apple-pay' onClick={this.handlePayButton}></div>\n );\n break;\n\n case ApplePayButtonState.Unknown:\n case ApplePayButtonState.NotAvailable:\n default:\n applePayButton = <div />;\n break;\n }\n\n const viewProps: ICheckoutApplePayViewProps = {\n ...this.props,\n ...this.state,\n className,\n checkoutApplePay: {\n moduleProps: this.props,\n className: classNames(this.moduleClassName, className)\n },\n alert: this.state.errorMessage && (\n <ErrorComponent {...{ title: resources.errorMessageTitle, message: this.state.errorMessage }} />\n ),\n applePayButton\n };\n\n return this.props.renderView(viewProps);\n }\n\n /**\n * Handler for Apple Pay button.\n */\n public handlePayButton = async () => {\n const { config, resources, telemetry } = this.props;\n\n const handler: IAppleSessionHandler = {\n onAuthorize: this.authorizePayment,\n onCancel: this.cancelPayment,\n onPaymentMethodUpdate: this.updatePaymentMethod,\n onValidation: this.validateMerchant\n };\n\n // Set shipping related callbacks if corresponding options enabled.\n if (config.shouldRequestShippingAddress) {\n handler.onShippingContactSelected = this.shippingContactSelected;\n handler.onShippingMethodSelected = this.shippingMethodSelected;\n }\n\n try {\n // calling connector JS to create payment session.\n const displayName = window.CreateApplePaySession(handler, this.amountDue.toString());\n this.setState({\n lineDisplayName: displayName\n });\n } catch (error) {\n this.showErrorMessage(resources.genericErrorMessage);\n telemetry.error(`unable to create Apple Pay session: ${error}`);\n }\n };\n\n /**\n * Call CSU checkout API with Apple Pay token.\n * @param paymentToken {string} The gateway payment token\n */\n private checkout = async (paymentToken: string) => {\n const {\n data: { checkout },\n context: { actionContext }\n } = this.props;\n const { paymentConnectorId } = this.state;\n\n const checkoutState = await getCheckoutState(actionContext);\n const cartState = checkoutState.checkoutCart;\n\n const channelConfiguration = actionContext.requestContext.channel;\n if (!channelConfiguration) {\n throw new Error('unable to get channel configuration');\n }\n\n if (checkout !== null) {\n const cardPaymentAcceptResult: CardPaymentAcceptResult = {\n AccessCode: paymentToken,\n Settings: {\n PaymentConnectorId: paymentConnectorId\n }\n };\n\n await checkout?.result?.updateCardPaymentAcceptResult({ newCardPaymentAcceptResult: cardPaymentAcceptResult });\n await PlaceOrder(\n actionContext,\n checkoutState,\n undefined, // orderedProducts\n true, // redirect,\n cartState.cart.Version,\n false // isPaymentVerificationRedirection\n );\n }\n };\n\n /**\n * Load JS SDK from payment connector.\n * @param cardPaymentAcceptPoint {CardPaymentAcceptPoint} The card payment accept point object from CSU.\n */\n private loadPaymentConnectorSdk = (cardPaymentAcceptPoint: CardPaymentAcceptPoint) => {\n if (!cardPaymentAcceptPoint.AcceptPageContent) {\n this.props.telemetry.error(`Card payment accept page content can't be null or empty`);\n return;\n }\n\n const connectorSdk: string = cardPaymentAcceptPoint.AcceptPageContent || '';\n const sdk = document.createElement('script');\n sdk.id = this.applePaySdkId;\n sdk.type = 'text/javascript';\n sdk.appendChild(document.createTextNode(connectorSdk));\n document.body.appendChild(sdk);\n };\n\n /**\n * Validate Apple Pay merchant account with gateway.\n * @param validationEvent {IValidationEvent} The object containing merchant validation data.\n * @returns The response from CSU with validated data.\n */\n private validateMerchant = async (validationEvent: IValidationEvent): Promise<string> => {\n const {\n data: { checkout, cardPaymentAcceptPoint },\n resources,\n telemetry\n } = this.props;\n\n telemetry.information('starting merchant validation for Apple Pay');\n const validationUrl = validationEvent?.validationUrl || '';\n if (!validationUrl) {\n telemetry.error(`Apple Pay validation failed: url can't be null or empty`);\n return Promise.reject('Validation url can not be null or empty');\n }\n\n const cartId = checkout?.result?.checkoutCart.cart.Id || '';\n if (!cartId) {\n telemetry.error(`Apple Pay validation failed: cart can't be null or empty`);\n return Promise.reject('Cart identifier can not be null or empty');\n }\n\n const paymentConnectorId = cardPaymentAcceptPoint?.result?.PaymentConnectorId || '';\n if (!paymentConnectorId) {\n telemetry.error(`Apple Pay validation failed: payment connector identifier can't be null or empty`);\n return Promise.reject('Connector identifier can not be null or empty');\n }\n\n const validationObject = {\n domainName: window.location.hostname,\n validationUrl: validationUrl\n };\n const validationBody = JSON.stringify(validationObject);\n const validationData = await retrieveCardPaymentAcceptResultAsync(\n { callerContext: this.props.context.actionContext },\n btoa(validationBody),\n [],\n cartId,\n { PaymentConnectorId: paymentConnectorId }\n ).catch(error => {\n this.showErrorMessage(resources.genericErrorMessage);\n telemetry.error(`Apple Pay validation failed: ${error}`);\n return Promise.reject(error);\n });\n\n telemetry.information('merchant validation for Apple Pay completed');\n return Promise.resolve(JSON.stringify(validationData));\n };\n\n /**\n * Authorize Apple Pay token by calling checkout API.\n * @param authorizeEvent {IAuthorizeEvent} The object containing authorization information.\n * @returns The authorization result.\n */\n private authorizePayment = async (authorizeEvent: IAuthorizeEvent): Promise<IAuthorizeResult> => {\n const { resources, telemetry } = this.props;\n\n telemetry.information('starting authorization for Apple Pay');\n try {\n await this.updateContactInfo(authorizeEvent.shippingContact);\n await this.checkout(btoa(JSON.stringify(authorizeEvent)));\n telemetry.information('Apple Pay authorization completed');\n return Promise.resolve({ resultCode: ApplePayPaymentAuthorizationResult.STATUS_SUCCESS });\n } catch (error) {\n this.showErrorMessage(resources.genericErrorMessage);\n telemetry.error(`Apple Pay authorization failed: ${error as string}`);\n return Promise.reject(error as string);\n }\n };\n\n /**\n * Callback to notify Apple Pay sheet was closed/canceled.\n */\n private cancelPayment = (): void => {\n this.props.telemetry.information('Apple Pay popup canceled');\n };\n\n /**\n * The callback for Apple Pay payment method confirmation.\n * @param paymentMethodEvent {IPaymentMethodEvent} The payment method event object.\n * @returns The transaction result object.\n */\n private updatePaymentMethod = async (paymentMethodEvent: IPaymentMethodEvent): Promise<IResult> => {\n return Promise.resolve({\n newTotal: {\n label: this.merchantName,\n type: 'final',\n amount: `${this.amountDue}`\n }\n });\n };\n\n /**\n * The callback for Apple Pay shipping contact confirmation.\n * @param shippingContact {IShippingContactSelectedEvent} The shipping contact event object.\n * @returns The transaction result object.\n */\n private shippingContactSelected = async (shippingContact: IShippingContactSelectedEvent): Promise<IResult> => {\n const { resources, telemetry } = this.props;\n\n // construct Address object from Apple Pay shipping contact.\n const shippingAddress: Address = this.getAddressFromShippingContact(shippingContact);\n const shippingMethods = await this.getShippingMethods(shippingAddress);\n if (ObjectExtensions.isNullOrUndefined(shippingMethods) || shippingMethods.length === 0) {\n return Promise.reject();\n }\n\n try {\n const shippingMethodId = shippingMethods.at(0)?.identifier || '';\n await this.updateShippingInfo(shippingMethodId, shippingAddress);\n\n // save shipping contact to update shipping method later.\n this.setState({\n shippingContact: shippingAddress,\n shippingMethodId: shippingMethodId\n });\n } catch (e) {\n telemetry.error(`unable to update shipping info after shipping method change: ${e}`);\n this.showErrorMessage(resources.genericErrorMessage);\n }\n\n return Promise.resolve({\n newShippingMethods: shippingMethods,\n newTotal: {\n label: this.merchantName,\n type: 'final',\n amount: `${this.amountDue}`\n }\n });\n };\n\n /**\n * The callback for Apple Pay shipping method confirmation.\n * @param shippingMethodSelectedEvent {IShippingMethodSelectedEvent} The shipping method event object.\n * @returns The transaction result object.\n */\n private shippingMethodSelected = async (shippingMethod: IShippingMethodSelectedEvent): Promise<IResult> => {\n const { resources, telemetry } = this.props;\n\n try {\n await this.updateShippingInfo(shippingMethod.id, this.state.shippingContact);\n\n // save selected shipping method.\n this.setState({ shippingMethodId: shippingMethod.id });\n } catch (e) {\n telemetry.error(`unable to update address after shipping method change: ${e}`);\n this.showErrorMessage(resources.genericErrorMessage);\n }\n\n return Promise.resolve({\n newTotal: {\n label: this.merchantName,\n type: 'final',\n amount: `${this.amountDue}`\n }\n });\n };\n\n /**\n * Helper function to obtain shipping methods available for Apple contact address.\n * @param address {Address} The shipping address.\n * @returns The cart delivery options.\n */\n private getShippingMethods = async (address: Address): Promise<IApplePayShippingMethod[]> => {\n const {\n context: { actionContext },\n data: { checkout },\n telemetry\n } = this.props;\n\n const cartId = (checkout?.result?.checkoutCart?.cart as Cart).Id;\n const deliveryOptionFilter: FilterDeliveryModeOption = FilterDeliveryModeOption.FilterOutNonCarrierDeliveryMode;\n const appleDeliveryOptions: IApplePayShippingMethod[] = [];\n try {\n const deliveryOptions = await getDeliveryOptionsAsync(\n {\n callerContext: actionContext,\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(actionContext)\n },\n cartId,\n address,\n [],\n deliveryOptionFilter,\n false\n );\n deliveryOptions.forEach(element =>\n appleDeliveryOptions.push({\n label: element.Description,\n amount: `${element.ShippingChargeAmount}`,\n detail: element.Description,\n identifier: element.Code\n })\n );\n } catch (e) {\n telemetry.error('unable to get delivery options for Apple Pay contact');\n }\n\n return appleDeliveryOptions;\n };\n\n /**\n * Helper function to convert Apple Pay shipping contact into Address object.\n * @param shippingContact {IShippingContactSelectedEvent} The shipping contact provided by Apple Pay SDK.\n * @returns The Address object.\n */\n private getAddressFromShippingContact = (shippingContact: IShippingContactSelectedEvent) => {\n const shippingAddress: Address = {\n ThreeLetterISORegionName: getThreeLetterCountryCode(shippingContact?.countryCode || ''),\n Name: this.getContactName(shippingContact),\n Street: shippingContact?.addressLines?.at(0),\n StreetNumber: shippingContact?.addressLines?.at(1),\n City: shippingContact?.locality,\n State: shippingContact?.administrativeArea,\n ZipCode: shippingContact?.postalCode\n };\n\n return shippingAddress;\n };\n\n /**\n * Helper function to return formatted contact name.\n * @param shippingContact {IShippingContactSelectedEvent} The shipping contact provided by Apple Pay SDK.\n * @returns The formatted contact name, i.e. 'Test User', 'Test', 'User' or empty string if both given and family names are missing.\n */\n private getContactName = (shippingContact: IShippingContactSelectedEvent) => {\n const givenName = shippingContact?.givenName || '';\n const familyName = shippingContact?.familyName || '';\n return `${givenName}${\n StringExtensions.isNullOrWhitespace(givenName) || StringExtensions.isNullOrWhitespace(familyName) ? '' : ' '\n }${familyName}`;\n };\n\n private updateContactInfo = async (shippingContact?: IShippingContactSelectedEvent) => {\n const {\n data: { checkout },\n telemetry\n } = this.props;\n\n if (shippingContact) {\n const shippingAddress: Address = this.getAddressFromShippingContact(shippingContact);\n const shippingMethodId = this.state.shippingMethodId || '';\n await this.updateShippingInfo(shippingMethodId, shippingAddress);\n const newGuestCheckoutEmail = shippingContact.emailAddress || '';\n if (!StringExtensions.isNullOrWhitespace(newGuestCheckoutEmail)) {\n await checkout?.result?.updateGuestCheckoutEmail({ newGuestCheckoutEmail });\n } else {\n telemetry.warning('email address missing in shipping contact from Apple');\n }\n } else {\n telemetry.information('no shipping information provided');\n }\n };\n\n /**\n * Update shipping information on cart.\n * @param shippingMethodId {string} The identifier for shipping method.\n * @param shippingAddress {Address} The shipping address.\n */\n private updateShippingInfo = async (shippingMethodId: string, shippingAddress?: Address) => {\n const {\n data: { checkout }\n } = this.props;\n\n const updateCartDeliverySpecificationInput = {\n deliveryModeId: shippingMethodId,\n shippingAddress: shippingAddress\n };\n\n const result = await checkout?.result?.checkoutCart.updateCartDeliverySpecification(updateCartDeliverySpecificationInput);\n if (result?.status !== 'SUCCESS') {\n throw new Error(result?.errorDetails?.LocalizedMessage);\n }\n };\n\n /**\n * Shows error message on screen next to Apple Pay button.\n * @param message {string} The error message to show.\n */\n private showErrorMessage = (message: string) => {\n this.setState({\n errorMessage: message\n });\n };\n}\n\nexport default CheckoutApplePay;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { isChannelTypeB2B } from '@msdyn365-commerce/core';\nimport { CustomerBalances } from '@msdyn365-commerce/retail-proxy';\nimport { IModuleStateManager, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\nimport { CheckoutModule, ErrorLocation } from '@msdyn365-commerce/global-state';\nimport classnames from 'classnames';\nimport get from 'lodash/get';\nimport { action, computed, reaction, when } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { ICheckoutCustomerAccountPaymentData } from './checkout-customer-account-payment.data';\nimport { ICheckoutCustomerAccountPaymentProps } from './checkout-customer-account-payment.props.autogenerated';\nimport { getAccountPaymentFormEditMode, IAccountPaymentEditViewForm } from './components/get-account-payment-form-edit-mode';\nimport { getAccountPaymentFormSummaryMode, IAccountPaymentSummaryViewForm } from './components/get-account-payment-form-summary-mode';\nimport { ErrorComponent } from '../../common/error';\nimport { focusOnCheckoutError } from '../../checkout-errors';\n\nexport interface ICheckoutCustomerAccountPaymentViewProps\n extends ICheckoutCustomerAccountPaymentProps<ICheckoutCustomerAccountPaymentData> {\n checkoutCustomerAccount: IModuleProps;\n summaryView: IAccountPaymentSummaryViewForm;\n editView: IAccountPaymentEditViewForm;\n moduleState: IModuleStateManager;\n alert?: React.ReactNode;\n checkoutErrorRef?: React.RefObject<HTMLElement>;\n}\n\nexport interface ICheckoutCustomerAccountPaymentState {\n paymentAmount: number;\n isCreditSectionExpanded: boolean;\n customizedAmt: string;\n amountVariable: string;\n errorMessage?: string;\n handleSaveAndContinue?: boolean;\n}\n\n/**\n *\n * CheckoutCustomerAccount component.\n * @extends {React.Component<ICheckoutCustomerAccountPaymentProps<ICheckoutCustomerAccountPaymentData>>}\n */\n// @ts-expect-error\n@withModuleState\n@observer\nexport class CheckoutCustomerAccountPayment extends React.Component<\n ICheckoutCustomerAccountPaymentViewProps,\n ICheckoutCustomerAccountPaymentState\n> {\n private readonly defaultLocale: string = 'en-us';\n @computed get isCustomerAccountPaymentEnabled(): boolean {\n const customerInfo = get(this.props, 'data.customerInformation.result');\n const request = get(this.props, 'context.request');\n const b2bChannel = isChannelTypeB2B(request);\n const platform = get(this.props, 'context.request.app.platform');\n\n return (\n customerInfo &&\n customerInfo.AllowOnAccountPayment === true &&\n platform &&\n (platform.enableCustomerAccountPayment === 'all' ||\n (platform.enableCustomerAccountPayment === 'b2b' && b2bChannel) ||\n (platform.enableCustomerAccountPayment === 'b2c' && !b2bChannel))\n );\n }\n\n @computed get getLoyaltyAmount(): number {\n const checkoutState = this.props.data.checkout.result;\n if (!checkoutState || !checkoutState.loyaltyAmount) {\n return 0;\n }\n return checkoutState.loyaltyAmount;\n }\n\n @computed get maxPaymentAmount(): number {\n const cart = this.props.data.checkout.result ? this.props.data.checkout.result.checkoutCart.cart : undefined;\n if (!cart) {\n return 0;\n }\n\n // Use customer account after loyalty.\n const amountDue = Math.max(0, (cart.TotalAmount || 0) - this.getLoyaltyAmount);\n\n // If the user has a mandatory credit limit, then the max amount must not be more than that\n if (this.props.data.customerInformation?.result?.MandatoryCreditLimit) {\n return Math.min(this.getAvailableCredit(this.props.data.creditBalances?.result), amountDue);\n }\n return amountDue;\n }\n\n @computed get errorMessage(): string | undefined {\n if (this.state.paymentAmount > this.maxPaymentAmount) {\n return this.props.resources.invalidAmountExceedAmountDueMessage;\n }\n\n if (this.state.paymentAmount < 0) {\n return this.props.resources.invalidAmountNegativeMessage;\n }\n\n return undefined;\n }\n\n @computed get currencyCode(): string | undefined {\n return get(this.props, 'context.request.channel.Currency');\n }\n\n @computed get availableCredit(): number {\n const creditBalances = get(this.props, 'data.creditBalances.result');\n\n return creditBalances ? this.getAvailableCredit(creditBalances) : 0;\n }\n\n @computed get orderTotal(): number {\n const orderTotal = get(this.props, 'data.checkout.result.checkoutCart.cart.TotalAmount');\n\n return orderTotal ? orderTotal : 0;\n }\n\n @computed get formattedExcessCredit(): string | undefined {\n const excessCredit = this.availableCredit - this.orderTotal;\n return excessCredit < 0 ? this.props.context.cultureFormatter.formatCurrency(excessCredit, this.currencyCode) : undefined;\n }\n\n @computed get isDataReady(): boolean {\n return (this.props.data.checkout.result && this.props.data.checkout.status) === 'SUCCESS';\n }\n\n private readonly baseClassName: string = 'ms-checkout-customer-account';\n\n private readonly checkoutErrorRef: React.RefObject<HTMLElement> = React.createRef();\n\n public constructor(props: ICheckoutCustomerAccountPaymentViewProps) {\n super(props);\n const locale = get(this.props, 'context.request.locale') || this.defaultLocale;\n this.state = {\n paymentAmount: this.maxPaymentAmount,\n isCreditSectionExpanded: false,\n customizedAmt: new Intl.NumberFormat(locale).format(this.maxPaymentAmount),\n amountVariable: this.maxPaymentAmount.toString(),\n handleSaveAndContinue: false\n };\n }\n\n public async componentDidMount(): Promise<void> {\n when(\n () => this.isDataReady,\n async () => {\n await this.init();\n }\n );\n\n // When the cart.TotalAmount gets updated (like if selecting the delivery option adds a charge) we need to update the amount based on the new total amount.\n reaction(\n () =>\n this.props.data.checkout.result &&\n this.props.data.checkout.result.checkoutCart.cart &&\n this.props.data.checkout.result.checkoutCart.cart.TotalAmount,\n totalAmount => {\n this.updateMaxAmount(this.maxPaymentAmount);\n }\n );\n\n if (this.props.data.checkout.result?.shouldEnableCheckoutErrorDisplayMessaging) {\n reaction(\n () => this.props.data.checkout.result?.checkoutError,\n checkoutError => {\n if (\n checkoutError &&\n checkoutError.errorLocation === ErrorLocation.CheckoutCustomerAccountPayment &&\n checkoutError.errorMessage\n ) {\n this._setErrorMessage(checkoutError.errorMessage);\n }\n }\n );\n\n reaction(\n () => this.props.data.checkout.result?.checkoutErrorFocus,\n checkoutErrorFocus => {\n if (checkoutErrorFocus === CheckoutModule.CheckoutCustomerAccountPayment) {\n focusOnCheckoutError(this.checkoutErrorRef, this.props.context.actionContext);\n }\n }\n );\n }\n }\n\n public shouldComponentUpdate(\n nextProps: ICheckoutCustomerAccountPaymentProps<ICheckoutCustomerAccountPaymentData>,\n nextState: ICheckoutCustomerAccountPaymentState\n ): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | null {\n const customerInfo = this.props.data.customerInformation?.result;\n\n if (!this.isCustomerAccountPaymentEnabled) {\n this.props.context.telemetry.information(\n 'customer account payments will not display, because the feature is disabled or not enabled for this type of customer'\n );\n return null;\n }\n\n const checkoutState = this.props.data.checkout.result;\n const cart = checkoutState ? checkoutState.checkoutCart.cart : undefined;\n const hasInvoiceLine = checkoutState?.checkoutCart.hasInvoiceLine;\n const creditBalances = this.props.data.creditBalances.result;\n\n if (!cart || hasInvoiceLine) {\n return null;\n }\n const resources = this.props.resources;\n const locale = get(this.props, 'context.request.locale') || this.defaultLocale;\n\n const customerSinceDate = new Date(customerInfo?.CreatedDateTime || 0).toLocaleDateString(locale);\n\n const hasError = this.props.moduleState.hasError;\n const errorMessage = this.state.errorMessage;\n\n const props = {\n ...this.props,\n checkoutErrorRef: this.checkoutErrorRef,\n checkoutCustomerAccount: {\n moduleProps: this.props,\n className: classnames(this.baseClassName)\n },\n alert: hasError && errorMessage && (\n <ErrorComponent\n {...{ title: resources.errorMessageTitle, message: errorMessage, className: 'ms-checkout-customer-account' }}\n />\n ),\n editView: getAccountPaymentFormEditMode({\n onAddPayment: this.addPayment,\n resources,\n customizedAmt: this.state.customizedAmt,\n amountVariable: this.state.amountVariable,\n amount: this.state.paymentAmount,\n onChangePaymentAmount: this.onChangePaymentAmount,\n maxAmount: this.maxPaymentAmount,\n customer: customerInfo,\n customerCreatedDate: customerSinceDate,\n availableCredit: this.props.context.cultureFormatter.formatCurrency(\n this.getAvailableCredit(creditBalances),\n this.currencyCode\n ),\n showCreditLimit: customerInfo?.MandatoryCreditLimit || false,\n errorMessage: this.errorMessage,\n onToggleCreditSection: this.toggleCreditSection,\n creditSectionIsExpanded: this.state.isCreditSectionExpanded,\n orderTotal: this.props.context.cultureFormatter.formatCurrency(this.orderTotal, this.currencyCode),\n excessCredit: this.formattedExcessCredit,\n onRemovePayment: this.removePayment,\n appliedAmount:\n checkoutState && checkoutState.customerAccountAmount > 0\n ? this.props.context.cultureFormatter.formatCurrency(checkoutState.customerAccountAmount, this.currencyCode)\n : undefined,\n locale:\n this.props.context && this.props.context.request && this.props.context.request.locale\n ? this.props.context.request.locale\n : this.defaultLocale,\n skipOnChangeLogic: this.props.context.request.features?.skipCheckoutOnChangeLogic\n }),\n summaryView: getAccountPaymentFormSummaryMode({\n resources,\n amount: this.state.paymentAmount,\n appliedAmount:\n checkoutState && checkoutState.customerAccountAmount > 0\n ? this.props.context.cultureFormatter.formatCurrency(checkoutState.customerAccountAmount, this.currencyCode)\n : undefined\n })\n };\n\n return this.props.renderView(props) as React.ReactElement;\n }\n\n private readonly getAvailableCredit = (creditBalances: CustomerBalances | undefined) => {\n let availableCredit = 0;\n\n if (!creditBalances) {\n return 0;\n }\n\n if (creditBalances.InvoiceAccountCreditLimit === 0) {\n availableCredit = creditBalances.CreditLimit - creditBalances.Balance - creditBalances.PendingBalance;\n } else {\n availableCredit =\n creditBalances.InvoiceAccountCreditLimit -\n creditBalances.InvoiceAccountBalance -\n creditBalances.InvoiceAccountPendingBalance;\n }\n\n return availableCredit;\n };\n\n private readonly addPayment = async (): Promise<void> => {\n const checkoutState = this.props.data.checkout.result;\n\n if (!checkoutState) {\n this.props.context.telemetry.error('checkout state not found');\n return;\n }\n\n this.setState({ handleSaveAndContinue: true });\n this._clearError();\n await checkoutState.updateCustomerAccountAmount({ newAmount: this.state.paymentAmount });\n this.props.context.telemetry.information('customer account payment amount updated');\n };\n\n private readonly toggleCreditSection = (): void => {\n this.setState({\n isCreditSectionExpanded: !this.state.isCreditSectionExpanded\n });\n };\n\n private readonly init = async (): Promise<void> => {\n this.props.moduleState.init({\n onCancel: this.handleCancelOrSubmit,\n onSubmit: this.handleCancelOrSubmit,\n onEdit: this.onEdit\n });\n\n if (this.props.data.checkout.result && this.props.data.checkout.result.customerAccountAmount !== 0) {\n this.props.moduleState.onReady();\n }\n };\n\n private readonly onChangePaymentAmount = (customizedAmt: string, paymentAmount: number, amountVariable: string): void => {\n this.setState({\n customizedAmt: customizedAmt,\n paymentAmount: paymentAmount,\n amountVariable: amountVariable\n });\n };\n\n private readonly updateMaxAmount = (newAmount: number): void => {\n // If the user has already set an amount, we should not override that in the UI because it will be confusing.\n if (this.props.data.checkout.result && this.props.data.checkout.result.customerAccountAmount === 0) {\n this.setState({\n // We should never allow a negative amount.\n paymentAmount: Math.max(0, newAmount),\n customizedAmt: Math.max(0, newAmount).toString()\n });\n }\n };\n\n private readonly onEdit = (): void => {\n this.props.telemetry.information('Payment section customer account payment onEdit is called.');\n\n this.props.moduleState.onUpdating();\n };\n\n private readonly handleCancelOrSubmit = () => {\n const checkoutState = this.props.data.checkout.result;\n if (checkoutState && checkoutState.customerAccountAmount > 0) {\n this.setState({ handleSaveAndContinue: false });\n this.props.telemetry.information('Payment section customer account payment onSubmit is called.');\n\n if (\n Msdyn365.isOboRequest(this.props.context.request) &&\n checkoutState?.customerAccountAmount !== checkoutState?.checkoutCart.cart.TotalAmount\n ) {\n this._setErrorMessage(this.props.resources.invalidAmountForOBOMessage);\n } else {\n this.props.moduleState.onReady();\n }\n } else if (\n checkoutState?.customerAccountAmount === 0 &&\n !this.state.handleSaveAndContinue &&\n this.props.config.isCheckoutCustomerAccountPaymentRequired\n ) {\n this._setErrorMessage(this.props.resources.customerAccountCreditErrorMessage);\n } else {\n this.props.telemetry.information('Payment section customer account payment onCancel is called.');\n\n // Skip the module\n this.props.moduleState.onSkip();\n }\n };\n\n private readonly removePayment = async (): Promise<void> => {\n const checkoutState = this.props.data.checkout.result;\n\n if (!checkoutState) {\n this.props.context.telemetry.error('checkout state not found');\n return;\n }\n\n this.setState({\n paymentAmount: 0\n });\n\n this.onChangePaymentAmount('', NaN, '0');\n\n this._clearError();\n await checkoutState.updateCustomerAccountAmount({ newAmount: 0 });\n this.props.context.telemetry.information('customer account payment removed');\n };\n\n @action\n private readonly _setErrorMessage = (errorMessage: string): void => {\n this.props.telemetry.error(errorMessage);\n this.props.moduleState.setHasError(true);\n this.props.moduleState.onUpdating();\n this.setState({\n errorMessage\n });\n };\n\n private readonly _clearError = (): void => {\n this.props.moduleState.setHasError(false);\n this.setState({\n errorMessage: ''\n });\n };\n}\n\nexport default CheckoutCustomerAccountPayment;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport MsDyn365, { AsyncResultStatus, getUrlSync } from '@msdyn365-commerce/core';\nimport {\n Address,\n CardPaymentAcceptResult,\n CardType,\n CartsDataActions,\n StoreOperationsDataActions,\n TokenizedPaymentCard\n} from '@msdyn365-commerce/retail-proxy';\nimport { withModuleState, EnabledPaymentsForOBO } from '@msdyn365-commerce-modules/checkout-utilities';\nimport { ArrayExtensions, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { IModuleProps, INodeProps, Modal } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { get, isEmpty } from 'lodash';\nimport { action, computed, reaction, when } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport { AsyncResultStatusCode, GetCheckoutReturnUrl, IExpressPaymentDetails } from '../../common';\nimport { AddPaymentFormComponent } from '../../common/add-payment-form';\nimport { ErrorComponent } from '../../common/error';\nimport { Iframe } from '../../common/iframe';\nimport { PaymentConnectorPostMessageType } from '../../common/payment-instrument-message';\nimport { WaitingComponent } from '../../common/waiting';\nimport getCardPaymentAcceptPointAction, { GetCardPaymentAcceptPointInput } from './actions/get-card-payment-accept-point';\nimport { ICheckoutExpressData } from './checkout-express.data';\nimport { ICheckoutExpressProps, IHeadingData } from './checkout-express.props.autogenerated';\n\n/**\n * Interface for CheckOutExpress Module Props.\n */\nexport interface ICheckoutExpressModuleProps extends ICheckoutExpressProps<ICheckoutExpressData> {}\n\n/**\n * Checkout Express State.\n */\ninterface ICheckoutExpressState {\n errorMessage?: string;\n isFetchingPaymentConnector?: boolean;\n paymentConnectorHeight?: number;\n isPaymentVerificationRequired?: boolean;\n paymentVerificationPostData?: string;\n isPaymentProcessing?: boolean;\n isOverlayModal?: boolean;\n terminalError?: Error;\n paymentConnectorId?: string;\n shouldHideExpressCheckout?: boolean;\n}\n\n/**\n * Checkout Express Overlay Modal.\n */\nexport interface ICheckoutExpressOverlayModal {\n modal: INodeProps;\n}\n\n/**\n * Checkout Express View Props.\n */\nexport interface ICheckoutExpressViewProps extends ICheckoutExpressProps<{}>, ICheckoutExpressState {\n className?: string;\n checkoutExpress: IModuleProps;\n waiting?: React.ReactNode;\n alert?: React.ReactNode;\n addPaymentForm?: React.ReactNode;\n overlayModal?: ICheckoutExpressOverlayModal;\n title?: React.ReactNode;\n shouldHideExpressCheckout?: boolean;\n}\n\nconst zeroAmount = 0;\nconst expressPaymentSectionClassName = 'msc-express-payment-container';\nconst expressPaymentSectionInCartPageClassName = 'msc-express-payment-container-in-cart-page';\nconst expressPaymentSectionTextBlockClassName = 'msc-express-payment-textblock';\n\n/**\n *\n * CheckoutExpress component.\n * @extends {React.Component<ICheckoutExpressProps<ICheckoutExpressData>>}\n */\n// @ts-expect-error - existing code.\n@withModuleState\n@observer\nexport class CheckoutExpress extends React.PureComponent<ICheckoutExpressModuleProps, ICheckoutExpressState> {\n private readonly moduleClassName: string = 'ms-checkout-express';\n\n private readonly iframeRef: React.RefObject<Iframe> = React.createRef();\n\n public constructor(props: ICheckoutExpressModuleProps) {\n super(props);\n this.state = {\n isFetchingPaymentConnector: true,\n shouldHideExpressCheckout:\n (!this.isInCartPage && this.isExpressPaymentAppliedInCartPage) ||\n this.isEmptyCart ||\n this.props.data.checkout?.result?.isPaymentVerificationRedirection ||\n (!this.isInCartPage &&\n !this.props.context.request.cookies.isConsentGiven() &&\n this.props.context.request.user.isAuthenticated)\n };\n }\n\n public componentDidMount(): void {\n when(\n () => this.asyncResultStatus !== AsyncResultStatusCode.LOADING,\n async () => {\n if (this.props.data.checkout.result?.isPaymentVerificationRedirection) {\n this.shouldHideExpressPaymentSectionElementByClassName(expressPaymentSectionClassName, true);\n }\n\n await this.init();\n }\n );\n\n reaction(\n () => this.props.data.checkout.result?.redirectAdditionalContext && this.props.data.checkout.result?.redirectPaymentConnectorId,\n () => {\n if (\n this.props.data.checkout.result?.isExpressCheckoutApplied &&\n this.props.data.checkout.result?.redirectAdditionalContext &&\n this.props.data.cardPaymentAcceptPoint.result?.PaymentConnectorId ===\n this.props.data.checkout.result?.redirectPaymentConnectorId\n ) {\n this.redirectToPaymentVerification(this.props.data.checkout.result.redirectAdditionalContext);\n }\n }\n );\n\n reaction(\n () => this.props.data.checkout.result?.isPlaceOrderEnabledInRedirection,\n () => {\n if (\n this.props.data.checkout.result?.isExpressCheckoutApplied &&\n this.props.data.checkout.result?.isPlaceOrderEnabledInRedirection &&\n this.props.data.cardPaymentAcceptPoint.result?.PaymentConnectorId ===\n this.props.data.checkout.result?.redirectPaymentConnectorId\n ) {\n this.init();\n }\n }\n );\n\n reaction(\n () => this.props.data.checkout.result?.isCheckoutCallFailed,\n () => {\n if (this.props.data.checkout.result?.isCheckoutCallFailed) {\n this.setState({\n isPaymentProcessing: false\n });\n this.shouldHideExpressPaymentSectionElementByClassName(expressPaymentSectionClassName, false);\n }\n }\n );\n\n reaction(\n () => this.amountDue,\n async () => {\n if (this.isInCartPage) {\n await this.updatePaymentAcceptPageData();\n }\n }\n );\n\n this.shouldHideExpressPaymentSectionElementByClassName(expressPaymentSectionClassName, this.state.shouldHideExpressCheckout);\n this.shouldHideExpressPaymentSectionElementByClassName(\n expressPaymentSectionInCartPageClassName,\n this.state.shouldHideExpressCheckout\n );\n }\n\n public render(): JSX.Element | null {\n const {\n errorMessage,\n isFetchingPaymentConnector,\n paymentConnectorHeight,\n isPaymentProcessing,\n isOverlayModal,\n shouldHideExpressCheckout\n } = this.state;\n\n const {\n config: { heading, iFrameHeightOverride, paymentStyleOverride, className, paymentTenderType },\n resources,\n data: { cardPaymentAcceptPoint }\n } = this.props;\n\n // eslint-disable-next-line @typescript-eslint/naming-convention -- following existing naming.\n const { AcceptPageUrl, AcceptPageContent, MessageOrigin } = cardPaymentAcceptPoint.result ?? {\n AcceptPageUrl: undefined,\n AcceptPageContent: undefined,\n MessageOrigin: undefined\n };\n\n if (this.props.context.request.user.isOBORequest && EnabledPaymentsForOBO.ExpressPayment === 0) {\n this.shouldHideExpressPaymentSectionElementByClassName(expressPaymentSectionClassName, true);\n this.props.context.telemetry.information('isOBORequest is enabled, checkout express module wont render');\n return null;\n }\n\n let paymentTenderTypeClassName = paymentTenderType ? `${this.moduleClassName}-${paymentTenderType.toLowerCase()}` : '';\n paymentTenderTypeClassName += this.isInCartPage ? '-in-cart-page' : '';\n\n if (typeof window !== 'undefined') {\n const classList = document.getElementsByClassName(expressPaymentSectionTextBlockClassName)[0]?.parentElement?.classList;\n\n classList?.forEach(classNameInList => {\n if (classNameInList.startsWith('col-md')) {\n classList.remove(classNameInList);\n }\n });\n\n classList?.add('col-md-has-textblock');\n }\n\n const viewProps: ICheckoutExpressViewProps = {\n ...this.props,\n ...this.state,\n className,\n\n checkoutExpress: {\n moduleProps: this.props,\n className: classnames(this.moduleClassName, paymentTenderTypeClassName, className)\n },\n waiting: this.asyncResultStatus !== AsyncResultStatusCode.FAILED &&\n (this.asyncResultStatus === AsyncResultStatusCode.LOADING || isFetchingPaymentConnector) && (\n <WaitingComponent {...{ message: resources.loadingMessage, className: this.moduleClassName }} />\n ),\n alert: errorMessage && (\n <ErrorComponent {...{ title: resources.errorMessageTitle, message: errorMessage, className: this.moduleClassName }} />\n ),\n addPaymentForm: !isPaymentProcessing && (AcceptPageUrl || AcceptPageContent) && (\n <AddPaymentFormComponent\n acceptPageUrl={AcceptPageUrl}\n acceptPageContent={AcceptPageContent}\n messageOrigin={MessageOrigin}\n onIFrameMessage={this.oniFrameMessage}\n iframeRef={this.iframeRef}\n canSubmit={false}\n canCancel={false}\n iFrameHeightOverride={iFrameHeightOverride ?? paymentConnectorHeight}\n requestUrlOrigin={this.requestUrlOrigin}\n isFetchingPaymentConnector={isFetchingPaymentConnector}\n paymentStyleOverride={paymentStyleOverride}\n className={this.moduleClassName}\n moduleName='checkout-express'\n resources={resources}\n />\n ),\n overlayModal: {\n modal: {\n tag: Modal,\n className: `${this.moduleClassName}__overlay-modal`,\n isOpen: isOverlayModal\n }\n },\n title: heading && !this.isInCartPage && this.renderMsdyn365Text(heading),\n shouldHideExpressCheckout: shouldHideExpressCheckout ?? this.isEmptyCart\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n /**\n * Renders the heading for the module.\n * @param heading - The heading data.\n * @returns The react node.\n */\n public renderMsdyn365Text(heading: IHeadingData): React.ReactNode {\n return (\n <Msdyn365.Text\n {...heading}\n tag={heading.tag ?? 'h2'}\n className='checkout-express__title'\n text={heading.text}\n editProps={{ onEdit: this.handleHeadingChange, requestContext: this.props.context.request }}\n />\n );\n }\n\n /**\n * Handles the heading change event.\n * @param event - The event.\n */\n public handleHeadingChange(event: Msdyn365.ContentEditableEvent): void {\n this.props.config.heading!.text = event.target.value;\n }\n\n /**\n * Handle payment result.\n * @param resultAccessCode - Result access code.\n */\n @action\n private readonly handlePaymentResult = async (\n resultAccessCode: string,\n isRedirectedFromPaymentGateway: boolean = false\n ): Promise<void> => {\n const {\n data: { checkout, cardPaymentAcceptPoint },\n context: {\n actionContext,\n request: {\n user: { isAuthenticated, signInUrl }\n }\n },\n config: { paymentTenderType }\n } = this.props;\n\n const cartId = checkout.result?.checkoutCart.cart.Id ?? '';\n const paymentConnectorId = cardPaymentAcceptPoint.result?.PaymentConnectorId;\n\n const settings = {\n ReturnUrl: GetCheckoutReturnUrl(actionContext),\n ...(paymentConnectorId && { PaymentConnectorId: paymentConnectorId })\n };\n\n if (isRedirectedFromPaymentGateway) {\n const cardPaymentAcceptResult: CardPaymentAcceptResult = {\n AccessCode: resultAccessCode,\n Settings: settings\n };\n\n checkout?.result?.updateCardPaymentAcceptResult({ newCardPaymentAcceptResult: cardPaymentAcceptResult }).then(async () => {\n this.props.data.checkout.result?.checkoutCart.refreshCart({});\n\n await checkout.result?.updateShouldCollapsePaymentSection({ newShouldCollapsePaymentSection: true });\n await checkout.result?.updateIsPaymentSectionContainerReady({ newIsPaymentSectionContainerReady: true });\n });\n\n return;\n } else if (checkout.result?.shippingAddressFromExpressCheckout) {\n const cardPaymentAcceptResult: CardPaymentAcceptResult = {\n AccessCode: resultAccessCode,\n Settings: settings\n };\n\n const tokenizedPaymentCard: TokenizedPaymentCard = {\n CardTypeId: paymentTenderType\n };\n\n this.setState({\n terminalError: undefined,\n errorMessage: undefined,\n shouldHideExpressCheckout: true\n });\n\n if (this.isInCartPage) {\n const address = checkout.result?.shippingAddressFromExpressCheckout;\n\n const expressPaymentDetails: IExpressPaymentDetails = {\n email: checkout.result.emailAddressFromExpressCheckout,\n paymentTenderType,\n tokenizedPaymentCard,\n address,\n isExpressCheckoutAppliedInCartPage: true,\n isExpressAddressAppliedInCartPage: true,\n cardPaymentAcceptResult\n };\n\n const newExtensionProperties = [\n {\n Key: 'expressPaymentDetails',\n Value: { StringValue: JSON.stringify(expressPaymentDetails) }\n }\n ];\n\n this.props.data.cart.result?.updateExtensionProperties({ newExtensionProperties });\n\n this.shouldHideExpressPaymentSectionElementByClassName(expressPaymentSectionInCartPageClassName, true);\n\n await checkout.result?.updateIsExpressCheckoutAppliedInCartPage({ newIsExpressCheckoutAppliedInCartPage: true });\n const guestCheckoutUrl = getUrlSync('checkout', this.props.context.actionContext) ?? '';\n const checkoutUrl = this.getCheckoutUrl(isAuthenticated, guestCheckoutUrl, signInUrl ?? '');\n\n if (MsDyn365.isBrowser) {\n window.location.href = escape(isAuthenticated ? checkoutUrl : guestCheckoutUrl);\n }\n } else {\n checkout.result\n ?.updateCardPaymentAcceptResult({ newCardPaymentAcceptResult: cardPaymentAcceptResult })\n .catch((error: Error) => {\n this.setTerminalError(error);\n });\n\n checkout.result?.updateExpressCheckoutDetails({\n newPaymentTenderType: paymentTenderType,\n newIsExpressCheckoutApplied: true,\n newIsExpressAddressApplied: true,\n newCardPaymentAcceptResult: checkout.result.cardPaymentAcceptResult,\n newEmailAddressFromExpressCheckout: checkout.result.emailAddressFromExpressCheckout,\n newTenderLine: checkout.result.tenderLine,\n newTokenizedPaymentCard: tokenizedPaymentCard\n });\n\n this.shouldHideExpressPaymentSectionElementByClassName(expressPaymentSectionClassName, true);\n }\n\n return;\n }\n\n CartsDataActions.retrieveCardPaymentAcceptResultAsync(\n { callerContext: this.props.context.actionContext },\n resultAccessCode,\n [],\n cartId,\n settings\n )\n .then(async cardPaymentAcceptResult => {\n // eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-shadow -- Public name.\n const { TenderLine, TokenizedPaymentCard, Email } = cardPaymentAcceptResult;\n\n if (!TokenizedPaymentCard) {\n this.setTerminalError(new Error('No TokenizedPaymentCard found'));\n return;\n }\n const checkoutState = this.props.data.checkout.result;\n if (checkoutState) {\n // Try to update card prefix, if it is not set already.\n const cardPrefix = TokenizedPaymentCard.CardTokenInfo?.MaskedCardNumber;\n if (cardPrefix) {\n await checkoutState.updateCardPrefix({ newCardPrefix: cardPrefix });\n }\n\n if (!TokenizedPaymentCard.CardTypeId) {\n const cardTypeId = await this.getCardTypeId(checkoutState.cardPrefix ?? '');\n if (!cardTypeId) {\n const error = new Error('The specified card type is not supported.');\n error.name = 'CARDTYPENOTFOUND';\n this.setTerminalError(error);\n return;\n }\n\n TokenizedPaymentCard.CardTypeId = cardTypeId;\n }\n\n if (this.isInCartPage) {\n const address = this.getAddressFromTokenizedPaymentCard(TokenizedPaymentCard);\n\n const expressPaymentDetails: IExpressPaymentDetails = {\n email: Email,\n tenderLine: TenderLine,\n tokenizedPaymentCard: TokenizedPaymentCard,\n paymentTenderType,\n address,\n isExpressCheckoutAppliedInCartPage: true\n };\n\n const newExtensionProperties = [\n {\n Key: 'expressPaymentDetails',\n Value: { StringValue: JSON.stringify(expressPaymentDetails) }\n }\n ];\n\n this.props.data.cart.result?.updateExtensionProperties({ newExtensionProperties });\n\n this.shouldHideExpressPaymentSectionElementByClassName(expressPaymentSectionInCartPageClassName, true);\n\n await checkoutState.updateIsExpressCheckoutAppliedInCartPage({ newIsExpressCheckoutAppliedInCartPage: true });\n } else {\n await checkoutState.updateExpressCheckoutDetails({\n newEmailAddressFromExpressCheckout: Email ?? '',\n newTenderLine: TenderLine,\n newTokenizedPaymentCard: TokenizedPaymentCard,\n newPaymentTenderType: paymentTenderType,\n newIsExpressCheckoutApplied: true,\n newIsExpressAddressApplied: false,\n newCardPaymentAcceptResult: checkoutState.cardPaymentAcceptResult\n });\n\n await this.saveShippingAndBillingAddress(TokenizedPaymentCard);\n\n this.shouldHideExpressPaymentSectionElementByClassName(expressPaymentSectionClassName, true);\n }\n\n this.setState({\n terminalError: undefined,\n errorMessage: undefined,\n shouldHideExpressCheckout: true\n });\n }\n })\n .catch(async (error: Error) => {\n // IMPORTANT: Call RS for getting a new payment session. It should not re-use the previous session for the security reason.\n await this.updatePaymentAcceptPageData();\n this.setTerminalError(error);\n this.setState({ shouldHideExpressCheckout: false });\n\n this.shouldHideExpressPaymentSectionElementByClassName(expressPaymentSectionClassName, false);\n this.shouldHideExpressPaymentSectionElementByClassName(expressPaymentSectionInCartPageClassName, false);\n })\n .finally(() => {\n this.setState({\n isPaymentProcessing: false\n });\n\n if (this.isInCartPage) {\n const guestCheckoutUrl = getUrlSync('checkout', this.props.context.actionContext) ?? '';\n const checkoutUrl = this.getCheckoutUrl(isAuthenticated, guestCheckoutUrl, signInUrl ?? '');\n\n if (MsDyn365.isBrowser) {\n window.location.href = escape(isAuthenticated ? checkoutUrl : guestCheckoutUrl);\n }\n }\n });\n };\n\n /**\n * Init.\n */\n @action\n private readonly init = async (): Promise<void> => {\n const {\n data: { checkout, cart },\n config\n } = this.props;\n const properties =\n this.props.data.cart?.result?.cart?.ExtensionProperties?.find(property => property.Key === 'expressPaymentDetails')?.Value\n ?.StringValue ?? '';\n\n if (\n (!this.isInCartPage && this.isExpressPaymentAppliedInCartPage) ||\n this.isEmptyCart ||\n checkout?.result?.isPaymentVerificationRedirection ||\n (!this.isInCartPage && !this.props.context.request.cookies.isConsentGiven() && this.props.context.request.user.isAuthenticated)\n ) {\n this.setState({\n shouldHideExpressCheckout: true\n });\n this.shouldHideExpressPaymentSectionElementByClassName(expressPaymentSectionClassName, true);\n }\n\n if (checkout.result?.isPaymentVerificationRedirection && checkout.result?.isPlaceOrderEnabledInRedirection) {\n if (config.paymentTenderType === checkout.result?.paymentTenderType) {\n const { requestFormData, query } = this.props.context.request;\n\n const formData = btoa(JSON.stringify(requestFormData ?? { redirectResult: query?.redirectResult }));\n\n this.setState({\n isPaymentProcessing: true\n });\n this.handlePaymentResult(formData, true);\n }\n } else if (this.asyncResultStatus === AsyncResultStatusCode.FAILED) {\n this.setState({\n isFetchingPaymentConnector: false\n });\n\n if (this.isInCartPage && ArrayExtensions.hasElements(cart.result?.cart.CartLines)) {\n await this.updatePaymentAcceptPageData();\n } else {\n this.setTerminalError(new Error('Failed in load data'));\n }\n }\n\n // Need to remove the property in Cart state, otherwise it will be copied to CheckoutCart when refresh or redirect to checkout page.\n if (!StringExtensions.isNullOrEmpty(properties)) {\n this.props.data.cart.result?.updateExtensionProperties({\n newExtensionProperties: [\n {\n Key: 'expressPaymentDetails',\n Value: { StringValue: '' }\n }\n ]\n });\n }\n };\n\n /**\n * Set terminal error.\n * @param terminalError - The terminal error.\n */\n @action\n private readonly setTerminalError = (terminalError: Error): void => {\n this.props.telemetry.exception(terminalError);\n const {\n resources: { genericErrorMessage, cardTypeErrorMessage }\n } = this.props;\n let errorMessage = genericErrorMessage;\n\n if (terminalError.name === 'CARDTYPENOTFOUND') {\n errorMessage = cardTypeErrorMessage;\n }\n\n this.setState({\n terminalError,\n errorMessage\n });\n };\n\n /**\n * Set error message.\n * @param errorMessage - The error message.\n */\n @action\n private readonly setErrorMessage = (errorMessage: string): void => {\n this.props.telemetry.error(errorMessage);\n this.setState({\n errorMessage\n });\n };\n\n @computed public get isEmptyCart(): boolean {\n if (this.isEditorialMode) {\n // Editorial mode: Ignore empty cart\n return false;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined..\n const cart = this.props.data.cart?.result?.cart;\n return !!cart && !isEmpty(cart) && (!cart.CartLines || !ArrayExtensions.hasElements(cart.CartLines));\n }\n\n @computed public get isEditorialMode(): boolean {\n return this.props.context.request.params.isEditor;\n }\n\n @computed get getLoyaltyAmount(): number {\n const checkoutState = this.props.data.checkout.result;\n return checkoutState && checkoutState.loyaltyAmount ? checkoutState.loyaltyAmount : zeroAmount;\n }\n\n @computed get getCustomerAccountAmount(): number {\n const checkoutState = this.props.data.checkout.result;\n return checkoutState && checkoutState.customerAccountAmount ? checkoutState.customerAccountAmount : zeroAmount;\n }\n\n @computed get getGiftCardTotalAmount(): number {\n const checkoutState = this.props.data.checkout.result;\n if (!checkoutState || !checkoutState.giftCardExtends) {\n return zeroAmount;\n }\n return checkoutState.giftCardExtends.reduce((count: number, giftCard: IGiftCardExtend) => {\n const balance: number = giftCard.Balance || zeroAmount;\n return count + balance;\n }, 0);\n }\n\n @computed public get amountDue(): number {\n const {\n data: { cart, checkout }\n } = this.props;\n let currentCart;\n\n if (this.isInCartPage) {\n if (!cart.result) {\n return zeroAmount;\n }\n\n currentCart = cart.result.cart;\n } else {\n if (!checkout.result) {\n return zeroAmount;\n }\n\n const checkoutResult = checkout.result;\n currentCart = checkoutResult.checkoutCart.cart;\n }\n\n if (!currentCart.CartLines || !ArrayExtensions.hasElements(currentCart.CartLines)) {\n return zeroAmount;\n }\n\n // Use the express checkout for all amount.\n return (\n (currentCart.TotalAmount || zeroAmount) - this.getGiftCardTotalAmount - this.getLoyaltyAmount - this.getCustomerAccountAmount\n );\n }\n\n @computed public get asyncResultStatus(): AsyncResultStatus | undefined {\n const isLoading = Object.values(this.props.data).some(data => get(data, 'status') === AsyncResultStatusCode.LOADING);\n if (isLoading) {\n return AsyncResultStatusCode.LOADING;\n }\n\n const isSuccess = Object.values(this.props.data).every(data => get(data, 'status') === AsyncResultStatusCode.SUCCESS);\n if (isSuccess) {\n return AsyncResultStatusCode.SUCCESS;\n }\n\n const isFailed = Object.values(this.props.data).some(data => get(data, 'status') === AsyncResultStatusCode.FAILED);\n if (isFailed) {\n return AsyncResultStatusCode.FAILED;\n }\n\n return undefined;\n }\n\n @computed public get requestUrlOrigin(): string {\n const origin = window.location.origin;\n const propsRequestUrl = this.props.context.request.url.requestUrl;\n const requestUrl = typeof propsRequestUrl === 'string' ? new URL(propsRequestUrl) : propsRequestUrl;\n\n return origin || requestUrl.origin;\n }\n\n public get isInCartPage(): boolean {\n const cartUrlSync = getUrlSync('cart', this.props.context.actionContext);\n let cartUrl = cartUrlSync || '/cart';\n cartUrl = cartUrl.includes('?') ? cartUrl.substring(0, cartUrl.indexOf('?')) : cartUrl;\n return this.props.context.request.canonicalUrl?.toLocaleLowerCase().includes(cartUrl) ?? false;\n }\n\n public get expressPaymentDetailsFromCartPage(): IExpressPaymentDetails | null {\n const properties =\n this.props.data.checkout?.result?.checkoutCart?.cart?.ExtensionProperties?.find(\n property => property.Key === 'expressPaymentDetails'\n )?.Value?.StringValue ?? '';\n\n return properties ? (JSON.parse(properties) as IExpressPaymentDetails) : null;\n }\n\n public get isExpressPaymentAppliedInCartPage(): boolean {\n return this.expressPaymentDetailsFromCartPage?.isExpressCheckoutAppliedInCartPage ?? false;\n }\n\n /**\n * Should hide the express payment section.\n * @param name - The class name of express payment section.\n * @param shouldHide - Should hide the section or not.\n */\n private readonly shouldHideExpressPaymentSectionElementByClassName = (name: string, shouldHide?: boolean): void => {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- explicit null/undefined check.\n const expressPaymentTextElements = document?.getElementsByClassName(name);\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- explicit null/undefined check.\n if (expressPaymentTextElements?.[0]) {\n const expressPaymentTextElement = expressPaymentTextElements[0] as HTMLInputElement;\n expressPaymentTextElement.style.display = shouldHide ? 'none' : '';\n }\n };\n\n /**\n * On iFrame has message.\n * @param event - Message event.\n */\n private readonly oniFrameMessage = (event: MessageEvent): void => {\n let result;\n try {\n if (typeof event.data !== 'string') {\n return;\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- Event is any.\n result = JSON.parse(event.data);\n } catch (error) {\n this.setTerminalError(error as Error);\n return;\n }\n\n const paymentConnectorId = this.props.data.cardPaymentAcceptPoint.result?.PaymentConnectorId;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Jason parse result is any.\n if (!result || !result.type || result.id !== paymentConnectorId) {\n if (result.type && !result.id) {\n this.props.telemetry.error('Connector id is not sent from the connector.');\n console.error(`${this.props.config.paymentTenderType} express connector id is not sent from the connector.`);\n }\n\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- Jason parse result is any.\n const { type, value, express = false } = result;\n\n // If express flag in the result is false, then express module should not handle this message.\n if (type !== PaymentConnectorPostMessageType.Height && !express) {\n return;\n }\n\n this.props.telemetry.information(\n `Express payment instrument ${this.props.config.paymentTenderType ?? ''} handles onIframeMessage ${type}.`\n );\n\n switch (type) {\n case PaymentConnectorPostMessageType.Height:\n // The payment connector will post height after it completes initialization\n if (this.state.isFetchingPaymentConnector) {\n this.setState({\n isFetchingPaymentConnector: false,\n paymentConnectorHeight: Number(value)\n });\n\n if (this.props.data.cardPaymentAcceptPoint?.result && this.props.data.checkout?.result) {\n const extension = Array.from(this.props.data.checkout.result?.isExpressPaymentModulesReady ?? []);\n const newIsExpressPaymentModulesReady = [\n ...extension,\n {\n Key: `is${this.props.config.paymentTenderType}ExpressModuleReady`,\n Value: { BooleanValue: true }\n }\n ];\n\n this.props.data.checkout.result?.updateIsExpressPaymentModulesReady({ newIsExpressPaymentModulesReady });\n }\n }\n return;\n case PaymentConnectorPostMessageType.Result:\n this.handlePaymentResult(String(value));\n return;\n case PaymentConnectorPostMessageType.ShippingAddress:\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- Jason parse result is any.\n this.handleShippingAddress(value);\n return;\n case PaymentConnectorPostMessageType.Error:\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- Jason parse result is any.\n this.handlePaymentError(value);\n return;\n case PaymentConnectorPostMessageType.Showoverlay:\n this.showOverlayModal(true);\n return;\n case PaymentConnectorPostMessageType.Hideoverlay:\n this.showOverlayModal(false);\n break;\n\n default:\n\n // Do nothing\n }\n };\n\n /**\n * Show overlay modal.\n * @param isShow - Is show.\n */\n private readonly showOverlayModal = (isShow: boolean): void => {\n this.setState({ isOverlayModal: isShow });\n };\n\n /**\n * Get card type id.\n * @param cardPrefix - Card prefix.\n * @returns Card type id.\n */\n private readonly getCardTypeId = async (cardPrefix: string = ''): Promise<string | undefined> => {\n try {\n const response = await StoreOperationsDataActions.resolveCardTypesAsync(\n { callerContext: this.props.context.actionContext },\n cardPrefix,\n CardType.Unknown\n );\n if (ArrayExtensions.hasElements(response)) {\n return response[0].TypeId;\n }\n } catch (error) {\n this.props.context.telemetry.error('Call to resolveCardTypesAsync failed.', error);\n }\n return undefined;\n };\n\n private readonly redirectToPaymentVerification = async (paymentVerificationPostData: string): Promise<void> => {\n if (!paymentVerificationPostData) {\n return;\n }\n const checkoutState = this.props.data.checkout.result;\n if (checkoutState) {\n await checkoutState.updatePaymentTenderType({ newPaymentTenderType: this.props.config.paymentTenderType });\n await checkoutState.saveDataInStorage({});\n await checkoutState.updateIsPaymentVerificationRequired({ newIsPaymentVerificationRequired: true });\n }\n const redirectInfo = JSON.parse(paymentVerificationPostData);\n const { url, data } = redirectInfo;\n const form = document.createElement('form');\n form.method = 'POST';\n form.action = url;\n for (const propertyName of Object.keys(data)) {\n const element = document.createElement('input');\n element.name = propertyName;\n element.value = data[propertyName];\n form.appendChild(element);\n }\n document.body.appendChild(form);\n form.submit();\n };\n\n /**\n * Handle payment error.\n * @param value - Message.\n */\n private readonly handlePaymentError = (value?: { message: string }[]): void => {\n const {\n resources: { defaultSubmitErrorMessage = 'An error occurred in payment method details. Please try again.' }\n } = this.props;\n if (!value || !ArrayExtensions.hasElements(value)) {\n // Fallback, if no message could be translated from payment accept page response\n this.setErrorMessage(defaultSubmitErrorMessage);\n return;\n }\n this.setErrorMessage(value.map((errorValue: { message: string }) => errorValue.message).join('\\n'));\n };\n\n /**\n * Handle shipping address.\n * @param value - Message.\n */\n private readonly handleShippingAddress = async (value?: string): Promise<void> => {\n if (value) {\n const parsedValue = JSON.parse(value);\n const address: Address = {\n TwoLetterISORegionName: parsedValue.countryCode,\n Name: parsedValue.name,\n Street: parsedValue.address1,\n StreetNumber: parsedValue.address2,\n City: parsedValue.locality,\n State: parsedValue.administrativeArea,\n ZipCode: parsedValue.postalCode\n };\n await this.props.data.checkout.result?.updateBillingAddressFromExpressCheckout({\n newBillingAddressFromExpressCheckout: address\n });\n await this.props.data.checkout.result?.updateShippingAddressFromExpressCheckout({\n newShippingAddressFromExpressCheckout: address\n });\n\n await this.props.data.checkout.result?.updateEmailAddressFromExpressCheckout({\n newEmailAddressFromExpressCheckout: parsedValue?.email ?? ''\n });\n }\n };\n\n /**\n * Update payment accept page data.\n */\n private readonly updatePaymentAcceptPageData = async (): Promise<void> => {\n const {\n context: { actionContext },\n config: { paymentTenderType },\n context: {\n request: { apiSettings }\n },\n data: { checkout }\n } = this.props;\n\n const input = {\n paymentTenderType,\n apiSettings,\n shouldEnableSinglePaymentAuthorizationCheckout: checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout,\n amountDue: this.amountDue,\n isInCartPage: this.isInCartPage\n };\n\n this.setState({\n isFetchingPaymentConnector: true\n });\n\n const checkoutState = checkout.result;\n if (checkoutState) {\n await checkoutState.updatePaymentTenderType({ newPaymentTenderType: undefined });\n await checkoutState.updateTenderLine({ newTenderLine: undefined });\n await checkoutState.updateTokenizedPaymentCard({ newTokenizedPaymentCard: undefined });\n }\n\n getCardPaymentAcceptPointAction(new GetCardPaymentAcceptPointInput(input), actionContext)\n .then(paymentAcceptPoint => {\n // In case, add form is not hidden. We need to explicity reset value to force re-rendering.\n actionContext.update(new GetCardPaymentAcceptPointInput(input), { AcceptPageContent: '', AcceptPageUrl: '' });\n\n // IMPORTANT: Do NOT set isFetchingPaymentConnector = false in getCardPaymentAcceptPointAction success response.\n // The payment connector will post a message with content height when payment is ready.\n actionContext.update(new GetCardPaymentAcceptPointInput(input), paymentAcceptPoint);\n this.setState({ paymentConnectorId: paymentAcceptPoint.PaymentConnectorId });\n\n return paymentAcceptPoint;\n })\n .catch((error: Error) => {\n this.setTerminalError(error);\n\n this.setState({\n isFetchingPaymentConnector: false\n });\n\n // IMPORTANT: Clear the AcceptPageUrl and AcceptPageContent. It should not re-use the previous session for the security reason.\n actionContext.update(new GetCardPaymentAcceptPointInput(input), { AcceptPageContent: '', AcceptPageUrl: '' });\n });\n };\n\n /**\n * Save the address as Shipping and Billing address.\n * @param tokenizedPaymentCard - Tokenized payment card.\n */\n private readonly saveShippingAndBillingAddress = async (tokenizedPaymentCard?: TokenizedPaymentCard): Promise<void> => {\n const checkoutState = this.props.data.checkout.result;\n\n // For Paypal, the address returned in TokenizedPaymentCard will be used as both shipping and billing address.\n if (checkoutState && tokenizedPaymentCard && tokenizedPaymentCard.Zip) {\n const address: Address = this.getAddressFromTokenizedPaymentCard(tokenizedPaymentCard);\n\n await checkoutState.updateBillingAddressFromExpressCheckout({ newBillingAddressFromExpressCheckout: address });\n await checkoutState.updateShippingAddressFromExpressCheckout({ newShippingAddressFromExpressCheckout: address });\n }\n };\n\n /**\n * Get address from tokenizedPaymentCard.\n * @param tokenizedPaymentCard -- The tokenizedPaymentCard from the payment.\n * @returns The address.\n */\n private readonly getAddressFromTokenizedPaymentCard = (tokenizedPaymentCard: TokenizedPaymentCard): Address => {\n const address: Address = {\n TwoLetterISORegionName: tokenizedPaymentCard.Country,\n Name: tokenizedPaymentCard.NameOnCard,\n Street: tokenizedPaymentCard.Address1,\n StreetNumber: tokenizedPaymentCard.Address2,\n City: tokenizedPaymentCard.City,\n State: tokenizedPaymentCard.State,\n ZipCode: tokenizedPaymentCard.Zip,\n Phone: tokenizedPaymentCard.Phone\n };\n\n return address;\n };\n\n /**\n * Gets the checkout URL.\n * @param isAuthenticated - Is authenticated flag.\n * @param guestCheckoutUrl - Guest checkout URL.\n * @param signInUrl -The sign in URL.\n * @returns The checkout URL.\n */\n private readonly getCheckoutUrl = (isAuthenticated: boolean, guestCheckoutUrl: string, signInUrl: string): string => {\n if (isAuthenticated) {\n return guestCheckoutUrl;\n }\n\n const absoluteUrlRegExp = new RegExp('^(?:[a-z]+:)?//', 'i');\n const isAbsoluteUrl = absoluteUrlRegExp.test(guestCheckoutUrl);\n let returnUrl = guestCheckoutUrl;\n if (MsDyn365.isBrowser && !isAbsoluteUrl) {\n returnUrl = `${window.location.origin}${guestCheckoutUrl}`;\n }\n\n return `${signInUrl}${!signInUrl.includes('?') ? '?' : '&'}ru=${returnUrl}`;\n };\n}\n\nexport default CheckoutExpress;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\nimport classNames from 'classnames';\nimport { EnabledPaymentsForOBO } from '@msdyn365-commerce-modules/checkout-utilities';\nimport { IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport { computed, reaction } from 'mobx';\nimport { CardPaymentAcceptPoint, CardPaymentAcceptResult } from '@msdyn365-commerce/retail-proxy';\nimport { StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { ICheckoutGooglePayProps } from './checkout-google-pay.props.autogenerated';\nimport { ICheckoutGooglePayData } from './checkout-google-pay.data';\nimport { GetCardPaymentAcceptPointInput, getCardPaymentAcceptPointAction } from '../checkout-payment-instrument';\nimport { IPaymentAuthorizationResult, IPaymentData, IPaymentsError, ITransactionInfo } from './checkout-google-pay.model';\nimport { GetCheckoutReturnUrl } from '../../common';\n\nexport interface ICheckoutGooglePayViewProps extends ICheckoutGooglePayProps<{}> {\n alert?: React.ReactNode;\n className?: string;\n checkoutButton?: HTMLDivElement;\n checkoutGooglePay: IModuleProps;\n}\n\nexport interface ICheckoutGooglePayModuleProps extends ICheckoutGooglePayProps<ICheckoutGooglePayData> {}\n\nexport enum GooglePayButtonState {\n Unknown,\n NotAvailable,\n Available\n}\n\ninterface IMerchantConfiguration {\n adyenMerchantId?: string;\n googleMerchantId?: string;\n currencyCode?: string;\n environment?: string;\n connectorId?: string;\n}\n\ninterface ICheckoutGooglePayState {\n buttonState: GooglePayButtonState;\n merchantConfiguration?: IMerchantConfiguration;\n errorMessage?: string;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ndeclare const window: any;\n\n/**\n *\n * CheckoutGooglePay component\n * @extends {React.Component<ICheckoutGooglePayModuleProps, ICheckoutGooglePayState>}\n */\nexport class CheckoutGooglePay extends React.Component<ICheckoutGooglePayModuleProps, ICheckoutGooglePayState> {\n private readonly moduleClassName: string = 'ms-checkout-google-pay';\n private readonly zeroAmount: number = 0;\n\n private readonly baseRequest = {\n apiVersion: 2,\n apiVersionMinor: 0\n };\n\n private readonly allowedCardNetworks = ['AMEX', 'DISCOVER', 'INTERAC', 'JCB', 'MASTERCARD', 'VISA'];\n private readonly allowedCardAuthMethods = ['PAN_ONLY', 'CRYPTOGRAM_3DS'];\n\n private readonly baseCardPaymentMethod = {\n type: 'CARD',\n parameters: {\n allowedAuthMethods: this.allowedCardAuthMethods,\n allowedCardNetworks: this.allowedCardNetworks\n }\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private paymentsClient: any = null;\n private googlePayButton: HTMLDivElement = document.createElement('div');\n\n @computed private get getLoyaltyAmount(): number {\n const {\n data: { checkout }\n } = this.props;\n const checkoutState = checkout?.result;\n return checkoutState?.loyaltyAmount ? checkoutState.loyaltyAmount : this.zeroAmount;\n }\n\n @computed private get getGiftCardTotalAmount(): number {\n const {\n data: { checkout }\n } = this.props;\n const checkoutState = checkout?.result;\n if (!checkoutState || !checkoutState.giftCardExtends) {\n return this.zeroAmount;\n }\n return checkoutState.giftCardExtends.reduce((count: number, giftCard: IGiftCardExtend) => {\n return count + (giftCard.Balance || this.zeroAmount);\n }, 0);\n }\n\n @computed private get getCustomerAccountAmount(): number {\n const {\n data: { checkout }\n } = this.props;\n const checkoutState = checkout?.result;\n\n return checkoutState?.customerAccountAmount ?? this.zeroAmount;\n }\n\n @computed private get amountDue(): number {\n const {\n data: { checkout }\n } = this.props;\n\n const cart = checkout?.result?.checkoutCart.cart;\n if (!cart || !cart.AmountDue) {\n return this.zeroAmount;\n }\n\n return Math.max(\n this.zeroAmount,\n cart.AmountDue - this.getGiftCardTotalAmount - this.getLoyaltyAmount - this.getCustomerAccountAmount\n );\n }\n\n @computed private get googleClient() {\n if (this.paymentsClient === null || this.paymentsClient === undefined) {\n const { merchantConfiguration } = this.state;\n const clientRequest = {\n environment: merchantConfiguration?.environment,\n paymentDataCallbacks: {\n onPaymentAuthorized: this.onPaymentAuthorized\n }\n };\n\n this.paymentsClient = new window.google.payments.api.PaymentsClient(clientRequest);\n }\n\n return this.paymentsClient;\n }\n\n @computed private get transactionInfo(): ITransactionInfo {\n const { merchantConfiguration } = this.state;\n return {\n currencyCode: merchantConfiguration?.currencyCode || '',\n totalPriceStatus: 'ESTIMATED',\n totalPrice: `${this.amountDue}`\n };\n }\n\n @computed private get paymentDataRequest() {\n const { merchantConfiguration } = this.state;\n const cardPaymentMethod = {\n ...this.baseCardPaymentMethod,\n tokenizationSpecification: {\n type: 'PAYMENT_GATEWAY',\n parameters: {\n gateway: 'adyen',\n gatewayMerchantId: merchantConfiguration?.adyenMerchantId || ''\n }\n }\n };\n\n const callbackIntents: string[] = ['PAYMENT_AUTHORIZATION'];\n const paymentDataRequest = {\n ...this.baseRequest,\n allowedPaymentMethods: [cardPaymentMethod],\n transactionInfo: this.transactionInfo,\n merchantInfo: {\n merchantId: merchantConfiguration?.googleMerchantId || ''\n },\n callbackIntents: callbackIntents\n };\n\n return paymentDataRequest;\n }\n\n public constructor(props: ICheckoutGooglePayProps<ICheckoutGooglePayData>) {\n super(props);\n this.state = {\n buttonState: GooglePayButtonState.Unknown\n };\n }\n\n public async componentDidMount() {\n const {\n data: { checkout }\n } = this.props;\n\n reaction(\n () => checkout?.result?.redirectAdditionalContext && checkout?.result?.redirectPaymentConnectorId,\n async () => this.performRedirect()\n );\n\n reaction(\n () => checkout?.result?.isPaymentVerificationRedirection && checkout?.result?.isPlaceOrderEnabledInRedirection,\n async () => this.handlePaymentVerification()\n );\n\n await this.loadPaymentAcceptPage();\n }\n\n public render(): JSX.Element | null {\n const {\n config: { className },\n telemetry\n } = this.props;\n\n if (this.props.context.request.user.isOBORequest && EnabledPaymentsForOBO.ExpressPayment === 0) {\n telemetry.information('isOBORequest is enabled, google pay module wont render');\n return null;\n }\n\n let checkoutButton: HTMLDivElement;\n switch (this.state.buttonState) {\n case GooglePayButtonState.Available:\n checkoutButton = this.googlePayButton;\n break;\n\n case GooglePayButtonState.NotAvailable:\n case GooglePayButtonState.Unknown:\n default:\n checkoutButton = document.createElement('div');\n }\n\n const viewProps: ICheckoutGooglePayViewProps = {\n ...this.props,\n ...this.state,\n className,\n checkoutGooglePay: {\n moduleProps: this.props,\n className: classNames(this.moduleClassName, className)\n },\n checkoutButton\n };\n\n return this.props.renderView(viewProps);\n }\n\n private async loadPaymentAcceptPage() {\n const {\n config,\n context: {\n actionContext,\n request: { apiSettings }\n },\n telemetry\n } = this.props;\n\n const input = {\n amountDue: this.amountDue,\n apiSettings,\n paymenTenderType: config.paymentTenderType\n };\n\n await getCardPaymentAcceptPointAction(new GetCardPaymentAcceptPointInput(input), actionContext)\n .then(paymentAcceptPoint => {\n const configuration = this.getMerchantConfiguration(paymentAcceptPoint);\n if (configuration) {\n this.setState({ merchantConfiguration: configuration });\n this.initialize();\n } else {\n telemetry.error('Unable to initialize Google Pay module');\n this.setState({ buttonState: GooglePayButtonState.NotAvailable });\n }\n })\n .catch((error: Error) => {\n telemetry.error(error.message);\n console.error(`[GooglePay] getCardPaymentAcceptPointAction failed: ${error.message}`);\n });\n }\n\n private getMerchantConfiguration(paymentAcceptPoint: CardPaymentAcceptPoint): IMerchantConfiguration | null {\n const { telemetry } = this.props;\n\n try {\n const configuration: IMerchantConfiguration = JSON.parse(paymentAcceptPoint?.AcceptPageContent || '');\n configuration.connectorId = paymentAcceptPoint?.PaymentConnectorId;\n\n if (StringExtensions.isNullOrWhitespace(configuration.adyenMerchantId)) {\n throw new Error('missing Adyen merchant account identifier');\n } else if (StringExtensions.isNullOrWhitespace(configuration.currencyCode)) {\n throw new Error('missing currency code');\n } else if (StringExtensions.isNullOrWhitespace(configuration.connectorId)) {\n throw new Error('missing connector identifier');\n } else if (StringExtensions.isNullOrWhitespace(configuration.environment)) {\n throw new Error('missing environment property');\n } else if (configuration.environment === 'PRODUCTION' && StringExtensions.isNullOrWhitespace(configuration.googleMerchantId)) {\n throw new Error('missing Google merchant account identifier');\n }\n\n return configuration;\n } catch (error) {\n telemetry.error(`Caught exception during parsing configuration: ${error}`);\n console.error(`[GooglePay] Caught exception during parsing configuration: ${error}`);\n }\n\n return null;\n }\n\n private initialize = () => {\n const { telemetry } = this.props;\n\n const script = document.createElement('script');\n script.onload = this.loadGoogleSdk;\n script.src = 'https://pay.google.com/gp/p/js/pay.js';\n script.async = true;\n script.onerror = () => telemetry.error('unable to load Google Pay SDK');\n document.body.appendChild(script);\n };\n\n /**\n * Load Google Pay JS SDK.\n */\n private loadGoogleSdk = async () => {\n const { telemetry } = this.props;\n const isReadyToPayRequest = {\n ...this.baseRequest,\n allowedPaymentMethods: [this.baseCardPaymentMethod]\n };\n\n let buttonState: GooglePayButtonState = GooglePayButtonState.NotAvailable;\n try {\n const isReadyToPay = await this.googleClient.isReadyToPay(isReadyToPayRequest);\n if (isReadyToPay?.result) {\n this.googlePayButton = this.googleClient.createButton({\n allowedPaymentMethods: [this.baseCardPaymentMethod],\n buttonColor: 'default',\n buttonType: 'buy',\n buttonSizeMode: 'fill',\n onClick: this.handlePayButton\n });\n\n buttonState = GooglePayButtonState.Available;\n } else {\n telemetry.error('[loadGoogleSdk] current browser does not support Google Pay');\n }\n } catch (error) {\n telemetry.error(`[loadGoogleSdk] unexpected error during loading sdk: ${error}`);\n }\n\n return this.setState({\n buttonState\n });\n };\n\n /**\n * Handler for Google Pay button.\n */\n private handlePayButton = () => {\n const { telemetry } = this.props;\n this.googleClient.loadPaymentData(this.paymentDataRequest).catch((error: IPaymentsError) => {\n if (error.statusCode === 'CANCELED') {\n telemetry.information('[CheckoutGooglePay::handlePayButton] popup was canceled');\n } else {\n telemetry.error(\n `[CheckoutGooglePay::handlePayButton] unable to complete Google transaction (${error.statusCode}): ${error.statusMessage}`\n );\n }\n });\n };\n\n private onPaymentAuthorized = async (paymentData: IPaymentData) => {\n const { resources } = this.props;\n let result: IPaymentAuthorizationResult;\n try {\n await this.processPayment(paymentData);\n result = {\n transactionState: 'SUCCESS'\n };\n } catch (e) {\n result = {\n transactionState: 'ERROR',\n error: {\n reason: 'PAYMENT_DATA_INVALID',\n message: resources.genericErrorMessage,\n intent: 'PAYMENT_AUTHORIZATION'\n }\n };\n }\n\n return new Promise((resolve, reject) => {\n resolve(result);\n });\n };\n\n /**\n * Process payment data in CSU.\n * @param paymentData The payment data from Google SDK.\n */\n private processPayment = async (paymentData: IPaymentData) => {\n const {\n data: { checkout },\n context: { actionContext }\n } = this.props;\n const { merchantConfiguration } = this.state;\n const paymentConnectorId: string = merchantConfiguration?.connectorId || '';\n const message = {\n paymentToken: paymentData.paymentMethodData.tokenizationData.token,\n browserInfo: {\n acceptHeader: '*/*',\n colorDepth: window.screen.colorDepth,\n language: window.navigator.language,\n javaEnabled: window.navigator.javaEnabled(),\n screenHeight: window.screen.height,\n screenWidth: window.screen.width,\n userAgent: window.navigator.userAgent,\n timeZoneOffset: new Date().getTimezoneOffset()\n }\n };\n\n const settings = {\n ReturnUrl: GetCheckoutReturnUrl(actionContext),\n ...(paymentConnectorId && { PaymentConnectorId: paymentConnectorId })\n };\n\n const cardPaymentAcceptResult: CardPaymentAcceptResult = {\n AccessCode: btoa(JSON.stringify(message)),\n Settings: settings\n };\n\n await checkout?.result?.updateCardPaymentAcceptResult({ newCardPaymentAcceptResult: cardPaymentAcceptResult });\n await checkout?.result?.updateIsPaymentSectionContainerReady({ newIsPaymentSectionContainerReady: true });\n };\n\n /**\n * Perform redirect\n */\n private performRedirect = async () => {\n const {\n config,\n data: { checkout },\n telemetry\n } = this.props;\n\n const { merchantConfiguration } = this.state;\n const checkoutState = checkout?.result;\n\n if (\n !StringExtensions.isNullOrWhitespace(checkoutState?.redirectPaymentConnectorId) &&\n checkoutState?.redirectPaymentConnectorId === merchantConfiguration?.connectorId\n ) {\n let redirectInfo;\n try {\n redirectInfo = JSON.parse(checkoutState?.redirectAdditionalContext || '');\n } catch (error) {\n telemetry.error(`[CheckoutGooglePay::performRedirect] unable to parse additional context`);\n return;\n }\n\n await checkoutState?.updatePaymentTenderType({ newPaymentTenderType: config.paymentTenderType });\n await checkoutState?.saveDataInStorage({});\n await checkoutState?.updateIsPaymentVerificationRequired({ newIsPaymentVerificationRequired: true });\n\n const { url, data } = redirectInfo;\n const form = document.createElement('form');\n\n form.method = 'POST';\n form.action = url;\n\n for (const propertyName of Object.keys(data)) {\n const element = document.createElement('input');\n element.name = propertyName;\n element.value = data[propertyName];\n form.appendChild(element);\n }\n\n document.body.appendChild(form);\n form.submit();\n } else {\n telemetry.warning(`[CheckoutGooglePay::performRedirect] cannot perform redirect, connector id is not valid or matching`);\n }\n };\n\n /**\n * Handle redirect shopper bank institution.\n */\n private handlePaymentVerification = async () => {\n const {\n config,\n context: { actionContext },\n data: { checkout },\n telemetry\n } = this.props;\n\n const { merchantConfiguration } = this.state;\n const checkoutState = checkout?.result;\n\n if (\n !StringExtensions.isNullOrWhitespace(checkoutState?.paymentTenderType) &&\n checkoutState?.paymentTenderType === config.paymentTenderType\n ) {\n const { requestFormData, query } = this.props.context.request;\n const formData = btoa(JSON.stringify(requestFormData ?? { redirectResult: query?.redirectResult }));\n\n const settings = {\n ReturnUrl: GetCheckoutReturnUrl(actionContext),\n PaymentConnectorId: merchantConfiguration?.connectorId\n };\n\n const cardPaymentAcceptResult: CardPaymentAcceptResult = {\n AccessCode: formData,\n Settings: settings\n };\n\n await checkoutState?.updateCardPaymentAcceptResult({ newCardPaymentAcceptResult: cardPaymentAcceptResult });\n await checkoutState?.checkoutCart.refreshCart({});\n await checkoutState?.updateShouldCollapsePaymentSection({ newShouldCollapsePaymentSection: true });\n await checkoutState?.updateIsPaymentSectionContainerReady({ newIsPaymentSectionContainerReady: true });\n } else {\n telemetry.warning(\n `[CheckoutGooglePay::handlePaymentVerification] ignore payment verification, checkout tender type: '${checkoutState?.paymentTenderType}', config tender type: '${config.paymentTenderType}'`\n );\n }\n };\n}\n\nexport default CheckoutGooglePay;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CheckoutModule, ErrorLocation, ICheckoutState } from '@msdyn365-commerce/global-state';\nimport { getEstimatedPickupTimeslotAvailabilitiesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\nimport {\n CartLine,\n LineDeliverySpecification,\n OrgUnitLocation,\n PickupTimeslotAvailability,\n PickupTimeslotAvailabilitySearchCriteria,\n ProductDeliveryOptions,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\nimport {\n ArrayExtensions,\n getFallbackImageUrl,\n getSimpleProducts,\n ObjectExtensions,\n ProductInput\n} from '@msdyn365-commerce-modules/retail-actions';\nimport { format, IModuleProps, isNullOrWhiteSpace, Waiting } from '@msdyn365-commerce-modules/utilities';\nimport classname from 'classnames';\nimport { action, computed, observable, reaction, when } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { ICheckoutPickupData } from './checkout-pickup.data';\nimport { ICheckoutPickupProps } from './checkout-pickup.props.autogenerated';\nimport {\n CheckoutPickupDateDropdown,\n CheckoutPickupError,\n CheckoutPickupTimeslotDropdown,\n getDate,\n getTimeslot,\n getUTCDateWithoutTime\n} from './components';\nimport {\n CheckoutPickupAddress,\n CheckoutPickupCartLines,\n CheckoutPickupGroupHeader,\n CheckoutPickupTimeslotInfo,\n DefaultImageSettings,\n ICheckoutPickupAddressProps,\n ICheckoutPickupCartLineInfo,\n ICheckoutPickupCartLinesProps,\n ICheckoutPickupGroup,\n ICheckoutPickupGroupHeaderProps,\n ICheckoutPickupGroupViewProps,\n ICheckoutPickupTimeslotInfoProps,\n PickupTimeslotAvailabilityState\n} from './components/checkout-pickup-group';\nimport { focusOnCheckoutError } from '../../checkout-errors';\n\nexport interface ICheckoutPickupModuleProps extends ICheckoutPickupProps<ICheckoutPickupData>, IModuleStateProps {}\n\nexport interface ICheckoutPickupState {\n pickupGroups: ICheckoutPickupGroup[];\n}\n\nexport interface ICheckoutPickupViewState {\n isLoading: boolean;\n isHeaderError: boolean;\n isShowDropdown: boolean;\n isShowSelected: boolean;\n}\n\nexport interface ICheckoutPickupViewProps extends ICheckoutPickupProps<{}> {\n checkoutPickup: IModuleProps;\n viewState: ICheckoutPickupViewState;\n headerError: React.ReactNode;\n waiting: React.ReactNode;\n pickupGroups: ICheckoutPickupGroupViewProps[];\n checkoutErrorRef?: React.RefObject<HTMLElement>;\n}\n\n/**\n *\n * CheckoutPickup component.\n * @extends {React.Component<ICheckoutPickupModuleProps>}\n */\n// @ts-expect-error\n@withModuleState\n@observer\nclass CheckoutPickup extends React.Component<ICheckoutPickupModuleProps, ICheckoutPickupState> {\n private readonly checkoutErrorRef: React.RefObject<HTMLElement> = React.createRef();\n\n @observable private isLoading: boolean = false;\n\n @observable private headerErrorMessage?: string;\n\n @computed get isDataReady(): boolean {\n return (\n (this.props.data.checkout.result && this.props.data.checkout.status) === 'SUCCESS' &&\n (this.props.data.orgUnitLocations.result && this.props.data.orgUnitLocations.status) === 'SUCCESS'\n );\n }\n\n constructor(props: ICheckoutPickupModuleProps) {\n super(props);\n this.state = { pickupGroups: [] };\n\n this.setDateHandler = this.setDateHandler.bind(this);\n this.setTimeslotHandler = this.setTimeslotHandler.bind(this);\n }\n\n public componentDidMount(): void {\n when(\n () => this.isDataReady,\n async () => {\n await this.initPickupGroup();\n this.initModuleState();\n }\n );\n\n if (this.props.data.checkout.result?.shouldEnableCheckoutErrorDisplayMessaging) {\n reaction(\n () => this.props.data.checkout.result?.checkoutError,\n checkoutError => {\n if (checkoutError && checkoutError.errorLocation === ErrorLocation.CheckoutPickup && checkoutError.errorMessage) {\n this.setError(checkoutError.errorMessage);\n }\n }\n );\n\n reaction(\n () => this.props.data.checkout.result?.checkoutErrorFocus,\n checkoutErrorFocus => {\n if (checkoutErrorFocus === CheckoutModule.CheckoutPickup) {\n focusOnCheckoutError(this.checkoutErrorRef, this.props.context.actionContext);\n }\n }\n );\n }\n }\n\n public shouldComponentUpdate(nextProps: ICheckoutPickupModuleProps, nextState: ICheckoutPickupState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | null {\n if (!this.isDataReady || !this.canPickup()) {\n return null;\n }\n\n const { resources, config, context } = this.props;\n\n const {\n pickupDateLabel,\n pickupTimeslotLabel,\n pickupDateDefaultText,\n pickupTimeslotDefaultText,\n itemsText,\n singleItemText,\n pickupDateTimeslotText,\n pickupTimeslotPlaceHolder,\n pickupLocationLabel\n } = resources;\n\n const { locale } = context.request;\n const { className, imageSettings, useHour12TimeFormat } = config;\n const defaultClassName = 'ms-checkout-pickup';\n const groupsViewProps: ICheckoutPickupGroupViewProps[] = [];\n\n this.state.pickupGroups.forEach((value, index) => {\n // Divider line for each pickup group\n const groupDivider: React.ReactNode = index !== 0 && <hr className={`${defaultClassName}__group-divider`} />;\n\n // Line images\n const cartlines: ICheckoutPickupCartLineInfo[] = value.cartLines\n .filter(x => !ObjectExtensions.isNullOrUndefined(x.product))\n .map(line => ({\n lineId: line.cartLine.LineId || '',\n imageProps: {\n requestContext: context.actionContext.requestContext,\n className: `${defaultClassName}__group-line-image`,\n altText: line.product?.Name,\n src: line.product?.PrimaryImageUrl || '',\n fallBackSrc: getFallbackImageUrl(\n line.product?.ItemId,\n context.actionContext.requestContext.apiSettings,\n context.request.app?.config?.OmniChannelMedia\n ),\n gridSettings: context.request.gridSettings!,\n imageSettings: imageSettings || DefaultImageSettings,\n loadFailureBehavior: 'empty'\n },\n quantity: line.cartLine.Quantity || 0\n }));\n\n // Heading for each group\n const numberOfCartLines = this._countItems(cartlines);\n const itemText = numberOfCartLines > 1 ? itemsText : singleItemText;\n const itemTitle = `(${format(itemText, numberOfCartLines)})`;\n const headerProps: ICheckoutPickupGroupHeaderProps = {\n moduleClassName: defaultClassName,\n storeInfo: `${value.pickupModeName}, ${value.storeName}`,\n items: itemTitle\n };\n const groupHeader: React.ReactNode = <CheckoutPickupGroupHeader {...headerProps} />;\n\n const lineImageProps: ICheckoutPickupCartLinesProps = {\n moduleClassName: defaultClassName,\n cartLines: cartlines.filter(x => !ObjectExtensions.isNullOrUndefined(x))\n };\n const cartLineImages: React.ReactNode = <CheckoutPickupCartLines {...lineImageProps} />;\n\n // Selected pickup date and timeslot node\n const dateString = getDate(value.selectedDate, locale);\n const timeslotString = getTimeslot(\n pickupTimeslotPlaceHolder,\n value.selectedTimeslot?.StartDateTime,\n value.selectedTimeslot?.EndDateTime,\n locale,\n useHour12TimeFormat\n );\n const timeslotInfoProps: ICheckoutPickupTimeslotInfoProps = {\n moduleClassName: defaultClassName,\n title: pickupDateTimeslotText,\n content: `${dateString} ${timeslotString}`\n };\n const selectedDateTimeslotNode: React.ReactNode = <CheckoutPickupTimeslotInfo {...timeslotInfoProps} />;\n\n // Pickup address\n const addressProps: ICheckoutPickupAddressProps = {\n moduleClassName: defaultClassName,\n title: pickupLocationLabel,\n address: value.pickupAddress\n };\n const pickupAddress: React.ReactNode = <CheckoutPickupAddress {...addressProps} />;\n\n // Pickup date and timeslot dropdown list\n const dropdownClassName = `${defaultClassName}__group-datetime-dropdown`;\n const labelClassName = `${dropdownClassName}-label`;\n const dropdownSelectClassName = `${dropdownClassName}-select`;\n const dateDropdownNode: React.ReactNode = (\n <CheckoutPickupDateDropdown\n className={dropdownClassName}\n pickupStoreId={value.pickupStoreId}\n deliveryMode={value.deliveryMode}\n defaultText={pickupDateDefaultText}\n errorMessage={value.dateErrorMessage}\n labelText={pickupDateLabel}\n locale={locale}\n dropdownId={`pickup-date-dropdown-${index}`}\n availableDates={value.availableDates}\n selectedDate={value.selectedDate}\n controlledByParent\n labelClassname={labelClassName}\n dropdownClassname={dropdownSelectClassName}\n setDateHandler={this.setDateHandler}\n />\n );\n\n const timeslotDropdownNode: React.ReactNode = (\n <CheckoutPickupTimeslotDropdown\n className={dropdownClassName}\n pickupStoreId={value.pickupStoreId}\n deliveryMode={value.deliveryMode}\n defaultText={pickupTimeslotDefaultText}\n errorMessage={value.timeslotErrorMessage}\n labelText={pickupTimeslotLabel}\n timeslotPlaceHolder={pickupTimeslotPlaceHolder}\n locale={locale}\n dropdownId={`pickup-timeslot-dropdown-${index}`}\n availableTimeslots={value.availableTimeslots}\n selectedTimeslot={value.selectedTimeslot}\n controlledByParent\n labelClassname={labelClassName}\n dropdownClassname={dropdownSelectClassName}\n setTimeslotHandler={this.setTimeslotHandler}\n useHour12TimeFormat={useHour12TimeFormat}\n />\n );\n\n const viewProp: ICheckoutPickupGroupViewProps = {\n moduleProps: { ...this.props },\n pickupGroupContainer: { className: `${defaultClassName}__group` },\n dateTimeslotContainer: { className: `${defaultClassName}__group-datetime` },\n pickupStoreId: value.pickupStoreId,\n pickupModeName: value.pickupModeName,\n deliveryMode: value.deliveryMode,\n groupDivider,\n groupHeader,\n groupErrorMessage: <CheckoutPickupError errorMessage={value.groupErrorMessage} />,\n cartLineImages,\n pickupDateDropdown: dateDropdownNode,\n pickupTimeslotDropdown: timeslotDropdownNode,\n selectedDateTimeslot: selectedDateTimeslotNode,\n pickupAddress\n };\n\n groupsViewProps.push(viewProp);\n });\n\n const {\n moduleState: { isReady, hasError }\n } = this.props;\n const isHeaderError = !this.isLoading && this.headerErrorMessage !== undefined;\n const isShowDropdown = !this.isLoading && !isReady;\n const isShowSelected = !this.isLoading && !hasError && isReady;\n\n const viewProps: ICheckoutPickupViewProps = {\n ...this.props,\n checkoutPickup: {\n moduleProps: this.props,\n className: classname(defaultClassName, className)\n },\n viewState: {\n isLoading: this.isLoading,\n isHeaderError,\n isShowSelected,\n isShowDropdown\n },\n headerError: <CheckoutPickupError errorMessage={this.headerErrorMessage} />,\n waiting: <Waiting />,\n pickupGroups: groupsViewProps,\n checkoutErrorRef: this.checkoutErrorRef\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n @action\n public async setDateHandler(pickupStoreId: string, deliveryMode: string, pickupDate: Date | undefined): Promise<void> {\n const oldGroup = this.state.pickupGroups.find(\n group => group.pickupStoreId === pickupStoreId && group.deliveryMode === deliveryMode\n );\n if (!oldGroup) {\n return;\n }\n\n const newGroup: ICheckoutPickupGroup = { ...oldGroup };\n newGroup.selectedDate = pickupDate;\n newGroup.selectedTimeslot = undefined; // Clear the selected timeslot in any case\n newGroup.timeslotErrorMessage = undefined; // Clear the timeslot error message if any\n newGroup.lineDeliverySpecs.forEach((lineSpec: LineDeliverySpecification) => {\n if (lineSpec.DeliverySpecification) {\n lineSpec.DeliverySpecification.PickupTimeslotStartDateTime = undefined;\n lineSpec.DeliverySpecification.PickupTimeslotEndDateTime = undefined;\n }\n });\n\n if (pickupDate) {\n // Date is set\n const searchCriteria: PickupTimeslotAvailabilitySearchCriteria = {\n DeliveryModeCode: newGroup.deliveryMode,\n StoreId: newGroup.pickupStoreId,\n StartDate: pickupDate,\n EndDate: pickupDate,\n SearchOptionValue: 2 // Test runtime does not recognize PickupTimeslotAvailabilitySearchOption.All\n };\n const timeslotResults: PickupTimeslotAvailability[] = await getEstimatedPickupTimeslotAvailabilitiesAsync(\n { callerContext: this.props.context.actionContext, queryResultSettings: {}, bypassCache: 'get' },\n searchCriteria\n );\n\n newGroup.availableTimeslots = timeslotResults.filter(value => (value.AvailableCapacity || 0) > 0);\n newGroup.dateErrorMessage =\n newGroup.availableTimeslots.length === 0 ? this.props.resources.noAvailableTimeslotError : undefined;\n } else {\n // Date is not set\n newGroup.availableTimeslots = [];\n newGroup.dateErrorMessage = undefined;\n }\n\n const groups = this.state.pickupGroups.map(group => {\n if (group.pickupStoreId === pickupStoreId && group.deliveryMode === deliveryMode) {\n return newGroup;\n }\n return group;\n });\n\n this.setState({ pickupGroups: groups });\n }\n\n @action\n public setTimeslotHandler(pickupStoreId: string, deliveryMode: string, pickupTimeslot: PickupTimeslotAvailability | undefined): void {\n const oldGroup = this.state.pickupGroups.find(\n group => group.pickupStoreId === pickupStoreId && group.deliveryMode === deliveryMode\n );\n if (!oldGroup) {\n return;\n }\n\n const newGroup: ICheckoutPickupGroup = { ...oldGroup };\n\n newGroup.selectedTimeslot = pickupTimeslot;\n newGroup.lineDeliverySpecs.forEach((lineSpec: LineDeliverySpecification) => {\n if (lineSpec.DeliverySpecification) {\n lineSpec.DeliverySpecification.PickupTimeslotStartDateTime = pickupTimeslot?.StartDateTime;\n lineSpec.DeliverySpecification.PickupTimeslotEndDateTime = pickupTimeslot?.EndDateTime;\n }\n });\n\n if (pickupTimeslot) {\n newGroup.timeslotErrorMessage = undefined;\n }\n\n const groups = this.state.pickupGroups.map(group => {\n if (group.pickupStoreId === pickupStoreId && group.deliveryMode === deliveryMode) {\n return newGroup;\n }\n return group;\n });\n\n this.setState({ pickupGroups: groups });\n }\n\n @action\n private readonly initModuleState = (): void => {\n this.props.moduleState.init({\n onEdit: this.onEdit,\n onSubmit: this.onSubmit,\n status: this.canPickup() ? (this.isPickupTimeSlotSet() ? 'ready' : 'updating') : 'disabled'\n });\n };\n\n private readonly onEdit = (): void => {\n this.props.moduleState.onUpdating();\n };\n\n private readonly onReady = (): void => {\n this.props.moduleState.onReady();\n };\n\n private readonly onPending = (): void => {\n this.props.moduleState.onPending();\n };\n\n private readonly onSubmit = async (): Promise<void> => {\n await this.updateCartLinePickupDateTimeslot();\n };\n\n private readonly setError = (errorMessage: string, isHeaderError: boolean = true): void => {\n this.props.telemetry.error(errorMessage);\n this.props.moduleState.setHasError(true);\n this.props.moduleState.onUpdating();\n if (isHeaderError) {\n this.headerErrorMessage = errorMessage;\n }\n };\n\n private readonly clearError = (): void => {\n this.props.moduleState.setHasError(false);\n this.headerErrorMessage = undefined;\n };\n\n @action\n private readonly initPickupGroup = async (): Promise<void> => {\n const pickupCartLines: CartLine[] = this.getCartLinesforPickup();\n let products: SimpleProduct[] = [];\n try {\n products = await this.getProductsByCartLines(\n this.props.data.checkout.result?.checkoutCart.cart.ChannelId || 0,\n pickupCartLines\n );\n } catch (error) {\n this.props.telemetry.error(error);\n }\n const pickupGroups: ICheckoutPickupGroup[] = [];\n const locations: OrgUnitLocation[] = this.props.data.orgUnitLocations.result || [];\n this.isLoading = true;\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n const { featureState, deliveryOptions } = this.props?.data;\n const retailMultiplePickUpOptionEnabled = featureState?.result?.find(feature => feature.Name === multiplePickupStoreSwitchName)\n ?.IsEnabled;\n\n for (const line of pickupCartLines) {\n const group: ICheckoutPickupGroup | undefined = pickupGroups.find(\n x => x.pickupStoreId === line.FulfillmentStoreId && x.deliveryMode === line.DeliveryMode\n );\n const product: SimpleProduct | undefined = products.find(x => x.RecordId === line.ProductId);\n const lineDeliverySpecification: LineDeliverySpecification = {\n LineId: line.LineId,\n DeliverySpecification: {\n DeliveryModeId: line.DeliveryMode,\n DeliveryPreferenceTypeValue: 2,\n PickUpStoreId: line.FulfillmentStoreId,\n PickupTimeslotStartDateTime: line.PickupTimeslotStartDateTime,\n PickupTimeslotEndDateTime: line.PickupTimeslotEndDateTime,\n DeliveryAddress: line.ShippingAddress\n }\n };\n if (group) {\n group.lineDeliverySpecs.push(lineDeliverySpecification);\n group.cartLines.push({ cartLine: line, product });\n } else {\n // Group not exists yet\n const location: OrgUnitLocation | undefined = locations.find(x => x.OrgUnitNumber === line.FulfillmentStoreId);\n const storeName: string = this.getStoreName(location, line);\n const selectedDate: Date | undefined =\n line.PickupTimeslotStartDateTime && getUTCDateWithoutTime(line.PickupTimeslotStartDateTime);\n const selectedTimeslot =\n line.PickupTimeslotStartDateTime && line.PickupTimeslotEndDateTime\n ? { StartDateTime: line.PickupTimeslotStartDateTime, EndDateTime: line.PickupTimeslotEndDateTime }\n : undefined;\n const newGroup: ICheckoutPickupGroup = {\n pickupModeName: retailMultiplePickUpOptionEnabled\n ? this.getPickupModeDescription(\n this.props.resources.generalPickupText,\n line.DeliveryMode,\n deliveryOptions?.result,\n product\n )\n : this.props.resources.generalPickupText,\n pickupStoreId: line.FulfillmentStoreId || '',\n deliveryMode: line.DeliveryMode || '',\n storeName,\n pickupAddress: line.ShippingAddress,\n availabilityState: PickupTimeslotAvailabilityState.None,\n lineDeliverySpecs: [lineDeliverySpecification],\n cartLines: [{ cartLine: line, product }],\n availableDates: [],\n availableTimeslots: [],\n selectedDate,\n selectedTimeslot\n };\n\n let dailyGroupingResults: PickupTimeslotAvailability[] = [];\n try {\n const searchCriteria: PickupTimeslotAvailabilitySearchCriteria = {\n DeliveryModeCode: newGroup.deliveryMode,\n StoreId: newGroup.pickupStoreId,\n SearchOptionValue: 1 // Test runtime does not recognize PickupTimeslotAvailabilitySearchOption.DailyGroupingTimeslotOnly\n };\n dailyGroupingResults = await getEstimatedPickupTimeslotAvailabilitiesAsync(\n { callerContext: this.props.context.actionContext, queryResultSettings: {} },\n searchCriteria\n );\n } catch (error) {\n this.props.telemetry.error(error);\n }\n newGroup.availabilityState = this.getPickupTimeslotAvailabilityState(dailyGroupingResults);\n if (newGroup.availabilityState === PickupTimeslotAvailabilityState.NotAvailable) {\n newGroup.groupErrorMessage = this.props.resources.noAvailableDateError;\n this.setError(newGroup.groupErrorMessage, false);\n }\n dailyGroupingResults.forEach(value => {\n if (value.StartDateTime && (value.AvailableCapacity || 0) > 0) {\n newGroup.availableDates.push(getUTCDateWithoutTime(value.StartDateTime));\n }\n });\n\n if (selectedDate) {\n let timeslotResults: PickupTimeslotAvailability[] = [];\n try {\n const searchCriteria: PickupTimeslotAvailabilitySearchCriteria = {\n DeliveryModeCode: newGroup.deliveryMode,\n StoreId: newGroup.pickupStoreId,\n StartDate: selectedDate,\n EndDate: selectedDate,\n SearchOptionValue: 2 // Test runtime does not recognize PickupTimeslotAvailabilitySearchOption.All\n };\n timeslotResults = await getEstimatedPickupTimeslotAvailabilitiesAsync(\n { callerContext: this.props.context.actionContext, queryResultSettings: {}, bypassCache: 'get' },\n searchCriteria\n );\n } catch (error) {\n this.props.telemetry.error(error);\n }\n newGroup.availableTimeslots = timeslotResults.filter(value => (value.AvailableCapacity || 0) > 0);\n }\n pickupGroups.push(newGroup);\n }\n }\n\n const filteredPickupGroups = pickupGroups.filter(\n group =>\n group.availabilityState === PickupTimeslotAvailabilityState.Available ||\n group.availabilityState === PickupTimeslotAvailabilityState.NotAvailable\n );\n\n if (!ArrayExtensions.hasElements(filteredPickupGroups)) {\n this.props.context.telemetry.error('Data is not ready or pickup group is empty, module wont render.');\n }\n this.isLoading = false;\n this.setState({ pickupGroups: filteredPickupGroups });\n };\n\n @action\n private readonly updateCartLinePickupDateTimeslot = async (): Promise<void> => {\n if (!this.validateTimeslot()) {\n return;\n }\n const { resources } = this.props;\n let lineSpecs: LineDeliverySpecification[] = [];\n\n this.state.pickupGroups.forEach(group => {\n lineSpecs = lineSpecs.concat(group.lineDeliverySpecs);\n });\n\n this.clearError();\n this.onPending();\n\n try {\n const checkoutState = this.props.data.checkout.result as ICheckoutState;\n const response = await checkoutState.checkoutCart.updateCartLinePickupDateTimeslot({ lineDeliverySpecifications: lineSpecs });\n\n if (response.status === 'FAILED') {\n this.setError(resources.genericErrorMessage);\n } else {\n this.onReady();\n this.props.moduleState.setIsCancellable(true);\n }\n } catch {\n this.setError(resources.genericErrorMessage);\n }\n };\n\n private readonly getProductsByCartLines = async (channelId: number, cartLines: CartLine[]): Promise<SimpleProduct[]> => {\n const actionContext = this.props.context.actionContext;\n const productInputs = cartLines\n .filter(line => !ObjectExtensions.isNullOrUndefined(line.ProductId))\n .map(\n line =>\n new ProductInput(\n line.ProductId || 0,\n actionContext.requestContext.apiSettings,\n channelId,\n undefined,\n actionContext.requestContext\n )\n );\n return getSimpleProducts(productInputs, actionContext);\n };\n\n private readonly validateTimeslot = (): boolean => {\n let validationResult = true;\n this.state.pickupGroups.forEach(group => {\n switch (group.availabilityState) {\n case PickupTimeslotAvailabilityState.NotAvailable:\n // Need customer to select another store in this case\n validationResult = false;\n break;\n case PickupTimeslotAvailabilityState.Available:\n if (!group.selectedDate || !group.selectedTimeslot) {\n if (!group.selectedDate) {\n group.dateErrorMessage = this.props.resources.pickupDateRequired;\n }\n if (!group.selectedTimeslot) {\n group.timeslotErrorMessage = this.props.resources.pickupTimeslotRequired;\n }\n this.setError(this.props.resources.pickupDateTimeslotRequired, false);\n validationResult = false;\n } else {\n group.dateErrorMessage = undefined;\n group.timeslotErrorMessage = undefined;\n }\n break;\n\n // We consider timeslot not defined as fallback case\n case PickupTimeslotAvailabilityState.NotDefined:\n default:\n }\n });\n\n return validationResult;\n };\n\n private readonly getStoreName = (orgUnitLocation: OrgUnitLocation | undefined, cartLine: CartLine): string => {\n return orgUnitLocation?.OrgUnitName || cartLine.ShippingAddress?.Name || cartLine.FulfillmentStoreId || '';\n };\n\n private readonly canPickup = (): boolean => {\n return ArrayExtensions.hasElements(this.state.pickupGroups);\n };\n\n private readonly isPickupTimeSlotSet = (): boolean => {\n return (\n ArrayExtensions.hasElements(this.state.pickupGroups) &&\n this.state.pickupGroups.every(\n group =>\n !ObjectExtensions.isNullOrUndefined(group.selectedTimeslot?.StartDateTime) &&\n !ObjectExtensions.isNullOrUndefined(group.selectedTimeslot?.EndDateTime)\n )\n );\n };\n\n private readonly getCartLinesforPickup = (): CartLine[] => {\n return this.props.data.checkout.result?.checkoutCart.cart.CartLines?.filter(line => this.isPickupLine(line)) || [];\n };\n\n private readonly isPickupMode = (deliveryMode: string | undefined): boolean => {\n const pickupDeliveryModeCode = this.props.context.request.channel?.PickupDeliveryModeCode;\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n const { channelDeliveryOptionConfig, featureState } = this.props?.data;\n const retailMultiplePickUpOptionEnabled = featureState?.result?.find(feature => feature.Name === multiplePickupStoreSwitchName)\n ?.IsEnabled;\n if (retailMultiplePickUpOptionEnabled && deliveryMode !== undefined) {\n const pickupDeliveryMode = channelDeliveryOptionConfig?.result?.PickupDeliveryModeCodes?.includes(deliveryMode);\n return pickupDeliveryMode !== undefined ? pickupDeliveryMode : false;\n }\n return deliveryMode !== undefined && pickupDeliveryModeCode !== undefined && deliveryMode === pickupDeliveryModeCode;\n };\n\n private readonly isPickupLine = (line: CartLine): boolean => {\n return (\n this.isPickupMode(line.DeliveryMode) && line.FulfillmentStoreId !== undefined && !isNullOrWhiteSpace(line.FulfillmentStoreId)\n );\n };\n\n private readonly getPickupModeDescription = (\n resourceString: string,\n deliveryMode?: string,\n deliveryOptions?: ProductDeliveryOptions[],\n product?: SimpleProduct\n ): string => {\n let deliveryOption: string = resourceString;\n if (ArrayExtensions.hasElements(deliveryOptions) && product !== undefined) {\n let foundProductDeliveryOption;\n foundProductDeliveryOption = deliveryOptions?.find(deliveryO => {\n return deliveryO && deliveryO.ProductId === product.RecordId;\n });\n const deliveryDesc = foundProductDeliveryOption?.DeliveryOptions\n ? foundProductDeliveryOption?.DeliveryOptions?.find(option => option.Code === deliveryMode)?.Description\n : resourceString;\n if (deliveryDesc !== undefined) {\n deliveryOption = deliveryDesc;\n }\n }\n return deliveryOption;\n };\n\n private readonly getPickupTimeslotAvailabilityState = (dailyResult: PickupTimeslotAvailability[]) => {\n let state: PickupTimeslotAvailabilityState = PickupTimeslotAvailabilityState.None;\n if (!ArrayExtensions.hasElements(dailyResult)) {\n state = PickupTimeslotAvailabilityState.NotDefined;\n } else if (dailyResult.every(date => (date.AvailableCapacity || 0) <= 0)) {\n state = PickupTimeslotAvailabilityState.NotAvailable;\n } else {\n state = PickupTimeslotAvailabilityState.Available;\n }\n return state;\n };\n\n /**\n * Returns count of products.\n * @param cartLine - The checkout pickup cart line info props.\n * @returns Number of products.\n */\n private readonly _countItems = (cartlines: ICheckoutPickupCartLineInfo[]): number => {\n return cartlines.reduce((count, line) => {\n return count + (line.quantity || 0);\n }, 0);\n };\n}\n\nexport default CheckoutPickup;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ICheckoutPickupGroupViewProps, ICheckoutPickupViewProps } from './index';\n\nconst CheckoutPickupView: React.FC<ICheckoutPickupViewProps> = props => {\n const { checkoutPickup, checkoutErrorRef, viewState, headerError, waiting, pickupGroups } = props;\n\n return (\n <Module {...checkoutPickup} ref={checkoutErrorRef}>\n {viewState.isLoading && waiting}\n {viewState.isHeaderError && headerError}\n {pickupGroups.map(\n (pickupGroupViewProps: ICheckoutPickupGroupViewProps, index: number): React.ReactElement => {\n const {\n pickupGroupContainer,\n dateTimeslotContainer,\n groupDivider,\n groupHeader,\n groupErrorMessage,\n cartLineImages,\n pickupDateDropdown,\n pickupTimeslotDropdown,\n selectedDateTimeslot,\n pickupAddress\n } = pickupGroupViewProps;\n\n return (\n <Node {...pickupGroupContainer} key={`checkout-pickup-group-${index}`}>\n {groupDivider}\n {groupHeader}\n {groupErrorMessage}\n {cartLineImages}\n {viewState.isShowDropdown && (\n <Node {...dateTimeslotContainer}>\n {pickupDateDropdown}\n {pickupTimeslotDropdown}\n </Node>\n )}\n {viewState.isShowSelected && pickupAddress}\n {viewState.isShowSelected && selectedDateTimeslot}\n </Node>\n );\n }\n )}\n </Module>\n );\n};\n\nexport default CheckoutPickupView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { AsyncResultStatus } from '@msdyn365-commerce/core';\nimport { CheckoutModule, ErrorLocation, IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport { CardType } from '@msdyn365-commerce/retail-proxy';\nimport { retrieveCardPaymentAcceptResultAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { resolveCardTypesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\nimport {\n Address,\n CardPaymentAcceptResult,\n CartLine,\n TokenizedPaymentCard\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { IModuleStateProps, withModuleState, EnabledPaymentsForOBO } from '@msdyn365-commerce-modules/checkout-utilities';\nimport { IModuleProps, INodeProps, Modal } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport get from 'lodash/get';\nimport { action, computed, reaction, when } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { AsyncResultStatusCode, GetCheckoutReturnUrl } from '../../common';\nimport { AddPaymentFormComponent } from '../../common/add-payment-form';\nimport { ErrorComponent } from '../../common/error';\nimport { Iframe } from '../../common/iframe';\nimport {\n paymentConnectorAmountMessage,\n paymentConnectorExtraContextMessage,\n PaymentConnectorPostMessageType,\n paymentConnectorSubmitMessage\n} from '../../common/payment-instrument-message';\nimport { WaitingComponent } from '../../common/waiting';\nimport { IVisibilityObserverProps, withVisibilityObserver } from '../../common/with-visibility-observer';\nimport getCardPaymentAcceptPointAction, { GetCardPaymentAcceptPointInput } from './actions/get-card-payment-accept-point';\nimport { ICheckoutPaymentInstrumentData } from './checkout-payment-instrument.data';\nimport { ICheckoutPaymentInstrumentProps } from './checkout-payment-instrument.props.autogenerated';\nimport PaymentInformationComponent from './components/payment-information';\nimport { focusOnCheckoutError, setCheckoutErrors } from '../../checkout-errors';\n\nexport interface ICheckoutPaymentInstrumentModuleProps\n extends ICheckoutPaymentInstrumentProps<ICheckoutPaymentInstrumentData>,\n IModuleStateProps,\n IVisibilityObserverProps {}\n\ninterface ICheckoutPaymentInstrumentState {\n errorMessage?: string;\n isFetchingPaymentConnector?: boolean;\n paymentConnectorHeight?: number;\n isPaymentVerificationRequried?: boolean;\n paymentVerificationPostData?: string;\n isPaymentProcessing?: boolean;\n isOverlayModal?: boolean;\n isExpressCheckoutApplied?: boolean;\n errorPaymentConnectorId?: string;\n}\n\nexport interface ICheckoutPaymentOverlayModal {\n modal: INodeProps;\n}\n\nexport interface ICheckoutPaymentInstrumentViewProps extends ICheckoutPaymentInstrumentProps<{}>, ICheckoutPaymentInstrumentState {\n className?: string;\n checkoutPaymentInstrument: IModuleProps;\n waiting?: React.ReactNode;\n alert?: React.ReactNode;\n paymentInformation?: React.ReactNode;\n addPaymentForm?: React.ReactNode;\n overlayModal?: ICheckoutPaymentOverlayModal;\n isVisible?: boolean;\n checkoutErrorRef?: React.RefObject<HTMLElement>;\n}\n\nconst zeroAmount = 0;\n\n/**\n *\n * CheckoutPaymentInstrument component.\n * @extends {React.Component<ICheckoutPaymentInstrumentProps<ICheckoutPaymentInstrumentData>>}\n */\n// @ts-expect-error\n@withModuleState\n@observer\nexport class CheckoutPaymentInstrument extends React.PureComponent<ICheckoutPaymentInstrumentModuleProps> {\n @computed get getLoyaltyAmount(): number {\n const checkoutState = this.props.data.checkout.result;\n return checkoutState && checkoutState.loyaltyAmount ? checkoutState.loyaltyAmount : 0;\n }\n\n @computed get getCustomerAccountAmount(): number {\n const checkoutState = this.props.data.checkout.result;\n return checkoutState && checkoutState.customerAccountAmount ? checkoutState.customerAccountAmount : 0;\n }\n\n @computed get getGiftCardTotalAmount(): number {\n const checkoutState = this.props.data.checkout.result;\n if (!checkoutState || !checkoutState.giftCardExtends) {\n return 0;\n }\n return checkoutState.giftCardExtends.reduce((count: number, giftCard: IGiftCardExtend) => {\n const balance: number = giftCard.Balance || 0;\n return count + balance;\n }, 0);\n }\n\n @computed public get amountDue(): number {\n const {\n data: { checkout }\n } = this.props;\n if (!checkout.result) {\n return 0;\n }\n\n const checkoutResult = checkout.result;\n const cart = checkoutResult.checkoutCart.cart;\n if (!cart || !cart.CartLines || cart.CartLines.length === 0) {\n return 0;\n }\n\n // Use the card for payment after all other payment methods\n return (cart.TotalAmount || zeroAmount) - this.getGiftCardTotalAmount - this.getLoyaltyAmount - this.getCustomerAccountAmount;\n }\n\n @computed get shouldPaidByCard(): boolean {\n const {\n data: { checkout },\n config\n } = this.props;\n if (!checkout.result) {\n return false;\n }\n\n const checkoutResult = checkout.result;\n\n const { paymentTenderType, tokenizedPaymentCard, isExpressAddressApplied } = checkoutResult;\n const isPaidByOtherPaymentSource =\n config.paymenTenderType?.toLocaleLowerCase() !== paymentTenderType?.toLocaleLowerCase() &&\n (tokenizedPaymentCard || isExpressAddressApplied);\n\n return this.amountDue > zeroAmount && !isPaidByOtherPaymentSource;\n }\n\n @computed get isCartContainsItemsForShipping(): boolean {\n const pickupDeliveryModeCode = get(this.props, 'context.request.channel.PickupDeliveryModeCode');\n const emailDeliveryModeCode = get(this.props, 'context.request.channel.EmailDeliveryModeCode');\n const { channelDeliveryOptionConfig, featureState } = this.props.data;\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n const retailMultiplePickUpOptionEnabled = featureState?.result?.find(feature => feature.Name === multiplePickupStoreSwitchName)\n ?.IsEnabled;\n\n return retailMultiplePickUpOptionEnabled\n ? (get(this.props, 'data.checkout.result.checkoutCart.cart.CartLines') || []).some(\n (cartLine: CartLine) =>\n cartLine.DeliveryMode !==\n channelDeliveryOptionConfig.result?.PickupDeliveryModeCodes?.find(\n deliveryMode => deliveryMode === cartLine.DeliveryMode\n ) && cartLine.DeliveryMode !== emailDeliveryModeCode\n )\n : (get(this.props, 'data.checkout.result.checkoutCart.cart.CartLines') || []).some(\n (cartLine: CartLine) =>\n cartLine.DeliveryMode !== pickupDeliveryModeCode && cartLine.DeliveryMode !== emailDeliveryModeCode\n );\n }\n\n @computed get isCartHasSelectedDeliveryMethods(): boolean {\n return (get(this.props, 'data.checkout.result.checkoutCart.cart.CartLines') || []).every(\n (cartLine: CartLine) => !!cartLine.DeliveryMode\n );\n }\n\n @computed get asyncResultStatus(): AsyncResultStatus | undefined {\n const isLoading = Object.values(this.props.data).some(data => get(data, 'status') === AsyncResultStatusCode.LOADING);\n if (isLoading) {\n return AsyncResultStatusCode.LOADING;\n }\n\n const isSuccess = Object.values(this.props.data).every(data => get(data, 'status') === AsyncResultStatusCode.SUCCESS);\n if (isSuccess) {\n return AsyncResultStatusCode.SUCCESS;\n }\n\n const isFailed = Object.values(this.props.data).some(data => get(data, 'status') === AsyncResultStatusCode.FAILED);\n if (isFailed) {\n return AsyncResultStatusCode.FAILED;\n }\n return;\n }\n\n @computed get hasSelectedItem(): boolean {\n return !!get(this.props.data, 'checkoutState.result.tokenizedPaymentCard');\n }\n\n @computed get shouldReloadAcceptPage(): boolean {\n return !get(this.props.data, 'cardPaymentAcceptPoint.result.NotReloadAcceptPageContentWhenAmountChanged');\n }\n\n @computed get requestUrlOrigin(): string {\n const origin = get(window, 'location.origin');\n const requestUrl =\n typeof get(this.props, 'context.request.url.requestUrl') === 'string'\n ? new URL(get(this.props, 'context.request.url.requestUrl'))\n : get(this.props, 'context.request.url.requestUrl');\n return origin || requestUrl.origin;\n }\n\n public state: ICheckoutPaymentInstrumentState = {\n isFetchingPaymentConnector: true\n };\n\n private readonly moduleClassName: string = 'ms-checkout-payment-instrument';\n\n private readonly iframeRef: React.RefObject<Iframe> = React.createRef();\n\n private readonly checkoutErrorRef: React.RefObject<HTMLElement> = React.createRef();\n\n public componentDidMount(): void {\n when(\n () => this.asyncResultStatus !== AsyncResultStatusCode.LOADING,\n () => {\n this.init();\n\n this._handleExpressCheckout();\n }\n );\n reaction(\n () => this.asyncResultStatus !== AsyncResultStatusCode.FAILED && this.shouldPaidByCard,\n () => {\n this.togglePayment();\n }\n );\n\n reaction(\n () => this.amountDue,\n async () => {\n if (\n this.shouldReloadAcceptPage &&\n !this.props.data.checkout.result?.isExpressCheckoutApplied &&\n this.amountDue > zeroAmount &&\n !this.props.data.checkout.result?.isPaymentVerificationRedirection\n ) {\n await this.onEdit();\n\n this.props.telemetry.information(\n `AmountDue is updated and onEdit() is called for payment instrument ${this.props.config.paymenTenderType ?? ''}.`\n );\n }\n\n // send amount to payment connector\n const message = paymentConnectorAmountMessage(this.amountDue);\n this.postMessageToIframe(message, false /* setPending */);\n }\n );\n\n reaction(\n () => this.props.data.checkout.result?.isExpressCheckoutApplied,\n () => {\n this._handleExpressCheckout();\n }\n );\n\n if (this.props.data.checkout.result?.shouldEnableCheckoutErrorDisplayMessaging) {\n reaction(\n () => this.props.data.checkout.result?.checkoutError,\n checkoutError => {\n if (\n (this.props.data.cardPaymentAcceptPoint.result?.PaymentConnectorId ===\n this.props.data.checkout.result?.checkoutErrorPaymentConnectorId ||\n this.state.errorPaymentConnectorId) &&\n checkoutError &&\n checkoutError.errorLocation === ErrorLocation.CheckoutPaymentInstrument &&\n checkoutError.errorMessage\n ) {\n this.setErrorMessage(checkoutError.errorMessage);\n }\n }\n );\n\n reaction(\n () => this.props.data.checkout.result?.checkoutErrorFocus,\n checkoutErrorFocus => {\n if (\n (this.props.data.cardPaymentAcceptPoint.result?.PaymentConnectorId ===\n this.props.data.checkout.result?.checkoutErrorPaymentConnectorId ||\n this.state.errorPaymentConnectorId) &&\n checkoutErrorFocus === CheckoutModule.CheckoutPaymentInstrument\n ) {\n focusOnCheckoutError(this.checkoutErrorRef, this.props.context.actionContext);\n }\n }\n );\n }\n\n // Reaction for new checkout flow.\n if (this.props.data.checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout) {\n reaction(\n () =>\n this.props.data.checkout.result?.redirectAdditionalContext &&\n this.props.data.checkout.result?.redirectPaymentConnectorId,\n () => {\n if (\n !this.props.data.checkout.result?.isExpressCheckoutApplied &&\n this.props.data.checkout.result?.redirectAdditionalContext &&\n this.props.data.cardPaymentAcceptPoint.result?.PaymentConnectorId ===\n this.props.data.checkout.result?.redirectPaymentConnectorId\n ) {\n this.handleAdditionalContext(this.props.data.checkout.result.redirectAdditionalContext);\n\n this.props.telemetry.information(\n `For single payment auth, handle Additional Context in reaction for payment instrument ${this.props.config\n .paymenTenderType ?? ''}.`\n );\n }\n }\n );\n\n reaction(\n () => this.props.data.checkout.result?.isPlaceOrderEnabledInRedirection,\n () => {\n if (\n !this.props.data.checkout.result?.isExpressCheckoutApplied &&\n this.props.data.checkout.result?.isPlaceOrderEnabledInRedirection &&\n this.props.data.cardPaymentAcceptPoint.result?.PaymentConnectorId ===\n this.props.data.checkout.result?.redirectPaymentConnectorId\n ) {\n this.init();\n\n this.props.telemetry.information(`For single payment auth, isPlaceOrderEnabledInRedirection is updated to\n ${\n this.props.data.checkout.result?.isPlaceOrderEnabledInRedirection\n } and init() is called for payment instrument ${this.props.config.paymenTenderType ?? ''}.`);\n }\n }\n );\n }\n }\n\n // eslint-disable-next-line complexity -- from existing code.\n public render(): JSX.Element | null {\n const {\n errorMessage,\n isFetchingPaymentConnector,\n paymentConnectorHeight,\n isPaymentVerificationRequried,\n isPaymentProcessing,\n isOverlayModal,\n isExpressCheckoutApplied\n } = this.state;\n const {\n moduleState: { isReady, hasError, hasInitialized, isPending, hasExternalSubmitGroup },\n config: { iFrameHeightOverride, paymentStyleOverride, className, showBillingAddress, paymenTenderType },\n resources,\n data: { checkout, cardPaymentAcceptPoint },\n visibilityObserver\n } = this.props;\n\n const isVisible = visibilityObserver && visibilityObserver.isVisible;\n\n const isSinglePayment = checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout;\n\n if (!hasInitialized || (this.asyncResultStatus !== AsyncResultStatusCode.FAILED && !this.shouldPaidByCard)) {\n this.props.context.telemetry.error('Checkout payment content is empty, module wont render');\n return null;\n }\n\n if (this.props.context.request.user.isOBORequest && EnabledPaymentsForOBO.PaymentInstrument === 0) {\n this.props.context.telemetry.information('isOBORequest is enabled, Checkout payment instrument module wont render');\n return null;\n }\n\n const { AcceptPageUrl, AcceptPageContent, MessageOrigin } = cardPaymentAcceptPoint.result ?? {\n AcceptPageUrl: undefined,\n AcceptPageContent: undefined,\n MessageOrigin: undefined\n };\n\n const { tokenizedPaymentCard, tenderLine, billingAddress } = checkout.result || {\n tokenizedPaymentCard: undefined,\n tenderLine: undefined,\n billingAddress: undefined\n };\n\n const paymentTenderTypeClassName = paymenTenderType ? `${this.moduleClassName}-${paymenTenderType.toLowerCase()}` : '';\n\n const viewProps: ICheckoutPaymentInstrumentViewProps = {\n ...this.props,\n ...this.state,\n isVisible,\n className,\n checkoutErrorRef: this.checkoutErrorRef,\n\n checkoutPaymentInstrument: {\n moduleProps: this.props,\n className: classnames(this.moduleClassName, paymentTenderTypeClassName, className)\n },\n waiting: !isReady &&\n !isExpressCheckoutApplied &&\n this.asyncResultStatus !== AsyncResultStatusCode.FAILED &&\n (this.asyncResultStatus === AsyncResultStatusCode.LOADING || isFetchingPaymentConnector || isPending) && (\n <WaitingComponent {...{ message: resources.loadingMessage }} />\n ),\n alert: hasError && errorMessage && <ErrorComponent {...{ title: resources.errorMessageTitle, message: errorMessage }} />,\n paymentInformation: (isExpressCheckoutApplied ||\n (isReady && !isSinglePayment && !isPaymentVerificationRequried && !isPaymentProcessing)) && (\n <PaymentInformationComponent\n tokenizedPaymentCard={tokenizedPaymentCard}\n tenderLine={tenderLine}\n billingAddress={showBillingAddress ? billingAddress : undefined}\n canEdit={!hasExternalSubmitGroup}\n onEdit={this.onEdit}\n resources={resources}\n />\n ),\n addPaymentForm: !isExpressCheckoutApplied &&\n (!isReady || isSinglePayment || isPaymentVerificationRequried) &&\n !isPaymentProcessing &&\n (AcceptPageUrl || AcceptPageContent) &&\n isVisible && (\n <AddPaymentFormComponent\n acceptPageUrl={AcceptPageUrl}\n acceptPageContent={AcceptPageContent}\n messageOrigin={MessageOrigin}\n onSubmit={this.onSubmit}\n onCancel={this.onCancel}\n onIFrameMessage={this.onIFrameMessage}\n iframeRef={this.iframeRef}\n canSubmit={!hasExternalSubmitGroup}\n canCancel={!hasExternalSubmitGroup && this.hasSelectedItem}\n iFrameHeightOverride={iFrameHeightOverride || paymentConnectorHeight}\n requestUrlOrigin={this.requestUrlOrigin}\n isFetchingPaymentConnector={isFetchingPaymentConnector}\n paymentStyleOverride={paymentStyleOverride}\n resources={resources}\n />\n ),\n overlayModal: {\n modal: {\n tag: Modal,\n className: `${this.moduleClassName}__overlay-modal`,\n isOpen: isOverlayModal\n }\n }\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private readonly onIFrameMessage = async (event: MessageEvent): Promise<void> => {\n let result;\n try {\n if (typeof event.data !== 'string') {\n return;\n }\n result = JSON.parse(event.data);\n } catch (error) {\n this.setTerminalError(error);\n return;\n }\n\n const shouldCheckConnectorId = this.props.config.shouldCheckConnectorId;\n\n const paymentConnectorId = this.props.data.cardPaymentAcceptPoint.result?.PaymentConnectorId;\n\n if (!result || !result.type || (shouldCheckConnectorId && result.id !== paymentConnectorId)) {\n if (shouldCheckConnectorId && result.type && !result.id) {\n this.props.telemetry.error('User connector id flag is checked but connector id is not sent from the connector.');\n console.error(\n `${this.props.config.paymenTenderType ??\n ''} User connector id flag is checked but connector id is not sent from the connector.`\n );\n }\n\n return;\n }\n\n const { type, value, express = false } = result;\n\n // If express flag in the result is true, then regular payment module should not handle this message.\n if (express) {\n return;\n }\n\n this.props.telemetry.information(`Payment instrument ${this.props.config.paymenTenderType ?? ''} handles onIframeMessage ${type}.`);\n\n switch (type) {\n case PaymentConnectorPostMessageType.Height:\n // The payment connector will post height after it completes initialization\n this.setState({\n isFetchingPaymentConnector: false,\n paymentConnectorHeight: value\n });\n\n // send amount to payment connector\n const message = paymentConnectorAmountMessage(this.amountDue);\n this.postMessageToIframe(message, false /* setPending */);\n\n if (this.props.config.isPrimaryPayment) {\n this.props.moduleState.onUpdating();\n }\n\n return;\n case PaymentConnectorPostMessageType.Result:\n this.handlePaymentResult(value);\n return;\n case PaymentConnectorPostMessageType.CardPrefix:\n await this.handlePaymentCardPrefix(value);\n return;\n case PaymentConnectorPostMessageType.Error:\n this.handlePaymentError(value);\n return;\n case PaymentConnectorPostMessageType.Redirect:\n this.handlePaymentRedirect(value);\n return;\n case PaymentConnectorPostMessageType.Showoverlay:\n this.showOverlayModal(true);\n return;\n case PaymentConnectorPostMessageType.Hideoverlay:\n this.showOverlayModal(false);\n return;\n default:\n return;\n // Do nothing\n }\n };\n\n @action\n private readonly handlePaymentResult = (resultAccessCode: string, isRedirectedFromPaymentGateway: boolean = false): void => {\n const {\n data: { checkout, cardPaymentAcceptPoint },\n config: { isPrimaryPayment, paymenTenderType },\n context: { actionContext },\n resources: { termsAndConditionErrorMessage }\n } = this.props;\n\n const cartId = checkout.result?.checkoutCart.cart.Id || '';\n const paymentConnectorId = cardPaymentAcceptPoint.result?.PaymentConnectorId;\n\n const settings = {\n ReturnUrl: GetCheckoutReturnUrl(actionContext),\n ...(paymentConnectorId && { PaymentConnectorId: paymentConnectorId })\n };\n\n if (checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout) {\n const cardPaymentAcceptResult: CardPaymentAcceptResult = {\n AccessCode: resultAccessCode,\n Settings: settings\n };\n\n checkout.result\n .updateCardPaymentAcceptResult({ newCardPaymentAcceptResult: cardPaymentAcceptResult })\n .then(async () => {\n if (isRedirectedFromPaymentGateway) {\n this.props.data.checkout.result?.checkoutCart.refreshCart({});\n\n this.props.moduleState.setHasError(false);\n this.props.moduleState.onReady();\n this.setState({\n terminalError: null,\n errorMessage: null\n });\n this.props.moduleState.setIsSubmitContainer(true);\n\n await checkout.result?.updateShouldCollapsePaymentSection({ newShouldCollapsePaymentSection: true });\n await checkout.result?.updateIsPaymentSectionContainerReady({ newIsPaymentSectionContainerReady: true });\n } else if (isPrimaryPayment) {\n this.props.moduleState.setHasError(false);\n this.props.moduleState.onReady();\n this.setState({\n terminalError: null,\n errorMessage: null\n });\n this.props.moduleState.setIsSubmitContainer(true);\n } else {\n if (\n checkout.result?.isTermsAndConditionChecked !== false ||\n checkout.result.isTermsAndConditionAccepted !== false\n ) {\n this.props.moduleState.onSkip();\n await checkout.result?.updateIsPaymentSectionContainerReady({ newIsPaymentSectionContainerReady: true });\n } else {\n this.props.moduleState.setHasError(true);\n this.setErrorMessage(termsAndConditionErrorMessage);\n }\n }\n })\n .catch(async (error: Error) => {\n // IMPORTANT: Call RS for getting a new payment session. It should not re-use the previous session for the security reason.\n await this.updatePaymentAcceptPageData();\n this.setTerminalError(error);\n })\n .finally(() => {\n this.setState({ isPaymentProcessing: false });\n });\n\n return;\n }\n\n retrieveCardPaymentAcceptResultAsync({ callerContext: this.props.context.actionContext }, resultAccessCode, [], cartId, settings)\n .then(async cardPaymentAcceptResult => {\n const { TenderLine, TokenizedPaymentCard, AdditionalContext } = cardPaymentAcceptResult || {};\n\n await this.saveBillingAddress(TokenizedPaymentCard);\n\n if (AdditionalContext) {\n this.handleAdditionalContext(AdditionalContext);\n } else {\n if (!TokenizedPaymentCard) {\n this.setTerminalError(new Error('No TokenizedPaymentCard found'));\n return;\n }\n const checkoutState = this.props.data.checkout.result;\n if (checkoutState) {\n // Try to update card prefix, if it is not set already.\n // Adyen connector does not send msax-cc-cardprefix message\n // but it sets the card prefix in tokenized card\n if (!checkoutState.cardPrefix) {\n const cardPrefix =\n TokenizedPaymentCard &&\n TokenizedPaymentCard.CardTokenInfo &&\n TokenizedPaymentCard.CardTokenInfo.MaskedCardNumber;\n if (cardPrefix) {\n await checkoutState.updateCardPrefix({ newCardPrefix: cardPrefix });\n }\n }\n\n if (!TokenizedPaymentCard.CardTypeId) {\n const cardTypeId = await this.getCardTypeId(checkoutState.cardPrefix || '');\n if (!cardTypeId) {\n const error = new Error('The specified card type is not supported.');\n error.name = 'CARDTYPENOTFOUND';\n this.setTerminalError(error);\n return;\n }\n\n TokenizedPaymentCard.CardTypeId = cardTypeId;\n }\n\n await checkoutState.updateTenderLine({ newTenderLine: TenderLine });\n await checkoutState.updateTokenizedPaymentCard({ newTokenizedPaymentCard: TokenizedPaymentCard });\n await checkoutState.updatePaymentTenderType({ newPaymentTenderType: paymenTenderType });\n\n // In case of PSD2 redirect, cart we be updated in server side so refresh cart.\n if (isRedirectedFromPaymentGateway) {\n this.props.data.checkout.result?.checkoutCart.refreshCart({});\n }\n\n this.props.moduleState.setHasError(false);\n this.props.moduleState.onReady();\n this.setState({\n terminalError: null,\n errorMessage: null\n });\n this.props.moduleState.setIsSubmitContainer(true);\n }\n }\n })\n .catch(error => {\n // IMPORTANT: Call RS for getting a new payment session. It should not re-use the previous session for the security reason.\n this.updatePaymentAcceptPageData();\n this._handleCheckoutError(error);\n })\n .finally(() => {\n this.setState({\n isPaymentProcessing: false\n });\n });\n };\n\n @action\n private readonly handlePaymentCardPrefix = async (cardPrefix: string): Promise<void> => {\n const checkoutState = this.props.data.checkout.result;\n if (checkoutState) {\n await checkoutState.updateCardPrefix({ newCardPrefix: cardPrefix });\n }\n };\n\n @action\n private readonly handlePaymentRedirect = (redirectData: string): void => {\n this.setState({\n isPaymentVerificationRequried: true,\n paymentVerificationPostData: redirectData\n });\n this.props.moduleState.setHasError(false);\n this.onContainerReady();\n };\n\n private readonly showOverlayModal = (isShow: boolean): void => {\n this.setState({ isOverlayModal: isShow });\n };\n\n private readonly getCardTypeId = async (cardPrefix: string = ''): Promise<string | undefined> => {\n try {\n const response = await resolveCardTypesAsync({ callerContext: this.props.context.actionContext }, cardPrefix, CardType.Unknown);\n if (response && response.length > 0) {\n return response[0].TypeId;\n }\n } catch (error) {\n this.props.context.telemetry.error('Call to resolveCardTypesAsync failed.', error);\n }\n return undefined;\n };\n\n private readonly redirectToPaymentVerification = async (): Promise<void> => {\n const { isPaymentVerificationRequried, paymentVerificationPostData } = this.state;\n if (!isPaymentVerificationRequried || !paymentVerificationPostData) {\n return;\n }\n\n const checkoutState = this.props.data.checkout.result;\n if (checkoutState) {\n await checkoutState.updatePaymentTenderType({ newPaymentTenderType: this.props.config.paymenTenderType });\n await checkoutState.saveDataInStorage({});\n await checkoutState.updateIsPaymentVerificationRequired({ newIsPaymentVerificationRequired: true });\n }\n\n const redirectInfo = JSON.parse(paymentVerificationPostData);\n const { url, data } = redirectInfo;\n const form = document.createElement('form');\n\n form.method = 'POST';\n form.action = url;\n\n for (const propertyName of Object.keys(data)) {\n const element = document.createElement('input');\n element.name = propertyName;\n element.value = data[propertyName];\n form.appendChild(element);\n }\n\n document.body.appendChild(form);\n form.submit();\n\n this.props.telemetry.information(\n `RedirectToPaymentVerification is submitted for payment instrument ${this.props.config.paymenTenderType ?? ''}.`\n );\n };\n\n private readonly handlePaymentError = (value?: { Message: string }[]): void => {\n const {\n resources: { defaultSubmitErrorMessage = 'An error occurred in payment method details. Please try again.' }\n } = this.props;\n if (!value || value.length === 0) {\n // Fallback, if no message could be translated from payment accept page response\n this.setErrorMessage(defaultSubmitErrorMessage);\n return;\n }\n this.setErrorMessage(value.map((_value: { Message: string }) => _value.Message).join('\\n'));\n };\n\n @action\n private readonly init = (): void => {\n const {\n data: { checkout },\n config\n } = this.props;\n\n const moduleStatusWhenExpressCheckoutApplied = checkout.result?.isExpressCheckoutApplied ? 'ready' : 'updating';\n\n this.props.moduleState.init({\n onEdit: this.onEdit,\n onCancel: this.onCancel,\n onSubmit: this.onSubmit,\n onContainerReady: this.onContainerReady,\n isCancellable: false,\n status: this.shouldPaidByCard ? moduleStatusWhenExpressCheckoutApplied : 'disabled'\n });\n\n if (\n checkout.result?.isPaymentVerificationRedirection &&\n !(checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout && !checkout.result.isPlaceOrderEnabledInRedirection)\n ) {\n if (config.paymenTenderType === checkout.result?.paymentTenderType) {\n const { requestFormData, query } = this.props.context.request;\n\n const formData = btoa(JSON.stringify(requestFormData ?? { redirectResult: query?.redirectResult }));\n\n this.setState({\n isPaymentProcessing: true\n });\n\n this.props.moduleState.onPending();\n this.handlePaymentResult(formData, true);\n }\n } else if (this.asyncResultStatus === AsyncResultStatusCode.FAILED) {\n this.setState({\n isFetchingPaymentConnector: false\n });\n this.setTerminalError(new Error('Failed in load data'));\n } else if (checkout.result?.isExpressCheckoutApplied) {\n this._handleExpressCheckout();\n }\n };\n\n @action\n private readonly setTerminalError = (terminalError: Error): void => {\n this.props.telemetry.exception(terminalError);\n this.props.moduleState.setHasError(true);\n this.props.moduleState.onUpdating();\n const {\n resources: { genericErrorMessage, cardTypeErrorMessage }\n } = this.props;\n let errorMessage = genericErrorMessage;\n\n switch (terminalError.name) {\n case 'CARDTYPENOTFOUND': {\n errorMessage = cardTypeErrorMessage;\n break;\n }\n default:\n }\n\n this.setState({\n terminalError,\n errorMessage\n });\n };\n\n @action\n private readonly setErrorMessage = (errorMessage: string): void => {\n this.props.telemetry.error(errorMessage);\n this.props.moduleState.setHasError(true);\n this.props.moduleState.onUpdating();\n this.setState({\n errorMessage\n });\n };\n\n private readonly updatePaymentAcceptPageData = async (): Promise<void> => {\n const {\n context: { actionContext },\n config: { showBillingAddress, paymenTenderType, shouldPassLocaleToiFrame },\n context: {\n request: { apiSettings }\n },\n data: { checkout }\n } = this.props;\n\n const input = {\n showBillingAddress,\n paymenTenderType,\n apiSettings,\n shouldEnableSinglePaymentAuthorizationCheckout: checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout,\n amountDue: this.amountDue,\n shouldPassLocaleToiFrame\n };\n\n this.setState({\n isFetchingPaymentConnector: true\n });\n\n const checkoutState = checkout.result;\n if (checkoutState) {\n await checkoutState.updatePaymentTenderType({ newPaymentTenderType: undefined });\n await checkoutState.updateTenderLine({ newTenderLine: undefined });\n await checkoutState.updateTokenizedPaymentCard({ newTokenizedPaymentCard: undefined });\n }\n\n getCardPaymentAcceptPointAction(new GetCardPaymentAcceptPointInput(input), actionContext)\n .then(paymentAcceptPoint => {\n // In case, add form is not hidden. We need to explicitly reset value to force re-rendering.\n actionContext.update(new GetCardPaymentAcceptPointInput(input), { AcceptPageContent: '', AcceptPageUrl: '' });\n\n // IMPORTANT: Do NOT set isFetchingPaymentConnector = false in getCardPaymentAcceptPointAction success response.\n // The payment connector will post a message with content height when payment is ready.\n actionContext.update(new GetCardPaymentAcceptPointInput(input), paymentAcceptPoint);\n this.setState({ paymentConnectorId: paymentAcceptPoint.PaymentConnectorId });\n\n // For new checkout flow, redirect additionContext comes from Checkout API exception and will be handled in below.\n if (checkoutState?.shouldEnableSinglePaymentAuthorizationCheckout && checkoutState.redirectAdditionalContext) {\n this.handleAdditionalContext(checkoutState.redirectAdditionalContext);\n }\n })\n .catch((error: Error) => {\n this.setTerminalError(error);\n\n this.setState({\n isFetchingPaymentConnector: false\n });\n\n // IMPORTANT: Clear the AcceptPageUrl and AcceptPageContent. It should not re-use the previous session for the security reason.\n actionContext.update(new GetCardPaymentAcceptPointInput(input), { AcceptPageContent: '', AcceptPageUrl: '' });\n });\n };\n\n private readonly postMessageToIframe = (message: object, setPending: boolean) => {\n const postMessage = get(this.iframeRef, 'current.postMessage');\n if (postMessage) {\n if (setPending) {\n this.props.moduleState.onPending();\n }\n postMessage(message);\n }\n };\n\n private readonly handleAdditionalContext = (additionalContext: string): void => {\n const message = paymentConnectorExtraContextMessage(additionalContext);\n this.postMessageToIframe(message, true /* setPending */);\n\n // eslint-disable-next-line no-console -- log the message for more information.\n console.log('Post payment connector extraContext message.');\n };\n\n private readonly saveBillingAddress = async (tokenizedPaymentCard?: TokenizedPaymentCard): Promise<void> => {\n const { showBillingAddress } = this.props.config;\n const checkoutState = this.props.data.checkout.result;\n\n // If we use billing address provided by adyen, billing address returned in TokenizedPaymentCard.\n if (checkoutState && showBillingAddress && tokenizedPaymentCard && tokenizedPaymentCard.Zip) {\n const billingAddress: Address = {\n ThreeLetterISORegionName: tokenizedPaymentCard.Country,\n Name: tokenizedPaymentCard.House === 'N/A' ? '' : tokenizedPaymentCard.House,\n Street: tokenizedPaymentCard.Address1,\n StreetNumber: tokenizedPaymentCard.Address2,\n City: tokenizedPaymentCard.City,\n State: tokenizedPaymentCard.State,\n ZipCode: tokenizedPaymentCard.Zip,\n Phone: tokenizedPaymentCard.Phone\n };\n await checkoutState.updateBillingAddress({ newBillingAddress: billingAddress });\n }\n };\n\n @action\n private readonly togglePayment = () => {\n if (this.shouldPaidByCard && this.props.moduleState.isDisabled) {\n this.props.moduleState.onUpdating();\n } else if (!this.shouldPaidByCard && !this.props.moduleState.isDisabled) {\n this.props.moduleState.setHasError(false);\n this.props.moduleState.onDisable();\n }\n };\n\n @action\n private readonly onSubmit = (): void => {\n const { isPrimaryPayment = true, paymenTenderType } = this.props.config;\n\n this.props.telemetry.information(`Payment instrument ${paymenTenderType ?? ''} onSubmit is called.`);\n\n if (isPrimaryPayment) {\n this.postMessageToIframe(paymentConnectorSubmitMessage(), true /* setPending */);\n } else {\n this.props.moduleState.onSkip();\n }\n };\n\n @action\n private readonly onCancel = (): void => {\n this.props.telemetry.information(`Payment instrument ${this.props.config.paymenTenderType ?? ''} onCancel is called.`);\n\n if (this.hasSelectedItem) {\n this.props.moduleState.onReady();\n } else {\n this.props.moduleState.onUpdating();\n }\n };\n\n // eslint-disable-next-line @typescript-eslint/member-ordering -- Keep existing order.\n @action\n private readonly onEdit = async (): Promise<void> => {\n this.props.telemetry.information(`Payment instrument ${this.props.config.paymenTenderType ?? ''} onEdit is called.`);\n\n this.props.moduleState.onUpdating();\n\n await this.props.data.checkout.result?.updateIsExpressCheckoutApplied({ newIsExpressCheckoutApplied: false });\n\n if (this.props.data.checkout.result?.isExpressAddressApplied) {\n await this.props.data.checkout.result.updateIsExpressAddressApplied({ newIsExpressAddressApplied: false });\n }\n\n // IMPORTANT: Call RS for getting a new payment session. It should not re-use the previous session for the security reason.\n this.updatePaymentAcceptPageData();\n };\n\n @action\n private readonly onContainerReady = (): void => {\n this.props.telemetry.information(`Payment instrument ${this.props.config.paymenTenderType ?? ''} onContainerReady is called.`);\n\n this.redirectToPaymentVerification();\n this.props.moduleState.setIsSubmitContainer(false);\n };\n\n @action\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private readonly _handleCheckoutError = (error: any): void => {\n const checkoutResult = this.props.data.checkout.result;\n\n this.setState({\n errorPaymentConnectorId: this.props.data.cardPaymentAcceptPoint.result?.PaymentConnectorId\n });\n\n if (checkoutResult && checkoutResult.shouldEnableCheckoutErrorDisplayMessaging) {\n this.props.telemetry.exception(error);\n this.props.moduleState.setHasError(true);\n\n const errorCode = error && error.name ? error.name : '';\n setCheckoutErrors(errorCode, this.props.resources, !!checkoutResult.isExpressCheckoutApplied, this.props.context.actionContext);\n } else {\n this.setTerminalError(error);\n }\n };\n\n @action\n private readonly _handleExpressCheckout = (): void => {\n this.props.telemetry.information(\n `IsExpressCheckoutApplied is updated to ${\n this.props.data.checkout.result?.isExpressCheckoutApplied\n } for payment instrument ${this.props.config.paymenTenderType ?? ''}.`\n );\n\n if (this.props.data.checkout.result?.isExpressCheckoutApplied && this.props.config.paymenTenderType) {\n this.props.moduleState.setHasError(false);\n this.props.moduleState.onReady();\n this.setState({\n terminalError: null,\n errorMessage: null,\n isPaymentProcessing: false,\n isExpressCheckoutApplied: true\n });\n this.props.moduleState.setIsSubmitContainer(true);\n } else {\n this.setState({ isExpressCheckoutApplied: false });\n }\n };\n}\n\nexport default withVisibilityObserver(CheckoutPaymentInstrument);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ICheckoutPaymentInstrumentViewProps, ICheckoutPaymentOverlayModal } from './checkout-payment-instrument';\n\nconst OverlayModal: React.FC<ICheckoutPaymentOverlayModal> = ({ modal }) => {\n return <Node {...modal} />;\n};\n\nconst CheckoutPaymentInstrumentView: React.FC<ICheckoutPaymentInstrumentViewProps> = ({\n checkoutPaymentInstrument,\n checkoutErrorRef,\n className,\n id,\n waiting,\n alert,\n paymentInformation,\n addPaymentForm,\n overlayModal,\n ...restProps\n}) => (\n <Module {...checkoutPaymentInstrument} ref={checkoutErrorRef}>\n {waiting}\n {alert}\n {paymentInformation}\n {addPaymentForm}\n {overlayModal && <OverlayModal {...overlayModal} />}\n </Module>\n);\n\nexport default CheckoutPaymentInstrumentView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport {\n CheckoutModule,\n ErrorCode,\n ErrorLocation,\n ErrorMessageResource,\n getCheckoutState,\n ICheckoutError,\n ICheckoutState\n} from '@msdyn365-commerce/global-state/';\n\n// eslint-disable-next-line @typescript-eslint/no-extraneous-class -- create global class\nexport class CheckoutErrors {\n public static readonly ActionError: ICheckoutError = {\n errorCode: ErrorCode.ActionError,\n errorMessageResource: ErrorMessageResource.checkoutTimeoutErrorMessage,\n errorLocation: ErrorLocation.Checkout\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_BlockedLoyaltyCard: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_BlockedLoyaltyCard,\n errorMessageResource: ErrorMessageResource.blockedLoyaltyCardErrorMessage,\n errorLocation: ErrorLocation.CheckoutLoyalty\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_CustomerAccountLimitSignDifferentFromAmountDue: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountLimitSignDifferentFromAmountDue,\n errorMessageResource: ErrorMessageResource.customerAccountLimitSignDifferentFromAmountDueErrorMessage,\n errorLocation: ErrorLocation.CheckoutCustomerAccountPayment\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsAvailableCreditLimit: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsAvailableCreditLimit,\n errorMessageResource: ErrorMessageResource.customerAccountPaymentExceedsAvailableCreditLimitErrorMessage,\n errorLocation: ErrorLocation.Checkout\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsCustomerAccountFloorLimit: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsCustomerAccountFloorLimit,\n errorMessageResource: ErrorMessageResource.customerAccountPaymentExceedsCustomerAccountFloorLimitErrorMessage,\n errorLocation: ErrorLocation.CheckoutCustomerAccountPayment\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsTotalAmountForCarryOutAndReturnItems: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsTotalAmountForCarryOutAndReturnItems,\n errorMessageResource: ErrorMessageResource.customerAccountPaymentExceedsTotalAmountForCarryOutAndReturnItemsErrorMessage,\n errorLocation: ErrorLocation.CheckoutCustomerAccountPayment\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentForCustomerWithoutAllowOnAccount: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentForCustomerWithoutAllowOnAccount,\n errorMessageResource: ErrorMessageResource.customerAccountPaymentForCustomerWithoutAllowOnAccountErrorMessage,\n errorLocation: ErrorLocation.CheckoutCustomerAccountPayment\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentNotAllowedForOpenInvoices: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentNotAllowedForOpenInvoices,\n errorMessageResource: ErrorMessageResource.customerAccountPaymentNotAllowedForOpenInvoicesErrorMessage,\n errorLocation: ErrorLocation.CheckoutCustomerAccountPayment\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_FraudRisk: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_FraudRisk,\n errorMessageResource: ErrorMessageResource.fraudRiskErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_GiftCardBalanceInquiryFailed: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_GiftCardBalanceInquiryFailed,\n errorMessageResource: ErrorMessageResource.giftCardBalanceInquiryFailedErrorMessage,\n errorLocation: ErrorLocation.CheckoutGiftCard\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_GiftCardCurrencyMismatch: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_GiftCardCurrencyMismatch,\n errorMessageResource: ErrorMessageResource.giftCardCurrencyMismatchErrorMessage,\n errorLocation: ErrorLocation.CheckoutGiftCard\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion,\n errorMessageResource: ErrorMessageResource.invalidCartVersionErrorMessage,\n errorLocation: ErrorLocation.Checkout\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_InvalidLoyaltyCardNumber: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_InvalidLoyaltyCardNumber,\n errorMessageResource: ErrorMessageResource.invalidLoyaltyCardNumberErrorMessage,\n errorLocation: ErrorLocation.CheckoutLoyalty\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_InvalidPaymentRequest: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_InvalidPaymentRequest,\n errorMessageResource: ErrorMessageResource.invalidPaymentRequestErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_InvalidPaymentRequest_Console: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_InvalidPaymentRequest,\n errorMessageResource: ErrorMessageResource.invalidPaymentRequestConsoleErrorMessage,\n errorLocation: ErrorLocation.Console\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_MissingRequiredCartTenderLines: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_MissingRequiredCartTenderLines,\n errorMessageResource: ErrorMessageResource.missingRequiredCartTenderLinesErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_MultipleCustomerAccountPaymentsNotAllowed: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_MultipleCustomerAccountPaymentsNotAllowed,\n errorMessageResource: ErrorMessageResource.multipleCustomerAccountPaymentsNotAllowedErrorMessage,\n errorLocation: ErrorLocation.CheckoutCustomerAccountPayment\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_NoMoreThanOneLoyaltyTender: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_NoMoreThanOneLoyaltyTender,\n errorMessageResource: ErrorMessageResource.noMoreThanOneLoyaltyTenderErrorMessage,\n errorLocation: ErrorLocation.CheckoutLoyalty\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_NoResponseFromGatewayForGiftCardBalanceInquiry: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_NoResponseFromGatewayForGiftCardBalanceInquiry,\n errorMessageResource: ErrorMessageResource.noResponseFromGatewayForGiftCardBalanceInquiryErrorMessage,\n errorLocation: ErrorLocation.CheckoutGiftCard\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_NoTenderLoyaltyCard: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_NoTenderLoyaltyCard,\n errorMessageResource: ErrorMessageResource.noTenderLoyaltyCardErrorMessage,\n errorLocation: ErrorLocation.CheckoutLoyalty\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_NotEnoughRewardPoints: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_NotEnoughRewardPoints,\n errorMessageResource: ErrorMessageResource.notEnoughRewardPointsErrorMessage,\n errorLocation: ErrorLocation.CheckoutLoyalty\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_PaymentAlreadyVoided: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_PaymentAlreadyVoided,\n errorMessageResource: ErrorMessageResource.paymentAlreadyVoidedErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_PaymentAmountExceedsGiftBalance: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_PaymentAmountExceedsGiftBalance,\n errorMessageResource: ErrorMessageResource.paymentAmountExceedsGiftBalanceErrorMessage,\n errorLocation: ErrorLocation.CheckoutGiftCard\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_PaymentRequiresMerchantProperties: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_PaymentRequiresMerchantProperties,\n errorMessageResource: ErrorMessageResource.paymentRequiresMerchantPropertiesErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_PaymentRequiresMerchantProperties_Console: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_PaymentRequiresMerchantProperties,\n errorMessageResource: ErrorMessageResource.paymentRequiresMerchantPropertiesConsoleErrorMessage,\n errorLocation: ErrorLocation.Console\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_PaymentUsingUnauthorizedAccount: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_PaymentUsingUnauthorizedAccount,\n errorMessageResource: ErrorMessageResource.paymentUsingUnauthorizedAccountErrorMessage,\n errorLocation: ErrorLocation.CheckoutCustomerAccountPayment\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_RefundAmountMoreThanAllowed: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_RefundAmountMoreThanAllowed,\n errorMessageResource: ErrorMessageResource.refundAmountMoreThanAllowedErrorMessage,\n errorLocation: ErrorLocation.CheckoutLoyalty\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePayment: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePayment,\n errorMessageResource: ErrorMessageResource.unableToAuthorizePaymentErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardAdditionalContextRequired: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardAdditionalContextRequired,\n errorMessageResource: ErrorMessageResource.unableToAuthorizePaymentCardAdditionalContextRequiredErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardTypeMissingOrNotSupported: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardTypeMissingOrNotSupported,\n errorMessageResource: ErrorMessageResource.unableToAuthorizePaymentCardTypeMissingOrNotSupportedErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_UnableToCancelPayment: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_UnableToCancelPayment,\n errorMessageResource: ErrorMessageResource.unableToCancelPaymentErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_UnableToReadCardTokenInfo: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_UnableToReadCardTokenInfo,\n errorMessageResource: ErrorMessageResource.unableToReadCardTokenInfoErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_UnableToRetrieveCardPaymentAcceptResult: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_UnableToRetrieveCardPaymentAcceptResult,\n errorMessageResource: ErrorMessageResource.unableToRetrieveCardPaymentAcceptResultErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly checkoutErrorsList: ICheckoutError[] = [\n CheckoutErrors.ActionError,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_BlockedLoyaltyCard,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountLimitSignDifferentFromAmountDue,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsAvailableCreditLimit,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsCustomerAccountFloorLimit,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsTotalAmountForCarryOutAndReturnItems,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentForCustomerWithoutAllowOnAccount,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentNotAllowedForOpenInvoices,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_FraudRisk,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_GiftCardBalanceInquiryFailed,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_GiftCardCurrencyMismatch,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_InvalidLoyaltyCardNumber,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_InvalidPaymentRequest,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_InvalidPaymentRequest_Console,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_MissingRequiredCartTenderLines,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_MultipleCustomerAccountPaymentsNotAllowed,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_NoMoreThanOneLoyaltyTender,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_NoResponseFromGatewayForGiftCardBalanceInquiry,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_NoTenderLoyaltyCard,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_NotEnoughRewardPoints,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_PaymentAlreadyVoided,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_PaymentAmountExceedsGiftBalance,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_PaymentRequiresMerchantProperties,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_PaymentRequiresMerchantProperties_Console,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_PaymentUsingUnauthorizedAccount,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_RefundAmountMoreThanAllowed,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePayment,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardAdditionalContextRequired,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardTypeMissingOrNotSupported,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_UnableToCancelPayment,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_UnableToReadCardTokenInfo,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_UnableToRetrieveCardPaymentAcceptResult\n ];\n}\n\nexport async function setCheckoutErrors(\n errorCode: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n resources: any,\n isExpressCheckoutApplied: boolean,\n ctx: IActionContext,\n apiError?: string | undefined\n): Promise<void> {\n let clientCheckoutError: ICheckoutError | undefined;\n const consoleCheckoutErrors: ICheckoutError[] = [];\n\n const checkoutState: ICheckoutState = await getCheckoutState(ctx).catch((error: Error) => {\n ctx.telemetry.exception(error);\n throw error;\n });\n\n // find the checkout errors\n for (const checkoutError of CheckoutErrors.checkoutErrorsList) {\n if (errorCode === checkoutError.errorCode) {\n if (checkoutError.errorLocation === ErrorLocation.Console) {\n const consoleCheckoutError: ICheckoutError = {\n errorCode: checkoutError.errorCode,\n errorMessageResource: checkoutError.errorMessageResource,\n errorLocation: checkoutError.errorLocation\n };\n consoleCheckoutErrors.push(consoleCheckoutError);\n } else {\n if (clientCheckoutError) {\n ctx.telemetry.exception(new Error('Invalid number of client checkout errors.'));\n throw new Error('Invalid number of client checkout errors.');\n } else {\n clientCheckoutError = {\n errorCode: checkoutError.errorCode,\n errorMessageResource: checkoutError.errorMessageResource,\n errorLocation: checkoutError.errorLocation\n };\n }\n }\n }\n }\n\n // log the console checkout errors\n for (const consoleCheckoutError of consoleCheckoutErrors) {\n consoleCheckoutError.errorMessage = getCheckoutErrorMessage(resources, consoleCheckoutError.errorMessageResource!, apiError!);\n console.log(consoleCheckoutError.errorMessage);\n }\n\n // handle the client checkout error\n if (clientCheckoutError) {\n clientCheckoutError.errorMessage = getCheckoutErrorMessage(resources, clientCheckoutError.errorMessageResource!, apiError!);\n\n if (isExpressCheckoutApplied && clientCheckoutError.errorLocation === ErrorLocation.CheckoutPaymentInstrument) {\n clientCheckoutError.errorLocation = ErrorLocation.Checkout;\n }\n\n await checkoutState.updateCheckoutError({ newCheckoutError: clientCheckoutError });\n await checkoutState.updateShouldFocusOnCheckoutError({ newShouldFocusOnCheckoutError: true });\n } else {\n // if could not map to any checkout error(s), show the API error message over generic error\n if (consoleCheckoutErrors.length === 0) {\n const genericError = {\n errorLocation: ErrorLocation.Checkout\n };\n if (apiError) {\n genericError['errorMessage'] = apiError;\n } else {\n genericError['errorMessage'] = resources.genericErrorMessage;\n }\n\n await checkoutState.updateCheckoutError({ newCheckoutError: genericError });\n await checkoutState.updateShouldFocusOnCheckoutError({ newShouldFocusOnCheckoutError: true });\n }\n }\n}\n\nexport async function focusOnCheckoutError(checkoutErrorRef: React.RefObject<HTMLElement>, ctx: IActionContext): Promise<void> {\n const checkoutState: ICheckoutState = await getCheckoutState(ctx).catch((error: Error) => {\n ctx.telemetry.exception(error);\n throw error;\n });\n\n checkoutErrorRef.current && checkoutErrorRef.current.scrollIntoView();\n\n await checkoutState.updateCheckoutErrorFocus({ newCheckoutErrorFocus: CheckoutModule.None });\n await checkoutState.updateShouldFocusOnCheckoutError({ newShouldFocusOnCheckoutError: false });\n}\n\nexport async function setCheckoutErrorFocus(checkoutModuleId: string, ctx: IActionContext): Promise<void> {\n const checkoutState: ICheckoutState = await getCheckoutState(ctx).catch((error: Error) => {\n ctx.telemetry.exception(error);\n throw error;\n });\n\n for (const checkoutModule of Object.keys(CheckoutModule)) {\n if (checkoutModuleId.includes(CheckoutModule[checkoutModule])) {\n await checkoutState.updateCheckoutErrorFocus({ newCheckoutErrorFocus: CheckoutModule[checkoutModule] });\n return;\n }\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction getCheckoutErrorMessage(resources: any, errorMessageResource: ErrorMessageResource, errorMessageFromAPI: string): string {\n const errorResource = Object.keys(resources).find(resource => resource === errorMessageResource);\n // return API error when error resource string is not found in checkout definition file\n return errorResource !== undefined ? resources[errorResource] : errorMessageFromAPI;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n CacheType,\n createObservableDataAction,\n IAction,\n IActionContext,\n IActionInput,\n IAny,\n ICommerceApiSettings,\n ICreateActionContext,\n IGeneric\n} from '@msdyn365-commerce/core';\nimport { buildCacheKey } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { CheckoutState } from './checkout-state';\n\n/**\n * CheckoutState - action input.\n */\nexport class CheckoutStateInput implements IActionInput {\n private readonly apiSettings: ICommerceApiSettings;\n\n constructor(apiSettings: ICommerceApiSettings) {\n this.apiSettings = apiSettings;\n }\n\n public getCacheKey = () => buildCacheKey('CheckoutState', this.apiSettings);\n\n public getCacheObjectType = () => 'CheckoutState';\n\n public dataCacheType = (): CacheType => 'request';\n}\n\n/**\n * CheckoutState - action.\n * @param input\n * @param ctx\n */\nexport async function checkoutStateAction(input: CheckoutStateInput, ctx: IActionContext): Promise<CheckoutState> {\n return new CheckoutState();\n}\n\n/**\n * CheckoutState - create new input for create action.\n * @param inputData\n */\nconst createInput = (inputData: ICreateActionContext<IGeneric<IAny>>): IActionInput => {\n return new CheckoutStateInput(inputData.requestContext.apiSettings);\n};\n\n/**\n * CheckoutState - create action.\n */\nexport const checkoutStateActionDataAction = createObservableDataAction<CheckoutState>({\n action: <IAction<CheckoutState>>checkoutStateAction,\n input: createInput\n});\n\nexport default checkoutStateActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport { Address, GiftCard, Note, TenderLine, TokenizedPaymentCard } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { action, computed, observable } from 'mobx';\n\n/**\n * State information related to what is needed to succesfully perform a checkout.\n */\nexport class CheckoutState {\n @observable private _tokenizedPaymentCard: TokenizedPaymentCard | undefined;\n\n @computed public get tokenizedPaymentCard(): Readonly<TokenizedPaymentCard> | undefined {\n return this._tokenizedPaymentCard;\n }\n\n @observable private _tenderLine: TenderLine | undefined;\n\n @computed public get tenderLine(): Readonly<TenderLine> | undefined {\n return this._tenderLine;\n }\n\n @observable private _billingAddress: Address | undefined;\n\n @computed public get billingAddress(): Readonly<Address> | undefined {\n return this._billingAddress;\n }\n\n @observable private _shippingAddress: Address | undefined;\n\n @computed public get shippingAddress(): Readonly<Address> | undefined {\n return this._shippingAddress;\n }\n\n @observable private _cardPrefix: string | undefined;\n\n @computed public get cardPrefix(): Readonly<string> | undefined {\n return this._cardPrefix;\n }\n\n @observable private _giftCards: GiftCard[] = [];\n\n @computed public get giftCards(): readonly GiftCard[] {\n return this._giftCards;\n }\n\n @observable private _giftCardExtends: IGiftCardExtend[] = [];\n\n @computed public get giftCardExtends(): readonly IGiftCardExtend[] {\n return this._giftCardExtends;\n }\n\n @observable private _loyaltyCardNumber?: string;\n\n @computed public get loyaltyCardNumber(): Readonly<string> | undefined {\n return this._loyaltyCardNumber;\n }\n\n @observable private _loyaltyAmount: number = 0;\n\n @computed public get loyaltyAmount(): Readonly<number> | number {\n return this._loyaltyAmount;\n }\n\n @observable private _guestCheckoutEmail: string = '';\n @observable private _customerReference: string = '';\n @observable private _customerRequisition: string = '';\n @observable private _note: Note = {};\n\n @computed public get guestCheckoutEmail(): Readonly<string> | string {\n return this._guestCheckoutEmail;\n }\n\n @computed public get customerReference(): Readonly<string> | string {\n return this._customerReference;\n }\n\n @computed public get customerRequisition(): Readonly<string> | string {\n return this._customerRequisition;\n }\n\n @computed public get note(): Readonly<Note> | Note[] {\n return this._note;\n }\n\n @observable private _isTermsAndConditionAccepted: boolean = false;\n\n @computed public get isTermsAndConditionAccepted(): Readonly<boolean> | boolean {\n return this._isTermsAndConditionAccepted;\n }\n\n @observable private _customerAccountAmount: number = 0;\n\n @computed public get customerAccountAmount(): Readonly<number> | number {\n return this._customerAccountAmount;\n }\n\n @action\n public updateTokenizedPaymentCard(newTokenizedPaymentCard: TokenizedPaymentCard): void {\n this._tokenizedPaymentCard = newTokenizedPaymentCard;\n }\n\n @action\n public updateTenderLine(newTenderLine: TenderLine | undefined): void {\n this._tenderLine = newTenderLine;\n }\n\n @action\n public updateShippingAddress(newShippingAddress: Address): void {\n this._shippingAddress = newShippingAddress;\n }\n\n @action\n public updateBillingAddress(newBillingAddress: Address): void {\n this._billingAddress = newBillingAddress;\n }\n\n @action\n public updateCardPrefix(newCardPrefix: string): void {\n this._cardPrefix = newCardPrefix;\n }\n\n @action\n public removeGiftCard(giftCardNumber: string): void {\n this._giftCards = this._giftCards.filter(giftCard => giftCard.Id !== giftCardNumber);\n }\n\n @action\n public removeGiftCardExtend(giftCardNumber: string): void {\n this._giftCardExtends = this._giftCardExtends.filter(giftCard => giftCard.Id !== giftCardNumber);\n }\n\n @action\n public addGiftCard(giftCard: GiftCard): void {\n this._giftCards = [giftCard, ...this._giftCards];\n }\n\n @action\n public addGiftCardExtend(giftCard: IGiftCardExtend): void {\n this._giftCardExtends = [giftCard, ...this._giftCards];\n }\n\n @action\n public updateLoyaltyCardNumber(newLoyaltyCardNumber: string): void {\n this._loyaltyCardNumber = newLoyaltyCardNumber;\n }\n\n @action\n public updateLoyaltyAmount(newAmount: number): void {\n this._loyaltyAmount = newAmount;\n }\n\n @action\n public updateGuestCheckoutEmail(\n newGuestCheckoutEmail: string,\n customerReference: string,\n customerRequisition: string,\n note: Note\n ): void {\n this._guestCheckoutEmail = newGuestCheckoutEmail;\n this._customerReference = customerReference;\n this._customerRequisition = customerRequisition;\n this._note = note;\n }\n\n @action\n public updateTermsAndConditionsAcceptance(newIsTermsAndConditionAccepted: boolean): void {\n this._isTermsAndConditionAccepted = newIsTermsAndConditionAccepted;\n }\n\n @action\n public updateCustomerAccountAmount(newAmount: number): void {\n this._customerAccountAmount = newAmount;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IModule } from '@msdyn365-commerce/core';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport isMatch from 'lodash/isMatch';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { getModuleStates, updateModuleStates } from './module-state';\nimport { IModuleState, IModuleStateManager, IModuleStateProps, IModuleStates } from './module-state.data';\n\nexport interface IProps extends IModule, IModuleStateProps {\n enableControl?: boolean;\n}\n\nconst sectionContainerModuleId = 'section-container';\nconst paymentInstrumentModuleId = 'payment-instrument';\n\nconst withModuleState = <P extends IProps>(WrappedComponent: React.ComponentType<P>): React.ComponentType<P> => {\n /**\n *\n * ModuleState component.\n * @extends {React.Component<P>}\n */\n @observer\n class ModuleState extends React.Component<P> {\n constructor(props: P) {\n super(props);\n this.initializeState();\n }\n\n public shouldComponentUpdate(nextProps: IModuleStateProps): boolean {\n if (this.props === nextProps) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | null {\n const { id } = this.props;\n return <WrappedComponent {...this.props} moduleState={this.getModuleStateManager(id)} />;\n }\n\n private readonly initializeState = (): void => {\n const { id, typeName, context } = this.props;\n const states = getModuleStates(context.actionContext);\n if (!states) {\n this.props.telemetry.error('withModuleState initializeState() - states not found');\n return;\n }\n\n if (states[id]) {\n // State has been initialized\n return;\n }\n\n updateModuleStates(\n {\n ...states,\n [id]: {\n id,\n typeName,\n hasInitialized: false,\n hasError: false,\n isRequired: true,\n isCancellable: true,\n isSubmitContainer: false,\n status: undefined,\n childIds: []\n }\n },\n context.actionContext\n );\n };\n\n /**\n * GetModuleStateManager\n * Get module state manager by id.\n * @param id\n */\n private readonly getModuleStateManager = (id: string): IModuleStateManager => {\n const moduleState = this.get()[id];\n return {\n ...moduleState!,\n hasInitialized: this.validate(id, { hasInitialized: true }, true), // All has initialized is initialized\n hasError: this.validate(id, { hasError: true }), // Partial has error is error\n isReady: this.validate(id, { status: 'ready' }, true, true), // All ready is ready (exclued disabled and skipped)\n isUpdating: this.validate(id, { status: 'updating' }), // Partial updating is updating\n isPending: this.validate(id, { status: 'pending' }), // Partial pending is pending\n isSkipped: this.validate(id, { status: 'skipped' }, true, true), // All skipped is skipped (exclued disabled)\n isDisabled: this.validate(id, { status: 'disabled' }, true), // All disabled is disabled\n isCancelAllowed: this.validate(id, { isCancellable: true }, true, true), // Partial not allowed is not allowed\n shouldSubmitContainer: this.validate(id, { isSubmitContainer: true }), // Partial submit is submit.\n hasExternalSubmitGroup: this.hasExternalSubmitGroup(),\n hasModuleState: this.hasModuleState(id),\n setIsRequired: (value: boolean): void => {\n this.update(id, { isRequired: value });\n },\n setIsCancellable: (value: boolean): void => {\n this.update(id, { isCancellable: value });\n },\n setIsSubmitContainer: (value: boolean): void => {\n this.update(id, { isSubmitContainer: value });\n },\n setHasError: (value: boolean): void => {\n this.update(id, { hasError: value });\n },\n onReady: (): void => {\n this.update(id, { status: 'ready' });\n },\n onUpdating: (): void => {\n this.update(id, { status: 'updating' });\n },\n onPending: (): void => {\n this.update(id, { status: 'pending' });\n },\n onSkip: (): void => {\n this.update(id, { status: 'skipped' });\n },\n onDisable: (): void => {\n this.update(id, { status: 'disabled' });\n },\n getModule: (moduleId: string): IModuleStateManager => this.getModuleStateManager(moduleId),\n getModuleByTypeName: (typeName: string): IModuleStateManager => this.getModuleStateManagerByTypeName(typeName),\n init: (options?: Partial<IModuleState>): void => {\n if (moduleState?.hasInitialized) {\n // State has been initialized\n return;\n }\n this.update(id, {\n hasInitialized: true,\n ...options\n });\n }\n };\n };\n\n /**\n * GetModuleStateManagerByTypeName\n * Get module state manager by type name.\n * @param typeName\n */\n private readonly getModuleStateManagerByTypeName = (typeName: string): IModuleStateManager => {\n const moduleStates = getModuleStates(this.props.context.actionContext);\n const moduleState = Object.values(moduleStates).find(_moduleState => _moduleState?.typeName === typeName);\n return this.getModuleStateManager((moduleState && moduleState.id) || '');\n };\n\n /**\n * Get\n * Get all module states.\n */\n private readonly get = (): IModuleStates => {\n return getModuleStates(this.props.context.actionContext);\n };\n\n /**\n * Update\n * Update module state.\n * @param id\n * @param value\n */\n private readonly update = (id: string, value: Partial<IModuleState>): void => {\n // Console.log('withModuleState - update', id, value);\n const modules = this.get();\n if (!modules[id]) {\n this.props.telemetry.error(`withModuleState update() - Module state with id ${id} is not found.`);\n return;\n }\n modules[id] = {\n ...modules[id]!,\n ...value\n };\n };\n\n private readonly _validateLeaf = (id: string, source: Partial<IModuleState>): boolean => {\n const modules = this.get();\n const module = modules[id];\n if (!module) {\n return false;\n }\n return isMatch(module, source);\n };\n\n private readonly _validateContainer = (\n id: string,\n source: Partial<IModuleState>,\n allMatched?: boolean,\n skipSkippableItem?: boolean\n ): boolean => {\n const modules = this.get();\n const module = modules[id];\n if (!module) {\n // Module doesn't has module state\n return !!allMatched;\n }\n\n if (skipSkippableItem && (module.status === 'disabled' || module.status === 'skipped')) {\n // Skip disabled or skipped modules\n return !!allMatched;\n }\n\n // It is leaf module\n if (!module.childIds || module.childIds.length === 0) {\n return this._validateLeaf(id, source);\n }\n\n let childIds = module.childIds;\n\n if (this.props.context.app.config.shouldEnableSinglePaymentAuthorizationCheckout) {\n // For new checkout flow, we bypass the isReady check for payment section container to enable the place order button.\n childIds = childIds.filter(childId => !this._isPaymentSectionContainer(childId));\n }\n\n // It is container module\n const method = allMatched ? 'every' : 'some';\n return childIds[method](childId => this._validateContainer(childId, source, allMatched, skipSkippableItem));\n };\n\n /**\n * Check if it is a section container with payment module.\n * @param moduleId -- The id of the module.\n * @returns If it is a section container with payment module.\n */\n private readonly _isPaymentSectionContainer = (moduleId: string): boolean => {\n if (!moduleId.includes(sectionContainerModuleId)) {\n return false;\n }\n\n const modules = this.get();\n const module = modules[moduleId];\n\n if (module && ArrayExtensions.hasElements(module.childIds.filter(childId => childId.includes(paymentInstrumentModuleId)))) {\n return true;\n }\n\n return false;\n };\n\n /**\n * Validate\n * Validate current module and all its child module match the provided condition.\n * @param id\n * @param source\n * @param allMatched\n * @param skipSkippableItem\n */\n private readonly validate = (\n id: string,\n source: Partial<IModuleState>,\n allMatched?: boolean,\n skipSkippableItem?: boolean\n ): boolean => {\n const modules = this.get();\n const module = modules[id];\n if (!module) {\n return false;\n }\n\n // It is leaf module\n if (!module.childIds || module.childIds.length === 0) {\n return this._validateLeaf(id, source);\n }\n\n // It is container module\n return this._validateContainer(id, source, allMatched, skipSkippableItem);\n };\n\n /**\n * HasExternalSubmitGroup\n * Module will use external submit group.\n */\n private readonly hasExternalSubmitGroup = (): boolean => {\n return !!this.props.enableControl;\n };\n\n /**\n * HasModuleState\n * Module is using module state manager.\n * @param id\n */\n private readonly hasModuleState = (id: string): boolean => {\n const modules = this.get();\n const module = modules[id];\n return !!module;\n };\n }\n\n return ModuleState;\n};\n\nexport default withModuleState;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CacheType, IActionContext, IActionInput } from '@msdyn365-commerce/core';\n\nimport { IModuleStates } from './module-state.data';\n\n/**\n * GetModulesInput.\n */\nexport class ModuleStatesCacheKey implements IActionInput {\n public getCacheKey = () => 'ModuleState';\n\n public getCacheObjectType = () => 'ModuleState';\n\n public dataCacheType = (): CacheType => 'none';\n}\n\nexport function getModuleStates(ctx: IActionContext): IModuleStates {\n const cacheKey = new ModuleStatesCacheKey();\n\n let moduleStates = <IModuleStates>ctx.get<IModuleStates>(cacheKey.getCacheObjectType(), cacheKey.getCacheKey());\n if (moduleStates) {\n return moduleStates;\n }\n ctx.update(cacheKey, {});\n moduleStates = <IModuleStates>ctx.get<IModuleStates>(cacheKey.getCacheObjectType(), cacheKey.getCacheKey());\n return moduleStates;\n}\n\nexport function updateModuleStates(value: IModuleStates, ctx: IActionContext): void {\n const cacheKey = new ModuleStatesCacheKey();\n ctx.update(cacheKey, value);\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\n/**\n * EnabledPaymentsForOBO enum.\n */\n export enum EnabledPaymentsForOBO {\n OnCustomerAccount = 1,\n ExpressPayment = 0,\n Loyalty = 0,\n GiftCard = 0,\n PaymentInstrument = 0,\n ApplePay = 0\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nexport * from './add-payment-form';\nexport * from './error';\nexport * from './iframe';\nexport * from './payment-instrument-message';\nexport * from './waiting';\nexport * from './with-visibility-observer';\nexport * from './interfaces';\nexport * from './place-order';\nexport * from './empty-active-cart';\nexport * from './country-codes';\nexport { CartCheckout } from './checkout';\nexport * from './get-checkout-return-url';\n\n/**\n * AsyncResultStatusCode.\n */\nexport enum AsyncResultStatusCode {\n LOADING = 'LOADING',\n SUCCESS = 'SUCCESS',\n FAILED = 'FAILED'\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\n/**\n * The payment error.\n */\nexport interface IPaymentError {\n title: string;\n message: string;\n className?: string;\n}\n\n/**\n * The payment error.\n * @param param0 - First param.\n * @param param0.title - Title.\n * @param param0.message - Message.\n * @param param0.className - ClassName.\n * @returns React node.\n */\nexport const ErrorComponent: React.FC<IPaymentError> = ({ title, message, className = 'ms-checkout-payment-instrument' }) => (\n <div className={`${className}__error`} role='alert' aria-live='assertive'>\n <p className={`${className}__error-title`}>{title}</p>\n <p className={`${className}__error-message`}>{message}</p>\n </div>\n);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Waiting } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\n/**\n * Payment waiting props.\n */\nexport interface IPaymentWaitingProps {\n message: string;\n className?: string;\n}\n\n/**\n * Payment waiting.\n * @param param0 - First in param.\n * @param param0.message - Message.\n * @param param0.className - ClassName.\n * @returns React node.\n */\nexport const WaitingComponent: React.FC<IPaymentWaitingProps> = ({ message, className = 'ms-checkout-payment-instrument' }) => (\n <div className={`${className}__loading-background`}>\n <Waiting />\n <span className={`${className}__loading-message`}>{message}</span>\n </div>\n);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IImageProps, IImageSettings, Image, IModule } from '@msdyn365-commerce/core';\nimport {\n Address,\n CartLine,\n LineDeliverySpecification,\n PickupTimeslotAvailability,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nexport interface ICheckoutPickupGroupKey {\n pickupStoreId: string;\n deliveryMode: string;\n}\n\nexport interface ICheckoutPickupGroup extends ICheckoutPickupGroupKey {\n pickupModeName: string;\n storeName: string;\n pickupAddress?: Address;\n availabilityState: PickupTimeslotAvailabilityState;\n groupErrorMessage?: string;\n dateErrorMessage?: string;\n timeslotErrorMessage?: string;\n lineDeliverySpecs: LineDeliverySpecification[];\n cartLines: ICartLineWithProduct[];\n\n availableDates: Date[];\n availableTimeslots: PickupTimeslotAvailability[];\n\n selectedDate?: Date;\n selectedTimeslot?: PickupTimeslotAvailability;\n}\n\nexport enum PickupTimeslotAvailabilityState {\n None,\n Available,\n NotDefined,\n NotAvailable // All slots occupied\n}\n\nexport interface ICartLineWithProduct {\n cartLine: CartLine;\n product?: SimpleProduct;\n}\n\nexport interface ICheckoutPickupGroupViewProps {\n moduleProps: IModule;\n\n pickupGroupContainer: INodeProps;\n dateTimeslotContainer: INodeProps;\n\n pickupStoreId: string;\n pickupModeName: string;\n deliveryMode: string;\n\n groupDivider: React.ReactNode;\n groupHeader: React.ReactNode;\n groupErrorMessage: React.ReactNode;\n cartLineImages: React.ReactNode;\n pickupDateDropdown: React.ReactNode;\n pickupTimeslotDropdown: React.ReactNode;\n\n selectedDateTimeslot: React.ReactNode;\n pickupAddress: React.ReactNode;\n}\n\nexport interface ICheckoutPickupErrorProps {\n errorMessage?: string;\n}\n\nexport const CheckoutPickupError: React.FC<ICheckoutPickupErrorProps> = ({ errorMessage }) => {\n if (!errorMessage) {\n return null;\n }\n\n return (\n <span className='msc-alert msc-alert-noborder msc-alert-danger'>\n <span className='msi-exclamation-triangle' aria-hidden='true' />\n <span>{errorMessage}</span>\n </span>\n );\n};\n\nexport interface ICheckoutPickupGroupHeaderProps {\n moduleClassName: string;\n storeInfo: string;\n items: string;\n}\n\nexport const CheckoutPickupGroupHeader: React.FC<ICheckoutPickupGroupHeaderProps> = ({ moduleClassName, storeInfo, items }) => {\n return (\n <div className={`${moduleClassName}__group-header`}>\n <div className={`${moduleClassName}__group-header-main`}>{storeInfo}</div>\n <div className={`${moduleClassName}__group-header-item`}>{items}</div>\n </div>\n );\n};\n\nexport interface ICheckoutPickupTimeslotInfoProps {\n moduleClassName: string;\n title: string;\n content: string;\n}\n\nexport const CheckoutPickupTimeslotInfo: React.FC<ICheckoutPickupTimeslotInfoProps> = ({ moduleClassName, title, content }) => {\n return (\n <div className={`${moduleClassName}__group-selected`}>\n <div className={`${moduleClassName}__group-selected-title`}>{title}</div>\n <div className={`${moduleClassName}__group-selected-content`}>{content}</div>\n </div>\n );\n};\n\nexport interface ICheckoutPickupAddressProps {\n moduleClassName: string;\n title: string;\n address?: Address;\n}\n\nexport const CheckoutPickupAddress: React.FC<ICheckoutPickupAddressProps> = ({ moduleClassName, title, address }) => {\n if (!address) {\n return null;\n }\n\n return (\n <div className={`${moduleClassName}__group-address`}>\n <div className={`${moduleClassName}__group-address-header`}>{title}</div>\n {address.Name && <span className={`${moduleClassName}__group-address-name`}>{address.Name}</span>}\n <>\n {address.Street && <span className={`${moduleClassName}__group-address-street`}>{address.Street}</span>}\n {address.City && <span className={`${moduleClassName}__group-address-city`}>{address.City}</span>}\n {address.State && <span className={`${moduleClassName}__group-address-state`}>{`, ${address.State}`}</span>}\n {address.County && <span className={`${moduleClassName}__group-address-county`}>{`, ${address.County}`}</span>}\n {address.ZipCode && <span className={`${moduleClassName}__group-address-zipcode`}>{` ${address.ZipCode}`}</span>}\n {address.ThreeLetterISORegionName && (\n <span className={`${moduleClassName}__group-address-threeletterisoregionname`}>\n {` ${address.ThreeLetterISORegionName}`}\n </span>\n )}\n </>\n </div>\n );\n};\n\nexport interface ICheckoutPickupCartLineInfo {\n lineId: string;\n imageProps: IImageProps;\n quantity: number;\n}\n\nexport interface ICheckoutPickupCartLinesProps {\n moduleClassName: string;\n cartLines: ICheckoutPickupCartLineInfo[];\n}\n\nexport const CheckoutPickupCartLines: React.FC<ICheckoutPickupCartLinesProps> = ({ moduleClassName, cartLines }) => {\n if (!ArrayExtensions.hasElements(cartLines)) {\n return null;\n }\n return (\n <div className={`${moduleClassName}__group-lines`}>\n {cartLines.map(prop => {\n const showQty = prop.quantity > 1;\n let className = `${moduleClassName}__group-product-image`;\n if (showQty) {\n className = classnames(className, ' product-image-wide');\n }\n return (\n <div className={className} key={prop.lineId}>\n <Image {...prop.imageProps} />\n {showQty && <div className={`${moduleClassName}__group-line-quantity`}>{prop.quantity}</div>}\n </div>\n );\n })}\n </div>\n );\n};\n\nexport const DefaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=108&h=108&q=80&m=6&f=jpg\"', w: 108, h: 108 },\n lg: { q: 'w=108&h=108&q=80&m=6&f=jpg', w: 108, h: 108 },\n xl: { q: 'w=108&h=108&q=80&m=6&f=jpg', w: 108, h: 108 }\n },\n lazyload: true,\n quality: 80\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { getCartState, getCheckoutState } from '@msdyn365-commerce/global-state';\n\nexport const EmptyActiveCartInvoice = async (ctx: IActionContext): Promise<void> => {\n let cartState;\n let checkoutState;\n const lineItemIdsToRemove = [];\n\n try {\n cartState = await getCartState(ctx);\n checkoutState = await getCheckoutState(ctx);\n } catch (error) {\n throw error;\n }\n\n if (!cartState || !cartState.cart) {\n throw new Error('Fail to fetch active cart');\n }\n\n if (!checkoutState || !checkoutState.checkoutCart) {\n throw new Error('Fail to fetch checkoutCart cart');\n }\n\n const activeCart = cartState.cart;\n const checkoutCart = checkoutState.checkoutCart.cart;\n if (checkoutState.checkoutCart.hasInvoiceLine) {\n for (const activeCartLine of activeCart.CartLines || []) {\n for (const checkoutCartLine of checkoutCart.CartLines || []) {\n if (activeCartLine.LineId && activeCartLine.LineId === checkoutCartLine.LineId) {\n lineItemIdsToRemove.push(activeCartLine.LineId);\n }\n }\n }\n\n try {\n console.log('Removing invoice cart lines');\n await cartState.removeCartLines({ cartLineIds: lineItemIdsToRemove });\n await cartState.removeAllPromoCodes({});\n } catch (error) {\n throw error;\n }\n }\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getUrlSync, IActionContext } from '@msdyn365-commerce/core';\nimport { ICheckoutState } from '@msdyn365-commerce/global-state';\nimport { SalesOrder, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { CartCheckout } from './checkout';\nimport { EmptyActiveCart } from './empty-active-cart';\nimport { EmptyActiveCartInvoice } from './empty-active-cart-invoice';\n\n/**\n * Known action error failure states\n */\nconst enum ActionErrorStatus {\n Timeout = 'Timeout',\n HookTimeout = 'Hook Timeout',\n ServiceUnavailable = 'Service Unavailable'\n}\n\nexport const PlaceOrder = async (\n ctx: IActionContext,\n checkoutState: ICheckoutState | undefined,\n orderedProducts: SimpleProduct[] | undefined,\n redirect: boolean,\n updatedCartVersion?: number,\n isPaymentVerificationRedirection?: boolean\n) => {\n return new Promise(async (resolve: () => void, reject: (reason?: Error) => void) => {\n ctx.telemetry.information('Checkout place-order method is triggered.');\n\n let salesOrder: SalesOrder;\n\n // Proceed checkout\n try {\n salesOrder = await CartCheckout(ctx, updatedCartVersion, isPaymentVerificationRedirection);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error) {\n if (error.status === ActionErrorStatus.Timeout || error.status === ActionErrorStatus.ServiceUnavailable) {\n console.error('Error: Checkout failed due to timeout or service unavailable.');\n ctx.telemetry.information('Checkout emptyActiveCart is called.');\n await EmptyActiveCartInvoice(ctx);\n }\n reject(error);\n return;\n }\n\n // Remove purchased items from the active cart\n try {\n ctx.telemetry.information('Checkout emptyActiveCart is called.');\n await EmptyActiveCart(ctx);\n } catch (error) {\n reject(error);\n return;\n }\n\n if (redirect) {\n ctx.telemetry.information('Redirect to order confirmation page.');\n\n // Redirect to the order confirmation page\n const orderConfirmationUrl = getUrlSync('orderConfirmation', ctx) || '';\n if (!orderConfirmationUrl) {\n reject(new Error('Error: No orderConfirmationUrl'));\n return;\n }\n\n const separator = orderConfirmationUrl.includes('?') ? '&' : '?';\n const url = `${orderConfirmationUrl}${separator}transactionId=${salesOrder.Id}`;\n window.location.assign(url);\n } else {\n ctx.telemetry.information('Not redirect to order confirmation page.');\n\n if (checkoutState) {\n const result = await checkoutState.updateSalesOrder({\n newSalesOrder: salesOrder,\n newOrderedProducts: orderedProducts || []\n });\n\n if (result.status === 'FAILED') {\n reject(new Error('Error: Updating error state failed'));\n return;\n }\n } else {\n reject(new Error('Error: No checkout state'));\n return;\n }\n resolve();\n }\n });\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n// eslint-disable-next-line import/no-anonymous-default-export -- Existing code.\nexport default `\n .adyen-dropin {\n font-family: -apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif;\n font-weight: normal;\n font-size: 16px;\n line-height: 21px;\n margin-left: -7px;\n text-transform: none;\n }\n\n /* Card pannel */\n\n .adyen-checkout__payment-method--next-selected,\n .adyen-checkout__payment-method:last-child {\n background-color: #FFFFFF;\n }\n\n .adyen-checkout__payment-method__name {\n color: #1D1D1D;\n font-weight: normal;\n }\n\n .adyen-checkout__label__text--error,\n .adyen-checkout__helper-text,\n .adyen-checkout__label__text {\n color: #1D1D1D;\n font-size: 18px;\n line-height: 24px;\n padding-bottom: 4px;\n }\n\n .adyen-checkout__error-text {\n color: #A80000;\n font-size: 16px;\n line-height: 21px;\n }\n\n .adyen-checkout__input {\n background: white;\n box-shadow: none;\n border: none;\n border-radius: 0;\n box-shadow: none;\n color: #1D1D1D;\n height: 42px;\n padding: 5px 8px;\n }\n\n .adyen-checkout__input--focus,\n .adyen-checkout__input--focus:hover,\n .adyen-checkout__input:active,\n .adyen-checkout__input:active:hover,\n .adyen-checkout__input:focus,\n .adyen-checkout__input:focus:hover {\n border: 1px dashed #fff;\n outline: 1px dashed #000;\n box-shadow: none;\n }\n\n .adyen-checkout__input:hover {\n border: none;\n }\n\n .adyen-checkout__input--error,\n .adyen-checkout__input--error:hover,\n .adyen-checkout__input--invalid,\n .adyen-checkout__input--invalid:hover {\n border: none;\n border-left: 2px solid #A80000;\n color: #A80000;\n }\n\n .adyen-checkout__label--focused .adyen-checkout__label__text {\n color: inherit;\n }\n`;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Button } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { Iframe } from './iframe';\nimport defaultPaymentConnectorDropinStyle from './payment-instrument.dropin.style';\nimport defaultPaymentConnectorPaypalStyle from './payment-instrument.paypal.style';\nimport defaultPaymentConnectorStyle from './payment-instrument.style';\n\n/**\n * Interface for add payment form.\n */\nexport interface IAddPaymentFormProps {\n acceptPageUrl?: string;\n acceptPageContent?: string;\n iframeRef?: React.RefObject<Iframe>;\n canSubmit?: boolean;\n canCancel?: boolean;\n hasSelectedItem?: boolean;\n iFrameHeightOverride?: number;\n style?: string;\n requestUrlOrigin?: string;\n messageOrigin?: string;\n isFetchingPaymentConnector?: boolean;\n paymentStyleOverride?: string;\n className?: string;\n moduleName?: string;\n resources: {\n cancelButtonText: string;\n submitButtonText: string;\n iframeAriaLabel: string;\n };\n // eslint-disable-next-line @typescript-eslint/naming-convention -- For IFrame.\n onIFrameMessage?(event: MessageEvent): void;\n onSubmit?(): void;\n onCancel?(): void;\n}\n\n/**\n * AddPaymentForm SFC.\n * @param root0 - Root.\n * @param root0.acceptPageUrl - Accept page url.\n * @param root0.acceptPageContent - Accept page content.\n * @param root0.onSubmit - On submit.\n * @param root0.onCancel - On cancel.\n * @param root0.onIFrameMessage - On iFrame message.\n * @param root0.iframeRef - IFrame ref.\n * @param root0.canSubmit - Can submit.\n * @param root0.canCancel - Can cancel.\n * @param root0.iFrameHeightOverride - IFrame height override.\n * @param root0.requestUrlOrigin - Origin request url.\n * @param root0.messageOrigin - Message origin.\n * @param root0.isFetchingPaymentConnector - Is fetching payment connector.\n * @param root0.paymentStyleOverride - Payment style override.\n * @param root0.className - ClassName.\n * @param root0.moduleName - ModuleName.\n * @param root0.resources - Resources.\n * @param root0.resources.cancelButtonText - Cancel button text.\n * @param root0.resources.submitButtonText - Submit button text.\n * @param root0.resources.iframeAriaLabel - IFrame aria label.\n * @extends {React.FunctionComponent<IAddPaymentFormProps>}\n * @returns React nodes.\n */\nexport const AddPaymentFormComponent: React.FunctionComponent<IAddPaymentFormProps> = ({\n acceptPageUrl = '',\n acceptPageContent = '',\n onSubmit,\n onCancel,\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Existing name.\n onIFrameMessage,\n iframeRef,\n canSubmit,\n canCancel,\n iFrameHeightOverride,\n requestUrlOrigin,\n messageOrigin,\n isFetchingPaymentConnector,\n paymentStyleOverride,\n className = 'ms-checkout-payment-instrument',\n moduleName = 'checkout-payment-instrument',\n resources: { cancelButtonText, submitButtonText, iframeAriaLabel }\n}) => (\n <div className={classnames(`${className}__add`, { 'is-fetching': isFetchingPaymentConnector })}>\n <Iframe\n className={`${className}__add`}\n moduleName={moduleName}\n ref={iframeRef}\n iframeAriaLabel={iframeAriaLabel}\n displayContent={acceptPageContent}\n sourceUrl={acceptPageUrl}\n requestUrlOrigin={requestUrlOrigin}\n messageOrigin={messageOrigin}\n onIFrameMessage={onIFrameMessage}\n height={iFrameHeightOverride}\n css={\n paymentStyleOverride ??\n defaultPaymentConnectorStyle + defaultPaymentConnectorDropinStyle + defaultPaymentConnectorPaypalStyle\n }\n />\n {canSubmit && (\n <Button className={`${className}__btn-save`} title={submitButtonText} color='primary' onClick={onSubmit}>\n {submitButtonText}\n </Button>\n )}\n {canCancel && (\n <Button className={`${className}__btn-cancel`} title={cancelButtonText} color='secondary' onClick={onCancel}>\n {cancelButtonText}\n </Button>\n )}\n </div>\n);\n\nexport default React.memo(AddPaymentFormComponent);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/**\n * Payment connect post message type.\n */\nexport enum PaymentConnectorPostMessageType {\n CardPrefix = 'msax-cc-cardprefix',\n Error = 'msax-cc-error',\n Height = 'msax-cc-height',\n Result = 'msax-cc-result',\n Submit = 'msax-cc-submit',\n ExtraContext = 'msax-cc-extracontext',\n Redirect = 'msax-cc-redirect',\n Showoverlay = 'msax-cc-showoverlay',\n Hideoverlay = 'msax-cc-hideoverlay',\n ShippingAddress = 'msax-shipping-address',\n Amount = 'msax-cc-amount'\n}\n\n/**\n * Interface for payment connector post message.\n */\nexport interface IPaymentConnectorPostMessage {\n message: string;\n targetOrigin: string;\n}\n\n/**\n * Payment connector message.\n * @param data - Data with message.\n * @param messageType - Message type.\n * @returns Payment connector post message.\n */\nexport function paymentConnectorMessage(data: string, messageType: PaymentConnectorPostMessageType): IPaymentConnectorPostMessage {\n return {\n message: JSON.stringify({\n type: messageType,\n value: data\n }),\n targetOrigin: '*'\n };\n}\n\n/**\n * Payment connector extra context message.\n * @param data - The data.\n * @returns The payment connector post message.\n */\nexport function paymentConnectorExtraContextMessage(data: string): IPaymentConnectorPostMessage {\n return paymentConnectorMessage(data, PaymentConnectorPostMessageType.ExtraContext);\n}\n\n/**\n * Payment connector submit message.\n * @returns The payment connector post message.\n */\nexport function paymentConnectorSubmitMessage(): IPaymentConnectorPostMessage {\n return paymentConnectorMessage('true', PaymentConnectorPostMessageType.Submit);\n}\n\nexport function paymentConnectorAmountMessage(amount: number): IPaymentConnectorPostMessage {\n return paymentConnectorMessage(`${amount}`, PaymentConnectorPostMessageType.Amount);\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { getCheckoutState } from '@msdyn365-commerce/global-state';\nimport { checkoutAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport { getTenderTypesAsync, resolveCardTypesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\nimport {\n Address,\n CardPaymentAcceptResult,\n CardType,\n CartTenderLine,\n RetailOperation,\n SalesOrder,\n TenderType,\n TokenizedPaymentCard\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nexport const OPERATIONS = {\n PayCard: 201,\n PayGiftCertificate: 214,\n PayLoyalty: 207,\n PayCustomerAccount: 202\n};\n\nconst getCardTypeId = async (ctx: IActionContext, cardPrefix: string = ''): Promise<string | undefined> => {\n try {\n const response = await resolveCardTypesAsync({ callerContext: ctx }, cardPrefix, CardType.Unknown);\n if (response && response.length > 0) {\n return response[0].TypeId;\n }\n } catch (error) {\n ctx.telemetry.error('Call to resolveCardTypesAsync failed.', error);\n }\n return undefined;\n};\n\nconst findTenderIdTypeByOperationId = (tenderTypes: TenderType[], operationId: RetailOperation): string | undefined => {\n const matchedTenderType = tenderTypes.find(tenderType => tenderType.OperationId === operationId);\n if (matchedTenderType) {\n return matchedTenderType.TenderTypeId;\n }\n return;\n};\n\nconst roundNumber = (value: number) => Number(value.toFixed(2));\n\nasync function getLoyaltyTenderLine(\n ctx: IActionContext,\n LoyaltyCardId: string,\n Amount: number = 0,\n Currency: string = 'USD'\n): Promise<CartTenderLine> {\n const tenderTypes = await getTenderTypesAsync({ callerContext: ctx, queryResultSettings: {} }).catch(error => {\n throw error;\n });\n\n if (!tenderTypes) {\n throw new Error('Fail to get gift card tender line');\n }\n\n const TenderTypeId = findTenderIdTypeByOperationId(tenderTypes, OPERATIONS.PayLoyalty);\n return {\n // @ts-expect-error\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CartTenderLine',\n\n 'Amount@odata.type': '#Decimal',\n Currency,\n TenderTypeId,\n Amount,\n LoyaltyCardId\n };\n}\n\nasync function getGiftCardTenderLine(\n ctx: IActionContext,\n GiftCardId: string = '',\n Amount: number = 0,\n Currency: string = 'USD',\n tenderTypeId?: string,\n giftCardPin?: string,\n giftCardExpirationYear?: number,\n giftCardExpirationMonth?: number\n): Promise<CartTenderLine> {\n let TenderTypeId = tenderTypeId;\n\n if (!TenderTypeId) {\n const tenderTypes = await getTenderTypesAsync({ callerContext: ctx, queryResultSettings: {} }).catch(error => {\n throw error;\n });\n if (!tenderTypes) {\n throw new Error('Fail to get gift card tender line');\n }\n TenderTypeId = findTenderIdTypeByOperationId(tenderTypes, OPERATIONS.PayGiftCertificate);\n }\n\n const GiftCardPin = giftCardPin;\n const GiftCardExpirationYear = giftCardExpirationYear;\n const GiftCardExpirationMonth = giftCardExpirationMonth;\n return {\n // @ts-expect-error\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CartTenderLine',\n 'Amount@odata.type': '#Decimal',\n Currency,\n TenderTypeId,\n Amount,\n GiftCardId,\n GiftCardPin,\n GiftCardExpirationYear,\n GiftCardExpirationMonth\n };\n}\n\nasync function getCreditCardTenderLine(\n ctx: IActionContext,\n tokenizedPaymentCard: TokenizedPaymentCard,\n cardPrefix: string = '',\n Amount: number = 0,\n Currency: string = 'USD',\n billingAddress?: Address\n): Promise<CartTenderLine> {\n const tenderTypes = await getTenderTypesAsync({ callerContext: ctx, queryResultSettings: {} }).catch(error => {\n throw error;\n });\n\n let cartTypeId = tokenizedPaymentCard.CardTypeId;\n\n if (!cartTypeId) {\n cartTypeId = await getCardTypeId(ctx, cardPrefix);\n }\n\n if (!tenderTypes) {\n throw new Error('Fail to get card tender type');\n }\n\n if (!cartTypeId) {\n throw new Error('Fail to get card type id');\n }\n\n const TenderTypeId = tokenizedPaymentCard.TenderType ?? findTenderIdTypeByOperationId(tenderTypes, OPERATIONS.PayCard);\n const cardTenderLine: CartTenderLine = {\n // @ts-expect-error\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CartTenderLine',\n 'Amount@odata.type': '#Decimal',\n Currency,\n Amount,\n TenderTypeId,\n CardTypeId: cartTypeId\n };\n cardTenderLine.TokenizedPaymentCard = {\n ...tokenizedPaymentCard,\n CardTypeId: cartTypeId,\n\n // @ts-expect-error\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.TokenizedPaymentCard',\n House: tokenizedPaymentCard.House || 'N/A',\n ...(tokenizedPaymentCard.CardTokenInfo && {\n CardTokenInfo: {\n ...tokenizedPaymentCard.CardTokenInfo,\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CardTokenInfo'\n }\n }),\n ...(billingAddress && {\n Phone: billingAddress.Phone,\n Country: billingAddress.ThreeLetterISORegionName,\n Address1: billingAddress.Street,\n City: billingAddress.City,\n State: billingAddress.State,\n Zip: billingAddress.ZipCode\n })\n };\n\n return cardTenderLine;\n}\n\n/**\n * Get credit card tender line.\n * @param context - Action context.\n * @param amount - Due amount for credit card.\n * @param currency - Currency.\n * @param cardPaymentAcceptResult - CardPaymentAcceptResult.\n * @param billingAddress - BillingAddress.\n * @returns - The credit card tender line.\n */\nasync function getCreditCardTenderLineForSinglePaymentAuth(\n context: IActionContext,\n amount: number = 0,\n currency: string = 'USD',\n cardPaymentAcceptResult?: CardPaymentAcceptResult,\n billingAddress?: Address\n): Promise<CartTenderLine> {\n const tenderTypes = await getTenderTypesAsync({ callerContext: context, queryResultSettings: {} }).catch(error => {\n throw error;\n });\n\n const tenderTypeId = findTenderIdTypeByOperationId(tenderTypes, OPERATIONS.PayCard);\n\n if (cardPaymentAcceptResult) {\n cardPaymentAcceptResult.TokenizedPaymentCard = {\n // @ts-expect-error\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.TokenizedPaymentCard',\n House: 'N/A',\n ...(billingAddress && {\n Phone: billingAddress.Phone,\n Country: billingAddress.ThreeLetterISORegionName,\n Address1: billingAddress.Street,\n City: billingAddress.City,\n State: billingAddress.State,\n Zip: billingAddress.ZipCode\n })\n };\n }\n\n const cardTenderLine: CartTenderLine = {\n // @ts-expect-error -- existing data.\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CartTenderLine',\n 'Amount@odata.type': '#Decimal',\n Currency: currency,\n Amount: amount,\n TenderTypeId: tenderTypeId,\n CardPaymentAcceptResult: cardPaymentAcceptResult\n };\n\n return cardTenderLine;\n}\n\nasync function createCustomerAccountTenderLine(ctx: IActionContext, Amount: number, Currency: string = 'USD'): Promise<CartTenderLine> {\n const CustomerId = null;\n if (!ctx.requestContext.user.isAuthenticated) {\n ctx.telemetry.error('A customer id is required to pay with customer account');\n }\n\n const tenderTypes = await getTenderTypesAsync({ callerContext: ctx, queryResultSettings: {} }).catch(error => {\n throw error;\n });\n\n if (!tenderTypes) {\n ctx.telemetry.error('No tender types found for this channel');\n }\n\n const TenderTypeId = findTenderIdTypeByOperationId(tenderTypes, OPERATIONS.PayCustomerAccount);\n if (!TenderTypeId) {\n ctx.telemetry.error('No customer account tender type');\n }\n return {\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.CartTenderLine',\n 'Amount@odata.type': '#Decimal',\n Currency,\n TenderTypeId,\n Amount,\n\n // @ts-expect-error\n CustomerId\n };\n}\n\nexport const CartCheckout = async (\n ctx: IActionContext,\n updatedCartVersion?: number,\n isPaymentVerificationRedirection?: boolean\n): Promise<SalesOrder> => {\n const checkoutState = await getCheckoutState(ctx).catch(error => {\n throw error;\n });\n\n const cartState = checkoutState.checkoutCart;\n\n const channelConfiguration = ctx.requestContext.channel;\n\n if (!cartState || Object.keys(cartState).length === 0 || !channelConfiguration) {\n throw new Error('Fail to placeOrder');\n }\n\n const {\n giftCardExtends,\n tokenizedPaymentCard,\n cardPrefix,\n guestCheckoutEmail,\n billingAddress,\n loyaltyAmount,\n cardPaymentAcceptResult,\n shouldEnableSinglePaymentAuthorizationCheckout,\n isExpressCheckoutApplied,\n isExpressAddressApplied\n } = checkoutState;\n const { Currency } = channelConfiguration;\n\n let amountDue = cartState.cart.AmountDue || 0;\n let cartTenderLines;\n const getTenderLinePromises = [];\n const loyaltyCardNumber = cartState.cart.LoyaltyCardId;\n\n // Pay by loyalty first\n if (loyaltyAmount && loyaltyCardNumber) {\n const chargedAmount = roundNumber(Math.min(loyaltyAmount, amountDue));\n const loyaltyTenderLinePromise = getLoyaltyTenderLine(ctx, loyaltyCardNumber, chargedAmount, Currency);\n getTenderLinePromises.push(loyaltyTenderLinePromise);\n amountDue = roundNumber(amountDue - chargedAmount);\n\n ctx.telemetry.information('Checkout loyalty tender line is added.');\n } else {\n ctx.telemetry.information('Checkout loyalty tender line is not added when no loyaltyAmount or loyaltyCardNumber.');\n }\n\n // Then by customer account\n if (checkoutState.customerAccountAmount > 0) {\n const chargedAmount = roundNumber(Math.min(checkoutState.customerAccountAmount, amountDue));\n const customerAccountTenderLinePromise = createCustomerAccountTenderLine(ctx, chargedAmount, Currency);\n getTenderLinePromises.push(customerAccountTenderLinePromise);\n amountDue = roundNumber(amountDue - chargedAmount);\n\n ctx.telemetry.information('Checkout customer account amount tender line is added.');\n } else {\n ctx.telemetry.information('Checkout customer account amount tender line is not added when customerAccountAmount is 0.');\n }\n\n // Then by gift card\n if (giftCardExtends && giftCardExtends.length > 0) {\n giftCardExtends.some(giftCardExtend => {\n if (giftCardExtend.Balance && amountDue > 0) {\n const chargedAmount = roundNumber(Math.min(giftCardExtend.Balance, amountDue));\n const tenderTypeId = giftCardExtend.TenderTypeId;\n const giftCardPin = giftCardExtend.Pin;\n const giftCardExpirationYear = giftCardExtend.ExpirationDate\n ? Number.parseInt(giftCardExtend.ExpirationDate?.split('/')[1], 10)\n : undefined;\n const giftCardExpirationMonth = giftCardExtend.ExpirationDate\n ? Number.parseInt(giftCardExtend.ExpirationDate?.split('/')[0], 10)\n : undefined;\n const creditCardTenderLinePromise = getGiftCardTenderLine(\n ctx,\n giftCardExtend.Id,\n chargedAmount,\n Currency,\n tenderTypeId,\n giftCardPin,\n giftCardExpirationYear,\n giftCardExpirationMonth\n );\n getTenderLinePromises.push(creditCardTenderLinePromise);\n amountDue = roundNumber(amountDue - chargedAmount);\n\n ctx.telemetry.information('Checkout gift card tender line is added.');\n } else {\n ctx.telemetry.information('Checkout gift card tender line is not added when no balance or no remaining balance.');\n }\n return amountDue === 0;\n });\n }\n\n // Pay the rest by credit card\n if (amountDue > 0) {\n let creditCardTenderLinePromise: Promise<CartTenderLine>;\n\n if (\n shouldEnableSinglePaymentAuthorizationCheckout &&\n (!(isExpressCheckoutApplied && !isExpressAddressApplied) || (isExpressCheckoutApplied && isPaymentVerificationRedirection))\n ) {\n creditCardTenderLinePromise = getCreditCardTenderLineForSinglePaymentAuth(\n ctx,\n amountDue,\n Currency,\n cardPaymentAcceptResult,\n billingAddress\n );\n } else {\n if (!tokenizedPaymentCard) {\n throw new Error('Fail to placeOrder: no token found');\n }\n creditCardTenderLinePromise = getCreditCardTenderLine(\n ctx,\n tokenizedPaymentCard,\n cardPrefix,\n amountDue,\n Currency,\n billingAddress\n );\n }\n\n getTenderLinePromises.push(creditCardTenderLinePromise);\n\n ctx.telemetry.information('Checkout credit card tender line is added.');\n } else {\n ctx.telemetry.information('Checkout credit card tender line is not added when no remaining balance for credit card.');\n }\n\n if (getTenderLinePromises.length > 0) {\n // When payment methods is required\n cartTenderLines = await Promise.all(getTenderLinePromises).catch(error => {\n throw error;\n });\n\n if (!cartTenderLines || cartTenderLines.length === 0) {\n throw new Error('Fail to placeOrder: fail to get cart tender lines');\n }\n } else {\n ctx.telemetry.information('TenderLinePromises length is 0.');\n }\n\n const cartVersion = updatedCartVersion || cartState.cart.Version;\n\n ctx.telemetry.information('Checkout checkoutAsync is called.');\n\n // Proceed checkout\n const salesOrder = await checkoutAsync(\n { callerContext: ctx, bypassCache: 'get' },\n cartState.cart.Id,\n guestCheckoutEmail,\n undefined,\n undefined,\n cartTenderLines || null,\n cartVersion\n ).catch(async error => {\n if (checkoutState.shouldEnableSinglePaymentAuthorizationCheckout) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- unknown type.\n if (error.data?.AdditionalContext) {\n ctx.telemetry.warning('CheckoutAsync call failed. AdditionalContext is sent for single payment auth.');\n\n await checkoutState.updateShouldCollapsePaymentSection({ newShouldCollapsePaymentSection: true });\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- unknown type.\n await checkoutState.updateRedirectAdditionalContext({\n newRedirectAdditionalContext: error?.data?.AdditionalContext as string\n });\n await checkoutState.updateRedirectPaymentConnectorId({\n newRedirectPaymentConnectorId: cardPaymentAcceptResult?.Settings?.PaymentConnectorId as string\n });\n } else {\n ctx.telemetry.warning('CheckoutAsync call failed. AdditionalContext is not sent for single payment auth.');\n\n await checkoutState.updateIsCheckoutCallFailed({ newIsCheckoutCallFailed: true });\n\n await checkoutState.updateCheckoutErrorPaymentConnectorId({\n newCheckoutErrorPaymentConnectorId: cardPaymentAcceptResult?.Settings?.PaymentConnectorId as string\n });\n\n if (isPaymentVerificationRedirection) {\n ctx.telemetry.warning('RefreshCart when isPaymentVerificationRedirection is true.');\n\n await checkoutState.checkoutCart.refreshCart({});\n await checkoutState.updateIsExpressCheckoutApplied({ newIsExpressCheckoutApplied: false });\n await checkoutState.updateShouldCollapsePaymentSection({ newShouldCollapsePaymentSection: false });\n }\n }\n }\n\n throw error;\n });\n\n if (!salesOrder) {\n ctx.telemetry.error('Failed to placeOrder: fail to checkout.');\n throw new Error('Fail to placeOrder: fail to checkout');\n }\n\n return salesOrder;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { getCartState, getCheckoutState } from '@msdyn365-commerce/global-state';\n\nexport const EmptyActiveCart = async (ctx: IActionContext): Promise<void> => {\n let cartState;\n let checkoutState;\n const lineItemIdsToRemove = [];\n\n try {\n cartState = await getCartState(ctx);\n checkoutState = await getCheckoutState(ctx);\n } catch (error) {\n throw error;\n }\n\n if (!cartState || !cartState.cart) {\n throw new Error('Fail to fetch active cart');\n }\n\n if (!checkoutState || !checkoutState.checkoutCart) {\n throw new Error('Fail to fetch checkoutCart cart');\n }\n\n const activeCart = cartState.cart;\n const checkoutCart = checkoutState.checkoutCart.cart;\n\n for (const activeCartLine of activeCart.CartLines || []) {\n for (const checkoutCartLine of checkoutCart.CartLines || []) {\n if (activeCartLine.LineId && activeCartLine.LineId === checkoutCartLine.LineId) {\n lineItemIdsToRemove.push(activeCartLine.LineId);\n }\n }\n }\n\n try {\n await cartState.removeCartLines({ cartLineIds: lineItemIdsToRemove });\n await cartState.removeAllPromoCodes({});\n await checkoutState.removeCheckoutCartId({});\n } catch (error) {\n throw error;\n }\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\n/**\n * Visibility observer state.\n */\ninterface IVisibilityObserverState {\n isVisible?: boolean;\n errorMessage?: string;\n observer?: MutationObserver;\n}\n\n/**\n * Visibility observer props.\n */\nexport interface IVisibilityObserverProps {\n visibilityObserver?: IVisibilityObserverState;\n}\n\n/**\n * With visibility observer.\n * @param WrappedComponent - Wrapped component.\n * @param className - ClassName.\n * @returns React node.\n */\nexport const withVisibilityObserver = <P extends IVisibilityObserverProps>(\n WrappedComponent: React.ComponentType<P>,\n className = 'ms-checkout-payment-instrument'\n): React.ComponentType<P> => {\n /**\n *\n * VisibilityObserver component.\n * @extends {React.Component<P>}\n */\n class VisibilityObserver extends React.Component<P> {\n // eslint-disable-next-line react/state-in-constructor -- Existing pattern.\n public state: IVisibilityObserverState = {\n isVisible: false,\n // eslint-disable-next-line react/no-unused-state -- Need show error.\n errorMessage: '',\n observer: undefined\n };\n\n private readonly selfRef: React.RefObject<HTMLDivElement> = React.createRef();\n\n public componentDidMount(): void {\n this.initMutationObserver();\n }\n\n public componentWillUnmount(): void {\n this.stopMutationObserver();\n }\n\n public shouldComponentUpdate(nextProps: IVisibilityObserverProps, nextState: IVisibilityObserverState): boolean {\n if (this.state === nextState && this.props === nextProps) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | null {\n return (\n <div className={`${className}__mutation-observer`} ref={this.selfRef}>\n <WrappedComponent {...this.props} visibilityObserver={this.state} />\n </div>\n );\n }\n\n /**\n * Initial mutation observer.\n */\n private readonly initMutationObserver = (): void => {\n // Select the node that will be observed for mutations\n const targetNode = document.getElementsByTagName('body')[0];\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Better double check.\n if (!targetNode) {\n this.setState({\n // eslint-disable-next-line react/no-unused-state -- Need show error.\n errorMessage: 'No body element found'\n });\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Better double check.\n if (!MutationObserver) {\n this.setState({\n // eslint-disable-next-line react/no-unused-state -- Need show error.\n errorMessage: 'MutationObserver is not supported'\n });\n return;\n }\n\n // Options for the observer (which mutations to observe)\n const config = { attributes: true, childList: true, subtree: true };\n\n // Create an observer instance linked to the callback function\n const mutationObserver = new MutationObserver(() => {\n this.handleVisibilityChange();\n });\n mutationObserver.observe(targetNode, config);\n\n this.setState({\n observer: mutationObserver\n });\n };\n\n /**\n * Stop mutation observer.\n */\n private readonly stopMutationObserver = (): void => {\n this.state.observer?.disconnect();\n };\n\n /**\n * Handle visibility change.\n */\n private readonly handleVisibilityChange = (): void => {\n // If module is visible or not\n const isVisible = !!this.selfRef.current && this.selfRef.current.offsetWidth > 0 && this.selfRef.current.offsetHeight > 0;\n if (!this.state.isVisible && isVisible) {\n this.setState({\n isVisible\n });\n this.stopMutationObserver();\n }\n };\n }\n\n return VisibilityObserver;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext, getUrlSync } from '@msdyn365-commerce/core';\n\nexport const GetCheckoutReturnUrl = (actionContext: IActionContext): string => {\n let returnUrl = getUrlSync('checkout', actionContext) || '';\n const absoluteUrlRegExp = new RegExp('^(?:[a-z]+:)?//', 'i');\n const isAbsoluteUrl = absoluteUrlRegExp.test(returnUrl);\n if (window && !isAbsoluteUrl) {\n returnUrl = `${window.location.origin}${returnUrl}`;\n }\n\n return `${returnUrl}${!returnUrl.includes('?') ? '?' : '&'}pv=1`;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Customer } from '@msdyn365-commerce/retail-proxy';\nimport { Alert, Button, INodeProps, NodeTag, getLocaleBasedCustomizedPrice, ILocalizedPrice } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ICheckoutCustomerAccountPaymentResources } from '../checkout-customer-account-payment.props.autogenerated';\n\nexport interface IGetAccountPaymentEditViewFormInput {\n resources: ICheckoutCustomerAccountPaymentResources;\n customizedAmt: string;\n amount: number;\n amountVariable: string;\n maxAmount: number;\n customer: Customer | undefined;\n customerCreatedDate: string;\n availableCredit: string;\n showCreditLimit: boolean;\n errorMessage: string | undefined;\n creditSectionIsExpanded: boolean;\n orderTotal: string;\n excessCredit: string | undefined;\n appliedAmount: string | undefined;\n locale: string;\n onAddPayment(): Promise<void>;\n onChangePaymentAmount(customizedAmt: string, paymentAmount: number, amountVariable: string): void;\n onToggleCreditSection(): void;\n onRemovePayment(): Promise<void>;\n skipOnChangeLogic?: boolean;\n}\n\nexport interface IAccountPaymentEditViewForm {\n formProps: INodeProps;\n inputLabel: React.ReactNode;\n inputAmount: React.ReactNode;\n addPaymentButton: React.ReactNode;\n customerName: React.ReactNode;\n customerAccountNumber: React.ReactNode;\n customerSince: React.ReactNode;\n accountCredit: React.ReactNode;\n alert: React.ReactNode;\n accountDetails: React.ReactNode;\n appliedLine: React.ReactNode;\n bottomBorder: React.ReactNode;\n}\n\n/**\n * On Add Account Payment Function.\n * @param onAddPayment -On Add Payment Function.\n * @returns Call of Add payment function.\n */\nconst onAddAccountPayment = (onAddPayment: () => Promise<void>) => async (event: React.SyntheticEvent): Promise<void> => {\n event.preventDefault();\n await onAddPayment();\n};\n\n/**\n * On Change Amount Function.\n * @param onChangePaymentAmount -On Change Payment Amount Function.\n * @returns Call of Change payment Amount function.\n */\nconst onChangeAmountHandler = (\n customizedAmt: string,\n paymentAmount: number,\n amountVariable: string,\n locale: string,\n onChangePaymentAmount: (customizedAmt: string, paymentAmount: number, amountVariable: string) => void\n) => (event: React.ChangeEvent<HTMLInputElement>) => {\n const value = event.target.value;\n const customState: ILocalizedPrice = {\n customizedAmount: customizedAmt,\n amountVariable: amountVariable,\n paymentAmount: paymentAmount\n };\n const returnModifiedState = getLocaleBasedCustomizedPrice(value, customState, locale, keyCode);\n customizedAmt = returnModifiedState.customizedAmount as string;\n paymentAmount = returnModifiedState.paymentAmount as number;\n amountVariable = returnModifiedState.amountVariable as string;\n onChangePaymentAmount(customizedAmt, paymentAmount, amountVariable);\n keyCode = 0;\n};\n\nlet keyCode: number = 0;\nexport const getAccountPaymentFormEditMode = (options: IGetAccountPaymentEditViewFormInput): IAccountPaymentEditViewForm => {\n const {\n resources,\n onAddPayment,\n amount,\n customizedAmt,\n amountVariable,\n onChangePaymentAmount,\n maxAmount,\n customer,\n customerCreatedDate,\n availableCredit,\n showCreditLimit,\n errorMessage,\n onToggleCreditSection,\n creditSectionIsExpanded,\n orderTotal,\n excessCredit,\n onRemovePayment,\n appliedAmount,\n locale,\n skipOnChangeLogic\n } = options;\n\n const {\n addPaymentButtonLabel,\n inputAmountLabel,\n inputAmountAriaLabel,\n customerSinceLabel,\n accountCreditLabel,\n creditDetailsSectionLabel,\n orderTotalLabel,\n availableCreditLabel,\n creditExcessLabel,\n appliedCustomerAccountPaymentLabel,\n removeCustomerAccountPaymentLabel,\n accountCreditDetails\n } = resources;\n\n const inputLabel = (\n <span id='ms-checkout-customer-account__label' className='ms-checkout-customer-account__input-label'>\n {inputAmountLabel}\n </span>\n );\n\n const formProps = {\n className: 'ms-checkout-customer-account__form-edit',\n onSubmit: onAddAccountPayment(onAddPayment),\n tag: 'form' as NodeTag\n };\n\n const addPaymentButton = (\n <Button\n className='ms-checkout-customer-account__btn-pay'\n onClick={onAddAccountPayment(onAddPayment)}\n disabled={amount > maxAmount || amount < 0 || Number.isNaN(amount)}\n >\n {addPaymentButtonLabel}\n </Button>\n );\n\n const inputAmount = (\n <input\n type='text'\n className='ms-checkout-customer-account__input-amount form-control'\n value={customizedAmt}\n onInput={\n skipOnChangeLogic\n ? ({ currentTarget: { value } }) => onChangePaymentAmount(value, Number(value), value)\n : onChangeAmountHandler(customizedAmt, amount, amountVariable, locale, onChangePaymentAmount)\n }\n onKeyDown={event => (keyCode = event.which)}\n aria-label={inputAmountAriaLabel}\n aria-valuemin={0}\n aria-valuemax={maxAmount}\n aria-valuenow={amount}\n min={0}\n max={maxAmount}\n />\n );\n\n const customerName = <div className='ms-checkout-customer-account__account-name'>{customer?.Name}</div>;\n\n const customerAccountNumber = <div className='ms-checkout-customer-account__account-number'>#{customer?.AccountNumber}</div>;\n\n const customerSince = (\n <div className='ms-checkout-customer-account__customer-since'>\n {customerSinceLabel}\n {customerCreatedDate}\n </div>\n );\n\n const accountCredit = (\n <>\n <span className='ms-checkout-customer-account__account-credit-label'>{accountCreditLabel}</span>\n {showCreditLimit && <span className='ms-checkout-customer-account__account-credit'>{availableCredit}</span>}\n <span\n className={\n creditSectionIsExpanded\n ? 'ms-checkout-customer-account__account-credit-toggle-up'\n : 'ms-checkout-customer-account__account-credit-toggle-down'\n }\n onClick={onToggleCreditSection}\n role='button'\n aria-label={accountCreditDetails}\n />\n </>\n );\n\n const accountDetails = creditSectionIsExpanded ? (\n <div className='ms-checkout-customer-account__credit-details-section'>\n <>\n <div className='ms-checkout-customer-account__account-credit-current-order-preview'>\n <span className='ms-checkout-customer-account__account-credit-current-order-icon' />\n <span className='ms-checkout-customer-account__account-credit-current-order-preview-label'>\n {creditDetailsSectionLabel}\n </span>\n </div>\n </>\n <div className='ms-checkout-customer-account__available-credit-section'>\n <span className='ms-checkout-customer-account__available-credit-label'>{availableCreditLabel}</span>\n <span className='ms-checkout-customer-account__available-credit'>{availableCredit}</span>\n </div>\n <div className='ms-checkout-customer-account__order-total-section'>\n <span className='ms-checkout-customer-account__order-total-label'>{orderTotalLabel}</span>\n <span className='ms-checkout-customer-account__order-total'>{orderTotal}</span>\n </div>\n <div className='ms-checkout-customer-account__excess-credit-section'>\n <span className='ms-checkout-customer-account__excess-credit-label'>{creditExcessLabel}</span>\n <span className='ms-checkout-customer-account__excess-credit'>{excessCredit ?? '0'}</span>\n </div>\n </div>\n ) : (\n undefined\n );\n\n const alert = (\n <Alert\n tag='span'\n id='ms-checkout-customer-account__error'\n className='ms-checkout-customer-account__input-error'\n role='alert'\n assertive={false}\n fade={false}\n includeAlertClass={false}\n isOpen={!!errorMessage}\n >\n {errorMessage}\n </Alert>\n );\n\n const appliedLine = appliedAmount ? (\n <div className='ms-checkout-customer-account__applied-line'>\n <span className='ms-checkout-customer-account__applied-label'>{appliedCustomerAccountPaymentLabel}</span>\n <span className='ms-checkout-customer-account__applied-amount'>{appliedAmount}</span>\n <a className='ms-checkout-customer-account__remove' onClick={onRemovePayment} role='button'>\n {removeCustomerAccountPaymentLabel}\n </a>\n </div>\n ) : (\n undefined\n );\n\n const bottomBorder = <div className='ms-checkout-customer-account__bottom-border' />;\n\n return {\n formProps,\n inputLabel,\n inputAmount,\n addPaymentButton,\n customerName,\n customerAccountNumber,\n customerSince,\n accountCredit,\n alert,\n accountDetails,\n appliedLine,\n bottomBorder\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Button, INodeProps, NodeTag } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ICheckoutCustomerAccountPaymentResources } from '../checkout-customer-account-payment.props.autogenerated';\n\nexport interface IGetAccountPaymentSummaryViewFormInput {\n resources: ICheckoutCustomerAccountPaymentResources;\n amount: number;\n appliedAmount: string | undefined;\n}\n\nexport interface IAccountPaymentSummaryViewForm {\n formProps: INodeProps;\n label: React.ReactNode;\n paymentAmount: React.ReactNode;\n addPaymentButton: React.ReactNode;\n appliedLine: React.ReactNode;\n bottomBorder: React.ReactNode;\n alert?: React.ReactNode;\n paymentAmountInput?: React.ReactNode;\n}\n\nexport const getAccountPaymentFormSummaryMode = (options: IGetAccountPaymentSummaryViewFormInput): IAccountPaymentSummaryViewForm => {\n const { resources, amount, appliedAmount } = options;\n\n const { addPaymentButtonLabel, inputAmountSummaryLabel, appliedCustomerAccountPaymentLabel, inputAmountAriaLabel } = resources;\n\n const label = (\n <label id='ms-checkout-customer-account__label' className='ms-checkout-customer-account__input-label'>\n {inputAmountSummaryLabel}\n </label>\n );\n\n const formProps = {\n className: 'ms-checkout-customer-account__form-summary',\n tag: 'form' as NodeTag\n };\n\n const paymentAmount = <label id='ms-checkout-customer-account__amount'>{amount}</label>;\n\n const paymentAmountInput = (\n <input\n type='text'\n className='ms-checkout-customer-account__input-amount form-control'\n value={amount}\n aria-label={inputAmountAriaLabel}\n disabled={true}\n />\n );\n\n const addPaymentButton = (\n <Button className='ms-checkout-customer-account__btn-pay' disabled>\n {addPaymentButtonLabel}\n </Button>\n );\n\n const appliedLine = appliedAmount ? (\n <div className='ms-checkout-customer-account__applied-line'>\n <span className='ms-checkout-customer-account__applied-label'>{appliedCustomerAccountPaymentLabel}</span>\n <span className='ms-checkout-customer-account__applied-amount'>{appliedAmount}</span>\n </div>\n ) : (\n undefined\n );\n\n const bottomBorder = <div className='ms-checkout-customer-account__bottom-border' />;\n\n return {\n formProps,\n label,\n paymentAmount,\n addPaymentButton,\n appliedLine,\n bottomBorder,\n paymentAmountInput\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Address, TenderLine, TokenizedPaymentCard } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { Button } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IPaymentInformationProps {\n resources: {\n changePaymentButtonText: string;\n cardTitle: string;\n cardNumberLabel: string;\n expiresDateLabel: string;\n addressTitle: string;\n };\n tokenizedPaymentCard?: TokenizedPaymentCard;\n tenderLine?: TenderLine;\n billingAddress?: Address;\n canEdit?: boolean;\n onEdit?(): void;\n}\n\n/**\n * PaymentInformation SFC.\n * @param root0\n * @param root0.resources\n * @param root0.resources.changePaymentButtonText\n * @param root0.resources.cardTitle\n * @param root0.resources.cardNumberLabel\n * @param root0.resources.expiresDateLabel\n * @param root0.resources.addressTitle\n * @param root0.tokenizedPaymentCard\n * @param root0.tenderLine\n * @param root0.billingAddress\n * @param root0.onEdit\n * @param root0.canEdit\n * @extends {React.SFC<IPaymentInformationProps>}\n */\nconst PaymentInformation: React.SFC<IPaymentInformationProps> = ({\n resources: { changePaymentButtonText, cardTitle, cardNumberLabel, expiresDateLabel, addressTitle },\n tokenizedPaymentCard,\n tenderLine,\n billingAddress,\n onEdit,\n canEdit\n}) => {\n const { NameOnCard = '', CardTypeId, CardTokenInfo = {}, ExpirationMonth = 0, ExpirationYear = 0 } = tokenizedPaymentCard || {};\n const { MaskedCardNumber = '' } = CardTokenInfo || tenderLine || {};\n const cardLastNDigit = MaskedCardNumber.substr(-4);\n\n // @ts-expect-error\n const isValidCardNumber = !isNaN(cardLastNDigit) && cardLastNDigit !== '';\n const { Name, Street, StreetNumber, City, State, ZipCode, ThreeLetterISORegionName, Phone } = billingAddress || {};\n\n return (\n <div className='ms-checkout-payment-instrument__show'>\n <p className='ms-checkout-payment-instrument__card-title'>{cardTitle}</p>\n <p className='ms-checkout-payment-instrument__card-name'>{NameOnCard}</p>\n {CardTypeId && <p className='ms-checkout-payment-instrument__card-type-id'>{CardTypeId}</p>}\n {isValidCardNumber && (\n <p className='ms-checkout-payment-instrument__card-number'>\n {cardNumberLabel} {` `} {cardLastNDigit}\n </p>\n )}\n {(ExpirationMonth > 0 || ExpirationYear > 0) && (\n <p className='ms-checkout-payment-instrument__card-expiration'>\n {expiresDateLabel} {` `} {ExpirationMonth}/{ExpirationYear}\n </p>\n )}\n {billingAddress && (\n <>\n <p className='ms-checkout-payment-instrument__billing-address-title'>{addressTitle}</p>\n <p className='ms-checkout-payment-instrument__billing-address-1'>\n {Name}\n {` `}\n {Street}\n </p>\n {StreetNumber && <p className='ms-checkout-payment-instrument__billing-address-2'>{StreetNumber}</p>}\n <p className='ms-checkout-payment-instrument__billing-address-3'>\n {City},{State}\n {` `}\n {ZipCode}\n {` `}\n {ThreeLetterISORegionName}\n {` `}\n {Phone}\n </p>\n </>\n )}\n {canEdit && (\n <Button className='ms-checkout-payment-instrument__btn-edit' title={changePaymentButtonText} color='link' onClick={onEdit}>\n {changePaymentButtonText}\n </Button>\n )}\n </div>\n );\n};\n\nexport default React.memo(PaymentInformation);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Button, INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nexport interface IAddContactInfoInput {\n inputRef?: React.RefObject<HTMLInputElement>;\n hasError: boolean;\n email: string;\n resources: {\n emailLabel: string;\n emailErrortext: string;\n saveBtnLabel: string;\n cancelBtnLabel: string;\n };\n canSubmit: boolean;\n canCancel: boolean;\n onChange(email: string): void;\n onSubmit(): void;\n onCancel(): void;\n}\n\nexport interface IAddContactInfo {\n addFormProps: INodeProps;\n submitButton: React.ReactNode;\n cancelButton: React.ReactNode;\n inputGroupProps: INodeProps;\n label: React.ReactNode;\n error: React.ReactNode;\n input: React.ReactNode;\n}\n\n/**\n * On Input change handler function.\n * @param onChange -On change input function.\n * @returns Call of onChange function.\n */\nconst onInputChangeHandler = (onChange: (email: string) => void) => (event: React.ChangeEvent<HTMLInputElement>): void => {\n onChange(event.target.value || '');\n};\n\nconst getAddContactInfo = ({\n hasError,\n inputRef,\n email,\n canSubmit,\n canCancel,\n onChange,\n onSubmit,\n onCancel,\n resources: { emailLabel, emailErrortext, saveBtnLabel, cancelBtnLabel }\n}: IAddContactInfoInput): IAddContactInfo => {\n const onInputChange = onInputChangeHandler(onChange);\n\n return {\n addFormProps: { className: 'ms-checkout-guest-profile__add-contact-info' },\n submitButton: canSubmit && (\n <Button className='ms-checkout-guest-profile__btn-save' title={saveBtnLabel} color='primary' onClick={onSubmit}>\n {saveBtnLabel}\n </Button>\n ),\n cancelButton: canCancel && (\n <Button className='ms-checkout-guest-profile__btn-cancel' title={cancelBtnLabel} color='secondary' onClick={onCancel}>\n {cancelBtnLabel}\n </Button>\n ),\n inputGroupProps: { className: classnames('ms-checkout-guest-profile__input', { 'is-invalid': hasError }) },\n label: (\n <label id='ms-checkout-guest-profile__label' className='ms-checkout-guest-profile__input-label'>\n {emailLabel}\n </label>\n ),\n error: hasError && (\n <span id='ms-checkout-guest-profile__error' className='ms-checkout-guest-profile__input-error' role='alert' aria-live='polite'>\n {emailErrortext}\n </span>\n ),\n input: (\n <input\n ref={inputRef}\n type='text'\n className='ms-checkout-guest-profile__input-text form-control'\n aria-label={emailLabel}\n onChange={onInputChange}\n value={email}\n aria-labelledby='ms-checkout-guest-profile__label ms-checkout-guest-profile__error'\n />\n )\n };\n};\n\nexport default getAddContactInfo;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Button, INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nexport interface IAddCustomerRefInfoInput {\n inputRef?: React.RefObject<HTMLInputElement>;\n hasError: boolean;\n customerRef: string | undefined;\n resources: {\n customerRefLabel: string;\n customerRefErrortext: string;\n saveBtnLabel: string;\n cancelBtnLabel: string;\n };\n canSubmit: boolean;\n canCancel: boolean;\n onChange(email: string): void;\n onSubmit(): void;\n onCancel(): void;\n}\n\nexport interface IAddCustomerRefInfo {\n addFormProps: INodeProps;\n submitButton: React.ReactNode;\n cancelButton: React.ReactNode;\n inputGroupProps: INodeProps;\n label: React.ReactNode;\n error: React.ReactNode;\n input: React.ReactNode;\n}\n\n/**\n * On Input change handler function.\n * @param onChange -On change input function.\n * @returns Call of onChange function.\n */\nconst onInputChangeHandler = (onChange: (customerRef: string) => void) => (event: React.ChangeEvent<HTMLInputElement>): void => {\n onChange(event.target.value || '');\n};\n\nconst getAddCustomerRefInfo = ({\n hasError,\n inputRef,\n customerRef,\n canSubmit,\n canCancel,\n onChange,\n onSubmit,\n onCancel,\n resources: { customerRefLabel, customerRefErrortext, saveBtnLabel, cancelBtnLabel }\n}: IAddCustomerRefInfoInput): IAddCustomerRefInfo => {\n const onInputChange = onInputChangeHandler(onChange);\n\n return {\n addFormProps: { className: 'ms-checkout-guest-profile__add-customer-reference-number' },\n submitButton: canSubmit && (\n <Button className='ms-checkout-guest-profile__btn-save' title={saveBtnLabel} color='primary' onClick={onSubmit}>\n {saveBtnLabel}\n </Button>\n ),\n cancelButton: canCancel && (\n <Button className='ms-checkout-guest-profile__btn-cancel' title={cancelBtnLabel} color='secondary' onClick={onCancel}>\n {cancelBtnLabel}\n </Button>\n ),\n inputGroupProps: { className: classnames('ms-checkout-guest-profile__input', { 'is-invalid': hasError }) },\n label: (\n <label id='ms-checkout-guest-profile__label' className='ms-checkout-guest-profile__input-label'>\n {customerRefLabel}\n </label>\n ),\n error: hasError && (\n <span id='ms-checkout-guest-profile__error' className='ms-checkout-guest-profile__input-error' role='alert' aria-live='polite'>\n {customerRefErrortext}\n </span>\n ),\n input: (\n <input\n ref={inputRef}\n type='text'\n maxLength={60}\n className='ms-checkout-guest-profile__input-text form-control'\n aria-label={customerRefLabel}\n onChange={onInputChange}\n value={customerRef}\n aria-labelledby='ms-checkout-guest-profile__label ms-checkout-guest-profile__error'\n />\n )\n };\n};\n\nexport default getAddCustomerRefInfo;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Button, INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nexport interface IAddPurchaseOrderInfoInput {\n inputRef?: React.RefObject<HTMLInputElement>;\n hasError: boolean;\n purchaseOrderNumber: string | undefined;\n resources: {\n purchaseOrderLabel: string;\n purchaseOrderErrortext: string;\n saveBtnLabel: string;\n cancelBtnLabel: string;\n };\n canSubmit: boolean;\n canCancel: boolean;\n onChange(email: string): void;\n onSubmit(): void;\n onCancel(): void;\n}\n\nexport interface IAddPurchaseOrderInfo {\n addFormProps: INodeProps;\n submitButton: React.ReactNode;\n cancelButton: React.ReactNode;\n inputGroupProps: INodeProps;\n label: React.ReactNode;\n error: React.ReactNode;\n input: React.ReactNode;\n}\n\n/**\n * On Input change handler function.\n * @param onChange -On change input function.\n * @returns Call of onChange function.\n */\nconst onInputChangeHandler = (onChange: (purchaseOrder: string) => void) => (event: React.ChangeEvent<HTMLInputElement>): void => {\n onChange(event.target.value || '');\n};\n\nconst getAddPurchaseOrderInfo = ({\n hasError,\n inputRef,\n purchaseOrderNumber,\n canSubmit,\n canCancel,\n onChange,\n onSubmit,\n onCancel,\n resources: { purchaseOrderLabel, purchaseOrderErrortext, saveBtnLabel, cancelBtnLabel }\n}: IAddPurchaseOrderInfoInput): IAddPurchaseOrderInfo => {\n const onInputChange = onInputChangeHandler(onChange);\n\n return {\n addFormProps: { className: 'ms-checkout-guest-profile__add-customer-requisition' },\n submitButton: canSubmit && (\n <Button className='ms-checkout-guest-profile__btn-save' title={saveBtnLabel} color='primary' onClick={onSubmit}>\n {saveBtnLabel}\n </Button>\n ),\n cancelButton: canCancel && (\n <Button className='ms-checkout-guest-profile__btn-cancel' title={cancelBtnLabel} color='secondary' onClick={onCancel}>\n {cancelBtnLabel}\n </Button>\n ),\n inputGroupProps: { className: classnames('ms-checkout-guest-profile__input', { 'is-invalid': hasError }) },\n label: (\n <label id='ms-checkout-guest-profile__label' className='ms-checkout-guest-profile__input-label'>\n {purchaseOrderLabel}\n </label>\n ),\n error: hasError && (\n <span id='ms-checkout-guest-profile__error' className='ms-checkout-guest-profile__input-error' role='alert' aria-live='polite'>\n {purchaseOrderErrortext}\n </span>\n ),\n input: (\n <input\n ref={inputRef}\n type='text'\n maxLength={60}\n className='ms-checkout-guest-profile__input-text form-control'\n aria-label={purchaseOrderLabel}\n onChange={onInputChange}\n value={purchaseOrderNumber}\n aria-labelledby='ms-checkout-guest-profile__label ms-checkout-guest-profile__error'\n />\n )\n };\n};\n\nexport default getAddPurchaseOrderInfo;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Button, INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IShowContactInfoInput {\n canEdit: boolean;\n email: string;\n resources: {\n editBtnLabel: string;\n };\n onEdit(): void;\n}\n\nexport interface IShowContactInfo {\n showInfoProps: INodeProps;\n email: React.ReactNode;\n editButton?: React.ReactNode;\n}\n\nconst getContactInfo = ({ canEdit, email, resources: { editBtnLabel }, onEdit }: IShowContactInfoInput): IShowContactInfo => ({\n showInfoProps: { className: 'ms-checkout-guest-profile__selected-item' },\n email: <span className='ms-checkout-guest-profile__selected-email'>{email}</span>,\n editButton: canEdit && (\n <Button className='ms-checkout-guest-profile__btn-edit' title={editBtnLabel} color='link' onClick={onEdit}>\n {editBtnLabel}\n </Button>\n )\n});\n\nexport default getContactInfo;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IShowNoteInfoInput {\n noteDescription?: string;\n}\n\nexport interface IShowNoteInfo {\n showInfoProps: INodeProps;\n noteDescription: React.ReactNode;\n}\n\nconst getNoteInfo = ({ noteDescription }: IShowNoteInfoInput): IShowNoteInfo => ({\n showInfoProps: { className: 'ms-checkout-guest-profile__selected-item' },\n noteDescription: <span className='ms-checkout-guest-profile__selected-email'>{noteDescription}</span>\n});\n\nexport default getNoteInfo;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IShowCustomerRefInfoInput {\n canEdit: boolean;\n customerRef: string;\n resources: {\n editBtnLabel: string;\n };\n onEdit(): void;\n}\n\nexport interface IShowCustomerRefInfo {\n showInfoProps: INodeProps;\n customerRef: React.ReactNode;\n}\n\nconst getCustomerRefInfo = ({\n canEdit,\n customerRef,\n resources: { editBtnLabel },\n onEdit\n}: IShowCustomerRefInfoInput): IShowCustomerRefInfo => ({\n showInfoProps: { className: 'ms-checkout-guest-profile__selected-item' },\n customerRef: <span className='ms-checkout-guest-profile__selected-email'>{customerRef}</span>\n});\n\nexport default getCustomerRefInfo;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IShowPurchaseOrderInfoInput {\n canEdit: boolean;\n purchaseOrder: string;\n resources: {\n editBtnLabel: string;\n };\n onEdit(): void;\n}\n\nexport interface IShowPurchaseOrderInfo {\n showInfoProps: INodeProps;\n purchaseOrder: React.ReactNode;\n}\n\nconst getPurchaseOrderInfo = ({\n canEdit,\n purchaseOrder,\n resources: { editBtnLabel },\n onEdit\n}: IShowPurchaseOrderInfoInput): IShowPurchaseOrderInfo => ({\n showInfoProps: { className: 'ms-checkout-guest-profile__selected-item' },\n purchaseOrder: <span className='ms-checkout-guest-profile__selected-po'>{purchaseOrder}</span>\n});\n\nexport default getPurchaseOrderInfo;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Button, INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport { Note } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nexport interface IAddNoteInfoInput {\n inputRef?: React.RefObject<HTMLInputElement>;\n hasError: boolean;\n note?: Note;\n onChange(note: string): void;\n resources: {\n noteLabel: string;\n noteErrortext: string;\n saveBtnLabel: string;\n cancelBtnLabel: string;\n };\n canSubmit: boolean;\n canCancel: boolean;\n onSubmit(): void;\n onCancel(): void;\n}\n\nexport interface IAddNoteInfo {\n addFormProps: INodeProps;\n submitButton: React.ReactNode;\n cancelButton: React.ReactNode;\n inputGroupProps: INodeProps;\n label: React.ReactNode;\n error: React.ReactNode;\n input: React.ReactNode;\n}\n\n/**\n * On Input change handler function.\n * @param onChange -On change input function.\n * @returns Call of onChange function.\n */\nconst onInputChangeHandler = (onChange: (note: string) => void) => (event: React.ChangeEvent<HTMLInputElement>): void => {\n onChange(event.target.value || '');\n};\n\nconst getAddNoteInfo = ({\n hasError,\n inputRef,\n note,\n canSubmit,\n canCancel,\n onSubmit,\n onCancel,\n onChange,\n resources: { noteLabel, noteErrortext, saveBtnLabel, cancelBtnLabel }\n}: IAddNoteInfoInput): IAddNoteInfo => {\n const onInputChange = onInputChangeHandler(onChange);\n return {\n addFormProps: { className: 'ms-checkout-guest-profile__add-notes-info' },\n submitButton: canSubmit && (\n <Button className='ms-checkout-guest-profile__btn-save' title={saveBtnLabel} color='primary' onClick={onSubmit}>\n {saveBtnLabel}\n </Button>\n ),\n cancelButton: canCancel && (\n <Button className='ms-checkout-guest-profile__btn-cancel' title={cancelBtnLabel} color='secondary' onClick={onCancel}>\n {cancelBtnLabel}\n </Button>\n ),\n inputGroupProps: { className: classnames('ms-checkout-guest-profile__input', { 'is-invalid': hasError }) },\n label: (\n <label id='ms-checkout-guest-profile__label' className='ms-checkout-guest-profile__input-label'>\n {noteLabel}\n </label>\n ),\n error: hasError && (\n <span id='ms-checkout-guest-profile__error' className='ms-checkout-guest-profile__input-error' role='alert' aria-live='polite'>\n {noteErrortext}\n </span>\n ),\n input: (\n <input\n ref={inputRef}\n type='text'\n onChange={onInputChange}\n className='ms-checkout-guest-profile__input-text form-control notes-input'\n aria-label={noteLabel}\n value={note?.Description || ''}\n aria-labelledby='ms-checkout-guest-profile__label ms-checkout-guest-profile__error'\n />\n )\n };\n};\n\nexport default getAddNoteInfo;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { format } from '@msdyn365-commerce-modules/utilities';\n\nexport function getDate(date: Date | undefined, locale: string): string {\n if (!date) {\n return '';\n }\n const options: Intl.DateTimeFormatOptions = {\n timeZone: 'UTC'\n };\n const formatter = new Intl.DateTimeFormat(locale, options);\n return formatter.format(new Date(date));\n}\n\nexport const getTimeslot = (\n placeHolder: string,\n startDate: Date | undefined,\n endDate: Date | undefined,\n locale: string,\n useHour12TimeFormat?: boolean\n): string => {\n if (!startDate || !endDate) {\n return '';\n }\n let options: Intl.DateTimeFormatOptions = { hour: 'numeric', minute: 'numeric' };\n options = useHour12TimeFormat\n ? { hour: 'numeric', minute: 'numeric', timeZone: 'UTC' }\n : { hour: 'numeric', minute: 'numeric', timeZone: 'UTC', hour12: true };\n const formatter = new Intl.DateTimeFormat(locale, options);\n return format(placeHolder, formatter.format(new Date(startDate)), formatter.format(new Date(endDate)));\n};\n\nexport const getUTCDateWithoutTime = (input: Date): Date => {\n const date: Date = new Date(input);\n return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), 0, 0, 0));\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { LabeledDropdown } from '@msdyn365-commerce-modules/utilities';\nimport {\n ILabeledDropdownOnChangeNotification,\n ILabeledDropdownOption\n} from '@msdyn365-commerce-modules/utilities/dist/types/labeled-dropdown/LabeledDropdown.props';\nimport { computed } from 'mobx';\nimport * as React from 'react';\n\nimport { CheckoutPickupError } from './checkout-pickup-group';\nimport { getDate } from './checkout-pickup-utility';\n\nexport interface IPickupDropdownProps {\n pickupStoreId: string;\n deliveryMode: string;\n\n className: string;\n labelClassname?: string;\n labelText: string;\n defaultText: string;\n errorMessage?: string;\n\n locale: string;\n\n // Props for the LabeledDropdown component\n dropdownId: string;\n controlledByParent: boolean;\n toggleColor?: string;\n dropdownClassname?: string;\n}\n\nexport interface IPickupDateDropdownProps extends IPickupDropdownProps {\n availableDates: Date[];\n selectedDate?: Date;\n setDateHandler(pickupStoreId: string, deliveryMode: string, pickupDate: Date | undefined): void;\n}\n\n/**\n *\n * CheckoutPickupDateDropdown component.\n * @extends {React.Component<IPickupDateDropdownProps>}\n */\nexport class CheckoutPickupDateDropdown extends React.PureComponent<IPickupDateDropdownProps> {\n private readonly defaultKey: number = -1;\n\n private readonly defaultOption: ILabeledDropdownOption;\n\n // As the LabeledDropdown control only offers key and value, we need to map the key with date and timeslot data\n @computed get getDateMap(): Map<string, Date> {\n const map = new Map<string, Date>();\n this.props.availableDates.forEach((value, index) => {\n map.set(index.toString(), value);\n });\n return map;\n }\n\n constructor(props: IPickupDateDropdownProps) {\n super(props);\n this.defaultOption = { key: this.defaultKey.toString(), value: props.defaultText };\n this.updateDateSelection = this.updateDateSelection.bind(this);\n }\n\n public render(): JSX.Element | null {\n const {\n className,\n labelClassname,\n labelText,\n errorMessage,\n dropdownId,\n availableDates,\n selectedDate,\n controlledByParent,\n toggleColor,\n dropdownClassname\n } = this.props;\n\n const { dropdownOptions, selectedOption } = this.mapDatesToOptions(availableDates, selectedDate);\n\n return (\n <div className={className}>\n <label className={labelClassname} htmlFor={dropdownId}>\n {labelText}\n </label>\n <CheckoutPickupError errorMessage={errorMessage} />\n <LabeledDropdown\n dropdownId={dropdownId}\n dropdownOptions={dropdownOptions}\n selectedOption={selectedOption}\n controlledByParent={controlledByParent}\n toggleColor={toggleColor}\n dropdownClassname={dropdownClassname}\n onSelectOption={this.updateDateSelection}\n />\n </div>\n );\n }\n\n private readonly updateDateSelection = (notification: ILabeledDropdownOnChangeNotification): void => {\n const { pickupStoreId, deliveryMode, setDateHandler } = this.props;\n const date: Date | undefined = this.getDate(notification);\n setDateHandler(pickupStoreId, deliveryMode, date);\n };\n\n private readonly getDate = (notification: ILabeledDropdownOnChangeNotification): Date | undefined => {\n const key: string = notification.selectedOption.key;\n if (key === this.defaultKey.toString() || !this.getDateMap.has(key)) {\n return undefined;\n }\n return this.getDateMap.get(key);\n };\n\n private readonly mapDatesToOptions = (\n dates: Date[],\n selectedDate: Date | undefined\n ): { dropdownOptions: ILabeledDropdownOption[]; selectedOption: ILabeledDropdownOption | undefined } => {\n const { locale } = this.props;\n let options: ILabeledDropdownOption[] = [];\n let selectedOption: ILabeledDropdownOption = this.defaultOption;\n\n options = dates.map((value: Date, index: number) => {\n return {\n key: index.toString(),\n value: getDate(value, locale)\n };\n });\n options.unshift(this.defaultOption);\n\n const index: number = dates.findIndex((value: Date) => selectedDate !== undefined && selectedDate.getTime() === value.getTime());\n if (index >= 0 && selectedDate) {\n selectedOption = {\n key: index.toString(),\n value: getDate(selectedDate, locale)\n };\n }\n\n return {\n dropdownOptions: options,\n selectedOption\n };\n };\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { PickupTimeslotAvailability } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { LabeledDropdown } from '@msdyn365-commerce-modules/utilities';\nimport {\n ILabeledDropdownOnChangeNotification,\n ILabeledDropdownOption\n} from '@msdyn365-commerce-modules/utilities/dist/types/labeled-dropdown/LabeledDropdown.props';\nimport { computed } from 'mobx';\nimport * as React from 'react';\n\nimport { IPickupDropdownProps } from './checkout-pickup-date-dropdown';\nimport { CheckoutPickupError } from './checkout-pickup-group';\nimport { getTimeslot } from './checkout-pickup-utility';\n\nexport interface IPickupTimeslotDropdownProps extends IPickupDropdownProps {\n availableTimeslots: PickupTimeslotAvailability[];\n selectedTimeslot?: PickupTimeslotAvailability;\n timeslotPlaceHolder: string;\n setTimeslotHandler(pickupStoreId: string, deliveryMode: string, pickupTimeslot: PickupTimeslotAvailability | undefined): void;\n useHour12TimeFormat?: boolean;\n}\n\n/**\n *\n * CheckoutPickupTimeslotDropdown component.\n * @extends {React.Component<IPickupTimeslotDropdownProps>}\n */\nexport class CheckoutPickupTimeslotDropdown extends React.PureComponent<IPickupTimeslotDropdownProps> {\n private readonly defaultKey: number = -1;\n\n private readonly defaultOption: ILabeledDropdownOption;\n\n // As the LabeledDropdown control only offers key and value, we need to map the key with date and timeslot data\n @computed get getTimeslotMap(): Map<string, PickupTimeslotAvailability> {\n const map = new Map<string, PickupTimeslotAvailability>();\n this.props.availableTimeslots.forEach((value, index) => {\n map.set(index.toString(), value);\n });\n return map;\n }\n\n constructor(props: IPickupTimeslotDropdownProps) {\n super(props);\n this.defaultOption = { key: this.defaultKey.toString(), value: props.defaultText };\n this.updateTimeslotSelection = this.updateTimeslotSelection.bind(this);\n }\n\n public render(): JSX.Element | null {\n const {\n className,\n labelClassname,\n labelText,\n errorMessage,\n dropdownId,\n availableTimeslots,\n selectedTimeslot,\n controlledByParent,\n toggleColor,\n dropdownClassname\n } = this.props;\n\n const { dropdownOptions, selectedOption } = this.mapTimeslotsToOptions(availableTimeslots, selectedTimeslot);\n\n return (\n <div className={className}>\n <label className={labelClassname} htmlFor={dropdownId}>\n {labelText}\n </label>\n <CheckoutPickupError errorMessage={errorMessage} />\n <LabeledDropdown\n dropdownId={dropdownId}\n dropdownOptions={dropdownOptions}\n selectedOption={selectedOption}\n controlledByParent={controlledByParent}\n toggleColor={toggleColor}\n dropdownClassname={dropdownClassname}\n onSelectOption={this.updateTimeslotSelection}\n />\n </div>\n );\n }\n\n private readonly updateTimeslotSelection = (notification: ILabeledDropdownOnChangeNotification): void => {\n const { pickupStoreId, deliveryMode, setTimeslotHandler } = this.props;\n const timeslot: PickupTimeslotAvailability | undefined = this.getTimeslot(notification);\n setTimeslotHandler(pickupStoreId, deliveryMode, timeslot);\n };\n\n private readonly getTimeslot = (notification: ILabeledDropdownOnChangeNotification): PickupTimeslotAvailability | undefined => {\n const key: string = notification.selectedOption.key;\n if (key === this.defaultKey.toString() || !this.getTimeslotMap.has(key)) {\n return undefined;\n }\n return this.getTimeslotMap.get(key);\n };\n\n private readonly mapTimeslotsToOptions = (\n timeslots: PickupTimeslotAvailability[],\n selectedTimeslot: PickupTimeslotAvailability | undefined\n ): { dropdownOptions: ILabeledDropdownOption[]; selectedOption: ILabeledDropdownOption | undefined } => {\n const { timeslotPlaceHolder, locale, useHour12TimeFormat } = this.props;\n let options: ILabeledDropdownOption[] = [];\n let selectedOption: ILabeledDropdownOption = this.defaultOption;\n\n options = timeslots.map((value: PickupTimeslotAvailability, index: number) => {\n return {\n key: index.toString(),\n value: getTimeslot(timeslotPlaceHolder, value.StartDateTime, value.EndDateTime, locale, useHour12TimeFormat)\n };\n });\n options.unshift(this.defaultOption);\n\n const index: number = timeslots.findIndex(\n value =>\n selectedTimeslot !== undefined &&\n selectedTimeslot.StartDateTime?.getTime() === value.StartDateTime?.getTime() &&\n selectedTimeslot.EndDateTime?.getTime() === value.EndDateTime?.getTime()\n );\n if (index >= 0 && selectedTimeslot) {\n selectedOption = {\n key: index.toString(),\n value: getTimeslot(\n timeslotPlaceHolder,\n selectedTimeslot.StartDateTime,\n selectedTimeslot.EndDateTime,\n locale,\n useHour12TimeFormat\n )\n };\n }\n\n return {\n dropdownOptions: options,\n selectedOption\n };\n };\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\nconst Loading: React.FC = () => <div className='ms-checkout-section-container__loading' />;\n\nexport default Loading;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface ICheckoutTermsAndConditionsCheckboxProps {\n isChecked: boolean;\n ariaLabel?: string;\n disabled: boolean;\n id?: string;\n telemetryContent?: ITelemetryContent;\n onChange(event: React.ChangeEvent<HTMLInputElement>): void;\n}\n\n/**\n * AddPaymentForm SFC.\n * @param root0\n * @param root0.isChecked\n * @param root0.ariaLabel\n * @param root0.disabled\n * @param root0.telemetryContent\n * @param root0.onChange\n * @param root0.id\n * @extends {React.FC<ICheckoutTermsAndConditionsCheckboxProps>}\n */\nconst CheckoutTermsAndConditionsCheckbox: React.FC<ICheckoutTermsAndConditionsCheckboxProps> = ({\n isChecked,\n ariaLabel,\n disabled,\n telemetryContent,\n onChange,\n id\n}) => {\n const payLoad = getPayloadObject('click', telemetryContent!, '');\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\n\n return (\n <>\n <input\n className='ms-checkout-terms-and-conditions__input-checkbox'\n type='checkbox'\n aria-label={ariaLabel}\n aria-checked={isChecked}\n name='checkoutTermsAndConditions'\n onChange={onChange}\n disabled={disabled}\n checked={isChecked}\n id={id}\n {...attribute}\n />\n </>\n );\n};\n\nexport default CheckoutTermsAndConditionsCheckbox;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\nexport interface ICheckoutTermsAndConditionsErrorMessageProps {\n message?: string;\n}\n\n/**\n * AddPaymentForm SFC.\n * @param root0\n * @param root0.message\n * @extends {React.FC<ICheckoutTermsAndConditionsErrorMessageProps>}\n */\nconst CheckoutTermsAndConditionsErrorMessage: React.FC<ICheckoutTermsAndConditionsErrorMessageProps> = ({ message }) => {\n if (!message) {\n return null;\n }\n\n return <p className='ms-checkout-terms-and-conditions__error-message'>{message}</p>;\n};\n\nexport default CheckoutTermsAndConditionsErrorMessage;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\nexport interface ICheckoutTermsAndConditionsErrorTitleProps {\n title?: string;\n}\n\n/**\n * AddPaymentForm SFC.\n * @param root0\n * @param root0.title\n * @extends {React.FC<ICheckoutTermsAndConditionsErrorTitleProps>}\n */\nconst CheckoutTermsAndConditionsErrorTitle: React.FC<ICheckoutTermsAndConditionsErrorTitleProps> = ({ title }) => {\n if (!title) {\n return null;\n }\n\n return <p className='ms-checkout-terms-and-conditions__error-title'>{title}</p>;\n};\n\nexport default CheckoutTermsAndConditionsErrorTitle;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { IPaymentConnectorPostMessage } from './payment-instrument-message';\n\n/**\n * Payment iFrame interface.\n */\nexport interface IPaymentFrameElementProps {\n className?: string;\n moduleName?: string;\n iframeAriaLabel: string;\n displayContent?: string;\n sourceUrl?: string;\n requestUrlOrigin?: string;\n messageOrigin?: string;\n // eslint-disable-next-line @typescript-eslint/naming-convention -- public props.\n css?: string;\n height?: number;\n // eslint-disable-next-line @typescript-eslint/naming-convention -- public event.\n onIFrameMessage?(event: MessageEvent): void;\n}\n\n/**\n * Default post message name.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Existing name.\nexport const POST_MESSAGE_NAME = 'message';\n\n/**\n * Get host name.\n * @param url - The url.\n * @returns The host name.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Public props.\nconst getHostName = (url: string = ''): string => {\n return (url.includes('//') ? url.split('/')[2] : url.split('/')[0]).toLowerCase();\n};\n\n/**\n *\n * IFrameElement component.\n * @extends {React.PureComponent<IPaymentFrameElementProps>}\n */\nexport class Iframe extends React.PureComponent<IPaymentFrameElementProps> {\n private readonly iframeRef: React.RefObject<HTMLIFrameElement>;\n\n // eslint-disable-next-line @typescript-eslint/explicit-member-accessibility -- Existing code.\n constructor(props: IPaymentFrameElementProps) {\n super(props);\n this.iframeRef = React.createRef();\n }\n\n public componentDidMount(): void {\n window.addEventListener(POST_MESSAGE_NAME, this.onEvent);\n\n this.updateContentDocument();\n }\n\n public componentDidUpdate(previousProps: IPaymentFrameElementProps): void {\n if (previousProps.displayContent !== this.props.displayContent) {\n this.updateContentDocument();\n }\n }\n\n public componentWillUnmount(): void {\n window.removeEventListener(POST_MESSAGE_NAME, this.onEvent);\n }\n\n public render(): JSX.Element | null {\n const { sourceUrl, className, iframeAriaLabel, height, moduleName = 'checkout-payment-instrument' } = this.props;\n return (\n <iframe\n title={iframeAriaLabel}\n className={classnames(`${moduleName}__iframe`, className)}\n aria-label={iframeAriaLabel}\n src={sourceUrl}\n ref={this.iframeRef}\n height={height}\n sandbox='allow-scripts allow-forms allow-same-origin allow-popups'\n />\n );\n }\n\n /**\n * Post message.\n * @param parameters - Payment connector post message.\n */\n public postMessage = (parameters: IPaymentConnectorPostMessage): void => {\n if (this.iframeRef.current?.contentWindow?.postMessage) {\n this.iframeRef.current.contentWindow.postMessage(parameters.message, parameters.targetOrigin);\n }\n };\n\n /**\n * On event.\n * @param event - The message event.\n */\n private readonly onEvent = (event: MessageEvent) => {\n // eslint-disable-next-line @typescript-eslint/naming-convention -- IFrame.\n const { sourceUrl, onIFrameMessage, requestUrlOrigin, messageOrigin } = this.props;\n const sourceHost = getHostName(sourceUrl);\n const eventHost = getHostName(event.origin);\n const requestHost = getHostName(requestUrlOrigin);\n const messageHost = getHostName(messageOrigin);\n\n // Important: security check\n // check actual origin matches with expected origin\n if (\n !onIFrameMessage ||\n (sourceUrl && !(sourceHost === eventHost || requestHost === eventHost || messageHost === eventHost)) ||\n (!sourceUrl && !(requestHost === eventHost || messageHost === eventHost))\n ) {\n return;\n }\n\n onIFrameMessage(event);\n };\n\n /**\n * Update content document.\n */\n private readonly updateContentDocument = (): void => {\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Existing props.\n const { displayContent, sourceUrl, css } = this.props;\n if (!sourceUrl && displayContent && this.iframeRef.current) {\n const innerDocument = this.iframeRef.current.contentDocument;\n\n if (innerDocument) {\n innerDocument.open();\n innerDocument.write(displayContent);\n if (css) {\n // Append custom style\n const style = document.createElement('style');\n const cssNote = document.createTextNode(css);\n style.appendChild(cssNote);\n innerDocument.head.appendChild(style);\n }\n\n innerDocument.close();\n }\n }\n };\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nconst countryISOMapping: { [key: string]: string } = {\n AF: 'AFG',\n AX: 'ALA',\n AL: 'ALB',\n DZ: 'DZA',\n AS: 'ASM',\n AD: 'AND',\n AO: 'AGO',\n AI: 'AIA',\n AQ: 'ATA',\n AG: 'ATG',\n AR: 'ARG',\n AM: 'ARM',\n AW: 'ABW',\n AU: 'AUS',\n AT: 'AUT',\n AZ: 'AZE',\n BS: 'BHS',\n BH: 'BHR',\n BD: 'BGD',\n BB: 'BRB',\n BY: 'BLR',\n BE: 'BEL',\n BZ: 'BLZ',\n BJ: 'BEN',\n BM: 'BMU',\n BT: 'BTN',\n BO: 'BOL',\n BA: 'BIH',\n BW: 'BWA',\n BV: 'BVT',\n BR: 'BRA',\n VG: 'VGB',\n IO: 'IOT',\n BN: 'BRN',\n BG: 'BGR',\n BF: 'BFA',\n BI: 'BDI',\n KH: 'KHM',\n CM: 'CMR',\n CA: 'CAN',\n CV: 'CPV',\n KY: 'CYM',\n CF: 'CAF',\n TD: 'TCD',\n CL: 'CHL',\n CN: 'CHN',\n HK: 'HKG',\n MO: 'MAC',\n CX: 'CXR',\n CC: 'CCK',\n CO: 'COL',\n KM: 'COM',\n CG: 'COG',\n CD: 'COD',\n CK: 'COK',\n CR: 'CRI',\n CI: 'CIV',\n HR: 'HRV',\n CU: 'CUB',\n CY: 'CYP',\n CZ: 'CZE',\n DK: 'DNK',\n DJ: 'DJI',\n DM: 'DMA',\n DO: 'DOM',\n EC: 'ECU',\n EG: 'EGY',\n SV: 'SLV',\n GQ: 'GNQ',\n ER: 'ERI',\n EE: 'EST',\n ET: 'ETH',\n FK: 'FLK',\n FO: 'FRO',\n FJ: 'FJI',\n FI: 'FIN',\n FR: 'FRA',\n GF: 'GUF',\n PF: 'PYF',\n TF: 'ATF',\n GA: 'GAB',\n GM: 'GMB',\n GE: 'GEO',\n DE: 'DEU',\n GH: 'GHA',\n GI: 'GIB',\n GR: 'GRC',\n GL: 'GRL',\n GD: 'GRD',\n GP: 'GLP',\n GU: 'GUM',\n GT: 'GTM',\n GG: 'GGY',\n GN: 'GIN',\n GW: 'GNB',\n GY: 'GUY',\n HT: 'HTI',\n HM: 'HMD',\n VA: 'VAT',\n HN: 'HND',\n HU: 'HUN',\n IS: 'ISL',\n IN: 'IND',\n ID: 'IDN',\n IR: 'IRN',\n IQ: 'IRQ',\n IE: 'IRL',\n IM: 'IMN',\n IL: 'ISR',\n IT: 'ITA',\n JM: 'JAM',\n JP: 'JPN',\n JE: 'JEY',\n JO: 'JOR',\n KZ: 'KAZ',\n KE: 'KEN',\n KI: 'KIR',\n KP: 'PRK',\n KR: 'KOR',\n KW: 'KWT',\n KG: 'KGZ',\n LA: 'LAO',\n LV: 'LVA',\n LB: 'LBN',\n LS: 'LSO',\n LR: 'LBR',\n LY: 'LBY',\n LI: 'LIE',\n LT: 'LTU',\n LU: 'LUX',\n MK: 'MKD',\n MG: 'MDG',\n MW: 'MWI',\n MY: 'MYS',\n MV: 'MDV',\n ML: 'MLI',\n MT: 'MLT',\n MH: 'MHL',\n MQ: 'MTQ',\n MR: 'MRT',\n MU: 'MUS',\n YT: 'MYT',\n MX: 'MEX',\n FM: 'FSM',\n MD: 'MDA',\n MC: 'MCO',\n MN: 'MNG',\n ME: 'MNE',\n MS: 'MSR',\n MA: 'MAR',\n MZ: 'MOZ',\n MM: 'MMR',\n NA: 'NAM',\n NR: 'NRU',\n NP: 'NPL',\n NL: 'NLD',\n AN: 'ANT',\n NC: 'NCL',\n NZ: 'NZL',\n NI: 'NIC',\n NE: 'NER',\n NG: 'NGA',\n NU: 'NIU',\n NF: 'NFK',\n MP: 'MNP',\n NO: 'NOR',\n OM: 'OMN',\n PK: 'PAK',\n PW: 'PLW',\n PS: 'PSE',\n PA: 'PAN',\n PG: 'PNG',\n PY: 'PRY',\n PE: 'PER',\n PH: 'PHL',\n PN: 'PCN',\n PL: 'POL',\n PT: 'PRT',\n PR: 'PRI',\n QA: 'QAT',\n RE: 'REU',\n RO: 'ROU',\n RU: 'RUS',\n RW: 'RWA',\n BL: 'BLM',\n SH: 'SHN',\n KN: 'KNA',\n LC: 'LCA',\n MF: 'MAF',\n PM: 'SPM',\n VC: 'VCT',\n WS: 'WSM',\n SM: 'SMR',\n ST: 'STP',\n SA: 'SAU',\n SN: 'SEN',\n RS: 'SRB',\n SC: 'SYC',\n SL: 'SLE',\n SG: 'SGP',\n SK: 'SVK',\n SI: 'SVN',\n SB: 'SLB',\n SO: 'SOM',\n ZA: 'ZAF',\n GS: 'SGS',\n SS: 'SSD',\n ES: 'ESP',\n LK: 'LKA',\n SD: 'SDN',\n SR: 'SUR',\n SJ: 'SJM',\n SZ: 'SWZ',\n SE: 'SWE',\n CH: 'CHE',\n SY: 'SYR',\n TW: 'TWN',\n TJ: 'TJK',\n TZ: 'TZA',\n TH: 'THA',\n TL: 'TLS',\n TG: 'TGO',\n TK: 'TKL',\n TO: 'TON',\n TT: 'TTO',\n TN: 'TUN',\n TR: 'TUR',\n TM: 'TKM',\n TC: 'TCA',\n TV: 'TUV',\n UG: 'UGA',\n UA: 'UKR',\n AE: 'ARE',\n GB: 'GBR',\n US: 'USA',\n UM: 'UMI',\n UY: 'URY',\n UZ: 'UZB',\n VU: 'VUT',\n VE: 'VEN',\n VN: 'VNM',\n VI: 'VIR',\n WF: 'WLF',\n EH: 'ESH',\n YE: 'YEM',\n ZM: 'ZMB',\n ZW: 'ZWE',\n XK: 'XKX'\n};\n\n/**\n * Convert two-letter ISO country code to tree-letter ISO country code.\n * @param countryCode {string} The two-letter country code.\n * @returns The three-letter country code or empty string if not found.\n */\nexport const getThreeLetterCountryCode = (countryCode: string) => {\n return countryISOMapping[countryCode] || '';\n};\n"],"names":["CheckoutExpressPaymentContainer","React","constructor","props","_this$props$data$chec","super","moduleClassName","_getItems","slots","this","primary","length","_handleCheckoutExpressContainerHeadingChange","event","config","checkoutExpressPaymentContainerHeading","text","target","value","state","isReady","shouldHideExpressPaymentContainer","data","checkout","result","shippingAddressFromExpressCheckout","componentDidMount","reaction","_this$props$data$chec2","isExpressPaymentModulesReady","items","context","telemetry","error","item","key","includes","_this$props$data$chec3","_this$props$data$chec4","extensionPropertyKey","paymentTenderType","isModuleReady","find","property","Key","Value","BooleanValue","setState","_this$props$data$chec5","isExpressCheckoutApplied","render","_checkout$result","_checkout$result2","resources","checkoutExpressPaymentSectionLoadingMessage","isPaymentVerificationRedirection","information","request","user","isOBORequest","EnabledPaymentsForOBO","ExpressPayment","shouldHideExpressPaymentContainerClassName","classname","className","viewProps","_objectSpread","checkoutPlainContainerProps","moduleProps","waiting","WaitingComponent","Object","assign","message","title","_renderMsdyn365Text","headerProps","renderView","Msdyn365","tag","editProps","onEdit","requestContext","__decorate","observer","CheckoutGuestProfile","email","isAuthenticated","emailAddress","inputRef","checkoutErrorRef","customerReferenceRef","customerRequisitionRef","noteRef","init","async","_this$props$data$acco","_this$props$context$r","_ref","checkoutState","customerAccountInformation","accountInformation","checkoutCart","cart","hasInvoiceLine","updateEmail","undefined","Email","setErrorMsgOboUserEmailEmpty","emailOnCart","ReceiptEmail","notes","Notes","customerRequisition","CustomerRequisition","customerReference","Comment","StringExtensions","isNullOrEmpty","emailAddressFromExpressCheckout","isEmailValid","moduleState","onCancel","onSubmit","status","hasError","updateGuestProfile","updateHasGuestCheckoutEmail","newHasGuestCheckoutEmail","onChange","rowEmail","replace","RegExp","setHasError","hasCheckoutError","onChangeCustomerRef","customerRef","onChangeCustomerRequisition","onChangeNote","note","defaultNote","defaultNoteTitle","Description","Title","RestrictionValue","EmailRegex","defaultRegex","test","newGuestCheckoutEmail","updateGuestCheckoutEmail","onUpdating","submitEmail","onReady","_this$inputRef$curren","input","current","focus","guestCheckoutEmail","_setErrorMessage","errorMessage","isDataReady","hasEmailError","when","isEmailFromExpressCheckoutDifferent","isExpressAddressApplied","shouldEnableCheckoutErrorDisplayMessaging","_this$props$data$chec6","checkoutError","errorLocation","ErrorLocation","_this$props$data$chec7","checkoutErrorFocus","CheckoutModule","focusOnCheckoutError","actionContext","shouldComponentUpdate","nextProps","nextState","_this$props$data$chec8","_this$props$data$chec9","_this$props$data$chec10","_this$props$data$chec11","_this$props$data$chec12","_this$props$data$chec13","_this$props$data$chec14","_this$props$data$chec15","_note$","hasExternalSubmitGroup","classnames","alert","ErrorComponent","errorMessageTitle","showContactInfo","getShowContactInfo","canEdit","showCustomerRefInfo","enableCustomerReference","getCustomerRefInfo","showPurchaseOrderInfo","enableCustomerRequisition","getPurchaseOrderInfo","purchaseOrder","showNoteInfo","enableCartNote","getNoteInfo","noteDescription","addContactInfo","getAddContactInfo","canSubmit","canCancel","addPurchaseOrderInfo","getAddPurchaseOrderInfo","purchaseOrderNumber","addCustomerRefInfo","getAddCustomerRefInfo","addNoteInfo","getAddNoteInfo","computed","action","withModuleState","paymentInstrumentModuleId","CheckoutPlainContainer","getItems","getActiveChildModuleStates","childIds","getModule","map","filter","isDisabled","hasModuleState","clearError","forEach","isPaymentSectionContainer","ArrayExtensions","hasElements","childId","shouldEnableSinglePaymentAuthorizationCheckout","amountDue","updateIsPaymentSectionContainerReady","newIsPaymentSectionContainerReady","isSkipped","onContainerReady","isCollapse","_checkoutResult$check","_cart$TotalAmount","CartLines","TotalAmount","get","shouldSubmitContainer","shouldCollapsePaymentSection","shouldTriggerPaymentWithPlaceOrder","updateIsPaymentSectionContainerHasError","newIsPaymentSectionContainerHasError","isCheckoutCallFailed","updateIsCheckoutCallFailed","newIsCheckoutCallFailed","componentDidUpdate","some","enableControl","width","hasInitialized","container","hidden","id","loading","LoadingComponent","itemProps","typeName","initialized","disabled","skipped","ready","updating","isUpdating","pending","isPending","CheckoutTermsAndConditions","isTermsAccepted","handleTextChange","description","getTermsAndConditions","showCheckbox","isAutoSave","isTermsAndConditionAccepted","checkboxAriaLabel","termsAndConditionAcceptance","checkBox","CheckboxComponent","isChecked","ariaLabel","telemetryContent","MsDyn365","_data$checkout$result","updateTermsAndConditionsAcceptance","getErrorMessage","role","ErrorTitleComponent","ErrorMessageComponent","getCancelButton","cancelBtnLabel","cancelBtnAriaLabel","Button","color","onClick","getSaveButton","saveBtnLabel","saveBtnAriaLabel","getEditButton","editBtnLabel","editBtnAriaLabel","setError","newIsTermsAndConditionAccepted","checked","updateIsTermsAndConditionsChecked","newIsTermsAndConditionChecked","getTelemetryObject","telemetryPageName","friendlyName","isShowButtons","showControlButtons","defaultTermsAndConditionAcceptedValue","isError","isShowContent","isShowSelected","errorMessageData","viewState","isShowSaveButton","isShowEditButton","isShowCancelButton","checkoutTermsAndConditions","termsAndConditionsContent","saveButton","editButton","cancelButton","onSave","observable","ShowContactInfo","showInfoProps","Node","ShowCustomerRefInfo","_ref2","ShowPurchaseOrderInfo","_ref3","ShowNoteInfo","_ref4","AddContactInfo","_ref5","addFormProps","submitButton","inputGroupProps","label","AddPurchaseOrderInfo","_ref6","AddNoteInfo","_ref7","AddCustomerRefInfo","_ref8","_ref9","Module","ref","ItemComponent","TermsAndCondition","ErrorMessage","ContainerItemsComponent","isLoadingClassName","ApplePayButtonState","ApplePayPaymentAuthorizationResult","CheckoutApplePay","applePaySdkId","zeroAmount","handlePayButton","handler","onAuthorize","authorizePayment","cancelPayment","onPaymentMethodUpdate","updatePaymentMethod","onValidation","validateMerchant","shouldRequestShippingAddress","onShippingContactSelected","shippingContactSelected","onShippingMethodSelected","shippingMethodSelected","displayName","window","CreateApplePaySession","toString","lineDisplayName","showErrorMessage","genericErrorMessage","paymentConnectorId","getCheckoutState","cartState","channel","Error","cardPaymentAcceptResult","AccessCode","paymentToken","Settings","PaymentConnectorId","updateCardPaymentAcceptResult","newCardPaymentAcceptResult","PlaceOrder","Version","loadPaymentConnectorSdk","cardPaymentAcceptPoint","AcceptPageContent","connectorSdk","sdk","document","createElement","type","appendChild","createTextNode","body","_cardPaymentAcceptPoi","validationUrl","validationEvent","Promise","reject","cartId","Id","validationObject","domainName","location","hostname","validationBody","JSON","stringify","validationData","retrieveCardPaymentAcceptResultAsync","callerContext","btoa","catch","resolve","updateContactInfo","authorizeEvent","shippingContact","resultCode","STATUS_SUCCESS","newTotal","merchantName","amount","shippingAddress","getAddressFromShippingContact","shippingMethods","getShippingMethods","ObjectExtensions","isNullOrUndefined","_shippingMethods$at","shippingMethodId","at","identifier","updateShippingInfo","e","newShippingMethods","shippingMethod","_checkout$result3","deliveryOptionFilter","FilterDeliveryModeOption","FilterOutNonCarrierDeliveryMode","appleDeliveryOptions","getDeliveryOptionsAsync","queryResultSettings","QueryResultSettingsProxy","getPagingFromInputDataOrDefaultValue","address","element","push","ShippingChargeAmount","detail","Code","_shippingContact$addr","_shippingContact$addr2","ThreeLetterISORegionName","getThreeLetterCountryCode","countryCode","Name","getContactName","Street","addressLines","StreetNumber","City","locality","State","administrativeArea","ZipCode","postalCode","givenName","familyName","isNullOrWhitespace","_checkout$result4","warning","_checkout$result5","updateCartDeliverySpecificationInput","deliveryModeId","updateCartDeliverySpecification","_result$errorDetails","errorDetails","LocalizedMessage","applePayButtonState","Unknown","getLoyaltyAmount","loyaltyAmount","getGiftCardTotalAmount","giftCardExtends","reduce","count","giftCard","Balance","getCustomerAccountAmount","_checkoutState$custom","customerAccountAmount","_checkout$result6","AmountDue","Math","max","script","onload","_cardPaymentAcceptPoi2","isApplePayAvailable","Available","NotAvailable","src","onerror","applePayButton","checkoutApplePay","classNames","CheckoutCustomerAccountPayment","defaultLocale","baseClassName","getAvailableCredit","creditBalances","availableCredit","InvoiceAccountCreditLimit","CreditLimit","PendingBalance","InvoiceAccountBalance","InvoiceAccountPendingBalance","addPayment","handleSaveAndContinue","_clearError","updateCustomerAccountAmount","newAmount","paymentAmount","toggleCreditSection","isCreditSectionExpanded","handleCancelOrSubmit","onChangePaymentAmount","customizedAmt","amountVariable","updateMaxAmount","invalidAmountForOBOMessage","isCheckoutCustomerAccountPaymentRequired","customerAccountCreditErrorMessage","onSkip","removePayment","NaN","locale","maxPaymentAmount","Intl","NumberFormat","format","isCustomerAccountPaymentEnabled","customerInfo","b2bChannel","isChannelTypeB2B","platform","AllowOnAccountPayment","enableCustomerAccountPayment","_this$props$data$cust","_this$props$data$cred","customerInformation","MandatoryCreditLimit","min","invalidAmountExceedAmountDueMessage","invalidAmountNegativeMessage","currencyCode","orderTotal","formattedExcessCredit","excessCredit","cultureFormatter","formatCurrency","totalAmount","_this$props$data$cust2","customerSinceDate","Date","CreatedDateTime","toLocaleDateString","checkoutCustomerAccount","editView","getAccountPaymentFormEditMode","onAddPayment","maxAmount","customer","customerCreatedDate","showCreditLimit","onToggleCreditSection","creditSectionIsExpanded","onRemovePayment","appliedAmount","skipOnChangeLogic","features","skipCheckoutOnChangeLogic","summaryView","getAccountPaymentFormSummaryMode","expressPaymentSectionClassName","expressPaymentSectionInCartPageClassName","CheckoutExpress","_this","iframeRef","handlePaymentResult","resultAccessCode","_checkout$result$chec","isRedirectedFromPaymentGateway","arguments","signInUrl","settings","ReturnUrl","GetCheckoutReturnUrl","then","refreshCart","updateShouldCollapsePaymentSection","newShouldCollapsePaymentSection","tokenizedPaymentCard","CardTypeId","terminalError","shouldHideExpressCheckout","isInCartPage","_this$props$data$cart","_checkout$result7","_getUrlSync","expressPaymentDetails","isExpressCheckoutAppliedInCartPage","isExpressAddressAppliedInCartPage","newExtensionProperties","StringValue","updateExtensionProperties","shouldHideExpressPaymentSectionElementByClassName","updateIsExpressCheckoutAppliedInCartPage","newIsExpressCheckoutAppliedInCartPage","guestCheckoutUrl","getUrlSync","checkoutUrl","getCheckoutUrl","isBrowser","href","escape","_checkout$result8","_checkout$result9","setTerminalError","updateExpressCheckoutDetails","newPaymentTenderType","newIsExpressCheckoutApplied","newIsExpressAddressApplied","newEmailAddressFromExpressCheckout","newTenderLine","tenderLine","newTokenizedPaymentCard","CartsDataActions","TenderLine","TokenizedPaymentCard","_TokenizedPaymentCard","cardPrefix","CardTokenInfo","MaskedCardNumber","updateCardPrefix","newCardPrefix","_checkoutState$cardPr","cardTypeId","getCardTypeId","name","_this$props$data$cart2","getAddressFromTokenizedPaymentCard","saveShippingAndBillingAddress","updatePaymentAcceptPageData","finally","isPaymentProcessing","_getUrlSync2","_this$props$data$cart3","_this$props$data$cart4","_checkout$result10","_checkout$result11","_checkout$result12","properties","ExtensionProperties","_checkout$result13","_this$props$data$cart5","isExpressPaymentAppliedInCartPage","isEmptyCart","cookies","isConsentGiven","isPlaceOrderEnabledInRedirection","requestFormData","query","formData","redirectResult","asyncResultStatus","AsyncResultStatusCode","FAILED","_cart$result","isFetchingPaymentConnector","exception","cardTypeErrorMessage","setErrorMessage","shouldHide","_document","expressPaymentTextElements","getElementsByClassName","style","display","oniFrameMessage","_this$props$data$card","_this$props$config$pa","parse","console","express","PaymentConnectorPostMessageType","Height","_this$props$data$card2","paymentConnectorHeight","Number","newIsExpressPaymentModulesReady","Array","from","updateIsExpressPaymentModulesReady","Result","String","ShippingAddress","handleShippingAddress","handlePaymentError","Showoverlay","showOverlayModal","Hideoverlay","isShow","isOverlayModal","response","StoreOperationsDataActions","CardType","TypeId","redirectToPaymentVerification","paymentVerificationPostData","updatePaymentTenderType","saveDataInStorage","updateIsPaymentVerificationRequired","newIsPaymentVerificationRequired","redirectInfo","url","form","method","propertyName","keys","submit","defaultSubmitErrorMessage","errorValue","join","_parsedValue$email","parsedValue","TwoLetterISORegionName","address1","address2","updateBillingAddressFromExpressCheckout","newBillingAddressFromExpressCheckout","updateShippingAddressFromExpressCheckout","newShippingAddressFromExpressCheckout","updateEmailAddressFromExpressCheckout","_checkout$result14","apiSettings","updateTenderLine","updateTokenizedPaymentCard","getCardPaymentAcceptPointAction","GetCardPaymentAcceptPointInput","paymentAcceptPoint","update","AcceptPageUrl","Zip","Country","NameOnCard","Address1","Address2","Phone","isAbsoluteUrl","returnUrl","origin","LOADING","redirectAdditionalContext","redirectPaymentConnectorId","_this$props$data$card3","_this$props$data$chec16","_this$props$data$chec17","_this$props$data$chec18","_this$props$data$card4","_this$props$data$chec19","_this$props$data$chec20","_this$props$data$chec21","heading","iFrameHeightOverride","paymentStyleOverride","MessageOrigin","paymentTenderTypeClassName","toLowerCase","_document$getElements","classList","parentElement","classNameInList","startsWith","remove","add","checkoutExpress","loadingMessage","addPaymentForm","AddPaymentFormComponent","acceptPageUrl","acceptPageContent","messageOrigin","onIFrameMessage","requestUrlOrigin","moduleName","overlayModal","modal","Modal","isOpen","renderMsdyn365Text","_heading$tag","handleHeadingChange","_this$props$data$cart6","isEditorialMode","_isEmpty","params","isEditor","currentCart","values","_get","every","SUCCESS","propsRequestUrl","requestUrl","URL","_this$props$context$r2","cartUrl","substring","indexOf","canonicalUrl","toLocaleLowerCase","expressPaymentDetailsFromCartPage","_this$props$data$chec22","_this$props$data$chec23","_this$expressPaymentD","_this$expressPaymentD2","GooglePayButtonState","CheckoutGooglePay","baseRequest","apiVersion","apiVersionMinor","allowedCardNetworks","allowedCardAuthMethods","baseCardPaymentMethod","parameters","allowedAuthMethods","paymentsClient","googlePayButton","initialize","loadGoogleSdk","isReadyToPayRequest","allowedPaymentMethods","buttonState","isReadyToPay","googleClient","createButton","buttonColor","buttonType","buttonSizeMode","loadPaymentData","paymentDataRequest","statusCode","statusMessage","onPaymentAuthorized","processPayment","paymentData","transactionState","reason","intent","merchantConfiguration","connectorId","paymentMethodData","tokenizationData","token","browserInfo","acceptHeader","colorDepth","screen","language","navigator","javaEnabled","screenHeight","height","screenWidth","userAgent","timeZoneOffset","getTimezoneOffset","performRedirect","handlePaymentVerification","clientRequest","environment","paymentDataCallbacks","google","payments","api","PaymentsClient","transactionInfo","totalPriceStatus","totalPrice","cardPaymentMethod","tokenizationSpecification","gateway","gatewayMerchantId","adyenMerchantId","merchantInfo","merchantId","googleMerchantId","callbackIntents","loadPaymentAcceptPage","checkoutButton","checkoutGooglePay","paymenTenderType","configuration","getMerchantConfiguration","CheckoutPickup","isLoading","initModuleState","canPickup","isPickupTimeSlotSet","onPending","updateCartLinePickupDateTimeslot","isHeaderError","headerErrorMessage","initPickupGroup","_this$props","_featureState$result","pickupCartLines","getCartLinesforPickup","products","getProductsByCartLines","ChannelId","pickupGroups","locations","orgUnitLocations","featureState","deliveryOptions","retailMultiplePickUpOptionEnabled","feature","IsEnabled","line","group","x","pickupStoreId","FulfillmentStoreId","deliveryMode","DeliveryMode","product","RecordId","ProductId","lineDeliverySpecification","LineId","DeliverySpecification","DeliveryModeId","DeliveryPreferenceTypeValue","PickUpStoreId","PickupTimeslotStartDateTime","PickupTimeslotEndDateTime","DeliveryAddress","lineDeliverySpecs","cartLines","cartLine","OrgUnitNumber","storeName","getStoreName","selectedDate","getUTCDateWithoutTime","selectedTimeslot","StartDateTime","EndDateTime","newGroup","pickupModeName","getPickupModeDescription","generalPickupText","pickupAddress","availabilityState","PickupTimeslotAvailabilityState","None","availableDates","availableTimeslots","dailyGroupingResults","searchCriteria","DeliveryModeCode","StoreId","SearchOptionValue","getEstimatedPickupTimeslotAvailabilitiesAsync","getPickupTimeslotAvailabilityState","groupErrorMessage","noAvailableDateError","AvailableCapacity","timeslotResults","StartDate","EndDate","bypassCache","filteredPickupGroups","validateTimeslot","lineSpecs","concat","lineDeliverySpecifications","setIsCancellable","_unused","channelId","productInputs","ProductInput","getSimpleProducts","validationResult","dateErrorMessage","timeslotErrorMessage","pickupDateRequired","pickupTimeslotRequired","pickupDateTimeslotRequired","NotDefined","orgUnitLocation","_cartLine$ShippingAdd","OrgUnitName","_group$selectedTimesl","_group$selectedTimesl2","isPickupLine","isPickupMode","_this$props2","_featureState$result2","pickupDeliveryModeCode","PickupDeliveryModeCode","channelDeliveryOptionConfig","_channelDeliveryOptio","pickupDeliveryMode","PickupDeliveryModeCodes","isNullOrWhiteSpace","resourceString","deliveryOption","_foundProductDelivery","_foundProductDelivery2","foundProductDeliveryOption","deliveryO","deliveryDesc","DeliveryOptions","option","dailyResult","date","_countItems","cartlines","quantity","setDateHandler","bind","setTimeslotHandler","pickupDateLabel","pickupTimeslotLabel","pickupDateDefaultText","pickupTimeslotDefaultText","itemsText","singleItemText","pickupDateTimeslotText","pickupTimeslotPlaceHolder","pickupLocationLabel","imageSettings","useHour12TimeFormat","defaultClassName","groupsViewProps","index","_value$selectedTimesl","_value$selectedTimesl2","groupDivider","_line$product","_line$product2","_line$product3","_context$request$app","lineId","imageProps","altText","PrimaryImageUrl","fallBackSrc","getFallbackImageUrl","ItemId","app","OmniChannelMedia","gridSettings","DefaultImageSettings","loadFailureBehavior","Quantity","numberOfCartLines","itemText","itemTitle","storeInfo","groupHeader","CheckoutPickupGroupHeader","lineImageProps","cartLineImages","CheckoutPickupCartLines","dateString","getDate","timeslotString","getTimeslot","timeslotInfoProps","content","selectedDateTimeslotNode","CheckoutPickupTimeslotInfo","addressProps","CheckoutPickupAddress","dropdownClassName","labelClassName","dropdownSelectClassName","dateDropdownNode","CheckoutPickupDateDropdown","defaultText","labelText","dropdownId","controlledByParent","labelClassname","dropdownClassname","timeslotDropdownNode","CheckoutPickupTimeslotDropdown","timeslotPlaceHolder","viewProp","pickupGroupContainer","dateTimeslotContainer","CheckoutPickupError","pickupDateDropdown","pickupTimeslotDropdown","selectedDateTimeslot","isShowDropdown","checkoutPickup","headerError","Waiting","pickupDate","oldGroup","lineSpec","noAvailableTimeslotError","groups","pickupTimeslot","pickupGroupViewProps","CheckoutPaymentInstrument","_this$props$config$pa2","shouldCheckConnectorId","paymentConnectorAmountMessage","postMessageToIframe","isPrimaryPayment","CardPrefix","handlePaymentCardPrefix","Redirect","handlePaymentRedirect","termsAndConditionErrorMessage","setIsSubmitContainer","isTermsAndConditionChecked","AdditionalContext","saveBillingAddress","handleAdditionalContext","_handleCheckoutError","redirectData","isPaymentVerificationRequried","resolveCardTypesAsync","_this$props$config$pa3","_value","Message","moduleStatusWhenExpressCheckoutApplied","isCancellable","shouldPaidByCard","_handleExpressCheckout","showBillingAddress","shouldPassLocaleToiFrame","setPending","postMessage","additionalContext","paymentConnectorExtraContextMessage","log","billingAddress","House","updateBillingAddress","newBillingAddress","togglePayment","onDisable","paymentConnectorSubmitMessage","_this$props$config$pa4","hasSelectedItem","_this$props$config$pa5","updateIsExpressCheckoutApplied","updateIsExpressAddressApplied","_this$props$config$pa6","checkoutResult","errorPaymentConnectorId","errorCode","setCheckoutErrors","_this$props$config$pa7","_config$paymenTenderT","isPaidByOtherPaymentSource","isCartContainsItemsForShipping","emailDeliveryModeCode","isCartHasSelectedDeliveryMethods","shouldReloadAcceptPage","_this$props$config$pa8","checkoutErrorPaymentConnectorId","_this$props$data$card5","_this$props$config$pa9","_this$props$data$card6","_this$props$data$chec24","_this$props$data$chec25","_this$props$config$pa10","visibilityObserver","isVisible","isSinglePayment","PaymentInstrument","checkoutPaymentInstrument","paymentInformation","PaymentInformationComponent","withVisibilityObserver","OverlayModal","_objectWithoutProperties","_excluded","CheckoutErrors","ctx","apiError","clientCheckoutError","consoleCheckoutErrors","checkoutErrorsList","Console","consoleCheckoutError","errorMessageResource","getCheckoutErrorMessage","Checkout","updateCheckoutError","newCheckoutError","updateShouldFocusOnCheckoutError","newShouldFocusOnCheckoutError","genericError","scrollIntoView","updateCheckoutErrorFocus","newCheckoutErrorFocus","setCheckoutErrorFocus","checkoutModuleId","checkoutModule","errorMessageFromAPI","errorResource","resource","ActionError","ErrorCode","ErrorMessageResource","checkoutTimeoutErrorMessage","Microsoft_Dynamics_Commerce_Runtime_BlockedLoyaltyCard","blockedLoyaltyCardErrorMessage","CheckoutLoyalty","Microsoft_Dynamics_Commerce_Runtime_CustomerAccountLimitSignDifferentFromAmountDue","customerAccountLimitSignDifferentFromAmountDueErrorMessage","Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsAvailableCreditLimit","customerAccountPaymentExceedsAvailableCreditLimitErrorMessage","Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsCustomerAccountFloorLimit","customerAccountPaymentExceedsCustomerAccountFloorLimitErrorMessage","Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsTotalAmountForCarryOutAndReturnItems","customerAccountPaymentExceedsTotalAmountForCarryOutAndReturnItemsErrorMessage","Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentForCustomerWithoutAllowOnAccount","customerAccountPaymentForCustomerWithoutAllowOnAccountErrorMessage","Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentNotAllowedForOpenInvoices","customerAccountPaymentNotAllowedForOpenInvoicesErrorMessage","Microsoft_Dynamics_Commerce_Runtime_FraudRisk","fraudRiskErrorMessage","Microsoft_Dynamics_Commerce_Runtime_GiftCardBalanceInquiryFailed","giftCardBalanceInquiryFailedErrorMessage","CheckoutGiftCard","Microsoft_Dynamics_Commerce_Runtime_GiftCardCurrencyMismatch","giftCardCurrencyMismatchErrorMessage","Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion","invalidCartVersionErrorMessage","Microsoft_Dynamics_Commerce_Runtime_InvalidLoyaltyCardNumber","invalidLoyaltyCardNumberErrorMessage","Microsoft_Dynamics_Commerce_Runtime_InvalidPaymentRequest","invalidPaymentRequestErrorMessage","Microsoft_Dynamics_Commerce_Runtime_InvalidPaymentRequest_Console","invalidPaymentRequestConsoleErrorMessage","Microsoft_Dynamics_Commerce_Runtime_MissingRequiredCartTenderLines","missingRequiredCartTenderLinesErrorMessage","Microsoft_Dynamics_Commerce_Runtime_MultipleCustomerAccountPaymentsNotAllowed","multipleCustomerAccountPaymentsNotAllowedErrorMessage","Microsoft_Dynamics_Commerce_Runtime_NoMoreThanOneLoyaltyTender","noMoreThanOneLoyaltyTenderErrorMessage","Microsoft_Dynamics_Commerce_Runtime_NoResponseFromGatewayForGiftCardBalanceInquiry","noResponseFromGatewayForGiftCardBalanceInquiryErrorMessage","Microsoft_Dynamics_Commerce_Runtime_NoTenderLoyaltyCard","noTenderLoyaltyCardErrorMessage","Microsoft_Dynamics_Commerce_Runtime_NotEnoughRewardPoints","notEnoughRewardPointsErrorMessage","Microsoft_Dynamics_Commerce_Runtime_PaymentAlreadyVoided","paymentAlreadyVoidedErrorMessage","Microsoft_Dynamics_Commerce_Runtime_PaymentAmountExceedsGiftBalance","paymentAmountExceedsGiftBalanceErrorMessage","Microsoft_Dynamics_Commerce_Runtime_PaymentRequiresMerchantProperties","paymentRequiresMerchantPropertiesErrorMessage","Microsoft_Dynamics_Commerce_Runtime_PaymentRequiresMerchantProperties_Console","paymentRequiresMerchantPropertiesConsoleErrorMessage","Microsoft_Dynamics_Commerce_Runtime_PaymentUsingUnauthorizedAccount","paymentUsingUnauthorizedAccountErrorMessage","Microsoft_Dynamics_Commerce_Runtime_RefundAmountMoreThanAllowed","refundAmountMoreThanAllowedErrorMessage","Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePayment","unableToAuthorizePaymentErrorMessage","Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardAdditionalContextRequired","unableToAuthorizePaymentCardAdditionalContextRequiredErrorMessage","Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardTypeMissingOrNotSupported","unableToAuthorizePaymentCardTypeMissingOrNotSupportedErrorMessage","Microsoft_Dynamics_Commerce_Runtime_UnableToCancelPayment","unableToCancelPaymentErrorMessage","Microsoft_Dynamics_Commerce_Runtime_UnableToReadCardTokenInfo","unableToReadCardTokenInfoErrorMessage","Microsoft_Dynamics_Commerce_Runtime_UnableToRetrieveCardPaymentAcceptResult","unableToRetrieveCardPaymentAcceptResultErrorMessage","CheckoutStateInput","getCacheKey","buildCacheKey","getCacheObjectType","dataCacheType","createObservableDataAction","CheckoutState","inputData","_giftCards","_giftCardExtends","_loyaltyAmount","_guestCheckoutEmail","_customerReference","_customerRequisition","_note","_isTermsAndConditionAccepted","_customerAccountAmount","defineProperty","prototype","_tokenizedPaymentCard","_tenderLine","_billingAddress","_shippingAddress","_cardPrefix","_loyaltyCardNumber","updateShippingAddress","newShippingAddress","removeGiftCard","giftCardNumber","removeGiftCardExtend","addGiftCard","__spreadArrays","addGiftCardExtend","updateLoyaltyCardNumber","newLoyaltyCardNumber","updateLoyaltyAmount","WrappedComponent","_super","ModuleState","call","initializeState","_b","states","getModuleStates","updateModuleStates","__assign","_a","isRequired","isSubmitContainer","getModuleStateManager","validate","isCancelAllowed","setIsRequired","moduleId","getModuleByTypeName","getModuleStateManagerByTypeName","options","moduleStates","_moduleState","modules","_validateLeaf","source","module","isMatch","_validateContainer","allMatched","skipSkippableItem","_isPaymentSectionContainer","__extends","ModuleStatesCacheKey","cacheKey","County","prop","showQty","Image","viewports","xs","q","w","h","lg","xl","lazyload","quality","orderedProducts","redirect","updatedCartVersion","salesOrder","CartCheckout","lineItemIdsToRemove","getCartState","activeCart","activeCartLine","checkoutCartLine","removeCartLines","cartLineIds","removeAllPromoCodes","EmptyActiveCartInvoice","EmptyActiveCart","orderConfirmationUrl","separator","updateSalesOrder","newSalesOrder","newOrderedProducts","cancelButtonText","submitButtonText","iframeAriaLabel","Iframe","displayContent","sourceUrl","css","defaultPaymentConnectorStyle","paymentConnectorMessage","messageType","targetOrigin","ExtraContext","Submit","Amount","OPERATIONS","findTenderIdTypeByOperationId","tenderTypes","operationId","matchedTenderType","tenderType","OperationId","TenderTypeId","roundNumber","toFixed","channelConfiguration","Currency","cartTenderLines","getTenderLinePromises","loyaltyCardNumber","LoyaltyCardId","chargedAmount","loyaltyTenderLinePromise","getTenderTypesAsync","getLoyaltyTenderLine","customerAccountTenderLinePromise","CustomerId","createCustomerAccountTenderLine","giftCardExtend","_giftCardExtend$Expir","_giftCardExtend$Expir2","tenderTypeId","giftCardPin","Pin","giftCardExpirationYear","ExpirationDate","parseInt","split","giftCardExpirationMonth","creditCardTenderLinePromise","GiftCardId","GiftCardPin","GiftCardExpirationYear","GiftCardExpirationMonth","getGiftCardTenderLine","currency","CardPaymentAcceptResult","getCreditCardTenderLineForSinglePaymentAuth","cartTypeId","TenderType","cardTenderLine","getCreditCardTenderLine","all","cartVersion","checkoutAsync","_error$data","_error$data2","_cardPaymentAcceptRes","_cardPaymentAcceptRes2","updateRedirectAdditionalContext","newRedirectAdditionalContext","updateRedirectPaymentConnectorId","newRedirectPaymentConnectorId","updateCheckoutErrorPaymentConnectorId","newCheckoutErrorPaymentConnectorId","removeCheckoutCartId","VisibilityObserver","selfRef","initMutationObserver","targetNode","getElementsByTagName","MutationObserver","mutationObserver","handleVisibilityChange","observe","attributes","childList","subtree","stopMutationObserver","_this$state$observer","disconnect","offsetWidth","offsetHeight","componentWillUnmount","onAddAccountPayment","preventDefault","onChangeAmountHandler","customState","customizedAmount","returnModifiedState","getLocaleBasedCustomizedPrice","keyCode","addPaymentButtonLabel","inputAmountLabel","inputAmountAriaLabel","customerSinceLabel","accountCreditLabel","creditDetailsSectionLabel","orderTotalLabel","availableCreditLabel","creditExcessLabel","appliedCustomerAccountPaymentLabel","removeCustomerAccountPaymentLabel","accountCreditDetails","inputLabel","formProps","addPaymentButton","isNaN","inputAmount","onInput","currentTarget","onKeyDown","which","customerName","customerAccountNumber","AccountNumber","customerSince","accountCredit","accountDetails","Alert","assertive","fade","includeAlertClass","appliedLine","bottomBorder","inputAmountSummaryLabel","paymentAmountInput","PaymentInformation","changePaymentButtonText","cardTitle","cardNumberLabel","expiresDateLabel","addressTitle","ExpirationMonth","ExpirationYear","cardLastNDigit","substr","isValidCardNumber","emailLabel","emailErrortext","onInputChange","onInputChangeHandler","customerRefLabel","customerRefErrortext","maxLength","purchaseOrderLabel","purchaseOrderErrortext","noteLabel","noteErrortext","DateTimeFormat","timeZone","placeHolder","startDate","endDate","hour","minute","hour12","formatter","UTC","getUTCFullYear","getUTCMonth","getUTCDate","defaultKey","updateDateSelection","notification","selectedOption","getDateMap","has","mapDatesToOptions","dates","defaultOption","unshift","findIndex","getTime","dropdownOptions","Map","set","toggleColor","htmlFor","LabeledDropdown","onSelectOption","updateTimeslotSelection","getTimeslotMap","mapTimeslotsToOptions","timeslots","_selectedTimeslot$Sta","_value$StartDateTime","_selectedTimeslot$End","_value$EndDateTime","Loading","payLoad","getPayloadObject","attribute","getTelemetryAttributes","POST_MESSAGE_NAME","getHostName","_this$iframeRef$curre","contentWindow","onEvent","sourceHost","eventHost","requestHost","messageHost","updateContentDocument","innerDocument","contentDocument","open","write","cssNote","head","close","addEventListener","previousProps","removeEventListener","sandbox","countryISOMapping","AF","AX","AL","DZ","AS","AD","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BA","BW","BV","BR","VG","IO","BN","BG","BF","BI","KH","CM","CA","CV","KY","CF","TD","CL","CN","HK","MO","CX","CC","CO","KM","CG","CD","CK","CR","CI","HR","CU","CY","CZ","DK","DJ","DM","DO","EC","EG","SV","GQ","ER","EE","ET","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GG","GN","GW","GY","HT","HM","VA","HN","HU","IS","IN","ID","IR","IQ","IE","IM","IL","IT","JM","JP","JE","JO","KZ","KE","KI","KP","KR","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MK","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MD","MC","MN","ME","MS","MA","MZ","MM","NA","NR","NP","NL","AN","NC","NZ","NI","NE","NG","NU","NF","MP","NO","OM","PK","PW","PS","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","RE","RO","RU","RW","BL","SH","KN","LC","MF","PM","VC","WS","SM","ST","SA","SN","RS","SC","SL","SG","SK","SI","SB","SO","ZA","GS","SS","ES","LK","SD","SR","SJ","SZ","SE","CH","SY","TW","TJ","TZ","TH","TL","TG","TK","TO","TT","TN","TR","TM","TC","TV","UG","UA","AE","GB","US","UM","UY","UZ","VU","VE","VN","VI","WF","EH","YE","ZM","ZW","XK"],"sourceRoot":""}