Liferay.Loader.define("layout-admin-web@5.0.146/js/layout/look_and_feel/Favicon",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","frontend-js-web","liferay!frontend-js-react-web$react"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function Favicon({clearButtonEnabled:e,defaultImgURL:t,defaultTitle:a,faviconFileEntryId:c,imgURL:o,isReadOnly:d,portletNamespace:u,themeFaviconCETExternalReferenceCode:f,title:y,url:s}){const onChangeFaviconButtonClick=()=>{d||(0,r.openSelectionModal)({iframeBodyCssClass:"",onSelect(e){if(e&&e&&e.value){const t=JSON.parse(e.value),a={};"com.liferay.client.extension.type.item.selector.CETItemSelectorReturnType"===e.returnType?(a.faviconFileEntryId=0,a.themeFaviconCETExternalReferenceCode=t.cetExternalReferenceCode):(a.faviconFileEntryId=t.fileEntryId,a.themeFaviconCETExternalReferenceCode=""),t.url&&(a.imgURL=t.url),a.title=t.title||t.name,a.clearButtonEnabled=!0,g(a)}},selectEventName:"".concat(u,"selectImage"),title:Liferay.Language.get("select-favicon"),url:s.toString()})},[m,g]=(0,i.useState)({clearButtonEnabled:e,faviconFileEntryId:c,imgURL:o,themeFaviconCETExternalReferenceCode:f,title:y});return i.default.createElement(i.default.Fragment,null,i.default.createElement(l.ClayInput,{name:"".concat(u,"themeFaviconCETExternalReferenceCode"),type:"hidden",value:m.themeFaviconCETExternalReferenceCode}),i.default.createElement(l.ClayInput,{name:"".concat(u,"faviconFileEntryId"),type:"hidden",value:m.faviconFileEntryId}),m.imgURL&&i.default.createElement("img",{alt:m.title,className:"c-mb-2",height:"16",src:m.imgURL,width:"16"}),i.default.createElement(l.default.Group,null,i.default.createElement("label",{htmlFor:"".concat(u,"basicInputText")},Liferay.Language.get("favicon")),i.default.createElement("div",{className:"d-flex"},i.default.createElement(l.ClayInput,{className:"c-mr-2",id:"".concat(u,"basicInputText"),onClick:onChangeFaviconButtonClick,readOnly:!0,value:m.title}),i.default.createElement(n.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("select-favicon"),className:"c-mr-2 flex-shrink-0",disabled:d,displayType:"secondary",onClick:onChangeFaviconButtonClick,symbol:"change",title:Liferay.Language.get("select-favicon")}),i.default.createElement(n.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("clear-favicon"),className:"flex-shrink-0",disabled:!m.clearButtonEnabled||d,displayType:"secondary",onClick:()=>{d||g({clearButtonEnabled:!1,faviconFileEntryId:0,imgURL:t,themeFaviconCETExternalReferenceCode:"",title:a})},symbol:"times-circle",title:Liferay.Language.get("clear-favicon")}))))};var n=a("@frontend-taglib-clay$clayui/button"),l=_interopRequireWildcard(a("@frontend-taglib-clay$clayui/form")),r=a("frontend-js-web"),i=_interopRequireWildcard(a("liferay!frontend-js-react-web$react"));function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}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={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){var r=n?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(a,l,r):a[l]=e[l]}return a.default=e,t&&t.set(e,a),a}}}));
//# sourceMappingURL=Favicon.js.map