Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.132/page_editor/plugins/comments/components/FragmentEntryLinksWithComments",["module","exports","require","frontend-js-web","liferay!frontend-js-react-web$react","../../../app/config/constants/layoutDataItemTypes","../../../app/contexts/ControlsContext","../../../app/contexts/StoreContext","../../../common/components/SidebarPanelHeader","./NoCommentsMessage","./ResolvedCommentsToggle"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){const e=(0,s.useSelector)((e=>Object.values(e.layoutData.items).filter((e=>e.type===a.LAYOUT_DATA_ITEM_TYPES.fragment)).map((t=>[t,e.fragmentEntryLinks[t.config.fragmentEntryLinkId]])).map((([t,n])=>[t,g(g({},n),{},{comments:(n.comments||[]).filter((({resolved:t})=>e.showResolvedComments&&t||!t))})])).filter((([,e])=>e.comments.length))));return r.default.createElement(r.default.Fragment,null,r.default.createElement(m.default,null,Liferay.Language.get("comments")),r.default.createElement(u.default,null),e.length?r.default.createElement("nav",{className:"list-group mb-0 overflow-auto page-editor__fragments-with-comments"},e.map((([e,t])=>r.default.createElement(p,{fragmentEntryLink:t,item:e,key:t.fragmentEntryLinkId})))):r.default.createElement(c.default,null))};var o=n("frontend-js-web"),r=i(n("liferay!frontend-js-react-web$react")),a=n("../../../app/config/constants/layoutDataItemTypes"),l=n("../../../app/contexts/ControlsContext"),s=n("../../../app/contexts/StoreContext"),m=i(n("../../../common/components/SidebarPanelHeader")),c=i(n("./NoCommentsMessage")),u=i(n("./ResolvedCommentsToggle"));function i(e){return e&&e.__esModule?e:{default:e}}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p({fragmentEntryLink:e,item:t}){const n=(0,l.useSelectItem)(),a=(0,l.useHoverItem)();return r.default.createElement("button",{"aria-label":Liferay.Language.get("show-comments"),className:"border-0 flex-shrink-0 list-group-item list-group-item-action",onClick:()=>n(t.itemId),onFocus:()=>a(t.itemId),onMouseOut:()=>a(null),onMouseOver:()=>a(t.itemId),type:"button"},r.default.createElement("strong",{className:"d-block text-dark"},e.name),r.default.createElement("span",{className:"text-secondary"},(0,o.sub)(1===e.comments.length?Liferay.Language.get("x-comment"):Liferay.Language.get("x-comments"),e.comments.length)))}}}));
//# sourceMappingURL=FragmentEntryLinksWithComments.js.map