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,EAAAA,KAAIC,OAAAC,OAAA,GAAKnH,GAAYD,IAYhG,EAV2EU,IACvE,MAAM,0BAAE8F,EAAyB,KAAEM,EAAI,KAAEC,GAASrG,EAClD,OACInD,EAAAA,cAACgK,EAAAA,OAAMJ,OAAAC,OAAA,GAAKZ,GACPM,GAAQvJ,EAAAA,cAAC0J,EAAIE,OAAAC,OAAA,GAAKN,IAClBC,GAAQxJ,EAAAA,cAAC8J,EAAIF,OAAAC,OAAA,GAAKL,0BCrE/BS,EAAOC,QAAUlK,2BCAjBiK,EAAOC,QAAUC","sources":["webpack://henrys-ecommerce/./lib/gift-card-balance-check/module-registration.js?2f56","webpack://henrys-ecommerce/./src/modules/checkout/methods/checkout.ts?7b6b","webpack://henrys-ecommerce/./src/modules/gift-card-balance-check/components/get-form.tsx?e249","webpack://henrys-ecommerce/./src/modules/gift-card-balance-check/components/get-item.tsx?4862","webpack://henrys-ecommerce/./src/modules/gift-card-balance-check/gift-card-balance-check.tsx?d1f8","webpack://henrys-ecommerce/./src/modules/gift-card-balance-check/gift-card-balance-check.view.tsx?a0c9","webpack://henrys-ecommerce/external var \"React\"?0d3b","webpack://henrys-ecommerce/external var \"ReactDOM\"?853b"],"sourcesContent":["const binding = { modules: {}, dataActions: {} };\n\n (binding.modules['gift-card-balance-check'] = {\n c: () => require('@msdyn365-commerce-modules/checkout/dist/lib/modules/gift-card-balance-check/gift-card-balance-check'),\n $type: 'contentModule',\n da: [],\n \n iNM: true,\n ns: '@msdyn365-commerce-modules',\n n: 'gift-card-balance-check',\n p: 'checkout',\n \n pdp: '',\n \n \n md: 'node_modules/@msdyn365-commerce-modules/checkout/dist/lib/modules/gift-card-balance-check'\n });\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['@msdyn365-commerce-modules|checkout|modules|gift-card-balance-check|gift-card-balance-check'] = {\n c: () => require('@msdyn365-commerce-modules/checkout/dist/lib/modules/gift-card-balance-check/gift-card-balance-check.view.js'),\n cn: '@msdyn365-commerce-modules-checkout-gift-card-balance-check'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { SalesOrder } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { CartCheckout } from '../../../common/checkout';\n\nexport const OPERATIONS = {\n PayCard: 201,\n PayGiftCertificate: 214,\n PayLoyalty: 207,\n PayCustomerAccount: 202\n};\n\nexport default async (\n ctx: IActionContext,\n updatedCartVersion?: number,\n isPaymentVerificationRedirection?: boolean\n): Promise => {\n return CartCheckout(ctx, updatedCartVersion, isPaymentVerificationRedirection);\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Alert, Button, INodeProps, NodeTag } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { showAdditionalFields } from '../gift-card-balance-check.props.autogenerated';\n\nexport interface IGetFormInput {\n errorMessage: string;\n giftCardNumber: string;\n giftCardPin: string;\n giftCardExp: string;\n inputRef?: React.RefObject;\n inputPinRef?: React.RefObject;\n inputExpRef?: React.RefObject;\n supportExternalGiftCard?: boolean;\n additionalFields?: showAdditionalFields;\n resources: {\n balanceCheckButton: string;\n giftCardFormLabel: string;\n giftCardNumberLabel: string;\n giftCardPinLabel: string;\n giftCardExpLabel: string;\n giftCardAlertLabel: string;\n giftCardPinPlaceholderText: string;\n giftCardExpPlaceholderText: string;\n };\n onEnterGiftCardNumber(giftCardNumber: string): void;\n onEnterGiftCardPin(giftCardPin: string): void;\n onEnterGiftCardExp(giftCardExp: string): void;\n onApplyGiftCard(): Promise;\n}\n\nexport interface IForm {\n formProps: INodeProps;\n label: React.ReactNode;\n inputPinLabel: React.ReactNode;\n inputExpLabel: React.ReactNode;\n alert: React.ReactNode;\n inputProps: INodeProps;\n inputNumProps: INodeProps;\n inputPinProps: INodeProps;\n inputExpProps: INodeProps;\n inputNumber: React.ReactNode;\n inputPin: React.ReactNode;\n inputExp: React.ReactNode;\n applyButton: React.ReactNode;\n supportExternalGiftCard: boolean | undefined;\n showGiftCardPinInput: boolean | undefined;\n showGiftCardExpInput: boolean | undefined;\n alertFieldLabel: React.ReactNode;\n}\n\n/**\n * On apply function.\n * @param onApplyGiftCard -On apply gift card.\n * @returns Apply gift card.\n */\nconst onApplyHandler = (onApplyGiftCard: () => Promise) => async (event: React.SyntheticEvent): Promise => {\n event.preventDefault();\n await onApplyGiftCard();\n};\n\n/**\n * On change number function.\n * @param onEnterGiftCardNumber -On enter gift card number.\n * @returns On gift card enter pin function result.\n */\nconst onChangeNumberHandler = (onEnterGiftCardNumber: (giftCardNumber: string) => void) => (event: React.ChangeEvent) => {\n const value = (event.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\n onEnterGiftCardNumber(value);\n};\n\n/**\n * On change pin function.\n * @param onEnterGiftCardPin -On enter gift card pin.\n * @returns On enter gift card pin function result.\n */\nconst onChangePinHandler = (onEnterGiftCardPin: (giftCardPin: string) => void) => (event: React.ChangeEvent) => {\n const value = (event.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\n onEnterGiftCardPin(value);\n};\n\n/**\n * On change exp function.\n * @param onEnterGiftCardExp -On enter gift card.\n * @returns On enter gift card function result.\n */\nconst onChangeExpHandler = (onEnterGiftCardExp: (giftCardExp: string) => void) => (event: React.ChangeEvent) => {\n const value = (event.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\n onEnterGiftCardExp(value);\n};\n\nexport const getForm = (options: IGetFormInput): IForm => {\n const {\n errorMessage,\n inputRef,\n inputPinRef,\n inputExpRef,\n giftCardNumber,\n giftCardPin,\n giftCardExp,\n onEnterGiftCardNumber,\n onEnterGiftCardPin,\n onEnterGiftCardExp,\n onApplyGiftCard,\n supportExternalGiftCard,\n additionalFields,\n resources: {\n balanceCheckButton,\n giftCardFormLabel,\n giftCardNumberLabel,\n giftCardPinLabel,\n giftCardExpLabel,\n giftCardAlertLabel,\n giftCardPinPlaceholderText,\n giftCardExpPlaceholderText\n }\n } = options;\n\n const formProps = {\n className: classnames('ms-gift-card-balance-check__form', { 'is-invalid': !!errorMessage }),\n onSubmit: onApplyHandler(onApplyGiftCard),\n tag: 'form' as NodeTag\n };\n\n const label = (\n \n );\n\n const inputPinLabel = (\n \n );\n\n const inputExpLabel = (\n \n );\n\n const alertFieldLabel = (\n \n );\n\n const alert = (\n \n {errorMessage}\n \n );\n\n const inputProps = {\n className: 'ms-gift-card-balance-check__input-fields'\n };\n\n const inputNumProps = {\n className: 'ms-gift-card-balance-check__input-num-fields'\n };\n\n const inputPinProps = {\n className: 'ms-gift-card-balance-check__input-pin-fields'\n };\n\n const inputExpProps = {\n className: 'ms-gift-card-balance-check__input-exp-fields'\n };\n\n const inputNumber = (\n \n );\n\n const inputPin = (\n \n );\n\n const inputExp = (\n \n );\n\n const applyButton = (\n \n {balanceCheckButton}\n \n );\n\n let showGiftCardPinInput = false;\n let showGiftCardExpInput = false;\n\n switch (additionalFields) {\n case showAdditionalFields.pin:\n showGiftCardPinInput = true;\n break;\n case showAdditionalFields.expirationDate:\n showGiftCardExpInput = true;\n break;\n case showAdditionalFields.pinAndExpirationDate:\n showGiftCardPinInput = true;\n showGiftCardExpInput = true;\n break;\n default:\n }\n\n return {\n formProps,\n label,\n inputPinLabel,\n inputExpLabel,\n alert,\n inputProps,\n inputNumProps,\n inputPinProps,\n inputExpProps,\n inputNumber,\n inputPin,\n inputExp,\n applyButton,\n supportExternalGiftCard,\n showGiftCardPinInput,\n showGiftCardExpInput,\n alertFieldLabel\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { GiftCard } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IGetItemInput {\n giftCard: GiftCard;\n resources: {\n enteredGiftCardLabel: string;\n giftCardAvailableBalanceLabel: string;\n };\n getFormattedPrice(price?: number, currencyCode?: string): string;\n}\n\nexport interface IItem {\n itemProps: INodeProps;\n id?: string;\n selectedGiftCard: React.ReactNode;\n removeButton?: React.ReactNode;\n}\n\n/**\n * GiftCardItem component.\n * @param root0\n * @param root0.giftCard\n * @param root0.getFormattedPrice\n * @param root0.resources\n * @param root0.resources.enteredGiftCardLabel\n * @param root0.resources.giftCardAvailableBalanceLabel\n * @extends {React.PureComponent}\n */\nexport const getItem = ({\n giftCard,\n getFormattedPrice,\n resources: { enteredGiftCardLabel, giftCardAvailableBalanceLabel }\n}: IGetItemInput): IItem => {\n const balance = getFormattedPrice(giftCard.Balance, giftCard.CardCurrencyCode);\n const giftCardLast4Digit = (giftCard.Id || '').substr(-4);\n\n const itemProps = {\n className: 'ms-gift-card-balance-check__item'\n };\n\n const selectedGiftCard = (\n \n {enteredGiftCardLabel}\n {` `}\n {giftCardLast4Digit}\n {` `}({giftCardAvailableBalanceLabel}\n {` `}\n {balance})\n \n );\n\n return {\n itemProps,\n id: giftCard && giftCard.Id,\n selectedGiftCard\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n getGiftCardAsync,\n getTenderTypesAsync,\n resolveCardTypesAsync\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\nimport {\n CardType,\n CardTypeInfo,\n GiftCard,\n RetailOperation,\n TenderType\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\nimport classname from 'classnames';\nimport * as React from 'react';\n\nimport { OPERATIONS } from '../checkout';\nimport { getForm, IForm } from './components/get-form';\nimport { getItem, IItem } from './components/get-item';\nimport { IGiftCardBalanceCheckProps } from './gift-card-balance-check.props.autogenerated';\n\ninterface IGiftCardBalanceCheckState {\n isFetchingGiftCard: boolean;\n errorMessage: string;\n giftCardNumber: string;\n giftCardPin: string;\n giftCardExp: string;\n giftCard?: GiftCard;\n}\n\nenum SupportedGiftCardType {\n Internal = 'internal',\n External = 'external',\n Both = 'both'\n}\n\nexport interface IGiftCardBalanceCheckModuleProps extends IGiftCardBalanceCheckProps<{}> {}\n\nexport interface IGiftCardBalanceCheckViewProps extends IGiftCardBalanceCheckProps<{}>, IGiftCardBalanceCheckState {\n className?: string;\n\n form: IForm;\n item?: IItem;\n\n giftCardBalanceCheckProps: IModuleProps;\n\n enterGiftCardNumber?(giftCardNumber: string): void;\n enterGiftCardPin?(giftCardPin: string): void;\n enterGiftCardExp?(giftCardExp: string): void;\n applyGiftCard?(): void;\n}\n\n/**\n *\n * GiftCardBalanceCheck component.\n * @extends {React.Component}\n */\nexport class GiftCardBalanceCheck extends React.Component {\n public state: IGiftCardBalanceCheckState = {\n isFetchingGiftCard: false,\n errorMessage: '',\n giftCardNumber: '',\n giftCardPin: '',\n giftCardExp: ''\n };\n\n private readonly inputRef: React.RefObject = React.createRef();\n\n private readonly inputPinRef: React.RefObject = React.createRef();\n\n private readonly inputExpRef: React.RefObject = React.createRef();\n\n public shouldComponentUpdate(nextProps: IGiftCardBalanceCheckModuleProps, nextState: IGiftCardBalanceCheckState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | null {\n const {\n config: { className, showAdditionalFields },\n resources\n } = this.props;\n const { errorMessage, giftCardNumber, giftCardPin, giftCardExp } = this.state;\n\n const supportedGiftCardType = this.props.context.app.config.giftCardSupported;\n\n if (!this._isEnabled()) {\n this.props.context.telemetry.error('Gift card balance check is not supported, module wont render');\n return null;\n }\n\n const supportExternalGiftCard = supportedGiftCardType !== SupportedGiftCardType.Internal;\n\n const moduleClassName = classname('ms-gift-card-balance-check', className);\n\n const viewProps: IGiftCardBalanceCheckViewProps = {\n ...this.props,\n ...this.state,\n className: moduleClassName,\n giftCardBalanceCheckProps: { moduleProps: this.props, className: moduleClassName },\n\n enterGiftCardNumber: this._enterGiftCardNumber,\n enterGiftCardPin: this._enterGiftCardPin,\n enterGiftCardExp: this._enterGiftCardExp,\n applyGiftCard: this._applyGiftCard,\n\n form: getForm({\n errorMessage,\n giftCardNumber,\n giftCardPin,\n giftCardExp,\n inputRef: this.inputRef,\n inputPinRef: this.inputPinRef,\n inputExpRef: this.inputExpRef,\n resources,\n supportExternalGiftCard,\n additionalFields: showAdditionalFields,\n onEnterGiftCardNumber: this._enterGiftCardNumber,\n onEnterGiftCardPin: this._enterGiftCardPin,\n onEnterGiftCardExp: this._enterGiftCardExp,\n onApplyGiftCard: this._applyGiftCard\n }),\n item:\n this.state.giftCard &&\n getItem({\n giftCard: this.state.giftCard,\n getFormattedPrice: this._getFormattedPrice,\n resources\n })\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private readonly _isEnabled = (): boolean => {\n if (\n !this.props.context.request.user.isAuthenticated &&\n this.props.context.app.config.giftCardSupported !== SupportedGiftCardType.External &&\n !this.props.config.shouldBeEnabledForGuest\n ) {\n return false;\n }\n return true;\n };\n\n private readonly _getFormattedPrice = (price: number = 0, currencyCode: string = 'USD'): string => {\n return this.props.context.cultureFormatter.formatCurrency(price, currencyCode);\n };\n\n private readonly _enterGiftCardNumber = (giftCardNumber: string): void => {\n this.setState({\n giftCardNumber\n });\n this._clearError();\n };\n\n private readonly _enterGiftCardPin = (giftCardPin: string): void => {\n this.setState({\n giftCardPin\n });\n this._clearError();\n };\n\n private readonly _enterGiftCardExp = (giftCardExp: string): void => {\n this.setState({\n giftCardExp\n });\n this._clearError();\n };\n\n private readonly _clearError = (): void => {\n this.setState({\n errorMessage: ''\n });\n };\n\n private readonly _setError = (errorMessage: string): void => {\n this.props.telemetry.error('Error', errorMessage);\n this.props.telemetry.debug('Error', errorMessage);\n this.setState({\n errorMessage\n });\n };\n\n private readonly _applyGiftCard = async (): Promise => {\n if (this.state.isFetchingGiftCard) {\n return;\n }\n this.setState({\n isFetchingGiftCard: true\n });\n\n const giftCardNumber = this.state.giftCardNumber.trim();\n const giftCardPin = this.state.giftCardPin.trim();\n const giftCardExp = this.state.giftCardExp.trim();\n\n const giftCardTypes = await this._getGiftCardTypes(giftCardNumber);\n const giftCardType = giftCardTypes && giftCardTypes[0];\n const isPinRequired = giftCardType && giftCardType.IsPinRequired;\n const isExpRequired = giftCardType && giftCardType.IsExpirationDateRequired;\n const tenderTypeId = giftCardType && giftCardType.PaymentMethodId;\n const giftCard = await this._getGiftCard(giftCardNumber, giftCardPin, giftCardExp, isPinRequired, isExpRequired, tenderTypeId);\n\n if (giftCard) {\n this._clearError();\n this.setState({\n giftCardNumber: '',\n giftCardPin: '',\n giftCardExp: '',\n isFetchingGiftCard: false,\n giftCard\n });\n return Promise.resolve();\n }\n const input = this.inputRef && this.inputRef.current && this.inputRef.current.focus && (this.inputRef.current as HTMLElement);\n input && input.focus();\n this.setState({\n isFetchingGiftCard: false,\n giftCard: undefined\n });\n };\n\n private readonly _findGiftcardTenderTypes = (\n tenderTypes: TenderType[],\n operationId: RetailOperation,\n giftcardType: string\n ): string[] | undefined => {\n let matchedTenderTypes: TenderType[] | undefined;\n\n switch (giftcardType) {\n case SupportedGiftCardType.Internal:\n matchedTenderTypes = tenderTypes.filter(\n tenderType => tenderType.OperationId === operationId && tenderType.ConnectorId === ''\n );\n break;\n case SupportedGiftCardType.External:\n matchedTenderTypes = tenderTypes.filter(\n tenderType => tenderType.OperationId === operationId && tenderType.ConnectorId !== ''\n );\n break;\n default:\n throw new Error('Invalid gift card type');\n }\n\n if (matchedTenderTypes) {\n return matchedTenderTypes.map(tenderType => tenderType.TenderTypeId || '');\n }\n return;\n };\n\n private readonly _getGiftCard = async (\n giftCardNumber: string,\n giftCardPin: string,\n giftCardExp: string,\n isPinRequired: boolean | undefined,\n isExpRequired: boolean | undefined,\n tenderTypeId: string | undefined\n ): Promise => {\n const {\n resources: { invalidCardTypeError, noBalanceError, invalidCardInfoError, noCardPinError, noCardExpError }\n } = this.props;\n\n const supportedGiftCardType = this.props.context.app.config.giftCardSupported;\n\n if (!tenderTypeId) {\n return undefined;\n }\n\n const tenderTypes = await getTenderTypesAsync({ callerContext: this.props.context.actionContext, queryResultSettings: {} }).catch(\n error => {\n throw error;\n }\n );\n\n if (!tenderTypes) {\n throw new Error('Fail to get gift card tender line');\n }\n\n const internalGiftcardTenderTypes = this._findGiftcardTenderTypes(\n tenderTypes,\n OPERATIONS.PayGiftCertificate,\n SupportedGiftCardType.Internal\n );\n const externalGiftcardTenderTypes = this._findGiftcardTenderTypes(\n tenderTypes,\n OPERATIONS.PayGiftCertificate,\n SupportedGiftCardType.External\n );\n\n switch (supportedGiftCardType) {\n case undefined:\n case SupportedGiftCardType.Internal:\n if (!internalGiftcardTenderTypes?.includes(tenderTypeId)) {\n this._setError(invalidCardTypeError);\n return undefined;\n }\n break;\n case SupportedGiftCardType.External:\n if (!externalGiftcardTenderTypes?.includes(tenderTypeId)) {\n this._setError(invalidCardTypeError);\n return undefined;\n }\n break;\n case SupportedGiftCardType.Both:\n if (!internalGiftcardTenderTypes?.includes(tenderTypeId) && !externalGiftcardTenderTypes?.includes(tenderTypeId)) {\n this._setError(invalidCardTypeError);\n return undefined;\n }\n break;\n default:\n throw new Error('Unsupported gift card type');\n }\n\n if (!this.props.context.request.user.isAuthenticated && internalGiftcardTenderTypes?.includes(tenderTypeId)) {\n this._setError(invalidCardTypeError);\n return undefined;\n }\n\n if (isPinRequired && giftCardPin === '') {\n this._setError(noCardPinError);\n return undefined;\n }\n\n if (isExpRequired && giftCardExp === '') {\n this._setError(noCardExpError);\n return undefined;\n }\n\n const month = Number.parseInt(giftCardExp.split('/')[0], 10);\n const year = Number.parseInt(giftCardExp.split('/')[1], 10);\n\n return getGiftCardAsync({ callerContext: this.props.context.actionContext }, giftCardNumber, tenderTypeId, giftCardPin, month, year)\n .then(activeGiftCard => {\n if (!activeGiftCard.Balance || activeGiftCard.Balance === 0) {\n this._setError(noBalanceError);\n return;\n }\n return activeGiftCard;\n })\n .catch(error => {\n this._setError(invalidCardInfoError);\n return undefined;\n });\n };\n\n private readonly _getGiftCardTypes = async (giftCardNumber: string): Promise => {\n const {\n resources: { emptyInputError, invalidCodeError }\n } = this.props;\n\n if (!giftCardNumber) {\n this._setError(emptyInputError);\n return undefined;\n }\n\n return resolveCardTypesAsync({ callerContext: this.props.context.actionContext }, giftCardNumber, CardType.GiftCard)\n .then(giftCardTypes => {\n if (!giftCardTypes || giftCardTypes.length === 0 || giftCardTypes[0] === undefined) {\n this._setError(invalidCodeError);\n return;\n }\n return giftCardTypes;\n })\n .catch(error => {\n this._setError(invalidCodeError);\n return undefined;\n });\n };\n}\n\nexport default GiftCardBalanceCheck;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IForm, IItem } from './components';\nimport { IGiftCardBalanceCheckViewProps } from './gift-card-balance-check';\n\nexport const Form: React.FC = ({\n formProps,\n label,\n inputPinLabel,\n inputExpLabel,\n alert,\n inputProps,\n inputNumProps,\n inputPinProps,\n inputExpProps,\n inputNumber,\n inputPin,\n inputExp,\n applyButton,\n supportExternalGiftCard,\n showGiftCardPinInput,\n showGiftCardExpInput,\n alertFieldLabel\n}) => (\n \n {alert}\n {supportExternalGiftCard ? (\n \n \n {label}\n {inputNumber}\n \n {showGiftCardPinInput && (\n \n {inputPinLabel}\n {inputPin}\n \n )}\n {showGiftCardExpInput && (\n \n {inputExpLabel}\n {inputExp}\n \n )}\n {(showGiftCardPinInput || showGiftCardExpInput) && alertFieldLabel}\n \n ) : (\n <>\n {label}\n {inputNumber}\n \n )}\n {applyButton}\n \n);\n\nexport const Item: React.FC = ({ itemProps, selectedGiftCard }) => {selectedGiftCard};\n\nconst GiftCardBalanceCheckView: React.FC = props => {\n const { giftCardBalanceCheckProps, form, item } = props;\n return (\n \n {form &&
}\n {item && }\n \n );\n};\n\nexport default GiftCardBalanceCheckView;\n","module.exports = React;","module.exports = ReactDOM;"],"names":["binding","modules","dataActions","c","require","$type","da","iNM","ns","n","p","pdp","md","window","__bindings__","_objectSpread","viewDictionary","cn","OPERATIONS","PayCard","PayGiftCertificate","PayLoyalty","PayCustomerAccount","onApplyHandler","onApplyGiftCard","async","event","preventDefault","onChangeNumberHandler","onEnterGiftCardNumber","value","target","replace","RegExp","onChangePinHandler","onEnterGiftCardPin","onChangeExpHandler","onEnterGiftCardExp","getForm","options","errorMessage","inputRef","inputPinRef","inputExpRef","giftCardNumber","giftCardPin","giftCardExp","supportExternalGiftCard","additionalFields","resources","balanceCheckButton","giftCardFormLabel","giftCardNumberLabel","giftCardPinLabel","giftCardExpLabel","giftCardAlertLabel","giftCardPinPlaceholderText","giftCardExpPlaceholderText","formProps","className","classnames","onSubmit","tag","label","React","id","inputPinLabel","inputExpLabel","alertFieldLabel","alert","Alert","role","assertive","fade","includeAlertClass","isOpen","inputNumber","ref","type","onChange","inputPin","placeholder","inputExp","applyButton","Button","onClick","disabled","showGiftCardPinInput","showGiftCardExpInput","inputProps","inputNumProps","inputPinProps","inputExpProps","getItem","_ref","giftCard","getFormattedPrice","enteredGiftCardLabel","giftCardAvailableBalanceLabel","balance","Balance","CardCurrencyCode","giftCardLast4Digit","Id","substr","selectedGiftCard","itemProps","SupportedGiftCardType","GiftCardBalanceCheck","constructor","_this","state","isFetchingGiftCard","_isEnabled","this","props","context","request","user","isAuthenticated","app","config","giftCardSupported","External","shouldBeEnabledForGuest","_getFormattedPrice","price","arguments","length","undefined","currencyCode","cultureFormatter","formatCurrency","_enterGiftCardNumber","setState","_clearError","_enterGiftCardPin","_enterGiftCardExp","_setError","telemetry","error","debug","_applyGiftCard","trim","giftCardTypes","_getGiftCardTypes","giftCardType","isPinRequired","IsPinRequired","isExpRequired","IsExpirationDateRequired","tenderTypeId","PaymentMethodId","_getGiftCard","Promise","resolve","input","current","focus","_findGiftcardTenderTypes","tenderTypes","operationId","giftcardType","matchedTenderTypes","Internal","filter","tenderType","OperationId","ConnectorId","Error","map","TenderTypeId","invalidCardTypeError","noBalanceError","invalidCardInfoError","noCardPinError","noCardExpError","supportedGiftCardType","getTenderTypesAsync","callerContext","actionContext","queryResultSettings","catch","internalGiftcardTenderTypes","externalGiftcardTenderTypes","includes","Both","month","Number","parseInt","split","year","getGiftCardAsync","then","activeGiftCard","emptyInputError","invalidCodeError","resolveCardTypesAsync","CardType","GiftCard","shouldComponentUpdate","nextProps","nextState","data","render","showAdditionalFields","moduleClassName","classname","viewProps","giftCardBalanceCheckProps","moduleProps","enterGiftCardNumber","enterGiftCardPin","enterGiftCardExp","applyGiftCard","form","item","renderView","Form","Node","Object","assign","Item","_ref2","Module","module","exports","ReactDOM"],"sourceRoot":""}