Liferay.Loader.define("layout-admin-web@5.0.150/js/ThemeCSSReplacementSelector",["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 ThemeCSSReplacementSelector({isReadOnly:e,placeholder:t,portletNamespace:a,selectThemeCSSClientExtensionEventName:i,selectThemeCSSClientExtensionURL:o,themeCSSCETExternalReferenceCode:u,themeCSSExtensionName:d}){const[f,s]=(0,c.useState)(d),[y,m]=(0,c.useState)(u),onClick=()=>{e||(0,r.openSelectionModal)({onSelect:e=>{const t=JSON.parse(e.value);m(t.cetExternalReferenceCode),s(t.name)},selectEventName:i,title:Liferay.Language.get("select-theme-css-client-extension"),url:o})};return c.default.createElement(c.default.Fragment,null,c.default.createElement("p",{className:"text-secondary"},Liferay.Language.get("use-this-client-extension-to-fully-replace-the-default-css-contained-in-the-theme")),c.default.createElement(l.ClayInput,{name:"".concat(a,"themeCSSCETExternalReferenceCode"),type:"hidden",value:y}),c.default.createElement(l.default.Group,null,c.default.createElement("label",{htmlFor:"".concat(a,"themeCSSReplacementExtension")},Liferay.Language.get("theme-css")),c.default.createElement(l.ClayInput.Group,null,c.default.createElement(l.ClayInput.GroupItem,null,c.default.createElement(l.ClayInput,{id:"".concat(a,"themeCSSReplacementExtension"),onClick:onClick,placeholder:t,readOnly:!0,type:"text",value:f})),c.default.createElement(l.ClayInput.GroupItem,{shrink:!0},f?c.default.createElement(c.default.Fragment,null,c.default.createElement(n.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("replace"),className:"c-mr-2",disabled:e,displayType:"secondary",onClick:onClick,symbol:"change"}),c.default.createElement(n.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("delete"),disabled:e,displayType:"secondary",onClick:()=>{s(""),m("")},symbol:"trash"})):c.default.createElement(n.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("select"),disabled:e,displayType:"secondary",onClick:onClick,symbol:"plus"})))))};var n=a("@frontend-taglib-clay$clayui/button"),l=_interopRequireWildcard(a("@frontend-taglib-clay$clayui/form")),r=a("frontend-js-web"),c=_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=ThemeCSSReplacementSelector.js.map