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,EAA0C2H,EAAoCoC,GAA4B,IAAAnC,EACpJ,MAAMoC,EAA6B,GAC7BC,EAAwD,QAA5BrC,EAAGD,EAAe3H,kBAAU,IAAA4H,OAAA,EAAzBA,EAA2BlE,QAAO9C,GAAkB,iBAANA,GAAkBA,EAAEwF,gBAAgB8D,QACjHC,EAAoBF,MAAAA,OAA4B,EAA5BA,EAA8BtD,KAAI/F,GAAKA,EAAEwF,OAEnE,GAAI+D,GAAqBA,EAAkBjI,OAAS,EAChD,IAAK,IAAIkI,EAAI,EAAGA,EAAID,EAAkBjI,OAAQkI,IAC1C,GAAKD,EAAkBC,GAGvB,IAAK,IAAIC,EAAI,EAAGA,GAAwB,QAAvBC,EAAGH,EAAkBC,UAAE,IAAAE,OAAA,EAApBA,EAAsBpI,QAAQmI,IAAK,KAAAC,EAAAC,EACnD,MAAMjE,EAAQvG,EAA4BC,EACtCmK,EAAkBC,GAAGC,GACrB1C,EAAezH,cAAgB6J,GAEL,QAA1BQ,EAAC5C,EAAe6C,kBAAU,IAAAD,GAAzBA,EAA2B3G,SAAS0C,IACrC0D,EAAiBtC,KAAK2C,GAYtC,OAL4BL,EAAiBS,QAAO,CAACC,EAAKC,EAAMP,EAAGQ,KAC/D,MAAMC,EAAQD,EAAIlH,QAAQ9C,GAAMA,IAAM+J,IAAMzI,OAC5C,OAAO2I,EAAQH,EAAIG,MAAQ,CAAEA,MAAAA,EAAO5D,MAAO0D,GAASD,IACrD,CAAEG,MAAO,EAAG5D,MAAO,IAAKA,Q","sources":["webpack://Msdyn365.Commerce.Online/./src/shared-utils/attributes/attributes.ts?f392","webpack://Msdyn365.Commerce.Online/./src/shared-utils/attributes/attributes-map.ts?19ca","webpack://Msdyn365.Commerce.Online/./src/shared-utils/attributes/attribute-sorters.ts?85e1","webpack://Msdyn365.Commerce.Online/./src/shared-utils/attributes/get-most-used-attribute-name-index.ts?6ba6"],"sourcesContent":["import { AttributeValue, CategoryPath, Customer } from \"@msdyn365-commerce/retail-proxy\";\r\nimport { ICoreContext } from '@msdyn365-commerce/core';\r\nimport nbNO from './locale/nb-NO.json';\r\nimport enUS from './locale/en-US.json';\r\nimport { SimpleProductExt } from \"../types\";\r\nimport { ProductSearchResultExt } from \"../../modules/vinhuset-search-result-container/components\";\r\n\r\nexport function getAttribute(attributes: AttributeValue[] | undefined, attributeName: string): AttributeValue {\r\n if (!attributes) {\r\n throw new Error(`No attributes found.`);\r\n }\r\n\r\n const attribute = attributes?.find(x => x.Name === attributeName);\r\n\r\n if (!attribute) {\r\n throw new Error(`Attribute ${attributeName} not found.`);\r\n }\r\n\r\n return attribute;\r\n}\r\n\r\nexport function getAttributeNumber(attributes: AttributeValue[] | undefined, attributeName: string): number {\r\n if (!attributes) {\r\n throw new Error(`No attributes found.`);\r\n }\r\n\r\n const attribute = attributes?.find(x => x.Name === attributeName);\r\n let result: number | undefined;\r\n\r\n if (!attribute) {\r\n throw new Error(`Attribute ${attributeName} not found.`);\r\n }\r\n\r\n switch (attribute.DataTypeValue) {\r\n case 1: // Currency\r\n result = attribute.CurrencyValue;\r\n break;\r\n case 3: // Decimal\r\n result = attribute.FloatValue;\r\n break;\r\n case 4: // Integer\r\n result = attribute.IntegerValue;\r\n break;\r\n case 0: // None\r\n case 2: // DateTime\r\n case 5: // Text\r\n case 6: // TrueFalse\r\n throw new Error(`Attribute ${attributeName} is not a number.`);\r\n }\r\n\r\n return result || 0;\r\n}\r\n\r\nexport function getAttributeNumberOrDefault(attributes: AttributeValue[] | undefined, attributeName: string, defaultValue: number): number {\r\n if (!attributes) {\r\n return defaultValue;\r\n }\r\n\r\n const attribute = attributes?.find(x => x.Name === attributeName);\r\n let result: number | undefined;\r\n\r\n if (!attribute) {\r\n return defaultValue;\r\n }\r\n\r\n switch (attribute.DataTypeValue) {\r\n case 1: // Currency\r\n result = attribute.CurrencyValue;\r\n break;\r\n case 3: // Decimal\r\n result = attribute.FloatValue;\r\n break;\r\n case 4: // Integer\r\n result = attribute.IntegerValue;\r\n break;\r\n case 0: // None\r\n case 2: // DateTime\r\n case 5: // Text\r\n case 6: // TrueFalse\r\n result = defaultValue;\r\n break;\r\n }\r\n\r\n return result || 0;\r\n}\r\n\r\nexport function getAttributeString(attributes: AttributeValue[] | undefined, attributeOrName: AttributeValue | string, suffix?: string): string {\r\n if (!attributes) {\r\n throw new Error(`No attributes found.`);\r\n }\r\n\r\n let attribute, result;\r\n\r\n if (typeof attributeOrName === 'string') {\r\n attribute = attributes?.find(x => x.Name === attributeOrName);\r\n } else {\r\n attribute = attributeOrName;\r\n }\r\n\r\n switch (attribute?.DataTypeValue) {\r\n case 0: // None\r\n result = `-`;\r\n break;\r\n case 1: // Currency\r\n result = attribute.CurrencyValue?.toString();\r\n break;\r\n case 2: // DateTime\r\n result = attribute.DateTimeOffsetValue?.toUTCString();\r\n break;\r\n case 3: // Decimal\r\n result = attribute.FloatValue?.toString();\r\n break;\r\n case 4: // Integer\r\n result = attribute.IntegerValue?.toString();\r\n break;\r\n case 5: // Text\r\n result = attribute.TextValue?.toString();\r\n break;\r\n case 6: // TrueFalse\r\n result = attribute.BooleanValue?.toString();\r\n break;\r\n }\r\n\r\n if (!result) {\r\n throw new Error(`Attribute ${attributeOrName} not found`);\r\n }\r\n\r\n if (result !== '-' && suffix) {\r\n result += suffix;\r\n }\r\n\r\n return result;\r\n}\r\n\r\nexport function getAttributeStringOrDefault(attributes: AttributeValue[] | undefined, attributeName: string, defaultValue: T, suffix?: string): T | string {\r\n if (!attributes) {\r\n return defaultValue;\r\n }\r\n\r\n const attribute = attributes?.find(x => x.Name === attributeName);\r\n let result;\r\n\r\n if (!attribute) {\r\n return defaultValue;\r\n }\r\n\r\n switch (attribute?.DataTypeValue) {\r\n case 0: // None\r\n result = `-`;\r\n break;\r\n case 1: // Currency\r\n result = attribute.CurrencyValue?.toString();\r\n break;\r\n case 2: // DateTime\r\n result = attribute.DateTimeOffsetValue?.toUTCString();\r\n break;\r\n case 3: // Decimal\r\n result = attribute.FloatValue?.toString();\r\n break;\r\n case 4: // Integer\r\n result = attribute.IntegerValue?.toString();\r\n break;\r\n case 5: // Text\r\n result = attribute.TextValue?.toString();\r\n break;\r\n case 6: // TrueFalse\r\n result = attribute.BooleanValue?.toString();\r\n break;\r\n default:\r\n result = '';\r\n break;\r\n }\r\n\r\n if (result && result !== '-' && suffix) {\r\n result += suffix;\r\n }\r\n\r\n return result || '';\r\n}\r\n\r\nexport function getAttributesLocale(lang: string): typeof nbNO {\r\n switch (lang) {\r\n case 'nb-NO':\r\n return nbNO;\r\n case 'en-US':\r\n return {...nbNO, ...enUS};\r\n default:\r\n return nbNO;\r\n }\r\n}\r\n\r\nexport function hasAttribute(attributes: AttributeValue[] | undefined, attributeName: string): boolean {\r\n if (!attributes) {\r\n return false;\r\n }\r\n\r\n return attributes?.some(x => x.Name === attributeName);\r\n}\r\n\r\nexport function hasAccessToBuy(context: ICoreContext, customer: Customer | undefined, productAttributes: AttributeValue[] | undefined) {\r\n if (!productAttributes || productAttributes.length === 0) {\r\n // No product attributes available, default to true\r\n return true;\r\n }\r\n\r\n // @ts-expect-error\r\n const locale = getAttributesLocale(context.request.locale);\r\n const licensesToCheck: string[] = [];\r\n let hasAccess = true;\r\n\r\n for (const license of licensesToCheck) {\r\n const productAttribute = Number(productAttributes?.find(x => x.Name === license)?.TextValue);\r\n const customerAttribute = Number(customer?.Attributes?.find(x => x.Name === license)?.AttributeValue?.StringValue);\r\n\r\n // Product doesn't have the attribute. Default to has access\r\n if (isNaN(productAttribute) || productAttribute === 0) {\r\n continue;\r\n }\r\n\r\n // Product has the attribute and it's more than 0, but customer doesn't have it at all. No access\r\n if (isNaN(customerAttribute)) {\r\n hasAccess = false;\r\n break;\r\n }\r\n\r\n // Product has the attribute, but customer has a lower value. No access\r\n if (customerAttribute < productAttribute) {\r\n hasAccess = false;\r\n break;\r\n }\r\n }\r\n\r\n const attributeRecordId = Number(context.request.app.config?.customerSpecificRefinerRecordId);\r\n\r\n if (!isNaN(attributeRecordId) && attributeRecordId > 0) {\r\n const customerNumber = customer?.AccountNumber;\r\n const productAttribute = productAttributes?.find(x => x.RecordId === attributeRecordId)?.TextValue\r\n ?.split('|')\r\n .filter(Boolean);\r\n\r\n // Produt is customer specific\r\n if (productAttribute && productAttribute.length > 0 && !productAttribute.includes('0')) {\r\n if (!customerNumber || !productAttribute.includes(customerNumber)) {\r\n hasAccess = false;\r\n }\r\n }\r\n }\r\n\r\n return hasAccess;\r\n}\r\n\r\nexport function applyAttributesToSimpleProduct(locale: string, product: SimpleProductExt, attributes: AttributeValue[] | undefined, categoryPaths: CategoryPath[] | undefined): void {\r\n if (attributes && attributes.length > 0) {\r\n const attrLocale = getAttributesLocale(locale);\r\n const alcoholPercentage = getAttributeStringOrDefault(attributes, attrLocale.prefixedAttributes.alcoholPercent, '-', '%');\r\n const volumeCl = getAttributeStringOrDefault(attributes, attrLocale.prefixedAttributes.volumeCl, undefined, ' cl')\r\n || getAttributeStringOrDefault(attributes, attrLocale.alternative.prefixed.volumeCl, undefined, ' cl');\r\n const producer = getAttributeStringOrDefault(attributes, attrLocale.prefixedAttributes.producer, undefined)\r\n || getAttributeStringOrDefault(attributes, attrLocale.alternative.prefixed.producer, undefined);\r\n const country = getAttributeStringOrDefault(attributes, attrLocale.prefixedAttributes.country, undefined)\r\n || getAttributeStringOrDefault(attributes, attrLocale.alternative.prefixed.country, undefined);\r\n const district = getAttributeStringOrDefault(attributes, attrLocale.prefixedAttributes.district, undefined)\r\n || getAttributeStringOrDefault(attributes, attrLocale.alternative.prefixed.district, undefined);\r\n const vintage = getAttributeStringOrDefault(attributes, attrLocale.prefixedAttributes.vintage, undefined);\r\n\r\n product.AlcoholPercentage = alcoholPercentage;\r\n product.VolumeCl = volumeCl;\r\n product.Producer = producer;\r\n product.Country = country;\r\n product.District = district;\r\n product.CountryAndDistrict = [country, district].filter(Boolean).join(', ') || undefined;\r\n product.Vintage = vintage;\r\n }\r\n\r\n product.CategoryPaths = categoryPaths;\r\n product.Category = product.CategoryPaths?.[0]?.Segments?.[1]?.CategoryName;\r\n}\r\n\r\nexport function applyAttributesToProductSearchResult(locale: string, product: ProductSearchResultExt, attributes: AttributeValue[] | undefined, categoryPaths: CategoryPath[] | undefined): void {\r\n if (attributes && attributes.length > 0) {\r\n const attrLocale = getAttributesLocale(locale);\r\n const alcoholPercentage = getAttributeStringOrDefault(attributes, attrLocale.prefixedAttributes.alcoholPercent, '-', '%');\r\n const volumeCl = getAttributeStringOrDefault(attributes, attrLocale.prefixedAttributes.volumeCl, undefined, ' cl')\r\n || getAttributeStringOrDefault(attributes, attrLocale.alternative.prefixed.volumeCl, undefined, ' cl');\r\n const producer = getAttributeStringOrDefault(attributes, attrLocale.prefixedAttributes.producer, undefined)\r\n || getAttributeStringOrDefault(attributes, attrLocale.alternative.prefixed.producer, undefined);\r\n const country = getAttributeStringOrDefault(attributes, attrLocale.prefixedAttributes.country, undefined)\r\n || getAttributeStringOrDefault(attributes, attrLocale.alternative.prefixed.country, undefined);\r\n const district = getAttributeStringOrDefault(attributes, attrLocale.prefixedAttributes.district, undefined)\r\n || getAttributeStringOrDefault(attributes, attrLocale.alternative.prefixed.district, undefined);\r\n const vintage = getAttributeStringOrDefault(attributes, attrLocale.prefixedAttributes.vintage, undefined);\r\n\r\n product.AlcoholPercentage = alcoholPercentage;\r\n product.VolumeCl = volumeCl;\r\n product.Producer = producer;\r\n product.Country = country;\r\n product.District = district;\r\n product.CountryAndDistrict = [country, district].filter(Boolean).join(', ') || undefined;\r\n product.Vintage = vintage;\r\n }\r\n\r\n product.CategoryPaths = categoryPaths;\r\n product.Category = product.CategoryPaths?.[0]?.Segments?.[1]?.CategoryName;\r\n}\r\n","import { ICoreContext, getUrlSync } from '@msdyn365-commerce/core';\r\nimport { getAttributeStringOrDefault, getAttributesLocale } from './attributes';\r\nimport { getMostUsedAttributeNameIndex, sortAttributes, sortAttributesByGroupOrder } from '.';\r\nimport { AttributeValue } from '@msdyn365-commerce/retail-proxy';\r\n\r\nexport interface IAttributeGroupMapAttribute {\r\n name: string | string[];\r\n label?: string;\r\n hideIfEmpty?: boolean;\r\n transform?: (value: string) => string;\r\n transformName?: (key: string) => string;\r\n}\r\n\r\nexport interface IAttributeGroupMap {\r\n type: AttributeGroupType;\r\n group: string;\r\n /** Sets the mode for how to handle the 'attributes':\r\n * - 'include': Only include the attributes defined in 'attributes'.\r\n * - 'transform': Include all attributes and apply transformations defined in 'attributes' on matching attributes.\r\n */\r\n attributesMode: 'include' | 'transform';\r\n attributes?: (string | IAttributeGroupMapAttribute)[];\r\n transform?: (value: string) => string;\r\n defaultValue?: string;\r\n nullValues?: string[];\r\n /** Sets global 'hideIfEmpty' for all attributes in this group. Only used if 'attributes' is not defined or list of strings. */\r\n hideIfEmpty?: boolean;\r\n /** The attribute to use as source. If set this will look for the attributes inside this attribute. */\r\n attributeSource?: string;\r\n attributeSourceSet?: { source: string, value: string }[];\r\n exclude?: string[];\r\n}\r\n\r\nexport type AttributeGroupType = 'default';\r\nexport type ModelVersion = '1.0' | '2.0' | '3.0';\r\n\r\nexport interface IParsedAttributeMap {\r\n type: AttributeGroupType;\r\n name: string;\r\n attributes: IParsedAttribute[];\r\n modelVersion?: ModelVersion;\r\n}\r\n\r\nexport interface IParsedAttribute {\r\n name: string;\r\n value: string;\r\n}\r\n\r\nexport const replaceCommaWithDot = (value: string): string => {\r\n // Shouldn't need to replace anything if both are present\r\n if (value.includes(',') && value.includes('.')) {\r\n return value.replace(' ', '');\r\n }\r\n // Only replace the last occurance of a comma with a dot\r\n const lastCommaIndex = value.lastIndexOf(',');\r\n if (lastCommaIndex !== -1) {\r\n return `${value.substring(0, lastCommaIndex)}.${value.substring(lastCommaIndex + 1)}`.replace(' ', '');\r\n }\r\n // If no comma is present, return the value as is\r\n return value.replace(' ', '');\r\n // return value.replace(',', '.').replace(' ', '');\r\n};\r\nexport const padValue = (value: string): string => {\r\n return Number(value.replace(',', '')).toFixed(2).toString();\r\n};\r\nexport const addCelsiusSign = (value: string): string => {\r\n return value ? `${value}°` : value;\r\n};\r\nexport const addDashPrefix = (key: string): string => {\r\n return ` - ${key}`;\r\n};\r\n\r\nfunction findAttribute(attributeName: string): (attribute: string | IAttributeGroupMapAttribute) => boolean {\r\n return (attribute: string | IAttributeGroupMapAttribute) => {\r\n if (typeof attribute === 'string') {\r\n return attribute === attributeName;\r\n } else {\r\n return attribute.name === attributeName;\r\n }\r\n };\r\n}\r\n\r\nexport function parseAttributesMap(context: ICoreContext, attributes: AttributeValue[] | undefined, attributesMap?: IAttributeGroupMap[]): IParsedAttributeMap[] {\r\n if (!attributesMap) {\r\n attributesMap = getAttributesMap(context);\r\n }\r\n\r\n const attributesLocale = getAttributesLocale(context.request.locale);\r\n const groups: {\r\n [key: string]: AttributeValue[];\r\n } = {};\r\n\r\n attributes!.sort(sortAttributesByGroupOrder).map((product: AttributeValue, index) => {\r\n const attrFind = product.ExtensionProperties?.find((e) => {\r\n return e.Key === 'ATTRGROUPNAME';\r\n });\r\n if(attrFind && attrFind.Value && attrFind.Value.StringValue){\r\n const key = attrFind.Value.StringValue.trim();\r\n if (groups[key]) {\r\n groups[key].push(product);\r\n } else {\r\n groups[key] = [];\r\n groups[key].push(product);\r\n }\r\n }\r\n });\r\n\r\n const parsed: IParsedAttributeMap[] = attributesMap.map((attributeGroup) => {\r\n const mostCommonNameIndex = getMostUsedAttributeNameIndex(attributes, attributeGroup, attributesLocale.notFound);\r\n\r\n if (!attributeGroup.attributes && !groups[attributeGroup.group]) {\r\n return {\r\n type: attributeGroup.type,\r\n name: attributeGroup.group,\r\n attributes: []\r\n };\r\n }\r\n\r\n let modelVersion: ModelVersion = '1.0';\r\n let attributesToUse: AttributeValue[] | undefined;\r\n const attributeSource = attributeGroup.attributeSource\r\n ? attributes!.find((attribute: AttributeValue) => attribute.Name === attributeGroup.attributeSource)\r\n : undefined;\r\n const shouldUseAttributeSet = attributeGroup.attributeSourceSet?.some((source) => {\r\n return attributes?.find((attribute: AttributeValue) => attribute.Name === source.source)?.TextValue;\r\n });\r\n\r\n if (shouldUseAttributeSet) {\r\n modelVersion = '3.0';\r\n attributesToUse = [];\r\n\r\n attributeGroup.attributeSourceSet!.forEach((source) => {\r\n const attribute = attributes?.find((attribute: AttributeValue) => attribute.Name === source.source);\r\n\r\n if (!attribute || !attribute.TextValue) {\r\n return;\r\n }\r\n\r\n attributesToUse!.push(...attribute.TextValue.split('|').map((attribute) => {\r\n return {\r\n Name: attribute,\r\n DataTypeValue: 5,\r\n TextValue: source.value,\r\n ExtensionProperties: [\r\n {\r\n Key: 'ATTRORDER',\r\n Value: {\r\n DecimalValue: (attributeGroup.attributes?.findIndex((attr) => {\r\n if (typeof attr === 'string') {\r\n return attr === attribute;\r\n } else {\r\n return attr.name === attribute;\r\n }\r\n }) ?? -1) + 1\r\n }\r\n }\r\n ]\r\n } as AttributeValue;\r\n }));\r\n });\r\n } else if (attributeGroup.attributeSource && attributeSource?.TextValue) {\r\n modelVersion = '2.0';\r\n attributesToUse = attributeSource?.TextValue?.split('|').map((attribute) => {\r\n return {\r\n Name: attribute.split(':')[0],\r\n DataTypeValue: 5,\r\n TextValue: attribute.split(':')[1]\r\n } as AttributeValue;\r\n });\r\n } else {\r\n if (attributeGroup.attributesMode === 'include' && attributeGroup.attributes) {\r\n // Only get the attributes defined in the 'attributes' list\r\n const includes = attributeGroup.attributes.map(attr => {\r\n if (typeof attr === 'string') {\r\n return attr;\r\n } else {\r\n if (typeof attr.name === 'string') {\r\n return attr.name;\r\n } else {\r\n return attr.name[mostCommonNameIndex];\r\n }\r\n }\r\n });\r\n attributesToUse = attributes?.filter((attribute: AttributeValue) => includes.includes(attribute.Name || ''));\r\n } else {\r\n // Get all attributes in this group and 'attributes' is a list of transformations to apply to matching attributes\r\n attributesToUse = groups[attributeGroup.group];\r\n }\r\n }\r\n\r\n const attrsNew = attributesToUse?.sort(sortAttributes).map((attribute) => {\r\n if (!attribute.Name) {\r\n throw new Error(`Attribute name is missing.`);\r\n }\r\n\r\n if (attributeGroup.exclude && attributeGroup.exclude.includes(attribute.Name)) {\r\n return undefined;\r\n }\r\n\r\n let name = attribute.Name;\r\n let value = getAttributeStringOrDefault(attributesToUse,\r\n attribute.Name,\r\n attributeGroup.defaultValue);\r\n\r\n const findAttributeFromAttributes = attributeGroup.attributes?.find(findAttribute(attribute.Name));\r\n\r\n if (typeof findAttributeFromAttributes === 'object') {\r\n if (findAttributeFromAttributes.transformName) {\r\n name = findAttributeFromAttributes.transformName(attribute.Name);\r\n }\r\n\r\n if (value && findAttributeFromAttributes.transform) {\r\n value = findAttributeFromAttributes.transform(value);\r\n }\r\n\r\n if (value && attributeGroup.transform) {\r\n value = attributeGroup.transform(value);\r\n }\r\n\r\n if (findAttributeFromAttributes.hideIfEmpty && !value) {\r\n return undefined;\r\n }\r\n\r\n if (findAttributeFromAttributes.hideIfEmpty !== false && attributeGroup.hideIfEmpty && !value) {\r\n return undefined;\r\n }\r\n } else {\r\n if (value && attributeGroup.transform) {\r\n value = attributeGroup.transform(value);\r\n }\r\n\r\n if (attributeGroup.hideIfEmpty && !value) {\r\n return undefined;\r\n }\r\n }\r\n\r\n return {\r\n name,\r\n value: value || attributesLocale.notFound\r\n };\r\n });\r\n\r\n return {\r\n type: attributeGroup.type,\r\n name: attributeGroup.group,\r\n attributes: (attrsNew || []).filter(x => x).map((attribute) => {\r\n const { name, value } = attribute || {};\r\n\r\n return {\r\n name: name as string,\r\n value: value as string\r\n };\r\n }),\r\n modelVersion\r\n };\r\n });\r\n\r\n return parsed;\r\n}\r\n\r\nexport function getAttributesMap(context: ICoreContext): IAttributeGroupMap[] {\r\n const attributesLocale = getAttributesLocale(context.request.locale);\r\n\r\n return [\r\n {\r\n type: 'default',\r\n group: attributesLocale.groups.aboutProduct,\r\n hideIfEmpty: true,\r\n attributesMode: 'transform',\r\n attributes: [\r\n {\r\n name: attributesLocale.country,\r\n transform: (value) => {\r\n const searchURLBase = getUrlSync('search', context.actionContext);\r\n const separator = searchURLBase!.includes('?') ? '&' : '?';\r\n\r\n return value.split('|').map((v) => {\r\n const searchURL = `${searchURLBase}${separator}q=${encodeURIComponent(v)}`;\r\n return `${v}`;\r\n }).join(', ');\r\n }\r\n },\r\n {\r\n name: attributesLocale.alcoholPercent,\r\n transform: (value) => `${value}%`\r\n },\r\n {\r\n name: attributesLocale.volumeCl,\r\n transform: (value) => `${value} cl`\r\n }\r\n ]\r\n }\r\n ];\r\n}\r\n","import { AttributeValue } from \"@msdyn365-commerce/retail-proxy\";\r\n\r\nexport const sortAttributes = (a: AttributeValue, b: AttributeValue): number => {\r\n const a_order = a.ExtensionProperties?.find(prop => prop.Key === 'ATTRORDER')?.Value?.DecimalValue;\r\n const b_order = b.ExtensionProperties?.find(prop => prop.Key === 'ATTRORDER')?.Value?.DecimalValue;\r\n\r\n if (a_order === undefined) {\r\n return 1;\r\n }\r\n if (b_order === undefined) {\r\n return -1;\r\n }\r\n\r\n if (a_order < b_order) {\r\n return -1;\r\n }\r\n if (a_order > b_order) {\r\n return 1;\r\n }\r\n return 0;\r\n};\r\n\r\nexport const sortAttributesByGroupOrder = (a: AttributeValue, b: AttributeValue): number => {\r\n const a_order = a.ExtensionProperties?.find(prop => prop.Key === 'ATTRGROUPORDER')?.Value?.DecimalValue;\r\n const b_order = b.ExtensionProperties?.find(prop => prop.Key === 'ATTRGROUPORDER')?.Value?.DecimalValue;\r\n\r\n if (a_order === undefined) {\r\n return 1;\r\n }\r\n if (b_order === undefined) {\r\n return -1;\r\n }\r\n\r\n if (a_order < b_order) {\r\n return -1;\r\n }\r\n if (a_order > b_order) {\r\n return 1;\r\n }\r\n return 0;\r\n};\r\n","import { AttributeValue } from \"@msdyn365-commerce/retail-proxy\";\r\nimport { IAttributeGroupMap, IAttributeGroupMapAttribute } from \"./attributes-map\";\r\nimport { getAttributeStringOrDefault } from \"./\";\r\n\r\n/**\r\n * Returns the index of the most used attribute name in the given array of product specifications named from attribute map.\r\n */\r\nexport function getMostUsedAttributeNameIndex(attributes: AttributeValue[] | undefined, attributeGroup: IAttributeGroupMap, notFoundDefaultValue: string) {\r\n const usedNameIndicies: number[] = [];\r\n const attributeGroupsWithNameArray = attributeGroup.attributes?.filter(x => typeof x !== 'string' && x.name instanceof Array) as IAttributeGroupMapAttribute[];\r\n const arrayOfNameArrays = attributeGroupsWithNameArray?.map(x => x.name) as (string[])[];\r\n\r\n if (arrayOfNameArrays && arrayOfNameArrays.length > 0) {\r\n for (let i = 0; i < arrayOfNameArrays.length; i++) {\r\n if (!arrayOfNameArrays[i]) {\r\n continue;\r\n }\r\n for (let y = 0; y < arrayOfNameArrays[i]?.length; y++) {\r\n const value = getAttributeStringOrDefault(attributes,\r\n arrayOfNameArrays[i][y],\r\n attributeGroup.defaultValue || notFoundDefaultValue);\r\n\r\n if (!attributeGroup.nullValues?.includes(value)) {\r\n usedNameIndicies.push(y);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Get the number that appears the most in 'usedNameIndicies' array\r\n const mostCommonNameIndex = usedNameIndicies.reduce((acc, curr, i, arr) => {\r\n const count = arr.filter((x) => x === curr).length;\r\n return count > acc.count ? { count, index: curr } : acc;\r\n }, { count: 0, index: 0 }).index;\r\n\r\n return mostCommonNameIndex;\r\n}\r\n"],"names":["getAttributeStringOrDefault","attributes","attributeName","defaultValue","suffix","_attribute$CurrencyVa2","_attribute$DateTimeOf2","_attribute$FloatValue2","_attribute$IntegerVal2","_attribute$TextValue2","_attribute$BooleanVal2","attribute","find","x","Name","result","DataTypeValue","CurrencyValue","toString","DateTimeOffsetValue","toUTCString","FloatValue","IntegerValue","TextValue","BooleanValue","getAttributesLocale","lang","nbNO","_objectSpread","enUS","hasAccessToBuy","context","customer","productAttributes","_context$request$app$","length","request","locale","licensesToCheck","hasAccess","license","_productAttributes$fi","_customer$Attributes","productAttribute","Number","customerAttribute","Attributes","AttributeValue","StringValue","isNaN","attributeRecordId","app","config","customerSpecificRefinerRecordId","_productAttributes$fi2","customerNumber","AccountNumber","RecordId","split","filter","Boolean","includes","applyAttributesToSimpleProduct","product","categoryPaths","_product$CategoryPath","attrLocale","alcoholPercentage","prefixedAttributes","alcoholPercent","volumeCl","undefined","alternative","prefixed","producer","country","district","vintage","AlcoholPercentage","VolumeCl","Producer","Country","District","CountryAndDistrict","join","Vintage","CategoryPaths","Category","Segments","CategoryName","applyAttributesToProductSearchResult","_product$CategoryPath2","parseAttributesMap","attributesMap","attributesLocale","type","group","groups","aboutProduct","hideIfEmpty","attributesMode","name","transform","value","searchURLBase","getUrlSync","actionContext","separator","map","v","encodeURIComponent","getAttributesMap","sort","sortAttributesByGroupOrder","index","_product$ExtensionPro","attrFind","ExtensionProperties","e","Key","Value","key","trim","push","attributeGroup","_attributeGroup$attri","_attributesToUse","mostCommonNameIndex","getMostUsedAttributeNameIndex","notFound","attributesToUse","modelVersion","attributeSource","attributeSourceSet","some","source","_attributes$find","forEach","_attributeGroup$attri2","_attributeGroup$attri3","DecimalValue","findIndex","attr","_attributeSource$Text","attrsNew","sortAttributes","_attributeGroup$attri4","Error","exclude","findAttributeFromAttributes","transformName","a","b","_a$ExtensionPropertie","_b$ExtensionPropertie","a_order","prop","b_order","_a$ExtensionPropertie2","_b$ExtensionPropertie2","notFoundDefaultValue","usedNameIndicies","attributeGroupsWithNameArray","Array","arrayOfNameArrays","i","y","_arrayOfNameArrays$i","_attributeGroup$nullV","nullValues","reduce","acc","curr","arr","count"],"sourceRoot":""}