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MAAM,oBAAsBH,EAAsB,mCAEhEJ,EAAQE,YAAYE,GAAqBE,QAAQE,UAAUC,eAAiBL,EACxEJ,EAAQE,YAAYE,GAAqBE,QAAQE,UAAUE,KAC3DV,EAAQE,YAAYF,EAAQE,YAAYE,GAAqBE,QAAQE,UAAUE,IAAMN,IAMhGJ,EAAQC,QAAQ,kBAAoB,CACjCU,EAAGA,IAAMC,EAAQ,MACjBC,MAAO,gBACPC,GAAI,CAAC,CAACC,KAAK,aAAeC,KAAK,8EAA+EC,MAAO,GAAG,CAACF,KAAK,oBAAsBC,KAAK,oFAAqFC,MAAO,IAErPC,KAAK,EACLC,GAAI,YACJC,EAAG,iBACHC,EAAG,YAEHC,IAAK,GAGLC,GAAI,8BAOApB,EAF4B,8EACXS,EAAQ,MAQzBT,EAF4B,oFACXS,EAAQ,MAMjCY,OAAOC,aAAeD,OAAOC,cAAgB,GAC7CD,OAAOC,aAAaxB,QAAOyB,EAAAA,EAAA,GACpBF,OAAOC,aAAaxB,SAAW,IAC/BD,EAAQC,SAGXuB,OAAOC,aAAavB,YAAWwB,EAAAA,EAAA,GAC5BF,OAAOC,aAAavB,aAAe,IACnCF,EAAQE,aAEY,MAAMyB,EAAiB,GAC9BA,EAAe,6DAA+D,CACtFhB,EAAGA,IAAMC,EAAQ,MACjBgB,GAAI,sCAEpBJ,OAAOC,aAAeD,OAAOC,cAAgB,GAC7CD,OAAOC,aAAaE,eAAcD,EAAAA,EAAA,GACPF,OAAOC,aAAaE,gBAAkB,IACtCA,UC1F3BE,EAAOC,QAAU3E,cCAjB0E,EAAOC,QAAUC","sources":["webpack://Dobbies.Commerce/./src/modules/dobbies-browse/dobbies-browse.tsx?bd3f","webpack://Dobbies.Commerce/./src/modules/dobbies-browse/dobbies-browse.view.tsx?e9ae","webpack://Dobbies.Commerce/./lib/dobbies-browse/module-registration.js?bc62","webpack://Dobbies.Commerce/external var \"React\"?0d3b","webpack://Dobbies.Commerce/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 React from 'react';\r\n\r\nimport { IDobbiesBrowseData } from './dobbies-browse.data';\r\nimport { IDobbiesBrowseProps } from './dobbies-browse.props.autogenerated';\r\n\r\nexport interface IDobbiesBrowseViewProps extends IDobbiesBrowseProps {}\r\n\r\n/**\r\n *\r\n * DobbiesBrowse component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass DobbiesBrowse extends React.PureComponent> {\r\n public render(): JSX.Element | null {\r\n return this.props.renderView(this.props);\r\n }\r\n}\r\n\r\nexport default DobbiesBrowse;\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 { CategoryHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport * as React from 'react';\r\nimport { IDobbiesBrowseViewProps } from './dobbies-browse';\r\n\r\nconst renderLinks = (category: CategoryHierarchy, props: IDobbiesBrowseViewProps): JSX.Element => {\r\n const recordId = props.context.request.urlTokens.recordId;\r\n const activeClass = recordId && +recordId === category.RecordId ? 'browse-active-link' : '';\r\n if (props.config.hideMenuItemPrefix && category.NeutralizedName?.startsWith(props.config.hideMenuItemPrefix)) {\r\n return <>;\r\n }\r\n return (\r\n
  • \r\n \r\n {category.Name}\r\n \r\n
  • \r\n );\r\n};\r\n/* VSI-Customization -- START\r\nWill render \"View All\" link and append the direct children of root link (children links based on rootLink(category ID))\r\n*/\r\nconst renderRootLink = (categories: JSX.Element[], category: CategoryHierarchy, makeActive: boolean): JSX.Element[] => {\r\n const active = makeActive ? 'browse-active-link' : '';\r\n const viewAll = (\r\n
  • \r\n \r\n View All\r\n \r\n
  • \r\n );\r\n return [viewAll, ...categories];\r\n};\r\n/* VSI-Customization -- END */\r\n\r\n/* VSI-Customization -- START Will render the categories based on selection */\r\nconst renderCategories = (props: IDobbiesBrowseViewProps): JSX.Element[][] | JSX.Element[] | undefined => {\r\n const results = props.data.categoryHierarchy.result;\r\n /* VSI-Customization -- START\r\n Render categories if parent doesn't exist\r\n */\r\n if (results && results.length === 1) {\r\n return results.map((cat: CategoryHierarchy) => {\r\n const categories = cat.Children.map(\r\n (category: CategoryHierarchy): JSX.Element => {\r\n return renderLinks(category, props);\r\n }\r\n );\r\n return renderRootLink(categories, cat, true);\r\n });\r\n }\r\n /* VSI-Customization -- END */\r\n\r\n /* VSI-Customization -- START\r\n Render Direct childrens of some category ID that has children categories\r\n */\r\n if (results && results.length === 2) {\r\n if (results[1].Children && results[1].Children.length > 0) {\r\n const categories = results[1].Children.map(\r\n (category: CategoryHierarchy): JSX.Element => {\r\n return renderLinks(category, props);\r\n }\r\n );\r\n return renderRootLink(categories, results[1], true);\r\n } else {\r\n // VSI CUSTOMIZATION - START - Edits Further Customization\r\n const urlID = Number(\r\n props.context.request.url.requestUrl.href\r\n .substring(props.context.request.url.requestUrl.href.lastIndexOf('/') + 1)\r\n .split('.')[0]\r\n );\r\n // VSI CUSTOMIZATION - END - Edits Further Customization\r\n const categories = results[0].Children.map(\r\n (category: CategoryHierarchy): JSX.Element => {\r\n // VSI CUSTOMIZATION - START - Edits Further Customization\r\n if (category.RecordId === urlID) {\r\n return renderLinks(category, props);\r\n } else {\r\n return
    ;\r\n }\r\n // VSI CUSTOMIZATION - END - Edits Further Customization\r\n }\r\n );\r\n return renderRootLink(categories, results[0], false);\r\n }\r\n }\r\n\r\n if (results && results.length === 3) {\r\n if (results[2].Children && results[2].Children.length > 0) {\r\n const categories = results[2].Children.map(\r\n (category: CategoryHierarchy): JSX.Element => {\r\n return renderLinks(category, props);\r\n }\r\n );\r\n return renderRootLink(categories, results[2], true);\r\n } else {\r\n const categories = results[1].Children.map(\r\n (category: CategoryHierarchy): JSX.Element => {\r\n return renderLinks(category, props);\r\n }\r\n );\r\n return renderRootLink(categories, results[1], false);\r\n }\r\n }\r\n\r\n if (results && results.length === 4) {\r\n if (results[3].Children && results[3].Children.length > 0) {\r\n const categories = results[3].Children.map(\r\n (category: CategoryHierarchy): JSX.Element => {\r\n return renderLinks(category, props);\r\n }\r\n );\r\n return renderRootLink(categories, results[3], true);\r\n } else {\r\n const categories = results[2].Children.map(\r\n (category: CategoryHierarchy): JSX.Element => {\r\n return renderLinks(category, props);\r\n }\r\n );\r\n return renderRootLink(categories, results[2], false);\r\n }\r\n }\r\n\r\n return;\r\n};\r\n/* VSI-Customization -- END *\r\n\r\n/* VSI-Customization -- END */\r\n\r\nexport default (props: IDobbiesBrowseViewProps) => {\r\n return
      {renderCategories(props)}
    ;\r\n};\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['dobbies-browse'] = {\n c: () => require('partner/modules/dobbies-browse/dobbies-browse.tsx'),\n $type: 'contentModule',\n da: [{name:'categories', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-categories-hierarchy', runOn: 0},{name:'categoryHierarchy', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-current-category-hierarchy', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'dobbies-browse',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/dobbies-browse'\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 const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-current-category-hierarchy';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-current-category-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|dobbies-browse|dobbies-browse'] = {\n c: () => require('partner/modules/dobbies-browse/dobbies-browse.view.tsx'),\n cn: '__local__-__local__-dobbies-browse'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["DobbiesBrowse","React","render","this","props","renderView","renderLinks","category","_category$Neutralized","recordId","context","request","urlTokens","activeClass","RecordId","config","hideMenuItemPrefix","NeutralizedName","startsWith","key","href","Url","className","Name","renderRootLink","categories","makeActive","active","results","data","categoryHierarchy","result","length","map","cat","Children","urlID","Number","url","requestUrl","substring","lastIndexOf","split","style","display","renderCategories","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","id","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","window","__bindings__","_objectSpread","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}