Liferay.Loader.define("@liferay/notification-web@1.0.35/js/components/ContentContainer/ContentContainer",["module","exports","require","@frontend-taglib-clay$clayui/core","@liferay/object-js-components-web","liferay!frontend-js-react-web$react","./Attachments","./DefinitionOfTerms","./FreeMarkerTemplateEditor"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function ContentContainer({baseResourceURL:t,editorConfig:r,selectedLocale:u,setSelectedLocale:s,setValues:f,values:d}){var p;const[b,y]=(0,o.useState)([]);return(0,o.useEffect)((()=>{(async()=>{const e=await n.API.getObjectDefinitions();y(e)})()}),[]),o.default.createElement(n.Card,{title:Liferay.Language.get("content")},o.default.createElement(a.Text,{as:"span",color:"secondary"},Liferay.Language.get("use-terms-to-populate-fields-dynamically-with-the-exception-of-the-freemarker-template-editor")),o.default.createElement(n.InputLocalized,_extends({},"userNotification"===d.type&&{component:"textarea"},{label:Liferay.Language.get("subject"),name:"subject",onChange:e=>{f(_objectSpread(_objectSpread({},d),{},{subject:e}))},placeholder:"",selectedLocale:u,translations:d.subject})),"email"===d.type&&o.default.createElement(o.default.Fragment,null,o.default.createElement(n.SingleSelect,{label:Liferay.Language.get("editor-type"),onChange:({value:e})=>{f(_objectSpread(_objectSpread({},d),{},{editorType:e}))},options:e,required:!0,value:null===(p=e.find((({value:e})=>e===d.editorType)))||void 0===p?void 0:p.label}),"richText"===d.editorType?o.default.createElement(n.RichTextLocalized,{editorConfig:r,label:Liferay.Language.get("template"),name:"template",onSelectedLocaleChange:({label:e})=>s(e),onTranslationsChange:e=>{f(_objectSpread(_objectSpread({},d),{},{body:e}))},selectedLocale:u,translations:d.body}):o.default.createElement(o.default.Fragment,null,o.default.createElement(i.FreeMarkerTemplateEditor,{baseResourceURL:t,objectDefinitions:b,selectedLocale:u,setSelectedLocale:s,setValues:f,values:d}),o.default.createElement(a.Text,{as:"span",color:"secondary",size:3},Liferay.Language.get("object-terms-cannot-be-used-in-freemarker-templates")))),o.default.createElement(c.DefinitionOfTerms,{baseResourceURL:t,objectDefinitions:b}),"email"===d.type&&o.default.createElement(l.Attachments,{setValues:f,values:d}))};var a=r("@frontend-taglib-clay$clayui/core"),n=r("@liferay/object-js-components-web"),o=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 r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=a?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react")),l=r("./Attachments"),c=r("./DefinitionOfTerms"),i=r("./FreeMarkerTemplateEditor");function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _extends(){return(_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const e=[{label:Liferay.Language.get("freemarker-template"),value:"freeMarker"},{label:Liferay.Language.get("rich-text"),value:"richText"}]}}));
//# sourceMappingURL=ContentContainer.js.map