Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.156/page_editor/plugins/comments/components/ReplyCommentForm",["module","exports","require","@frontend-taglib-clay$clayui/button","frontend-js-web","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../../app/contexts/StoreContext","../../../app/thunks/addFragmentComment","./CommentForm"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function ReplyCommentForm({disabled:e,fragmentEntryLinkId:t,parentCommentId:r}){const[d,c]=(0,o.useState)(!1),[f,p]=(0,o.useState)(!1),[s,m]=(0,o.useState)(""),y=(0,i.useDispatch)();return o.default.createElement("div",{className:"mr-3 pb-2"},f?o.default.createElement(l.default,{autoFocus:!0,id:"pageEditorCommentReplyEditor_".concat(r),loading:d,onCancelButtonClick:()=>{p(!1),m("")},onSubmitButtonClick:()=>{c(!0),y((0,u.default)({body:s,fragmentEntryLinkId:t,parentCommentId:r})).then((()=>{c(!1),p(!1),m("")})).catch((()=>{(0,a.openToast)({message:Liferay.Language.get("the-reply-could-not-be-saved"),type:"danger"}),c(!1)}))},onTextareaChange:e=>e&&m(e),showButtons:!0,submitButtonLabel:Liferay.Language.get("reply"),textareaContent:s}):o.default.createElement(n.default,{borderless:!0,disabled:e,displayType:"secondary",onClick:()=>p(!0),size:"sm"},Liferay.Language.get("reply")))};var n=_interopRequireDefault(r("@frontend-taglib-clay$clayui/button")),a=r("frontend-js-web"),o=(_interopRequireDefault(r("liferay!frontend-js-react-web$prop-types")),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={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var o=n?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,t&&t.set(e,r);return r}(r("liferay!frontend-js-react-web$react"))),i=r("../../../app/contexts/StoreContext"),u=_interopRequireDefault(r("../../../app/thunks/addFragmentComment")),l=_interopRequireDefault(r("./CommentForm"));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}}}}));
//# sourceMappingURL=ReplyCommentForm.js.map