"use strict"; /* React-Quill https://github.com/zenoamaro/react-quill */ var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __spreadArrays = (this && this.__spreadArrays) || function () { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; var react_1 = __importDefault(require("react")); var react_dom_1 = __importDefault(require("react-dom")); var isEqual_1 = __importDefault(require("lodash/isEqual")); var quill_1 = __importDefault(require("quill")); var ReactQuill = /** @class */ (function (_super) { __extends(ReactQuill, _super); function ReactQuill(props) { var _this = _super.call(this, props) || this; /* Changing one of these props should cause a full re-render and a re-instantiation of the Quill editor. */ _this.dirtyProps = [ 'modules', 'formats', 'bounds', 'theme', 'children', ]; /* Changing one of these props should cause a regular update. These are mostly props that act on the container, rather than the quillized editing area. */ _this.cleanProps = [ 'id', 'className', 'style', 'placeholder', 'tabIndex', 'onChange', 'onChangeSelection', 'onFocus', 'onBlur', 'onKeyPress', 'onKeyDown', 'onKeyUp', ]; _this.state = { generation: 0, }; /* Tracks the internal selection of the Quill editor */ _this.selection = null; _this.onEditorChange = function (eventName, rangeOrDelta, oldRangeOrDelta, source) { var _a, _b, _c, _d; if (eventName === 'text-change') { (_b = (_a = _this).onEditorChangeText) === null || _b === void 0 ? void 0 : _b.call(_a, _this.editor.root.innerHTML, rangeOrDelta, source, _this.unprivilegedEditor); } else if (eventName === 'selection-change') { (_d = (_c = _this).onEditorChangeSelection) === null || _d === void 0 ? void 0 : _d.call(_c, rangeOrDelta, source, _this.unprivilegedEditor); } }; var value = _this.isControlled() ? props.value : props.defaultValue; _this.value = (value !== null && value !== void 0 ? value : ''); return _this; } ReactQuill.prototype.validateProps = function (props) { var _a; if (react_1.default.Children.count(props.children) > 1) throw new Error('The Quill editing area can only be composed of a single React element.'); if (react_1.default.Children.count(props.children)) { var child = react_1.default.Children.only(props.children); if (((_a = child) === null || _a === void 0 ? void 0 : _a.type) === 'textarea') throw new Error('Quill does not support editing on a