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","sources":["webpack://Msdyn365.Commerce.Online/./src/actions/get-organization-customer.ts?79c2","webpack://Msdyn365.Commerce.Online/./src/modules/dlvry-cookie-compliance/components/accept-button.tsx?4036","webpack://Msdyn365.Commerce.Online/./src/modules/dlvry-cookie-compliance/components/links.tsx?dcbe","webpack://Msdyn365.Commerce.Online/./src/modules/dlvry-cookie-compliance/components/accept-essential-button.tsx?32d6","webpack://Msdyn365.Commerce.Online/./src/modules/dlvry-cookie-compliance/dlvry-cookie-compliance.tsx?5feb","webpack://Msdyn365.Commerce.Online/./src/modules/dlvry-cookie-compliance/dlvry-cookie-compliance.view.tsx?8e0f","webpack://Msdyn365.Commerce.Online/./lib/dlvry-cookie-compliance/module-registration.js?65ba","webpack://Msdyn365.Commerce.Online/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online/external var \"ReactDOM\"?853b"],"sourcesContent":["import { createObservableDataAction, IActionContext, IAction, ICreateActionContext, IGeneric, IAny, ICommerceApiSettings } from '@msdyn365-commerce/core';\r\nimport { CacheType, callActionOrExecute, Customer, DataServiceQuery, IActionInput, IDataServiceRequest } from \"@msdyn365-commerce/retail-proxy\";\r\nimport * as Entities from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\n\r\nexport class GetOrganizationCustomerInput implements IActionInput {\r\n private readonly user: string | undefined;\r\n private readonly query: DataServiceQuery;\r\n\r\n constructor(apiSettings: ICommerceApiSettings, user: string) {\r\n this.user = user;\r\n\r\n this.query = new DataServiceQuery();\r\n }\r\n\r\n public getDataServiceRequest = (): IDataServiceRequest => {\r\n return this.query.createDataServiceRequestForOperation(\r\n 'GetOrganizationCustomer',\r\n false,\r\n Entities.CustomerClass,\r\n 'false',\r\n {\r\n bypassCache: 'get',\r\n returnEntity: 'Entities.CustomerClass'\r\n },\r\n {}\r\n );\r\n };\r\n\r\n public shouldCacheOutput = (): boolean => false;\r\n\r\n public getCacheKey = () => `OrganizationCustomer-${this.user}`;\r\n public getCacheObjectType = () => 'OrganizationCustomer';\r\n public dataCacheType = (): CacheType => 'request';\r\n}\r\n\r\nconst createInput = (inputData: ICreateActionContext>): GetOrganizationCustomerInput => {\r\n const { user } = inputData.requestContext;\r\n return new GetOrganizationCustomerInput(inputData.requestContext.apiSettings, user.customerAccountNumber ?? \"\");\r\n};\r\n\r\nexport const getOrganizationCustomerAction = async (input: GetOrganizationCustomerInput, ctx: IActionContext): Promise => {\r\n if (!ctx.requestContext.user.isAuthenticated) {\r\n return {};\r\n }\r\n var customer = await callActionOrExecute(input.getDataServiceRequest(), ctx);\r\n return customer;\r\n};\r\n\r\nexport const getOrganizationCustomer = createObservableDataAction({\r\n id: 'src/actions/get-organization-customer',\r\n action: >getOrganizationCustomerAction,\r\n input: createInput\r\n});\r\n\r\nexport default getOrganizationCustomer;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { getPayloadObject, getTelemetryAttributes, IPayLoad, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nexport interface ICookieComplianceAcceptButton {\r\n acceptCookiesButtonText?: string;\r\n acceptCookiesButtonAriaLabel?: string;\r\n\r\n /**\r\n * The telemetry content\r\n */\r\n telemetryContent?: ITelemetryContent;\r\n onClose(): void;\r\n}\r\n\r\nexport const CookieComplianceAcceptButton: React.FC = ({\r\n acceptCookiesButtonText,\r\n acceptCookiesButtonAriaLabel,\r\n telemetryContent,\r\n onClose\r\n}) => {\r\n const payLoad: IPayLoad = getPayloadObject('click', telemetryContent!, 'accept cookies');\r\n const attributes = getTelemetryAttributes(telemetryContent!, payLoad);\r\n\r\n return (\r\n \r\n {acceptCookiesButtonText}\r\n \r\n );\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent, onTelemetryClick } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IActionLinksData } from '../dlvry-cookie-compliance.props.autogenerated';\r\n\r\nexport interface ICookieComplianceLinks {\r\n links: IActionLinksData[];\r\n requestContext: Msdyn365.IRequestContext;\r\n telemetryContent: ITelemetryContent;\r\n onTextChange?(index: number): (event: Msdyn365.ContentEditableEvent) => void;\r\n}\r\n\r\n/**\r\n *\r\n * ContentCardLinks component.\r\n * @extends {React.PureComponent}\r\n */\r\nexport class CookieComplianceLinks extends React.PureComponent {\r\n public render(): JSX.Element {\r\n const editableLinks = this._mapEditableLinks(this.props.links);\r\n return (\r\n \r\n {editableLinks && editableLinks.length > 0 ? (\r\n \r\n ) : null}\r\n \r\n );\r\n }\r\n\r\n private readonly _mapEditableLinks = (linkdata: IActionLinksData[]): Msdyn365.ILinksData[] | null => {\r\n if (!linkdata || linkdata.length === 0) {\r\n return null;\r\n }\r\n const editableLinks: Msdyn365.ILinksData[] = [];\r\n linkdata.forEach((link, index) => {\r\n // Construct telemetry attribute to render\r\n const payLoad = getPayloadObject('click', this.props.telemetryContent, '', '');\r\n const linkText = link.linkText ? link.linkText : '';\r\n payLoad.contentAction.etext = linkText;\r\n const attributes = getTelemetryAttributes(this.props.telemetryContent, payLoad);\r\n const editableLink: Msdyn365.ILinksData = {\r\n ariaLabel: link.ariaLabel,\r\n className: 'link',\r\n linkText: link.linkText,\r\n linkUrl: link.linkUrl.destinationUrl,\r\n openInNewTab: link.openInNewTab,\r\n role: 'link',\r\n additionalProperties: attributes,\r\n onClick: onTelemetryClick(this.props.telemetryContent, payLoad, linkText)\r\n };\r\n editableLinks.push(editableLink);\r\n });\r\n\r\n return editableLinks;\r\n };\r\n}\r\n\r\nexport default CookieComplianceLinks;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { getPayloadObject, getTelemetryAttributes, IPayLoad, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nexport interface ICookieComplianceAcceptEssentialButton {\r\n acceptEssentialCookiesButtonText?: string;\r\n acceptEssentialCookiesButtonAriaLabel?: string;\r\n\r\n /**\r\n * The telemetry content\r\n */\r\n telemetryContent?: ITelemetryContent;\r\n onClose(): void;\r\n}\r\n\r\nexport const CookieComplianceAcceptEssentialButton: React.FC = ({\r\n acceptEssentialCookiesButtonText,\r\n acceptEssentialCookiesButtonAriaLabel,\r\n telemetryContent,\r\n onClose\r\n}) => {\r\n const payLoad: IPayLoad = getPayloadObject('click', telemetryContent!, 'accept essential cookies');\r\n const attributes = getTelemetryAttributes(telemetryContent!, payLoad);\r\n\r\n return (\r\n \r\n {acceptEssentialCookiesButtonText}\r\n \r\n );\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport * as MsDyn365 from '@msdyn365-commerce/core';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getTelemetryObject, IAlertProps, IModuleProps, INodeProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport { CookieContext } from '@msdyn365-commerce/runtime-internal/dist/types/utils/cookie-utils';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\n\r\nimport { CookieComplianceAcceptButton, CookieComplianceLinks } from './components';\r\nimport { IDlvryCookieComplianceConfig, IDlvryCookieComplianceProps } from './dlvry-cookie-compliance.props.autogenerated';\r\nimport { CookieComplianceAcceptEssentialButton } from './components/accept-essential-button';\r\nimport { IDlvryCookieComplianceData } from './dlvry-cookie-compliance.data';\r\n\r\n/**\r\n * Alert state interface.\r\n */\r\nexport interface IAlertState {\r\n visible: boolean;\r\n}\r\n\r\n/**\r\n * Cookie compliance view props interface.\r\n */\r\nexport interface ICookieComplianceViewProps extends IDlvryCookieComplianceProps<{}> {\r\n CookieComplianceBanner: IModuleProps;\r\n AlertProps: IAlertProps;\r\n Content: INodeProps;\r\n ButtonContainer: INodeProps;\r\n text?: React.ReactNode;\r\n links?: React.ReactNode;\r\n acceptButton?: React.ReactNode;\r\n acceptEssentialButton?: React.ReactNode;\r\n className: string;\r\n onDismiss(): void;\r\n}\r\n\r\n/**\r\n *\r\n * CookieCompliance component.\r\n * @extends {React.PureComponent>}\r\n */\r\nclass CookieCompliance extends React.PureComponent, IAlertState> {\r\n private readonly cookieRef: React.RefObject;\r\n\r\n private readonly telemetryContent: ITelemetryContent = getTelemetryObject(\r\n this.props.context.request.telemetryPageName!,\r\n this.props.friendlyName,\r\n this.props.telemetry\r\n );\r\n\r\n public constructor(props: IDlvryCookieComplianceProps) {\r\n super(props);\r\n this.state = { visible: false };\r\n this.cookieRef = React.createRef();\r\n this._onDismiss = this._onDismiss.bind(this);\r\n }\r\n\r\n public componentDidMount(): void {\r\n const { context } = this.props;\r\n const cookies = context.request.cookies as CookieContext;\r\n const hideCookieBannerCookie = !!cookies.get('_msdyn365__hcb_', true).value;\r\n\r\n if (!hideCookieBannerCookie && !context.request.cookies.isConsentGiven()) {\r\n this.setState({ visible: true });\r\n }\r\n\r\n if (context.request.cookies.isConsentGiven()) {\r\n try {\r\n if (this.props.config.clarity && window && (window as any).clarity) {\r\n try {\r\n const { customerInformation, organizationInformation } = this.props.data;\r\n\r\n if (customerInformation.result?.AccountNumber) {\r\n (window as any).clarity('set', 'customerId', customerInformation.result.AccountNumber);\r\n }\r\n\r\n if (organizationInformation.result?.AccountNumber) {\r\n (window as any).clarity('set', 'organizationCustomerId', organizationInformation.result.AccountNumber);\r\n }\r\n } catch (error) {\r\n console.error('Error while setting clarity consent cookie', error);\r\n }\r\n }\r\n } catch {\r\n // Do nothing\r\n }\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const { config, resources, telemetry } = this.props;\r\n const {\r\n acceptCookiesButtonText,\r\n acceptCookiesAriaLabel,\r\n acceptEssentialCookiesButtonText,\r\n acceptEssentialCookiesAriaLabel\r\n } = resources;\r\n const { visible } = this.state;\r\n\r\n let moduleConfig: IDlvryCookieComplianceConfig;\r\n\r\n try {\r\n moduleConfig = config;\r\n } catch (error) {\r\n telemetry.error(`Something went wrong while rendering the alert module ------${error}`);\r\n return
{error}
;\r\n }\r\n\r\n if (!visible) {\r\n return <>;\r\n }\r\n\r\n if (!MsDyn365.msdyn365Commerce.isBrowser) {\r\n return <>;\r\n }\r\n\r\n const viewProps: Partial = {\r\n ...this.props,\r\n // onDismiss: this._onDismiss,\r\n CookieComplianceBanner: {\r\n moduleProps: this.props,\r\n className: classnames('ms-cookie-compliance', moduleConfig.className),\r\n ref: this.cookieRef\r\n },\r\n AlertProps: {\r\n className: 'ms-cookie-compliance__container',\r\n color: 'white',\r\n fade: false\r\n },\r\n Content: {\r\n className: 'ms-cookie-compliance__content'\r\n },\r\n ButtonContainer: {\r\n className: 'ms-cookie-compliance__button-container'\r\n },\r\n text: moduleConfig.content && (\r\n \r\n ),\r\n links: ArrayExtensions.hasElements(moduleConfig.actionLinks) && (\r\n \r\n ),\r\n acceptButton: (\r\n this._onDismiss(true)}\r\n acceptCookiesButtonText={acceptCookiesButtonText}\r\n acceptCookiesButtonAriaLabel={acceptCookiesAriaLabel}\r\n telemetryContent={this.telemetryContent}\r\n />\r\n ),\r\n acceptEssentialButton: (\r\n this._onDismiss(false)}\r\n acceptEssentialCookiesButtonText={acceptEssentialCookiesButtonText}\r\n acceptEssentialCookiesButtonAriaLabel={acceptEssentialCookiesAriaLabel}\r\n telemetryContent={this.telemetryContent}\r\n />\r\n )\r\n };\r\n\r\n return this.props.renderView(viewProps as ICookieComplianceViewProps) as React.ReactElement;\r\n }\r\n\r\n /**\r\n * Handles Link content change event.\r\n * @param linkIndex - Index of link in linkarray.\r\n * @returns Void.\r\n */\r\n public handleLinkTextChange = (linkIndex: number) => (event: MsDyn365.ContentEditableEvent): void => {\r\n if (this.props.config.actionLinks?.[linkIndex]) {\r\n this.props.config.actionLinks[linkIndex].linkText = event.target.value;\r\n }\r\n };\r\n\r\n /**\r\n * Handles content change event.\r\n * @param event - Event.\r\n */\r\n public handleContentChange = (event: MsDyn365.ContentEditableEvent): void => {\r\n this.props.config.content = event.target.value;\r\n };\r\n\r\n private _onDismiss(consentAll: boolean): void {\r\n const { context, config } = this.props;\r\n const cookies = context.request.cookies as CookieContext;\r\n\r\n if (consentAll && cookies) {\r\n cookies.setConsentCookie();\r\n\r\n if (config.clarity && window && (window as any).clarity) {\r\n try {\r\n const { customerInformation, organizationInformation } = this.props.data;\r\n // Tell Clarity that the user has consented to all cookies\r\n (window as any).clarity('consent');\r\n\r\n if (customerInformation.result?.AccountNumber) {\r\n (window as any).clarity('set', 'customerId', customerInformation.result.AccountNumber);\r\n }\r\n\r\n if (organizationInformation.result?.AccountNumber) {\r\n (window as any).clarity('set', 'organizationCustomerId', organizationInformation.result.AccountNumber);\r\n }\r\n } catch (error) {\r\n console.error('Error while setting clarity consent cookie', error);\r\n }\r\n }\r\n\r\n location.reload();\r\n }\r\n\r\n if (!consentAll) {\r\n // Set cookie to hide the banner\r\n cookies.set('_msdyn365__hcb_', Date.now(), { path: '/', maxAge: 31536000, isEssential: true });\r\n }\r\n\r\n this.setState({ visible: false });\r\n }\r\n}\r\n\r\nexport default CookieCompliance;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { Alert, Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { ICookieComplianceViewProps } from './dlvry-cookie-compliance';\r\n\r\nconst CookieComplianceView: React.FC = props => {\r\n const {\r\n CookieComplianceBanner,\r\n AlertProps,\r\n Content,\r\n ButtonContainer,\r\n acceptButton,\r\n acceptEssentialButton,\r\n text,\r\n links\r\n } = props;\r\n\r\n return (\r\n \r\n \r\n \r\n {text}\r\n {links}\r\n \r\n \r\n {acceptButton}\r\n {acceptEssentialButton}\r\n \r\n \r\n \r\n );\r\n};\r\nexport default CookieComplianceView;\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['dlvry-cookie-compliance'] = {\n c: () => require('partner/modules/dlvry-cookie-compliance/dlvry-cookie-compliance.tsx'),\n $type: 'contentModule',\n da: [{name:'customerInformation', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer', runOn: 0},{name:'organizationInformation', path:'actions/get-organization-customer', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'dlvry-cookie-compliance',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/dlvry-cookie-compliance'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/get-organization-customer';\n let dataAction = require('partner/actions/get-organization-customer');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|dlvry-cookie-compliance|dlvry-cookie-compliance'] = {\n c: () => require('partner/modules/dlvry-cookie-compliance/dlvry-cookie-compliance.view.tsx'),\n cn: '__local__-__local__-dlvry-cookie-compliance'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["GetOrganizationCustomerInput","constructor","apiSettings","user","getDataServiceRequest","this","query","createDataServiceRequestForOperation","Entities","bypassCache","returnEntity","shouldCacheOutput","getCacheKey","getCacheObjectType","dataCacheType","DataServiceQuery","getOrganizationCustomerAction","async","input","ctx","requestContext","isAuthenticated","callActionOrExecute","getOrganizationCustomer","createObservableDataAction","id","action","inputData","_user$customerAccount","customerAccountNumber","CookieComplianceAcceptButton","_ref","acceptCookiesButtonText","acceptCookiesButtonAriaLabel","telemetryContent","onClose","payLoad","getPayloadObject","attributes","getTelemetryAttributes","React","Object","assign","type","className","onClick","CookieComplianceLinks","_mapEditableLinks","linkdata","length","editableLinks","forEach","link","index","props","linkText","contentAction","etext","editableLink","ariaLabel","linkUrl","destinationUrl","openInNewTab","role","additionalProperties","onTelemetryClick","push","render","links","Msdyn365","editProps","onTextChange","CookieComplianceAcceptEssentialButton","acceptEssentialCookiesButtonText","acceptEssentialCookiesButtonAriaLabel","CookieCompliance","super","getTelemetryObject","context","request","telemetryPageName","friendlyName","telemetry","handleLinkTextChange","linkIndex","event","_this$props$config$ac","config","actionLinks","target","value","handleContentChange","content","state","visible","cookieRef","_onDismiss","bind","componentDidMount","cookies","get","isConsentGiven","setState","clarity","window","_customerInformation$","_organizationInformat","customerInformation","organizationInformation","data","result","AccountNumber","error","console","_unused","resources","acceptCookiesAriaLabel","acceptEssentialCookiesAriaLabel","moduleConfig","MsDyn365","isBrowser","viewProps","_objectSpread","CookieComplianceBanner","moduleProps","classnames","ref","AlertProps","color","fade","Content","ButtonContainer","text","onEdit","ArrayExtensions","hasElements","acceptButton","acceptEssentialButton","renderView","consentAll","setConsentCookie","_customerInformation$2","_organizationInformat2","location","reload","set","Date","now","path","maxAge","isEssential","Module","Alert","Node","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","c","require","$type","da","name","runOn","iNM","ns","n","p","pdp","md","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}