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G7S,gBAAQ,IAAA6S,OAAA,EAARA,EAAUd,cAAc,UACvCD,EAAOkB,KAAO,kBACdlB,EAAOv5B,OAAQ,EACfu5B,EAAOmB,OAAQ,EACfnB,EAAO/f,IAAM6C,EACbkd,EAAOz3B,GAAK,uBACRsE,SACAA,OAAOu0B,YAAc,KACjBj7B,KAAKk7B,gBAAiB,EACtB51B,MAGRu0B,EAAOsB,iBAAiB,SAAUv5B,IAC9B+4B,EAAO/4B,MAEH,QAARi5B,EAAA9S,gBAAQ,IAAA8S,GAAM,QAANC,EAARD,EAAUT,YAAI,IAAAU,GAAdA,EAAgBT,YAAYR,OCnGjC,SAASuB,EAA8Bl4B,GAC1C,OAAO,IAAIm4B,EAAAA,aAAyC,UAAWn4B,EAAQ,+BDavEw1B,EAAAA,EAAAA,IAAA,CADCr2B,EAAAA,IAAM,+BAsDPq2B,EAAAA,EAAAA,IAAA,CADCr2B,EAAAA,IAAM,+BC9DX,MAIai5B,GAA6Bn5B,EAAAA,EAAAA,IAA2B,CACjEE,OAA6Ck5B,EAAAA,iBAC7C/6B,MAN2CN,GACpCk7B,EAA8B,IAAIvC,KAQ7C,WCxBA2C,EAAOC,QAAUl5B,cCAjBi5B,EAAOC,QAAUC","sources":["webpack://Msdyn365.Commerce.Online/./src/actions/product-inventory-information.ts?5994","webpack://Msdyn365.Commerce.Online/./src/actions/product-inventory-utils.ts?6469","webpack://Msdyn365.Commerce.Online/./src/actions/get-product-availabilities-for-selected-variant.ts?8cf2","webpack://Msdyn365.Commerce.Online/./src/modules/lobas-buybox/components/lobas-buybox-find-in-store.tsx?fad7","webpack://Msdyn365.Commerce.Online/./src/modules/lobas-buybox/components/lobas-buybox-components.tsx?cf4e","webpack://Msdyn365.Commerce.Online/./src/modules/lobas-buybox/components/lobas-dropdown/lobas-dropdown.props.ts?d708","webpack://Msdyn365.Commerce.Online/./src/modules/components/lobas-single-slide-carousel.tsx?bcd8","webpack://Msdyn365.Commerce.Online/./src/modules/lobas-buybox/components/lobas-dropdown/lobas-dropdown.tsx?3a11","webpack://Msdyn365.Commerce.Online/./src/modules/lobas-buybox/components/lobas-buybox-product-configure.tsx?13f4","webpack://Msdyn365.Commerce.Online/./src/modules/lobas-buybox/components/dropdown/dropdown.props.ts?bf46","webpack://Msdyn365.Commerce.Online/./src/modules/lobas-buybox/components/dropdown/dropdown.tsx?e9a3","webpack://Msdyn365.Commerce.Online/./src/modules/lobas-buybox/components/buybox-product-configure.tsx?23fa","webpack://Msdyn365.Commerce.Online/./src/modules/lobas-buybox/lobas-buybox.tsx?c04e","webpack://Msdyn365.Commerce.Online/./src/modules/lobas-buybox/components/lobas-buybox-add-to-order-template.tsx?b463","webpack://Msdyn365.Commerce.Online/./src/modules/lobas-buybox/lobas-buybox.view.tsx?fa5b","webpack://Msdyn365.Commerce.Online/./lib/lobas-buybox/module-registration.js?bcdb","webpack://Msdyn365.Commerce.Online/./src/store-selector-state-manager/base-store-selector-state-manager.ts?281e","webpack://Msdyn365.Commerce.Online/./src/store-selector-state-manager/map-store-selector-state-manager.ts?2ae0","webpack://Msdyn365.Commerce.Online/./src/store-selector-state-manager/store-selector-state-manager-data-action.ts?bd3e","webpack://Msdyn365.Commerce.Online/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online/external var \"ReactDOM\"?853b"],"sourcesContent":["/*--------------------------------------------------------------\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 {\r\n ProductAvailableQuantity,\r\n ProductDimensionValueInventoryAvailability,\r\n ProductInventoryAvailability\r\n} from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * This setting defines the delivery modes supported.\r\n */\r\nexport enum DeliveryMode {\r\n allWareHouses = 0,\r\n shipping = 1,\r\n pickup = 2\r\n}\r\n\r\n/**\r\n * This setting defines the inventory levels supported.\r\n */\r\nexport enum InventoryLevels {\r\n physicalAvailable = 'physicalAvailable',\r\n totalAvailable = 'totalAvailable',\r\n threshold = 'inventoryThreshold'\r\n}\r\n\r\n/**\r\n * Product inventory information class.\r\n */\r\nexport interface IProductInventoryInformation {\r\n ProductAvailableQuantity: ProductAvailableQuantity;\r\n StockLevelCode?: string;\r\n StockLevelLabel?: string;\r\n IsProductAvailable: boolean;\r\n InventLocationId?: string;\r\n deliveryType?: DeliveryMode;\r\n}\r\n\r\n/**\r\n * This setting defines the inventory level values return by the API.\r\n */\r\nexport enum InventoryLevelValues {\r\n outOfStock = 'OOS',\r\n available = 'AVAIL'\r\n}\r\n\r\n/**\r\n * Retrieves inventory level code from the dimension based on the app config setting.\r\n * @param dimensionValuesWithInventory - The dimension info.\r\n * @param inventoryLevel - App config setting for inventory level.\r\n * @returns Inventory level code value.\r\n */\r\nexport const getInventoryLevelCodeFromDimensionValue = (\r\n dimensionValuesWithInventory: ProductDimensionValueInventoryAvailability,\r\n inventoryLevel?: InventoryLevels | undefined\r\n): InventoryLevelValues | undefined => {\r\n if (inventoryLevel === InventoryLevels.totalAvailable) {\r\n return dimensionValuesWithInventory.TotalAvailableInventoryLevelCode as InventoryLevelValues | undefined;\r\n }\r\n if (inventoryLevel === InventoryLevels.physicalAvailable) {\r\n return dimensionValuesWithInventory.PhysicalAvailableInventoryLevelCode as InventoryLevelValues | undefined;\r\n }\r\n return undefined;\r\n};\r\n\r\n/**\r\n * Retrieves inventory level code from the product availability based on the app config setting.\r\n * @param productAvailability - The product availability info.\r\n * @param inventoryLevel - App config setting for inventory level.\r\n * @returns Inventory level code value.\r\n */\r\nexport const getInventoryLevelCodeFromProductAvailability = (\r\n productAvailability: ProductInventoryAvailability,\r\n inventoryLevel?: InventoryLevels | undefined\r\n): InventoryLevelValues | undefined => {\r\n if (inventoryLevel === InventoryLevels.totalAvailable) {\r\n return productAvailability.TotalAvailableInventoryLevelCode as InventoryLevelValues | undefined;\r\n }\r\n if (inventoryLevel === InventoryLevels.physicalAvailable) {\r\n return productAvailability.PhysicalAvailableInventoryLevelCode as InventoryLevelValues | undefined;\r\n }\r\n return undefined;\r\n};\r\n","/* eslint-disable no-debugger */\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 { IActionContext } from '@msdyn365-commerce/core';\r\nimport {\r\n InventoryAvailabilitySearchCriteria,\r\n ProductAvailableQuantity,\r\n ProductWarehouseInventoryAvailability,\r\n ProductWarehouseInventoryInformation,\r\n SearchArea\r\n} from '@msdyn365-commerce/retail-proxy';\r\n\r\nimport { DeliveryMode, InventoryLevels, InventoryLevelValues, IProductInventoryInformation } from './product-inventory-information';\r\n\r\n/**\r\n * The function defines whether the inventory label should be displayed or not.\r\n * @param context - The action context.\r\n * @param inventoryCode - The inventory code.\r\n * @returns Boolean.\r\n */\r\nexport function displayLabelEnabled(context: IActionContext, inventoryCode?: string): boolean {\r\n if (!inventoryCode) {\r\n return false;\r\n }\r\n\r\n switch (context.requestContext.app.config.inventoryRanges) {\r\n case 'lowAndOutofStock':\r\n if (inventoryCode !== InventoryLevelValues.available) {\r\n return true;\r\n }\r\n break;\r\n case 'outOfStock':\r\n if (inventoryCode === InventoryLevelValues.outOfStock) {\r\n return true;\r\n }\r\n break;\r\n case 'all':\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * The function that maps a ProductWareHouse object into a ProductAvailabilityQuantity.\r\n * @param context - The action context.\r\n * @param productsWarehouseInventory - The product warehouse inventory information.\r\n * @returns IProductInventoryInformation[].\r\n */\r\nexport function mapProductInventoryInformation(\r\n context: IActionContext,\r\n productsWarehouseInventory?: ProductWarehouseInventoryAvailability[]\r\n): IProductInventoryInformation[] {\r\n const productInventoryInformation: IProductInventoryInformation[] = [];\r\n\r\n /*if (context.requestContext.app.config.enableStockCheck === undefined || context.requestContext.app.config.enableStockCheck === false) {\r\n return productInventoryInformation;\r\n }*/\r\n\r\n if (productsWarehouseInventory && productsWarehouseInventory.length > 0) {\r\n for (const product of productsWarehouseInventory) {\r\n switch (context.requestContext.app.config.inventoryLevel) {\r\n case InventoryLevels.physicalAvailable:\r\n // Inventory level is enabled with Physical inventory\r\n const physicalProductMap = mapInventoryWithPhysicalBufferEnabled(context, product);\r\n if (physicalProductMap) {\r\n productInventoryInformation.push(physicalProductMap);\r\n }\r\n break;\r\n case InventoryLevels.totalAvailable:\r\n // Inventory level is enabled with Total available inventory\r\n const totalAvailableProductMap = mapInventoryWithTotalAvailableBufferEnabled(context, product);\r\n if (totalAvailableProductMap) {\r\n productInventoryInformation.push(totalAvailableProductMap);\r\n }\r\n break;\r\n default:\r\n // When inventory level is inventoryThreshold or not defined\r\n const productMap = mapInventoryWithThresholdEnabled(context, product);\r\n if (productMap) {\r\n productInventoryInformation.push(productMap);\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n return productInventoryInformation;\r\n}\r\n\r\n/**\r\n * The function that maps inventory for when threshold is selected.\r\n * @param context - The action context.\r\n * @param productWarehouseInventoryAvailability - The product warehouse inventory information.\r\n * @returns IProductInventoryInformation.\r\n */\r\nexport function mapInventoryWithThresholdEnabled(\r\n context: IActionContext,\r\n productWarehouseInventoryAvailability: ProductWarehouseInventoryAvailability\r\n): IProductInventoryInformation | null {\r\n if (productWarehouseInventoryAvailability.ProductId && productWarehouseInventoryAvailability.TotalAvailable !== undefined) {\r\n const productQty = productWarehouseInventoryAvailability.TotalAvailable - context.requestContext.app.config.outOfStockThreshold;\r\n const productAvailableQuantity: ProductAvailableQuantity = {\r\n ProductId: productWarehouseInventoryAvailability.ProductId,\r\n AvailableQuantity: productQty > 0 ? productQty : 0\r\n };\r\n\r\n return {\r\n ProductAvailableQuantity: productAvailableQuantity,\r\n IsProductAvailable: !!(productAvailableQuantity.AvailableQuantity && productAvailableQuantity.AvailableQuantity > 0),\r\n InventLocationId: productWarehouseInventoryAvailability.InventLocationId\r\n };\r\n }\r\n\r\n return null;\r\n}\r\n\r\n/**\r\n * The function that maps inventory for when physical available is selected.\r\n * @param context - The action context.\r\n * @param productWarehouseInventoryAvailability - The product warehouse inventory information.\r\n * @returns IProductInventoryInformation.\r\n */\r\nexport function mapInventoryWithPhysicalBufferEnabled(\r\n context: IActionContext,\r\n productWarehouseInventoryAvailability: ProductWarehouseInventoryAvailability\r\n): IProductInventoryInformation | null {\r\n const shouldRenderLabel = displayLabelEnabled(context, productWarehouseInventoryAvailability.PhysicalAvailableInventoryLevelCode);\r\n\r\n if (productWarehouseInventoryAvailability.ProductId && productWarehouseInventoryAvailability.TotalAvailable !== undefined) {\r\n // As per the new buffer logic from RS,\r\n // if code is out of stock then we set the available quantity to 0 regardless of the actual value from API\r\n let productQuantity: number | undefined = 0;\r\n if (productWarehouseInventoryAvailability.PhysicalAvailableInventoryLevelCode !== InventoryLevelValues.outOfStock) {\r\n productQuantity =\r\n productWarehouseInventoryAvailability.MaximumPurchasablePhysicalAvailableQuantity ??\r\n productWarehouseInventoryAvailability.PhysicalAvailable;\r\n }\r\n\r\n const productAvailableQuantity: ProductAvailableQuantity = {\r\n ProductId: productWarehouseInventoryAvailability.ProductId,\r\n AvailableQuantity: productQuantity\r\n };\r\n return {\r\n ProductAvailableQuantity: productAvailableQuantity,\r\n StockLevelCode: shouldRenderLabel ? productWarehouseInventoryAvailability.PhysicalAvailableInventoryLevelCode : undefined,\r\n StockLevelLabel: shouldRenderLabel ? productWarehouseInventoryAvailability.PhysicalAvailableInventoryLevelLabel : undefined,\r\n IsProductAvailable: productAvailableQuantity.AvailableQuantity !== undefined && productAvailableQuantity.AvailableQuantity > 0,\r\n InventLocationId: productWarehouseInventoryAvailability.InventLocationId\r\n };\r\n }\r\n\r\n return null;\r\n}\r\n\r\n/**\r\n * The function that maps inventory for when total available is selected.\r\n * @param context - The action context.\r\n * @param productWarehouseInventoryAvailability - The product warehouse inventory information.\r\n * @returns IProductInventoryInformation.\r\n */\r\nexport function mapInventoryWithTotalAvailableBufferEnabled(\r\n context: IActionContext,\r\n productWarehouseInventoryAvailability: ProductWarehouseInventoryAvailability\r\n): IProductInventoryInformation | null {\r\n const shouldRenderLabel = displayLabelEnabled(context, productWarehouseInventoryAvailability.TotalAvailableInventoryLevelCode);\r\n if (productWarehouseInventoryAvailability.ProductId && productWarehouseInventoryAvailability.TotalAvailable !== undefined) {\r\n // As per the new buffer logic from RS,\r\n // if code is out of stock then we set the available quantity to 0 regardless of the actual value from API\r\n let productQuantity: number | undefined = 0;\r\n if (productWarehouseInventoryAvailability.TotalAvailableInventoryLevelCode !== InventoryLevelValues.outOfStock) {\r\n productQuantity =\r\n productWarehouseInventoryAvailability.MaximumPurchasableTotalAvailableQuantity ??\r\n productWarehouseInventoryAvailability.TotalAvailable;\r\n }\r\n\r\n const productAvailableQuantity: ProductAvailableQuantity = {\r\n ProductId: productWarehouseInventoryAvailability.ProductId,\r\n AvailableQuantity: productQuantity\r\n };\r\n return {\r\n ProductAvailableQuantity: productAvailableQuantity,\r\n StockLevelCode: shouldRenderLabel ? productWarehouseInventoryAvailability.TotalAvailableInventoryLevelCode : undefined,\r\n StockLevelLabel: shouldRenderLabel ? productWarehouseInventoryAvailability.TotalAvailableInventoryLevelLabel : undefined,\r\n IsProductAvailable: productAvailableQuantity.AvailableQuantity !== undefined && productAvailableQuantity.AvailableQuantity > 0,\r\n InventLocationId: productWarehouseInventoryAvailability.InventLocationId\r\n };\r\n }\r\n\r\n return null;\r\n}\r\n\r\n/**\r\n * The function created a InventoryAvailabilitySearchCriteria object for getEstimatedAvailability API.\r\n * @param context - The action context.\r\n * @returns Boolean.\r\n */\r\nexport function isAggregatedInventory(context: IActionContext): boolean {\r\n // If warehouse aggregated is true then query inventory from multiple warehouses\r\n // else query from single warehouse\r\n return (\r\n (context.requestContext.app.config.inventoryLevel === InventoryLevels.totalAvailable ||\r\n context.requestContext.app.config.inventoryLevel === InventoryLevels.physicalAvailable) &&\r\n context.requestContext.app.config.warehouseAggregation === 'multiple'\r\n );\r\n}\r\n\r\n/**\r\n * The function created a InventoryAvailabilitySearchCriteria object for getEstimatedAvailability API.\r\n * @param context - The action context.\r\n * @param productWarehouseInventoryInformation - The product ware house inventory information.\r\n * @returns ProductWarehouseInventoryInformation.\r\n */\r\nexport function mapAggregatedProductInventoryInformation(\r\n context: IActionContext,\r\n productWarehouseInventoryInformation: ProductWarehouseInventoryInformation\r\n): IProductInventoryInformation[] {\r\n if (isAggregatedInventory(context)) {\r\n const productInventoryMapping:\r\n | ProductWarehouseInventoryAvailability[]\r\n | undefined = productWarehouseInventoryInformation.AggregatedProductInventoryAvailabilities?.map(product => {\r\n return {\r\n DataAreaId: product.DataAreaId,\r\n MaximumPurchasablePhysicalAvailableQuantity:\r\n product.MaximumPurchasablePhysicalAvailableQuantity ?? product.PhysicalAvailableQuantity,\r\n MaximumPurchasableTotalAvailableQuantity:\r\n product.MaximumPurchasableTotalAvailableQuantity ?? product.TotalAvailableQuantity,\r\n ProductId: product.ProductId,\r\n PhysicalAvailable: product.PhysicalAvailableQuantity,\r\n PhysicalAvailableInventoryLevelCode: product.PhysicalAvailableInventoryLevelCode,\r\n PhysicalAvailableInventoryLevelLabel: product.PhysicalAvailableInventoryLevelLabel,\r\n TotalAvailable: product.TotalAvailableQuantity,\r\n TotalAvailableInventoryLevelCode: product.TotalAvailableInventoryLevelCode,\r\n TotalAvailableInventoryLevelLabel: product.TotalAvailableInventoryLevelLabel\r\n };\r\n });\r\n return mapProductInventoryInformation(context, productInventoryMapping);\r\n }\r\n\r\n return mapProductInventoryInformation(context, productWarehouseInventoryInformation.ProductWarehouseInventoryAvailabilities);\r\n}\r\n\r\n/**\r\n * The function created a InventoryAvailabilitySearchCriteria object for getEstimatedAvailability API.\r\n * @param context - The action context.\r\n * @param productIds - The product id collection.\r\n * @param isDefaultWareHouse - Flag to define whether inventory is from default warehouse or not.\r\n * @param isFilterByChannelFulfillmentGroup - Filter by fulfillment group.\r\n * @param searchArea - The search area.\r\n * @param defaultDeliveryMode - The delivery mode.\r\n * @returns InventoryAvailabilitySearchCriteria.\r\n */\r\nexport function createInventoryAvailabilitySearchCriteria(\r\n context: IActionContext,\r\n productIds: number[],\r\n isDefaultWareHouse?: boolean,\r\n isFilterByChannelFulfillmentGroup?: boolean,\r\n searchArea?: SearchArea,\r\n defaultDeliveryMode?: DeliveryMode\r\n): InventoryAvailabilitySearchCriteria {\r\n const salesUnitType = 2;\r\n const deliveryMode = defaultDeliveryMode ? defaultDeliveryMode : DeliveryMode.shipping;\r\n\r\n const inventoryAvailabilitySearchCriteria: InventoryAvailabilitySearchCriteria = {\r\n ProductIds: productIds,\r\n QuantityUnitTypeValue: salesUnitType,\r\n SearchArea: searchArea\r\n };\r\n\r\n if (isAggregatedInventory(context)) {\r\n inventoryAvailabilitySearchCriteria.FilterByChannelFulfillmentGroup = true;\r\n inventoryAvailabilitySearchCriteria.DeliveryModeTypeFilterValue = deliveryMode;\r\n } else {\r\n inventoryAvailabilitySearchCriteria.DefaultWarehouseOnly = isDefaultWareHouse;\r\n inventoryAvailabilitySearchCriteria.FilterByChannelFulfillmentGroup = isFilterByChannelFulfillmentGroup;\r\n }\r\n\r\n return inventoryAvailabilitySearchCriteria;\r\n}\r\n","/* eslint-disable no-debugger */\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 {\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 ProductAvailableQuantity,\r\n ProductsDataActions,\r\n /*ProductType,*/\r\n ProductWarehouseInventoryAvailability,\r\n ReleasedProductType\r\n} from '@msdyn365-commerce/retail-proxy';\r\n\r\nimport {\r\n ArrayExtensions,\r\n getSelectedProductIdFromActionInput,\r\n getSelectedVariant,\r\n SelectedVariantInput\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { DeliveryMode, IProductInventoryInformation } from './product-inventory-information';\r\nimport { createInventoryAvailabilitySearchCriteria, mapAggregatedProductInventoryInformation } from './product-inventory-utils';\r\n\r\n/**\r\n * Input class for the getProductAvailabilitiesForSelectedVariant Data Action.\r\n */\r\nexport class ProductAvailabilitiesForSelectedVariantInput implements IActionInput {\r\n public productId: number;\r\n\r\n public channelId: number;\r\n\r\n public constructor(productId: number | string, channelId: number) {\r\n this.productId = typeof productId === 'string' ? +productId : productId;\r\n this.channelId = channelId;\r\n }\r\n\r\n /**\r\n * GetCacheKey.\r\n * @returns - Returns string.\r\n */\r\n public getCacheKey = (): string => 'ProductAvailabilitiesForSelectedVariant';\r\n\r\n /**\r\n * GetCacheObjectType.\r\n * @returns - Cache Object Type string.\r\n */\r\n public getCacheObjectType = (): string => 'ProductAvailabilities';\r\n\r\n /**\r\n * DataCacheType.\r\n * @returns - CacheType string.\r\n */\r\n public dataCacheType = (): CacheType => 'none';\r\n}\r\n\r\n/**\r\n * CreateInput method for the getProductAvailabilitiesForSelectedVariant data action.\r\n * @param inputData - The input data passed to the createInput method.\r\n * @returns - ProductAvailabilitiesForSelectedVariant or error.\r\n */\r\nexport const createProductAvailabilitiesForSelectedVariantInput = (\r\n inputData: ICreateActionContext>\r\n): ProductAvailabilitiesForSelectedVariantInput => {\r\n const productId = getSelectedProductIdFromActionInput(inputData);\r\n\r\n if (productId) {\r\n return new ProductAvailabilitiesForSelectedVariantInput(+productId, +inputData.requestContext.apiSettings.channelId);\r\n }\r\n throw new Error('Unable to create ProductAvailabilitiesForSelectedVariantInput, no productId found on module config or query');\r\n};\r\n\r\n/**\r\n * The action method for the getProductAvailabilitiesForSelectedVariant data action.\r\n * @param input - ProductAvailabilitiesForSelectedVariant.\r\n * @param ctx - Action Context.\r\n * @returns - Product inventory information.\r\n */\r\nexport async function getProductAvailabilitiesForSelectedVariantAction(\r\n input: ProductAvailabilitiesForSelectedVariantInput,\r\n ctx: IActionContext\r\n): Promise {\r\n const selectedVariantInput = new SelectedVariantInput(input.productId, input.channelId, undefined, undefined, ctx.requestContext);\r\n const productInventoryInformation: IProductInventoryInformation[] = [];\r\n\r\n try {\r\n const productResult = await getSelectedVariant(selectedVariantInput, ctx);\r\n\r\n // Don't get availability if it is service item && enableStockCheck is disbaled.\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Reading config.\r\n if (\r\n /*ctx.requestContext.app.config.enableStockCheck &&*/\r\n productResult &&\r\n productResult.ItemTypeValue !==\r\n ReleasedProductType.Service /*&&\r\n productResult.ProductTypeValue !== ProductType.Master*/\r\n ) {\r\n const shippingSearchCriteria = createInventoryAvailabilitySearchCriteria(\r\n ctx,\r\n [productResult.RecordId],\r\n true,\r\n undefined,\r\n undefined,\r\n DeliveryMode.shipping\r\n );\r\n const pickupSearchCriteria = createInventoryAvailabilitySearchCriteria(\r\n ctx,\r\n [input.productId],\r\n false,\r\n true,\r\n undefined,\r\n DeliveryMode.pickup\r\n );\r\n const shippingAvailability = await ProductsDataActions.getEstimatedAvailabilityAsync(\r\n { callerContext: ctx },\r\n shippingSearchCriteria\r\n );\r\n if (shippingAvailability.ProductWarehouseInventoryAvailabilities) {\r\n const shippingInventory = mapAggregatedProductInventoryInformation(ctx, shippingAvailability);\r\n if (ArrayExtensions.hasElements(shippingInventory)) {\r\n shippingInventory[0].deliveryType = DeliveryMode.shipping;\r\n productInventoryInformation.push(shippingInventory[0]);\r\n }\r\n }\r\n const pickupAvailability = await ProductsDataActions.getEstimatedAvailabilityAsync(\r\n { callerContext: ctx },\r\n pickupSearchCriteria\r\n );\r\n if (pickupAvailability.ProductWarehouseInventoryAvailabilities) {\r\n const pickupInventory = mapAggregatedProductInventoryInformation(ctx, pickupAvailability);\r\n if (ArrayExtensions.hasElements(pickupInventory)) {\r\n pickupInventory[0].deliveryType = DeliveryMode.pickup;\r\n productInventoryInformation.push(pickupInventory[0]);\r\n }\r\n }\r\n\r\n return productInventoryInformation;\r\n }\r\n\r\n return undefined;\r\n } catch (error) {\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- cann't assign type to the error variable.\r\n ctx.telemetry.exception(error);\r\n ctx.telemetry.debug('[getPriceForSelectedVariantAction]Error executing action');\r\n return undefined;\r\n }\r\n}\r\n\r\n/**\r\n * The function that maps a ProductWareHouse object into a ProductAvailabilityQuantity.\r\n * @param productsWarehouseInventory - Product warehouse inventory.\r\n * @returns Product Available quantity.\r\n */\r\nexport function mergeProductWarehouseToProductAvailabities(\r\n productsWarehouseInventory: ProductWarehouseInventoryAvailability[]\r\n): ProductAvailableQuantity[] {\r\n const productAvailable: ProductAvailableQuantity[] = [];\r\n if (ArrayExtensions.hasElements(productsWarehouseInventory)) {\r\n for (const product of productsWarehouseInventory) {\r\n if (product.TotalAvailable !== undefined && product.ProductId !== undefined) {\r\n productAvailable.push({ ProductId: product.ProductId, AvailableQuantity: product.TotalAvailable });\r\n }\r\n }\r\n }\r\n return productAvailable;\r\n}\r\n\r\n/**\r\n * The complete getProductAvailabilitiesForSelectedVariant data action\r\n * Get the currently selected variant via the getSelectedVariant data action, and\r\n * then gets the availabilities for the variant via the getProductAvailabilities RetailServer API.\r\n */\r\nexport const getProductAvailabilitiesForSelectedVariantActionDataAction = createObservableDataAction({\r\n id: '@msdyn365-commerce-modules/retail-actions/get-product-availabilities-for-selected-variant',\r\n action: >getProductAvailabilitiesForSelectedVariantAction,\r\n input: createProductAvailabilitiesForSelectedVariantInput\r\n});\r\n\r\nexport default getProductAvailabilitiesForSelectedVariantActionDataAction;\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\n/* eslint-disable no-duplicate-imports */\r\nimport {\r\n AddToCartBehavior,\r\n IAddToCartFailureResult,\r\n IAddToCartResources,\r\n ItemSuccessfullyAddedToCartNotification,\r\n PriceComponent\r\n} from '@msdyn365-commerce/components';\r\nimport { getUrlSync, ICoreContext, IImageSettings } from '@msdyn365-commerce/core';\r\nimport { ICartActionResult } from '@msdyn365-commerce/global-state';\r\nimport { DeliveryOption, FeatureState, OrgUnitLocation, ProductAvailableQuantity, ProductDimension } from '@msdyn365-commerce/retail-proxy';\r\nimport { NotificationsManager } from '@msdyn365-commerce-modules/notifications-core';\r\nimport {\r\n ArrayExtensions,\r\n DeliveryMode,\r\n IProductInventoryInformation,\r\n isAggregatedInventory\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getTelemetryObject, Heading, INodeProps, IPopupProps, Popup } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { BuyboxErrorBlock } from '@msdyn365-commerce-modules/buybox';\r\nimport { IBuyboxCallbacks, IBuyboxState } from '@msdyn365-commerce-modules/buybox';\r\nimport { getConfigureErrors, getGenericError } from '@msdyn365-commerce-modules/buybox';\r\nimport { ILobasBuyboxData } from '../lobas-buybox.data';\r\nimport { ILobasBuyboxProps, ILobasBuyboxResources } from '../lobas-buybox.props.autogenerated';\r\n\r\nconst modalCloseButtonReference: React.RefObject = React.createRef();\r\n\r\n/**\r\n * FindinStore failure Interface.\r\n */\r\nexport interface IFindInStoreFailureResult {\r\n missingDimensions?: ProductDimension[];\r\n}\r\n\r\n/**\r\n * BuyBoxFindinStore View Props Interface.\r\n */\r\nexport interface IBuyboxFindInStoreViewProps {\r\n storeSelector?: React.ReactNode;\r\n heading?: React.ReactNode;\r\n description?: React.ReactNode;\r\n errors?: React.ReactNode;\r\n button?: React.ReactNode;\r\n productPickupOptionList?: React.ReactNode;\r\n\r\n modal?: React.ReactNode;\r\n\r\n ContainerProps: INodeProps;\r\n\r\n openFindInStoreDialog(): Promise;\r\n}\r\n\r\n/**\r\n * On click find store handler.\r\n * @param props -Buybox data.\r\n * @param state -Buybox state.\r\n * @param callbacks -Buybox callbacks.\r\n * @returns Find in store.\r\n */\r\nconst onClickFindInStoreHandler = (\r\n props: ILobasBuyboxProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks\r\n) => async () => {\r\n await findInStoreOnClick(props, state, callbacks);\r\n};\r\n\r\n/**\r\n * Inventory settings based on the inventory policy for aggregated availability.\r\n */\r\ninterface IInventorySettingsProps {\r\n isSectionDisabled: boolean;\r\n description: string;\r\n buttonText: string;\r\n}\r\n\r\n/**\r\n * The function defines the settings values for a given inventory configuration.\r\n * @param context - The context.\r\n * @param isStockCheck - Flag to enable inventory validation.\r\n * @param productAvailability - The product inventory information.\r\n * @param buyboxResources - The buybox string resources.\r\n * @param isLoading - Is loading.\r\n * @returns Boolean.\r\n */\r\nfunction getFindInStoreInventorySettings(\r\n context: ICoreContext,\r\n isStockCheck: boolean,\r\n productAvailability: IProductInventoryInformation[] | undefined,\r\n buyboxResources: ILobasBuyboxResources,\r\n isLoading?: boolean\r\n): IInventorySettingsProps {\r\n // If shouldValidateAggregation is true then is required to check for the product inventory, based on this the messaging will change\r\n // and the find in store button will be ensbled or disabled\r\n\r\n let isSectionDisabled: boolean;\r\n let buttonText;\r\n let description: string;\r\n\r\n let pickupInventory: IProductInventoryInformation | undefined;\r\n\r\n if (!isStockCheck || isLoading) {\r\n return {\r\n isSectionDisabled: false,\r\n buttonText: buyboxResources.findInStoreLinkText,\r\n description: buyboxResources.findInStoreDescriptionText\r\n };\r\n }\r\n\r\n if (productAvailability) {\r\n pickupInventory = productAvailability.find(pickup => pickup.deliveryType === DeliveryMode.pickup);\r\n }\r\n\r\n // If aggregated is enabled, then we need to validate the inventor check for find in store.\r\n // If an individual is selected, then we will always show a find in store button.\r\n if (isAggregatedInventory(context.actionContext)) {\r\n if (productAvailability && pickupInventory?.IsProductAvailable) {\r\n isSectionDisabled = false;\r\n buttonText = buyboxResources.findInStoreLinkText;\r\n description = buyboxResources.findInStoreDescriptionText;\r\n } else {\r\n isSectionDisabled = true;\r\n buttonText = buyboxResources.findInStoreNotAvailableTextButton;\r\n description = buyboxResources.findInStoreNotAvailableDescription;\r\n }\r\n } else {\r\n isSectionDisabled = false;\r\n buttonText = buyboxResources.findInStoreLinkText;\r\n description = buyboxResources.findInStoreDescriptionText;\r\n }\r\n\r\n return {\r\n isSectionDisabled,\r\n description,\r\n buttonText\r\n };\r\n}\r\n\r\n/**\r\n * Method to check if we have atleast one common delivery code between product and channel.\r\n * @param productdeliveryOptions - Product DeliveryOption List.\r\n * @param storePickUpOptionList - Channel DeliveryOption List.\r\n * @returns Boolean flag.\r\n */\r\nconst matchDeliveryOptions = (\r\n productdeliveryOptions: DeliveryOption[] | undefined,\r\n storePickUpOptionList: string[] | undefined\r\n): boolean => {\r\n const deliveryOption: string[] = [];\r\n productdeliveryOptions?.map(delivery => {\r\n const pickup = storePickUpOptionList?.find(deliveryCode => deliveryCode === delivery.Code);\r\n if (pickup) {\r\n deliveryOption.push(pickup);\r\n }\r\n return deliveryOption;\r\n });\r\n\r\n return ArrayExtensions.hasElements(deliveryOption);\r\n};\r\n\r\nexport function getBuyboxFindInStore(\r\n props: ILobasBuyboxProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks\r\n): IBuyboxFindInStoreViewProps | undefined {\r\n const {\r\n data,\r\n slots: { storeSelector },\r\n resources: {\r\n priceFree,\r\n originalPriceText,\r\n currentPriceText,\r\n findInStoreHeaderText,\r\n buyBoxGoToCartText,\r\n buyBoxContinueShoppingText,\r\n closeNotificationLabel,\r\n buyBoxSingleItemText,\r\n buyBoxMultiLineItemFormatText,\r\n buyBoxHeaderMessageText,\r\n descriptionTextToShowAllPickupOptions\r\n },\r\n context: {\r\n request: { channel: { PickupDeliveryModeCode } = { PickupDeliveryModeCode: undefined } }\r\n }\r\n } = props;\r\n\r\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n const product = data?.product?.result;\r\n const price = data?.productPrice?.result;\r\n const cart = data?.cart?.result;\r\n const deliveryOptions = data?.deliveryOptions?.result;\r\n const productAvailability = data.productAvailableQuantity?.result;\r\n const retailMulitplePickupMFeatureState = data?.featureState?.result?.find(\r\n (featureState: FeatureState) => featureState.Name === multiplePickupStoreSwitchName\r\n )?.IsEnabled;\r\n const channelDeliveryOptionConfig = data?.channelDeliveryOptionConfig?.result;\r\n\r\n const missingDimensions = product?.Dimensions?.filter(dimension => !dimension.DimensionValue?.Value);\r\n\r\n const {\r\n errorState: { configureErrors, quantityError, otherError, errorHost },\r\n modalOpen,\r\n quantity\r\n } = state;\r\n\r\n const { isSectionDisabled, buttonText, description } = getFindInStoreInventorySettings(\r\n props.context,\r\n props.context.app.config.enableStockCheck,\r\n productAvailability,\r\n props.resources,\r\n props.data.productAvailableQuantity.status === 'LOADING' || ArrayExtensions.hasElements(missingDimensions)\r\n );\r\n\r\n if (!product || !ArrayExtensions.hasElements(storeSelector)) {\r\n return undefined;\r\n }\r\n\r\n if (!deliveryOptions || !deliveryOptions.DeliveryOptions) {\r\n return undefined;\r\n }\r\n\r\n // If no delivery options present on the product, or none of the delivery options\r\n // match the PickupDeliveryModeCode, that means the item cannot be used for BOPIS\r\n if (retailMulitplePickupMFeatureState && channelDeliveryOptionConfig) {\r\n if (!matchDeliveryOptions(deliveryOptions.DeliveryOptions, channelDeliveryOptionConfig?.PickupDeliveryModeCodes)) {\r\n return undefined;\r\n }\r\n } else if (\r\n !PickupDeliveryModeCode ||\r\n !deliveryOptions.DeliveryOptions.find((option: DeliveryOption) => option.Code === PickupDeliveryModeCode)\r\n ) {\r\n return undefined;\r\n }\r\n\r\n const dialogStrings = {\r\n goToCartText: buyBoxGoToCartText,\r\n continueShoppingText: buyBoxContinueShoppingText,\r\n closeNotificationLabel,\r\n headerItemOneText: buyBoxSingleItemText,\r\n headerItemFormatText: buyBoxMultiLineItemFormatText,\r\n headerMessageText: buyBoxHeaderMessageText,\r\n freePriceText: priceFree,\r\n originalPriceText,\r\n currentPriceText\r\n };\r\n\r\n const priceComponent = price ? (\r\n \r\n ) : (\r\n ''\r\n );\r\n\r\n const defaultImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: 'w=240&h=240&m=6', w: 0, h: 0 },\r\n lg: { q: 'w=240&h=240&m=6', w: 0, h: 0 },\r\n xl: { q: 'w=240&h=240&m=6', w: 0, h: 0 }\r\n },\r\n lazyload: false,\r\n disableLazyLoad: true\r\n };\r\n\r\n const popupProps: IPopupProps = {\r\n context: props.context,\r\n className: 'ms-buybox',\r\n id: props.id,\r\n typeName: props.typeName,\r\n data: { product: props.data.product?.result, price: props.data.productPrice?.result },\r\n dialogStrings,\r\n imageSettings: defaultImageSettings,\r\n gridSettings: props.context.request.gridSettings,\r\n productQuantity: quantity,\r\n priceComponent,\r\n navigationUrl: getUrlSync('cart', props.context.actionContext),\r\n modalOpen,\r\n setModalOpen: callbacks.changeModalOpen\r\n };\r\n const renderModalPopup = ;\r\n\r\n return {\r\n ContainerProps: {\r\n className: 'ms-buybox__find-in-store'\r\n },\r\n\r\n storeSelector: storeSelector[0],\r\n\r\n openFindInStoreDialog: onClickFindInStoreHandler(props, state, callbacks),\r\n\r\n heading: ,\r\n\r\n description:

{description}

,\r\n productPickupOptionList:\r\n retailMulitplePickupMFeatureState && !isSectionDisabled ? (\r\n <>\r\n

{descriptionTextToShowAllPickupOptions}

\r\n
    \r\n {deliveryOptions.DeliveryOptions.map((item: DeliveryOption) => {\r\n return (\r\n
  • \r\n {item.Description}\r\n
  • \r\n );\r\n })}\r\n
\r\n \r\n ) : null,\r\n errors: (\r\n \r\n ),\r\n\r\n button: (\r\n \r\n {buttonText}\r\n \r\n ),\r\n\r\n modal: renderModalPopup\r\n };\r\n}\r\n\r\n/**\r\n * Handler for find in store button.\r\n * @param props - BuyBox data.\r\n * @param state - BuyBox state.\r\n * @param callbacks - BuyBox callbacks.\r\n * @returns - Promise.\r\n */\r\nasync function findInStoreOnClick(\r\n props: ILobasBuyboxProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks\r\n): Promise {\r\n const {\r\n data: {\r\n storeSelectorStateManager: { result: storeSelectorStateManager },\r\n cart: { result: cart },\r\n productAvailableQuantity: { result: productAvailableQuantity }\r\n },\r\n resources,\r\n context,\r\n modules\r\n } = props;\r\n\r\n const { selectedProduct, quantity } = state;\r\n\r\n let dataProduct = props.data.product.result;\r\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n const retailMulitplePickupMFeatureState = props.data?.featureState?.result?.find(\r\n (featureState: FeatureState) => featureState.Name === multiplePickupStoreSwitchName\r\n )?.IsEnabled;\r\n\r\n if (selectedProduct) {\r\n dataProduct = (await selectedProduct) || dataProduct;\r\n }\r\n\r\n if (!dataProduct || !storeSelectorStateManager) {\r\n return;\r\n }\r\n\r\n const product = dataProduct;\r\n\r\n const missingDimensions =\r\n product.Dimensions &&\r\n product.Dimensions.filter((dimension: ProductDimension) => !(dimension.DimensionValue && dimension.DimensionValue.Value));\r\n\r\n let storeSelectorId: string = '';\r\n if (modules && Object.keys(modules).length > 0 && modules.storeSelector && modules.storeSelector.length > 0) {\r\n storeSelectorId = modules.storeSelector[0].id;\r\n }\r\n\r\n if (missingDimensions && missingDimensions.length > 0) {\r\n if (callbacks.updateErrorState) {\r\n callbacks.updateErrorState({\r\n errorHost: 'FINDINSTORE',\r\n configureErrors: getConfigureErrors(missingDimensions, resources)\r\n });\r\n }\r\n } else {\r\n storeSelectorStateManager\r\n .openDialog({\r\n product,\r\n id: storeSelectorId,\r\n parentElementRef: modalCloseButtonReference,\r\n deliveryOptions: retailMulitplePickupMFeatureState ? props.data.deliveryOptions.result : undefined,\r\n onLocationSelected: async (orgUnitLocation: OrgUnitLocation, deliveryMode: string) => {\r\n if (!cart) {\r\n return Promise.resolve();\r\n }\r\n\r\n const behavior = props.context?.app?.config?.addToCartBehavior;\r\n\r\n return cart\r\n .addProductToCart({ product, count: quantity, location: orgUnitLocation, deliveryMode })\r\n .then((result: ICartActionResult) => {\r\n if (result.status === 'FAILED' && result.substatus === 'MAXQUANTITY') {\r\n callbacks.changeModalOpen(false);\r\n let productAvailability: ProductAvailableQuantity | undefined;\r\n if (state.productAvailableQuantity) {\r\n productAvailability = state.productAvailableQuantity.ProductAvailableQuantity;\r\n } else if (productAvailableQuantity && ArrayExtensions.hasElements(productAvailableQuantity)) {\r\n const shippingInventory = productAvailableQuantity.find(\r\n shipping => shipping.deliveryType === DeliveryMode.pickup\r\n );\r\n productAvailability = shippingInventory?.ProductAvailableQuantity;\r\n } else {\r\n productAvailability = undefined;\r\n }\r\n const failureResult: IAddToCartFailureResult = {\r\n failureReason: 'CARTACTIONFAILED',\r\n cartActionResult: { status: result.status, substatus: result.substatus }\r\n };\r\n callbacks.updateErrorState({\r\n errorHost: 'ADDTOCART',\r\n configureErrors: {},\r\n otherError: getGenericError(\r\n failureResult,\r\n cart,\r\n resources,\r\n context,\r\n product,\r\n productAvailability,\r\n orgUnitLocation\r\n )\r\n });\r\n } else {\r\n callbacks.updateErrorState({\r\n configureErrors: {}\r\n });\r\n const navigationUrl = getUrlSync('cart', context.actionContext);\r\n if (behavior === undefined || behavior === AddToCartBehavior.goToCart) {\r\n if (result.status === 'SUCCESS' && navigationUrl) {\r\n window.location.assign(navigationUrl);\r\n }\r\n } else if (behavior === AddToCartBehavior.showModal) {\r\n callbacks.changeModalOpen(true);\r\n } else if (behavior === AddToCartBehavior.showNotification) {\r\n const defaultImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: 'w=240&h=240&m=6', w: 0, h: 0 },\r\n lg: { q: 'w=240&h=240&m=6', w: 0, h: 0 },\r\n xl: { q: 'w=240&h=240&m=6', w: 0, h: 0 }\r\n },\r\n lazyload: false,\r\n disableLazyLoad: true\r\n };\r\n const telemetryContent = getTelemetryObject(\r\n props.context.request.telemetryPageName!,\r\n props.friendlyName,\r\n props.telemetry\r\n );\r\n const dialogStrings: IAddToCartResources = {\r\n goToCartText: resources.buyBoxGoToCartText,\r\n continueShoppingText: resources.buyBoxContinueShoppingText,\r\n closeNotificationLabel: resources.closeNotificationLabel,\r\n headerItemOneText: resources.buyBoxSingleItemText,\r\n headerItemFormatText: resources.buyBoxMultiLineItemFormatText,\r\n headerMessageText: resources.buyBoxHeaderMessageText,\r\n freePriceText: resources.priceFree,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText,\r\n addedQuantityText: resources.addedQuantityText\r\n };\r\n const notification = new ItemSuccessfullyAddedToCartNotification(\r\n props.context,\r\n dialogStrings,\r\n defaultImageSettings,\r\n props.context.request.gridSettings,\r\n product,\r\n props.data.productPrice?.result,\r\n quantity,\r\n navigationUrl,\r\n telemetryContent,\r\n props.id,\r\n props.typeName\r\n );\r\n NotificationsManager.instance().addNotification(notification);\r\n }\r\n }\r\n })\r\n .catch((error: Error) => {\r\n if (props.telemetry) {\r\n props.telemetry.exception(error);\r\n props.telemetry.debug('Unable to add product to cart');\r\n }\r\n });\r\n }\r\n })\r\n .catch((error: Error) => {\r\n if (props.telemetry) {\r\n props.telemetry.error(error.message);\r\n props.telemetry.debug('Unable to find in store');\r\n }\r\n });\r\n }\r\n}\r\n","/* eslint-disable no-debugger */\r\nimport { ArrayExtensions, DeliveryMode } from '@msdyn365-commerce-modules/retail-actions';\r\nimport * as React from 'react';\r\n\r\nimport { IBuyboxCommonData, IProductDetails, IBuyboxState } from '@msdyn365-commerce-modules/buybox';\r\nimport { IProductInventoryInformation } from '../../../actions/product-inventory-information';\r\nimport { ILobasBuyboxProps } from '../lobas-buybox.props.autogenerated';\r\n\r\nconst _getClassNamePrefix = (typeName: string): string => {\r\n return typeName.toLocaleLowerCase() === 'quickview' ? 'ms-quickView' : 'ms-buybox';\r\n};\r\n\r\nexport function getBuyBoxInventoryLabel(\r\n props: ILobasBuyboxProps,\r\n state?: IBuyboxState,\r\n productDetails?: IProductDetails\r\n): React.ReactElement | undefined {\r\n const { typeName } = props;\r\n\r\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\r\n const productAvailableQuantity = props.data.productAvailableQuantity?.result ?? productDetails?.productAvailableQuantity;\r\n const productSelected = state?.selectedProduct;\r\n const className = _getClassNamePrefix(typeName);\r\n\r\n if (productSelected === undefined && (!productAvailableQuantity || !ArrayExtensions.hasElements(productAvailableQuantity))) {\r\n return (\r\n
\r\n {props.resources.inventoryAvailability}\r\n
\r\n );\r\n }\r\n if (!productAvailableQuantity || !ArrayExtensions.hasElements(productAvailableQuantity)) {\r\n return (\r\n
\r\n \r\n {props.resources.inventoryOutOfStock}\r\n \r\n
\r\n );\r\n }\r\n const shippingInventory = productAvailableQuantity.find(shipping => shipping.deliveryType === DeliveryMode.shipping);\r\n\r\n if (shippingInventory) {\r\n let inventoryClassName: string;\r\n if (shippingInventory.StockLevelCode) {\r\n inventoryClassName = `${className}__inventory-label ${className}__inventory-code-${shippingInventory.StockLevelCode.toLowerCase()}`;\r\n } else {\r\n inventoryClassName = `${className}__inventory-label`;\r\n }\r\n return (\r\n
\r\n {shippingInventory.StockLevelLabel}\r\n {getInventoryQty(shippingInventory)}\r\n
\r\n );\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\nconst getInventoryQty = (inventory: IProductInventoryInformation): string => {\r\n if (inventory.ProductAvailableQuantity.AvailableQuantity && inventory.ProductAvailableQuantity.AvailableQuantity > 0) {\r\n const qtyAvailable = inventory.ProductAvailableQuantity.AvailableQuantity;\r\n let step = Math.log10(qtyAvailable);\r\n\r\n if (step - Math.floor(step) >= 0.69898) {\r\n step = Math.ceil(step);\r\n } else {\r\n step = Math.floor(step);\r\n }\r\n\r\n let denom = Math.floor(qtyAvailable / Math.pow(10, step));\r\n\r\n if (denom < 1) {\r\n denom = 0.5;\r\n }\r\n\r\n const qtyRange = denom * Math.pow(10, step);\r\n\r\n return `${qtyRange}+`;\r\n }\r\n return '';\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 { ICommerceApiSettings, ICoreContext } from '@msdyn365-commerce/core-internal';\r\nimport { ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\n\r\n/**\r\n * Specifies the type of selection.\r\n */\r\nexport enum LobasSelectionType {\r\n dropdown = 0,\r\n swatch = 1\r\n}\r\n\r\n/**\r\n * Copyright (c) 2018 Microsoft Corporation.\r\n */\r\nexport interface ILobasDropdownProps {\r\n /**\r\n * Specifies the type of selection. Dropdown by default.\r\n */\r\n selectionType?: LobasSelectionType;\r\n\r\n /**\r\n * @friendlyName dropdownId\r\n * @description Id for dropdown component.\r\n */\r\n dropdownId: string;\r\n\r\n /**\r\n * @friendlyName dropdownName\r\n * @description Name of the dropdown component.\r\n */\r\n dropdownName: string;\r\n\r\n /**\r\n * @friendlyName dropdownList\r\n * @description List of items in dropdown.\r\n */\r\n dropdownList: ILobasDropdownItemProps[];\r\n\r\n /**\r\n * @friendlyName dropdownToggleName\r\n * @description Name to use for the toggle when nothing is selected.\r\n */\r\n dropdownToggleName: string;\r\n\r\n /**\r\n * @telemetryContent telemetryContent\r\n * @description Telemetry content.\r\n */\r\n telemetryContent?: ITelemetryContent;\r\n\r\n apiSettings?: ICommerceApiSettings;\r\n\r\n /**\r\n * @friendlyName onChange\r\n * @description Callback that gets fired when when a selected dimension changes.\r\n */\r\n onChange?(notification: ILobasDropdownOnSelectionChangeNotification): Promise;\r\n\r\n context: ICoreContext;\r\n\r\n product: SimpleProduct | null | undefined;\r\n}\r\n\r\nexport interface ILobasDropdownItemProps {\r\n value: string;\r\n name: string;\r\n id: string;\r\n colorHexCode?: string;\r\n imageUrl?: string;\r\n isDisabled?: boolean;\r\n isDefault?: boolean;\r\n}\r\n\r\nexport interface ILobasDropdownOnSelectionChangeNotification {\r\n dropdownId: string;\r\n selectId: string;\r\n selectedValue: string;\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 * as React from 'react';\r\n\r\nimport { addThrottledEvent, getCSS, Flipper, ISingleSlideCarouselProps } from '@msdyn365-commerce-modules/utilities';\r\n\r\ninterface ISingleSlideCarouselState {\r\n showPrevious: boolean;\r\n showNext: boolean;\r\n offset: number;\r\n}\r\n\r\n/**\r\n * SingleSlideCarousel - yup.\r\n */\r\nexport default class LOBASSingleSlideCarousel extends React.PureComponent {\r\n private static readonly itemsSelector: string = 'msc-ss-carousel-item';\r\n\r\n private static readonly verticalItemsSelector: string = 'msc-ss-carousel-vert-item';\r\n\r\n private direction: string;\r\n\r\n private item: HTMLElement | undefined;\r\n\r\n private slide: HTMLElement | undefined;\r\n\r\n private carousel: HTMLElement | undefined;\r\n\r\n private carouselSize: number = 0;\r\n\r\n private slideSize: number = 0;\r\n\r\n private itemSize: number = 0;\r\n\r\n private resizeThrottledEventHandler?: (event: Event) => void;\r\n\r\n private readonly ref: React.RefObject;\r\n\r\n private readonly slideRef: React.RefObject;\r\n\r\n private readonly itemRef: React.RefObject;\r\n\r\n private readonly id: string;\r\n\r\n private scrollStart: number | undefined;\r\n\r\n private readonly scrollThreshold: number;\r\n\r\n private readonly flipperNextLabel: string = 'next';\r\n\r\n private readonly flipperPrevLabel: string = 'prev';\r\n\r\n constructor(props: ISingleSlideCarouselProps) {\r\n super(props);\r\n this._nextSlide = this._nextSlide.bind(this);\r\n this._previousSlide = this._previousSlide.bind(this);\r\n this._handleTouchStart = this._handleTouchStart.bind(this);\r\n this._handleTouchEnd = this._handleTouchEnd.bind(this);\r\n this._onFocus = this._onFocus.bind(this);\r\n this._onResized = this._onResized.bind(this);\r\n this.state = { showPrevious: false, showNext: false, offset: 0 };\r\n this.ref = React.createRef();\r\n this.slideRef = React.createRef();\r\n this.itemRef = React.createRef();\r\n this.direction = 'left';\r\n this.id = props.parentId || '';\r\n this.scrollThreshold = this.props.touchScrollThreshold !== undefined ? this.props.touchScrollThreshold : 100;\r\n }\r\n\r\n public componentDidUpdate(): void {\r\n this.carousel = this.ref.current!;\r\n this.slide = this.slideRef.current!;\r\n this.item = this.itemRef.current!;\r\n this._setSizes();\r\n this._updateFlippers(this.state.offset);\r\n }\r\n\r\n public componentDidMount(): void {\r\n this.direction = this.props.vertical ? 'top' : 'left';\r\n this.carousel = this.ref.current!;\r\n this.slide = this.slideRef.current!;\r\n this.item = this.itemRef.current!;\r\n this._setSizes();\r\n this.resizeThrottledEventHandler = window && addThrottledEvent(window, 'resize', this._onResized as EventListener);\r\n this._updateFlippers(0);\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n window && window.removeEventListener('resize', this.resizeThrottledEventHandler!, false);\r\n }\r\n\r\n public render(): JSX.Element {\r\n const isVert: boolean = this.props.vertical === true;\r\n const slidePositionStyle = {} as React.CSSProperties;\r\n const modifiedChildren = this._getClonedChildren(isVert);\r\n slidePositionStyle[this.direction] = `${this.state.offset}px`;\r\n const carouselClass = isVert ? 'msc-ss-carousel-vert' : 'msc-ss-carousel';\r\n const carouselSlideClass = isVert ? 'msc-ss-carousel-vert-slide' : 'msc-ss-carousel-slide';\r\n const overflowClass = isVert ? 'msc-ss-carousel-vert-strip' : 'msc-ss-carousel-strip';\r\n const previousFlipperGlyph = isVert ? 'msi-chevron-up' : 'msi-chevron-left';\r\n const nextFlipperGlyph = isVert ? 'msi-chevron-down' : 'msi-chevron-right';\r\n const previousFlipperClassName = isVert ? 'msc-ss-carousel-vert__flipper' : 'msc-ss-carousel__flipper';\r\n const nextFlipperClassName = isVert\r\n ? 'msc-ss-carousel-vert__flipper msc-ss-carousel-vert__flipper--next'\r\n : 'msc-ss-carousel__flipper msc-ss-carousel__flipper--next';\r\n const disableClassName = !this.state.showPrevious || !this.state.showNext ? 'disabled' : null;\r\n return (\r\n
\r\n
\r\n 0)}\r\n telemetryContent={this.props.telemetryContent}\r\n telemetryLabel={this.flipperNextLabel}\r\n />\r\n 0)}\r\n telemetryContent={this.props.telemetryContent}\r\n telemetryLabel={this.flipperPrevLabel}\r\n />\r\n
\r\n
\r\n \r\n {modifiedChildren}\r\n \r\n
\r\n
\r\n );\r\n }\r\n\r\n private _getClonedChildren(isVert: boolean): React.DetailedReactHTMLElement, HTMLElement>[] {\r\n return React.Children.map(this.props.children, (child: React.ReactNode, index: number) => {\r\n const castChild = (child as React.ReactChild) as React.ReactElement;\r\n if (index === 1) {\r\n return React.cloneElement(castChild, {\r\n className: `${isVert ? LOBASSingleSlideCarousel.verticalItemsSelector : LOBASSingleSlideCarousel.itemsSelector} ${\r\n castChild.props.className\r\n }`,\r\n\r\n // @ts-expect-error\r\n ref: this.itemRef,\r\n onFocus: this._onFocus\r\n });\r\n }\r\n return React.cloneElement(castChild, {\r\n className: `${isVert ? LOBASSingleSlideCarousel.verticalItemsSelector : LOBASSingleSlideCarousel.itemsSelector} ${\r\n castChild.props.className\r\n }`,\r\n\r\n // @ts-expect-error\r\n onFocus: this._onFocus\r\n });\r\n });\r\n }\r\n\r\n private _nextSlide(): void {\r\n this._moveSingleSlide(true);\r\n }\r\n\r\n private _previousSlide(): void {\r\n this._moveSingleSlide(false);\r\n }\r\n\r\n private _handleTouchStart(evt: React.TouchEvent): void {\r\n if (evt.touches.length === 0) {\r\n this.scrollStart = undefined;\r\n } else {\r\n this.scrollStart = this.props.vertical === true ? evt.touches[0].screenY : evt.touches[0].screenX;\r\n }\r\n }\r\n\r\n private _handleTouchEnd(evt: React.TouchEvent): void {\r\n if (evt.changedTouches.length > 0 && this.scrollStart !== undefined) {\r\n const newTarget: number = this.props.vertical === true ? evt.changedTouches[0].screenY : evt.changedTouches[0].screenX;\r\n\r\n const delta = newTarget - this.scrollStart;\r\n\r\n if (delta > this.scrollThreshold) {\r\n this._previousSlide();\r\n }\r\n\r\n if (delta < -this.scrollThreshold) {\r\n this._nextSlide();\r\n }\r\n }\r\n\r\n this.scrollStart = undefined;\r\n\r\n return;\r\n }\r\n\r\n private _moveSingleSlide(next: boolean): void {\r\n this._setSizes();\r\n let currentOffset = Number.parseInt(getCSS(this.slide!, this.direction), 10);\r\n const carouselSize = this.carouselSize;\r\n let maxScrollCount = Math.floor(carouselSize / this.itemSize);\r\n const directionModifier = next ? -1 : 1;\r\n currentOffset = !isNaN(currentOffset) && typeof currentOffset === 'number' ? currentOffset : 0;\r\n\r\n if (maxScrollCount === 0) {\r\n maxScrollCount = 1;\r\n }\r\n\r\n maxScrollCount = carouselSize % this.itemSize === 0 ? maxScrollCount - 1 : maxScrollCount;\r\n maxScrollCount = Math.max(maxScrollCount, 1);\r\n const maxScrollDistance = maxScrollCount * this.itemSize;\r\n let distanceToEdge = next ? this.slideSize - carouselSize + currentOffset : Math.abs(currentOffset);\r\n distanceToEdge = Math.max(0, distanceToEdge);\r\n\r\n let offset =\r\n maxScrollDistance <= distanceToEdge\r\n ? maxScrollDistance * directionModifier + currentOffset\r\n : distanceToEdge * directionModifier + currentOffset;\r\n\r\n offset = Math.round(offset / this.itemSize) * this.itemSize;\r\n\r\n this._updateFlippers(offset);\r\n }\r\n\r\n private _setSizes(): void {\r\n const item = this.item;\r\n if (item) {\r\n this.itemSize = this.props.vertical ? item.scrollHeight : item.scrollWidth;\r\n\r\n if (item.parentElement !== null && item.parentElement.children.length > 1) {\r\n this.itemSize =\r\n item.parentElement.children[1].getBoundingClientRect().left -\r\n item.parentElement.children[0].getBoundingClientRect().left;\r\n }\r\n } else {\r\n this.itemSize = 0;\r\n }\r\n\r\n this.carouselSize = this._calculateCarouselSize();\r\n this.slideSize = this.slide ? (this.props.vertical ? this.slide.scrollHeight : this.slide.scrollWidth) : 0;\r\n }\r\n\r\n private _calculateCarouselSize(): number {\r\n if (!this.carousel) {\r\n return 0;\r\n }\r\n\r\n const carouselStyle = getComputedStyle(this.carousel);\r\n\r\n const padding = this.props.vertical\r\n ? Number.parseFloat(carouselStyle.paddingTop || '') + Number.parseFloat(carouselStyle.paddingBottom || '')\r\n : Number.parseFloat(carouselStyle.paddingLeft || '') + Number.parseFloat(carouselStyle.paddingRight || '');\r\n\r\n return this.props.vertical ? this.carousel.clientHeight - padding : this.carousel.clientWidth - padding;\r\n }\r\n\r\n private _canScrollPrevious(offset: number): boolean {\r\n return !isNaN(offset) && offset !== 0;\r\n }\r\n\r\n private _canScrollNext(offset: number): boolean {\r\n if (this.carouselSize + Math.abs(offset) >= this.slideSize - 1) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n private _updateFlippers(offset: number): void {\r\n this.setState({\r\n showPrevious: this._canScrollPrevious(offset),\r\n showNext: this._canScrollNext(offset),\r\n offset\r\n });\r\n }\r\n\r\n private _scrollItemIntoView(item: HTMLElement): void {\r\n const carouselSize = this.carouselSize;\r\n let offset = this.props.vertical ? item.offsetTop : item.offsetLeft;\r\n let updateOffset = false;\r\n\r\n const left = Number.parseInt(getCSS(this.slide!, 'left'), 10) || 0;\r\n const top = Number.parseInt(getCSS(this.slide!, 'top'), 10) || 0;\r\n\r\n if (this.props.vertical) {\r\n if (top < 0 && -top > offset) {\r\n if (offset !== 0) {\r\n offset = -offset + 1;\r\n }\r\n updateOffset = true;\r\n } else if (top + offset > carouselSize - this.itemSize) {\r\n offset = carouselSize - this.itemSize - offset - 1;\r\n updateOffset = true;\r\n }\r\n } else if (this.direction === 'left') {\r\n if (left < 0 && -left > offset) {\r\n if (offset !== 0) {\r\n offset = -offset + 1;\r\n }\r\n updateOffset = true;\r\n } else if (left + offset > carouselSize - this.itemSize) {\r\n offset = carouselSize - this.itemSize - offset + 19;\r\n updateOffset = true;\r\n }\r\n }\r\n\r\n if (updateOffset) {\r\n this._updateFlippers(offset);\r\n\r\n if (this.props.vertical) {\r\n setTimeout(() => {\r\n (this.slide as Node).parentElement!.scrollTop = 0;\r\n }, 0);\r\n } else {\r\n setTimeout(() => {\r\n (this.slide as Node).parentElement!.scrollLeft = 0;\r\n }, 0);\r\n }\r\n }\r\n }\r\n\r\n private _onFocus(event: React.FocusEvent): void {\r\n const target = event.currentTarget as HTMLElement;\r\n this._scrollItemIntoView(target);\r\n }\r\n\r\n private _onCarouselResized(): void {\r\n this._setSizes();\r\n let offset = Number.parseInt(getCSS(this.slide!, this.direction), 10);\r\n\r\n // Ensure the carousel slide fits across the entire alotted space\r\n if (!isNaN(offset) && offset < 0 && this.slideSize + offset < this.carouselSize) {\r\n offset = Math.min(0, this.carouselSize - this.slideSize);\r\n }\r\n\r\n this._updateFlippers(offset);\r\n }\r\n\r\n private readonly _onResized = (): void => {\r\n this._onCarouselResized();\r\n };\r\n}\r\n","/* eslint-disable no-debugger */\r\n/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */\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\n//import { ISwatchItem, SwatchComponent } from '@msdyn365-commerce/components';\r\nimport { /*DimensionTypes,*/ ArrayExtensions, getFallbackImageUrl /*, ObjectExtensions*/ } from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n /*getPayloadObject, getTelemetryAttributes, IPayLoad,*/ INodeProps,\r\n NodeTag,\r\n Node,\r\n ISingleSlideCarouselProps,\r\n IComponentNodeProps\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport { IImageData, IImageSettings, Image } from '@msdyn365-commerce/core';\r\nimport { /*ILobasDropdownItemProps,*/ ILobasDropdownProps /*, LobasSelectionType*/ } from './lobas-dropdown.props';\r\nimport classnames from 'classnames';\r\nimport { IDropdownState } from '../dropdown-state';\r\nimport LOBASSingleSlideCarousel from '../../../components/lobas-single-slide-carousel';\r\n\r\n/**\r\n * IMediaGalleryThumbnailsViewProps Interface.\r\n */\r\nexport interface IMediaGalleryThumbnailsViewProps {\r\n ThumbnailsContainerProps: INodeProps;\r\n SingleSlideCarouselComponentProps: INodeProps;\r\n items?: IMediaGalleryThumbnailItemViewProps[];\r\n}\r\n\r\n/**\r\n * IMediaGalleryThumbnailItemViewProps Interface.\r\n */\r\nexport interface IMediaGalleryThumbnailItemViewProps {\r\n ThumbnailItemContainerProps: INodeProps;\r\n Picture: React.ReactElement;\r\n}\r\n\r\n/**\r\n * Props for carousel.\r\n */\r\ninterface IMediaGalleryCarouselItems {\r\n items: ItemType[];\r\n keys: (string | undefined)[];\r\n}\r\n\r\n/**\r\n *\r\n * DropDown component.\r\n * @extends {React.PureComponent}\r\n */\r\nexport class LobasDropdown extends React.PureComponent {\r\n //private readonly selectMenu: React.RefObject = React.createRef();\r\n\r\n //private readonly payLoad: IPayLoad;\r\n\r\n private fallbackImage?: string;\r\n\r\n private readonly defaultThumbnailImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: 'w=100&m=8', w: 100, h: 0 },\r\n lg: { q: 'w=100&m=8', w: 100, h: 0 }\r\n },\r\n lazyload: false,\r\n disableLazyLoad: true,\r\n cropFocalRegion: true\r\n };\r\n\r\n public constructor(props: ILobasDropdownProps, state: IDropdownState) {\r\n super(props);\r\n\r\n const selectedItem = this.props.dropdownList.find(item => item.isDefault);\r\n if (selectedItem) {\r\n this.state = {\r\n selectedIndex: selectedItem.id\r\n };\r\n if (this.props.onChange) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises -- Update for default.\r\n this.props.onChange({\r\n dropdownId: this.props.dropdownId,\r\n selectId: selectedItem.id,\r\n selectedValue: selectedItem.value\r\n });\r\n }\r\n } else {\r\n this.state = {\r\n selectedIndex: ''\r\n };\r\n }\r\n //this.payLoad = getPayloadObject('click', props.telemetryContent!, this.props.dropdownName);\r\n }\r\n\r\n public render(): JSX.Element {\r\n if (this.props.product) {\r\n this.fallbackImage = getFallbackImageUrl(this.props.product.ItemId, this.props.context.request.apiSettings);\r\n }\r\n\r\n return this._renderDropdown();\r\n }\r\n\r\n private _renderDropdown(): JSX.Element {\r\n //const { dropdownId, dropdownList, dropdownName, dropdownToggleName } = this.props;\r\n //const attribute = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\r\n const mediaGalleryThumbnailCarouselItems = this._getMediaGalleryThumbnailItems();\r\n\r\n const Thumbnails: IMediaGalleryThumbnailsViewProps = {\r\n ThumbnailsContainerProps: { className: 'ms-media-gallery__thumbnails-container' },\r\n SingleSlideCarouselComponentProps: {\r\n tag: LOBASSingleSlideCarousel,\r\n className: 'ms-media-gallery__thumbnails',\r\n vertical: false,\r\n flipperPrevLabel: '', //resources.previousScreenshotFlipperText,\r\n flipperNextLabel: '', //resources.nextScreenshotFlipperText,\r\n parentId: this.props.dropdownId,\r\n useTabList: true,\r\n key: JSON.stringify(mediaGalleryThumbnailCarouselItems.keys)\r\n } as IComponentNodeProps,\r\n items: mediaGalleryThumbnailCarouselItems.items\r\n };\r\n\r\n /*return (\r\n \r\n \r\n {dropdownList.map(\r\n (item: ILobasDropdownItemProps) =>\r\n item && (\r\n \r\n {item.value}\r\n \r\n )\r\n )}\r\n \r\n );*/\r\n return this._renderThumbnails(Thumbnails);\r\n }\r\n\r\n /*private _renderSwatch(): JSX.Element {\r\n const swatchItems = this.props.dropdownList.map(item => {\r\n return {\r\n ...item,\r\n itemId: item.id,\r\n dimensionType: this.props.dropdownName as DimensionTypes\r\n };\r\n });\r\n return ;\r\n }*/\r\n\r\n /**\r\n * Updates state on swatch selection.\r\n * @param item - Selected swatch item.\r\n */\r\n /*private readonly _selectSwatch = async (item: ISwatchItem) => {\r\n this.setState({ selectedIndex: item.itemId });\r\n\r\n if (this.props.onChange) {\r\n await this.props.onChange({\r\n dropdownId: this.props.dropdownId,\r\n selectId: item.itemId,\r\n selectedValue: item.value\r\n });\r\n }\r\n };*/\r\n\r\n /*private readonly _onChanged = async (event: React.ChangeEvent) => {\r\n this.setState({ selectedIndex: event.target.value });\r\n\r\n if (this.props.onChange) {\r\n await this.props.onChange({\r\n dropdownId: this.props.dropdownId,\r\n selectId: event.target.value,\r\n selectedValue: event.target.innerText\r\n });\r\n }\r\n };*/\r\n\r\n private readonly _onClicked = async (id: string, value: string) => {\r\n this.setState({ selectedIndex: id });\r\n\r\n if (this.props.onChange) {\r\n await this.props.onChange({\r\n dropdownId: this.props.dropdownId,\r\n selectId: id,\r\n selectedValue: value\r\n });\r\n }\r\n\r\n return (event: React.MouseEvent) => {\r\n event.preventDefault();\r\n };\r\n };\r\n\r\n private _renderThumbnails = (thumbnails: IMediaGalleryThumbnailsViewProps): JSX.Element => {\r\n const { ThumbnailsContainerProps, SingleSlideCarouselComponentProps, items } = thumbnails;\r\n\r\n return (\r\n \r\n {items && items.map(this._renderThumbnailItem)}\r\n \r\n );\r\n };\r\n\r\n private _renderThumbnailItem = (thumbnail: IMediaGalleryThumbnailItemViewProps): JSX.Element => {\r\n const { ThumbnailItemContainerProps, Picture } = thumbnail;\r\n\r\n return {Picture};\r\n };\r\n\r\n private readonly _getThumbnailItem = (\r\n image: IImageData,\r\n imageSettings: IImageSettings,\r\n index: string,\r\n id: string,\r\n value: string,\r\n tabIndex: number,\r\n modifiedActiveIndex?: string\r\n ): IMediaGalleryThumbnailItemViewProps => {\r\n const classes = classnames(\r\n 'ms-media-gallery__thumbnail-item',\r\n modifiedActiveIndex === index ? 'ms-media-gallery__thumbnail-item-active' : ''\r\n );\r\n\r\n return {\r\n ThumbnailItemContainerProps: {\r\n tag: 'li' as NodeTag,\r\n className: classes,\r\n role: 'tab',\r\n tabIndex: tabIndex,\r\n key: index,\r\n 'aria-label': image.altText,\r\n 'aria-selected': modifiedActiveIndex === index,\r\n onClick: () => this._onClicked(id, value)\r\n },\r\n Picture: (\r\n \r\n )\r\n };\r\n };\r\n\r\n private _getMediaGalleryThumbnailItems(): IMediaGalleryCarouselItems {\r\n const itemId = this.props.product?.ItemId ?? '';\r\n const mediaGalleryItems: IImageData[] = this.props.dropdownList.map(dropdown => {\r\n return {\r\n src: `${this.props.context.request.apiSettings.baseImageUrl}Products/${itemId} ^ ${dropdown.name}_000_001.png`,\r\n altText: dropdown.id\r\n };\r\n });\r\n\r\n const thumbnailImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: {\r\n w: 100,\r\n h: 0,\r\n q: 'w=100&h=0&q=80&m=6&f=png',\r\n qe: 't=w100qhigh'\r\n },\r\n sm: {\r\n w: 100,\r\n h: 0,\r\n q: 'w=100&h=0&q=80&m=6&f=png',\r\n qe: 't=w100qhigh'\r\n },\r\n lg: {\r\n w: 100,\r\n h: 0,\r\n q: 'w=100&h=0&q=80&m=6&f=png',\r\n qe: 't=w100qhigh'\r\n },\r\n xl: {\r\n w: 100,\r\n h: 0,\r\n q: 'w=100&h=0&q=80&m=6&f=png',\r\n qe: 't=w100qhigh'\r\n }\r\n },\r\n lazyload: false,\r\n disableLazyLoad: true,\r\n cropFocalRegion: true\r\n };\r\n\r\n if (thumbnailImageSettings) {\r\n thumbnailImageSettings.cropFocalRegion = true;\r\n }\r\n\r\n const hasMediaGalleryItems = ArrayExtensions.hasElements(mediaGalleryItems);\r\n\r\n if (!hasMediaGalleryItems) {\r\n return { items: [], keys: [] };\r\n }\r\n\r\n return {\r\n items: [\r\n ...mediaGalleryItems!.map((item: IImageData, index: number) =>\r\n this._getThumbnailItem(\r\n item,\r\n thumbnailImageSettings ?? this.defaultThumbnailImageSettings,\r\n this.props.dropdownList[index].id,\r\n this.props.dropdownList[index].id,\r\n this.props.dropdownList[index].value,\r\n index,\r\n this.props.dropdownList.find(item => item.isDefault)?.id\r\n )\r\n )\r\n ],\r\n keys: [...mediaGalleryItems!.map(item => item.src)]\r\n };\r\n }\r\n\r\n /*private _getEmptyThumbnailItem(\r\n imageSettings: IImageSettings | undefined,\r\n index: number,\r\n modifiedActiveIndex: number\r\n ): IMediaGalleryThumbnailItemViewProps {\r\n const classes = classnames(\r\n 'ms-media-gallery__thumbnail-item',\r\n modifiedActiveIndex === index ? 'ms-media-gallery__thumbnail-item-active' : ''\r\n );\r\n return {\r\n ThumbnailItemContainerProps: {\r\n tag: 'li' as NodeTag,\r\n className: classes,\r\n role: 'tab',\r\n tabIndex: 0,\r\n key: 'empty',\r\n 'aria-label': '',\r\n 'aria-selected': modifiedActiveIndex === index,\r\n onClick: this._onClicked('', '')\r\n },\r\n Picture: (\r\n \r\n )\r\n };\r\n }*/\r\n}\r\n","/* eslint-disable no-debugger */\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 { ICoreContext } from '@msdyn365-commerce/core-internal';\r\nimport { ProductDimension, ProductDimensionType, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ArrayExtensions,\r\n convertProductDimensionTypeToDimensionTypes,\r\n DimensionTypes,\r\n getDimensionValuesFromQuery,\r\n getInventoryLevelCodeFromDimensionValue,\r\n IDimensionForSelectedVariant,\r\n IDimensionsApp,\r\n IDimensionValueForSelectedVariant,\r\n InventoryLevelValues,\r\n ObjectExtensions\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { format, getTelemetryObject, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport {\r\n IBuyboxCallbacks,\r\n IBuyboxCommonData,\r\n IBuyboxCommonResources,\r\n IBuyboxExtentedProps,\r\n IBuyboxProductConfigureDropdownViewProps,\r\n IBuyboxProductConfigureViewProps,\r\n IBuyboxState,\r\n IProductDetails\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport { LobasDropdown, ILobasDropdownItemProps, ILobasDropdownOnSelectionChangeNotification, LobasSelectionType } from './lobas-dropdown';\r\n\r\nlet telemetryContent: ITelemetryContent;\r\n\r\n/**\r\n * Dimension pre-processing info.\r\n */\r\ninterface IProductDimensionInfo {\r\n dropdownName: string;\r\n dropdownId: string;\r\n dropdownList: ILobasDropdownItemProps[];\r\n}\r\n\r\n/**\r\n * Props for rendering a dropdown.\r\n */\r\ninterface IProductDimensionDropdownProps extends IProductDimensionInfo {\r\n resources: IBuyboxCommonResources;\r\n className: string;\r\n context: ICoreContext;\r\n product: SimpleProduct | null | undefined;\r\n configureErrors: { [configureId: string]: string | undefined };\r\n\r\n getDropdownName(dimensionType: number, resources: IBuyboxCommonResources): string;\r\n dropdownCallback(notification: ILobasDropdownOnSelectionChangeNotification): Promise;\r\n}\r\n\r\nconst mapProductDimensionFullToDropdownViewProps = (props: IProductDimensionDropdownProps): IBuyboxProductConfigureDropdownViewProps => {\r\n const dimensionId = Number.parseInt(props.dropdownId, 10) as ProductDimensionType;\r\n const dropdownToggleName = format(props.resources.selectDimensionFormatString, props.dropdownName);\r\n\r\n const errorMessage = props.configureErrors[props.dropdownId];\r\n\r\n let dimensionSelectionType = LobasSelectionType.dropdown;\r\n\r\n const dimensionType = convertProductDimensionTypeToDimensionTypes(dimensionId);\r\n\r\n const dimensionsAsSwatchConfiguration = props.context.app.config.dimensionsAsSwatchType;\r\n if (\r\n ArrayExtensions.hasElements(dimensionsAsSwatchConfiguration) &&\r\n !dimensionsAsSwatchConfiguration.includes(DimensionTypes.none) &&\r\n dimensionsAsSwatchConfiguration.includes(dimensionType)\r\n ) {\r\n dimensionSelectionType = LobasSelectionType.swatch;\r\n }\r\n\r\n return {\r\n ContainerProps: {\r\n className: `ms-media-gallery`\r\n },\r\n LabelContainerProps: {\r\n tag: 'label',\r\n className: `${props.className}__dropdown-quantity-label`,\r\n htmlFor: `${props.className}__dropown-quantity-input-${props.dropdownId}`\r\n },\r\n errors: errorMessage && (\r\n \r\n \r\n ),\r\n heading:
{props.dropdownName}
,\r\n select: (\r\n \r\n )\r\n };\r\n};\r\n\r\nexport function getLobasBuyboxProductConfigure(\r\n props: IBuyboxExtentedProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks,\r\n productDetails?: IProductDetails,\r\n selectedDimensions?: ProductDimension[]\r\n): IBuyboxProductConfigureViewProps | undefined {\r\n const { resources, typeName } = props;\r\n\r\n const {\r\n errorState: { configureErrors }\r\n } = state;\r\n\r\n const { getDropdownName } = callbacks;\r\n\r\n const context = props.context as ICoreContext;\r\n\r\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\r\n const product = props.data.product?.result ? props.data.product.result : productDetails?.product;\r\n\r\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\r\n const productDimensionsData = props.data.productDimensions?.result ?? productDetails?.productDimensions;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access -- app context is generic\r\n const enableStockCheck = props.context.app.config.enableStockCheck;\r\n\r\n const hasProductDimensions = ArrayExtensions.hasElements(productDimensionsData);\r\n\r\n if (!product || !hasProductDimensions) {\r\n return undefined;\r\n }\r\n\r\n const className = _getClassNamePrefix(typeName);\r\n\r\n const onChanged = async (notification: ILobasDropdownOnSelectionChangeNotification) =>\r\n _onChanged(notification, callbacks.dimensionSelectedAsync);\r\n\r\n telemetryContent = getTelemetryObject(context.request.telemetryPageName!, props.typeName, props.telemetry);\r\n\r\n const inventoryLevel = context.app.config.inventoryLevel;\r\n\r\n let dimensionsInfo: IProductDimensionInfo[] = [];\r\n\r\n const productDimensions = productDimensionsData as IDimensionForSelectedVariant[];\r\n\r\n dimensionsInfo = productDimensions.map(productDimensionFull => {\r\n const dropdownName = getDropdownName(productDimensionFull.DimensionTypeValue, resources);\r\n const dropdownId = productDimensionFull.DimensionTypeValue.toString();\r\n\r\n const dimensions = (productDimensionFull.dimensionValuesWithInventory ??\r\n productDimensionFull.DimensionValues ??\r\n []) as IDimensionValueForSelectedVariant[];\r\n const validProductDimensionsFull = dimensions.filter(\r\n value => !ObjectExtensions.isNullOrUndefined(value.DimensionValue?.RecordId ?? value.RecordId)\r\n );\r\n\r\n const dropdownList: ILobasDropdownItemProps[] = validProductDimensionsFull.map(\r\n dimensionValuesWithInventory => {\r\n const dimensionValue = dimensionValuesWithInventory.DimensionValue ?? dimensionValuesWithInventory;\r\n const inventoryLevelCode = getInventoryLevelCodeFromDimensionValue(dimensionValuesWithInventory, inventoryLevel);\r\n return {\r\n value: dimensionValue.Value ?? '',\r\n name: dimensionValue.DimensionId ?? '',\r\n id: dimensionValue.RecordId.toString(),\r\n colorHexCode: dimensionValue.ColorHexCode,\r\n imageUrl: dimensionValue.ImageUrl,\r\n isDisabled: enableStockCheck && inventoryLevelCode === InventoryLevelValues.outOfStock,\r\n swatchItemAriaLabel: resources.swatchItemAriaLabel ? resources.swatchItemAriaLabel : ''\r\n };\r\n }\r\n );\r\n return {\r\n dropdownName,\r\n dropdownId,\r\n dropdownList\r\n };\r\n });\r\n\r\n const matchedDimensions = selectedDimensions ?? getDimensionValuesFromQuery(context.request.url.requestUrl);\r\n for (const dimensionInfo of dimensionsInfo) {\r\n const currentDimensionsFromQuery = matchedDimensions.filter(\r\n dimensionFromQuery => dimensionFromQuery.DimensionTypeValue.toString() === dimensionInfo.dropdownId\r\n );\r\n if (!ArrayExtensions.hasElements(currentDimensionsFromQuery)) {\r\n continue;\r\n }\r\n const currentDimensionFromQuery = currentDimensionsFromQuery[0];\r\n const selectedDimensionItem = dimensionInfo.dropdownList.filter(\r\n dimensionItem =>\r\n dimensionItem.value.toLocaleLowerCase() === currentDimensionFromQuery.DimensionValue?.Value?.toLocaleLowerCase()\r\n );\r\n if (!ArrayExtensions.hasElements(selectedDimensionItem)) {\r\n continue;\r\n }\r\n selectedDimensionItem[0].isDefault = true;\r\n }\r\n\r\n const dropdowns: IBuyboxProductConfigureDropdownViewProps[] = dimensionsInfo.map(dimensionInfo => {\r\n return mapProductDimensionFullToDropdownViewProps({\r\n ...dimensionInfo,\r\n resources,\r\n configureErrors,\r\n getDropdownName,\r\n dropdownCallback: onChanged,\r\n className,\r\n context,\r\n product\r\n });\r\n });\r\n\r\n return {\r\n ContainerProps: {\r\n className: `${className}__configure`\r\n },\r\n dropdowns\r\n };\r\n}\r\n\r\nconst _onChanged = async (\r\n notification: ILobasDropdownOnSelectionChangeNotification,\r\n dimensionChanged: (newValue: number, selectedDimensionValue: string) => Promise\r\n): Promise => {\r\n await dimensionChanged(+notification.dropdownId, notification.selectId);\r\n};\r\n\r\nconst _getClassNamePrefix = (typeName: string): string => {\r\n return typeName.toLocaleLowerCase() === 'quickview' ? 'ms-quickView' : 'ms-buybox';\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 { ICommerceApiSettings } from '@msdyn365-commerce/core-internal';\r\nimport { ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\n\r\n/**\r\n * Specifies the type of selection.\r\n */\r\nexport enum SelectionType {\r\n dropdown = 0,\r\n swatch = 1\r\n}\r\n\r\n/**\r\n * Copyright (c) 2018 Microsoft Corporation.\r\n */\r\nexport interface IDropdownProps {\r\n /**\r\n * Specifies the type of selection. Dropdown by default.\r\n */\r\n selectionType?: SelectionType;\r\n\r\n /**\r\n * @friendlyName dropdownId\r\n * @description Id for dropdown component.\r\n */\r\n dropdownId: string;\r\n\r\n /**\r\n * @friendlyName dropdownName\r\n * @description Name of the dropdown component.\r\n */\r\n dropdownName: string;\r\n\r\n /**\r\n * @friendlyName dropdownList\r\n * @description List of items in dropdown.\r\n */\r\n dropdownList: IDropdownItemProps[];\r\n\r\n /**\r\n * @friendlyName dropdownToggleName\r\n * @description Name to use for the toggle when nothing is selected.\r\n */\r\n dropdownToggleName: string;\r\n\r\n /**\r\n * @telemetryContent telemetryContent\r\n * @description Telemetry content.\r\n */\r\n telemetryContent?: ITelemetryContent;\r\n\r\n apiSettings?: ICommerceApiSettings;\r\n\r\n /**\r\n * @friendlyName onChange\r\n * @description Callback that gets fired when when a selected dimension changes.\r\n */\r\n onChange?(notification: IDropdownOnSelectionChangeNotification): Promise;\r\n}\r\n\r\nexport interface IDropdownItemProps {\r\n value: string;\r\n id: string;\r\n colorHexCode?: string;\r\n imageUrl?: string;\r\n isDisabled?: boolean;\r\n isDefault?: boolean;\r\n}\r\n\r\nexport interface IDropdownOnSelectionChangeNotification {\r\n dropdownId: string;\r\n selectId: string;\r\n selectedValue: string;\r\n}\r\n","/* eslint-disable no-debugger */\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 { ISwatchItem, SwatchComponent } from '@msdyn365-commerce/components';\r\nimport { DimensionTypes } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getPayloadObject, getTelemetryAttributes, IPayLoad } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IDropdownItemProps, IDropdownProps, SelectionType } from './dropdown.props';\r\nimport { IDropdownState } from '../dropdown-state';\r\n\r\n/**\r\n *\r\n * DropDown component.\r\n * @extends {React.PureComponent}\r\n */\r\nexport class Dropdown extends React.PureComponent {\r\n private readonly selectMenu: React.RefObject = React.createRef();\r\n\r\n private readonly payLoad: IPayLoad;\r\n\r\n public constructor(props: IDropdownProps, state: IDropdownState) {\r\n super(props);\r\n\r\n const selectedItem = this.props.dropdownList.find(item => item.isDefault);\r\n\r\n if (selectedItem) {\r\n this.state = {\r\n selectedIndex: selectedItem.id\r\n };\r\n if (this.props.onChange) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises -- Update for default.\r\n this.props.onChange({\r\n dropdownId: this.props.dropdownId,\r\n selectId: selectedItem.id,\r\n selectedValue: selectedItem.value\r\n });\r\n }\r\n } else {\r\n this.state = {\r\n selectedIndex: ''\r\n };\r\n }\r\n this.payLoad = getPayloadObject('click', props.telemetryContent!, this.props.dropdownName);\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: IDropdownProps, nextState: IDropdownState): boolean {\r\n if (this.state === nextState && this.props === nextProps) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n public render(): JSX.Element {\r\n if (this.props.apiSettings && this.props.selectionType === SelectionType.swatch) {\r\n return this._renderSwatch();\r\n }\r\n\r\n return this._renderDropdown();\r\n }\r\n\r\n private _renderDropdown(): JSX.Element {\r\n const { dropdownId, dropdownList, dropdownName, dropdownToggleName } = this.props;\r\n const attribute = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\r\n const selectedItem = this.props.dropdownList.find(item => item.isDefault);\r\n\r\n return (\r\n \r\n \r\n {dropdownToggleName}\r\n \r\n {dropdownList.map(\r\n (item: IDropdownItemProps, index: number) =>\r\n item && (\r\n \r\n {item.value}\r\n \r\n )\r\n )}\r\n \r\n );\r\n }\r\n\r\n private _renderSwatch(): JSX.Element {\r\n const swatchItems = this.props.dropdownList.map(item => {\r\n return {\r\n ...item,\r\n itemId: item.id,\r\n dimensionType: this.props.dropdownName as DimensionTypes\r\n };\r\n });\r\n return ;\r\n }\r\n\r\n /**\r\n * Updates state on swatch selection.\r\n * @param item - Selected swatch item.\r\n */\r\n private readonly _selectSwatch = async (item: ISwatchItem) => {\r\n this.setState({ selectedIndex: item.itemId });\r\n\r\n if (this.props.onChange) {\r\n await this.props.onChange({\r\n dropdownId: this.props.dropdownId,\r\n selectId: item.itemId,\r\n selectedValue: item.value\r\n });\r\n }\r\n };\r\n\r\n private readonly _onChanged = async (event: React.ChangeEvent) => {\r\n this.setState({ selectedIndex: event.target.value });\r\n\r\n if (this.props.onChange) {\r\n await this.props.onChange({\r\n dropdownId: this.props.dropdownId,\r\n selectId: event.target.value,\r\n selectedValue: event.target.innerText\r\n });\r\n }\r\n };\r\n}\r\n","/* eslint-disable no-debugger */\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 { ICoreContext } from '@msdyn365-commerce/core-internal';\r\nimport { ProductDimension, ProductDimensionType } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ArrayExtensions,\r\n convertProductDimensionTypeToDimensionTypes,\r\n DimensionTypes,\r\n getDimensionValuesFromQuery,\r\n getInventoryLevelCodeFromDimensionValue,\r\n IDimensionForSelectedVariant,\r\n IDimensionsApp,\r\n IDimensionValueForSelectedVariant,\r\n InventoryLevelValues,\r\n ObjectExtensions\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { format, getTelemetryObject, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport {\r\n IBuyboxCallbacks,\r\n IBuyboxCommonData,\r\n IBuyboxCommonResources,\r\n IBuyboxExtentedProps,\r\n IBuyboxProductConfigureDropdownViewProps,\r\n IBuyboxProductConfigureViewProps,\r\n IBuyboxState,\r\n IProductDetails\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport { Dropdown, IDropdownItemProps, IDropdownOnSelectionChangeNotification, SelectionType } from './dropdown';\r\n\r\nlet telemetryContent: ITelemetryContent;\r\n\r\n/**\r\n * Dimension pre-processing info.\r\n */\r\ninterface IProductDimensionInfo {\r\n dropdownName: string;\r\n dropdownId: string;\r\n dropdownList: IDropdownItemProps[];\r\n}\r\n\r\n/**\r\n * Props for rendering a dropdown.\r\n */\r\ninterface IProductDimensionDropdownProps extends IProductDimensionInfo {\r\n resources: IBuyboxCommonResources;\r\n className: string;\r\n context: ICoreContext;\r\n\r\n configureErrors: { [configureId: string]: string | undefined };\r\n\r\n getDropdownName(dimensionType: number, resources: IBuyboxCommonResources): string;\r\n dropdownCallback(notification: IDropdownOnSelectionChangeNotification): Promise;\r\n}\r\n\r\nconst mapProductDimensionFullToDropdownViewProps = (props: IProductDimensionDropdownProps): IBuyboxProductConfigureDropdownViewProps => {\r\n const dimensionId = Number.parseInt(props.dropdownId, 10) as ProductDimensionType;\r\n const dropdownToggleName = format(props.resources.selectDimensionFormatString, props.dropdownName);\r\n\r\n const errorMessage = props.configureErrors[props.dropdownId];\r\n\r\n let dimensionSelectionType = SelectionType.dropdown;\r\n\r\n const dimensionType = convertProductDimensionTypeToDimensionTypes(dimensionId);\r\n\r\n const dimensionsAsSwatchConfiguration = props.context.app.config.dimensionsAsSwatchType;\r\n if (\r\n ArrayExtensions.hasElements(dimensionsAsSwatchConfiguration) &&\r\n !dimensionsAsSwatchConfiguration.includes(DimensionTypes.none) &&\r\n dimensionsAsSwatchConfiguration.includes(dimensionType)\r\n ) {\r\n dimensionSelectionType = SelectionType.swatch;\r\n }\r\n\r\n return {\r\n ContainerProps: {\r\n className: `${props.className}__dropdown`\r\n },\r\n LabelContainerProps: {\r\n tag: 'label',\r\n className: `${props.className}__dropdown-quantity-label`,\r\n htmlFor: `${props.className}__dropown-quantity-input-${props.dropdownId}`\r\n },\r\n errors: errorMessage && (\r\n \r\n \r\n ),\r\n heading:
{props.dropdownName}
,\r\n select: (\r\n \r\n )\r\n };\r\n};\r\n\r\nexport function getBuyboxProductConfigure(\r\n props: IBuyboxExtentedProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks,\r\n productDetails?: IProductDetails,\r\n selectedDimensions?: ProductDimension[]\r\n): IBuyboxProductConfigureViewProps | undefined {\r\n const { resources, typeName } = props;\r\n\r\n const {\r\n errorState: { configureErrors }\r\n } = state;\r\n\r\n const { getDropdownName } = callbacks;\r\n\r\n const context = props.context as ICoreContext;\r\n\r\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\r\n const product = props.data.product?.result ? props.data.product.result : productDetails?.product;\r\n\r\n // Since the data action can return no value, and the type is non-nullable due to backward compatibility reasons, the null check is required.\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\r\n const productDimensionsData = props.data.productDimensions?.result ?? productDetails?.productDimensions;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access -- app context is generic\r\n const enableStockCheck = props.context.app.config.enableStockCheck;\r\n\r\n const hasProductDimensions = ArrayExtensions.hasElements(productDimensionsData);\r\n\r\n if (!product || !hasProductDimensions) {\r\n return undefined;\r\n }\r\n\r\n const className = _getClassNamePrefix(typeName);\r\n\r\n const onChanged = async (notification: IDropdownOnSelectionChangeNotification) =>\r\n _onChanged(notification, callbacks.dimensionSelectedAsync);\r\n\r\n telemetryContent = getTelemetryObject(context.request.telemetryPageName!, props.typeName, props.telemetry);\r\n\r\n const inventoryLevel = context.app.config.inventoryLevel;\r\n\r\n let dimensionsInfo: IProductDimensionInfo[] = [];\r\n\r\n const productDimensions = productDimensionsData as IDimensionForSelectedVariant[];\r\n\r\n dimensionsInfo = productDimensions.map(productDimensionFull => {\r\n const dropdownName = getDropdownName(productDimensionFull.DimensionTypeValue, resources);\r\n const dropdownId = productDimensionFull.DimensionTypeValue.toString();\r\n\r\n const dimensions = (productDimensionFull.dimensionValuesWithInventory ??\r\n productDimensionFull.DimensionValues ??\r\n []) as IDimensionValueForSelectedVariant[];\r\n const validProductDimensionsFull = dimensions.filter(\r\n value => !ObjectExtensions.isNullOrUndefined(value.DimensionValue?.RecordId ?? value.RecordId)\r\n );\r\n\r\n const dropdownList: IDropdownItemProps[] = validProductDimensionsFull.map(dimensionValuesWithInventory => {\r\n const dimensionValue = dimensionValuesWithInventory.DimensionValue ?? dimensionValuesWithInventory;\r\n const inventoryLevelCode = getInventoryLevelCodeFromDimensionValue(dimensionValuesWithInventory, inventoryLevel);\r\n return {\r\n value: dimensionValue.Value ?? '',\r\n id: dimensionValue.RecordId.toString(),\r\n colorHexCode: dimensionValue.ColorHexCode,\r\n imageUrl: dimensionValue.ImageUrl,\r\n isDisabled: enableStockCheck && inventoryLevelCode === InventoryLevelValues.outOfStock,\r\n swatchItemAriaLabel: resources.swatchItemAriaLabel ? resources.swatchItemAriaLabel : ''\r\n };\r\n });\r\n return {\r\n dropdownName,\r\n dropdownId,\r\n dropdownList\r\n };\r\n });\r\n\r\n const matchedDimensions = selectedDimensions ?? getDimensionValuesFromQuery(context.request.url.requestUrl);\r\n for (const dimensionInfo of dimensionsInfo) {\r\n const currentDimensionsFromQuery = matchedDimensions.filter(\r\n dimensionFromQuery => dimensionFromQuery.DimensionTypeValue.toString() === dimensionInfo.dropdownId\r\n );\r\n if (!ArrayExtensions.hasElements(currentDimensionsFromQuery)) {\r\n continue;\r\n }\r\n const currentDimensionFromQuery = currentDimensionsFromQuery[0];\r\n const selectedDimensionItem = dimensionInfo.dropdownList.filter(\r\n dimensionItem =>\r\n dimensionItem.value.toLocaleLowerCase() === currentDimensionFromQuery.DimensionValue?.Value?.toLocaleLowerCase()\r\n );\r\n if (!ArrayExtensions.hasElements(selectedDimensionItem)) {\r\n continue;\r\n }\r\n selectedDimensionItem[0].isDefault = true;\r\n }\r\n\r\n const dropdowns: IBuyboxProductConfigureDropdownViewProps[] = dimensionsInfo.map(dimensionInfo => {\r\n return mapProductDimensionFullToDropdownViewProps({\r\n ...dimensionInfo,\r\n resources,\r\n configureErrors,\r\n getDropdownName,\r\n dropdownCallback: onChanged,\r\n className,\r\n context\r\n });\r\n });\r\n\r\n return {\r\n ContainerProps: {\r\n className: `${className}__configure`\r\n },\r\n dropdowns\r\n };\r\n}\r\n\r\nconst _onChanged = async (\r\n notification: IDropdownOnSelectionChangeNotification,\r\n dimensionChanged: (newValue: number, selectedDimensionValue: string) => Promise\r\n): Promise => {\r\n await dimensionChanged(+notification.dropdownId, notification.selectId);\r\n};\r\n\r\nconst _getClassNamePrefix = (typeName: string): string => {\r\n return typeName.toLocaleLowerCase() === 'quickview' ? 'ms-quickView' : 'ms-buybox';\r\n};\r\n","/* eslint-disable @typescript-eslint/no-floating-promises */\r\n/* eslint-disable security/detect-object-injection */\r\n/* eslint-disable no-debugger */\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 { getCatalogId, ICoreContext, msdyn365Commerce } from '@msdyn365-commerce/core-internal';\r\nimport {\r\n CommerceProperty,\r\n ProductCatalog,\r\n ProductDeliveryOptions,\r\n ProductDimensionValue,\r\n ProductDimensionValueInventoryAvailability,\r\n ProductPrice,\r\n ReleasedProductType,\r\n SimpleProduct\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { BulkPurchase } from '@msdyn365-commerce-modules/bulk-purchase';\r\nimport {\r\n ArrayExtensions,\r\n DeliveryMode,\r\n FinitePromiseQueue,\r\n FinitePromiseQueueError,\r\n getDeliveryOptionsForSelectedVariant,\r\n GetDeliveryOptionsForSelectedVariantInput,\r\n getDimensionsForSelectedVariant,\r\n GetDimensionsForSelectedVariantInput,\r\n getInventoryLevelCodeFromDimensionValue,\r\n getPriceForSelectedVariant,\r\n getProductAvailabilitiesForSelectedVariant,\r\n getSelectedVariant,\r\n IDimensionsApp,\r\n IDimensionValueForSelectedVariant,\r\n InventoryLevelValues,\r\n IProductInventoryInformation,\r\n IPromiseQueue,\r\n PriceForSelectedVariantInput,\r\n ProductAvailabilitiesForSelectedVariantInput,\r\n SelectedVariantInput,\r\n setDimensionValuesToQuery,\r\n getDimensionValuesFromQuery,\r\n validateCatalogId\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n Button,\r\n getTelemetryObject,\r\n IModuleProps,\r\n INodeProps,\r\n ITelemetryContent,\r\n updateMaxQuantityForCartLineItem\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\nimport {\r\n getBuyboxAddToCart,\r\n getBuyboxKeyInPrice,\r\n getBuyboxProductAddToOrderTemplate,\r\n getBuyboxProductAddToWishlist,\r\n getBuyboxProductComparisonButton,\r\n getBuyboxProductDescription,\r\n getBuyboxProductPrice,\r\n getBuyboxProductQuantity,\r\n getBuyboxProductRating,\r\n getBuyboxProductTitle,\r\n getBuyboxProductUnitOfMeasure,\r\n getBuyboxShopSimilarButton,\r\n getQuantityLimitsMessages,\r\n RetailDefaultOrderQuantityLimitsFeatureName,\r\n EcommerceQuantityLimitConfigurationsFeatureName,\r\n IBuyboxAddToCartViewProps,\r\n IBuyboxAddToOrderTemplateViewProps,\r\n IBuyboxAddToWishlistViewProps,\r\n IBuyboxCallbacks,\r\n IBuyboxCommonData,\r\n IBuyboxExtentedProps,\r\n IBuyboxKeyInPriceViewProps,\r\n IBuyboxProductConfigureViewProps,\r\n IBuyboxProductQuantityViewProps,\r\n IBuyboxShopSimilarLookViewProps,\r\n IBuyboxState,\r\n IErrorState,\r\n ShopSimiliarButtonType,\r\n RecentlyViewedState\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport { ILobasBuyboxData } from './lobas-buybox.data';\r\nimport { ILobasBuyboxProps, ILobasBuyboxResources } from './lobas-buybox.props.autogenerated';\r\nimport { getBuyboxFindInStore, IBuyboxFindInStoreViewProps } from './components/lobas-buybox-find-in-store';\r\nimport { getBuyBoxInventoryLabel } from './components/lobas-buybox-components';\r\nimport { getLobasBuyboxProductConfigure } from './components/lobas-buybox-product-configure';\r\nimport { getBuyboxProductConfigure } from './components/buybox-product-configure';\r\n\r\nexport interface ILobasBuyboxViewProps extends ILobasBuyboxProps {\r\n state: IBuyboxState;\r\n ModuleProps: IModuleProps;\r\n ProductInfoContainerProps: INodeProps;\r\n MediaGalleryContainerProps: INodeProps;\r\n callbacks: IBuyboxCallbacks;\r\n mediaGallery?: React.ReactNode;\r\n title?: React.ReactNode;\r\n description?: React.ReactNode;\r\n rating?: React.ReactNode;\r\n price?: React.ReactNode;\r\n productComparisonButton?: React.ReactNode;\r\n bulkPurchaseLink?: React.ReactNode;\r\n addToOrderTemplate?: IBuyboxAddToOrderTemplateViewProps;\r\n addToWishlist?: IBuyboxAddToWishlistViewProps;\r\n max: number | undefined;\r\n addToCart: IBuyboxAddToCartViewProps;\r\n findInStore?: IBuyboxFindInStoreViewProps;\r\n quantity?: IBuyboxProductQuantityViewProps;\r\n configure?: IBuyboxProductConfigureViewProps;\r\n lobasConfigure?: IBuyboxProductConfigureViewProps;\r\n inventoryLabel?: React.ReactNode;\r\n shopSimilarLook?: IBuyboxShopSimilarLookViewProps;\r\n shopSimilarDescription?: IBuyboxShopSimilarLookViewProps;\r\n quantityLimitsMessages: React.ReactNode;\r\n telemetryContent?: ITelemetryContent;\r\n keyInPrice?: IBuyboxKeyInPriceViewProps;\r\n unitOfMeasure?: React.ReactNode;\r\n catalogs?: ProductCatalog[] | undefined;\r\n isChannelMultipleCatalogsFeatureEnabled?: boolean;\r\n currentCatalogId?: number;\r\n}\r\n\r\n//export type GridSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\r\n\r\n/**\r\n * Buybox Module.\r\n */\r\nclass Buybox extends React.PureComponent, IBuyboxState> {\r\n /**\r\n * A queue of tasks of processing the changes in the dimensions.\r\n * Limit to two processes:\r\n * 1 - for the current process, which is under execution at the moment.\r\n * 2 - next process, which will process the latest version of data.\r\n * @remark Enqueueing new promises will discard the previous ones (except the one which is under processing).\r\n */\r\n private readonly dimensionUpdateQueue: IPromiseQueue = new FinitePromiseQueue(2);\r\n\r\n /* @computed get isMobile(): boolean {\r\n return this._viewport === 'xs' || this._viewport === 'sm';\r\n }\r\n\r\n @observable\r\n private _viewport: GridSize = 'lg';*/\r\n\r\n private dimensions: { [id: number]: string } = {};\r\n\r\n private readonly buyboxCallbacks: IBuyboxCallbacks = {\r\n updateQuantity: (newQuantity: number): boolean => {\r\n const errorState = { ...this.state.errorState };\r\n errorState.quantityError = undefined;\r\n errorState.otherError = undefined;\r\n\r\n this.setState({ quantity: newQuantity, errorState });\r\n return true;\r\n },\r\n updateErrorState: (newErrorState: IErrorState): void => {\r\n this.setState({ errorState: newErrorState });\r\n },\r\n updateSelectedProduct: (\r\n newSelectedProduct: Promise,\r\n newInventory: IProductInventoryInformation | undefined,\r\n newPrice: ProductPrice | undefined,\r\n newDeliveryOptions: ProductDeliveryOptions | undefined\r\n ): void => {\r\n this.setState({\r\n selectedProduct: newSelectedProduct,\r\n productAvailableQuantity: newInventory,\r\n productDeliveryOptions: newDeliveryOptions\r\n });\r\n this._updatePrice(newPrice);\r\n },\r\n dimensionSelectedAsync: async (selectedDimensionId: number, selectedDimensionValueId: string): Promise => {\r\n this.dimensions[selectedDimensionId] = selectedDimensionValueId;\r\n return this.dimensionUpdateQueue\r\n .enqueue(async () => {\r\n return this._updateDimensions();\r\n })\r\n .catch((error: unknown) => {\r\n // Ignore discarded processes.\r\n if (error !== FinitePromiseQueueError.ProcessWasDiscardedFromTheQueue) {\r\n throw error;\r\n }\r\n });\r\n },\r\n getDropdownName: (dimensionType: number, resources: ILobasBuyboxResources): string => {\r\n return this._getDropdownName(dimensionType, resources);\r\n },\r\n changeModalOpen: (isModalOpen: boolean): void => {\r\n this.setState({ modalOpen: isModalOpen });\r\n },\r\n changeUpdatingDimension: (isUpdatingDimension: boolean): void => {\r\n this.setState({ isUpdatingDimension });\r\n },\r\n\r\n /**\r\n * Update isUpdatingDeliveryOptions state.\r\n *\r\n * @param isUpdatingDeliveryOptions - The status of updating delivery options.\r\n */\r\n changeUpdatingDeliveryOptions: (isUpdatingDeliveryOptions: boolean): void => {\r\n this.setState({ isUpdatingDeliveryOptions });\r\n },\r\n\r\n updateKeyInPrice: (customPrice: number): void => {\r\n // Remove custom amount error when updating the custom price\r\n const errorState = { ...this.state.errorState };\r\n errorState.customAmountError = undefined;\r\n\r\n this.setState({ isPriceKeyedIn: true, keyInPriceAmount: customPrice, errorState });\r\n this._updatePrice(this.state.productPrice, customPrice);\r\n }\r\n };\r\n\r\n private readonly telemetryContent: ITelemetryContent;\r\n\r\n public constructor(props: ILobasBuyboxProps, state: IBuyboxState) {\r\n super(props);\r\n //this._viewport = props.context.request?.device?.Type === 'Mobile' ? 'xs' : 'lg';\r\n //this._updateViewport = this._updateViewport.bind(this);\r\n this.state = {\r\n errorState: {\r\n configureErrors: {}\r\n },\r\n quantity: 1,\r\n min: undefined,\r\n max: undefined,\r\n selectedProduct: undefined,\r\n productPrice: undefined,\r\n productDeliveryOptions: undefined,\r\n\r\n modalOpen: false,\r\n isUpdatingDimension: false,\r\n isUpdatingDeliveryOptions: false,\r\n isPriceApiCalled: false\r\n };\r\n this.telemetryContent = getTelemetryObject(props.context.request.telemetryPageName!, props.friendlyName, props.telemetry);\r\n //this._updateViewport();\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n const {\r\n data: {\r\n product: { result: product },\r\n productPrice\r\n },\r\n context\r\n } = this.props;\r\n\r\n // There are multiple sources triggering the callback function dimensionSelectedAsync calling the GetActivePrice api before componentDidMount and after componentDidMount.\r\n // Set isPriceApiCalled to false here to prevent redundant API call after componentDidMount:\r\n // If the price has not been hydrated before, this means the component was just loaded for the first time with variant selected.\r\n // We will skip calling RS API in this case as the price data has already been fetched via module data action in node server.\r\n this.setState({ isPriceApiCalled: false });\r\n\r\n /*if (MsDyn365.isBrowser && window.addEventListener) {\r\n window.addEventListener('resize', this._updateViewport);\r\n this._updateViewport();\r\n }*/\r\n\r\n productPrice.then(async result => {\r\n this._updatePrice(result);\r\n });\r\n\r\n if (product) {\r\n // Check if the product is service or not by product type\r\n if (product.ItemTypeValue === ReleasedProductType.Service) {\r\n this.setState({ isServiceItem: true });\r\n }\r\n await this._updateQuantitiesInState(product);\r\n }\r\n\r\n if (product && context.app.config.maxRecentlyViewedItemsCount > 0) {\r\n RecentlyViewedState.instance(this.props.context, context.app.config.maxRecentlyViewedItemsCount, product.RecordId);\r\n }\r\n }\r\n\r\n /*public componentWillUnmount(): void {\r\n if (MsDyn365.isBrowser && window.removeEventListener) {\r\n window.removeEventListener('resize', this._updateViewport);\r\n }\r\n }*/\r\n\r\n public render(): JSX.Element | null {\r\n const {\r\n slots: { mediaGallery, productComparisonButton },\r\n data: {\r\n product: { result: product }\r\n },\r\n config: { className = '' }\r\n } = this.props;\r\n\r\n const { max } = this.state;\r\n\r\n if (!product) {\r\n this.props.context.telemetry.error('Product content is empty, module wont render');\r\n return null;\r\n }\r\n\r\n const props = this.props as IBuyboxExtentedProps;\r\n const defaultMinimumKeyInPrice = 10;\r\n const defaultMaximumKeyInPrice = 100;\r\n\r\n const context = this.props.context as ICoreContext;\r\n const inventoryLevel = context.app.config.inventoryLevel;\r\n const dimensionValuesWithInventory = ArrayExtensions.flatten(\r\n ArrayExtensions.validValues(this.props.data.productDimensions.result?.map(value => value.dimensionValuesWithInventory))\r\n );\r\n const hasAvailableProducts =\r\n !ArrayExtensions.hasElements(dimensionValuesWithInventory) ||\r\n dimensionValuesWithInventory.some((value: unknown) => {\r\n const inventoryLevelCode = getInventoryLevelCodeFromDimensionValue(\r\n value as ProductDimensionValueInventoryAvailability,\r\n inventoryLevel\r\n );\r\n return inventoryLevelCode !== InventoryLevelValues.outOfStock;\r\n });\r\n const catalogId = getCatalogId(this.props.context.request);\r\n validateCatalogId(catalogId);\r\n\r\n const viewProps: ILobasBuyboxViewProps = {\r\n ...(this.props as ILobasBuyboxProps),\r\n state: this.state,\r\n mediaGallery: mediaGallery && mediaGallery.length > 0 ? mediaGallery[0] : undefined,\r\n ModuleProps: {\r\n moduleProps: this.props,\r\n className: classnames('ms-buybox', className)\r\n },\r\n ProductInfoContainerProps: {\r\n className: 'ms-buybox__content'\r\n },\r\n MediaGalleryContainerProps: {\r\n className: 'ms-buybox__media-gallery'\r\n },\r\n telemetryContent: this.telemetryContent,\r\n callbacks: this.buyboxCallbacks,\r\n //isMobile: this.isMobile,\r\n title: getBuyboxProductTitle(props),\r\n description: getBuyboxProductDescription(props),\r\n bulkPurchaseLink: this._renderBuyboxBulkPurchaseLink(),\r\n unitOfMeasure: getBuyboxProductUnitOfMeasure(props),\r\n configure: getBuyboxProductConfigure(\r\n props,\r\n this.state,\r\n this.buyboxCallbacks,\r\n undefined,\r\n getDimensionValuesFromQuery(context.request.url.requestUrl)\r\n ),\r\n lobasConfigure: getLobasBuyboxProductConfigure(\r\n props,\r\n this.state,\r\n this.buyboxCallbacks,\r\n undefined,\r\n getDimensionValuesFromQuery(context.request.url.requestUrl)\r\n ),\r\n findInStore: getBuyboxFindInStore(this.props, this.state, this.buyboxCallbacks),\r\n price: getBuyboxProductPrice(props, this.state),\r\n addToCart: getBuyboxAddToCart(\r\n props,\r\n this.state,\r\n this.buyboxCallbacks,\r\n defaultMinimumKeyInPrice,\r\n defaultMaximumKeyInPrice,\r\n undefined,\r\n hasAvailableProducts\r\n ),\r\n productComparisonButton: ArrayExtensions.hasElements(productComparisonButton)\r\n ? getBuyboxProductComparisonButton(\r\n productComparisonButton[0],\r\n product,\r\n getCatalogId(this.props.context.request),\r\n this.state\r\n )\r\n : undefined,\r\n addToOrderTemplate: getBuyboxProductAddToOrderTemplate(\r\n props,\r\n this.state,\r\n this.buyboxCallbacks,\r\n this._isChannelMultipleCatalogsFeatureEnabled(),\r\n catalogId\r\n ),\r\n addToWishlist: getBuyboxProductAddToWishlist(props, this.state, this.buyboxCallbacks),\r\n rating: !props.context.app.config.hideRating && getBuyboxProductRating(props),\r\n quantity: product.IsGiftCard ? undefined : getBuyboxProductQuantity(props, this.state, this.buyboxCallbacks),\r\n inventoryLabel: getBuyBoxInventoryLabel(this.props, this.state),\r\n shopSimilarLook:\r\n this.props.config.enableShopSimilarLooks && !product.IsGiftCard\r\n ? getBuyboxShopSimilarButton(props, ShopSimiliarButtonType.Looks)\r\n : undefined,\r\n shopSimilarDescription:\r\n this.props.config.enableShopSimilarDescription && !product.IsGiftCard\r\n ? getBuyboxShopSimilarButton(props, ShopSimiliarButtonType.Description)\r\n : undefined,\r\n keyInPrice:\r\n this.props.config.enableKeyInPrice && this.state.isCustomPriceSelected\r\n ? getBuyboxKeyInPrice(props, this.state, this.buyboxCallbacks)\r\n : undefined,\r\n quantityLimitsMessages: getQuantityLimitsMessages(props, this.state),\r\n max,\r\n isChannelMultipleCatalogsFeatureEnabled: this._isChannelMultipleCatalogsFeatureEnabled(),\r\n currentCatalogId: catalogId,\r\n catalogs: this._validateCatalogDetails(catalogId)\r\n };\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n /**\r\n * Handles anchor click event and scrolls to the given bulk purchase module.\r\n * @param bulkPurchaseModule - Bulk purchase module.\r\n * @returns Handler.\r\n */\r\n private readonly _onBulkPurchaseLinkClick = (bulkPurchaseModule: Element) => () => {\r\n const boundingRect = bulkPurchaseModule.getBoundingClientRect();\r\n const scrollX = boundingRect.left + window.pageXOffset;\r\n const scrollY = boundingRect.top + window.pageYOffset;\r\n\r\n window.scrollTo(scrollX, scrollY);\r\n };\r\n private readonly _isChannelMultipleCatalogsFeatureEnabled = (): boolean => {\r\n let isMultipleCatalogFeatureEnabledInHq = false;\r\n if (this.props.data.featureState) {\r\n isMultipleCatalogFeatureEnabledInHq =\r\n this.props.data.featureState.result?.find(\r\n feature => feature.Name === 'Dynamics.AX.Application.ChannelMultipleCatalogsFeature'\r\n )?.IsEnabled || false;\r\n }\r\n return isMultipleCatalogFeatureEnabledInHq;\r\n };\r\n\r\n private _renderBuyboxBulkPurchaseLink(): React.ReactNode {\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Temporary switch for the feature which is under development.\r\n if (!this.props.context.app.config.isBulkPurchaseEnabled) {\r\n return null;\r\n }\r\n\r\n if (!msdyn365Commerce.isBrowser) {\r\n return null;\r\n }\r\n\r\n const bulkPurchaseModules = Array.from(document.getElementsByClassName(BulkPurchase.className));\r\n\r\n if (!ArrayExtensions.hasElements(bulkPurchaseModules)) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n {this.props.resources.bulkPurchaseLinkText}\r\n \r\n );\r\n }\r\n\r\n private _updatePrice(newPrice: ProductPrice | undefined, customPrice: number | undefined = this.state.keyInPriceAmount): void {\r\n if (this.state.isCustomPriceSelected && newPrice) {\r\n newPrice.CustomerContextualPrice = customPrice;\r\n }\r\n this.setState({ productPrice: newPrice });\r\n }\r\n\r\n private _getProductVariant(dimensionsToUpdate: { [id: number]: string }) {\r\n const {\r\n data: {\r\n product: { result: product }\r\n },\r\n context: {\r\n actionContext,\r\n request: {\r\n apiSettings: { channelId }\r\n }\r\n }\r\n } = this.props;\r\n\r\n const productDimensions = this.props.data.productDimensions.result!;\r\n\r\n // Step 3, Build the actually selected dimensions, prioritizing the information in state\r\n // over the information in data\r\n const mappedDimensions = productDimensions\r\n .map(dimension => {\r\n const dimensions = (dimension.dimensionValuesWithInventory ??\r\n dimension.DimensionValues ??\r\n []) as IDimensionValueForSelectedVariant[];\r\n return {\r\n DimensionTypeValue: dimension.DimensionTypeValue,\r\n DimensionValue:\r\n dimensions.find(\r\n value => value.DimensionValue?.RecordId.toString() === dimensionsToUpdate[dimension.DimensionTypeValue]\r\n )?.DimensionValue ?? dimension.DimensionValue,\r\n ExtensionProperties: dimension.ExtensionProperties\r\n };\r\n })\r\n .filter(dimension => dimension.DimensionValue);\r\n setDimensionValuesToQuery(this.props.context.actionContext.requestContext.url.requestUrl, mappedDimensions);\r\n\r\n // Step 4. Use these dimensions hydrate the product. Wrap this in a promise\r\n // so that places like add to cart can await it\r\n const selectedProductPromise = getSelectedVariant(\r\n new SelectedVariantInput(\r\n product!.MasterProductId ? product!.MasterProductId : product!.RecordId,\r\n channelId,\r\n undefined,\r\n undefined,\r\n this.props.context.request\r\n ),\r\n actionContext\r\n );\r\n this.setState({ selectedProduct: selectedProductPromise });\r\n\r\n return { productVariantPromise: selectedProductPromise, mappedDimensions };\r\n }\r\n\r\n private readonly _updateDimensions = async (): Promise => {\r\n const product = this.props.data.product.result;\r\n\r\n const productDimensions = this.props.data.productDimensions.result;\r\n\r\n const hasProductDimensions = ArrayExtensions.hasElements(productDimensions);\r\n\r\n if (!product || !hasProductDimensions) {\r\n return;\r\n }\r\n\r\n const dimensionsToUpdate: { [id: number]: string } = { ...this.dimensions };\r\n\r\n this.setState({ isUpdatingDimension: true, isUpdatingDeliveryOptions: true });\r\n\r\n // Step 1: Clear error state to display relevant errors\r\n if (this.state.errorState.otherError || this.state.errorState.quantityError) {\r\n const clearErrorState = { ...this.state.errorState };\r\n clearErrorState.otherError = undefined;\r\n if (this.state.errorState.errorHost === 'ADDTOCART') {\r\n clearErrorState.quantityError = undefined;\r\n clearErrorState.errorHost = undefined;\r\n }\r\n this.setState({ errorState: clearErrorState });\r\n }\r\n\r\n // Step 2: Clear any errors indicating the dimension wasn't selected\r\n for (const key of Object.keys(dimensionsToUpdate)) {\r\n if (this.state.errorState.configureErrors[key]) {\r\n this.setState(previousState => {\r\n const errorState = previousState.errorState;\r\n errorState.configureErrors[key] = undefined;\r\n\r\n return { errorState };\r\n });\r\n }\r\n }\r\n\r\n const data = this._getProductVariant(dimensionsToUpdate);\r\n const productVariant: SimpleProduct | null = await data.productVariantPromise;\r\n\r\n if (!productVariant) {\r\n return;\r\n }\r\n\r\n const promises: Promise[] = [\r\n this._getDimensionsForSelectedVariant(productVariant, data.mappedDimensions),\r\n this._hydrateInventoryInfo(productVariant),\r\n this._hydratePrice(productVariant),\r\n this._hydrateDeliveryOptions(productVariant),\r\n this._updateQuantitiesInState(productVariant)\r\n ];\r\n\r\n await Promise.all(promises);\r\n };\r\n\r\n private async _getDimensionsForSelectedVariant(\r\n productVariant: SimpleProduct,\r\n mappedDimensions: {\r\n /* eslint-disable @typescript-eslint/naming-convention -- Retail proxy values */\r\n DimensionTypeValue: number;\r\n DimensionValue: ProductDimensionValue | undefined;\r\n ExtensionProperties: CommerceProperty[] | undefined;\r\n /* eslint-enable @typescript-eslint/naming-convention -- Retail proxy values */\r\n }[]\r\n ): Promise {\r\n await getDimensionsForSelectedVariant(\r\n new GetDimensionsForSelectedVariantInput(\r\n productVariant.MasterProductId ? productVariant.MasterProductId : productVariant.RecordId,\r\n this.props.context.request.apiSettings.channelId,\r\n mappedDimensions,\r\n this.props.context.request\r\n ),\r\n this.props.context.actionContext\r\n );\r\n }\r\n\r\n private async _hydrateInventoryInfo(productVariant: SimpleProduct): Promise {\r\n // Step 5. Use these dimensions hydrate the inventory. Wrap this in a promise\r\n // so that places like add to cart can await it\r\n const newAvailableQuantity = await getProductAvailabilitiesForSelectedVariant(\r\n new ProductAvailabilitiesForSelectedVariantInput(productVariant.RecordId, this.props.context.request.apiSettings.channelId),\r\n this.props.context.actionContext\r\n );\r\n\r\n const newShippingQuantity = newAvailableQuantity?.find(\r\n // @ts-expect-error\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (shipping: { deliveryType: any }) => shipping.deliveryType === DeliveryMode.shipping\r\n );\r\n const isCustomPriceSelected = productVariant.Dimensions?.find(\r\n dimension =>\r\n dimension.DimensionTypeValue === 4 && dimension.DimensionValue && dimension.DimensionValue.Value?.toLowerCase() === 'custom'\r\n );\r\n if (isCustomPriceSelected) {\r\n this.setState({ isCustomPriceSelected: true });\r\n } else {\r\n this.setState(previousState => {\r\n const errorState = previousState.errorState;\r\n errorState.customAmountError = undefined;\r\n return { isCustomPriceSelected: false, isPriceKeyedIn: false, errorState };\r\n });\r\n }\r\n\r\n if (newShippingQuantity) {\r\n this.setState({ productAvailableQuantity: newShippingQuantity });\r\n } else {\r\n this.setState({ productAvailableQuantity: undefined });\r\n }\r\n }\r\n\r\n private async _hydratePrice(productVariant: SimpleProduct): Promise {\r\n // This function is invoked when dimensionSelectedAsync get called.\r\n // If the price has not been hydrated before, this means the component was just loaded for the first time with variant selected.\r\n // We will skip calling RS API in this case as the price data has already been fetched via module data action in node server.\r\n if (!this.state.isPriceApiCalled) {\r\n this.setState({ isPriceApiCalled: true });\r\n return;\r\n }\r\n\r\n // Step 6. Use these dimensions hydrate the product price.\r\n const newPrice = await getPriceForSelectedVariant(\r\n new PriceForSelectedVariantInput(productVariant.RecordId, this.props.context.request.apiSettings.channelId),\r\n this.props.context.actionContext\r\n );\r\n\r\n if (newPrice) {\r\n this._updatePrice(newPrice);\r\n }\r\n }\r\n\r\n private async _hydrateDeliveryOptions(productVariant: SimpleProduct): Promise {\r\n const retailMultiplePickupFeatureState = this.props.data.featureState.result?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature'\r\n );\r\n\r\n // Step 7. Use these dimensions hydrate the product delivery options.\r\n const newDeliveryOptions = await getDeliveryOptionsForSelectedVariant(\r\n new GetDeliveryOptionsForSelectedVariantInput(\r\n productVariant.RecordId,\r\n this.props.context.request.apiSettings.channelId,\r\n undefined,\r\n undefined,\r\n retailMultiplePickupFeatureState?.IsEnabled\r\n ),\r\n this.props.context.actionContext\r\n );\r\n\r\n if (newDeliveryOptions) {\r\n this.setState({ productDeliveryOptions: newDeliveryOptions });\r\n }\r\n }\r\n\r\n /*private async _updateProductDimensionsWithAvailabilities(dimensionsToUpdate: { [id: number]: string }): Promise {\r\n const {\r\n data: {\r\n product: { result: product }\r\n },\r\n context: {\r\n actionContext,\r\n request: {\r\n apiSettings: { channelId }\r\n }\r\n }\r\n } = this.props;\r\n\r\n const productDimensions = this.props.data.productDimensions.result!;\r\n\r\n // Step 3, Build the actually selected dimensions, prioritizing the information in state\r\n // over the information in data\r\n const mappedDimensions = productDimensions\r\n .map(dimension => {\r\n const dimensions = (dimension.dimensionValuesWithInventory ??\r\n dimension.DimensionValues ??\r\n []) as IDimensionValueForSelectedVariant[];\r\n return {\r\n DimensionTypeValue: dimension.DimensionTypeValue,\r\n DimensionValue:\r\n dimensions.find(\r\n value => value.DimensionValue?.RecordId.toString() === dimensionsToUpdate[dimension.DimensionTypeValue]\r\n )?.DimensionValue ?? dimension.DimensionValue,\r\n ExtensionProperties: dimension.ExtensionProperties\r\n };\r\n })\r\n .filter(dimension => dimension.DimensionValue);\r\n setDimensionValuesToQuery(this.props.context.actionContext.requestContext.url.requestUrl, mappedDimensions);\r\n\r\n // Step 4. Use these dimensions hydrate the product. Wrap this in a promise\r\n // so that places like add to cart can await it\r\n const selectedProductPromise = getSelectedVariant(\r\n new SelectedVariantInput(\r\n product!.MasterProductId ? product!.MasterProductId : product!.RecordId,\r\n channelId,\r\n undefined,\r\n undefined,\r\n this.props.context.request\r\n ),\r\n actionContext\r\n );\r\n this.setState({ selectedProduct: selectedProductPromise });\r\n\r\n const variantProduct = await selectedProductPromise;\r\n if (variantProduct) {\r\n await getDimensionsForSelectedVariant(\r\n new GetDimensionsForSelectedVariantInput(\r\n variantProduct.MasterProductId ? variantProduct.MasterProductId : variantProduct.RecordId,\r\n channelId,\r\n mappedDimensions,\r\n this.props.context.request\r\n ),\r\n actionContext\r\n );\r\n }\r\n\r\n return variantProduct;\r\n }*/\r\n\r\n private async _updateQuantitiesInState(product: SimpleProduct): Promise {\r\n const isOrderQuantityLimitsFeatureEnabled = await this._isOrderQuantityLimitsFeatureEnabled();\r\n const isChannelLimitsFeatureEnabled = await this._isChannelLimitsFeatureEnabled();\r\n\r\n const min: number = this._getMinQuantityForCartLineItem(isOrderQuantityLimitsFeatureEnabled, product);\r\n const max: number = this._getMaxQuantityForCartLineItem(\r\n isChannelLimitsFeatureEnabled || isOrderQuantityLimitsFeatureEnabled,\r\n product\r\n );\r\n\r\n this.setState({\r\n min,\r\n max\r\n });\r\n }\r\n\r\n private _getMinQuantityForCartLineItem(isOrderQuantityLimitsFeatureEnabled: boolean, product: SimpleProduct): number {\r\n if (isOrderQuantityLimitsFeatureEnabled && product?.Behavior?.MinimumQuantity && product.Behavior.MinimumQuantity > 0) {\r\n return product.Behavior.MinimumQuantity;\r\n }\r\n\r\n return 1;\r\n }\r\n\r\n private _getMaxQuantityForCartLineItem(isQuantityLimitsFeatureEnabled: boolean, product: SimpleProduct): number {\r\n if (isQuantityLimitsFeatureEnabled && product?.Behavior?.MaximumQuantity && product.Behavior.MaximumQuantity > 0) {\r\n return product.Behavior.MaximumQuantity;\r\n }\r\n\r\n return updateMaxQuantityForCartLineItem(this.props.context.app.config.maxQuantityForCartLineItem);\r\n }\r\n\r\n private readonly _getDropdownName = (dimensionType: number, resources: ILobasBuyboxResources): string => {\r\n const isGiftCard = this.props.data.product.result?.IsGiftCard;\r\n\r\n switch (dimensionType) {\r\n case 1: // ProductDimensionType.Color\r\n return resources.productDimensionTypeColor;\r\n case 2: // ProductDimensionType.Configuration\r\n return resources.productDimensionTypeConfiguration;\r\n case 3: // ProductDimensionType.Size\r\n return resources.productDimensionTypeSize;\r\n case 4: // ProductDimensionType.Style\r\n return isGiftCard ? resources.productDimensionTypeAmount : resources.productDimensionTypeStyle;\r\n default:\r\n return '';\r\n }\r\n };\r\n\r\n private async _isOrderQuantityLimitsFeatureEnabled(): Promise {\r\n const defaultOrderQuantityLimitsFeatureConfig = this.props.context?.request?.app?.platform?.enableDefaultOrderQuantityLimits;\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'none') {\r\n return false;\r\n }\r\n\r\n const featureStatuses = await this.props.data.featureState;\r\n const isFeatureEnabledInHq = featureStatuses?.find(\r\n featureState => featureState.Name === RetailDefaultOrderQuantityLimitsFeatureName\r\n )?.IsEnabled;\r\n if (!isFeatureEnabledInHq) {\r\n return false;\r\n }\r\n\r\n if (defaultOrderQuantityLimitsFeatureConfig === 'all') {\r\n return true;\r\n }\r\n let customerInfo;\r\n try {\r\n customerInfo = await this.props.data.customerInformation;\r\n } catch (error) {\r\n this.props.telemetry.information(error);\r\n this.props.telemetry.debug('Unable to receive Customer Information. May be user is not authorized');\r\n return false;\r\n }\r\n\r\n return (\r\n customerInfo &&\r\n ((defaultOrderQuantityLimitsFeatureConfig === 'b2b' && customerInfo.IsB2b) ||\r\n (defaultOrderQuantityLimitsFeatureConfig === 'b2c' && !customerInfo.IsB2b))\r\n );\r\n }\r\n\r\n /*private _getViewport(): GridSize {\r\n if (MsDyn365.isBrowser) {\r\n return isMobile({ variant: VariantType.Browser, context: this.props.context.request });\r\n }\r\n return isMobile({ variant: VariantType.Viewport, context: this.props.context.request });\r\n }\r\n\r\n private _updateViewport(): void {\r\n this._viewport = this._getViewport();\r\n }*/\r\n\r\n private _validateCatalogDetails(catalogId: number): ProductCatalog[] | undefined {\r\n const catalogs = this.props.data.catalogs?.result?.filter(item => item.RecordId === catalogId);\r\n if (ArrayExtensions.hasElements(catalogs) && catalogs[0].RecordId === 0) {\r\n return;\r\n }\r\n\r\n return catalogs;\r\n }\r\n\r\n private async _isChannelLimitsFeatureEnabled(): Promise {\r\n const featureStatuses = await this.props.data.featureState;\r\n\r\n const isChannelLimitsFeatureEnabledInHq = featureStatuses?.find(\r\n featureState => featureState.Name === EcommerceQuantityLimitConfigurationsFeatureName\r\n )?.IsEnabled;\r\n\r\n return isChannelLimitsFeatureEnabledInHq ?? false;\r\n }\r\n}\r\n\r\nexport default Buybox;\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 {\r\n AddToOrderTemplateComponent,\r\n IAddToOrderTemplateDialogResources,\r\n IDuplicateItemsWhenAddingToOrderTemplateDialogResources,\r\n IItemAddedToOrderTemplateDialogResources,\r\n IOrderTemplateActionErrorResult,\r\n IOrderTemplateNameDialogResources\r\n} from '@msdyn365-commerce/components';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { getConfigureErrors, IBuyboxCallbacks, IBuyboxCommonResources, IBuyboxState } from '@msdyn365-commerce-modules/buybox';\r\nimport * as React from 'react';\r\n\r\nimport { ILobasBuyboxProps } from '../lobas-buybox.props.autogenerated';\r\nimport { ILobasBuyboxData } from '../lobas-buybox.data';\r\nimport { ILobasBuyboxViewProps } from '../lobas-buybox';\r\n\r\n/**\r\n * To generate AddToOrderTemplateDialog resources.\r\n * @param resources - The resources.\r\n * @returns -- Returns the list of AddToOrderTemplateDialog resources..\r\n */\r\nfunction generateAddToOrderTemplateDialogResources(resources: IBuyboxCommonResources): IAddToOrderTemplateDialogResources {\r\n return {\r\n addToOrderTemplateHeader: resources.addToOrderTemplateHeader,\r\n\r\n noOrderTemplatesMessage: resources.noOrderTemplatesMessage,\r\n noOrderTemplatesDescription: resources.noOrderTemplatesDescription,\r\n\r\n createAnOrderTemplateButtonText: resources.createAnOrderTemplateButtonText,\r\n createNewOrderTemplateButtonText: resources.createNewOrderTemplateButtonText,\r\n cancelOrderTemplateCreationButtonText: resources.cancelOrderTemplateCreationButtonText,\r\n\r\n selectTemplatesText: resources.selectTemplatesText,\r\n addToTemplateButtonText: resources.addToTemplateButtonText,\r\n lineItemsText: resources.lineItemsText\r\n };\r\n}\r\n\r\n/**\r\n * To generate OrderTemplateNameDialog resources.\r\n * @param resources - The resources.\r\n * @returns -- Returns the list of OrderTemplateNameDialog resources..\r\n */\r\nfunction generateOrderTemplateNameDialogResources(resources: IBuyboxCommonResources): IOrderTemplateNameDialogResources {\r\n return {\r\n orderTemplateHeaderLabel: resources.createOrderTemplateHeader,\r\n orderTemplateTitleLabel: resources.orderTemplateTitle,\r\n orderTemplateNameAriaLabel: resources.orderTemplateNameAriaLabel,\r\n orderTemplateDescription: resources.createOrderTemplateDescription,\r\n\r\n defaultOrderTemplateName: resources.defaultOrderTemplateName,\r\n\r\n orderTemplateButtonLabel: resources.createOrderTemplateButtonText,\r\n orderTemplateCancelButtonLabel: resources.cancelNewOrderTemplateCreationButtonText\r\n };\r\n}\r\n\r\n/**\r\n * To generate ItemAddedToOrderTemplateDialog resources.\r\n * @param resources - The resources.\r\n * @returns -- Returns the list of ItemAddedToOrderTemplateDialog resources..\r\n */\r\nfunction generateItemAddedToOrderTemplateDialogResources(resources: IBuyboxCommonResources): IItemAddedToOrderTemplateDialogResources {\r\n return {\r\n viewOrderTemplateButtonText: resources.viewOrderTemplateButtonText,\r\n continueShoppingButtonText: resources.continueShoppingButtonText,\r\n itemAddedToOrderTemplateHeaderItemOneText: resources.itemAddedToOrderTemplateHeaderItemOneText,\r\n itemAddedToOrderTemplateHeaderItemFormatText: resources.itemAddedToOrderTemplateHeaderItemFormatText,\r\n itemAddedToOrderTemplateHeaderMessageText: resources.itemAddedToOrderTemplateHeaderMessageText,\r\n freePriceText: resources.priceFree,\r\n originalPriceText: resources.originalPriceText,\r\n currentPriceText: resources.currentPriceText\r\n };\r\n}\r\n\r\n/**\r\n * To generate DuplicateItemsWhenAddingToOrderTemplateDialog resources.\r\n * @param resources - The resources.\r\n * @returns -- Returns the list of DuplicateItemsWhenAddingToOrderTemplateDialog resources..\r\n */\r\nfunction generateDuplicateItemsWhenAddingToOrderTemplateDialogResources(\r\n resources: IBuyboxCommonResources\r\n): IDuplicateItemsWhenAddingToOrderTemplateDialogResources {\r\n return {\r\n duplicatedProductsHeader: resources.duplicatedProductsHeader,\r\n duplicatedProductsDescription: resources.duplicatedProductsDescription,\r\n updateQuantityButtonText: resources.updateQuantityButtonText,\r\n cancelDuplicateItemsButtonText: resources.cancelDuplicateItemsButtonText\r\n };\r\n}\r\n\r\n/**\r\n * Add to wishlist failed function.\r\n * @param callbacks -Buybox callbacks.\r\n * @param resources -Buybox resources.\r\n * @param product -Simple product.\r\n * @returns Update error state.\r\n */\r\nconst onAddToOrderTemplateFailed = (callbacks: IBuyboxCallbacks, resources: IBuyboxCommonResources, product: SimpleProduct | undefined) => (\r\n result: IOrderTemplateActionErrorResult\r\n) => {\r\n callbacks.updateErrorState({\r\n errorHost: 'ORDER_TEMPLATE',\r\n configureErrors:\r\n result.status === 'MISSING_DIMENSION' ? getConfigureErrors(result.missingDimensions, resources, product?.IsGiftCard) : {}\r\n });\r\n};\r\n\r\n/**\r\n * RenderAddToOrderTemplateButton.\r\n * @param props - Buybox view props.\r\n * @param state - Buybox state.\r\n * @param callbacks - Buybox callbacks.\r\n * @param product - Product data.\r\n * @returns -- Returns JSX element.\r\n */\r\nexport const renderAddToOrderTemplateButton = (\r\n props: ILobasBuyboxViewProps & ILobasBuyboxProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks,\r\n product: SimpleProduct\r\n): React.ReactNode => {\r\n const {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from module file.\r\n id,\r\n typeName,\r\n context,\r\n data: {\r\n orderTemplates: { result: orderTemplates },\r\n customerInformation: { result: customerInformation }\r\n },\r\n resources\r\n } = props;\r\n\r\n const { quantity } = state;\r\n\r\n const isShowButtonText = true;\r\n\r\n return (\r\n orderTemplates && (\r\n \r\n )\r\n );\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 { AddToWishlistComponent, IWishlistActionErrorResult } from '@msdyn365-commerce/components';\r\nimport { SimpleProduct, ItemAvailability, format } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n getConfigureErrors,\r\n IBuyboxAddToCartViewProps,\r\n IBuyboxCallbacks,\r\n IBuyboxCommonResources,\r\n IBuyboxFindInStoreViewProps,\r\n IBuyboxProductConfigureDropdownViewProps,\r\n IBuyboxProductConfigureViewProps,\r\n IBuyboxProductQuantityViewProps,\r\n IBuyboxShopSimilarLookViewProps,\r\n IBuyboxState\r\n} from '@msdyn365-commerce-modules/buybox';\r\nimport {\r\n ArrayExtensions,\r\n getFullAvailableInventoryNearby,\r\n GetFullAvailableInventoryNearbyInput,\r\n IFullOrgUnitAvailability\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { IncrementalQuantity, ITelemetryContent, Module, Node, INodeProps } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport { reaction } from 'mobx';\r\n\r\nimport { ILobasBuyboxProps, ILobasBuyboxResources } from './lobas-buybox.props.autogenerated';\r\nimport { renderAddToOrderTemplateButton } from './components/lobas-buybox-add-to-order-template';\r\nimport { ILobasBuyboxData } from './lobas-buybox.data';\r\nimport { ILobasBuyboxViewProps } from './lobas-buybox';\r\nimport { IStoreInfo } from '@msdyn365-commerce-modules/bopis-utilities';\r\n\r\n/**\r\n * DescriptionText.\r\n */\r\n/*enum DescriptionText {\r\n Shop = 'More ways to shop',\r\n Price = 'Price',\r\n Description = 'Description',\r\n Find = 'Pickup and Delivery Methods',\r\n SKU = 'SKU: '\r\n}*/\r\n\r\n/**\r\n * On Change function.\r\n * @param callbacks -Callbacks.\r\n * @returns Update quantity.\r\n */\r\nconst onChangeHandler = (callbacks: IBuyboxCallbacks) => (newValue: number): boolean => {\r\n if (callbacks.updateQuantity) {\r\n return callbacks.updateQuantity(newValue);\r\n }\r\n return true;\r\n};\r\n\r\n/**\r\n * BuyBoxConstants enum.\r\n */\r\nexport enum BuyBoxConstants {\r\n zero = 0\r\n}\r\n\r\n/**\r\n * RenderQuantity.\r\n * @param quantityComponent - QuantityComponent.\r\n * @param callbacks - Callbacks.\r\n * @param props - Props.\r\n * @param state - State.\r\n * @param extentionResources - ExtentionResources.\r\n * @param quantityLimitsMessages - QuantityLimitsMessages.\r\n * @param max - Max.\r\n * @param telemetryContent - TelemetryContent.\r\n * @param unitOfMeasure - Unit Of Measure.\r\n * @returns -- Returns.\r\n */\r\nconst renderQuantity = (\r\n quantityComponent: IBuyboxProductQuantityViewProps,\r\n callbacks: IBuyboxCallbacks,\r\n props: ILobasBuyboxProps,\r\n state: IBuyboxState,\r\n extentionResources: ILobasBuyboxResources,\r\n quantityLimitsMessages: React.ReactNode,\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\r\n max: number | undefined,\r\n telemetryContent?: ITelemetryContent,\r\n unitOfMeasure?: React.ReactNode,\r\n configure?: IBuyboxProductConfigureViewProps\r\n): JSX.Element => {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\r\n const { /*ContainerProps,*/ LabelContainerProps, heading, errors } = quantityComponent;\r\n\r\n const { resources } = props;\r\n\r\n const { quantity } = state;\r\n\r\n const mainDiv: INodeProps = {\r\n className: configure ? 'ms-buybox__quantity ms-buybox__quantity-right' : 'ms-buybox__quantity ms-buybox__quantity-left'\r\n };\r\n\r\n if (\r\n !props.config.hideQty ||\r\n (props.config.hideQty &&\r\n props.context.request.user.isAuthenticated &&\r\n ((props.context.request.user.customerAccountNumber !== null && props.context.request.user.customerAccountNumber !== '') ||\r\n props.context.request.user.isOBORequest))\r\n ) {\r\n return (\r\n \r\n \r\n {heading}\r\n {errors}\r\n \r\n\r\n \r\n {unitOfMeasure}\r\n {quantityLimitsMessages}\r\n \r\n );\r\n } else {\r\n return <>;\r\n }\r\n};\r\n\r\n/**\r\n * RenderAddToCart.\r\n * @param addToCart - AddToCart.\r\n * @returns -- Returns.\r\n */\r\nconst renderAddToCart = (props: ILobasBuyboxProps, addToCart: IBuyboxAddToCartViewProps): JSX.Element => {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\r\n const { ContainerProps, errorBlock, button } = addToCart;\r\n\r\n if (\r\n !props.config.hideAddToCart ||\r\n (props.config.hideAddToCart &&\r\n props.context.request.user.isAuthenticated &&\r\n ((props.context.request.user.customerAccountNumber !== null && props.context.request.user.customerAccountNumber !== '') ||\r\n props.context.request.user.isOBORequest))\r\n ) {\r\n return (\r\n \r\n {errorBlock}\r\n {button}\r\n \r\n );\r\n } else {\r\n return <>;\r\n }\r\n};\r\n\r\n/**\r\n * RenderFindInStore.\r\n * @param findInStore - FindInStore.\r\n * @returns -- Returns.\r\n */\r\nconst renderFindInStore = (findInStore: IBuyboxFindInStoreViewProps): JSX.Element => {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\r\n const { ContainerProps, storeSelector, heading, description, errors, button, modal, productPickupOptionList } = findInStore;\r\n\r\n return (\r\n \r\n {storeSelector}\r\n {heading}\r\n {productPickupOptionList}\r\n {description}\r\n {errors}\r\n {button}\r\n {modal}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * RenderAddToOrderTemplate.\r\n * @param props - Buybox view props.\r\n * @param state - Buybox state.\r\n * @param callbacks - Buybox callbacks.\r\n * @returns -- Returns.\r\n */\r\nconst renderAddToOrderTemplate = (\r\n props: ILobasBuyboxViewProps & ILobasBuyboxProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks\r\n): JSX.Element | null => {\r\n const product = props.data.product.result;\r\n if (!props.addToOrderTemplate || !product) {\r\n return null;\r\n }\r\n\r\n const orderTemplateButton = renderAddToOrderTemplateButton(props, state, callbacks, product);\r\n\r\n return (\r\n \r\n {props.addToOrderTemplate.errorBlock}\r\n {orderTemplateButton}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Add to wishlist failed function.\r\n * @param callbacks -Buybox callbacks.\r\n * @param resources -Buybox resources.\r\n * @param product -Simple product.\r\n * @returns Update error state.\r\n */\r\nconst onAddToWishlistFailed = (callbacks: IBuyboxCallbacks, resources: IBuyboxCommonResources, product: SimpleProduct | undefined) => (\r\n result: IWishlistActionErrorResult\r\n) => {\r\n callbacks.updateErrorState({\r\n errorHost: 'WISHLIST',\r\n configureErrors:\r\n result.status === 'MISSINGDIMENSION' ? getConfigureErrors(result.missingDimensions, resources, product?.IsGiftCard) : {}\r\n });\r\n};\r\n\r\n/**\r\n * RenderAddToWishlist.\r\n * @param props - Buybox view props.\r\n * @param state - Buybox state.\r\n * @param callbacks - Buybox callbacks.\r\n * @param product - Product data.\r\n * @returns -- Returns.\r\n */\r\nconst renderAddtoWishlistButton = (\r\n props: ILobasBuyboxViewProps & ILobasBuyboxProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks,\r\n product: SimpleProduct\r\n): React.ReactNode => {\r\n const { context, resources } = props;\r\n const wishlists = props.data.wishlists.result;\r\n const isShowWishlitButtonText = true;\r\n return (\r\n \r\n );\r\n};\r\n\r\n/**\r\n * RenderAddToWishlist.\r\n * @param props - Buybox viewprops.\r\n * @param state - Buybox state.\r\n * @param callbacks - Buybox callbacks.\r\n * @returns -- Returns.\r\n */\r\nconst renderAddToWishlist = (\r\n props: ILobasBuyboxViewProps & ILobasBuyboxProps,\r\n state: IBuyboxState,\r\n callbacks: IBuyboxCallbacks\r\n): JSX.Element | null => {\r\n const product = props.data.product.result;\r\n if (!props.addToWishlist || !product) {\r\n return null;\r\n }\r\n\r\n const wishlistButton = renderAddtoWishlistButton(props, state, callbacks, product);\r\n\r\n if (\r\n !props.config.hideAddToWishlist ||\r\n (props.config.hideAddToWishlist &&\r\n props.context.request.user.isAuthenticated &&\r\n ((props.context.request.user.customerAccountNumber !== null && props.context.request.user.customerAccountNumber !== '') ||\r\n props.context.request.user.isOBORequest))\r\n ) {\r\n return (\r\n \r\n {props.addToWishlist.errorBlock}\r\n {wishlistButton}\r\n \r\n );\r\n } else {\r\n return <>;\r\n }\r\n};\r\n\r\n/**\r\n * RRenderShopSimilarItem.\r\n * @param shopSimilarItem - ShopSimilarItem.\r\n * @returns -- Returns.\r\n */\r\nconst renderShopSimilarItem = (shopSimilarItem: IBuyboxShopSimilarLookViewProps): JSX.Element => {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\r\n const { ContainerProps, errors, input } = shopSimilarItem;\r\n\r\n return (\r\n \r\n {errors}\r\n {input}\r\n \r\n );\r\n};\r\nconst _renderSocialShare = (socialShare: React.ReactNode[]): JSX.Element | undefined => {\r\n if (!socialShare || socialShare.length === 0) {\r\n return undefined;\r\n }\r\n\r\n return <>{socialShare[0]};\r\n};\r\n\r\n/**\r\n * RenderConfigureDropdown.\r\n * @param dropdown - Buybox product configure dropdown view props.\r\n * @returns -- Returns JSX.Element.\r\n */\r\nconst renderConfigureDropdown = (dropdown: IBuyboxProductConfigureDropdownViewProps): JSX.Element => {\r\n const { ContainerProps, LabelContainerProps, heading, errors, select } = dropdown;\r\n\r\n return (\r\n \r\n {heading}\r\n {select}\r\n {errors}\r\n \r\n );\r\n};\r\n\r\nconst renderLobasConfigureDropdown = (dropdown: IBuyboxProductConfigureDropdownViewProps): JSX.Element => {\r\n const { ContainerProps, errors, select } = dropdown;\r\n\r\n return (\r\n \r\n {select}\r\n {errors}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * RenderConfigure.\r\n * @param configure - Buybox product configure view props.\r\n * @returns -- Returns JSX.Element.\r\n */\r\nconst renderConfigure = (configure: IBuyboxProductConfigureViewProps): JSX.Element => {\r\n const { ContainerProps, dropdowns } = configure;\r\n\r\n return {dropdowns.map(renderConfigureDropdown)};\r\n};\r\n\r\nconst renderLobasConfigure = (configure: IBuyboxProductConfigureViewProps): JSX.Element => {\r\n const { ContainerProps, dropdowns } = configure;\r\n\r\n return {dropdowns.map(renderLobasConfigureDropdown)};\r\n};\r\n\r\nconst _renderPriceSection = (props: ILobasBuyboxViewProps & ILobasBuyboxProps): JSX.Element => {\r\n if (\r\n !props.config.hidePrice ||\r\n (props.config.hidePrice &&\r\n props.context.request.user.isAuthenticated &&\r\n ((props.context.request.user.customerAccountNumber !== null && props.context.request.user.customerAccountNumber !== '') ||\r\n props.context.request.user.isOBORequest))\r\n ) {\r\n return (\r\n \r\n
{props.resources.priceLabel}
\r\n {props.price}\r\n
\r\n );\r\n } else {\r\n return <>;\r\n }\r\n};\r\n\r\n/*const _renderSimilarItemsSection = (props: ILobasBuyboxViewProps & ILobasBuyboxProps): JSX.Element => {\r\n const { shopSimilarLook, shopSimilarDescription, resources } = props;\r\n\r\n if (!props.config.hideMoreWaysToShop || (props.config.hideMoreWaysToShop && props.context.request.user.isAuthenticated)) {\r\n return (\r\n \r\n
{resources.shopLabel}
\r\n {shopSimilarLook && renderShopSimilarItem(shopSimilarLook)}\r\n {shopSimilarDescription && renderShopSimilarItem(shopSimilarDescription)}\r\n
\r\n );\r\n } else {\r\n return <>;\r\n }\r\n};*/\r\n\r\n/**\r\n * BuyboxView.\r\n * @param props - Props.\r\n * @returns -- Returns.\r\n */\r\nconst buyboxView: React.FC> = props => {\r\n const {\r\n ModuleProps,\r\n MediaGalleryContainerProps,\r\n ProductInfoContainerProps,\r\n addToCart,\r\n addToOrderTemplate,\r\n addToWishlist,\r\n productComparisonButton,\r\n configure,\r\n description,\r\n findInStore,\r\n quantity,\r\n title,\r\n rating,\r\n shopSimilarLook,\r\n shopSimilarDescription,\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from Buybox.tsx file\r\n max,\r\n unitOfMeasure,\r\n callbacks,\r\n state,\r\n resources,\r\n quantityLimitsMessages,\r\n telemetryContent,\r\n app: { config: appConfig },\r\n catalogs,\r\n lobasConfigure,\r\n inventoryLabel\r\n } = props;\r\n let skuText: string = props.resources.sKULabel;\r\n skuText += props.data.product.result?.ItemId;\r\n\r\n const preferredStoreInfo: IStoreInfo | undefined = props.data.storeSelectorStateManager.result?.preferredStore;\r\n const preferredStoreId = preferredStoreInfo?.StoreId ? preferredStoreInfo.StoreId : '';\r\n const preferredStoreName = preferredStoreInfo?.StoreName ? preferredStoreInfo.StoreName : '';\r\n\r\n const [availability, setAvailability] = React.useState('');\r\n const [isStoreChange, setIsStoreChange] = React.useState(false);\r\n\r\n /**\r\n * GetStockInventoryLabel.\r\n * @param availabilityWithHours - Stock availability with hours.\r\n * @returns -- Returns.\r\n */\r\n const getStockInventoryLabel = (availabilityWithHours: IFullOrgUnitAvailability | undefined): string | undefined => {\r\n if (availabilityWithHours && ArrayExtensions.hasElements(availabilityWithHours.ProductInventoryInformation)) {\r\n for (const productInventoryInformation of availabilityWithHours.ProductInventoryInformation) {\r\n if (\r\n availabilityWithHours.OrgUnitAvailability?.OrgUnitLocation?.InventoryLocationId ===\r\n productInventoryInformation.InventLocationId\r\n ) {\r\n return productInventoryInformation.StockLevelLabel;\r\n }\r\n }\r\n }\r\n\r\n return undefined;\r\n };\r\n\r\n const getInventory = React.useCallback(async () => {\r\n const input = new GetFullAvailableInventoryNearbyInput(\r\n props.data.product.result?.RecordId,\r\n BuyBoxConstants.zero,\r\n BuyBoxConstants.zero,\r\n BuyBoxConstants.zero,\r\n BuyBoxConstants.zero,\r\n true\r\n );\r\n\r\n /**\r\n * IsProductInStock.\r\n * @param itemAvailabilities - Item availability array.\r\n * @returns -- Returns.\r\n */\r\n const isProductInStock = (itemAvailabilities: ItemAvailability[] | undefined): boolean => {\r\n if (!appConfig.enableStockCheck) {\r\n return true;\r\n }\r\n\r\n if (ArrayExtensions.hasElements(itemAvailabilities)) {\r\n return itemAvailabilities[BuyBoxConstants.zero].AvailableQuantity! > BuyBoxConstants.zero;\r\n }\r\n\r\n return false;\r\n };\r\n\r\n await getFullAvailableInventoryNearby(input, props.context.actionContext)\r\n .catch((error: Error) => {\r\n props.telemetry.error(error.message);\r\n })\r\n .then(response => {\r\n if (response && ArrayExtensions.hasElements(response)) {\r\n const isPreferredStore = (value: IFullOrgUnitAvailability) =>\r\n value.OrgUnitAvailability?.OrgUnitLocation?.OrgUnitNumber === preferredStoreId;\r\n const filteredFullOrgUnitAvailability = response.filter(isPreferredStore);\r\n const preferredStoreAvailability = ArrayExtensions.hasElements(filteredFullOrgUnitAvailability)\r\n ? filteredFullOrgUnitAvailability[BuyBoxConstants.zero]\r\n : undefined;\r\n const stockStatusLabel: string | undefined = getStockInventoryLabel(preferredStoreAvailability);\r\n const isInStock = isProductInStock(preferredStoreAvailability?.OrgUnitAvailability?.ItemAvailabilities);\r\n const resourceLabel = isInStock ? props.resources.inStockText : props.resources.outOfStockText;\r\n const stockText: string | undefined = stockStatusLabel ? stockStatusLabel : resourceLabel;\r\n const preferredStoreAvailabilityText = `${format(\r\n props.resources.availabilityAtPreferredStoreText,\r\n preferredStoreName\r\n )} ${stockText}`;\r\n setAvailability(preferredStoreAvailabilityText);\r\n }\r\n });\r\n\r\n setIsStoreChange(false);\r\n }, [\r\n props.data.product.result?.RecordId,\r\n appConfig.enableStockCheck,\r\n preferredStoreId,\r\n preferredStoreName,\r\n props.context.actionContext,\r\n props.resources.availabilityAtPreferredStoreText,\r\n props.resources.inStockText,\r\n props.resources.outOfStockText,\r\n props.telemetry\r\n ]);\r\n\r\n React.useEffect(() => {\r\n if (props.config.displayStockAvailability) {\r\n getInventory().catch((error: Error) => {\r\n props.telemetry.error(error.message);\r\n });\r\n }\r\n }, [getInventory, isStoreChange, props.telemetry, props.config.displayStockAvailability]);\r\n\r\n reaction(\r\n () => props.data.storeSelectorStateManager.result?.selectedStoreLocationId,\r\n () => {\r\n setIsStoreChange(true);\r\n }\r\n );\r\n\r\n /**\r\n * RenderAvailabiltyAtPreferredStore.\r\n * @returns -- Returns.\r\n */\r\n const renderAvailabilityAtPreferredStore = (): JSX.Element | undefined => {\r\n const hasProductDimensions = ArrayExtensions.hasElements(props.data.product.result?.Dimensions);\r\n if (hasProductDimensions && props.data.product.result?.MasterProductId === undefined) {\r\n return undefined;\r\n }\r\n const containerProps: INodeProps = {\r\n className: 'ms-buybox__preferred-store-availability',\r\n tag: 'span'\r\n };\r\n\r\n return {availability};\r\n };\r\n\r\n return (\r\n \r\n \r\n {props.mediaGallery}\r\n {lobasConfigure && renderLobasConfigure(lobasConfigure)}\r\n {ArrayExtensions.hasElements(props.slots.productDescription) ? (\r\n {props.slots.productDescription[0]}\r\n ) : null}\r\n \r\n \r\n {catalogs && catalogs[0].Name}\r\n {title}\r\n \r\n
{skuText}
\r\n {rating}\r\n
\r\n \r\n
{resources.descriptionLabel}
\r\n {description}\r\n
\r\n {_renderPriceSection(props)}\r\n \r\n {configure && renderConfigure(configure)}\r\n {quantity &&\r\n renderQuantity(\r\n quantity,\r\n callbacks,\r\n props,\r\n state,\r\n resources,\r\n quantityLimitsMessages,\r\n max,\r\n telemetryContent,\r\n unitOfMeasure,\r\n configure\r\n )}\r\n {(!props.config.hideInventoryStatus ||\r\n (props.config.hideInventoryStatus &&\r\n props.context.request.user.isAuthenticated &&\r\n ((props.context.request.user.customerAccountNumber !== null &&\r\n props.context.request.user.customerAccountNumber !== '') ||\r\n props.context.request.user.isOBORequest))) &&\r\n inventoryLabel}\r\n {props.bulkPurchaseLink}\r\n \r\n {props.config.displayStockAvailability && preferredStoreId && renderAvailabilityAtPreferredStore()}\r\n {/* {inventoryLabel} */}\r\n {renderAddToCart(props, addToCart)}\r\n {findInStore && renderFindInStore(findInStore)}\r\n {addToWishlist && renderAddToWishlist(props, state, callbacks)}\r\n {productComparisonButton}\r\n {addToOrderTemplate && renderAddToOrderTemplate(props, state, callbacks)}\r\n {findInStore?.productPickupOptionList ? (\r\n
{findInStore.productPickupOptionList}
\r\n ) : null}\r\n {_renderSocialShare(props.slots && props.slots.socialShare)}\r\n \r\n {shopSimilarLook && renderShopSimilarItem(shopSimilarLook)}\r\n {shopSimilarDescription && renderShopSimilarItem(shopSimilarDescription)}\r\n \r\n {ArrayExtensions.hasElements(props.slots.productSpecification) ? (\r\n {props.slots.productSpecification[0]}\r\n ) : null}\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default buyboxView;\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['lobas-buybox'] = {\n c: () => require('partner/modules/lobas-buybox/lobas-buybox.tsx'),\n $type: 'containerModule',\n da: [{name:'cart', path:'@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action', runOn: 0},{name:'channelDeliveryOptionConfig', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration', runOn: 0},{name:'customerInformation', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer', runOn: 0},{name:'deliveryOptions', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-selected-variant', runOn: 0},{name:'featureState', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state', runOn: 0},{name:'orderTemplates', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/order-templates/get-order-templates-preview', runOn: 1},{name:'product', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant', runOn: 0},{name:'productAvailableQuantity', path:'actions/get-product-availabilities-for-selected-variant', runOn: 0},{name:'productDimensions', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-dimensions-for-selected-variant', runOn: 0},{name:'productPrice', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-price-for-selected-variant', runOn: 0},{name:'ratingsSummary', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-ratings-summary', runOn: 1},{name:'storeSelectorStateManager', path:'@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action', runOn: 1},{name:'wishlists', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'lobas-buybox',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/lobas-buybox'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action';\n let dataAction = require('@msdyn365-commerce-modules/bopis-utilities/dist/lib/store-selector-state-manager/store-selector-state-manager-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-channel-delivery-option-configuration');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-customer');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-delivery-options-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-dimensions-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-dimensions-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-feature-state');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-price-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-price-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-ratings-summary';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-ratings-summary');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-wishlist-by-customer-id');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/order-templates/get-order-templates-preview';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/order-templates/get-order-templates-preview');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action';\n let dataAction = require('@msdyn365-commerce/global-state/dist/lib/data-actions/cart-state-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = 'actions/get-product-availabilities-for-selected-variant';\n let dataAction = require('partner/actions/get-product-availabilities-for-selected-variant');\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|lobas-buybox|lobas-buybox'] = {\n c: () => require('partner/modules/lobas-buybox/lobas-buybox.view.tsx'),\n cn: '__local__-__local__-lobas-buybox'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport MsDyn365, { IActionContext } from '@msdyn365-commerce/core';\nimport { action, computed, observable } from 'mobx';\n\nimport {\n IListMapViewState,\n ILoadMapApiInput,\n IStoreInfo,\n IStoreSelectionStateContext,\n IStoreSelectorLocation,\n IStoreSelectorStateManager\n} from './i-store-selection-state-manager';\n\n/**\n * Abstract instance of IStoreSelectorStateManager with base implementation\n * of everything except the geoLocate function.\n */\nexport abstract class BaseStoreSelectorStateManager implements IStoreSelectorStateManager {\n @computed public get isDialogOpen(): Readonly {\n return this._context !== undefined;\n }\n\n @computed public get context(): Readonly {\n return this._context;\n }\n\n @observable public isMapApiLoaded?: boolean;\n\n @observable public selectedStoreLocationId?: string;\n\n @observable public preferredStore?: IStoreInfo;\n\n @observable public listMapViewState: IListMapViewState = { displayList: true, displayMap: false };\n\n @observable public isMapModuleLoaded?: boolean;\n\n @observable public lastInlineShownStoreInfo?: IStoreInfo;\n\n @observable protected _context?: IStoreSelectionStateContext;\n\n private readonly preferredStoreLocalStorageKey: string = '_msdyn365__preferredStore_';\n\n constructor() {\n this.isMapModuleLoaded = false;\n const value = this._readFromToCookie(this.preferredStoreLocalStorageKey);\n try {\n const storeInfo: IStoreInfo | undefined = value ? JSON.parse(value) : undefined;\n if (storeInfo) {\n this.preferredStore = storeInfo;\n }\n } catch {\n this.preferredStore = undefined;\n }\n }\n\n public abstract geoLocate(searchTerm: string, actionContext: IActionContext): Promise;\n\n public abstract loadMapApi(input: ILoadMapApiInput): Promise;\n\n @action\n public async toggleListMapViewState(): Promise {\n this.listMapViewState = {\n displayList: !this.listMapViewState.displayList,\n displayMap: !this.listMapViewState.displayMap\n };\n }\n\n @action\n public async setMapModuleLoaded(input: boolean): Promise {\n this.isMapModuleLoaded = input;\n }\n\n @action\n public async setOrgUnitStoreInformation(input: IStoreSelectionStateContext): Promise {\n this._context = input;\n }\n\n @action\n public async setSelectedStoreLocationId(storeId: string | undefined): Promise {\n this.selectedStoreLocationId = storeId;\n }\n\n @action\n public async setPreferredStoreLocation(\n storeId?: string,\n storeName?: string | undefined,\n writeToCookie: boolean = false,\n latitude?: number,\n longitude?: number\n ): Promise {\n const storeInfo: IStoreInfo = { StoreId: storeId, StoreName: storeName, Latitude: latitude, Longitude: longitude };\n this.preferredStore = storeInfo;\n if (writeToCookie) {\n this._writeToCookie(this.preferredStoreLocalStorageKey, JSON.stringify(storeInfo));\n }\n }\n\n @action\n public async setLastInlineStoreInfo(latitude?: number, longitude?: number): Promise {\n const storeInfo: IStoreInfo = { StoreId: '', StoreName: '', Latitude: latitude, Longitude: longitude };\n this.lastInlineShownStoreInfo = storeInfo;\n }\n\n @action\n public async clearPreferredStore(writeToCookie: boolean): Promise {\n this.preferredStore = undefined;\n if (writeToCookie) {\n this._removeCookie(this.preferredStoreLocalStorageKey);\n }\n }\n\n @action\n public async openDialog(input: IStoreSelectionStateContext): Promise {\n if (this._context && this._context.id === input.id) {\n throw new Error('Dialog is already opened');\n }\n\n this._context = input;\n }\n\n @action\n public async closeDialog(): Promise {\n this._context = undefined;\n }\n\n private _removeCookie(key: string): void {\n if (!key) {\n return;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n storage.removeItem(key);\n }\n }\n\n private _writeToCookie(key: string, value: string | undefined): void {\n if (!key || !value) {\n return;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n storage.setItem(key, value);\n }\n }\n\n private _readFromToCookie(key: string): string | undefined {\n if (!key) {\n return undefined;\n }\n if (MsDyn365.isBrowser) {\n const storage = window.localStorage;\n const cookieValue = storage.getItem(key);\n if (cookieValue) {\n return cookieValue;\n }\n }\n\n return undefined;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport { StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { action } from 'mobx';\n\nimport { BaseStoreSelectorStateManager } from './base-store-selector-state-manager';\nimport { ILoadMapApiInput, IStoreSelectorLocation } from './i-store-selection-state-manager';\nimport { IMapWindow, MapLocationsResult } from './models/map-data';\n\ndeclare const window: IMapWindow;\n\n/**\n * Instance of IStoreSelectorStateManager manager that uses Map service\n * for geo location.\n */\nexport class MapStoreSelectorStateManager extends BaseStoreSelectorStateManager {\n private readonly SERVICE_ENDPOINT: string = 'https://dev.virtualearth.net/REST/v1/';\n\n private readonly MAP_API_ENDPOINT: string = 'https://www.bing.com/api/maps/mapcontrol?callback=mapAPIReady';\n\n @action\n public async geoLocate(searchTerm: string, actionContext: IActionContext): Promise {\n if (\n !searchTerm ||\n !actionContext.requestContext.channel ||\n !actionContext.requestContext.channel.BingMapsApiKey ||\n !actionContext.requestContext.channel.BingMapsEnabled\n ) {\n return undefined;\n }\n\n let searchContent: string = searchTerm;\n\n const jsonp = `mapSearchCallback_${crypto.getRandomValues(new Uint32Array(1))[0]}`;\n\n if (actionContext.requestContext.channel.ChannelCountryRegionISOCode) {\n searchContent = `${searchTerm.trim()} ${actionContext.requestContext.channel.ChannelCountryRegionISOCode}`;\n }\n\n const query = encodeURI(searchContent);\n const key = encodeURI(actionContext.requestContext.channel.BingMapsApiKey);\n\n const geolocationApiUrl =\n actionContext.requestContext.app &&\n actionContext.requestContext.app.config &&\n actionContext.requestContext.app.config.geolocationApiUrl;\n const requestUrl = `${\n geolocationApiUrl ? geolocationApiUrl : this.SERVICE_ENDPOINT\n }/Locations?query=${query}&key=${key}&jsonp=${jsonp}`;\n\n return new Promise(resolve => {\n const script = document.createElement('script');\n script.setAttribute('type', 'text/javascript');\n script.setAttribute('src', requestUrl);\n\n window[jsonp] = (data: MapLocationsResult) => {\n delete window[jsonp];\n script.remove();\n\n if (data && data.resourceSets && data.resourceSets.length > 0 && data.resourceSets[0].resources.length > 0) {\n resolve({\n latitude: data.resourceSets[0].resources[0].point.coordinates[0],\n longitude: data.resourceSets[0].resources[0].point.coordinates[1]\n });\n }\n\n resolve(undefined);\n };\n\n document.body.appendChild(script);\n });\n }\n\n @action\n public async loadMapApi(input: ILoadMapApiInput): Promise {\n if (StringExtensions.isNullOrEmpty(input.key)) {\n return Promise.resolve();\n }\n\n const isScriptAlreadyLoaded = !!document?.getElementById('msdyn_map-api-script');\n\n if (isScriptAlreadyLoaded) {\n // Prevents from loading multiple script into the body\n return Promise.resolve();\n }\n\n const url = `${this.MAP_API_ENDPOINT}${input.key ? `&key=${input.key}` : ''}${input.lang ? `&setLang=${input.lang}` : ''}${\n input.market ? `&setMkt=${input.market}` : ''\n }`;\n\n return new Promise((resolve, reject) => {\n const script = document?.createElement('script');\n script.type = 'text/javascript';\n script.async = true;\n script.defer = true;\n script.src = url;\n script.id = 'msdyn_map-api-script';\n if (window) {\n window.mapAPIReady = () => {\n this.isMapApiLoaded = true;\n resolve();\n };\n }\n script.addEventListener('error', (error: string | Event) => {\n reject(error);\n });\n document?.body?.appendChild(script);\n });\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createObservableDataAction, IAction, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\nimport { GenericInput, getGenericAction } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { IStoreSelectorStateManager } from './i-store-selection-state-manager';\nimport { MapStoreSelectorStateManager } from './map-store-selector-state-manager';\n\nexport function createStoreSelectorStateInput(result: IStoreSelectorStateManager): GenericInput {\n return new GenericInput('mapSSSM', result, 'IStoreSelectorStateManager');\n}\n\nconst createStoreSelectorStateInputInternal = (inputData: ICreateActionContext>): IActionInput => {\n return createStoreSelectorStateInput(new MapStoreSelectorStateManager());\n};\n\nexport const getGenericActionDataAction = createObservableDataAction({\n action: >getGenericAction,\n input: createStoreSelectorStateInputInternal\n});\n\nexport default getGenericActionDataAction;\n","module.exports = React;","module.exports = ReactDOM;"],"names":["DeliveryMode","InventoryLevels","InventoryLevelValues","displayLabelEnabled","context","inventoryCode","requestContext","app","config","inventoryRanges","available","outOfStock","mapProductInventoryInformation","productsWarehouseInventory","productInventoryInformation","length","product","inventoryLevel","physicalAvailable","physicalProductMap","mapInventoryWithPhysicalBufferEnabled","push","totalAvailable","totalAvailableProductMap","mapInventoryWithTotalAvailableBufferEnabled","productMap","mapInventoryWithThresholdEnabled","productWarehouseInventoryAvailability","ProductId","undefined","TotalAvailable","productQty","outOfStockThreshold","productAvailableQuantity","AvailableQuantity","ProductAvailableQuantity","IsProductAvailable","InventLocationId","shouldRenderLabel","PhysicalAvailableInventoryLevelCode","productQuantity","_productWarehouseInve","MaximumPurchasablePhysicalAvailableQuantity","PhysicalAvailable","StockLevelCode","StockLevelLabel","PhysicalAvailableInventoryLevelLabel","TotalAvailableInventoryLevelCode","_productWarehouseInve2","MaximumPurchasableTotalAvailableQuantity","TotalAvailableInventoryLevelLabel","isAggregatedInventory","warehouseAggregation","mapAggregatedProductInventoryInformation","productWarehouseInventoryInformation","_productWarehouseInve3","AggregatedProductInventoryAvailabilities","map","_product$MaximumPurch","_product$MaximumPurch2","DataAreaId","PhysicalAvailableQuantity","TotalAvailableQuantity","ProductWarehouseInventoryAvailabilities","createInventoryAvailabilitySearchCriteria","productIds","isDefaultWareHouse","isFilterByChannelFulfillmentGroup","searchArea","defaultDeliveryMode","deliveryMode","shipping","inventoryAvailabilitySearchCriteria","ProductIds","QuantityUnitTypeValue","SearchArea","FilterByChannelFulfillmentGroup","DeliveryModeTypeFilterValue","DefaultWarehouseOnly","ProductAvailabilitiesForSelectedVariantInput","constructor","productId","channelId","getCacheKey","getCacheObjectType","dataCacheType","this","createProductAvailabilitiesForSelectedVariantInput","inputData","getSelectedProductIdFromActionInput","apiSettings","Error","async","getProductAvailabilitiesForSelectedVariantAction","input","ctx","selectedVariantInput","SelectedVariantInput","productResult","getSelectedVariant","ItemTypeValue","ReleasedProductType","shippingSearchCriteria","RecordId","pickupSearchCriteria","pickup","shippingAvailability","ProductsDataActions","callerContext","shippingInventory","ArrayExtensions","deliveryType","pickupAvailability","pickupInventory","error","telemetry","exception","debug","mergeProductWarehouseToProductAvailabities","productAvailable","getProductAvailabilitiesForSelectedVariantActionDataAction","createObservableDataAction","id","action","modalCloseButtonReference","React","onClickFindInStoreHandler","props","state","callbacks","_props$data","_props$data$featureSt","_props$data$featureSt2","_props$data$featureSt3","data","storeSelectorStateManager","result","cart","resources","modules","selectedProduct","quantity","dataProduct","multiplePickupStoreSwitchName","retailMulitplePickupMFeatureState","featureState","find","Name","IsEnabled","missingDimensions","Dimensions","filter","dimension","DimensionValue","Value","storeSelectorId","Object","keys","storeSelector","updateErrorState","errorHost","configureErrors","getConfigureErrors","openDialog","parentElementRef","deliveryOptions","onLocationSelected","orgUnitLocation","_props$context","_props$context$app","_props$context$app$co","Promise","resolve","behavior","addToCartBehavior","addProductToCart","count","location","then","status","substatus","productAvailability","changeModalOpen","failureResult","failureReason","cartActionResult","otherError","getGenericError","navigationUrl","getUrlSync","actionContext","AddToCartBehavior","window","assign","_props$data$productPr2","defaultImageSettings","viewports","xs","q","w","h","lg","xl","lazyload","disableLazyLoad","telemetryContent","getTelemetryObject","request","telemetryPageName","friendlyName","dialogStrings","goToCartText","buyBoxGoToCartText","continueShoppingText","buyBoxContinueShoppingText","closeNotificationLabel","headerItemOneText","buyBoxSingleItemText","headerItemFormatText","buyBoxMultiLineItemFormatText","headerMessageText","buyBoxHeaderMessageText","freePriceText","priceFree","originalPriceText","currentPriceText","addedQuantityText","notification","ItemSuccessfullyAddedToCartNotification","gridSettings","productPrice","typeName","NotificationsManager","addNotification","catch","message","findInStoreOnClick","getBuyboxFindInStore","_data$product","_data$productPrice","_data$cart","_data$deliveryOptions","_data$productAvailabl","_data$featureState","_data$featureState$re","_data$featureState$re2","_data$channelDelivery","_product$Dimensions","_props$data$product","_props$data$productPr","slots","findInStoreHeaderText","descriptionTextToShowAllPickupOptions","channel","PickupDeliveryModeCode","price","channelDeliveryOptionConfig","_dimension$DimensionV","errorState","quantityError","modalOpen","isSectionDisabled","buttonText","description","isStockCheck","buyboxResources","isLoading","findInStoreLinkText","findInStoreDescriptionText","_pickupInventory","findInStoreNotAvailableTextButton","findInStoreNotAvailableDescription","getFindInStoreInventorySettings","enableStockCheck","DeliveryOptions","matchDeliveryOptions","productdeliveryOptions","storePickUpOptionList","deliveryOption","delivery","deliveryCode","Code","PickupDeliveryModeCodes","option","priceComponent","PriceComponent","popupProps","className","imageSettings","setModalOpen","renderModalPopup","Popup","ContainerProps","openFindInStoreDialog","heading","Heading","headingTag","text","productPickupOptionList","item","Description","key","errors","BuyboxErrorBlock","showError","button","onClick","color","ref","disabled","modal","getBuyBoxInventoryLabel","productDetails","_props$data$productAv","_props$data$productAv2","productSelected","toLocaleLowerCase","_getClassNamePrefix","inventoryAvailability","inventoryOutOfStock","inventoryClassName","toLowerCase","getInventoryQty","inventory","qtyAvailable","step","Math","log10","floor","ceil","denom","pow","LobasSelectionType","LOBASSingleSlideCarousel","super","carouselSize","slideSize","itemSize","flipperNextLabel","flipperPrevLabel","_onResized","_onCarouselResized","_nextSlide","bind","_previousSlide","_handleTouchStart","_handleTouchEnd","_onFocus","showPrevious","showNext","offset","slideRef","itemRef","direction","parentId","scrollThreshold","touchScrollThreshold","componentDidUpdate","carousel","current","slide","_setSizes","_updateFlippers","componentDidMount","vertical","resizeThrottledEventHandler","addThrottledEvent","componentWillUnmount","removeEventListener","render","isVert","slidePositionStyle","modifiedChildren","_getClonedChildren","carouselClass","carouselSlideClass","overflowClass","previousFlipperGlyph","nextFlipperGlyph","previousFlipperClassName","nextFlipperClassName","disableClassName","onTouchStart","onTouchEnd","Flipper","glyphProps","displayTooltip","telemetryLabel","style","role","useTabList","children","child","index","castChild","verticalItemsSelector","itemsSelector","onFocus","_moveSingleSlide","evt","touches","scrollStart","screenY","screenX","changedTouches","delta","next","currentOffset","Number","parseInt","getCSS","maxScrollCount","directionModifier","isNaN","max","maxScrollDistance","distanceToEdge","abs","round","scrollHeight","scrollWidth","parentElement","getBoundingClientRect","left","_calculateCarouselSize","carouselStyle","getComputedStyle","padding","parseFloat","paddingTop","paddingBottom","paddingLeft","paddingRight","clientHeight","clientWidth","_canScrollPrevious","_canScrollNext","setState","_scrollItemIntoView","offsetTop","offsetLeft","updateOffset","top","setTimeout","scrollTop","scrollLeft","event","target","currentTarget","min","LobasDropdown","defaultThumbnailImageSettings","cropFocalRegion","_onClicked","value","selectedIndex","onChange","dropdownId","selectId","selectedValue","preventDefault","_renderThumbnails","thumbnails","ThumbnailsContainerProps","SingleSlideCarouselComponentProps","items","Node","_renderThumbnailItem","thumbnail","ThumbnailItemContainerProps","Picture","_getThumbnailItem","image","tabIndex","modifiedActiveIndex","tag","classnames","altText","Image","fallBackSrc","fallbackImage","loadFailureBehavior","imageFallbackOptimize","bypassHideOnFailure","selectedItem","dropdownList","isDefault","getFallbackImageUrl","ItemId","_renderDropdown","mediaGalleryThumbnailCarouselItems","_getMediaGalleryThumbnailItems","Thumbnails","JSON","stringify","_this$props$product$I","_this$props$product","itemId","mediaGalleryItems","dropdown","src","baseImageUrl","name","thumbnailImageSettings","qe","sm","_this$props$dropdownL","getLobasBuyboxProductConfigure","selectedDimensions","_props$data$productDi","_props$data$productDi2","getDropdownName","productDimensionsData","productDimensions","hasProductDimensions","onChanged","_onChanged","dimensionSelectedAsync","dimensionsInfo","productDimensionFull","_ref","_productDimensionFull","dropdownName","DimensionTypeValue","toString","dimensionValuesWithInventory","DimensionValues","_value$DimensionValue","_value$DimensionValue2","ObjectExtensions","_dimensionValuesWithI","_dimensionValue$Value","_dimensionValue$Dimen","dimensionValue","inventoryLevelCode","getInventoryLevelCodeFromDimensionValue","DimensionId","colorHexCode","ColorHexCode","imageUrl","ImageUrl","isDisabled","swatchItemAriaLabel","matchedDimensions","getDimensionValuesFromQuery","url","requestUrl","dimensionInfo","currentDimensionsFromQuery","dimensionFromQuery","currentDimensionFromQuery","selectedDimensionItem","dimensionItem","_currentDimensionFrom","_currentDimensionFrom2","dropdowns","dimensionId","dropdownToggleName","format","selectDimensionFormatString","errorMessage","dimensionSelectionType","dimensionType","convertProductDimensionTypeToDimensionTypes","dimensionsAsSwatchConfiguration","dimensionsAsSwatchType","includes","DimensionTypes","swatch","LabelContainerProps","htmlFor","select","dropdownCallback","selectionType","mapProductDimensionFullToDropdownViewProps","_objectSpread","dimensionChanged","SelectionType","Dropdown","selectMenu","_selectSwatch","innerText","payLoad","getPayloadObject","shouldComponentUpdate","nextProps","nextState","_renderSwatch","attribute","getTelemetryAttributes","selected","hidden","swatchItems","SwatchComponent","list","onSelectItem","getBuyboxProductConfigure","Buybox","dimensionUpdateQueue","FinitePromiseQueue","dimensions","buyboxCallbacks","updateQuantity","newQuantity","newErrorState","updateSelectedProduct","newSelectedProduct","newInventory","newPrice","newDeliveryOptions","productDeliveryOptions","_updatePrice","selectedDimensionId","selectedDimensionValueId","enqueue","_updateDimensions","FinitePromiseQueueError","_getDropdownName","isModalOpen","changeUpdatingDimension","isUpdatingDimension","changeUpdatingDeliveryOptions","isUpdatingDeliveryOptions","updateKeyInPrice","customPrice","customAmountError","isPriceKeyedIn","keyInPriceAmount","_onBulkPurchaseLinkClick","bulkPurchaseModule","boundingRect","scrollX","pageXOffset","scrollY","pageYOffset","scrollTo","_isChannelMultipleCatalogsFeatureEnabled","isMultipleCatalogFeatureEnabledInHq","_this$props$data$feat","_this$props$data$feat2","feature","dimensionsToUpdate","clearErrorState","previousState","_getProductVariant","productVariant","productVariantPromise","promises","_getDimensionsForSelectedVariant","mappedDimensions","_hydrateInventoryInfo","_hydratePrice","_hydrateDeliveryOptions","_updateQuantitiesInState","all","_this$props$data$prod","isGiftCard","IsGiftCard","productDimensionTypeColor","productDimensionTypeConfiguration","productDimensionTypeSize","productDimensionTypeAmount","productDimensionTypeStyle","isPriceApiCalled","isServiceItem","maxRecentlyViewedItemsCount","RecentlyViewedState","_this$props$data$prod2","mediaGallery","productComparisonButton","hasAvailableProducts","some","catalogId","getCatalogId","validateCatalogId","viewProps","ModuleProps","moduleProps","ProductInfoContainerProps","MediaGalleryContainerProps","title","getBuyboxProductTitle","getBuyboxProductDescription","bulkPurchaseLink","_renderBuyboxBulkPurchaseLink","unitOfMeasure","getBuyboxProductUnitOfMeasure","configure","lobasConfigure","findInStore","getBuyboxProductPrice","addToCart","getBuyboxAddToCart","getBuyboxProductComparisonButton","addToOrderTemplate","getBuyboxProductAddToOrderTemplate","addToWishlist","getBuyboxProductAddToWishlist","rating","hideRating","getBuyboxProductRating","getBuyboxProductQuantity","inventoryLabel","shopSimilarLook","enableShopSimilarLooks","getBuyboxShopSimilarButton","ShopSimiliarButtonType","shopSimilarDescription","enableShopSimilarDescription","keyInPrice","enableKeyInPrice","isCustomPriceSelected","getBuyboxKeyInPrice","quantityLimitsMessages","getQuantityLimitsMessages","isChannelMultipleCatalogsFeatureEnabled","currentCatalogId","catalogs","_validateCatalogDetails","renderView","isBulkPurchaseEnabled","msdyn365Commerce","bulkPurchaseModules","Array","from","document","getElementsByClassName","BulkPurchase","Button","bulkPurchaseLinkText","arguments","CustomerContextualPrice","_dimension$dimensionV","_dimensions$find$Dime","_dimensions$find","ExtensionProperties","setDimensionValuesToQuery","selectedProductPromise","MasterProductId","getDimensionsForSelectedVariant","GetDimensionsForSelectedVariantInput","_productVariant$Dimen","newAvailableQuantity","getProductAvailabilitiesForSelectedVariant","newShippingQuantity","getPriceForSelectedVariant","PriceForSelectedVariantInput","_this$props$data$feat3","retailMultiplePickupFeatureState","getDeliveryOptionsForSelectedVariant","GetDeliveryOptionsForSelectedVariantInput","isOrderQuantityLimitsFeatureEnabled","_isOrderQuantityLimitsFeatureEnabled","isChannelLimitsFeatureEnabled","_isChannelLimitsFeatureEnabled","_getMinQuantityForCartLineItem","_getMaxQuantityForCartLineItem","_product$Behavior","Behavior","MinimumQuantity","isQuantityLimitsFeatureEnabled","_product$Behavior2","MaximumQuantity","updateMaxQuantityForCartLineItem","maxQuantityForCartLineItem","_this$props$context","_this$props$context$r","_this$props$context$r2","_this$props$context$r3","_featureStatuses$find","defaultOrderQuantityLimitsFeatureConfig","platform","enableDefaultOrderQuantityLimits","featureStatuses","RetailDefaultOrderQuantityLimitsFeatureName","customerInfo","customerInformation","information","IsB2b","_this$props$data$cata","_this$props$data$cata2","_featureStatuses$find2","isChannelLimitsFeatureEnabledInHq","EcommerceQuantityLimitConfigurationsFeatureName","generateAddToOrderTemplateDialogResources","addToOrderTemplateHeader","noOrderTemplatesMessage","noOrderTemplatesDescription","createAnOrderTemplateButtonText","createNewOrderTemplateButtonText","cancelOrderTemplateCreationButtonText","selectTemplatesText","addToTemplateButtonText","lineItemsText","generateOrderTemplateNameDialogResources","orderTemplateHeaderLabel","createOrderTemplateHeader","orderTemplateTitleLabel","orderTemplateTitle","orderTemplateNameAriaLabel","orderTemplateDescription","createOrderTemplateDescription","defaultOrderTemplateName","orderTemplateButtonLabel","createOrderTemplateButtonText","orderTemplateCancelButtonLabel","cancelNewOrderTemplateCreationButtonText","generateItemAddedToOrderTemplateDialogResources","viewOrderTemplateButtonText","continueShoppingButtonText","itemAddedToOrderTemplateHeaderItemOneText","itemAddedToOrderTemplateHeaderItemFormatText","itemAddedToOrderTemplateHeaderMessageText","generateDuplicateItemsWhenAddingToOrderTemplateDialogResources","duplicatedProductsHeader","duplicatedProductsDescription","updateQuantityButtonText","cancelDuplicateItemsButtonText","onAddToOrderTemplateFailed","onChangeHandler","newValue","BuyBoxConstants","renderAddToOrderTemplate","orderTemplateButton","renderAddToOrderTemplateButton","orderTemplates","AddToOrderTemplateComponent","addToOrderTemplateButtonText","addToOrderTemplateButtonTooltip","addToOrderTemplateDialogResources","createOrderTemplateDialogResources","itemAddedToOrderTemplateDialogResources","duplicateItemsWhenAddingToOrderTemplateDialogResources","onError","shouldShowButtonFailedTooltip","showButtonTooltip","showButtonText","errorBlock","onAddToWishlistFailed","renderAddToWishlist","wishlistButton","renderAddtoWishlistButton","wishlists","AddToWishlistComponent","addToWishlistButtonText","removeFromWishlistButtonText","addToWishlistMessage","removedFromWishlistMessage","addItemToWishlistError","removeItemFromWishlistError","nameOfWishlist","ariaRole","getSelectedProduct","hideAddToWishlist","user","isAuthenticated","customerAccountNumber","isOBORequest","renderShopSimilarItem","shopSimilarItem","renderConfigureDropdown","renderLobasConfigureDropdown","_props$data$product$r","_props$data$storeSele","_props$data$product$r3","appConfig","skuText","sKULabel","preferredStoreInfo","preferredStore","preferredStoreId","StoreId","preferredStoreName","StoreName","availability","setAvailability","isStoreChange","setIsStoreChange","getInventory","_props$data$product$r2","GetFullAvailableInventoryNearbyInput","zero","getFullAvailableInventoryNearby","response","_preferredStoreAvaila","isPreferredStore","_value$OrgUnitAvailab","_value$OrgUnitAvailab2","OrgUnitAvailability","OrgUnitLocation","OrgUnitNumber","filteredFullOrgUnitAvailability","preferredStoreAvailability","stockStatusLabel","availabilityWithHours","ProductInventoryInformation","_availabilityWithHour","_availabilityWithHour2","InventoryLocationId","getStockInventoryLabel","resourceLabel","itemAvailabilities","ItemAvailabilities","inStockText","outOfStockText","stockText","preferredStoreAvailabilityText","availabilityAtPreferredStoreText","displayStockAvailability","reaction","_props$data$storeSele2","selectedStoreLocationId","Module","renderLobasConfigure","productDescription","descriptionLabel","hidePrice","priceLabel","_renderPriceSection","renderConfigure","renderQuantity","quantityComponent","extentionResources","mainDiv","hideQty","IncrementalQuantity","currentCount","inputQuantityAriaLabel","decrementButtonAriaLabel","incrementButtonAriaLabel","minQuantityText","maxQuantityText","hideInventoryStatus","renderAvailabilityAtPreferredStore","_props$data$product$r4","_props$data$product$r5","renderAddToCart","hideAddToCart","renderFindInStore","socialShare","_renderSocialShare","productSpecification","binding","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","prototype","RegistrationId","c","require","$type","da","path","runOn","iNM","ns","n","p","pdp","md","__bindings__","viewDictionary","cn","BaseStoreSelectorStateManager","listMapViewState","displayList","displayMap","preferredStoreLocalStorageKey","isMapModuleLoaded","_readFromToCookie","storeInfo","parse","_unused","_context","storeId","storeName","writeToCookie","Latitude","Longitude","_writeToCookie","latitude","longitude","lastInlineShownStoreInfo","_removeCookie","MsDyn365","localStorage","removeItem","setItem","cookieValue","getItem","__decorate","computed","observable","MapStoreSelectorStateManager","SERVICE_ENDPOINT","MAP_API_ENDPOINT","searchTerm","BingMapsApiKey","BingMapsEnabled","searchContent","jsonp","crypto","getRandomValues","Uint32Array","ChannelCountryRegionISOCode","trim","query","encodeURI","geolocationApiUrl","script","createElement","setAttribute","remove","resourceSets","point","coordinates","body","appendChild","_document","StringExtensions","getElementById","lang","market","reject","_document2","_document3","_document3$body","type","defer","mapAPIReady","isMapApiLoaded","addEventListener","createStoreSelectorStateInput","GenericInput","getGenericActionDataAction","getGenericAction","module","exports","ReactDOM"],"sourceRoot":""}