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kQ9B,OArQ0BC,EAAAA,EAAAA,IAAAA,EAAAA,GAMfC,EAAAA,UAAAA,sBAAP,SAA6B3I,GACzB,OAAIjE,KAAKV,QAAU2E,GAMhB2I,EAAAA,UAAAA,OAAP,WACY,IAAAxY,EAAO4L,KAAKV,MAAK,GACzB,OAAOjD,EAAAA,cAACqN,GAAgB,WAAK1J,KAAKV,MAAK,CAAEuB,YAAab,KAAKsL,sBAAsBlX,OAfnFwY,GAAW,SADhBxH,EAAAA,IAAQ,uCACHwH,GAAN,CAA0BvQ,EAAAA,mBC5B9BuP,EAAOiB,QAAUxQ,cCAjBuP,EAAOiB,QAAUC","sources":["webpack://msdyn365.commerce.online/./src/actions/get-on-account-guest-checkout-state.ts?1a00","webpack://msdyn365.commerce.online/./src/actions/get-payment-onbill-value.action.ts?df19","webpack://msdyn365.commerce.online/./src/actions/savesubmit-enabledisable.action.ts?d0df","webpack://msdyn365.commerce.online/./src/common/utils/helper.tsx?25b9","webpack://msdyn365.commerce.online/./src/modules/c-checkout-customer-account-payment/components/get-account-payment-form-edit-mode.tsx?be9c","webpack://msdyn365.commerce.online/./src/modules/c-checkout-customer-account-payment/components/get-account-payment-form-summary-mode.tsx?eb12","webpack://msdyn365.commerce.online/./src/modules/c-checkout-customer-account-payment/c-checkout-customer-account-payment.tsx?41f1","webpack://msdyn365.commerce.online/./src/modules/c-checkout-customer-account-payment/c-checkout-customer-account-payment.view.tsx?2dc5","webpack://msdyn365.commerce.online/./lib/c-checkout-customer-account-payment/module-registration.js?5c3a","webpack://msdyn365.commerce.online/../../src/checkout-state-data-action.ts?8344","webpack://msdyn365.commerce.online/../../src/checkout-state.ts?acd8","webpack://msdyn365.commerce.online/../../../src/module-state-manager/module-state.ts?7579","webpack://msdyn365.commerce.online/../../../src/module-state-manager/with-module-state.tsx?61ca","webpack://msdyn365.commerce.online/external var \"React\"?0d3b","webpack://msdyn365.commerce.online/external var \"ReactDOM\"?853b"],"sourcesContent":["// on-account-guest-checkout-state.ts\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nexport interface IOnAccountGuestCheckoutState {\r\n appliedOnAccount: boolean;\r\n receiptEmail: string;\r\n rentOptIn: boolean;\r\n emailOptIn: boolean;\r\n}\r\n\r\n/**\r\n * OnAccountGuestCheckoutState - action input\r\n */\r\nexport class OnAccountGuestCheckoutStateInput implements IActionInput {\r\n public getCacheKey = () => `OnAccountGuestCheckoutState`;\r\n public getCacheObjectType = () => 'OnAccountGuestCheckoutState';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\n/**\r\n * OnAccountGuestCheckoutState - action\r\n */\r\nexport async function onAccountGuestCheckoutStateAction(\r\n input: OnAccountGuestCheckoutStateInput,\r\n ctx: IActionContext\r\n): Promise {\r\n return { appliedOnAccount: false, receiptEmail: '', rentOptIn: false, emailOptIn: false };\r\n}\r\n\r\n/**\r\n * OnAccountGuestCheckoutState - create new input for create action\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\r\n return new OnAccountGuestCheckoutStateInput();\r\n};\r\n\r\n/**\r\n * OnAccountGuestCheckoutState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >onAccountGuestCheckoutStateAction,\r\n input: createInput\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * GetPaymentOnbillValue Input Action\r\n */\r\nexport class GetPaymentOnbillValueInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `GetPaymentOnbillValue`;\r\n public getCacheObjectType = () => 'GetPaymentOnbillValue';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetPaymentOnbillValueData {\r\n onBill: boolean;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetPaymentOnbillValueInput();\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: GetPaymentOnbillValueInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { onBill: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'GetPaymentOnbillValue',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * SavesubmitEnabledisable Input Action\r\n */\r\nexport class SavesubmitEnabledisableInput implements Msdyn365.IActionInput {\r\n // TODO: Construct the input needed to run the action\r\n constructor() {}\r\n\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `SavesubmitEnabledisable`;\r\n public getCacheObjectType = () => 'SavesubmitEnabledisable';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface ISavesubmitEnabledisableData {\r\n disableButton: boolean;\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new SavesubmitEnabledisableInput();\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function action(input: SavesubmitEnabledisableInput, ctx: Msdyn365.IActionContext): Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { disableButton: false };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >action,\r\n // TODO: Give your data action a unique id\r\n id: 'SavesubmitEnabledisable',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});","/* eslint-disable security/detect-object-injection */\r\nimport { IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\r\nimport { updateAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\r\nimport {\r\n AttributeValueBase,\r\n AttributeTextValue,\r\n CartLine,\r\n SimpleProduct,\r\n CustomerAttribute,\r\n AsyncResult,\r\n CommerceProperty\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ObjectExtensions,\r\n IDimensionForSelectedVariant,\r\n IDimensionValueForSelectedVariant\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { ICartState } from '../../modules/c-checkout/mod/state-interfaces';\r\nimport { IOnAccountGuestCheckoutState, OnAccountGuestCheckoutStateInput } from '../../actions/get-on-account-guest-checkout-state';\r\n\r\n// Created Custom Interface for Cart Attributes\r\nexport interface ICartAttributes {\r\n attributeName: string;\r\n attributeValue: boolean | string;\r\n}\r\n\r\n// Set Customer Attribues\r\nexport const setCustomerAttribute = (attributeName: string, attributeValue: string): CustomerAttribute => {\r\n const privIdAttribute: CustomerAttribute = {\r\n Name: attributeName,\r\n KeyName: attributeName,\r\n ExtensionProperties: [],\r\n AttributeValue: {\r\n StringValue: attributeValue\r\n },\r\n NameTranslations: []\r\n };\r\n\r\n return privIdAttribute;\r\n};\r\n\r\n// Find Customer Attributes if exist update it other wise push\r\nexport const findCustomerAttribute = async (\r\n currentAttributes: CustomerAttribute[],\r\n attributeObj: CustomerAttribute\r\n): Promise => {\r\n const attributeIndex = currentAttributes.findIndex(\r\n (attribute: CustomerAttribute) => attribute.Name?.toLowerCase() === attributeObj.Name?.toLowerCase()\r\n );\r\n if (attributeIndex > -1) {\r\n currentAttributes[attributeIndex] = attributeObj;\r\n } else {\r\n currentAttributes.push(attributeObj);\r\n }\r\n\r\n return currentAttributes;\r\n};\r\n\r\n// Set Order and Cart Attribues\r\nexport const setNameAttribute = (attributeName: string, attributeValue: string): AttributeValueBase => {\r\n const privIdAttribute = {\r\n // @ts-ignore\r\n '@odata.type': '#Microsoft.Dynamics.Commerce.Runtime.DataModel.AttributeTextValue',\r\n Name: attributeName,\r\n ExtensionProperties: [],\r\n TextValue: attributeValue,\r\n TextValueTranslations: []\r\n };\r\n\r\n return privIdAttribute as AttributeTextValue;\r\n};\r\n\r\n// Find attribute if exist update it other wise push\r\n\r\nexport const findAttribute = async (\r\n currentAttributes: AttributeTextValue[],\r\n attributeObj: AttributeTextValue\r\n): Promise => {\r\n const attributeIndex = currentAttributes.findIndex(\r\n (attribute: AttributeTextValue) => attribute.Name?.toLowerCase() === attributeObj.Name?.toLowerCase()\r\n );\r\n\r\n if (attributeIndex > -1) {\r\n currentAttributes[attributeIndex] = attributeObj;\r\n } else {\r\n currentAttributes.push(attributeObj);\r\n }\r\n\r\n return currentAttributes;\r\n};\r\n\r\n// Set Extension Properties\r\nexport const setExtensionProperties = (attributeName: string, attributeValue: string | boolean | number): CommerceProperty => {\r\n const privIdExtensionProperty: CommerceProperty = {\r\n Key: attributeName\r\n };\r\n if (typeof attributeValue === 'string') {\r\n privIdExtensionProperty.Value = {\r\n StringValue: attributeValue\r\n };\r\n } else if (typeof attributeValue === 'boolean') {\r\n privIdExtensionProperty.Value = {\r\n BooleanValue: attributeValue\r\n };\r\n }\r\n\r\n return privIdExtensionProperty;\r\n};\r\n\r\n// Find Extension Properties if exist update it other wise push\r\nexport const findExtensionProperty = async (\r\n currentProperties: CommerceProperty[],\r\n attributeObj: CommerceProperty\r\n): Promise => {\r\n const propertyIndex = currentProperties.findIndex(\r\n (property: CommerceProperty) => property.Key?.toLowerCase() === attributeObj.Key?.toLowerCase()\r\n );\r\n\r\n if (propertyIndex > -1) {\r\n currentProperties[propertyIndex] = attributeObj;\r\n } else {\r\n currentProperties.push(attributeObj);\r\n }\r\n\r\n return currentProperties;\r\n};\r\n\r\n// Find Extension Properties if exist update it other wise push\r\nexport const findToRemoveExtensionProperty = async (\r\n currentProperties: CommerceProperty[],\r\n attributeObj: CommerceProperty\r\n): Promise => {\r\n const propertyIndex = currentProperties.findIndex(\r\n (property: CommerceProperty) => property.Key?.toLowerCase() === attributeObj.Key?.toLowerCase()\r\n );\r\n\r\n if (propertyIndex > -1) {\r\n currentProperties.splice(propertyIndex, 1);\r\n }\r\n\r\n return currentProperties;\r\n};\r\n\r\nexport const getNBFlagForCartLine = (cartline: CartLine): boolean | undefined => {\r\n const NBFlag: AttributeTextValue | undefined = cartline.AttributeValues?.find(attr => attr.Name === 'NonBackOrderableFlag');\r\n if (NBFlag && NBFlag.TextValue) {\r\n const value = JSON.parse(NBFlag.TextValue);\r\n return value;\r\n }\r\n return;\r\n};\r\n\r\n// ITS - Customization to get dimension value for selected product\r\nexport const getDiemnsionValueForSelectedProduct = (\r\n productDimensions: IDimensionForSelectedVariant[],\r\n product: SimpleProduct\r\n): IDimensionValueForSelectedVariant | undefined => {\r\n const dimensions = (productDimensions[0].dimensionValuesWithInventory ??\r\n productDimensions[0].DimensionValues ??\r\n []) as IDimensionValueForSelectedVariant[];\r\n let dimension = dimensions.find(\r\n value =>\r\n !ObjectExtensions.isNullOrUndefined(value.DimensionValue?.RecordId ?? value.RecordId) &&\r\n value.ProductIds &&\r\n value.ProductIds.find(prod => prod === product.RecordId)\r\n );\r\n dimension = dimension && dimension.DimensionValue;\r\n return dimension;\r\n};\r\n\r\nexport const getNBFlagFromProductDimensions = (\r\n productDimensions: IDimensionForSelectedVariant[],\r\n product: SimpleProduct\r\n): boolean | undefined => {\r\n const dimension = getDiemnsionValueForSelectedProduct(productDimensions, product);\r\n const NBFlag =\r\n dimension &&\r\n dimension.ExtensionProperties &&\r\n dimension.ExtensionProperties[0] &&\r\n dimension.ExtensionProperties[0].Key === 'NonBackOrderableFlag'\r\n ? dimension.ExtensionProperties[0].Value?.BooleanValue\r\n : false;\r\n return NBFlag;\r\n};\r\n// ITS - Customization End\r\n\r\n// ITS Customization\r\n// export const updateCartAttributes = async (checkoutCart: ICartState, attributeName: string, attributeValue: string) => {\r\n// const newCart = {...checkoutCart.cart};\r\n// const newAttribute = setNameAttribute(attributeName, attributeValue);\r\n// let currentAttributes: AttributeValueBase[] = newCart?.AttributeValues || [];\r\n// currentAttributes = await findAttribute(currentAttributes, newAttribute);\r\n// newCart.AttributeValues = currentAttributes; // Updates cart with Attribute Values\r\n// updateCart(checkoutCart, newCart);\r\n// // await checkoutCart.updateAttributeValues({ newAttributeValues: newCart.AttributeValues })\r\n// };\r\n\r\nexport const updateCartExtensionProperties = async (\r\n checkoutCart: ICartState,\r\n attributeName: string,\r\n attributeValue: string,\r\n context?: ICoreContext\r\n) => {\r\n const newCart = { ...checkoutCart.cart };\r\n const newProperty = setExtensionProperties(attributeName, attributeValue);\r\n let currentExtensionProperties: CommerceProperty[] = newCart?.ExtensionProperties || [];\r\n currentExtensionProperties = await findExtensionProperty(currentExtensionProperties, newProperty);\r\n newCart.ExtensionProperties = currentExtensionProperties; // Updates cart with Extension Properties\r\n // newCart.ExtensionProperties && await updateAsync({callerContext: context?.actionContext!}, newCart);\r\n newCart.ExtensionProperties && (await checkoutCart.updateExtensionProperties({ newExtensionProperties: newCart.ExtensionProperties }));\r\n};\r\n\r\nexport const removeCartExtensionProperties = async (checkoutCart: ICartState, attributeName: string, context?: ICoreContext) => {\r\n const newCart = { ...checkoutCart.cart };\r\n const currentExtensionProperties: CommerceProperty[] = newCart?.ExtensionProperties || [];\r\n const newExtensionProperties = currentExtensionProperties.filter(\r\n (property: CommerceProperty) => property.Key?.toLowerCase() !== attributeName.toLowerCase()\r\n );\r\n newCart.ExtensionProperties = newExtensionProperties; // Updates cart with Extension Properties\r\n console.log(newCart.ExtensionProperties, newExtensionProperties);\r\n newCart.ExtensionProperties && (await updateAsync({ callerContext: context?.actionContext! }, newCart));\r\n // newCart.ExtensionProperties && await checkoutCart.updateExtensionProperties({ newExtensionProperties: newCart.ExtensionProperties });\r\n};\r\n\r\nexport const updateCartProperties = async (checkoutCart: ICartState, attributesArr: ICartAttributes[]) => {\r\n const newCart = { ...checkoutCart.cart };\r\n let currentExtensionProperties: CommerceProperty[] = newCart?.ExtensionProperties || [];\r\n await (async function() {\r\n for (const attr of attributesArr) {\r\n const newProperty = setExtensionProperties(attr.attributeName, attr.attributeValue);\r\n currentExtensionProperties = await findExtensionProperty(currentExtensionProperties, newProperty);\r\n }\r\n })();\r\n newCart.ExtensionProperties = [...currentExtensionProperties]; // Updates cart with Extension Properties\r\n newCart.ExtensionProperties && (await checkoutCart.updateExtensionProperties({ newExtensionProperties: newCart.ExtensionProperties }));\r\n};\r\n// ITS Customization\r\n// export const updateCartAttributes = async (checkoutCart: ICartState, attributesArr: ICartAttributes[]) => {\r\n// const newCart = {...checkoutCart.cart};\r\n// let currentAttributes: AttributeValueBase[] = newCart?.AttributeValues || [];\r\n// await (async function() {\r\n// for (const attr of attributesArr) {\r\n// const newAttribute = setNameAttribute(attr.attributeName, attr.attributeValue);\r\n// currentAttributes = await findAttribute(currentAttributes, newAttribute);\r\n// newCart.AttributeValues = currentAttributes; // Updates cart with Attribute Values\r\n// console.log('newCart Attrbiutes::::', newCart.AttributeValues, ' with the attribuite::::', attr);\r\n// }\r\n// })();\r\n// newCart.AttributeValues && await checkoutCart.updateAttributeValues({ newAttributeValues: newCart.AttributeValues });\r\n// console.log('newCart Attrbiutes::::', newCart.AttributeValues);\r\n// };\r\n\r\nexport const updateContext = (context: ICoreContext>, key: string, attributeValue: boolean | string) => {\r\n const input = new OnAccountGuestCheckoutStateInput();\r\n const value = context.actionContext.get(input.getCacheObjectType(), input.getCacheKey()) as AsyncResult;\r\n context.actionContext.update(input, { ...value.result, [key]: attributeValue });\r\n};\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\r\n// import { findCustomerAttribute, setCustomerAttribute, updateCartExtensionProperties, updateContext } from '../../../common/utils/helper';\r\nimport { updateCartExtensionProperties, updateContext } from '../../../common/utils/helper';\r\n// import { Customer, CustomerAttribute } from '@msdyn365-commerce/retail-proxy';\r\nimport { Customer } from '@msdyn365-commerce/retail-proxy';\r\nimport { Alert, Button, INodeProps, NodeTag } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n// import { updateAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CustomersDataActions.g';\r\nimport { IOnAccountGuestCheckoutState } from '../../../actions/get-on-account-guest-checkout-state';\r\nimport { ICCheckoutCustomerAccountPaymentResources } from '../c-checkout-customer-account-payment.props.autogenerated';\r\nimport { ICartState } from '../../c-checkout/mod/state-interfaces';\r\nimport { SavesubmitEnabledisableInput } from '../../../actions/savesubmit-enabledisable.action';\r\nimport { GetPaymentOnbillValueInput } from '../../../actions/get-payment-onbill-value.action';\r\n\r\nexport interface IGetAccountPaymentEditViewFormInput {\r\n resources: ICCheckoutCustomerAccountPaymentResources;\r\n amount: number;\r\n maxAmount: number;\r\n customer: Customer | undefined;\r\n customerCreatedDate: string;\r\n availableCredit: string;\r\n showCreditLimit: boolean;\r\n errorMessage: string | undefined;\r\n creditSectionIsExpanded: boolean;\r\n orderTotal: string;\r\n excessCredit: string | undefined;\r\n appliedAmount: string | undefined;\r\n DOBValue: string;\r\n DOBError: boolean;\r\n DOBInvalidError: boolean;\r\n loginDOB: string | undefined;\r\n onAddPayment(): Promise;\r\n onChangePaymentAmount(newAmount: number): void;\r\n onToggleCreditSection(): void;\r\n onRemovePayment(): Promise;\r\n onChangeDOB(event: any): void;\r\n onChangeDOBError(value: boolean): void;\r\n onChangeDOBInvalidError(value: boolean): void;\r\n disableDates(): string;\r\n context: ICoreContext>;\r\n checkoutCart: ICartState | undefined;\r\n onAccountGuestCheckoutState: IOnAccountGuestCheckoutState | undefined;\r\n}\r\n\r\nexport interface IAccountPaymentEditViewForm {\r\n formProps: INodeProps;\r\n inputLabel: React.ReactNode;\r\n inputAmount: React.ReactNode;\r\n addPaymentButton: React.ReactNode;\r\n customerName: React.ReactNode;\r\n customerAccountNumber: React.ReactNode;\r\n customerSince: React.ReactNode;\r\n accountCredit: React.ReactNode;\r\n alert: React.ReactNode;\r\n accountDetails: React.ReactNode;\r\n appliedLine: React.ReactNode;\r\n bottomBorder: React.ReactNode;\r\n dateOfBirth: React.ReactNode;\r\n dobErrorLabel: React.ReactNode;\r\n dobInvalidErrorLabel: React.ReactNode;\r\n InputdobLabel: React.ReactNode;\r\n}\r\n\r\n// Valiate Date Regex.\r\nfunction isValidDate(dateString: string) {\r\n const regex = /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$/;\r\n return regex.test(dateString);\r\n}\r\n\r\n/**\r\n * On Add Account Payment Function.\r\n * @param onAddPayment -On Add Payment Function.\r\n * @returns Call of Add payment function.\r\n */\r\nconst onAddAccountPayment = (\r\n onAddPayment: () => Promise,\r\n context: ICoreContext>,\r\n customer: Customer | undefined,\r\n DOBValue: string,\r\n onChangeDOBError: (value: boolean) => void,\r\n onChangeDOBInvalidError: (value: boolean) => void,\r\n DOBError: boolean,\r\n DOBInvalidError: boolean,\r\n checkoutCart: ICartState | undefined,\r\n onAccountGuestCheckoutState: IOnAccountGuestCheckoutState | undefined\r\n) => async (event: React.SyntheticEvent): Promise => {\r\n event.preventDefault();\r\n context.actionContext.update(new GetPaymentOnbillValueInput(), { onBill: true });\r\n context.actionContext.update(new SavesubmitEnabledisableInput(), { disableButton: false });\r\n const dobDate = new Date(DOBValue); //dd-mm-YYYY\r\n const today = new Date();\r\n today.setHours(0, 0, 0, 0);\r\n if (!customer) {\r\n if (DOBValue === '' || dobDate >= today) {\r\n onChangeDOBInvalidError(true);\r\n\r\n return;\r\n } else {\r\n onChangeDOBInvalidError(false);\r\n }\r\n }\r\n if (customer) {\r\n if (DOBValue === '' || dobDate >= today || !isValidDate(DOBValue)) {\r\n onChangeDOBInvalidError(true);\r\n return;\r\n } else {\r\n onChangeDOBInvalidError(false);\r\n }\r\n // await updateCustomerAttribute(customer, DOBValue, context);\r\n } else if (DOBValue && !customer && checkoutCart) {\r\n await updateExtensionPropertiesAndState(checkoutCart, 'BirthDate', DOBValue, context, onAccountGuestCheckoutState);\r\n }\r\n\r\n // const updatedCustomer = customer;\r\n\r\n // if(DOBValue && updatedCustomer && updatedCustomer.Attributes && updatedCustomer.Attributes[0] && updatedCustomer.Attributes[0].AttributeValue && updatedCustomer.Attributes[0].AttributeValue.StringValue){\r\n\r\n // updatedCustomer.Attributes[0].AttributeValue.StringValue = DOBValue || '2000-01-01';\r\n\r\n // await updateAsync({ callerContext: context.actionContext },updatedCustomer);\r\n\r\n // }\r\n\r\n await onAddPayment();\r\n};\r\n\r\n// ITS Customization\r\n// const updateCustomerAttribute = async (customer: Customer, DOBValue: string, context: ICoreContext>) => {\r\n// const modifiedCustomer = { ...customer };\r\n// const DOBAttribute = setCustomerAttribute('DOB', DOBValue);\r\n// let currentAttributes: CustomerAttribute[] = modifiedCustomer.Attributes || [];\r\n// currentAttributes = await findCustomerAttribute([...currentAttributes], DOBAttribute);\r\n// modifiedCustomer.Attributes = currentAttributes; // Updates customer with Attribute Values\r\n// await updateAsync({ callerContext: context.actionContext }, modifiedCustomer);\r\n// };\r\n// // ITS Customization\r\n// const updateCartAttributes = async (checkoutCart: ICartState, DOBValue: string, context: ICoreContext>) => {\r\n// const newCart = {...checkoutCart.cart};\r\n// const dateOfBirthAttribute = setNameAttribute('BirthDate', DOBValue);\r\n// let currentAttributes: AttributeValueBase[] = newCart?.AttributeValues || [];\r\n// currentAttributes = await findAttribute(currentAttributes, dateOfBirthAttribute);\r\n// newCart.AttributeValues = currentAttributes; // Updates cart with Attribute Values\r\n// await checkoutCart.updateAttributeValues({ newAttributeValues: newCart.AttributeValues })\r\n// };\r\n\r\nconst updateExtensionPropertiesAndState = async (\r\n checkoutCart: ICartState,\r\n attributeName: string,\r\n attributeValue: string,\r\n context: ICoreContext>,\r\n onAccountGuestCheckoutState: IOnAccountGuestCheckoutState | undefined\r\n) => {\r\n await updateCartExtensionProperties(checkoutCart, attributeName, attributeValue, context);\r\n if (onAccountGuestCheckoutState) {\r\n // This will directly update our application state, which should trigger all modules observing the state to update\r\n updateContext(context, 'appliedOnAccount', true);\r\n }\r\n};\r\n\r\n/**\r\n * On Change Amount Function.\r\n * @param onChangePaymentAmount -On Change Payment Amount Function.\r\n * @returns Call of Change payment Amount function.\r\n */\r\nconst onChangeAmountHandler = (onChangePaymentAmount: (newAmount: number) => void) => (event: React.ChangeEvent) => {\r\n const value = Number.parseFloat(event.target.value || '0');\r\n onChangePaymentAmount(value);\r\n};\r\n\r\nexport const getAccountPaymentFormEditMode = (options: IGetAccountPaymentEditViewFormInput): IAccountPaymentEditViewForm => {\r\n const {\r\n resources,\r\n onAddPayment,\r\n amount,\r\n onChangePaymentAmount,\r\n maxAmount,\r\n customer,\r\n customerCreatedDate,\r\n availableCredit,\r\n showCreditLimit,\r\n errorMessage,\r\n onToggleCreditSection,\r\n creditSectionIsExpanded,\r\n orderTotal,\r\n excessCredit,\r\n onRemovePayment,\r\n appliedAmount,\r\n onChangeDOB,\r\n disableDates,\r\n DOBValue,\r\n DOBError,\r\n DOBInvalidError,\r\n loginDOB,\r\n onChangeDOBError,\r\n onChangeDOBInvalidError,\r\n context,\r\n checkoutCart,\r\n onAccountGuestCheckoutState\r\n } = options;\r\n const {\r\n addPaymentButtonLabel,\r\n inputAmountLabel,\r\n inputDOBLabel,\r\n dOBErrorLabel,\r\n dOBInvalidErrorLabel,\r\n inputAmountAriaLabel,\r\n customerSinceLabel,\r\n accountCreditLabel,\r\n creditDetailsSectionLabel,\r\n orderTotalLabel,\r\n availableCreditLabel,\r\n creditExcessLabel,\r\n appliedCustomerAccountPaymentLabel,\r\n removeCustomerAccountPaymentLabel\r\n } = resources;\r\n console.log('applied amont', appliedAmount);\r\n const inputLabel = (\r\n \r\n {inputAmountLabel}\r\n \r\n );\r\n\r\n const InputdobLabel = (\r\n \r\n {inputDOBLabel}\r\n \r\n );\r\n const dobErrorLabel = DOBError && (\r\n
\r\n {dOBErrorLabel}\r\n
\r\n );\r\n const dobInvalidErrorLabel = DOBInvalidError && (\r\n
\r\n {dOBInvalidErrorLabel}\r\n
\r\n );\r\n const formProps = {\r\n className: 'ms-checkout-customer-account__form-edit',\r\n onSubmit: onAddAccountPayment(\r\n onAddPayment,\r\n context,\r\n customer,\r\n DOBValue,\r\n onChangeDOBError,\r\n onChangeDOBInvalidError,\r\n DOBError,\r\n DOBInvalidError,\r\n checkoutCart,\r\n onAccountGuestCheckoutState\r\n ),\r\n tag: 'form' as NodeTag\r\n };\r\n\r\n const addPaymentButton = (\r\n maxAmount) || (amount < 0)}\r\n >\r\n {addPaymentButtonLabel}\r\n \r\n );\r\n\r\n const dateOfBirth = (\r\n <>\r\n onChangeDOB(event)}\r\n />\r\n \r\n );\r\n const inputAmount = (\r\n \r\n );\r\n\r\n const customerName =
{customer?.Name}
;\r\n\r\n const customerAccountNumber =
#{customer?.AccountNumber}
;\r\n\r\n const customerSince = (\r\n
\r\n {customerSinceLabel}\r\n {customerCreatedDate}\r\n
\r\n );\r\n\r\n // Customization to show acount credit dropdown for registered user only\r\n const accountCredit = customer ? (\r\n <>\r\n {accountCreditLabel}\r\n {showCreditLimit && {availableCredit}}\r\n \r\n \r\n ) : null;\r\n\r\n const accountDetails = creditSectionIsExpanded ? (\r\n
\r\n <>\r\n
\r\n \r\n \r\n {creditDetailsSectionLabel}\r\n \r\n
\r\n \r\n
\r\n {availableCreditLabel}\r\n {availableCredit}\r\n
\r\n
\r\n {orderTotalLabel}\r\n {orderTotal}\r\n
\r\n
\r\n {creditExcessLabel}\r\n {excessCredit}\r\n
\r\n
\r\n ) : (\r\n undefined\r\n );\r\n\r\n const alert = (\r\n \r\n {errorMessage}\r\n \r\n );\r\n\r\n const appliedLine = appliedAmount ? (\r\n
\r\n {appliedCustomerAccountPaymentLabel}\r\n {appliedAmount}\r\n \r\n {removeCustomerAccountPaymentLabel}\r\n \r\n
\r\n ) : (\r\n undefined\r\n );\r\n\r\n const bottomBorder =
;\r\n\r\n return {\r\n formProps,\r\n inputLabel,\r\n inputAmount,\r\n addPaymentButton,\r\n dateOfBirth,\r\n customerName,\r\n customerAccountNumber,\r\n customerSince,\r\n accountCredit,\r\n alert,\r\n accountDetails,\r\n appliedLine,\r\n bottomBorder,\r\n InputdobLabel,\r\n dobErrorLabel,\r\n dobInvalidErrorLabel\r\n };\r\n};\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { Button, INodeProps, NodeTag } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport { Customer } from '@msdyn365-commerce/retail-proxy';\r\nimport { ICCheckoutCustomerAccountPaymentResources } from '../c-checkout-customer-account-payment.props.autogenerated';\r\n\r\nexport interface IGetAccountPaymentSummaryViewFormInput {\r\n resources: ICCheckoutCustomerAccountPaymentResources;\r\n DOBValue: string;\r\n loginDOB: string | undefined;\r\n amount: number;\r\n customer: Customer | undefined;\r\n appliedAmount: string | undefined;\r\n}\r\n\r\nexport interface IAccountPaymentSummaryViewForm {\r\n formProps: INodeProps;\r\n label: React.ReactNode;\r\n paymentAmount: React.ReactNode;\r\n addPaymentButton: React.ReactNode;\r\n appliedLine: React.ReactNode;\r\n bottomBorder: React.ReactNode;\r\n dateOfBirth: React.ReactNode;\r\n InputdobLabel: React.ReactNode;\r\n}\r\n\r\nexport const getAccountPaymentFormSummaryMode = (options: IGetAccountPaymentSummaryViewFormInput): IAccountPaymentSummaryViewForm => {\r\n const { resources, DOBValue, amount, appliedAmount, loginDOB, customer } = options;\r\n\r\n const { addPaymentButtonLabel, inputAmountSummaryLabel, appliedCustomerAccountPaymentLabel, inputDOBLabel } = resources;\r\n\r\n const label = (\r\n \r\n );\r\n const InputdobLabel = (\r\n \r\n {inputDOBLabel}\r\n \r\n );\r\n const formProps = {\r\n className: 'ms-checkout-customer-account__form-summary',\r\n tag: 'form' as NodeTag\r\n };\r\n\r\n const paymentAmount = ;\r\n const dateOfBirth = (\r\n <>\r\n \r\n
\r\n \r\n );\r\n\r\n const addPaymentButton = (\r\n \r\n );\r\n\r\n const appliedLine = appliedAmount ? (\r\n
\r\n {appliedCustomerAccountPaymentLabel}\r\n {appliedAmount}\r\n
\r\n ) : (\r\n undefined\r\n );\r\n\r\n const bottomBorder =
;\r\n\r\n return {\r\n formProps,\r\n label,\r\n paymentAmount,\r\n addPaymentButton,\r\n appliedLine,\r\n dateOfBirth,\r\n bottomBorder,\r\n InputdobLabel\r\n };\r\n};\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { CustomerAttribute, CustomerBalances } from '@msdyn365-commerce/retail-proxy';\r\nimport { IModuleStateManager, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\r\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport get from 'lodash/get';\r\nimport { computed, reaction } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport MsDyn365 from '@msdyn365-commerce/core';\r\nimport { ICCheckoutCustomerAccountPaymentData } from './c-checkout-customer-account-payment.data';\r\nimport { ICCheckoutCustomerAccountPaymentProps } from './c-checkout-customer-account-payment.props.autogenerated';\r\nimport { getAccountPaymentFormEditMode, IAccountPaymentEditViewForm } from './components/get-account-payment-form-edit-mode';\r\nimport { getAccountPaymentFormSummaryMode, IAccountPaymentSummaryViewForm } from './components/get-account-payment-form-summary-mode';\r\nimport { getByAccountNumbersAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CustomersDataActions.g';\r\n\r\nexport interface ICheckoutCustomerAccountPaymentViewProps\r\n extends ICCheckoutCustomerAccountPaymentProps {\r\n checkoutCustomerAccount: IModuleProps;\r\n summaryView: IAccountPaymentSummaryViewForm;\r\n editView: IAccountPaymentEditViewForm;\r\n moduleState: IModuleStateManager;\r\n}\r\n\r\nexport interface ICheckoutCustomerAccountPaymentState {\r\n paymentAmount: number;\r\n isCreditSectionExpanded: boolean;\r\n DOB: string;\r\n DOBError: boolean;\r\n DOBInvalidError: boolean;\r\n CustomerDOBAttributes: string;\r\n}\r\n\r\n/**\r\n *\r\n * CheckoutCustomerAccount component.\r\n * @extends {React.Component>}\r\n */\r\n// @ts-expect-error\r\n@withModuleState\r\n@observer\r\nexport class CheckoutCustomerAccountPayment extends React.Component<\r\n ICheckoutCustomerAccountPaymentViewProps,\r\n ICheckoutCustomerAccountPaymentState\r\n> {\r\n @computed get isCustomerAccountPaymentEnabled(): boolean {\r\n const customerInfo = get(this.props, 'data.customerInformation.result');\r\n const platform = get(this.props, 'context.request.app.platform');\r\n\r\n // return customerInfo &&\r\n // customerInfo.AllowOnAccountPayment === true &&\r\n // platform &&\r\n // (platform.enableCustomerAccountPayment === 'all' ||\r\n // (platform.enableCustomerAccountPayment === 'b2b' && customerInfo.IsB2b === true) ||\r\n // (platform.enableCustomerAccountPayment === 'b2c' && customerInfo.IsB2b === false));\r\n\r\n return (\r\n platform &&\r\n (platform.enableCustomerAccountPayment === 'all' ||\r\n (platform.enableCustomerAccountPayment === 'b2b' && customerInfo && customerInfo.IsB2b === true) ||\r\n (platform.enableCustomerAccountPayment === 'b2c' && customerInfo && customerInfo.IsB2b === false))\r\n );\r\n }\r\n\r\n @computed get getLoyaltyAmount(): number {\r\n const checkoutState = this.props.data.checkout.result;\r\n if (!checkoutState || !checkoutState.loyaltyAmount) {\r\n return 0;\r\n }\r\n return checkoutState.loyaltyAmount;\r\n }\r\n\r\n @computed get getGiftCardAmount(): number {\r\n const checkoutState = this.props.data.checkout.result;\r\n if (!checkoutState || !checkoutState.giftCards || checkoutState.giftCards.length === 0) {\r\n return 0;\r\n }\r\n\r\n let giftCardAmount: number = 0;\r\n checkoutState.giftCards.forEach(giftCard => {\r\n giftCardAmount += giftCard.Balance || 0;\r\n });\r\n\r\n return giftCardAmount;\r\n }\r\n\r\n @computed get maxPaymentAmount(): number {\r\n const cart =\r\n MsDyn365.isBrowser && this.props.data.checkout.result! && this.props.data.checkout.result\r\n ? this.props.data.checkout.result.checkoutCart.cart\r\n : undefined;\r\n if (!cart) {\r\n return 0;\r\n }\r\n\r\n // Use customer account after gift card and loyalty.\r\n const amountDue = Math.max(0, (cart.TotalAmount || 0) - this.getLoyaltyAmount - this.getGiftCardAmount);\r\n\r\n // If the user has a mandatory credit limit, then the max amount must not be more than that\r\n if (this.props.data.customerInformation?.result?.MandatoryCreditLimit) {\r\n return Math.min(this.getAvailableCredit(this.props.data.creditBalances?.result), amountDue);\r\n }\r\n return amountDue;\r\n }\r\n\r\n @computed get errorMessage(): string | undefined {\r\n if (this.state.paymentAmount > this.maxPaymentAmount || this.state.paymentAmount < 0) {\r\n return this.props.resources.invalidAmountMessage;\r\n }\r\n\r\n if (this.props.data.customerInformation.result === undefined && this.state.paymentAmount < this.maxPaymentAmount) {\r\n return `${this.props.resources.invalidInputAmountMessage} ${this.maxPaymentAmount}`;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n @computed get currencyCode(): string | undefined {\r\n return get(this.props, 'context.request.channel.Currency');\r\n }\r\n\r\n @computed get availableCredit(): number {\r\n const creditBalances = get(this.props, 'data.creditBalances.result');\r\n\r\n return creditBalances ? this.getAvailableCredit(creditBalances) : 0;\r\n }\r\n\r\n @computed get orderTotal(): number {\r\n const orderTotal = get(this.props, 'data.checkout.result.checkoutCart.cart.TotalAmount');\r\n\r\n return orderTotal ? orderTotal : 0;\r\n }\r\n\r\n @computed get formattedExcessCredit(): string | undefined {\r\n const excessCredit = this.availableCredit - this.orderTotal;\r\n return excessCredit < 0 ? this.props.context.cultureFormatter.formatCurrency(excessCredit, this.currencyCode) : undefined;\r\n }\r\n\r\n private readonly baseClassName: string = 'ms-checkout-customer-account';\r\n\r\n public constructor(props: ICheckoutCustomerAccountPaymentViewProps) {\r\n super(props);\r\n this.state = {\r\n paymentAmount: this.maxPaymentAmount,\r\n isCreditSectionExpanded: false,\r\n DOB: '',\r\n DOBError: false,\r\n DOBInvalidError: false,\r\n CustomerDOBAttributes: ''\r\n };\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n await this.init();\r\n const customerInfo = get(this.props, 'data.customerInformation.result');\r\n const checkoutState = this.props.data.checkout.result;\r\n const context = get(this.props, 'context');\r\n\r\n const resetCustomerAccountAmount = async () => {\r\n if (!checkoutState) {\r\n this.props.context.telemetry.error('checkout state not found');\r\n return;\r\n }\r\n\r\n this.setState({\r\n paymentAmount: this.maxPaymentAmount\r\n });\r\n\r\n await checkoutState.updateCustomerAccountAmount({ newAmount: 0 });\r\n this.props.context.telemetry.information('customer account payment updated.');\r\n };\r\n try {\r\n if (customerInfo) {\r\n const response = await getByAccountNumbersAsync(\r\n { callerContext: context.actionContext },\r\n [`${customerInfo.AccountNumber}`],\r\n 2\r\n );\r\n if (response && response[0] !== undefined) {\r\n response[0].Attributes?.find(async (attribute: CustomerAttribute) => {\r\n if (attribute.Name === 'DOB') {\r\n this.setState({\r\n CustomerDOBAttributes: attribute?.AttributeValue?.StringValue!\r\n });\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n });\r\n }\r\n }\r\n // else {\r\n // console.log('reset CustomerDOBAttributes');\r\n // this.setState({\r\n // CustomerDOBAttributes: this.state.DOB\r\n // });\r\n // }\r\n } catch (error) {\r\n console.log(error);\r\n }\r\n\r\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.\r\n reaction(\r\n () =>\r\n (this.props.data.checkout.result &&\r\n this.props.data.checkout.result.checkoutCart.cart &&\r\n this.props.data.checkout.result.checkoutCart.cart.TotalAmount) ||\r\n this.props.data.checkout.result?.giftCardExtends.length,\r\n async () => {\r\n this.updateMaxAmount(this.maxPaymentAmount);\r\n await resetCustomerAccountAmount();\r\n }\r\n );\r\n\r\n reaction(\r\n () => this.maxPaymentAmount,\r\n async () => {\r\n await resetCustomerAccountAmount();\r\n }\r\n );\r\n }\r\n\r\n public shouldComponentUpdate(\r\n nextProps: ICCheckoutCustomerAccountPaymentProps,\r\n nextState: ICheckoutCustomerAccountPaymentState\r\n ): boolean {\r\n if (this.state === nextState && this.props.data === nextProps.data) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const customerInfo = this.props.data.customerInformation.result;\r\n if (!this.isCustomerAccountPaymentEnabled) {\r\n this.props.context.telemetry.information(\r\n 'customer account payments will not display, because the feature is disabled or not enabled for this type of customer'\r\n );\r\n return null;\r\n }\r\n\r\n const checkoutState = this.props.data.checkout.result;\r\n const cart = checkoutState ? checkoutState.checkoutCart.cart : undefined;\r\n const hasInvoiceLine = checkoutState?.checkoutCart.hasInvoiceLine;\r\n const creditBalances = this.props.data.creditBalances.result;\r\n const onAccountGuestCheckoutState = this.props.data.onAccountGuestCheckoutState.result;\r\n\r\n if (!cart || hasInvoiceLine) {\r\n return null;\r\n }\r\n const resources = this.props.resources;\r\n const locale = get(this.props, 'context.request.locale') || 'en-us';\r\n const context = get(this.props, 'context');\r\n\r\n const customerSinceDate = new Date(customerInfo?.CreatedDateTime || 0).toLocaleDateString(locale);\r\n const props = {\r\n ...this.props,\r\n checkoutCustomerAccount: {\r\n moduleProps: this.props,\r\n className: classnames(this.baseClassName)\r\n },\r\n editView: getAccountPaymentFormEditMode({\r\n onAddPayment: this.addPayment,\r\n onChangeDOB: this.onChangeDOB,\r\n onChangeDOBError: this.onChangeDOBError,\r\n onChangeDOBInvalidError: this.onChangeDOBInvalidError,\r\n disableDates: this.disableDates,\r\n DOBValue: this.state.DOB,\r\n DOBInvalidError: this.state.DOBInvalidError,\r\n DOBError: this.state.DOBError,\r\n loginDOB: this.state.CustomerDOBAttributes,\r\n context: context,\r\n resources,\r\n amount: this.state.paymentAmount,\r\n onChangePaymentAmount: this.onChangePaymentAmount,\r\n maxAmount: this.maxPaymentAmount,\r\n customer: customerInfo,\r\n customerCreatedDate: customerSinceDate,\r\n availableCredit: this.props.context.cultureFormatter.formatCurrency(\r\n this.getAvailableCredit(creditBalances),\r\n this.currencyCode\r\n ),\r\n showCreditLimit: customerInfo?.MandatoryCreditLimit || false,\r\n errorMessage: this.errorMessage,\r\n onToggleCreditSection: this.toggleCreditSection,\r\n creditSectionIsExpanded: this.state.isCreditSectionExpanded,\r\n orderTotal: this.props.context.cultureFormatter.formatCurrency(this.orderTotal, this.currencyCode),\r\n excessCredit: this.formattedExcessCredit,\r\n onRemovePayment: this.removePayment,\r\n appliedAmount:\r\n checkoutState && checkoutState.customerAccountAmount > 0\r\n ? this.props.context.cultureFormatter.formatCurrency(checkoutState.customerAccountAmount, this.currencyCode)\r\n : undefined,\r\n checkoutCart: checkoutState?.checkoutCart,\r\n onAccountGuestCheckoutState\r\n }),\r\n summaryView: getAccountPaymentFormSummaryMode({\r\n resources,\r\n loginDOB: this.state.CustomerDOBAttributes,\r\n DOBValue: this.state.DOB,\r\n customer: customerInfo,\r\n amount: this.state.paymentAmount,\r\n appliedAmount:\r\n checkoutState && checkoutState.customerAccountAmount > 0\r\n ? this.props.context.cultureFormatter.formatCurrency(checkoutState.customerAccountAmount, this.currencyCode)\r\n : undefined\r\n })\r\n };\r\n\r\n return this.props.renderView(props) as React.ReactElement;\r\n }\r\n\r\n private readonly getAvailableCredit = (creditBalances: CustomerBalances | undefined) => {\r\n if (!creditBalances) {\r\n return 0;\r\n }\r\n return creditBalances.CreditLimit - creditBalances.Balance - creditBalances.PendingBalance;\r\n };\r\n\r\n private readonly addPayment = async (): Promise => {\r\n const checkoutState = this.props.data.checkout.result;\r\n\r\n if (!checkoutState) {\r\n this.props.context.telemetry.error('checkout state not found');\r\n return;\r\n }\r\n\r\n await checkoutState.updateCustomerAccountAmount({ newAmount: this.state.paymentAmount });\r\n this.props.context.telemetry.information('customer account payment amount updated');\r\n };\r\n\r\n private readonly toggleCreditSection = (): void => {\r\n this.setState({\r\n isCreditSectionExpanded: !this.state.isCreditSectionExpanded\r\n });\r\n };\r\n\r\n private readonly init = async (): Promise => {\r\n this.props.moduleState.init({\r\n onCancel: this.handleCancelOrSubmit,\r\n onSubmit: this.handleCancelOrSubmit,\r\n onEdit: this.onEdit\r\n });\r\n\r\n if (this.props.data.checkout.result && this.props.data.checkout.result.customerAccountAmount !== 0) {\r\n this.props.moduleState.onReady();\r\n }\r\n };\r\n\r\n private readonly onChangePaymentAmount = (newAmount: number): void => {\r\n this.setState({\r\n paymentAmount: newAmount\r\n });\r\n };\r\n private readonly onChangeDOB = (event: any): void => {\r\n const { value } = event.target;\r\n this.setState({\r\n DOB: value,\r\n DOBError: false,\r\n DOBInvalidError: false\r\n });\r\n };\r\n private readonly onChangeDOBError = (value: boolean): void => {\r\n this.setState({\r\n DOBError: value\r\n });\r\n };\r\n private readonly onChangeDOBInvalidError = (value: boolean): void => {\r\n this.setState({\r\n DOBInvalidError: value\r\n });\r\n };\r\n private readonly disableDates = (): string => {\r\n let dd;\r\n let mm;\r\n const today = new Date();\r\n const d = today.getDate() - 1;\r\n d < 10 ? (dd = `0${d}`) : (dd = d);\r\n const m = today.getMonth() + 1;\r\n m < 10 ? (mm = `0${m}`) : (mm = m);\r\n const yyyy = today.getFullYear();\r\n return `${yyyy}+'-'+${mm}+'-'+${dd}`;\r\n };\r\n private readonly updateMaxAmount = (newAmount: number): void => {\r\n // If the user has already set an amount, we should not override that in the UI because it will be confusing.\r\n if (\r\n (this.props.data.checkout.result && this.props.data.checkout.result.customerAccountAmount === 0) ||\r\n this.state.paymentAmount !== newAmount\r\n ) {\r\n this.setState({\r\n // We should never allow a negative amount.\r\n paymentAmount: Math.max(0, newAmount)\r\n });\r\n }\r\n };\r\n\r\n private readonly onEdit = (): void => {\r\n this.props.moduleState.onUpdating();\r\n };\r\n\r\n private readonly handleCancelOrSubmit = () => {\r\n const checkoutState = this.props.data.checkout.result;\r\n if (checkoutState && checkoutState.customerAccountAmount > 0) {\r\n this.props.moduleState.onReady();\r\n } else {\r\n // Skip the module\r\n this.props.moduleState.onSkip();\r\n }\r\n };\r\n\r\n private readonly removePayment = async (): Promise => {\r\n const checkoutState = this.props.data.checkout.result;\r\n\r\n if (!checkoutState) {\r\n this.props.context.telemetry.error('checkout state not found');\r\n return;\r\n }\r\n\r\n this.setState({\r\n paymentAmount: this.maxPaymentAmount\r\n });\r\n\r\n await checkoutState.updateCustomerAccountAmount({ newAmount: 0 });\r\n this.props.context.telemetry.information('customer account payment removed');\r\n };\r\n}\r\n\r\nexport default CheckoutCustomerAccountPayment;\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { ICheckoutCustomerAccountPaymentViewProps } from './c-checkout-customer-account-payment';\r\nimport { IAccountPaymentSummaryViewForm } from './components/get-account-payment-form-summary-mode';\r\nimport { RichTextComponent } from '@msdyn365-commerce/core-internal';\r\n\r\nexport const SummaryForm: React.FC = ({\r\n formProps,\r\n label,\r\n paymentAmount,\r\n addPaymentButton,\r\n appliedLine,\r\n bottomBorder,\r\n InputdobLabel,\r\n dateOfBirth\r\n}) => (\r\n \r\n <>\r\n {label}\r\n {paymentAmount}\r\n {InputdobLabel}\r\n {dateOfBirth}\r\n {addPaymentButton}\r\n {appliedLine}\r\n {bottomBorder}\r\n \r\n \r\n);\r\n\r\nexport const EditForm: React.FC = props => {\r\n const {\r\n formProps,\r\n inputLabel,\r\n InputdobLabel,\r\n dobErrorLabel,\r\n dobInvalidErrorLabel,\r\n inputAmount,\r\n addPaymentButton,\r\n customerName,\r\n customerAccountNumber,\r\n customerSince,\r\n accountCredit,\r\n alert,\r\n accountDetails,\r\n appliedLine,\r\n bottomBorder,\r\n dateOfBirth\r\n } = props.editView;\r\n return (\r\n \r\n <>\r\n {customerName}\r\n {customerAccountNumber}\r\n {customerSince}\r\n {accountCredit}\r\n {accountDetails}\r\n {inputLabel}\r\n {alert}\r\n {inputAmount}\r\n {InputdobLabel}\r\n {dateOfBirth}\r\n {dobErrorLabel}\r\n {dobInvalidErrorLabel}\r\n {addPaymentButton}\r\n {appliedLine}\r\n {\r\n
\r\n \r\n
\r\n }\r\n {bottomBorder}\r\n \r\n
\r\n );\r\n};\r\n\r\nconst CheckoutCustomerAccountView: React.FC = props => {\r\n const { checkoutCustomerAccount, summaryView, editView, moduleState } = props;\r\n\r\n return (\r\n \r\n {moduleState.isReady && summaryView && }\r\n {!moduleState.isReady && editView && }\r\n \r\n );\r\n};\r\n\r\nexport default CheckoutCustomerAccountView;\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['c-checkout-customer-account-payment'] = {\n c: () => require('partner/modules/c-checkout-customer-account-payment/c-checkout-customer-account-payment.tsx'),\n $type: 'contentModule',\n da: [{name:'checkout', path:'@msdyn365-commerce/global-state/dist/lib/data-actions/checkout-state-data-action', runOn: 1},{name:'creditBalances', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer-balance', runOn: 0},{name:'customerInformation', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer', runOn: 0},{name:'onAccountGuestCheckoutState', path:'actions/get-on-account-guest-checkout-state', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'c-checkout-customer-account-payment',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/c-checkout-customer-account-payment'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer-balance';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer-balance');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce/global-state/dist/lib/data-actions/checkout-state-data-action';\n let dataAction = require('@msdyn365-commerce/global-state/dist/lib/data-actions/checkout-state-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/get-on-account-guest-checkout-state';\n let dataAction = require('partner/actions/get-on-account-guest-checkout-state');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|c-checkout-customer-account-payment|c-checkout-customer-account-payment'] = {\n c: () => require('partner/modules/c-checkout-customer-account-payment/c-checkout-customer-account-payment.view.tsx'),\n cn: '__local__-__local__-c-checkout-customer-account-payment'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\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 {\n return new CheckoutState();\n}\n\n/**\n * CheckoutState - create new input for create action.\n * @param inputData\n */\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\n return new CheckoutStateInput(inputData.requestContext.apiSettings);\n};\n\n/**\n * CheckoutState - create action.\n */\nexport const checkoutStateActionDataAction = createObservableDataAction({\n action: >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, 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 | undefined {\n return this._tokenizedPaymentCard;\n }\n\n @observable private _tenderLine: TenderLine | undefined;\n\n @computed public get tenderLine(): Readonly | undefined {\n return this._tenderLine;\n }\n\n @observable private _billingAddress: Address | undefined;\n\n @computed public get billingAddress(): Readonly
| undefined {\n return this._billingAddress;\n }\n\n @observable private _shippingAddress: Address | undefined;\n\n @computed public get shippingAddress(): Readonly
| undefined {\n return this._shippingAddress;\n }\n\n @observable private _cardPrefix: string | undefined;\n\n @computed public get cardPrefix(): Readonly | 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 | undefined {\n return this._loyaltyCardNumber;\n }\n\n @observable private _loyaltyAmount: number = 0;\n\n @computed public get loyaltyAmount(): Readonly | number {\n return this._loyaltyAmount;\n }\n\n @observable private _guestCheckoutEmail: string = '';\n\n @computed public get guestCheckoutEmail(): Readonly | string {\n return this._guestCheckoutEmail;\n }\n\n @observable private _isTermsAndConditionAccepted: boolean = false;\n\n @computed public get isTermsAndConditionAccepted(): Readonly | boolean {\n return this._isTermsAndConditionAccepted;\n }\n\n @observable private _customerAccountAmount: number = 0;\n\n @computed public get customerAccountAmount(): Readonly | 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(newGuestCheckoutEmail: string): void {\n this._guestCheckoutEmail = newGuestCheckoutEmail;\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 { 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 = ctx.get(cacheKey.getCacheObjectType(), cacheKey.getCacheKey());\n if (moduleStates) {\n return moduleStates;\n }\n ctx.update(cacheKey, {});\n moduleStates = ctx.get(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.\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 =

(WrappedComponent: React.ComponentType

): React.ComponentType

=> {\n /**\n *\n * ModuleState component.\n * @extends {React.Component

}\n */\n @observer\n class ModuleState extends React.Component

{\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 ;\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): 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): 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): 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,\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,\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","module.exports = React;","module.exports = ReactDOM;"],"names":["OnAccountGuestCheckoutStateInput","constructor","getCacheKey","getCacheObjectType","dataCacheType","async","onAccountGuestCheckoutStateAction","input","ctx","appliedOnAccount","receiptEmail","rentOptIn","emailOptIn","createObservableDataAction","action","inputData","GetPaymentOnbillValueInput","Msdyn365","onBill","id","args","SavesubmitEnabledisableInput","disableButton","setNameAttribute","attributeName","attributeValue","Name","ExtensionProperties","TextValue","TextValueTranslations","findAttribute","currentAttributes","attributeObj","attributeIndex","findIndex","attribute","toLowerCase","push","setExtensionProperties","privIdExtensionProperty","Key","Value","StringValue","BooleanValue","findExtensionProperty","currentProperties","propertyIndex","property","getNBFlagForCartLine","cartline","NBFlag","AttributeValues","find","attr","JSON","parse","getDiemnsionValueForSelectedProduct","productDimensions","product","dimension","dimensionValuesWithInventory","DimensionValues","value","ObjectExtensions","isNullOrUndefined","DimensionValue","RecordId","ProductIds","prod","getNBFlagFromProductDimensions","updateCartExtensionProperties","checkoutCart","context","newCart","cart","newProperty","currentExtensionProperties","updateExtensionProperties","newExtensionProperties","removeCartExtensionProperties","filter","console","log","updateAsync","callerContext","actionContext","updateCartProperties","attributesArr","updateContext","key","get","update","result","onAddAccountPayment","onAddPayment","customer","DOBValue","onChangeDOBError","onChangeDOBInvalidError","DOBError","DOBInvalidError","onAccountGuestCheckoutState","event","preventDefault","dobDate","Date","today","setHours","test","updateExtensionPropertiesAndState","onChangeAmountHandler","onChangePaymentAmount","Number","parseFloat","target","getAccountPaymentFormEditMode","options","resources","amount","maxAmount","customerCreatedDate","availableCredit","showCreditLimit","errorMessage","onToggleCreditSection","creditSectionIsExpanded","orderTotal","excessCredit","onRemovePayment","appliedAmount","onChangeDOB","disableDates","loginDOB","addPaymentButtonLabel","inputAmountLabel","inputDOBLabel","dOBErrorLabel","dOBInvalidErrorLabel","inputAmountAriaLabel","customerSinceLabel","accountCreditLabel","creditDetailsSectionLabel","orderTotalLabel","availableCreditLabel","creditExcessLabel","appliedCustomerAccountPaymentLabel","removeCustomerAccountPaymentLabel","inputLabel","React","className","InputdobLabel","dobErrorLabel","style","color","dobInvalidErrorLabel","formProps","onSubmit","tag","addPaymentButton","Button","onClick","disabled","dateOfBirth","type","name","max","display","onChange","inputAmount","placeholder","Intl","NumberFormat","format","onInput","min","customerName","customerAccountNumber","AccountNumber","customerSince","accountCredit","role","accountDetails","undefined","alert","Alert","assertive","fade","includeAlertClass","isOpen","appliedLine","bottomBorder","getAccountPaymentFormSummaryMode","inputAmountSummaryLabel","label","paymentAmount","required","CheckoutCustomerAccountPayment","props","super","baseClassName","getAvailableCredit","creditBalances","CreditLimit","Balance","PendingBalance","addPayment","checkoutState","this","data","checkout","updateCustomerAccountAmount","newAmount","state","telemetry","information","error","toggleCreditSection","setState","isCreditSectionExpanded","init","moduleState","onCancel","handleCancelOrSubmit","onEdit","customerAccountAmount","onReady","DOB","dd","mm","d","getDate","m","getMonth","getFullYear","updateMaxAmount","Math","onUpdating","onSkip","removePayment","maxPaymentAmount","CustomerDOBAttributes","customerInfo","platform","enableCustomerAccountPayment","IsB2b","loyaltyAmount","giftCards","length","giftCardAmount","forEach","giftCard","MsDyn365","isBrowser","amountDue","TotalAmount","getLoyaltyAmount","getGiftCardAmount","customerInformation","MandatoryCreditLimit","invalidAmountMessage","invalidInputAmountMessage","cultureFormatter","formatCurrency","currencyCode","resetCustomerAccountAmount","response","getByAccountNumbersAsync","Attributes","AttributeValue","reaction","giftCardExtends","shouldComponentUpdate","nextProps","nextState","render","isCustomerAccountPaymentEnabled","hasInvoiceLine","locale","customerSinceDate","CreatedDateTime","toLocaleDateString","checkoutCustomerAccount","moduleProps","classnames","editView","formattedExcessCredit","summaryView","renderView","__decorate","computed","withModuleState","observer","SummaryForm","Node","EditForm","RichTextComponent","text","config","onAccountMessageText","Module","isReady","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","c","require","$type","da","path","runOn","iNM","ns","n","p","pdp","md","window","__bindings__","viewDictionary","cn","apiSettings","buildCacheKey","_this","CheckoutState","CheckoutStateInput","requestContext","_giftCards","_giftCardExtends","_loyaltyAmount","_guestCheckoutEmail","_isTermsAndConditionAccepted","_customerAccountAmount","Object","_tokenizedPaymentCard","_tenderLine","_billingAddress","_shippingAddress","_cardPrefix","_loyaltyCardNumber","newTokenizedPaymentCard","newTenderLine","newShippingAddress","newBillingAddress","newCardPrefix","giftCardNumber","Id","newLoyaltyCardNumber","newGuestCheckoutEmail","newIsTermsAndConditionAccepted","observable","getModuleStates","cacheKey","ModuleStatesCacheKey","moduleStates","WrappedComponent","_super","typeName","states","hasInitialized","hasError","isRequired","isCancellable","isSubmitContainer","status","childIds","validate","isUpdating","isPending","isSkipped","isDisabled","isCancelAllowed","shouldSubmitContainer","hasExternalSubmitGroup","hasModuleState","setIsRequired","setIsCancellable","setIsSubmitContainer","setHasError","onPending","onDisable","getModule","moduleId","getModuleStateManager","getModuleByTypeName","getModuleStateManagerByTypeName","values","_moduleState","source","module","isMatch","allMatched","skipSkippableItem","_validateLeaf","app","shouldEnableSinglePaymentAuthorizationCheckout","childId","_isPaymentSectionContainer","_validateContainer","includes","ArrayExtensions","hasElements","enableControl","initializeState","__extends","ModuleState","exports","ReactDOM"],"sourceRoot":""}