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MAAO5B,EAAUS,sBAC7D/a,IAAAA,cAAA,UAAQmc,QA3FGS,KAC3BxC,GAAU,GACVT,GAAU,GACVC,GAAa,GACbnI,GAAc,GACduI,GAAe,EAAM,EAsFoCkC,MAAO5B,EAAUU,kBACtDhb,IAAAA,cAAA,OAAK2N,OAAO,OAAOkP,GAAG,UAAUC,QAAQ,MAAMC,QAAQ,cAAclP,MAAM,OAAOmP,SAAS,YACtFhd,IAAAA,cAAA,QAAMid,EAtHlC,geAsHqDC,KAAM9c,EAAMC,OAAOkP,qBAIxDvP,IAAAA,cAAA,OAAKkc,MAAO5B,EAAUW,oBAClBjb,IAAAA,cAACmd,GAAQ,CAACrJ,gBAAiB1B,EAAO/R,OAAQD,EAAOmL,SAAUA,EAAUkG,cAAeA,OAI9FwK,KAAkBjc,IAAAA,cAAA,OAAKkc,MAAO,CAAE1O,QAAS,OAAQQ,WAAY,aAAe5N,EAAMC,OAAO+c,yBACzF,iOCtId,SAAgBhd,IAEZ,MAAOsZ,EAAQC,GAAa3Z,EAAAA,UAAe,GACrCqd,yWAAClZ,CAAA,GACA/D,GAKDkd,EAAWC,aAAY,KAEf,qBADOhW,QACQA,OAAOgM,UAC5BoG,GAAU,GACV6D,cAAcF,GAAU,GAE7B,KAEH,OAAOtd,EAAAA,cAAA,OAAKyc,UAAU,OAAO/C,GAAU1Z,EAAAA,cAACyd,GAAIC,OAAAC,OAAA,GAAKN,IACpD","sources":["webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-pva-chat-connector/msdyn365-pva-chat-connector.tsx?797a","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce-modules/chat/node_modules/uuid/dist/esm-browser/rng.js?7d39","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce-modules/chat/node_modules/uuid/dist/esm-browser/regex.js?255d","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce-modules/chat/node_modules/uuid/dist/esm-browser/validate.js?f4cd","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce-modules/chat/node_modules/uuid/dist/esm-browser/stringify.js?688d","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce-modules/chat/node_modules/uuid/dist/esm-browser/v4.js?0bec","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-pva-chat-connector/proactive/triggers/proactive-chat-trigger.ts?ab51","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-pva-chat-connector/proactive/triggers/cart-amount-trigger.ts?b0a3","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-pva-chat-connector/proactive/triggers/cart-number-of-items-trigger.ts?5c1e","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-pva-chat-connector/proactive/triggers/cart-specific-product-trigger.ts?5985","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-pva-chat-connector/helpers/consts.ts?4dc3","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-pva-chat-connector/proactive/triggers/date-range-trigger.ts?d574","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-pva-chat-connector/proactive/triggers/from-specific-page-trigger.ts?37c0","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-pva-chat-connector/proactive/triggers/page-visits-trigger.ts?66a6","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-pva-chat-connector/proactive/triggers/specific-CountryRegion-trigger.ts?5c72","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-pva-chat-connector/proactive/triggers/specific-page-trigger.ts?9295","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-pva-chat-connector/proactive/triggers/wait-on-time-trigger.ts?63fd","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-pva-chat-connector/proactive/index.ts?ef6c","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-pva-chat-connector/helpers/ContextProvider.ts?20ff","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-pva-chat-connector/helpers/StyleComposers.ts?0cc6","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-pva-chat-connector/helpers/CommerceChatStore.ts?9abc","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-pva-chat-connector/components/ChatCore.tsx?1b5f","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-pva-chat-connector/components/Chat.tsx?5004","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-pva-chat-connector/msdyn365-pva-chat-connector.view.tsx?cb2f"],"sourcesContent":["/*!\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';\nimport { IMsdyn365PvaChatConnectorData } from './msdyn365-pva-chat-connector.data';\nimport { IMsdyn365PvaChatConnectorConfig, IMsdyn365PvaChatConnectorProps } from './msdyn365-pva-chat-connector.props.autogenerated';\n\nexport interface IPvaChatConnectorViewProps extends IMsdyn365PvaChatConnectorProps {\n config: IMsdyn365PvaChatConnectorConfig;\n}\n\n/**\n * PvaChatConnector component\n * @extends {React.PureComponent>}\n */\nclass PvaChatConnector extends React.PureComponent> {\n // Loads CDN version of Botframework-Webchat library\n public componentDidMount(): void {\n const url = this.props.config.botFrameworkCDNURL || this.props.context.app.config.pvaChatConnectorBotFrameworkCDNURL;\n const script = document.createElement('script');\n script.src = url;\n script.async = true;\n script.crossOrigin = 'anonymous';\n document.body.appendChild(script);\n }\n\n public render(): JSX.Element | null {\n return this.props.renderView(this.props);\n }\n}\n\nexport default PvaChatConnector;\n","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nvar getRandomValues;\nvar rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n // find the complete implementation of crypto (msCrypto) on IE11.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IProactiveChatTrigger } from '../../interfaces';\nimport { IChatContext, TContextProvider } from '../../../interfaces';\nimport { IPvaChatConnectorViewProps } from '../../msdyn365-pva-chat-connector';\n\n/**\n * ProactiveChatTrigger class - checks if Proactive Chat should be triggered, starts the chat and sets context\n */\nabstract class ProactiveChatTrigger implements IProactiveChatTrigger {\n public props: IPvaChatConnectorViewProps;\n public context: IChatContext;\n constructor(props: IPvaChatConnectorViewProps, context: IChatContext) {\n this.props = props;\n this.context = context;\n }\n\n /**\n * Generates Chat Context with included properties related to Proactive Chat\n * @returns TContextProvider - Chat Context\n */\n public abstract getContextProvider(): TContextProvider;\n\n /**\n * Generates chat welcome message to be used if Proactive Chat is triggered\n * @returns string - chat welcome message\n */\n public abstract getMessage(): string;\n\n /**\n * Validate specific trigger conditions if Proactive Chat should be initiated\n * @returns boolean (TRUE if Proactive Chat should be triggered)\n */\n public abstract validate(): Promise;\n}\n\nexport default ProactiveChatTrigger;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n// @ts-ignore\nimport { getCartState, ICartState } from '@msdyn365-commerce/global-state';\nimport { IChatContext, TContextProvider } from '../../../interfaces';\nimport { IPvaChatConnectorViewProps } from '../../msdyn365-pva-chat-connector';\nimport ProactiveChatTrigger from './proactive-chat-trigger';\n\n/**\n * CartAmountTrigger class - proactive chat is triggered if cArt amount is in preset boundaries (config.proactiveOnCartAmountMin, config.proactiveOnCartAmountMax)\n */\nclass CartAmountTrigger extends ProactiveChatTrigger {\n private min?: number;\n private max?: number;\n private totalInCart: number = 0;\n\n constructor(props: IPvaChatConnectorViewProps, context: IChatContext) {\n super(props, context);\n this.min = this.props.config.proactiveOnCartAmountMin;\n this.max = this.props.config.proactiveOnCartAmountMax;\n this.props.context.telemetry.debug(\n `[Chat][${CartAmountTrigger.name}] Cart amount proactive chat initialized with min: '${this.min}'; max: '${this.max}'.`\n );\n }\n\n public async validate(): Promise {\n const cart = await this._getCart();\n if (cart.isEmpty) {\n this.props.context.telemetry.debug(`[Chat][${CartAmountTrigger.name}] Cart was empty. Validation returning 'false'.`);\n return false;\n }\n\n this.totalInCart = cart.cart.TotalAmount || 0;\n let retVal = false;\n if (this.min) {\n if (this.max) {\n retVal = this.min <= this.totalInCart && this.totalInCart <= this.max;\n } else {\n retVal = this.min <= this.totalInCart;\n }\n } else {\n if (this.max) {\n retVal = this.totalInCart <= this.max;\n } else {\n retVal = false;\n }\n }\n this.props.context.telemetry.debug(\n `[Chat][${CartAmountTrigger.name}] Validation result: '${retVal}'; Cart total: '${this.totalInCart}'.`\n );\n return retVal;\n }\n\n public getContextProvider(): TContextProvider {\n return () => {\n return {\n ...this.context,\n eCommerceCustIsProactiveChat: 'True',\n eCommerceCustProactiveType: 'Cart Amount',\n eCommerceCustProactiveShoppingCartAmount: `${this.totalInCart}`\n };\n };\n }\n\n public getMessage(): string {\n // @TODO: Add message processing if needed\n return this.props.config.proactiveOnCartAmountMessage || this.props.config.proactiveDefaultMessage;\n }\n\n private async _getCart(): Promise {\n return getCartState(this.props.context.actionContext);\n }\n}\n\nexport default CartAmountTrigger;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n// @ts-ignore\nimport { getCartState, ICartState } from '@msdyn365-commerce/global-state';\nimport { IChatContext, TContextProvider } from '../../../interfaces';\nimport { IPvaChatConnectorViewProps } from '../../msdyn365-pva-chat-connector';\nimport ProactiveChatTrigger from './proactive-chat-trigger';\n\n/**\n * CartNumberOfItemsTrigger class - proactive chat is triggered if Cart Number of Items is in preset boundaries (config.proactiveOnCartNoOfItemsMin, config.proactiveOnCartNoOfItemsMax)\n */\nclass CartNumberOfItemsTrigger extends ProactiveChatTrigger {\n private min?: number;\n private max?: number;\n private numberOfItems: number = 0;\n\n constructor(props: IPvaChatConnectorViewProps, context: IChatContext) {\n super(props, context);\n this.min = this.props.config.proactiveOnCartNoOfItemsMin;\n this.max = this.props.config.proactiveOnCartNoOfItemsMax;\n\n this.props.context.telemetry.debug(\n `[${CartNumberOfItemsTrigger.name}] Cart number of items proactive chat initialized with min: '${this.min}'; max: '${this.max}'.`\n );\n }\n\n public async validate(): Promise {\n const cart = await this._getCart();\n if (cart.isEmpty) {\n this.props.context.telemetry.debug(`[Chat][${CartNumberOfItemsTrigger.name}] Cart was empty. Validation returning 'false'.`);\n return false;\n }\n\n this.numberOfItems = cart.cart.TotalItems || 0;\n\n let retVal = false;\n if (this.min) {\n if (this.max) {\n retVal = this.min <= this.numberOfItems && this.numberOfItems <= this.max;\n } else {\n retVal = this.min <= this.numberOfItems;\n }\n } else {\n if (this.max) {\n retVal = this.numberOfItems <= this.max;\n } else {\n retVal = false;\n }\n }\n this.props.context.telemetry.debug(\n `[${CartNumberOfItemsTrigger.name}] Validation result: '${retVal}'; Number of items in cart: '${this.numberOfItems}'.`\n );\n return retVal;\n }\n\n public getContextProvider(): TContextProvider {\n return () => {\n return {\n ...this.context,\n eCommerceCustIsProactiveChat: 'True',\n eCommerceCustProactiveType: 'Cart Number of Items',\n eCommerceCustProactiveShoppingCartNumberOfItems: `${this.numberOfItems}`\n };\n };\n }\n\n public getMessage(): string {\n // @TODO: Add message processing if needed\n return this.props.config.proactiveOnCartNoOfItemsMessage || this.props.config.proactiveDefaultMessage;\n }\n\n private async _getCart(): Promise {\n return getCartState(this.props.context.actionContext);\n }\n}\n\nexport default CartNumberOfItemsTrigger;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n// @ts-ignore\nimport { getCartState, ICartState } from '@msdyn365-commerce/global-state';\nimport { TContextProvider } from '../../../interfaces';\nimport ProactiveChatTrigger from './proactive-chat-trigger';\n\n/**\n * CartSpecificProductTrigger class - proactive chat is triggered if a Product in the Cart is in preset list of products (config.proactiveOnCartSpecificProductList)\n */\nclass CartSpecificProductTrigger extends ProactiveChatTrigger {\n private product: string = '';\n\n public async validate(): Promise {\n let isValid = false;\n const cart = await this._getCart();\n if (!cart.isEmpty) {\n if (cart.cart.CartLines) {\n this.props.context.telemetry.debug(\n `[${CartSpecificProductTrigger.name}] Number of cart line items was '${cart.cart.CartLines?.length}'`\n );\n for (let i = 0; i < cart.cart.CartLines?.length; i++) {\n if (cart.cart.CartLines[i]) {\n if (this.props.config.proactiveOnCartSpecificProductList) {\n this.props.context.telemetry.debug(\n `[${CartSpecificProductTrigger.name}] Number of cart specific products was configured for proactive chat was '${this.props.config.proactiveOnCartSpecificProductList?.length}'`\n );\n // Find first item, from user-defined list of products, that matches the cart lines' itemId in the cart.\n for (let j = 0; j < (this.props.config.proactiveOnCartSpecificProductList?.length || 0); j++) {\n if (\n this.props.config.proactiveOnCartSpecificProductList &&\n cart.cart.CartLines[i].ItemId &&\n this.props.config.proactiveOnCartSpecificProductList[j] === cart.cart.CartLines[i].ItemId\n ) {\n this.props.context.telemetry.debug(\n `[${CartSpecificProductTrigger.name}] Matched cart line item ID '${cart.cart.CartLines[i].ItemId}' against user-defined list of specific products for proactive chat.`\n );\n isValid = true;\n break;\n }\n }\n }\n } else {\n // Rest of the CartLines are undefined\n break;\n }\n }\n } else {\n this.props.context.telemetry.debug(`[Chat][${CartSpecificProductTrigger.name}] Cart did not contain any cart lines.`);\n }\n } else {\n this.props.context.telemetry.debug(`[Chat][${CartSpecificProductTrigger.name}] Cart was empty.`);\n }\n this.props.context.telemetry.debug(`[Chat][${CartSpecificProductTrigger.name}] Validation returning '${isValid}'.`);\n return isValid;\n }\n\n public getContextProvider(): TContextProvider {\n return () => {\n return {\n ...this.context,\n eCommerceCustIsProactiveChat: 'True',\n eCommerceCustProactiveType: 'Cart Specific Product',\n eCommerceCustProactiveShoppingCartSpecificProduct: `${this.product}`\n };\n };\n }\n\n public getMessage(): string {\n // @TODO: Add message processing if needed\n return this.props.config.proactiveOnCartSpecificProductMessage || this.props.config.proactiveDefaultMessage;\n }\n\n private async _getCart(): Promise {\n return getCartState(this.props.context.actionContext);\n }\n}\n\nexport default CartSpecificProductTrigger;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nexport enum ProactiveChatNames {\n DateRange = 'Date Range',\n FromSpecificPage = 'From Specific Page',\n PageVisits = 'Page Visits',\n SpecificLocation = 'Specific Location',\n SpecificPage = 'Specific Page',\n WaitOnTime = 'Wait On Time'\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ProactiveChatNames } from '../../helpers/consts';\nimport { IChatContext, TContextProvider } from '../../../interfaces';\nimport { IPvaChatConnectorViewProps } from '../../msdyn365-pva-chat-connector';\nimport ProactiveChatTrigger from './proactive-chat-trigger';\n\n/**\n * DateRangeTrigger class - proactive chat is triggered if current date is in preset date boundaries (config.proactiveOnDateRangeStart, config.proactiveOnDateRangeEnd)\n */\nclass DateRangeTrigger extends ProactiveChatTrigger {\n private start?: Date;\n private end?: Date;\n\n constructor(props: IPvaChatConnectorViewProps, context: IChatContext) {\n super(props, context);\n this.start = this._toDate(this.props.config.proactiveOnDateRangeStart);\n this.end = this._toDate(this.props.config.proactiveOnDateRangeEnd);\n\n this.props.context.telemetry.debug(\n `[${DateRangeTrigger.name}] Proactive chat initialized with startDate: '${this.start}'; max: '${this.end}'.`\n );\n }\n\n public async validate(): Promise {\n const now = new Date();\n now.setHours(0, 0, 0, 0);\n\n let retVal = false;\n if (this.start) {\n if (this.end) {\n retVal = this.start.getTime() <= now.getTime() && now.getTime() <= this.end.getTime();\n } else {\n retVal = this.start.getTime() <= now.getTime();\n }\n } else if (this.end) {\n retVal = now.getTime() <= this.end.getTime();\n }\n\n this.props.context.telemetry.debug(\n `[${DateRangeTrigger.name}] Validation result: '${retVal}'; Current date used to compare: '${now}'.`\n );\n return retVal;\n }\n\n public getContextProvider(): TContextProvider {\n return () => {\n return {\n ...this.context,\n eCommerceCustIsProactiveChat: 'True',\n eCommerceCustProactiveType: ProactiveChatNames.DateRange,\n eCommerceCustProactiveFromDate: this.start ? this.start.toUTCString() : '',\n eCommerceCustProactiveToDate: this.end ? this.end.toUTCString() : ''\n };\n };\n }\n\n public getMessage(): string {\n // @TODO: Add message processing if needed\n return this.props.config.proactiveOnDateRangeMessage || this.props.config.proactiveDefaultMessage;\n }\n\n /**\n * Converts string(us-en) to date\n * @param date string (mm/dd/yyyy)\n * @returns Date or undefined\n */\n private _toDate(date?: string): Date | undefined {\n if (date) {\n const dateParts = date.split('/');\n return new Date(+dateParts[2], +dateParts[1] - 1, +dateParts[0]);\n } else {\n return undefined;\n }\n }\n}\n\nexport default DateRangeTrigger;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ProactiveChatNames } from '../../helpers/consts';\nimport { TContextProvider } from '../../../interfaces';\nimport ProactiveChatTrigger from './proactive-chat-trigger';\n\n/**\n * FromSpecificPageTrigger class - proactive chat is triggered if user has come from specific page (the one listed in config.proactiveOnFromSpecificPageList)\n */\nclass FromSpecificPageTrigger extends ProactiveChatTrigger {\n public async validate(): Promise {\n let isValid = false;\n if (this.props.config.proactiveOnFromSpecificPageList) {\n this.props.context.telemetry.debug(\n `[${FromSpecificPageTrigger.name}] Number of items in user-defined list of 'From Specific Page' was '${this.props.config.proactiveOnFromSpecificPageList?.length}'.`\n );\n for (let i = 0; i < (this.props.config.proactiveOnFromSpecificPageList?.length || 0); i++) {\n const fromSpecificPageTrimmed: string = this.props.config.proactiveOnFromSpecificPageList[i].trim();\n this.props.context.telemetry.debug(\n `[Chat][${FromSpecificPageTrigger.name}] Current page URL: '${window.document.referrer}'.`\n );\n this.props.context.telemetry.debug(\n `[${FromSpecificPageTrigger.name}] Current item from user-defined list of 'From Specific Page': '${fromSpecificPageTrimmed}'.`\n );\n\n if (window.document.referrer.indexOf(fromSpecificPageTrimmed) > -1) {\n isValid = true;\n break;\n }\n }\n } else {\n this.props.context.telemetry.debug(\n `[Chat][${FromSpecificPageTrigger.name}] User-defined 'From Specific Page' list was undefined.`\n );\n }\n this.props.context.telemetry.debug(`[Chat][${FromSpecificPageTrigger.name}] Validation returning '${isValid}'.`);\n return isValid;\n }\n public getContextProvider(): TContextProvider {\n return () => {\n return {\n ...this.context,\n eCommerceCustIsProactiveChat: 'True',\n eCommerceCustProactiveType: ProactiveChatNames.FromSpecificPage,\n eCommerceCustProactiveCameFromPage: window.document.referrer\n };\n };\n }\n public getMessage(): string {\n // @TODO: Add message processing if needed\n return this.props.config.proactiveOnFromSpecificPageMessage || this.props.config.proactiveDefaultMessage;\n }\n}\n\nexport default FromSpecificPageTrigger;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICookieContext } from '@msdyn365-commerce/core-internal/dist/types/interfaces/context/ICookieContext';\nimport { ProactiveChatNames } from '../../helpers/consts';\nimport { IChatContext, TContextProvider } from '../../../interfaces';\nimport { IPvaChatConnectorViewProps } from '../../msdyn365-pva-chat-connector';\nimport ProactiveChatTrigger from './proactive-chat-trigger';\n\n/**\n * PageVisitTrigger class - proactive chat is triggered if user has visited current page for (config.proactiveOnPageVisitNumber) or more times\n */\nclass PageVisitTrigger extends ProactiveChatTrigger {\n public visits: number = 0;\n private cookieName: string = 'TimesPageVisited';\n private expdate: Date;\n private cookies: ICookieContext;\n\n constructor(props: IPvaChatConnectorViewProps, context: IChatContext) {\n super(props, context);\n this.cookies = this.props.context.request.cookies;\n this.expdate = new Date();\n // Set expiry date to 365 days.\n this.expdate.setTime(this.expdate.getTime() + 24 * 60 * 60 * 1000 * 365);\n this.props.context.telemetry.debug(`[Chat][${PageVisitTrigger.name}] Cookie expiry date set to: '${this.expdate}'.`);\n\n this.props.context.telemetry.debug(`[Chat][${PageVisitTrigger.name}] Cookie context is given: '${this.cookies.isConsentGiven()}'.`);\n if (this.cookies.isConsentGiven()) {\n this.cookies.setConsentCookie();\n }\n\n this._updateVisitCounter();\n }\n\n public async validate(): Promise {\n let retVal: boolean = false;\n\n if (this.props.config.proactiveOnPageVisitNumber) {\n retVal = this.visits >= this.props.config.proactiveOnPageVisitNumber;\n }\n\n this.props.context.telemetry.debug(`[Chat][${PageVisitTrigger.name}] Validation result: '${retVal}'.`);\n return retVal;\n }\n\n public clear(): void {\n this.props.context.telemetry.debug(`[Chat][${PageVisitTrigger.name}] Clearing cookie for page visit counter.`);\n this.cookies.set(this.cookieName, 0, {\n domain: window.location.hostname,\n path: window.location.pathname,\n expires: this.expdate\n });\n }\n\n public getContextProvider(): TContextProvider {\n return () => {\n return {\n ...this.context,\n eCommerceCustIsProactiveChat: 'True',\n eCommerceCustProactiveType: ProactiveChatNames.PageVisits,\n eCommerceCustProactiveNumberOfVisits: `${this.visits}`\n };\n };\n }\n\n public getMessage(): string {\n // @TODO: Add message processing if needed\n return this.props.config.proactiveOnPageVisitMessage || this.props.config.proactiveDefaultMessage;\n }\n\n private _updateVisitCounter(): void {\n this.visits = this.cookies.get(this.cookieName).value || 0;\n this.props.context.telemetry.debug(`[Chat][${PageVisitTrigger.name}] Page visit counter BEFORE update: '${this.visits}.`);\n ++this.visits;\n this.props.context.telemetry.debug(`[Chat][${PageVisitTrigger.name}] Page visit counter AFTER update: '${this.visits}.`);\n\n this.cookies.set(this.cookieName, this.visits, {\n domain: window.location.hostname,\n path: window.location.pathname,\n expires: this.expdate\n });\n }\n}\n\nexport default PageVisitTrigger;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ProactiveChatNames } from '../../helpers/consts';\nimport { IExtendedRequest } from '../../interfaces';\nimport { IChatContext, TContextProvider } from '../../../interfaces';\nimport { IPvaChatConnectorViewProps } from '../../msdyn365-pva-chat-connector';\nimport ProactiveChatTrigger from './proactive-chat-trigger';\n\n/**\n * SpecificPageTrigger class - proactive chat is triggered if user geographically uses the website from specific country/regions(config.proactiveOnSpecificCountryRegionCountry)\n */\nclass SpecificCountryRegionTrigger extends ProactiveChatTrigger {\n private customerCountryCode: string;\n constructor(props: IPvaChatConnectorViewProps, context: IChatContext) {\n super(props, context);\n this.customerCountryCode = (this.props.context.request).suggestedMarket || 'n/a';\n this.props.context.telemetry.debug(\n `[${SpecificCountryRegionTrigger.name}] Customer country code set to: '${this.customerCountryCode}.'`\n );\n }\n\n public async validate(): Promise {\n const retVal: boolean = this.props.config.proactiveOnSpecificLocation\n ? this.props.config.proactiveOnSpecificLocation.toLowerCase().indexOf(this.customerCountryCode.toLowerCase()) > -1\n : false;\n this.props.context.telemetry.debug(`[Chat][${SpecificCountryRegionTrigger.name}] Validation returning '${retVal}'.`);\n return retVal;\n }\n public getContextProvider(): TContextProvider {\n return () => {\n return {\n ...this.context,\n eCommerceCustIsProactiveChat: 'True',\n eCommerceCustProactiveCountryCode: this.props.config.proactiveOnSpecificLocation || '',\n eCommerceCustProactiveType: ProactiveChatNames.SpecificLocation\n };\n };\n }\n public getMessage(): string {\n // @TODO: Add message processing if needed\n return this.props.config.proactiveOnSpecificCountryRegionMessage || this.props.config.proactiveDefaultMessage;\n }\n}\n\nexport default SpecificCountryRegionTrigger;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ProactiveChatNames } from '../../helpers/consts';\nimport { TContextProvider } from '../../../interfaces';\nimport ProactiveChatTrigger from './proactive-chat-trigger';\n\n/**\n * SpecificPageTrigger class - proactive chat is triggered if current page is listed in config.proactiveOnSpecificPageList\n */\nclass SpecificPageTrigger extends ProactiveChatTrigger {\n public async validate(): Promise {\n let isValid = false;\n if (this.props.config.proactiveOnSpecificPageList) {\n this.props.context.telemetry.debug(\n `[${SpecificPageTrigger.name}] Number of items in user-defined list of 'Specific Pages' was '${this.props.config.proactiveOnSpecificPageList?.length}'.`\n );\n for (let i = 0; i < (this.props.config.proactiveOnSpecificPageList?.length || 0); i++) {\n const specificPageTrimmed: string = this.props.config.proactiveOnSpecificPageList[i].trim();\n this.props.context.telemetry.debug(`[] Current location URL: ${window.location.href}.`);\n this.props.context.telemetry.debug(`[] Current item from user-defined list of 'Specific Page': ${specificPageTrimmed}.`);\n if (window.location.href.indexOf(specificPageTrimmed) > -1) {\n isValid = true;\n break;\n }\n }\n } else {\n this.props.context.telemetry.debug(`[Chat][${SpecificPageTrigger.name}] User-defined 'Specific Page' list was undefined.`);\n }\n this.props.context.telemetry.debug(`[Chat][${SpecificPageTrigger.name}] Validation returning '${isValid}'.`);\n return isValid;\n }\n\n public getContextProvider(): TContextProvider {\n return () => {\n return {\n ...this.context,\n eCommerceCustIsProactiveChat: 'True',\n eCommerceCustProactiveType: ProactiveChatNames.SpecificPage\n };\n };\n }\n\n public getMessage(): string {\n // @TODO: Add message processing if needed\n return this.props.config.proactiveOnSpecificPageMessage || this.props.config.proactiveDefaultMessage;\n }\n}\n\nexport default SpecificPageTrigger;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ProactiveChatNames } from '../../helpers/consts';\nimport { IChatContext, TContextProvider } from '../../../interfaces';\nimport { IPvaChatConnectorViewProps } from '../../msdyn365-pva-chat-connector';\nimport ProactiveChatTrigger from './proactive-chat-trigger';\n\n/**\n * WaitOnTimeTrigger - proactive chat is triggered if user stays on current page for more than (config.proactiveOnWaitTimeSeconds) seconds\n */\nclass WaitOnTimeTrigger extends ProactiveChatTrigger {\n private waitTimeInMilliseconds: number | undefined;\n\n constructor(props: IPvaChatConnectorViewProps, context: IChatContext) {\n super(props, context);\n if (this.props.config.proactiveOnWaitTimeSeconds && !isNaN(this.props.config.proactiveOnWaitTimeSeconds)) {\n this.waitTimeInMilliseconds = Number(this.props.config.proactiveOnWaitTimeSeconds) * 1000;\n this.props.context.telemetry.debug(\n `[Chat][${WaitOnTimeTrigger.name}] Wait time (ms) set to: '${this.waitTimeInMilliseconds}'.`\n );\n }\n }\n\n public async validate(): Promise {\n const retVal: boolean = this.waitTimeInMilliseconds !== undefined;\n this.props.context.telemetry.debug(`[Chat][${WaitOnTimeTrigger.name}] Validation returning '${retVal}'.`);\n return retVal;\n }\n\n public getContextProvider(): TContextProvider {\n const triggerTime = Date.now() + (this.waitTimeInMilliseconds || 0);\n return () => {\n return triggerTime > Date.now()\n ? this.context\n : {\n ...this.context,\n eCommerceCustIsProactiveChat: 'True',\n eCommerceCustProactiveType: ProactiveChatNames.WaitOnTime,\n eCommerceCustProactiveTimeOnPage: `${this.waitTimeInMilliseconds ? this.waitTimeInMilliseconds : 0}`\n };\n };\n }\n\n public getMessage(): string {\n // @TODO: Add message processing if needed\n return this.props.config.proactiveOnWaitTimeMessage || this.props.config.proactiveDefaultMessage;\n }\n}\n\nexport default WaitOnTimeTrigger;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport CartAmountTrigger from './triggers/cart-amount-trigger';\nimport CartNumberOfItemsTrigger from './triggers/cart-number-of-items-trigger';\nimport CartSpecificProductTrigger from './triggers/cart-specific-product-trigger';\nimport DateRangeTrigger from './triggers/date-range-trigger';\nimport FromSpecificPageTrigger from './triggers/from-specific-page-trigger';\nimport PageVisitTrigger from './triggers/page-visits-trigger';\nimport SpecificCountryRegionTrigger from './triggers/specific-CountryRegion-trigger';\nimport SpecificPageTrigger from './triggers/specific-page-trigger';\nimport WaitOnTimeTrigger from './triggers/wait-on-time-trigger';\n\ntype ProactiveChat =\n | typeof DateRangeTrigger\n | typeof SpecificPageTrigger\n | typeof FromSpecificPageTrigger\n | typeof PageVisitTrigger\n | typeof SpecificCountryRegionTrigger\n | typeof CartAmountTrigger\n | typeof CartNumberOfItemsTrigger\n | typeof CartSpecificProductTrigger\n | typeof WaitOnTimeTrigger;\n\n/**\n * List of Proactive Chat Validators in order of validation (first proactive chat that pass validation is triggered, the rest are ommited)\n */\nexport const ProactiveTriggers: ProactiveChat[] = [\n DateRangeTrigger,\n SpecificPageTrigger,\n FromSpecificPageTrigger,\n PageVisitTrigger,\n SpecificCountryRegionTrigger,\n CartAmountTrigger,\n CartNumberOfItemsTrigger,\n CartSpecificProductTrigger,\n WaitOnTimeTrigger\n];\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IRequestContextUser } from '@msdyn365-commerce/core-internal/dist/types/interfaces/context/IRequestContext';\nimport { v4 as uuidv4 } from 'uuid';\nimport { ProactiveTriggers } from '../proactive';\nimport ProactiveChatTrigger from '../proactive/triggers/proactive-chat-trigger';\nimport { IPvaChatConnectorViewProps } from '../msdyn365-pva-chat-connector';\nimport { IProactiveData } from './../interfaces';\nimport { IChatContext, TContextProvider } from '../../interfaces';\n\n/**\n *\n * ContextProvider class - generates chat context, and checks for proactive triggers\n */\nclass ContextProvider {\n public data: IProactiveData;\n public props: IPvaChatConnectorViewProps;\n private user: IRequestContextUser;\n private userId: string;\n private context: IChatContext;\n private provider: TContextProvider | undefined;\n\n constructor(props: IPvaChatConnectorViewProps) {\n this.props = props;\n this.user = this.props.context.request.user;\n this.userId = `dl_${uuidv4()}`;\n this.context = this._getContext();\n // Proactive Chat related data\n this.data = {\n enabled: false,\n timeout: this.props.config.proactiveOnWaitTimeSeconds || 0,\n message: this.props.config.proactiveDefaultMessage\n };\n }\n\n /**\n * Executes Proactive Chat validation\n * @returns TContextProvider - a function returning IChatContext object\n */\n public async init(): Promise {\n try {\n await this._proactiveCheck();\n } catch (e) {\n // Use ?debug=true to see telemetry\n // If previous block fails, chat will still be available (no need to display any errors to user)\n this.props.telemetry.exception(e);\n }\n return this.provider || this._getProvider();\n }\n\n /**\n * Returns TContextProvider - a function returning IChatContext object\n */\n private _getProvider(): TContextProvider {\n return () => {\n return {\n eCommerceOperatingUnitNumber: this.props.context.request.apiSettings.oun,\n eCommerceBaseUrl: this.props.context.request.apiSettings.baseUrl,\n eCommerceDataAreaId: this.props.context.request.channel?.InventLocationDataAreaId,\n UserId: this.userId,\n // eCommerceCust...\n AccountNumber: this.user.customerAccountNumber ? this.user.customerAccountNumber : 'N/A',\n Email: this.user.emailAddress ? this.user.emailAddress : 'N/A',\n FirstName: this.user.firstName ? this.user.firstName : this.props.config.anonymousUserName,\n LastName: this.user.lastName ? this.user.lastName : 'N/A',\n Name: this.user.name ? this.user.name : this.props.config.anonymousUserName,\n eCommerceCustPageURL: window.location.href,\n eCommerceCustChatType: 'pva',\n // Proactive chat\n eCommerceCustIsProactiveChat: 'False',\n eCommerceCustProactiveType: 'N/A',\n // Date Range\n eCommerceCustProactiveFromDate: 'N/A',\n eCommerceCustProactiveToDate: 'N/A',\n // From Specific Page\n eCommerceCustProactiveCameFromPage: 'N/A',\n // No. Page Visits\n eCommerceCustProactiveNumberOfVisits: 'N/A',\n // Specific CountryRegion\n eCommerceCustProactiveCountryCode: 'N/A',\n // Specific Page => eCommerceCustPageURL\n // eCommerceCustProactiveSpecificPage: 'N/A',\n // Wait On Time\n eCommerceCustProactiveTimeOnPage: 'N/A',\n // Shopping cart amount\n eCommerceCustProactiveShoppingCartAmount: 'N/A',\n // Shopping cart number of items\n eCommerceCustProactiveShoppingCartNumberOfItems: 'N/A',\n // Shopping cart specific product\n eCommerceCustProactiveShoppingCartSpecificProduct: 'N/A'\n };\n };\n }\n\n /**\n * Returns default IChatContext object\n */\n private _getContext(): IChatContext {\n return this._getProvider()();\n }\n\n /**\n * Validates proactive triggers to check if proactive chat should be initialized\n */\n private async _proactiveCheck(): Promise {\n if (this.props.config.proactiveChatEnabled) {\n for (let i = 0; i < ProactiveTriggers.length; i++) {\n const proactive = new ProactiveTriggers[i](this.props, this.context);\n // Only first detected proactive trigger gets executed\n if (await this._isProactive(proactive)) {\n this.props.context.telemetry.debug(`First detected proactive trigger to be executed: ${proactive}`);\n break;\n }\n }\n }\n }\n\n /**\n * Validates if proactive chat should be triggered for given ProactiveTrigger\n * @param proactive ProactiveChatTrigger\n * @returns boolean\n */\n private async _isProactive(proactive: ProactiveChatTrigger): Promise {\n this.data.enabled = await proactive.validate();\n if (this.data.enabled) {\n this.provider = proactive.getContextProvider();\n this.data.message = proactive.getMessage();\n }\n return this.data.enabled;\n }\n}\n\nexport default ContextProvider;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/**\n * Style generating functions\n */\nimport { IAvatarStyling, IBubbleStyling, IChatCustomStyle, IChatStyling, IOtherStyling, ISuggestedActionStyling } from '../interfaces';\nimport { IMsdyn365PvaChatConnectorConfig } from '../msdyn365-pva-chat-connector.props.autogenerated';\n\nconst getChatWrapperStyle = (config: IMsdyn365PvaChatConnectorConfig): React.CSSProperties => {\n return {\n position: config.position || 'inherit',\n top: config.top ? config.top : 'inherit',\n right: config.right ? config.right : 'inherit',\n bottom: config.bottom ? config.bottom : 'inherit',\n left: config.left ? config.left : 'inherit',\n display: 'flex',\n justifyContent: 'flex-end'\n };\n};\n\nconst getMaximizedChatWrapperStyle = (config: IMsdyn365PvaChatConnectorConfig): React.CSSProperties => {\n return {\n height: config.chatHeight ? config.chatHeight : '80%',\n width: config.chatWidth ? config.chatWidth : 'inherit'\n };\n};\n\nconst getChatButtonStyle = (config: IMsdyn365PvaChatConnectorConfig): React.CSSProperties => {\n return {\n display: 'flex',\n alignItems: 'center',\n backgroundColor: config.startChatButtonBackgroundColor || 'inherit',\n color: config.startChatButtonTextColor || 'inherit',\n borderColor: config.startChatButtonBorderColor || 'inherit',\n borderRadius: config.startChatButtonBorderRadius || '0px',\n borderStyle: config.startChatButtonBorderStyle || 'solid',\n borderWidth: config.startChatButtonBorderWidth ? config.startChatButtonBorderWidth : '0px',\n padding: config.storeLogoURL ? '2px 20px 2px 2px' : '10px 20px 10px 20px',\n cursor: 'pointer',\n outlineStyle: 'none',\n alignSelf: 'flex-end',\n boxShadow: '0 0 4px rgba(102,102,102,.5)',\n WebkitBoxShadow: '0 0 4px rgba(102,102,102,.5)',\n MozBoxShadow: '0 0 4px rgba(102,102,102,.5)'\n };\n};\n\nconst getButtonStoreLogoStyle = (config: IMsdyn365PvaChatConnectorConfig): React.CSSProperties => {\n return {\n backgroundColor: config.headerBackgroundColor || 'inherit',\n color: config.headerTextColor || 'inherit',\n borderRadius: '50%',\n padding: '11px',\n width: '30px',\n height: '30px',\n marginRight: '12px',\n borderStyle: 'solid',\n borderWidth: '1px',\n boxSizing: 'content-box'\n };\n};\n\nconst getChatStoreLogoStyle = (config: IMsdyn365PvaChatConnectorConfig): React.CSSProperties => {\n return {\n backgroundColor: config.headerBackgroundColor || 'inherit',\n color: config.headerTextColor || 'inherit',\n borderRadius: '50%',\n padding: '11px',\n width: '30px',\n height: '30px',\n margin: '5px 12px 5px 5px',\n alignSelf: 'center',\n borderStyle: 'solid',\n borderWidth: '1px',\n boxSizing: 'content-box'\n };\n};\n\nconst getChatMessagesStyle = (config: IMsdyn365PvaChatConnectorConfig, minimized: boolean): React.CSSProperties => {\n return {\n display: minimized ? 'none' : 'block',\n backgroundColor: config.backgroundColor || 'White',\n height: '100%',\n width: '100%',\n boxSizing: 'border-box',\n position: 'relative'\n };\n};\n\nconst getChatMessageHeader = (config: IMsdyn365PvaChatConnectorConfig): React.CSSProperties => {\n config.chatHeaderHeight = config.chatHeaderHeight || '70px';\n return {\n backgroundColor: config.headerBackgroundColor || 'inherit',\n backgroundImage: `url(\"${config.headerBackgroundImageURL}\")` || 'none',\n color: config.headerTextColor || 'inherit',\n backgroundRepeat: 'no-repeat',\n display: 'flex',\n alignItems: 'flex-start',\n flexDirection: 'row',\n width: '100%',\n position: 'absolute',\n top: config.chatHeaderHeight ? `-${config.chatHeaderHeight}` : '',\n height: config.chatHeaderHeight,\n borderColor: config.headerBackgroundColor ? config.headerBackgroundColor : 'inherit',\n borderStyle: config.chatBorderStyle ? config.chatBorderStyle : 'none',\n borderWidth: config.chatBorderWidth ? config.chatBorderWidth : '0px'\n };\n};\n\nconst getMinimizeButtonStyle = (config: IMsdyn365PvaChatConnectorConfig): React.CSSProperties => {\n config.chatHeaderHeight = config.chatHeaderHeight || '70px';\n return {\n borderTop: 'none',\n borderLeft: 'none',\n borderRight: 'none',\n borderBottom: `solid 2px ${config.headerTextColor || 'White'}`,\n backgroundColor: 'transparent',\n padding: '5px 10px 3px 10px',\n cursor: 'pointer',\n outlineStyle: 'none',\n marginTop: '7px',\n marginRight: '7px'\n };\n};\n\nconst getCloseButtonStyle = (config: IMsdyn365PvaChatConnectorConfig): React.CSSProperties => {\n config.chatHeaderHeight = config.chatHeaderHeight || '70px';\n return {\n border: 'none',\n color: config.headerTextColor || 'White',\n backgroundColor: 'transparent',\n padding: '0px 0px 0px 7px',\n cursor: 'pointer',\n outlineStyle: 'none',\n marginTop: '7px',\n marginRight: '7px'\n };\n};\n\nconst getChatMessageContent = (config: IMsdyn365PvaChatConnectorConfig): React.CSSProperties => {\n config.chatHeaderHeight = config.chatHeaderHeight || '70px';\n return {\n height: '100%',\n width: '100%',\n borderColor: config.chatBorderColor ? config.chatBorderColor : 'inherit',\n borderStyle: config.chatBorderStyle ? config.chatBorderStyle : 'none',\n borderWidth: config.chatBorderWidth ? config.chatBorderWidth : '0px'\n };\n};\n\nconst getProactiveWrapperStyle = (config: IMsdyn365PvaChatConnectorConfig): React.CSSProperties => {\n return {\n flexDirection: 'column',\n display: 'flex',\n justifyContent: 'flex-end',\n backgroundColor: config.backgroundColor || 'White'\n };\n};\n\nconst getProactiveMessageHeader = (config: IMsdyn365PvaChatConnectorConfig): React.CSSProperties => {\n config.chatHeaderHeight = config.chatHeaderHeight || '70px';\n return {\n backgroundColor: config.headerBackgroundColor || 'inherit',\n backgroundImage: `url(\"${config.headerBackgroundImageURL}\")` || 'none',\n color: config.headerTextColor || 'inherit',\n backgroundRepeat: 'no-repeat',\n display: 'flex',\n alignItems: 'flex-start',\n flexDirection: 'row',\n boxSizing: 'border-box',\n width: '100%',\n height: config.chatHeaderHeight,\n borderColor: config.headerBackgroundColor ? config.headerBackgroundColor : 'inherit',\n borderStyle: config.chatBorderStyle ? config.chatBorderStyle : 'none',\n borderWidth: config.chatBorderWidth ? config.chatBorderWidth : '0px'\n };\n};\n\nconst getProactiveMessageContent = (config: IMsdyn365PvaChatConnectorConfig): React.CSSProperties => {\n config.chatHeaderHeight = config.chatHeaderHeight || '70px';\n return {\n width: '100%',\n padding: '10px 20px',\n boxSizing: 'border-box',\n borderColor: config.chatBorderColor ? config.chatBorderColor : 'inherit',\n borderStyle: config.chatBorderStyle ? config.chatBorderStyle : 'none',\n borderWidth: config.chatBorderWidth ? config.chatBorderWidth : '0px'\n };\n};\n\nconst getProactiveButtonStyle = (config: IMsdyn365PvaChatConnectorConfig): React.CSSProperties => {\n config.chatHeaderHeight = config.chatHeaderHeight || '70px';\n return {\n color: config.headerTextColor || 'inherit',\n cursor: 'pointer',\n padding: '5px 10px',\n outline: 'none',\n border: 'none',\n backgroundColor: config.headerBackgroundColor || 'inherit',\n borderRadius: '25px'\n };\n};\n\nconst getRedDotStyle = (config: IMsdyn365PvaChatConnectorConfig): React.CSSProperties => {\n return {\n background: 'Red',\n borderRadius: '50%',\n height: '5px',\n width: '5px',\n position: 'absolute',\n right: '10px',\n bottom: '33px'\n };\n};\n\n/**\n * Generates styles for the chat wrapper, and proactive chat parts\n * @param config IMsdyn365PvaChatConnectorConfig\n * @param minimized boolean\n * @returns IChatCustomStyle\n */\nexport const getChatStyling = (config: IMsdyn365PvaChatConnectorConfig, minimized: boolean): IChatCustomStyle => {\n return {\n ChatWrapperStyle: getChatWrapperStyle(config),\n MaximizedChatWrapperStyle: getMaximizedChatWrapperStyle(config),\n ChatButtonStyle: getChatButtonStyle(config),\n ButtonStoreLogoStyle: getButtonStoreLogoStyle(config),\n ChatStoreLogoStyle: getChatStoreLogoStyle(config),\n ChatMessagesStyle: getChatMessagesStyle(config, minimized),\n ChatMessageHeader: getChatMessageHeader(config),\n MinimizeButtonStyle: getMinimizeButtonStyle(config),\n CloseButtonStyle: getCloseButtonStyle(config),\n ChatMessageContent: getChatMessageContent(config),\n ProactiveWrapperStyle: getProactiveWrapperStyle(config),\n ProactiveMessageHeader: getProactiveMessageHeader(config),\n ProactiveMessageContent: getProactiveMessageContent(config),\n ProactiveButtonStyle: getProactiveButtonStyle(config),\n RedDotStyle: getRedDotStyle(config)\n };\n};\n\nconst fontFormat = (font?: string): string | undefined => {\n if (font && font.length > 0) {\n const arr = font.split(',');\n for (let i = 0; i < arr.length; i++) {\n arr[i] = `'${arr[i].trim()}'`;\n }\n font = arr.join(', ');\n } else {\n font = \"'Calibri', 'Helvetica Neue', 'Arial', 'sans-serif'\";\n }\n\n return font;\n};\n\nconst getBubbleStyling = (config: IMsdyn365PvaChatConnectorConfig): IBubbleStyling => {\n return {\n bubbleBackground: config.bubbleBackground || 'White',\n bubbleTextColor: config.bubbleTextColor || 'Black',\n bubbleBorderColor: config.bubbleBorderColor || '#e6e6e6',\n bubbleBorderRadius: config.bubbleBorderRadius || '2',\n bubbleBorderStyle: config.bubbleBorderStyle || 'solid',\n bubbleBorderWidth: config.bubbleBorderWidth || '1',\n bubbleFromUserBackground: config.bubbleFromUserBackground || 'White',\n bubbleFromUserTextColor: config.bubbleFromUserTextColor || 'Black',\n bubbleFromUserBorderColor: config.bubbleFromUserBorderColor || '#e6e6e6',\n bubbleFromUserBorderRadius: config.bubbleFromUserBorderRadius || '2',\n bubbleFromUserBorderStyle: config.bubbleFromUserBorderStyle || 'solid',\n bubbleFromUserBorderWidth: config.bubbleFromUserBorderWidth || '1'\n };\n};\n\n// eslint-disable-next-line complexity\nconst getOtherStyling = (config: IMsdyn365PvaChatConnectorConfig): IOtherStyling => {\n return {\n groupTimestamp: config.groupTimestamp || true,\n sendTimeout: config.sendTimeout || '20000',\n sendTimeoutForAttachments: config.sendTimeoutForAttachments || '120000',\n timestampColor: config.timestampColor || 'undefined',\n timestampFormat: config.timestampFormat || 'undefined',\n notificationDebounceTimeout: config.notificationDebounceTimeout || '400',\n hideToaster: config.hideToaster || true,\n toasterHeight: config.toasterHeight || '32',\n toasterMaxHeight: config.toasterMaxHeight || '32 * 5',\n toasterSingularMaxHeight: config.toasterSingularMaxHeight || '50',\n toastFontSize: config.toastFontSize || '87.5%',\n toastIconWidth: config.toastIconWidth || '36',\n toastSeparatorColor: config.toastSeparatorColor || '#E8EAEC',\n toastTextPadding: config.toastTextPadding || '6',\n toastErrorBackgroundColor: config.toastErrorBackgroundColor || '#FDE7E9',\n toastErrorColor: config.toastErrorColor || '#A80000',\n toastInfoBackgroundColor: config.toastInfoBackgroundColor || '#CEF1FF',\n toastInfoColor: config.toastInfoColor || '#105E7D',\n toastSuccessBackgroundColor: config.toastSuccessBackgroundColor || '#DFF6DD',\n toastSuccessColor: config.toastSuccessColor || '#107C10',\n toastWarnBackgroundColor: config.toastWarnBackgroundColor || '#FFF4CE',\n toastWarnColor: config.toastWarnColor || '#3B3A39',\n typingAnimationBackgroundImage: config.typingAnimationBackgroundImage || 'undefined',\n typingAnimationDuration: config.typingAnimationDuration || '5000',\n typingAnimationHeight: config.typingAnimationHeight || '20',\n typingAnimationWidth: config.typingAnimationWidth || '64',\n videoHeight: config.videoHeight || '270',\n markdownExternalLinkIconImage:\n config.markdownExternalLinkIconImage ||\n 'url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcuMjUwMSA0LjUwMDE3SDEwLjc0OTVDMTEuMTYzNyA0LjUwMDE3IDExLj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NMMjAuNTU5IDMuMDY4MDNDMjAuNjEyMiAzLjA5MTIyIDIwLjY2MzQgMy4xMjE2MyAyMC43MTExIDMuMTU4ODVMMjAuNzgwNCAzLjIyMTU2TDIwLjg2NDEgMy4zMjAxNEwyMC45MTgzIDMuNDEwMjVMMjAuOTU3IDMuNTAwNTdMMjAuOTc2MiAzLjU2NDc2TDIwLjk4OTggMy42Mjg2MkwyMC45OTkyIDMuNzIyODJMMjAuOTk5NyAxMC4yNTU0QzIwLjk5OTcgMTAuNjY5NiAyMC42NjM5IDExLjAwNTQgMjAuMjQ5NyAxMS4wMDU0QzE5Ljg3IDExLjAwNTQgMTkuNTU2MiAxMC43MjMyIDE5LjUwNjUgMTAuMzU3MUwxOS40OTk3IDEwLjI1NTRMMTkuNDk4OSA1LjU2MTQ3TDEyLjI3OTcgMTIuNzg0N0MxMi4wMTM0IDEzLjA1MSAxMS41OTY4IDEzLjA3NTMgMTEuMzAzMSAxMi44NTc1TDExLjIxOSAxMi43ODQ5QzEwLjk1MjcgMTIuNTE4NyAxMC45Mjg0IDEyLjEwMjEgMTEuMTQ2MiAxMS44MDg0TDExLjIxODggMTEuNzI0M0wxOC40MzY5IDQuNTAxNDZIMTMuNzQ4MUMxMy4zNjg0IDQuNTAxNDYgMTMuMDU0NiA0LjIxOTMxIDEzLjAwNSAzLjg1MzI0TDEyLjk5ODEgMy43NTE0NkMxMi45OTgxIDMuMzcxNzcgMTMuMjgwMyAzLjA1Nzk3IDEzLjY0NjQgMy4wMDgzMUwxMy43NDgxIDMuMDAxNDZaIiBmaWxsPSIjMjEyMTIxIiAvPjwvc3ZnPg==)',\n markdownRespectCRLF: config.markdownRespectCRLF || 'true',\n internalLiveRegionFadeAfter: config.internalLiveRegionFadeAfter || '1000',\n accent: config.accent || '#0063B1',\n subtle: config.subtle || '#767676'\n };\n};\n\nconst getAvatarStyling = (config: IMsdyn365PvaChatConnectorConfig): IAvatarStyling => {\n return {\n avatarBorderRadius: config.avatarBorderRadius || '50%',\n avatarSize: config.avatarSize || '40',\n botAvatarBackgroundColor: config.botAvatarBackgroundColor || 'undefined',\n botAvatarImage: config.botAvatarImage || '',\n botAvatarInitials: config.botAvatarInitials || '',\n userAvatarBackgroundColor: config.userAvatarBackgroundColor || 'undefined',\n userAvatarImage: config.userAvatarImage || '',\n userAvatarInitials: config.userAvatarInitials || '',\n showAvatarInGroup: config.showAvatarInGroup || 'status'\n };\n};\n\nconst getSuggestedActionStyling = (config: IMsdyn365PvaChatConnectorConfig): ISuggestedActionStyling => {\n return {\n suggestedActionLayout: config.suggestedActionLayout || 'carousel',\n suggestedActionBackground: config.suggestedActionBackground || 'White',\n suggestedActionTextColor: config.suggestedActionTextColor || '',\n suggestedActionBorderColor: config.suggestedActionBorderColor || '',\n suggestedActionBorderRadius: config.suggestedActionBorderRadius || '0',\n suggestedActionBorderStyle: config.suggestedActionBorderStyle || 'solid',\n suggestedActionBorderWidth: config.suggestedActionBorderWidth || '2',\n suggestedActionDisabledBorderStyle: config.suggestedActionDisabledBorderStyle || 'solid',\n suggestedActionDisabledBorderWidth: config.suggestedActionDisabledBorderWidth || '2',\n suggestedActionDisabledTextColor: config.suggestedActionDisabledTextColor || '',\n suggestedActionHeight: config.suggestedActionHeight || '40',\n suggestedActionImageHeight: config.suggestedActionImageHeight || '20',\n suggestedActionsCarouselFlipperCursor: config.suggestedActionsCarouselFlipperCursor || '',\n suggestedActionsCarouselFlipperBoxWidth: config.suggestedActionsCarouselFlipperBoxWidth || '40',\n suggestedActionsCarouselFlipperSize: config.suggestedActionsCarouselFlipperSize || '20',\n suggestedActionsFlowMaxHeight: config.suggestedActionsFlowMaxHeight || '',\n suggestedActionsStackedHeight: config.suggestedActionsStackedHeight || '',\n suggestedActionsStackedOverflow: config.suggestedActionsStackedOverflow || '2',\n suggestedActionsStackedLayoutButtonMaxHeight: config.suggestedActionsStackedLayoutButtonMaxHeight || '',\n suggestedActionsStackedLayoutButtonTextWrap: config.suggestedActionsStackedLayoutButtonTextWrap || false\n };\n};\n\n/**\n * Generates style options for the Botframework-WebChat widget\n * @param config IMsdyn365PvaChatConnectorConfig\n * @returns IChatStyling\n */\nexport const getChatStyleOptions = (config: IMsdyn365PvaChatConnectorConfig): IChatStyling => {\n const bubbleStyling = getBubbleStyling(config);\n const avatarStyling = getAvatarStyling(config);\n const suggestedActionStyling = getSuggestedActionStyling(config);\n const otherStyling = getOtherStyling(config);\n return {\n hideUploadButton: true,\n primaryFont: fontFormat(config.primaryFont),\n backgroundColor: config.backgroundColor || 'White',\n ...bubbleStyling,\n ...avatarStyling,\n ...suggestedActionStyling,\n ...otherStyling\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport React from 'react';\nimport { IAction, IDispatch, INext } from '../interfaces';\nimport { TContextProvider } from '../../interfaces';\nimport { IPvaChatConnectorViewProps } from '../msdyn365-pva-chat-connector';\n\nexport class CommerceChatStore {\n private props: IPvaChatConnectorViewProps;\n private setNewMessageAction: React.Dispatch>;\n private provider?: TContextProvider;\n\n /**\n * Gets conversation token\n * @param props IPvaChatConnectorViewProps\n */\n public static async getDirectLineToken(props: IPvaChatConnectorViewProps): Promise {\n if (props.config.powervaDirectlineTokenURL && props.config.botID && props.config.tenantID) {\n // use direct line token url, bot id and tenant id from module config to get conversation token\n const url = `${props.config.powervaDirectlineTokenURL}?botId=${props.config.botID}&tenantId=${props.config.tenantID}`;\n const options = { method: 'GET' };\n return fetch(url, options)\n .then(r => r.json())\n .then(r => {\n if (r.token) {\n return r.token;\n } else {\n throw r;\n }\n });\n }\n\n // use direct line token url, bot id and tenant id from app config to get conversation token\n const url = `${props.context.app.config.pvaChatConnectorPowervaDirectlineTokenURL}?botId=${props.context.app.config.pvaChatConnectorBotID}&tenantId=${props.context.app.config.pvaChatConnectorTenantID}`;\n const options = {\n method: 'GET'\n };\n return fetch(url, options)\n .then(r => r.json())\n .then(r => {\n if (r.token) {\n return r.token;\n } else {\n throw r;\n }\n });\n }\n\n /**\n * Creates a new instance of commerce store for WebChat\n * @param props IPvaChatConnectorViewProps\n * @param provider TContextProvider\n * @param setNewMessage React.Dispatch>\n */\n constructor(\n props: IPvaChatConnectorViewProps,\n provider: TContextProvider | undefined,\n setNewMessage: React.Dispatch>\n ) {\n this.props = props;\n this.provider = provider;\n this.setNewMessageAction = setNewMessage;\n }\n\n /**\n * Handles custom chat actions\n * @param param0 {\n * dispatch: IDispatch;\n * next: INext;\n * action: IAction;\n * }\n */\n public async actionHandler({ dispatch, next, action }: { dispatch: IDispatch; next: INext; action: IAction }): Promise {\n const atype = action.type;\n\n switch (atype) {\n case 'DIRECT_LINE/CONNECT_FULFILLED': {\n // sets language\n dispatch({\n type: 'WEB_CHAT/SEND_EVENT',\n payload: {\n name: 'webchat/join',\n value: { language: window.navigator.language }\n }\n });\n break;\n }\n case 'DIRECT_LINE/INCOMING_ACTIVITY': {\n const activity = action.payload.activity;\n if (activity?.from?.role === 'bot') {\n // Sets flag for new message (will be use to indicate new messages from bot when chat is minimized)\n this.setNewMessageAction(true);\n }\n break;\n }\n case 'DIRECT_LINE/POST_ACTIVITY_FULFILLED': {\n switch (action.payload.activity.name) {\n case 'webchat/join':\n {\n if (this.provider !== undefined) {\n // Sets Chat Context\n dispatch({\n type: 'WEB_CHAT/SEND_EVENT',\n payload: {\n name: 'pvaSetContext',\n value: this.provider()\n }\n });\n }\n }\n break;\n case 'pvaSetContext':\n {\n if (this.props.config.triggerQuery) {\n // Initialize chat after Chat Context is set\n dispatch({\n type: 'WEB_CHAT/SEND_MESSAGE_BACK',\n payload: {\n text: this.props.config.triggerQuery\n }\n });\n }\n }\n break;\n default: {\n // default nothing\n }\n }\n break;\n }\n default: {\n // default nothing\n }\n }\n\n return next(action);\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport React, { FunctionComponent, useMemo, useState } from 'react';\nimport { getChatStyleOptions } from '../helpers/StyleComposers';\nimport { IChatCoreProps, IAction, IDispatch } from '../interfaces';\nimport { CommerceChatStore } from '../helpers/CommerceChatStore';\n\n/**\n * Just a core Chat component\n * @param props\n */\n\nconst ChatCore: FunctionComponent = (props: IChatCoreProps) => {\n const { ReactWebChat } = window.WebChat;\n\n const [userId, setUserId] = useState('');\n useMemo(() => {\n if (props.provider) {\n const ctx = props.provider();\n if (ctx.UserId) {\n setUserId(typeof ctx.UserId === 'string' ? ctx.UserId : ctx.UserId.value.toString());\n }\n }\n }, [props.provider]);\n\n const directLine = useMemo(() => {\n return window.WebChat.createDirectLine({ token: props.directLineToken });\n }, [props.directLineToken]);\n\n const commerceChatStore = useMemo(() => {\n if (directLine && props.provider) {\n return new CommerceChatStore(props.config, props.provider, props.setNewMessage);\n }\n return undefined;\n }, [props.provider, directLine]);\n\n const store = useMemo(() => {\n return window.WebChat.createStore(\n {},\n ({ dispatch }: { dispatch: IDispatch }) => (next: (action: IAction) => IDispatch) => (action: IAction) => {\n commerceChatStore?.actionHandler({ dispatch, next, action });\n }\n );\n }, [commerceChatStore]);\n const styleOptions = getChatStyleOptions(props.config.config);\n\n return props.directLineToken !== '' ? (\n \n ) : (\n

Please wait while we are connecting.

\n );\n};\n\nexport default ChatCore;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport React, { FunctionComponent, useEffect, useState } from 'react';\nimport ContextProvider from '../helpers/ContextProvider';\nimport { getChatStyling } from '../helpers/StyleComposers';\nimport { TContextProvider } from '../../interfaces';\nimport { IPvaChatConnectorViewProps } from '../msdyn365-pva-chat-connector';\nimport { CommerceChatStore } from '../helpers';\nimport ChatCore from './ChatCore';\n\nconst INVALID_TOKEN = 'INVALID_TOKEN';\nconst CLOSE_IMG_DATA =\n 'M443.6,387.1L312.4,255.4l131.5-130c5.4-5.4,5.4-14.2,0-19.6l-37.4-37.6c-2.6-2.6-6.1-4-9.8-4c-3.7,0-7.2,1.5-9.8,4 L256,197.8L124.9,68.3c-2.6-2.6-6.1-4-9.8-4c-3.7,0-7.2,1.5-9.8,4L68,105.9c-5.4,5.4-5.4,14.2,0,19.6l131.5,130L68.4,387.1 c-2.6,2.6-4.1,6.1-4.1,9.8c0,3.7,1.4,7.2,4.1,9.8l37.4,37.6c2.7,2.7,6.2,4.1,9.8,4.1c3.5,0,7.1-1.3,9.8-4.1L256,313.1l130.7,131.1 c2.7,2.7,6.2,4.1,9.8,4.1c3.5,0,7.1-1.3,9.8-4.1l37.4-37.6c2.6-2.6,4.1-6.1,4.1-9.8C447.7,393.2,446.2,389.7,443.6,387.1z';\n\n/**\n * Outer chat component, displays chat button, and proactive chat, and handles custom actions\n * @param props IPvaChatConnectorViewProps\n */\nconst Chat: FunctionComponent = (props: IPvaChatConnectorViewProps) => {\n const [loaded, setLoaded] = useState(false); // loaded & minimized are needed as ChatWidget should not be removed from DOM (it resets chat)\n const [minimized, setMinimized] = useState(true);\n const [newMessage, setNewMessage] = useState(false); // TODO: use this to indicate new message in minimized chat\n const [token, setToken] = useState(''); // holds conversation token for WebChat\n const [isProactive, setIsProactive] = useState(false); // if proactive chat is triggered\n const [proactiveMessage, setProactiveMessage] = useState(props.config.proactiveDefaultMessage);\n const [closed, setClosed] = useState(false);\n const [provider, setProvider] = useState();\n const chatStyle = getChatStyling(props.config, minimized); // generates chat style objects based on configuration\n const handleMaximizeButtonClick = () => {\n setLoaded(true);\n setMinimized(false);\n setNewMessage(false);\n };\n const handleMinimizeButtonClick = () => {\n setMinimized(true);\n setNewMessage(false);\n };\n const handleCloseButtonClick = () => {\n setClosed(true);\n setLoaded(false);\n setMinimized(true);\n setNewMessage(false);\n setIsProactive(false);\n };\n useEffect(() => {\n if (loaded) {\n CommerceChatStore.getDirectLineToken(props)\n .then(directLineToken => {\n setToken(directLineToken);\n })\n .catch(e => {\n setToken(INVALID_TOKEN);\n props.telemetry.exception(e);\n });\n }\n }, [loaded]);\n useEffect(() => {\n (async () => {\n const contextProvider = new ContextProvider(props); // Generates context (provider) and checks for proactive chat triggers\n const prov = await contextProvider.init();\n if (contextProvider.data.enabled) {\n props.context.telemetry.debug(`[Chat] Proactive chat was enabled: '${contextProvider.data.enabled}'.`);\n // if proactive chat is triggered\n const timeout = contextProvider.data.timeout * 1000; // timeout is there only for WaitOnTime trigger\n setTimeout(() => {\n if (!loaded) {\n props.context.telemetry.debug(`[Chat] Proactive chat was loaded: ${loaded}.`);\n setProactiveMessage(contextProvider.data.message);\n setIsProactive(true);\n }\n }, timeout);\n }\n setProvider(() => prov);\n })().catch(e => props.telemetry.exception(e));\n }, []);\n useEffect(() => {\n if (closed) {\n setClosed(false);\n }\n }, [token, provider]);\n const isValidToken = (): boolean => {\n return `${token}` !== INVALID_TOKEN;\n };\n return (\n \n {minimized && (!isProactive || (isProactive && loaded)) && (\n \n )}\n {minimized && isProactive && !loaded && (\n
\n
\n {props.config.storeLogoURL && (\n logo\n )}\n
\n
\n
\n

{proactiveMessage}

\n \n
\n
\n )}\n {loaded && isValidToken() && (\n
\n
\n {props.config.storeLogoURL && (\n logo\n )}\n
\n \n
\n
\n \n
\n
\n )}\n {!isValidToken() &&
{props.config.unableToLoadChatMessage}
}\n
\n );\n};\n\nexport default Chat;\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';\nimport Chat from './components/Chat';\nimport { IPvaChatConnectorViewProps } from './msdyn365-pva-chat-connector';\n\nexport default (props: IPvaChatConnectorViewProps) => {\n // Only for CDN loading check, won't be needed with npm package of Botframework-WebChat\n const [loaded, setLoaded] = React.useState(false);\n const p = {\n ...props\n };\n\n // Just to verify that CDN Chat Widget js lib is loaded\n // Remove this block if moving to npm package of Botframework-WebChat\n const interval = setInterval(() => {\n const t = typeof window;\n if (t !== 'undefined' && window.WebChat) {\n setLoaded(true);\n clearInterval(interval);\n }\n }, 100);\n\n return
{loaded && }
;\n};\n"],"names":["PvaChatConnector","React","componentDidMount","url","this","props","config","botFrameworkCDNURL","context","app","pvaChatConnectorBotFrameworkCDNURL","script","document","createElement","src","async","crossOrigin","body","appendChild","render","renderView","getRandomValues","rnds8","Uint8Array","rng","crypto","bind","msCrypto","Error","uuid","REGEX","test","byteToHex","i","push","toString","substr","arr","offset","arguments","length","undefined","toLowerCase","validate","TypeError","options","buf","rnds","random","stringify","constructor","CartAmountTrigger","ProactiveChatTrigger","super","totalInCart","min","proactiveOnCartAmountMin","max","proactiveOnCartAmountMax","telemetry","debug","name","cart","_getCart","isEmpty","TotalAmount","retVal","getContextProvider","_objectSpread","eCommerceCustIsProactiveChat","eCommerceCustProactiveType","eCommerceCustProactiveShoppingCartAmount","getMessage","proactiveOnCartAmountMessage","proactiveDefaultMessage","getCartState","actionContext","CartNumberOfItemsTrigger","numberOfItems","proactiveOnCartNoOfItemsMin","proactiveOnCartNoOfItemsMax","TotalItems","eCommerceCustProactiveShoppingCartNumberOfItems","proactiveOnCartNoOfItemsMessage","CartSpecificProductTrigger","product","isValid","CartLines","_cart$cart$CartLines","_cart$cart$CartLines2","proactiveOnCartSpecificProductList","_this$props$config$pr","j","_this$props$config$pr2","ItemId","eCommerceCustProactiveShoppingCartSpecificProduct","proactiveOnCartSpecificProductMessage","ProactiveChatNames","DateRangeTrigger","start","_toDate","proactiveOnDateRangeStart","end","proactiveOnDateRangeEnd","now","Date","setHours","getTime","DateRange","eCommerceCustProactiveFromDate","toUTCString","eCommerceCustProactiveToDate","proactiveOnDateRangeMessage","date","dateParts","split","FromSpecificPageTrigger","proactiveOnFromSpecificPageList","fromSpecificPageTrimmed","trim","window","referrer","indexOf","FromSpecificPage","eCommerceCustProactiveCameFromPage","proactiveOnFromSpecificPageMessage","PageVisitTrigger","visits","cookieName","cookies","request","expdate","setTime","isConsentGiven","setConsentCookie","_updateVisitCounter","proactiveOnPageVisitNumber","clear","set","domain","location","hostname","path","pathname","expires","PageVisits","eCommerceCustProactiveNumberOfVisits","proactiveOnPageVisitMessage","get","value","SpecificCountryRegionTrigger","customerCountryCode","suggestedMarket","proactiveOnSpecificLocation","eCommerceCustProactiveCountryCode","SpecificLocation","proactiveOnSpecificCountryRegionMessage","SpecificPageTrigger","proactiveOnSpecificPageList","specificPageTrimmed","href","SpecificPage","proactiveOnSpecificPageMessage","WaitOnTimeTrigger","proactiveOnWaitTimeSeconds","isNaN","waitTimeInMilliseconds","Number","triggerTime","WaitOnTime","eCommerceCustProactiveTimeOnPage","proactiveOnWaitTimeMessage","ProactiveTriggers","user","userId","uuidv4","_getContext","data","enabled","timeout","message","_proactiveCheck","e","exception","provider","_getProvider","_this$props$context$r","eCommerceOperatingUnitNumber","apiSettings","oun","eCommerceBaseUrl","baseUrl","eCommerceDataAreaId","channel","InventLocationDataAreaId","UserId","AccountNumber","customerAccountNumber","Email","emailAddress","FirstName","firstName","anonymousUserName","LastName","lastName","Name","eCommerceCustPageURL","eCommerceCustChatType","proactiveChatEnabled","proactive","_isProactive","getChatWrapperStyle","position","top","right","bottom","left","display","justifyContent","getMaximizedChatWrapperStyle","height","chatHeight","width","chatWidth","getChatButtonStyle","alignItems","backgroundColor","startChatButtonBackgroundColor","color","startChatButtonTextColor","borderColor","startChatButtonBorderColor","borderRadius","startChatButtonBorderRadius","borderStyle","startChatButtonBorderStyle","borderWidth","startChatButtonBorderWidth","padding","storeLogoURL","cursor","outlineStyle","alignSelf","boxShadow","WebkitBoxShadow","MozBoxShadow","getButtonStoreLogoStyle","headerBackgroundColor","headerTextColor","marginRight","boxSizing","getChatStoreLogoStyle","margin","getChatMessagesStyle","minimized","getChatMessageHeader","chatHeaderHeight","backgroundImage","headerBackgroundImageURL","backgroundRepeat","flexDirection","chatBorderStyle","chatBorderWidth","getMinimizeButtonStyle","borderTop","borderLeft","borderRight","borderBottom","marginTop","getCloseButtonStyle","border","getChatMessageContent","chatBorderColor","getProactiveWrapperStyle","getProactiveMessageHeader","getProactiveMessageContent","getProactiveButtonStyle","outline","fontFormat","font","join","CommerceChatStore","setNewMessage","setNewMessageAction","static","powervaDirectlineTokenURL","botID","tenantID","fetch","method","then","r","json","token","pvaChatConnectorPowervaDirectlineTokenURL","pvaChatConnectorBotID","pvaChatConnectorTenantID","_ref","dispatch","next","action","type","payload","language","navigator","_activity$from","activity","from","role","triggerQuery","text","ReactWebChat","WebChat","setUserId","useState","useMemo","ctx","directLine","createDirectLine","directLineToken","commerceChatStore","store","createStore","actionHandler","styleOptions","bubbleStyling","bubbleBackground","bubbleTextColor","bubbleBorderColor","bubbleBorderRadius","bubbleBorderStyle","bubbleBorderWidth","bubbleFromUserBackground","bubbleFromUserTextColor","bubbleFromUserBorderColor","bubbleFromUserBorderRadius","bubbleFromUserBorderStyle","bubbleFromUserBorderWidth","getBubbleStyling","avatarStyling","avatarBorderRadius","avatarSize","botAvatarBackgroundColor","botAvatarImage","botAvatarInitials","userAvatarBackgroundColor","userAvatarImage","userAvatarInitials","showAvatarInGroup","getAvatarStyling","suggestedActionStyling","suggestedActionLayout","suggestedActionBackground","suggestedActionTextColor","suggestedActionBorderColor","suggestedActionBorderRadius","suggestedActionBorderStyle","suggestedActionBorderWidth","suggestedActionDisabledBorderStyle","suggestedActionDisabledBorderWidth","suggestedActionDisabledTextColor","suggestedActionHeight","suggestedActionImageHeight","suggestedActionsCarouselFlipperCursor","suggestedActionsCarouselFlipperBoxWidth","suggestedActionsCarouselFlipperSize","suggestedActionsFlowMaxHeight","suggestedActionsStackedHeight","suggestedActionsStackedOverflow","suggestedActionsStackedLayoutButtonMaxHeight","suggestedActionsStackedLayoutButtonTextWrap","getSuggestedActionStyling","otherStyling","groupTimestamp","sendTimeout","sendTimeoutForAttachments","timestampColor","timestampFormat","notificationDebounceTimeout","hideToaster","toasterHeight","toasterMaxHeight","toasterSingularMaxHeight","toastFontSize","toastIconWidth","toastSeparatorColor","toastTextPadding","toastErrorBackgroundColor","toastErrorColor","toastInfoBackgroundColor","toastInfoColor","toastSuccessBackgroundColor","toastSuccessColor","toastWarnBackgroundColor","toastWarnColor","typingAnimationBackgroundImage","typingAnimationDuration","typingAnimationHeight","typingAnimationWidth","videoHeight","markdownExternalLinkIconImage","markdownRespectCRLF","internalLiveRegionFadeAfter","accent","subtle","getOtherStyling","hideUploadButton","primaryFont","getChatStyleOptions","userID","INVALID_TOKEN","loaded","setLoaded","setMinimized","newMessage","setToken","isProactive","setIsProactive","proactiveMessage","setProactiveMessage","closed","setClosed","setProvider","chatStyle","getChatStyling","ChatWrapperStyle","MaximizedChatWrapperStyle","ChatButtonStyle","ButtonStoreLogoStyle","ChatStoreLogoStyle","ChatMessagesStyle","ChatMessageHeader","MinimizeButtonStyle","CloseButtonStyle","ChatMessageContent","ProactiveWrapperStyle","ProactiveMessageHeader","ProactiveMessageContent","ProactiveButtonStyle","RedDotStyle","background","handleMaximizeButtonClick","useEffect","getDirectLineToken","catch","contextProvider","ContextProvider","prov","init","setTimeout","isValidToken","style","onClick","alt","fontWeight","fontSize","chatButtonHeader","chatButtonText","className","flexGrow","handleMinimizeButtonClick","handleCloseButtonClick","id","version","viewBox","xmlSpace","d","fill","ChatCore","unableToLoadChatMessage","p","interval","setInterval","clearInterval","Chat","Object","assign"],"sourceRoot":""}