{"version":3,"sources":["webpack:///src/modules/checkout-customer-account-payment/checkout-customer-account-payment.view.tsx?c009","webpack:///src/modules/checkout-payment-instrument/checkout-payment-instrument.view.tsx?9afd","webpack:///./src/modules/smwe-checkout-gift-card/smwe-checkout-gift-card.props.autogenerated.ts?e31d","webpack:///./src/modules/smwe-checkout-gift-card/components/get-form.tsx?0f5c","webpack:///./src/modules/smwe-checkout-gift-card/components/get-item.tsx?1aab","webpack:///./src/modules/smwe-checkout-gift-card/components/get-list.tsx?9b57","webpack:///./src/modules/smwe-checkout-gift-card/components/title.tsx?9b50","webpack:///./src/modules/smwe-checkout-gift-card/smwe-checkout-gift-card.tsx?a30b","webpack:///src/modules/checkout-terms-and-conditions/components/checkout-terms-and-conditions.check-box.tsx?c1cc","webpack:///src/modules/checkout-terms-and-conditions/components/checkout-terms-and-conditions.error-message.tsx?791f","webpack:///src/modules/checkout-terms-and-conditions/components/checkout-terms-and-conditions.error-title.tsx?1f3c","webpack:///src/modules/checkout-terms-and-conditions/checkout-terms-and-conditions.tsx?0ddf","webpack:///src/modules/checkout-terms-and-conditions/checkout-terms-and-conditions.view.tsx?0931","webpack:///src/modules/checkout-customer-account-payment/components/get-account-payment-form-edit-mode.tsx?4bab","webpack:///src/modules/checkout-customer-account-payment/components/get-account-payment-form-summary-mode.tsx?4664","webpack:///src/modules/checkout-customer-account-payment/checkout-customer-account-payment.tsx?ced5","webpack:///./src/modules/smwe-checkout-gift-card/smwe-checkout-gift-card.view.tsx?b389","webpack:///src/modules/checkout-pickup/checkout-pickup.view.tsx?9210","webpack:///./src/modules/smwe-checkout-section-container/components/loading.tsx?0dd1","webpack:///./src/modules/smwe-checkout-section-container/smwe-checkout-section-container.tsx?81fe","webpack:///src/modules/checkout-pickup/components/checkout-pickup-utility.ts?22a5","webpack:///src/modules/checkout-pickup/components/checkout-pickup-date-dropdown.tsx?4fb2","webpack:///src/modules/checkout-pickup/components/checkout-pickup-timeslot-dropdown.tsx?089a","webpack:///src/modules/checkout-pickup/components/checkout-pickup-group.tsx?4b00","webpack:///src/modules/checkout-pickup/checkout-pickup.tsx?b7a1","webpack:///./src/modules/smwe-checkout-section-container/smwe-checkout-section-container.view.tsx?e951","webpack:///../../../src/module-state-manager/module-state.ts?7579","webpack:///../../../src/module-state-manager/with-module-state.tsx?61ca","webpack:///src/modules/checkout-guest-profile/checkout-guest-profile.view.tsx?c89a","webpack:///src/modules/checkout-section-container/checkout-section-container.view.tsx?61ae","webpack:///src/modules/checkout-guest-profile/components/get-add-contact-info.tsx?1fcf","webpack:///src/modules/checkout-guest-profile/components/get-show-contact-info.tsx?77e1","webpack:///src/modules/checkout-guest-profile/checkout-guest-profile.tsx?f355","webpack:///src/modules/checkout-section-container/components/loading.tsx?c2e5","webpack:///src/modules/checkout-section-container/checkout-section-container.tsx?9b3a","webpack:///src/modules/checkout-payment-instrument/components/iframe.tsx?3db1","webpack:///src/modules/checkout-payment-instrument/components/add-payment-form.tsx?5fda","webpack:///src/modules/checkout-payment-instrument/components/error.tsx?1f63","webpack:///src/modules/checkout-payment-instrument/components/payment-information.tsx?3828","webpack:///src/modules/checkout-payment-instrument/components/waiting.tsx?1cbd","webpack:///src/modules/checkout-payment-instrument/components/with-visibility-observer.tsx?97b9","webpack:///src/modules/checkout-payment-instrument/payment-instrument-message.ts?bbca","webpack:///src/modules/checkout-payment-instrument/checkout-payment-instrument.tsx?0303"],"names":["SummaryForm","formProps","label","paymentAmount","addPaymentButton","appliedLine","bottomBorder","React","Node","Object","EditForm","inputLabel","inputAmount","customerName","customerAccountNumber","customerSince","accountCredit","alert","accountDetails","CheckoutCustomerAccountView","props","checkoutCustomerAccount","summaryView","editView","moduleState","Module","isReady","OverlayModal","modal","CheckoutPaymentInstrumentView","checkoutPaymentInstrument","className","id","waiting","paymentInformation","addPaymentForm","overlayModal","showAdditionalFields","getForm","options","errorMessage","inputRef","inputPinRef","inputExpRef","giftCardNumber","giftCardPin","giftCardExp","onEnterGiftCardNumber","onEnterGiftCardPin","onEnterGiftCardExp","onApplyGiftCard","supportExternalGiftCard","additionalFields","resources","applyGiftCardButton","giftCardFormLabel","giftCardNumberLabel","giftCardPinLabel","giftCardExpLabel","giftCardAlertLabel","giftCardPinPlaceholderText","giftCardExpPlaceholderText","onApply","async","e","preventDefault","classnames","onSubmit","tag","inputPinLabel","inputExpLabel","alertFieldLabel","Alert","role","assertive","fade","includeAlertClass","isOpen","inputNumber","ref","type","onChange","value","target","replace","RegExp","inputPin","placeholder","inputExp","applyButton","Button","onClick","disabled","showGiftCardPinInput","showGiftCardExpInput","pin","expirationDate","pinAndExpirationDate","inputProps","inputNumProps","inputPinProps","inputExpProps","getItem","giftCard","getFormattedPrice","canRemove","onRemoveGiftCard","enteredGiftCardLabel","giftCardAvailableBalanceLabel","removeGiftCardButton","balance","Balance","CardCurrencyCode","giftCardLast4Digit","Id","substr","selectedGiftCard","removeButton","itemProps","getList","giftCards","length","listProps","list","map","GiftCardTitle","title","CheckoutGiftCard","constructor","state","isFetchingGiftCard","init","this","onEdit","onCancel","isRequired","isEnabled","status","couldPaidByGiftCard","cart","data","checkout","result","checkoutCart","undefined","TotalAmount","context","request","user","isAuthenticated","app","config","giftCardSupported","onUpdating","handleCancelOrSubmit","hasSelectedItem","onReady","onSkip","price","currencyCode","cultureFormatter","formatCurrency","enterGiftCardNumber","setState","clearError","enterGiftCardPin","enterGiftCardExp","setError","telemetry","error","setHasError","removeGiftCard","checkoutState","removeGiftCardExtend","applyGiftCard","trim","giftCardTypes","getGiftCardTypes","giftCardType","isPinRequired","IsPinRequired","isExpRequired","IsExpirationDateRequired","tenderTypeId","PaymentMethodId","getGiftCard","giftCardExtend","Pin","ExpirationDate","TenderTypeId","addGiftCardExtend","Promise","resolve","input","current","focus","noBalanceError","invalidCardInfoError","invalidCardTypeError","noCardPinError","noCardExpError","supportedGiftCardType","month","parseInt","split","year","getGiftCardAsync","callerContext","actionContext","then","activeGiftCard","catch","emptyInputError","duplicatedCodeError","invalidCodeError","giftCardExtends","some","card","resolveCardTypesAsync","loyaltyAmount","getLoyaltyAmount","componentDidMount","when","isDataReady","render","shouldPayGiftCard","moduleClassName","classname","viewProps","checkoutGiftCardProps","moduleProps","showGiftCard","TitleCompoent","addGiftCard","form","renderView","__decorate","computed","observer","withModuleState","CheckoutTermsAndConditionsCheckbox","isChecked","ariaLabel","telemetryContent","payLoad","getPayloadObject","attribute","getTelemetryAttributes","name","checked","CheckoutTermsAndConditionsErrorMessage","message","CheckoutTermsAndConditionsErrorTitle","CheckoutTermsAndConditions","super","isTermsAccepted","getTermsAndConditions","showCheckbox","description","isDisabled","isAutoSave","isTermsAndConditionAccepted","termsAndConditionAcceptance","checkBox","CheckboxComponent","MsDyn365","text","hasInvoiceLine","updateTermsAndConditionsAcceptance","getErrorMessage","errorMessageTitle","ErrorTitleComponent","ErrorMessageComponent","getCancelButton","cancelBtnLabel","cancelBtnAriaLabel","color","getSaveButton","saveBtnLabel","saveBtnAriaLabel","getEditButton","editBtnLabel","editBtnAriaLabel","newIsTermsAndConditionAccepted","event","getTelemetryObject","telemetryPageName","friendlyName","showControlButtons","hasExternalSubmitGroup","reaction","defaultTermsAndConditionAcceptedValue","hasError","isError","isShowContent","isShowSelected","errorMessageData","viewState","isShowSaveButton","isShowButtons","isShowEditButton","isShowCancelButton","checkoutTermsAndConditions","termsAndConditionsContent","saveButton","editButton","cancelButton","onSave","observable","action","TermsAndCondition","ErrorMessage","CheckoutTermsAndConditionsView","getAccountPaymentFormEditMode","onAddPayment","amount","onChangePaymentAmount","maxAmount","customer","customerCreatedDate","availableCredit","showCreditLimit","onToggleCreditSection","creditSectionIsExpanded","orderTotal","excessCredit","onRemovePayment","appliedAmount","addPaymentButtonLabel","inputAmountLabel","inputAmountAriaLabel","customerSinceLabel","accountCreditLabel","creditDetailsSectionLabel","orderTotalLabel","availableCreditLabel","creditExcessLabel","appliedCustomerAccountPaymentLabel","removeCustomerAccountPaymentLabel","onAddAccountPayment","onInput","parseFloat","min","max","Name","AccountNumber","getAccountPaymentFormSummaryMode","inputAmountSummaryLabel","CheckoutCustomerAccountPayment","baseClassName","getAvailableCredit","creditBalances","CreditLimit","PendingBalance","addPayment","updateCustomerAccountAmount","newAmount","information","toggleCreditSection","isCreditSectionExpanded","customerAccountAmount","updateMaxAmount","Math","removePayment","maxPaymentAmount","customerInfo","get","platform","AllowOnAccountPayment","enableCustomerAccountPayment","IsB2b","giftCardAmount","forEach","amountDue","getGiftCardAmount","customerInformation","MandatoryCreditLimit","invalidAmountMessage","totalAmount","isCustomerAccountPaymentEnabled","locale","customerSinceDate","Date","CreatedDateTime","toLocaleDateString","formattedExcessCredit","From","SelectedGiftCard","GiftCardList","item","key","AddResource","ShowResource","CheckoutGiftCardView","CheckoutPickupView","checkoutPickup","headerError","pickupGroups","isLoading","isHeaderError","pickupGroupViewProps","index","pickupGroupContainer","dateTimeslotContainer","groupDivider","groupHeader","cartLineImages","groupErrorMessage","pickupDateDropdown","pickupTimeslotDropdown","selectedDateTimeslot","pickupAddress","isShowDropdown","Loading","CheckoutPlainContainer","getItems","slots","primary","getActiveChildModuleStates","childIds","getModule","filter","hasModuleState","isSkipped","componentDidUpdate","childId","enableControl","width","items","hasInitialized","container","checkoutPlainContainerProps","hidden","loading","LoadingComponent","typeName","initialized","skipped","ready","updating","isUpdating","pending","isPending","getDate","date","Intl","DateTimeFormat","timeZone","format","getTimeslot","placeHolder","startDate","endDate","formatter","hour","minute","hour12","getUTCDateWithoutTime","UTC","getUTCFullYear","getUTCMonth","getUTCDate","CheckoutPickupDateDropdown","defaultKey","updateDateSelection","notification","pickupStoreId","deliveryMode","setDateHandler","selectedOption","toString","getDateMap","has","mapDatesToOptions","dates","selectedDate","defaultOption","unshift","findIndex","getTime","dropdownOptions","defaultText","bind","Map","availableDates","set","labelText","dropdownId","controlledByParent","labelClassname","toggleColor","dropdownClassname","LabeledDropdown","onSelectOption","CheckoutPickupTimeslotDropdown","updateTimeslotSelection","setTimeslotHandler","getTimeslotMap","mapTimeslotsToOptions","timeslots","selectedTimeslot","timeslotPlaceHolder","StartDateTime","EndDateTime","availableTimeslots","CheckoutPickupError","CheckoutPickupGroupHeader","storeInfo","dir","CheckoutPickupTimeslotInfo","content","CheckoutPickupAddress","address","Street","City","State","County","ZipCode","ThreeLetterISORegionName","CheckoutPickupCartLines","cartLines","ArrayExtensions","hasElements","prop","showQty","quantity","lineId","Image","imageProps","DefaultImageSettings","viewports","xs","q","w","h","lg","xl","lazyload","quality","CheckoutPickup","initModuleState","canPickup","isPickupTimeSlotSet","onPending","updateCartLinePickupDateTimeslot","headerErrorMessage","initPickupGroup","pickupCartLines","getCartLinesforPickup","products","getProductsByCartLines","ChannelId","locations","orgUnitLocations","featureState","deliveryOptions","retailMultiplePickUpOptionEnabled","find","feature","IsEnabled","line","group","x","FulfillmentStoreId","DeliveryMode","product","RecordId","ProductId","lineDeliverySpecification","LineId","DeliverySpecification","DeliveryModeId","DeliveryPreferenceTypeValue","PickUpStoreId","PickupTimeslotStartDateTime","PickupTimeslotEndDateTime","DeliveryAddress","ShippingAddress","lineDeliverySpecs","push","cartLine","location","OrgUnitNumber","storeName","getStoreName","newGroup","pickupModeName","getPickupModeDescription","generalPickupText","dailyGroupingResults","searchCriteria","DeliveryModeCode","StoreId","SearchOptionValue","getEstimatedPickupTimeslotAvailabilitiesAsync","queryResultSettings","timeslotResults","StartDate","EndDate","bypassCache","AvailableCapacity","filteredPickupGroups","validateTimeslot","lineSpecs","concat","lineDeliverySpecifications","genericErrorMessage","setIsCancellable","channelId","productInputs","ObjectExtensions","isNullOrUndefined","ProductInput","requestContext","apiSettings","getSimpleProducts","validated","pickupDateTimeslotRequired","orgUnitLocation","OrgUnitName","every","CartLines","isPickupLine","isPickupMode","pickupDeliveryModeCode","channel","PickupDeliveryModeCode","channelDeliveryOptionConfig","pickupDeliveryMode","PickupDeliveryModeCodes","pickupMode","isNullOrWhiteSpace","resourceString","deliveryOption","foundProductDeliveryOption","deliveryO","deliveryDesc","DeliveryOptions","option","Code","Description","pickupDateLabel","pickupTimeslotLabel","pickupDateDefaultText","pickupTimeslotDefaultText","itemsText","singleItemText","pickupDateTimeslotText","pickupTimeslotPlaceHolder","pickupLocationLabel","imageSettings","defaultClassName","groupsViewProps","itemText","headerProps","cartlines","altText","src","PrimaryImageUrl","fallBackSrc","getFallbackImageUrl","ItemId","gridSettings","loadFailureBehavior","Quantity","lineImageProps","dateString","timeslotString","timeslotInfoProps","selectedDateTimeslotNode","addressProps","dropdownClassName","labelClassName","dateDropdownNode","timeslotDropdownNode","viewProp","Waiting","pickupDate","oldGroup","lineSpec","noAvailableTimeslotError","groups","pickupTimeslot","ItemComponent","CheckoutSectionContainerView","getCacheKey","getCacheObjectType","dataCacheType","getModuleStates","ctx","cacheKey","ModuleStatesCacheKey","moduleStates","update","WrappedComponent","_super","_this","states","_a","isCancellable","isSubmitContainer","validate","isCancelAllowed","shouldSubmitContainer","setIsRequired","setIsSubmitContainer","onDisable","moduleId","getModuleStateManager","getModuleByTypeName","getModuleStateManagerByTypeName","__assign","values","_moduleState","modules","source","module","isMatch","allMatched","skipSkippableItem","_validateLeaf","method","_validateContainer","initializeState","__extends","ModuleState","ShowContactInfo","showInfoProps","email","AddContactInfo","addFormProps","submitButton","inputGroupProps","CheckoutGuestProfileView","showContactInfo","addContactInfo","getAddContactInfo","canSubmit","canCancel","emailLabel","emailErrortext","getContactInfo","canEdit","CheckoutGuestProfile","emailAddress","emailOnCart","ReceiptEmail","updateGuestProfile","isEmailValid","rowEmail","test","updateGuestCheckoutEmail","newGuestCheckoutEmail","guestCheckoutEmail","getShowContactInfo","onContainerReady","getHostName","url","indexOf","toLowerCase","IPaymentFrameElement","postMessage","params","iframeRef","contentWindow","targetOrigin","onEvent","sourceUrl","onIFrameMessage","requestUrlOrigin","messageOrigin","sourceHost","eventHost","origin","requestHost","messageHost","updateContentDocument","displayContent","css","innerDocument","contentDocument","open","write","style","document","createElement","cssNote","createTextNode","appendChild","head","close","window","addEventListener","prevProps","componentWillUnmount","removeEventListener","iframeAriaLabel","height","sandbox","AddPaymentForm","acceptPageUrl","acceptPageContent","iFrameHeightOverride","isFetchingPaymentConnector","paymentStyleOverride","cancelButtonText","submitButtonText","Iframe","defaultPaymentConnectorStyle","PaymentError","PaymentInformation","changePaymentButtonText","cardTitle","cardNumberLabel","expiresDateLabel","addressTitle","tokenizedPaymentCard","tenderLine","billingAddress","NameOnCard","CardTypeId","CardTokenInfo","ExpirationMonth","ExpirationYear","MaskedCardNumber","cardLastNDigit","isValidCardNumber","isNaN","StreetNumber","Phone","PaymentWaiting","withVisibilyObserver","PaymentConnectorPostMessageType","VisibilyObserver","isVisible","selfRef","initMutationObserver","targetNode","getElementsByTagName","MutationObserver","_observer","handleVisibilityChange","observe","attributes","childList","subtree","stopMutationObserver","disconnect","offsetWidth","offsetHeight","visibilityObserver","paymentConnectorMessage","messageType","JSON","stringify","CheckoutPaymentInstrument","parse","setTerminalError","shouldCheckConnectorId","paymentConnectorId","cardPaymentAcceptPoint","PaymentConnectorId","Height","paymentConnectorHeight","Result","handlePaymentResult","CardPrefix","handlePaymentCardPrefix","Error","handlePaymentError","Redirect","handlePaymentRedirect","Showoverlay","showOverlayModal","Hideoverlay","resultAccessCode","isRedirectedFromPaymentGateway","paymenTenderType","cartId","settings","ReturnUrl","getReturnUrl","retrieveCardPaymentAcceptResultAsync","TenderLine","TokenizedPaymentCard","AdditionalContext","cardPaymentAcceptResult","saveBillingAddress","handleAdditionalContext","cardPrefix","updateCardPrefix","newCardPrefix","cardTypeId","getCardTypeId","updateTenderLine","newTenderLine","updateTokenizedPaymentCard","newTokenizedPaymentCard","updatePaymentTenderType","newPaymentTenderType","refreshCart","terminalError","updatePaymentAcceptPageData","finally","isPaymentProcessing","redirectData","isPaymentVerificationRequried","paymentVerificationPostData","isShow","isOverlayModal","response","TypeId","redirectToPaymentVerification","saveDataInStorage","redirectInfo","propertyName","keys","element","body","submit","defaultSubmitErrorMessage","setErrorMessage","_value","Message","join","returnUrl","getUrlSync","isAbsoluteUrl","shouldPaidByCard","isPaymentVerificationRedirection","paymentTenderType","requestFormData","formData","btoa","asyncResultStatus","exception","cardTypeErrorMessage","showBillingAddress","getCardPaymentAcceptPointAction","GetCardPaymentAcceptPointInput","paymentAcceptPoint","AcceptPageContent","AcceptPageUrl","postMessageToIframe","additionalContext","ExtraContext","Zip","Country","House","Address1","Address2","updateBillingAddress","newBillingAddress","togglePayment","isPrimaryPayment","Submit","reduce","count","checkoutResult","isPaidByOtherPaymentSource","getGiftCardTotalAmount","getCustomerAccountAmount","emailDeliveryModeCode","query","pv","requestUrl","URL","MessageOrigin","paymentTenderTypeClassName","WaitingComponent","loadingMessage","ErrorComponent","PaymentInformationComponent","AddPaymentFormComponent","Modal","withVisibilityObserver"],"mappings":";;;;;AAWO,MAAMA,EAAwD,QAAC,UAAEC,EAAF,MAAaC,EAAb,cAAoBC,EAApB,iBAAmCC,EAAnC,YAAqDC,EAArD,aAAkEC,GAAnE,SACjEC,gBAACC,OAAIC,iBAAKR,GACNM,gCACKL,EACAC,EACAC,EACAC,EACAC,KAKAI,EAAkD,QAAC,UAAET,EAAF,WAAaU,EAAb,YAAyBC,EAAzB,iBAAsCR,EAAtC,aAAwDS,EAAxD,sBAAsEC,EAAtE,cAA6FC,EAA7F,cAA4GC,EAA5G,MAA2HC,EAA3H,eAAkIC,EAAlI,YAAkJb,EAAlJ,aAA+JC,GAAhK,SAC3DC,gBAACC,OAAIC,iBAAKR,GACNM,gCAEKM,EACAC,EACAC,EACAC,EACAE,EACAP,EACAM,EACAL,EACAR,EACAC,EACAC,KAeEa,UAVyEC,IACpF,MAAM,wBAAEC,EAAF,YAA2BC,EAA3B,SAAwCC,EAAxC,YAAkDC,GAAgBJ,EACxE,OACQb,gBAACkB,SAAMhB,iBAAKY,GACPG,EAAYE,SAAWJ,GAAef,gBAACP,EAAWS,iBAAKa,KACtDE,EAAYE,SAAWH,GAAYhB,gBAACG,EAAQD,iBAAKc,O,6NCvC7DI,EAAuD,IAExD,IAFyD,MAC1DC,GACC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5J,OAAQD,KAAKC,OACbhF,UAAWA,IAGnBlB,iBAAkBT,GAAWg3B,KAAmCF,IAAwBsC,GAAiBD,IAAsB3G,GAC3H3zB,gBAACs8B,EAAuB,CACpB7K,cAAe8I,EACf7I,kBAAmB4I,EACnB3K,cAAeqM,EACfp4B,SAAUiE,KAAKjE,SACfmE,SAAUF,KAAKE,SACf0nB,gBAAiB5nB,KAAK4nB,gBACtBL,UAAWvnB,KAAKunB,UAChB1B,WAAYhc,EACZic,WAAYjc,GAA0B7J,KAAKuB,gBAC3CuoB,qBAAsBA,GAAwB6D,EAC9C9F,iBAAkB7nB,KAAK6nB,iBACvBkC,2BAA4BA,EAC5BC,qBAAsBA,EACtB/uB,UAAWA,IAGnBjB,aAAc,CACVR,MAAO,CACHwC,IAAK04B,QACL/6B,UAAcqG,KAAK8F,gBAAR,kBACXrJ,OAAQg0B,MAKpB,OAAOzwB,KAAKhH,MAAMuN,WAAWP,KAxNvBQ,sBAATC,KAAS,qCAKAD,sBAATC,KAAS,6CAKAD,sBAATC,KAAS,2CAYAD,sBAATC,KAAS,qCA0BAD,sBAATC,KAAS,mDAiBAD,sBAATC,KAAS,qDAMAD,sBAATC,KAAS,sCAmBAD,sBAATC,KAAS,oCAIAD,sBAATC,KAAS,qDAKAD,sBAATC,KAAS,qCA6KVD,sBADCyE,KACD,0CA8FAzE,sBADCyE,KACD,8CAQAzE,sBADCyE,KACD,4CAgFAzE,sBADCyE,KACD,2BA2CAzE,sBADCyE,KACD,uCAwBAzE,sBADCyE,KACD,sCAwFAzE,sBADCyE,KACD,oCAUAzE,sBADCyE,KACD,+BAUAzE,sBADCyE,KACD,+BASAzE,sBADCyE,KACD,6BAQAzE,sBADCyE,KACD,uCAxoBSkiB,EAAyB,sBAFrCxmB,IACAD,KACYymB,GA+oBEwH,YAAuBxH","file":"static/js/16.2ab96d26aa1b5096a907.chunk.js","sourcesContent":["/*!\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';\nimport { ICheckoutCustomerAccountPaymentViewProps } from './checkout-customer-account-payment';\nimport { IAccountPaymentEditViewForm } from './components/get-account-payment-form-edit-mode';\nimport { IAccountPaymentSummaryViewForm } from './components/get-account-payment-form-summary-mode';\n\nexport const SummaryForm: React.FC = ({ formProps, label, paymentAmount, addPaymentButton, appliedLine, bottomBorder }) => (\n \n <>\n {label}\n {paymentAmount}\n {addPaymentButton}\n {appliedLine}\n {bottomBorder}\n \n \n);\n\nexport const EditForm: React.FC = ({ formProps, inputLabel, inputAmount, addPaymentButton, customerName, customerAccountNumber, customerSince, accountCredit, alert, accountDetails, appliedLine, bottomBorder }) => (\n \n <>\n\n {customerName}\n {customerAccountNumber}\n {customerSince}\n {accountCredit}\n {accountDetails}\n {inputLabel}\n {alert}\n {inputAmount}\n {addPaymentButton}\n {appliedLine}\n {bottomBorder}\n \n \n);\n\nconst CheckoutCustomerAccountView: React.FC = props => {\n const { checkoutCustomerAccount, summaryView, editView, moduleState } = props;\n return (\n \n {moduleState.isReady && summaryView && }\n {!moduleState.isReady && editView && }\n \n );\n};\n\nexport default CheckoutCustomerAccountView;\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\nimport { ICheckoutPaymentInstrumentViewProps, ICheckoutPaymentOverlayModal } from './checkout-payment-instrument';\n\nconst OverlayModal: React.FC = ({\n modal\n}) => {\n return (\n \n );\n};\n\nconst CheckoutPaymentInstrumentView: React.FC = ({\n checkoutPaymentInstrument,\n className,\n id,\n waiting,\n alert,\n paymentInformation,\n addPaymentForm,\n overlayModal,\n ...restProps\n}) => (\n \n {waiting}\n {alert}\n {paymentInformation}\n {addPaymentForm}\n {overlayModal && }\n \n );\n\nexport default CheckoutPaymentInstrumentView;\n","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. See License.txt in the project root for license information.\r\n * ISmweCheckoutGiftCard contentModule Interface Properties\r\n * THIS FILE IS AUTO-GENERATED - MANUAL MODIFICATIONS WILL BE LOST\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport const enum showAdditionalFields {\r\n pin = 'pin',\r\n expirationDate = 'expirationDate',\r\n pinAndExpirationDate = 'pinAndExpirationDate'\r\n}\r\n\r\nexport interface ISmweCheckoutGiftCardConfig extends Msdyn365.IModuleConfig {\r\n className?: string;\r\n showAdditionalFields?: showAdditionalFields;\r\n}\r\n\r\nexport interface ISmweCheckoutGiftCardResources {\r\n emptyInputError: string;\r\n invalidCodeError: string;\r\n invalidCardInfoError: string;\r\n invalidCardTypeError: string;\r\n noCardPinError: string;\r\n noCardExpError: string;\r\n duplicatedCodeError: string;\r\n noBalanceError: string;\r\n giftCardFormLabel: string;\r\n giftCardNumberLabel: string;\r\n giftCardPinLabel: string;\r\n giftCardExpLabel: string;\r\n giftCardPinPlaceholderText: string;\r\n giftCardExpPlaceholderText: string;\r\n giftCardAlertLabel: string;\r\n applyGiftCardButton: string;\r\n removeGiftCardButton: string;\r\n enteredGiftCardLabel: string;\r\n giftCardAvailableBalanceLabel: string;\r\n}\r\n\r\nexport interface ISmweCheckoutGiftCardProps extends Msdyn365.IModule {\r\n resources: ISmweCheckoutGiftCardResources;\r\n config: ISmweCheckoutGiftCardConfig;\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 { Alert, Button, INodeProps, NodeTag } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\nimport { showAdditionalFields } from '../smwe-checkout-gift-card.props.autogenerated';\r\n\r\nexport interface IGetFormInput {\r\n errorMessage: string;\r\n giftCardNumber: string;\r\n giftCardPin: string;\r\n giftCardExp: string;\r\n inputRef?: React.RefObject;\r\n inputPinRef?: React.RefObject;\r\n inputExpRef?: React.RefObject;\r\n supportExternalGiftCard?: boolean;\r\n additionalFields?: showAdditionalFields;\r\n resources: {\r\n applyGiftCardButton: string;\r\n giftCardFormLabel: string;\r\n giftCardNumberLabel: string;\r\n giftCardPinLabel: string;\r\n giftCardExpLabel: string;\r\n giftCardAlertLabel: string;\r\n giftCardPinPlaceholderText: string;\r\n giftCardExpPlaceholderText: string;\r\n };\r\n onEnterGiftCardNumber(giftCardNumber: string): void;\r\n onEnterGiftCardPin(giftCardPin: string): void;\r\n onEnterGiftCardExp(giftCardExp: string): void;\r\n onApplyGiftCard(): Promise;\r\n}\r\n\r\nexport interface IForm {\r\n formProps: INodeProps;\r\n label: React.ReactNode;\r\n inputPinLabel: React.ReactNode;\r\n inputExpLabel: React.ReactNode;\r\n alert: React.ReactNode;\r\n inputProps: INodeProps;\r\n inputNumProps: INodeProps;\r\n inputPinProps: INodeProps;\r\n inputExpProps: INodeProps;\r\n inputNumber: React.ReactNode;\r\n inputPin: React.ReactNode;\r\n inputExp: React.ReactNode;\r\n applyButton: React.ReactNode;\r\n supportExternalGiftCard: boolean | undefined;\r\n showGiftCardPinInput: boolean | undefined;\r\n showGiftCardExpInput: boolean | undefined;\r\n alertFieldLabel: React.ReactNode;\r\n}\r\n\r\n// tslint:disable-next-line:max-func-body-length\r\nexport const getForm = (options: IGetFormInput): IForm => {\r\n const {\r\n errorMessage,\r\n inputRef,\r\n inputPinRef,\r\n inputExpRef,\r\n giftCardNumber,\r\n giftCardPin,\r\n giftCardExp,\r\n onEnterGiftCardNumber,\r\n onEnterGiftCardPin,\r\n onEnterGiftCardExp,\r\n onApplyGiftCard,\r\n supportExternalGiftCard,\r\n additionalFields,\r\n resources: { applyGiftCardButton, giftCardFormLabel, giftCardNumberLabel, giftCardPinLabel, giftCardExpLabel,\r\n giftCardAlertLabel, giftCardPinPlaceholderText, giftCardExpPlaceholderText }\r\n } = options;\r\n\r\n const onApply = async (e: React.SyntheticEvent): Promise => {\r\n e.preventDefault();\r\n await onApplyGiftCard();\r\n };\r\n\r\n const onChangeNumber = (e: React.ChangeEvent) => {\r\n const value = (e.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\r\n onEnterGiftCardNumber(value);\r\n };\r\n\r\n const onChangePin = (e: React.ChangeEvent) => {\r\n const value = (e.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\r\n onEnterGiftCardPin(value);\r\n };\r\n\r\n // need to filter out the month and year\r\n const onChangeExp = (e: React.ChangeEvent) => {\r\n const value = (e.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\r\n onEnterGiftCardExp(value);\r\n };\r\n\r\n const formProps = {\r\n className: classnames('ms-checkout-gift-card__form', { 'is-invalid': !!errorMessage }),\r\n onSubmit: onApply,\r\n tag: 'form' as NodeTag\r\n };\r\n\r\n const label = (\r\n \r\n );\r\n\r\n const inputPinLabel = (\r\n \r\n );\r\n\r\n const inputExpLabel = (\r\n \r\n );\r\n\r\n const alertFieldLabel = (\r\n \r\n );\r\n\r\n const alert = (\r\n \r\n {errorMessage}\r\n \r\n );\r\n\r\n const inputProps = {\r\n className: 'ms-checkout-gift-card__input-fields'\r\n };\r\n\r\n const inputNumProps = {\r\n className: 'ms-checkout-gift-card__input-num-fields'\r\n };\r\n\r\n const inputPinProps = {\r\n className: 'ms-checkout-gift-card__input-pin-fields'\r\n };\r\n\r\n const inputExpProps = {\r\n className: 'ms-checkout-gift-card__input-exp-fields'\r\n };\r\n\r\n const inputNumber = (\r\n \r\n );\r\n\r\n const inputPin = (\r\n \r\n );\r\n\r\n const inputExp = (\r\n \r\n );\r\n\r\n const applyButton = (\r\n \r\n {applyGiftCardButton}\r\n \r\n );\r\n\r\n let showGiftCardPinInput = false;\r\n let showGiftCardExpInput = false;\r\n\r\n switch(additionalFields) {\r\n case showAdditionalFields.pin:\r\n showGiftCardPinInput = true;\r\n break;\r\n case showAdditionalFields.expirationDate:\r\n showGiftCardExpInput = true;\r\n break;\r\n case showAdditionalFields.pinAndExpirationDate:\r\n showGiftCardPinInput = true;\r\n showGiftCardExpInput = true;\r\n break;\r\n default:\r\n }\r\n\r\n return {\r\n formProps,\r\n label,\r\n inputPinLabel,\r\n inputExpLabel,\r\n alert,\r\n inputProps,\r\n inputNumProps,\r\n inputPinProps,\r\n inputExpProps,\r\n inputNumber,\r\n inputPin,\r\n inputExp,\r\n applyButton,\r\n supportExternalGiftCard,\r\n showGiftCardPinInput,\r\n showGiftCardExpInput,\r\n alertFieldLabel\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 { Button, INodeProps } from '@msdyn365-commerce-modules/utilities';\r\nimport { IGiftCardExtend } from '@msdyn365-commerce/global-state';\r\nimport * as React from 'react';\r\n\r\nexport interface IGetItemInput {\r\n giftCard: IGiftCardExtend;\r\n canRemove: boolean;\r\n resources: {\r\n enteredGiftCardLabel: string;\r\n giftCardAvailableBalanceLabel: string;\r\n removeGiftCardButton: string;\r\n };\r\n getFormattedPrice(price?: number, currencyCode?: string): string;\r\n onRemoveGiftCard(giftCardNumber: string): void;\r\n}\r\n\r\nexport interface IItem {\r\n itemProps: INodeProps;\r\n id?: string;\r\n selectedGiftCard: React.ReactNode;\r\n removeButton?: React.ReactNode;\r\n}\r\n\r\n/**\r\n *\r\n * GiftCardItem component\r\n * @extends {React.PureComponent}\r\n */\r\nexport const getItem = ({\r\n giftCard,\r\n getFormattedPrice,\r\n canRemove,\r\n onRemoveGiftCard,\r\n resources: { enteredGiftCardLabel, giftCardAvailableBalanceLabel, removeGiftCardButton }\r\n}: IGetItemInput): IItem => {\r\n const balance = getFormattedPrice(giftCard.Balance, giftCard.CardCurrencyCode);\r\n const giftCardLast4Digit = (giftCard.Id || '').substr(-4);\r\n const onRemove = (): void => onRemoveGiftCard(giftCard.Id || '');\r\n\r\n const itemProps = {\r\n className: 'ms-checkout-gift-card__item'\r\n };\r\n\r\n const selectedGiftCard = (\r\n \r\n {enteredGiftCardLabel} {giftCardLast4Digit} ({giftCardAvailableBalanceLabel}{' '}\r\n {balance})\r\n \r\n );\r\n\r\n const removeButton = canRemove && (\r\n \r\n );\r\n\r\n return {\r\n itemProps,\r\n id: giftCard.Id,\r\n selectedGiftCard,\r\n removeButton\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 { INodeProps } from '@msdyn365-commerce-modules/utilities';\r\nimport { IGiftCardExtend } from '@msdyn365-commerce/global-state';\r\nimport { getItem, IItem } from './get-item';\r\n\r\ninterface IGetListInput {\r\n giftCards?: IGiftCardExtend[];\r\n canRemove: boolean;\r\n resources: {\r\n enteredGiftCardLabel: string;\r\n giftCardAvailableBalanceLabel: string;\r\n removeGiftCardButton: string;\r\n };\r\n getFormattedPrice(price?: number, currencyCode?: string): string;\r\n onRemoveGiftCard(giftCardNumber: string): void;\r\n}\r\n\r\nexport interface IList {\r\n listProps: INodeProps;\r\n list: IItem[];\r\n}\r\n\r\nexport const getList = ({ giftCards, canRemove, resources, getFormattedPrice, onRemoveGiftCard }: IGetListInput): IList | undefined => {\r\n if (!giftCards || !giftCards.length) {\r\n return undefined;\r\n }\r\n\r\n const listProps = {\r\n className: 'ms-checkout-gift-card__list'\r\n };\r\n\r\n const list = giftCards.map(giftCard =>\r\n getItem({\r\n canRemove,\r\n getFormattedPrice,\r\n giftCard,\r\n onRemoveGiftCard,\r\n resources\r\n })\r\n );\r\n\r\n return {\r\n listProps,\r\n list\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\ninterface IGiftCardTitleProps {\r\n title: string;\r\n}\r\n\r\nconst GiftCardTitle: React.FC = ({ title }) => ;\r\n\r\nexport default GiftCardTitle;\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 { IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\r\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\r\nimport { IGiftCardExtend } from '@msdyn365-commerce/global-state';\r\nimport { getGiftCardAsync, resolveCardTypesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\r\nimport { CardTypeInfo, GiftCard } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport classname from 'classnames';\r\nimport { computed, when } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport { getForm, IForm } from './components/get-form';\r\nimport { getList, IList } from './components/get-list';\r\nimport TitleCompoent from './components/title';\r\nimport { ISmweCheckoutGiftCardData } from './smwe-checkout-gift-card.data';\r\nimport { ISmweCheckoutGiftCardProps } from './smwe-checkout-gift-card.props.autogenerated';\r\n\r\nexport * from './components/get-form';\r\nexport * from './components/get-item';\r\nexport * from './components/get-list';\r\n\r\ninterface ICheckoutGiftCardState {\r\n isFetchingGiftCard: boolean;\r\n errorMessage: string;\r\n giftCardNumber: string;\r\n giftCardPin: string;\r\n giftCardExp: string;\r\n}\r\n\r\nexport interface ICheckoutGiftCardModuleProps extends ISmweCheckoutGiftCardProps, IModuleStateProps {}\r\n\r\nexport interface IShowResource {\r\n title: React.ReactNode;\r\n list?: IList;\r\n}\r\n\r\nexport interface IAddResource {\r\n form: IForm;\r\n list?: IList;\r\n}\r\n\r\nexport interface ICheckoutGiftCardViewProps extends ISmweCheckoutGiftCardProps<{}>, ICheckoutGiftCardState {\r\n className?: string;\r\n\r\n showGiftCard?: IShowResource;\r\n addGiftCard?: IAddResource;\r\n\r\n checkoutGiftCardProps: IModuleProps;\r\n couldPaidByGiftCard?: boolean;\r\n isEnabled?: boolean;\r\n onEdit?(): void;\r\n onCancel?(): void;\r\n onSubmit?(): void;\r\n enterGiftCardNumber?(giftCardNumber: string): void;\r\n enterGiftCardPin?(giftCardNumber: string): void;\r\n enterGiftCardExp?(giftCardNumber: string): void;\r\n removeGiftCard?(giftCardNumber: string): void;\r\n applyGiftCard?(): void;\r\n}\r\n\r\n/**\r\n *\r\n * CheckoutGiftCard component\r\n * @extends {React.Component, ICheckoutGiftCardState>}\r\n */\r\n@observer\r\nexport class CheckoutGiftCard extends React.Component {\r\n public state: ICheckoutGiftCardState = {\r\n isFetchingGiftCard: false,\r\n errorMessage: '',\r\n giftCardNumber: '',\r\n giftCardPin: '',\r\n giftCardExp: ''\r\n };\r\n\r\n private inputRef: React.RefObject = React.createRef();\r\n\r\n private inputPinRef: React.RefObject = React.createRef();\r\n\r\n private inputExpRef: React.RefObject = React.createRef();\r\n\r\n @computed get isDataReady(): boolean {\r\n return (this.props.data.checkout.result && this.props.data.checkout.status) === 'SUCCESS';\r\n }\r\n\r\n @computed get getLoyaltyAmount(): number {\r\n const checkoutState = this.props.data.checkout.result;\r\n if (!checkoutState || !checkoutState.loyaltyAmount) {\r\n return 0;\r\n }\r\n return checkoutState.loyaltyAmount;\r\n }\r\n\r\n @computed get shouldPayGiftCard(): boolean {\r\n const cart = this.props.data.checkout.result ? this.props.data.checkout.result.checkoutCart.cart : undefined;\r\n if (!cart) {\r\n return false;\r\n }\r\n // Use gift card card when loyalty points do not cover the total amount\r\n const amountDue = (cart.TotalAmount || 0) - this.getLoyaltyAmount;\r\n return amountDue > 0;\r\n }\r\n\r\n @computed get hasSelectedItem(): boolean {\r\n const {\r\n data: { checkout }\r\n } = this.props;\r\n const giftCards = checkout.result && checkout.result.giftCardExtends;\r\n return !!giftCards && giftCards.length > 0;\r\n }\r\n\r\n public componentDidMount(): void {\r\n // @ts-ignore: Compiler not reconizing condition check for function params\r\n when(\r\n () => this.isDataReady,\r\n () => {\r\n this.init();\r\n }\r\n );\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const {\r\n moduleState: { isReady },\r\n data: { checkout },\r\n config: { className, showAdditionalFields },\r\n resources\r\n } = this.props;\r\n const { errorMessage, giftCardNumber, giftCardPin, giftCardExp } = this.state;\r\n const giftCards = checkout.result && checkout.result.giftCardExtends;\r\n const additionalFields = showAdditionalFields;\r\n const supportedGiftCardType = this.props.context.app.config.giftCardSupported;\r\n\r\n if (!this.isEnabled() || (!this.shouldPayGiftCard && !isReady)) {\r\n return null;\r\n }\r\n\r\n const supportExternalGiftCard = supportedGiftCardType === 'internal' ? false : true;\r\n\r\n const moduleClassName = classname('ms-checkout-gift-card', className, isReady ? 'show' : 'add');\r\n\r\n const viewProps: ICheckoutGiftCardViewProps = {\r\n ...this.props,\r\n ...this.state,\r\n className: moduleClassName,\r\n\r\n checkoutGiftCardProps: { moduleProps: this.props, className: moduleClassName },\r\n couldPaidByGiftCard: this.couldPaidByGiftCard(),\r\n isEnabled: this.isEnabled(),\r\n onEdit: this.onEdit,\r\n onCancel: this.onCancel,\r\n onSubmit: this.onSubmit,\r\n enterGiftCardNumber: this.enterGiftCardNumber,\r\n enterGiftCardPin: this.enterGiftCardPin,\r\n enterGiftCardExp: this.enterGiftCardExp,\r\n removeGiftCard: this.removeGiftCard,\r\n applyGiftCard: this.applyGiftCard,\r\n showGiftCard: isReady\r\n ? {\r\n title: ,\r\n list: getList({\r\n canRemove: false,\r\n getFormattedPrice: this.getFormattedPrice,\r\n giftCards: giftCards && [...giftCards], // Note: ReadOnly Checkout State GiftCard[] is not assignable to GiftCard[] type\r\n onRemoveGiftCard: this.removeGiftCard,\r\n resources\r\n })\r\n }\r\n : undefined,\r\n addGiftCard: !isReady\r\n ? {\r\n form: getForm({\r\n errorMessage,\r\n giftCardNumber,\r\n giftCardPin,\r\n giftCardExp,\r\n inputRef: this.inputRef,\r\n inputPinRef: this.inputPinRef,\r\n inputExpRef: this.inputExpRef,\r\n resources,\r\n onEnterGiftCardNumber: this.enterGiftCardNumber,\r\n onEnterGiftCardPin: this.enterGiftCardPin,\r\n onEnterGiftCardExp: this.enterGiftCardExp,\r\n onApplyGiftCard: this.applyGiftCard,\r\n supportExternalGiftCard,\r\n additionalFields\r\n }),\r\n list: getList({\r\n canRemove: true,\r\n getFormattedPrice: this.getFormattedPrice,\r\n giftCards: giftCards && [...giftCards], // Note: ReadOnly Checkout State GiftCard[] is not assignable to GiftCard[] type\r\n onRemoveGiftCard: this.removeGiftCard,\r\n resources\r\n })\r\n }\r\n : undefined\r\n };\r\n\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n private init = (): void => {\r\n this.props.moduleState.init({\r\n onEdit: this.onEdit,\r\n onCancel: this.onCancel,\r\n onSubmit: this.onSubmit,\r\n isRequired: false,\r\n ...(!this.isEnabled() && { status: 'disabled' })\r\n });\r\n };\r\n\r\n private couldPaidByGiftCard = (): boolean => {\r\n const cart = this.props.data.checkout.result ? this.props.data.checkout.result.checkoutCart.cart : undefined;\r\n if (!cart) {\r\n return false;\r\n }\r\n // Use gift card when it is not free\r\n return (cart.TotalAmount || 0) > 0;\r\n };\r\n\r\n private isEnabled = (): boolean => {\r\n if (!this.props.context.request.user.isAuthenticated && this.props.context.app.config.giftCardSupported !== 'external') {\r\n return false;\r\n }\r\n return this.couldPaidByGiftCard();\r\n };\r\n\r\n private onEdit = (): void => {\r\n // Show add gift card form\r\n this.props.moduleState.onUpdating();\r\n };\r\n\r\n private onCancel = (): void => {\r\n this.handleCancelOrSubmit();\r\n };\r\n\r\n private onSubmit = (): void => {\r\n this.handleCancelOrSubmit();\r\n };\r\n\r\n private handleCancelOrSubmit = () => {\r\n if (this.hasSelectedItem) {\r\n // Show summary screen\r\n this.props.moduleState.onReady();\r\n } else {\r\n // Skip the module\r\n this.props.moduleState.onSkip();\r\n }\r\n };\r\n\r\n private getFormattedPrice = (price: number = 0, currencyCode: string = 'USD'): string => {\r\n return this.props.context.cultureFormatter.formatCurrency(price, currencyCode);\r\n };\r\n\r\n private enterGiftCardNumber = (giftCardNumber: string): void => {\r\n this.setState({\r\n giftCardNumber\r\n });\r\n this.clearError();\r\n };\r\n\r\n private enterGiftCardPin = (giftCardPin: string): void => {\r\n this.setState({\r\n giftCardPin\r\n });\r\n this.clearError();\r\n };\r\n\r\n private enterGiftCardExp = (giftCardExp: string): void => {\r\n this.setState({\r\n giftCardExp\r\n });\r\n this.clearError();\r\n };\r\n\r\n private setError = (errorMessage: string): void => {\r\n this.props.telemetry.error('Error', errorMessage);\r\n this.props.moduleState.setHasError(true);\r\n this.setState({\r\n errorMessage\r\n });\r\n };\r\n\r\n private clearError = (): void => {\r\n this.props.moduleState.setHasError(false);\r\n this.setState({\r\n errorMessage: ''\r\n });\r\n };\r\n\r\n private removeGiftCard = async (giftCardNumber: string): Promise => {\r\n const checkoutState = this.props.data.checkout.result;\r\n if (!checkoutState) {\r\n return;\r\n }\r\n\r\n await checkoutState.removeGiftCardExtend({ giftCardNumber });\r\n };\r\n\r\n private applyGiftCard = async (): Promise => {\r\n if (this.state.isFetchingGiftCard) {\r\n return;\r\n }\r\n this.setState({\r\n isFetchingGiftCard: true\r\n });\r\n\r\n const checkoutState = this.props.data.checkout.result;\r\n const giftCardNumber = this.state.giftCardNumber.trim();\r\n const giftCardPin = this.state.giftCardPin.trim();\r\n const giftCardExp = this.state.giftCardExp.trim();\r\n\r\n const giftCardTypes = await this.getGiftCardTypes(giftCardNumber);\r\n const giftCardType = giftCardTypes && giftCardTypes[0];\r\n const isPinRequired = giftCardType && giftCardType.IsPinRequired;\r\n const isExpRequired = giftCardType && giftCardType.IsExpirationDateRequired;\r\n const tenderTypeId = giftCardType && giftCardType.PaymentMethodId;\r\n const giftCard = await this.getGiftCard(giftCardNumber, giftCardPin, giftCardExp, isPinRequired, isExpRequired, tenderTypeId);\r\n\r\n const giftCardExtend: IGiftCardExtend = { Pin: giftCardPin, ExpirationDate: giftCardExp, TenderTypeId: tenderTypeId, ...giftCard};\r\n if (checkoutState && giftCard) {\r\n await checkoutState.addGiftCardExtend({ giftCard: giftCardExtend });\r\n this.clearError();\r\n this.setState({\r\n giftCardNumber: '',\r\n giftCardPin: '',\r\n giftCardExp: '',\r\n isFetchingGiftCard: false\r\n });\r\n return Promise.resolve();\r\n } else {\r\n const input =\r\n this.inputRef && this.inputRef.current && this.inputRef.current.focus && (this.inputRef.current as HTMLElement);\r\n input && input.focus();\r\n this.setState({\r\n isFetchingGiftCard: false\r\n });\r\n }\r\n };\r\n\r\n private getGiftCard = async (giftCardNumber: string, giftCardPin: string, giftCardExp: string, isPinRequired: boolean | undefined, isExpRequired: boolean | undefined, tenderTypeId: string | undefined): Promise => {\r\n const {\r\n resources: { noBalanceError, invalidCardInfoError, invalidCardTypeError, noCardPinError, noCardExpError }\r\n } = this.props;\r\n\r\n const supportedGiftCardType = this.props.context.app.config.giftCardSupported;\r\n\r\n if (!tenderTypeId) {\r\n return undefined;\r\n }\r\n\r\n switch (supportedGiftCardType) {\r\n case undefined:\r\n case 'internal':\r\n if (tenderTypeId !== '13' && tenderTypeId !== '4') {\r\n this.setError(invalidCardTypeError);\r\n return undefined;\r\n }\r\n break;\r\n case 'external':\r\n if (tenderTypeId !== '12') {\r\n this.setError(invalidCardTypeError);\r\n return undefined;\r\n }\r\n break;\r\n case 'both':\r\n if (tenderTypeId !== '12' && tenderTypeId !== '13' && tenderTypeId !== '4') {\r\n this.setError(invalidCardTypeError);\r\n return undefined;\r\n }\r\n break;\r\n default:\r\n }\r\n\r\n if (isPinRequired && giftCardPin === '') {\r\n this.setError(noCardPinError);\r\n return undefined;\r\n }\r\n\r\n if (isExpRequired && giftCardExp === '') {\r\n this.setError(noCardExpError);\r\n return undefined;\r\n }\r\n\r\n const month = parseInt(giftCardExp.split('/')[0], 10);\r\n const year = parseInt(giftCardExp.split('/')[1], 10);\r\n\r\n return getGiftCardAsync({ callerContext: this.props.context.actionContext }, giftCardNumber, tenderTypeId, giftCardPin, month, year)\r\n .then(activeGiftCard => {\r\n if (!activeGiftCard.Balance || activeGiftCard.Balance === 0) {\r\n this.setError(noBalanceError);\r\n return;\r\n }\r\n return activeGiftCard;\r\n })\r\n .catch(error => {\r\n this.setError(invalidCardInfoError);\r\n return undefined;\r\n });\r\n };\r\n\r\n private getGiftCardTypes = async (giftCardNumber: string): Promise => {\r\n const {\r\n resources: { emptyInputError, duplicatedCodeError, invalidCodeError },\r\n data: { checkout }\r\n } = this.props;\r\n\r\n if (!giftCardNumber) {\r\n this.setError(emptyInputError);\r\n return undefined;\r\n }\r\n\r\n const isDuplicated = checkout.result && checkout.result.giftCardExtends.some((card: GiftCard) => card.Id === giftCardNumber);\r\n if (isDuplicated) {\r\n this.setError(duplicatedCodeError);\r\n return undefined;\r\n }\r\n\r\n const GIFTCARDTYPE = 7;\r\n return resolveCardTypesAsync({ callerContext: this.props.context.actionContext }, giftCardNumber, GIFTCARDTYPE)\r\n .then(giftCardTypes => {\r\n if (!giftCardTypes || giftCardTypes.length === 0 || giftCardTypes[0] === undefined) {\r\n this.setError(invalidCodeError);\r\n return ;\r\n }\r\n return giftCardTypes;\r\n })\r\n .catch(error => {\r\n this.setError(invalidCodeError);\r\n return undefined;\r\n });\r\n };\r\n}\r\n\r\nexport default withModuleState(CheckoutGiftCard);\r\n","\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\nexport interface ICheckoutTermsAndConditionsCheckboxProps {\n isChecked: boolean;\n ariaLabel?: string;\n disabled: boolean;\n id?: string;\n telemetryContent?: ITelemetryContent;\n onChange(event: React.ChangeEvent): void;\n}\n\n/**\n *\n * AddPaymentForm SFC\n * @extends {React.FC}\n */\nconst CheckoutTermsAndConditionsCheckbox: React.FC = ({\n isChecked,\n ariaLabel,\n disabled,\n telemetryContent,\n onChange,\n id\n}) => {\n\n const payLoad = getPayloadObject('click', telemetryContent!, '');\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\n\n return (\n <>\n \n \n );\n};\n\nexport default CheckoutTermsAndConditionsCheckbox;","\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as React from 'react';\n\nexport interface ICheckoutTermsAndConditionsErrorMessageProps {\n message?: string;\n}\n\n/**\n *\n * AddPaymentForm SFC\n * @extends {React.FC}\n */\nconst CheckoutTermsAndConditionsErrorMessage: React.FC = ({\n message\n}) => {\n if (!message) {\n return null;\n }\n\n return (\n

{message}

\n );\n\n};\n\nexport default CheckoutTermsAndConditionsErrorMessage;","\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as React from 'react';\n\nexport interface ICheckoutTermsAndConditionsErrorTitleProps {\n title?: string;\n}\n\n/**\n *\n * AddPaymentForm SFC\n * @extends {React.FC}\n */\nconst CheckoutTermsAndConditionsErrorTitle: React.FC = ({\n title\n}) => {\n if (!title) {\n return null;\n }\n\n return (\n

{title}

\n );\n\n};\n\nexport default CheckoutTermsAndConditionsErrorTitle;","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport classname from 'classnames';\nimport { action, computed, observable, reaction, when } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\nimport { Button, getTelemetryObject, IModuleProps, INodeProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as MsDyn365 from '@msdyn365-commerce/core';\n\nimport { ICheckoutTermsAndConditionsData } from './checkout-terms-and-conditions.data';\nimport {\n ICheckoutTermsAndConditionsProps\n} from './checkout-terms-and-conditions.props.autogenerated';\nimport CheckboxComponent from './components/checkout-terms-and-conditions.check-box';\nimport ErrorMessageComponent from './components/checkout-terms-and-conditions.error-message';\nimport ErrorTitleComponent from './components/checkout-terms-and-conditions.error-title';\n\nexport interface ICheckoutTermsAndConditionsModuleProps extends ICheckoutTermsAndConditionsProps, IModuleStateProps { }\n\nexport interface ICheckoutTermsAndConditions {\n termsAndConditionAcceptance: INodeProps;\n checkBox: React.ReactNode;\n description: React.ReactNode;\n}\n\nexport interface ICheckoutTermsAndConditionsError {\n error: INodeProps;\n title: React.ReactNode;\n message: React.ReactNode;\n}\n\nexport interface ICheckoutTermsAndConditionsViewState {\n isError: boolean;\n isShowSaveButton: boolean;\n isShowEditButton: boolean;\n isShowCancelButton: boolean;\n}\n\nexport interface ICheckoutTermsAndConditionsViewProps extends ICheckoutTermsAndConditionsProps<{}> {\n checkoutTermsAndConditions: IModuleProps;\n isTermsAccepted: boolean;\n errorMessageData: string;\n viewState: ICheckoutTermsAndConditionsViewState;\n termsAndConditionsContent: ICheckoutTermsAndConditions;\n errorMessage?: ICheckoutTermsAndConditionsError;\n saveButton?: React.ReactNode;\n editButton?: React.ReactNode;\n cancelButton?: React.ReactNode;\n onChange(event: React.ChangeEvent): void;\n onSave(): void;\n onEdit(): void;\n onCancel(): void;\n}\n\n/**\n *\n * CheckoutTermsAndConditions component\n * @extends {React.Component>}\n */\n// @ts-ignore\n@withModuleState\n@observer\nclass CheckoutTermsAndConditions extends React.Component {\n private telemetryContent: ITelemetryContent;\n @observable private isTermsAccepted: boolean = true;\n @observable private errorMessage?: string;\n\n constructor(props: ICheckoutTermsAndConditionsModuleProps) {\n super(props);\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!, this.props.friendlyName, this.props.telemetry);\n }\n\n @computed get isDataReady(): boolean {\n return (this.props.data.checkout.result && this.props.data.checkout.status) === 'SUCCESS';\n }\n\n @computed get isShowButtons(): boolean {\n const { showControlButtons } = this.props.config;\n return !this.props.moduleState.hasExternalSubmitGroup && (showControlButtons || false);\n }\n\n @computed get isAutoSave(): boolean {\n const { showControlButtons } = this.props.config;\n return !this.props.moduleState.hasExternalSubmitGroup && !showControlButtons;\n }\n\n @computed get defaultTermsAndConditionAcceptedValue(): boolean {\n const { showCheckbox } = this.props.config;\n return showCheckbox ? false : true;\n }\n\n public async componentDidMount(): Promise {\n // @ts-ignore: Compiler not reconizing condition check for function params\n when(\n () => this.isDataReady,\n async () => {\n await this.init();\n }\n );\n\n reaction(\n () => this.props.data.checkout.result && this.props.data.checkout.result.isTermsAndConditionAccepted,\n async () => {\n this.isTermsAccepted = this.props.data.checkout.result?.isTermsAndConditionAccepted || this.defaultTermsAndConditionAcceptedValue;\n }\n );\n }\n\n public render(): JSX.Element | null {\n const {\n moduleState: { isReady, hasError },\n config: { className }\n } = this.props;\n const isTermsAndConditionAccepted = this.props.data.checkout.result?.isTermsAndConditionAccepted;\n const isError = hasError;\n const isShowContent = !isReady;\n const isShowSelected = !hasError && isReady;\n\n const viewProps = {\n ...this.props,\n ...this.state,\n isTermsAccepted: this.isTermsAccepted,\n errorMessageData: this.errorMessage,\n viewState: {\n isError: isError,\n isShowSaveButton: isShowContent && this.isShowButtons,\n isShowEditButton: isShowSelected && this.isShowButtons,\n isShowCancelButton: isShowContent && this.isShowButtons && isTermsAndConditionAccepted,\n },\n checkoutTermsAndConditions: {\n moduleProps: this.props,\n className: classname('ms-checkout-terms-and-conditions', className)\n },\n termsAndConditionsContent: this.getTermsAndConditions(),\n errorMessage: this.getErrorMessage(),\n saveButton: this.getSaveButton(),\n editButton: this.getEditButton(),\n cancelButton: this.getCancelButton(),\n onSave: this.onSubmit,\n onEdit: this.onEdit,\n onCancel: this.onCancel,\n onChange: this.onChange\n };\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private getTermsAndConditions = (): ICheckoutTermsAndConditions => {\n const {\n moduleState: { isReady },\n config: { showCheckbox, description }\n } = this.props;\n const isDisabled = isReady && !this.isAutoSave;\n const isTermsAndConditionAccepted = this.isTermsAccepted;\n\n return {\n termsAndConditionAcceptance: { className: 'ms-checkout-terms-and-conditions__container' },\n checkBox: showCheckbox && ,\n description: \n };\n }\n\n @action\n private init = async (): Promise => {\n const {\n data,\n config: { showCheckbox }\n } = this.props;\n\n const hasInvoiceLine = this.props.data.checkout.result?.checkoutCart.hasInvoiceLine;\n\n // if hasInvoiceLine is true, this is for b2b and isTermsAccepted should be true\n if (hasInvoiceLine || data.checkout.result?.isTermsAndConditionAccepted || !showCheckbox) {\n await this.updateTermsAndConditionsAcceptance(true);\n this.isTermsAccepted = true;\n } else if (showCheckbox) {\n await this.updateTermsAndConditionsAcceptance(false);\n this.isTermsAccepted = false;\n }\n\n this.props.moduleState.init({\n onEdit: this.onEdit,\n onCancel: this.onCancel,\n onSubmit: this.onSubmit,\n status: hasInvoiceLine ? 'disabled' : (this.isTermsAccepted ? 'ready' : 'updating')\n });\n };\n\n private getErrorMessage = (): ICheckoutTermsAndConditionsError => {\n const { errorMessageTitle } = this.props.resources;\n return {\n error: { tag: 'div', className: 'ms-checkout-terms-and-conditions__error', role: 'alert', 'aria-live': 'assertive' },\n title: ,\n message: \n };\n };\n\n private getCancelButton = (): React.ReactNode => {\n const { cancelBtnLabel = 'Cancel', cancelBtnAriaLabel } = this.props.resources;\n return (\n \n {cancelBtnLabel}\n \n );\n };\n\n private getSaveButton = (): React.ReactNode => {\n const { saveBtnLabel = 'Save', saveBtnAriaLabel } = this.props.resources;\n return (\n \n {saveBtnLabel}\n \n );\n };\n\n private getEditButton = (): React.ReactNode => {\n const { editBtnLabel = 'Change', editBtnAriaLabel } = this.props.resources;\n return (\n \n {editBtnLabel}\n \n );\n };\n\n private onEdit = (): void => {\n this.onUpdating();\n };\n\n private onSubmit = async (): Promise => {\n if (!this.isTermsAccepted) {\n if (this.isAutoSave) {\n await this.updateTermsAndConditionsAcceptance(this.isTermsAccepted);\n } else {\n this.setError(this.props.resources.errorMessage);\n this.props.moduleState.setHasError(true);\n }\n } else {\n this.clearError();\n await this.updateTermsAndConditionsAcceptance(this.isTermsAccepted);\n this.props.moduleState.onReady();\n }\n };\n\n private onUpdating = () => {\n this.props.moduleState.onUpdating();\n };\n\n private setError = (errorMessage: string): void => {\n this.props.telemetry.error(errorMessage);\n this.props.moduleState.setHasError(true);\n this.props.moduleState.onUpdating();\n this.errorMessage = errorMessage;\n };\n\n private onCancel = (): void => {\n // Reset to the saved value\n if (!this.props.data.checkout.result) {\n return;\n }\n\n const isTermsAccepted = this.props.data.checkout.result.isTermsAndConditionAccepted;\n if (!isTermsAccepted) {\n // It has no saved email, set to status updating and request user to fill the email form\n this.props.moduleState.onUpdating();\n return;\n } else {\n // It has saved email, set to status ready\n this.isTermsAccepted = true;\n this.props.moduleState.setHasError(false);\n this.props.moduleState.onReady();\n }\n };\n\n private updateTermsAndConditionsAcceptance = async (isTermsAccepted: boolean): Promise => {\n if (this.props.data.checkout.result) {\n await this.props.data.checkout.result.updateTermsAndConditionsAcceptance({ newIsTermsAndConditionAccepted: isTermsAccepted });\n }\n };\n\n private clearError = (): void => {\n this.props.moduleState.setHasError(false);\n this.errorMessage = undefined;\n };\n\n private onChange = async (event: React.ChangeEvent) => {\n const checked = event.target.checked;\n this.isTermsAccepted = checked;\n if (this.isAutoSave) {\n await this.onSubmit();\n }\n };\n\n}\n\nexport default CheckoutTermsAndConditions;\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\nimport { ICheckoutTermsAndConditions, ICheckoutTermsAndConditionsError, ICheckoutTermsAndConditionsViewProps } from './checkout-terms-and-conditions';\n\nconst TermsAndCondition: React.FC = ({\n termsAndConditionAcceptance,\n checkBox,\n description\n}) => {\n\n return (\n \n {checkBox}\n {description}\n \n );\n};\n\nconst ErrorMessage: React.FC = ({\n error,\n title,\n message,\n}) => {\n\n return (\n \n {title}\n {message}\n \n );\n};\n\nconst CheckoutTermsAndConditionsView: React.FC = props => {\n const {\n checkoutTermsAndConditions,\n viewState,\n termsAndConditionsContent,\n errorMessage,\n saveButton,\n editButton,\n cancelButton } = props;\n\n return (\n // TODO: All wrapper div should be provided by viewProps. Once SDK provide the sln, update markup.\n \n {viewState.isError && errorMessage && }\n {}\n {viewState.isShowSaveButton && saveButton}\n {viewState.isShowEditButton && editButton}\n {viewState.isShowCancelButton && cancelButton}\n \n );\n};\n\nexport default CheckoutTermsAndConditionsView;","import { Alert, Button, INodeProps, NodeTag } from '@msdyn365-commerce-modules/utilities';\nimport { Customer } from '@msdyn365-commerce/retail-proxy';\nimport * as React from 'react';\nimport { ICheckoutCustomerAccountPaymentResources } from '../checkout-customer-account-payment.props.autogenerated';\n\nexport interface IGetAccountPaymentEditViewFormInput {\n resources: ICheckoutCustomerAccountPaymentResources;\n amount: number;\n maxAmount: number;\n customer: Customer | undefined;\n customerCreatedDate: string;\n availableCredit: string;\n showCreditLimit: boolean;\n errorMessage: string | undefined;\n creditSectionIsExpanded: boolean;\n orderTotal: string;\n excessCredit: string | undefined;\n appliedAmount: string | undefined;\n onAddPayment(): Promise;\n onChangePaymentAmount(newAmount: number): void;\n onToggleCreditSection(): void;\n onRemovePayment(): Promise;\n}\n\nexport interface IAccountPaymentEditViewForm {\n formProps: INodeProps;\n inputLabel: React.ReactNode;\n inputAmount: React.ReactNode;\n addPaymentButton: React.ReactNode;\n customerName: React.ReactNode;\n customerAccountNumber: React.ReactNode;\n customerSince: React.ReactNode;\n accountCredit: React.ReactNode;\n alert: React.ReactNode;\n accountDetails: React.ReactNode;\n appliedLine: React.ReactNode;\n bottomBorder: React.ReactNode;\n}\n\n// tslint:disable-next-line:max-func-body-length\nexport const getAccountPaymentFormEditMode = (options: IGetAccountPaymentEditViewFormInput): IAccountPaymentEditViewForm => {\n const {\n resources,\n onAddPayment,\n amount,\n onChangePaymentAmount,\n maxAmount,\n customer,\n customerCreatedDate,\n availableCredit,\n showCreditLimit,\n errorMessage,\n onToggleCreditSection,\n creditSectionIsExpanded,\n orderTotal,\n excessCredit,\n onRemovePayment,\n appliedAmount\n } = options;\n\n const { addPaymentButtonLabel, inputAmountLabel, inputAmountAriaLabel, customerSinceLabel, accountCreditLabel, creditDetailsSectionLabel, orderTotalLabel, availableCreditLabel, creditExcessLabel, appliedCustomerAccountPaymentLabel,\n removeCustomerAccountPaymentLabel } = resources;\n\n const inputLabel = (\n \n {inputAmountLabel}\n \n );\n\n const onAddAccountPayment = async (e: React.SyntheticEvent): Promise => {\n e.preventDefault();\n await onAddPayment();\n };\n\n const formProps = {\n className: 'ms-checkout-customer-account__form-edit',\n onSubmit: onAddAccountPayment,\n tag: 'form' as NodeTag\n };\n\n const addPaymentButton = (\n maxAmount) || (amount < 0) }\n >\n {addPaymentButtonLabel}\n \n );\n\n const onChangeAmount = (e: React.ChangeEvent) => {\n const value = parseFloat(e.target.value || '0');\n onChangePaymentAmount(value);\n };\n\n const inputAmount = (\n \n );\n\n const customerName = (\n \n {customer?.Name}\n \n );\n\n const customerAccountNumber = (\n \n {'#'}{customer?.AccountNumber}\n \n );\n\n const customerSince = (\n \n {customerSinceLabel}{customerCreatedDate}\n \n );\n\n const accountCredit = (\n <>\n \n {accountCreditLabel}\n \n {showCreditLimit && \n {availableCredit}\n }\n \n \n );\n\n const accountDetails = (\n creditSectionIsExpanded ?\n (\n \n <>\n \n \n \n {creditDetailsSectionLabel}\n \n \n \n \n \n {availableCreditLabel}\n \n \n {availableCredit}\n \n \n \n \n {orderTotalLabel}\n \n \n {orderTotal}\n \n \n \n \n {creditExcessLabel}\n \n \n {excessCredit}\n \n \n \n\n ): undefined\n );\n\n const alert = (\n \n {errorMessage}\n \n );\n\n const appliedLine = (\n appliedAmount ?\n (\n \n \n {appliedCustomerAccountPaymentLabel}\n \n \n {appliedAmount}\n \n \n {removeCustomerAccountPaymentLabel}\n \n \n ) : undefined\n );\n\n const bottomBorder = (\n
\n );\n\n return {\n formProps,\n inputLabel,\n inputAmount,\n addPaymentButton,\n customerName,\n customerAccountNumber,\n customerSince,\n accountCredit,\n alert,\n accountDetails,\n appliedLine,\n bottomBorder\n };\n};","import { Button, INodeProps, NodeTag } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\nimport { ICheckoutCustomerAccountPaymentResources } from '../checkout-customer-account-payment.props.autogenerated';\n\nexport interface IGetAccountPaymentSummaryViewFormInput {\n resources: ICheckoutCustomerAccountPaymentResources;\n amount: number;\n appliedAmount: string | undefined;\n}\n\nexport interface IAccountPaymentSummaryViewForm {\n formProps: INodeProps;\n label: React.ReactNode;\n paymentAmount: React.ReactNode;\n addPaymentButton: React.ReactNode;\n appliedLine: React.ReactNode;\n bottomBorder: React.ReactNode;\n}\n\nexport const getAccountPaymentFormSummaryMode = (options: IGetAccountPaymentSummaryViewFormInput): IAccountPaymentSummaryViewForm => {\n const {\n resources,\n amount,\n appliedAmount\n } = options;\n\n const { addPaymentButtonLabel, inputAmountSummaryLabel, appliedCustomerAccountPaymentLabel } = resources;\n\n const label = (\n \n );\n\n const formProps = {\n className: 'ms-checkout-customer-account__form-summary',\n tag: 'form' as NodeTag\n };\n\n const paymentAmount = (\n \n );\n\n const addPaymentButton = (\n \n {addPaymentButtonLabel}\n \n );\n\n const appliedLine = (\n appliedAmount ?\n (\n \n \n {appliedCustomerAccountPaymentLabel}\n \n \n {appliedAmount}\n \n
\n ) : undefined\n );\n\n const bottomBorder = (\n
\n );\n\n return {\n formProps,\n label,\n paymentAmount,\n addPaymentButton,\n appliedLine,\n bottomBorder\n };\n};","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as React from 'react';\n\nimport { IModuleStateManager, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\nimport { CustomerBalances } from '@msdyn365-commerce/retail-proxy';\nimport classnames from 'classnames';\nimport get from 'lodash/get';\nimport { computed, reaction } from 'mobx';\nimport { observer } from 'mobx-react';\nimport { ICheckoutCustomerAccountPaymentData } from './checkout-customer-account-payment.data';\nimport { ICheckoutCustomerAccountPaymentProps } from './checkout-customer-account-payment.props.autogenerated';\nimport { getAccountPaymentFormEditMode, IAccountPaymentEditViewForm } from './components/get-account-payment-form-edit-mode';\nimport { getAccountPaymentFormSummaryMode, IAccountPaymentSummaryViewForm } from './components/get-account-payment-form-summary-mode';\n\nexport interface ICheckoutCustomerAccountPaymentViewProps extends ICheckoutCustomerAccountPaymentProps {\n checkoutCustomerAccount: IModuleProps;\n summaryView: IAccountPaymentSummaryViewForm;\n editView: IAccountPaymentEditViewForm;\n moduleState: IModuleStateManager;\n}\n\nexport interface ICheckoutCustomerAccountPaymentState {\n paymentAmount: number;\n isCreditSectionExpanded: boolean;\n}\n\n/**\n *\n * CheckoutCustomerAccount component\n * @extends {React.Component>}\n */\n// @ts-ignore\n@withModuleState\n@observer\nexport class CheckoutCustomerAccountPayment extends React.Component {\n\n @computed get isCustomerAccountPaymentEnabled(): boolean {\n const customerInfo = get(this.props, 'data.customerInformation.result');\n const platform = get(this.props, 'context.request.app.platform');\n\n return customerInfo &&\n customerInfo.AllowOnAccountPayment === true &&\n platform &&\n (platform.enableCustomerAccountPayment === 'all' ||\n (platform.enableCustomerAccountPayment === 'b2b' && customerInfo.IsB2b === true) ||\n (platform.enableCustomerAccountPayment === 'b2c' && customerInfo.IsB2b === false));\n }\n\n @computed get getLoyaltyAmount(): number {\n const checkoutState = this.props.data.checkout.result;\n if (!checkoutState || !checkoutState.loyaltyAmount) {\n return 0;\n }\n return checkoutState.loyaltyAmount;\n }\n\n @computed get getGiftCardAmount(): number {\n const checkoutState = this.props.data.checkout.result;\n if (!checkoutState || !checkoutState.giftCards || checkoutState.giftCards.length === 0) {\n return 0;\n }\n\n let giftCardAmount: number = 0;\n checkoutState.giftCards.forEach(giftCard => {\n giftCardAmount += (giftCard.Balance || 0);\n });\n\n return giftCardAmount;\n }\n\n @computed get maxPaymentAmount(): number {\n const cart = this.props.data.checkout.result ? this.props.data.checkout.result.checkoutCart.cart : undefined;\n if (!cart) {\n return 0;\n }\n // Use customer account after gift card and loyalty.\n const amountDue = Math.max(0, (cart.TotalAmount || 0) - this.getLoyaltyAmount - this.getGiftCardAmount);\n\n // if the user has a mandatory credit limit, then the max amount must not be more than that\n if (this.props.data.customerInformation?.result?.MandatoryCreditLimit) {\n return Math.min(this.getAvailableCredit(this.props.data.creditBalances?.result), amountDue);\n } else {\n return amountDue;\n }\n }\n\n @computed get errorMessage(): string | undefined {\n if (this.state.paymentAmount > this.maxPaymentAmount || this.state.paymentAmount < 0) {\n return this.props.resources.invalidAmountMessage;\n }\n\n return undefined;\n }\n\n @computed get currencyCode(): string | undefined {\n return get(this.props, 'context.request.channel.Currency');\n }\n\n @computed get availableCredit(): number {\n const creditBalances = get(this.props, 'data.creditBalances.result');\n\n return creditBalances ? this.getAvailableCredit(creditBalances) : 0;\n }\n\n @computed get orderTotal(): number {\n const orderTotal = get(this.props, 'data.checkout.result.checkoutCart.cart.TotalAmount');\n\n return orderTotal ? orderTotal : 0;\n }\n\n @computed get formattedExcessCredit(): string | undefined {\n const excessCredit = this.availableCredit - this.orderTotal;\n return excessCredit < 0 ? this.props.context.cultureFormatter.formatCurrency(excessCredit, this.currencyCode) : undefined;\n }\n\n private baseClassName: string = 'ms-checkout-customer-account';\n public constructor(props: ICheckoutCustomerAccountPaymentViewProps) {\n super(props);\n this.state = {paymentAmount: this.maxPaymentAmount, isCreditSectionExpanded: false};\n }\n\n public async componentDidMount(): Promise {\n await this.init();\n\n // when the cart.TotalAmount gets updated (like if selecting the delivery option adds a charge) we need to update the amount based on the new total amount.\n reaction(\n () => this.props.data.checkout.result && this.props.data.checkout.result.checkoutCart.cart && this.props.data.checkout.result.checkoutCart.cart.TotalAmount,\n totalAmount => {\n this.updateMaxAmount(this.maxPaymentAmount);\n }\n );\n }\n\n public render(): JSX.Element | null {\n const customerInfo = this.props.data.customerInformation.result;\n\n if (!this.isCustomerAccountPaymentEnabled) {\n this.props.context.telemetry.information('customer account payments will not display, because the feature is disabled or not enabled for this type of customer');\n return null;\n }\n\n const checkoutState = this.props.data.checkout.result;\n const cart = checkoutState ? checkoutState.checkoutCart.cart : undefined;\n\n const creditBalances = this.props.data.creditBalances.result;\n\n if (!cart) {\n return null;\n }\n const resources = this.props.resources;\n const locale = get(this.props, 'context.request.locale') || 'en-us';\n\n const customerSinceDate = new Date(customerInfo?.CreatedDateTime || 0).toLocaleDateString(locale);\n\n const props = {\n ...this.props,\n checkoutCustomerAccount: {\n moduleProps: this.props,\n className: classnames(\n this.baseClassName\n )},\n editView: getAccountPaymentFormEditMode({\n onAddPayment: this.addPayment,\n resources,\n amount: this.state.paymentAmount,\n onChangePaymentAmount: this.onChangePaymentAmount,\n maxAmount: this.maxPaymentAmount,\n customer: customerInfo,\n customerCreatedDate: customerSinceDate,\n availableCredit: this.props.context.cultureFormatter.formatCurrency(this.getAvailableCredit(creditBalances), this.currencyCode),\n showCreditLimit: customerInfo?.MandatoryCreditLimit || false,\n errorMessage: this.errorMessage,\n onToggleCreditSection: this.toggleCreditSection,\n creditSectionIsExpanded: this.state.isCreditSectionExpanded,\n orderTotal: this.props.context.cultureFormatter.formatCurrency(this.orderTotal, this.currencyCode),\n excessCredit: this.formattedExcessCredit,\n onRemovePayment: this.removePayment,\n appliedAmount: checkoutState && checkoutState.customerAccountAmount > 0 ? this.props.context.cultureFormatter.formatCurrency(checkoutState.customerAccountAmount, this.currencyCode) : undefined\n }),\n summaryView: getAccountPaymentFormSummaryMode({\n resources,\n amount: this.state.paymentAmount,\n appliedAmount: checkoutState && checkoutState.customerAccountAmount > 0 ? this.props.context.cultureFormatter.formatCurrency(checkoutState.customerAccountAmount, this.currencyCode) : undefined\n })\n };\n\n return this.props.renderView(props) as React.ReactElement;\n }\n\n private getAvailableCredit = (creditBalances: CustomerBalances | undefined) => {\n if (!creditBalances) {\n return 0;\n }\n return creditBalances.CreditLimit - creditBalances.Balance - creditBalances.PendingBalance;\n };\n\n private addPayment = async (): Promise => {\n const checkoutState = this.props.data.checkout.result;\n\n if (!checkoutState) {\n this.props.context.telemetry.error('checkout state not found');\n return;\n }\n\n await checkoutState.updateCustomerAccountAmount({ newAmount: this.state.paymentAmount });\n this.props.context.telemetry.information('customer account payment amount updated');\n }\n\n private toggleCreditSection = (): void => {\n this.setState({\n isCreditSectionExpanded: !this.state.isCreditSectionExpanded\n });\n };\n\n private init = async(): Promise => {\n this.props.moduleState.init({\n onCancel: this.handleCancelOrSubmit,\n onSubmit: this.handleCancelOrSubmit,\n onEdit: this.onEdit\n });\n\n if (this.props.data.checkout.result && this.props.data.checkout.result.customerAccountAmount !== 0) {\n this.props.moduleState.onReady();\n }\n }\n\n private onChangePaymentAmount =(newAmount: number): void => {\n this.setState({\n paymentAmount: newAmount\n });\n };\n\n private updateMaxAmount =(newAmount: number): void => {\n\n // if the user has already set an amount, we should not override that in the UI because it will be confusing.\n if (this.props.data.checkout.result && this.props.data.checkout.result.customerAccountAmount === 0) {\n this.setState({\n // We should never allow a negative amount.\n paymentAmount: Math.max(0, newAmount)\n });\n }\n };\n\n private onEdit = (): void => {\n this.props.moduleState.onUpdating();\n };\n\n private handleCancelOrSubmit = () => {\n const checkoutState = this.props.data.checkout.result;\n if (checkoutState && checkoutState.customerAccountAmount > 0) {\n this.props.moduleState.onReady();\n } else {\n // Skip the module\n this.props.moduleState.onSkip();\n }\n };\n\n private removePayment = async (): Promise => {\n const checkoutState = this.props.data.checkout.result;\n\n if (!checkoutState) {\n this.props.context.telemetry.error('checkout state not found');\n return;\n }\n\n this.setState({\n paymentAmount: 0\n });\n\n await checkoutState.updateCustomerAccountAmount({ newAmount: 0});\n this.props.context.telemetry.information('customer account payment removed');\n }\n}\n\nexport default CheckoutCustomerAccountPayment;\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport { IAddResource, ICheckoutGiftCardViewProps, IForm, IItem, IList, IShowResource } from './smwe-checkout-gift-card';\r\n\r\nexport const From: React.FC = ({ formProps, label, inputPinLabel, inputExpLabel, alert, inputProps, inputNumProps,\r\n inputPinProps, inputExpProps, inputNumber, inputPin, inputExp, applyButton, supportExternalGiftCard, showGiftCardPinInput, showGiftCardExpInput, alertFieldLabel }) => (\r\n \r\n {alert}\r\n {supportExternalGiftCard ?\r\n \r\n \r\n {label}\r\n {inputNumber}\r\n \r\n {showGiftCardPinInput &&\r\n \r\n {inputPinLabel}\r\n {inputPin}\r\n \r\n }\r\n {showGiftCardExpInput &&\r\n \r\n {inputExpLabel}\r\n {inputExp}\r\n \r\n }\r\n {(showGiftCardPinInput || showGiftCardExpInput) && alertFieldLabel}\r\n \r\n : <>{label}{inputNumber}\r\n }\r\n {applyButton}\r\n \r\n);\r\n\r\nexport const SelectedGiftCard: React.FC = ({ itemProps, selectedGiftCard, removeButton }) => (\r\n \r\n {selectedGiftCard}\r\n {removeButton}\r\n \r\n);\r\n\r\nexport const GiftCardList: React.FC = ({ listProps, list }) => (\r\n \r\n {list.map(({ id, ...item }) => (\r\n \r\n ))}\r\n \r\n);\r\n\r\nexport const AddResource: React.FC = ({ form, list }) => (\r\n <>\r\n {form && }\r\n {list && }\r\n \r\n);\r\n\r\nexport const ShowResource: React.FC = ({ title, list }) => (\r\n <>\r\n {title}\r\n {list && }\r\n \r\n);\r\n\r\nconst CheckoutGiftCardView: React.FC = props => {\r\n const { checkoutGiftCardProps, showGiftCard, addGiftCard } = props;\r\n return (\r\n \r\n {showGiftCard && }\r\n {addGiftCard && }\r\n \r\n );\r\n};\r\n\r\nexport default CheckoutGiftCardView;\r\n","import { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\nimport { ICheckoutPickupViewProps } from './checkout-pickup';\nimport { ICheckoutPickupGroupViewProps } from './components/checkout-pickup-group';\n\nconst CheckoutPickupView: React.FC = props => {\n const {\n checkoutPickup,\n viewState,\n headerError,\n waiting,\n pickupGroups,\n } = props;\n\n return (\n \n {viewState.isLoading && waiting}\n {viewState.isHeaderError && headerError}\n {pickupGroups.map((pickupGroupViewProps: ICheckoutPickupGroupViewProps, index: number): React.ReactElement => {\n const {\n pickupGroupContainer,\n dateTimeslotContainer,\n groupDivider,\n groupHeader,\n cartLineImages,\n groupErrorMessage,\n pickupDateDropdown,\n pickupTimeslotDropdown,\n selectedDateTimeslot,\n pickupAddress\n } = pickupGroupViewProps;\n\n return (\n \n {groupDivider}\n {groupHeader}\n {cartLineImages}\n {groupErrorMessage}\n {viewState.isShowDropdown &&\n \n {pickupDateDropdown}\n {pickupTimeslotDropdown}\n \n }\n {viewState.isShowSelected && pickupAddress}\n {viewState.isShowSelected && selectedDateTimeslot}\n \n );\n })}\n \n );\n\n};\n\nexport default CheckoutPickupView;","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as React from 'react';\r\n\r\nconst Loading: React.FC = () =>
;\r\n\r\nexport default Loading;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport { IModuleStateManager, IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\r\nimport { IModuleProps, INodeProps } from '@msdyn365-commerce-modules/utilities';\r\nimport classname from 'classnames';\r\nimport get from 'lodash/get';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport LoadingComponent from './components/loading';\r\nimport { ISmweCheckoutSectionContainerProps } from './smwe-checkout-section-container.props.autogenerated';\r\n\r\nexport interface ICheckoutSectionContainerModuleProps extends ISmweCheckoutSectionContainerProps<{}>, IModuleStateProps {\r\n enableControl: boolean;\r\n}\r\n\r\nexport interface ICheckoutSectionContainerItem {\r\n id: string;\r\n loading?: React.ReactNode;\r\n itemProps: INodeProps;\r\n item: React.ReactNode;\r\n}\r\n\r\nexport interface ICheckoutSectionContainerViewProps extends ISmweCheckoutSectionContainerProps<{}> {\r\n className: string;\r\n checkoutPlainContainerProps: IModuleProps;\r\n items: ICheckoutSectionContainerItem[];\r\n}\r\n\r\n/**\r\n *\r\n * CheckoutPlainContainer component\r\n * @extends {React.Component}\r\n */\r\n@observer\r\nexport class CheckoutPlainContainer extends React.Component {\r\n public componentDidMount(): void {\r\n const items = this.getItems();\r\n const childIds = items.map((item: React.ReactNode) => get(item, 'props.id'));\r\n this.props.moduleState.init({\r\n onEdit: this.onEdit,\r\n onCancel: this.onCancel,\r\n onSubmit: this.onSubmit,\r\n childIds\r\n });\r\n }\r\n\r\n public componentDidUpdate(): void {\r\n if (!this.props.moduleState.hasExternalSubmitGroup) {\r\n return;\r\n }\r\n /**\r\n * Review all modules to updating status if one of the modules has error\r\n */\r\n const { childIds, hasError, getModule } = this.props.moduleState;\r\n const hasReadyItems = childIds.some((childId: string) => {\r\n const state = getModule(childId);\r\n return !!state && state.isReady;\r\n });\r\n if (hasReadyItems && hasError) {\r\n this.onEdit();\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const {\r\n enableControl,\r\n moduleState,\r\n config: { width }\r\n } = this.props;\r\n\r\n const items = this.getItems();\r\n if (!items.length) {\r\n return null;\r\n }\r\n\r\n const moduleClassName = classname(\r\n 'ms-checkout-section-container',\r\n {\r\n 'has-initialized': moduleState.hasInitialized,\r\n 'is-ready': moduleState.isReady,\r\n 'is-updating': !moduleState.isReady,\r\n container: width === 'container',\r\n 'col-12 fullwidth': width === 'fluid'\r\n },\r\n this.props.config.className\r\n );\r\n\r\n const viewProps: ICheckoutSectionContainerViewProps = {\r\n ...this.props,\r\n\r\n className: moduleClassName,\r\n checkoutPlainContainerProps: {\r\n moduleProps: this.props,\r\n className: moduleClassName\r\n },\r\n items: items.map((item: React.ReactNode) => {\r\n const childId = get(item, 'props.id');\r\n const state = moduleState.getModule(childId);\r\n // Modules has not completed initializing or it's disable\r\n const hidden = state.hasModuleState && (!state.hasInitialized || state.isDisabled || state.isSkipped);\r\n return {\r\n id: childId,\r\n loading: state.hasModuleState && !state.hasInitialized && ,\r\n itemProps: {\r\n 'data-type-name': state.typeName,\r\n className: classname('ms-checkout-section-container__item', {\r\n hidden: hidden,\r\n initialized: state.hasInitialized,\r\n disabled: state.isDisabled,\r\n skipped: state.isSkipped,\r\n ready: state.isReady,\r\n updating: state.isUpdating,\r\n pending: state.isPending\r\n })\r\n },\r\n item: React.cloneElement(item as React.ReactElement, { enableControl })\r\n };\r\n })\r\n };\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n private getItems = (): React.ReactNode[] => {\r\n const { slots } = this.props;\r\n return (slots && slots.primary && slots.primary.length && slots.primary) || [];\r\n };\r\n\r\n private getActiveChildModuleStates = (): IModuleStateManager[] => {\r\n const { childIds, getModule } = this.props.moduleState;\r\n return childIds\r\n .map(getModule)\r\n .filter((state): state is IModuleStateManager => !!state && !state.isDisabled && state.hasModuleState);\r\n };\r\n\r\n private clearError = (): void => {\r\n // Clear error before action, otherwise it will rise conflict;\r\n this.getActiveChildModuleStates().forEach(state => {\r\n state.hasError && state.setHasError(false);\r\n });\r\n };\r\n\r\n private onSubmit = (): void => {\r\n this.clearError();\r\n this.getActiveChildModuleStates().forEach(state => {\r\n !state.isReady && state.onSubmit && state.onSubmit();\r\n });\r\n };\r\n\r\n private onCancel = (): void => {\r\n this.clearError();\r\n this.getActiveChildModuleStates().forEach(state => {\r\n !state.isReady && state.onCancel && state.onCancel();\r\n });\r\n };\r\n\r\n private onEdit = (): void => {\r\n this.getActiveChildModuleStates().forEach(state => {\r\n (state.isReady || state.isSkipped) && state.onEdit && state.onEdit();\r\n });\r\n };\r\n}\r\n\r\nexport default withModuleState(CheckoutPlainContainer);\r\n","import { format } from '@msdyn365-commerce-modules/utilities';\n\nexport function getDate(date: Date | undefined, locale: string): string {\n if (!date) {\n return '';\n }\n const options: Intl.DateTimeFormatOptions = {\n timeZone: 'UTC'\n };\n const formatter = new Intl.DateTimeFormat(locale, options);\n return formatter.format(new Date(date));\n}\n\nexport const getTimeslot = (placeHolder: string, startDate: Date | undefined, endDate: Date | undefined, locale: string): string => {\n if (!startDate || !endDate) {\n return '';\n }\n const options: Intl.DateTimeFormatOptions = {\n hour: 'numeric',\n minute: 'numeric',\n hour12: true,\n timeZone: 'UTC'\n };\n const formatter = new Intl.DateTimeFormat(locale, options);\n return format(placeHolder, formatter.format(new Date(startDate)), formatter.format(new Date(endDate)));\n};\n\nexport const getUTCDateWithoutTime = (input: Date): Date => {\n const date: Date = new Date(input);\n return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), 0, 0, 0));\n};","import { computed } from 'mobx';\nimport * as React from 'react';\n\nimport { LabeledDropdown } from '@msdyn365-commerce-modules/utilities';\nimport {\n ILabeledDropdownOnChangeNotification, ILabeledDropdownOption\n} from '@msdyn365-commerce-modules/utilities/dist/types/labeled-dropdown/LabeledDropdown.props';\n\nimport { getDate } from './checkout-pickup-utility';\n\nexport interface IPickupDropdownProps {\n pickupStoreId: string;\n deliveryMode: string;\n\n defaultText: string;\n locale: string;\n\n // props for the LabeledDropdown component\n labelText: string;\n dropdownId: string;\n controlledByParent: boolean;\n labelClassname?: string;\n toggleColor?: string;\n dropdownClassname?: string;\n}\n\nexport interface IPickupDateDropdownProps extends IPickupDropdownProps {\n availableDates: Date[];\n selectedDate?: Date;\n setDateHandler(pickupStoreId: string, deliveryMode: string, pickupDate: Date | undefined): void;\n}\n\n/**\n *\n * CheckoutPickupDateDropdown component\n * @extends {React.Component}\n */\nexport class CheckoutPickupDateDropdown extends React.Component {\n\n private defaultKey: number = -1;\n private defaultOption: ILabeledDropdownOption;\n\n // as the LabeledDropdown control only offers key and value, we need to map the key with date and timeslot data\n @computed get getDateMap(): Map {\n const map = new Map();\n this.props.availableDates.forEach((value, index) => {\n map.set(index.toString(), value);\n });\n return map;\n }\n\n constructor(props: IPickupDateDropdownProps) {\n super(props);\n this.defaultOption = { key: this.defaultKey.toString(), value: props.defaultText };\n this.updateDateSelection = this.updateDateSelection.bind(this);\n }\n\n public render(): JSX.Element | null {\n const {\n labelText,\n dropdownId,\n availableDates,\n selectedDate,\n controlledByParent,\n labelClassname,\n toggleColor,\n dropdownClassname\n } = this.props;\n\n const { dropdownOptions, selectedOption } = this.mapDatesToOptions(availableDates, selectedDate);\n\n return (\n \n );\n }\n\n private updateDateSelection = (notification: ILabeledDropdownOnChangeNotification): void => {\n const {\n pickupStoreId,\n deliveryMode,\n setDateHandler,\n } = this.props;\n const date: Date | undefined = this.getDate(notification);\n setDateHandler(pickupStoreId, deliveryMode, date);\n }\n\n private getDate = (notification: ILabeledDropdownOnChangeNotification): Date | undefined => {\n const key: string = notification.selectedOption.key;\n if (key === this.defaultKey.toString() || !this.getDateMap.has(key)) {\n return undefined;\n } else {\n return this.getDateMap.get(key);\n }\n }\n\n private mapDatesToOptions = (dates: Date[], selectedDate: Date | undefined): { dropdownOptions: ILabeledDropdownOption[]; selectedOption: ILabeledDropdownOption | undefined } => {\n const { locale } = this.props;\n let options: ILabeledDropdownOption[] = [];\n let selectedOption: ILabeledDropdownOption = this.defaultOption;\n\n // tslint:disable-next-line:no-shadowed-variable\n options = dates.map((value: Date, index: number) => {\n return {\n key: index.toString(),\n value: getDate(value, locale)\n };\n });\n options.unshift(this.defaultOption);\n\n const index: number = dates.findIndex((value: Date) => (selectedDate !== undefined && selectedDate.getTime() === value.getTime()));\n if (index >= 0 && selectedDate) {\n selectedOption = {\n key: index.toString(),\n value: getDate(selectedDate, locale)\n };\n }\n\n return {\n dropdownOptions: options,\n selectedOption: selectedOption\n };\n }\n}","import { computed } from 'mobx';\nimport * as React from 'react';\n\nimport { LabeledDropdown } from '@msdyn365-commerce-modules/utilities';\nimport {\n ILabeledDropdownOnChangeNotification, ILabeledDropdownOption\n} from '@msdyn365-commerce-modules/utilities/dist/types/labeled-dropdown/LabeledDropdown.props';\nimport {\n PickupTimeslotAvailability\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { IPickupDropdownProps } from './checkout-pickup-date-dropdown';\nimport { getTimeslot } from './checkout-pickup-utility';\n\nexport interface IPickupTimeslotDropdownProps extends IPickupDropdownProps {\n availableTimeslots: PickupTimeslotAvailability[];\n selectedTimeslot?: PickupTimeslotAvailability;\n timeslotPlaceHolder: string;\n setTimeslotHandler(pickupStoreId: string, deliveryMode: string, pickupTimeslot: PickupTimeslotAvailability | undefined): void;\n}\n\n/**\n *\n * CheckoutPickupTimeslotDropdown component\n * @extends {React.Component}\n */\nexport class CheckoutPickupTimeslotDropdown extends React.Component {\n\n private defaultKey: number = -1;\n private defaultOption: ILabeledDropdownOption;\n\n // as the LabeledDropdown control only offers key and value, we need to map the key with date and timeslot data\n @computed get getTimeslotMap(): Map {\n const map = new Map();\n this.props.availableTimeslots.forEach((value, index) => {\n map.set(index.toString(), value);\n });\n return map;\n }\n\n constructor(props: IPickupTimeslotDropdownProps) {\n super(props);\n this.defaultOption = { key: this.defaultKey.toString(), value: props.defaultText };\n this.updateTimeslotSelection = this.updateTimeslotSelection.bind(this);\n }\n\n public render(): JSX.Element | null {\n const {\n labelText,\n dropdownId,\n availableTimeslots,\n selectedTimeslot,\n controlledByParent,\n labelClassname,\n toggleColor,\n dropdownClassname\n } = this.props;\n\n const { dropdownOptions, selectedOption } = this.mapTimeslotsToOptions(availableTimeslots, selectedTimeslot);\n\n return (\n \n );\n }\n\n private updateTimeslotSelection = (notification: ILabeledDropdownOnChangeNotification): void => {\n const {\n pickupStoreId,\n deliveryMode,\n setTimeslotHandler,\n } = this.props;\n const timeslot: PickupTimeslotAvailability | undefined = this.getTimeslot(notification);\n setTimeslotHandler(pickupStoreId, deliveryMode, timeslot);\n }\n\n private getTimeslot = (notification: ILabeledDropdownOnChangeNotification): PickupTimeslotAvailability | undefined => {\n const key: string = notification.selectedOption.key;\n if (key === this.defaultKey.toString() || !this.getTimeslotMap.has(key)) {\n return undefined;\n } else {\n return this.getTimeslotMap.get(key);\n }\n }\n\n private mapTimeslotsToOptions = (timeslots: PickupTimeslotAvailability[], selectedTimeslot: PickupTimeslotAvailability | undefined): { dropdownOptions: ILabeledDropdownOption[]; selectedOption: ILabeledDropdownOption | undefined } => {\n const { timeslotPlaceHolder, locale } = this.props;\n let options: ILabeledDropdownOption[] = [];\n let selectedOption: ILabeledDropdownOption = this.defaultOption;\n\n // tslint:disable-next-line:no-shadowed-variable\n options = timeslots.map((value: PickupTimeslotAvailability, index: number) => {\n return {\n key: index.toString(),\n value: getTimeslot(timeslotPlaceHolder, value.StartDateTime, value.EndDateTime, locale)\n };\n });\n options.unshift(this.defaultOption);\n\n const index: number = timeslots.findIndex(value => (\n selectedTimeslot !== undefined\n && selectedTimeslot.StartDateTime?.getTime() === value.StartDateTime?.getTime()\n && selectedTimeslot.EndDateTime?.getTime() === value.EndDateTime?.getTime()\n ));\n if (index >= 0 && selectedTimeslot) {\n selectedOption = {\n key: index.toString(),\n value: getTimeslot(timeslotPlaceHolder, selectedTimeslot.StartDateTime, selectedTimeslot.EndDateTime, locale)\n };\n }\n\n return {\n dropdownOptions: options,\n selectedOption: selectedOption\n };\n }\n\n}","import classnames from 'classnames';\nimport * as React from 'react';\n\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport { IImageProps, IImageSettings, Image, IModule } from '@msdyn365-commerce/core';\nimport {\n Address, CartLine, LineDeliverySpecification, PickupTimeslotAvailability, SimpleProduct\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nexport interface ICheckoutPickupGroupKey {\n pickupStoreId: string;\n deliveryMode: string;\n}\n\nexport interface ICheckoutPickupGroup extends ICheckoutPickupGroupKey {\n pickupModeName: string;\n storeName: string;\n pickupAddress?: Address;\n\n groupErrorMessage?: string;\n lineDeliverySpecs: LineDeliverySpecification[];\n cartLines: ICartLineWithProduct[];\n\n availableDates: Date[];\n availableTimeslots: PickupTimeslotAvailability[];\n\n selectedDate?: Date;\n selectedTimeslot?: PickupTimeslotAvailability;\n}\n\nexport interface ICartLineWithProduct {\n cartLine: CartLine;\n product?: SimpleProduct;\n}\n\nexport interface ICheckoutPickupGroupViewProps {\n moduleProps: IModule;\n\n pickupGroupContainer: INodeProps;\n dateTimeslotContainer: INodeProps;\n\n pickupStoreId: string;\n pickupModeName: string;\n deliveryMode: string;\n\n groupDivider: React.ReactNode;\n groupHeader: React.ReactNode;\n cartLineImages: React.ReactNode;\n groupErrorMessage: React.ReactNode;\n pickupDateDropdown: React.ReactNode;\n pickupTimeslotDropdown: React.ReactNode;\n\n selectedDateTimeslot: React.ReactNode;\n pickupAddress: React.ReactNode;\n}\n\nexport interface ICheckoutPickupErrorProps {\n errorMessage?: string;\n}\n\nexport const CheckoutPickupError: React.FC = ({\n errorMessage\n}) => {\n if (!errorMessage) {\n return null;\n }\n\n return (\n \n \n );\n};\n\nexport interface ICheckoutPickupGroupHeaderProps {\n moduleClassName: string;\n storeInfo: string;\n items: string;\n}\n\nexport const CheckoutPickupGroupHeader: React.FC = ({ moduleClassName, storeInfo, items }) => {\n // need to set dir=\"auto\" as the text (1 item) in rtl mode is incorrect\n return (\n
\n
{storeInfo}
\n
{items}
\n
\n );\n};\n\nexport interface ICheckoutPickupTimeslotInfoProps {\n moduleClassName: string;\n title: string;\n content: string;\n}\n\nexport const CheckoutPickupTimeslotInfo: React.FC = ({ moduleClassName, title, content }) => {\n return (\n
\n
{title}
\n
{content}
\n
\n );\n};\n\nexport interface ICheckoutPickupAddressProps {\n moduleClassName: string;\n title: string;\n address?: Address;\n}\n\nexport const CheckoutPickupAddress: React.FC = ({ moduleClassName, title, address }) => {\n if (!address) {\n return null;\n }\n\n return (\n
\n
{title}
\n {address.Name && {address.Name}}\n {\n (<>\n {address.Street && {address.Street}}\n {address.City && {address.City}}\n {address.State && {`, ${address.State}`}}\n {address.County && {`, ${address.County}`}}\n {address.ZipCode && {` ${address.ZipCode}`}}\n {address.ThreeLetterISORegionName && {` ${address.ThreeLetterISORegionName}`}}\n )\n }\n
\n );\n};\n\nexport interface ICheckoutPickupCartLineInfo {\n lineId: string;\n imageProps: IImageProps;\n quantity: number;\n}\n\nexport interface ICheckoutPickupCartLinesProps {\n moduleClassName: string;\n cartLines: ICheckoutPickupCartLineInfo[];\n}\n\nexport const CheckoutPickupCartLines: React.FC = ({ moduleClassName, cartLines }) => {\n if (!ArrayExtensions.hasElements(cartLines)) {\n return null;\n }\n return (\n
\n {cartLines.map(prop => {\n const showQty = prop.quantity > 1;\n let className = `${moduleClassName}__group-product-image`;\n if (showQty) {\n className = classnames(className, ' product-image-wide');\n }\n return (\n
\n \n {showQty &&
{prop.quantity}
}\n
\n );\n })}\n
\n );\n};\n\nexport const DefaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: `w=108&h=108&q=80&m=6&f=jpg\"`, w: 108, h: 108 },\n lg: { q: `w=108&h=108&q=80&m=6&f=jpg`, w: 108, h: 108 },\n xl: { q: `w=108&h=108&q=80&m=6&f=jpg`, w: 108, h: 108 }\n },\n lazyload: true,\n quality: 80\n};","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport classname from 'classnames';\nimport { action, computed, observable, when } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\nimport {\n ArrayExtensions, getFallbackImageUrl, getSimpleProducts, ObjectExtensions, ProductInput\n} from '@msdyn365-commerce-modules/retail-actions';\nimport {\n format, IModuleProps, isNullOrWhiteSpace, Waiting\n} from '@msdyn365-commerce-modules/utilities';\nimport { ICheckoutState } from '@msdyn365-commerce/global-state';\nimport {\n getEstimatedPickupTimeslotAvailabilitiesAsync\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\nimport {\n CartLine, LineDeliverySpecification, OrgUnitLocation, PickupTimeslotAvailability, PickupTimeslotAvailabilitySearchCriteria,\n ProductDeliveryOptions, SimpleProduct\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\n\nimport { ICheckoutPickupData } from './checkout-pickup.data';\nimport { ICheckoutPickupProps } from './checkout-pickup.props.autogenerated';\nimport {\n CheckoutPickupDateDropdown, CheckoutPickupTimeslotDropdown, getDate, getTimeslot,\n getUTCDateWithoutTime\n} from './components';\nimport {\n CheckoutPickupAddress, CheckoutPickupCartLines, CheckoutPickupError, CheckoutPickupGroupHeader,\n CheckoutPickupTimeslotInfo, DefaultImageSettings, ICheckoutPickupAddressProps,\n ICheckoutPickupCartLineInfo, ICheckoutPickupCartLinesProps, ICheckoutPickupGroup,\n ICheckoutPickupGroupHeaderProps, ICheckoutPickupGroupViewProps, ICheckoutPickupTimeslotInfoProps\n} from './components/checkout-pickup-group';\n\nexport interface ICheckoutPickupModuleProps extends ICheckoutPickupProps, IModuleStateProps { }\n\nexport interface ICheckoutPickupState {\n pickupGroups: ICheckoutPickupGroup[];\n}\n\nexport interface ICheckoutPickupViewState {\n isLoading: boolean;\n isHeaderError: boolean;\n isShowDropdown: boolean;\n isShowSelected: boolean;\n}\n\nexport interface ICheckoutPickupViewProps extends ICheckoutPickupProps<{}> {\n checkoutPickup: IModuleProps;\n viewState: ICheckoutPickupViewState;\n headerError: React.ReactNode;\n waiting: React.ReactNode;\n pickupGroups: ICheckoutPickupGroupViewProps[];\n}\n\n/**\n *\n * CheckoutPickup component\n * @extends {React.Component}\n */\n// @ts-ignore\n@withModuleState\n@observer\nclass CheckoutPickup extends React.Component {\n @observable private isLoading: boolean = false;\n @observable private headerErrorMessage?: string;\n\n @computed get isDataReady(): boolean {\n return (this.props.data.checkout.result && this.props.data.checkout.status) === 'SUCCESS'\n && (this.props.data.orgUnitLocations.result && this.props.data.orgUnitLocations.status) === 'SUCCESS';\n }\n\n constructor(props: ICheckoutPickupModuleProps) {\n super(props);\n this.state = { pickupGroups: [] };\n\n this.setDateHandler = this.setDateHandler.bind(this);\n this.setTimeslotHandler = this.setTimeslotHandler.bind(this);\n }\n\n public componentDidMount(): void {\n when(\n () => this.isDataReady,\n async () => {\n await this.initPickupGroup();\n this.initModuleState();\n }\n );\n }\n\n // tslint:disable-next-line:max-func-body-length\n public render(): JSX.Element | null {\n if (!this.isDataReady || !this.canPickup()) {\n return null;\n }\n\n const { resources, config, context } = this.props;\n\n const {\n pickupDateLabel,\n pickupTimeslotLabel,\n pickupDateDefaultText,\n pickupTimeslotDefaultText,\n itemsText,\n singleItemText,\n pickupDateTimeslotText,\n pickupTimeslotPlaceHolder,\n pickupLocationLabel\n } = resources;\n\n const { locale } = context.request;\n const { className, imageSettings } = config;\n const defaultClassName = 'ms-checkout-pickup';\n const groupsViewProps: ICheckoutPickupGroupViewProps[] = [];\n\n // tslint:disable-next-line:max-func-body-length\n this.state.pickupGroups.forEach((value, index) => {\n // divider line for each pickup group\n const groupDivider: React.ReactNode = index !== 0 && (\n
\n );\n\n // heading for each group\n const itemText = value.lineDeliverySpecs.length > 1 ? itemsText : singleItemText;\n const headerProps: ICheckoutPickupGroupHeaderProps = {\n moduleClassName: defaultClassName,\n storeInfo: `${value.pickupModeName}, ${value.storeName}`,\n items: `(${format(itemText, value.lineDeliverySpecs.length)})`\n };\n const groupHeader: React.ReactNode = ;\n\n // line images\n const cartlines: ICheckoutPickupCartLineInfo[] = value.cartLines.filter(x => !ObjectExtensions.isNullOrUndefined(x.product)).map(line =>\n ({\n lineId: line.cartLine.LineId || '',\n imageProps: {\n className: `${defaultClassName}__group-line-image`,\n altText: line.product?.Name,\n src: line.product?.PrimaryImageUrl || '',\n fallBackSrc: getFallbackImageUrl(line.product?.ItemId, context.actionContext.requestContext.apiSettings),\n gridSettings: context.request.gridSettings!,\n imageSettings: imageSettings || DefaultImageSettings,\n loadFailureBehavior: 'empty'\n },\n quantity: line.cartLine.Quantity || 0\n })\n );\n const lineImageProps: ICheckoutPickupCartLinesProps = {\n moduleClassName: defaultClassName,\n cartLines: cartlines.filter(x => !ObjectExtensions.isNullOrUndefined(x))\n };\n const cartLineImages: React.ReactNode = ;\n\n // selected pickup date and timeslot node\n const dateString = getDate(value.selectedDate, locale);\n const timeslotString = getTimeslot(pickupTimeslotPlaceHolder, value.selectedTimeslot?.StartDateTime, value.selectedTimeslot?.EndDateTime, locale);\n const timeslotInfoProps: ICheckoutPickupTimeslotInfoProps = {\n moduleClassName: defaultClassName,\n title: pickupDateTimeslotText,\n content: `${dateString} ${timeslotString}`\n };\n const selectedDateTimeslotNode: React.ReactNode = ;\n\n // pickup address\n const addressProps: ICheckoutPickupAddressProps = {\n moduleClassName: defaultClassName,\n title: pickupLocationLabel,\n address: value.pickupAddress\n };\n const pickupAddress: React.ReactNode = ;\n\n // pickup date and timeslot dropdown list\n const dropdownClassName = `${defaultClassName}__group-datetime-dropdown`;\n const labelClassName = `${dropdownClassName}-label`;\n const dropdownSelectClassName = `${dropdownClassName}-select`;\n const dateDropdownNode: React.ReactNode = (\n
\n \n
\n );\n\n const timeslotDropdownNode: React.ReactNode = (\n
\n \n
\n );\n\n const viewProp: ICheckoutPickupGroupViewProps = {\n moduleProps: { ...this.props },\n pickupGroupContainer: { className: `${defaultClassName}__group` },\n dateTimeslotContainer: { className: `${defaultClassName}__group-datetime` },\n pickupStoreId: value.pickupStoreId,\n pickupModeName: value.pickupModeName,\n deliveryMode: value.deliveryMode,\n groupDivider: groupDivider,\n groupHeader: groupHeader,\n cartLineImages: cartLineImages,\n groupErrorMessage: ,\n pickupDateDropdown: dateDropdownNode,\n pickupTimeslotDropdown: timeslotDropdownNode,\n selectedDateTimeslot: selectedDateTimeslotNode,\n pickupAddress: pickupAddress\n };\n\n groupsViewProps.push(viewProp);\n });\n\n const {\n moduleState: { isReady, hasError }\n } = this.props;\n const isHeaderError = !this.isLoading && this.headerErrorMessage !== undefined;\n const isShowDropdown = !this.isLoading && !isReady;\n const isShowSelected = !this.isLoading && !hasError && isReady;\n\n const viewProps: ICheckoutPickupViewProps = {\n ...this.props,\n checkoutPickup: {\n moduleProps: this.props,\n className: classname(defaultClassName, className),\n },\n viewState: {\n isLoading: this.isLoading,\n isHeaderError: isHeaderError,\n isShowSelected: isShowSelected,\n isShowDropdown: isShowDropdown\n },\n headerError: ,\n waiting: ,\n pickupGroups: groupsViewProps\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n @action\n public async setDateHandler(pickupStoreId: string, deliveryMode: string, pickupDate: Date | undefined): Promise {\n const oldGroup = this.state.pickupGroups.find(group => group.pickupStoreId === pickupStoreId && group.deliveryMode === deliveryMode);\n if (!oldGroup) {\n return;\n }\n\n const newGroup: ICheckoutPickupGroup = { ...oldGroup };\n newGroup.selectedDate = pickupDate;\n newGroup.selectedTimeslot = undefined; // clear the selected timeslot in any case\n newGroup.lineDeliverySpecs.forEach((lineSpec: LineDeliverySpecification) => {\n if (lineSpec.DeliverySpecification) {\n lineSpec.DeliverySpecification.PickupTimeslotStartDateTime = undefined;\n lineSpec.DeliverySpecification.PickupTimeslotEndDateTime = undefined;\n }\n });\n\n if (pickupDate) { // date is set\n const searchCriteria: PickupTimeslotAvailabilitySearchCriteria = {\n DeliveryModeCode: newGroup.deliveryMode,\n StoreId: newGroup.pickupStoreId,\n StartDate: pickupDate,\n EndDate: pickupDate,\n SearchOptionValue: 2 // test runtime does not recognize PickupTimeslotAvailabilitySearchOption.All\n };\n const timeslotResults: PickupTimeslotAvailability[] = await getEstimatedPickupTimeslotAvailabilitiesAsync(\n { callerContext: this.props.context.actionContext, queryResultSettings: {}, bypassCache: 'get' }, searchCriteria);\n\n newGroup.availableTimeslots = timeslotResults.filter(value => (value.AvailableCapacity || 0) > 0);\n newGroup.groupErrorMessage = newGroup.availableTimeslots.length === 0 ? this.props.resources.noAvailableTimeslotError : undefined;\n } else { // date is not set\n newGroup.availableTimeslots = [];\n newGroup.groupErrorMessage = undefined;\n }\n\n const groups = this.state.pickupGroups.map(group => {\n if (group.pickupStoreId === pickupStoreId && group.deliveryMode === deliveryMode) {\n return newGroup;\n } else {\n return group;\n }\n });\n\n this.setState({ pickupGroups: groups });\n }\n\n @action\n public setTimeslotHandler(pickupStoreId: string, deliveryMode: string, pickupTimeslot: PickupTimeslotAvailability | undefined): void {\n const oldGroup = this.state.pickupGroups.find(group => group.pickupStoreId === pickupStoreId && group.deliveryMode === deliveryMode);\n if (!oldGroup) {\n return;\n }\n\n const newGroup: ICheckoutPickupGroup = { ...oldGroup };\n\n newGroup.selectedTimeslot = pickupTimeslot;\n newGroup.lineDeliverySpecs.forEach((lineSpec: LineDeliverySpecification) => {\n if (lineSpec.DeliverySpecification) {\n lineSpec.DeliverySpecification.PickupTimeslotStartDateTime = pickupTimeslot?.StartDateTime;\n lineSpec.DeliverySpecification.PickupTimeslotEndDateTime = pickupTimeslot?.EndDateTime;\n }\n });\n\n const groups = this.state.pickupGroups.map(group => {\n if (group.pickupStoreId === pickupStoreId && group.deliveryMode === deliveryMode) {\n return newGroup;\n } else {\n return group;\n }\n });\n\n this.setState({ pickupGroups: groups });\n }\n\n @action\n private initModuleState = (): void => {\n this.props.moduleState.init({\n onEdit: this.onEdit,\n onSubmit: this.onSubmit,\n status: this.canPickup() ? (this.isPickupTimeSlotSet() ? 'ready' : 'updating') : 'disabled'\n });\n }\n\n private onEdit = (): void => {\n this.props.moduleState.onUpdating();\n }\n\n private onReady = (): void => {\n this.props.moduleState.onReady();\n };\n\n private onPending = (): void => {\n this.props.moduleState.onPending();\n }\n\n private onSubmit = async (): Promise => {\n await this.updateCartLinePickupDateTimeslot();\n }\n\n private setError = (errorMessage: string, isHeaderError: boolean = true): void => {\n this.props.telemetry.error(errorMessage);\n this.props.moduleState.setHasError(true);\n this.props.moduleState.onUpdating();\n if (isHeaderError) { this.headerErrorMessage = errorMessage; }\n };\n\n private clearError = (): void => {\n this.props.moduleState.setHasError(false);\n this.headerErrorMessage = undefined;\n };\n\n @action\n private initPickupGroup = async (): Promise => {\n const pickupCartLines: CartLine[] = this.getCartLinesforPickup();\n let products: SimpleProduct[] = [];\n try {\n products = await this.getProductsByCartLines(this.props.data.checkout.result?.checkoutCart.cart.ChannelId || 0, pickupCartLines);\n } catch (error) {\n this.props.telemetry.error(error);\n }\n const pickupGroups: ICheckoutPickupGroup[] = [];\n const locations: OrgUnitLocation[] = this.props.data.orgUnitLocations.result || [];\n this.isLoading = true;\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n const { featureState, deliveryOptions } = this.props?.data;\n const retailMultiplePickUpOptionEnabled = featureState?.result?.find(feature => feature.Name === multiplePickupStoreSwitchName)?.IsEnabled;\n\n for (let index = 0; index < pickupCartLines.length; index++) {\n const line = pickupCartLines[index];\n const group: ICheckoutPickupGroup | undefined = pickupGroups.find(x => x.pickupStoreId === line.FulfillmentStoreId && x.deliveryMode === line.DeliveryMode);\n const product: SimpleProduct | undefined = products.find(x => x.RecordId === line.ProductId);\n const lineDeliverySpecification: LineDeliverySpecification = {\n LineId: line.LineId,\n DeliverySpecification: {\n DeliveryModeId: line.DeliveryMode,\n DeliveryPreferenceTypeValue: 2,\n PickUpStoreId: line.FulfillmentStoreId,\n PickupTimeslotStartDateTime: line.PickupTimeslotStartDateTime,\n PickupTimeslotEndDateTime: line.PickupTimeslotEndDateTime,\n DeliveryAddress: line.ShippingAddress\n }\n };\n if (group) {\n group.lineDeliverySpecs.push(lineDeliverySpecification);\n group.cartLines.push({ cartLine: line, product: product });\n } else { // group not exists yet\n const location: OrgUnitLocation | undefined = locations.find(x => x.OrgUnitNumber === line.FulfillmentStoreId);\n const storeName: string = this.getStoreName(location, line);\n const selectedDate: Date | undefined = line.PickupTimeslotStartDateTime && getUTCDateWithoutTime(line.PickupTimeslotStartDateTime);\n const newGroup: ICheckoutPickupGroup = {\n pickupModeName: retailMultiplePickUpOptionEnabled? this.getPickupModeDescription(this.props.resources.generalPickupText, line.DeliveryMode, deliveryOptions?.result, product) : this.props.resources.generalPickupText,\n pickupStoreId: line.FulfillmentStoreId || '',\n deliveryMode: line.DeliveryMode || '',\n storeName: storeName,\n pickupAddress: line.ShippingAddress,\n lineDeliverySpecs: [lineDeliverySpecification],\n cartLines: [{ cartLine: line, product: product }],\n availableDates: [],\n availableTimeslots: [],\n selectedDate: selectedDate,\n selectedTimeslot: { StartDateTime: line.PickupTimeslotStartDateTime, EndDateTime: line.PickupTimeslotEndDateTime },\n };\n\n let dailyGroupingResults: PickupTimeslotAvailability[] = [];\n try {\n const searchCriteria: PickupTimeslotAvailabilitySearchCriteria = {\n DeliveryModeCode: newGroup.deliveryMode,\n StoreId: newGroup.pickupStoreId,\n SearchOptionValue: 1 // test runtime does not recognize PickupTimeslotAvailabilitySearchOption.DailyGroupingTimeslotOnly\n };\n dailyGroupingResults = await getEstimatedPickupTimeslotAvailabilitiesAsync({ callerContext: this.props.context.actionContext, queryResultSettings: {} }, searchCriteria);\n } catch (error) {\n this.props.telemetry.error(error);\n }\n dailyGroupingResults.forEach(value => {\n if (value.StartDateTime) {\n newGroup.availableDates.push(getUTCDateWithoutTime(value.StartDateTime));\n }\n });\n\n if (selectedDate) {\n let timeslotResults: PickupTimeslotAvailability[] = [];\n try {\n const searchCriteria: PickupTimeslotAvailabilitySearchCriteria = {\n DeliveryModeCode: newGroup.deliveryMode,\n StoreId: newGroup.pickupStoreId,\n StartDate: selectedDate,\n EndDate: selectedDate,\n SearchOptionValue: 2 // test runtime does not recognize PickupTimeslotAvailabilitySearchOption.All\n };\n timeslotResults = await getEstimatedPickupTimeslotAvailabilitiesAsync(\n { callerContext: this.props.context.actionContext, queryResultSettings: {}, bypassCache: 'get' },\n searchCriteria);\n } catch (error) {\n this.props.telemetry.error(error);\n }\n newGroup.availableTimeslots = timeslotResults.filter(value => (value.AvailableCapacity || 0) > 0);\n }\n pickupGroups.push(newGroup);\n }\n }\n\n const filteredPickupGroups = pickupGroups.filter(group => group.availableDates.length > 0);\n\n if (filteredPickupGroups.length === 0) {\n this.props.context.telemetry.error('Data is not ready or pickup group is empty, module wont render.');\n }\n this.isLoading = false;\n this.setState({ pickupGroups: filteredPickupGroups });\n }\n\n @action\n private updateCartLinePickupDateTimeslot = async (): Promise => {\n if (!this.validateTimeslot()) {\n return;\n }\n const { resources } = this.props;\n let lineSpecs: LineDeliverySpecification[] = [];\n\n this.state.pickupGroups.forEach(group => {\n lineSpecs = lineSpecs.concat(group.lineDeliverySpecs);\n });\n\n this.clearError();\n this.onPending();\n\n try {\n const checkoutState = this.props.data.checkout.result as ICheckoutState;\n const response = await checkoutState.checkoutCart.updateCartLinePickupDateTimeslot({ lineDeliverySpecifications: lineSpecs });\n\n if (response.status === 'FAILED') {\n this.setError(resources.genericErrorMessage);\n } else {\n this.onReady();\n this.props.moduleState.setIsCancellable(true);\n }\n } catch {\n this.setError(resources.genericErrorMessage);\n }\n }\n\n private getProductsByCartLines = async (channelId: number, cartLines: CartLine[]): Promise => {\n const actionContext = this.props.context.actionContext;\n const productInputs = cartLines.filter(line => !ObjectExtensions.isNullOrUndefined(line.ProductId)).map(line => new ProductInput(line.ProductId || 0, actionContext.requestContext.apiSettings, channelId));\n return getSimpleProducts(productInputs, actionContext);\n }\n\n private validateTimeslot = (): boolean => {\n let validated = true;\n this.state.pickupGroups.forEach(group => {\n // if no available date to choose, we consider this as fallback case, i.e., timeslot not defined.\n if (group.availableDates.length > 0 && (!group.selectedDate || !group.selectedTimeslot)) {\n group.groupErrorMessage = this.props.resources.pickupDateTimeslotRequired;\n this.setError(group.groupErrorMessage, false);\n validated = false;\n } else {\n group.groupErrorMessage = undefined;\n }\n });\n return validated;\n }\n\n private getStoreName = (orgUnitLocation: OrgUnitLocation | undefined, cartLine: CartLine): string => {\n return orgUnitLocation?.OrgUnitName || cartLine.ShippingAddress?.Name || cartLine.FulfillmentStoreId || '';\n };\n\n private canPickup = (): boolean => {\n return ArrayExtensions.hasElements(this.state.pickupGroups);\n }\n\n private isPickupTimeSlotSet = (): boolean => {\n return ArrayExtensions.hasElements(this.state.pickupGroups) &&\n this.state.pickupGroups.every(group => !ObjectExtensions.isNullOrUndefined(group.selectedTimeslot?.StartDateTime) && !ObjectExtensions.isNullOrUndefined(group.selectedTimeslot?.EndDateTime));\n }\n\n private getCartLinesforPickup = (): CartLine[] => {\n return this.props.data.checkout.result?.checkoutCart.cart.CartLines?.filter(line => this.isPickupLine(line)) || [];\n }\n\n private isPickupMode = (deliveryMode: string | undefined): boolean => {\n const pickupDeliveryModeCode = this.props.context.request.channel?.PickupDeliveryModeCode;\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n const { channelDeliveryOptionConfig, featureState } = this.props?.data;\n const retailMultiplePickUpOptionEnabled = featureState?.result?.find(feature => feature.Name === multiplePickupStoreSwitchName)?.IsEnabled;\n if (retailMultiplePickUpOptionEnabled && deliveryMode !== undefined) {\n const pickupDeliveryMode = channelDeliveryOptionConfig?.result?.PickupDeliveryModeCodes?.some(pickupMode => pickupMode === deliveryMode);\n return pickupDeliveryMode !== undefined ? pickupDeliveryMode : false;\n }\n return deliveryMode !== undefined && pickupDeliveryModeCode !== undefined && (deliveryMode === pickupDeliveryModeCode);\n }\n\n private isPickupLine = (line: CartLine): boolean => {\n return this.isPickupMode(line.DeliveryMode) && line.FulfillmentStoreId !== undefined && !isNullOrWhiteSpace(line.FulfillmentStoreId);\n }\n\n private getPickupModeDescription = (resourceString: string, deliveryMode?: string, deliveryOptions?: ProductDeliveryOptions[], product?: SimpleProduct): string => {\n let deliveryOption: string = resourceString;\n if(ArrayExtensions.hasElements(deliveryOptions) && product !== undefined) {\n let foundProductDeliveryOption;\n foundProductDeliveryOption = deliveryOptions?.find((deliveryO) => {\n return deliveryO && deliveryO.ProductId === product.RecordId;\n });\n const deliveryDesc = foundProductDeliveryOption?.DeliveryOptions ? foundProductDeliveryOption?.DeliveryOptions?.find(option => option.Code === deliveryMode)?.Description: resourceString;\n if(deliveryDesc !== undefined) {\n deliveryOption = deliveryDesc;\n }\n }\n return deliveryOption;\n };\n\n}\n\nexport default CheckoutPickup;","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport { ICheckoutSectionContainerItem, ICheckoutSectionContainerViewProps } from './smwe-checkout-section-container';\r\n\r\nconst ItemComponent: React.FC = ({ loading, itemProps, item }) => (\r\n <>\r\n {loading}\r\n {item}\r\n \r\n);\r\n\r\nconst CheckoutSectionContainerView: React.FC = ({ checkoutPlainContainerProps, items }) => (\r\n \r\n {items.map(item => (\r\n \r\n ))}\r\n \r\n);\r\n\r\nexport default CheckoutSectionContainerView;\r\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { CacheType, IActionContext, IActionInput } from '@msdyn365-commerce/core';\nimport { IModuleStates } from './module-state.data';\n\n/**\n * GetModulesInput\n */\nexport class ModuleStatesCacheKey implements IActionInput {\n public getCacheKey = () => 'ModuleState';\n public getCacheObjectType = () => 'ModuleState';\n public dataCacheType = (): CacheType => 'none';\n}\n\nexport function getModuleStates(ctx: IActionContext): IModuleStates {\n const cacheKey = new ModuleStatesCacheKey();\n\n // @ts-ignore\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. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IModule } from '@msdyn365-commerce/core';\nimport isMatch from 'lodash/isMatch';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\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 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 render(): JSX.Element | null {\n const { id } = this.props;\n return ;\n }\n\n private 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 */\n private 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 => this.update(id, { isRequired: value }),\n setIsCancellable: (value: boolean): void => this.update(id, { isCancellable: value }),\n setIsSubmitContainer: (value: boolean): void => this.update(id, { isSubmitContainer: value }),\n setHasError: (value: boolean): void => this.update(id, { hasError: value }),\n onReady: (): void => this.update(id, { status: 'ready' }),\n onUpdating: (): void => this.update(id, { status: 'updating' }),\n onPending: (): void => this.update(id, { status: 'pending' }),\n onSkip: (): void => this.update(id, { status: 'skipped' }),\n onDisable: (): void => this.update(id, { status: 'disabled' }),\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 */\n private 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 get = (): IModuleStates => {\n return getModuleStates(this.props.context.actionContext);\n };\n\n /**\n * Update\n * Update module state\n */\n private 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 _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 _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) {\n return this._validateLeaf(id, source);\n }\n\n // It is container module\n const method = allMatched ? 'every' : 'some';\n return module.childIds[method](childId => this._validateContainer(childId, source, allMatched, skipSkippableItem));\n };\n\n /**\n * Validate\n * Validate current module and all its child module match the provided condition\n */\n private validate = (id: string, source: Partial, allMatched?: boolean, skipSkippableItem?: boolean): 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) {\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 hasExternalSubmitGroup = (): boolean => {\n return !!this.props.enableControl;\n };\n\n /**\n * hasModuleState\n * Module is using module state manager\n */\n private 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 * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\nimport { IAddContactInfo, ICheckoutGuestProfileViewProps, IShowContactInfo } from './checkout-guest-profile';\n\nexport const ShowContactInfo: React.FC = ({ showInfoProps, email, editButton }) => (\n \n {email}\n {editButton}\n \n);\n\nexport const AddContactInfo: React.FC = ({\n addFormProps,\n submitButton,\n cancelButton,\n inputGroupProps,\n label,\n error,\n input\n}) => (\n \n \n {label}\n {error}\n {input}\n \n {submitButton}\n {cancelButton}\n \n);\n\nconst CheckoutGuestProfileView: React.FC = ({ moduleProps, showContactInfo, addContactInfo }) => {\n return (\n \n {showContactInfo && }\n {addContactInfo && }\n \n );\n};\n\nexport default CheckoutGuestProfileView;\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\nimport { ICheckoutSectionContainerItem, ICheckoutSectionContainerViewProps } from './checkout-section-container';\n\nconst ItemComponent: React.FC = ({ loading, itemProps, item }) => (\n <>\n {loading}\n {item}\n \n);\n\nconst CheckoutSectionContainerView: React.FC = ({ checkoutPlainContainerProps, items }) => (\n \n {items.map(item => (\n \n ))}\n \n);\n\nexport default CheckoutSectionContainerView;\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Button,INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nexport interface IAddContactInfoInput {\n inputRef?: React.RefObject;\n hasError: boolean;\n email: string;\n resources: {\n emailLabel: string;\n emailErrortext: string;\n saveBtnLabel: string;\n cancelBtnLabel: string;\n };\n canSubmit: boolean;\n canCancel: boolean;\n onChange(email: string): void;\n onSubmit(): void;\n onCancel(): void;\n}\n\nexport interface IAddContactInfo {\n addFormProps: INodeProps;\n submitButton: React.ReactNode;\n cancelButton: React.ReactNode;\n inputGroupProps: INodeProps;\n label: React.ReactNode;\n error: React.ReactNode;\n input: React.ReactNode;\n}\n\nconst getAddContactInfo = ({\n hasError,\n inputRef,\n email,\n canSubmit,\n canCancel,\n onChange,\n onSubmit,\n onCancel,\n resources: { emailLabel, emailErrortext, saveBtnLabel, cancelBtnLabel }\n}: IAddContactInfoInput): IAddContactInfo => {\n const onInputChange = (e: React.ChangeEvent): void => {\n onChange(e.target.value || '');\n };\n\n return {\n addFormProps: { className: 'ms-checkout-guest-profile__add-contact-info' },\n submitButton: canSubmit && (\n \n {saveBtnLabel}\n \n ),\n cancelButton: canCancel && (\n \n {cancelBtnLabel}\n \n ),\n inputGroupProps: { className: classnames('ms-checkout-guest-profile__input', { 'is-invalid': hasError }) },\n label: (\n \n ),\n error: hasError && (\n \n {emailErrortext}\n \n ),\n input: (\n \n )\n };\n};\n\nexport default getAddContactInfo;\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as React from 'react';\n\nimport { Button, INodeProps } from '@msdyn365-commerce-modules/utilities';\n\nexport interface IShowContactInfoInput {\n canEdit: boolean;\n email: string;\n resources: {\n editBtnLabel: string;\n };\n onEdit(): void;\n}\n\nexport interface IShowContactInfo {\n showInfoProps: INodeProps;\n email: React.ReactNode;\n editButton?: React.ReactNode;\n}\n\nconst getContactInfo = ({ canEdit, email, resources: { editBtnLabel }, onEdit }: IShowContactInfoInput): IShowContactInfo => ({\n showInfoProps: { className: 'ms-checkout-guest-profile__selected-item' },\n email: {email},\n editButton: canEdit && (\n \n )\n});\n\nexport default getContactInfo;\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { computed, when } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\nimport { ICheckoutGuestProfileData } from './checkout-guest-profile.data';\nimport { ICheckoutGuestProfileProps } from './checkout-guest-profile.props.autogenerated';\nimport getAddContactInfo, { IAddContactInfo } from './components/get-add-contact-info';\nimport getShowContactInfo, { IShowContactInfo } from './components/get-show-contact-info';\n\nexport * from './components/get-add-contact-info';\nexport * from './components/get-show-contact-info';\n\ninterface ICheckoutGuestProfileState {\n email: string;\n}\n\nexport interface ICheckoutGuestProfileModuleProps extends ICheckoutGuestProfileProps, IModuleStateProps { }\n\nexport interface ICheckoutGuestProfileViewProps extends ICheckoutGuestProfileProps, ICheckoutGuestProfileState {\n moduleProps: IModuleProps;\n showContactInfo?: IShowContactInfo;\n addContactInfo?: IAddContactInfo;\n\n onChange?(email: string): void;\n onEdit?(): void;\n onSubmit?(): void;\n onCancel?(): void;\n}\n\n/**\n *\n * CheckoutGuestProfile component\n * @extends {React.PureComponent, ICheckoutGuestProfileState>}\n */\n// @ts-ignore\n@withModuleState\n@observer\nclass CheckoutGuestProfile extends React.Component {\n public state: ICheckoutGuestProfileState = {\n email:\n (this.props.context &&\n this.props.context.request &&\n this.props.context.request.user &&\n this.props.context.request.user.isAuthenticated &&\n this.props.context.request.user.emailAddress) ||\n ''\n };\n\n private inputRef: React.RefObject = React.createRef();\n\n @computed get isDataReady(): boolean {\n return (this.props.data.checkout.result && this.props.data.checkout.status) === 'SUCCESS';\n }\n\n public componentDidMount(): void {\n // @ts-ignore: Compiler not reconizing condition check for function params\n when(\n () => this.isDataReady,\n async () => {\n await this.init();\n }\n );\n }\n\n public render(): JSX.Element {\n const {\n config: { className },\n resources,\n moduleState: { isReady, hasError, hasExternalSubmitGroup }\n } = this.props;\n const email = (this.props.data.checkout.result && this.props.data.checkout.result.guestCheckoutEmail) || '';\n\n const viewProps: ICheckoutGuestProfileViewProps = {\n ...this.props,\n ...this.state,\n onChange: this.onChange,\n onEdit: this.onEdit,\n onCancel: this.onCancel,\n onSubmit: this.onSubmit,\n\n moduleProps: {\n moduleProps: this.props,\n className: classnames('ms-checkout-guest-profile', className, isReady ? 'show' : 'add')\n },\n showContactInfo: isReady\n ? getShowContactInfo({\n canEdit: !hasExternalSubmitGroup,\n email,\n resources,\n onEdit: this.onEdit\n })\n : undefined,\n addContactInfo: !isReady\n ? getAddContactInfo({\n email: this.state.email,\n hasError,\n resources,\n inputRef: this.inputRef,\n onChange: this.onChange,\n canSubmit: !hasExternalSubmitGroup,\n onSubmit: this.onSubmit,\n canCancel: !hasExternalSubmitGroup && !!email,\n onCancel: this.onCancel\n })\n : undefined\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private init = async (): Promise => {\n const hasInvoiceLine = this.props.data.checkout.result?.checkoutCart.hasInvoiceLine;\n\n const emailOnCart = this.props.data.checkout.result?.checkoutCart.cart.ReceiptEmail;\n const email = hasInvoiceLine ? (this.props.context.request.user.emailAddress || '') : (emailOnCart || this.state.email);\n\n if (email) {\n await this.updateGuestProfile(email);\n }\n\n const isEmailValid = this.isEmailValid(email);\n this.props.moduleState.init({\n onEdit: this.onEdit,\n onCancel: this.onCancel,\n onSubmit: this.onSubmit,\n status: hasInvoiceLine ? 'disabled' : (email && isEmailValid ? 'ready' : 'updating'),\n hasError: !!email && !isEmailValid\n });\n };\n\n private onChange = (rowEmail: string): void => {\n const email = (rowEmail || '').replace(new RegExp('[<>]', 'gi'), '');\n this.setState({ email });\n if (this.props.moduleState.hasError) {\n // Clear error during user updating the email\n this.props.moduleState.setHasError(false);\n }\n };\n\n private isEmailValid = (email: string): boolean => {\n const regex = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n return regex.test(email);\n };\n\n private updateGuestProfile = async (newGuestCheckoutEmail: string): Promise => {\n if (this.props.data.checkout.result) {\n await this.props.data.checkout.result.updateGuestCheckoutEmail({ newGuestCheckoutEmail });\n this.setState({ email: newGuestCheckoutEmail });\n }\n };\n\n private onEdit = (): void => {\n this.props.moduleState.onUpdating();\n };\n\n private onSubmit = async (): Promise => {\n const { email } = this.state;\n const isValid = this.isEmailValid(email);\n if (!isValid) {\n this.props.moduleState.setHasError(true);\n // Get error, focus back on the input field\n const input = this.inputRef && this.inputRef.current && this.inputRef.current.focus && (this.inputRef.current as HTMLElement);\n input && input.focus();\n } else {\n this.props.moduleState.onReady();\n await this.updateGuestProfile(email);\n }\n };\n\n private onCancel = (): void => {\n // Reset to the saved value\n if (!this.props.data.checkout.result) {\n return;\n }\n\n const email = this.props.data.checkout.result.guestCheckoutEmail;\n if (!email) {\n // It has no saved email, set to status updating and request user to fill the email form\n this.props.moduleState.onUpdating();\n return;\n } else {\n // It has saved email, set to status ready\n this.setState({\n email\n });\n this.props.moduleState.setHasError(false);\n this.props.moduleState.onReady();\n }\n };\n}\n\nexport default CheckoutGuestProfile;","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as React from 'react';\n\nconst Loading: React.FC = () =>

;\n\nexport default Loading;\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IModuleStateManager, IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\nimport { IModuleProps, INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport classname from 'classnames';\nimport get from 'lodash/get';\nimport { reaction } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\nimport { ICheckoutSectionContainerProps } from './checkout-section-container.props.autogenerated';\nimport LoadingComponent from './components/loading';\n\nexport interface ICheckoutSectionContainerModuleProps extends ICheckoutSectionContainerProps<{}>, IModuleStateProps {\n enableControl: boolean;\n}\n\nexport interface ICheckoutSectionContainerItem {\n id: string;\n loading?: React.ReactNode;\n itemProps: INodeProps;\n item: React.ReactNode;\n}\n\nexport interface ICheckoutSectionContainerViewProps extends ICheckoutSectionContainerProps<{}> {\n className: string;\n checkoutPlainContainerProps: IModuleProps;\n items: ICheckoutSectionContainerItem[];\n}\n\n/**\n *\n * CheckoutPlainContainer component\n * @extends {React.Component}\n */\n@observer\nexport class CheckoutPlainContainer extends React.Component {\n public componentDidMount(): void {\n const items = this.getItems();\n const childIds = items.map((item: React.ReactNode) => get(item, 'props.id'));\n this.props.moduleState.init({\n onEdit: this.onEdit,\n onCancel: this.onCancel,\n onSubmit: this.onSubmit,\n childIds\n });\n\n reaction(\n () => this.props.moduleState.isReady,\n () => {\n this.onContainerReady();\n }\n );\n\n reaction(\n () => this.props.moduleState.shouldSubmitContainer,\n () => {\n this.onSubmit();\n }\n );\n }\n\n public componentDidUpdate(): void {\n if (!this.props.moduleState.hasExternalSubmitGroup) {\n return;\n }\n /**\n * Review all modules to updating status if one of the modules has error\n */\n const { childIds, hasError, getModule } = this.props.moduleState;\n const hasReadyItems = childIds.some((childId: string) => {\n const state = getModule(childId);\n return !!state && state.isReady;\n });\n if (hasReadyItems && hasError) {\n this.onEdit();\n }\n }\n\n public render(): JSX.Element | null {\n const {\n enableControl,\n moduleState,\n config: { width }\n } = this.props;\n\n const items = this.getItems();\n if (!items.length) {\n this.props.context.telemetry.error('Checkout section content is empty, module wont render');\n return null;\n }\n\n const moduleClassName = classname(\n 'ms-checkout-section-container',\n {\n 'has-initialized': moduleState.hasInitialized,\n 'is-ready': moduleState.isReady,\n 'is-updating': !moduleState.isReady,\n container: width === 'container',\n 'col-12 fullwidth': width === 'fluid'\n },\n this.props.config.className\n );\n\n const viewProps: ICheckoutSectionContainerViewProps = {\n ...this.props,\n\n className: moduleClassName,\n checkoutPlainContainerProps: {\n moduleProps: this.props,\n className: moduleClassName\n },\n items: items.map((item: React.ReactNode) => {\n const childId = get(item, 'props.id');\n const state = moduleState.getModule(childId);\n // Modules has not completed initializing or it's disable\n const hidden = state.hasModuleState && (!state.hasInitialized || state.isDisabled || state.isSkipped);\n return {\n id: childId,\n loading: state.hasModuleState && !state.hasInitialized && ,\n itemProps: {\n 'data-type-name': state.typeName,\n className: classname('ms-checkout-section-container__item', {\n hidden: hidden,\n initialized: state.hasInitialized,\n disabled: state.isDisabled,\n skipped: state.isSkipped,\n ready: state.isReady,\n updating: state.isUpdating,\n pending: state.isPending\n })\n },\n item: React.cloneElement(item as React.ReactElement, { enableControl })\n };\n })\n };\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private getItems = (): React.ReactNode[] => {\n const { slots } = this.props;\n return (slots && slots.primary && slots.primary.length && slots.primary) || [];\n };\n\n private getActiveChildModuleStates = (): IModuleStateManager[] => {\n const { childIds, getModule } = this.props.moduleState;\n return childIds\n .map(getModule)\n .filter((state): state is IModuleStateManager => !!state && !state.isDisabled && state.hasModuleState);\n };\n\n private clearError = (): void => {\n // Clear error before action, otherwise it will rise conflict;\n this.getActiveChildModuleStates().forEach(state => {\n state.hasError && state.setHasError(false);\n });\n };\n\n private onSubmit = (): void => {\n this.clearError();\n this.getActiveChildModuleStates().forEach(state => {\n !state.isReady && state.onSubmit && state.onSubmit();\n });\n };\n\n private onCancel = (): void => {\n this.clearError();\n this.getActiveChildModuleStates().forEach(state => {\n !state.isReady && state.onCancel && state.onCancel();\n });\n };\n\n private onEdit = (): void => {\n this.getActiveChildModuleStates().forEach(state => {\n (state.isReady || state.isSkipped) && state.onEdit && state.onEdit();\n });\n };\n\n private onContainerReady = (): void => {\n this.getActiveChildModuleStates().forEach(state => {\n state.isReady && state.onContainerReady && state.onContainerReady();\n });\n };\n}\n\nexport default withModuleState(CheckoutPlainContainer);\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport classnames from 'classnames';\nimport * as React from 'react';\nimport { IPaymentConnectorPostMessage } from '../payment-instrument-message';\n\nexport interface IPaymentFrameElementProps {\n className?: string;\n iframeAriaLabel: string;\n displayContent?: string;\n sourceUrl?: string;\n requestUrlOrigin?: string;\n messageOrigin?: string;\n css?: string;\n height?: number;\n onIFrameMessage?(event: MessageEvent): void;\n}\n\nexport const POST_MESSAGE_NAME = 'message';\n\nconst getHostName = (url: string = ''): string => {\n return (url.indexOf('//') > -1 ? url.split('/')[2] : url.split('/')[0]).toLowerCase();\n};\n\n/**\n *\n * IFrameElement component\n * @extends {React.PureComponent}\n */\nclass IPaymentFrameElement extends React.PureComponent {\n private iframeRef: React.RefObject;\n\n constructor(props: IPaymentFrameElementProps) {\n super(props);\n this.iframeRef = React.createRef();\n }\n\n public componentDidMount(): void {\n window.addEventListener(POST_MESSAGE_NAME, this.onEvent);\n\n this.updateContentDocument();\n }\n\n public componentDidUpdate(prevProps: IPaymentFrameElementProps): void {\n if (prevProps.displayContent !== this.props.displayContent) {\n this.updateContentDocument();\n }\n }\n\n public componentWillUnmount(): void {\n window.removeEventListener(POST_MESSAGE_NAME, this.onEvent);\n }\n\n public render(): JSX.Element | null {\n const { sourceUrl, className, iframeAriaLabel, height } = this.props;\n return (\n \n );\n }\n\n public postMessage = (params: IPaymentConnectorPostMessage): void => {\n if (\n this.iframeRef &&\n this.iframeRef.current &&\n this.iframeRef.current.contentWindow &&\n this.iframeRef.current.contentWindow.postMessage\n ) {\n this.iframeRef.current.contentWindow.postMessage(params.message, params.targetOrigin);\n }\n };\n\n private onEvent = (event: MessageEvent) => {\n const { sourceUrl, onIFrameMessage, requestUrlOrigin, messageOrigin } = this.props;\n const sourceHost = getHostName(sourceUrl);\n const eventHost = getHostName(event.origin);\n const requestHost = getHostName(requestUrlOrigin);\n const messageHost = getHostName(messageOrigin);\n\n // Important: security check\n // check actual origin matches with expected origin\n if (\n !onIFrameMessage ||\n (sourceUrl && !(sourceHost === eventHost || requestHost === eventHost || messageHost === eventHost)) ||\n (!sourceUrl && !(requestHost === eventHost || messageHost === eventHost))\n ) {\n return;\n }\n\n return onIFrameMessage(event);\n };\n\n private updateContentDocument = (): void => {\n const { displayContent, sourceUrl, css } = this.props;\n if (!sourceUrl && displayContent && this.iframeRef && this.iframeRef.current) {\n const innerDocument = this.iframeRef.current.contentDocument;\n\n if (innerDocument) {\n innerDocument.open();\n innerDocument.write(displayContent);\n if (css) {\n // Append custom style\n const style = document.createElement('style');\n const cssNote = document.createTextNode(css);\n style.type = 'text/css';\n style.appendChild(cssNote);\n innerDocument.head.appendChild(style);\n }\n\n innerDocument.close();\n }\n }\n };\n}\n\nexport default IPaymentFrameElement;","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Button } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\nimport defaultPaymentConnectorDropinStyle from '../payment-instrument.dropin.style';\nimport defaultPaymentConnectorPaypalStyle from '../payment-instrument.paypal.style';\nimport defaultPaymentConnectorStyle from '../payment-instrument.style';\nimport Iframe from './iframe';\n\nexport interface IAddPaymentFormProps {\n acceptPageUrl?: string;\n acceptPageContent?: string;\n iframeRef?: React.RefObject