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,CACrCE,EAAGA,IAAMC,EAAQ,MACjBC,MAAO,gBACPC,GAAI,CAAC,CAACC,KAAK,UAAYC,KAAK,0EAA2EC,MAAO,IAE9GC,KAAK,EACLC,GAAI,YACJC,EAAG,qBACHC,EAAG,YAEHC,IAAK,GAGLC,GAAI,kCAlC4BC,EAACC,EAAqBC,KAUlD,GADAlB,EAAQE,YAAYe,GAAuBC,GACtClB,EAAQE,YAAYe,GAAqBE,QAC1C,MAAM,IAAIC,MAAM,oBAAsBH,EAAsB,mCAEhEjB,EAAQE,YAAYe,GAAqBE,QAAQE,UAAUC,eAAiBL,EACxEjB,EAAQE,YAAYe,GAAqBE,QAAQE,UAAUE,KAC3DvB,EAAQE,YAAYF,EAAQE,YAAYe,GAAqBE,QAAQE,UAAUE,IAAMN,IA0BzFD,CAF4B,0EACXZ,EAAQ,KAMjCoB,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,qEAAuE,CAC9FxB,EAAGA,IAAMC,EAAQ,MACjBwB,GAAI,0CAEpBJ,OAAOC,aAAeD,OAAOC,cAAgB,GAC7CD,OAAOC,aAAaE,eAAcD,EAAAA,EAAA,GACPF,OAAOC,aAAaE,gBAAkB,IACtCA,UCnF3BE,EAAOC,QAAU7C,cCAjB4C,EAAOC,QAAUC","sources":["webpack://henrys-ecommerce/./src/modules/bazzarvoice-widget/bazzarvoice-widget.tsx?3c89","webpack://henrys-ecommerce/./src/modules/bazzarvoice-widget/bazzarvoice-widget.view.tsx?2d6b","webpack://henrys-ecommerce/./src/modules/bazzarvoice-widget/components/Bazzarvoice.tsx?245f","webpack://henrys-ecommerce/./lib/bazzarvoice-widget/module-registration.js?a801","webpack://henrys-ecommerce/external var \"React\"?0d3b","webpack://henrys-ecommerce/external var \"ReactDOM\"?853b"],"sourcesContent":["import { IBazzarvoiceWidgetData } from './bazzarvoice-widget.data';\r\nimport { IBazzarvoiceWidgetProps } from './bazzarvoice-widget.props.autogenerated';\r\n\r\nexport interface IBazzarvoiceWidgetViewProps extends IBazzarvoiceWidgetProps {}\r\n\r\n/**\r\n *\r\n * BazzarvoiceWidget component\r\n * @extends {React.PureComponent>}\r\n */\r\nconst BazzarvoiceWidget = (props: IBazzarvoiceWidgetProps) => {\r\n return props.renderView(props);\r\n};\r\n\r\nexport default BazzarvoiceWidget;\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\nimport { IBazzarvoiceWidgetViewProps } from './bazzarvoice-widget';\r\nimport Bazzarvoice from './components/Bazzarvoice';\r\n\r\nexport default (props: IBazzarvoiceWidgetViewProps) => {\r\n const {\r\n data: { product },\r\n config\r\n } = props;\r\n\r\n const newProductSku = product.result?.ExtensionProperties?.find(ep => ep.Key === 'NewSku')?.Value?.StringValue?.split(':')[1];\r\n const itemId = newProductSku ?? product?.result?.ItemId;\r\n\r\n return ;\r\n};\r\n","import * as React from 'react';\r\nimport { widgetType as WidgetType } from '../bazzarvoice-widget.props.autogenerated';\r\nimport MsDyn365 from '@msdyn365-commerce/core';\r\nimport classnames from 'classnames';\r\n\r\ntype BazzarvoiceProps = {\r\n itemId?: string;\r\n widgetType?: WidgetType;\r\n className?: string;\r\n disableSeo?: boolean;\r\n};\r\n\r\nconst Bazzarvoice = (props: BazzarvoiceProps) => {\r\n const { itemId, widgetType, className, disableSeo } = props;\r\n const divRef = React.useRef(null);\r\n const [initialized, setInitialized] = React.useState(false);\r\n\r\n const isBrowser = MsDyn365.isBrowser;\r\n React.useEffect(() => {\r\n const div = divRef.current;\r\n if (!initialized && isBrowser && div && itemId && widgetType) {\r\n setInitialized(true);\r\n\r\n div.innerHTML = `
`;\r\n }\r\n }, [isBrowser, initialized, itemId, widgetType, disableSeo, divRef]);\r\n\r\n return (\r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default Bazzarvoice;\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['bazzarvoice-widget'] = {\n c: () => require('partner/modules/bazzarvoice-widget/bazzarvoice-widget.tsx'),\n $type: 'contentModule',\n da: [{name:'product', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant', runOn: 0}],\n \n iNM: false,\n ns: '__local__',\n n: 'bazzarvoice-widget',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/bazzarvoice-widget'\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 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|bazzarvoice-widget|bazzarvoice-widget'] = {\n c: () => require('partner/modules/bazzarvoice-widget/bazzarvoice-widget.view.tsx'),\n cn: '__local__-__local__-bazzarvoice-widget'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["props","renderView","_product$result","_product$result2","data","product","config","newProductSku","result","ExtensionProperties","find","ep","Key","Value","StringValue","split","itemId","ItemId","React","Bazzarvoice","widgetType","className","disableSeo","divRef","initialized","setInitialized","isBrowser","MsDyn365","div","current","innerHTML","classnames","ref","binding","modules","dataActions","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","id","window","__bindings__","_objectSpread","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}