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SAAWwiB,EAAK,OAAOxB,EAC7B,IAAK,IAAIoC,EAAI,EAAGA,GAAKD,EAAEnjB,OAAS,EAAGojB,IAEjC,GADAngB,EAAK+d,EAAGmC,EAAEC,IACNpC,EAAEhhB,SAAWwiB,EAAK,OAAOxB,EAE/BnE,EAAIkB,EAAIxV,GAIZ,OADAtF,EAAK+d,EAAGiB,EAAYvB,EAAG3C,IAChBiD,QA3H4BU,GAAM,WAE7C,IAAI2B,EAAK,OACLC,EAAeD,EAAGrB,KACtBqB,EAAGrB,KAAO,WAAc,OAAOsB,EAAapC,MAAMlb,KAAMud,YACxD,IAAI3R,EAAS,KAAKhR,MAAMyiB,GACxB,OAAyB,IAAlBzR,EAAO5R,QAA8B,MAAd4R,EAAO,IAA4B,MAAdA,EAAO,MAwHrB+P,+BC1JvC,EAAQ,yBCFR6B,EAAOC,QAAUxJ,2BCAjBuJ,EAAOC,QAAUC","sources":["webpack://mattressfirm/./src/Utilities/constants.ts?8bdf","webpack://mattressfirm/./src/Utilities/get-html-parser-value.ts?1fb6","webpack://mattressfirm/./src/Utilities/plp-url-utils.ts?728b","webpack://mattressfirm/./src/data-actions/get-attributes-for-selected-variant.ts?4859","webpack://mattressfirm/./src/data-actions/get-selected-variant.override.action.ts?02a3","webpack://mattressfirm/./src/data-actions/get-seo-data.action.ts?b8ff","webpack://mattressfirm/./src/data-actions/utilities/utils.ts?7452","webpack://mattressfirm/./src/modules/mfrm-buybox/list-page-state-buybox.ts?792c","webpack://mattressfirm/./src/modules/mfrm-category-page-summary/mfrm-category-page-summary.action.ts?d22e","webpack://mattressfirm/./src/modules/mfrm-product-page-summary/mfrm-product-page-summary.action.ts?7926","webpack://mattressfirm/./src/modules/mfrm-utag-data/mfrm-utag-data.tsx?9fcd","webpack://mattressfirm/./src/modules/mfrm-utag-data/mfrm-utag-data.props.autogenerated.ts?8d3d","webpack://mattressfirm/./src/modules/mfrm-utag-data/mfrm-utag-data.view.tsx?60c1","webpack://mattressfirm/./lib/mfrm-utag-data/module-registration.js?085c","webpack://mattressfirm/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.promise.all-settled.js?ad9a","webpack://mattressfirm/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.string.match.js?a69e","webpack://mattressfirm/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.string.split.js?9fc2","webpack://mattressfirm/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/esnext.promise.all-settled.js?b32a","webpack://mattressfirm/external var \"React\"?0d3b","webpack://mattressfirm/external var \"ReactDOM\"?853b"],"sourcesContent":["export const variantQueryStringName = 'variantid';","import ReactHtmlParser from 'react-html-parser';\r\n\r\nconst getHtmlParserValue = (value?: string) => {\r\n let parsedValue = '';\r\n const parsedArr = value && ReactHtmlParser(value);\r\n if (parsedArr && parsedArr?.length > 0) {\r\n parsedValue = parsedArr[0] ? parsedArr[0].toString() : '';\r\n }\r\n return parsedValue;\r\n};\r\n\r\nexport default getHtmlParserValue;","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 // eslint-disable-next-line security/detect-non-literal-regexp\r\n return new RegExp(pattern, 'gi');\r\n } else {\r\n\r\n const pattern = `[^\\\\w\\\\&\\\\|]`;\r\n // eslint-disable-next-line security/detect-non-literal-regexp\r\n return new RegExp(pattern, 'gi');\r\n }\r\n};\r\n","import {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport { AttributeValue, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\nimport { getSelectedProductIdFromActionInput, getSelectedVariant, SelectedVariantInput } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getAttributeValuesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\n\r\n/**\r\n * Chains getting the SelectedVariant with GetActivePrice\r\n */\r\nexport class AttributesForSelectedVariantInput implements IActionInput {\r\n public productId: number;\r\n public channelId: number;\r\n public catalogId: number;\r\n public selectedProduct: SimpleProduct | undefined;\r\n\r\n constructor(productId: number, channelId: number, selectedProduct?: SimpleProduct, catalogId?: number) {\r\n this.productId = productId;\r\n this.channelId = channelId;\r\n this.selectedProduct = selectedProduct;\r\n this.catalogId = catalogId || 0;\r\n }\r\n\r\n public getCacheKey = () => `AttributesForSelectedVariant`;\r\n public getCacheObjectType = () => 'ProductAttributeValue';\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\nexport const createAttributesForSelectedVariantInput = (\r\n inputData: ICreateActionContext>\r\n): AttributesForSelectedVariantInput => {\r\n const productId = getSelectedProductIdFromActionInput(inputData);\r\n if (productId) {\r\n return new AttributesForSelectedVariantInput(+productId, +inputData.requestContext.apiSettings.channelId);\r\n } else {\r\n throw new Error('Unable to create PriceForSelectedVariantInput, no productId found on module config or query');\r\n }\r\n};\r\n\r\n/**\r\n * Calls the Retail API a get a list of dimension values for a given product.\r\n */\r\nexport async function getAttributesForSelectedVariantAction(\r\n input: AttributesForSelectedVariantInput,\r\n ctx: IActionContext\r\n): Promise {\r\n // @ts-ignore: Promise vs. ObservablePromise typing conflict\r\n return Promise.resolve()\r\n .then(() => {\r\n const activeProduct: SimpleProduct | undefined = input.selectedProduct;\r\n\r\n if (!activeProduct) {\r\n const selectedVariantInput = new SelectedVariantInput(input.productId, input.channelId);\r\n\r\n return getSelectedVariant(selectedVariantInput, ctx);\r\n }\r\n\r\n return activeProduct;\r\n })\r\n .then((productResult: SimpleProduct | null) => {\r\n const activeProduct: SimpleProduct | undefined = productResult;\r\n\r\n if (activeProduct) {\r\n return getAttributeValuesAsync(\r\n { callerContext: ctx, queryResultSettings: {} },\r\n activeProduct.RecordId,\r\n input.channelId,\r\n input.catalogId\r\n );\r\n }\r\n\r\n return null;\r\n })\r\n .then((attributeValues: AttributeValue[] | null) => {\r\n const resultArray = attributeValues;\r\n if (resultArray) {\r\n return resultArray;\r\n }\r\n\r\n return [];\r\n })\r\n .catch((error: Error) => {\r\n ctx.trace(error.message);\r\n throw new Error(`[getPriceForSelectedVariantAction]Error executing action ${error.message}`);\r\n });\r\n}\r\n\r\nexport default createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/product-info/get-attributes-for-selected-variant',\r\n action: >getAttributesForSelectedVariantAction,\r\n input: createAttributesForSelectedVariantInput\r\n});\r\n","import { generateProductImageUrl, getSelectedProductIdFromActionInput } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { ProductDimensionFull } from '@msdyn365-commerce/commerce-entities';\r\nimport MsDyn365, {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport {\r\n getByIdAsync,\r\n getDimensionValuesAsync,\r\n getVariantsByDimensionValuesAsync,\r\n searchByCriteriaAsync\r\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport {\r\n AttributeValue,\r\n CommerceProperty,\r\n ProductDimension,\r\n ProductDimensionValue,\r\n ProductSearchCriteria,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { variantQueryStringName } from '../Utilities/constants';\r\nimport getAttributesForSelectedVariant, { AttributesForSelectedVariantInput } from './get-attributes-for-selected-variant';\r\nimport { getQueryParamsFromQueryByName } from './utilities/utils';\r\n// import { AttributesForSelectedVariantInput, getAttributesForSelectedVariantAction } from '@msdyn365-commerce-modules/product-specification/src/dataActions/get-attributes-for-selected-variant';\r\n\r\nexport interface IDefaultDimension {\r\n dimensionType: number;\r\n dimensionValue: string;\r\n}\r\n\r\nlet shouldDefaultSet: boolean = true;\r\n/**\r\n * Get selected variant action input class\r\n */\r\nexport class SelectedVariantInput implements IActionInput {\r\n public productId: number;\r\n public channelId: number;\r\n public matchingDimensionValues: ProductDimension[];\r\n\r\n constructor(productId: number, channelId: number, matchingDimensionValues?: ProductDimension[]) {\r\n this.productId = productId;\r\n this.channelId = channelId;\r\n this.matchingDimensionValues = matchingDimensionValues || [];\r\n }\r\n\r\n public getCacheKey = () => `SelectedVariant`;\r\n public getCacheObjectType = () => 'SimpleProduct';\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\n/**\r\n * CreateInput method for the getSelectedVariant data action\r\n * @param inputData The input data passed to the createInput method\r\n */\r\nconst createInput = (inputData: ICreateActionContext>): SelectedVariantInput => {\r\n const productId = getSelectedProductIdFromActionInput(inputData);\r\n if (productId) {\r\n return new SelectedVariantInput(+productId, +inputData.requestContext.apiSettings.channelId, []);\r\n } else {\r\n throw new Error('Unable to create SelectedVariantInput, no productId found on module config or query');\r\n }\r\n};\r\n\r\n/**\r\n * Action method for the getSelectedVariant data aciton\r\n * @param input The action input class\r\n * @param ctx The action context\r\n */\r\n// tslint:disable-next-line:cyclomatic-complexity max-func-body-length\r\nasync function getSelectedVariantAction(input: SelectedVariantInput, ctx: IActionContext): Promise {\r\n //TODO: what is the use case for `matchingDimensionValues` to ever have values?\r\n // the `createInput` always passes an empty array to the input constructor. Where\r\n // else / how else is this getting called that would pass a populated array?\r\n const matchingDimensionValues = input.matchingDimensionValues ?? [];\r\n const variantId = ctx.requestContext.app.config.queryBasedVariantSelection\r\n ? getQueryParamsFromQueryByName(\r\n MsDyn365.isBrowser\r\n ? new URL(window.location.href.toString())\r\n : ctx.requestContext.url.requestUrl,\r\n variantQueryStringName)\r\n : undefined;\r\n let getByIdResponse;\r\n try {\r\n getByIdResponse = await getByIdAsync(\r\n { callerContext: ctx },\r\n matchingDimensionValues?.length === 0 && variantId && !Number.isNaN(Number(variantId))\r\n ? Number(variantId)\r\n : await getDefaultVariantId(input.productId, ctx) ?? input.productId,\r\n input.channelId);\r\n } catch (error) {\r\n console.log('[getByIdAsync Error calling API]', error);\r\n }\r\n // bellow cond will only be 1 if we have invalid variantid\r\n if (!getByIdResponse && variantId) {\r\n getByIdResponse = await getByIdAsync(\r\n { callerContext: ctx },\r\n input.productId,\r\n input.channelId);\r\n }\r\n\r\n // below condition will only be true if we have masterid in url and query\r\n if (getByIdResponse && !getByIdResponse?.MasterProductId) {\r\n getByIdResponse = await getByIdAsync(\r\n { callerContext: ctx },\r\n await getDefaultVariantId(getByIdResponse.RecordId, ctx) ?? input.productId,\r\n input.channelId);\r\n }\r\n\r\n const baseProduct: SimpleProduct = Array.isArray(getByIdResponse)\r\n ? getByIdResponse[0]\r\n : getByIdResponse;\r\n // Need to dereference this before editing it. Otherwise we might not\r\n // properly get the mobx events because if things aren't properly observable\r\n // they won't fire when you set them, and then if you don't deref the value in\r\n // the cache will match the value when you try to save it, so it won't detect any\r\n // changes there either\r\n let product: SimpleProduct | null = { ...baseProduct };\r\n const originalDimensionLength = product.Dimensions ? product.Dimensions.length : 0;\r\n\r\n if (product && product.RecordId > 0) {\r\n let baseProductHadUnmatchedDimension: boolean = false;\r\n\r\n product.Dimensions?.forEach(dimension => {\r\n const matchedTargetDimension = matchingDimensionValues.find(\r\n targetDimension => targetDimension.DimensionTypeValue === dimension.DimensionTypeValue\r\n );\r\n\r\n if (matchedTargetDimension) {\r\n dimension.DimensionValue = matchedTargetDimension?.DimensionValue;\r\n } else {\r\n baseProductHadUnmatchedDimension = true;\r\n }\r\n });\r\n\r\n const actionInput = new AttributesForSelectedVariantInput(\r\n product.RecordId,\r\n input.channelId,\r\n product\r\n );\r\n const productSpecificationData: AttributeValue[] = await getAttributesForSelectedVariant(actionInput, ctx)\r\n .catch((error: Error) => {\r\n error;\r\n }) || [];\r\n\r\n // check if default variant is given for product\r\n // const productSpecificationData: AttributeValue[] = await getAttributeValuesAsync({ callerContext: ctx, queryResultSettings: {} }, product.RecordId, input.channelId, 0);\r\n const defaultValues = productSpecificationData.find(data => data.Name?.toLowerCase().trim() === 'default variants')?.TextValue;\r\n const parsedDefaultData = defaultValues\r\n ? parseDefaultDimensionsData(defaultValues)\r\n : undefined;\r\n const productPreSelectionDimensions: ProductDimensionFull[] = [];\r\n\r\n //new - literally 10x faster!\r\n if (!product.MasterProductId) {\r\n // const now = (new Date()).valueOf()\r\n // console.time(`productPreSelectionDimensions${now}`);\r\n const asyncCalls = product.Dimensions?.map(async dimension => {\r\n const dimensionValues = await getDimensionValuesAsync(\r\n { callerContext: ctx, queryResultSettings: {} },\r\n product?.MasterProductId\r\n ? product.MasterProductId\r\n // @ts-ignore: nested in `if(product && product.RecordId > 0)`\r\n : product.RecordId,\r\n input.channelId,\r\n dimension.DimensionTypeValue,\r\n matchingDimensionValues.filter(value => value.DimensionTypeValue !== dimension.DimensionTypeValue),\r\n null\r\n );\r\n\r\n // if dimensionValues have a length of exactly one then we need to make\r\n // it as selected dimension for getting variant of the product\r\n if (dimensionValues.length === 1 && shouldDefaultSet) {\r\n dimension.DimensionValue = dimensionValues[0];\r\n } else {\r\n // search through default dimensions to find current dimension\r\n const defaultValueToFind = parsedDefaultData\r\n ?.find(defaultData => defaultData.dimensionType === dimension.DimensionTypeValue)\r\n ?.dimensionValue.toLowerCase()\r\n .trim();\r\n\r\n // look through all dimension values to find the default one\r\n const defaultDimension: ProductDimensionValue | undefined = dimensionValues.find(\r\n availableDimensionValue => availableDimensionValue.Value?.toLowerCase().trim() === defaultValueToFind || availableDimensionValue.DimensionId?.toLowerCase().trim() === defaultValueToFind\r\n );\r\n\r\n if (defaultDimension && shouldDefaultSet) {\r\n dimension.DimensionValue = defaultDimension;\r\n }\r\n }\r\n\r\n const fullDimension: ProductDimensionFull = {\r\n ...dimension,\r\n DimensionValues: dimensionValues\r\n };\r\n\r\n productPreSelectionDimensions.push(fullDimension);\r\n }) || [];\r\n\r\n await Promise.allSettled(asyncCalls);\r\n }\r\n //*/\r\n\r\n // if there is any selection in productPreSelectionDimensions array then get the variant\r\n if (productPreSelectionDimensions.length > 0) {\r\n const mappedDimensions = productPreSelectionDimensions\r\n .filter(dimension => dimension && dimension.DimensionValue)\r\n .map(dimension => {\r\n return {\r\n DimensionTypeValue: dimension.DimensionTypeValue,\r\n DimensionValue: dimension.DimensionValue,\r\n ExtensionProperties: dimension.ExtensionProperties\r\n };\r\n });\r\n //console.log(\"mappedDimensions: \",mappedDimensions)\r\n if (originalDimensionLength > 0 && originalDimensionLength === mappedDimensions.length) {\r\n const variants = await getVariantsByDimensionValuesAsync(\r\n { callerContext: ctx, queryResultSettings: {} },\r\n baseProduct.RecordId,\r\n input.channelId,\r\n mappedDimensions\r\n );\r\n if (variants && variants.length === 1) {\r\n //TODO: why is the `product` variable that has been built up through the rest of the code\r\n // being overwriten in the final steps?\r\n product = variants[0];\r\n }\r\n }\r\n }\r\n else if (productPreSelectionDimensions.length === 0 && !baseProductHadUnmatchedDimension && matchingDimensionValues.length > 0) {\r\n const variants = await getVariantsByDimensionValuesAsync(\r\n { callerContext: ctx, queryResultSettings: {} },\r\n baseProduct.RecordId,\r\n input.channelId,\r\n matchingDimensionValues\r\n );\r\n\r\n if (variants && variants.length > 0) {\r\n //TODO: why is the `product` variable that has been built up through the rest of the code\r\n // being overwriten in the final steps?\r\n product = variants[0];\r\n }\r\n }\r\n else {\r\n //TODO: what should happen here??\r\n //console.log(\"in 'else' for getVariantsByDimensionValuesAsync\")\r\n }\r\n\r\n const newImageUrl = generateProductImageUrl(product, ctx.requestContext.apiSettings);\r\n\r\n if (newImageUrl) {\r\n product.PrimaryImageUrl = newImageUrl;\r\n }\r\n }\r\n\r\n shouldDefaultSet = false;\r\n\r\n return product;\r\n}\r\n\r\nconst parseDefaultDimensionsData = (defaultValue: string): IDefaultDimension[] | undefined => {\r\n try {\r\n const defaultDimensions: IDefaultDimension[] = [];\r\n\r\n const splitDimensionTypes = defaultValue.split(',');\r\n splitDimensionTypes.forEach(dimensionData => {\r\n const [dimensionTypeString, dimensionValue] = dimensionData.split('_');\r\n const dimensionType = parseInt(dimensionTypeString, 10);\r\n defaultDimensions.push({\r\n dimensionType,\r\n dimensionValue\r\n });\r\n });\r\n\r\n return defaultDimensions;\r\n } catch (e) {\r\n console.log(e);\r\n }\r\n\r\n return undefined;\r\n};\r\n\r\nexport const getDefaultVariantId = async (masterId: number, context: IActionContext): Promise => {\r\n const productSearchCriteria: ProductSearchCriteria = {\r\n Ids: [masterId],\r\n Context: {\r\n ChannelId: +context.requestContext.apiSettings.channelId,\r\n CatalogId: +context.requestContext.apiSettings.catalogId\r\n },\r\n IncludeAttributes: true,\r\n SearchCondition: '*'\r\n };\r\n try {\r\n const productSearchResults = await searchByCriteriaAsync(\r\n { callerContext: context },\r\n productSearchCriteria\r\n );\r\n // If the ProductSearchResult API finds the products then populate the product image urls and return\r\n // otherwise if the API does not exist or does not return products proceed to the legacy flows for legacy/backward compatibility reasons\r\n context.telemetry.debug('Product search results returned', JSON.stringify(productSearchResults));\r\n if (productSearchResults.length > 0) {\r\n const defaultVariantId = productSearchResults[0]?.ExtensionProperties && productSearchResults[0]?.ExtensionProperties.find(\r\n (property: CommerceProperty) => property?.Key === \"Unbxd_DefaultVariantID\"\r\n )?.Value?.LongValue;\r\n return !defaultVariantId || defaultVariantId === 0 ? undefined : defaultVariantId;\r\n }\r\n return undefined;\r\n } catch (e) {\r\n // In case of an error fall back to legacy flow\r\n context.telemetry.error(`Error while getting productSearchResult: ${e}`);\r\n return undefined;\r\n }\r\n};\r\n\r\n/**\r\n * The complete getSelectedVariant data action\r\n */\r\nexport default createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/get-selected-variant',\r\n action: >getSelectedVariantAction,\r\n input: createInput\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\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { filteredURL } from '../Utilities/plp-url-utils';\r\n\r\nexport class GetSeoDataInput extends Msdyn365.CommerceEntityInput implements Msdyn365.IActionInput {\r\n\r\n private seoDataUrl: string = '';\r\n constructor(seoDataUrl: string) {\r\n super({ shouldCacheOutput: true, cacheObjectType: 'SeoDataCache', cacheKey: 'SeoDataCache' });\r\n this.seoDataUrl = seoDataUrl;\r\n }\r\n\r\n public getSeoDataUrl = () => this.seoDataUrl;\r\n public getCacheKey = () => `SeoDataCache`;\r\n public getCacheObjectType = () => 'SeoDataCache';\r\n public dataCacheType = (): Msdyn365.CacheType => 'request';\r\n\r\n}\r\n\r\nconst createInput = (inputData: Msdyn365.ICreateActionContext>): Msdyn365.IActionInput => {\r\n if (inputData.config && inputData.config.seoDataUrl) {\r\n return new GetSeoDataInput(inputData.config.seoDataUrl);\r\n }\r\n return new GetSeoDataInput('');\r\n};\r\n\r\n// tslint:disable: no-any\r\nasync function action(input: GetSeoDataInput, ctx: Msdyn365.IActionContext): Promise {\r\n\r\n const jsonUrlFromGlobals = ctx.requestContext.app.config.seoDataUrl;\r\n // TODO: Just remove the fallback\r\n const jsonUrl = jsonUrlFromGlobals || 'https://files-us-prod.cms.commerce.dynamics.com/cms/api/fknscsckgq/binary/MA5cA7';\r\n const res = await Msdyn365.sendRequest(jsonUrl, 'get');\r\n const filteredUrlPath = filteredURL(ctx.requestContext);\r\n const seoData = filteredUrlPath && res.data && res.data[filteredUrlPath];\r\n return seoData && seoData[0];\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n id: 'SeoDataCache',\r\n action: >action,\r\n input: createInput\r\n});\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { IAny, ICommerceApiSettings, ICoreContext, ICreateActionContext, IGeneric, IRequestContext } from '@msdyn365-commerce/core';\r\nimport {\r\n AsyncResult, CartLine, CommerceListLine, ProductDimension,\r\n ProductDimensionType, ProductSearchResult, SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy';\r\n\r\nimport { ProductDetailsCriteria, InventoryLevels, ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { variantQueryStringName } from '../../Utilities/constants';\r\n// import { parseSearchData } from '@msdyn365-commerce-modules/retail-actions/src/utilities/input-data-parser';\r\n\r\nexport const wrapInResolvedAsyncResult = (input: T | null | undefined): AsyncResult => {\r\n return >{\r\n status: 'SUCCESS',\r\n result: input,\r\n metadata: {}\r\n };\r\n};\r\n\r\nexport const wrapInRejectedAsyncResult = (input: T | null | undefined): AsyncResult => {\r\n return >{\r\n status: 'FAILED',\r\n result: input,\r\n metadata: {}\r\n };\r\n};\r\n\r\n\r\n/**\r\n * Utility function to extract the active productId in the following priority:\r\n * First query param (productId), then UrlToken (itemId), then module config.\r\n * @param inputData - The Action Input data.\r\n * @returns Productid or undefined.\r\n */\r\nexport const getSelectedProductIdFromActionInput = (inputData: ICreateActionContext>): string | undefined => {\r\n const context = inputData.requestContext;\r\n const variantId = context.app.config.queryBasedVariantSelection ? getQueryParamsFromQueryByName(context.url.requestUrl, variantQueryStringName) : undefined;\r\n\r\n if (variantId) {\r\n return variantId;\r\n } else if (context.query?.productId) {\r\n return context.query.productId;\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Exsiting code.\r\n } else if (context.urlTokens && inputData.requestContext.urlTokens.itemId && inputData.requestContext.urlTokens.pageType === 'Product') {\r\n return context.urlTokens.itemId;\r\n } else if (inputData && inputData.config && inputData.config.productId) {\r\n return inputData.config.productId;\r\n }\r\n return undefined;\r\n};\r\n\r\nexport const getQueryParamsFromQueryByName = (inputUrl: URL, queryParamName: string) => {\r\n const urlWithIgnoredCase = new URL(inputUrl.toString().toLocaleLowerCase());\r\n const urlParameters = urlWithIgnoredCase.searchParams;\r\n const value = urlParameters.get(queryParamName.trim().toLocaleLowerCase());\r\n if (!value || Number.isNaN(Number(value))) {\r\n return undefined;\r\n }\r\n return value;\r\n};\r\n/**\r\n * Generates a Image URL based on data return from retail server.\r\n * @param imageUrl The image url returned by Retail Server.\r\n * @param ctx The request context.\r\n * @param apiSettings\r\n */\r\nexport const generateImageUrl = (imageUrl: string | undefined, apiSettings: ICommerceApiSettings): string | undefined => {\r\n if (imageUrl) {\r\n // Images hosted in CMS include schema\r\n if (imageUrl.startsWith('http')) {\r\n return imageUrl;\r\n }\r\n\r\n // Images hosted in Retail Server must be encoded and joined with the base image url\r\n return apiSettings.baseImageUrl + encodeURIComponent(imageUrl);\r\n }\r\n\r\n // D365Commerce.telemetry.warning(`Unable to generate a proper Image URL for Product: ${product.RecordId}`);\r\n return undefined;\r\n\r\n};\r\n\r\n/**\r\n * Represents app configuration for dimensions.\r\n */\r\nexport interface IDimensionsConfig {\r\n dimensionsAsSwatchType?: DimensionTypes[];\r\n dimensionsInProductCard?: DimensionTypes[];\r\n inventoryLevel?: InventoryLevels;\r\n dimensionToPreSelectInProductCard?: DimensionTypes;\r\n}\r\n\r\n/**\r\n * Represents app configuration for dimensions.\r\n */\r\nexport interface IDimensionsApp {\r\n config: IDimensionsConfig;\r\n}\r\n\r\n/**\r\n * Represents product dimension types.\r\n */\r\nexport enum DimensionTypes {\r\n none = 'none',\r\n color = 'color',\r\n configuration = 'configuration',\r\n size = 'size',\r\n style = 'style'\r\n}\r\n\r\n/**\r\n * Defines display configuration types.\r\n */\r\nexport enum DimensionSwatchDisplayTypes {\r\n default = 'default',\r\n productCard = 'productCard'\r\n}\r\n\r\n/**\r\n * Checks if rendering the particular dimensions is allowed.\r\n * @param dimensionType - Dimension to be displayed.\r\n * @param context - Core application context.\r\n * @param displayType - The swatch location, the component from which it comes from.\r\n * @returns Updates the state with new product page url.\r\n */\r\nexport const checkIfShouldDisplayAsSwatch = (\r\n dimensionType: DimensionTypes,\r\n context: ICoreContext,\r\n displayType: DimensionSwatchDisplayTypes = DimensionSwatchDisplayTypes.default): boolean => {\r\n\r\n // Additional checks for the product card since it has a separate config setting.\r\n if (displayType === DimensionSwatchDisplayTypes.productCard) {\r\n const dimensionsToDisplayOnProductCard = context.app.config.dimensionsInProductCard;\r\n if (!ArrayExtensions.hasElements(dimensionsToDisplayOnProductCard) ||\r\n dimensionsToDisplayOnProductCard.includes(DimensionTypes.none) ||\r\n !dimensionsToDisplayOnProductCard.includes(dimensionType)) {\r\n return false;\r\n }\r\n }\r\n\r\n const dimensionsToDisplayAsSwatch = context.app.config.dimensionsAsSwatchType;\r\n return ArrayExtensions.hasElements(dimensionsToDisplayAsSwatch) &&\r\n !dimensionsToDisplayAsSwatch.includes(DimensionTypes.none) &&\r\n dimensionsToDisplayAsSwatch.includes(dimensionType);\r\n};\r\n\r\n/**\r\n * Generates an image URL for a swatch.\r\n * @param imageUrl - The image url returned by Retail Server.\r\n * @param apiSettings - The request context.\r\n * @returns Full image url.\r\n */\r\nexport const generateSwatchImageUrl = (imageUrl: string, apiSettings: ICommerceApiSettings): string => {\r\n if (imageUrl.startsWith('http')) {\r\n return imageUrl;\r\n }\r\n\r\n return apiSettings.baseImageUrl + encodeURIComponent(imageUrl);\r\n};\r\n\r\n/**\r\n * Generates a Image URL for a product based on data return from retail server.\r\n * @param product The Product returned by Retail Server.\r\n * @param ctx The request context.\r\n * @param apiSettings\r\n */\r\nexport const generateProductImageUrl = (\r\n product: SimpleProduct | ProductSearchResult,\r\n apiSettings: ICommerceApiSettings\r\n): string | undefined => {\r\n return generateImageUrl(product.PrimaryImageUrl, apiSettings);\r\n};\r\n\r\n/**\r\n * Creates a CartLine object from the passed data.\r\n * @param product The product.\r\n * @param quantity The quantity.\r\n * @param catalogId The catalog.\r\n */\r\nexport const buildCartLine = (product: SimpleProduct, quantity?: number, catalogId?: number): CartLine => {\r\n return {\r\n CatalogId: catalogId || 0,\r\n Description: product.Description,\r\n\r\n // TODO: Investigate this value and what it represents\r\n EntryMethodTypeValue: 3,\r\n ItemId: product.ItemId,\r\n ProductId: product.RecordId,\r\n Quantity: quantity || 1,\r\n TrackingId: '',\r\n UnitOfMeasureSymbol: product.DefaultUnitOfMeasure\r\n };\r\n};\r\n\r\n/**\r\n * Creates a CommerceListLine (also know as WishlistLine) object from the passed data.\r\n * @param productId The RecordId of the Product to be added.\r\n * @param customerId The account number of the customer.\r\n * @param wishlistId The Id of the commerce list.\r\n */\r\nexport const buildWishlistLine = (productId: number, customerId: string, wishlistId: number): CommerceListLine => {\r\n return {\r\n CommerceListId: wishlistId,\r\n ProductId: productId,\r\n CustomerId: customerId\r\n };\r\n};\r\n\r\n/**\r\n * Utility function to prepare the product details criteria before getting full product:\r\n * @param inputData The Action Input data\r\n */\r\nexport const getProductDetailsCriteriaFromActionInput = (inputData: ICreateActionContext>): ProductDetailsCriteria => {\r\n if (inputData && inputData.config) {\r\n return {\r\n getPrice: !inputData.config.hidePrice,\r\n getRating: !inputData.config.hideRating\r\n };\r\n }\r\n return {\r\n getPrice: true,\r\n getRating: true\r\n };\r\n};\r\n\r\n/**\r\n * Transforms search text into the expected 'search terms' format, expected by refiner APIs.\r\n * @param searchText Free-form text used for searching for products or categories of products.\r\n */\r\nexport const ensureSearchTextIsFormedProperly = (searchText: string): string => {\r\n const prefix = searchText.startsWith('\\'') ? '' : '\\'';\r\n const suffix = searchText.endsWith('\\'') ? '' : '\\'';\r\n return `${prefix}${searchText}${suffix}`;\r\n};\r\n\r\nexport const ensureSafeSearchText = (searchText: string): string => {\r\n return searchText?.replace(/[^\\d\\sA-Za-z]+/g, '');\r\n};\r\n\r\nexport const buildCacheKey = (base: string, apiSettings: ICommerceApiSettings, locale?: string): string => {\r\n return `${base}-chanId:${apiSettings.channelId}-catId:${apiSettings.catalogId}${locale ? `-${locale}` : ''}`;\r\n};\r\n\r\nexport const buildCacheKeyWithUrlTokens = (base: string, requestContext: IRequestContext): string => {\r\n const urlTokens = requestContext.urlTokens;\r\n const defaultCacheKey = buildCacheKey(base, requestContext.apiSettings, requestContext.locale);\r\n return urlTokens ? `${defaultCacheKey}-${urlTokens.itemId}-${urlTokens.recordId}-${urlTokens.pageType}` : defaultCacheKey;\r\n};\r\n\r\n/**\r\n * Generates a key from set of arguments as inputs.\r\n *\r\n * @param args Argument list of pivots to generate key from.\r\n * @param handler Handler function for null/undefined values.\r\n */\r\n\r\ntype TKeyTypes = string | number | boolean | null | undefined;\r\ninterface IGenerateKeyOptions {\r\n separator?: string;\r\n handler?(input: null | undefined): string;\r\n}\r\nexport const generateKey = (args: TKeyTypes[], options?: IGenerateKeyOptions): string => {\r\n const { handler, separator }: IGenerateKeyOptions = { ...{ separator: '-', handler: undefined }, ...(options || {}) };\r\n return args\r\n .map(arg => {\r\n if (arg === null || arg === undefined) {\r\n if (handler) {\r\n return handler(arg);\r\n }\r\n }\r\n return arg;\r\n })\r\n .join(separator);\r\n};\r\n\r\n/**\r\n * Gets the fall back image url for a variant image.\r\n * @param itemId Item id of a product.\r\n * @param apiSettings Api setting from request context.\r\n */\r\nexport const getFallbackImageUrl = (itemId: string | undefined, apiSettings: ICommerceApiSettings): string | undefined => {\r\n if (!itemId) {\r\n return '';\r\n }\r\n\r\n const parsedItemId = itemId.trim().split(' ')[0];\r\n\r\n const productUrl = `Products/${parsedItemId}_000_001.png`;\r\n return generateImageUrl(productUrl, apiSettings);\r\n};\r\n\r\n/**\r\n * Converts retail proxy product dimension type to display dimension type.\r\n * @param productDimensionType - Product dimension type from retail proxy.\r\n * @returns Local dimension type.\r\n */\r\nexport const convertProductDimensionTypeToDimensionTypes = (productDimensionType: ProductDimensionType): DimensionTypes => {\r\n switch (productDimensionType) {\r\n case ProductDimensionType.Color:\r\n return DimensionTypes.color;\r\n case ProductDimensionType.Configuration:\r\n return DimensionTypes.configuration;\r\n case ProductDimensionType.Size:\r\n return DimensionTypes.size;\r\n case ProductDimensionType.Style:\r\n return DimensionTypes.style;\r\n default:\r\n return DimensionTypes.none;\r\n }\r\n};\r\n\r\n/**\r\n * Converts display dimension type to retail proxy product dimension type.\r\n * @param dimensionType - Local dimension type.\r\n * @returns Product dimension type from retail proxy.\r\n */\r\nexport const convertDimensionTypeToProductDimensionType = (dimensionType: DimensionTypes): ProductDimensionType => {\r\n switch (dimensionType) {\r\n case DimensionTypes.color:\r\n return ProductDimensionType.Color;\r\n case DimensionTypes.configuration:\r\n return ProductDimensionType.Configuration;\r\n case DimensionTypes.size:\r\n return ProductDimensionType.Size;\r\n case DimensionTypes.style:\r\n return ProductDimensionType.Style;\r\n default:\r\n return ProductDimensionType.None;\r\n }\r\n};\r\n\r\n/**\r\n * Sets dimensions to url.\r\n * @param inputUrl - Url to update.\r\n * @param productDimensions - Dimensions to set.\r\n */\r\nexport const setDimensionValuesToQuery = (inputUrl: URL, productDimensions: ProductDimension[]): void => {\r\n for (const dimension of productDimensions) {\r\n inputUrl.searchParams.set(\r\n convertProductDimensionTypeToDimensionTypes(dimension.DimensionTypeValue), dimension.DimensionValue?.Value ?? '');\r\n }\r\n\r\n window.history?.replaceState(window.history.state, '', inputUrl.toString()?.replace(inputUrl.host, window.location.host));\r\n};\r\n\r\n/**\r\n * Retrieves dimension value stored in url.\r\n * @param urlParameters - Url parameters.\r\n * @param productDimensionType - The dimension type to retrieve.\r\n * @returns Product dimension item.\r\n */\r\nconst parseDimensionFromUrl = (urlParameters: URLSearchParams, productDimensionType: ProductDimensionType): ProductDimension | undefined => {\r\n const localDimensionType = convertProductDimensionTypeToDimensionTypes(productDimensionType);\r\n const value = urlParameters.get(localDimensionType);\r\n if (!value) {\r\n return undefined;\r\n }\r\n return {\r\n DimensionTypeValue: productDimensionType,\r\n DimensionValue: {\r\n RecordId: 0,\r\n Value: value\r\n }\r\n };\r\n};\r\n\r\n/**\r\n * Retrieves all dimensions from URL.\r\n * @param urlParameters - Url parameters.\r\n * @returns Product dimensions stored in url.\r\n */\r\nconst parseDimensionsFromUrl = (urlParameters: URLSearchParams): ProductDimension[] => {\r\n const dimensionsToParse: ProductDimensionType[] = [\r\n ProductDimensionType.Color,\r\n ProductDimensionType.Configuration,\r\n ProductDimensionType.Size,\r\n ProductDimensionType.Style\r\n ];\r\n const parsedDimensions = dimensionsToParse.map(dimension => parseDimensionFromUrl(urlParameters, dimension));\r\n return ArrayExtensions.validValues(parsedDimensions);\r\n};\r\n\r\n/**\r\n * Utility function to extract the dimension values from input url querystring.\r\n * @param inputUrl - The request url.\r\n * @returns The selected dimension values.\r\n */\r\nexport const getDimensionValuesFromQuery = (inputUrl: URL): ProductDimension[] => {\r\n const urlWithIgnoredCase = new URL(inputUrl.toString().toLocaleLowerCase());\r\n const urlParameters = urlWithIgnoredCase.searchParams;\r\n const dimensions: ProductDimension[] = parseDimensionsFromUrl(urlParameters);\r\n return dimensions;\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 {\r\n CacheType,\r\n createObservableDataAction,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n IAny,\r\n ICreateActionContext,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\n/* tslint:disable: no-duplicate-imports */\r\nimport { observable } from 'mobx';\r\n\r\n\r\n/**\r\n * ListPageState class\r\n */\r\nexport class ListPageStateBuyBox {\r\n @observable public variantId: string | undefined = '';\r\n @observable public itemId: string | undefined = '';\r\n @observable public name: string | undefined = '';\r\n @observable public categoryName: string | undefined = '';\r\n @observable public productBrandName: string | undefined = '';\r\n @observable public price: string | undefined = '';\r\n @observable public productUrl: string | undefined = '';\r\n @observable public productImageUrl: string | undefined = '';\r\n @observable public productSize: string | undefined = '';\r\n}\r\n\r\n/**\r\n * ListPageStateInput - action input\r\n */\r\nexport class ListPageStateBuyBoxInput implements IActionInput {\r\n public getCacheKey = () => `ListPageStateBuyBox`;\r\n public getCacheObjectType = () => 'ListPageStateBuyBox';\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\nexport async function listPageStateAction(\r\n input: ListPageStateBuyBoxInput,\r\n ctx: IActionContext\r\n): Promise {\r\n return new ListPageStateBuyBox();\r\n}\r\n\r\n/**\r\n * create new input for create action\r\n */\r\nexport const createListPageInput = (\r\n inputData: ICreateActionContext>\r\n): IActionInput => {\r\n return new ListPageStateBuyBoxInput();\r\n};\r\n\r\n/**\r\n * ListPageState - create action\r\n */\r\nexport default createObservableDataAction({\r\n action: >listPageStateAction,\r\n input: createListPageInput\r\n});\r\n","/* tslint:disable: no-duplicate-imports */\r\nimport { IPageSummaryData } from '@msdyn365-commerce-modules/page-summary';\r\nimport { buildCacheKeyWithUrlTokens, CurrentCategoryInput, getCategoryUrl, getCurrentCategory, removeDomainQspFromUrl } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { CategoryHierarchy, IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport {\r\n CacheType,\r\n createObservableDataAction,\r\n getFriendlyName,\r\n IAction,\r\n IActionContext,\r\n IActionInput,\r\n ICreateActionContext,\r\n IRequestContext,\r\n IAny,\r\n IGeneric\r\n} from '@msdyn365-commerce/core';\r\nimport flatten from 'lodash/flatten';\r\n// VSI customization: 7924 Start\r\nimport getHtmlParserValue from '../../Utilities/get-html-parser-value';\r\nimport { canonicalURL, getSortedVirtualRefinerConfig, getVirtualRefinerNames, regExSpecialChars, removeKeywords } from '../../Utilities/plp-url-utils';\r\nimport getSEOData, { GetSeoDataInput } from '../../data-actions/get-seo-data.action';\r\nimport { getProductSearchRefinersAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport { ProductRefiner } from '@msdyn365-commerce/retail-proxy';\r\nimport { IMfrmCategoryPageSummaryConfig } from './mfrm-category-page-summary.props.autogenerated';\r\n// VSI customization: 7924 End\r\n\r\n/** Category Page Summary Input */\r\nexport class MFRMCategoryPageSummaryInput implements IActionInput {\r\n public requestContext: IRequestContext;\r\n public config: IMfrmCategoryPageSummaryConfig;\r\n constructor(config: IMfrmCategoryPageSummaryConfig, requestContext: IRequestContext) {\r\n this.config = config || {};\r\n this.requestContext = requestContext;\r\n }\r\n\r\n public getCacheObjectType = (): string => 'MFRMCategoryPageSummary';\r\n public getCacheKey = (): string => `${buildCacheKeyWithUrlTokens('MFRMCategoryPageSummary', this.requestContext)}-${this.requestContext?.url?.requestUrl?.pathname?.toLowerCase()}`;\r\n public dataCacheType = (): CacheType => 'application';\r\n}\r\n\r\nconst createGetCurrentCategoryInput = (inputData: IActionContext): CurrentCategoryInput => {\r\n if (inputData && inputData.requestContext) {\r\n return new CurrentCategoryInput(inputData.requestContext);\r\n }\r\n\r\n throw new Error('Please specify categoryId query string in request.');\r\n};\r\n\r\n/**\r\n * Get skip count.\r\n * @param inputData\r\n */\r\nfunction getSkipCount(inputData: ICreateActionContext, IGeneric>): string | undefined {\r\n return inputData && inputData.requestContext && inputData.requestContext.query && inputData.requestContext.query.skip;\r\n}\r\n\r\nconst _getSEOMetaTagValue = (currentCategory: CategoryHierarchy, keyValue: string) => {\r\n return currentCategory?.ExtensionProperties?.find((attr) => attr.Key === keyValue)?.Value?.StringValue;\r\n};\r\n\r\nconst _getActiveRefiners = (refiners: IProductRefinerHierarchy[], requestContext: IRequestContext, CategoryHierarchy: any): string[] | undefined => {\r\n // get refiners from URL\r\n const configVirtualRefinerNames = getVirtualRefinerNames(requestContext, false);\r\n const filteredRefiners = refiners && refiners.filter((refiner) => {\r\n return refiner.KeyName && configVirtualRefinerNames.indexOf(refiner.KeyName.toLowerCase()) !== -1;\r\n });\r\n // get category slug\r\n let slug = (CategoryHierarchy && CategoryHierarchy.Slug) || '';\r\n let slugArray: string[];\r\n let pathArray: string[];\r\n const sortedConfigValues = getSortedVirtualRefinerConfig(requestContext, false);\r\n if (sortedConfigValues && slug) {\r\n slugArray = slug.split('/').splice(1);\r\n // remove keywords form slugArray\r\n slugArray = removeKeywords(slugArray, requestContext);\r\n // FIX reset slug to without keywords\r\n slug = slugArray.join('/');\r\n // path of URL\r\n let path = requestContext.url.requestUrl.pathname.toLowerCase();\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 path = path?.replace(`/${categoryId}`, '');\r\n }\r\n // remove category slug\r\n pathArray = removeKeywords(path.split('\\/').splice(1), requestContext);\r\n path = pathArray.join('\\/');\r\n const removedCategorySlug = path.split(slug).splice(1)[0];\r\n let refinerParts: string[] = [];\r\n if (removedCategorySlug !== '') {\r\n refinerParts = decodeURIComponent(removedCategorySlug).split('/');\r\n }\r\n if (refinerParts && refinerParts.length > 0 && slugArray && slugArray.length > 0) {\r\n // remove duplicates if any from the first url part\r\n slugArray.forEach(_slug => {\r\n refinerParts.forEach(refinerPart => {\r\n const index = slugArray.indexOf(refinerPart);\r\n if (index !== -1) {\r\n slugArray.splice(index, 1);\r\n }\r\n });\r\n });\r\n }\r\n const finalRefinerParts: string[] = [];\r\n refinerParts.forEach(refinerPart => {\r\n refinerPart.split('|').map(item => finalRefinerParts.push(item.includes('-') ? item : item.split('-').join(' ')));\r\n });\r\n refinerParts = finalRefinerParts && flatten(finalRefinerParts);\r\n // setup object with refiner values\r\n const sortedValues: { [key: string]: string[] } = {};\r\n filteredRefiners?.forEach(refinerSet => {\r\n let refinerName = refinerSet.KeyName;\r\n if (refinerName) {\r\n refinerName = refinerName.toLowerCase();\r\n sortedValues[refinerName] = []; // size, brand, price\r\n }\r\n refinerSet.Values.forEach((refiner) => {\r\n refinerParts.forEach((refinerPart) => {\r\n if (refinerName && refiner.LeftValueBoundString &&\r\n (refiner.LeftValueBoundString.toLowerCase()?.replace(/\\&/g, 'and')?.replace(regExSpecialChars(requestContext.app.config.canonicalUrlspecialCharIncludeList), '-') === refinerPart.toLocaleLowerCase().split('-').join(' ')\r\n || refiner.LeftValueBoundString.toLowerCase()?.replace(/\\&/g, 'and')?.replace(regExSpecialChars(requestContext.app.config.canonicalUrlspecialCharIncludeList), '-') === refinerPart.toLocaleLowerCase())) {\r\n sortedValues[refinerName].push(refiner.LeftValueBoundString);\r\n } else if (refinerName && refiner.LeftValueBoundString &&\r\n refiner.LeftValueBoundString.toLowerCase() === refinerPart.toLowerCase().split('-').join(' ')) {\r\n sortedValues[refinerName].push(refinerPart);\r\n }\r\n });\r\n });\r\n });\r\n // alpha sort\r\n // @ts-ignore\r\n for (const sortedValue of Object.keys(sortedValues)) {\r\n sortedValues[sortedValue].length > 0 &&\r\n sortedValues[sortedValue].sort((a: string, b: string) => {\r\n if (a < b) {\r\n return -1;\r\n }\r\n if (a > b) {\r\n return 1;\r\n }\r\n return 0;\r\n });\r\n }\r\n // @ts-ignore\r\n const finalRefiners: string[] = [];\r\n sortedConfigValues.forEach(sortedConfigValue => {\r\n const sortedRefinerName = sortedConfigValue.refinerName.toLowerCase();\r\n if (sortedValues[sortedRefinerName] !== undefined && sortedValues[sortedRefinerName].length > 0) {\r\n // @ts-ignore\r\n finalRefiners.push(sortedValues[sortedRefinerName].join(' '));\r\n }\r\n });\r\n return finalRefiners;\r\n }\r\n return undefined;\r\n};\r\n\r\nasync function getAllRefinersAction(ctx: IActionContext): Promise {\r\n const searchCriteria = {\r\n SearchCondition: '*',\r\n Context: {\r\n ChannelId: ctx.requestContext.apiSettings.channelId,\r\n CatalogId: ctx.requestContext.apiSettings.catalogId\r\n }\r\n };\r\n return getProductSearchRefinersAsync({ callerContext: ctx }, searchCriteria).then(\r\n (productRefiners: ProductRefiner[]) => {\r\n if (!productRefiners) {\r\n ctx.telemetry.error('[getRefinersByCriteriaAction] returned no refiners');\r\n return [];\r\n }\r\n\r\n const result = (productRefiners || []).map((productRefiner: ProductRefiner) => productRefiner);\r\n\r\n if (result.length === 0) {\r\n ctx.telemetry.error('[getRefinersByCriteriaAction] returned no IProductRefinerHierarchy objects');\r\n return [];\r\n }\r\n\r\n return result;\r\n }\r\n ).catch((err) => {\r\n console.log('[getRefinersByCriteriaAction Category-page-summary] returned no IProductRefinerHierarchy objects', err);\r\n ctx.telemetry.error(`[getRefinersByCriteriaAction Category-page-summary] returned no IProductRefinerHierarchy objects ${err}`);\r\n return [];\r\n });\r\n}\r\n\r\nasync function getFallbackTitle(context: IActionContext, requestContext: IRequestContext, currentCategory: any): Promise {\r\n let activeRefinerList: string[] | undefined = [];\r\n return getAllRefinersAction(context).then(refiners => {\r\n activeRefinerList = _getActiveRefiners(refiners, requestContext, currentCategory);\r\n const concateTitle = `${activeRefinerList && activeRefinerList?.length > 0 ? activeRefinerList.length === 1 ? ` ${activeRefinerList[0]} ` : ` ${activeRefinerList?.join(' ')} ` : ''}`;\r\n const fallbackTitle = concateTitle && `Shop for${concateTitle}Products | Mattress Firm`;\r\n return fallbackTitle;\r\n }).catch((err) => {\r\n console.log('[getFallbackTitle Category-page-summary] has some errors', err);\r\n context.telemetry.error(`[getFallbackTitle Category-page-summary] has some errors- ${err}`);\r\n return \"\";\r\n });\r\n}\r\n\r\nconst action = async (input: MFRMCategoryPageSummaryInput, context: IActionContext): Promise => {\r\n const { config } = input;\r\n const seoInput = new GetSeoDataInput(context.requestContext.app.config.seoDataUrl || 'https://files-us-prod.cms.commerce.dynamics.com/cms/api/fknscsckgq/binary/MA5cA7');\r\n const seoData = await getSEOData(seoInput, context);\r\n const seoPageTitle = seoData && seoData['SEO State'] === 'Active' && seoData['Title Tag'];\r\n const seoPageMetaData = seoData && seoData['SEO State'] === 'Active' && seoData['Meta Description'];\r\n let currentCategory: any;\r\n try {\r\n currentCategory = await getCurrentCategory(createGetCurrentCategoryInput(context), context);\r\n } catch (e) {\r\n // Do nothing, if the action fails fallback to values defined in data\r\n }\r\n if (currentCategory) {\r\n let categoryUrl: string | undefined;\r\n let fallbackTitle;\r\n if (!seoPageTitle) {\r\n fallbackTitle = await getFallbackTitle(context, input.requestContext, currentCategory);\r\n }\r\n const pageTitle = seoPageTitle || fallbackTitle || _getSEOMetaTagValue(currentCategory, 'CategoryPageTitle');\r\n const pageTitleParser = getHtmlParserValue(pageTitle);\r\n\r\n const fallBackMeta = 'Find comfortable mattresses, high quality beds, and accessories from top brands all at great low prices at Mattress Firm';\r\n const categoryPageMetaData = seoPageMetaData || fallBackMeta || _getSEOMetaTagValue(currentCategory, 'CategoryPageMetaData');\r\n const categoryPageMetaDataParser = getHtmlParserValue(categoryPageMetaData);\r\n try {\r\n // reset category's name neutralizedName\r\n const localName = getFriendlyName(context.requestContext.locale, currentCategory.NameTranslations);\r\n const neutralizedName = currentCategory.NeutralizedName || currentCategory.Name;\r\n currentCategory.Name = localName;\r\n currentCategory.NeutralizedName = neutralizedName;\r\n categoryUrl = getCategoryUrl(currentCategory);\r\n // @ts-ignore - TODO: property exits in new version of SDK. Remove once released.\r\n const canonicalDomain = context.requestContext.canonicalDomain;\r\n if (categoryUrl && canonicalDomain) {\r\n categoryUrl = canonicalURL(context.requestContext).toLocaleLowerCase();\r\n /**\r\n * Changes from v30\r\n */\r\n const skipCount = getSkipCount(context);\r\n const Url = new URL(categoryUrl);\r\n const urlParams: URLSearchParams = new URLSearchParams(Url.search);\r\n if (skipCount) {\r\n urlParams.set('skip', skipCount);\r\n }\r\n Url.search = urlParams.toString();\r\n categoryUrl = Url.toString();\r\n categoryUrl = removeDomainQspFromUrl(categoryUrl, context.requestContext);\r\n } else {\r\n categoryUrl = undefined;\r\n }\r\n } catch (e) {\r\n categoryUrl = undefined;\r\n }\r\n return {\r\n title: pageTitleParser || currentCategory.Name,\r\n description: categoryPageMetaDataParser || '',\r\n sharingImageUrl: currentCategory.OfflineImage,\r\n canonicalUrl: categoryUrl,\r\n faviconUrl: config && config.faviconUrl\r\n };\r\n // If the action fails fallback to values defined from data\r\n } else if (config) {\r\n return {\r\n title: config.title,\r\n sharingImageUrl: config.sharingImage && config.sharingImage.src,\r\n faviconUrl: config && config.faviconUrl\r\n };\r\n } else {\r\n return {};\r\n }\r\n};\r\n\r\nexport default createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/page-summary/category-page-summary',\r\n action: >action,\r\n input: (args: ICreateActionContext) => {\r\n return new MFRMCategoryPageSummaryInput(args.config, args.requestContext);\r\n }\r\n});\r\n","/* eslint-disable no-duplicate-imports */\r\nimport { IPageSummaryData } from '@msdyn365-commerce-modules/page-summary';\r\nimport { buildCacheKey, generateImageUrl, getProductUrlSync, getSelectedProductIdFromActionInput, QueryResultSettingsProxy, removeDomainQspFromUrl } from '@msdyn365-commerce-modules/retail-actions';\r\nimport MsDyn365, {\r\n CacheType, createObservableDataAction, IAction, IActionContext, IActionInput,\r\n ICommerceApiSettings, ICreateActionContext, IRequestContext, getCatalogId\r\n} from '@msdyn365-commerce/core';\r\nimport { AttributeValue, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { getAttributeValuesAsync, getByIdsAsync, getActivePricesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\nimport getHtmlParserValue from '../../Utilities/get-html-parser-value';\r\nimport { IMfrmProductPageSummaryConfig } from './mfrm-product-page-summary.props.autogenerated';\r\nimport getSelectedVariant, { SelectedVariantInput } from '../../data-actions/get-selected-variant.override.action';\r\nimport { getQueryParamsFromQueryByName } from '../../data-actions/utilities/utils';\r\nimport { variantQueryStringName } from '../../Utilities/constants';\r\n//import { getAllVariantsForProduct, BuyboxGetDimensionVariantAvailabilityInput } from '../../data-actions/buybox-get-all-variants-list';\r\n\r\n/** Product Page Summary Input */\r\nexport class ProductPageSummaryInput implements IActionInput {\r\n public apiSettings: ICommerceApiSettings;\r\n public config: IMfrmProductPageSummaryConfig;\r\n public productId: number;\r\n public catalogId?: number;\r\n\r\n public constructor(config: IMfrmProductPageSummaryConfig, apiSettings: ICommerceApiSettings, productId: number, requestContext?: IRequestContext) {\r\n this.config = config || {};\r\n this.apiSettings = apiSettings;\r\n this.productId = productId;\r\n\r\n if (requestContext) {\r\n this.catalogId = getCatalogId(requestContext);\r\n }\r\n }\r\n\r\n public getCacheObjectType = (): string => 'ProductPageSummary';\r\n public getCacheKey = (): string => `${buildCacheKey('ProductPageSummary', this.apiSettings)}-${this.config.title}-${this.productId}-${this.catalogId ?? 0}`;\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\n//TODO: move to .data.ts\r\nexport interface IProductPageSummary extends IPageSummaryData {\r\n price?: number;\r\n variantId?: number;\r\n masterProductId?: number;\r\n productBrand?: string;\r\n priceValidUntil?: string;\r\n itemCondition?: string;\r\n isOutOfStockArray?: { key: string, value: string }[];\r\n gtinArray?: { key: string, value: string }[];\r\n}\r\n\r\n//NOTE: needed for `export default createObservableDataAction({})`\r\nconst createInput = (args: ICreateActionContext) => {\r\n const productId = getSelectedProductIdFromActionInput(args);\r\n\r\n if (productId) {\r\n return new ProductPageSummaryInput(args.config, args.requestContext.apiSettings, +productId, args.requestContext);\r\n } else {\r\n throw new Error('Unable to create ProductPageSummaryAction input, no productId found on module config or query');\r\n }\r\n\r\n};\r\n\r\n//TODO: move in a common utility file\r\nfunction _getAttributeByName(attributeValues: AttributeValue[] | undefined, keyValue: string) {\r\n return attributeValues && attributeValues.find(currAttribute => currAttribute.Name && currAttribute.Name.toLowerCase().trim() === keyValue.toLowerCase().trim());\r\n}\r\n\r\n//TODO: move to utility file\r\nfunction parseAttributeTextArray(text: string | string[] | undefined): { key: string, value: string }[] {\r\n const rtn: { key: string, value: string }[] = [];\r\n\r\n if (text !== undefined) {\r\n if (!(text instanceof Array)) {\r\n text = [text];\r\n }\r\n\r\n text.forEach(str => {\r\n str?.replace(/[\\[\\]\"\\s]/g, '').split(',').forEach(it => {\r\n const keyVal = it.split('|');\r\n rtn.push({\r\n key: keyVal[0],\r\n value: keyVal[1]\r\n });\r\n });\r\n });\r\n }\r\n\r\n return rtn;\r\n}\r\n\r\nconst action = async (input: ProductPageSummaryInput, context: IActionContext): Promise => {\r\n const {\r\n config,\r\n productId,\r\n apiSettings,\r\n apiSettings: {\r\n channelId\r\n }\r\n } = input;\r\n const url = MsDyn365.isBrowser\r\n ? new URL(window.location.href.toString())\r\n : context.requestContext.url.requestUrl;\r\n //TODO: move get variantId from url logic into utility file and use in `createInput` methode\r\n let variantId = Number(getQueryParamsFromQueryByName(url, variantQueryStringName)) || undefined;\r\n if (!variantId) {\r\n try {\r\n const input = new SelectedVariantInput(productId, channelId);\r\n const selectedVariant = await getSelectedVariant(input, context) || undefined;\r\n variantId = selectedVariant?.RecordId;\r\n if (!variantId) {\r\n throw new Error(`Error - Had to fallback to MasterProductId for SEO Schema at ${url}`);\r\n }\r\n } catch (error) {\r\n console.error(error);\r\n variantId = productId;\r\n }\r\n }\r\n\r\n const byIdAsync = productId && getByIdsAsync(\r\n {\r\n callerContext: context,\r\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(context)\r\n },\r\n apiSettings.channelId,\r\n [productId],\r\n null,\r\n input.catalogId ?? 0\r\n ).catch(e => {\r\n // Do nothing, if there's an error we fall back to values defined from config\r\n console.error(\"Error while calling getByIdAsync: \", e);\r\n });\r\n const attributeValuesAsync = getAttributeValuesAsync(\r\n {\r\n callerContext: context,\r\n queryResultSettings: QueryResultSettingsProxy.getPagingFromInputDataOrDefaultValue(context)\r\n },\r\n productId,\r\n apiSettings.channelId,\r\n apiSettings.catalogId\r\n ).catch(e => {\r\n // Do nothing, if error fall back to config values\r\n console.error(\"Error while calling getAttributeValuesAsync: \", e);\r\n });\r\n const activePricesAsync = getActivePricesAsync(\r\n { callerContext: context },\r\n {\r\n ChannelId: context.requestContext.apiSettings.channelId,\r\n CatalogId: context.requestContext.apiSettings.catalogId\r\n },\r\n [+variantId],\r\n new Date(),\r\n null,\r\n [],\r\n true\r\n ).catch(e => {\r\n // Do nothing, if error fall back to config values\r\n console.error(\"Error while calling getActivePricesAsync: \", e);\r\n });\r\n //wait for all async to resolve\r\n const asynValues = await Promise.allSettled([\r\n byIdAsync,\r\n attributeValuesAsync,\r\n activePricesAsync\r\n ]);\r\n\r\n //results from async calls\r\n const simpleProductsData = asynValues[0].status === \"fulfilled\" ? asynValues[0].value || undefined : undefined;\r\n const productAttributes = asynValues[1].status === \"fulfilled\" ? asynValues[1].value || undefined : undefined;\r\n const productActivePrices = asynValues[2].status === \"fulfilled\" ? asynValues[2].value || undefined : undefined;\r\n const productActivePrice = productActivePrices && productActivePrices[0];\r\n const simpleProductData: SimpleProduct | undefined = simpleProductsData && simpleProductsData[0];\r\n const itemCondition = 'NewCondition';\r\n\r\n const pageTitleAttribute = _getAttributeByName(productAttributes, 'pageTitle')?.TextValue;\r\n const pageTitle = pageTitleAttribute ? getHtmlParserValue(pageTitleAttribute) : '';\r\n\r\n const pageDescriptionAttribute = _getAttributeByName(productAttributes, 'pageDescription')?.TextValue;\r\n const pageDescription = pageDescriptionAttribute ? getHtmlParserValue(pageDescriptionAttribute) : '';\r\n\r\n const priceValidUntil = productActivePrice?.DiscountLines && productActivePrice.DiscountLines[0]?.ValidTo?.toISOString();\r\n\r\n const isOutOfStockArray = parseAttributeTextArray(\r\n ['EcomAllVariantOOSInfo1',\r\n 'EcomAllVariantOOSInfo2',\r\n 'EcomAllVariantOOSInfo3'\r\n ].map(attributeName => {\r\n return _getAttributeByName(productAttributes, attributeName)?.TextValue || '';\r\n })\r\n );\r\n\r\n const gtinArray = parseAttributeTextArray(\r\n ['EcomAllVariantWithGTIN1',\r\n 'EcomAllVariantWithGTIN2',\r\n 'EcomAllVariantWithGTIN3',\r\n 'EcomAllVariantWithGTIN4',\r\n 'EcomAllVariantWithGTIN5',\r\n 'EcomAllVariantWithGTIN6',\r\n 'EcomAllVariantWithGTIN7',\r\n 'EcomAllVariantWithGTIN8',\r\n 'EcomAllVariantWithGTIN9'\r\n ].map(attributeName => {\r\n return _getAttributeByName(productAttributes, attributeName)?.TextValue || '';\r\n })\r\n );\r\n\r\n if (simpleProductData) {\r\n let productUrl: string | undefined;\r\n let productBrand: string | undefined;\r\n\r\n try {\r\n productUrl = getProductUrlSync(simpleProductData, context);\r\n const canonicalDomain = context.requestContext.canonicalDomain;\r\n if (productUrl && canonicalDomain) {\r\n productUrl = `https://${canonicalDomain}${productUrl}`.toLocaleLowerCase();\r\n productUrl = removeDomainQspFromUrl(productUrl, context.requestContext);\r\n } else {\r\n productUrl = undefined;\r\n }\r\n } catch (e) {\r\n productUrl = undefined;\r\n }\r\n\r\n if (productAttributes) {\r\n productBrand = _getAttributeByName(productAttributes, 'Brand')?.TextValue; //getProductBrand(productAttributes);\r\n } else {\r\n productBrand = undefined;\r\n }\r\n\r\n return {\r\n title: pageTitle || simpleProductData.Name,\r\n description: pageDescription || simpleProductData.Description,\r\n sharingImageUrl: generateImageUrl(simpleProductData.PrimaryImageUrl, apiSettings),\r\n canonicalUrl: `${productUrl}?variantid=${variantId}`,\r\n faviconUrl: config && config.faviconUrl,\r\n variantId: variantId,\r\n masterProductId: simpleProductData.RecordId,\r\n price: productActivePrice?.CustomerContextualPrice,\r\n productBrand: productBrand,\r\n itemCondition: itemCondition,\r\n isOutOfStockArray: isOutOfStockArray,\r\n priceValidUntil: priceValidUntil,\r\n gtinArray: gtinArray\r\n };\r\n // If the action fails fallback to values defined from config\r\n } else if (config) {\r\n return {\r\n title: pageTitle || config.title,\r\n description: pageDescription || config.description,\r\n sharingImageUrl: config.sharingImage && config.sharingImage.src,\r\n faviconUrl: config && config.faviconUrl\r\n };\r\n } else {\r\n return {};\r\n }\r\n};\r\n\r\nexport default createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/page-summary/product-page-summary',\r\n action: >action,\r\n input: createInput\r\n});","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as React from 'react';\r\n\r\nimport { IMfrmUtagDataProps } from './mfrm-utag-data.props.autogenerated';\r\n\r\nexport interface IMfrmUtagDataViewProps extends IMfrmUtagDataProps<{}> {}\r\n\r\n/**\r\n *\r\n * MfrmUtagData component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass MfrmUtagData extends React.PureComponent> {\r\n public render(): JSX.Element | null {\r\n return this.props.renderView(this.props);\r\n }\r\n}\r\n\r\nexport default MfrmUtagData;\r\n","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. See License.txt in the project root for license information.\r\n * IMfrmUtagData scriptModule Interface Properties\r\n * THIS FILE IS AUTO-GENERATED - MANUAL MODIFICATIONS WILL BE LOST\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\nexport const enum pageType {\r\n home = 'home',\r\n product = 'product',\r\n category = 'category',\r\n search = 'search',\r\n content = 'content',\r\n shopping_guides = 'shopping_guides',\r\n brand = 'brand',\r\n holiday = 'holiday',\r\n sale = 'sale',\r\n checkout = 'checkout',\r\n confirmation = 'confirmation',\r\n cart = 'cart',\r\n orderconfirmation = 'orderconfirmation',\r\n error = 'error'\r\n}\r\n\r\nexport const enum pageContextType {\r\n product = 'product',\r\n search = 'search',\r\n content = 'content',\r\n storefront = 'storefront',\r\n cart = 'cart',\r\n sale = 'sale',\r\n checkout = 'checkout',\r\n orderconfirmation = 'orderconfirmation',\r\n error = 'error',\r\n compare = 'compare',\r\n myaccount = 'myaccount',\r\n haulaway = 'haulaway',\r\n orderhistory = 'orderhistory'\r\n}\r\n\r\nexport interface IMfrmUtagDataConfig {\r\n pageType?: pageType;\r\n pageContextType?: pageContextType;\r\n}\r\n\r\nexport interface IMfrmUtagDataProps extends Msdyn365.IModule {\r\n config: IMfrmUtagDataConfig;\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { isNonceEnabled, SDK_FRAGMENT_NAME } from '@msdyn365-commerce/core-internal';\r\nimport * as React from 'react';\r\nimport { IMfrmUtagDataViewProps } from './mfrm-utag-data';\r\nimport { IMfrmUtagDataData } from './mfrm-utag-data.data';\r\nimport { IMfrmUtagDataProps, pageType as PageTypeOptions } from './mfrm-utag-data.props.autogenerated';\r\n\r\nexport default (props: IMfrmUtagDataProps) => {\r\n const source = getPageScript(props);\r\n const nonceToken = props.context && isNonceEnabled(props.context.request);\r\n const scriptHtml = ``;\r\n\r\n // tslint:disable-next-line: react-no-dangerous-html\r\n return React.createElement(SDK_FRAGMENT_NAME, { key: props.id, dangerouslySetInnerHTML: { __html: scriptHtml } });\r\n};\r\n\r\nconst getPageScript = (props: IMfrmUtagDataProps) => {\r\n // Build an array of utag data.\r\n const utag_extra = ['...utag_data', 'new_site: newSiteCookie'];\r\n\r\n // Append values to utag array.\r\n const pageTypeVars = getPageTypeVars(props);\r\n !!pageTypeVars && utag_extra.push(pageTypeVars);\r\n\r\n const pageContextTypeVars = getPageContextTypeVars(props);\r\n !!pageContextTypeVars && utag_extra.push(pageContextTypeVars);\r\n\r\n const productTypeVars = getProductTypeVars(props);\r\n !!productTypeVars && utag_extra.push(productTypeVars);\r\n\r\n const pageNameVars = getPageNameVars(props);\r\n !!pageNameVars && utag_extra.push(pageNameVars);\r\n\r\n // Merge values using a comma as glue.\r\n return `${getCookieFunction()}utag_data = { ${utag_extra.join(', ')} };`;\r\n};\r\n\r\nconst getPageTypeVars = (props: IMfrmUtagDataViewProps) => {\r\n const { pageType } = props.config;\r\n\r\n if (pageType) {\r\n if (pageType === PageTypeOptions.search) {\r\n return `page_type: 'search', search_term: '${getSearchTerm(props)}'`;\r\n } else {\r\n return `page_type: '${pageType.toLowerCase()}'`;\r\n }\r\n } else {\r\n return '';\r\n }\r\n};\r\n\r\nconst getPageNameVars = (props: IMfrmUtagDataProps) => {\r\n const reqUrl = props.context.request.url.requestUrl.toString()?.split('?')[0];\r\n\r\n var pageNameToReturn = (a : string | undefined) => {\r\n return a?.replace(/'/g, \"\\\\'\");\r\n };\r\n\r\n if (reqUrl.endsWith('.c')) {\r\n return `page_name: '${pageNameToReturn(props.data.categoryPageSummary?.result?.title)}'`;\r\n } else if (reqUrl.endsWith('.p')) {\r\n return `page_name: '${pageNameToReturn(props.data.productPageSummary?.result?.title)}'`;\r\n } else {\r\n return `page_name: '${pageNameToReturn(props.context.request.telemetryPageName)}'`;\r\n }\r\n};\r\n\r\nconst getPageContextTypeVars = (props: IMfrmUtagDataViewProps) => {\r\n const { pageContextType } = props.config;\r\n\r\n if (pageContextType) {\r\n return `page_context_type: '${pageContextType.toLowerCase()}'`;\r\n } else {\r\n return undefined;\r\n }\r\n};\r\n\r\nconst getProductTypeVars = (props: IMfrmUtagDataProps) => {\r\n const pageType = props.config.pageType?.toLocaleLowerCase();\r\n\r\n if (pageType === 'checkout' || pageType === 'cart' || pageType === 'product') {\r\n //product category\r\n const productData = props.data.listPageStateBuyBox?.result;\r\n const productName = productData?.name?.replace(/\\'/g, `'`);\r\n const productCategory = productData?.categoryName?.replace(/\\'/g, `'`);\r\n const productBrand = productData?.productBrandName?.replace(/\\'/g, ``);\r\n if (productData && productData.itemId) {\r\n return `product_id: ['${productData.itemId}'],\r\n product_name: ['${productName}'],\r\n product_category: ['${productCategory}'],\r\n product_discount: ['0.00'],\r\n product_brand: ['${productBrand}'],\r\n product_variant: ['${productData.variantId}'],\r\n product_price: ['${productData.price}'],\r\n product_url:['${productData.productUrl}'],\r\n product_image_url: ['${productData.productImageUrl}'],\r\n product_size:['${productData.productSize}']`;\r\n } else {\r\n return undefined;\r\n }\r\n }\r\n return undefined;\r\n};\r\n\r\nconst getSearchTerm = (props: IMfrmUtagDataViewProps) => {\r\n return props.context.request.query?.q;\r\n};\r\n\r\nconst getCookieFunction = () => {\r\n // Build a cookie value getter in JS. We can't access the cookie data from this module.\r\n // Use the cookie values to set new_site and is_cart_active.\r\n return `\r\n let getCookieValue = (ck) => {\r\n let cookieValue,\r\n cookieKey = ck + '=',\r\n decodedCookie = decodeURIComponent(document.cookie),\r\n ca = decodedCookie.split(';');\r\n\r\n for (let i in ca)\r\n {\r\n // Trim left spaces\r\n let c = ca[i].replace(/^\\\\s+/, '');\r\n if (!!~c.indexOf(cookieKey)) {\r\n cookieValue = c.substring(cookieKey.length, c.length);\r\n }\r\n }\r\n\r\n return cookieValue;\r\n };\r\n\r\n var newSiteCookie = getCookieValue('d365_site') ? 'true' : 'false';\r\n var utag_data = typeof utag_data !== 'undefined' ? utag_data : {};\r\n const checkoutCheck = window.location.pathname.includes('checkout');\r\n const checkoutExpress = window.location.pathname.includes('paypal') || window.location.pathname.includes('applepay');\r\n var newCookies = getCookieValue('mfrm_basket_cookie');\r\n let basketNewObj = newCookies && JSON.parse(newCookies);\r\n\r\n var newCookiesProductUrl = getCookieValue('tealium_cart_products_url');\r\n var basketNewObjUrl = newCookiesProductUrl && JSON.parse(newCookiesProductUrl);\r\n\r\n var newCookiesProductData = getCookieValue('tealium_cart_products_details');\r\n var newCookiesProductDataObj = newCookiesProductData && JSON.parse(newCookiesProductData);\r\n\r\n var newCookiesProductQuantity = getCookieValue('tealium_cart_products_quantity');\r\n var newCookiesProductQuantityObj = newCookiesProductQuantity && JSON.parse(newCookiesProductQuantity);\r\n\r\n var newCookiesExpress = getCookieValue('express_funnel');\r\n var usaEpayErrorCookie = getCookieValue('tealium_usaEpay_error');\r\n var usaEpayErrorCookieObj = usaEpayErrorCookie && JSON.parse(usaEpayErrorCookie);\r\n var isUsaEpay = getCookieValue('is_usa_epay');\r\n var cardType = getCookieValue('temp_card_payment_info_for_order_confirmation')?.split(',')[0];\r\n utag_data.cart_product_id = newCookiesProductDataObj && newCookiesProductDataObj.productIDsArray;\r\n utag_data.cart_product_category = newCookiesProductDataObj && newCookiesProductDataObj.productCatgoryArray;\r\n utag_data.cart_product_name = newCookiesProductDataObj && newCookiesProductDataObj.productNameArray;\r\n utag_data.cart_product_brand = newCookiesProductDataObj && newCookiesProductDataObj.productBrandName;\r\n utag_data.cart_product_quantity = newCookiesProductQuantityObj && newCookiesProductQuantityObj.productQuantity;\r\n utag_data.cart_product_variant = newCookiesProductDataObj && newCookiesProductDataObj.variantRecord;\r\n utag_data.cart_product_size = newCookiesProductDataObj && newCookiesProductDataObj.productSize;\r\n utag_data.cart_product_price = newCookiesProductDataObj && newCookiesProductDataObj.cartProductPriceArray;\r\n utag_data.cart_url = basketNewObjUrl && basketNewObjUrl.cartUrl;\r\n utag_data.cart_product_image_url = basketNewObjUrl && basketNewObjUrl.productImageUrl;\r\n utag_data.cart_product_url = basketNewObjUrl && basketNewObjUrl.productURL;\r\n utag_data.cart_total_quantity = newCookiesProductQuantityObj && newCookiesProductQuantityObj.quantity;\r\n utag_data.cart_subtotal = newCookiesProductQuantityObj && newCookiesProductQuantityObj.subTotal;\r\n utag_data.core_item_flag = newCookiesProductQuantityObj && newCookiesProductQuantityObj.isCoreItem;\r\n utag_data.funnel_type = newCookiesProductQuantityObj && newCookiesProductQuantityObj.funnelType;\r\n\r\n if(checkoutExpress) {\r\n utag_data.funnel_type = newCookiesExpress;\r\n }\r\n\r\n if(checkoutCheck || checkoutExpress) {\r\n utag_data.page_name = 'customer info';\r\n utag_data.product_discount = newCookiesProductDataObj && newCookiesProductDataObj.productDiscountArray;\r\n utag_data.product_brand = newCookiesProductDataObj && newCookiesProductDataObj.productBrandName;\r\n utag_data.product_id = newCookiesProductDataObj && newCookiesProductDataObj.productIDsArray;\r\n utag_data.product_category = newCookiesProductDataObj && newCookiesProductDataObj.productCatgoryArray;\r\n utag_data.product_name = newCookiesProductDataObj && newCookiesProductDataObj.productNameArray;\r\n utag_data.product_quantity = newCookiesProductQuantityObj && newCookiesProductQuantityObj.productQuantity;\r\n utag_data.product_variant = newCookiesProductDataObj && newCookiesProductDataObj.variantRecord;\r\n utag_data.product_size = newCookiesProductDataObj && newCookiesProductDataObj.productSize;\r\n utag_data.product_price = newCookiesProductDataObj && newCookiesProductDataObj.productPriceArray;\r\n utag_data.product_image_url = basketNewObjUrl && basketNewObjUrl.productImageUrl;\r\n utag_data.product_url = basketNewObjUrl && basketNewObjUrl.productURL;\r\n }\r\n\r\n if(isUsaEpay === 'true') {\r\n utag_data.event_category = \"USAePay Errors\",\r\n utag_data.event_action = usaEpayErrorCookieObj && usaEpayErrorCookieObj.errorHeading?.replace(/[,!_-]/g, \"\").replace(/\\b(\\w)/g, (c) => c.toUpperCase());\r\n utag_data.event_label = 'card type: '+ cardType\r\n }\r\n\r\n utag_data.cart_product_image_url_1 = basketNewObjUrl && basketNewObjUrl.productImageUrl[0];\r\n utag_data.cart_product_image_url_2 = basketNewObjUrl && basketNewObjUrl.productImageUrl[1];\r\n utag_data.cart_product_image_url_3 = basketNewObjUrl && basketNewObjUrl.productImageUrl[2];\r\n\r\n utag_data.cart_product_name_1 = newCookiesProductDataObj && newCookiesProductDataObj.productNameArray[0];\r\n utag_data.cart_product_name_2 = newCookiesProductDataObj && newCookiesProductDataObj.productNameArray[1];\r\n utag_data.cart_product_name_3 = newCookiesProductDataObj && newCookiesProductDataObj.productNameArray[2];\r\n\r\n if(!basketNewObj || basketNewObj.cartDataInfo?.length === 0) {\r\n [\r\n 'cart_product_id',\r\n 'cart_product_category',\r\n 'cart_product_name',\r\n 'cart_product_brand',\r\n 'cart_product_price',\r\n 'cart_product_quantity',\r\n 'cart_product_variant',\r\n 'cart_product_size',\r\n 'cart_product_image_url',\r\n 'cart_product_url',\r\n 'cart_total_quantity',\r\n 'cart_subtotal',\r\n 'cart_product_name_1',\r\n 'cart_product_name_2',\r\n 'cart_product_name_3',\r\n 'cart_product_image_url_1',\r\n 'cart_product_image_url_2',\r\n 'cart_product_image_url_3',\r\n 'cart_url',\r\n 'core_item_flag',\r\n 'funnel_type'\r\n ].forEach(e => delete utag_data[e]);\r\n\r\n }\r\n utag_data.is_cart_active = (\r\n (basketCookie) => {\r\n let basketCookieObj = basketCookie && JSON.parse(basketCookie);\r\n if(basketCookieObj) {\r\n return basketCookieObj.cartDataInfo?.length > 0 ? \"true\" : \"false\";\r\n }\r\n\r\n return \"false\";\r\n })(getCookieValue('mfrm_basket_cookie'));\r\n `;\r\n};\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['mfrm-utag-data'] = {\n c: () => require('partner/modules/mfrm-utag-data/mfrm-utag-data.tsx'),\n $type: 'scriptModule',\n da: [{name:'categoryPageSummary', path:'modules/mfrm-category-page-summary/mfrm-category-page-summary.action', runOn: 0},{name:'listPageStateBuyBox', path:'modules/mfrm-buybox/list-page-state-buybox', runOn: 0},{name:'productPageSummary', path:'modules/mfrm-product-page-summary/mfrm-product-page-summary.action', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'mfrm-utag-data',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/mfrm-utag-data'\n });\n \n\n {\n const sanitizedActionPath = 'modules/mfrm-buybox/list-page-state-buybox';\n let dataAction = require('partner/modules/mfrm-buybox/list-page-state-buybox');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'modules/mfrm-category-page-summary/mfrm-category-page-summary.action';\n let dataAction = require('partner/modules/mfrm-category-page-summary/mfrm-category-page-summary.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'modules/mfrm-product-page-summary/mfrm-product-page-summary.action';\n let dataAction = require('partner/modules/mfrm-product-page-summary/mfrm-product-page-summary.action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|mfrm-utag-data|mfrm-utag-data'] = {\n c: () => require('partner/modules/mfrm-utag-data/mfrm-utag-data.view.tsx'),\n cn: '__local__-__local__-mfrm-utag-data'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar aCallable = require('../internals/a-callable');\nvar newPromiseCapabilityModule = require('../internals/new-promise-capability');\nvar perform = require('../internals/perform');\nvar iterate = require('../internals/iterate');\nvar PROMISE_STATICS_INCORRECT_ITERATION = require('../internals/promise-statics-incorrect-iteration');\n\n// `Promise.allSettled` method\n// https://tc39.es/ecma262/#sec-promise.allsettled\n$({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {\n allSettled: function allSettled(iterable) {\n var C = this;\n var capability = newPromiseCapabilityModule.f(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var promiseResolve = aCallable(C.resolve);\n var values = [];\n var counter = 0;\n var remaining = 1;\n iterate(iterable, function (promise) {\n var index = counter++;\n var alreadyCalled = false;\n remaining++;\n call(promiseResolve, C, promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = { status: 'fulfilled', value: value };\n --remaining || resolve(values);\n }, function (error) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[index] = { status: 'rejected', reason: error };\n --remaining || resolve(values);\n });\n });\n --remaining || resolve(values);\n });\n if (result.error) reject(result.value);\n return capability.promise;\n }\n});\n","'use strict';\nvar call = require('../internals/function-call');\nvar fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');\nvar anObject = require('../internals/an-object');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar toLength = require('../internals/to-length');\nvar toString = require('../internals/to-string');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar getMethod = require('../internals/get-method');\nvar advanceStringIndex = require('../internals/advance-string-index');\nvar regExpExec = require('../internals/regexp-exec-abstract');\n\n// @@match logic\nfixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {\n return [\n // `String.prototype.match` method\n // https://tc39.es/ecma262/#sec-string.prototype.match\n function match(regexp) {\n var O = requireObjectCoercible(this);\n var matcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, MATCH);\n return matcher ? call(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString(O));\n },\n // `RegExp.prototype[@@match]` method\n // https://tc39.es/ecma262/#sec-regexp.prototype-@@match\n function (string) {\n var rx = anObject(this);\n var S = toString(string);\n var res = maybeCallNative(nativeMatch, rx, S);\n\n if (res.done) return res.value;\n\n if (!rx.global) return regExpExec(rx, S);\n\n var fullUnicode = rx.unicode;\n rx.lastIndex = 0;\n var A = [];\n var n = 0;\n var result;\n while ((result = regExpExec(rx, S)) !== null) {\n var matchStr = toString(result[0]);\n A[n] = matchStr;\n if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);\n n++;\n }\n return n === 0 ? null : A;\n }\n ];\n});\n","'use strict';\nvar apply = require('../internals/function-apply');\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');\nvar anObject = require('../internals/an-object');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar isRegExp = require('../internals/is-regexp');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar speciesConstructor = require('../internals/species-constructor');\nvar advanceStringIndex = require('../internals/advance-string-index');\nvar toLength = require('../internals/to-length');\nvar toString = require('../internals/to-string');\nvar getMethod = require('../internals/get-method');\nvar arraySlice = require('../internals/array-slice-simple');\nvar callRegExpExec = require('../internals/regexp-exec-abstract');\nvar regexpExec = require('../internals/regexp-exec');\nvar stickyHelpers = require('../internals/regexp-sticky-helpers');\nvar fails = require('../internals/fails');\n\nvar UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;\nvar MAX_UINT32 = 0xFFFFFFFF;\nvar min = Math.min;\nvar $push = [].push;\nvar exec = uncurryThis(/./.exec);\nvar push = uncurryThis($push);\nvar stringSlice = uncurryThis(''.slice);\n\n// Chrome 51 has a buggy \"split\" implementation when RegExp#exec !== nativeExec\n// Weex JS has frozen built-in prototypes, so use try / catch wrapper\nvar SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {\n // eslint-disable-next-line regexp/no-empty-group -- required for testing\n var re = /(?:)/;\n var originalExec = re.exec;\n re.exec = function () { return originalExec.apply(this, arguments); };\n var result = 'ab'.split(re);\n return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';\n});\n\n// @@split logic\nfixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {\n var internalSplit;\n if (\n 'abbc'.split(/(b)*/)[1] === 'c' ||\n // eslint-disable-next-line regexp/no-empty-group -- required for testing\n 'test'.split(/(?:)/, -1).length !== 4 ||\n 'ab'.split(/(?:ab)*/).length !== 2 ||\n '.'.split(/(.?)(.?)/).length !== 4 ||\n // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing\n '.'.split(/()()/).length > 1 ||\n ''.split(/.?/).length\n ) {\n // based on es5-shim implementation, need to rework it\n internalSplit = function (separator, limit) {\n var string = toString(requireObjectCoercible(this));\n var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;\n if (lim === 0) return [];\n if (separator === undefined) return [string];\n // If `separator` is not a regex, use native split\n if (!isRegExp(separator)) {\n return call(nativeSplit, string, separator, lim);\n }\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var match, lastIndex, lastLength;\n while (match = call(regexpExec, separatorCopy, string)) {\n lastIndex = separatorCopy.lastIndex;\n if (lastIndex > lastLastIndex) {\n push(output, stringSlice(string, lastLastIndex, match.index));\n if (match.length > 1 && match.index < string.length) apply($push, output, arraySlice(match, 1));\n lastLength = match[0].length;\n lastLastIndex = lastIndex;\n if (output.length >= lim) break;\n }\n if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop\n }\n if (lastLastIndex === string.length) {\n if (lastLength || !exec(separatorCopy, '')) push(output, '');\n } else push(output, stringSlice(string, lastLastIndex));\n return output.length > lim ? arraySlice(output, 0, lim) : output;\n };\n // Chakra, V8\n } else if ('0'.split(undefined, 0).length) {\n internalSplit = function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : call(nativeSplit, this, separator, limit);\n };\n } else internalSplit = nativeSplit;\n\n return [\n // `String.prototype.split` method\n // https://tc39.es/ecma262/#sec-string.prototype.split\n function split(separator, limit) {\n var O = requireObjectCoercible(this);\n var splitter = isNullOrUndefined(separator) ? undefined : getMethod(separator, SPLIT);\n return splitter\n ? call(splitter, separator, O, limit)\n : call(internalSplit, toString(O), separator, limit);\n },\n // `RegExp.prototype[@@split]` method\n // https://tc39.es/ecma262/#sec-regexp.prototype-@@split\n //\n // NOTE: This cannot be properly polyfilled in engines that don't support\n // the 'y' flag.\n function (string, limit) {\n var rx = anObject(this);\n var S = toString(string);\n var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);\n\n if (res.done) return res.value;\n\n var C = speciesConstructor(rx, RegExp);\n\n var unicodeMatching = rx.unicode;\n var flags = (rx.ignoreCase ? 'i' : '') +\n (rx.multiline ? 'm' : '') +\n (rx.unicode ? 'u' : '') +\n (UNSUPPORTED_Y ? 'g' : 'y');\n\n // ^(? + rx + ) is needed, in combination with some S slicing, to\n // simulate the 'y' flag.\n var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);\n var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;\n if (lim === 0) return [];\n if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];\n var p = 0;\n var q = 0;\n var A = [];\n while (q < S.length) {\n splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;\n var z = callRegExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S);\n var e;\n if (\n z === null ||\n (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p\n ) {\n q = advanceStringIndex(S, q, unicodeMatching);\n } else {\n push(A, stringSlice(S, p, q));\n if (A.length === lim) return A;\n for (var i = 1; i <= z.length - 1; i++) {\n push(A, z[i]);\n if (A.length === lim) return A;\n }\n q = p = e;\n }\n }\n push(A, stringSlice(S, p));\n return A;\n }\n ];\n}, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);\n","'use strict';\n// TODO: Remove from `core-js@4`\nrequire('../modules/es.promise.all-settled.js');\n","module.exports = React;","module.exports = ReactDOM;"],"names":["variantQueryStringName","value","parsedValue","parsedArr","ReactHtmlParser","length","toString","canonicalURL","requestContext","_urlParts","requestUrl","url","origin","path","pathname","toLowerCase","urlParts","split","splice","match","removePipeSignValue","removeKeywords","join","filteredURL","_urlParts2","undefined","filter","urlPart","indexOf","removeKeywordFromUrl","app","config","removeKeywordFromUrlArray","trim","forEach","_part","removeKeyword","trimmedKeyword","indexOfValue","getSortedVirtualRefinerConfig","isMattressesCategory","appConfigSorted","getVirtualRefinerConfig","appConfig","enableForMattresses","enableForOtherCategories","sort","a","b","order","getVirtualRefinerNames","sortedVirtualRefinerConfig","appConfigRefinerNames","sortedConfig","push","refinerName","urlModifications","async","getVirtualRefinerValues","virtualRefiners","virtualRefinerValues","categoryIdToken","urlTokens","recordId","finalizedUrlParts","plainUrlPart","decodeURIComponent","part","filteredPart","mainRefiner","Values","refinerValue","_refinerValue$LeftVal","refinerValueKeyName","LeftValueBoundString","replace","regExSpecialChars","canonicalUrlspecialCharIncludeList","navLinkKeywordRemoval","link","_linkParams$map","_urlParts4","linkBase","linkParams","endsWith","linkParam","map","param","includeConfigList","includeConfig","_includeConfigList$tr","RegExp","AttributesForSelectedVariantInput","constructor","productId","channelId","selectedProduct","catalogId","getCacheKey","getCacheObjectType","dataCacheType","this","createAttributesForSelectedVariantInput","inputData","getSelectedProductIdFromActionInput","apiSettings","Error","getAttributesForSelectedVariantAction","input","ctx","Promise","resolve","then","activeProduct","selectedVariantInput","SelectedVariantInput","getSelectedVariant","productResult","getAttributeValuesAsync","callerContext","queryResultSettings","RecordId","attributeValues","catch","error","trace","message","createObservableDataAction","id","action","shouldDefaultSet","matchingDimensionValues","parseDefaultDimensionsData","defaultValue","defaultDimensions","dimensionData","dimensionTypeString","dimensionValue","dimensionType","parseInt","e","console","log","getDefaultVariantId","masterId","context","productSearchCriteria","Ids","Context","ChannelId","CatalogId","IncludeAttributes","SearchCondition","productSearchResults","searchByCriteriaAsync","telemetry","debug","JSON","stringify","_productSearchResults","_productSearchResults2","defaultVariantId","ExtensionProperties","find","property","Key","Value","LongValue","_input$matchingDimens","_getByIdResponse","variantId","queryBasedVariantSelection","getQueryParamsFromQueryByName","MsDyn365","isBrowser","URL","window","location","href","getByIdResponse","_await$getDefaultVari","getByIdAsync","Number","isNaN","_await$getDefaultVari2","MasterProductId","baseProduct","Array","isArray","product","_objectSpread","originalDimensionLength","Dimensions","_product$Dimensions","_productSpecification","baseProductHadUnmatchedDimension","dimension","matchedTargetDimension","targetDimension","DimensionTypeValue","DimensionValue","actionInput","defaultValues","getAttributesForSelectedVariant","data","_data$Name","Name","TextValue","parsedDefaultData","productPreSelectionDimensions","_product$Dimensions2","asyncCalls","_product","dimensionValues","getDimensionValuesAsync","_parsedDefaultData$fi","defaultValueToFind","defaultData","defaultDimension","availableDimensionValue","_availableDimensionVa","_availableDimensionVa2","DimensionId","fullDimension","DimensionValues","allSettled","mappedDimensions","variants","getVariantsByDimensionValuesAsync","newImageUrl","generateProductImageUrl","PrimaryImageUrl","GetSeoDataInput","Msdyn365","seoDataUrl","super","shouldCacheOutput","cacheObjectType","cacheKey","getSeoDataUrl","jsonUrl","res","filteredUrlPath","seoData","_context$query","query","itemId","pageType","inputUrl","queryParamName","toLocaleLowerCase","searchParams","get","generateImageUrl","imageUrl","startsWith","baseImageUrl","encodeURIComponent","DimensionTypes","DimensionSwatchDisplayTypes","getFallbackImageUrl","parsedItemId","ListPageStateBuyBox","name","categoryName","productBrandName","price","productUrl","productImageUrl","productSize","__decorate","observable","ListPageStateBuyBoxInput","listPageStateAction","createListPageInput","MFRMCategoryPageSummaryInput","_this$requestContext","buildCacheKeyWithUrlTokens","_getSEOMetaTagValue","currentCategory","keyValue","_currentCategory$Exte","attr","StringValue","getFallbackTitle","activeRefinerList","searchCriteria","getProductSearchRefinersAsync","productRefiners","result","productRefiner","err","getAllRefinersAction","refiners","_activeRefinerList","_activeRefinerList2","_getActiveRefiners","CategoryHierarchy","configVirtualRefinerNames","filteredRefiners","refiner","KeyName","slugArray","pathArray","slug","Slug","sortedConfigValues","categoryId","_path","removedCategorySlug","refinerParts","_slug","refinerPart","index","finalRefinerParts","item","includes","flatten","sortedValues","refinerSet","_refiner$LeftValueBou","_refiner$LeftValueBou2","sortedValue","Object","keys","finalRefiners","sortedConfigValue","sortedRefinerName","concateTitle","seoInput","getSEOData","seoPageTitle","seoPageMetaData","getCurrentCategory","CurrentCategoryInput","createGetCurrentCategoryInput","categoryUrl","fallbackTitle","pageTitle","pageTitleParser","getHtmlParserValue","fallBackMeta","categoryPageMetaData","categoryPageMetaDataParser","localName","getFriendlyName","locale","NameTranslations","neutralizedName","NeutralizedName","getCategoryUrl","canonicalDomain","skipCount","skip","Url","urlParams","URLSearchParams","search","set","removeDomainQspFromUrl","title","description","sharingImageUrl","OfflineImage","canonicalUrl","faviconUrl","sharingImage","src","args","ProductPageSummaryInput","_this$catalogId","buildCacheKey","getCatalogId","_getAttributeByName","currAttribute","parseAttributeTextArray","text","rtn","str","it","keyVal","key","_input$catalogId","_getAttributeByName2","_getAttributeByName3","_productActivePrice$D","selectedVariant","byIdAsync","getByIdsAsync","QueryResultSettingsProxy","getPagingFromInputDataOrDefaultValue","attributeValuesAsync","activePricesAsync","getActivePricesAsync","Date","asynValues","simpleProductsData","status","productAttributes","productActivePrices","productActivePrice","simpleProductData","pageTitleAttribute","pageDescriptionAttribute","pageDescription","priceValidUntil","DiscountLines","ValidTo","toISOString","isOutOfStockArray","attributeName","_getAttributeByName4","gtinArray","_getAttributeByName5","productBrand","getProductUrlSync","_getAttributeByName6","Description","masterProductId","CustomerContextualPrice","itemCondition","MfrmUtagData","React","render","props","renderView","pageContextType","source","getPageScript","nonceToken","isNonceEnabled","request","scriptHtml","SDK_FRAGMENT_NAME","dangerouslySetInnerHTML","__html","utag_extra","pageTypeVars","getPageTypeVars","pageContextTypeVars","getPageContextTypeVars","productTypeVars","getProductTypeVars","pageNameVars","getPageNameVars","getCookieFunction","PageTypeOptions","getSearchTerm","_props$context$reques","reqUrl","_props$data$categoryP","_props$data$productPa","pageNameToReturn","categoryPageSummary","productPageSummary","telemetryPageName","_props$config$pageTyp","_props$data$listPageS","_productData$name","_productData$category","_productData$productB","productData","listPageStateBuyBox","productName","productCategory","_props$context$reques2","q","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","c","require","$type","da","runOn","iNM","ns","n","p","pdp","md","__bindings__","viewDictionary","cn","$","call","aCallable","newPromiseCapabilityModule","perform","iterate","target","stat","forced","iterable","C","capability","f","reject","promiseResolve","values","counter","remaining","promise","alreadyCalled","reason","fixRegExpWellKnownSymbolLogic","anObject","isNullOrUndefined","toLength","requireObjectCoercible","getMethod","advanceStringIndex","regExpExec","MATCH","nativeMatch","maybeCallNative","regexp","O","matcher","string","rx","S","done","global","fullUnicode","unicode","lastIndex","A","matchStr","apply","uncurryThis","isRegExp","speciesConstructor","arraySlice","callRegExpExec","regexpExec","stickyHelpers","fails","UNSUPPORTED_Y","MAX_UINT32","min","Math","$push","exec","stringSlice","slice","SPLIT","nativeSplit","internalSplit","separator","limit","lim","lastLength","output","flags","ignoreCase","multiline","sticky","lastLastIndex","separatorCopy","splitter","unicodeMatching","z","i","re","originalExec","arguments","module","exports","ReactDOM"],"sourceRoot":""}