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A,EAAAA,GAMfC,EAAAA,UAAAA,sBAAP,SAA6BC,GACzB,OAAIvmB,KAAKiP,QAAUsX,GAMhBD,EAAAA,UAAAA,OAAP,WACY,IAAA5a,EAAO1L,KAAKiP,MAAK,GACzB,OAAO1B,EAAAA,cAACmW,GAAgB,WAAK1jB,KAAKiP,MAAK,CAAEyE,YAAa1T,KAAKklB,sBAAsBxZ,OAfnF4a,GAAW,SADhB5L,EAAAA,IAAQ,uCACH4L,GAAN,CAA0B/Y,EAAAA","sources":["webpack://Msdyn365.Commerce.Online/./src/modules/custom-checkout-shipping-address/actions/get-state-provinces.ts?4008","webpack://Msdyn365.Commerce.Online/./src/modules/custom-checkout-shipping-address/common/address-common.ts?f4cc","webpack://Msdyn365.Commerce.Online/./src/modules/custom-checkout-shipping-address/common/address-format.data.ts?1ce5","webpack://Msdyn365.Commerce.Online/./src/modules/custom-checkout-shipping-address/common/address-module.data.ts?c633","webpack://Msdyn365.Commerce.Online/./src/modules/custom-checkout-shipping-address/common/address-format.ts?b9ef","webpack://Msdyn365.Commerce.Online/./src/modules/custom-checkout-shipping-address/common/address-autosuggest.ts?d373","webpack://Msdyn365.Commerce.Online/./src/modules/custom-checkout-shipping-address/common/address-meta-data.ts?e0f3","webpack://Msdyn365.Commerce.Online/./src/modules/custom-checkout-shipping-address/common/components/address-alert.tsx?99d1","webpack://Msdyn365.Commerce.Online/./src/modules/custom-checkout-shipping-address/common/components/address-button.tsx?55d4","webpack://Msdyn365.Commerce.Online/./src/modules/custom-checkout-shipping-address/common/components/address-checkbox.tsx?0721","webpack://Msdyn365.Commerce.Online/./src/modules/custom-checkout-shipping-address/common/components/address-dropdown.tsx?6e8b","webpack://Msdyn365.Commerce.Online/./src/modules/custom-checkout-shipping-address/common/components/address-error-message.tsx?a335","webpack://Msdyn365.Commerce.Online/./src/modules/custom-checkout-shipping-address/common/components/address-error-title.tsx?227d","webpack://Msdyn365.Commerce.Online/./src/modules/custom-checkout-shipping-address/common/components/address-input.tsx?713c","webpack://Msdyn365.Commerce.Online/./src/modules/custom-checkout-shipping-address/common/components/address-label.tsx?597f","webpack://Msdyn365.Commerce.Online/./src/modules/custom-checkout-shipping-address/common/components/address-add.tsx?eb99","webpack://Msdyn365.Commerce.Online/./src/modules/custom-checkout-shipping-address/common/components/address-detail-item.tsx?6cc8","webpack://Msdyn365.Commerce.Online/./src/modules/custom-checkout-shipping-address/common/components/address-show.tsx?8659","webpack://Msdyn365.Commerce.Online/./src/modules/custom-checkout-shipping-address/common/components/address-select.tsx?bbe0","webpack://Msdyn365.Commerce.Online/./src/modules/custom-checkout-shipping-address/custom-checkout-shipping-address.tsx?35a0","webpack://Msdyn365.Commerce.Online/./src/modules/custom-checkout-shipping-address/custom-checkout-shipping-address.view.tsx?774b","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"],"sourcesContent":["import { buildCacheKey } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n ICommerceApiSettings\r\n} from '@msdyn365-commerce/core';\r\nimport { getStateProvincesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\r\nimport { StateProvinceInfo } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\n/**\r\n * Input class for get state provinces data action\r\n */\r\nexport class GetStateProvincesInput implements IActionInput {\r\n public countryRegionId: string;\r\n private apiSettings: ICommerceApiSettings;\r\n\r\n constructor(countryRegionId: string, apiSettings: ICommerceApiSettings) {\r\n this.countryRegionId = countryRegionId;\r\n this.apiSettings = apiSettings;\r\n }\r\n\r\n public getCacheKey = () => buildCacheKey(`StateProvinceInfo-${this.countryRegionId}`, this.apiSettings);\r\n public getCacheObjectType = () => 'StateProvinceInfo';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\nexport async function getStateProvinceAction(input: GetStateProvincesInput, ctx: IActionContext): Promise {\r\n return getStateProvincesAsync({ callerContext: ctx, queryResultSettings: {} }, input.countryRegionId);\r\n}\r\n\r\nexport const getStateProvinceActionDataAction = createObservableDataAction({\r\n action: >getStateProvinceAction\r\n});\r\n\r\nexport default getStateProvinceActionDataAction;\r\n","import { addAddress, AddressManagementInput, updateAddress, updatePrimaryAddress } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { IActionInput, ICoreContext, IObservableAction, ITelemetry } from '@msdyn365-commerce/core';\r\nimport { Address, CountryRegionInfo, StateProvinceInfo } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\nimport { getStateProvinceAction, GetStateProvincesInput } from '../actions/get-state-provinces';\r\nimport { IAddressResource, IAddressResponse } from './address-module.data';\r\n\r\n/**\r\n *\r\n * Address common\r\n */\r\nexport class AddressCommon {\r\n private context: ICoreContext;\r\n private resources: IAddressResource;\r\n private telemetry: ITelemetry;\r\n\r\n constructor(context: ICoreContext, resources: IAddressResource, telemetry: ITelemetry) {\r\n this.context = context;\r\n this.resources = resources;\r\n this.telemetry = telemetry;\r\n }\r\n\r\n public getDefaultCountryRegionId = (countryRegionId: string, countryRegions: CountryRegionInfo[], market?: string): string => {\r\n const marketISOCode = market || 'US';\r\n const currentCountryRegion = countryRegions.find(countryRegion => (countryRegion.ISOCode || '') === marketISOCode);\r\n return (currentCountryRegion && currentCountryRegion.CountryRegionId) || countryRegionId;\r\n };\r\n\r\n public parseRetailException = (resources: IAddressResource): IAddressResponse => {\r\n return {\r\n errorTitle: resources.addressErrorMessageTitle,\r\n errorMessage: resources.addressGenericErrorMessage\r\n };\r\n };\r\n\r\n public isAuthenticatedFlow = (): boolean => {\r\n // return this.context.request.user.isAuthenticated;\r\n return false;\r\n };\r\n\r\n public getStateProvinces = async (countryRegionId: string): Promise => {\r\n let response: StateProvinceInfo[] = [];\r\n if (this.context && this.context.actionContext) {\r\n try {\r\n const input = new GetStateProvincesInput(countryRegionId, this.context.request.apiSettings);\r\n response = await getStateProvinceAction(input, this.context.actionContext);\r\n } catch (error) {\r\n if (this.telemetry) {\r\n this.telemetry.error(`Error encountered ${error}`);\r\n this.telemetry.debug('Unable to get state provinces');\r\n }\r\n }\r\n }\r\n return Promise.resolve(response);\r\n };\r\n\r\n // For any address, check for common requried field else treat it as invalid\\empty address.\r\n public isEmpty = (address: Address): boolean => {\r\n if (address && address.ThreeLetterISORegionName && address.State && address.City) {\r\n return false;\r\n }\r\n\r\n return true;\r\n };\r\n\r\n public addCustomerAddress = (address: Address): Promise => {\r\n return this.submitCustomerAddress(addAddress, address);\r\n };\r\n\r\n public updateCustomerAddress = (address: Address): Promise => {\r\n return this.submitCustomerAddress(updateAddress, address);\r\n };\r\n\r\n public updateCustomerPrimaryAddress = (address: Address): Promise => {\r\n return this.submitCustomerAddress(updatePrimaryAddress, address);\r\n };\r\n\r\n private submitCustomerAddress = (addressAction: IObservableAction, address: Address): Promise => {\r\n address.AddressTypeValue = address.AddressTypeValue || 7; // 7 sets it to HOME by default\r\n\r\n const input = new AddressManagementInput(address);\r\n return this.execAddressAction(addressAction, input, address);\r\n };\r\n\r\n private execAddressAction = async (\r\n addressAction: IObservableAction,\r\n input: IActionInput | IActionInput[],\r\n address: Address\r\n ): Promise => {\r\n let response: IAddressResponse = {};\r\n\r\n if (this.context && this.context.actionContext) {\r\n try {\r\n const addresses = await addressAction(input, this.context.actionContext);\r\n if (addresses.length > 0) {\r\n response.address = address.RecordId ? address : addresses[addresses.length - 1];\r\n } else {\r\n response.address = address;\r\n }\r\n response.customerAddresses = addresses;\r\n } catch (error) {\r\n if (this.telemetry) {\r\n this.telemetry.error(`Error encountered ${error}`);\r\n this.telemetry.debug('Unable to exec address action');\r\n }\r\n response = this.parseRetailException(this.resources);\r\n }\r\n }\r\n return Promise.resolve(response);\r\n };\r\n}\r\n","export enum AddressItemDisplayType {\r\n Input = 'Input',\r\n Dropdown = 'Dropdown',\r\n Checkbox = 'Checkbox'\r\n}\r\n\r\nexport enum AddressValidationRuleType {\r\n Required = 'Required',\r\n Format = 'Format'\r\n}\r\n\r\nexport enum AddressItemType {\r\n Name = 1001,\r\n Phone = 1002,\r\n IsPrimary = 1003,\r\n AddressTypeValue = 1004,\r\n ZipCode = 1,\r\n City = 2,\r\n County = 3,\r\n State = 4,\r\n ThreeLetterISORegionName = 5,\r\n Street = 6,\r\n District = 7,\r\n StreetNumber = 8,\r\n BuildingCompliment = 9,\r\n Postbox = 10,\r\n House_RU = 21,\r\n Flat_RU = 22,\r\n CountryOKSMCode_RU = 23\r\n}\r\n\r\nexport interface IAddressItem {\r\n name: string;\r\n type: AddressItemType;\r\n label: string;\r\n maxLength: number;\r\n displayType: AddressItemDisplayType;\r\n validationRules?: IAddressValidationRule[];\r\n isNewLine: boolean;\r\n}\r\n\r\nexport interface IAddressValidationRule {\r\n type: AddressValidationRuleType;\r\n regEx: string;\r\n message: string;\r\n}\r\n\r\nexport interface IAddressDropdownsData {\r\n [index: string]: { key?: string | number; value?: string }[];\r\n}\r\n","import { Heading } from '@msdyn365-commerce-modules/data-types';\r\nimport { Address } from '@msdyn365-commerce/retail-proxy';\r\n\r\nexport enum AddressOperation {\r\n Add = 'Add',\r\n Show = 'Show',\r\n Update = 'Update',\r\n List = 'List'\r\n}\r\n\r\nexport enum AddressType {\r\n Shipping = 'Shipping',\r\n Billing = 'Billing',\r\n Company = 'Company'\r\n}\r\n\r\nexport interface IDropdownDisplayData {\r\n [index: string]: { key?: string; value?: string }[];\r\n}\r\n\r\nexport interface IAddressResponse {\r\n errorTitle?: string;\r\n errorMessage?: string;\r\n customerAddresses?: Address[];\r\n address?: Address;\r\n}\r\n\r\nexport interface IAddressConfig {\r\n heading?: Heading;\r\n primaryAddressSectionHeading?: Heading;\r\n otherAddressSectionHeading?: Heading;\r\n addAddressHeading?: Heading;\r\n editAddressHeading?: Heading;\r\n}\r\n\r\nexport interface IAddressResource {\r\n addressAddButtonText: string;\r\n addressAddButtonAriaLabel: string;\r\n addressPrimaryButtonText: string;\r\n addressPrimaryButtonAriaLabel: string;\r\n addressEditButtonText: string;\r\n addressEditButtonAriaLabel: string;\r\n addressRemoveButtonText: string;\r\n addressRemoveButtonAriaLabel: string;\r\n addressSaveButtonText: string;\r\n addressSaveButtonAriaLabel: string;\r\n addressCancelButtonText: string;\r\n addressCancelButtonAriaLabel: string;\r\n addressStateDefaultSelectionText: string;\r\n addressNameLabel: string;\r\n addressNameLabelOptional?: string;\r\n addressNameRequiredErrorMessage: string;\r\n addressPhoneLabel: string;\r\n addressPhoneLabelOptional?: string;\r\n addressPhoneRequiredErrorMessage: string;\r\n addressZipCodeLabel: string;\r\n addressZipCodeLabelOptional?: string;\r\n addressZipCodeRequiredErrorMessage: string;\r\n addressCityLabel: string;\r\n addressCityLabelOptional?: string;\r\n addressCityRequiredErrorMessage: string;\r\n addressCountyLabel: string;\r\n addressCountyLabelOptional?: string;\r\n addressCountyRequiredErrorMessage: string;\r\n addressStateLabel: string;\r\n addressStateLabelOptional?: string;\r\n addressStateRequiredErrorMessage: string;\r\n addressThreeLetterISORegionNameLabel: string;\r\n addressThreeLetterISORegionNameLabelOptional?: string;\r\n addressThreeLetterISORegionNameRequiredErrorMessage: string;\r\n addressStreetRequiredErrorMessage: string;\r\n addressDistrictLabel: string;\r\n addressDistrictLabelOptional?: string;\r\n addressDistrictRequiredErrorMessage: string;\r\n addressStreetNumberLabel: string;\r\n addressStreetNumberLabelOptional?: string;\r\n addressStreetNumberRequiredErrorMessage: string;\r\n addressBuildingComplimentLabel: string;\r\n addressBuildingComplimentLabelOptional?: string;\r\n addressBuildingComplimentRequiredErrorMessage: string;\r\n addressPostboxLabel: string;\r\n addressPostboxLabelOptional?: string;\r\n addressPostboxRequiredErrorMessage: string;\r\n addressHouseRULabel: string;\r\n addressHouseRULabelOptional?: string;\r\n addressHouseRURequiredErrorMessage: string;\r\n addressFlatRULabel: string;\r\n addressFlatRULabelOptional?: string;\r\n addressFlatRURequiredErrorMessage: string;\r\n addressCountryOKSMCodeRULabel: string;\r\n addressCountryOKSMCodeRURequiredErrorMessage: string;\r\n addressErrorMessageTitle: string;\r\n addressGenericErrorMessage: string;\r\n addressEmptyListAddressMessage: string;\r\n}\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport { get, set } from 'mobx';\r\n\r\nimport {\r\n Address,\r\n AddressPurpose,\r\n CountryRegionInfo,\r\n StateProvinceInfo\r\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\nimport { AddressItemType, IAddressDropdownsData, IAddressItem, IAddressValidationRule } from './address-format.data';\r\nimport { AddressMetaData } from './address-meta-data';\r\n\r\n/**\r\n *\r\n * Retail Service Address format parser\r\n */\r\nexport class AddressFormat {\r\n private countryRegionsInfo?: CountryRegionInfo[];\r\n private addressPurposes?: AddressPurpose[];\r\n private addressMetaData: AddressMetaData;\r\n\r\n constructor(countryRegionsInfo: CountryRegionInfo[], addressMetaData: AddressMetaData, addressPurposes: AddressPurpose[]) {\r\n this.countryRegionsInfo = countryRegionsInfo;\r\n this.addressMetaData = addressMetaData;\r\n this.addressPurposes = addressPurposes;\r\n }\r\n\r\n public getAddressFormat(countryRegionId: string): IAddressItem[] {\r\n const countryRegionInfo = this._getCountryRegionInfo(countryRegionId);\r\n if (countryRegionInfo) {\r\n return this._getAddressDisplayFormat(countryRegionInfo);\r\n }\r\n return [];\r\n }\r\n\r\n public getCountryFormat(): { key?: string; value?: string }[] {\r\n return (this.countryRegionsInfo || []).map(countryRegion => {\r\n return {\r\n key: countryRegion.CountryRegionId,\r\n value: countryRegion.ShortName\r\n };\r\n });\r\n }\r\n\r\n public getStateFormat(stateProvinceInfo?: StateProvinceInfo[]): { key?: string; value?: string }[] {\r\n return (stateProvinceInfo || []).map(state => {\r\n return {\r\n key: state.StateId,\r\n value: state.StateName\r\n };\r\n });\r\n }\r\n\r\n public getAddressTypeFormat(): { key?: number; value?: string }[] {\r\n return (this.addressPurposes || []).map(addressPurpose => {\r\n return {\r\n key: addressPurpose.AddressType,\r\n value: addressPurpose.Name\r\n };\r\n });\r\n }\r\n\r\n public getPrefilledAddressDropdownData = (\r\n stateDefaultSelectionText: string,\r\n stateProvinceInfo?: StateProvinceInfo[]\r\n ): IAddressDropdownsData => {\r\n const defaultStateText = {\r\n key: '',\r\n value: stateDefaultSelectionText\r\n };\r\n const dropdownData: IAddressDropdownsData = {};\r\n\r\n dropdownData[AddressItemType[AddressItemType.ThreeLetterISORegionName]] = this.getCountryFormat();\r\n dropdownData[AddressItemType[AddressItemType.State]] = this.getStateFormat(stateProvinceInfo);\r\n dropdownData[AddressItemType[AddressItemType.State]].unshift(defaultStateText);\r\n dropdownData[AddressItemType[AddressItemType.AddressTypeValue]] = this.getAddressTypeFormat();\r\n\r\n return dropdownData;\r\n };\r\n\r\n public getTwoLetterISORegionName = (countryRegionId: string): string | undefined => {\r\n const countryRegionInfo = this._getCountryRegionInfo(countryRegionId);\r\n\r\n return countryRegionInfo!.ISOCode;\r\n };\r\n\r\n public validateAddressFormat = (\r\n address: Address,\r\n validationError: Address,\r\n countryRegionId: string,\r\n propertyName?: string\r\n ): boolean => {\r\n let isValid: boolean = true;\r\n let validationtor;\r\n const addressFormat = this.getAddressFormat(address.ThreeLetterISORegionName || countryRegionId);\r\n\r\n addressFormat.forEach(addressFormatItem => {\r\n if (!propertyName || (propertyName && addressFormatItem.name === propertyName)) {\r\n validationtor = this._inputValidation(addressFormatItem, validationError, address);\r\n if (validationtor !== undefined) {\r\n isValid = validationtor;\r\n }\r\n }\r\n });\r\n\r\n return isValid;\r\n };\r\n\r\n public getTranformedAddress = (result: Microsoft.Maps.ISuggestionResult, stateProvinceInfo?: StateProvinceInfo[]): Address => {\r\n const address: Address = {};\r\n\r\n // Zip Code\r\n if (result.address.postalCode !== undefined) {\r\n address.ZipCode = result.address.postalCode;\r\n } else {\r\n address.ZipCode = '';\r\n }\r\n\r\n // State\r\n if (stateProvinceInfo) {\r\n const selectedState = stateProvinceInfo.find(state => state.StateName === result.address.adminDistrict);\r\n if (!selectedState) {\r\n address.State = '';\r\n address.StateName = result.address.adminDistrict;\r\n } else {\r\n address.State = selectedState.StateId;\r\n address.StateName = selectedState.StateName;\r\n }\r\n }\r\n\r\n // Street\r\n if (result.address.addressLine !== undefined) {\r\n address.Street = result.address.addressLine;\r\n } else {\r\n address.Street = ' ';\r\n }\r\n\r\n // City\r\n if (result.address.locality !== undefined) {\r\n address.City = result.address.locality;\r\n } else {\r\n address.City = '';\r\n }\r\n\r\n // District\r\n if (result.address.district !== undefined) {\r\n address.DistrictName = result.address.district;\r\n address.CountyName = result.address.district;\r\n } else {\r\n address.DistrictName = '';\r\n }\r\n\r\n // formatted Address\r\n address.FullAddress = result.address.formattedAddress;\r\n return address;\r\n };\r\n\r\n private _inputValidation(addressFormatItem: IAddressItem, validationError: Address, address: Address): boolean | undefined {\r\n set(validationError, { [addressFormatItem.name]: null });\r\n for (const validationRule of addressFormatItem.validationRules || []) {\r\n if (!this._validateRegEx(address, addressFormatItem.name, validationRule)) {\r\n set(validationError, { [addressFormatItem.name]: validationRule.message });\r\n return false;\r\n }\r\n }\r\n return undefined;\r\n }\r\n private _validateRegEx = (address: Address, propertyName: string, validationRule: IAddressValidationRule): boolean => {\r\n if (validationRule.regEx && validationRule.regEx.length > 0) {\r\n const regex = new RegExp(validationRule.regEx);\r\n return regex.test(get(address, propertyName) || '');\r\n }\r\n return true;\r\n };\r\n\r\n private _getCountryRegionInfo(countryRegionId: string): CountryRegionInfo | undefined {\r\n return (this.countryRegionsInfo || []).find(countryRegion => {\r\n return (countryRegion.CountryRegionId || '').toLowerCase() === countryRegionId.toLowerCase();\r\n });\r\n }\r\n\r\n private _getAddressDisplayFormat(countryRegionInfo: CountryRegionInfo): IAddressItem[] {\r\n const addressDisplayItem: IAddressItem[] = [];\r\n\r\n if (countryRegionInfo && countryRegionInfo.AddressFormatLines) {\r\n const AddressTypeItem = this._extendAddressDisplayFormat(AddressItemType.AddressTypeValue, true);\r\n if (AddressTypeItem) {\r\n addressDisplayItem.push(AddressTypeItem);\r\n }\r\n\r\n const nameDisplayItem = this._extendAddressDisplayFormat(AddressItemType.Name, true);\r\n if (nameDisplayItem) {\r\n addressDisplayItem.push(nameDisplayItem);\r\n }\r\n\r\n countryRegionInfo.AddressFormatLines.forEach(formatLine => {\r\n if (formatLine.AddressComponentNameValue) {\r\n const addressItem = this.addressMetaData.getItemFormat(formatLine.AddressComponentNameValue);\r\n if (addressItem) {\r\n addressItem.isNewLine = formatLine.NewLine || false;\r\n addressDisplayItem.push(addressItem);\r\n }\r\n }\r\n });\r\n\r\n const phoneDisplayItem = this._extendAddressDisplayFormat(AddressItemType.Phone, false);\r\n if (phoneDisplayItem) {\r\n addressDisplayItem.push(phoneDisplayItem);\r\n }\r\n\r\n const isPrimaryDisplayItem = this._extendAddressDisplayFormat(AddressItemType.IsPrimary, false);\r\n if (isPrimaryDisplayItem) {\r\n addressDisplayItem.push(isPrimaryDisplayItem);\r\n }\r\n }\r\n\r\n return addressDisplayItem;\r\n }\r\n\r\n private _extendAddressDisplayFormat(type: AddressItemType, isNewLine: boolean): IAddressItem | undefined {\r\n const addressItem = this.addressMetaData.getItemFormat(type);\r\n if (addressItem) {\r\n addressItem.isNewLine = isNewLine;\r\n }\r\n return addressItem;\r\n }\r\n}\r\n","// tslint:disable:no-reference\r\n/// \r\n\r\nimport { IStoreSelectorStateManager } from '@msdyn365-commerce-modules/bopis-utilities';\r\nimport { ITelemetry } from '@msdyn365-commerce/core';\r\nimport { IAutoSuggestOptions } from './address-autosuggest.data';\r\n/**\r\n *\r\n * Auto Suggest\r\n */\r\nexport class AutoSuggest {\r\n public readonly excludedAddressFields: string[] = ['ThreeLetterISORegionName', 'Name', 'AddressTypeValue', 'Phone'];\r\n private telemetry: ITelemetry;\r\n private countryCode?: string;\r\n private bingMapsApiKey?: string;\r\n private defaultLanguageId?: string;\r\n private autoSuggestManager: Microsoft.Maps.AutosuggestManager | undefined;\r\n private autoSuggestOptions: IAutoSuggestOptions;\r\n\r\n constructor(\r\n telemetry: ITelemetry,\r\n autoSuggestOptions: IAutoSuggestOptions,\r\n BingMapsApiKey?: string,\r\n countryCode?: string,\r\n defaultLanguageId?: string\r\n ) {\r\n this.telemetry = telemetry;\r\n this.autoSuggestOptions = autoSuggestOptions;\r\n this.bingMapsApiKey = BingMapsApiKey;\r\n this.countryCode = countryCode;\r\n this.defaultLanguageId = defaultLanguageId;\r\n }\r\n\r\n public attachAutoSuggest = (\r\n inputId: string,\r\n containerId: string,\r\n selectedSuggestionCallback: (result: Microsoft.Maps.ISuggestionResult) => void\r\n ): void => {\r\n if (!this.autoSuggestManager) {\r\n Microsoft.Maps.loadModule('Microsoft.Maps.AutoSuggest', {\r\n callback: () => {\r\n const options = { ...this.autoSuggestOptions, countryCode: this.countryCode };\r\n this.autoSuggestManager = new Microsoft.Maps.AutosuggestManager(options);\r\n this.autoSuggestManager.attachAutosuggest(inputId, containerId, selectedSuggestionCallback);\r\n document.querySelector(inputId)?.setAttribute('role', 'combobox');\r\n setTimeout(() => {\r\n document.querySelector(inputId)?.setAttribute('type', 'text');\r\n }, 0);\r\n },\r\n errorCallback: () => {\r\n if (this.telemetry) {\r\n this.telemetry.debug('Unable to attach map auto suggest.');\r\n }\r\n },\r\n credentials: this.bingMapsApiKey\r\n });\r\n }\r\n };\r\n\r\n public changeAutoSuggestionCountryCode = (countryCode?: string): void => {\r\n if (this.autoSuggestManager) {\r\n this.autoSuggestOptions.countryCode = countryCode;\r\n this.autoSuggestManager.setOptions(this.autoSuggestOptions);\r\n }\r\n };\r\n\r\n public disposeAutoSuggest = (): void => {\r\n this.autoSuggestManager?.detachAutosuggest();\r\n this.autoSuggestManager?.dispose();\r\n this.autoSuggestManager = undefined;\r\n };\r\n\r\n public _loadMapAPI = async (storeSelectorStateManager: IStoreSelectorStateManager): Promise => {\r\n await storeSelectorStateManager.loadMapApi({\r\n key: this.bingMapsApiKey,\r\n lang: this.countryCode,\r\n market: this.defaultLanguageId\r\n });\r\n };\r\n}\r\n","import {\r\n AddressItemDisplayType,\r\n AddressItemType,\r\n AddressValidationRuleType,\r\n IAddressItem,\r\n IAddressValidationRule\r\n} from './address-format.data';\r\nimport { IAddressResource } from './address-module.data';\r\n\r\n/**\r\n * Address meta data\r\n */\r\nexport class AddressMetaData {\r\n private metaData: IAddressItem[] = [];\r\n private resources: IAddressResource;\r\n private requiredFieldRegEx: string = '\\\\S';\r\n private resourcesPrefix: string = 'address';\r\n private maxLength: number = 64;\r\n private requiredFields: AddressItemType[];\r\n private excludedTypes: AddressItemType[];\r\n\r\n constructor(resources: IAddressResource, excluded?: AddressItemType[], required?: AddressItemType[]) {\r\n this.resources = resources || {};\r\n this.excludedTypes = excluded || [];\r\n this.requiredFields =\r\n required !== undefined\r\n ? required\r\n : [\r\n AddressItemType.Name,\r\n AddressItemType.ZipCode,\r\n AddressItemType.City,\r\n AddressItemType.State,\r\n AddressItemType.ThreeLetterISORegionName,\r\n AddressItemType.Street\r\n ];\r\n this._init();\r\n }\r\n\r\n public getItemFormat(id: number): IAddressItem | undefined {\r\n return this.metaData.find(item => {\r\n return item.type === id;\r\n });\r\n }\r\n\r\n private _init(): void {\r\n this._addItem(AddressItemType.Name, AddressItemDisplayType.Input);\r\n this._addItem(AddressItemType.Phone, AddressItemDisplayType.Input);\r\n this._addItem(AddressItemType.ZipCode, AddressItemDisplayType.Input);\r\n this._addItem(AddressItemType.City, AddressItemDisplayType.Input);\r\n this._addItem(AddressItemType.County, AddressItemDisplayType.Input);\r\n this._addItem(AddressItemType.State, AddressItemDisplayType.Dropdown);\r\n this._addItem(AddressItemType.ThreeLetterISORegionName, AddressItemDisplayType.Dropdown);\r\n this._addItem(AddressItemType.Street, AddressItemDisplayType.Input);\r\n this._addItem(AddressItemType.District, AddressItemDisplayType.Input);\r\n this._addItem(AddressItemType.StreetNumber, AddressItemDisplayType.Input);\r\n this._addItem(AddressItemType.BuildingCompliment, AddressItemDisplayType.Input);\r\n this._addItem(AddressItemType.Postbox, AddressItemDisplayType.Input);\r\n this._addItem(AddressItemType.House_RU, AddressItemDisplayType.Input);\r\n this._addItem(AddressItemType.Flat_RU, AddressItemDisplayType.Input);\r\n this._addItem(AddressItemType.CountryOKSMCode_RU, AddressItemDisplayType.Input);\r\n this._addItem(AddressItemType.AddressTypeValue, AddressItemDisplayType.Dropdown);\r\n this._addItem(AddressItemType.IsPrimary, AddressItemDisplayType.Checkbox);\r\n }\r\n\r\n private _addItem(type: AddressItemType, displayType: AddressItemDisplayType): void {\r\n if (this.excludedTypes.includes(type)) {\r\n return;\r\n }\r\n\r\n const nameKey = AddressItemType[type].replace('_', '');\r\n\r\n // find out if currentItem is required field\r\n const validationRules = this._validationRules(type, nameKey);\r\n let isRequired = false;\r\n validationRules.forEach(rule => {\r\n if (rule.type === AddressValidationRuleType.Required) {\r\n isRequired = true;\r\n }\r\n });\r\n\r\n // if no optional string is provided in resource file, use the original label text\r\n const optionalString =\r\n this.resources[`${this.resourcesPrefix}${nameKey}LabelOptional`] || this.resources[`${this.resourcesPrefix}${nameKey}Label`];\r\n const item: IAddressItem = {\r\n type,\r\n displayType,\r\n name: AddressItemType[type],\r\n label: isRequired ? this.resources[`${this.resourcesPrefix}${nameKey}Label`] : optionalString,\r\n maxLength: this.maxLength,\r\n validationRules: validationRules,\r\n isNewLine: true\r\n };\r\n\r\n this.metaData.push(item);\r\n }\r\n\r\n private _validationRules(type: AddressItemType, name: string): IAddressValidationRule[] {\r\n const validationRules: IAddressValidationRule[] = [];\r\n\r\n for (const ruleType of Object.keys(AddressValidationRuleType)) {\r\n const key = `${this.resourcesPrefix}${name}${ruleType}`;\r\n const message = this.resources[`${key}ErrorMessage`];\r\n switch (ruleType) {\r\n case AddressValidationRuleType.Required: {\r\n if (this.requiredFields.find((itemType: AddressItemType) => itemType === type)) {\r\n validationRules.push(this._validationRule(ruleType, this.requiredFieldRegEx, message));\r\n }\r\n break;\r\n }\r\n default:\r\n }\r\n }\r\n return validationRules;\r\n }\r\n\r\n private _validationRule(type: AddressValidationRuleType, regEx: string, message: string): IAddressValidationRule {\r\n return {\r\n type,\r\n regEx,\r\n message\r\n };\r\n }\r\n}\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as React from 'react';\r\n\r\nexport interface IAdressAlert {\r\n message?: string;\r\n}\r\n\r\nconst AdressAlert: React.FC = ({ message }) => (\r\n \r\n {message && <>{message}}\r\n \r\n);\r\n\r\nexport default AdressAlert;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nexport interface IAddressButton {\r\n className: string;\r\n text: string;\r\n ariaLabel: string;\r\n disabled?: boolean;\r\n telemetryContent?: ITelemetryContent;\r\n onClick(event: React.MouseEvent): void;\r\n}\r\n\r\nconst AddressButton: React.FC = ({ className, text, ariaLabel, disabled, telemetryContent, onClick }) => {\r\n const payLoad = getPayloadObject('click', telemetryContent!, text);\r\n const attributes = getTelemetryAttributes(telemetryContent!, payLoad);\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport default AddressButton;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nexport interface IAdressCheckbox {\r\n id?: string;\r\n name?: string;\r\n className: string;\r\n type: string;\r\n isChecked: boolean;\r\n autoFocus?: boolean;\r\n additionalAddributes?: object;\r\n telemetryContent?: ITelemetryContent;\r\n onChange(event: React.ChangeEvent): void;\r\n}\r\n\r\nconst AdressCheckbox: React.FC = ({\r\n id,\r\n name,\r\n className,\r\n type,\r\n isChecked,\r\n additionalAddributes,\r\n telemetryContent,\r\n autoFocus,\r\n onChange\r\n}) => {\r\n const payLoad = getPayloadObject('click', telemetryContent!, name!);\r\n const attributes = getTelemetryAttributes(telemetryContent!, payLoad);\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport default AdressCheckbox;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as React from 'react';\r\n\r\nexport interface IAdressDropdown {\r\n id: string;\r\n name: string;\r\n className: string;\r\n value: string | number;\r\n additionalAddributes?: object;\r\n displayData: { key?: string | number; value?: string }[];\r\n onChange(event: React.ChangeEvent): void;\r\n}\r\n\r\nconst getDropdownItem = (key?: string | number, value?: string, selectedValue?: string | number): React.ReactNode => {\r\n let isSelected: boolean;\r\n if (typeof key === 'number') {\r\n isSelected = key === selectedValue;\r\n } else {\r\n isSelected = typeof selectedValue === 'string' && (key || '').toLowerCase() === (selectedValue || '').toLowerCase();\r\n }\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nconst AdressDropdown: React.FC = ({ id, name, className, value, additionalAddributes, displayData, onChange }) => (\r\n \r\n);\r\n\r\nexport default AdressDropdown;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as React from 'react';\r\n\r\nexport interface IAdressErrorMessage {\r\n message: string;\r\n}\r\n\r\nconst AdressErrorMessage: React.FC = ({ message }) =>

{message}

;\r\n\r\nexport default AdressErrorMessage;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as React from 'react';\r\n\r\nexport interface IAdressErrorTitle {\r\n title: string;\r\n}\r\n\r\nconst AdressErrorTitle: React.FC = ({ title }) =>

{title}

;\r\n\r\nexport default AdressErrorTitle;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nexport interface IAdressInput {\r\n id?: string;\r\n name?: string;\r\n className: string;\r\n type: string;\r\n value: string;\r\n maxLength?: number;\r\n autoFocus?: boolean;\r\n additionalAddributes?: object;\r\n telemetryContent?: ITelemetryContent;\r\n onChange(event: React.ChangeEvent): void;\r\n}\r\n\r\nconst AdressInput: React.FC = ({\r\n id,\r\n name,\r\n className,\r\n type,\r\n value,\r\n maxLength,\r\n additionalAddributes,\r\n autoFocus,\r\n telemetryContent,\r\n onChange\r\n}) => {\r\n const payLoad = getPayloadObject('click', telemetryContent!, name!);\r\n const attributes = getTelemetryAttributes(telemetryContent!, payLoad);\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport default AdressInput;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as React from 'react';\r\n\r\nexport interface IAdressLabel {\r\n id: string;\r\n text: string;\r\n}\r\n\r\nconst AdressLabel: React.FC = ({ id, text }) => (\r\n \r\n);\r\n\r\nexport default AdressLabel;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport classname from 'classnames';\r\nimport { get } from 'mobx';\r\nimport * as React from 'react';\r\n\r\nimport { Heading as HeadingData } from '@msdyn365-commerce-modules/data-types';\r\nimport { Heading, INodeProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport { Address } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\nimport { AddressType, IAddressResource, IAddressResponse } from '../../common/address-module.data';\r\nimport {\r\n AddressItemDisplayType,\r\n AddressItemType,\r\n AddressValidationRuleType,\r\n IAddressDropdownsData,\r\n IAddressItem,\r\n IAddressValidationRule\r\n} from '../address-format.data';\r\nimport AddressAlertComponent from './address-alert';\r\nimport AddressButtonComponent from './address-button';\r\nimport AdressCheckboxComponent from './address-checkbox';\r\nimport AdressDropdownComponent from './address-dropdown';\r\nimport AddressErrorMessageComponent from './address-error-message';\r\nimport AddressErrorTitleComponent from './address-error-title';\r\nimport AddressInputComponent from './address-input';\r\nimport AddressLabelComponent from './address-label';\r\n\r\nexport interface IAddressAddInputProps {\r\n isUpdating?: boolean;\r\n hasError?: boolean;\r\n hasExternalSubmitGroup?: boolean;\r\n addressType: AddressType;\r\n addressFormat: IAddressItem[];\r\n defaultCountryRegionId: string;\r\n defaultAddressType: number;\r\n selectedAddress?: Address;\r\n dropdownDisplayData: IAddressDropdownsData;\r\n resources: IAddressResource;\r\n addressActionResponse?: IAddressResponse;\r\n addAddressHeading?: HeadingData;\r\n editAddressHeading?: HeadingData;\r\n validationError?: object;\r\n telemetryContent?: ITelemetryContent;\r\n onInputChange(event: React.ChangeEvent): void;\r\n onDropdownChange(event: React.ChangeEvent): void;\r\n onSave?(): void;\r\n onCancel?(): void;\r\n}\r\n\r\nexport interface IAddressError {\r\n AddressError: INodeProps;\r\n title: React.ReactNode;\r\n message: React.ReactNode;\r\n}\r\n\r\nexport interface IAddressAddItem {\r\n key: string;\r\n AddressItem: INodeProps;\r\n label: React.ReactNode;\r\n alert: React.ReactNode;\r\n input: React.ReactNode;\r\n}\r\n\r\nexport interface IAddressAddUpdateProps {\r\n AddressForm: INodeProps;\r\n heading: React.ReactNode;\r\n items: IAddressAddItem[];\r\n hasError: boolean;\r\n error: IAddressError;\r\n isShowSaveButton: boolean;\r\n saveButton: React.ReactNode;\r\n isShowCancelButton: boolean;\r\n cancelButton: React.ReactNode;\r\n}\r\n\r\nconst getRequriedAttribute = (validationRules?: IAddressValidationRule[]): object => {\r\n const requriedRule = (validationRules || []).find(validationRule => {\r\n return validationRule.type === AddressValidationRuleType.Required;\r\n });\r\n\r\n return requriedRule ? { 'aria-required': true } : {};\r\n};\r\n\r\nconst getAddessItems = (selectedAddress: Address, props: IAddressAddInputProps): IAddressAddItem[] => {\r\n const {\r\n addressFormat,\r\n addressType,\r\n dropdownDisplayData,\r\n defaultCountryRegionId,\r\n defaultAddressType,\r\n validationError = {},\r\n onInputChange,\r\n onDropdownChange\r\n } = props;\r\n\r\n // @ts-ignore\r\n return addressFormat.map((addressFormatItem, index) => {\r\n const elementId = `${addressType.toLowerCase()}_address${addressFormatItem.name.toLowerCase()}`;\r\n const errorMessage = get(validationError, addressFormatItem.name);\r\n const className = classname('msc-address-form__item', `msc-address-form__item-${addressFormatItem.name.toLowerCase()}`, {\r\n 'msc-address-form__item-newline': addressFormatItem.isNewLine,\r\n 'address-form__item-invalid': errorMessage\r\n });\r\n let input;\r\n if (addressFormatItem.name === 'Phone') {\r\n addressFormatItem.validationRules = [\r\n {\r\n // @ts-ignore\r\n type: 'Required',\r\n regEx: '^[0-9-+\\\\s]+$',\r\n message: 'Inserisci telefono'\r\n }\r\n ];\r\n }\r\n if (addressFormatItem.name === 'County') {\r\n addressFormatItem.maxLength = 2;\r\n addressFormatItem.validationRules = [\r\n {\r\n // @ts-ignore\r\n type: 'Required',\r\n regEx: '[a-zA-Z]',\r\n message: 'Inserisci la provincia'\r\n }\r\n ];\r\n }\r\n if (addressFormatItem.displayType === AddressItemDisplayType.Input) {\r\n input = (\r\n \r\n );\r\n } else if (addressFormatItem.displayType === AddressItemDisplayType.Checkbox) {\r\n input = (\r\n \r\n );\r\n } else {\r\n const displayData = dropdownDisplayData[addressFormatItem.name];\r\n let selectedValue = selectedAddress[addressFormatItem.name];\r\n\r\n if (addressFormatItem.type === AddressItemType.ThreeLetterISORegionName) {\r\n selectedValue = selectedValue || defaultCountryRegionId;\r\n }\r\n\r\n if (addressFormatItem.type === AddressItemType.AddressTypeValue) {\r\n selectedValue = selectedValue || defaultAddressType;\r\n }\r\n\r\n input = (\r\n \r\n );\r\n }\r\n\r\n return {\r\n key: addressFormatItem.name,\r\n AddressItem: { className: className, id: `${elementId}_container` },\r\n label: ,\r\n alert: ,\r\n input: input\r\n };\r\n });\r\n};\r\n\r\nexport const AddressAddUpdate = (props: IAddressAddInputProps): IAddressAddUpdateProps => {\r\n const {\r\n editAddressHeading,\r\n addAddressHeading,\r\n selectedAddress = {},\r\n resources,\r\n hasError,\r\n onCancel,\r\n onSave,\r\n hasExternalSubmitGroup,\r\n isUpdating,\r\n addressActionResponse,\r\n telemetryContent\r\n } = props;\r\n const heading = selectedAddress.RecordId ? editAddressHeading : addAddressHeading;\r\n\r\n return {\r\n AddressForm: { className: 'msc-address-form' },\r\n heading: heading && ,\r\n items: getAddessItems(selectedAddress, props),\r\n isShowSaveButton: !hasExternalSubmitGroup,\r\n saveButton: onSave && (\r\n \r\n ),\r\n isShowCancelButton: !hasExternalSubmitGroup,\r\n cancelButton: onCancel && (\r\n \r\n ),\r\n hasError: hasError || false,\r\n error: {\r\n AddressError: { className: 'msc-address-form__error' },\r\n title: addressActionResponse && addressActionResponse.errorTitle && (\r\n \r\n ),\r\n message: addressActionResponse && addressActionResponse.errorMessage && (\r\n \r\n )\r\n }\r\n };\r\n};\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport classname from 'classnames';\r\nimport * as React from 'react';\r\n\r\nexport interface IAddressDetailItem {\r\n isNewLine: boolean;\r\n isShowLabel: boolean;\r\n labelText: string;\r\n name: string;\r\n value: string;\r\n}\r\n\r\nconst AddressDetailItem: React.FC = ({ isNewLine, isShowLabel, labelText, name, value }) => {\r\n const className = `msc-address-detail__item msc-address-detail__item-${name.toLowerCase()}`;\r\n const isEmpty = !(value && value.length > 0);\r\n const mainClass = isShowLabel\r\n ? `msc-address-detail__item msc-address-detail__item-address-detail_${labelText}`\r\n : classname(className, { 'msc-address-detail__item-empty': isEmpty, 'msc-address-detail__item-newline': isNewLine });\r\n return (\r\n \r\n {isShowLabel && (\r\n <>\r\n {labelText}\r\n \r\n \r\n )}\r\n {value}\r\n \r\n );\r\n};\r\n\r\nexport default AddressDetailItem;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as React from 'react';\r\n\r\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\r\nimport { Address, AddressPurpose } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\nimport { AddressItemType, IAddressItem } from '../../common/address-format.data';\r\nimport AddressDetailItemComponent from './address-detail-item';\r\n\r\nexport interface IAddressShowItem {\r\n key: string;\r\n description: React.ReactNode;\r\n}\r\n\r\nexport interface IAddressShowProps {\r\n AddressDetail: INodeProps;\r\n items: IAddressShowItem[];\r\n}\r\n\r\nexport interface IAddressShowInputProps {\r\n addressFormat: IAddressItem[];\r\n address: Address;\r\n addressPurposes: AddressPurpose[];\r\n}\r\n\r\nexport const AddressShow = (props: IAddressShowInputProps): IAddressShowProps => {\r\n const { addressFormat, addressPurposes, address } = props;\r\n\r\n return {\r\n AddressDetail: { className: 'msc-address-detail' },\r\n items: addressFormat.map(item => {\r\n if (item.name === AddressItemType[AddressItemType.AddressTypeValue]) {\r\n const addressType = addressPurposes.find(\r\n addressTypeValue => addressTypeValue.AddressType.toString() === (address[item.name] || '').toString()\r\n );\r\n if (addressType) {\r\n const value = addressType.Name || '';\r\n return {\r\n key: item.name,\r\n description: (\r\n \r\n )\r\n };\r\n }\r\n }\r\n return {\r\n key: item.name,\r\n description: (\r\n \r\n )\r\n };\r\n })\r\n };\r\n};\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as React from 'react';\r\n\r\nimport { INodeProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport { Address, AddressPurpose } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\nimport { AddressFormat } from '../../common/address-format';\r\nimport { IAddressResource } from '../../common/address-module.data';\r\nimport AddressButtonComponent from './address-button';\r\nimport AddressInputComponent from './address-input';\r\nimport { AddressShow, IAddressShowProps } from './address-show';\r\n\r\nexport interface IAddressSelectInputProps {\r\n hasExternalSubmitGroup?: boolean;\r\n addressFormat: AddressFormat;\r\n addresses: Address[];\r\n addressPurposes: AddressPurpose[];\r\n resources: IAddressResource;\r\n selectedAddress: Address;\r\n telemetryContent?: ITelemetryContent;\r\n onAddressOptionChange(event: React.ChangeEvent): void;\r\n onAddAddress(): void;\r\n onSave(): void;\r\n onCancel(): void;\r\n}\r\n\r\nexport interface IAddressSelectItem {\r\n key: number;\r\n SelectItem: INodeProps;\r\n input: React.ReactNode;\r\n showItems: IAddressShowProps;\r\n}\r\n\r\nexport interface IAddressSelectProps {\r\n SelectAddress: INodeProps;\r\n addButton: React.ReactNode;\r\n items: IAddressSelectItem[];\r\n isShowSaveButton: boolean;\r\n saveButton: React.ReactNode;\r\n isShowCancelButton: boolean;\r\n cancelButton: React.ReactNode;\r\n}\r\n\r\nconst getInput = (index: number, address: Address, props: IAddressSelectInputProps): React.ReactNode => {\r\n const { addresses, onAddressOptionChange, selectedAddress } = props;\r\n\r\n const ichecked = address.RecordId === selectedAddress.RecordId;\r\n const additionalAttributes = {\r\n checked: ichecked,\r\n 'aria-checked': ichecked,\r\n 'aria-setsize': addresses.length,\r\n 'aria-posinset': index + 1\r\n };\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nconst getAddressSelectItems = (props: IAddressSelectInputProps): IAddressSelectItem[] => {\r\n const { addresses, addressFormat, addressPurposes } = props;\r\n\r\n return addresses.map((address, index) => {\r\n return {\r\n key: address.RecordId || 0,\r\n SelectItem: { className: 'msc-address-select__item' },\r\n input: getInput(index, address, props),\r\n showItems: AddressShow({\r\n addressFormat: addressFormat.getAddressFormat(address.ThreeLetterISORegionName || ''),\r\n address: address,\r\n addressPurposes: addressPurposes\r\n })\r\n };\r\n });\r\n};\r\n\r\nexport const AddressSelect = (props: IAddressSelectInputProps): IAddressSelectProps => {\r\n const { resources, onCancel, onSave, onAddAddress, hasExternalSubmitGroup } = props;\r\n\r\n return {\r\n SelectAddress: { className: 'msc-address-select' },\r\n addButton: (\r\n \r\n ),\r\n isShowSaveButton: !hasExternalSubmitGroup,\r\n saveButton: (\r\n \r\n ),\r\n isShowCancelButton: !hasExternalSubmitGroup,\r\n cancelButton: (\r\n \r\n ),\r\n items: getAddressSelectItems(props)\r\n };\r\n};\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport classnames from 'classnames';\r\nimport { action, computed, observable, reaction, set } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\n\r\nimport { IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\r\nimport { getTelemetryObject, IModuleProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport { Address, AddressPurpose, CountryRegionInfo, StateProvinceInfo } from '@msdyn365-commerce/retail-proxy';\r\n\r\nimport { AutoSuggest } from './common';\r\nimport { IAutoSuggestOptions } from './common';\r\nimport { AddressCommon } from './common';\r\nimport { AddressFormat } from './common';\r\nimport { AddressItemType } from './common';\r\nimport { AddressMetaData } from './common';\r\nimport { AddressOperation, AddressType, IAddressResource, IAddressResponse } from './common';\r\nimport { AddressAddUpdate, IAddressAddUpdateProps } from './common';\r\nimport { AddressSelect, IAddressSelectProps } from './common';\r\nimport { AddressShow, IAddressShowProps } from './common';\r\nimport { ICustomCheckoutShippingAddressData } from './custom-checkout-shipping-address.data';\r\nimport { ICustomCheckoutShippingAddressProps } from './custom-checkout-shipping-address.props.autogenerated';\r\n\r\nexport interface ICheckoutAddressProps extends ICustomCheckoutShippingAddressProps, IModuleStateProps {}\r\n\r\nexport interface ICheckoutShippingAddressViewState {\r\n isShowAddress: boolean;\r\n isShowAddresList: boolean;\r\n isShowAddOrUpdateAddress: boolean;\r\n}\r\n\r\nexport interface ICheckoutShippingAddressViewProps extends ICheckoutAddressProps {\r\n className: string;\r\n currentOperation: AddressOperation;\r\n selectedAddress?: Address;\r\n addUpdateAddress: Address;\r\n addressListSelectedAddress: Address;\r\n countryRegionId: string;\r\n stateProvinceInfo?: StateProvinceInfo[];\r\n customerAddresses: Address[];\r\n validationError: object;\r\n addressActionResponse?: IAddressResponse;\r\n viewState: ICheckoutShippingAddressViewState;\r\n CheckoutShippingAddress: IModuleProps;\r\n isUpdating: boolean;\r\n hasError: boolean;\r\n showAddress: IAddressShowProps;\r\n showAddressSelect: IAddressSelectProps;\r\n showAddOrUpdateAddress: IAddressAddUpdateProps;\r\n}\r\n\r\n/**\r\n *\r\n * Address component\r\n * @extends {React.Component>}\r\n */\r\n// @ts-ignore\r\n@withModuleState\r\n@observer\r\nclass CheckoutShippingAddress extends React.Component {\r\n @observable private currentOperation: AddressOperation;\r\n @observable private selectedAddress?: Address;\r\n @observable private addUpdateAddress: Address;\r\n @observable private countryRegionId: string = 'USA';\r\n @observable private stateProvinceInfo?: StateProvinceInfo[];\r\n @observable private customerAddresses: Address[];\r\n @observable private validationError: object;\r\n @observable private addressActionResponse?: IAddressResponse;\r\n @observable private isUpdating?: boolean;\r\n @observable private hasError?: boolean;\r\n @observable private addressListSelectedAddress: Address = {};\r\n\r\n @computed get isPaymentVerificationRedirection(): boolean {\r\n const { requestFormData, query } = this.props.context.request;\r\n return requestFormData && query && query.pv === '1' ? true : false;\r\n }\r\n private addressCommon: AddressCommon;\r\n private addressFormat: AddressFormat;\r\n private countryRegions: CountryRegionInfo[];\r\n private addressPurposes: AddressPurpose[];\r\n private resources: IAddressResource;\r\n private defaultAddressType: number = 6; // Default to Home\r\n private telemetryContent?: ITelemetryContent;\r\n private autoSuggest?: AutoSuggest;\r\n private multiplePickupStoreSwitchName: string = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n private retailMultiplePickUpOptionEnabled?: boolean = false;\r\n\r\n constructor(props: ICheckoutAddressProps) {\r\n super(props);\r\n const { context, data, resources, telemetry } = this.props;\r\n\r\n this.addUpdateAddress = {};\r\n this.resources = resources;\r\n this.currentOperation = AddressOperation.List;\r\n this.countryRegions = data.countryRegions.result || [];\r\n this.addressPurposes = data.addressPurposes.result || [];\r\n this.customerAddresses = data.address.result || [];\r\n this.stateProvinceInfo = data.countryStates.result || [];\r\n this.addressCommon = new AddressCommon(context, resources, telemetry);\r\n this.addressFormat = new AddressFormat(\r\n this.countryRegions,\r\n new AddressMetaData({ ...resources }, this._getAddressFormatExcludeList()),\r\n this.addressPurposes\r\n );\r\n this.validationError = {};\r\n this.retailMultiplePickUpOptionEnabled = data?.featureState?.result?.find(\r\n feature => feature.Name === this.multiplePickupStoreSwitchName\r\n )?.IsEnabled;\r\n this.telemetryContent = getTelemetryObject(\r\n this.props.context.request.telemetryPageName!,\r\n this.props.friendlyName,\r\n this.props.telemetry\r\n );\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n const {\r\n context: {\r\n telemetry,\r\n actionContext: {\r\n requestContext: { channel }\r\n }\r\n },\r\n config: { autoSuggestionEnabled, autoSuggestOptions }\r\n } = this.props;\r\n\r\n this.props.data.checkout.then(() => {\r\n this._setDefaultCountryRegionId();\r\n this._initModuleState();\r\n });\r\n\r\n reaction(\r\n () => this.countryRegionId,\r\n () => this._getStateProvinces()\r\n );\r\n\r\n reaction(\r\n () => this.currentOperation,\r\n () => {\r\n this._getStateProvinces();\r\n }\r\n );\r\n\r\n if (autoSuggestionEnabled) {\r\n if (channel && !channel.BingMapsApiKey) {\r\n telemetry.error('BingMapsApiKey is missing.');\r\n return;\r\n }\r\n\r\n if (channel && !channel.BingMapsEnabled) {\r\n telemetry.error('Map is disabled from HQ.');\r\n return;\r\n }\r\n\r\n const options: IAutoSuggestOptions = { ...autoSuggestOptions };\r\n this.autoSuggest = new AutoSuggest(\r\n telemetry,\r\n options,\r\n channel?.BingMapsApiKey,\r\n channel?.ChannelCountryRegionISOCode,\r\n channel?.DefaultLanguageId\r\n );\r\n\r\n // Customer doesn't have any address. Then add view will be loaded directly. Code for the same to handle that\r\n if (\r\n this.props.data.storeSelectorStateManager.result &&\r\n (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update)\r\n ) {\r\n await this.autoSuggest?._loadMapAPI(await this.props.data.storeSelectorStateManager);\r\n }\r\n\r\n reaction(\r\n () =>\r\n this.props.data.storeSelectorStateManager.result?.loadMapApi &&\r\n (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update),\r\n async () => {\r\n await this.autoSuggest?._loadMapAPI(await this.props.data.storeSelectorStateManager);\r\n }\r\n );\r\n\r\n reaction(\r\n () => this.props.data.storeSelectorStateManager.result?.isMapApiLoaded,\r\n async () => {\r\n await this._attachMapAutoSuggest();\r\n }\r\n );\r\n }\r\n }\r\n\r\n public async componentDidUpdate(): Promise {\r\n if (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update) {\r\n if (this.props.data.storeSelectorStateManager.result?.isMapApiLoaded) {\r\n await this._attachMapAutoSuggest();\r\n }\r\n } else {\r\n this.autoSuggest?.disposeAutoSuggest();\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n if (!this._canShip()) {\r\n // return null;\r\n }\r\n\r\n const { renderView, config } = this.props;\r\n\r\n const viewProps = {\r\n ...this.props,\r\n currentOperation: this.currentOperation,\r\n selectedAddress: this.selectedAddress,\r\n addUpdateAddress: this.addUpdateAddress,\r\n addressListSelectedAddress: this.addressListSelectedAddress,\r\n countryRegionId: this.countryRegionId,\r\n stateProvinceInfo: this.stateProvinceInfo,\r\n customerAddresses: this.customerAddresses,\r\n validationError: this.validationError,\r\n addressActionResponse: this.addressActionResponse,\r\n isUpdating: this.isUpdating,\r\n hasError: this.hasError,\r\n className: config.className,\r\n viewState: {\r\n isShowAddress: this.currentOperation === AddressOperation.Show && (this.selectedAddress ? this.selectedAddress : {}),\r\n // isShowAddresList: this.currentOperation === AddressOperation.List && this.customerAddresses.length > 0,\r\n isShowAddresList: false,\r\n isShowAddOrUpdateAddress:\r\n this.currentOperation === AddressOperation.List ||\r\n this.currentOperation === AddressOperation.Add ||\r\n this.currentOperation === AddressOperation.Update\r\n },\r\n CheckoutShippingAddress: {\r\n moduleProps: this.props,\r\n className: classnames('ms-checkout-shipping-address', config.className)\r\n },\r\n showAddress: this._renderShowAddress(),\r\n showAddressSelect: this._renderSelectAddress(),\r\n showAddOrUpdateAddress: this._renderAddOrUpdateAddress()\r\n };\r\n\r\n return renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n private _renderAddOrUpdateAddress = (): IAddressAddUpdateProps => {\r\n const addressFormat =\r\n this.currentOperation === AddressOperation.Add && this.addressCommon.isAuthenticatedFlow()\r\n ? this.addressFormat\r\n : this.addressFormat;\r\n return AddressAddUpdate({\r\n isUpdating: this.isUpdating,\r\n resources: this.resources,\r\n addressType: AddressType.Shipping,\r\n addressFormat: addressFormat.getAddressFormat(this.addUpdateAddress.ThreeLetterISORegionName || this.countryRegionId),\r\n defaultCountryRegionId: this.countryRegionId,\r\n defaultAddressType: this.defaultAddressType,\r\n selectedAddress: this.addUpdateAddress,\r\n validationError: this.validationError,\r\n hasError: this.hasError,\r\n addressActionResponse: this.addressActionResponse,\r\n telemetryContent: this.telemetryContent,\r\n dropdownDisplayData: addressFormat.getPrefilledAddressDropdownData(\r\n this.resources.addressStateDefaultSelectionText,\r\n this.stateProvinceInfo\r\n ),\r\n onInputChange: this._onAddressAddUpdateInputChange,\r\n onDropdownChange: this._onAddressAddUpdateDropdownChange,\r\n hasExternalSubmitGroup: this.props.moduleState.hasExternalSubmitGroup,\r\n onSave: this.onSubmit,\r\n // tslint:disable-next-line: no-empty\r\n onCancel: !this.selectedAddress && !this.addressCommon.isAuthenticatedFlow() ? () => {} : this._resetView\r\n });\r\n };\r\n\r\n private _renderSelectAddress = (): IAddressSelectProps => {\r\n return AddressSelect({\r\n addressFormat: this.addressFormat,\r\n addresses: this.customerAddresses,\r\n resources: this.resources,\r\n addressPurposes: this.addressPurposes,\r\n selectedAddress: this.addressListSelectedAddress,\r\n onAddressOptionChange: this._onAddressOptionChange,\r\n hasExternalSubmitGroup: this.props.moduleState.hasExternalSubmitGroup,\r\n telemetryContent: this.telemetryContent,\r\n onAddAddress: this._goToAddAddress,\r\n onSave: this._onSelectAddress,\r\n // tslint:disable-next-line: no-empty\r\n onCancel: !this.selectedAddress ? () => {} : this._resetView\r\n });\r\n };\r\n\r\n private _renderShowAddress(): IAddressShowProps | null {\r\n if (this.selectedAddress) {\r\n return AddressShow({\r\n address: this.selectedAddress,\r\n addressFormat: this.addressFormat.getAddressFormat(this.selectedAddress.ThreeLetterISORegionName || ''),\r\n addressPurposes: this.addressPurposes\r\n });\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private _attachMapAutoSuggest = async (): Promise => {\r\n const {\r\n data: {\r\n storeSelectorStateManager: { result: storeSelectorStateManager }\r\n }\r\n } = this.props;\r\n\r\n if (storeSelectorStateManager?.isMapApiLoaded) {\r\n this.autoSuggest?.attachAutoSuggest('#shipping_addressstreet', '#shipping_addressstreet_container', this._onSuggestionSelected);\r\n }\r\n };\r\n\r\n @action\r\n private _onSuggestionSelected = async (result: Microsoft.Maps.ISuggestionResult): Promise => {\r\n this._clearAddressFields();\r\n const address = this.addressFormat.getTranformedAddress(result, this.stateProvinceInfo);\r\n\r\n set(this.addUpdateAddress, { ['Street']: '' });\r\n set(this.addUpdateAddress, { ['ZipCode']: address.ZipCode });\r\n set(this.addUpdateAddress, { ['CountyName']: address.CountyName });\r\n set(this.addUpdateAddress, { ['City']: address.City });\r\n set(this.addUpdateAddress, { ['State']: address.State });\r\n set(this.addUpdateAddress, { ['DistrictName']: address.DistrictName });\r\n set(this.addUpdateAddress, { ['FullAddress']: address.FullAddress });\r\n\r\n // Bing autosuggest put the complete address in the Street input box. Updating the street input box to show only street address.\r\n setTimeout(() => {\r\n set(this.addUpdateAddress, { ['Street']: address.Street });\r\n }, 0);\r\n };\r\n\r\n @action\r\n private _clearAddressFields = (): void => {\r\n const addressFormatItem = this.addressFormat.getAddressFormat(\r\n this.addUpdateAddress.ThreeLetterISORegionName || this.countryRegionId\r\n );\r\n addressFormatItem.forEach(format => {\r\n if (this.addUpdateAddress[format.name] !== undefined && !this.autoSuggest?.excludedAddressFields.includes(format.name)) {\r\n this.addressFormat[format.name] = '';\r\n }\r\n });\r\n this._clearValidation();\r\n };\r\n\r\n @action\r\n private _clearValidation = (): void => {\r\n this.validationError = {};\r\n };\r\n\r\n private _onAddressOptionChange = (event: React.ChangeEvent) => {\r\n const addressRecordId = event.currentTarget.value;\r\n const selectedAddress = this.customerAddresses.find(address => (address.RecordId || '').toString() === addressRecordId);\r\n if (selectedAddress) {\r\n this.addressListSelectedAddress = selectedAddress;\r\n }\r\n };\r\n\r\n private onAddressAddUpdate = (name: string, value: string | boolean) => {\r\n set(this.addUpdateAddress, { [name]: value });\r\n this.addressFormat.validateAddressFormat(this.addUpdateAddress, this.validationError, this.countryRegionId, name);\r\n };\r\n\r\n private _onAddressAddUpdateInputChange = (event: React.ChangeEvent): void => {\r\n if (event.target.type === 'checkbox') {\r\n this.onAddressAddUpdate(event.target.name, event.target.checked);\r\n } else {\r\n const value = (event.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\r\n this.onAddressAddUpdate(event.target.name, value);\r\n }\r\n };\r\n\r\n private _onAddressAddUpdateDropdownChange = (event: React.ChangeEvent): void => {\r\n this.onAddressAddUpdate(event.target.name, event.target.value);\r\n\r\n if (event.target.name === AddressItemType[AddressItemType.ThreeLetterISORegionName]) {\r\n this._onCountryChange(event.target.value);\r\n }\r\n };\r\n\r\n private _onAddressAddUpdateSubmit = (): void => {\r\n if (!this.addressFormat.validateAddressFormat(this.addUpdateAddress, this.validationError, this.countryRegionId)) {\r\n return;\r\n }\r\n\r\n let response: Promise;\r\n if (this.addressCommon.isAuthenticatedFlow()) {\r\n response =\r\n this.currentOperation === AddressOperation.Update\r\n ? this.addressCommon.updateCustomerAddress(this.addUpdateAddress)\r\n : this.addressCommon.addCustomerAddress(this.addUpdateAddress);\r\n } else {\r\n response = Promise.resolve({ address: this.addUpdateAddress });\r\n }\r\n\r\n this.isUpdating = true;\r\n this._updateModuleState();\r\n\r\n response.then(\r\n (result: IAddressResponse) => {\r\n this.isUpdating = false;\r\n\r\n if (result.address) {\r\n this.hasError = false;\r\n this._onAddOrUpdateSuccess(result);\r\n } else {\r\n this.hasError = true;\r\n this.addressActionResponse = result;\r\n this._updateModuleState();\r\n }\r\n },\r\n () => {\r\n this.hasError = true;\r\n this.isUpdating = false;\r\n this._updateModuleState();\r\n }\r\n );\r\n };\r\n\r\n private _onCountryChange = (countryRegionId: string) => {\r\n this.countryRegionId = countryRegionId;\r\n const twoLetterISORegionName = this.addressFormat.getTwoLetterISORegionName(countryRegionId);\r\n set(this.addUpdateAddress, { ['ThreeLetterISORegionName']: countryRegionId });\r\n set(this.addUpdateAddress, { ['TwoLetterISORegionName']: twoLetterISORegionName });\r\n this.autoSuggest?.changeAutoSuggestionCountryCode(twoLetterISORegionName);\r\n this._clearAddressFields();\r\n };\r\n\r\n private _getAddressFormatExcludeList = (): AddressItemType[] => {\r\n const { config } = this.props;\r\n const addressFormatExcludeList: AddressItemType[] = [];\r\n\r\n if (!config.showAddressType) {\r\n addressFormatExcludeList.push(AddressItemType.AddressTypeValue);\r\n }\r\n\r\n addressFormatExcludeList.push(AddressItemType.IsPrimary);\r\n\r\n return addressFormatExcludeList;\r\n };\r\n\r\n private _getStateProvinces = (): void => {\r\n if (\r\n !this.countryRegionId ||\r\n !(this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update)\r\n ) {\r\n return;\r\n }\r\n\r\n // tslint:disable-next-line:no-floating-promises\r\n this.addressCommon.getStateProvinces(this.countryRegionId).then((result: StateProvinceInfo[]) => {\r\n const stateInfo = result.some(state => state.StateId === this.addUpdateAddress.State);\r\n // Reset state if selected state not found in the list.\r\n if (!stateInfo) {\r\n set(this.addUpdateAddress, { ['State']: '' });\r\n }\r\n\r\n this.stateProvinceInfo = result;\r\n });\r\n };\r\n\r\n private _setDefaultCountryRegionId(): void {\r\n // forsed to ITL as to customer request\r\n // const { request } = this.props.context;\r\n // const market = request && request.channel && request.channel.ChannelCountryRegionISOCode;\r\n // this.countryRegionId = this.addressCommon.getDefaultCountryRegionId(this.countryRegionId, this.countryRegions, market);\r\n this.countryRegionId = 'ITL';\r\n }\r\n\r\n private _getDefaultAddress = (): Address | undefined => {\r\n if (this.customerAddresses) {\r\n // const primaryAddress = this.customerAddresses.find((address: Address) => address.IsPrimary);\r\n // return primaryAddress || (this.customerAddresses.length > 0 ? this.customerAddresses[0] : undefined);\r\n }\r\n return undefined;\r\n };\r\n\r\n private _initModuleState = (): void => {\r\n this.props.moduleState.init({\r\n // status: this._canShip() ? 'updating' : 'disabled',\r\n status: 'updating',\r\n onEdit: this.onEdit,\r\n onCancel: this.onCancel,\r\n onSubmit: this.onSubmit\r\n });\r\n\r\n if (this._canShip()) {\r\n const defaultAddress =\r\n this.props.data.checkout.result?.checkoutCart.cart.ShippingAddress ??\r\n this._getShippingAddressFromCartLines() ??\r\n this._getDefaultAddress();\r\n if (defaultAddress && !this.addressCommon.isEmpty(defaultAddress)) {\r\n this._updateCurrentOperation(AddressOperation.Show, defaultAddress);\r\n this._setShippingAddress(defaultAddress);\r\n this._updateModuleState();\r\n } else {\r\n this._updateCurrentOperation(AddressOperation.Add);\r\n }\r\n }\r\n if (this.isPaymentVerificationRedirection) {\r\n this.currentOperation = AddressOperation.Show;\r\n this.props.moduleState.onReady();\r\n }\r\n };\r\n\r\n private onSubmit = (): void => {\r\n switch (this.currentOperation) {\r\n case AddressOperation.Add:\r\n case AddressOperation.Update:\r\n this._onAddressAddUpdateSubmit();\r\n break;\r\n case AddressOperation.List:\r\n this._onSelectAddress();\r\n break;\r\n default:\r\n this.props.telemetry.error('Invalid operation');\r\n }\r\n };\r\n\r\n private onCancel = (): void => {\r\n switch (this.currentOperation) {\r\n case AddressOperation.Add:\r\n case AddressOperation.Update:\r\n this._clearAddressFields();\r\n if (!(!this.selectedAddress && !this.addressCommon.isAuthenticatedFlow())) {\r\n this._resetView();\r\n }\r\n\r\n break;\r\n case AddressOperation.List:\r\n if (this.selectedAddress) {\r\n this._resetView();\r\n }\r\n break;\r\n default:\r\n this.props.telemetry.error('Invalid operation');\r\n }\r\n };\r\n\r\n private onEdit = (): void => {\r\n /* if (this.addressCommon.isAuthenticatedFlow() && this.shippingAddress) {\r\n this._updateCurrentOperation(AddressOperation.List, this.shippingAddress);\r\n } else */ if (\r\n this.shippingAddress\r\n ) {\r\n this._updateCurrentOperation(AddressOperation.Update, this.shippingAddress);\r\n }\r\n\r\n this._updateModuleState();\r\n };\r\n\r\n private _getShippingAddressFromCartLines = (): Address | undefined => {\r\n const { request } = this.props.context;\r\n const { channelDeliveryOptionConfig } = this.props.data;\r\n const pickupDeliveryModeCode = request && request.channel && request.channel.PickupDeliveryModeCode;\r\n const emailDeliveryModeCode = request && request.channel && request.channel.EmailDeliveryModeCode;\r\n\r\n const cartLines = this.retailMultiplePickUpOptionEnabled\r\n ? ((this.props.data.checkout.result && this.props.data.checkout.result.checkoutCart.cart.CartLines) || []).filter(cartLine =>\r\n cartLine.DeliveryMode && cartLine.DeliveryMode !== ''\r\n ? cartLine.DeliveryMode !==\r\n channelDeliveryOptionConfig.result?.PickupDeliveryModeCodes?.find(\r\n deliveryMode => deliveryMode === cartLine.DeliveryMode\r\n ) && cartLine.DeliveryMode !== emailDeliveryModeCode\r\n : cartLine\r\n )\r\n : ((this.props.data.checkout.result && this.props.data.checkout.result.checkoutCart.cart.CartLines) || []).filter(cartLine =>\r\n cartLine.DeliveryMode && cartLine.DeliveryMode !== ''\r\n ? cartLine.DeliveryMode !== pickupDeliveryModeCode && cartLine.DeliveryMode !== emailDeliveryModeCode\r\n : cartLine\r\n );\r\n if (cartLines && cartLines.length > 0) {\r\n return cartLines[0].ShippingAddress;\r\n }\r\n\r\n return undefined;\r\n };\r\n\r\n private _canShip = (): boolean => {\r\n const { checkout, channelDeliveryOptionConfig } = this.props.data;\r\n const { request } = this.props.context;\r\n const pickupDeliveryModeCode = request && request.channel && request.channel.PickupDeliveryModeCode;\r\n const emailDeliveryModeCode = request && request.channel && request.channel.EmailDeliveryModeCode;\r\n if (!checkout.result || !request.channel || checkout.result.checkoutCart.isEmpty || checkout.result.checkoutCart.hasInvoiceLine) {\r\n return false;\r\n }\r\n\r\n // @ts-ignore: Type-checker not realizing above request.channel check\r\n return this.retailMultiplePickUpOptionEnabled\r\n ? checkout?.result?.checkoutCart?.cart?.CartLines?.some(cartLine =>\r\n cartLine.DeliveryMode && cartLine.DeliveryMode !== ''\r\n ? cartLine.DeliveryMode !==\r\n channelDeliveryOptionConfig.result?.PickupDeliveryModeCodes?.find(\r\n deliveryMode => deliveryMode === cartLine.DeliveryMode\r\n ) && cartLine.DeliveryMode !== emailDeliveryModeCode\r\n : cartLine\r\n )\r\n : checkout?.result?.checkoutCart?.cart?.CartLines?.some(cartLine =>\r\n cartLine.DeliveryMode && cartLine.DeliveryMode !== ''\r\n ? cartLine.DeliveryMode !== pickupDeliveryModeCode && cartLine.DeliveryMode !== emailDeliveryModeCode\r\n : cartLine\r\n );\r\n };\r\n\r\n private _onSelectAddress = () => {\r\n this._updateCurrentOperation(AddressOperation.Show, this.addressListSelectedAddress);\r\n this._setShippingAddress(this.addressListSelectedAddress);\r\n this._updateModuleState();\r\n };\r\n\r\n private _goToAddAddress = () => {\r\n this._setDefaultCountryRegionId();\r\n this._updateCurrentOperation(AddressOperation.Add);\r\n };\r\n\r\n private _onAddOrUpdateSuccess = (response: IAddressResponse) => {\r\n /*if (response.customerAddresses) {\r\n console.log(\"response.customerAddresses\");\r\n this.customerAddresses = response.customerAddresses;\r\n }\r\n*/\r\n if (response.address) {\r\n this._updateCurrentOperation(AddressOperation.Show, response.address);\r\n this._setShippingAddress(response.address);\r\n this._updateModuleState();\r\n }\r\n };\r\n\r\n private _setShippingAddress = async (address: Address): Promise => {\r\n if (this.props.data.checkout.result) {\r\n const newShippingAddress = { ...address };\r\n // const fullAddress = `${address.Street}\\n${address.City}, ${address.County} \\n${address.ZipCode}\\n${address.ThreeLetterISORegionName}`;\r\n\r\n if (address.ThreeLetterISORegionName && !newShippingAddress.TwoLetterISORegionName) {\r\n newShippingAddress.TwoLetterISORegionName = this.addressFormat.getTwoLetterISORegionName(address.ThreeLetterISORegionName);\r\n }\r\n // newShippingAddress.FullAddress = fullAddress;\r\n newShippingAddress.FullAddress = '';\r\n await this.props.data.checkout.result.updateShippingAddress({ newShippingAddress });\r\n this.props.data.checkout.result.checkoutCart.updateShippingAddress({ newShippingAddress }).catch(error => {\r\n this.props.telemetry.error(error);\r\n });\r\n }\r\n };\r\n\r\n @computed get shippingAddress(): Address | undefined {\r\n return this.props.data.checkout.result && this.props.data.checkout.result.shippingAddress;\r\n }\r\n\r\n private _resetView = (): void => {\r\n switch (this.currentOperation) {\r\n case AddressOperation.Add:\r\n case AddressOperation.Update:\r\n this._updateCurrentOperation(\r\n //this.addressCommon.isAuthenticatedFlow() ? AddressOperation.List : AddressOperation.Show,\r\n AddressOperation.Show,\r\n this.shippingAddress\r\n );\r\n break;\r\n default:\r\n this._updateCurrentOperation(AddressOperation.Show, this.shippingAddress);\r\n }\r\n this._updateModuleState();\r\n };\r\n\r\n private _updateCurrentOperation = (operation: AddressOperation, selectedAddress?: Address) => {\r\n this.currentOperation = operation;\r\n this.selectedAddress = selectedAddress;\r\n\r\n if (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update) {\r\n this.addUpdateAddress = { ...this.selectedAddress } || {};\r\n set(this.addUpdateAddress, {\r\n ['ThreeLetterISORegionName']: this.addUpdateAddress.ThreeLetterISORegionName || this.countryRegionId\r\n });\r\n set(this.addUpdateAddress, {\r\n ['AddressTypeValue']: this.addUpdateAddress.AddressTypeValue || this.defaultAddressType\r\n });\r\n } else if (this.currentOperation === AddressOperation.List) {\r\n this.addressListSelectedAddress = { ...this.selectedAddress } || {};\r\n }\r\n };\r\n\r\n private _updateModuleState = () => {\r\n if (this.currentOperation === AddressOperation.Show) {\r\n this.props.moduleState.onReady();\r\n } else if (this.isUpdating) {\r\n this.props.moduleState.onPending();\r\n } else {\r\n this.props.moduleState.onUpdating();\r\n }\r\n };\r\n}\r\n\r\nexport default CheckoutShippingAddress;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport { IModule, RichTextComponent } from '@msdyn365-commerce/core';\r\nimport { CommerceProperty } from '@msdyn365-commerce/retail-proxy';\r\nimport * as React from 'react';\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport { IAddressAddItem, IAddressAddUpdateProps, IAddressShowProps } from '@msdyn365-commerce-modules/address';\r\nimport { useForm } from 'react-hook-form';\r\nimport { ICheckoutShippingAddressViewProps } from './custom-checkout-shipping-address';\r\n\r\ninterface ICustomValues {\r\n FirstName_CAP: string;\r\n LastName_CAP: string;\r\n FiscalCode_CAP: string;\r\n Citizenship_CAP: string;\r\n Birthday_CAP: string;\r\n BirthPlace_CAP: string;\r\n OrgName_CAP: string;\r\n VatNum_CAP: string;\r\n Type_CAP: string;\r\n ZipCode_CAP: string;\r\n Address_CAP: string;\r\n City_CAP: string;\r\n Country_CAP: string;\r\n State_CAP: string;\r\n County_CAP: string;\r\n DeliveryMode_CAP: string;\r\n Phone_CAP: string;\r\n}\r\nconst addressData = ['ZipCode_CAP', 'Address_CAP', 'City_CAP', 'Country_CAP', 'State_CAP', 'County_CAP', 'DeliveryMode_CAP', 'Phone_CAP'];\r\n\r\nfunction selectItemByValue(elmnt: HTMLSelectElement, value: string) {\r\n for (let i = 0; i < elmnt.options.length; i++) {\r\n const eValue = elmnt.options[i].value;\r\n if (eValue === value) {\r\n return elmnt.options[i].value;\r\n }\r\n }\r\n return;\r\n}\r\n\r\nconst nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value')?.set;\r\n\r\nconst AddressShow: React.FC = ({ AddressDetail, items, ...other }) => {\r\n // @ts-ignore\r\n const userData = other.userData;\r\n\r\n return (\r\n \r\n {userData &&\r\n Object.keys(userData)\r\n .filter(keyName => !addressData.includes(keyName))\r\n .map((keyName, i) => (\r\n \r\n {userData[keyName]}\r\n \r\n ))}\r\n
INDIRIZZO DI RESIDENZA
\r\n {userData &&\r\n Object.keys(userData)\r\n .filter(keyName => addressData.includes(keyName))\r\n .map((keyName, i) => (\r\n \r\n {userData[keyName]}\r\n \r\n ))}\r\n
\r\n );\r\n};\r\n\r\nconst extraPersonalData = [\r\n 'FirstName_CAP',\r\n 'LastName_CAP',\r\n 'FiscalCode_CAP',\r\n 'Citizenship_CAP',\r\n 'Birthday_CAP',\r\n 'BirthPlace_CAP',\r\n 'OrgName_CAP',\r\n 'VatNum_CAP',\r\n 'Type_CAP',\r\n 'ZipCode_CAP',\r\n 'Address_CAP',\r\n 'City_CAP',\r\n 'Country_CAP',\r\n 'DeliveryMode_CAP',\r\n 'Phone_CAP',\r\n 'State_CAP',\r\n 'County_CAP'\r\n];\r\n\r\nconst updateExtProps = async (data: ICustomValues, props: IModule) => {\r\n const dataCompiled = [];\r\n Object.keys(data).forEach(key => {\r\n const value = { StringValue: data[key] };\r\n dataCompiled.push({\r\n Key: key,\r\n Value: value\r\n });\r\n });\r\n\r\n for (const str of extraPersonalData) {\r\n if (!Object.keys(data).includes(str)) {\r\n dataCompiled.push({\r\n Key: str,\r\n Value: { StringValue: '' }\r\n });\r\n }\r\n }\r\n // @ts-ignore\r\n const checkoutResult = props.data.checkout.result;\r\n // @ts-ignore\r\n const cartResult = props.data.cart.result;\r\n\r\n const dataCompiledCc = [\r\n {\r\n Key: 'ActiveCartId_CAP',\r\n Value: { StringValue: cartResult.cart.Id }\r\n },\r\n {\r\n Key: 'CheckoutCartId_CAP',\r\n Value: { StringValue: checkoutResult.checkoutCart.cart.Id }\r\n }\r\n ];\r\n\r\n Array.prototype.push.apply(dataCompiledCc, dataCompiled);\r\n // const currentCartState = await getCartState(props.context?.actionContext);\r\n\r\n // await checkoutResult.updateExtensionProperties({ newExtensionProperties: dataCompiledCc });\r\n await checkoutResult.checkoutCart.updateExtensionProperties({ newExtensionProperties: dataCompiledCc });\r\n // è necessario in quanto copia indirizzo in extProps del salesOrder dal active cart\r\n await cartResult.updateExtensionProperties({ newExtensionProperties: dataCompiledCc });\r\n // await currentCartState.refreshCart({});\r\n};\r\n\r\nconst _capDataSave = async (props: IModule, data: ICustomValues) => {\r\n await updateExtProps(data, props);\r\n};\r\n\r\nconst _capDataRender = async (props: IModule) => {\r\n // @ts-ignore\r\n const checkoutCart = props.data.checkout.result.checkoutCart;\r\n // @ts-ignore\r\n const currentCartState = props.data.cart.result;\r\n const extProps: CommerceProperty[] = checkoutCart?.cart?.ExtensionProperties;\r\n if (!extProps) {\r\n return;\r\n }\r\n\r\n // @ts-ignore\r\n const extPropsToRemove = extProps.filter((fieldVal: { Key: string }) => fieldVal.Key === 'ExtPropsRemove_CAP')[0]?.Value?.BooleanValue;\r\n if (extPropsToRemove === true) {\r\n const extKeysToRemove = extraPersonalData;\r\n\r\n const extPropsToEmpty = [];\r\n for (const prop of extKeysToRemove) {\r\n if (!Object.keys(extProps).includes(prop)) {\r\n extPropsToEmpty.push({\r\n Key: prop,\r\n Value: {}\r\n });\r\n }\r\n }\r\n extPropsToEmpty.push({\r\n Key: 'ExtPropsRemove_CAP',\r\n Value: {\r\n BooleanValue: false\r\n }\r\n });\r\n await currentCartState.updateExtensionProperties({ newExtensionProperties: extPropsToEmpty });\r\n return;\r\n } else {\r\n const compiledFields = extProps?.filter(item => item.Key && extraPersonalData.indexOf(item.Key) > -1);\r\n\r\n const compiledFieldsData: [] = [];\r\n if (compiledFields) {\r\n // @ts-ignore\r\n compiledFields.forEach(compiledField => {\r\n const values = [compiledField?.Value?.StringValue, compiledField?.Value?.IntegerValue, compiledField?.Value?.BooleanValue];\r\n if (compiledField.Key) {\r\n // @ts-ignore\r\n compiledFieldsData[compiledField.Key] = values.filter(value => value !== null)[0];\r\n }\r\n });\r\n }\r\n return compiledFieldsData;\r\n }\r\n};\r\n\r\nconst _customAddressName = (userFirstName: string, userLastName: string) => {\r\n // @ts-ignore\r\n const nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value').set;\r\n const input = document.getElementById('shipping_addressname');\r\n if (input !== undefined) {\r\n if (nativeInputValueSetter === undefined) {\r\n return;\r\n }\r\n nativeInputValueSetter.call(input, `${userFirstName} ${userLastName}`);\r\n const eCustom = new Event('input', { bubbles: true });\r\n if (input !== null) {\r\n input.dispatchEvent(eCustom);\r\n }\r\n }\r\n};\r\n\r\ninterface IAddressAddUpdatePropsExt extends IAddressAddUpdateProps {\r\n changeUserData(arg: ICustomValues): void;\r\n}\r\n\r\n// tslint:disable-next-line:max-func-body-length\r\nconst AddressAddUpdate: React.FC = ({\r\n AddressForm,\r\n heading,\r\n items,\r\n hasError,\r\n error,\r\n isShowSaveButton,\r\n saveButton,\r\n isShowCancelButton,\r\n cancelButton,\r\n changeUserData,\r\n ...other\r\n}) => {\r\n // @ts-ignore\r\n const moduleProps = other?.moduleProps;\r\n const moduleState = moduleProps.moduleState;\r\n const resources = moduleProps?.resources;\r\n const intro = moduleProps?.config.moduleIntro;\r\n const userFirstName = moduleProps.context.request.user.firstName;\r\n const userLastName = moduleProps.context.request.user.lastName;\r\n const fiscalPattern = /^([A-Za-z]{6}[0-9lmnpqrstuvLMNPQRSTUV]{2}[abcdehlmprstABCDEHLMPRST]{1}[0-9lmnpqrstuvLMNPQRSTUV]{2}[A-Za-z]{1}[0-9lmnpqrstuvLMNPQRSTUV]{3}[A-Za-z]{1})$|([0-9]{11})$/;\r\n const birthdayPattern = /^([0-2][0-9]|(3)[0-1])(\\/)(((0)[0-9])|((1)[0-2]))(\\/)\\d{4}$/;\r\n const VatNumPattern = /^[0-9]{11}$/;\r\n\r\n const {\r\n register,\r\n watch,\r\n formState: { errors },\r\n handleSubmit,\r\n setValue,\r\n /*setError,*/ reset\r\n } = useForm({\r\n defaultValues: {\r\n Type_CAP: 'person',\r\n FirstName_CAP: userFirstName,\r\n LastName_CAP: userLastName\r\n }\r\n });\r\n const typeSelected: string = watch('Type_CAP');\r\n const [dataCompiled, setDataCompiled] = React.useState({});\r\n const _renderInput = (\r\n name: string,\r\n label: string,\r\n required: boolean,\r\n errorMessage: string,\r\n pattern?: RegExp,\r\n disabled?: boolean,\r\n format?: string\r\n ): JSX.Element => {\r\n return (\r\n \r\n \r\n {format &&
({format})
}\r\n {errors[name] && {errorMessage}}\r\n \r\n \r\n );\r\n };\r\n const ownerAddressComponents = {\r\n Address_CAP: 'shipping_addressstreet',\r\n City_CAP: 'shipping_addresscity',\r\n State_CAP: 'shipping_addressstate',\r\n ZipCode_CAP: 'shipping_addresszipcode',\r\n County_CAP: 'shipping_addresscounty',\r\n Phone_CAP: 'shipping_addressphone'\r\n };\r\n const setData = async () => {\r\n const userExtraData: [] | undefined = await _capDataRender(moduleProps);\r\n\r\n if (userExtraData) {\r\n Object.keys(userExtraData).forEach(key => {\r\n if (userExtraData[key]) {\r\n // @ts-ignore\r\n setValue(key, userExtraData[key], { shouldDirty: true });\r\n if (ownerAddressComponents[key]) {\r\n populateFormElement(ownerAddressComponents[key], userExtraData[key]);\r\n }\r\n }\r\n });\r\n }\r\n handleChangeUserData({\r\n FirstName_CAP: '',\r\n LastName_CAP: '',\r\n Type_CAP: '',\r\n BirthPlace_CAP: '',\r\n Birthday_CAP: '',\r\n Citizenship_CAP: '',\r\n FiscalCode_CAP: '',\r\n OrgName_CAP: '',\r\n VatNum_CAP: '',\r\n ZipCode_CAP: '',\r\n Address_CAP: '',\r\n City_CAP: '',\r\n Country_CAP: '',\r\n DeliveryMode_CAP: '',\r\n Phone_CAP: '',\r\n State_CAP: '',\r\n County_CAP: '',\r\n ...userExtraData\r\n });\r\n };\r\n function handleChangeUserData(data: ICustomValues): void {\r\n changeUserData(data);\r\n }\r\n const _customSubmit = () => {\r\n void handleSubmit(onSubmit)();\r\n };\r\n const _resetForm = () => {\r\n reset(dataCompiled);\r\n moduleState.onCancel();\r\n };\r\n const onSubmit = async (data: ICustomValues) => {\r\n data.ZipCode_CAP = (document.getElementById('shipping_addresszipcode') as HTMLInputElement).value;\r\n data.Address_CAP = (document.getElementById('shipping_addressstreet') as HTMLInputElement).value;\r\n data.City_CAP = (document.getElementById('shipping_addresscity') as HTMLInputElement).value;\r\n data.Country_CAP = 'ITA';\r\n data.DeliveryMode_CAP = moduleProps.data.checkout.result.checkoutCart.cart.CartLines[0].DeliveryMode;\r\n data.Phone_CAP = (document.getElementById('shipping_addressphone') as HTMLInputElement).value;\r\n data.County_CAP = (document.getElementById('shipping_addresscounty') as HTMLInputElement).value;\r\n data.State_CAP = (document.getElementById('shipping_addressstate') as HTMLInputElement).value;\r\n\r\n setDataCompiled(data);\r\n void _capDataSave(moduleProps, data).then(() => {\r\n void handleChangeUserData(data);\r\n // moduleState.onEdit();\r\n moduleState.onSubmit();\r\n });\r\n };\r\n\r\n function populateFormElement(id: string, value: string) {\r\n if (id !== 'shipping_addressstate') {\r\n const input = document.getElementById(id);\r\n if (input !== undefined) {\r\n if (nativeInputValueSetter === undefined) {\r\n return;\r\n }\r\n nativeInputValueSetter.call(input, value);\r\n const eCustom = new Event('input', { bubbles: true });\r\n if (input !== null) {\r\n input.dispatchEvent(eCustom);\r\n }\r\n }\r\n } else {\r\n const input = document.getElementById(id) as HTMLSelectElement;\r\n if (input !== null) {\r\n const selectedValue = selectItemByValue(input, value);\r\n if (selectedValue !== undefined) {\r\n input.value = selectedValue;\r\n const event = new Event('change', { bubbles: true });\r\n input.dispatchEvent(event);\r\n }\r\n }\r\n }\r\n }\r\n\r\n React.useEffect(() => {\r\n _customAddressName(userFirstName, userLastName);\r\n void setData();\r\n }, []);\r\n return (\r\n \r\n {heading}\r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n {_renderInput('FirstName_CAP', `${resources.FirstName_CAP_Label}`, true, 'Inserisci il nome corretto', undefined, true)}\r\n {_renderInput('LastName_CAP', `${resources.LastName_CAP_Label}`, true, 'Inserisci il cognome corretto', undefined, true)}\r\n {typeSelected === 'person' &&\r\n _renderInput(\r\n 'FiscalCode_CAP',\r\n `${resources.FiscalCode_CAP_Label} *`,\r\n true,\r\n 'Inserisci il codice fiscale corretto',\r\n fiscalPattern\r\n )}\r\n {typeSelected === 'person' &&\r\n _renderInput('Citizenship_CAP', `${resources.Citizenship_CAP_Label}`, true, 'Inserisci la cittadinanza')}\r\n {typeSelected === 'person' &&\r\n _renderInput(\r\n 'Birthday_CAP',\r\n `${resources.Birthday_CAP_Label}`,\r\n true,\r\n 'Inserisci la data di nascita corretta',\r\n birthdayPattern,\r\n false,\r\n 'dd/mm/yyyy'\r\n )}\r\n {typeSelected === 'person' &&\r\n _renderInput('BirthPlace_CAP', `${resources.BirthPlace_CAP_Label}`, true, 'Inserisci il luogo di nascita')}\r\n {typeSelected !== 'person' && _renderInput('OrgName_CAP', `${resources.OrgName_CAP_Label}`, true, 'Inserisci nome Azienda')}\r\n {typeSelected === 'soleproprietorship' &&\r\n _renderInput(\r\n 'FiscalCode_CAP',\r\n `${resources.FiscalCode_CAP_Label} *`,\r\n true,\r\n 'Inserisci il codice fiscale corretto',\r\n fiscalPattern\r\n )}\r\n {typeSelected === 'soleproprietorship' &&\r\n _renderInput('VatNum_CAP', `${resources.VatNum_CAP_Label}`, false, 'Inserisci la Partita Iva corretta', VatNumPattern)}\r\n {typeSelected === 'company' &&\r\n _renderInput('VatNum_CAP', `${resources.VatNum_CAP_Label} *`, true, 'Inserisci la Partita Iva corretta', VatNumPattern)}\r\n\r\n {items &&\r\n items.map((item: IAddressAddItem) => {\r\n const { AddressItem, key, label, alert, input } = item;\r\n if (key === 'ThreeLetterISORegionName') {\r\n // @ts-ignore\r\n input.props.additionalAddributes.disabled = true;\r\n }\r\n if (key === 'Name') {\r\n // @ts-ignore\r\n input.props.additionalAddributes.disabled = true;\r\n }\r\n const extraInfo = {\r\n ThreeLetterISORegionName: 'il servizio di e-commerce è attivo in Italia',\r\n County: 'Codice ISO a 2 lettere'\r\n };\r\n return (\r\n \r\n {label}\r\n {extraInfo &&
{extraInfo[key] && extraInfo[key]}
}\r\n {alert}\r\n {input}\r\n
\r\n );\r\n })}\r\n\r\n {hasError && (\r\n \r\n {error.title}\r\n {error.message}\r\n \r\n )}\r\n
\r\n \r\n Salva e continua\r\n \r\n \r\n Annulla\r\n \r\n
\r\n
\r\n );\r\n};\r\n\r\nconst CheckoutShippingAddressView: React.FC = props => {\r\n const { CheckoutShippingAddress, viewState, showAddress, showAddOrUpdateAddress } = props;\r\n const [userData, setUserData] = React.useState({\r\n FirstName_CAP: '',\r\n LastName_CAP: '',\r\n FiscalCode_CAP: '',\r\n Citizenship_CAP: '',\r\n Birthday_CAP: '',\r\n BirthPlace_CAP: '',\r\n OrgName_CAP: '',\r\n VatNum_CAP: '',\r\n Type_CAP: '',\r\n ZipCode_CAP: '',\r\n Address_CAP: '',\r\n City_CAP: '',\r\n Country_CAP: '',\r\n DeliveryMode_CAP: '',\r\n Phone_CAP: '',\r\n County_CAP: '',\r\n State_CAP: ''\r\n });\r\n const setData = async () => {\r\n const userExtraData: [] | undefined = await _capDataRender(props);\r\n if (userExtraData) {\r\n setUserData({\r\n FirstName_CAP: '',\r\n LastName_CAP: '',\r\n Type_CAP: '',\r\n BirthPlace_CAP: '',\r\n Birthday_CAP: '',\r\n Citizenship_CAP: '',\r\n FiscalCode_CAP: '',\r\n OrgName_CAP: '',\r\n VatNum_CAP: '',\r\n ZipCode_CAP: '',\r\n Address_CAP: '',\r\n City_CAP: '',\r\n Country_CAP: '',\r\n DeliveryMode_CAP: '',\r\n Phone_CAP: '',\r\n County_CAP: '',\r\n State_CAP: '',\r\n ...userExtraData\r\n });\r\n }\r\n };\r\n function handleChangeUserData(userExtraData: ICustomValues): void {\r\n setUserData(userExtraData);\r\n }\r\n const personalDataProps = {\r\n ...showAddress,\r\n ...CheckoutShippingAddress,\r\n userData: userData\r\n };\r\n React.useEffect(() => {\r\n void setData();\r\n }, []);\r\n // IAddressShowProps\r\n return (\r\n \r\n {userData && userData.Type_CAP !== '' && (viewState.isShowAddress || viewState.isShowAddress === undefined) && (\r\n \r\n )}\r\n {((userData && userData.Type_CAP === '') || viewState.isShowAddOrUpdateAddress) && (\r\n \r\n )}\r\n \r\n );\r\n};\r\n\r\nexport default CheckoutShippingAddressView;\r\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"],"names":["GetStateProvincesInput","constructor","countryRegionId","apiSettings","getCacheKey","buildCacheKey","this","getCacheObjectType","dataCacheType","async","getStateProvinceAction","input","ctx","getStateProvincesAsync","callerContext","queryResultSettings","createObservableDataAction","action","AddressCommon","context","resources","telemetry","getDefaultCountryRegionId","countryRegions","market","marketISOCode","currentCountryRegion","find","countryRegion","ISOCode","CountryRegionId","parseRetailException","errorTitle","addressErrorMessageTitle","errorMessage","addressGenericErrorMessage","isAuthenticatedFlow","getStateProvinces","response","actionContext","request","error","debug","Promise","resolve","isEmpty","address","ThreeLetterISORegionName","State","City","addCustomerAddress","submitCustomerAddress","addAddress","updateCustomerAddress","updateAddress","updateCustomerPrimaryAddress","updatePrimaryAddress","addressAction","AddressTypeValue","AddressManagementInput","execAddressAction","addresses","length","RecordId","customerAddresses","AddressItemDisplayType","AddressValidationRuleType","AddressItemType","AddressOperation","AddressType","AddressFormat","countryRegionsInfo","addressMetaData","addressPurposes","getPrefilledAddressDropdownData","stateDefaultSelectionText","stateProvinceInfo","defaultStateText","key","value","dropdownData","getCountryFormat","getStateFormat","unshift","getAddressTypeFormat","getTwoLetterISORegionName","_getCountryRegionInfo","validateAddressFormat","validationError","propertyName","validationtor","isValid","getAddressFormat","forEach","addressFormatItem","name","_inputValidation","undefined","getTranformedAddress","result","postalCode","ZipCode","selectedState","state","StateName","adminDistrict","StateId","addressLine","Street","locality","district","DistrictName","CountyName","FullAddress","formattedAddress","_validateRegEx","validationRule","regEx","RegExp","test","get","countryRegionInfo","_getAddressDisplayFormat","map","ShortName","addressPurpose","Name","set","validationRules","message","toLowerCase","addressDisplayItem","AddressFormatLines","AddressTypeItem","_extendAddressDisplayFormat","push","nameDisplayItem","formatLine","AddressComponentNameValue","addressItem","getItemFormat","isNewLine","NewLine","phoneDisplayItem","Phone","isPrimaryDisplayItem","IsPrimary","type","AutoSuggest","autoSuggestOptions","BingMapsApiKey","countryCode","defaultLanguageId","excludedAddressFields","attachAutoSuggest","inputId","containerId","selectedSuggestionCallback","autoSuggestManager","Microsoft","Maps","loadModule","callback","options","AutosuggestManager","attachAutosuggest","document","querySelector","setAttribute","setTimeout","errorCallback","credentials","bingMapsApiKey","changeAutoSuggestionCountryCode","setOptions","disposeAutoSuggest","detachAutosuggest","dispose","_loadMapAPI","storeSelectorStateManager","loadMapApi","lang","AddressMetaData","excluded","required","metaData","requiredFieldRegEx","resourcesPrefix","maxLength","excludedTypes","requiredFields","_init","id","item","_addItem","Input","County","Dropdown","District","StreetNumber","BuildingCompliment","Postbox","House_RU","Flat_RU","CountryOKSMCode_RU","Checkbox","displayType","includes","nameKey","replace","_validationRules","isRequired","rule","Required","optionalString","label","ruleType","Object","keys","itemType","_validationRule","React","className","role","text","ariaLabel","disabled","telemetryContent","onClick","payLoad","getPayloadObject","attributes","getTelemetryAttributes","isChecked","additionalAddributes","autoFocus","onChange","checked","displayData","selectedValue","isSelected","getDropdownItem","title","htmlFor","getRequriedAttribute","getAddessItems","selectedAddress","props","addressFormat","addressType","dropdownDisplayData","defaultCountryRegionId","defaultAddressType","onInputChange","onDropdownChange","index","elementId","classname","AddressInputComponent","AdressCheckboxComponent","AdressDropdownComponent","AddressItem","AddressLabelComponent","alert","AddressAlertComponent","isShowLabel","labelText","mainClass","AddressShow","AddressDetail","items","addressTypeValue","toString","description","AddressDetailItemComponent","getInput","onAddressOptionChange","ichecked","additionalAttributes","getAddressSelectItems","SelectItem","showItems","CheckoutShippingAddress","super","addressListSelectedAddress","multiplePickupStoreSwitchName","retailMultiplePickUpOptionEnabled","_renderAddOrUpdateAddress","currentOperation","Add","addressCommon","editAddressHeading","addAddressHeading","hasError","onCancel","onSave","hasExternalSubmitGroup","isUpdating","addressActionResponse","heading","AddressForm","Heading","isShowSaveButton","saveButton","AddressButtonComponent","addressSaveButtonText","addressSaveButtonAriaLabel","isShowCancelButton","cancelButton","addressCancelButtonText","addressCancelButtonAriaLabel","AddressError","AddressErrorTitleComponent","AddressErrorMessageComponent","AddressAddUpdate","Shipping","addUpdateAddress","addressStateDefaultSelectionText","_onAddressAddUpdateInputChange","_onAddressAddUpdateDropdownChange","moduleState","onSubmit","_resetView","_renderSelectAddress","onAddAddress","SelectAddress","addButton","addressAddButtonText","addressAddButtonAriaLabel","AddressSelect","_onAddressOptionChange","_goToAddAddress","_onSelectAddress","_attachMapAutoSuggest","data","isMapApiLoaded","autoSuggest","_onSuggestionSelected","_clearAddressFields","format","_clearValidation","event","addressRecordId","currentTarget","onAddressAddUpdate","target","_onCountryChange","_onAddressAddUpdateSubmit","Update","_updateModuleState","then","_onAddOrUpdateSuccess","twoLetterISORegionName","_getAddressFormatExcludeList","config","addressFormatExcludeList","showAddressType","_getStateProvinces","some","_getDefaultAddress","_initModuleState","init","status","onEdit","_canShip","defaultAddress","checkout","checkoutCart","cart","ShippingAddress","_getShippingAddressFromCartLines","_updateCurrentOperation","Show","_setShippingAddress","isPaymentVerificationRedirection","onReady","List","shippingAddress","channelDeliveryOptionConfig","pickupDeliveryModeCode","channel","PickupDeliveryModeCode","emailDeliveryModeCode","EmailDeliveryModeCode","cartLines","CartLines","filter","cartLine","DeliveryMode","PickupDeliveryModeCodes","deliveryMode","hasInvoiceLine","_setDefaultCountryRegionId","newShippingAddress","TwoLetterISORegionName","updateShippingAddress","catch","operation","onPending","onUpdating","countryStates","featureState","feature","IsEnabled","getTelemetryObject","telemetryPageName","friendlyName","requestFormData","query","pv","requestContext","autoSuggestionEnabled","reaction","BingMapsEnabled","ChannelCountryRegionISOCode","DefaultLanguageId","render","renderView","viewState","isShowAddress","isShowAddresList","isShowAddOrUpdateAddress","moduleProps","classnames","showAddress","_renderShowAddress","showAddressSelect","showAddOrUpdateAddress","__decorate","observable","computed","withModuleState","observer","addressData","nativeInputValueSetter","getOwnPropertyDescriptor","window","HTMLInputElement","prototype","userData","Node","keyName","i","extraPersonalData","_capDataSave","dataCompiled","StringValue","Key","Value","str","checkoutResult","cartResult","dataCompiledCc","Id","Array","apply","updateExtensionProperties","newExtensionProperties","updateExtProps","_capDataRender","currentCartState","extProps","ExtensionProperties","fieldVal","BooleanValue","extKeysToRemove","extPropsToEmpty","prop","compiledFields","indexOf","compiledFieldsData","compiledField","values","IntegerValue","changeUserData","other","intro","moduleIntro","userFirstName","user","firstName","userLastName","lastName","fiscalPattern","VatNumPattern","register","watch","formState","errors","handleSubmit","setValue","reset","useForm","defaultValues","Type_CAP","FirstName_CAP","LastName_CAP","typeSelected","setDataCompiled","_renderInput","pattern","readOnly","ref","ownerAddressComponents","Address_CAP","City_CAP","State_CAP","ZipCode_CAP","County_CAP","Phone_CAP","setData","userExtraData","shouldDirty","getElementById","call","eCustom","Event","bubbles","dispatchEvent","elmnt","selectItemByValue","populateFormElement","handleChangeUserData","BirthPlace_CAP","Birthday_CAP","Citizenship_CAP","FiscalCode_CAP","OrgName_CAP","VatNum_CAP","Country_CAP","DeliveryMode_CAP","_customAddressName","RichTextComponent","FirstName_CAP_Label","LastName_CAP_Label","FiscalCode_CAP_Label","Citizenship_CAP_Label","Birthday_CAP_Label","BirthPlace_CAP_Label","OrgName_CAP_Label","VatNum_CAP_Label","extraInfo","setUserData","personalDataProps","Module","_this","CheckoutState","inputData","CheckoutStateInput","_giftCards","_giftCardExtends","_loyaltyAmount","_guestCheckoutEmail","_isTermsAndConditionAccepted","_customerAccountAmount","_tokenizedPaymentCard","_tenderLine","_billingAddress","_shippingAddress","_cardPrefix","_loyaltyCardNumber","newTokenizedPaymentCard","newTenderLine","newBillingAddress","newCardPrefix","giftCardNumber","giftCard","newLoyaltyCardNumber","newAmount","newGuestCheckoutEmail","newIsTermsAndConditionAccepted","getModuleStates","cacheKey","ModuleStatesCacheKey","moduleStates","update","WrappedComponent","_super","typeName","states","hasInitialized","isCancellable","isSubmitContainer","childIds","validate","isReady","isPending","isSkipped","isDisabled","isCancelAllowed","shouldSubmitContainer","hasModuleState","setIsRequired","setIsCancellable","setIsSubmitContainer","setHasError","onSkip","onDisable","getModule","moduleId","getModuleStateManager","getModuleByTypeName","getModuleStateManagerByTypeName","_moduleState","modules","source","module","isMatch","allMatched","skipSkippableItem","_validateLeaf","app","shouldEnableSinglePaymentAuthorizationCheckout","childId","_isPaymentSectionContainer","_validateContainer","ArrayExtensions","enableControl","initializeState","__extends","ModuleState","nextProps"],"sourceRoot":""}