Liferay.Loader.define("layout-admin-web@5.0.145/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({placeholder:e,portletNamespace:t,selectThemeCSSClientExtensionEventName:a,selectThemeCSSClientExtensionURL:o,themeCSSCETExternalReferenceCode:u,themeCSSExtensionName:i}){const[d,f]=(0,c.useState)(i),[s,y]=(0,c.useState)(u),onClick=()=>{(0,r.openSelectionModal)({onSelect:e=>{const t=JSON.parse(e.value);y(t.cetExternalReferenceCode),f(t.name)},selectEventName:a,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(t,"themeCSSCETExternalReferenceCode"),type:"hidden",value:s}),c.default.createElement(l.default.Group,null,c.default.createElement("label",{htmlFor:"".concat(t,"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(t,"themeCSSReplacementExtension"),onClick:onClick,placeholder:e,readOnly:!0,type:"text",value:d})),c.default.createElement(l.ClayInput.GroupItem,{shrink:!0},d?c.default.createElement(c.default.Fragment,null,c.default.createElement(n.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("replace"),className:"c-mr-2",displayType:"secondary",onClick:onClick,symbol:"change"}),c.default.createElement(n.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("delete"),displayType:"secondary",onClick:()=>{f(""),y("")},symbol:"trash"})):c.default.createElement(n.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("select"),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