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iH,cAAgB,CAAC,EAC9CjH,OAAOiH,aAAarB,QAAOrG,EAAAA,EAAA,GACpBS,OAAOiH,aAAarB,SAAW,CAAC,GAChCD,EAAQC,SAGX5F,OAAOiH,aAAapB,YAAWtG,EAAAA,EAAA,GAC5BS,OAAOiH,aAAapB,aAAe,CAAC,GACpCF,EAAQE,aAEY,MAAMqB,EAAiB,CAAC,EAC/BA,EAAe,2EAA6E,CACpGpB,EAAGA,IAAMC,EAAQ,MACjBoB,GAAI,6CAEpBnH,OAAOiH,aAAejH,OAAOiH,cAAgB,CAAC,EAC9CjH,OAAOiH,aAAaC,eAAc3H,EAAAA,EAAA,GACPS,OAAOiH,aAAaC,gBAAkB,CAAC,GACvCA,UCnF3BE,EAAOC,QAAU7I,cCAjB4I,EAAOC,QAAUC","sources":["webpack://Msdyn365.Commerce.Online/./src/actions/eCommSelectedFilter/ecomm-get-selected-filter-criterias.ts?cf57","webpack://Msdyn365.Commerce.Online/./src/components/breakpoints.ts?f4e7","webpack://Msdyn365.Commerce.Online/./src/modules/ecomm-side-bar-filter/ecomm-side-bar-filter.tsx?3ba9","webpack://Msdyn365.Commerce.Online/./src/modules/ecomm-side-bar-filter/ecomm-side-bar-filter.view.tsx?8ff1","webpack://Msdyn365.Commerce.Online/./lib/ecomm-side-bar-filter/module-registration.js?4036","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 * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\n\r\n/**\r\n * GetActivecategorymenustate Input Action\r\n */\r\nexport class GetCategoryFilterValuesInput implements Msdyn365.IActionInput {\r\n // TODO: Determine if the results of this get action should cache the results and if so provide\r\n // a cache object type and an appropriate cache key\r\n public getCacheKey = () => `CategoryFilter`;\r\n public getCacheObjectType = () => 'CategoryFilter';\r\n public dataCacheType = (): Msdyn365.CacheType => 'application';\r\n}\r\n\r\n// TODO: Create a data model here or import one to capture the response of the action\r\nexport interface IGetFilteredCategoryMenuStateData {\r\n filteredCategories: string[];\r\n}\r\n\r\n/**\r\n * TODO: Use this function to create the input required to make the action call\r\n */\r\nconst createInput = (args: Msdyn365.ICreateActionContext): Msdyn365.IActionInput => {\r\n return new GetCategoryFilterValuesInput();\r\n};\r\n\r\n/**\r\n * TODO: Use this function to call your action and process the results as needed\r\n */\r\nasync function getCategoryFilterValuesStateAction(input: GetCategoryFilterValuesInput, ctx: Msdyn365.IActionContext):Promise {\r\n // const apiSettings = Msdyn365.msdyn365Commerce.apiSettings;\r\n\r\n // TODO: Uncomment the below line to get the value from a service\r\n // const response = await Msdyn365.sendRequest('/get/example/id/1', 'get');\r\n return { filteredCategories: [] };\r\n}\r\n\r\nexport default Msdyn365.createObservableDataAction({\r\n action: >getCategoryFilterValuesStateAction,\r\n // TODO: Give your data action a unique id\r\n id: 'GetCategoryFilterValuesStateActionState',\r\n input: createInput\r\n // TODO: Uncomment the below line if this is a meant to be a batched data action\r\n // isBatched: true\r\n});","// <= 999 = Mobile\r\n// >= 1000 = Tablet and Desktop\r\n\r\nexport const enum Breakpoints {\r\n small = 540,\r\n medium = 768,\r\n large = 992\r\n}\r\n\r\nexport function isMobile (width: number): boolean {\r\n return width < Breakpoints.large;\r\n}","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as React from 'react';\r\n\r\nimport { CategoryHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport { ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport { searchByCategoryAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductsDataActions.g';\r\n\r\nimport { IEcommSideBarFilterData } from './ecomm-side-bar-filter.data';\r\nimport { IEcommSideBarFilterProps } from './ecomm-side-bar-filter.props.autogenerated';\r\n\r\nexport interface IEcommSideBarFilterViewProps extends IEcommSideBarFilterProps {\r\n filterNodes: any[];\r\n extendedNodes: string[];\r\n totalProducts: number;\r\n}\r\n\r\nexport interface IFilterTreeView {\r\n node?: ITreeViewNode[];\r\n}\r\n\r\nexport interface ITreeViewNode {\r\n value: string;\r\n label: string;\r\n name: string;\r\n children?: ITreeViewNode[];\r\n}\r\n\r\nexport interface IEcommSideBarFilterState {\r\n filterTreeNodesState: ITreeViewNode[];\r\n extendedNodes: string[];\r\n totalProducts: number;\r\n}\r\n\r\n/**\r\n *\r\n * EcommSideBarFilter component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass EcommSideBarFilter extends React.PureComponent, IEcommSideBarFilterState> {\r\n public state: IEcommSideBarFilterState = { filterTreeNodesState: [], extendedNodes: [], totalProducts: 0 };\r\n\r\n private extendedNodes: string[] = [];\r\n\r\n constructor(props: IEcommSideBarFilterProps) {\r\n super(props);\r\n\r\n this._getFilerTreeDataStructure(this.extendedNodes)\r\n .catch(error => {\r\n console.log('[EcommSideBarFilter]_getFilerTreeDataStructure error: ', error);\r\n });\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const SideBarFilerViewProps = {\r\n ...this.props,\r\n filterNodes: this.state.filterTreeNodesState,\r\n extendedNodes: this.state.extendedNodes,\r\n totalProducts: this.state.totalProducts\r\n };\r\n\r\n return this.props.renderView(SideBarFilerViewProps);\r\n }\r\n\r\n private async _getFilerTreeDataStructure(extended: string[]):Promise {\r\n const { data: { hierarchy } } = this.props;\r\n\r\n let retObject: ITreeViewNode[] = [];\r\n let totalProductNumber: number;\r\n\r\n let parentId = (window) && window.sessionStorage.getItem('qLink') !== null ? parseInt(window.sessionStorage.getItem('qLink')!) : 0;\r\n\r\n const url = window.location.href.split('/');\r\n const urlLastPart = url[url.length - 1];\r\n const urlSplit = urlLastPart.split('.');\r\n const urlCategoryID = urlSplit && urlSplit.length > 0 ? parseInt(urlSplit[0]) : 0;\r\n\r\n parentId = parentId !== urlCategoryID ? urlCategoryID : parentId; \r\n\r\n\r\n if (parentId === 0) {\r\n parentId = hierarchy.result!.find(item => item.Name?.toLowerCase() === this.props.config.category?.toLowerCase())?.RecordId!;\r\n }\r\n\r\n const promises = hierarchy.result!.map(async elem => {\r\n if (parentId === elem.RecordId) {\r\n totalProductNumber = await this._getCountByCategory(parentId);\r\n \r\n if (elem.hasOwnProperty('Children')) {\r\n for (const child of elem.Children) {\r\n await this._addNode(retObject, child, extended);\r\n }\r\n }\r\n }\r\n });\r\n\r\n Promise.all(promises).then(() => {\r\n this.setState({\r\n filterTreeNodesState: retObject,\r\n extendedNodes: extended,\r\n totalProducts: totalProductNumber\r\n });\r\n })\r\n .catch(error => {\r\n console.log('[_getFilerTreeDataStructure] error: ', error);\r\n });\r\n }\r\n\r\n private async _addNode(tree: ITreeViewNode[], node: CategoryHierarchy, extended: string[]): Promise {\r\n if (!node) {\r\n return [];\r\n }\r\n\r\n const totalProductNumber = await this._getCountByCategory(node.RecordId);\r\n\r\n let newTreeNode: ITreeViewNode = { value: '', label: '', name: '' };\r\n \r\n newTreeNode.value = node.RecordId.toString();\r\n newTreeNode.label = `${node.Name} (${totalProductNumber})`;\r\n newTreeNode.name = node.Name ? node.Name : '';\r\n\r\n // Add record to extended array.\r\n extended.push(node.RecordId.toString());\r\n\r\n if (node.hasOwnProperty('Children')) {\r\n newTreeNode.children = [];\r\n \r\n for (const elem of node.Children) {\r\n await this._addNode(newTreeNode.children, elem, extended);\r\n }\r\n }\r\n\r\n tree.push(newTreeNode);\r\n\r\n return tree;\r\n }\r\n\r\n private async _getCountByCategory(categoryId: number): Promise {\r\n const { context } = this.props;\r\n\r\n let productSearchResult: ProductSearchResult[];\r\n let ret = 0;\r\n\r\n productSearchResult = await searchByCategoryAsync({ callerContext: context.actionContext }, context.request.apiSettings.channelId, context.request.apiSettings.catalogId, categoryId);\r\n\r\n if (productSearchResult.length > 0) {\r\n ret = productSearchResult.length;\r\n }\r\n\r\n return ret;\r\n }\r\n}\r\n\r\nexport default EcommSideBarFilter;\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 React from 'react';\r\n\r\nimport Dropdown from 'react-bootstrap/Dropdown';\r\nimport DropdownButton from 'react-bootstrap/DropdownButton';\r\n\r\nimport { isMobile } from '../../components/breakpoints';\r\n\r\nimport { GetCategoryFilterValuesInput } from '../../actions/eCommSelectedFilter/ecomm-get-selected-filter-criterias';\r\n\r\nimport { ITreeViewNode, IEcommSideBarFilterViewProps } from './ecomm-side-bar-filter';\r\n\r\n/**\r\n *\r\n * EcommSiteMenuView component\r\n * @extends {React.PureComponent}\r\n */\r\nexport class EcommSideBarFilterView extends React.PureComponent {\r\n public state: any = { width: 0, hasMounted: false, checked: [], expanded: [], selectedCategory: undefined };\r\n\r\n private _hasInitiated = false;\r\n\r\n public componentDidMount(): void {\r\n if (!this.state.hasMounted) { \r\n window.addEventListener('resize', this._updateDimensions);\r\n\r\n this.setState({ width: window.innerWidth, hasMounted: true });\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n if (!this.state.hasMounted) {\r\n return null;\r\n }\r\n\r\n const { config, filterNodes, totalProducts } = this.props;\r\n\r\n const mobileOptions: ITreeViewNode[] = [];\r\n const desktopOptions: ITreeViewNode[] = [];\r\n\r\n filterNodes.forEach(item => {\r\n if (this.state.selectedCategory) {\r\n if (item.value !== this.state.selectedCategory.value) {\r\n mobileOptions.push(item);\r\n }\r\n }\r\n\r\n desktopOptions.push(item);\r\n });\r\n\r\n if (isMobile(this.state.width)) {\r\n const displayName = this.state.selectedCategory ? this.state.selectedCategory.name : '';\r\n \r\n return (\r\n
\r\n \r\n {mobileOptions.map((item: ITreeViewNode, idx: number) =>\r\n {item.name}\r\n )}\r\n \r\n
\r\n );\r\n }\r\n\r\n const title = (window) && (window.sessionStorage.getItem('qFilter') !== null || window.sessionStorage.getItem('qFilter') !== undefined) ? window.sessionStorage.getItem('qFilter') : '';\r\n const count = `(${totalProducts} ` + `${config.productsText})`;\r\n\r\n return (\r\n
\r\n
\r\n

{title}

\r\n

{count}

\r\n
\r\n
\r\n {desktopOptions.map((item: ITreeViewNode, idx: number) => {\r\n const activeStyle = this.state.selectedCategory !== undefined && this.state.selectedCategory.value === item.value ? 'active' : '';\r\n\r\n return \r\n })}\r\n
\r\n
\r\n );\r\n }\r\n\r\n public componentWillUnmount() {\r\n window.removeEventListener('resize', this._updateDimensions);\r\n }\r\n\r\n public componentDidUpdate() {\r\n const { context, extendedNodes, filterNodes } = this.props;\r\n\r\n if (extendedNodes.length !== 0 && !this._hasInitiated) {\r\n const selected: string[] = [];\r\n\r\n selected.push(filterNodes[0].value);\r\n\r\n context.actionContext.update(new GetCategoryFilterValuesInput(), { filteredCategories: selected });\r\n\r\n this.setState({ selectedCategory: filterNodes[0] });\r\n\r\n this._hasInitiated = true;\r\n } else {\r\n if (this.state.selectedCategory) {\r\n const selected: string[] = [];\r\n\r\n selected.push(this.state.selectedCategory.value);\r\n \r\n context.actionContext.update(new GetCategoryFilterValuesInput(), { filteredCategories: selected });\r\n }\r\n }\r\n }\r\n\r\n private _onSelect = (event: any) => {\r\n const { filterNodes } = this.props;\r\n\r\n const result = filterNodes.find(item => item.value === event.currentTarget.value);\r\n\r\n if (result) {\r\n this.setState({ selectedCategory: result });\r\n }\r\n }\r\n\r\n private _onDropdownSelect = (event: any) => {\r\n const { filterNodes } = this.props;\r\n\r\n const result = filterNodes.find(item => item.value === event);\r\n\r\n if (result) {\r\n this.setState({ selectedCategory: result });\r\n }\r\n }\r\n\r\n private _updateDimensions = () => {\r\n this.setState({ width: window.innerWidth });\r\n }; \r\n}\r\n\r\nexport default EcommSideBarFilterView;","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['ecomm-side-bar-filter'] = {\n c: () => require('partner/modules/ecomm-side-bar-filter/ecomm-side-bar-filter.tsx'),\n $type: 'contentModule',\n da: [{name:'hierarchy', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-categories-hierarchy', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'ecomm-side-bar-filter',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/ecomm-side-bar-filter'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-categories-hierarchy';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-categories-hierarchy');\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|ecomm-side-bar-filter|ecomm-side-bar-filter'] = {\n c: () => require('partner/modules/ecomm-side-bar-filter/ecomm-side-bar-filter.view.tsx'),\n cn: '__local__-__local__-ecomm-side-bar-filter'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["GetCategoryFilterValuesInput","constructor","getCacheKey","getCacheObjectType","dataCacheType","Msdyn365","action","async","input","ctx","filteredCategories","id","args","Breakpoints","isMobile","width","large","EcommSideBarFilter","React","props","super","state","filterTreeNodesState","extendedNodes","totalProducts","this","_getFilerTreeDataStructure","catch","error","console","log","render","SideBarFilerViewProps","_objectSpread","filterNodes","renderView","extended","data","hierarchy","totalProductNumber","retObject","parentId","window","sessionStorage","getItem","parseInt","url","location","href","split","urlSplit","length","urlCategoryID","_hierarchy$result$fin","result","find","item","_item$Name","_this$props$config$ca","Name","toLowerCase","config","category","RecordId","promises","map","elem","_getCountByCategory","hasOwnProperty","child","Children","_addNode","Promise","all","then","setState","tree","node","newTreeNode","value","label","name","toString","push","children","categoryId","context","productSearchResult","ret","searchByCategoryAsync","callerContext","actionContext","request","apiSettings","channelId","catalogId","EcommSideBarFilterView","hasMounted","checked","expanded","selectedCategory","undefined","_hasInitiated","_onSelect","event","currentTarget","_onDropdownSelect","_updateDimensions","innerWidth","componentDidMount","addEventListener","mobileOptions","desktopOptions","forEach","displayName","className","DropdownButton","title","onSelect","idx","Dropdown","Item","key","eventKey","count","productsText","activeStyle","onClick","componentWillUnmount","removeEventListener","componentDidUpdate","selected","update","binding","modules","dataActions","c","require","$type","da","path","runOn","iNM","ns","n","p","pdp","md","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}