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C,OAAO2C,cAAgB,GAC7C3C,OAAO2C,aAAaZ,QAApB,OACO/B,OAAO2C,aAAaZ,SAAW,IAC/BD,EAAQC,SAGX/B,OAAO2C,aAAaX,YAApB,OACGhC,OAAO2C,aAAaX,aAAe,IACnCF,EAAQE,aAEY,MAAMY,EAAiB,GAC9BA,EAAe,+EAAiF,CACxGX,EAAG,IAAMC,EAAQ,MACjBW,GAAI,+CAEpB7C,OAAO2C,aAAe3C,OAAO2C,cAAgB,GAC7C3C,OAAO2C,aAAaC,eAApB,OAC2B5C,OAAO2C,aAAaC,gBAAkB,IACtCA,I,MCtC3BE,EAAOC,QAAU/F,O,OCAjB8F,EAAOC,QAAUC,W","sources":["webpack://mattressfirm/./src/Utilities/analytics/clickTrack.ts?bce2","webpack://mattressfirm/./src/Utilities/analytics/htmlToText.ts?c3c7","webpack://mattressfirm/./src/Utilities/analytics/promotionClickTrack.ts?a0bd","webpack://mattressfirm/./src/Utilities/analytics/utagCaller.ts?3814","webpack://mattressfirm/./src/Utilities/plp-url-utils.ts?728b","webpack://mattressfirm/./src/modules/mfrm-shop-by-department/mfrm-shop-by-department.tsx?9623","webpack://mattressfirm/./src/modules/mfrm-shop-by-department/mfrm-shop-by-department.view.tsx?f08b","webpack://mattressfirm/./src/modules/mfrm-shop-by-department/analytics.ts?ba0a","webpack://mattressfirm/./lib/mfrm-shop-by-department/module-registration.js?b27b","webpack://mattressfirm/external var \"React\"?0d3b","webpack://mattressfirm/external var \"ReactDOM\"?853b"],"sourcesContent":["import { callUtagLink } from \"./utagCaller\";\r\n\r\nexport interface IUtagPromoConfig {\r\n promotion_impression_name?: string[];\r\n promotion_impression_id?: string[];\r\n promotion_impression_creative?: string[];\r\n promotion_impression_position?: (string | undefined)[];\r\n promotion_name?: string[];\r\n promotion_id?: string[];\r\n promotion_creative?: string[];\r\n promotion_position?: (string | undefined)[];\r\n}\r\n\r\nexport interface IUtagGeneralConfig {\r\n enhanced_action?: string | undefined;\r\n}\r\nexport interface ICustomerConfig {\r\n customer_email?: string;\r\n}\r\nexport interface IProductConfig {\r\n product_id?: string[];\r\n product_name?: string[];\r\n product_category?: (string | undefined)[];\r\n product_brand?: (string | undefined)[];\r\n product_variant?: (string | undefined)[];\r\n product_price?: (string | undefined)[];\r\n product_list_name?: string[];\r\n product_position?: (number | undefined)[];\r\n product_quantity?: (string | undefined)[];\r\n checkout_step?: string;\r\n}\r\nexport interface IProductImpressionConfig {\r\n product_impression_brand?: (string | undefined)[];\r\n product_impression_list_name?: (string | undefined)[];\r\n product_impression_id?: string[];\r\n product_impression_name?: string[];\r\n product_impression_category?: string[];\r\n product_impression_variant?: (string | undefined)[];\r\n product_impression_position?: number[];\r\n product_impression_price?: number[];\r\n}\r\nexport interface IAnalyticsConfiguration {\r\n event?: string | null;\r\n eventName?: string | null;\r\n eventCategory?: string | null;\r\n eventAction?: string | null;\r\n eventLabel?: string | null;\r\n eventType?: string | null;\r\n eventNoninteraction?: string;\r\n enhancedAction?: string | null;\r\n searchTerm?: string | undefined | null;\r\n searchType?: string | undefined | null;\r\n generalConfig?: IUtagGeneralConfig;\r\n promoConfig?: IUtagPromoConfig;\r\n productConfig?: IProductConfig;\r\n customerConfig?: ICustomerConfig;\r\n productImpressionConfig?: IProductImpressionConfig;\r\n}\r\n\r\nexport const fireAnalyticsLink = ({\r\n searchTerm = null,\r\n searchType = null,\r\n eventName = null,\r\n eventCategory = null,\r\n eventAction = null,\r\n eventLabel = null,\r\n eventType = null,\r\n eventNoninteraction = 'false',\r\n enhancedAction = null,\r\n generalConfig = {},\r\n promoConfig = {},\r\n productConfig = {},\r\n customerConfig = {},\r\n productImpressionConfig = {}\r\n}: IAnalyticsConfiguration) => {\r\n void callUtagLink({\r\n ...generalConfig,\r\n ...promoConfig,\r\n ...productConfig,\r\n ...customerConfig,\r\n ...productImpressionConfig,\r\n event: eventName,\r\n event_category: eventCategory,\r\n event_action: eventAction,\r\n event_label: eventLabel,\r\n event_type: eventType,\r\n event_noninteraction: eventNoninteraction,\r\n enhanced_action: enhancedAction,\r\n search_term: searchTerm,\r\n search_type: searchType\r\n });\r\n};","\r\n// Convert Rich Text inner text to string for analytics tagging\r\n\r\nimport MsDyn365 from '@msdyn365-commerce/core';\r\n\r\nexport const htmltoText = (html: string) => {\r\n if(MsDyn365.isBrowser) {\r\n // Create a new div element\r\n const tempDivElement = document.createElement('div');\r\n\r\n // Set the HTML content with the given value\r\n // tslint:disable-next-line: no-inner-html\r\n tempDivElement.innerHTML = html;\r\n\r\n // Retrieve the text property of the element\r\n return tempDivElement.textContent || tempDivElement.innerText || '';\r\n } else {\r\n return '';\r\n }\r\n};","import { fireAnalyticsLink } from './clickTrack';\r\n\r\ninterface IPromotionConfigs {\r\n eventLabel: string;\r\n promotionName: string[];\r\n promotionId: string[];\r\n promotionCreative: string[];\r\n promotionPosition: (string | undefined)[];\r\n}\r\n\r\nexport const firePromotionImpression = ({ eventLabel = '', promotionName = [], promotionId = [], promotionCreative = [], promotionPosition = [] }: IPromotionConfigs) => {\r\n fireAnalyticsLink({\r\n eventName: 'promotion-impression',\r\n eventCategory: 'ecommerce',\r\n eventAction: 'promotion impression',\r\n eventLabel: eventLabel,\r\n eventNoninteraction: 'true',\r\n promoConfig: {\r\n promotion_impression_name: promotionName,\r\n promotion_impression_id: promotionId,\r\n promotion_impression_creative: promotionCreative,\r\n promotion_impression_position: promotionPosition\r\n }\r\n });\r\n};\r\n\r\nexport const firePromotionClick = ({ eventLabel = '', promotionName = [], promotionId = [], promotionCreative = [], promotionPosition = [] }: IPromotionConfigs) => {\r\n fireAnalyticsLink({\r\n eventName: 'promotion-click',\r\n eventCategory: 'ecommerce',\r\n eventAction: 'promotion click',\r\n eventLabel: eventLabel,\r\n eventNoninteraction: 'false',\r\n promoConfig: {\r\n promotion_name: promotionName,\r\n promotion_id: promotionId,\r\n promotion_creative: promotionCreative,\r\n promotion_position: promotionPosition\r\n }\r\n });\r\n};","import { IAnalyticsConfiguration } from './clickTrack';\r\n\r\n// Interface for 3rd-party function. AKA utag.\r\ninterface ITealium {\r\n link(data: {}): void | false;\r\n view(data: {}): void | false;\r\n data(data: {}): void | false;\r\n}\r\n\r\nexport interface IPromotionConfig {\r\n event?: string | null;\r\n event_name?: string | null;\r\n search_term?: string | null;\r\n search_type?: string | null;\r\n event_category?: string | null;\r\n event_action?: string | null;\r\n event_label?: string | null;\r\n event_type?: string | null;\r\n event_noninteraction?: string;\r\n enhanced_action?: string | null;\r\n customer_email?: string | undefined;\r\n customer_phone_number?: string | undefined;\r\n first_name?: string | undefined;\r\n last_name?: string | undefined;\r\n address1?: string | undefined;\r\n address2?: string | undefined;\r\n city?: string | undefined;\r\n state?: string | undefined;\r\n zip_code?: string | undefined;\r\n order_subtotal?: string | undefined;\r\n order_currency?: string | undefined;\r\n country?: string | undefined;\r\n // productConfig?: IProductDataConfig;\r\n checkout_step?: string;\r\n checkout_option?:(string | undefined)[];\r\n checkout_type?:(string | undefined)[];\r\n product_id?: (string | undefined)[];\r\n product_name?: (string | undefined)[];\r\n product_category?: (string | undefined)[];\r\n product_brand?: (string | undefined)[];\r\n product_variant?: (string | undefined | number)[];\r\n product_price?: (string | undefined)[];\r\n product_quantity?: (string | undefined)[];\r\n product_url?: (string | undefined)[];\r\n product_size?: (string | undefined)[];\r\n product_image_url?: (string | undefined)[];\r\n core_item_flag?: string | null;\r\n funnel_type?: string | null;\r\n}\r\n\r\ninterface IProductDataConfig {\r\n product_variant?: (string | undefined)[];\r\n product_price?: (string | undefined)[];\r\n}\r\n\r\nexport interface IAnalyticsConfigurationData {\r\n productConfig?: IProductDataConfig;\r\n}\r\n\r\n\r\n// Legacy function\r\nexport const callUtag = async (objToCall: IPromotionConfig) => {\r\n void await callUtagLink(objToCall);\r\n};\r\n\r\n/**\r\n * Tealium dispatch click tracking.\r\n * @param objToCall\r\n */\r\nexport const callUtagLink = async (objToCall: IPromotionConfig | IAnalyticsConfiguration) => {\r\n try {\r\n Object.keys(objToCall).forEach(\r\n key => {\r\n if (objToCall[key] === null) {\r\n delete objToCall[key];\r\n }\r\n }\r\n );\r\n // If utag doesn't exist in the global scope, set as false.\r\n const utag: ITealium = global.hasOwnProperty('utag') ? global[\"utag\"] : false;\r\n if(utag) { utag.link(objToCall); }\r\n\r\n } catch (e) {\r\n console.log('Utag Error', e);\r\n }\r\n};\r\n\r\n/**\r\n * Tealium dispatch view tracking.\r\n * @param objToCall\r\n */\r\nexport const callUtagView = async (objToCall: {}) => {\r\n try {\r\n // If utag doesn't exist in the global scope, set as false.\r\n const utag: ITealium = global.hasOwnProperty('utag') ? global[\"utag\"] : false;\r\n if(utag) { utag.view(objToCall); }\r\n } catch (e) {\r\n console.log('utag View Error', e);\r\n }\r\n};\r\n\r\n/**\r\n * Not currently implemented.\r\n * @param objToCall\r\n * @param dataType\r\n */\r\nexport const callUtagData = ({ productConfig = {} }: IAnalyticsConfigurationData , dataType: string) => {\r\n try {\r\n // If utag doesn't exist in the global scope, set as false.\r\n const utag: ITealium = global.hasOwnProperty('utag') ? global[\"utag\"] : false;\r\n switch (dataType) {\r\n case 'data':\r\n // @ts-ignore\r\n if(utag) { utag.data = {...utag.data, ...productConfig}; }\r\n break;\r\n case '_data':\r\n // @ts-ignore\r\n utag_data = {...utag_data , ...productConfig};\r\n break;\r\n default:\r\n null;\r\n }\r\n } catch (e) {\r\n console.log('Utag Error', e);\r\n }\r\n};","import { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport { IRequestContext } from '@msdyn365-commerce/core';\r\nimport { ProductRefinerValue } from '@msdyn365-commerce/retail-proxy';\r\nexport interface IVirtualRefinersConfig {\r\n order: number;\r\n refinerName: string;\r\n enableForMattresses: boolean;\r\n enableForOtherCategories: boolean;\r\n allowDuplicate: boolean;\r\n}\r\n\r\n/**\r\n * This will create the canonicalURL as per 7924 requirement\r\n * @param requestContext\r\n * @returns string of canonical URL\r\n */\r\nexport const canonicalURL = (requestContext: IRequestContext): string => {\r\n const requestUrl = requestContext.url.requestUrl;\r\n const origin = requestUrl.origin;\r\n const path = requestUrl.pathname.toLowerCase();\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('/').splice(1);\r\n\r\n // remove double values containing pipe sign\r\n if (path.match(/%7c/)) {\r\n urlParts = removePipeSignValue(urlParts);\r\n }\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n const filteredPath = urlParts?.join('/');\r\n\r\n return `${origin}/${filteredPath}`;\r\n};\r\n\r\nexport const filteredURL = (requestContext: IRequestContext): string => {\r\n const requestUrl = requestContext.url.requestUrl;\r\n const path = requestUrl.pathname.toLowerCase();\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('/').splice(1);\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n const filteredPath = urlParts?.join('/');\r\n\r\n return `/${filteredPath}`;\r\n};\r\n\r\n/**\r\n * This will create the canonicalURL as per 7924 requirement\r\n * @param requestContext\r\n * @returns string of canonical URL\r\n */\r\nexport const canonicalURLWithoutBaseUrl = (requestContext: IRequestContext): string => {\r\n const requestUrl = requestContext.url.requestUrl;\r\n const path = requestUrl.pathname.toLowerCase();\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('\\/').splice(1);\r\n\r\n // remove double values containing pipe sign\r\n if (path.match(/%7c/)) {\r\n urlParts = removePipeSignValue(urlParts);\r\n }\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n return urlParts?.join('\\/');\r\n};\r\n\r\n/**\r\n * This will remove the Pipe sign value set from urlParts\r\n * @param urlParts\r\n * @returns\r\n */\r\nexport const removePipeSignValue = (urlParts: string[]) => {\r\n // urlParts.forEach((part, index) => {\r\n // const indexOfValue = urlParts.indexOf('%7c');\r\n // if (indexOfValue !== -1) {\r\n // urlParts.splice(indexOfValue, 1);\r\n // }\r\n // });\r\n\r\n if (urlParts !== undefined && urlParts.length > 0) {\r\n urlParts = urlParts.filter(urlPart => urlPart.indexOf('%7c') === -1);\r\n }\r\n\r\n return urlParts;\r\n};\r\n\r\n/**\r\n * This will remove the keywords from urlParts array which were received from\r\n * the app.settings.json/CMS Extensions\r\n * @param urlParts\r\n * @param requestContext\r\n * @returns urlParts array filtered\r\n */\r\nexport const removeKeywords = (urlParts: string[], requestContext: IRequestContext): string[] => {\r\n const removeKeywordFromUrl = requestContext.app.config.removeKeywordFromUrl;\r\n\r\n if (urlParts.length > 0 && removeKeywordFromUrl && removeKeywordFromUrl.length > 0) {\r\n const removeKeywordFromUrlArray: string[] = removeKeywordFromUrl?.trim().split(',');\r\n removeKeywordFromUrlArray?.length > 0 &&\r\n urlParts.forEach(_part => {\r\n removeKeywordFromUrlArray.forEach(removeKeyword => {\r\n const trimmedKeyword = removeKeyword.trim().toLowerCase();\r\n const indexOfValue = urlParts.indexOf(trimmedKeyword);\r\n if (trimmedKeyword.length > 0 && indexOfValue !== -1) {\r\n urlParts.splice(indexOfValue, 1);\r\n }\r\n });\r\n });\r\n }\r\n\r\n return urlParts;\r\n};\r\n\r\n/**\r\n * This will sort the Virtual refiner config based on order and return\r\n * only active virtual refiner configs based on isMattress category will\r\n * be returned\r\n * @param requestContext\r\n * @param isMattressesCategory boolean | undefined\r\n * @returns IVirtualRefinersConfig[] | undefined\r\n */\r\nexport const getSortedVirtualRefinerConfig = (\r\n requestContext: IRequestContext,\r\n isMattressesCategory: boolean | undefined\r\n): IVirtualRefinersConfig[] | undefined => {\r\n let appConfigSorted = getVirtualRefinerConfig(requestContext);\r\n\r\n // sort the config by provided config\r\n if (appConfigSorted) {\r\n if (isMattressesCategory === true) {\r\n appConfigSorted = appConfigSorted.filter(appConfig => {\r\n return appConfig.enableForMattresses;\r\n });\r\n } else if (isMattressesCategory === false) {\r\n appConfigSorted = appConfigSorted.filter(appConfig => {\r\n return appConfig.enableForOtherCategories;\r\n });\r\n }\r\n appConfigSorted.sort((a: IVirtualRefinersConfig, b: IVirtualRefinersConfig) => {\r\n return a.order - b.order;\r\n });\r\n }\r\n\r\n return appConfigSorted;\r\n};\r\n\r\n/**\r\n * Virtual refiner names from the app.settings.json will be returned which can be used\r\n * to filter out refiners data based upon active virtual refiners\r\n * @param requestContext\r\n * @param isMattressesCategory boolean | undefined\r\n * @returns string[]\r\n */\r\nexport const getVirtualRefinerNames = (requestContext: IRequestContext, isMattressesCategory: boolean | undefined): string[] => {\r\n const sortedVirtualRefinerConfig = getSortedVirtualRefinerConfig(requestContext, isMattressesCategory);\r\n\r\n const appConfigRefinerNames: string[] = [];\r\n\r\n sortedVirtualRefinerConfig &&\r\n sortedVirtualRefinerConfig.forEach(sortedConfig => {\r\n appConfigRefinerNames.push(sortedConfig.refinerName.trim().toLowerCase());\r\n });\r\n\r\n return appConfigRefinerNames;\r\n};\r\n\r\n/**\r\n * This will return the value of virtual refiner configuration\r\n * @param requestContext\r\n * @returns IVirtualRefinersConfig[] | undefined\r\n */\r\nexport const getVirtualRefinerConfig = (requestContext: IRequestContext): IVirtualRefinersConfig[] => {\r\n return requestContext.app.config.urlModifications;\r\n};\r\n\r\nexport async function getVirtualRefinerValues(\r\n requestContext: IRequestContext,\r\n virtualRefiners: IProductRefinerHierarchy[]\r\n): Promise {\r\n const virtualRefinerValues: ProductRefinerValue[] = [];\r\n if (virtualRefiners.length === 0) {\r\n return virtualRefinerValues;\r\n }\r\n const requestUrl = requestContext.url.requestUrl;\r\n // const origin = requestUrl.origin;\r\n const path = requestUrl.pathname;\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('/').splice(1);\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n // remove category id {categoryid}.c\r\n const categoryIdToken = requestContext.urlTokens.recordId;\r\n const categoryId = categoryIdToken ? `${categoryIdToken}.c` : undefined;\r\n\r\n if (categoryId) {\r\n urlParts.splice(-1);\r\n }\r\n\r\n // run loop for each url part and get values from refiners for further usage\r\n const finalizedUrlParts: string[] = [];\r\n urlParts.forEach(plainUrlPart => {\r\n const urlPart = decodeURIComponent(plainUrlPart);\r\n if (urlPart.indexOf('|') !== -1) {\r\n const splitOnPipeSign = urlPart?.split('|');\r\n const filteredParts = splitOnPipeSign.filter(part => part.length > 0);\r\n filteredParts.forEach(filteredPart => {\r\n finalizedUrlParts.push(filteredPart.toLowerCase().trim());\r\n });\r\n }\r\n finalizedUrlParts.push(urlPart);\r\n });\r\n finalizedUrlParts.forEach((urlPart) => {\r\n virtualRefiners.forEach((mainRefiner) => {\r\n mainRefiner.Values.forEach((refinerValue) => {\r\n const refinerValueKeyName = refinerValue.LeftValueBoundString?.toLowerCase().trim().split(' ')?.join('-').replace(/\\&/g, 'and').replace(regExSpecialChars(requestContext.app.config.canonicalUrlspecialCharIncludeList), '-');\r\n if (refinerValueKeyName && refinerValueKeyName === urlPart) {\r\n virtualRefinerValues.push(refinerValue);\r\n }\r\n });\r\n });\r\n });\r\n\r\n return virtualRefinerValues;\r\n}\r\n\r\n/**\r\n * For navigation menu links, it will remove keywords configured in global configurations from the navigation link\r\n * and clp link and return url path string\r\n * @param link\r\n * @param requestContext\r\n * @returns string\r\n */\r\nexport const navLinkKeywordRemoval = (link: string, requestContext: IRequestContext): string => {\r\n // Using the rest operator in case there is a weirdly formatted URL with multiple question marks.\r\n const [linkBase, ...linkParams] = link?.split('?');\r\n\r\n // Only apply to category links and product links, which end in .c or .p. Check that a keyword is configured.\r\n if (!linkBase.endsWith('.c') && !linkBase.endsWith('.p') || !requestContext.app.config) {\r\n return link;\r\n }\r\n\r\n // Separate out url parts split on forward /\r\n let urlParts = linkBase?.split('\\/');\r\n\r\n // Remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n // Glue the URL params back together\r\n const linkParam = linkParams.map(param => `?${param}`)?.join('');\r\n\r\n // Rebuild URL by joining with forward slash and appending any URL parameters\r\n const filteredLink = `${urlParts?.join('/')}${linkParam}`;\r\n return `${filteredLink}`;\r\n};\r\nexport const regExSpecialChars = (includeConfigList: string): RegExp => {\r\n let includeConfig = '';\r\n if (includeConfigList !== undefined && includeConfigList !== '') {\r\n includeConfig = includeConfigList?.trim().split(',')?.join('\\\\\\\\');\r\n includeConfig = includeConfig && includeConfig !== '' ? `\\\\\\\\${includeConfig}` : '';\r\n const pattern = `[^\\\\w\\\\&\\\\|${includeConfig}]`;\r\n return new RegExp(pattern, 'gi');\r\n } else {\r\n\r\n const pattern = `[^\\\\w\\\\&\\\\|]`;\r\n return new RegExp(pattern, 'gi');\r\n }\r\n};\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport { IModuleProps, INodeProps } from '@msdyn365-commerce-modules/utilities';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\nimport { IMfrmShopByDepartmentProps } from './mfrm-shop-by-department.props.autogenerated';\r\n\r\nexport interface IContentBlockViewProps extends IMfrmShopByDepartmentProps<{}> {\r\n title?: React.ReactNode;\r\n eyebrowText?: string;\r\n text?: React.ReactNode;\r\n image?: React.ReactNode;\r\n className?: string;\r\n contentBlockContainer: IModuleProps;\r\n imageContainer: INodeProps;\r\n detailsContainer: INodeProps;\r\n contentBlockAnchorTag?: INodeProps;\r\n isPromotion: boolean;\r\n}\r\n\r\n/**\r\n *\r\n * ContentCard component\r\n * @extends {React.PureComponent}\r\n */\r\n\r\nclass ContentBlock extends React.PureComponent> {\r\n public render(): JSX.Element | null {\r\n const {\r\n heading,\r\n eyebrowText,\r\n paragraph,\r\n textColor,\r\n image,\r\n className,\r\n enhancedEcommTracking\r\n } = this.props.config;\r\n\r\n const colorOfText = textColor ? `font-${textColor}` : '';\r\n\r\n const contentBlockTitle = heading && (\r\n \r\n );\r\n\r\n const imageProps = {\r\n gridSettings: this.props.context.request.gridSettings || {},\r\n imageSettings: image && image.imageSettings\r\n };\r\n\r\n const contentBlockText = paragraph && (\r\n \r\n );\r\n\r\n const contentBlockImage = image && (\r\n \r\n );\r\n\r\n const isPromotion = enhancedEcommTracking === 'promotion';\r\n\r\n if (\r\n !contentBlockTitle &&\r\n !contentBlockText &&\r\n !contentBlockImage\r\n ) {\r\n this.props.context.telemetry.warning(\r\n 'Content block content is empty, module wont render.'\r\n );\r\n\r\n return null;\r\n }\r\n\r\n const contentBlockviewProps = {\r\n ...this.props,\r\n title: contentBlockTitle,\r\n eyebrowText: eyebrowText,\r\n text: contentBlockText,\r\n image: contentBlockImage,\r\n isPromotion,\r\n moduleClass: this.props.config.className,\r\n contentBlockContainer: {\r\n moduleProps: this.props,\r\n className: classnames('ms-content-block', 'mfrm-nsrp-sbd-item', className)\r\n },\r\n imageContainer: { className: 'ms-content-block__image' },\r\n detailsContainer: { className: classnames('ms-content-block__details', colorOfText)},\r\n contentBlockAnchorTag: {\r\n tag: 'a',\r\n className: 'ms-content-block__link',\r\n role: 'link',\r\n href: this._getLink()\r\n }\r\n };\r\n\r\n return this.props.renderView(contentBlockviewProps) as React.ReactElement;\r\n }\r\n\r\n public handleTextChange = (event: Msdyn365.ContentEditableEvent) => this.props.config.heading!.text = event.target.value;\r\n public handleParagraphChange = (event: Msdyn365.ContentEditableEvent) => this.props.config.paragraph = event.target.value;\r\n\r\n private _getLink(): string | null {\r\n const { link } = this.props.config;\r\n if (link) {\r\n return link.destinationUrl;\r\n }\r\n return null;\r\n }\r\n}\r\n\r\nexport default ContentBlock;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport MsDyn365 from '@msdyn365-commerce/core';\r\nimport * as React from 'react';\r\nimport { useInView } from 'react-intersection-observer';\r\nimport { fireAnalyticsLink } from '../../Utilities/analytics/clickTrack';\r\nimport { htmltoText } from '../../Utilities/analytics/htmlToText';\r\nimport { firePromotionClick, firePromotionImpression } from '../../Utilities/analytics/promotionClickTrack';\r\nimport { navLinkKeywordRemoval } from '../../Utilities/plp-url-utils';\r\nimport { getAnalyticsConfig, getPromoAnalyticsConfig } from './analytics';\r\nimport { IContentBlockViewProps } from './mfrm-shop-by-department';\r\n\r\nconst ContentBlockView: React.FC = (props) => {\r\n const {\r\n contentBlockContainer,\r\n imageContainer,\r\n detailsContainer,\r\n title,\r\n text,\r\n image,\r\n eyebrowText,\r\n contentBlockAnchorTag,\r\n isPromotion,\r\n config\r\n } = props;\r\n\r\n const pagePath = MsDyn365.isBrowser\r\n ? window.location.href.split(location.host)[1].includes('?')\r\n ? window.location.href.split(location.host)[1].split('?')[0]\r\n : window.location.href.split(location.host)[1]\r\n : '';\r\n const friendlyName = contentBlockContainer.moduleProps.friendlyName;\r\n const paragraphText = config.paragraph ? htmltoText(config.paragraph.toString()).trim() : '';\r\n\r\n const analyticsConfig = getAnalyticsConfig(pagePath, friendlyName, config.tealiumEvent);\r\n const promoAnalyticsConfig = getPromoAnalyticsConfig(\r\n props.config.image,\r\n contentBlockAnchorTag,\r\n pagePath,\r\n paragraphText,\r\n config.tealiumPromotion\r\n );\r\n\r\n const handleAnalytics = (event: React.MouseEvent) => {\r\n if (MsDyn365.isBrowser) {\r\n event.preventDefault();\r\n fireAnalyticsLink({ ...analyticsConfig });\r\n if (isPromotion) {\r\n firePromotionClick({ ...promoAnalyticsConfig });\r\n }\r\n\r\n if (contentBlockAnchorTag?.href) {\r\n window.location.href = navLinkKeywordRemoval(contentBlockAnchorTag.href, props.context.request);\r\n }\r\n }\r\n };\r\n\r\n const [ref, inView] = useInView({ triggerOnce: true, rootMargin: '25px' });\r\n\r\n React.useEffect(() => {\r\n if (MsDyn365.isBrowser && isPromotion && inView) {\r\n firePromotionImpression({ ...promoAnalyticsConfig });\r\n }\r\n }, [inView]);\r\n\r\n const cypressData: string[] = ['mfrm-nsrp-sbd-item'];\r\n config.tealiumEvent?.event_action && cypressData.push(config.tealiumEvent?.event_action.replace(/\\W+/gm, '-'));\r\n\r\n return (\r\n \r\n \r\n {eyebrowText &&
{eyebrowText}
}\r\n {image}\r\n \r\n {title}\r\n {text}\r\n \r\n \r\n
\r\n );\r\n};\r\n\r\nexport default ContentBlockView;\r\n","import { INodeProps } from '@msdyn365-commerce-modules/utilities';\r\nimport { IImageData } from '@msdyn365-commerce/core';\r\nimport { ITealiumEventData, ITealiumPromotionData } from './mfrm-shop-by-department.props.autogenerated';\r\n\r\nexport const getPromoAnalyticsConfig = (image: IImageData | undefined, restAssuredPromiseAnchorTag: INodeProps | undefined, pagePath: string, paragraphText: string, tealiumPromotion: ITealiumPromotionData | undefined) => {\r\n // Use Configured Paragraph text as Promotion Name\r\n const promoName = tealiumPromotion?.promotion_name || paragraphText;\r\n // Use Configured Link as Promotion ID\r\n const promoID = tealiumPromotion?.promotion_id || restAssuredPromiseAnchorTag?.href || '';\r\n // Use Configured Image URL as default Creative\r\n const promoCreative = tealiumPromotion?.promotion_creative_version || image?.title || image?.altText || '';\r\n const promoPosition = tealiumPromotion?.promotion_position || undefined;\r\n\r\n return {\r\n eventLabel: `${promoName} from ${pagePath}`,\r\n promotionName: [promoName],\r\n promotionId: [promoID],\r\n promotionCreative: [promoCreative],\r\n promotionPosition: [promoPosition]\r\n };\r\n};\r\n\r\nexport const getAnalyticsConfig = (pagePath: string, friendlyName: string, tealiumEvent: ITealiumEventData | undefined) => {\r\n return {\r\n eventName: tealiumEvent?.event || 'shop by department',\r\n eventCategory: tealiumEvent?.event_category || 'shop by department',\r\n eventAction: tealiumEvent?.event_action || `${friendlyName} click`,\r\n eventLabel: tealiumEvent?.event_label || pagePath\r\n };\r\n};","const binding = { modules: {}, dataActions: {} };\n\n (binding.modules['mfrm-shop-by-department'] = {\n c: () => require('partner/modules/mfrm-shop-by-department/mfrm-shop-by-department.tsx'),\n $type: 'contentModule',\n da: [],\n \n iNM: false,\n ns: '__local__',\n n: 'mfrm-shop-by-department',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/mfrm-shop-by-department'\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|mfrm-shop-by-department|mfrm-shop-by-department'] = {\n c: () => require('partner/modules/mfrm-shop-by-department/mfrm-shop-by-department.view.tsx'),\n cn: '__local__-__local__-mfrm-shop-by-department'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["fireAnalyticsLink","searchTerm","searchType","eventName","eventCategory","eventAction","eventLabel","eventType","eventNoninteraction","enhancedAction","generalConfig","promoConfig","productConfig","customerConfig","productImpressionConfig","callUtagLink","event","event_category","event_action","event_label","event_type","event_noninteraction","enhanced_action","search_term","search_type","htmltoText","html","MsDyn365","tempDivElement","document","createElement","innerHTML","textContent","innerText","firePromotionImpression","promotionName","promotionId","promotionCreative","promotionPosition","promotion_impression_name","promotion_impression_id","promotion_impression_creative","promotion_impression_position","firePromotionClick","promotion_name","promotion_id","promotion_creative","promotion_position","callUtag","async","objToCall","Object","keys","forEach","key","utag","global","hasOwnProperty","link","e","console","log","callUtagView","view","canonicalURL","requestContext","requestUrl","url","origin","path","pathname","toLowerCase","urlParts","split","splice","match","removePipeSignValue","removeKeywords","filteredPath","join","filteredURL","undefined","length","filter","urlPart","indexOf","removeKeywordFromUrl","app","config","removeKeywordFromUrlArray","trim","_part","removeKeyword","trimmedKeyword","indexOfValue","getSortedVirtualRefinerConfig","isMattressesCategory","appConfigSorted","getVirtualRefinerConfig","appConfig","enableForMattresses","enableForOtherCategories","sort","a","b","order","getVirtualRefinerNames","sortedVirtualRefinerConfig","appConfigRefinerNames","sortedConfig","push","refinerName","urlModifications","getVirtualRefinerValues","virtualRefiners","virtualRefinerValues","categoryIdToken","urlTokens","recordId","finalizedUrlParts","plainUrlPart","decodeURIComponent","part","filteredPart","mainRefiner","Values","refinerValue","refinerValueKeyName","LeftValueBoundString","replace","regExSpecialChars","canonicalUrlspecialCharIncludeList","navLinkKeywordRemoval","linkBase","linkParams","endsWith","linkParam","map","param","filteredLink","includeConfigList","includeConfig","pattern","RegExp","ContentBlock","React","constructor","handleTextChange","this","props","heading","text","target","value","handleParagraphChange","paragraph","render","eyebrowText","textColor","image","className","enhancedEcommTracking","colorOfText","contentBlockTitle","Msdyn365","tag","editProps","onEdit","context","request","imageProps","gridSettings","imageSettings","contentBlockText","contentBlockImage","isPromotion","telemetry","warning","contentBlockviewProps","title","moduleClass","contentBlockContainer","moduleProps","classnames","imageContainer","detailsContainer","contentBlockAnchorTag","role","href","_getLink","renderView","destinationUrl","pagePath","window","location","host","includes","friendlyName","paragraphText","toString","analyticsConfig","tealiumEvent","getAnalyticsConfig","promoAnalyticsConfig","restAssuredPromiseAnchorTag","tealiumPromotion","promoName","promoID","promoCreative","promotion_creative_version","altText","promoPosition","getPromoAnalyticsConfig","ref","inView","useInView","triggerOnce","rootMargin","cypressData","Module","Node","onClick","preventDefault","binding","modules","dataActions","c","require","$type","da","iNM","ns","n","p","pdp","md","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}