Liferay.Loader.define("@liferay/frontend-icons-web@1.0.18/js/pages/site_settings/index",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","@frontend-taglib-clay$clayui/icon","@frontend-taglib-clay$clayui/layout","@frontend-taglib-clay$clayui/panel","liferay!frontend-js-react-web$react","../../index","./AddIconPackModal"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function SiteIconPackConfiguration({allIconResourcePacks:e,portletNamespace:t,saveSiteIconPacksURL:a,siteIconResourcePacks:f}){const[d,p]=(0,i.useState)(f),[y,g]=(0,i.useState)(""),[m,b]=(0,i.useState)(!1),j=Object.keys(e),O=(0,i.useMemo)((()=>j.reduce(((t,a)=>_objectSpread(_objectSpread({},t),{},{[a]:_objectSpread(_objectSpread({},e[a]),{},{icons:e[a].icons.filter((e=>Object.keys(e).length)).filter((e=>e.name.toLowerCase().includes(y.toLowerCase())))})})),{})),[j,e,y]),w=(0,i.useMemo)((()=>(new Date).getTime()),[e]);return i.default.createElement(i.default.Fragment,null,i.default.createElement(c.default.ContentRow,{containerElement:"p"},Liferay.Language.get("icons-spritemap-path-at")),i.default.createElement(c.default.ContentRow,{className:"mb-2",containerElement:"code"},"/o/icons/site/".concat(Liferay.ThemeDisplay.getSiteGroupId(),".svg")),i.default.createElement("label",{className:"form-control-label"},i.default.createElement("span",{className:"form-control-label-text"},Liferay.Language.get("search-available-icons")),i.default.createElement(n.ClayInput,{onChange:e=>g(e.target.value),onKeyPress:e=>"Enter"===e.key&&e.preventDefault(),placeholder:Liferay.Language.get("search-available-icons"),type:"text",value:y})),i.default.createElement(o.default.Group,{className:"mt-4"},i.default.createElement("span",{className:"form-control-label-text"},Liferay.Language.get("available-icon-packs")),j.filter((e=>d.includes(e))).map((e=>{var t;return i.default.createElement("div",{className:"d-flex",key:e},i.default.createElement(o.default,{collapsable:!0,displayTitle:"".concat(e," (").concat(null===(t=O[e])||void 0===t?void 0:t.icons.length,")"),displayType:"secondary",showCollapseIcon:!0,style:{flex:1}},i.default.createElement(o.default.Body,{className:"list-group-card"},i.default.createElement("ul",{className:"list-group"},O[e].icons.sort().map((t=>i.default.createElement("li",{className:"list-group-card-item w-25",key:t.name},i.default.createElement(l.default,{spritemap:"".concat((0,u.getSpritemap)(e),"?").concat(w),symbol:t.name}),i.default.createElement("span",{className:"list-group-card-item-text"},t.name)))),!O[e].icons.length&&i.default.createElement("li",{className:"list-group-card-item w-100"},Liferay.Language.get("no-results-found"))))))}))),i.default.createElement(c.default.SheetFooter,null,i.default.createElement(r.default,{onClick:()=>b(!0)},Liferay.Language.get("select-icon-packs"))),m&&i.default.createElement(s.default,{icons:e,onSelectedPacksChange:p,onVisibleChange:b,portletNamespace:t,saveSiteSettingsURL:a,selectedPacks:d,visible:m}))};var r=_interopRequireDefault(a("@frontend-taglib-clay$clayui/button")),n=a("@frontend-taglib-clay$clayui/form"),l=_interopRequireDefault(a("@frontend-taglib-clay$clayui/icon")),c=_interopRequireDefault(a("@frontend-taglib-clay$clayui/layout")),o=_interopRequireDefault(a("@frontend-taglib-clay$clayui/panel")),i=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var a={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var l=r?Object.getOwnPropertyDescriptor(e,n):null;l&&(l.get||l.set)?Object.defineProperty(a,n,l):a[n]=e[n]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react")),u=a("../../index"),s=_interopRequireDefault(a("./AddIconPackModal"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ownKeys(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(a),!0).forEach((function(t){_defineProperty(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):ownKeys(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function _defineProperty(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}}}));
//# sourceMappingURL=index.js.map