{"version":3,"sources":["webpack:///src/utils/script-utils.ts?9534","webpack:///src/modules/footer-category/footer-category.tsx?b7b8","webpack:///src/modules/checkout-apple-pay/checkout-apple-pay.data.ts?7a06","webpack:///src/modules/checkout-apple-pay/checkout-apple-pay.tsx?a333","webpack:///src/modules/default-inline-script/default-inline-script.tsx?3ed3","webpack:///src/modules/default-external-script/default-external-script.tsx?203d","webpack:///src/modules/text-block/text-block.view.tsx?8d9b","webpack:///src/modules/footer-category/footer-category.view.tsx?26a5","webpack:///src/modules/default-inline-style/default-inline-style.tsx?bd16","webpack:///src/modules/text-block/text-block.tsx?1fe8","webpack:///src/modules/tile-list-item/tile-list-item.view.tsx?0144","webpack:///src/modules/tile-list-item/components/links.tsx?e54f","webpack:///src/modules/tile-list-item/tile-list-item.tsx?99bb","webpack:///src/modules/checkout-apple-pay/checkout-apple-pay.view.tsx?3cd4"],"names":["logDebug","debugMessage","telemetry","log","LogLevel","Debug","logError","errorMessage","Error","isAbsoluteUrl","source","test","isRelativeUrl","FooterCategory","React","render","this","props","slots","content","length","context","error","viewprops","_objectSpread","categories","FooterList","moduleProps","className","classnames","config","tag","FooterListItem","renderView","ApplePayButtonState","ApplePayPaymentAuthorizationResult","CheckoutApplePay","constructor","super","moduleClassName","applePaySdkId","zeroAmount","handlePayButton","async","resources","handler","onAuthorize","authorizePayment","onCancel","cancelPayment","onPaymentMethodUpdate","updatePaymentMethod","onValidation","validateMerchant","shouldRequestShippingAddress","onShippingContactSelected","shippingContactSelected","onShippingMethodSelected","shippingMethodSelected","displayName","window","CreateApplePaySession","amountDue","toString","setState","lineDisplayName","showErrorMessage","genericErrorMessage","checkout","data","actionContext","paymentConnectorId","state","checkoutState","getCheckoutState","cartState","checkoutCart","requestContext","channel","_checkout$result","cardPaymentAcceptResult","AccessCode","paymentToken","Settings","PaymentConnectorId","result","updateCardPaymentAcceptResult","newCardPaymentAcceptResult","PlaceOrder","undefined","cart","Version","loadPaymentConnectorSdk","cardPaymentAcceptPoint","AcceptPageContent","connectorSdk","sdk","document","createElement","id","type","appendChild","createTextNode","body","_checkout$result2","_cardPaymentAcceptPoi","information","validationUrl","validationEvent","Promise","reject","cartId","Id","validationObject","domainName","location","hostname","validationBody","JSON","stringify","validationData","retrieveCardPaymentAcceptResultAsync","callerContext","btoa","catch","resolve","updateContactInfo","authorizeEvent","shippingContact","resultCode","STATUS_SUCCESS","newTotal","label","merchantName","amount","shippingAddress","getAddressFromShippingContact","shippingMethods","getShippingMethods","ObjectExtensions","isNullOrUndefined","_shippingMethods$at","shippingMethodId","at","identifier","updateShippingInfo","e","newShippingMethods","shippingMethod","_checkout$result3","deliveryOptionFilter","FilterDeliveryModeOption","FilterOutNonCarrierDeliveryMode","appleDeliveryOptions","getDeliveryOptionsAsync","queryResultSettings","QueryResultSettingsProxy","getPagingFromInputDataOrDefaultValue","address","forEach","element","push","Description","ShippingChargeAmount","detail","Code","_shippingContact$addr","_shippingContact$addr2","ThreeLetterISORegionName","getThreeLetterCountryCode","countryCode","Name","getContactName","Street","addressLines","StreetNumber","City","locality","State","administrativeArea","ZipCode","postalCode","givenName","familyName","StringExtensions","isNullOrWhitespace","newGuestCheckoutEmail","emailAddress","_checkout$result4","warning","updateGuestCheckoutEmail","_checkout$result5","updateCartDeliverySpecificationInput","deliveryModeId","updateCartDeliverySpecification","_result$errorDetails","status","errorDetails","LocalizedMessage","message","applePayButtonState","Unknown","loyaltyAmount","giftCardExtends","reduce","count","giftCard","Balance","_checkoutState$custom","customerAccountAmount","_checkout$result6","AmountDue","Math","max","getGiftCardTotalAmount","getLoyaltyAmount","getCustomerAccountAmount","script","onload","_cardPaymentAcceptPoi2","isApplePayAvailable","Available","NotAvailable","src","onerror","request","user","isOBORequest","EnabledPaymentsForOBO","ExpressPayment","applePayButton","onClick","viewProps","checkoutApplePay","classNames","alert","ErrorComponent","Object","assign","title","errorMessageTitle","__decorate","computed","DefaultInlineScript","typeName","inlineScript","includes","nonceToken","isNonceEnabled","scriptHtml","SDK_FRAGMENT_NAME","key","dangerouslySetInnerHTML","__html","DefaultExternalScript","scriptSource","relativeBaseUrl","url","staticCdnUrl","msdyn365Commerce","getEnvironmentVariable","path","defer","TextBlockView","renderModuleAttributes","paragraph","FooterCategoryView","Module","map","category","index","Node","DefaultInlineStyle","inlineStyle","styleHtml","TextBlock","handleTextChange","event","target","value","text","MsDyn365","editProps","onEdit","textBlockViewProps","TileListItemViewComponent","tileListItem","heading","backgroundImage","links","thumbnailImage","tileListContainer","tileListImageContainer","tileListThumbnailImageContainer","tileListHeadingContainer","renderTileListItemContent","TileListLinks","_mapEditableLinks","linkdata","ArrayExtensions","hasElements","editableLinks","link","payLoad","getPayloadObject","telemetryContent","linkText","contentAction","etext","attributes","getTelemetryAttributes","editableLink","ariaLabel","linkUrl","destinationUrl","openInNewTab","role","additionalProperties","onTelemetryClick","Msdyn365","onTextChange","TileListItem","_telemetryContent","getTelemetryObject","telemetryPageName","friendlyName","handleHeadingChange","handleParagraphChange","handleLinkTextChange","linkIndex","_this$props$config$li","Number","redirectionUrl","tileListLinks","tileListLinkContainer","href","_createHeading","_createParagraph","_renderBackgroundImage","_renderThumbnailImage","_heading$tag","item","isAriaHiddenAttribute","_item$imageSettings","_this$props$config$ba","verifiedImageSettings","imageSettings","viewports","xs","q","w","h","sm","md","lg","xl","lazyload","gridSettings","loadFailureBehavior","moduleType","imagePropertyName","itemImageSettings","_this$props$config$th","layout","msdyn365__moduleLayout","CheckoutApplePayView"],"mappings":";8PAOO,MAAMA,EAAWA,CAACC,EAAsBC,KAC3CA,GAAaA,EAAUC,IAAIC,IAASC,MAAOJ,IAGlCK,EAAWA,CAACC,EAAsBL,KAC3CA,GAAaA,EAAUC,IAAIC,IAASI,MAAOD,IAQlCE,EAAiBC,GAEnB,kFAAkFC,KAAKD,GAGrFE,EAAiBF,GACnB,8DAA8DC,KAAKD,I,6qBCJ9E,MAAMG,UAAuBC,gBAClBC,SACH,IAAKC,KAAKC,MAAMC,QAAUF,KAAKC,MAAMC,MAAMC,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,EACb5D,UAAW,CACP/B,IAAsC,QAAnC6F,EAAExU,KAAKC,MAAMa,OAAOkQ,uBAAe,IAAAwD,IAAI,GAC1C3Q,eAAgB7D,KAAKC,MAAMI,QAAQ4M,QACnCsI,WAAYvV,KAAKC,MAAMmO,SACvBoH,kBAAmB,YAM3BrB,sBACJE,EACAoB,EACAnB,GAA+B,IAAAoB,EAE/B,OAAKrB,EAGD7J,mBAAiBC,mBAAmB4J,EAAKtH,KAClC,KAIPjN,gBAACiT,IAAclF,OAAAC,OAAA,GACPuG,EAAI,CACRgB,aAAcrV,KAAKC,MAAMI,QAAQ4M,QAAQoI,aACzCX,cAAee,EACfH,oBAAoB,UAAS,cAChBhB,EACb5D,UAAW,CACP/B,IAAqC,QAAlC+G,EAAE1V,KAAKC,MAAMa,OAAOoQ,sBAAc,IAAAwE,IAAI,GACzC7R,eAAgB7D,KAAKC,MAAMI,QAAQ4M,QACnCsI,WAAYvV,KAAKC,MAAMmO,SACvBoH,kBAAmB,QAGnBG,OAAS3V,KAAKC,MAAMa,OAAe8U,2BApBpC,MA2BJ3C,a,+ECvMA4C,UAXoD5V,IAC/D,MAAM,iBAAEwN,EAAgB,eAAEH,EAAc,MAAEK,GAAU1N,EAEpD,OACIH,gBAAC6P,SAAM9B,OAAAC,OAAA,GAAKL,GACPE,EACAL","file":"static/js/16.a04be990b320239fb434.chunk.js","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IInternalTelemetry, LogLevel } from '@msdyn365-commerce/telemetry-internal';\n\nexport const logDebug = (debugMessage: string, telemetry: IInternalTelemetry | undefined): void => {\n telemetry && telemetry.log(LogLevel.Debug, debugMessage);\n};\n\nexport const logError = (errorMessage: string, telemetry: IInternalTelemetry | undefined): void => {\n telemetry && telemetry.log(LogLevel.Error, errorMessage);\n};\n\n/**\n * Returns true if the given string matches an URL pattern\n *\n * @param source The string to check against\n */\nexport const isAbsoluteUrl = (source: string): boolean => {\n // eslint-disable-next-line security/detect-unsafe-regex\n return /^(http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?$/.test(source);\n};\n\nexport const isRelativeUrl = (source: string): boolean => {\n return /^(?!www\\.|(?:http|ftp)s?:\\/\\/|[A-Za-z]:\\\\|\\/\\/).*(\\.js){1}$/.test(source);\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IModuleProps, INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { IFooterCategoryConfig, IFooterCategoryProps } from './footer-category.props.autogenerated';\n\nexport interface IFooterCategoryViewProps extends IFooterCategoryProps {\n categories: React.ReactNode[];\n FooterList: IModuleProps;\n FooterListItem: INodeProps;\n}\n\n/**\n *\n * FooterCategory component.\n * @extends {React.PureComponent>}\n */\nclass FooterCategory extends React.PureComponent> {\n public render(): JSX.Element | null {\n if (!this.props.slots || !this.props.slots.content || this.props.slots.content.length === 0) {\n this.props.context.telemetry.error('footer slots content is empty, module wont render');\n return null;\n }\n const viewprops = {\n ...this.props,\n categories: this.props.slots.content,\n FooterList: {\n moduleProps: this.props,\n className: classnames('ms-footer__list', this.props.config.className),\n tag: 'ul'\n },\n FooterListItem: {\n className: classnames('ms-footer__list-item', this.props.config.className),\n tag: 'li'\n }\n };\n\n return this.props.renderView(viewprops) as React.ReactElement;\n }\n}\n\nexport default FooterCategory;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { ICheckoutState } from '@msdyn365-commerce/global-state';\nimport {\n AsyncResult, CardPaymentAcceptPoint\n} from '@msdyn365-commerce/retail-proxy';\n\nexport enum ApplePayButtonState {\n Unknown,\n NotAvailable,\n Available\n};\n\n/**\n * Interface for checkout apple pay data.\n */\nexport interface ICheckoutApplePayData {\n checkout?: AsyncResult;\n cardPaymentAcceptPoint?: AsyncResult;\n}","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\nimport { getCheckoutState, IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport {\n getDeliveryOptionsAsync,\n retrieveCardPaymentAcceptResultAsync\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\nimport {\n Address,\n CardPaymentAcceptResult,\n Cart,\n FilterDeliveryModeOption\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport classNames from 'classnames';\nimport * as React from 'react';\n\nimport { CardPaymentAcceptPoint } from '@msdyn365-commerce/retail-proxy';\nimport { EnabledPaymentsForOBO } from '@msdyn365-commerce-modules/checkout-utilities';\nimport { computed } from 'mobx';\nimport { ObjectExtensions, QueryResultSettingsProxy, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { ApplePayButtonState, ICheckoutApplePayData } from './checkout-apple-pay.data';\nimport { ICheckoutApplePayProps } from './checkout-apple-pay.props.autogenerated';\nimport { PlaceOrder } from '../../common/place-order';\nimport { ErrorComponent } from '../../common';\nimport { getThreeLetterCountryCode } from '../../common/country-codes';\n\nenum ApplePayPaymentAuthorizationResult {\n STATUS_SUCCESS = 0,\n STATUS_FAILURE = 1\n}\n\ninterface IApplePayLine {\n label: string;\n type: string;\n amount: string;\n}\n\ninterface IValidationEvent {\n validationUrl: string;\n}\n\ninterface IResult {\n newTotal: IApplePayLine;\n}\n\ninterface IAuthorizeEvent {\n paymentToken: string;\n shippingContact?: IShippingContactSelectedEvent;\n}\n\ninterface IAuthorizeResult {\n resultCode: ApplePayPaymentAuthorizationResult;\n}\n\ninterface IPaymentMethodEvent {\n type?: string;\n}\n\n/**\n * An interface that describes the shipping method for delivering physical goods.\n * Link to Apple doc - https://developer.apple.com/documentation/apple_pay_on_the_web/applepayshippingmethod\n */\ninterface IApplePayShippingMethod {\n /**\n * A short description of the shipping method.\n */\n label?: string;\n\n /**\n * The nonnegative cost associated with this shipping method.\n */\n amount?: string;\n\n /**\n * Additional description of the shipping method.\n */\n detail?: string;\n\n /**\n * A client-defined value used to identify this shipping method.\n */\n identifier?: string;\n}\n\n/**\n * Contact information fields to use for billing and shipping contact information.\n * Link to Apple doc - https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentcontact\n */\ninterface IShippingContactSelectedEvent {\n /**\n * A phone number for the contact.\n */\n phoneNumber?: string;\n\n /**\n * An email address for the contact.\n */\n emailAddress?: string;\n\n /**\n * The contact’s given name.\n */\n givenName?: string;\n\n /**\n * The contact’s family name.\n */\n familyName?: string;\n\n /**\n * The street portion of the address for the contact.\n */\n addressLines?: string[];\n\n /**\n * Additional information associated with the location, typically defined at the city or town level (such as district or neighborhood), in a postal address.\n */\n subLocality?: string;\n\n /**\n * The city for the contact.\n */\n locality?: string;\n\n /**\n * The zip code or postal code, where applicable, for the contact.\n */\n postalCode?: string;\n\n /**\n * The subAdministrative area (such as a county or other region) in a postal address.\n */\n subAdministrativeArea?: string;\n\n /**\n * The state for the contact.\n */\n administrativeArea?: string;\n\n /**\n * The name of the country or region for the contact.\n */\n country?: string;\n\n /**\n * The contact’s two-letter ISO 3166 country code.\n */\n countryCode?: string;\n}\n\ninterface IShippingMethodSelectedEvent {\n /**\n * The identifier of selected shipping method.\n */\n id: string;\n}\n\ninterface IAppleSessionHandler {\n onAuthorize(authorizeEvent: IAuthorizeEvent): Promise;\n onCancel(): void;\n onPaymentMethodUpdate(paymentMethodEvent: IPaymentMethodEvent): Promise;\n onValidation(validationEvent: IValidationEvent): Promise;\n\n onShippingContactSelected?(shippingContactSelectedEvent: IShippingContactSelectedEvent): Promise;\n onShippingMethodSelected?(shippingMethodSelectedEvent: IShippingMethodSelectedEvent): Promise;\n}\n\nexport interface ICheckoutApplePayViewProps extends ICheckoutApplePayProps<{}> {\n className?: string;\n checkoutApplePay: IModuleProps;\n applePayButton?: React.ReactNode;\n alert?: React.ReactNode;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ndeclare const window: any;\n\nexport interface ICheckoutApplePayModuleProps extends ICheckoutApplePayProps {}\n\ninterface ICheckoutApplePayState {\n applePayButtonState: ApplePayButtonState;\n paymentConnectorId?: string;\n lineDisplayName?: string;\n errorMessage?: string;\n shippingContact?: Address;\n shippingMethodId?: string;\n}\n/**\n *\n * CheckoutApplePay component\n * @extends {React.Component}\n */\nexport class CheckoutApplePay extends React.Component {\n private readonly moduleClassName: string = 'ms-checkout-apple-pay';\n private readonly applePaySdkId = 'd365-apple-pay-sdk';\n private readonly zeroAmount: number = 0;\n\n @computed private get getLoyaltyAmount(): number {\n const {\n data: { checkout }\n } = this.props;\n const checkoutState = checkout?.result;\n return checkoutState?.loyaltyAmount ? checkoutState.loyaltyAmount : this.zeroAmount;\n }\n\n @computed private get getGiftCardTotalAmount(): number {\n const {\n data: { checkout }\n } = this.props;\n const checkoutState = checkout?.result;\n if (!checkoutState || !checkoutState.giftCardExtends) {\n return this.zeroAmount;\n }\n return checkoutState.giftCardExtends.reduce((count: number, giftCard: IGiftCardExtend) => {\n return count + (giftCard.Balance || this.zeroAmount);\n }, 0);\n }\n\n @computed private get getCustomerAccountAmount(): number {\n const {\n data: { checkout }\n } = this.props;\n const checkoutState = checkout?.result;\n\n return checkoutState?.customerAccountAmount ?? this.zeroAmount;\n }\n\n @computed private get amountDue(): number {\n const {\n data: { checkout }\n } = this.props;\n\n const cart = checkout?.result?.checkoutCart.cart;\n if (!cart || !cart.AmountDue) {\n return this.zeroAmount;\n }\n\n return Math.max(\n this.zeroAmount,\n cart.AmountDue - this.getGiftCardTotalAmount - this.getLoyaltyAmount - this.getCustomerAccountAmount\n );\n }\n\n @computed private get merchantName(): string {\n return this.state.lineDisplayName || '';\n }\n\n public constructor(props: ICheckoutApplePayProps) {\n super(props);\n this.state = {\n applePayButtonState: ApplePayButtonState.Unknown\n };\n }\n\n public async componentDidMount() {\n const {\n data: { cardPaymentAcceptPoint },\n telemetry\n } = this.props;\n\n // load JS portion of payment connector for ApplePay\n await cardPaymentAcceptPoint;\n\n if (cardPaymentAcceptPoint?.result !== undefined) {\n this.loadPaymentConnectorSdk(cardPaymentAcceptPoint.result);\n\n // load official ApplePay JS SDK.\n const script = document.createElement('script');\n script.onload = () => {\n let isApplePayAvailable = false;\n if (typeof window.isApplePayAvailable === 'function') {\n isApplePayAvailable = window.isApplePayAvailable();\n }\n\n telemetry.information(`is Apple Pay available: ${isApplePayAvailable}`);\n return this.setState({\n applePayButtonState: isApplePayAvailable ? ApplePayButtonState.Available : ApplePayButtonState.NotAvailable,\n paymentConnectorId: cardPaymentAcceptPoint.result?.PaymentConnectorId\n });\n };\n\n script.src = 'https://applepay.cdn-apple.com/jsapi/v1/apple-pay-sdk.js';\n script.async = false;\n script.onerror = () => telemetry.error('unable to load Apple Pay SDK');\n document.body.appendChild(script);\n } else {\n telemetry.error('unable to get Apple Pay connector SDK');\n }\n }\n\n public render(): JSX.Element | null {\n const {\n config: { className },\n resources,\n telemetry\n } = this.props;\n\n if (this.props.context.request.user.isOBORequest && EnabledPaymentsForOBO.ExpressPayment === 0) {\n telemetry.information('isOBORequest is enabled, apple pay module wont render');\n return null;\n }\n\n let applePayButton: React.ReactNode;\n switch (this.state.applePayButtonState) {\n case ApplePayButtonState.Available:\n applePayButton = (\n
\n );\n break;\n\n case ApplePayButtonState.Unknown:\n case ApplePayButtonState.NotAvailable:\n default:\n applePayButton =
;\n break;\n }\n\n const viewProps: ICheckoutApplePayViewProps = {\n ...this.props,\n ...this.state,\n className,\n checkoutApplePay: {\n moduleProps: this.props,\n className: classNames(this.moduleClassName, className)\n },\n alert: this.state.errorMessage && (\n \n ),\n applePayButton\n };\n\n return this.props.renderView(viewProps);\n }\n\n /**\n * Handler for Apple Pay button.\n */\n public handlePayButton = async () => {\n const { config, resources, telemetry } = this.props;\n\n const handler: IAppleSessionHandler = {\n onAuthorize: this.authorizePayment,\n onCancel: this.cancelPayment,\n onPaymentMethodUpdate: this.updatePaymentMethod,\n onValidation: this.validateMerchant\n };\n\n // Set shipping related callbacks if corresponding options enabled.\n if (config.shouldRequestShippingAddress) {\n handler.onShippingContactSelected = this.shippingContactSelected;\n handler.onShippingMethodSelected = this.shippingMethodSelected;\n }\n\n try {\n // calling connector JS to create payment session.\n const displayName = window.CreateApplePaySession(handler, this.amountDue.toString());\n this.setState({\n lineDisplayName: displayName\n });\n } catch (error) {\n this.showErrorMessage(resources.genericErrorMessage);\n telemetry.error(`unable to create Apple Pay session: ${error}`);\n }\n };\n\n /**\n * Call CSU checkout API with Apple Pay token.\n * @param paymentToken {string} The gateway payment token\n */\n private checkout = async (paymentToken: string) => {\n const {\n data: { checkout },\n context: { actionContext }\n } = this.props;\n const { paymentConnectorId } = this.state;\n\n const checkoutState = await getCheckoutState(actionContext);\n const cartState = checkoutState.checkoutCart;\n\n const channelConfiguration = actionContext.requestContext.channel;\n if (!channelConfiguration) {\n throw new Error('unable to get channel configuration');\n }\n\n if (checkout !== null) {\n const cardPaymentAcceptResult: CardPaymentAcceptResult = {\n AccessCode: paymentToken,\n Settings: {\n PaymentConnectorId: paymentConnectorId\n }\n };\n\n await checkout?.result?.updateCardPaymentAcceptResult({ newCardPaymentAcceptResult: cardPaymentAcceptResult });\n await PlaceOrder(\n actionContext,\n checkoutState,\n undefined, // orderedProducts\n true, // redirect,\n cartState.cart.Version,\n false // isPaymentVerificationRedirection\n );\n }\n };\n\n /**\n * Load JS SDK from payment connector.\n * @param cardPaymentAcceptPoint {CardPaymentAcceptPoint} The card payment accept point object from CSU.\n */\n private loadPaymentConnectorSdk = (cardPaymentAcceptPoint: CardPaymentAcceptPoint) => {\n if (!cardPaymentAcceptPoint.AcceptPageContent) {\n this.props.telemetry.error(`Card payment accept page content can't be null or empty`);\n return;\n }\n\n const connectorSdk: string = cardPaymentAcceptPoint.AcceptPageContent || '';\n const sdk = document.createElement('script');\n sdk.id = this.applePaySdkId;\n sdk.type = 'text/javascript';\n sdk.appendChild(document.createTextNode(connectorSdk));\n document.body.appendChild(sdk);\n };\n\n /**\n * Validate Apple Pay merchant account with gateway.\n * @param validationEvent {IValidationEvent} The object containing merchant validation data.\n * @returns The response from CSU with validated data.\n */\n private validateMerchant = async (validationEvent: IValidationEvent): Promise => {\n const {\n data: { checkout, cardPaymentAcceptPoint },\n resources,\n telemetry\n } = this.props;\n\n telemetry.information('starting merchant validation for Apple Pay');\n const validationUrl = validationEvent?.validationUrl || '';\n if (!validationUrl) {\n telemetry.error(`Apple Pay validation failed: url can't be null or empty`);\n return Promise.reject('Validation url can not be null or empty');\n }\n\n const cartId = checkout?.result?.checkoutCart.cart.Id || '';\n if (!cartId) {\n telemetry.error(`Apple Pay validation failed: cart can't be null or empty`);\n return Promise.reject('Cart identifier can not be null or empty');\n }\n\n const paymentConnectorId = cardPaymentAcceptPoint?.result?.PaymentConnectorId || '';\n if (!paymentConnectorId) {\n telemetry.error(`Apple Pay validation failed: payment connector identifier can't be null or empty`);\n return Promise.reject('Connector identifier can not be null or empty');\n }\n\n const validationObject = {\n domainName: window.location.hostname,\n validationUrl: validationUrl\n };\n const validationBody = JSON.stringify(validationObject);\n const validationData = await retrieveCardPaymentAcceptResultAsync(\n { callerContext: this.props.context.actionContext },\n btoa(validationBody),\n [],\n cartId,\n { PaymentConnectorId: paymentConnectorId }\n ).catch(error => {\n this.showErrorMessage(resources.genericErrorMessage);\n telemetry.error(`Apple Pay validation failed: ${error}`);\n return Promise.reject(error);\n });\n\n telemetry.information('merchant validation for Apple Pay completed');\n return Promise.resolve(JSON.stringify(validationData));\n };\n\n /**\n * Authorize Apple Pay token by calling checkout API.\n * @param authorizeEvent {IAuthorizeEvent} The object containing authorization information.\n * @returns The authorization result.\n */\n private authorizePayment = async (authorizeEvent: IAuthorizeEvent): Promise => {\n const { resources, telemetry } = this.props;\n\n telemetry.information('starting authorization for Apple Pay');\n try {\n await this.updateContactInfo(authorizeEvent.shippingContact);\n await this.checkout(btoa(JSON.stringify(authorizeEvent)));\n telemetry.information('Apple Pay authorization completed');\n return Promise.resolve({ resultCode: ApplePayPaymentAuthorizationResult.STATUS_SUCCESS });\n } catch (error) {\n this.showErrorMessage(resources.genericErrorMessage);\n telemetry.error(`Apple Pay authorization failed: ${error as string}`);\n return Promise.reject(error as string);\n }\n };\n\n /**\n * Callback to notify Apple Pay sheet was closed/canceled.\n */\n private cancelPayment = (): void => {\n this.props.telemetry.information('Apple Pay popup canceled');\n };\n\n /**\n * The callback for Apple Pay payment method confirmation.\n * @param paymentMethodEvent {IPaymentMethodEvent} The payment method event object.\n * @returns The transaction result object.\n */\n private updatePaymentMethod = async (paymentMethodEvent: IPaymentMethodEvent): Promise => {\n return Promise.resolve({\n newTotal: {\n label: this.merchantName,\n type: 'final',\n amount: `${this.amountDue}`\n }\n });\n };\n\n /**\n * The callback for Apple Pay shipping contact confirmation.\n * @param shippingContact {IShippingContactSelectedEvent} The shipping contact event object.\n * @returns The transaction result object.\n */\n private shippingContactSelected = async (shippingContact: IShippingContactSelectedEvent): Promise => {\n const { resources, telemetry } = this.props;\n\n // construct Address object from Apple Pay shipping contact.\n const shippingAddress: Address = this.getAddressFromShippingContact(shippingContact);\n const shippingMethods = await this.getShippingMethods(shippingAddress);\n if (ObjectExtensions.isNullOrUndefined(shippingMethods) || shippingMethods.length === 0) {\n return Promise.reject();\n }\n\n try {\n const shippingMethodId = shippingMethods.at(0)?.identifier || '';\n await this.updateShippingInfo(shippingMethodId, shippingAddress);\n\n // save shipping contact to update shipping method later.\n this.setState({\n shippingContact: shippingAddress,\n shippingMethodId: shippingMethodId\n });\n } catch (e) {\n telemetry.error(`unable to update shipping info after shipping method change: ${e}`);\n this.showErrorMessage(resources.genericErrorMessage);\n }\n\n return Promise.resolve({\n newShippingMethods: shippingMethods,\n newTotal: {\n label: this.merchantName,\n type: 'final',\n amount: `${this.amountDue}`\n }\n });\n };\n\n /**\n * The callback for Apple Pay shipping method confirmation.\n * @param shippingMethodSelectedEvent {IShippingMethodSelectedEvent} The shipping method event object.\n * @returns The transaction result object.\n */\n private shippingMethodSelected = async (shippingMethod: IShippingMethodSelectedEvent): Promise => {\n const { resources, telemetry } = this.props;\n\n try {\n await this.updateShippingInfo(shippingMethod.id, this.state.shippingContact);\n\n // save selected shipping method.\n this.setState({ shippingMethodId: shippingMethod.id });\n } catch (e) {\n telemetry.error(`unable to update address after shipping method change: ${e}`);\n this.showErrorMessage(resources.genericErrorMessage);\n }\n\n return Promise.resolve({\n newTotal: {\n label: this.merchantName,\n type: 'final',\n amount: `${this.amountDue}`\n }\n });\n };\n\n /**\n * Helper function to obtain shipping methods available for Apple contact address.\n * @param address {Address} The shipping address.\n * @returns The cart delivery options.\n */\n private getShippingMethods = async (address: Address): Promise => {\n const {\n context: { actionContext },\n data: { checkout },\n telemetry\n } = this.props;\n\n const cartId = (checkout?.result?.checkoutCart?.cart as Cart).Id;\n const deliveryOptionFilter: FilterDeliveryModeOption = FilterDeliveryModeOption.FilterOutNonCarrierDeliveryMode;\n const appleDeliveryOptions: IApplePayShippingMethod[] = [];\n try {\n const deliveryOptions = await getDeliveryOptionsAsync(\n {\n callerContext: actionContext,\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(actionContext)\n },\n cartId,\n address,\n [],\n deliveryOptionFilter,\n false\n );\n deliveryOptions.forEach(element =>\n appleDeliveryOptions.push({\n label: element.Description,\n amount: `${element.ShippingChargeAmount}`,\n detail: element.Description,\n identifier: element.Code\n })\n );\n } catch (e) {\n telemetry.error('unable to get delivery options for Apple Pay contact');\n }\n\n return appleDeliveryOptions;\n };\n\n /**\n * Helper function to convert Apple Pay shipping contact into Address object.\n * @param shippingContact {IShippingContactSelectedEvent} The shipping contact provided by Apple Pay SDK.\n * @returns The Address object.\n */\n private getAddressFromShippingContact = (shippingContact: IShippingContactSelectedEvent) => {\n const shippingAddress: Address = {\n ThreeLetterISORegionName: getThreeLetterCountryCode(shippingContact?.countryCode || ''),\n Name: this.getContactName(shippingContact),\n Street: shippingContact?.addressLines?.at(0),\n StreetNumber: shippingContact?.addressLines?.at(1),\n City: shippingContact?.locality,\n State: shippingContact?.administrativeArea,\n ZipCode: shippingContact?.postalCode\n };\n\n return shippingAddress;\n };\n\n /**\n * Helper function to return formatted contact name.\n * @param shippingContact {IShippingContactSelectedEvent} The shipping contact provided by Apple Pay SDK.\n * @returns The formatted contact name, i.e. 'Test User', 'Test', 'User' or empty string if both given and family names are missing.\n */\n private getContactName = (shippingContact: IShippingContactSelectedEvent) => {\n const givenName = shippingContact?.givenName || '';\n const familyName = shippingContact?.familyName || '';\n return `${givenName}${\n StringExtensions.isNullOrWhitespace(givenName) || StringExtensions.isNullOrWhitespace(familyName) ? '' : ' '\n }${familyName}`;\n };\n\n private updateContactInfo = async (shippingContact?: IShippingContactSelectedEvent) => {\n const {\n data: { checkout },\n telemetry\n } = this.props;\n\n if (shippingContact) {\n const shippingAddress: Address = this.getAddressFromShippingContact(shippingContact);\n const shippingMethodId = this.state.shippingMethodId || '';\n await this.updateShippingInfo(shippingMethodId, shippingAddress);\n const newGuestCheckoutEmail = shippingContact.emailAddress || '';\n if (!StringExtensions.isNullOrWhitespace(newGuestCheckoutEmail)) {\n await checkout?.result?.updateGuestCheckoutEmail({ newGuestCheckoutEmail });\n } else {\n telemetry.warning('email address missing in shipping contact from Apple');\n }\n } else {\n telemetry.information('no shipping information provided');\n }\n };\n\n /**\n * Update shipping information on cart.\n * @param shippingMethodId {string} The identifier for shipping method.\n * @param shippingAddress {Address} The shipping address.\n */\n private updateShippingInfo = async (shippingMethodId: string, shippingAddress?: Address) => {\n const {\n data: { checkout }\n } = this.props;\n\n const updateCartDeliverySpecificationInput = {\n deliveryModeId: shippingMethodId,\n shippingAddress: shippingAddress\n };\n\n const result = await checkout?.result?.checkoutCart.updateCartDeliverySpecification(updateCartDeliverySpecificationInput);\n if (result?.status !== 'SUCCESS') {\n throw new Error(result?.errorDetails?.LocalizedMessage);\n }\n };\n\n /**\n * Shows error message on screen next to Apple Pay button.\n * @param message {string} The error message to show.\n */\n private showErrorMessage = (message: string) => {\n this.setState({\n errorMessage: message\n });\n };\n}\n\nexport default CheckoutApplePay;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { isNonceEnabled, SDK_FRAGMENT_NAME } from '@msdyn365-commerce/core-internal';\nimport * as React from 'react';\nimport { isAbsoluteUrl, isRelativeUrl, logDebug, logError } from '../../utils/script-utils';\nimport { IDefaultInlineScriptProps } from './default-inline-script.props.autogenerated';\n\n/**\n *\n * DefaultScript\n * @extends {React.PureComponent>}\n */\nclass DefaultInlineScript extends React.PureComponent> {\n constructor(props: IDefaultInlineScriptProps<{}>) {\n super(props);\n }\n\n public render(): JSX.Element | null {\n const { config } = this.props;\n logDebug(`Adding script tags for '${this.props.id}/${this.props.typeName}'`, this.props.telemetry);\n const source = config.inlineScript;\n\n if (!source || source === '' || isAbsoluteUrl(source) || isRelativeUrl(source)) {\n logError(\n 'Invalid inline script - Empty inline source defined or a url is being used as a source. Use default-external-script to load scripts from an external or relative url.',\n this.props.telemetry\n );\n return null;\n }\n\n if (source.includes('')) {\n logError('Invalid inline script - inline script should not contain html tags', this.props.telemetry);\n return null;\n }\n\n const nonceToken = this.props.context && isNonceEnabled(this.props.context.request);\n const scriptHtml = ``;\n return React.createElement(SDK_FRAGMENT_NAME, { key: this.props.id, dangerouslySetInnerHTML: { __html: scriptHtml } });\n }\n}\n\nexport default DefaultInlineScript;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { SDK_FRAGMENT_NAME, msdyn365Commerce } from '@msdyn365-commerce/core-internal';\nimport * as path from 'path';\nimport * as React from 'react';\nimport { isAbsoluteUrl, isRelativeUrl, logDebug, logError } from '../../utils/script-utils';\nimport { IDefaultExternalScriptProps } from './default-external-script.props.autogenerated';\n\n/**\n *\n * DefaultExternalScript component\n * @extends {React.PureComponent>}\n */\nclass DefaultExternalScript extends React.PureComponent> {\n constructor(props: IDefaultExternalScriptProps<{}>) {\n super(props);\n }\n\n public render(): JSX.Element | null {\n const { config } = this.props;\n logDebug(`Adding script tags for '${this.props.id}/${this.props.typeName}'`, this.props.telemetry);\n let source = config.scriptSource;\n\n let relativeBaseUrl: string = '';\n // Construct the relative base url, i.e. the base url from which statics will be served\n if (this.props.context) {\n relativeBaseUrl += this.props.context.request.url.staticCdnUrl;\n relativeBaseUrl += msdyn365Commerce.getEnvironmentVariable('SUBMISSIONID') || '';\n }\n\n if (isRelativeUrl(source)) {\n // If the source is a relative URL prepend the relative base url to the resolved source url for the actual source\n source = `${relativeBaseUrl}/${path.join(source)}`;\n } else if (source === '' || !isAbsoluteUrl(source)) {\n logError(\n 'Invalid external script - not a url. The external source is not an external or relative url, please use default-inline-script if you wish to load inline scripts',\n this.props.telemetry\n );\n return null;\n }\n const scriptHtml = ``;\n\n return React.createElement(SDK_FRAGMENT_NAME, { key: this.props.id, dangerouslySetInnerHTML: { __html: scriptHtml } });\n }\n}\n\nexport default DefaultExternalScript;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\nimport { ITextBlockViewProps } from './text-block';\n\nconst TextBlockView: React.FC = props => (\n
\n {props.paragraph}\n
\n);\n\nexport default TextBlockView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport React, { ReactNode } from 'react';\n\nimport { IFooterCategoryViewProps } from './footer-category';\n\nexport const FooterCategoryView: React.FC = props => {\n const { categories, FooterList, FooterListItem } = props;\n if (!categories || categories.length === 0) {\n props.context.telemetry.error('Footer content is empty, module wont render');\n return null;\n }\n return (\n \n {categories.map((category: ReactNode, index: number) => {\n return (\n \n {category}\n \n );\n })}\n \n );\n};\n\nexport default FooterCategoryView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { SDK_FRAGMENT_NAME } from '@msdyn365-commerce/core-internal';\nimport * as React from 'react';\nimport { isAbsoluteUrl, isRelativeUrl, logDebug, logError } from '../../utils/script-utils';\nimport { IDefaultInlineStyleProps } from './default-inline-style.props.autogenerated';\n\n/**\n *\n * DefaultStyle\n * @extends {React.PureComponent>}\n */\n\nconst DefaultInlineStyle = (props: IDefaultInlineStyleProps<{}>) => {\n const { config, id, typeName, telemetry } = props;\n logDebug(`Adding style tags for '${id}/${typeName}'`, telemetry);\n const source = config.inlineStyle;\n\n if (!source || source === '' || isAbsoluteUrl(source) || isRelativeUrl(source)) {\n logError('Invalid inline style - Empty inline source defined or a url is being used as a source.', telemetry);\n return null;\n }\n\n if (source.includes('')) {\n logError('Invalid inline style - inline style should not contain html tags', telemetry);\n return null;\n }\n\n const styleHtml = ``;\n return React.createElement(SDK_FRAGMENT_NAME, { key: id, dangerouslySetInnerHTML: { __html: styleHtml } });\n};\n\nexport default DefaultInlineStyle;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as MsDyn365 from '@msdyn365-commerce/core';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { ITextBlockProps } from './text-block.props.autogenerated';\n\nexport interface ITextBlockViewProps extends ITextBlockProps<{}> {\n paragraph?: React.ReactNode;\n className?: string;\n}\n\n/**\n *\n * TextBlock component.\n */\nclass TextBlock extends React.PureComponent> {\n public render(): JSX.Element | null {\n const { paragraph, className } = this.props.config;\n const text = paragraph && (\n \n );\n const textBlockViewProps = {\n ...this.props,\n paragraph: text,\n className: classnames('ms-text-block', className)\n };\n return this.props.renderView(textBlockViewProps) as React.ReactElement;\n }\n\n public handleTextChange = (event: MsDyn365.ContentEditableEvent) => (this.props.config.paragraph = event.target.value);\n}\nexport default TextBlock;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ITileListItemViewProps } from './tile-list-item';\n\n/**\n *\n * ITileListItemViewProps component.\n * @param props - Component props.\n * @returns TileListView.\n */\nconst renderTileListItemContent = (props: ITileListItemViewProps): JSX.Element => {\n const {\n heading,\n paragraph,\n backgroundImage,\n links,\n thumbnailImage,\n tileListContainer,\n tileListImageContainer,\n tileListThumbnailImageContainer,\n tileListHeadingContainer\n } = props;\n\n return (\n \n {backgroundImage}\n \n {heading}\n {paragraph}\n {links}\n \n {thumbnailImage}\n \n );\n};\n\n/**\n *\n * TileListItemViewProps component.\n * @param props - Component props.\n * @returns TileListView.\n */\nexport const TileListItemViewComponent: React.FC = props => {\n const { tileListItem } = props;\n return {renderTileListItemContent(props)};\n};\n\nexport default TileListItemViewComponent;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent, onTelemetryClick } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ILinksData } from '../tile-list-item.props.autogenerated';\n\n/**\n * Tile List links.\n */\nexport interface ITileListLinks {\n links: ILinksData[];\n requestContext: Msdyn365.IRequestContext;\n telemetryContent: ITelemetryContent;\n onTextChange?(index: number): (event: Msdyn365.ContentEditableEvent) => void;\n}\n\n/**\n *\n * ITileListLinks component.\n * @extends {React.PureComponent}\n */\nexport class TileListLinks extends React.PureComponent {\n public render(): JSX.Element {\n const editableLinks = this._mapEditableLinks(this.props.links);\n return (\n
\n {editableLinks && ArrayExtensions.hasElements(editableLinks) ? (\n \n ) : null}\n
\n );\n }\n\n /**\n * ITileListLinks component.\n * @param linkdata - Link data.\n * @returns Editable links.\n */\n private readonly _mapEditableLinks = (linkdata: ILinksData[]): Msdyn365.ILinksData[] | null => {\n if (!ArrayExtensions.hasElements(linkdata)) {\n return null;\n }\n const editableLinks: Msdyn365.ILinksData[] = [];\n for (const link of linkdata) {\n // Construct telemetry attribute to render\n const payLoad = getPayloadObject('click', this.props.telemetryContent, '', '');\n const linkText = link.linkText ? link.linkText : '';\n payLoad.contentAction.etext = linkText;\n const attributes = getTelemetryAttributes(this.props.telemetryContent, payLoad);\n const editableLink: Msdyn365.ILinksData = {\n ariaLabel: link.ariaLabel,\n className: 'ms-tile-list__link',\n linkText: link.linkText,\n linkUrl: link.linkUrl.destinationUrl,\n openInNewTab: link.openInNewTab,\n role: 'button',\n additionalProperties: attributes,\n onClick: onTelemetryClick(this.props.telemetryContent, payLoad, linkText)\n };\n editableLinks.push(editableLink);\n }\n\n return editableLinks;\n };\n}\nexport default TileListLinks;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { ArrayExtensions, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { getTelemetryObject, IModuleProps, INodeProps, ITelemetryContent, NodeTag } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { TileListLinks } from './components';\nimport { IHeadingData, ITileListItemProps } from './tile-list-item.props.autogenerated';\n\n/**\n * Tile-list-item view props.\n */\nexport interface ITileListItemViewProps extends ITileListItemProps<{}> {\n heading?: React.ReactNode;\n paragraph?: React.ReactNode;\n links?: React.ReactNode;\n backgroundImage?: React.ReactNode;\n thumbnailImage?: React.ReactNode;\n tileListItem: IModuleProps;\n tileListContainer: INodeProps;\n tileListImageContainer: INodeProps;\n tileListThumbnailImageContainer: INodeProps;\n tileListHeadingContainer: INodeProps;\n}\n\n/**\n *\n * TileListItem component.\n * @extends {React.PureComponent>}\n */\nexport class TileListItem extends React.PureComponent> {\n private readonly _telemetryContent: ITelemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\n\n public constructor(props: ITileListItemProps<{}>) {\n super(props);\n }\n\n public render(): JSX.Element {\n const { heading, paragraph, backgroundImage, thumbnailImage, redirectionUrl, links } = this.props.config;\n const tileListLinks = links && ArrayExtensions.hasElements(links) && (\n \n );\n const tileListLinkContainer = {\n tag: 'a' as NodeTag,\n className: 'ms-tile-list-container',\n role: 'link',\n href: redirectionUrl?.linkUrl.destinationUrl,\n 'aria-label': redirectionUrl?.ariaLabel,\n target: redirectionUrl?.openInNewTab ? '_blank' : undefined\n };\n\n const tileListButtonContainer = {\n tag: 'button' as NodeTag,\n className: 'ms-tile-list-container'\n };\n const viewProps: ITileListItemViewProps = {\n ...this.props,\n heading: this._createHeading(heading),\n paragraph: this._createParagraph(paragraph),\n backgroundImage: this._renderBackgroundImage(backgroundImage),\n thumbnailImage: this._renderThumbnailImage(thumbnailImage),\n links: tileListLinks,\n tileListItem: {\n moduleProps: this.props,\n className: ''\n },\n tileListContainer: redirectionUrl ? tileListLinkContainer : tileListButtonContainer,\n tileListImageContainer: {\n className: 'ms-tile-list__image'\n },\n tileListThumbnailImageContainer: {\n className: 'ms-tile-list__thumbnail_image',\n 'aria-hidden': 'true'\n },\n tileListHeadingContainer: {\n className: 'ms-tile-list__heading'\n }\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n /**\n * Handles heading content change event.\n * @param event - Content editable event.\n */\n public handleHeadingChange = (event: Msdyn365.ContentEditableEvent): void => {\n this.props.config.heading!.text = event.target.value;\n };\n\n /**\n * Handles paragraph content change event.\n * @param event - Content editable event.\n */\n public handleParagraphChange = (event: Msdyn365.ContentEditableEvent): void => {\n this.props.config.paragraph = event.target.value;\n };\n\n /**\n * Handles paragraph content change event.\n * @param linkIndex - Index of link in linkarray.\n * @returns Void.\n */\n public handleLinkTextChange = (linkIndex: number) => (event: Msdyn365.ContentEditableEvent): void => {\n if (this.props.config.links?.[Number(linkIndex)]) {\n this.props.config.links[Number(linkIndex)].linkText = event.target.value;\n }\n };\n\n private _createParagraph(text?: Msdyn365.RichText): React.ReactNode | null {\n if (!text) {\n return null;\n }\n return (\n \n );\n }\n\n private _createHeading(heading?: IHeadingData): React.ReactNode | null {\n if (!heading) {\n return null;\n }\n if (StringExtensions.isNullOrWhitespace(heading.text)) {\n return null;\n }\n\n return (\n \n );\n }\n\n private _renderBackgroundImage(item?: Msdyn365.IImageData, isAriaHiddenAttribute?: boolean): React.ReactNode | null {\n // If image is null, we want to render the placeholder SVG - by passing image data with empty src\n\n const defaultImageSettings: Msdyn365.IImageSettings = {\n viewports: {\n xs: { q: 'w=328&h=412&m=6', w: 328, h: 412 },\n sm: { q: 'w=328&h=412&m=6', w: 328, h: 412 },\n md: { q: 'w=315&h=412&m=6', w: 315, h: 412 },\n lg: { q: 'w=315&h=412&m=6', w: 315, h: 412 },\n xl: { q: 'w=315&h=412&m=6', w: 315, h: 412 }\n },\n lazyload: true\n };\n const verifiedImageSettings = item?.imageSettings?.viewports ? item.imageSettings : defaultImageSettings;\n\n return (\n \n );\n }\n\n private _renderThumbnailImage(\n item?: Msdyn365.IImageData,\n itemImageSettings?: Msdyn365.IImageSettings,\n isAriaHiddenAttribute?: boolean\n ): React.ReactNode | null {\n if (!item) {\n return null;\n }\n if (StringExtensions.isNullOrWhitespace(item.src)) {\n return null;\n }\n\n return (\n \n );\n }\n}\n\nexport default TileListItem;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\nimport { ICheckoutApplePayViewProps } from './checkout-apple-pay';\n\nconst CheckoutApplePayView: React.FC = props => {\n const { checkoutApplePay, applePayButton, alert } = props;\n\n return (\n \n {alert}\n {applePayButton}\n \n );\n};\n\nexport default CheckoutApplePayView;\n"],"sourceRoot":""}