Liferay.Loader.define("@liferay/object-js-components-web@1.0.58/components/CodeEditor/CodeMirrorEditor",["module","exports","require","liferay!object-js-components-web$codemirror/addon/display/autorefresh","liferay!object-js-components-web$codemirror/addon/fold/foldgutter","liferay!object-js-components-web$codemirror/addon/fold/foldgutter.css","liferay!object-js-components-web$codemirror/addon/display/placeholder","liferay!object-js-components-web$codemirror/lib/codemirror.css","liferay!object-js-components-web$codemirror","liferay!frontend-js-react-web$react","./CodeMirrorEditor.scss"],(function(e,r,t){window;{Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,t("liferay!object-js-components-web$codemirror/addon/display/autorefresh"),t("liferay!object-js-components-web$codemirror/addon/fold/foldgutter"),t("liferay!object-js-components-web$codemirror/addon/fold/foldgutter.css"),t("liferay!object-js-components-web$codemirror/addon/display/placeholder"),t("liferay!object-js-components-web$codemirror/lib/codemirror.css");var o=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(t("liferay!object-js-components-web$codemirror")),n=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=_getRequireWildcardCache();if(r&&r.has(e))return r.get(e);var t={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var c=o?Object.getOwnPropertyDescriptor(e,n):null;c&&(c.get||c.set)?Object.defineProperty(t,n,c):t[n]=e[n]}t.default=e,r&&r.set(e,t);return t}(t("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 ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function _defineProperty(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _objectWithoutProperties(e,r){if(null==e)return{};var t,o,n=function _objectWithoutPropertiesLoose(e,r){if(null==e)return{};var t,o,n={},c=Object.keys(e);for(o=0;o<c.length;o++)t=c[o],r.indexOf(t)>=0||(n[t]=e[t]);return n}(e,r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(o=0;o<c.length;o++)t=c[o],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(n[t]=e[t])}return n}t("./CodeMirrorEditor.scss");const e=n.default.forwardRef(((e,r)=>{let{mode:t,onChange:c}=e,i=_objectWithoutProperties(e,["mode","onChange"]);const d=(0,n.useRef)(null),a=(0,n.useRef)();return(0,n.useEffect)((()=>{const e=(0,o.default)(d.current,function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach((function(r){_defineProperty(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}({autoRefresh:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],inputStyle:"contenteditable",lineNumbers:!0,mode:null!=t?t:"freemarker"},i));a.current=e,r instanceof Function?r(e):r&&(r.current=e);const handleChange=e=>{c(e.getValue(),e.lineCount())};return e.on("change",handleChange),()=>e.off("change",handleChange)}),[]),n.default.createElement("div",{className:"lfr-objects__editor",ref:d})}));var c=n.default.memo(e);r.default=c}}));
//# sourceMappingURL=CodeMirrorEditor.js.map